catch error cases around users and roles.

This commit is contained in:
Keith Woodlock
2012-05-28 19:49:47 +01:00
parent 66d3babb06
commit 1cf29aaead
9 changed files with 61 additions and 35 deletions
@@ -159,20 +159,25 @@ $(document).ready(function() {
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
if (this.name === 'permissions' || this.name === 'notSelectedPermissions' || this.name === 'roles' || this.name === 'notSelectedRoles') {
o[this.name] = new Array();
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
}
if (this.name === 'notSelectedPermissions' || this.name === 'notSelectedRoles') {
// do not serialize
} else {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
if (this.name === 'permissions' || this.name === 'roles') {
o[this.name] = new Array();
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
}
}
});
return o;
};