diff --git a/client/modules/crm/src/views/calendar/calendar.js b/client/modules/crm/src/views/calendar/calendar.js index 80075e14db..2b024871d0 100644 --- a/client/modules/crm/src/views/calendar/calendar.js +++ b/client/modules/crm/src/views/calendar/calendar.js @@ -1100,7 +1100,7 @@ class CalendarView extends View { addModel(model) { let d = model.getClonedAttributes(); - d.scope = model.name; + d.scope = model.entityType; let event = this.convertToFcEvent(d); @@ -1108,7 +1108,7 @@ class CalendarView extends View { } updateModel(model) { - let eventId = model.name + '-' + model.id; + let eventId = model.entityType + '-' + model.id; let event = this.calendar.getEventById(eventId); @@ -1118,7 +1118,7 @@ class CalendarView extends View { let attributes = model.getClonedAttributes(); - attributes.scope = model.name; + attributes.scope = model.entityType; let data = this.convertToFcEvent(attributes); @@ -1181,7 +1181,7 @@ class CalendarView extends View { } removeModel(model) { - let event = this.calendar.getEventById(model.name + '-' + model.id); + let event = this.calendar.getEventById(model.entityType + '-' + model.id); if (!event) { return; diff --git a/client/modules/crm/src/views/call/record/row-actions/dashlet.js b/client/modules/crm/src/views/call/record/row-actions/dashlet.js index b246143be6..58bebf6fb7 100644 --- a/client/modules/crm/src/views/call/record/row-actions/dashlet.js +++ b/client/modules/crm/src/views/call/record/row-actions/dashlet.js @@ -57,7 +57,7 @@ define('crm:views/call/record/row-actions/dashlet', ['views/record/row-actions/v label: 'Remove', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); } diff --git a/client/modules/crm/src/views/call/record/row-actions/default.js b/client/modules/crm/src/views/call/record/row-actions/default.js index 402cd74282..954d4bd09d 100644 --- a/client/modules/crm/src/views/call/record/row-actions/default.js +++ b/client/modules/crm/src/views/call/record/row-actions/default.js @@ -56,7 +56,7 @@ define('crm:views/call/record/row-actions/default', ['views/record/row-actions/v label: 'Remove', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); } diff --git a/client/modules/crm/src/views/lead/convert.js b/client/modules/crm/src/views/lead/convert.js index edbd7f0f83..e9610ca5ce 100644 --- a/client/modules/crm/src/views/lead/convert.js +++ b/client/modules/crm/src/views/lead/convert.js @@ -35,7 +35,7 @@ define('crm:views/lead/convert', ['view'], function (Dep) { data: function () { return { scopeList: this.scopeList, - scope: this.model.name, + scope: this.model.entityType, }; }, diff --git a/client/modules/crm/src/views/lead/detail.js b/client/modules/crm/src/views/lead/detail.js index 92d884b39c..d40dac29ce 100644 --- a/client/modules/crm/src/views/lead/detail.js +++ b/client/modules/crm/src/views/lead/detail.js @@ -56,7 +56,7 @@ define('crm:views/lead/detail', ['views/detail'], function (Dep) { }, actionConvert: function () { - this.getRouter().navigate(this.model.name + '/convert/' + this.model.id , {trigger: true}); + this.getRouter().navigate(this.model.entityType + '/convert/' + this.model.id , {trigger: true}); }, }); }); diff --git a/client/modules/crm/src/views/meeting/fields/reminders.js b/client/modules/crm/src/views/meeting/fields/reminders.js index e82bca187c..b8313c0620 100644 --- a/client/modules/crm/src/views/meeting/fields/reminders.js +++ b/client/modules/crm/src/views/meeting/fields/reminders.js @@ -71,7 +71,7 @@ function (Dep, /** module:ui/select*/Select, moment) { }, setup: function () { - if (this.model.isNew() && !this.model.get(this.name) && this.model.name !== 'Preferences') { + if (this.model.isNew() && !this.model.get(this.name) && this.model.entityType !== 'Preferences') { this.reminderList = this.getPreferences().get('defaultReminders') || []; } else { this.reminderList = this.model.get(this.name) || []; diff --git a/client/modules/crm/src/views/meeting/record/row-actions/dashlet.js b/client/modules/crm/src/views/meeting/record/row-actions/dashlet.js index aaece87105..a6f6f32e95 100644 --- a/client/modules/crm/src/views/meeting/record/row-actions/dashlet.js +++ b/client/modules/crm/src/views/meeting/record/row-actions/dashlet.js @@ -35,7 +35,7 @@ define('crm:views/meeting/record/row-actions/dashlet', ['views/record/row-action actionList.forEach(item => { item.data = item.data || {}; - item.data.scope = this.model.name; + item.data.scope = this.model.entityType; }); if (this.options.acl.edit && !~['Held', 'Not Held'].indexOf(this.model.get('status'))) { @@ -44,7 +44,7 @@ define('crm:views/meeting/record/row-actions/dashlet', ['views/record/row-action label: 'Set Held', data: { id: this.model.id, - scope: this.model.name, + scope: this.model.entityType, } }); @@ -53,7 +53,7 @@ define('crm:views/meeting/record/row-actions/dashlet', ['views/record/row-action label: 'Set Not Held', data: { id: this.model.id, - scope: this.model.name, + scope: this.model.entityType, } }); } @@ -64,7 +64,7 @@ define('crm:views/meeting/record/row-actions/dashlet', ['views/record/row-action label: 'Remove', data: { id: this.model.id, - scope: this.model.name, + scope: this.model.entityType, } }); } diff --git a/client/modules/crm/src/views/meeting/record/row-actions/default.js b/client/modules/crm/src/views/meeting/record/row-actions/default.js index 5d0c4069f8..5f6225b3e2 100644 --- a/client/modules/crm/src/views/meeting/record/row-actions/default.js +++ b/client/modules/crm/src/views/meeting/record/row-actions/default.js @@ -35,7 +35,7 @@ define('crm:views/meeting/record/row-actions/default', ['views/record/row-action actionList.forEach(item => { item.data = item.data || {}; - item.data.scope = this.model.name; + item.data.scope = this.model.entityType; }); if (this.options.acl.edit && !~['Held', 'Not Held'].indexOf(this.model.get('status'))) { @@ -44,7 +44,7 @@ define('crm:views/meeting/record/row-actions/default', ['views/record/row-action label: 'Set Held', data: { id: this.model.id, - scope: this.model.name, + scope: this.model.entityType, } }); @@ -53,7 +53,7 @@ define('crm:views/meeting/record/row-actions/default', ['views/record/row-action label: 'Set Not Held', data: { id: this.model.id, - scope: this.model.name, + scope: this.model.entityType, } }); } @@ -64,7 +64,7 @@ define('crm:views/meeting/record/row-actions/default', ['views/record/row-action label: 'Remove', data: { id: this.model.id, - scope: this.model.name, + scope: this.model.entityType, } }); } diff --git a/client/modules/crm/src/views/record/panels/activities.js b/client/modules/crm/src/views/record/panels/activities.js index 75a0b73081..d1d46831cd 100644 --- a/client/modules/crm/src/views/record/panels/activities.js +++ b/client/modules/crm/src/views/record/panels/activities.js @@ -98,7 +98,7 @@ define('crm:views/record/panels/activities', } }); - this.url = this.serviceName + '/' + this.model.name + '/' + this.model.id + '/' + this.name; + this.url = this.serviceName + '/' + this.model.entityType + '/' + this.model.id + '/' + this.name; this.seeds = {}; @@ -226,8 +226,8 @@ define('crm:views/record/panels/activities', o.data.scope = scope; if ( - this.model.name !== 'User' && - !this.checkParentTypeAvailability(scope, this.model.name) + this.model.entityType !== 'User' && + !this.checkParentTypeAvailability(scope, this.model.entityType) ) { return; } @@ -378,7 +378,7 @@ define('crm:views/record/panels/activities', status: data.status, }; - if (this.model.name === 'User') { + if (this.model.entityType === 'User') { if (this.model.isPortal()) { attributes.usersIds = [this.model.id]; @@ -392,7 +392,7 @@ define('crm:views/record/panels/activities', } } else { - if (this.model.name === 'Contact') { + if (this.model.entityType === 'Contact') { if (this.model.get('accountId') && !this.getConfig().get('b2cMode')) { attributes.parentType = 'Account'; attributes.parentId = this.model.get('accountId'); @@ -408,21 +408,21 @@ define('crm:views/record/panels/activities', } } } - else if (this.model.name === 'Lead') { + else if (this.model.entityType === 'Lead') { attributes.parentType = 'Lead'; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } - if (this.model.name !== 'Account' && this.model.has('contactsIds')) { + if (this.model.entityType !== 'Account' && this.model.has('contactsIds')) { attributes.contactsIds = this.model.get('contactsIds'); attributes.contactsNames = this.model.get('contactsNames'); } if (scope) { if (!attributes.parentId) { - if (this.checkParentTypeAvailability(scope, this.model.name)) { - attributes.parentType = this.model.name; + if (this.checkParentTypeAvailability(scope, this.model.entityType)) { + attributes.parentType = this.model.entityType; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } @@ -509,7 +509,7 @@ define('crm:views/record/panels/activities', to: this.model.get('emailAddress') }; - if (this.model.name === 'Contact') { + if (this.model.entityType === 'Contact') { if (this.getConfig().get('b2cMode')) { attributes.parentType = 'Contact'; attributes.parentName = this.model.get('name'); @@ -517,27 +517,27 @@ define('crm:views/record/panels/activities', } else { if (this.model.get('accountId')) { - attributes.parentType = 'Account', + attributes.parentType = 'Account'; attributes.parentId = this.model.get('accountId'); attributes.parentName = this.model.get('accountName'); } } } - else if (this.model.name === 'Lead') { - attributes.parentType = 'Lead', - attributes.parentId = this.model.id + else if (this.model.entityType === 'Lead') { + attributes.parentType = 'Lead'; + attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } - if (~['Contact', 'Lead', 'Account'].indexOf(this.model.name) && this.model.get('emailAddress')) { + if (~['Contact', 'Lead', 'Account'].indexOf(this.model.entityType) && this.model.get('emailAddress')) { attributes.nameHash = {}; attributes.nameHash[this.model.get('emailAddress')] = this.model.get('name'); } if (scope) { if (!attributes.parentId) { - if (this.checkParentTypeAvailability(scope, this.model.name)) { - attributes.parentType = this.model.name; + if (this.checkParentTypeAvailability(scope, this.model.entityType)) { + attributes.parentType = this.model.entityType; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } @@ -555,7 +555,7 @@ define('crm:views/record/panels/activities', if ( attributes.parentType && - attributes.parentType === this.model.name && + attributes.parentType === this.model.entityType && ~emailKeepParentTeamsEntityList.indexOf(attributes.parentType) && this.model.get('teamsIds') && this.model.get('teamsIds').length @@ -649,7 +649,7 @@ define('crm:views/record/panels/activities', }, actionViewRelatedList: function (data) { - data.url = 'Activities/' + this.model.name + '/' + + data.url = 'Activities/' + this.model.entityType + '/' + this.model.id + '/' + this.name + '/list/' + data.scope; data.title = this.translate(this.defs.label) + diff --git a/client/modules/crm/src/views/record/panels/history.js b/client/modules/crm/src/views/record/panels/history.js index be2335f165..4e316fd2d8 100644 --- a/client/modules/crm/src/views/record/panels/history.js +++ b/client/modules/crm/src/views/record/panels/history.js @@ -84,7 +84,7 @@ define('crm:views/record/panels/history', ['crm:views/record/panels/activities'] to: this.getUser().get('emailAddress'), }; - if (this.model.name === 'Contact') { + if (this.model.entityType === 'Contact') { if (this.getConfig().get('b2cMode')) { attributes.parentType = 'Contact'; attributes.parentName = this.model.get('name'); @@ -96,7 +96,7 @@ define('crm:views/record/panels/history', ['crm:views/record/panels/activities'] attributes.parentName = this.model.get('accountName'); } } - } else if (this.model.name === 'Lead') { + } else if (this.model.entityType === 'Lead') { attributes.parentType = 'Lead'; attributes.parentId = this.model.id attributes.parentName = this.model.get('name'); @@ -107,8 +107,8 @@ define('crm:views/record/panels/history', ['crm:views/record/panels/activities'] if (scope) { if (!attributes.parentId) { - if (this.checkParentTypeAvailability(scope, this.model.name)) { - attributes.parentType = this.model.name; + if (this.checkParentTypeAvailability(scope, this.model.entityType)) { + attributes.parentType = this.model.entityType; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } diff --git a/client/modules/crm/src/views/record/panels/target-lists.js b/client/modules/crm/src/views/record/panels/target-lists.js index 4d8afbf3d6..c2f987a362 100644 --- a/client/modules/crm/src/views/record/panels/target-lists.js +++ b/client/modules/crm/src/views/record/panels/target-lists.js @@ -36,7 +36,7 @@ define('crm:views/record/panels/target-lists', ['views/record/panels/relationshi .postRequest('TargetList/action/optOut', { id: data.id, targetId: this.model.id, - targetType: this.model.name, + targetType: this.model.entityType, }) .then(() => { this.collection.fetch(); @@ -52,7 +52,7 @@ define('crm:views/record/panels/target-lists', ['views/record/panels/relationshi .postRequest('TargetList/action/cancelOptOut', { id: data.id, targetId: this.model.id, - targetType: this.model.name, + targetType: this.model.entityType, }) .then(() => { this.collection.fetch(); diff --git a/client/modules/crm/src/views/record/panels/tasks.js b/client/modules/crm/src/views/record/panels/tasks.js index 1ea01a7dcb..4b906a6e55 100644 --- a/client/modules/crm/src/views/record/panels/tasks.js +++ b/client/modules/crm/src/views/record/panels/tasks.js @@ -81,7 +81,7 @@ define('crm:views/record/panels/tasks', ['views/record/panels/relationship'], fu }, setup: function () { - this.parentScope = this.model.name; + this.parentScope = this.model.entityType; this.link = 'tasks'; this.panelName = 'tasksSide'; @@ -92,7 +92,7 @@ define('crm:views/record/panels/tasks', ['views/record/panels/relationship'], fu this.link = 'tasksPrimary'; } - this.url = this.model.name + '/' + this.model.id + '/' + this.link; + this.url = this.model.entityType + '/' + this.model.id + '/' + this.link; this.setupSorting(); diff --git a/client/modules/crm/src/views/record/row-actions/activities-dashlet.js b/client/modules/crm/src/views/record/row-actions/activities-dashlet.js index db0d88caa9..bfa1a395dc 100644 --- a/client/modules/crm/src/views/record/row-actions/activities-dashlet.js +++ b/client/modules/crm/src/views/record/row-actions/activities-dashlet.js @@ -33,11 +33,11 @@ define('crm:views/record/row-actions/activities-dashlet', ['views/record/row-act getActionList: function () { var actionList = Dep.prototype.getActionList.call(this); - var scope = this.model.name; + var scope = this.model.entityType; actionList.forEach(function (item) { item.data = item.data || {}; - item.data.scope = this.model.name; + item.data.scope = this.model.entityType; }, this); if (scope === 'Task') { @@ -57,7 +57,7 @@ define('crm:views/record/row-actions/activities-dashlet', ['views/record/row-act label: 'Set Held', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); actionList.push({ @@ -65,7 +65,7 @@ define('crm:views/record/row-actions/activities-dashlet', ['views/record/row-act label: 'Set Not Held', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); } @@ -77,7 +77,7 @@ define('crm:views/record/row-actions/activities-dashlet', ['views/record/row-act label: 'Remove', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); } diff --git a/client/modules/crm/src/views/record/row-actions/activities.js b/client/modules/crm/src/views/record/row-actions/activities.js index ae005961d9..159c485b76 100644 --- a/client/modules/crm/src/views/record/row-actions/activities.js +++ b/client/modules/crm/src/views/record/row-actions/activities.js @@ -37,7 +37,7 @@ define('crm:views/record/row-actions/activities', ['views/record/row-actions/rel data: { id: this.model.id, }, - link: '#' + this.model.name + '/view/' + this.model.id, + link: '#' + this.model.entityType + '/view/' + this.model.id, }]; if (this.options.acl.edit) { @@ -47,7 +47,7 @@ define('crm:views/record/row-actions/activities', ['views/record/row-actions/rel data: { id: this.model.id, }, - link: '#' + this.model.name + '/edit/' + this.model.id, + link: '#' + this.model.entityType + '/edit/' + this.model.id, }); if (this.model.entityType === 'Meeting' || this.model.entityType === 'Call') { diff --git a/client/modules/crm/src/views/record/row-actions/history.js b/client/modules/crm/src/views/record/row-actions/history.js index 9a94ca8f20..4c4e8fe3a7 100644 --- a/client/modules/crm/src/views/record/row-actions/history.js +++ b/client/modules/crm/src/views/record/row-actions/history.js @@ -37,7 +37,7 @@ define('crm:views/record/row-actions/history', ['views/record/row-actions/relati data: { id: this.model.id }, - link: '#' + this.model.name + '/view/' + this.model.id + link: '#' + this.model.entityType + '/view/' + this.model.id }]; if (this.model.entityType === 'Email') { @@ -58,7 +58,7 @@ define('crm:views/record/row-actions/history', ['views/record/row-actions/relati data: { id: this.model.id }, - link: '#' + this.model.name + '/edit/' + this.model.id + link: '#' + this.model.entityType + '/edit/' + this.model.id } ]); } diff --git a/client/modules/crm/src/views/record/row-actions/tasks.js b/client/modules/crm/src/views/record/row-actions/tasks.js index c2a12d2ea4..4918bdc7ae 100644 --- a/client/modules/crm/src/views/record/row-actions/tasks.js +++ b/client/modules/crm/src/views/record/row-actions/tasks.js @@ -37,7 +37,7 @@ define('crm:views/record/row-actions/tasks', ['views/record/row-actions/relation data: { id: this.model.id }, - link: '#' + this.model.name + '/view/' + this.model.id + link: '#' + this.model.entityType + '/view/' + this.model.id }]; if (this.options.acl.edit) { @@ -47,7 +47,7 @@ define('crm:views/record/row-actions/tasks', ['views/record/row-actions/relation data: { id: this.model.id }, - link: '#' + this.model.name + '/edit/' + this.model.id + link: '#' + this.model.entityType + '/edit/' + this.model.id }); if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { diff --git a/client/modules/crm/src/views/target-list/record/panels/opted-out.js b/client/modules/crm/src/views/target-list/record/panels/opted-out.js index d03f134d2c..7dfa73c7ab 100644 --- a/client/modules/crm/src/views/target-list/record/panels/opted-out.js +++ b/client/modules/crm/src/views/target-list/record/panels/opted-out.js @@ -45,7 +45,7 @@ function (Dep, MultiCollection) { }, getStorageKey: function () { - return 'target-list-opted-out-' + this.model.name + '-' + this.name; + return 'target-list-opted-out-' + this.model.entityType + '-' + this.name; }, setup: function () { diff --git a/client/modules/crm/src/views/target-list/record/row-actions/default.js b/client/modules/crm/src/views/target-list/record/row-actions/default.js index 2d7df24da8..3141d8af9c 100644 --- a/client/modules/crm/src/views/target-list/record/row-actions/default.js +++ b/client/modules/crm/src/views/target-list/record/row-actions/default.js @@ -40,7 +40,7 @@ define('crm:views/target-list/record/row-actions/default', ['views/record/row-ac label: 'Cancel Opt-Out', data: { id: this.model.id, - type: this.model.name, + type: this.model.entityType, }, }); } else { @@ -49,7 +49,7 @@ define('crm:views/target-list/record/row-actions/default', ['views/record/row-ac label: 'Opt-Out', data: { id: this.model.id, - type: this.model.name, + type: this.model.entityType, }, }); } diff --git a/client/modules/crm/src/views/target-list/record/row-actions/opted-out.js b/client/modules/crm/src/views/target-list/record/row-actions/opted-out.js index 70b7aeab24..2265e8ebb1 100644 --- a/client/modules/crm/src/views/target-list/record/row-actions/opted-out.js +++ b/client/modules/crm/src/views/target-list/record/row-actions/opted-out.js @@ -37,7 +37,7 @@ define('crm:views/target-list/record/row-actions/opted-out', ['views/record/row- label: 'Cancel Opt-Out', data: { id: this.model.id, - type: this.model.name + type: this.model.entityType, }, }, ]; diff --git a/client/modules/crm/src/views/task/record/row-actions/dashlet.js b/client/modules/crm/src/views/task/record/row-actions/dashlet.js index a7cb4d3e51..d3c21312f6 100644 --- a/client/modules/crm/src/views/task/record/row-actions/dashlet.js +++ b/client/modules/crm/src/views/task/record/row-actions/dashlet.js @@ -49,7 +49,7 @@ define('crm:views/task/record/row-actions/dashlet', ['views/record/row-actions/v label: 'Remove', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); } diff --git a/client/modules/crm/src/views/task/record/row-actions/default.js b/client/modules/crm/src/views/task/record/row-actions/default.js index 75bbfcddb8..69d7640075 100644 --- a/client/modules/crm/src/views/task/record/row-actions/default.js +++ b/client/modules/crm/src/views/task/record/row-actions/default.js @@ -49,7 +49,7 @@ define('crm:views/task/record/row-actions/default', ['views/record/row-actions/v label: 'Remove', data: { id: this.model.id, - scope: this.model.name + scope: this.model.entityType } }); } diff --git a/client/res/templates/event/fields/name-for-history/list-link.tpl b/client/res/templates/event/fields/name-for-history/list-link.tpl index d5f309571b..b69346fc42 100644 --- a/client/res/templates/event/fields/name-for-history/list-link.tpl +++ b/client/res/templates/event/fields/name-for-history/list-link.tpl @@ -1,5 +1,5 @@ - {{name}} diff --git a/client/res/templates/record/panels/side.tpl b/client/res/templates/record/panels/side.tpl index 21b3714bd6..ccf0a1ff79 100644 --- a/client/res/templates/record/panels/side.tpl +++ b/client/res/templates/record/panels/side.tpl @@ -9,7 +9,7 @@ > {{#if labelText}}{{labelText}}{{else}}{{translate label scope=../model.name category='fields'}}{{/if}} + >{{#if labelText}}{{labelText}}{{else}}{{translate label scope=../model.entityType category='fields'}}{{/if}} {{/unless}}