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 d8df8265d7..2b71c0a167 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json @@ -25,7 +25,8 @@ "targetLists": "Target Lists", "targetList": "Target List", "industry": "Industry", - "acceptanceStatus": "Acceptance Status" + "acceptanceStatus": "Acceptance Status", + "opportunityAmountCurrency": "Opportunity Amount Currency" }, "links": { "targetLists": "Target Lists", diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json index abfdb40fae..cb1d935d81 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json @@ -13,7 +13,8 @@ "amountConverted": "Amount (converted)", "amountWeightedConverted": "Amount Weighted", "campaign": "Campaign", - "originalLead": "Original Lead" + "originalLead": "Original Lead", + "amountCurrency": "Amount Currency" }, "links": { "contacts": "Contacts", diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/TargetList.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/TargetList.json index b9b4bc1dcf..6b3ce2bd5e 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/TargetList.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/TargetList.json @@ -10,6 +10,9 @@ } ] }, + "recordViews": { + "detail": "crm:views/target-list/record/detail" + }, "relationshipPanels": { "contacts": { "actionList": [ diff --git a/client/modules/crm/src/views/target-list/record/detail.js b/client/modules/crm/src/views/target-list/record/detail.js new file mode 100644 index 0000000000..35f917bb25 --- /dev/null +++ b/client/modules/crm/src/views/target-list/record/detail.js @@ -0,0 +1,46 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2017 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/target-list/record/detail', 'views/record/detail', function (Dep) { + + return Dep.extend({ + + setup: function () { + Dep.prototype.setup.call(this); + this.listenTo(this.model, 'after:relate', function () { + this.model.fetch(); + }, this); + + this.listenTo(this.model, 'after:unrelate', function () { + this.model.fetch(); + }, this); + } + + }); +}); + diff --git a/client/src/views/record/panels/relationship.js b/client/src/views/record/panels/relationship.js index 27fccd07c6..d0c0d8a59a 100644 --- a/client/src/views/record/panels/relationship.js +++ b/client/src/views/record/panels/relationship.js @@ -286,27 +286,27 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' actionUnlinkRelated: function (data) { var id = data.id; - var self = this; this.confirm({ message: this.translate('unlinkRecordConfirmation', 'messages'), confirmText: this.translate('Unlink') }, function () { var model = this.collection.get(id); - self.notify('Unlinking...'); + this.notify('Unlinking...'); $.ajax({ - url: self.collection.url, + url: this.collection.url, type: 'DELETE', data: JSON.stringify({ id: id }), contentType: 'application/json', success: function () { - self.notify('Unlinked', 'success'); - self.collection.fetch(); - }, + this.notify('Unlinked', 'success'); + this.collection.fetch(); + this.model.trigger('after:unrelate'); + }.bind(this), error: function () { - self.notify('Error occurred', 'error'); - }, + this.notify('Error occurred', 'error'); + }.bind(this), }); }, this); }, @@ -314,18 +314,18 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' actionRemoveRelated: function (data) { var id = data.id; - var self = this; this.confirm({ message: this.translate('removeRecordConfirmation', 'messages'), confirmText: this.translate('Remove') }, function () { var model = this.collection.get(id); - self.notify('Removing...'); + this.notify('Removing...'); model.destroy({ success: function () { - self.notify('Removed', 'success'); - self.collection.fetch(); - }, + this.notify('Removed', 'success'); + this.collection.fetch(); + this.model.trigger('after:unrelate'); + }.bind(this), }); }, this); }, @@ -344,6 +344,7 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' this.notify(false); this.notify('Unlinked', 'success'); this.collection.fetch(); + this.model.trigger('after:unrelate'); }.bind(this)); }, this); },