ability to disable field param in entity manager

This commit is contained in:
yuri
2015-08-07 16:00:54 +03:00
parent aecf04a4f8
commit f60732170e
2 changed files with 12 additions and 3 deletions
@@ -53,9 +53,9 @@
"max": 100
},
"leadSource": {
"type": "varchar",
"type": "enum",
"view": "Crm:Opportunity.Fields.LeadSource",
"customizationDisabled": true
"customizationOptionsDisabled": true
},
"closeDate": {
"type": "date",
@@ -87,7 +87,16 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep,
this.defs = model.defs.fields[this.field];
}
this.params = this.getFieldManager().getParams(this.type) || [];
this.params = [];
var params = this.getFieldManager().getParams(this.type) || [];
params.forEach(function (o) {
var item = o.name;
var disableParamName = 'customization' + Espo.Utils.upperCaseFirst(item) + 'Disabled';
if (this.getMetadata().get('entityDefs.' + this.scope + '.fields.' + this.field + '.' + disableParamName)) {
return;
}
this.params.push(o);
}, this);
this.params.forEach(function (o) {
this.model.defs.fields[o.name] = o;