EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
auto reply on detail view
Yuri Kuznetsov41e52c96fc40
diff --git a/application/Espo/Resources/metadata/entityDefs/Email.json b/application/Espo/Resources/metadata/entityDefs/Email.jsonindex 717efca43a..2b1943a9bc 100644--- a/application/Espo/Resources/metadata/entityDefs/Email.json+++ b/application/Espo/Resources/metadata/entityDefs/Email.json@@ -408,7 +408,8 @@"type": "bool","readOnly": true,"customizationDisabled": true,- "layoutDefaultSidePanelDisabled": true+ "layoutDefaultSidePanelDisabled": true,+ "layoutDetailDisabled": true},"parent": {"type": "linkParent",@@ -446,7 +447,9 @@"isAutoReply": {"type": "bool","readOnly": true,- "fieldManagerParamList": []+ "fieldManagerParamList": [],+ "layoutDefaultSidePanelDisabled": true,+ "layoutDetailDisabled": true},"createdAt": {"type": "datetime",diff --git a/client/src/views/email/record/panels/default-side.js b/client/src/views/email/record/panels/default-side.jsindex db97a9f3e8..9d82444e1d 100644--- a/client/src/views/email/record/panels/default-side.js+++ b/client/src/views/email/record/panels/default-side.js@@ -33,6 +33,10 @@ export default class extends DefaultSidePanelView {setupFields() {super.setupFields();+ this.fieldList.push({+ name: 'isAutoReply',+ });+this.fieldList.push({name: 'hasAttachment',view: 'views/email/fields/has-attachment',@@ -40,15 +44,17 @@ export default class extends DefaultSidePanelView {});this.controlHasAttachmentField();-this.listenTo(this.model, 'change:hasAttachment', () => this.controlHasAttachmentField());++ this.controlIsAutoReply();+ this.listenTo(this.model, 'change:isAutoReply', () => this.controlIsAutoReply());}/*** @private*/controlHasAttachmentField() {- if (this.model.get('hasAttachment')) {+ if (this.model.attributes.hasAttachment) {this.recordViewObject.showField('hasAttachment');return;@@ -56,4 +62,17 @@ export default class extends DefaultSidePanelView {this.recordViewObject.hideField('hasAttachment');}++ /**+ * @private+ */+ controlIsAutoReply() {+ if (this.model.attributes.isAutoReply) {+ this.recordViewObject.showField('isAutoReply');++ return;+ }++ this.recordViewObject.hideField('isAutoReply');+ }}diff --git a/client/src/views/record/panels/side.js b/client/src/views/record/panels/side.jsindex e00c2de478..13c5cce01a 100644--- a/client/src/views/record/panels/side.js+++ b/client/src/views/record/panels/side.js@@ -115,6 +115,12 @@ class SidePanelView extends View {*/defs+ /**+ * @protected+ * @type {import('views/record/base').default}+ */+ recordViewObject+events = {/** @this SidePanelView */'click .action': function (e) {@@ -152,8 +158,9 @@ class SidePanelView extends View {this.readOnly = this.readOnly || this.options.readOnly;this.inlineEditDisabled = this.inlineEditDisabled || this.options.inlineEditDisabled;- /** @type {import('views/record/base').default} */- this.recordViewObject = this.options.recordViewObject;+ this.recordViewObject = /** @type {import('views/record/base').default} */++ this.options.recordViewObject;}setup() {