foreign field ordered lists
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('views/admin/field-manager/fields/foreign/field', 'views/fields/enum', function (Dep) {
|
||||
define('views/admin/field-manager/fields/foreign/field', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
@@ -82,6 +82,10 @@ Espo.define('views/admin/field-manager/fields/foreign/field', 'views/fields/enum
|
||||
this.translatedOptions[item] = this.translate(item, 'fields', scope);
|
||||
}, this);
|
||||
|
||||
this.params.options = this.params.options.sort(function (v1, v2) {
|
||||
return this.translate(v1, 'fields', scope).localeCompare(this.translate(v2, 'fields', scope));
|
||||
}.bind(this));
|
||||
|
||||
this.params.options.unshift('');
|
||||
},
|
||||
|
||||
@@ -112,7 +116,7 @@ Espo.define('views/admin/field-manager/fields/foreign/field', 'views/fields/enum
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,11 +47,17 @@ define('views/admin/field-manager/fields/foreign/link', 'views/fields/enum', fun
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
var scope = this.options.scope;
|
||||
|
||||
this.translatedOptions = {};
|
||||
this.params.options.forEach(function (item) {
|
||||
this.translatedOptions[item] = this.translate(item, 'links', this.options.scope);
|
||||
this.translatedOptions[item] = this.translate(item, 'links', scope);
|
||||
}, this);
|
||||
|
||||
this.params.options = this.params.options.sort(function (v1, v2) {
|
||||
return this.translate(v1, 'links', scope).localeCompare(this.translate(v2, 'links', scope));
|
||||
}.bind(this));
|
||||
|
||||
this.params.options.unshift('');
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user