in the case of a user editing their own account. This prevents
a nasty bug whereby Dojo widgets with the readOnly flag set
become labels and therefore do not correctly hold a 'value'
like a normal form widget. See LP#806625 for details.
Signed-off-by: James Fournie <jfournie@sitka.bclibraries.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
// not overwritten when the profile groups arrive and update
wargs.forceSync = true;
wargs.disableQuery = {usergroup : 'f'};
- if(!patron.isnew() && !checkGrpAppPerm(patron.profile()))
- wargs.readOnly = true;
} else {
wargs.forceSync = false;
}
var widget = new openils.widget.AutoFieldWidget(wargs);
widget.build(
function(w, ww) {
- if(fmfield == 'profile') { trimGrpTree(ww); }
+ if(fmfield == 'profile') {
+ trimGrpTree(ww);
+ if(!patron.isnew() && !checkGrpAppPerm(patron.profile())){
+ w.attr('disabled', true);
+ }
+ }
}
);