define("views/import/record/panels/imported", ["exports", "views/record/panels/relationship"], function (_exports, _relationship) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _relationship = _interopRequireDefault(_relationship); 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 ImportImportedPanelView extends _relationship.default { link = 'imported'; readOnly = true; rowActionsView = 'views/record/row-actions/relationship-no-unlink'; setup() { this.entityType = this.model.get('entityType'); this.title = this.title || this.translate('Imported', 'labels', 'Import'); super.setup(); } } var _default = _exports.default = ImportImportedPanelView; }); define("views/email-account/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-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 _detail.default { setup() { super.setup(); this.setupFieldsBehaviour(); this.initSslFieldListening(); this.initSmtpFieldsControl(); if (this.getUser().isAdmin()) { this.setFieldNotReadOnly('assignedUser'); } else { this.setFieldReadOnly('assignedUser'); } } modifyDetailLayout(layout) { layout.filter(panel => panel.tabLabel === '$label:SMTP').forEach(panel => { panel.rows.forEach(row => { row.forEach(item => { const labelText = this.translate(item.name, 'fields', 'EmailAccount'); if (labelText && labelText.indexOf('SMTP ') === 0) { item.labelText = Espo.Utils.upperCaseFirst(labelText.substring(5)); } }); }); }); } setupFieldsBehaviour() { this.controlStatusField(); this.listenTo(this.model, 'change:status', (model, value, o) => { if (o.ui) { this.controlStatusField(); } }); this.listenTo(this.model, 'change:useImap', (model, value, o) => { if (o.ui) { this.controlStatusField(); } }); if (this.wasFetched()) { this.setFieldReadOnly('fetchSince'); } else { this.setFieldNotReadOnly('fetchSince'); } } controlStatusField() { const list = ['username', 'port', 'host', 'monitoredFolders']; if (this.model.get('status') === 'Active' && this.model.get('useImap')) { list.forEach(item => { this.setFieldRequired(item); }); return; } list.forEach(item => { this.setFieldNotRequired(item); }); } wasFetched() { if (!this.model.isNew()) { return !!(this.model.get('fetchData') || {}).lastUID; } return false; } initSslFieldListening() { this.listenTo(this.model, 'change:security', (model, value, o) => { if (!o.ui) { return; } if (value === 'SSL') { this.model.set('port', 993); } else { this.model.set('port', 143); } }); this.listenTo(this.model, 'change:smtpSecurity', (model, value, o) => { if (o.ui) { if (value === 'SSL') { this.model.set('smtpPort', 465); } else if (value === 'TLS') { this.model.set('smtpPort', 587); } else { this.model.set('smtpPort', 25); } } }); } initSmtpFieldsControl() { this.controlSmtpFields(); this.listenTo(this.model, 'change:useSmtp', this.controlSmtpFields, this); this.listenTo(this.model, 'change:smtpAuth', this.controlSmtpFields, this); } controlSmtpFields() { if (this.model.get('useSmtp')) { this.showField('smtpHost'); this.showField('smtpPort'); this.showField('smtpAuth'); this.showField('smtpSecurity'); this.showField('smtpTestSend'); this.setFieldRequired('smtpHost'); this.setFieldRequired('smtpPort'); this.controlSmtpAuthField(); return; } this.hideField('smtpHost'); this.hideField('smtpPort'); this.hideField('smtpAuth'); this.hideField('smtpUsername'); this.hideField('smtpPassword'); this.hideField('smtpAuthMechanism'); this.hideField('smtpSecurity'); this.hideField('smtpTestSend'); this.setFieldNotRequired('smtpHost'); this.setFieldNotRequired('smtpPort'); this.setFieldNotRequired('smtpUsername'); } controlSmtpAuthField() { if (this.model.get('smtpAuth')) { this.showField('smtpUsername'); this.showField('smtpPassword'); this.showField('smtpAuthMechanism'); this.setFieldRequired('smtpUsername'); return; } this.hideField('smtpUsername'); this.hideField('smtpPassword'); this.hideField('smtpAuthMechanism'); this.setFieldNotRequired('smtpUsername'); } } _exports.default = _default; }); define("views/personal-data/record/record", ["exports", "views/record/base"], function (_exports, _base) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _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-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 PersonalDataRecordView extends _base.default { template = 'personal-data/record/record'; additionalEvents = { /** @this PersonalDataRecordView */ 'click .checkbox': function (e) { const name = $(e.currentTarget).data('name'); if (e.currentTarget.checked) { if (!~this.checkedFieldList.indexOf(name)) { this.checkedFieldList.push(name); } if (this.checkedFieldList.length === this.fieldList.length) { this.$el.find('.checkbox-all').prop('checked', true); } else { this.$el.find('.checkbox-all').prop('checked', false); } } else { const index = this.checkedFieldList.indexOf(name); if (~index) { this.checkedFieldList.splice(index, 1); } this.$el.find('.checkbox-all').prop('checked', false); } this.trigger('check', this.checkedFieldList); }, /** @this PersonalDataRecordView */ 'click .checkbox-all': function (e) { if (e.currentTarget.checked) { this.checkedFieldList = Espo.Utils.clone(this.fieldList); this.$el.find('.checkbox').prop('checked', true); } else { this.checkedFieldList = []; this.$el.find('.checkbox').prop('checked', false); } this.trigger('check', this.checkedFieldList); } }; checkedFieldList; data() { const data = {}; data.fieldDataList = this.getFieldDataList(); data.scope = this.scope; data.editAccess = this.editAccess; return data; } setup() { super.setup(); this.events = { ...this.additionalEvents, ...this.events }; this.scope = this.model.entityType; this.fieldList = []; this.checkedFieldList = []; this.editAccess = this.getAcl().check(this.model, 'edit'); const fieldDefs = this.getMetadata().get(['entityDefs', this.scope, 'fields']) || {}; const fieldList = []; for (const field in fieldDefs) { const defs = /** @type {Record} */fieldDefs[field]; if (defs.isPersonalData) { fieldList.push(field); } } fieldList.forEach(field => { const type = fieldDefs[field].type; const attributeList = this.getFieldManager().getActualAttributeList(type, field); let isNotEmpty = false; attributeList.forEach(attribute => { const value = this.model.get(attribute); if (value) { if (Object.prototype.toString.call(value) === '[object Array]') { if (value.length) { return; } } isNotEmpty = true; } }); const hasAccess = !this.getAcl().getScopeForbiddenFieldList(this.scope).includes(field); if (isNotEmpty && hasAccess) { this.fieldList.push(field); } }); this.fieldList = this.fieldList.sort((v1, v2) => { return this.translate(v1, 'fields', this.scope).localeCompare(this.translate(v2, 'fields', this.scope)); }); this.fieldList.forEach(field => { this.createField(field, null, null, 'detail', true); }); } getFieldDataList() { const forbiddenList = this.getAcl().getScopeForbiddenFieldList(this.scope, 'edit'); const list = []; this.fieldList.forEach(field => { list.push({ name: field, key: field + 'Field', editAccess: this.editAccess && !~forbiddenList.indexOf(field) }); }); return list; } } var _default = _exports.default = PersonalDataRecordView; }); define("views/personal-data/modals/personal-data", ["exports", "views/modal"], function (_exports, _modal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _modal = _interopRequireDefault(_modal); 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 _modal.default { template = 'personal-data/modals/personal-data'; className = 'dialog dialog-record'; backdrop = true; setup() { super.setup(); this.buttonList = [{ name: 'cancel', label: 'Close' }]; this.headerText = this.getLanguage().translate('Personal Data'); this.headerText += ': ' + this.model.get('name'); if (this.getAcl().check(this.model, 'edit')) { this.buttonList.unshift({ name: 'erase', label: 'Erase', style: 'danger', disabled: true, onClick: () => this.actionErase() }); } this.fieldList = []; this.scope = this.model.entityType; this.createView('record', 'views/personal-data/record/record', { selector: '.record', model: this.model }, view => { this.listenTo(view, 'check', fieldList => { this.fieldList = fieldList; if (fieldList.length) { this.enableButton('erase'); } else { this.disableButton('erase'); } }); if (!view.fieldList.length) { this.disableButton('export'); } }); } actionErase() { this.confirm({ message: this.translate('erasePersonalDataConfirmation', 'messages'), confirmText: this.translate('Erase') }, () => { this.disableButton('erase'); Espo.Ajax.postRequest('DataPrivacy/action/erase', { fieldList: this.fieldList, entityType: this.scope, id: this.model.id }).then(() => { Espo.Ui.success(this.translate('Done')); this.trigger('erase'); }).catch(() => { this.enableButton('erase'); }); }); } } _exports.default = _default; }); define("views/outbound-email/modals/test-send", ["exports", "views/modal"], function (_exports, _modal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _modal = _interopRequireDefault(_modal); 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 _modal.default { cssName = 'test-send'; templateContent = ` `; data() { return { emailAddress: this.options.emailAddress }; } setup() { this.buttonList = [{ name: 'send', text: this.translate('Send', 'labels', 'Email'), style: 'primary', onClick: () => { const emailAddress = this.$el.find('input').val(); if (emailAddress === '') { return; } this.trigger('send', emailAddress); } }, { name: 'cancel', label: 'Cancel', onClick: dialog => { dialog.close(); } }]; } } _exports.default = _default; }); define("views/import-error/fields/validation-failures", ["exports", "views/fields/base"], function (_exports, _base) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _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-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 ValidationFailuresFieldView extends _base.default { // language=Handlebars detailTemplateContent = ` {{#if itemList.length}} {{#each itemList}} {{/each}}
{{translate 'Field'}} {{translateOption 'Validation' scope='ImportError' field='type'}}
{{translate field category='fields' scope=entityType}} {{translate type category='fieldValidations'}} {{#if popoverText}} {{/if}}
{{else}} {{translate 'None'}} {{/if}} `; data() { const data = super.data(); data.itemList = this.getDataList(); return data; } afterRenderDetail() { this.$el.find('.popover-anchor').each((i, /** HTMLElement */el) => { const text = this.getHelper().transformMarkdownText(el.dataset.text).toString(); Espo.Ui.popover($(el), { content: text }, this); }); } /** * @return {Object[]} */ getDataList() { const itemList = Espo.Utils.cloneDeep(this.model.get(this.name)) || []; const entityType = this.model.get('entityType'); if (Array.isArray(itemList)) { itemList.forEach(item => { const fieldManager = this.getFieldManager(); const language = this.getLanguage(); const fieldType = fieldManager.getEntityTypeFieldParam(entityType, item.field, 'type'); if (!fieldType) { return; } const key = fieldType + '_' + item.type; if (!language.has(key, 'fieldValidationExplanations', 'Global')) { if (!language.has(item.type, 'fieldValidationExplanations', 'Global')) { return; } item.popoverText = language.translate(item.type, 'fieldValidationExplanations'); return; } item.popoverText = language.translate(key, 'fieldValidationExplanations'); }); } return itemList; } } // noinspection JSUnusedGlobalSymbols var _default = _exports.default = ValidationFailuresFieldView; }); define("views/import-error/fields/line-number", ["exports", "views/fields/int"], function (_exports, _int) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _int = _interopRequireDefault(_int); 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 _int.default { disableFormatting = true; data() { const data = super.data(); data.valueIsSet = this.model.has(this.sourceName); data.isNotEmpty = this.model.has(this.sourceName); return data; } setup() { super.setup(); this.sourceName = this.name === 'exportLineNumber' ? 'exportRowIndex' : 'rowIndex'; } getAttributeList() { return [this.sourceName]; } getValueForDisplay() { let value = this.model.get(this.sourceName); value++; return this.formatNumber(value); } } _exports.default = _default; }); define("views/import/step2", ["exports", "view", "ui/select"], function (_exports, _view, _select) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _view = _interopRequireDefault(_view); _select = _interopRequireDefault(_select); 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 Step2ImportView extends _view.default { template = 'import/step-2'; allowedFieldList = ['createdAt', 'createdBy']; events = { /** @this Step2ImportView */ 'click button[data-action="back"]': function () { this.back(); }, /** @this Step2ImportView */ 'click button[data-action="next"]': function () { this.next(); }, /** @this Step2ImportView */ 'click a[data-action="addField"]': function (e) { const field = $(e.currentTarget).data('name'); this.addField(field); }, /** @this Step2ImportView */ 'click a[data-action="removeField"]': function (e) { const field = $(e.currentTarget).data('name'); this.$el.find('a[data-action="addField"]').parent().removeClass('hidden'); const index = this.additionalFields.indexOf(field); if (~index) { this.additionalFields.splice(index, 1); } this.$el.find('.field[data-name="' + field + '"]').parent().remove(); }, /** @this Step2ImportView */ 'keyup input.add-field-quick-search-input': function (e) { this.processFieldFilterQuickSearch(e.currentTarget.value); } }; data() { return { scope: this.scope, fieldList: this.getFieldList() }; } setup() { this.formData = this.options.formData; this.scope = this.formData.entityType; const mapping = []; this.additionalFields = []; if (this.formData.previewArray) { let index = 0; if (this.formData.headerRow) { index = 1; } if (this.formData.previewArray.length > index) { this.formData.previewArray[index].forEach((value, i) => { const d = { value: value }; if (this.formData.headerRow) { d.name = this.formData.previewArray[0][i]; } mapping.push(d); }); } } this.wait(true); this.getModelFactory().create(this.scope, model => { this.model = model; if (this.formData.defaultValues) { this.model.set(this.formData.defaultValues); } this.wait(false); }); this.mapping = mapping; /** @type {string[]} */ this.fieldList = this.getFieldList(); this.fieldTranslations = this.fieldList.reduce((map, item) => { map[item] = this.translate(item, 'fields', this.scope); return map; }, {}); } afterRender() { const $container = $('#mapping-container'); const $table = $('').addClass('table').addClass('table-bordered').css('table-layout', 'fixed'); const $tbody = $('').appendTo($table); let $row = $(''); if (this.formData.headerRow) { const $cell = $(''); if (this.formData.headerRow) { $cell = $('
').attr('width', '25%').text(this.translate('Header Row Value', 'labels', 'Import')); $row.append($cell); } let $cell = $('').attr('width', '25%').text(this.translate('Field', 'labels', 'Import')); $row.append($cell); $cell = $('').text(this.translate('First Row Value', 'labels', 'Import')); $row.append($cell); if (~['update', 'createAndUpdate'].indexOf(this.formData.action)) { $cell = $('').text(this.translate('Update by', 'labels', 'Import')); $row.append($cell); } $tbody.append($row); const selectList = []; this.mapping.forEach((d, i) => { $row = $('
').text(d.name); $row.append($cell); } let selectedName = d.name; if (this.formData.attributeList) { if (this.formData.attributeList[i]) { selectedName = this.formData.attributeList[i]; } else { selectedName = null; } } const $select = this.getFieldDropdown(i, selectedName); selectList.push($select.get(0)); $cell = $('').append($select); $row.append($cell); let value = d.value || ''; if (value.length > 200) { value = value.substring(0, 200) + '...'; } $cell = $('').css('overflow', 'hidden').text(value); $row.append($cell); if (~['update', 'createAndUpdate'].indexOf(this.formData.action)) { const $checkbox = $('').attr('type', 'checkbox').addClass('form-checkbox').attr('id', 'update-by-' + i.toString()); /** @type {HTMLInputElement} */ const checkboxElement = $checkbox.get(0); if (!this.formData.updateBy) { if (d.name === 'id') { checkboxElement.checked = true; } } else if (~this.formData.updateBy.indexOf(i)) { checkboxElement.checked = true; } $cell = $('').append(checkboxElement); $row.append($cell); } $tbody.append($row); }); $container.empty(); $container.append($table); this.getDefaultFieldList().forEach(name => { this.addField(name); }); this.$addFieldButton = this.$el.find('button.add-field'); this.$defaultFieldList = this.$el.find('ul.default-field-list'); this.$fieldQuickSearch = this.$el.find('input.add-field-quick-search-input'); this.initQuickSearchUi(); selectList.forEach(select => _select.default.init(select)); } resetFieldFilterQuickSearch() { this.$fieldQuickSearch.val(''); this.$defaultFieldList.find('li.item').removeClass('hidden'); } initQuickSearchUi() { this.$addFieldButton.parent().on('show.bs.dropdown', () => { setTimeout(() => { this.$fieldQuickSearch.focus(); const width = this.$fieldQuickSearch.outerWidth(); this.$fieldQuickSearch.css('minWidth', width); }, 1); }); this.$addFieldButton.parent().on('hide.bs.dropdown', () => { this.resetFieldFilterQuickSearch(); this.$fieldQuickSearch.css('minWidth', ''); }); } /** * @private * @param {string} text */ processFieldFilterQuickSearch(text) { text = text.trim(); text = text.toLowerCase(); /** @type {JQuery} */ const $li = this.$defaultFieldList.find('li.item'); if (text === '') { $li.removeClass('hidden'); return; } $li.addClass('hidden'); this.fieldList.forEach(field => { let label = this.fieldTranslations[field] || field; label = label.toLowerCase(); const wordList = label.split(' '); let matched = label.indexOf(text) === 0; if (!matched) { matched = wordList.filter(word => word.length > 3 && word.indexOf(text) === 0).length > 0; } if (matched) { $li.filter(`[data-name="${field}"]`).removeClass('hidden'); } }); } /** * @return {string[]} */ getDefaultFieldList() { if (this.formData.defaultFieldList) { return this.formData.defaultFieldList; } if (!this.formData.defaultValues) { return []; } const defaultAttributes = Object.keys(this.formData.defaultValues); return this.getFieldManager().getEntityTypeFieldList(this.scope).filter(field => { const attributeList = this.getFieldManager().getEntityTypeFieldActualAttributeList(this.scope, field); return attributeList.findIndex(attribute => defaultAttributes.includes(attribute)) !== -1; }); } /** * @private * @return {string[]} */ getFieldList() { const defs = this.getMetadata().get(`entityDefs.${this.scope}.fields`); const forbiddenFieldList = this.getAcl().getScopeForbiddenFieldList(this.scope, 'edit'); let fieldList = []; for (const field in defs) { if (forbiddenFieldList.includes(field)) { continue; } const d = /** @type {Object.} */defs[field]; if (!this.allowedFieldList.includes(field) && (d.disabled || d.importDisabled || d.utility || d.directAccessDisabled && !d.importEnabled || d.directUpdateDisabled && !d.importEnabled && !d.directUpdateEnabled)) { continue; } fieldList.push(field); } fieldList = fieldList.sort((v1, v2) => { return this.translate(v1, 'fields', this.scope).localeCompare(this.translate(v2, 'fields', this.scope)); }); return fieldList; } /** * @private * @returns {string[]} */ getAttributeList() { const fields = this.getMetadata().get(['entityDefs', this.scope, 'fields']) || {}; const forbiddenFieldList = this.getAcl().getScopeForbiddenFieldList(this.scope, 'edit'); let attributeList = []; attributeList.push('id'); for (const field in fields) { if (forbiddenFieldList.includes(field)) { continue; } const defs = /** @type {Object.} */fields[field]; if (!this.allowedFieldList.includes(field) && (defs.disabled || defs.importDisabled || defs.utility || defs.directAccessDisabled && !defs.importEnabled || defs.directUpdateDisabled && !defs.importEnabled && !defs.directUpdateEnabled)) { continue; } if (defs.type === 'phone') { attributeList.push(field); (this.getMetadata().get(`entityDefs.${this.scope}.fields.${field}.typeList`) || []).map(item => item.replace(/\s/g, '_')).forEach(item => { attributeList.push(field + Espo.Utils.upperCaseFirst(item)); }); continue; } if (defs.type === 'email') { attributeList.push(field + '2'); attributeList.push(field + '3'); attributeList.push(field + '4'); } if (defs.type === 'link') { attributeList.push(field + 'Name'); attributeList.push(field + 'Id'); } if (defs.type === 'foreign' && !defs.relateOnImport) { continue; } if (defs.type === 'personName') { attributeList.push(field); } const type = defs.type; let actualAttributeList = this.getFieldManager().getActualAttributeList(type, field); if (!actualAttributeList.length) { actualAttributeList = [field]; } actualAttributeList.forEach(it => { if (attributeList.indexOf(it) === -1) { attributeList.push(it); } }); } attributeList = attributeList.sort((v1, v2) => { return this.translate(v1, 'fields', this.scope).localeCompare(this.translate(v2, 'fields', this.scope)); }); return attributeList; } getFieldDropdown(num, name) { name = name || false; const fieldList = this.getAttributeList(); const $select = $('').addClass('table').addClass('table-bordered'); const $tbody = $('').appendTo($table); arr.forEach((row, i) => { if (i >= 3) { return; } const $row = $(''); row.forEach(value => { const $cell = $('
').html(this.getHelper().sanitizeHtml(value)); $row.append($cell); }); $tbody.append($row); }); const $container = $('#import-preview'); $container.empty().append($table); } csvToArray(strData, strDelimiter, strQualifier) { strDelimiter = strDelimiter || ','; strQualifier = strQualifier || '\"'; strDelimiter = strDelimiter.replace(/\\t/, '\t'); const objPattern = new RegExp( // Delimiters. "(\\" + strDelimiter + "|\\r?\\n|\\r|^)" + // Quoted fields. "(?:" + strQualifier + "([^" + strQualifier + "]*(?:" + strQualifier + "" + strQualifier + "[^" + strQualifier + "]*)*)" + strQualifier + "|" + // Standard fields. "([^" + strQualifier + "\\" + strDelimiter + "\\r\\n]*))", "gi"); const arrData = [[]]; let arrMatches = null; while (arrMatches = objPattern.exec(strData)) { const strMatchedDelimiter = arrMatches[1]; let strMatchedValue; if (strMatchedDelimiter.length && strMatchedDelimiter !== strDelimiter) { arrData.push([]); } strMatchedValue = arrMatches[2] ? arrMatches[2].replace(new RegExp("\"\"", "g"), "\"") : arrMatches[3]; arrData[arrData.length - 1].push(strMatchedValue); } return arrData; } saveAsDefault() { const preferences = this.getPreferences(); const importParams = Espo.Utils.cloneDeep(preferences.get('importParams') || {}); const data = {}; this.paramList.forEach(attribute => { data[attribute] = this.model.get(attribute); }); importParams.default = data; preferences.save({ importParams: importParams }).then(() => { Espo.Ui.success(this.translate('Saved')); }); this.hideSaveAsDefaultButton(); } controlFieldVisibility() { if (this.model.get('idleMode')) { this.hideField('manualMode'); } else { this.showField('manualMode'); } if (this.model.get('manualMode')) { this.hideField('idleMode'); } else { this.showField('idleMode'); } } hideField(name) { this.$el.find('.field[data-name="' + name + '"]').parent().addClass('hidden-cell'); } showField(name) { this.$el.find('.field[data-name="' + name + '"]').parent().removeClass('hidden-cell'); } convertFormatToLabel(format) { const formatItemLabelMap = { 'YYYY': '2021', 'DD': '27', 'MM': '12', 'HH': '23', 'mm': '00', 'hh': '11', 'ss': '00', 'a': 'pm', 'A': 'PM' }; let label = format; for (const item in formatItemLabelMap) { const value = formatItemLabelMap[item]; label = label.replace(new RegExp(item, 'g'), value); } return format + ' · ' + label; } getDateFormatDataList() { const dateFormatList = this.getMetadata().get(['clientDefs', 'Import', 'dateFormatList']) || []; return dateFormatList.map(item => { return { key: item, label: this.convertFormatToLabel(item) }; }); } getTimeFormatDataList() { const timeFormatList = this.getMetadata().get(['clientDefs', 'Import', 'timeFormatList']) || []; return timeFormatList.map(item => { return { key: item, label: this.convertFormatToLabel(item) }; }); } } var _default = _exports.default = Step1ImportView; }); define("views/import/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-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 ImportListView extends _list.default { createButton = false; setup() { super.setup(); this.menu.buttons.unshift({ iconHtml: '', text: this.translate('New Import', 'labels', 'Import'), link: '#Import', acl: 'edit' }); } } var _default = _exports.default = ImportListView; }); define("views/import/index", ["exports", "view"], function (_exports, _view) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _view = _interopRequireDefault(_view); 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. ************************************************************************/ /** @module views/import/index */ class IndexImportView extends _view.default { template = 'import/index'; formData = null; fileContents = null; data() { return { fromAdmin: this.options.fromAdmin }; } setup() { this.entityType = this.options.entityType || null; this.startFromStep = 1; if (this.options.formData || this.options.fileContents) { this.formData = this.options.formData || {}; this.fileContents = this.options.fileContents || null; this.entityType = this.formData.entityType || null; if (this.options.step) { this.startFromStep = this.options.step; } } } changeStep(num, result) { this.step = num; if (num > 1) { this.setConfirmLeaveOut(true); } this.createView('step', 'views/import/step' + num.toString(), { selector: '> .import-container', entityType: this.entityType, formData: this.formData, result: result }, view => { view.render(); }); let url = '#Import'; if (this.options.fromAdmin && this.step === 1) { url = '#Admin/import'; } if (this.step > 1) { url += '/index/step=' + this.step; } this.getRouter().navigate(url, { trigger: false }); } afterRender() { this.changeStep(this.startFromStep); } updatePageTitle() { this.setPageTitle(this.getLanguage().translate('Import', 'labels', 'Admin')); } setConfirmLeaveOut(value) { this.getRouter().confirmLeaveOut = value; } } var _default = _exports.default = IndexImportView; }); define("views/import/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. ************************************************************************/ class ImportDetailView extends _detail.default { getHeader() { let name = this.getDateTime().toDisplay(this.model.get('createdAt')); return this.buildHeaderHtml([$('').attr('href', '#' + this.model.entityType + '/list').text(this.getLanguage().translate(this.model.entityType, 'scopeNamesPlural')), $('').text(name)]); } setup() { super.setup(); this.setupMenu(); this.listenTo(this.model, 'change', () => { this.setupMenu(); if (this.isRendered()) { this.getView('header').reRender(); } }); this.listenTo(this.model, 'sync', m => { this.controlButtons(m); }); } setupMenu() { this.addMenuItem('buttons', { label: "Remove Import Log", action: "removeImportLog", name: 'removeImportLog', style: "default", acl: "delete", title: this.translate('removeImportLog', 'messages', 'Import') }, true); this.addMenuItem('buttons', { label: "Revert Import", name: 'revert', action: "revert", style: "danger", acl: "edit", title: this.translate('revert', 'messages', 'Import'), hidden: !this.model.get('importedCount') }, true); this.addMenuItem('buttons', { label: "Remove Duplicates", name: 'removeDuplicates', action: "removeDuplicates", style: "default", acl: "edit", title: this.translate('removeDuplicates', 'messages', 'Import'), hidden: !this.model.get('duplicateCount') }, true); this.addMenuItem('dropdown', { label: 'New import with same params', name: 'createWithSameParams', action: 'createWithSameParams' }); } controlButtons(model) { if (!model || model.hasChanged('importedCount')) { if (this.model.get('importedCount')) { this.showHeaderActionItem('revert'); } else { this.hideHeaderActionItem('revert'); } } if (!model || model.hasChanged('duplicateCount')) { if (this.model.get('duplicateCount')) { this.showHeaderActionItem('removeDuplicates'); } else { this.hideHeaderActionItem('removeDuplicates'); } } } // noinspection JSUnusedGlobalSymbols actionRemoveImportLog() { this.confirm(this.translate('confirmRemoveImportLog', 'messages', 'Import'), () => { this.disableMenuItem('removeImportLog'); Espo.Ui.notify(this.translate('pleaseWait', 'messages')); this.model.destroy({ wait: true }).then(() => { Espo.Ui.notify(false); var collection = this.model.collection; if (collection) { if (collection.total > 0) { collection.total--; } } this.getRouter().navigate('#Import/list', { trigger: true }); this.removeMenuItem('removeImportLog', true); }); }); } // noinspection JSUnusedGlobalSymbols actionRevert() { this.confirm(this.translate('confirmRevert', 'messages', 'Import'), () => { this.disableMenuItem('revert'); Espo.Ui.notify(this.translate('pleaseWait', 'messages')); Espo.Ajax.postRequest(`Import/${this.model.id}/revert`).then(() => { this.getRouter().navigate('#Import/list', { trigger: true }); }); }); } // noinspection JSUnusedGlobalSymbols actionRemoveDuplicates() { this.confirm(this.translate('confirmRemoveDuplicates', 'messages', 'Import'), () => { this.disableMenuItem('removeDuplicates'); Espo.Ui.notify(this.translate('pleaseWait', 'messages')); Espo.Ajax.postRequest(`Import/${this.model.id}/removeDuplicates`).then(() => { this.removeMenuItem('removeDuplicates', true); this.model.fetch(); this.model.trigger('update-all'); Espo.Ui.success(this.translate('duplicatesRemoved', 'messages', 'Import')); }); }); } // noinspection JSUnusedGlobalSymbols actionCreateWithSameParams() { let formData = this.model.get('params') || {}; formData.entityType = this.model.get('entityType'); formData.attributeList = this.model.get('attributeList') || []; formData = Espo.Utils.cloneDeep(formData); this.getRouter().navigate('#Import', { trigger: false }); this.getRouter().dispatch('Import', 'index', { formData: formData }); } } var _default = _exports.default = ImportDetailView; }); define("views/import/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-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 ImportListRecordView extends _list.default { quickDetailDisabled = true; quickEditDisabled = true; checkAllResultDisabled = true; massActionList = ['remove']; rowActionsView = 'views/record/row-actions/remove-only'; } var _default = _exports.default = ImportListRecordView; }); define("views/import/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-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 ImportDetailRecordView extends _detail.default { readOnly = true; returnUrl = '#Import/list'; checkInterval = 5; resultPanelFetchLimit = 10; duplicateAction = false; setup() { super.setup(); this.fetchCounter = 0; this.setupChecking(); this.hideActionItem('delete'); } setupChecking() { if (!this.model.has('status')) { this.listenToOnce(this.model, 'sync', this.setupChecking.bind(this)); return; } if (!~['In Process', 'Pending', 'Standby'].indexOf(this.model.get('status'))) { return; } setTimeout(this.runChecking.bind(this), this.checkInterval * 1000); this.on('remove', () => { this.stopChecking = true; }); } runChecking() { if (this.stopChecking) { return; } this.model.fetch().then(() => { const isFinished = !~['In Process', 'Pending', 'Standby'].indexOf(this.model.get('status')); if (this.fetchCounter < this.resultPanelFetchLimit && !isFinished) { this.fetchResultPanels(); } if (isFinished) { this.fetchResultPanels(); return; } setTimeout(this.runChecking.bind(this), this.checkInterval * 1000); }); this.fetchCounter++; } fetchResultPanels() { const bottomView = this.getView('bottom'); if (!bottomView) { return; } const importedView = bottomView.getView('imported'); if (importedView && importedView.collection) { importedView.collection.fetch(); } const duplicatesView = bottomView.getView('duplicates'); if (duplicatesView && duplicatesView.collection) { duplicatesView.collection.fetch(); } const updatedView = bottomView.getView('updated'); if (updatedView && updatedView.collection) { updatedView.collection.fetch(); } } } var _default = _exports.default = ImportDetailRecordView; }); define("views/import/record/row-actions/duplicates", ["exports", "views/record/row-actions/default"], function (_exports, _default2) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _default2 = _interopRequireDefault(_default2); 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 ImportDuplicatesRowActionsView extends _default2.default { getActionList() { const list = super.getActionList(); list.push({ action: 'unmarkAsDuplicate', label: 'Set as Not Duplicate', data: { id: this.model.id, type: this.model.entityType } }); return list; } } var _default = _exports.default = ImportDuplicatesRowActionsView; }); define("views/import/record/panels/updated", ["exports", "views/import/record/panels/imported"], function (_exports, _imported) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _imported = _interopRequireDefault(_imported); 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 ImportUpdatedPanelView extends _imported.default { link = 'updated'; rowActionsView = 'views/record/row-actions/relationship-view-and-edit'; setup() { this.title = this.title || this.translate('Updated', 'labels', 'Import'); super.setup(); } } var _default = _exports.default = ImportUpdatedPanelView; }); define("views/import/record/panels/duplicates", ["exports", "views/import/record/panels/imported"], function (_exports, _imported) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _imported = _interopRequireDefault(_imported); 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 ImportDuplicatesPanelView extends _imported.default { link = 'duplicates'; setup() { this.title = this.title || this.translate('Duplicates', 'labels', 'Import'); super.setup(); } // noinspection JSUnusedGlobalSymbols actionUnmarkAsDuplicate(data) { const id = data.id; const type = data.type; this.confirm(this.translate('confirmation', 'messages'), () => { Espo.Ajax.postRequest(`Import/${this.model.id}/unmarkDuplicates`, { entityId: id, entityType: type }).then(() => { this.collection.fetch(); }); }); } } var _default = _exports.default = ImportDuplicatesPanelView; }); define("views/group-email-folder/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-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 GroupEmailFolderListView extends _list.default { quickCreate = true; setup() { super.setup(); if (this.options.params.fromAdmin) { this.hideHeaderActionItem('emails'); } } } var _default = _exports.default = GroupEmailFolderListView; }); define("views/group-email-folder/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-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 _list.default { rowActionsView = 'views/email-folder/record/row-actions/default'; // noinspection JSUnusedGlobalSymbols async actionMoveUp(data) { const model = this.collection.get(data.id); if (!model) { return; } const index = this.collection.indexOf(model); if (index === 0) { return; } Espo.Ui.notifyWait(); await Espo.Ajax.postRequest('GroupEmailFolder/action/moveUp', { id: model.id }); await this.collection.fetch(); Espo.Ui.notify(false); } // noinspection JSUnusedGlobalSymbols async actionMoveDown(data) { const model = this.collection.get(data.id); if (!model) { return; } const index = this.collection.indexOf(model); if (index === this.collection.length - 1 && this.collection.length === this.collection.total) { return; } Espo.Ui.notifyWait(); await Espo.Ajax.postRequest('GroupEmailFolder/action/moveDown', { id: model.id }); await this.collection.fetch(); Espo.Ui.notify(false); } } _exports.default = _default; }); define("views/group-email-folder/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-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 _edit.default { afterSave() { this.getBaseController().clearScopeStoredMainView('Email'); super.afterSave(); } } _exports.default = _default; }); define("views/group-email-folder/record/row-actions/default", ["exports", "views/record/row-actions/default"], function (_exports, _default2) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _default2 = _interopRequireDefault(_default2); 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 _default2.default { getActionList() { const list = super.getActionList(); if (this.options.acl.edit) { list.unshift({ action: 'moveDown', label: 'Move Down', data: { id: this.model.id } }); list.unshift({ action: 'moveUp', label: 'Move Up', data: { id: this.model.id } }); } return list; } } _exports.default = _default; }); define("views/external-account/oauth2", ["exports", "view", "model"], function (_exports, _view, _model) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _view = _interopRequireDefault(_view); _model = _interopRequireDefault(_model); 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. ************************************************************************/ /** * @internal Do not extend. */ class ExternalAccountOauth2View extends _view.default { template = 'external-account/oauth2'; data() { return { integration: this.integration, helpText: this.helpText, isConnected: this.isConnected }; } isConnected = false; setup() { this.addActionHandler('connect', () => this.connect()); this.addActionHandler('save', () => this.save()); this.addActionHandler('cancel', () => this.getRouter().navigate('#ExternalAccount', { trigger: true })); this.integration = this.options.integration; this.id = this.options.id; this.helpText = false; if (this.getLanguage().has(this.integration, 'help', 'ExternalAccount')) { this.helpText = this.translate(this.integration, 'help', 'ExternalAccount'); } this.fieldList = []; this.dataFieldList = []; this.model = new _model.default(); this.model.id = this.id; this.model.entityType = this.model.name = 'ExternalAccount'; this.model.urlRoot = 'ExternalAccount'; this.model.defs = { fields: { enabled: { required: true, type: 'bool' } } }; this.wait(true); this.model.populateDefaults(); this.listenToOnce(this.model, 'sync', () => { this.createFieldView('bool', 'enabled'); Espo.Ajax.getRequest('ExternalAccount/action/getOAuth2Info?id=' + this.id).then(response => { this.clientId = response.clientId; this.redirectUri = response.redirectUri; if (response.isConnected) { this.isConnected = true; } this.wait(false); }); }); this.model.fetch(); } hideField(name) { this.$el.find(`label[data-name="${name}"]`).addClass('hide'); this.$el.find(`div.field[data-name="${name}"]`).addClass('hide'); const view = this.getView(name); if (view) { view.disabled = true; } } showField(name) { this.$el.find(`label[data-name="${name}"]`).removeClass('hide'); this.$el.find(`div.field[data-name="${name}"]`).removeClass('hide'); const view = this.getView(name); if (view) { view.disabled = false; } } afterRender() { if (!this.model.get('enabled')) { this.$el.find('.data-panel').addClass('hidden'); } this.listenTo(this.model, 'change:enabled', () => { if (this.model.get('enabled')) { this.$el.find('.data-panel').removeClass('hidden'); } else { this.$el.find('.data-panel').addClass('hidden'); } }); } createFieldView(type, name, readOnly, params) { this.createView(name, this.getFieldManager().getViewName(type), { model: this.model, selector: '.field[data-name="' + name + '"]', defs: { name: name, params: params }, mode: readOnly ? 'detail' : 'edit', readOnly: readOnly }); this.fieldList.push(name); } save() { this.fieldList.forEach(field => { const view = /** @type {import('views/fields/base').default} */this.getView(field); if (!view.readOnly) { view.fetchToModel(); } }); let notValid = false; this.fieldList.forEach(field => { const view = /** @type {import('views/fields/base').default} */this.getView(field); notValid = view.validate() || notValid; }); if (notValid) { Espo.Ui.error(this.translate('Not valid')); return; } this.listenToOnce(this.model, 'sync', () => { Espo.Ui.success(this.translate('Saved')); if (!this.model.get('enabled')) { this.setNotConnected(); } }); Espo.Ui.notify(this.translate('saving', 'messages')); this.model.save(); } popup(options, callback) { options.windowName = options.windowName || 'ConnectWithOAuth'; options.windowOptions = options.windowOptions || 'location=0,status=0,width=800,height=400'; options.callback = options.callback || function () { window.location.reload(); }; const self = this; let path = options.path; const arr = []; const params = options.params || {}; for (const name in params) { if (params[name]) { arr.push(name + '=' + encodeURI(params[name])); } } path += '?' + arr.join('&'); const parseUrl = str => { let code = null; let error = null; str = str.substr(str.indexOf('?') + 1, str.length); str.split('&').forEach(part => { const arr = part.split('='); const name = decodeURI(arr[0]); const value = decodeURI(arr[1] || ''); if (name === 'code') { code = value; } if (name === 'error') { error = value; } }); if (code) { return { code: code }; } else if (error) { return { error: error }; } }; const popup = window.open(path, options.windowName, options.windowOptions); let interval; interval = window.setInterval(() => { if (popup.closed) { window.clearInterval(interval); return; } const res = parseUrl(popup.location.href.toString()); if (res) { callback.call(self, res); popup.close(); window.clearInterval(interval); } }, 500); } connect() { this.popup({ path: this.getMetadata().get(`integrations.${this.integration}.params.endpoint`), params: { client_id: this.clientId, redirect_uri: this.redirectUri, scope: this.getMetadata().get(`integrations.${this.integration}.params.scope`), response_type: 'code', access_type: 'offline', approval_prompt: 'force' } }, response => { if (response.error) { Espo.Ui.notify(false); return; } if (!response.code) { Espo.Ui.error(this.translate('Error occurred')); return; } this.$el.find('[data-action="connect"]').addClass('disabled'); Espo.Ajax.postRequest('ExternalAccount/action/authorizationCode', { id: this.id, code: response.code }).then(response => { Espo.Ui.notify(false); if (response === true) { this.setConnected(); } else { this.setNotConnected(); } this.$el.find('[data-action="connect"]').removeClass('disabled'); }).catch(() => { this.$el.find('[data-action="connect"]').removeClass('disabled'); }); }); } setConnected() { this.isConnected = true; this.$el.find('[data-action="connect"]').addClass('hidden'); this.$el.find('.connected-label').removeClass('hidden'); } setNotConnected() { this.isConnected = false; this.$el.find('[data-action="connect"]').removeClass('hidden'); this.$el.find('.connected-label').addClass('hidden'); } } // noinspection JSUnusedGlobalSymbols var _default = _exports.default = ExternalAccountOauth2View; }); define("views/external-account/index", ["exports", "view"], function (_exports, _view) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _view = _interopRequireDefault(_view); 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 ExternalAccountIndex extends _view.default { template = 'external-account/index'; data() { return { externalAccountList: this.externalAccountList, id: this.id, externalAccountListCount: this.externalAccountList.length }; } setup() { this.addHandler('click', '#external-account-menu a.external-account-link', (e, target) => { const id = `${target.dataset.id}__${this.userId}`; this.openExternalAccount(id); }); this.externalAccountList = this.collection.models.map(model => model.getClonedAttributes()); this.userId = this.getUser().id; this.id = this.options.id || null; if (this.id) { this.userId = this.id.split('__')[1]; } this.on('after:render', () => { this.renderHeader(); if (!this.id) { this.renderDefaultPage(); } else { this.openExternalAccount(this.id); } }); } openExternalAccount(id) { this.id = id; const integration = this.integration = id.split('__')[0]; this.userId = id.split('__')[1]; this.getRouter().navigate(`#ExternalAccount/edit/${id}`, { trigger: false }); const authMethod = this.getMetadata().get(['integrations', integration, 'authMethod']); const viewName = this.getMetadata().get(['integrations', integration, 'userView']) || 'views/external-account/' + Espo.Utils.camelCaseToHyphen(authMethod); Espo.Ui.notifyWait(); this.createView('content', viewName, { fullSelector: '#external-account-content', id: id, integration: integration }, view => { this.renderHeader(); view.render(); Espo.Ui.notify(false); $(window).scrollTop(0); this.controlCurrentLink(id); }); } controlCurrentLink() { const id = this.integration; this.element.querySelectorAll('.external-account-link').forEach(element => { element.classList.remove('disabled', 'text-muted'); }); const currentLink = this.element.querySelector(`.external-account-link[data-id="${id}"]`); if (currentLink) { currentLink.classList.add('disabled', 'text-muted'); } } renderDefaultPage() { $('#external-account-header').html('').hide(); $('#external-account-content').html(''); } renderHeader() { const $header = $('#external-account-header'); if (!this.id) { $header.html(''); return; } $header.show().text(this.integration); } updatePageTitle() { this.setPageTitle(this.translate('ExternalAccount', 'scopeNamesPlural')); } } var _default = _exports.default = ExternalAccountIndex; }); define("views/email-account/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-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 EmailAccountListView extends _list.default { keepCurrentRootUrl = true; setup() { this.options.params = this.options.params || {}; const params = this.options.params || {}; this.userId = params.userId; super.setup(); if (this.userId) { this.collection.where = [{ type: 'equals', field: 'assignedUserId', value: params.userId }]; } } setupSearchPanel() { if (this.userId || !this.getUser().isAdmin()) { this.searchPanel = false; this.searchManager.reset(); return; } super.setupSearchPanel(); } getCreateAttributes() { const attributes = {}; if (this.options.params.userId) { attributes.assignedUserId = this.options.params.userId; attributes.assignedUserName = this.options.params.userName || this.options.params.userId; } return attributes; } } var _default = _exports.default = EmailAccountListView; }); define("views/email-account/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-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 _list.default { quickDetailDisabled = true; quickEditDisabled = true; checkAllResultDisabled = true; massActionList = ['remove', 'massUpdate']; } _exports.default = _default; }); define("views/email-account/record/edit", ["exports", "views/record/edit", "views/email-account/record/detail"], function (_exports, _edit, _detail) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _edit = _interopRequireDefault(_edit); _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. ************************************************************************/ class _default extends _edit.default { setup() { super.setup(); _detail.default.prototype.setupFieldsBehaviour.call(this); _detail.default.prototype.initSslFieldListening.call(this); _detail.default.prototype.initSmtpFieldsControl.call(this); if (this.getUser().isAdmin()) { this.setFieldNotReadOnly('assignedUser'); } else { this.setFieldReadOnly('assignedUser'); } } modifyDetailLayout(layout) { _detail.default.prototype.modifyDetailLayout.call(this, layout); } setupFieldsBehaviour() { _detail.default.prototype.setupFieldsBehaviour.call(this); } controlStatusField() { _detail.default.prototype.controlStatusField.call(this); } controlSmtpFields() { _detail.default.prototype.controlSmtpFields.call(this); } controlSmtpAuthField() { _detail.default.prototype.controlSmtpAuthField.call(this); } wasFetched() { _detail.default.prototype.wasFetched.call(this); } } _exports.default = _default; }); define("views/email-account/modals/select-folder", ["exports", "views/modal"], function (_exports, _modal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _modal = _interopRequireDefault(_modal); 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 _modal.default { cssName = 'select-folder-modal'; template = 'email-account/modals/select-folder'; data() { return { folders: this.options.folders }; } setup() { this.headerText = this.translate('Select'); this.addActionHandler('select', (event, target) => { const value = target.dataset.value; this.trigger('select', value); }); } } _exports.default = _default; }); define("views/email-account/fields/email-folder", ["exports", "views/fields/link"], function (_exports, _link) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _link = _interopRequireDefault(_link); 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 _link.default { createDisabled = true; autocompleteDisabled = true; getSelectFilters() { if (this.getUser().isAdmin() && this.model.get('assignedUserId')) { return { assignedUser: { type: 'equals', attribute: 'assignedUserId', value: this.model.get('assignedUserId'), data: { type: 'is', nameValue: this.model.get('assignedUserName') } } }; } } setup() { super.setup(); this.listenTo(this.model, 'change:assignedUserId', (model, e, o) => { if (!o.ui) { return; } this.model.set({ emailFolderId: null, emailFolderName: null }); }); } } _exports.default = _default; }); define("views/email-account/fields/email-address", ["exports", "views/fields/email-address"], function (_exports, _emailAddress) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _emailAddress = _interopRequireDefault(_emailAddress); 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 _emailAddress.default { setup() { super.setup(); this.on('change', () => { const emailAddress = this.model.get('emailAddress'); this.model.set('name', emailAddress); }); const userId = this.model.get('assignedUserId'); if (this.getUser().isAdmin() && userId !== this.getUser().id) { Espo.Ajax.getRequest(`User/${userId}`).then(data => { const list = []; if (data.emailAddress) { list.push(data.emailAddress); this.params.options = list; if (data.emailAddressData) { data.emailAddressData.forEach(item => { if (item.emailAddress === data.emailAddress) { return; } list.push(item.emailAddress); }); } this.reRender(); } }); } } setupOptions() { if (this.model.get('assignedUserId') === this.getUser().id) { this.params.options = this.getUser().get('userEmailAddressList'); } } } _exports.default = _default; });