Bug 33278: Correct JS for activating default tab on various pages
[koha-ffzg.git] / reserve / request.pl
index a15bc53..fce3a6e 100755 (executable)
@@ -70,7 +70,7 @@ my $pickup = $input->param('pickup');
 my $itemtypes = {
     map {
         $_->itemtype =>
-          { %{ $_->unblessed }, image_location => $_->image_location, notforloan => $_->notforloan }
+          { %{ $_->unblessed }, image_location => $_->image_location('intranet'), notforloan => $_->notforloan }
     } Koha::ItemTypes->search_with_localization->as_list
 };
 
@@ -299,12 +299,15 @@ if (   ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
         my %biblioloopiter = ();
 
         my $biblio = Koha::Biblios->find( $biblionumber );
+
         unless ($biblio) {
             $biblioloopiter{noitems} = 1;
             $template->param('nobiblio' => 1);
             last;
         }
 
+        $biblioloopiter{object} = $biblio;
+
         if ( $patron ) {
             { # CanBookBeReserved
                 my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber );
@@ -397,6 +400,7 @@ if (   ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
             for my $item_object ( @items ) {
                 my $do_check;
                 my $item = $item_object->unblessed;
+                $item->{object} = $item_object;
                 if ( $patron ) {
                     $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
                     if ( $do_check && $wants_check ) {
@@ -535,7 +539,7 @@ if (   ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
 
                             if ( @pickup_locations ) {
                                 $num_items_available++;
-                                $item->{available} = 1;
+                                $item->{override} = 1;
 
                                 my $default_pickup_location;
 
@@ -677,7 +681,7 @@ if (   ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
             $template->param( reserveloop => \@reserveloop );
         }
 
-        if ( $patron ) {
+        if ( $patron && $multi_hold ) {
             # Add the valid pickup locations
             my @pickup_locations = $biblio->pickup_locations({ patron => $patron })->as_list;
             $biblioloopiter{pickup_locations} = \@pickup_locations;
@@ -713,10 +717,6 @@ $template->param(
 # pass the userenv branch if no pickup location selected
 $template->param( pickup => $pickup || C4::Context->userenv->{branch} );
 
-if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) {
-    $template->param( reserve_in_future => 1 );
-}
-
 $template->param(borrowernumber => $borrowernumber_hold);
 
 # printout the page