define("modules/crm/views/meeting/fields/attendees", ["exports", "views/fields/link-multiple-with-role"], function (_exports, _linkMultipleWithRole) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _linkMultipleWithRole = _interopRequireDefault(_linkMultipleWithRole); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _linkMultipleWithRole.default { columnName = 'status'; roleFieldIsForeign = false; emptyRoleValue = 'None'; } _exports.default = _default; }); define("modules/crm/views/calendar/fields/teams", ["exports", "views/fields/link-multiple"], function (_exports, _linkMultiple) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _linkMultiple = _interopRequireDefault(_linkMultiple); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class CalendarSharedViewTeamsFieldView extends _linkMultiple.default { foreignScope = 'Team'; getSelectBoolFilterList() { if (this.getAcl().getPermissionLevel('userCalendar') === 'team') { return ['onlyMy']; } } } _exports.default = CalendarSharedViewTeamsFieldView; }); define("modules/crm/knowledge-base-helper", ["exports", "ajax"], function (_exports, _ajax) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _ajax = _interopRequireDefault(_ajax); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ /** * @todo Move to modules/crm/helpers. */ class KnowledgeBaseHelper { /** * @param {module:language} language */ constructor(language) { this.language = language; } getAttributesForEmail(model, attributes, callback) { attributes = attributes || {}; attributes.body = model.get('body'); if (attributes.name) { attributes.name = attributes.name + ' '; } else { attributes.name = ''; } attributes.name += this.language.translate('KnowledgeBaseArticle', 'scopeNames') + ': ' + model.get('name'); _ajax.default.postRequest('KnowledgeBaseArticle/action/getCopiedAttachments', { id: model.id, parentType: 'Email', field: 'attachments' }).then(data => { attributes.attachmentsIds = data.ids; attributes.attachmentsNames = data.names; attributes.isHtml = true; callback(attributes); }); } } var _default = _exports.default = KnowledgeBaseHelper; }); define("modules/crm/views/task/record/list", ["exports", "views/record/list"], function (_exports, _list) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _list = _interopRequireDefault(_list); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _list.default { rowActionsView = 'crm:views/task/record/row-actions/default'; actionSetCompleted(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); if (!model) { return; } Espo.Ui.notify(this.translate('saving', 'messages')); model.save({ status: 'Completed' }, { patch: true }).then(() => { Espo.Ui.success(this.translate('Saved')); this.collection.fetch(); }); } } _exports.default = _default; }); define("modules/crm/views/record/panels/tasks", ["exports", "views/record/panels/relationship", "helpers/record/create-related"], function (_exports, _relationship, _createRelated) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _relationship = _interopRequireDefault(_relationship); _createRelated = _interopRequireDefault(_createRelated); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class TasksRelationshipPanelView extends _relationship.default { name = 'tasks'; entityType = 'Task'; filterList = ['all', 'actual', 'completed']; orderBy = 'createdAt'; orderDirection = 'desc'; rowActionsView = 'crm:views/record/row-actions/tasks'; buttonList = [{ action: 'createTask', title: 'Create Task', acl: 'create', aclScope: 'Task', html: '' }]; actionList = [{ label: 'View List', action: 'viewRelatedList' }]; listLayout = { rows: [[{ name: 'name', link: true }], [{ name: 'isOverdue' }, { name: 'assignedUser' }, { name: 'dateEnd', soft: true }, { name: 'status' }]] }; setup() { this.parentScope = this.model.entityType; this.link = 'tasks'; this.panelName = 'tasksSide'; this.defs.create = true; if (this.parentScope === 'Account') { this.link = 'tasksPrimary'; } this.url = this.model.entityType + '/' + this.model.id + '/' + this.link; this.setupSorting(); if (this.filterList && this.filterList.length) { this.filter = this.getStoredFilter(); } this.setupFilterActions(); this.setupTitle(); this.wait(true); this.getCollectionFactory().create('Task', collection => { this.collection = collection; collection.seeds = this.seeds; collection.url = this.url; collection.orderBy = this.defaultOrderBy; collection.order = this.defaultOrder; collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; this.setFilter(this.filter); this.wait(false); }); this.once('show', () => { if (!this.isRendered() && !this.isBeingRendered()) { this.collection.fetch(); } }); let events = `update-related:${this.link} update-all`; if (this.parentScope === 'Account') { events += ' update-related:tasks'; } this.listenTo(this.model, events, () => this.collection.fetch()); } afterRender() { this.createView('list', 'views/record/list-expanded', { selector: '> .list-container', pagination: false, type: 'listRelationship', rowActionsView: this.defs.rowActionsView || this.rowActionsView, checkboxes: false, collection: this.collection, listLayout: this.listLayout, skipBuildRows: true }, view => { view.getSelectAttributeList(selectAttributeList => { if (selectAttributeList) { this.collection.data.select = selectAttributeList.join(','); } if (!this.disabled) { this.collection.fetch(); return; } this.once('show', () => this.collection.fetch()); }); }); } actionCreateRelated() { this.actionCreateTask(); } actionCreateTask() { let link = this.link; if (this.parentScope === 'Account') { link = 'tasks'; } const helper = new _createRelated.default(this); helper.process(this.model, link); } // noinspection JSUnusedGlobalSymbols actionComplete(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); model.save({ status: 'Completed' }, { patch: true }).then(() => this.collection.fetch()); } actionViewRelatedList(data) { data.viewOptions = data.viewOptions || {}; data.viewOptions.massUnlinkDisabled = true; super.actionViewRelatedList(data); } } _exports.default = TasksRelationshipPanelView; }); define("modules/crm/views/record/panels/activities", ["exports", "views/record/panels/relationship", "multi-collection", "helpers/record-modal"], function (_exports, _relationship, _multiCollection, _recordModal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _relationship = _interopRequireDefault(_relationship); _multiCollection = _interopRequireDefault(_multiCollection); _recordModal = _interopRequireDefault(_recordModal); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class ActivitiesPanelView extends _relationship.default { name = 'activities'; orderBy = 'dateStart'; serviceName = 'Activities'; order = 'desc'; rowActionsView = 'crm:views/record/row-actions/activities'; relatedListFiltersDisabled = true; buttonMaxCount = null; /** * @type {Array} */ actionList = [{ action: 'composeEmail', label: 'Compose Email', acl: 'create', aclScope: 'Email' }]; listLayout = {}; defaultListLayout = { rows: [[{ name: 'ico', view: 'crm:views/fields/ico' }, { name: 'name', link: true, view: 'views/event/fields/name-for-history' }], [{ name: 'dateStart', soft: true }, { name: 'assignedUser' }]] }; BUTTON_MAX_COUNT = 3; setup() { this.scopeList = this.getConfig().get(this.name + 'EntityList') || []; this.buttonMaxCount = this.getConfig().get('activitiesCreateButtonMaxCount'); if (typeof this.buttonMaxCount === 'undefined') { this.buttonMaxCount = this.BUTTON_MAX_COUNT; } this.listLayout = Espo.Utils.cloneDeep(this.listLayout); this.defs.create = true; this.createAvailabilityHash = {}; this.entityTypeLinkMap = {}; this.createEntityTypeStatusMap = {}; this.setupActionList(); this.setupFinalActionList(); this.setupSorting(); this.scopeList.forEach(item => { if (!(item in this.listLayout)) { this.listLayout[item] = this.defaultListLayout; } }); this.url = this.serviceName + '/' + this.model.entityType + '/' + this.model.id + '/' + this.name; this.seeds = {}; this.wait(true); let i = 0; this.scopeList.forEach(scope => { this.getModelFactory().create(scope, seed => { this.seeds[scope] = seed; i++; if (i === this.scopeList.length) { this.wait(false); } }); }); if (this.scopeList.length === 0) { this.wait(false); } this.filterList = []; /*this.scopeList.forEach(item => { if (!this.getAcl().check(item)) { return; } if (!this.getAcl().check(item, 'read')) { return; } if (this.getMetadata().get(['scopes', item, 'disabled'])) { return; } this.filterList.push(item); });*/ if (this.filterList.length) { this.filterList.unshift('all'); } if (this.filterList && this.filterList.length) { this.filter = this.getStoredFilter(); } this.setupFilterActions(); this.setupTitle(); this.collection = new _multiCollection.default(); this.collection.seeds = this.seeds; this.collection.url = this.url; this.collection.orderBy = this.orderBy; this.collection.order = this.order; this.collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; let events = `update-related:activities update-all`; for (const entityType of this.scopeList) { const link = this.entityTypeLinkMap[entityType]; if (!link) { continue; } events += ` update-related:${link}`; } if (this.name === 'history') { events += ' update-related:emails'; } this.listenTo(this.model, events, () => this.collection.fetch()); this.setFilter(this.filter); this.once('show', () => { if (!this.isRendered() && !this.isBeingRendered()) { this.collection.fetch(); } }); } translateFilter(name) { if (name === 'all') { return this.translate(name, 'presetFilters'); } return this.translate(name, 'scopeNamesPlural'); } isCreateAvailable(scope) { return this.createAvailabilityHash[scope]; } setupActionList() { if (this.name === 'activities' && this.buttonMaxCount) { this.buttonList.push({ action: 'composeEmail', title: 'Compose Email', acl: 'create', aclScope: 'Email', html: $('').addClass(this.getMetadata().get(['clientDefs', 'Email', 'iconClass'])).get(0).outerHTML }); } this.scopeList.forEach(scope => { if (!this.getMetadata().get(['clientDefs', scope, 'activityDefs', this.name + 'Create'])) { return; } if (!this.getAcl().checkScope(scope, 'create')) { return; } const label = (this.name === 'history' ? 'Log' : 'Schedule') + ' ' + scope; const o = { action: 'createActivity', text: this.translate(label, 'labels', scope), data: {}, acl: 'create', aclScope: scope }; const link = this.getMetadata().get(['clientDefs', scope, 'activityDefs', 'link']); if (link) { o.data.link = link; this.entityTypeLinkMap[scope] = link; if (!this.model.hasLink(link)) { return; } } else { o.data.scope = scope; if (this.model.entityType !== 'User' && !this.checkParentTypeAvailability(scope, this.model.entityType)) { return; } } this.createAvailabilityHash[scope] = true; o.data = o.data || {}; if (!o.data.status) { const statusList = this.getMetadata().get(['scopes', scope, this.name + 'StatusList']); if (statusList && statusList.length) { o.data.status = statusList[0]; } } this.createEntityTypeStatusMap[scope] = o.data.status; this.actionList.push(o); if (this.name === 'activities' && this.buttonList.length < this.buttonMaxCount) { const ob = Espo.Utils.cloneDeep(o); const iconClass = this.getMetadata().get(['clientDefs', scope, 'iconClass']); if (iconClass) { ob.title = label; ob.html = $('').addClass(iconClass).get(0).outerHTML; this.buttonList.push(ob); } } }); } setupFinalActionList() { this.scopeList.forEach((scope, i) => { if (i === 0 && this.actionList.length) { this.actionList.push(false); } if (!this.getAcl().checkScope(scope, 'read')) { return; } const o = { action: 'viewRelatedList', html: $('').append($('').text(this.translate(scope, 'scopeNamesPlural'))).get(0).innerHTML, data: { scope: scope }, acl: 'read', aclScope: scope }; this.actionList.push(o); }); } setFilter(filter) { this.filter = filter; this.collection.data.entityType = null; if (filter && filter !== 'all') { this.collection.data.entityType = this.filter; } } afterRender() { const afterFetch = () => { this.createView('list', 'views/record/list-expanded', { selector: '> .list-container', pagination: false, type: 'listRelationship', rowActionsView: this.rowActionsView, checkboxes: false, collection: this.collection, listLayout: this.listLayout }, view => { view.render(); this.listenTo(view, 'after:save', () => { this.model.trigger('update-related:activities'); }); }); }; if (!this.disabled) { this.collection.fetch().then(() => afterFetch()); } else { this.once('show', () => { this.collection.fetch().then(() => afterFetch()); }); } } getCreateActivityAttributes(scope, data, callback) { data = data || {}; const attributes = { status: data.status }; if (this.model.entityType === 'User') { const model = /** @type {module:models/user} */this.model; if (model.isPortal()) { attributes.usersIds = [model.id]; const usersIdsNames = {}; usersIdsNames[model.id] = model.get('name'); attributes.usersIdsNames = usersIdsNames; } else { attributes.assignedUserId = model.id; attributes.assignedUserName = model.get('name'); } } else { if (this.model.entityType === 'Contact') { if (this.model.get('accountId') && !this.getConfig().get('b2cMode')) { attributes.parentType = 'Account'; attributes.parentId = this.model.get('accountId'); attributes.parentName = this.model.get('accountName'); if (scope && !this.getMetadata().get(['entityDefs', scope, 'links', 'contacts']) && !this.getMetadata().get(['entityDefs', scope, 'links', 'contact'])) { delete attributes.parentType; delete attributes.parentId; delete attributes.parentName; } } } else if (this.model.entityType === 'Lead') { attributes.parentType = 'Lead'; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } 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.entityType)) { attributes.parentType = this.model.entityType; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } } else { if (attributes.parentType && !this.checkParentTypeAvailability(scope, attributes.parentType)) { attributes.parentType = null; attributes.parentId = null; attributes.parentName = null; } } } } callback.call(this, Espo.Utils.cloneDeep(attributes)); } checkParentTypeAvailability(scope, parentType) { return (this.getMetadata().get(['entityDefs', scope, 'fields', 'parent', 'entityList']) || []).includes(parentType); } // noinspection JSUnusedGlobalSymbols actionCreateRelated(data) { data.link = this.entityTypeLinkMap[data.scope]; if (this.createEntityTypeStatusMap[data.scope]) { data.status = this.createEntityTypeStatusMap[data.scope]; } this.actionCreateActivity(data); } /** * @protected * @param {Record} data */ actionCreateActivity(data) { const link = data.link; let foreignLink; let scope; if (link) { scope = this.model.getLinkParam(link, 'entity'); foreignLink = this.model.getLinkParam(link, 'foreign'); } else { scope = data.scope; } Espo.Ui.notifyWait(); this.getCreateActivityAttributes(scope, data, attributes => { const helper = new _recordModal.default(); helper.showCreate(this, { entityType: scope, relate: link ? { model: this.model, link: foreignLink } : undefined, attributes: attributes, afterSave: () => { this.model.trigger(`update-related:${link}`); this.model.trigger('after:relate'); } }); }); } getComposeEmailAttributes(scope, data, callback) { const attributes = { status: 'Draft', to: this.model.get('emailAddress') }; if (this.model.entityType === 'Contact') { if (this.getConfig().get('b2cMode')) { attributes.parentType = 'Contact'; attributes.parentName = this.model.get('name'); attributes.parentId = this.model.id; } else if (this.model.get('accountId')) { attributes.parentType = 'Account'; attributes.parentId = this.model.get('accountId'); attributes.parentName = this.model.get('accountName'); } } else if (this.model.entityType === 'Lead') { attributes.parentType = 'Lead'; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } if (['Contact', 'Lead', 'Account'].includes(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.entityType)) { attributes.parentType = this.model.entityType; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } } else if (attributes.parentType && !this.checkParentTypeAvailability(scope, attributes.parentType)) { attributes.parentType = null; attributes.parentId = null; attributes.parentName = null; } } const emailKeepParentTeamsEntityList = this.getConfig().get('emailKeepParentTeamsEntityList') || []; if (attributes.parentType && attributes.parentType === this.model.entityType && emailKeepParentTeamsEntityList.includes(attributes.parentType) && this.model.get('teamsIds') && this.model.get('teamsIds').length) { attributes.teamsIds = Espo.Utils.clone(this.model.get('teamsIds')); attributes.teamsNames = Espo.Utils.clone(this.model.get('teamsNames') || {}); const defaultTeamId = this.getUser().get('defaultTeamId'); if (defaultTeamId && !attributes.teamsIds.includes(defaultTeamId)) { attributes.teamsIds.push(defaultTeamId); attributes.teamsNames[defaultTeamId] = this.getUser().get('defaultTeamName'); } attributes.teamsIds = attributes.teamsIds.filter(teamId => { return this.getAcl().checkTeamAssignmentPermission(teamId); }); } if (this.model.attributes.accountId && this.model.getFieldType('account') === 'link' && this.model.getLinkParam('account', 'entity') === 'Account') { attributes.accountId = this.model.attributes.accountId; attributes.accountName = this.model.attributes.accountName; } if (!attributes.to && this.isBasePlus()) { Espo.Ui.notifyWait(); Espo.Ajax.getRequest(`Activities/${this.model.entityType}/${this.model.id}/composeEmailAddressList`).then(/** Record[] */list => { if (!list.length) { callback.call(this, attributes); return; } attributes.to = ''; attributes.nameHash = {}; list.forEach(item => { attributes.to += item.emailAddress + ';'; attributes.nameHash[item.emailAddress] = item.name; }); Espo.Ui.notify(false); callback.call(this, attributes); }); return; } callback.call(this, attributes); } // noinspection JSUnusedGlobalSymbols actionComposeEmail(data) { const scope = 'Email'; let relate = null; if ('emails' in this.model.defs['links']) { relate = { model: this.model, link: this.model.defs['links']['emails'].foreign }; } Espo.Ui.notifyWait(); this.getComposeEmailAttributes(scope, data, attributes => { this.createView('quickCreate', 'views/modals/compose-email', { relate: relate, attributes: attributes }, view => { view.render(); view.notify(false); this.listenToOnce(view, 'after:save', () => { this.model.trigger(`update-related:emails`); this.model.trigger('after:relate'); }); }); }); } actionSetHeld(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); model.save({ status: 'Held' }, { patch: true }).then(() => { this.model.trigger(`update-related:activities`); }); } actionSetNotHeld(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); model.save({ status: 'Not Held' }, { patch: true }).then(() => { this.model.trigger(`update-related:activities`); }); } actionViewRelatedList(data) { data.url = `Activities/${this.model.entityType}/${this.model.id}/${this.name}/list/${data.scope}`; data.title = this.translate(this.defs.label) + ' @right ' + this.translate(data.scope, 'scopeNamesPlural'); const viewOptions = /** @type {Record.} */data.viewOptions || {}; const fullFormUrl = `#${this.model.entityType}/${this.name}/${this.model.id}/${data.scope}`; viewOptions.massUnlinkDisabled = true; viewOptions.fullFormUrl = fullFormUrl; viewOptions.createDisabled = true; data.viewOptions = viewOptions; super.actionViewRelatedList(data); } /** * @protected * @return {boolean} */ isBasePlus() { const type = this.getMetadata().get(`scopes.${this.model.entityType}.type`); return type === 'BasePlus'; } } var _default = _exports.default = ActivitiesPanelView; }); define("modules/crm/views/meeting/detail", ["exports", "views/detail", "moment"], function (_exports, _detail, _moment) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _detail = _interopRequireDefault(_detail); _moment = _interopRequireDefault(_moment); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MeetingDetailView extends _detail.default { cancellationPeriod = '8 hours'; setup() { super.setup(); this.setupStatuses(); this.addMenuItem('buttons', { name: 'sendInvitations', text: this.translate('Send Invitations', 'labels', 'Meeting'), acl: 'edit', hidden: true, onClick: () => this.actionSendInvitations() }); this.addMenuItem('dropdown', { name: 'sendCancellation', text: this.translate('Send Cancellation', 'labels', 'Meeting'), acl: 'edit', hidden: true, onClick: () => this.actionSendCancellation() }); this.addMenuItem('buttons', { name: 'setAcceptanceStatus', text: '', hidden: true, onClick: () => this.actionSetAcceptanceStatus() }); this.setupCancellationPeriod(); this.controlSendInvitationsButton(); this.controlAcceptanceStatusButton(); this.controlSendCancellationButton(); this.listenTo(this.model, 'sync', () => { this.controlSendInvitationsButton(); this.controlSendCancellationButton(); }); this.listenTo(this.model, 'sync', () => this.controlAcceptanceStatusButton()); } setupStatuses() { this.canceledStatusList = this.getMetadata().get(`scopes.${this.entityType}.canceledStatusList`) || []; this.notActualStatusList = [...(this.getMetadata().get(`scopes.${this.entityType}.completedStatusList`) || []), ...this.canceledStatusList]; } setupCancellationPeriod() { this.cancellationPeriodAmount = 0; this.cancellationPeriodUnits = 'hours'; const cancellationPeriod = this.getConfig().get('eventCancellationPeriod') || this.cancellationPeriod; if (!cancellationPeriod) { return; } const arr = cancellationPeriod.split(' '); this.cancellationPeriodAmount = parseInt(arr[0]); this.cancellationPeriodUnits = arr[1] ?? 'hours'; } controlAcceptanceStatusButton() { if (!this.model.has('status')) { return; } if (!this.model.has('usersIds')) { return; } if (this.notActualStatusList.includes(this.model.get('status'))) { this.hideHeaderActionItem('setAcceptanceStatus'); return; } if (!this.model.getLinkMultipleIdList('users').includes(this.getUser().id)) { this.hideHeaderActionItem('setAcceptanceStatus'); return; } const acceptanceStatus = this.model.getLinkMultipleColumn('users', 'status', this.getUser().id); let text; let style = 'default'; if (acceptanceStatus && acceptanceStatus !== 'None') { text = this.getLanguage().translateOption(acceptanceStatus, 'acceptanceStatus', this.model.entityType); style = this.getMetadata().get(['entityDefs', this.model.entityType, 'fields', 'acceptanceStatus', 'style', acceptanceStatus]); } else { text = this.translate('Acceptance', 'labels', 'Meeting'); } let iconHtml = ''; if (style) { const iconClass = { 'success': 'fas fa-check-circle', 'danger': 'fas fa-times-circle', 'warning': 'fas fa-question-circle' }[style]; iconHtml = $('').addClass(iconClass).addClass('text-' + style).get(0).outerHTML; } this.updateMenuItem('setAcceptanceStatus', { text: text, iconHtml: iconHtml, hidden: false }); } controlSendInvitationsButton() { let show = true; if (this.notActualStatusList.includes(this.model.get('status'))) { show = false; } if (show && !this.getAcl().checkModel(this.model, 'edit')) { show = false; } if (show) { const userIdList = this.model.getLinkMultipleIdList('users'); const contactIdList = this.model.getLinkMultipleIdList('contacts'); const leadIdList = this.model.getLinkMultipleIdList('leads'); if (!contactIdList.length && !leadIdList.length && !userIdList.length) { show = false; } /*else if ( !contactIdList.length && !leadIdList.length && userIdList.length === 1 && userIdList[0] === this.getUser().id && this.model.getLinkMultipleColumn('users', 'status', this.getUser().id) === 'Accepted' ) { show = false; }*/ } if (show) { const dateEnd = this.model.get('dateEnd'); if (dateEnd && this.getDateTime().toMoment(dateEnd).isBefore(_moment.default.now())) { show = false; } } show ? this.showHeaderActionItem('sendInvitations') : this.hideHeaderActionItem('sendInvitations'); } controlSendCancellationButton() { let show = this.canceledStatusList.includes(this.model.get('status')); if (show) { const dateEnd = this.model.get('dateEnd'); if (dateEnd && this.getDateTime().toMoment(dateEnd).add(this.cancellationPeriodAmount, this.cancellationPeriodUnits).isBefore(_moment.default.now())) { show = false; } } if (show) { const userIdList = this.model.getLinkMultipleIdList('users'); const contactIdList = this.model.getLinkMultipleIdList('contacts'); const leadIdList = this.model.getLinkMultipleIdList('leads'); if (!contactIdList.length && !leadIdList.length && !userIdList.length) { show = false; } } show ? this.showHeaderActionItem('sendCancellation') : this.hideHeaderActionItem('sendCancellation'); } actionSendInvitations() { Espo.Ui.notifyWait(); this.createView('dialog', 'crm:views/meeting/modals/send-invitations', { model: this.model }).then(view => { Espo.Ui.notify(false); view.render(); this.listenToOnce(view, 'sent', () => this.model.fetch()); }); } actionSendCancellation() { Espo.Ui.notifyWait(); this.createView('dialog', 'crm:views/meeting/modals/send-cancellation', { model: this.model }).then(view => { Espo.Ui.notify(false); view.render(); this.listenToOnce(view, 'sent', () => this.model.fetch()); }); } // noinspection JSUnusedGlobalSymbols actionSetAcceptanceStatus() { this.createView('dialog', 'crm:views/meeting/modals/acceptance-status', { model: this.model }, view => { view.render(); this.listenTo(view, 'set-status', status => { this.disableMenuItem('setAcceptanceStatus'); Espo.Ui.notifyWait(); Espo.Ajax.postRequest(this.model.entityType + '/action/setAcceptanceStatus', { id: this.model.id, status: status }).then(() => { this.model.fetch().then(() => { Espo.Ui.notify(false); this.enableMenuItem('setAcceptanceStatus'); }); }).catch(() => this.enableMenuItem('setAcceptanceStatus')); }); }); } } var _default = _exports.default = MeetingDetailView; }); define("modules/crm/views/meeting/record/list", ["exports", "views/record/list"], function (_exports, _list) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _list = _interopRequireDefault(_list); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _list.default { rowActionsView = 'modules/crm/views/meeting/record/row-actions/default'; setup() { super.setup(); if (this.getAcl().checkScope(this.entityType, 'edit') && this.getAcl().checkField(this.entityType, 'status', 'edit')) { this.massActionList.push('setHeld'); this.massActionList.push('setNotHeld'); } } /** * @protected * @param {Record} data */ async actionSetHeld(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); if (!model) { return; } Espo.Ui.notify(this.translate('saving', 'messages')); await model.save({ status: 'Held' }, { patch: true }); Espo.Ui.success(this.translate('Saved')); } /** * @protected * @param {Record} data */ async actionSetNotHeld(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); if (!model) { return; } Espo.Ui.notify(this.translate('saving', 'messages')); await model.save({ status: 'Not Held' }, { patch: true }); Espo.Ui.success(this.translate('Saved')); } // noinspection JSUnusedGlobalSymbols async massActionSetHeld() { const data = {}; data.ids = this.checkedList; Espo.Ui.notify(this.translate('saving', 'messages')); await Espo.Ajax.postRequest(`${this.collection.entityType}/action/massSetHeld`, data); Espo.Ui.success(this.translate('Saved')); await this.collection.fetch(); data.ids.forEach(id => { if (this.collection.get(id)) { this.checkRecord(id); } }); } // noinspection JSUnusedGlobalSymbols async massActionSetNotHeld() { const data = {}; data.ids = this.checkedList; Espo.Ui.notify(this.translate('saving', 'messages')); await Espo.Ajax.postRequest(`${this.collection.entityType}/action/massSetNotHeld`, data); Espo.Ui.success(this.translate('Saved')); await this.collection.fetch(); data.ids.forEach(id => { if (this.collection.get(id)) { this.checkRecord(id); } }); } } _exports.default = _default; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/mass-email/record/edit', ['views/record/edit'], function (Dep) { return Dep.extend({ setup: function () { Dep.prototype.setup.call(this); this.initFieldsControl(); }, initFieldsControl: function () { this.listenTo(this.model, 'change:smtpAccount', (model, value, o) => { if (!o.ui) { return; } if (!value || value === 'system') { this.model.set('fromAddress', this.getConfig().get('outboundEmailFromAddress') || ''); this.model.set('fromName', this.getConfig().get('outboundEmailFromName') || ''); return; } var smtpAccountView = this.getFieldView('smtpAccount'); if (!smtpAccountView) { return; } if (!smtpAccountView.loadedOptionAddresses) { return; } if (!smtpAccountView.loadedOptionAddresses[value]) { return; } this.model.set('fromAddress', smtpAccountView.loadedOptionAddresses[value]); this.model.set('fromName', smtpAccountView.loadedOptionFromNames[value]); }); }, }); }); define("modules/crm/views/mass-email/modals/send-test", ["exports", "views/modal", "model", "views/record/edit-for-modal", "views/fields/link-multiple"], function (_exports, _modal, _model, _editForModal, _linkMultiple) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _modal = _interopRequireDefault(_modal); _model = _interopRequireDefault(_model); _editForModal = _interopRequireDefault(_editForModal); _linkMultiple = _interopRequireDefault(_linkMultiple); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MassEmailSendTestModalView extends _modal.default { // language=Handlebars templateContent = `
{{{record}}}
`; /** * @private * @type {EditForModalRecordView} */ recordView; /** * @private * @type {Model} */ formModel; /** * @param {{model: import('model').default}} options */ constructor(options) { super(options); this.model = options.model; } setup() { super.setup(); this.headerText = this.translate('Send Test', 'labels', 'MassEmail'); const formModel = this.formModel = new _model.default(); formModel.set('usersIds', [this.getUser().id]); const usersNames = {}; usersNames[this.getUser().id] = this.getUser().get('name'); formModel.set('usersNames', usersNames); this.recordView = new _editForModal.default({ model: formModel, detailLayout: [{ rows: [[{ view: new _linkMultiple.default({ name: 'users', labelText: this.translate('users', 'links', 'TargetList'), mode: 'edit', params: { entity: 'User' } }) }, false], [{ view: new _linkMultiple.default({ name: 'contacts', labelText: this.translate('contacts', 'links', 'TargetList'), mode: 'edit', params: { entity: 'Contact' } }) }, false], [{ view: new _linkMultiple.default({ name: 'leads', labelText: this.translate('leads', 'links', 'TargetList'), mode: 'edit', params: { entity: 'Lead' } }) }, false], [{ view: new _linkMultiple.default({ name: 'accounts', labelText: this.translate('accounts', 'links', 'TargetList'), mode: 'edit', params: { entity: 'Account' } }) }, false]] }] }); this.assignView('record', this.recordView); this.buttonList.push({ name: 'sendTest', label: 'Send Test', style: 'danger', onClick: () => this.actionSendTest() }); this.buttonList.push({ name: 'cancel', label: 'Cancel', onClick: () => this.actionClose() }); } actionSendTest() { const list = []; if (Array.isArray(this.formModel.attributes.usersIds)) { this.formModel.attributes.usersIds.forEach(id => { list.push({ id: id, type: 'User' }); }); } if (Array.isArray(this.formModel.attributes.contactsIds)) { this.formModel.attributes.contactsIds.forEach(id => { list.push({ id: id, type: 'Contact' }); }); } if (Array.isArray(this.formModel.attributes.leadsIds)) { this.formModel.attributes.leadsIds.forEach(id => { list.push({ id: id, type: 'Lead' }); }); } if (Array.isArray(this.formModel.attributes.accountsIds)) { this.formModel.attributes.accountsIds.forEach(id => { list.push({ id: id, type: 'Account' }); }); } if (list.length === 0) { Espo.Ui.error(this.translate('selectAtLeastOneTarget', 'messages', 'MassEmail')); return; } this.disableButton('sendTest'); Espo.Ui.notifyWait(); Espo.Ajax.postRequest('MassEmail/action/sendTest', { id: this.model.id, targetList: list }).then(() => { Espo.Ui.success(this.translate('testSent', 'messages', 'MassEmail')); this.close(); }).catch(() => { this.enableButton('sendTest'); }); } } _exports.default = MassEmailSendTestModalView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/dashlets/options/chart', ['views/dashlets/options/base'], function (Dep) { return Dep.extend({ setupBeforeFinal: function () { this.listenTo(this.model, 'change:dateFilter', this.controlDateFilter); this.controlDateFilter(); }, controlDateFilter: function () { if (this.model.get('dateFilter') === 'between') { this.showField('dateFrom'); this.showField('dateTo'); } else { this.hideField('dateFrom'); this.hideField('dateTo'); } }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/contact/record/detail', ['views/record/detail'], function (Dep) { return Dep.extend({}); }); define("modules/crm/views/call/record/list", ["exports", "views/record/list"], function (_exports, _list) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _list = _interopRequireDefault(_list); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _list.default { rowActionsView = 'modules/crm/views/call/record/row-actions/default'; setup() { super.setup(); if (this.getAcl().checkScope(this.entityType, 'edit') && this.getAcl().checkField(this.entityType, 'status', 'edit')) { this.massActionList.push('setHeld'); this.massActionList.push('setNotHeld'); } } /** * @protected * @param {Record} data */ async actionSetHeld(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); if (!model) { return; } Espo.Ui.notify(this.translate('saving', 'messages')); await model.save({ status: 'Held' }, { patch: true }); Espo.Ui.success(this.translate('Saved')); } /** * @protected * @param {Record} data */ async actionSetNotHeld(data) { const id = data.id; if (!id) { return; } const model = this.collection.get(id); if (!model) { return; } Espo.Ui.notify(this.translate('saving', 'messages')); await model.save({ status: 'Not Held' }, { patch: true }); Espo.Ui.success(this.translate('Saved')); } // noinspection JSUnusedGlobalSymbols async massActionSetHeld() { const data = {}; data.ids = this.checkedList; Espo.Ui.notify(this.translate('saving', 'messages')); await Espo.Ajax.postRequest(`${this.collection.entityType}/action/massSetHeld`, data); Espo.Ui.success(this.translate('Saved')); await this.collection.fetch(); data.ids.forEach(id => { if (this.collection.get(id)) { this.checkRecord(id); } }); } // noinspection JSUnusedGlobalSymbols async massActionSetNotHeld() { const data = {}; data.ids = this.checkedList; Espo.Ui.notify(this.translate('saving', 'messages')); await Espo.Ajax.postRequest(`${this.collection.entityType}/action/massSetNotHeld`, data); Espo.Ui.success(this.translate('Saved')); await this.collection.fetch(); data.ids.forEach(id => { if (this.collection.get(id)) { this.checkRecord(id); } }); } } _exports.default = _default; }); define("modules/crm/views/call/fields/contacts", ["exports", "modules/crm/views/meeting/fields/attendees"], function (_exports, _attendees) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _attendees = _interopRequireDefault(_attendees); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _attendees.default { getAttributeList() { return [...super.getAttributeList(), 'phoneNumbersMap']; } getDetailLinkHtml(id, name) { const html = super.getDetailLinkHtml(id, name); const key = this.foreignScope + '_' + id; const phoneNumbersMap = this.model.get('phoneNumbersMap') || {}; if (!(key in phoneNumbersMap)) { return html; } const number = phoneNumbersMap[key]; const $item = $(html); // @todo Format phone number. $item.append(' ', $('').addClass('text-muted middle-dot'), ' ', $('').attr('href', 'tel:' + number).attr('data-phone-number', number).attr('data-action', 'dial').addClass('small').text(number)); return $('
').append($item).get(0).outerHTML; } } _exports.default = _default; }); define("modules/crm/views/calendar/modals/edit-view", ["exports", "views/modal", "model", "views/record/edit-for-modal", "views/fields/enum", "views/fields/varchar", "crm:views/calendar/fields/teams"], function (_exports, _modal, _model, _editForModal, _enum, _varchar, _teams) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _modal = _interopRequireDefault(_modal); _model = _interopRequireDefault(_model); _editForModal = _interopRequireDefault(_editForModal); _enum = _interopRequireDefault(_enum); _varchar = _interopRequireDefault(_varchar); _teams = _interopRequireDefault(_teams); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class CalendarEditViewModal extends _modal.default { // language=Handlebars templateContent = `
{{{record}}}
`; className = 'dialog dialog-record'; /** * @private * @type {EditForModalRecordView} */ recordView; /** * @param {{ * afterSave?: function({id: string}): void, * afterRemove?: function(): void, * id?: string, * }} options */ constructor(options) { super(); this.options = options; } setup() { const id = this.options.id; this.buttonList = [{ name: 'cancel', label: 'Cancel', onClick: () => this.actionCancel() }]; this.isNew = !id; const calendarViewDataList = this.getPreferences().get('calendarViewDataList') || []; if (this.isNew) { this.buttonList.unshift({ name: 'save', label: 'Create', style: 'danger', onClick: () => this.actionSave() }); } else { this.dropdownItemList.push({ name: 'remove', label: 'Remove', onClick: () => this.actionRemove() }); this.buttonList.unshift({ name: 'save', label: 'Save', style: 'primary', onClick: () => this.actionSave() }); } const model = new _model.default(); model.name = 'CalendarView'; const modelData = {}; if (!this.isNew) { calendarViewDataList.forEach(item => { if (id === item.id) { modelData.teamsIds = item.teamIdList || []; modelData.teamsNames = item.teamNames || {}; modelData.id = item.id; modelData.name = item.name; modelData.mode = item.mode; } }); } else { modelData.name = this.translate('Shared', 'labels', 'Calendar'); let foundCount = 0; calendarViewDataList.forEach(item => { if (item.name.indexOf(modelData.name) === 0) { foundCount++; } }); if (foundCount) { modelData.name += ' ' + foundCount; } modelData.id = id; modelData.teamsIds = this.getUser().get('teamsIds') || []; modelData.teamsNames = this.getUser().get('teamsNames') || {}; } model.set(modelData); this.recordView = new _editForModal.default({ model: model, detailLayout: [{ rows: [[{ view: new _varchar.default({ name: 'name', labelText: this.translate('name', 'fields'), params: { required: true } }) }, { view: new _enum.default({ name: 'mode', labelText: this.translate('mode', 'fields', 'DashletOptions'), params: { translation: 'DashletOptions.options.mode', options: this.getMetadata().get('clientDefs.Calendar.sharedViewModeList') || [] } }) }], [{ view: new _teams.default({ name: 'teams', labelText: this.translate('teams', 'fields'), params: { required: true } }) }, false]] }] }); this.assignView('record', this.recordView); if (this.isNew) { this.headerText = this.translate('Create Shared View', 'labels', 'Calendar'); } else { this.headerText = this.translate('Edit Shared View', 'labels', 'Calendar') + ' · ' + modelData.name; } } async actionSave() { if (this.recordView.validate()) { return; } const modelData = this.recordView.fetch(); const calendarViewDataList = this.getPreferences().get('calendarViewDataList') || []; const data = { name: modelData.name, teamIdList: modelData.teamsIds, teamNames: modelData.teamsNames, mode: modelData.mode, id: undefined }; if (this.isNew) { data.id = Math.random().toString(36).substring(2, 12); calendarViewDataList.push(data); } else { data.id = this.getView('record').model.id; calendarViewDataList.forEach((item, i) => { if (item.id === data.id) { calendarViewDataList[i] = data; } }); } Espo.Ui.notify(this.translate('saving', 'messages')); this.disableButton('save'); this.disableButton('remove'); try { await this.getPreferences().save({ calendarViewDataList: calendarViewDataList }, { patch: true }); } catch (e) { this.enableButton('remove'); this.enableButton('save'); return; } Espo.Ui.notify(); this.trigger('after:save', data); if (this.options.afterSave) { this.options.afterSave(data); } this.close(); } async actionRemove() { await this.confirm(this.translate('confirmation', 'messages')); this.disableButton('save'); this.disableButton('remove'); const id = this.options.id; if (!id) { return; } const newCalendarViewDataList = []; const calendarViewDataList = this.getPreferences().get('calendarViewDataList') || []; calendarViewDataList.forEach(item => { if (item.id !== id) { newCalendarViewDataList.push(item); } }); Espo.Ui.notifyWait(); try { await this.getPreferences().save({ calendarViewDataList: newCalendarViewDataList }, { patch: true }); } catch (e) { this.enableButton('remove'); this.enableButton('save'); return; } Espo.Ui.notify(); this.trigger('after:remove'); if (this.options.afterRemove) { this.options.afterRemove(); } this.close(); } } _exports.default = CalendarEditViewModal; }); define("modules/crm/views/calendar/fields/users", ["exports", "views/fields/link-multiple"], function (_exports, _linkMultiple) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _linkMultiple = _interopRequireDefault(_linkMultiple); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class CalendarUsersFieldView extends _linkMultiple.default { foreignScope = 'User'; sortable = true; getSelectBoolFilterList() { if (this.getAcl().getPermissionLevel('userCalendar') === 'team') { return ['onlyMyTeam']; } } getSelectPrimaryFilterName() { return 'active'; } } var _default = _exports.default = CalendarUsersFieldView; }); define("modules/crm/acl/meeting", ["exports", "acl"], function (_exports, _acl) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _acl = _interopRequireDefault(_acl); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MeetingAcl extends _acl.default { // noinspection JSUnusedGlobalSymbols checkModelRead(model, data, precise) { return this._checkModelCustom('read', model, data, precise); } // noinspection JSUnusedGlobalSymbols checkModelStream(model, data, precise) { return this._checkModelCustom('stream', model, data, precise); } _checkModelCustom(action, model, data, precise) { let result = this.checkModel(model, data, action, precise); if (result) { return true; } if (data === false) { return false; } let d = data || {}; if (d[action] === 'no') { return false; } if (model.has('usersIds')) { if (~(model.get('usersIds') || []).indexOf(this.getUser().id)) { return true; } } else if (precise) { return null; } return result; } } var _default = _exports.default = MeetingAcl; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/user/record/panels/tasks', ['crm:views/record/panels/tasks'], function (Dep) { return Dep.extend({ listLayout: { rows: [ [ { name: 'name', link: true, }, { name: 'isOverdue', } ], [ {name: 'status'}, {name: 'dateEnd'}, ], ] }, setup: function () { Dep.prototype.setup.call(this); if (this.getMetadata().get(['entityDefs', 'Task', 'fields', 'assignedUsers'])) { var foreignLink = this.getMetadata().get(['entityDefs', 'Task', 'links', 'assignedUsers', 'foreign']); if (foreignLink) { this.link = foreignLink; } } }, }); }); define("modules/crm/views/task/list", ["exports", "views/list"], function (_exports, _list) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _list = _interopRequireDefault(_list); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _list.default {} _exports.default = _default; ; }); define("modules/crm/views/task/detail", ["exports", "views/detail"], function (_exports, _detail) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _detail = _interopRequireDefault(_detail); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _detail.default {} _exports.default = _default; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/task/record/list-expanded', ['views/record/list-expanded', 'crm:views/task/record/list'], function (Dep, List) { return Dep.extend({ rowActionsView: 'crm:views/task/record/row-actions/default', actionSetCompleted: function (data) { List.prototype.actionSetCompleted.call(this, data); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/task/record/detail', ['views/record/detail'], function (Dep) { return Dep.extend({ duplicateAction: true, setupActionItems: function () { Dep.prototype.setupActionItems.call(this); if (this.getAcl().checkModel(this.model, 'edit')) { if ( !~['Completed', 'Canceled'].indexOf(this.model.get('status')) && this.getAcl().checkField(this.entityType, 'status', 'edit') ) { this.dropdownItemList.push({ 'label': 'Complete', 'name': 'setCompleted' }); } this.listenToOnce(this.model, 'sync', function () { if (~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { this.removeButton('setCompleted'); } }, this); } }, manageAccessEdit: function (second) { Dep.prototype.manageAccessEdit.call(this, second); if (second) { if (!this.getAcl().checkModel(this.model, 'edit', true)) { this.hideActionItem('setCompleted'); } } }, actionSetCompleted: function () { this.model.save({status: 'Completed'}, {patch: true}) .then(() => Espo.Ui.success(this.translate('Saved'))); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/task/record/row-actions/default', ['views/record/row-actions/view-and-edit'], function (Dep) { return Dep.extend({ getActionList: function () { var actionList = Dep.prototype.getActionList.call(this); if (this.options.acl.edit && !~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { actionList.push({ action: 'setCompleted', label: 'Complete', data: { id: this.model.id }, groupIndex: 1, }); } if (this.options.acl.delete) { actionList.push({ action: 'quickRemove', label: 'Remove', data: { id: this.model.id, scope: this.model.entityType }, groupIndex: 0, }); } return actionList; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/task/record/row-actions/dashlet', ['views/record/row-actions/view-and-edit'], function (Dep) { return Dep.extend({ getActionList: function () { var actionList = Dep.prototype.getActionList.call(this); if (this.options.acl.edit && !~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { actionList.push({ action: 'setCompleted', label: 'Complete', data: { id: this.model.id }, groupIndex: 1, }); } if (this.options.acl.delete) { actionList.push({ action: 'quickRemove', label: 'Remove', data: { id: this.model.id, scope: this.model.entityType }, groupIndex: 0, }); } return actionList; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/task/modals/detail', ['views/modals/detail'], function (Dep) { return Dep.extend({}); }); define("modules/crm/views/task/fields/tasks", ["exports", "views/fields/link-multiple-with-status"], function (_exports, _linkMultipleWithStatus) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _linkMultipleWithStatus = _interopRequireDefault(_linkMultipleWithStatus); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _linkMultipleWithStatus.default { setup() { super.setup(); this.canceledStatusList = this.getMetadata().get(`scopes.Task.canceledStatusList`) || []; } } _exports.default = _default; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/task/fields/priority-for-dashlet', ['views/fields/enum'], function (Dep) { return Dep.extend({ data: function () { var data = Dep.prototype.data.call(this); if (!data.style || data.style === 'default') { data.isNotEmpty = false; } return data; }, }); }); define("modules/crm/views/task/fields/is-overdue", ["exports", "views/fields/base", "moment"], function (_exports, _base, _moment) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _base = _interopRequireDefault(_base); _moment = _interopRequireDefault(_moment); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ // noinspection JSUnusedGlobalSymbols class _default extends _base.default { readOnly = true; templateContent = ` {{~#if isOverdue}} {{translate "overdue" scope="Task"}} {{/if~}} `; data() { let isOverdue = false; if (['Completed', 'Canceled'].indexOf(this.model.get('status')) === -1) { if (this.model.has('dateEnd')) { if (!this.isDate()) { const value = this.model.get('dateEnd'); if (value) { const d = this.getDateTime().toMoment(value); const now = _moment.default.tz(this.getDateTime().timeZone || 'UTC'); if (d.unix() < now.unix()) { isOverdue = true; } } } else { const value = this.model.get('dateEndDate'); if (value) { const d = _moment.default.utc(value + ' 23:59', this.getDateTime().internalDateTimeFormat); const now = this.getDateTime().getNowMoment(); if (d.unix() < now.unix()) { isOverdue = true; } } } } } return { isOverdue: isOverdue }; } setup() { this.mode = 'detail'; } isDate() { const dateValue = this.model.get('dateEnd'); if (dateValue) { return true; } return false; } } _exports.default = _default; }); define("modules/crm/views/task/fields/date-end", ["exports", "views/fields/datetime-optional", "moment"], function (_exports, _datetimeOptional, _moment) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _datetimeOptional = _interopRequireDefault(_datetimeOptional); _moment = _interopRequireDefault(_moment); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class TaskDateEndFieldView extends _datetimeOptional.default { isEnd = true; getAttributeList() { return [...super.getAttributeList(), 'status']; } data() { const data = super.data(); const status = this.model.attributes.status; if (!status || this.notActualStatusList.includes(status)) { return data; } if (this.mode === this.MODE_DETAIL || this.mode === this.MODE_LIST) { if (this.isDateInPast()) { data.isOverdue = true; } else if (this.isDateToday()) { data.style = 'warning'; } } if (data.isOverdue) { data.style = 'danger'; } return data; } setup() { super.setup(); this.notActualStatusList = [...(this.getMetadata().get(`scopes.${this.entityType}.completedStatusList`) || []), ...(this.getMetadata().get(`scopes.${this.entityType}.canceledStatusList`) || [])]; if (this.isEditMode() || this.isDetailMode()) { this.on('change', () => { if (!this.model.get('dateEnd') && this.model.get('reminders')) { this.model.set('reminders', []); } }); } } /** * @private * @return {boolean} */ isDateInPast() { if (this.isDate()) { const value = this.model.get(this.nameDate); if (value) { const d = _moment.default.tz(value + ' 23:59', this.getDateTime().getTimeZone()); const now = this.getDateTime().getNowMoment(); if (d.unix() < now.unix()) { return true; } } } const value = this.model.get(this.name); if (value) { const d = this.getDateTime().toMoment(value); const now = (0, _moment.default)().tz(this.getDateTime().timeZone || 'UTC'); if (d.unix() < now.unix()) { return true; } } return false; } /** * @private * @return {boolean} */ isDateToday() { if (!this.isDate()) { return false; } return this.getDateTime().getToday() === this.model.attributes[this.nameDate]; } } var _default = _exports.default = TaskDateEndFieldView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ 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', () => { this.model.fetch(); }); this.listenTo(this.model, 'after:unrelate', () => { this.model.fetch(); }); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/target-list/record/row-actions/opted-out', ['views/record/row-actions/default'], function (Dep) { return Dep.extend({ getActionList: function () { return [ { action: 'cancelOptOut', text: this.translate('Cancel Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id, type: this.model.entityType, }, }, ]; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/target-list/record/row-actions/default', ['views/record/row-actions/relationship'], function (Dep) { return Dep.extend({ getActionList: function () { const list = Dep.prototype.getActionList.call(this); if (this.options.acl.edit) { if (this.model.get('targetListIsOptedOut')) { list.push({ action: 'cancelOptOut', text: this.translate('Cancel Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id, type: this.model.entityType, }, }); } else { list.push({ action: 'optOut', text: this.translate('Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id, type: this.model.entityType, }, }); } } return list; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/target-list/record/panels/relationship', ['views/record/panels/relationship'], function (Dep) { return Dep.extend({ fetchOnModelAfterRelate: true, actionOptOut: function (data) { this.confirm(this.translate('confirmation', 'messages'), () => { Espo.Ajax .postRequest('TargetList/action/optOut', { id: this.model.id, targetId: data.id, targetType: data.type, }) .then(() => { this.collection.fetch(); Espo.Ui.success(this.translate('Done')); this.model.trigger('opt-out'); }); }); }, actionCancelOptOut: function (data) { this.confirm(this.translate('confirmation', 'messages'), () => { Espo.Ajax .postRequest('TargetList/action/cancelOptOut', { id: this.model.id, targetId: data.id, targetType: data.type, }) .then(() => { this.collection.fetch(); Espo.Ui.success(this.translate('Done')); this.collection.fetch(); this.model.trigger('cancel-opt-out'); }); }); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/target-list/record/panels/opted-out', ['views/record/panels/relationship', 'multi-collection'], function (Dep, MultiCollection) { return Dep.extend({ name: 'optedOut', template: 'crm:target-list/record/panels/opted-out', scopeList: ['Contact', 'Lead', 'User', 'Account'], data: function () { return { currentTab: this.currentTab, scopeList: this.scopeList, }; }, getStorageKey: function () { return 'target-list-opted-out-' + this.model.entityType + '-' + this.name; }, setup: function () { this.seeds = {}; let linkList = this.getMetadata().get(['scopes', 'TargetList', 'targetLinkList']) || []; this.scopeList = []; linkList.forEach(link => { let entityType = this.getMetadata().get(['entityDefs', 'TargetList', 'links', link, 'entity']); if (entityType) { this.scopeList.push(entityType); } }); this.listLayout = {}; this.scopeList.forEach(scope => { this.listLayout[scope] = { rows: [ [ { name: 'name', link: true, } ] ] }; }); if (this.scopeList.length) { this.wait(true); var i = 0; this.scopeList.forEach(scope => { this.getModelFactory().create(scope, seed => { this.seeds[scope] = seed; i++; if (i === this.scopeList.length) { this.wait(false); } }); }); } this.listenTo(this.model, 'opt-out', () => { this.actionRefresh(); }); this.listenTo(this.model, 'cancel-opt-out', () => { this.actionRefresh(); }); }, afterRender: function () { var url = 'TargetList/' + this.model.id + '/' + this.name; this.collection = new MultiCollection(); this.collection.seeds = this.seeds; this.collection.url = url; this.collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; this.listenToOnce(this.collection, 'sync', () => { this.createView('list', 'views/record/list-expanded', { selector: '> .list-container', pagination: false, type: 'listRelationship', rowActionsView: 'crm:views/target-list/record/row-actions/opted-out', checkboxes: false, collection: this.collection, listLayout: this.listLayout, }, view => { view.render(); }); }); this.collection.fetch(); }, actionRefresh: function () { this.collection.fetch(); }, actionCancelOptOut: function (data) { this.confirm(this.translate('confirmation', 'messages'), () => { Espo.Ajax.postRequest('TargetList/action/cancelOptOut', { id: this.model.id, targetId: data.id, targetType: data.type, }).then(() => { this.collection.fetch(); }); }); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/target-list/fields/target-status', ['views/fields/base'], function (Dep) { return Dep.extend({ getValueForDisplay: function () { if (this.model.get('isOptedOut')) { return this.getLanguage().translateOption('Opted Out', 'targetStatus', 'TargetList'); } return this.getLanguage().translateOption('Listed', 'targetStatus', 'TargetList'); } }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/target-list/fields/including-action-list', ['views/fields/multi-enum'], function (Dep) { return Dep.extend({ setupOptions: function () { this.params.options = this.getMetadata().get('entityDefs.CampaignLogRecord.fields.action.options') || []; this.translatedOptions = {}; this.params.options.forEach(item => { this.translatedOptions[item] = this.getLanguage().translateOption(item, 'action', 'CampaignLogRecord'); }); }, }); }); define("modules/crm/views/stream/notes/event-confirmation", ["exports", "views/stream/note"], function (_exports, _note) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _note = _interopRequireDefault(_note); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class EventConfirmationNoteView extends _note.default { // language=Handlebars templateContent = ` {{#unless noEdit}}
{{{right}}}
{{/unless}}
{{{avatar}}}
{{#if iconHtml}}{{{iconHtml}}}{{/if}} {{{message}}}
`; data() { const statusIconClass = { 'success': 'fas fa-check fa-sm', 'danger': 'fas fa-times fa-sm', 'warning': 'fas fa-question fa-sm' }[this.style] || ''; return { ...super.data(), statusText: this.statusText, style: this.style, statusIconClass: statusIconClass, iconHtml: this.getIconHtml() }; } init() { if (this.getUser().isAdmin()) { this.isRemovable = true; } super.init(); } setup() { this.inviteeType = this.model.get('relatedType'); this.inviteeId = this.model.get('relatedId'); this.inviteeName = this.model.get('relatedName'); const data = this.model.get('data') || {}; const status = data.status || 'Tentative'; this.style = data.style || 'default'; this.statusText = this.getLanguage().translateOption(status, 'acceptanceStatus', 'Meeting'); this.messageName = 'eventConfirmation' + status; if (this.isThis) { this.messageName += 'This'; } this.messageData['invitee'] = $('').attr('href', '#' + this.inviteeType + '/view/' + this.inviteeId).attr('data-id', this.inviteeId).attr('data-scope', this.inviteeType).text(this.inviteeName); this.createMessage(); } } // noinspection JSUnusedGlobalSymbols var _default = _exports.default = EventConfirmationNoteView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/list-activities-dashlet', ['views/record/list-expanded', 'crm:views/meeting/record/list', 'crm:views/task/record/list'], function (Dep, MeetingList, TaskList) { return Dep.extend({ actionSetHeld: function (data) { MeetingList.prototype.actionSetHeld.call(this, data); }, actionSetNotHeld: function (data) { MeetingList.prototype.actionSetNotHeld.call(this, data); }, actionSetCompleted: function (data) { TaskList.prototype.actionSetCompleted.call(this, data); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/row-actions/tasks', ['views/record/row-actions/relationship-no-unlink'], function (Dep) { return Dep.extend({ getActionList: function () { var list = [{ action: 'quickView', label: 'View', data: { id: this.model.id }, link: '#' + this.model.entityType + '/view/' + this.model.id, groupIndex: 0, }]; if (this.options.acl.edit) { list.push({ action: 'quickEdit', label: 'Edit', data: { id: this.model.id }, link: '#' + this.model.entityType + '/edit/' + this.model.id, groupIndex: 0, }); if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { list.push({ action: 'Complete', text: this.translate('Complete', 'labels', 'Task'), data: { id: this.model.id }, groupIndex: 1, }); } } if (this.options.acl.delete) { list.push({ action: 'removeRelated', label: 'Remove', data: { id: this.model.id }, groupIndex: 0, }); } return list; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/row-actions/relationship-target', ['views/record/row-actions/relationship-unlink-only'], function (Dep) { return Dep.extend({ getActionList: function () { var list = Dep.prototype.getActionList.call(this); if (this.options.acl.edit) { if (this.model.get('isOptedOut')) { list.push({ action: 'cancelOptOut', text: this.translate('Cancel Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id }, groupIndex: 1, }); } else { list.push({ action: 'optOut', text: this.translate('Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id }, groupIndex: 1, }); } } return list; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/row-actions/history', ['views/record/row-actions/relationship'], function (Dep) { return Dep.extend({ getActionList: function () { var list = [{ action: 'quickView', label: 'View', data: { id: this.model.id }, link: '#' + this.model.entityType + '/view/' + this.model.id, groupIndex: 0, }]; if (this.model.entityType === 'Email') { list.push({ action: 'reply', text: this.translate('Reply', 'labels', 'Email'), data: { id: this.model.id }, groupIndex: 1, }); } if (this.options.acl.edit) { list = list.concat([ { action: 'quickEdit', label: 'Edit', data: { id: this.model.id }, link: '#' + this.model.entityType + '/edit/' + this.model.id, groupIndex: 0, }, ]); } if (this.options.acl.delete) { list.push({ action: 'removeRelated', label: 'Remove', data: { id: this.model.id }, groupIndex: 0, }); } return list; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/row-actions/activities', ['views/record/row-actions/relationship'], function (Dep) { return Dep.extend({ getActionList: function () { var list = [{ action: 'quickView', label: 'View', data: { id: this.model.id, }, link: '#' + this.model.entityType + '/view/' + this.model.id, groupIndex: 0, }]; if (this.options.acl.edit) { list.push({ action: 'quickEdit', label: 'Edit', data: { id: this.model.id, }, link: '#' + this.model.entityType + '/edit/' + this.model.id, groupIndex: 0, }); if (this.model.entityType === 'Meeting' || this.model.entityType === 'Call') { list.push({ action: 'setHeld', text: this.translate('Set Held', 'labels', 'Meeting'), data: { id: this.model.id, }, groupIndex: 1, }); list.push({ action: 'setNotHeld', text: this.translate('Set Not Held', 'labels', 'Meeting'), data: { id: this.model.id, }, groupIndex: 1, }); } } if (this.options.acl.delete) { list.push({ action: 'removeRelated', label: 'Remove', data: { id: this.model.id, }, groupIndex: 0, }); } return list; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/row-actions/activities-dashlet', ['views/record/row-actions/view-and-edit'], function (Dep) { return Dep.extend({ getActionList: function () { var actionList = Dep.prototype.getActionList.call(this); var scope = this.model.entityType; actionList.forEach(function (item) { item.data = item.data || {}; item.data.scope = this.model.entityType; }, this); if (scope === 'Task') { if (this.options.acl.edit && !~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { actionList.push({ action: 'setCompleted', label: 'Complete', data: { id: this.model.id }, groupIndex: 1, }); } } else { if (this.options.acl.edit && !~['Held', 'Not Held'].indexOf(this.model.get('status'))) { actionList.push({ action: 'setHeld', label: 'Set Held', data: { id: this.model.id, scope: this.model.entityType }, groupIndex: 1, }); actionList.push({ action: 'setNotHeld', label: 'Set Not Held', data: { id: this.model.id, scope: this.model.entityType }, groupIndex: 1, }); } } if (this.options.acl.edit) { actionList.push({ action: 'quickRemove', label: 'Remove', data: { id: this.model.id, scope: this.model.entityType }, groupIndex: 0, }); } return actionList; }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/record/panels/target-lists', ['views/record/panels/relationship'], function (Dep) { return Dep.extend({ actionOptOut: function (data) { this.confirm(this.translate('confirmation', 'messages'), () => { Espo.Ajax .postRequest('TargetList/action/optOut', { id: data.id, targetId: this.model.id, targetType: this.model.entityType, }) .then(() => { this.collection.fetch(); Espo.Ui.success(this.translate('Done')); this.model.trigger('opt-out'); }); }); }, actionCancelOptOut: function (data) { this.confirm(this.translate('confirmation', 'messages'), () => { Espo.Ajax .postRequest('TargetList/action/cancelOptOut', { id: data.id, targetId: this.model.id, targetType: this.model.entityType, }) .then(() => { this.collection.fetch(); Espo.Ui.success(this.translate('Done')); this.model.trigger('cancel-opt-out'); }); }); }, }); }); define("modules/crm/views/record/panels/history", ["exports", "crm:views/record/panels/activities", "email-helper", "helpers/record-modal"], function (_exports, _activities, _emailHelper, _recordModal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _activities = _interopRequireDefault(_activities); _emailHelper = _interopRequireDefault(_emailHelper); _recordModal = _interopRequireDefault(_recordModal); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class HistoryPanelView extends _activities.default { name = 'history'; orderBy = 'dateStart'; orderDirection = 'desc'; rowActionsView = 'crm:views/record/row-actions/history'; actionList = []; listLayout = { 'Email': { rows: [[{ name: 'ico', view: 'crm:views/fields/ico' }, { name: 'name', link: true }], [{ name: 'dateSent', soft: true }, { name: 'from' }, { name: 'hasAttachment', view: 'views/email/fields/has-attachment' }]] } }; where = { scope: false }; setupActionList() { super.setupActionList(); this.actionList.push({ action: 'archiveEmail', label: 'Archive Email', acl: 'create', aclScope: 'Email' }); } getArchiveEmailAttributes(scope, data, callback) { const attributes = { dateSent: this.getDateTime().getNow(15), status: 'Archived', from: this.model.get('emailAddress'), to: this.getUser().get('emailAddress') }; if (this.model.entityType === 'Contact') { if (this.getConfig().get('b2cMode')) { attributes.parentType = 'Contact'; attributes.parentName = this.model.get('name'); attributes.parentId = this.model.id; } else { if (this.model.get('accountId')) { attributes.parentType = 'Account'; attributes.parentId = this.model.get('accountId'); attributes.parentName = this.model.get('accountName'); } } } else if (this.model.entityType === 'Lead') { attributes.parentType = 'Lead'; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } attributes.nameHash = {}; attributes.nameHash[this.model.get('emailAddress')] = this.model.get('name'); if (scope) { if (!attributes.parentId) { if (this.checkParentTypeAvailability(scope, this.model.entityType)) { attributes.parentType = this.model.entityType; attributes.parentId = this.model.id; attributes.parentName = this.model.get('name'); } } else { if (attributes.parentType && !this.checkParentTypeAvailability(scope, attributes.parentType)) { attributes.parentType = null; attributes.parentId = null; attributes.parentName = null; } } } callback.call(this, attributes); } // noinspection JSUnusedGlobalSymbols actionArchiveEmail(data) { const scope = 'Email'; let relate = null; if (this.model.hasLink('emails')) { relate = { model: this.model, link: this.model.getLinkParam('emails', 'foreign') }; } this.getArchiveEmailAttributes(scope, data, attributes => { const helper = new _recordModal.default(); helper.showCreate(this, { entityType: 'Email', attributes: attributes, relate: relate, afterSave: () => { this.collection.fetch(); this.model.trigger('after:relate'); } }); }); } // noinspection JSUnusedGlobalSymbols actionReply(data) { const id = data.id; if (!id) { return; } const emailHelper = new _emailHelper.default(); Espo.Ui.notifyWait(); this.getModelFactory().create('Email').then(model => { model.id = id; model.fetch().then(() => { const attributes = emailHelper.getReplyAttributes(model, data, this.getPreferences().get('emailReplyToAllByDefault')); const viewName = this.getMetadata().get('clientDefs.Email.modalViews.compose') || 'views/modals/compose-email'; return this.createView('quickCreate', viewName, { attributes: attributes, focusForCreate: true }); }).then(view => { view.render(); this.listenToOnce(view, 'after:save', () => { this.collection.fetch(); this.model.trigger('after:relate'); }); Espo.Ui.notify(false); }); }); } } var _default = _exports.default = HistoryPanelView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/detail', ['views/detail'], function (Dep) { /** Left for bc. */ return Dep.extend({}); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/record/list', ['views/record/list'], function (Dep) { return Dep.extend({ }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/record/kanban', ['views/record/kanban'], function (Dep) { return Dep.extend({ handleAttributesOnGroupChange: function (model, attributes, group) { if (this.statusField !== 'stage') { return; } var probability = this.getMetadata() .get(['entityDefs', 'Opportunity', 'fields', 'stage', 'probabilityMap', group]); probability = parseInt(probability); attributes['probability'] = probability; }, }); }); define("modules/crm/views/opportunity/record/edit", ["exports", "views/record/edit"], function (_exports, _edit) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _edit = _interopRequireDefault(_edit); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class OpportunityEditRecordView extends _edit.default {} var _default = _exports.default = OpportunityEditRecordView; }); define("modules/crm/views/opportunity/record/edit-small", ["exports", "views/record/edit-small"], function (_exports, _editSmall) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _editSmall = _interopRequireDefault(_editSmall); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class OpportunityEditSmallRecordView extends _editSmall.default {} var _default = _exports.default = OpportunityEditSmallRecordView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/record/panels/activities', ['crm:views/record/panels/activities'], function (Dep) { return Dep.extend({ getComposeEmailAttributes: function (scope, data, callback) { data = data || {}; Espo.Ui.notifyWait(); Dep.prototype.getComposeEmailAttributes.call(this, scope, data, (attributes) => { Espo.Ajax.getRequest('Opportunity/action/emailAddressList?id=' + this.model.id).then(list => { attributes.to = ''; attributes.cc = ''; attributes.nameHash = {}; list.forEach(item => { attributes.to += item.emailAddress + ';'; attributes.nameHash[item.emailAddress] = item.name; }); Espo.Ui.notify(false); callback.call(this, attributes); }); }) }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/fields/stage', ['views/fields/enum'], function (Dep) { return Dep.extend({ setup: function () { Dep.prototype.setup.call(this); this.probabilityMap = this.getMetadata().get('entityDefs.Opportunity.fields.stage.probabilityMap') || {}; if (this.mode !== 'list') { this.on('change', () => { var probability = this.probabilityMap[this.model.get(this.name)]; if (probability !== null && probability !== undefined) { this.model.set('probability', probability); } }); } }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/fields/lead-source', ['views/fields/enum'], function (Dep) { return Dep.extend({}); }); define("modules/crm/views/opportunity/fields/last-stage", ["exports", "views/fields/enum"], function (_exports, _enum) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _enum = _interopRequireDefault(_enum); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ // noinspection JSUnusedGlobalSymbols class _default extends _enum.default { setup() { /** @type {string[]} */ const optionList = this.getMetadata().get('entityDefs.Opportunity.fields.stage.options', []); /** @type {Record.} */ const probabilityMap = this.getMetadata().get('entityDefs.Opportunity.fields.stage.probabilityMap', {}); this.params.options = []; optionList.forEach(item => { if (!probabilityMap[item]) { return; } if (probabilityMap[item] === 100) { return; } this.params.options.push(item); }); this.params.translation = 'Opportunity.options.stage'; super.setup(); } } _exports.default = _default; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/fields/contacts', ['views/fields/link-multiple-with-columns-with-primary'], function (Dep) { /** Left for bc. */ return Dep.extend({}); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/opportunity/fields/contact-role', ['views/fields/enum'], function (Dep) { return Dep.extend({ searchTypeList: ['anyOf', 'noneOf'], }); }); define("modules/crm/views/opportunity/admin/field-manager/fields/probability-map", ["exports", "views/fields/base", "jquery"], function (_exports, _base, _jquery) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _base = _interopRequireDefault(_base); _jquery = _interopRequireDefault(_jquery); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ // noinspection JSUnusedGlobalSymbols class _default extends _base.default { editTemplateContent = ` `; setup() { super.setup(); this.listenTo(this.model, 'change:options', function (m, v, o) { const probabilityMap = this.model.get('probabilityMap') || {}; if (o.ui) { (this.model.get('options') || []).forEach(item => { if (!(item in probabilityMap)) { probabilityMap[item] = 50; } }); this.model.set('probabilityMap', probabilityMap); } this.reRender(); }); } data() { const data = {}; const values = this.model.get('probabilityMap') || {}; data.stageList = this.model.get('options') || []; data.values = values; return data; } fetch() { const data = { probabilityMap: {} }; (this.model.get('options') || []).forEach(item => { data.probabilityMap[item] = parseInt((0, _jquery.default)(this.element).find(`input[data-name="${item}"]`).val()); }); return data; } afterRender() { (0, _jquery.default)(this.element).find('input').on('change', () => { this.trigger('change'); }); } } _exports.default = _default; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/notification/items/event-attendee', ['views/notification/items/base'], function (Dep) { return Dep.extend({ messageName: 'eventAttendee', templateContent: `
{{{avatar}}}
{{{message}}}
{{{createdAt}}}
`, setup: function () { let data = this.model.get('data') || {}; this.userId = data.userId; this.messageData['entityType'] = this.translateEntityType(data.entityType); this.messageData['entity'] = $('
') .attr('href', '#' + data.entityType + '/view/' + data.entityId) .attr('data-id', data.entityId) .attr('data-scope', data.entityType) .text(data.entityName); this.messageData['user'] = $('') .attr('href', '#User/view/' + data.userId) .attr('data-id', data.userId) .attr('data-scope', 'User') .text(data.userName); this.createMessage(); }, }); }); define("modules/crm/views/meeting/popup-notification", ["exports", "views/popup-notification"], function (_exports, _popupNotification) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _popupNotification = _interopRequireDefault(_popupNotification); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MeetingPopupNotificationView extends _popupNotification.default { template = 'crm:meeting/popup-notification'; type = 'event'; style = 'primary'; closeButton = true; setup() { if (!this.notificationData.entityType) { return; } const promise = this.getModelFactory().create(this.notificationData.entityType, model => { const field = this.notificationData.dateField; const fieldType = model.getFieldParam(field, 'type') || 'base'; const viewName = this.getFieldManager().getViewName(fieldType); model.set(this.notificationData.attributes); this.createView('date', viewName, { model: model, mode: 'detail', selector: `.field[data-name="${field}"]`, name: field, readOnly: true }); }); this.wait(promise); } data() { return { header: this.translate(this.notificationData.entityType, 'scopeNames'), dateField: this.notificationData.dateField, ...super.data() }; } onCancel() { Espo.Ajax.postRequest('Activities/action/removePopupNotification', { id: this.notificationId }); } } var _default = _exports.default = MeetingPopupNotificationView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/record/list-expanded', ['views/record/list-expanded', 'crm:views/meeting/record/list'], function (Dep, List) { return Dep.extend({ actionSetHeld: function (data) { List.prototype.actionSetHeld.call(this, data); }, actionSetNotHeld: function (data) { List.prototype.actionSetNotHeld.call(this, data); }, }); }); define("modules/crm/views/meeting/record/edit-small", ["exports", "views/record/edit"], function (_exports, _edit) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _edit = _interopRequireDefault(_edit); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _edit.default {} _exports.default = _default; }); define("modules/crm/views/meeting/record/detail", ["exports", "views/record/detail"], function (_exports, _detail) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _detail = _interopRequireDefault(_detail); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MeetingDetailRecordView extends _detail.default { duplicateAction = true; setupActionItems() { super.setupActionItems(); if (!this.getAcl().checkModel(this.model, 'edit')) { return; } if (['Held', 'Not Held'].includes(this.model.get('status')) || !this.getAcl().checkField(this.entityType, 'status', 'edit')) { return; } const historyStatusList = this.getMetadata().get(`scopes.${this.entityType}.historyStatusList`) || []; if (!historyStatusList.includes('Held') || !historyStatusList.includes('Not Held')) { return; } this.dropdownItemList.push({ 'label': 'Set Held', 'name': 'setHeld', onClick: () => this.actionSetHeld() }); this.dropdownItemList.push({ 'label': 'Set Not Held', 'name': 'setNotHeld', onClick: () => this.actionSetNotHeld() }); } manageAccessEdit(second) { super.manageAccessEdit(second); if (second && !this.getAcl().checkModel(this.model, 'edit', true)) { this.hideActionItem('setHeld'); this.hideActionItem('setNotHeld'); } } actionSetHeld() { this.model.save({ status: 'Held' }, { patch: true }).then(() => { Espo.Ui.success(this.translate('Saved')); this.removeActionItem('setHeld'); this.removeActionItem('setNotHeld'); }); } actionSetNotHeld() { this.model.save({ status: 'Not Held' }, { patch: true }).then(() => { Espo.Ui.success(this.translate('Saved')); this.removeActionItem('setHeld'); this.removeActionItem('setNotHeld'); }); } } var _default = _exports.default = MeetingDetailRecordView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/record/row-actions/default', ['views/record/row-actions/view-and-edit'], function (Dep) { return Dep.extend({ getActionList: function () { var actionList = Dep.prototype.getActionList.call(this); actionList.forEach(item => { item.data = item.data || {}; item.data.scope = this.model.entityType; }); if ( this.options.acl.edit && !['Held', 'Not Held'].includes(this.model.get('status')) && this.getAcl().checkField(this.model.entityType, 'status', 'edit') ) { actionList.push({ action: 'setHeld', label: 'Set Held', data: { id: this.model.id, scope: this.model.entityType, }, groupIndex: 1, }); actionList.push({ action: 'setNotHeld', label: 'Set Not Held', data: { id: this.model.id, scope: this.model.entityType, }, groupIndex: 1, }); } if (this.options.acl.delete) { actionList.push({ action: 'quickRemove', label: 'Remove', data: { id: this.model.id, scope: this.model.entityType, }, groupIndex: 0, }); } return actionList; } }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/record/row-actions/dashlet', ['views/record/row-actions/view-and-edit'], function (Dep) { return Dep.extend({ getActionList: function () { var actionList = Dep.prototype.getActionList.call(this); actionList.forEach(item => { item.data = item.data || {}; item.data.scope = this.model.entityType; }); if ( this.options.acl.edit && !['Held', 'Not Held'].includes(this.model.get('status')) && this.getAcl().checkField(this.model.entityType, 'status', 'edit') ) { actionList.push({ action: 'setHeld', label: 'Set Held', data: { id: this.model.id, scope: this.model.entityType, }, groupIndex: 1, }); actionList.push({ action: 'setNotHeld', label: 'Set Not Held', data: { id: this.model.id, scope: this.model.entityType, }, groupIndex: 1, }); } if (this.options.acl.delete) { actionList.push({ action: 'quickRemove', label: 'Remove', data: { id: this.model.id, scope: this.model.entityType, }, groupIndex: 0, }); } return actionList; } }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/record/panels/scheduler', ['views/record/panels/bottom'], function (Dep) { return Dep.extend({ templateContent: '
{{{scheduler}}}
', setup: function () { Dep.prototype.setup.call(this); var viewName = this.getMetadata().get(['clientDefs', this.scope, 'schedulerView']) || 'crm:views/scheduler/scheduler'; this.createView('scheduler', viewName, { selector: '.scheduler-container', notToRender: true, model: this.model, }); this.once('after:render', () => { if (this.disabled) { return; } this.getView('scheduler').render(); this.getView('scheduler').notToRender = false; }); if (this.defs.disabled) { this.once('show', () => { this.getView('scheduler').render(); this.getView('scheduler').notToRender = false; }); } }, actionRefresh: function () { this.getView('scheduler').reRender(); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/record/panels/attendees', ['views/record/panels/side'], function (Dep) { return Dep.extend({ setupFields: function () { this.fieldList = []; this.fieldList.push('users'); if (this.getAcl().check('Contact') && !this.getMetadata().get('scopes.Contact.disabled')) { this.fieldList.push('contacts'); } if (this.getAcl().check('Lead') && !this.getMetadata().get('scopes.Lead.disabled')) { this.fieldList.push('leads'); } }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/modals/send-invitations', ['views/modal', 'collection'], function (Dep, Collection) { /** * @module crm_views/meeting/modals/send-invitations */ /** * @class * @name Class * @extends module:views/modal * @memberOf module:crm_views/meeting/modals/send-invitations */ return Dep.extend(/** @lends module:crm_views/meeting/modals/send-invitations.Class# */{ backdrop: true, templateContent: `

{{message}}

{{{list}}}
`, data: function () { return { message: this.translate('sendInvitationsToSelectedAttendees', 'messages', 'Meeting'), }; }, setup: function () { Dep.prototype.setup.call(this); this.shortcutKeys = {}; this.shortcutKeys['Control+Enter'] = e => { if (!this.hasAvailableActionItem('send')) { return; } e.preventDefault(); this.actionSend(); }; this.$header = $('').append( $('') .text(this.translate(this.model.entityType, 'scopeNames')), ' ', $('') .text(this.model.get('name')), ' ', $('') .text(this.translate('Send Invitations', 'labels', 'Meeting')) ); this.addButton({ label: 'Send', name: 'send', style: 'danger', disabled: true, }); this.addButton({ label: 'Cancel', name: 'cancel', }); this.collection = new Collection(); this.collection.url = this.model.entityType + `/${this.model.id}/attendees`; this.wait( this.collection.fetch() .then(() => { Espo.Utils.clone(this.collection.models).forEach(model => { model.entityType = model.get('_scope'); if (!model.get('emailAddress')) { this.collection.remove(model.id); } }); return this.createView('list', 'views/record/list', { selector: '.list-container', collection: this.collection, rowActionsDisabled: true, massActionsDisabled: true, checkAllResultDisabled: true, selectable: true, buttonsDisabled: true, listLayout: [ { name: 'name', customLabel: this.translate('name', 'fields'), notSortable: true, }, { name: 'acceptanceStatus', width: 40, customLabel: this.translate('acceptanceStatus', 'fields', 'Meeting'), notSortable: true, view: 'views/fields/enum', params: { options: this.model.getFieldParam('acceptanceStatus', 'options'), style: this.model.getFieldParam('acceptanceStatus', 'style'), }, }, ], }) }) .then(view => { this.collection.models .filter(model => { let status = model.get('acceptanceStatus'); return !status || status === 'None'; }) .forEach(model => { this.getListView().checkRecord(model.id); }); this.listenTo(view, 'check', () => this.controlSendButton()); this.controlSendButton(); }) ); }, controlSendButton: function () { this.getListView().checkedList.length ? this.enableButton('send') : this.disableButton('send'); }, /** * @return {module:views/record/list} */ getListView: function () { return this.getView('list'); }, actionSend: function () { this.disableButton('send'); Espo.Ui.notifyWait(); let targets = this.getListView().checkedList.map(id => { return { entityType: this.collection.get(id).entityType, id: id, }; }); Espo.Ajax .postRequest(this.model.entityType + '/action/sendInvitations', { id: this.model.id, targets: targets, }) .then(result => { result ? Espo.Ui.success(this.translate('Sent')) : Espo.Ui.warning(this.translate('nothingHasBeenSent', 'messages', 'Meeting')); this.trigger('sent'); this.close(); }) .catch(() => { this.enableButton('send'); }); }, }); }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/modals/send-cancellation', ['views/modal', 'collection'], function (Dep, Collection) { /** * @module crm_views/meeting/modals/send-cancellation */ /** * @class * @name Class * @extends module:views/modal * @memberOf module:crm_views/meeting/modals/send-cancellation */ return Dep.extend(/** @lends module:crm_views/meeting/modals/send-cancellation.Class# */{ backdrop: true, templateContent: `

{{message}}

{{{list}}}
`, data: function () { return { message: this.translate('sendCancellationsToSelectedAttendees', 'messages', 'Meeting'), }; }, setup: function () { Dep.prototype.setup.call(this); this.shortcutKeys = {}; this.shortcutKeys['Control+Enter'] = e => { if (!this.hasAvailableActionItem('send')) { return; } e.preventDefault(); this.actionSend(); }; this.$header = $('').append( $('') .text(this.translate(this.model.entityType, 'scopeNames')), ' ', $('') .text(this.model.get('name')), ' ', $('') .text(this.translate('Send Cancellation', 'labels', 'Meeting')) ); this.addButton({ label: 'Send', name: 'send', style: 'danger', disabled: true, }); this.addButton({ label: 'Cancel', name: 'cancel', }); this.collection = new Collection(); this.collection.url = this.model.entityType + `/${this.model.id}/attendees`; this.wait( this.collection.fetch() .then(() => { Espo.Utils.clone(this.collection.models).forEach(model => { model.entityType = model.get('_scope'); if (!model.get('emailAddress')) { this.collection.remove(model.id); } }); return this.createView('list', 'views/record/list', { selector: '.list-container', collection: this.collection, rowActionsDisabled: true, massActionsDisabled: true, checkAllResultDisabled: true, selectable: true, buttonsDisabled: true, listLayout: [ { name: 'name', customLabel: this.translate('name', 'fields'), notSortable: true, }, { name: 'acceptanceStatus', width: 40, customLabel: this.translate('acceptanceStatus', 'fields', 'Meeting'), notSortable: true, view: 'views/fields/enum', params: { options: this.model.getFieldParam('acceptanceStatus', 'options'), style: this.model.getFieldParam('acceptanceStatus', 'style'), }, }, ], }) }) .then(view => { this.collection.models .filter(model => { if (model.id === this.getUser().id && model.entityType === 'User') { return false; } return true; }) .forEach(model => { this.getListView().checkRecord(model.id); }); this.listenTo(view, 'check', () => this.controlSendButton()); this.controlSendButton(); }) ); }, controlSendButton: function () { this.getListView().checkedList.length ? this.enableButton('send') : this.disableButton('send'); }, /** * @return {module:views/record/list} */ getListView: function () { return this.getView('list'); }, actionSend: function () { this.disableButton('send'); Espo.Ui.notifyWait(); let targets = this.getListView().checkedList.map(id => { return { entityType: this.collection.get(id).entityType, id: id, }; }); Espo.Ajax .postRequest(this.model.entityType + '/action/sendCancellation', { id: this.model.id, targets: targets, }) .then(result => { result ? Espo.Ui.success(this.translate('Sent')) : Espo.Ui.warning(this.translate('nothingHasBeenSent', 'messages', 'Meeting')); this.trigger('sent'); this.close(); }) .catch(() => { this.enableButton('send'); }); }, }); }); define("modules/crm/views/meeting/modals/detail", ["exports", "moment", "views/modals/detail"], function (_exports, _moment, _detail) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _moment = _interopRequireDefault(_moment); _detail = _interopRequireDefault(_detail); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MeetingModalDetailView extends _detail.default { duplicateAction = true; setup() { super.setup(); this.setupStatuses(); } setupStatuses() { if (this.notActualStatusList) { return; } this.notActualStatusList = [...(this.getMetadata().get(`scopes.${this.entityType}.completedStatusList`) || []), ...(this.getMetadata().get(`scopes.${this.entityType}.canceledStatusList`) || [])]; } setupAfterModelCreated() { super.setupAfterModelCreated(); const buttonData = this.getAcceptanceButtonData(); this.addButton({ name: 'setAcceptanceStatus', html: buttonData.html, hidden: this.hasAcceptanceStatusButton(), style: buttonData.style, className: 'btn-text', pullLeft: true, onClick: () => this.actionSetAcceptanceStatus() }, 'cancel'); if (!this.getAcl().getScopeForbiddenFieldList(this.model.entityType).includes('status')) { this.addDropdownItem({ name: 'setHeld', text: this.translate('Set Held', 'labels', this.model.entityType), hidden: true }); this.addDropdownItem({ name: 'setNotHeld', text: this.translate('Set Not Held', 'labels', this.model.entityType), hidden: true }); } this.addDropdownItem({ name: 'sendInvitations', text: this.translate('Send Invitations', 'labels', 'Meeting'), hidden: !this.isSendInvitationsToBeDisplayed(), onClick: () => this.actionSendInvitations() }); this.initAcceptanceStatus(); this.on('switch-model', (model, previousModel) => { this.stopListening(previousModel, 'sync'); this.initAcceptanceStatus(); }); this.on('after:save', () => { if (this.hasAcceptanceStatusButton()) { this.showAcceptanceButton(); } else { this.hideAcceptanceButton(); } if (this.isSendInvitationsToBeDisplayed()) { this.showActionItem('sendInvitations'); } else { this.hideActionItem('sendInvitations'); } }); this.listenTo(this.model, 'sync', () => { if (this.isSendInvitationsToBeDisplayed()) { this.showActionItem('sendInvitations'); return; } this.hideActionItem('sendInvitations'); }); this.listenTo(this.model, 'after:save', () => { if (this.isSendInvitationsToBeDisplayed()) { this.showActionItem('sendInvitations'); return; } this.hideActionItem('sendInvitations'); }); } controlRecordButtonsVisibility() { super.controlRecordButtonsVisibility(); this.controlStatusActionVisibility(); } controlStatusActionVisibility() { this.setupStatuses(); if (this.getAcl().check(this.model, 'edit') && !this.notActualStatusList.includes(this.model.get('status'))) { this.showActionItem('setHeld'); this.showActionItem('setNotHeld'); return; } this.hideActionItem('setHeld'); this.hideActionItem('setNotHeld'); } initAcceptanceStatus() { if (this.hasAcceptanceStatusButton()) { this.showAcceptanceButton(); } else { this.hideAcceptanceButton(); } this.listenTo(this.model, 'sync', () => { if (this.hasAcceptanceStatusButton()) { this.showAcceptanceButton(); } else { this.hideAcceptanceButton(); } }); } /** * * @return {{ * style: 'default'|'danger'|'success'|'warning'|'info', * html: string, * text: string, * }} */ getAcceptanceButtonData() { const acceptanceStatus = this.model.getLinkMultipleColumn('users', 'status', this.getUser().id); let text; let style = 'default'; let iconHtml = null; if (acceptanceStatus && acceptanceStatus !== 'None') { text = this.getLanguage().translateOption(acceptanceStatus, 'acceptanceStatus', this.model.entityType); style = this.getMetadata().get(['entityDefs', this.model.entityType, 'fields', 'acceptanceStatus', 'style', acceptanceStatus]); if (style) { const iconClass = { 'success': 'fas fa-check-circle', 'danger': 'fas fa-times-circle', 'warning': 'fas fa-question-circle' }[style]; iconHtml = $('').addClass(iconClass).addClass('text-' + style).get(0).outerHTML; } } else { text = typeof acceptanceStatus !== 'undefined' ? this.translate('Acceptance', 'labels', 'Meeting') : ' '; } let html = this.getHelper().escapeString(text); if (iconHtml) { html = iconHtml + ' ' + html; } return { style: style, text: text, html: html }; } showAcceptanceButton() { this.showActionItem('setAcceptanceStatus'); if (!this.isRendered()) { this.once('after:render', this.showAcceptanceButton, this); return; } const data = this.getAcceptanceButtonData(); const $button = this.$el.find('.modal-footer [data-name="setAcceptanceStatus"]'); $button.html(data.html); $button.removeClass('btn-default'); $button.removeClass('btn-success'); $button.removeClass('btn-warning'); $button.removeClass('btn-info'); $button.removeClass('btn-primary'); $button.removeClass('btn-danger'); $button.addClass('btn-' + data.style); } hideAcceptanceButton() { this.hideActionItem('setAcceptanceStatus'); } hasAcceptanceStatusButton() { if (!this.model.has('status')) { return false; } if (!this.model.has('usersIds')) { return false; } if (this.notActualStatusList.includes(this.model.get('status'))) { return false; } if (!~this.model.getLinkMultipleIdList('users').indexOf(this.getUser().id)) { return false; } return true; } actionSetAcceptanceStatus() { this.createView('dialog', 'crm:views/meeting/modals/acceptance-status', { model: this.model }, view => { view.render(); this.listenTo(view, 'set-status', status => { this.hideAcceptanceButton(); Espo.Ui.notifyWait(); Espo.Ajax.postRequest(this.model.entityType + '/action/setAcceptanceStatus', { id: this.model.id, status: status }).then(() => { this.model.fetch().then(() => { Espo.Ui.notify(false); setTimeout(() => { this.$el.find(`button[data-name="setAcceptanceStatus"]`).focus(); }, 50); }); }); }); }); } actionSetHeld() { this.model.save({ status: 'Held' }); this.trigger('after:save', this.model); } actionSetNotHeld() { this.model.save({ status: 'Not Held' }); this.trigger('after:save', this.model); } isSendInvitationsToBeDisplayed() { if (this.notActualStatusList.includes(this.model.get('status'))) { return false; } const dateEnd = this.model.get('dateEnd'); if (dateEnd && this.getDateTime().toMoment(dateEnd).isBefore(_moment.default.now())) { return false; } if (!this.getAcl().checkModel(this.model, 'edit')) { return false; } const userIdList = this.model.getLinkMultipleIdList('users'); const contactIdList = this.model.getLinkMultipleIdList('contacts'); const leadIdList = this.model.getLinkMultipleIdList('leads'); if (!contactIdList.length && !leadIdList.length && !userIdList.length) { return false; } return true; } actionSendInvitations() { Espo.Ui.notifyWait(); this.createView('dialog', 'crm:views/meeting/modals/send-invitations', { model: this.model }).then(view => { Espo.Ui.notify(false); view.render(); this.listenToOnce(view, 'sent', () => this.model.fetch()); }); } } var _default = _exports.default = MeetingModalDetailView; }); /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ define('crm:views/meeting/modals/acceptance-status', ['views/modal'], function (Dep) { return Dep.extend({ backdrop: true, templateContent: `

{{viewObject.message}}

{{#each viewObject.statusDataList}}
{{#if selected}}{{/if}}
{{/each}}
`, setup: function () { Dep.prototype.setup.call(this); this.$header = $('').append( $('').text(this.translate(this.model.entityType, 'scopeNames')), ' ', $('').text(this.model.get('name')), ' ', $('').text(this.translate('Acceptance', 'labels', 'Meeting')) ); let statusList = this.getMetadata() .get(['entityDefs', this.model.entityType, 'fields', 'acceptanceStatus', 'options']) || []; this.statusDataList = []; statusList.filter(item => item !== 'None').forEach(item => { let o = { name: item, style: this.getMetadata() .get(['entityDefs', this.model.entityType, 'fields', 'acceptanceStatus', 'style', item]) || 'default', label: this.getLanguage().translateOption(item, 'acceptanceStatus', this.model.entityType), selected: this.model.getLinkMultipleColumn('users', 'status', this.getUser().id) === item, }; this.statusDataList.push(o); }); this.message = this.translate('selectAcceptanceStatus', 'messages', 'Meeting') }, actionSetStatus: function (data) { this.trigger('set-status', data.status); this.close(); }, }); }); define("modules/crm/views/meeting/fields/users", ["exports", "modules/crm/views/meeting/fields/attendees"], function (_exports, _attendees) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _attendees = _interopRequireDefault(_attendees); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class _default extends _attendees.default { selectPrimaryFilterName = 'active'; init() { this.assignmentPermission = this.getAcl().getPermissionLevel('assignmentPermission'); if (this.assignmentPermission === 'no') { this.readOnly = true; } super.init(); } getSelectBoolFilterList() { if (this.assignmentPermission === 'team') { return ['onlyMyTeam']; } } /** * @private * @param {string} id * @return {string} */ getIconHtml(id) { return this.getHelper().getAvatarHtml(id, 'small', 18, 'avatar-link'); } /** * @inheritDoc */ prepareEditItemElement(id, name) { const itemElement = super.prepareEditItemElement(id, name); const avatarHtml = this.getHelper().getAvatarHtml(id, 'small', 18, 'avatar-link'); if (avatarHtml) { const img = new DOMParser().parseFromString(avatarHtml, 'text/html').body.childNodes[0]; const nameElement = itemElement.children[0].querySelector('.link-item-name'); if (nameElement) { nameElement.prepend(img); } } return itemElement; } } _exports.default = _default; }); define("modules/crm/views/meeting/fields/reminders", ["exports", "ui/select", "moment", "views/fields/base"], function (_exports, _select, _moment, _base) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _select = _interopRequireDefault(_select); _moment = _interopRequireDefault(_moment); _base = _interopRequireDefault(_base); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /************************************************************************ * This file is part of EspoCRM. * * EspoCRM – Open Source CRM application. * Copyright (C) 2014-2025 EspoCRM, Inc. * Website: https://www.espocrm.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * 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 Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ class MeetingRemindersField extends _base.default { detailTemplate = 'crm:meeting/fields/reminders/detail'; listTemplate = 'crm:meeting/fields/reminders/detail'; editTemplate = 'crm:meeting/fields/reminders/edit'; /** * @private * @type {string} */ dateField = 'dateStart'; /** * @private * @type {boolean} */ isDateTimeOptional; /** * @private * @type {number} */ minAllDaySeconds = 120 * 60; getAttributeList() { return [this.name]; } setup() { this.addActionHandler('addReminder', () => this.actionAddReminder()); this.addActionHandler('removeReminder', (e, target) => { const element = target.closest('.reminder'); const index = Array.from(element.parentElement.childNodes).indexOf(element); this.removeReminder(index); }); this.setupReminderList(); this.listenTo(this.model, 'change:' + this.name, () => { this.reminderList = Espo.Utils.cloneDeep(this.model.get(this.name) || []); }); this.typeList = Espo.Utils.clone(this.getMetadata().get('entityDefs.Reminder.fields.type.options') || []); this.secondsList = Espo.Utils.clone(this.getMetadata().get('entityDefs.Reminder.fields.seconds.options') || []); this.dateField = this.model.getFieldParam(this.name, 'dateField') || this.dateField; this.listenTo(this.model, 'change:' + this.dateField, () => { if (this.isEditMode()) { this.reRender(); } }); this.isDateTimeOptional = this.model.getFieldParam(this.dateField, 'type') === 'datetimeOptional'; } /** * @private */ setupReminderList() { if (this.model.isNew() && !this.model.get(this.name) && this.model.entityType !== 'Preferences') { let param = 'defaultReminders'; if (this.model.entityType === 'Task') { param = 'defaultRemindersTask'; } this.reminderList = this.getPreferences().get(param) || []; } else { this.reminderList = this.model.get(this.name) || []; } this.reminderList = Espo.Utils.cloneDeep(this.reminderList); } afterRender() { if (this.isEditMode()) { this.$container = this.$el.find('.reminders-container'); this.reminderList.forEach(item => { this.addItemHtml(item); }); } } focusOnButton() { // noinspection JSUnresolvedReference this.$el.find('button[data-action="addReminder"]').get(0).focus({ preventScroll: true }); } /** * @private * @param {string} type * @param {number} index */ updateType(type, index) { this.reminderList[index].type = type; this.trigger('change'); } /** * @private * @param {number} seconds * @param {number} index */ updateSeconds(seconds, index) { this.reminderList[index].seconds = seconds; this.trigger('change'); } /** * @private * @param {{type: string, seconds: number}} item */ addItemHtml(item) { const $item = $('
').addClass('input-group').addClass('reminder'); const $type = $('').attr('name', 'seconds').attr('data-name', 'seconds').addClass('form-control radius-right'); const limitDate = this.model.get(this.dateField) ? this.getDateTime().toMoment(this.model.get(this.dateField)) : null; /** @var {number[]} secondsList */ let secondsList = Espo.Utils.clone(this.secondsList); if (this.isDateTimeOptional && this.model.attributes[this.dateField + 'Date']) { secondsList = secondsList.filter(seconds => !seconds || seconds >= this.minAllDaySeconds); } if (!secondsList.includes(item.seconds)) { secondsList.push(item.seconds); } secondsList.filter(seconds => { return seconds === item.seconds || !limitDate || this.isBefore(seconds, limitDate); }).sort((a, b) => a - b).forEach(seconds => { const $o = $('