Bugzilla – Attachment 74621 Details for
Bug 20100
A non-superlibrarian should not be able to add superlibrarian privileges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20100: (Alternate) Use template logic instead of js to disable superlib box
Bug-20100-Alternate-Use-template-logic-instead-of-.patch (text/plain), 4.07 KB, created by
Nick Clemens
on 2018-04-20 11:54:49 UTC
(
hide
)
Description:
Bug 20100: (Alternate) Use template logic instead of js to disable superlib box
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2018-04-20 11:54:49 UTC
Size:
4.07 KB
patch
obsolete
>From e5ea941bc6d2cb8a98f624e388ce522f059407b4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 20 Apr 2018 11:52:17 +0000 >Subject: [PATCH] Bug 20100: (Alternate) Use template logic instead of js to > disable superlib box > >--- > .../prog/en/modules/members/member-flags.tt | 27 ++++++++++++---------- > 1 file changed, 15 insertions(+), 12 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 f5631f2..8cb5135 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 >@@ -36,9 +36,18 @@ > <li> > [% END %] > [% IF ( loo.checked ) %] >- <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" /> >+ [% IF disable_superlibrarian_privs && loo.bit == 0 %] >+ <input type="checkbox" disabled="disabled" class="flag parent superlib" id="flag-[% loo.bit %]_disabled" name="flag" value="[% loo.flag %]" checked="checked" /> >+ <input type="hidden" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" > >+ [% ELSE %] >+ <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" /> >+ [% END %] > [% ELSE %] >- <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" /> >+ [% IF disable_superlibrarian_privs && loo.bit == 0 %] >+ <input type="checkbox" disabled="disabled" class="flag parent" id="flag-[% loo.bit %]_disabled" name="flag" value="[% loo.flag %]" /> >+ [% ELSE %] >+ <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" /> >+ [% END %] > [% END %] > <label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label> > <span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span> >@@ -85,13 +94,13 @@ > $("#permissionstree").treeview({animated: "fast", collapsed: true}); > > // Enforce Superlibrarian Privilege Mutual Exclusivity >- if($('input[id="flag-0"]:checked').length){ >+ if( $('input[id="flag-0"]:checked').length || $(".superlib:checked").length ){ > if ($('input[name="flag"]:checked').length > 1){ > 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"){ >+ if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ > $(this).prop('disabled', true); > $(this).prop('checked', false); > } >@@ -99,9 +108,9 @@ > } > > $('input#flag-0').click(function() { >- if($('input[id="flag-0"]:checked').length){ >+ if( $('input[id="flag-0"]:checked').length || $(".superlib:checked").length ){ > $('input[name="flag"]').each(function() { >- if($(this).attr('id') != "flag-0"){ >+ if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){ > $(this).prop('disabled', true); > $(this).prop('checked', false); > } >@@ -122,12 +131,6 @@ > } > }); > >- [% IF disable_superlibrarian_privs %] >- $("input#flag-0").attr("disabled", true); >- $("form").submit(function(e) { >- $("input#flag-0").removeAttr("disabled"); >- }); >- [% END %] > }); > > // manage checking/unchecking parent permissions >-- >2.1.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 20100
:
71091
|
71092
|
71093
|
71918
|
72260
|
72261
|
72262
|
72747
|
72749
|
72750
|
74618
|
74619
|
74620
|
74621
|
74721
|
74840
|
74841
|
74844
|
74846