Skip to content

EspoCRM – Open Source CRM Application

ref

Yuri Kuznetsov65f9cd35c99b
diff --git a/client/modules/crm/res/templates/calendar/record/shared-options.tpl b/client/modules/crm/res/templates/calendar/record/shared-options.tpl
deleted file mode 100644
index 271d8183d0..0000000000
--- a/client/modules/crm/res/templates/calendar/record/shared-options.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="cell" data-name="users">
- <label class="control-label" data-name="users">{{{translate 'User List' scope='Calendar'}}}</label>
- <div class="field" data-name="users">{{{usersField}}}</div>
-</div>
\ No newline at end of file
diff --git a/client/modules/crm/src/views/calendar/modals/shared-options.js b/client/modules/crm/src/views/calendar/modals/shared-options.js
index 63701e632b..c4177c4e23 100644
--- a/client/modules/crm/src/views/calendar/modals/shared-options.js
+++ b/client/modules/crm/src/views/calendar/modals/shared-options.js
@@ -28,19 +28,23 @@
import ModalView from 'views/modal';
import Model from 'model';
+import EditForModalRecordView from 'views/record/edit-for-modal';
+import CalendarUsersFieldView from 'crm:views/calendar/fields/users';
export default class TimelineSharedOptionsModalView extends ModalView {
className = 'dialog dialog-record'
templateContent = `
- <div class="panel panel-default no-side-margin">
- <div class="panel-body">
- <div class="record-container">{{{record}}}</div>
- </div>
- </div>
+ <div class="record-container no-side-margin">{{{record}}}</div>
`
+ /**
+ * @private
+ * @type {EditForModalRecordView}
+ */
+ recordView
+
/**
*
* @param {{
@@ -90,28 +94,34 @@ export default class TimelineSharedOptionsModalView extends ModalView {
usersNames: userNames,
});
- this.createView('record', 'crm:views/calendar/record/shared-options', {
+ this.recordView = new EditForModalRecordView({
model: this.model,
- selector: '.record-container',
+ detailLayout: [
+ {
+ rows: [
+ [
+ {
+ view: new CalendarUsersFieldView({
+ name: 'users',
+ }),
+ },
+ false
+ ]
+ ]
+ }
+ ]
});
- }
-
- /**
- * @private
- * @return {import('views/record/edit').default}
- */
- getRecordView() {
- return this.getView('record');
+ this.assignView('record', this.recordView);
}
/**
* @private
*/
actionSave() {
- const data = this.getRecordView().processFetch();
+ const data = this.recordView.processFetch();
- if (this.getRecordView().validate()) {
+ if (this.recordView.validate()) {
return;
}
diff --git a/client/modules/crm/src/views/calendar/record/shared-options.js b/client/modules/crm/src/views/calendar/record/shared-options.js
deleted file mode 100644
index 7fc810c453..0000000000
--- a/client/modules/crm/src/views/calendar/record/shared-options.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/************************************************************************
- * This file is part of EspoCRM.
- *
- * EspoCRM – Open Source CRM application.
- * Copyright (C) 2014-2025 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
- * 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 <https://www.gnu.org/licenses/>.
- *
- * The interactive user interfaces in modified source and object code versions
- * of this program must display Appropriate Legal Notices, as required under
- * Section 5 of the GNU Affero General Public License version 3.
- *
- * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
- * these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
- ************************************************************************/
-
-define('crm:views/calendar/record/shared-options', ['views/record/base'], function (Dep) {
-
- return Dep.extend({
-
- template: 'crm:calendar/record/shared-options',
-
- setup: function () {
- Dep.prototype.setup.call(this);
-
- this.createField('users', 'crm:views/calendar/fields/users');
- },
- });
-});