Tomas Cohen Arazi
5a57b3c163
This patch makes includes/patron-toolbar.inc (the one in charge of rendering the 'New patron' dropdown) make use of the Categories Template Toolkit plugin to create the list of categories. (1) To check the setup is sane: - Go to the Patrons page => SUCCESS: The 'New patron' dropdown is populated - Click on the [+] symbol on the Patron search on the top => SUCCESS: The Categories dropdown is populated (2) To test the patch: - On the checkout form, perform a patron search that (a) returns more than one result (b) returns zero results - Click the dropdown menu to create a new patron => FAIL: Dropdown is empty - Repeat for (a) or (b) - Apply the patch and reload => SUCCESS: The dropdown is correctly populated - Repeat (1) => SUCCESS: Nothing got broken - Verify the logs => SUCCESS: No new warnings - Sign off :-D - Get a cookie - Smile Regards Discussion: we might need a new bug to start cleaning stuff like this: @categories=C4::Category->all; if(scalar(@categories) < 1){ $no_add = 1; $template->param(no_categories => 1); } else { $template->param(categories=>\@categories); } but it belongs to a new bug me thinks. Well, suggestions are welcome, but this must be fixed on stable ASAP so hurry :-D Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
16 lines
767 B
HTML
16 lines
767 B
HTML
[% USE Categories %]
|
|
[% SET categories = Categories.all %]
|
|
|
|
[% UNLESS ( no_add ) %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
<div class="btn-group">
|
|
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-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&categorycode=[% category.categorycode %]">[% category.description %]</a></li>[% END %]
|
|
</ul>
|
|
</div>
|
|
[% IF CAN_user_tools_manage_patron_lists %]
|
|
<a class="btn btn-small" href="/cgi-bin/koha/patron_lists/lists.pl"><i class="icon-edit"></i>Patron lists</a>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|