Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
Nick Clemens 1fc56e0e47
Bug 31421: Add a limited option to template plugin
This adds a specific 'limited' routine to the Categories plugin, and uses
it for the new patron dropdowns

To test:
1 - Limit a patron category to some branches
2 - Sign in not at one of those
3 - Confirm the new patron dropdowns don't include the category

Bug 31421: (follow-up) Add POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-27 09:42:57 -03:00

27 lines
1.5 KiB
HTML

[% INCLUDE 'blocking_errors.inc' %]
[% USE Categories %]
[% USE Koha %]
[% SET categories = Categories.limited %]
[% UNLESS ( no_add ) %]
<div id="toolbar" class="btn-toolbar">
<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&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&amp;categorycode=[% category.categorycode | uri %]&amp;quickadd=true">[% category.description | html %]</a></li>[% END %]
</ul>
</div>
[% 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 fa-edit"></i> Patron lists</a>
[% END %]
</div>
[% END %]