').text(this.translate(this.foreignScope, 'scopeNamesPlural'));
$target.css('user-select', 'none').css('cursor', 'pointer').attr('data-action', 'fullRefresh').attr('title', this.translate('clickToRefresh', 'messages'));
return this.buildHeaderHtml([$root, $name, $link, $target]);
}
/**
* @inheritDoc
*/
updatePageTitle() {
this.setPageTitle(this.translate(this.foreignScope, 'scopeNamesPlural'));
}
}
_exports.default = ActivitiesListView;
});
define("modules/crm/views/account/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-2026 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.
************************************************************************/
/** Left for bc. */
class _default extends _detail.default {}
_exports.default = _default;
});
define("modules/crm/views/account/fields/shipping-address", ["exports", "views/fields/address"], function (_exports, _address) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_address = _interopRequireDefault(_address);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 _address.default {
copyFrom = 'billingAddress';
setup() {
super.setup();
this.addActionHandler('copyFromBilling', () => this.copy());
this.attributePartList = this.getMetadata().get(['fields', 'address', 'actualFields']) || [];
this.allAddressAttributeList = [];
this.attributePartList.forEach(part => {
this.allAddressAttributeList.push(this.copyFrom + Espo.Utils.upperCaseFirst(part));
this.allAddressAttributeList.push(this.name + Espo.Utils.upperCaseFirst(part));
});
this.listenTo(this.model, 'change', () => {
let isChanged = false;
for (const attribute of this.allAddressAttributeList) {
if (this.model.hasChanged(attribute)) {
isChanged = true;
break;
}
}
if (!isChanged) {
return;
}
if (!this.isEditMode() || !this.isRendered() || !this.copyButtonElement) {
return;
}
if (this.toShowCopyButton()) {
this.copyButtonElement.classList.remove('hidden');
} else {
this.copyButtonElement.classList.add('hidden');
}
});
}
afterRender() {
super.afterRender();
if (this.mode === this.MODE_EDIT && this.element) {
const label = this.translate('Copy Billing', 'labels', 'Account');
const button = this.copyButtonElement = document.createElement('button');
button.classList.add('btn', 'btn-default', 'btn-sm', 'action');
button.textContent = label;
button.setAttribute('data-action', 'copyFromBilling');
if (!this.toShowCopyButton()) {
button.classList.add('hidden');
}
this.element.append(button);
}
}
/**
* @private
*/
copy() {
const fieldFrom = this.copyFrom;
Object.keys(this.getMetadata().get('fields.address.fields') || {}).forEach(attr => {
const destField = this.name + Espo.Utils.upperCaseFirst(attr);
const sourceField = fieldFrom + Espo.Utils.upperCaseFirst(attr);
this.model.set(destField, this.model.get(sourceField));
});
}
/**
* @private
* @return {boolean}
*/
toShowCopyButton() {
let billingIsNotEmpty = false;
let shippingIsNotEmpty = false;
this.attributePartList.forEach(part => {
const attribute1 = this.copyFrom + Espo.Utils.upperCaseFirst(part);
if (this.model.get(attribute1)) {
billingIsNotEmpty = true;
}
const attribute2 = this.name + Espo.Utils.upperCaseFirst(part);
if (this.model.get(attribute2)) {
shippingIsNotEmpty = true;
}
});
return billingIsNotEmpty && !shippingIsNotEmpty;
}
}
_exports.default = _default;
});
define("modules/crm/view-setup-handlers/document/record-list-drag-n-drop", ["exports", "underscore", "bullbone"], function (_exports, _underscore, _bullbone) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_underscore = _interopRequireDefault(_underscore);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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.
************************************************************************/
const Handler = function (view) {
this.view = view;
};
_underscore.default.extend(Handler.prototype, {
process: function () {
this.listenTo(this.view, 'after:render', () => this.initDragDrop());
this.listenTo(this.view, 'remove', () => this.disable());
},
disable: function () {
const $el = this.view.$el.parent();
/** @type {Element} */
const el = $el.get(0);
$el.off('drop');
if (!el) {
return;
}
if (!this.onDragoverBind) {
return;
}
el.removeEventListener('dragover', this.onDragoverBind);
el.removeEventListener('dragenter', this.onDragenterBind);
el.removeEventListener('dragleave', this.onDragleaveBind);
},
initDragDrop: function () {
this.disable();
const $el = this.view.$el.parent();
const el = $el.get(0);
$el.on('drop', e => {
e.preventDefault();
e.stopPropagation();
e = e.originalEvent;
if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length === 1 && this.dropEntered) {
this.removeDrop();
this.create(e.dataTransfer.files[0]);
return;
}
this.removeDrop($el);
});
this.dropEntered = false;
this.onDragoverBind = this.onDragover.bind(this);
this.onDragenterBind = this.onDragenter.bind(this);
this.onDragleaveBind = this.onDragleave.bind(this);
el.addEventListener('dragover', this.onDragoverBind);
el.addEventListener('dragenter', this.onDragenterBind);
el.addEventListener('dragleave', this.onDragleaveBind);
},
renderDrop: function () {
this.dropEntered = true;
const $backdrop = $('').css('pointer-events', 'none').append('').append(' ').append($('').text(this.view.getLanguage().translate('Create Document', 'labels', 'Document')));
this.view.$el.append($backdrop);
},
removeDrop: function () {
this.view.$el.find('> .dd-backdrop').remove();
this.dropEntered = false;
},
create: function (file) {
this.view.actionQuickCreate().then(view => {
const fileView = view.getRecordView().getFieldView('file');
if (!fileView) {
const msg = "No 'file' field on the layout.";
Espo.Ui.error(msg);
console.error(msg);
return;
}
if (fileView.isRendered()) {
fileView.uploadFile(file);
return;
}
this.listenToOnce(fileView, 'after:render', () => {
fileView.uploadFile(file);
});
});
},
/**
* @param {DragEvent} e
*/
onDragover: function (e) {
e.preventDefault();
},
/**
* @param {DragEvent} e
*/
onDragenter: function (e) {
e.preventDefault();
if (!e.dataTransfer.types || !e.dataTransfer.types.length) {
return;
}
if (!~e.dataTransfer.types.indexOf('Files')) {
return;
}
if (!this.dropEntered) {
this.renderDrop();
}
},
/**
* @param {DragEvent} e
*/
onDragleave: function (e) {
e.preventDefault();
if (!this.dropEntered) {
return;
}
let fromElement = e.fromElement || e.relatedTarget;
if (fromElement && $.contains(this.view.$el.parent().get(0), fromElement)) {
return;
}
if (fromElement && fromElement.parentNode && fromElement.parentNode.toString() === '[object ShadowRoot]') {
return;
}
this.removeDrop();
}
});
Object.assign(Handler.prototype, _bullbone.Events);
// noinspection JSUnusedGlobalSymbols
var _default = _exports.default = Handler;
});
define("modules/crm/handlers/task/reminders-handler", ["exports", "bullbone"], function (_exports, _bullbone) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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.
************************************************************************/
/**
* @mixes Bull.Events
*/
class RemindersHandler {
/**
* @param {import('views/record/detail').default} view
*/
constructor(view) {
this.view = view;
this.model = view.model;
this.user = this.view.getUser();
this.ignoreStatusList = [...(this.view.getMetadata().get(['scopes', this.view.entityType, 'completedStatusList']) || []), ...(this.view.getMetadata().get(['scopes', this.view.entityType, 'canceledStatusList']) || [])];
}
process() {
this.control();
this.listenTo(this.model, 'change', () => {
if (!this.model.hasChanged('assignedUserId') && !this.model.hasChanged('assignedUsersIds') && !this.model.hasChanged('dateEnd') && !this.model.hasChanged('dateEndDate') && !this.model.hasChanged('status')) {
return;
}
this.control();
});
}
control() {
if (!this.model.attributes.dateEnd && !this.model.attributes.dateEndDate) {
this.view.hideField('reminders');
return;
}
/** @type {string[]} */
const assignedUsersIds = this.model.attributes.assignedUsersIds || [];
if (!this.ignoreStatusList.includes(this.model.attributes.status) && (this.model.attributes.assignedUserId === this.user.id || assignedUsersIds.includes(this.user.id))) {
this.view.showField('reminders');
return;
}
this.view.hideField('reminders');
}
}
Object.assign(RemindersHandler.prototype, _bullbone.Events);
// noinspection JSUnusedGlobalSymbols
var _default = _exports.default = RemindersHandler;
});
define("modules/crm/handlers/task/menu", ["exports", "action-handler"], function (_exports, _actionHandler) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_actionHandler = _interopRequireDefault(_actionHandler);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 TaskMenuHandler extends _actionHandler.default {
complete() {
const model = this.view.model;
model.save({
status: 'Completed'
}, {
patch: true
}).then(() => {
Espo.Ui.success(this.view.getLanguage().translateOption('Completed', 'status', 'Task'));
});
}
// noinspection JSUnusedGlobalSymbols
isCompleteAvailable() {
const status = this.view.model.get('status');
const view = /** @type {module:views/detail} */this.view;
if (view.getRecordView().isEditMode()) {
return false;
}
/** @type {string[]} */
const notActualStatuses = this.view.getMetadata().get('entityDefs.Task.fields.status.notActualOptions') || [];
return !notActualStatuses.includes(status);
}
}
var _default = _exports.default = TaskMenuHandler;
});
define("modules/crm/handlers/task/detail-actions", ["exports", "action-handler"], function (_exports, _actionHandler) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_actionHandler = _interopRequireDefault(_actionHandler);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 DetailActions extends _actionHandler.default {
complete() {
const model = this.view.model;
model.save({
status: 'Completed'
}, {
patch: true
}).then(() => {
Espo.Ui.success(this.view.getLanguage().translateOption('Completed', 'status', 'Task'));
});
}
// noinspection JSUnusedGlobalSymbols
isCompleteAvailable() {
const status = this.view.model.get('status');
/** @type {string[]} */
const notActualStatuses = this.view.getMetadata().get('entityDefs.Task.fields.status.notActualOptions') || [];
return !notActualStatuses.includes(status);
}
}
var _default = _exports.default = DetailActions;
});
define("modules/crm/handlers/opportunity/defaults-preparator", ["exports", "handlers/model/defaults-preparator", "metadata", "di"], function (_exports, _defaultsPreparator, _metadata, _di) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_defaultsPreparator = _interopRequireDefault(_defaultsPreparator);
_metadata = _interopRequireDefault(_metadata);
var _staticBlock;
let _init_metadata, _init_extra_metadata;
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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.
************************************************************************/
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for("Symbol.metadata"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if ("function" != typeof e && (r || void 0 !== e)) throw new TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError("Attempted to access private element on non-instance"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? "get" : j || D ? "set" : "value"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, "get"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? "" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error("Decorating two elements with the same name (" + P[F].name + ") is not supported yet"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], "A decorator", "be", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError("attempted to call addInitializer after decoration was finished"); b(t, "An initializer", "be", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, "class decorators", "return") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I("get", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I("set", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if ("object" == typeof N && N) (c = b(N.get, "accessor.get")) && (P.get = c), (c = b(N.set, "accessor.set")) && (P.set = c), (c = b(N.init, "accessor.init")) && k.unshift(c);else if (void 0 !== N) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined"); } else b(N, (l ? "field" : "method") + " decorators", "return") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I("get", s), I("set", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? "#" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
// noinspection JSUnusedGlobalSymbols
class _Class extends _defaultsPreparator.default {
constructor() {
super(...arguments);
_init_extra_metadata(this);
}
/**
* @private
* @type {Metadata}
*/
metadata = _init_metadata(this);
prepare(model) {
const probabilityMap = this.metadata.get('entityDefs.Opportunity.fields.stage.probabilityMap') || {};
const stage = model.attributes.stage;
const attributes = {};
if (stage in probabilityMap) {
attributes.probability = probabilityMap[stage];
}
return Promise.resolve(attributes);
}
static #_ = _staticBlock = () => [_init_metadata, _init_extra_metadata] = _applyDecs(this, [], [[(0, _di.inject)(_metadata.default), 0, "metadata"]], 0, void 0, _defaultsPreparator.default).e;
}
_exports.default = _Class;
_staticBlock();
});
define("modules/crm/handlers/opportunity/contacts-create", ["exports", "handlers/create-related"], function (_exports, _createRelated) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_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-2026 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 ContactsCreateHandler extends _createRelated.default {
getAttributes(model) {
const attributes = {};
if (model.get('accountId')) {
attributes['accountsIds'] = [model.get('accountId')];
}
return Promise.resolve(attributes);
}
}
var _default = _exports.default = ContactsCreateHandler;
});
define("modules/crm/handlers/knowledge-base-article/send-in-email", ["exports", "handlers/row-action"], function (_exports, _rowAction) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_rowAction = _interopRequireDefault(_rowAction);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 SendInEmailHandler extends _rowAction.default {
isAvailable(model, action) {
return this.view.getAcl().checkScope('Email', 'create');
}
process(model, action) {
const parentModel = this.view.getParentView().model;
const modelFactory = this.view.getModelFactory();
const collectionFactory = this.view.getCollectionFactory();
Espo.Ui.notifyWait();
model.fetch().then(() => {
return new Promise(resolve => {
if (parentModel.get('contactsIds') && parentModel.get('contactsIds').length) {
collectionFactory.create('Contact', contactList => {
const contactListFinal = [];
contactList.url = 'Case/' + parentModel.id + '/contacts';
contactList.fetch().then(() => {
contactList.forEach(contact => {
if (contact.id === parentModel.get('contactId')) {
contactListFinal.unshift(contact);
} else {
contactListFinal.push(contact);
}
});
resolve(contactListFinal);
});
});
return;
}
if (parentModel.get('accountId')) {
modelFactory.create('Account', account => {
account.id = parentModel.get('accountId');
account.fetch().then(() => resolve([account]));
});
return;
}
if (parentModel.get('leadId')) {
modelFactory.create('Lead', lead => {
lead.id = parentModel.get('leadId');
lead.fetch().then(() => resolve([lead]));
});
return;
}
resolve([]);
});
}).then(list => {
const attributes = {
parentType: 'Case',
parentId: parentModel.id,
parentName: parentModel.get('name'),
name: '[#' + parentModel.get('number') + ']'
};
attributes.to = '';
attributes.cc = '';
attributes.nameHash = {};
list.forEach((model, i) => {
if (model.get('emailAddress')) {
if (i === 0) {
attributes.to += model.get('emailAddress') + ';';
} else {
attributes.cc += model.get('emailAddress') + ';';
}
attributes.nameHash[model.get('emailAddress')] = model.get('name');
}
});
Espo.loader.require('crm:knowledge-base-helper', Helper => {
const helper = new Helper(this.view.getLanguage());
helper.getAttributesForEmail(model, attributes, attributes => {
const viewName = this.view.getMetadata().get('clientDefs.Email.modalViews.compose') || 'views/modals/compose-email';
this.view.createView('composeEmail', viewName, {
attributes: attributes,
selectTemplateDisabled: true,
signatureDisabled: true
}, view => {
Espo.Ui.notify(false);
view.render();
this.view.listenToOnce(view, 'after:send', () => {
parentModel.trigger('after:relate');
});
});
});
});
}).catch(() => {
Espo.Ui.notify(false);
});
}
}
var _default = _exports.default = SendInEmailHandler;
});
define("modules/crm/handlers/knowledge-base-article/move", ["exports", "handlers/row-action"], function (_exports, _rowAction) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_rowAction = _interopRequireDefault(_rowAction);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 MoveActionHandler extends _rowAction.default {
isAvailable(model, action) {
return model.collection && model.collection.orderBy === 'order' && model.collection.order === 'asc';
}
process(model, action) {
if (action === 'moveToTop') {
this.moveToTop(model);
return;
}
if (action === 'moveToBottom') {
this.moveToBottom(model);
return;
}
if (action === 'moveUp') {
this.moveUp(model);
return;
}
if (action === 'moveDown') {
this.moveDown(model);
}
}
moveToTop(model) {
const index = this.collection.indexOf(model);
if (index === 0) {
return;
}
Espo.Ui.notifyWait();
Espo.Ajax.postRequest('KnowledgeBaseArticle/action/moveToTop', {
id: model.id,
whereGroup: this.collection.getWhere()
}).then(() => {
this.collection.fetch().then(() => Espo.Ui.notify(false));
});
}
moveUp(model) {
const index = this.collection.indexOf(model);
if (index === 0) {
return;
}
Espo.Ui.notifyWait();
Espo.Ajax.postRequest('KnowledgeBaseArticle/action/moveUp', {
id: model.id,
whereGroup: this.collection.getWhere()
}).then(() => {
this.collection.fetch().then(() => Espo.Ui.notify(false));
});
}
moveDown(model) {
const index = this.collection.indexOf(model);
if (index === this.collection.length - 1 && this.collection.length === this.collection.total) {
return;
}
Espo.Ui.notifyWait();
Espo.Ajax.postRequest('KnowledgeBaseArticle/action/moveDown', {
id: model.id,
whereGroup: this.collection.getWhere()
}).then(() => {
this.collection.fetch().then(() => Espo.Ui.notify(false));
});
}
moveToBottom(model) {
const index = this.collection.indexOf(model);
if (index === this.collection.length - 1 && this.collection.length === this.collection.total) {
return;
}
Espo.Ui.notifyWait();
Espo.Ajax.postRequest('KnowledgeBaseArticle/action/moveToBottom', {
id: model.id,
whereGroup: this.collection.getWhere()
}).then(() => {
this.collection.fetch().then(() => Espo.Ui.notify(false));
});
}
}
var _default = _exports.default = MoveActionHandler;
});
define("modules/crm/handlers/event/reminders-handler", ["exports", "bullbone"], function (_exports, _bullbone) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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.
************************************************************************/
/**
* @mixes Bull.Events
*/
class RemindersHandler {
/**
* @param {import('views/record/detail').default} view
*/
constructor(view) {
this.view = view;
/** @type {import('model').default} */
this.model = view.model;
/** @type {import('models/user').default} */
this.user = this.view.getUser();
this.ignoreStatusList = [...(this.view.getMetadata().get(['scopes', this.view.entityType, 'completedStatusList']) || []), ...(this.view.getMetadata().get(['scopes', this.view.entityType, 'canceledStatusList']) || [])];
}
process() {
this.control();
this.listenTo(this.model, 'change', () => {
if (!this.model.hasChanged('assignedUserId') && !this.model.hasChanged('usersIds') && !this.model.hasChanged('assignedUsersIds') && !this.model.hasChanged('status')) {
return;
}
this.control();
});
}
control() {
const usersIds = /** @type {string[]} */this.model.get('usersIds') || [];
const assignedUsersIds = /** @type {string[]} */this.model.get('assignedUsersIds') || [];
if (!this.ignoreStatusList.includes(this.model.get('status')) && (this.model.get('assignedUserId') === this.user.id || usersIds.includes(this.user.id) || assignedUsersIds.includes(this.user.id))) {
this.view.showField('reminders');
return;
}
this.view.hideField('reminders');
}
}
Object.assign(RemindersHandler.prototype, _bullbone.Events);
// noinspection JSUnusedGlobalSymbols
var _default = _exports.default = RemindersHandler;
});
define("modules/crm/handlers/case/detail-actions", ["exports", "action-handler"], function (_exports, _actionHandler) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_actionHandler = _interopRequireDefault(_actionHandler);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 CaseDetailActionHandler extends _actionHandler.default {
close() {
const model = this.view.model;
model.save({
status: 'Closed'
}, {
patch: true
}).then(() => {
Espo.Ui.success(this.view.translate('Closed', 'labels', 'Case'));
});
}
reject() {
const model = this.view.model;
model.save({
status: 'Rejected'
}, {
patch: true
}).then(() => {
Espo.Ui.success(this.view.translate('Rejected', 'labels', 'Case'));
});
}
// noinspection JSUnusedGlobalSymbols
isCloseAvailable() {
return this.isStatusAvailable('Closed');
}
// noinspection JSUnusedGlobalSymbols
isRejectAvailable() {
return this.isStatusAvailable('Rejected');
}
isStatusAvailable(status) {
const model = this.view.model;
const acl = this.view.getAcl();
const metadata = this.view.getMetadata();
/** @type {string[]} */
const notActualStatuses = metadata.get('entityDefs.Case.fields.status.notActualOptions') || [];
if (notActualStatuses.includes(model.get('status'))) {
return false;
}
if (!acl.check(model, 'edit')) {
return false;
}
if (!acl.checkField(model.entityType, 'status', 'edit')) {
return false;
}
const statusList = metadata.get(['entityDefs', 'Case', 'fields', 'status', 'options']) || [];
if (!statusList.includes(status)) {
return false;
}
return true;
}
}
var _default = _exports.default = CaseDetailActionHandler;
});
define("modules/crm/handlers/campaign/mass-emails-create", ["exports", "handlers/create-related"], function (_exports, _createRelated) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_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-2026 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 MassEmailsCreateHandler extends _createRelated.default {
getAttributes(model) {
return Promise.resolve({
name: model.get('name') + ' ' + this.viewHelper.dateTime.getToday()
});
}
}
var _default = _exports.default = MassEmailsCreateHandler;
});
define("modules/crm/controllers/unsubscribe", ["exports", "controller"], function (_exports, _controller) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_controller = _interopRequireDefault(_controller);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 UnsubscribeController extends _controller.default {
// noinspection JSUnusedGlobalSymbols
actionUnsubscribe(data) {
const viewName = data.view || 'crm:views/campaign/unsubscribe';
this.entire(viewName, {
actionData: data.actionData,
template: data.template
}, view => {
view.render();
});
}
}
var _default = _exports.default = UnsubscribeController;
});
define("modules/crm/controllers/tracking-url", ["exports", "controller"], function (_exports, _controller) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_controller = _interopRequireDefault(_controller);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 TrackingUrlController extends _controller.default {
// noinspection JSUnusedGlobalSymbols
actionDisplayMessage(data) {
const viewName = data.view || 'crm:views/campaign/tracking-url';
this.entire(viewName, {
message: data.message,
template: data.template
}, view => {
view.render();
});
}
}
var _default = _exports.default = TrackingUrlController;
});
define("modules/crm/controllers/task", ["exports", "controllers/record"], function (_exports, _record) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_record = _interopRequireDefault(_record);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 TaskController extends _record.default {
actionCreate(options) {
const attributes = {
...options.attributes
};
if (options.emailId) {
attributes.emailId = options.emailId;
options.attributes = attributes;
}
super.actionCreate(options);
}
}
_exports.default = TaskController;
});
define("modules/crm/controllers/lead", ["exports", "controllers/record"], function (_exports, _record) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_record = _interopRequireDefault(_record);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 LeadController extends _record.default {
// noinspection JSUnusedGlobalSymbols
actionConvert(options) {
this.main('crm:views/lead/convert', {
id: options.id
});
}
}
var _default = _exports.default = LeadController;
});
define("modules/crm/controllers/event-confirmation", ["exports", "controller"], function (_exports, _controller) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_controller = _interopRequireDefault(_controller);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 EventConfirmationController extends _controller.default {
// noinspection JSUnusedGlobalSymbols
actionConfirmEvent(actionData) {
const viewName = this.getMetadata().get(['clientDefs', 'EventConfirmation', 'confirmationView']) || 'crm:views/event-confirmation/confirmation';
this.entire(viewName, {
actionData: actionData
}, view => {
view.render();
});
}
}
// noinspection JSUnusedGlobalSymbols
var _default = _exports.default = EventConfirmationController;
});
define("modules/crm/controllers/calendar", ["exports", "controller"], function (_exports, _controller) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_controller = _interopRequireDefault(_controller);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 CalendarController extends _controller.default {
checkAccess() {
if (this.getAcl().check('Calendar')) {
return true;
}
return false;
}
// noinspection JSUnusedGlobalSymbols
actionShow(options) {
this.actionIndex(options);
}
actionIndex(options) {
this.handleCheckAccess('');
this.main('crm:views/calendar/calendar-page', {
date: options.date,
mode: options.mode,
userId: options.userId,
userName: options.userName
});
}
}
var _default = _exports.default = CalendarController;
});
define("modules/crm/controllers/activities", ["exports", "controller"], function (_exports, _controller) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_controller = _interopRequireDefault(_controller);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 ActivitiesController extends _controller.default {
checkAccess(action) {
return this.getAcl().check('Activities');
}
// noinspection JSUnusedGlobalSymbols
actionActivities(options) {
this.processList('activities', options.entityType, options.id, options.targetEntityType);
}
actionHistory(options) {
this.processList('history', options.entityType, options.id, options.targetEntityType);
}
/**
* @private
* @param {'activities'|'history'} type
* @param {string} entityType
* @param {string} id
* @param {string} targetEntityType
*/
async processList(type, entityType, id, targetEntityType) {
const viewName = 'modules/crm/views/activities/list';
const model = await this.modelFactory.create(entityType);
model.id = id;
await model.fetch({
main: true
});
const collection = await this.collectionFactory.create(targetEntityType);
collection.url = `Activities/${model.entityType}/${id}/${type}/list/${targetEntityType}`;
this.main(viewName, {
scope: entityType,
model: model,
collection: collection,
link: `${type}_${targetEntityType}`,
type: type
});
}
}
_exports.default = ActivitiesController;
});
define("modules/crm/acl-portal/document", ["exports", "acl-portal"], function (_exports, _aclPortal) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_aclPortal = _interopRequireDefault(_aclPortal);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 DocumentAclPortal extends _aclPortal.default {
// noinspection JSUnusedGlobalSymbols
checkModelEdit(model, data, precise) {
let result = this.checkModel(model, data, 'delete', precise);
if (result) {
return true;
}
if (data.edit === 'account') {
return true;
}
return false;
}
}
var _default = _exports.default = DocumentAclPortal;
});
define("modules/crm/acl-portal/contact", ["exports", "acl-portal"], function (_exports, _aclPortal) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_aclPortal = _interopRequireDefault(_aclPortal);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 ContactAclPortal extends _aclPortal.default {
checkIsOwnContact(model) {
const contactId = this.getUser().get('contactId');
if (!contactId) {
return false;
}
if (contactId === model.id) {
return true;
}
return false;
}
}
var _default = _exports.default = ContactAclPortal;
});
define("modules/crm/acl-portal/account", ["exports", "acl-portal"], function (_exports, _aclPortal) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_aclPortal = _interopRequireDefault(_aclPortal);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 AccountAclPortal extends _aclPortal.default {
checkInAccount(model) {
const accountIdList = this.getUser().getLinkMultipleIdList('accounts');
if (!accountIdList.length) {
return false;
}
if (~accountIdList.indexOf(model.id)) {
return true;
}
return false;
}
}
var _default = _exports.default = AccountAclPortal;
});
define("modules/crm/acl/mass-email", ["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-2026 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 MassEmailAcl extends _acl.default {
checkScope(data, action, precise, entityAccessData) {
if (action === 'create') {
return super.checkScope(data, 'edit', precise, entityAccessData);
}
return super.checkScope(data, action, precise, entityAccessData);
}
checkIsOwner(model) {
if (model.has('campaignId')) {
return true;
}
return super.checkIsOwner(model);
}
checkInTeam(model) {
if (model.has('campaignId')) {
return true;
}
return super.checkInTeam(model);
}
}
var _default = _exports.default = MassEmailAcl;
});
define("modules/crm/acl/campaign-tracking-url", ["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-2026 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 CampaignTrackingUrlAcl extends _acl.default {
checkIsOwner(model) {
if (model.has('campaignId')) {
return true;
}
return false;
}
checkInTeam(model) {
if (model.has('campaignId')) {
return true;
}
return false;
}
}
var _default = _exports.default = CampaignTrackingUrlAcl;
});
define("modules/crm/acl/call", ["exports", "modules/crm/acl/meeting"], function (_exports, _meeting) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
_meeting = _interopRequireDefault(_meeting);
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 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 CallAcl extends _meeting.default {}
var _default = _exports.default = CallAcl;
});