|
Lines 12-18
Link Here
|
| 12 |
// Enforce Superlibrarian Privilege Mutual Exclusivity |
12 |
// Enforce Superlibrarian Privilege Mutual Exclusivity |
| 13 |
if($('input[id="flag-0"]:checked').length){ |
13 |
if($('input[id="flag-0"]:checked').length){ |
| 14 |
if ($('input[name="flag"]:checked').length > 1){ |
14 |
if ($('input[name="flag"]:checked').length > 1){ |
| 15 |
alert('Inconsistency Detected!\n\nThe superlibrarian privilege is mutually exclusive of other privileges, as it includes them all.\n\nThis patron\'s privileges will now be reset to include only superlibrarian.'); |
15 |
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.")); |
| 16 |
} |
16 |
} |
| 17 |
|
17 |
|
| 18 |
$('input[name="flag"]').each(function() { |
18 |
$('input[name="flag"]').each(function() { |
|
Lines 39-48
Link Here
|
| 39 |
} |
39 |
} |
| 40 |
}); |
40 |
}); |
| 41 |
|
41 |
|
|
|
42 |
$(".flag").on("change",function(){ |
| 43 |
if( $(this).hasClass("parent") ){ |
| 44 |
toggleChildren(this); |
| 45 |
} else { |
| 46 |
toggleParent(this); |
| 47 |
} |
| 48 |
}); |
| 49 |
|
| 42 |
}); |
50 |
}); |
| 43 |
</script> |
51 |
|
| 44 |
<!-- manage checking/unchecking parent permissions --> |
52 |
// manage checking/unchecking parent permissions |
| 45 |
<script type="text/javascript"> |
|
|
| 46 |
var originalChildStates = {}; /* keep track of subpermission checkbox values |
53 |
var originalChildStates = {}; /* keep track of subpermission checkbox values |
| 47 |
so that user can recover from accidentally |
54 |
so that user can recover from accidentally |
| 48 |
toggling a parent/module permission */ |
55 |
toggling a parent/module permission */ |
|
Lines 127-135
Link Here
|
| 127 |
<li> |
134 |
<li> |
| 128 |
[% END %] |
135 |
[% END %] |
| 129 |
[% IF ( loo.checked ) %] |
136 |
[% IF ( loo.checked ) %] |
| 130 |
<input type="checkbox" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" onclick="toggleChildren(this)" /> |
137 |
<input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" /> |
| 131 |
[% ELSE %] |
138 |
[% ELSE %] |
| 132 |
<input type="checkbox" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" onclick="toggleChildren(this)" /> |
139 |
<input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" /> |
| 133 |
[% END %] |
140 |
[% END %] |
| 134 |
<label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label> |
141 |
<label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label> |
| 135 |
<span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span> |
142 |
<span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span> |
|
Lines 138-146
Link Here
|
| 138 |
[% FOREACH sub_perm_loo IN loo.sub_perm_loop %] |
145 |
[% FOREACH sub_perm_loo IN loo.sub_perm_loop %] |
| 139 |
<li> |
146 |
<li> |
| 140 |
[% IF ( sub_perm_loo.checked ) %] |
147 |
[% IF ( sub_perm_loo.checked ) %] |
| 141 |
<input type="checkbox" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" checked="checked" onclick="toggleParent(this)" /> |
148 |
<input type="checkbox" class="flag child" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" checked="checked" /> |
| 142 |
[% ELSE %] |
149 |
[% ELSE %] |
| 143 |
<input type="checkbox" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" onclick="toggleParent(this)" /> |
150 |
<input type="checkbox" class="flag child" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" /> |
| 144 |
[% END %] |
151 |
[% END %] |
| 145 |
<label class="permissioncode" for="[% sub_perm_loo.id %]">[% sub_perm_loo.code %]</label> |
152 |
<label class="permissioncode" for="[% sub_perm_loo.id %]">[% sub_perm_loo.code %]</label> |
| 146 |
<span class="permissiondesc">[% PROCESS sub_permissions name=sub_perm_loo.code %]</span> |
153 |
<span class="permissiondesc">[% PROCESS sub_permissions name=sub_perm_loo.code %]</span> |