From c99a1261d5dc5b1c0b2d85096bd63b56d036551e Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 16 Nov 2016 11:54:17 +0200 Subject: [PATCH] lead industry field --- .../Crm/Resources/i18n/en_US/Lead.json | 3 +- .../Crm/Resources/layouts/Lead/detail.json | 1 + .../Crm/Resources/layouts/Lead/filters.json | 1 + .../Resources/metadata/entityDefs/Lead.json | 7 ++++ .../crm/src/views/lead/fields/industry.js | 42 +++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 client/modules/crm/src/views/lead/fields/industry.js diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json index 685e69cdc3..67bf0404f1 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json @@ -23,7 +23,8 @@ "createdOpportunity": "Opportunity", "campaign": "Campaign", "targetLists": "Target Lists", - "targetList": "Target List" + "targetList": "Target List", + "industry": "Industry" }, "links": { "targetLists": "Target Lists", diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json index 6fde5d1bac..51a6c3a786 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json @@ -13,6 +13,7 @@ "rows": [ [{"name":"status"},{"name":"source"}], [{"name":"opportunityAmount"},{"name":"campaign"}], + [false, {"name":"industry"}], [{"name":"description", "fullWidth": true}] ] } diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json index 061bcfaaf0..aba17ffe48 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json @@ -8,6 +8,7 @@ "status", "source", "opportunityAmountConverted", + "industry", "phoneNumber", "targetLists", "teams", diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json index bbb443a329..f59cb8df2c 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json @@ -39,6 +39,13 @@ "options": ["", "Call", "Email", "Existing Customer", "Partner", "Public Relations", "Web Site", "Campaign", "Other"], "default": "" }, + "industry": { + "type": "enum", + "view": "crm:views/lead/fields/industry", + "customizationOptionsDisabled": true, + "default": "", + "isSorted": true + }, "opportunityAmount": { "type": "currency", "audited": true diff --git a/client/modules/crm/src/views/lead/fields/industry.js b/client/modules/crm/src/views/lead/fields/industry.js new file mode 100644 index 0000000000..feb478cea3 --- /dev/null +++ b/client/modules/crm/src/views/lead/fields/industry.js @@ -0,0 +1,42 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko + * Website: http://www.espocrm.com + * + * EspoCRM is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * EspoCRM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with EspoCRM. If not, see http://www.gnu.org/licenses/. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. + ************************************************************************/ + +Espo.define('crm:views/lead/fields/industry', 'views/fields/enum', function (Dep) { + + return Dep.extend({ + + setup: function () { + this.params.options = this.getMetadata().get('entityDefs.Account.fields.industry.options'); + this.params.translation = 'Account.options.industry'; + + Dep.prototype.setup.call(this); + } + + }); + +});