<li>
[% END %]
[% IF ( loo.checked ) %]
- <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" />
+ [% IF disable_superlibrarian_privs && loo.bit == 0 %]
+ <input type="checkbox" disabled="disabled" class="flag parent superlib" id="flag-[% loo.bit %]_disabled" name="flag" value="[% loo.flag %]" checked="checked" />
+ <input type="hidden" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" >
+ [% ELSE %]
+ <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" />
+ [% END %]
[% ELSE %]
- <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" />
+ [% IF disable_superlibrarian_privs && loo.bit == 0 %]
+ <input type="checkbox" disabled="disabled" class="flag parent" id="flag-[% loo.bit %]_disabled" name="flag" value="[% loo.flag %]" />
+ [% ELSE %]
+ <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" />
+ [% END %]
[% END %]
<label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label>
<span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span>
$("#permissionstree").treeview({animated: "fast", collapsed: true});
// Enforce Superlibrarian Privilege Mutual Exclusivity
- if($('input[id="flag-0"]:checked').length){
+ if( $('input[id="flag-0"]:checked').length || $(".superlib:checked").length ){
if ($('input[name="flag"]:checked').length > 1){
alert(_("Inconsistency detected! The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all. This patron's privileges will now be reset to include only superlibrarian."));
}
$('input[name="flag"]').each(function() {
- if($(this).attr('id') != "flag-0"){
+ if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){
$(this).prop('disabled', true);
$(this).prop('checked', false);
}
}
$('input#flag-0').click(function() {
- if($('input[id="flag-0"]:checked').length){
+ if( $('input[id="flag-0"]:checked').length || $(".superlib:checked").length ){
$('input[name="flag"]').each(function() {
- if($(this).attr('id') != "flag-0"){
+ if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){
$(this).prop('disabled', true);
$(this).prop('checked', false);
}
}
});
- [% IF disable_superlibrarian_privs %]
- $("input#flag-0").attr("disabled", true);
- $("form").submit(function(e) {
- $("input#flag-0").removeAttr("disabled");
- });
- [% END %]
});
// manage checking/unchecking parent permissions