@@ -, +, @@
disable superlib box
---
.../prog/en/modules/members/member-flags.tt | 27 ++++++++++++----------
1 file changed, 15 insertions(+), 12 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
@@ -36,9 +36,18 @@
[% END %]
[% IF ( loo.checked ) %]
-
+ [% IF disable_superlibrarian_privs && loo.bit == 0 %]
+
+
+ [% ELSE %]
+
+ [% END %]
[% ELSE %]
-
+ [% IF disable_superlibrarian_privs && loo.bit == 0 %]
+
+ [% ELSE %]
+
+ [% END %]
[% END %]
[% PROCESS main_permissions name=loo.flag %]
@@ -85,13 +94,13 @@
$("#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);
}
@@ -99,9 +108,9 @@
}
$('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);
}
@@ -122,12 +131,6 @@
}
});
- [% 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
--