Bug 11097 - Hide duplicate patron button if logged in user lacks CAN_user_borrowers...
authorOwen Leonard <oleonard@myacpl.org>
Mon, 21 Oct 2013 21:54:41 +0000 (14:54 -0700)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 22 Oct 2013 12:48:39 +0000 (12:48 +0000)
The "duplicate" button on the circ/patron toolbar should not appear if
the logged in user lacks permission to edit patron records. This patch
wraps the button in the required logic.

To test, open a patron record in circulation or patrons and view as a
staff client user who both has and doesn't have CAN_user_borrowers
permission. The button should be shown and not shown accordingly.

Signed-off-by: Ed Veal <ed.veal@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc

index 787b852..258ccc6 100644 (file)
@@ -115,9 +115,9 @@ function searchToHold(){
         [% IF ( CAN_user_borrowers ) %]
             <a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="icon-lock"></i> Change password</a>
         [% END %]
+        <a id="duplicate" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% borrowernumber %]&amp;category_type=[% category_type %]"><i class="icon-copy"></i>Duplicate</a>
     [% END %]
 
-    <a id="duplicate" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% borrowernumber %]&amp;category_type=[% category_type %]"><i class="icon-copy"></i>Duplicate</a>
     <div class="btn-group">
         <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-print"></i> Print <span class="caret"></span></button>
             <ul class="dropdown-menu">