[DE] Check role name
This commit is contained in:
parent
19358f81e6
commit
0848f083f7
|
@ -73,6 +73,7 @@ define([
|
||||||
this.options.tpl = _.template(this.template)(this.options);
|
this.options.tpl = _.template(this.template)(this.options);
|
||||||
this.props = this.options.props;
|
this.props = this.options.props;
|
||||||
this.lastColor = 'C9C8FF';
|
this.lastColor = 'C9C8FF';
|
||||||
|
this.oformManager = this.options.oformManager;
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||||
},
|
},
|
||||||
|
@ -91,7 +92,12 @@ define([
|
||||||
style : 'width: 100%;',
|
style : 'width: 100%;',
|
||||||
validateOnBlur: false,
|
validateOnBlur: false,
|
||||||
validation : function(value) {
|
validation : function(value) {
|
||||||
return value ? true : '';
|
value = value.trim();
|
||||||
|
if (_.isEmpty(value))
|
||||||
|
return '';
|
||||||
|
if (!(me.props && value === me.props.name) && me.oformManager.asc_haveRole(value))
|
||||||
|
return me.errNameExists;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -200,6 +206,7 @@ define([
|
||||||
txtTitleNew: 'Create New Role',
|
txtTitleNew: 'Create New Role',
|
||||||
textName: 'Role name',
|
textName: 'Role name',
|
||||||
textEmptyError: 'Role name must not be empty.',
|
textEmptyError: 'Role name must not be empty.',
|
||||||
textNoHighlight: 'No highlighting'
|
textNoHighlight: 'No highlighting',
|
||||||
|
errNameExists: 'Role with such a name already exists.'
|
||||||
}, DE.Views.RoleEditDlg || {}));
|
}, DE.Views.RoleEditDlg || {}));
|
||||||
});
|
});
|
Loading…
Reference in a new issue