From e2fa6d97ef45efb902086aa3a3d232137c054afa Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 16 Apr 2019 17:21:01 +0000 Subject: [PATCH] Bug 19241: Waiting items show as available in the cart The cart uses the same item-status.inc that the details page uses, however, we don't set the waiting or reserved flags. This patch adds those flags to the script To test: 1 - Find an item on the opac 2 - Place a hold on the item 3 - Check in the item to confirm the hold 4 - Note the details page on OPAC shows 'On hold' 5 - Add the item to a basket 6 - Note the basket shows 'Available' 7 - Apply patch 8 - Check the cart, should show as 'On hold' Signed-off-by: Hayley Mapley Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- opac/opac-basket.pl | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index d66fd01..c2d57f2 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -101,6 +101,9 @@ foreach my $biblionumber ( @bibs ) { my @items; foreach my $item (@all_items) { if ( none { $item->{itemnumber} ne $_ } @hidden_items ) { + my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber}); + if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; } + if( $reserve_status eq "Reserved"){ $item->{'onhold'} = 1; } push @items, $item; } } -- 1.7.2.5