Fix custom rights option messes selected mail acl rights

This commit is contained in:
Hadi Nategh 2015-08-06 09:27:10 +00:00
parent 9903a5f926
commit 5e789237ed

View File

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