EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
email account dynamic logic changes
Yuri Kuznetsov981be2715129
diff --git a/application/Espo/Resources/metadata/clientDefs/EmailAccount.json b/application/Espo/Resources/metadata/clientDefs/EmailAccount.jsonindex 130a32c2f6..a3eee54a02 100644--- a/application/Espo/Resources/metadata/clientDefs/EmailAccount.json+++ b/application/Espo/Resources/metadata/clientDefs/EmailAccount.json@@ -9,32 +9,6 @@"list": "views/email-account/list"},"inlineEditDisabled": true,- "formDependency": {- "storeSentEmails": {- "map": {- "true" : [- {- "action": "show",- "fields": ["sentFolder"]- },- {- "action": "setRequired",- "fields": ["sentFolder"]- }- ]- },- "default": [- {- "action": "hide",- "fields": ["sentFolder"]- },- {- "action": "setNotRequired",- "fields": ["sentFolder"]- }- ]- }- },"filterList": [{"name": "active"diff --git a/application/Espo/Resources/metadata/clientDefs/InboundEmail.json b/application/Espo/Resources/metadata/clientDefs/InboundEmail.jsonindex 5a5a79ce84..ec687614af 100644--- a/application/Espo/Resources/metadata/clientDefs/InboundEmail.json+++ b/application/Espo/Resources/metadata/clientDefs/InboundEmail.json@@ -5,30 +5,6 @@"list":"views/inbound-email/record/list"},"inlineEditDisabled": true,- "formDependency": {- "reply": {- "map": {- "true" : [- {- "action": "show",- "fields": ["replyEmailTemplate", "replyFromAddress", "replyFromName"]- }, {- "action": "setRequired",- "fields": ["replyEmailTemplate"]- }- ]- },- "default": [- {- "action": "hide",- "fields": ["replyEmailTemplate", "replyFromAddress", "replyFromName"]- }, {- "action": "setNotRequired",- "fields": ["replyEmailTemplate"]- }- ]- }- },"searchPanelDisabled": true,"relationshipPanels": {"filters": {diff --git a/application/Espo/Resources/metadata/logicDefs/EmailAccount.json b/application/Espo/Resources/metadata/logicDefs/EmailAccount.jsonindex d7836314a2..a0add7d743 100644--- a/application/Espo/Resources/metadata/logicDefs/EmailAccount.json+++ b/application/Espo/Resources/metadata/logicDefs/EmailAccount.json@@ -44,6 +44,24 @@}]}+ },+ "sentFolder": {+ "visible": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "storeSentEmails"+ }+ ]+ },+ "required": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "storeSentEmails"+ }+ ]+ }}}}diff --git a/application/Espo/Resources/metadata/logicDefs/InboundEmail.json b/application/Espo/Resources/metadata/logicDefs/InboundEmail.jsonindex dfcc5813e8..35b4267504 100644--- a/application/Espo/Resources/metadata/logicDefs/InboundEmail.json+++ b/application/Espo/Resources/metadata/logicDefs/InboundEmail.json@@ -54,6 +54,62 @@}]}+ },+ "replyEmailTemplate": {+ "visible": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "reply"+ }+ ]+ },+ "required": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "reply"+ }+ ]+ }+ },+ "replyFromAddress": {+ "visible": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "reply"+ }+ ]+ }+ },+ "replyFromName": {+ "visible": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "reply"+ }+ ]+ }+ },+ "sentFolder": {+ "visible": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "storeSentEmails"+ }+ ]+ },+ "required": {+ "conditionGroup": [+ {+ "type": "isTrue",+ "attribute": "storeSentEmails"+ }+ ]+ }}}}diff --git a/client/src/views/inbound-email/record/detail.js b/client/src/views/inbound-email/record/detail.jsindex b446f7d201..7c1f83e0e0 100644--- a/client/src/views/inbound-email/record/detail.js+++ b/client/src/views/inbound-email/record/detail.js@@ -62,10 +62,8 @@ export default class extends DetailRecordView {initSmtpFieldsControl() {this.controlSmtpFields();- this.controlSentFolderField();this.listenTo(this.model, 'change:useSmtp', this.controlSmtpFields, this);this.listenTo(this.model, 'change:smtpAuth', this.controlSmtpFields, this);- this.listenTo(this.model, 'change:storeSentEmails', this.controlSentFolderField, this);}controlSmtpFields() {@@ -78,7 +76,6 @@ export default class extends DetailRecordView {this.showField('fromName');this.showField('smtpIsShared');this.showField('smtpIsForMassEmail');- this.showField('storeSentEmails');this.setFieldRequired('smtpHost');this.setFieldRequired('smtpPort');@@ -99,26 +96,12 @@ export default class extends DetailRecordView {this.hideField('fromName');this.hideField('smtpIsShared');this.hideField('smtpIsForMassEmail');- this.hideField('storeSentEmails');- this.hideField('sentFolder');this.setFieldNotRequired('smtpHost');this.setFieldNotRequired('smtpPort');this.setFieldNotRequired('smtpUsername');}- controlSentFolderField() {- if (this.model.get('useSmtp') && this.model.get('storeSentEmails')) {- this.showField('sentFolder');- this.setFieldRequired('sentFolder');-- return;- }-- this.hideField('sentFolder');- this.setFieldNotRequired('sentFolder');- }-controlSmtpAuthField() {if (this.model.get('smtpAuth')) {this.showField('smtpUsername');