Bugzilla – Attachment 95751 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.55 KB, created by
Maryse Simard
on 2019-11-22 22:00:23 UTC
(
hide
)
Description:
Bug 14741: Selecting all child permissions doesn't select the top level check box
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-11-22 22:00:23 UTC
Size:
2.55 KB
patch
obsolete
>From 3499ebb289057cb09f9c8fff21dbe1ded5d9b102 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> >--- > .../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 de955cc..d9eef9a 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.7.4
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