Bugzilla – Attachment 15002 Details for
Bug 9439
Enforce superlibrarian mutual exclusivity of other permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions
Bug-9439---Enforce-superlibrarian-mutual-exclusivi.patch (text/plain), 3.13 KB, created by
Jonathan Druart
on 2013-02-01 13:10:42 UTC
(
hide
)
Description:
Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-02-01 13:10:42 UTC
Size:
3.13 KB
patch
obsolete
>From 71678f3c0c143d8c1cc791c333464c18cd01aa0f Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 22 Jan 2013 11:47:43 +1100 >Subject: [PATCH] Bug 9439 - Enforce superlibrarian mutual exclusivity of > other permissions > >Basically, when you check the checkbox for the superlibrarian permission >in the patron record, it will disable and uncheck all the other >permission checkboxes. When you uncheck the checkbox for the >superlibrarian permission, it will renable those boxes. There is also >some JS code there to ensure that the other boxes are disabled when >returning to the change permission screen (i.e. the patch is not just a >click handler). > >In the event that the checkboxes for superlibrarian and other >permissions are already checked, the user will be shown a pop-up window >explaining that the superlibrarian permission is mutually exclusive to >the others (since it already includes the others) and that the >permissions for that patron will then be reset to just include the >superlibrarian permission. > >Comment: Tested on master. Works as described. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../prog/en/modules/members/member-flags.tt | 31 ++++++++++++++++++++ > 1 file changed, 31 insertions(+) > >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 dfb22cf..46ae7df 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 >@@ -7,6 +7,37 @@ > <script type="text/javascript"> > $(document).ready(function() { > $("#permissionstree").treeview({animated: "fast", collapsed: true}); >+ >+ // Enforce Superlibrarian Privilege Mutual Exclusivity >+ if($('input[id="flag-0"]:checked').length){ >+ if ($('input[name="flag"]:checked').length > 1){ >+ alert('Inconsistency Detected!\n\nThe superlibrarian privilege is mutually exclusive of other privileges, as it includes them all.\n\nThis patron\'s privileges will now be reset to include only superlibrarian.'); >+ } >+ >+ $('input[name="flag"]').each(function() { >+ if($(this).attr('id') != "flag-0"){ >+ $(this).attr('disabled', 'disabled'); >+ $(this).removeAttr('checked', 'checked'); >+ } >+ }); >+ } >+ >+ $('input#flag-0').click(function() { >+ if($('input[id="flag-0"]:checked').length){ >+ $('input[name="flag"]').each(function() { >+ if($(this).attr('id') != "flag-0"){ >+ $(this).attr('disabled', 'disabled'); >+ $(this).removeAttr('checked', 'checked'); >+ } >+ }); >+ } >+ else { >+ $('input[name="flag"]').each(function() { >+ $(this).removeAttr('disabled', 'disabled'); >+ }); >+ } >+ }); >+ > }); > </script> > <!-- manage checking/unchecking parent permissions --> >-- >1.7.10.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 9439
:
14733
|
14805
| 15002