setReadOnly locked

This commit is contained in:
yuri
2015-12-10 16:45:13 +02:00
parent 6d3d922290
commit 90f06fc532
2 changed files with 7 additions and 4 deletions
@@ -26,14 +26,14 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('Views.Fields.AssignedUser', 'Views.Fields.UserWithAvatar', function (Dep) {
Espo.define('views/fields/assigned-user', 'views/fields/user-with-avatar', function (Dep) {
return Dep.extend({
init: function () {
this.assignmentPermission = this.getAcl().get('assignmentPermission');
if (this.assignmentPermission == 'no') {
this.readOnly = true;
this.setReadOnly(true);
}
Dep.prototype.init.call(this);
},
@@ -46,7 +46,7 @@ Espo.define('Views.Fields.AssignedUser', 'Views.Fields.UserWithAvatar', function
getSelectPrimaryFilterName: function () {
return 'active';
},
}
});
});
+4 -1
View File
@@ -87,9 +87,12 @@ Espo.define('views/fields/base', 'view', function (Dep) {
this.getCellElement().removeClass('has-error');
},
setReadOnly: function () {
setReadOnly: function (locked) {
if (this.readOnlyLocked) return;
this.readOnly = true;
if (locked) {
this.readOnlyLocked = true;
}
if (this.mode == 'edit') {
this.setMode('detail');
if (this.isRendered()) {