Bugzilla – Attachment 84170 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), 3.84 KB, created by
Jasmine Amohia
on 2019-01-17 23:17:49 UTC
(
hide
)
Description:
Bug 22150: Ability to select or unselect all member flags
Filename:
MIME Type:
Creator:
Jasmine Amohia
Created:
2019-01-17 23:17:49 UTC
Size:
3.84 KB
patch
obsolete
>From f2460806d7a2820aa54a3bdfdad1527693296610 Mon Sep 17 00:00:00 2001 >From: Jasmine Amohia <jasmineamohia.student@wegc.school.nz> >Date: Thu, 17 Jan 2019 08:15:51 +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 >--- > .../prog/en/modules/members/member-flags.tt | 48 ++++++++++++++++++---- > 1 file changed, 41 insertions(+), 7 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 c46e1ff04c..9d7ab305e1 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 >@@ -22,7 +22,20 @@ > <div class="yui-b"> > [% INCLUDE 'members-toolbar.inc' %] > >-<form method="post" action="/cgi-bin/koha/members/member-flags.pl"> >+<p> >+ <a id="CheckAllFlags" href="#"> >+ <i class="fa fa-check"> >+ </i> >+ Select all >+ </a> >+ <a id="UncheckAllFlags" href="#"> >+ <i class="fa fa-remove"> >+ </i> >+ Clear all >+ </a> >+</p> >+ >+<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" /> >@@ -93,6 +106,23 @@ > <!-- set up tree --> > <script type="text/javascript"> > $(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); >+ } >+ }); >+ > $("#permissionstree").treeview({animated: "fast", collapsed: true}); > > // Enforce Superlibrarian Privilege Mutual Exclusivity >@@ -101,12 +131,7 @@ > 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" && !$(this).hasClass('superlib') ){ >- $(this).prop('disabled', true); >- $(this).prop('checked', false); >- } >- }); >+ setLibrarian(); > } > > $('input#flag-0').click(function() { >@@ -135,6 +160,15 @@ > > }); > >+ function setLibrarian(){ >+ $('input[name="flag"]').each(function() { >+ if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ >+ $(this).prop('disabled', true); >+ $(this).prop('checked', false); >+ } >+ }); >+ } >+ > // manage checking/unchecking parent permissions > var originalChildStates = {}; /* keep track of subpermission checkbox values > so that user can recover from accidentally >-- >2.11.0
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