Bug 7614: (follow-up) If patron's home library is not a pickup library, let them...
authorLari Taskula <lari.taskula@jns.fi>
Thu, 21 Dec 2017 14:55:58 +0000 (16:55 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 25 Jan 2019 14:47:00 +0000 (14:47 +0000)
This patch fixes an issue where patron is not allowed to place a hold in OPAC
while their home library is not a pickup library.

Instead, they should be presented with a list of other available pickup locations.

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
opac/opac-reserve.pl

index 214eb77..d55672f 100644 (file)
                             </li>
                         [% END %]
 
+                        [% IF ( no_pickup_locations ) %]
+                            <li id="no_pickup_locations">
+                                None of the libraries are available for pickup location.
+                            </li>
+                        [% END %]
                     [% ELSE %]
 
                         [% IF ( none_available && multi_hold ) %]
index df13dc1..e896975 100755 (executable)
@@ -385,6 +385,7 @@ my $itemdata_enumchron = 0;
 my $itemdata_ccode = 0;
 my $anyholdable = 0;
 my $itemLevelTypes = C4::Context->preference('item-level_itypes');
+my $pickup_locations = Koha::Libraries->search({ pickup_location => 1 });
 $template->param('item_level_itypes' => $itemLevelTypes);
 
 foreach my $biblioNum (@biblionumbers) {
@@ -614,6 +615,14 @@ foreach my $biblioNum (@biblionumbers) {
     $anyholdable = 1 if $biblioLoopIter{holdable};
 }
 
+unless ($pickup_locations->count) {
+    $numBibsAvailable = 0;
+    $anyholdable = 0;
+    $template->param(
+        message => 1,
+        no_pickup_locations => 1
+    );
+}
 
 if ( $numBibsAvailable == 0 || $anyholdable == 0) {
     $template->param( none_available => 1 );