Lines 36-44
Link Here
|
36 |
<li> |
36 |
<li> |
37 |
[% END %] |
37 |
[% END %] |
38 |
[% IF ( loo.checked ) %] |
38 |
[% IF ( loo.checked ) %] |
39 |
<input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" /> |
39 |
[% IF disable_superlibrarian_privs && loo.bit == 0 %] |
|
|
40 |
<input type="checkbox" disabled="disabled" class="flag parent superlib" id="flag-[% loo.bit %]_disabled" name="flag" value="[% loo.flag %]" checked="checked" /> |
41 |
<input type="hidden" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" > |
42 |
[% ELSE %] |
43 |
<input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" /> |
44 |
[% END %] |
40 |
[% ELSE %] |
45 |
[% ELSE %] |
41 |
<input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" /> |
46 |
[% IF disable_superlibrarian_privs && loo.bit == 0 %] |
|
|
47 |
<input type="checkbox" disabled="disabled" class="flag parent" id="flag-[% loo.bit %]_disabled" name="flag" value="[% loo.flag %]" /> |
48 |
[% ELSE %] |
49 |
<input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" /> |
50 |
[% END %] |
42 |
[% END %] |
51 |
[% END %] |
43 |
<label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label> |
52 |
<label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label> |
44 |
<span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span> |
53 |
<span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span> |
Lines 85-97
Link Here
|
85 |
$("#permissionstree").treeview({animated: "fast", collapsed: true}); |
94 |
$("#permissionstree").treeview({animated: "fast", collapsed: true}); |
86 |
|
95 |
|
87 |
// Enforce Superlibrarian Privilege Mutual Exclusivity |
96 |
// Enforce Superlibrarian Privilege Mutual Exclusivity |
88 |
if($('input[id="flag-0"]:checked').length){ |
97 |
if( $('input[id="flag-0"]:checked').length || $(".superlib:checked").length ){ |
89 |
if ($('input[name="flag"]:checked').length > 1){ |
98 |
if ($('input[name="flag"]:checked').length > 1){ |
90 |
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.")); |
99 |
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.")); |
91 |
} |
100 |
} |
92 |
|
101 |
|
93 |
$('input[name="flag"]').each(function() { |
102 |
$('input[name="flag"]').each(function() { |
94 |
if($(this).attr('id') != "flag-0"){ |
103 |
if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ |
95 |
$(this).prop('disabled', true); |
104 |
$(this).prop('disabled', true); |
96 |
$(this).prop('checked', false); |
105 |
$(this).prop('checked', false); |
97 |
} |
106 |
} |
Lines 99-107
Link Here
|
99 |
} |
108 |
} |
100 |
|
109 |
|
101 |
$('input#flag-0').click(function() { |
110 |
$('input#flag-0').click(function() { |
102 |
if($('input[id="flag-0"]:checked').length){ |
111 |
if( $('input[id="flag-0"]:checked').length || $(".superlib:checked").length ){ |
103 |
$('input[name="flag"]').each(function() { |
112 |
$('input[name="flag"]').each(function() { |
104 |
if($(this).attr('id') != "flag-0"){ |
113 |
if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ |
105 |
$(this).prop('disabled', true); |
114 |
$(this).prop('disabled', true); |
106 |
$(this).prop('checked', false); |
115 |
$(this).prop('checked', false); |
107 |
} |
116 |
} |
Lines 122-133
Link Here
|
122 |
} |
131 |
} |
123 |
}); |
132 |
}); |
124 |
|
133 |
|
125 |
[% IF disable_superlibrarian_privs %] |
|
|
126 |
$("input#flag-0").attr("disabled", true); |
127 |
$("form").submit(function(e) { |
128 |
$("input#flag-0").removeAttr("disabled"); |
129 |
}); |
130 |
[% END %] |
131 |
}); |
134 |
}); |
132 |
|
135 |
|
133 |
// manage checking/unchecking parent permissions |
136 |
// manage checking/unchecking parent permissions |
134 |
- |
|
|