Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl
authorLari Taskula <lari.taskula@jns.fi>
Tue, 7 Feb 2017 17:42:22 +0000 (19:42 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 6 Sep 2018 17:27:06 +0000 (17:27 +0000)
This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt

index ca7a4b3..d1bf7ee 100644 (file)
                                                                 <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
                                                                 [% UNLESS ( bibitemloo.holdable ) %]
                                                                     <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
-                                                                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
+                                                                        [% PROCESS options_for_libraries libraries => Branches.all({ search_params => { pickup_location => 1 }, selected => branch }) %]
                                                                     </select>
                                                                 [% ELSE %]
                                                                     [% SET at_least_one_library_not_available_for_pickup = 0 %]
                                                                     <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]">
-                                                                        [% FOREACH library IN Branches.all( selected => branch) %]
+                                                                        [% FOREACH library IN Branches.all({ search_params => { pickup_location => 1 }, selected => branch }) %]
                                                                             [% SET pickup_available_at = bibitemloo.not_available_at.grep(library.branchcode).size ? 0 : 1 %]
                                                                             [% IF library.selected AND pickup_available_at %]
                                                                                 <option value="[% library.branchcode | html %]" selected="selected" >[% library.branchname | html %]</option>