dynamic logic ID field and mass email duplicate fix

This commit is contained in:
yuri
2016-11-25 15:52:05 +02:00
parent c6b369587d
commit 4460a105a8
5 changed files with 89 additions and 51 deletions
@@ -1,54 +1,75 @@
{
"controller": "controllers/record",
"acl": "crm:acl/mass-email",
"recordViews": {
"detail": "crm:views/mass-email/record/detail",
"edit": "crm:views/mass-email/record/edit",
"editQuick": "crm:views/mass-email/record/edit-small"
},
"views": {
"detail": "crm:views/mass-email/detail"
},
"defaultSidePanel": {
"edit": false,
"editSmall": false
},
"formDependency": {
"status": {
"map": {
"Complete": [
{
"action": "setReadOnly",
"fields": [
"status"
"controller": "controllers/record",
"acl": "crm:acl/mass-email",
"recordViews": {
"detail": "crm:views/mass-email/record/detail",
"edit": "crm:views/mass-email/record/edit",
"editQuick": "crm:views/mass-email/record/edit-small"
},
"views": {
"detail": "crm:views/mass-email/detail"
},
"defaultSidePanel": {
"edit": false,
"editSmall": false
},
"dynamicLogic": {
"fields": {
"status": {
"readOnly": {
"conditionGroup": [
{
"type": "and",
"value": [
{
"type": "or",
"value": [
{
"type": "equals",
"attribute": "status",
"value": "Complete"
},
{
"type": "equals",
"attribute": "status",
"value": "In Process"
},
{
"type": "equals",
"attribute": "status",
"value": "Failed"
}
]
},
{
"type": "isNotEmpty",
"attribute": "id"
}
]
}
]
}
}
},
"options": {
"status": [
{
"optionList": [
"Draft",
"Pending"
],
"conditionGroup": [
{
"type": "in",
"attribute": "status",
"value": [
"Draft",
"Pending"
]
}
]
}
]
}
],
"In Process": [
{
"action": "setReadOnly",
"fields": [
"status"
]
}
],
"Failed": [
{
"action": "setReadOnly",
"fields": [
"status"
]
}
]
},
"default": [
{
"action": "setNotReadOnly",
"fields": [
"status"
]
}
]
}
}
}
@@ -7,7 +7,7 @@
},
"status": {
"type": "enum",
"options": ["Draft", "Pending"],
"options": ["Draft", "Pending", "Complete", "In Process", "Failed"],
"default": "Pending"
},
"storeSentEmails": {
@@ -129,6 +129,10 @@
"linkMultiple": {
"view": "views/admin/dynamic-logic/conditions/field-types/link-multiple",
"typeList": ["isEmpty", "isNotEmpty", "contains", "notContains"]
},
"id": {
"view": "views/admin/dynamic-logic/conditions/field-types/base",
"typeList": ["isEmpty", "isNotEmpty"]
}
},
"conditionTypes": {
@@ -99,7 +99,15 @@ Espo.define('views/admin/dynamic-logic/conditions/group-base', 'view', function
viewName = 'views/admin/dynamic-logic/conditions/' + type;
} else {
fieldType = this.getMetadata().get(['entityDefs', this.scope, 'fields', field, 'type']);
viewName = this.getMetadata().get(['clientDefs', 'DynamicLogic', 'fieldTypes', fieldType, 'view']);
if (field === 'id') {
fieldType = 'id';
}
if (fieldType) {
viewName = this.getMetadata().get(['clientDefs', 'DynamicLogic', 'fieldTypes', fieldType, 'view']);
}
}
if (!viewName) return;
@@ -170,6 +178,9 @@ Espo.define('views/admin/dynamic-logic/conditions/group-base', 'view', function
addField: function (field) {
var fieldType = this.getMetadata().get(['entityDefs', this.scope, 'fields', field, 'type']);
if (!fieldType && field == 'id') {
fieldType = 'id';
}
if (!this.getMetadata().get(['clientDefs', 'DynamicLogic', 'fieldTypes', fieldType])) {
throw new Error();
}
@@ -42,6 +42,8 @@ Espo.define('views/admin/dynamic-logic/fields/field', 'views/fields/multi-enum',
return true;
}, this);
filterList.push('id');
filterList.sort(function (v1, v2) {
return this.translate(v1, 'fields', this.options.scope).localeCompare(this.translate(v2, 'fields', this.options.scope));
}.bind(this));