Bugzilla – Attachment 115610 Details for
Bug 22150
Make it easier to unselect one member permission after selecting all
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22150: Ability to select or unselect all member flags
Bug-22150-Ability-to-select-or-unselect-all-member.patch (text/plain), 4.51 KB, created by
Kyle M Hall (khall)
on 2021-01-21 19:43:26 UTC
(
hide
)
Description:
Bug 22150: Ability to select or unselect all member flags
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-01-21 19:43:26 UTC
Size:
4.51 KB
patch
obsolete
>From e8859e171a3ddb7e0028daa303d3a7d746f71d8b Mon Sep 17 00:00:00 2001 >From: Jasmine Amohia <jasmineamohia.student@wegc.school.nz> >Date: Thu, 21 Jan 2021 12:00:38 +0000 >Subject: [PATCH] Bug 22150: Ability to select or unselect all member flags > >To test: >1) Find a patron >2) Click More -> Set permissions >3) Click 'Clear all', confirm all checkboxes get cleared and disabled >4) Click 'Select all', confirm all checkboxes get selected >5) Unselect one checkbox (not superlibrarian), and confirm that the > superlibrarian checkbox also gets unselected >6) Confirm that saving still works as expected > >Edit: Rebased by Owen Leonard > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/members/member-flags.tt | 42 +++++++++++++++---- > 1 file changed, 34 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >index d9eef9a824..6325e69317 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >@@ -21,7 +21,7 @@ > > [% INCLUDE 'members-toolbar.inc' %] > >-<form method="post" action="/cgi-bin/koha/members/member-flags.pl"> >+<form id="flag_form" method="post" action="/cgi-bin/koha/members/member-flags.pl"> > <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" /> > <input type="hidden" name="member" id="borrowernumber" value="[% patron.borrowernumber | html %]" /> > <input type="hidden" name="newflags" value="1" /> >@@ -33,6 +33,12 @@ > <a class="btn btn-default" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-remove"></i> Cancel</a> > <a class="toggleall toggleall_on btn btn-link" href="#"><i class="fa fa-plus-square-o"></i> Show all</a> > <a class="toggleall toggleall_off btn btn-link" href="#"><i class="fa fa-minus-square-o"></i> Hide all</a> >+ <a id="CheckAllFlags" class="btn btn-link" href="#"> >+ <i class="fa fa-check"></i> Select all >+ </a> >+ <a id="UncheckAllFlags" class="btn btn-link" href="#"> >+ <i class="fa fa-remove"></i> Clear all >+ </a> > <div class="btn-group pull-right"> > Filter: <input type="text" name="permissions_filter" id="permissions_filter" size="20" /> > <a href="#" id="clear_filter" style="display:none"><i class="fa fa-remove"></i></a> >@@ -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); >+ } >+ }); >+ } >+ > </script> > [% END %] > >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22150
:
84170
|
115490
|
115530
|
115531
|
115594
|
115595
|
115610
|
115611
|
115612
|
115691