Bug 22284: Filter item's pickup locations in holds_table.inc
authorAgustin Moyano <agustinmoyano@theke.io>
Tue, 30 Apr 2019 11:05:17 +0000 (08:05 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 3 Jan 2020 12:58:05 +0000 (12:58 +0000)
This patch filters pickup locations per item in holds_table.inc

To test:
1) Go to Circulation and fines rules and change max holds allowed to > 0, and change 'Hold pickup library match' to homebranch
2) Search for a patron
3) Click on "Search to hold"
4) Search for any bilio
5) Place hold on a specific item
CHECK => Item's pickup location is a select with all libraries
6) Apply this patch
7) Repeat steps 2 to 5
SUCCESS => Item's pickup location is filtered by allowed pickup locations
8) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc

index a189c01..6e66ffe 100644 (file)
                         [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" />
                     [% ELSE %]
                         <select name="pickup">
-                            [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode, search_params => { "-or" => { pickup_location => 1, branchcode => hold.branchcode } } ) %]
+                            [% PROCESS options_for_libraries libraries => Branches.pickup_locations( { search_params => { item => hold.itemnumber, patron => hold.patron }, selected => hold.branchcode }) %]
                         </select>
                     [% END %]
                 [% END %]