Fix custom rights option messes selected mail acl rights

This commit is contained in:
Hadi Nategh 2015-08-06 09:28:42 +00:00
parent c3136791b5
commit a4b850cd8d

View File

@ -3432,13 +3432,25 @@ app.classes.mail = AppJS.extend(
acl_common_rights_selector: function(event,widget)
{
var rowId = widget.id.replace(/[^0-9.]+/g, '');
var rights = (widget.get_value() == "custom"?[]:widget.get_value() == "aeiklprstwx")?
widget.get_value().replace(/[k,x,t,e]/g,"cd").split(""):widget.get_value().split("");
var rights = [];
for (var i=0;i<this.aclRights.length;i++)
switch (widget.get_value())
{
var rightsWidget = this.et2.getWidgetById(rowId+'[acl_' + this.aclRights[i]+ ']');
rightsWidget.set_value((jQuery.inArray(this.aclRights[i],rights) != -1 )?true:false);
case 'custom':
break;
case 'aeiklprstwx':
rights = widget.get_value().replace(/[k,x,t,e]/g,"cd").split("");
break;
default:
rights = widget.get_value().split("");
}
if (rights.length > 0)
{
for (var i=0;i<this.aclRights.length;i++)
{
var rightsWidget = this.et2.getWidgetById(rowId+'[acl_' + this.aclRights[i]+ ']');
rightsWidget.set_value((jQuery.inArray(this.aclRights[i],rights) != -1 )?true:false);
}
}
},