Bugzilla – Attachment 95791 Details for
Bug 14741
Selecting all child permissions doesn't select the top level check box
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14741: Selecting all child permissions doesn't select the top level check box
Bug-14741-Selecting-all-child-permissions-doesnt-s.patch (text/plain), 2.63 KB, created by
Jonathan Druart
on 2019-11-25 14:26:05 UTC
(
hide
)
Description:
Bug 14741: Selecting all child permissions doesn't select the top level check box
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-25 14:26:05 UTC
Size:
2.63 KB
patch
obsolete
>From 2b7b805e91021a67f305e055fbecebe1ac7eca18 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 21 Nov 2019 17:12:30 +0000 >Subject: [PATCH] Bug 14741: Selecting all child permissions doesn't select the > top level check box > >This patch modifies the patron flags page so that manually selecting all >the child permissions also checks the checkbox for the parent >permission. > >To test, apply the patch, open a patron record, select More -> Set >permissions. > > - Expand a set of permissions, for instance "Add, modify, and view > patron information." > - If any boxes are checked, uncheck them. > - Check each of the "child" checkboxes ("Add, modify, and view..." and > "View patron infos..." ). > - When both checkboxes are checked, the "Add, modify, and view" parent > permission should be automatically checked. > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/members/member-flags.tt | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >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 de955ccfdf..d9eef9a824 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 >@@ -196,7 +196,21 @@ > $(".flag").on("change",function(e){ > e.preventDefault(); > if( $(this).hasClass("child") ){ >- $(this).closest(".parent").find(".flag.parent").prop("checked", false); >+ if( $(this).prop("checked") ){ >+ // If this is the last of all the child boxes to be checked the parent should be checked too >+ var unchecked = 0; >+ $(this).closest(".children").find(".child").each(function(){ >+ if( !$(this).prop("checked") ){ >+ // There are still unchecked checkboxes in this group >+ unchecked = 1; >+ } >+ }); >+ if( unchecked === 0 ){ >+ $(this).closest(".parent").find(".flag.parent").prop("checked", true); >+ } >+ } else { >+ $(this).closest(".parent").find(".flag.parent").prop("checked", false); >+ } > } else { > var bit = $(this).data("bit"); > if( $(this).is(":checked") ){ >-- >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 14741
:
95702
|
95751
| 95791