@@ -, +, @@ superlibrarian checkbox also gets unselected --- .../prog/en/modules/members/member-flags.tt | 42 +++++++++++++++---- 1 file changed, 34 insertions(+), 8 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 @@ -21,7 +21,7 @@ [% INCLUDE 'members-toolbar.inc' %] -
+ @@ -33,6 +33,12 @@ Cancel Show all Hide all + + Select all + + + Clear all +
Filter: @@ -105,6 +111,22 @@ var Sticky; $(document).ready(function() { + $("#CheckAllFlags").on("click",function(){ + $(".flag").attr("disabled", false); + $(".flag").prop("checked", true); + return false; + }); + $("#UncheckAllFlags").on("click",function(){ + $(".flag").attr("disabled", false); + $(".flag").prop("checked", false); + return false; + }); + $(".flag").change(function(){ + if(!$(this).is(':checked')){ + $("input#flag-0").prop("checked", false); + } + }); + Sticky = $("#permissions_toolbar"); Sticky.hcSticky({ stickTo: "#permissionstree", @@ -144,12 +166,7 @@ alert(_("Inconsistency detected!") + "\n\n" + _("The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all.") + "\n\n" + _("This patron's privileges will now be reset to include only superlibrarian.")); } - $('input[name="flag"]').each(function() { - if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ - $(this).prop('disabled', true); - $(this).prop('checked', false); - } - }); + setLibrarian(); } $('input#flag-0').click(function() { @@ -222,8 +239,17 @@ } } }); - }); + + function setLibrarian(){ + $('input[name="flag"]').each(function() { + if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ + $(this).prop('disabled', true); + $(this).prop('checked', false); + } + }); + } + [% END %] --