Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
Brendan Lawlor 0b4bb48f2c
Bug 35980: Check for CAN_user_borrowers_edit_borrowers in patron-toolbar.inc
This patch removes the 'New patron' and 'Quick add new patron' buttons from the patron tool bar that's included on members-home.pl

To test:
1. Log in with a user with only 'catalogue', 'list_borrowers' and 'manage_patron_lists' permissions
2. From the main page click on Patrons
3. Notice there are 'New patron' and 'Quick add new patron' buttons in the members-home.pl page that lead to permissions errors
4. Apply patch, restart all, reload the page
5. Notice the buttons to add new patrons are gone, but the button to manage patron lists is still there

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-11 16:53:45 +02:00

28 lines
1.6 KiB
HTML

[% USE Categories %]
[% USE Koha %]
[% SET categories = Categories.limited %]
[% UNLESS ( no_add ) %]
<div id="toolbar" class="btn-toolbar">
[% IF CAN_user_borrowers_edit_borrowers %]
<div class="btn-group" id="new-patron-button">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New patron <span class="caret"></span></button>
<ul class="dropdown-menu">
[% FOREACH category IN categories %]<li><a href="/cgi-bin/koha/members/memberentry.pl?op=add_form&amp;categorycode=[% category.categorycode | uri %]">[% category.description | html %]</a></li>[% END %]
</ul>
</div>
[% IF Koha.Preference('PatronQuickAddFields') || Koha.Preference('BorrowerMandatoryField') %]
<div class="btn-group" id="quick-add-new-patron-button">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> Quick add new patron <span class="caret"></span></button>
<ul class="dropdown-menu">
[% FOREACH category IN categories %]<li><a href="/cgi-bin/koha/members/memberentry.pl?op=add_form&amp;categorycode=[% category.categorycode | uri %]&amp;quickadd=true">[% category.description | html %]</a></li>[% END %]
</ul>
</div>
[% END %]
[% END %]
[% IF CAN_user_tools_manage_patron_lists %]
<a class="btn btn-default" href="/cgi-bin/koha/patron_lists/lists.pl" id="patron-lists-button"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Patron lists</a>
[% END %]
</div>
[% END %]