From a7e9a25e1eb8e56333cd98651e49cb6fa6f3e147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Tue, 23 Aug 2022 19:51:17 +0000 Subject: [PATCH] Bug 31313: (QA follow-up) Show status "On hold" correctly if there are waiting holds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch "Bug 31313: Fix availability - OPAC opac-detail" (70cb4e22c07) cause the OPAC detail page only show "Available" status even when there were waiting holds. The onhold item field is removed at the same go as it was confusing and unused since "Bug 2655: Fixes availabilty counts if items are on hold shelf. Patch (2/2)" (a37545eb1) Signed-off-by: Joonas Kylmälä Signed-off-by: Nick Clemens --- koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 2 +- opac/opac-basket.pl | 1 - opac/opac-detail.pl | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index febdda5a15..31bd552e54 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -49,7 +49,7 @@ to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %] [% END %] -[% IF NOT( item.isa('Koha::Item') ) AND item.waiting %] [%# Not sure where does come from this waiting flag %] +[% IF (item.isa('Koha::Item') AND item.holds.waiting.count) OR (NOT item.isa('Koha::Item') AND item.waiting) %] [% SET itemavailable = 0 %] On hold [% END %] diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index f2eefd0bca..552abdf1db 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -98,7 +98,6 @@ foreach my $biblionumber ( @bibs ) { foreach my $item (@$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; } } my $hasauthors = 0; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 1c5e7949ab..2f8a027078 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -729,11 +729,6 @@ else { $item_info->{checkout} = $item->checkout; $item_info->{object} = $item; - my $reserve_status = - C4::Reserves::GetReserveStatus( $item->itemnumber ); - if ( $reserve_status eq "Waiting" ) { $item_info->{'waiting'} = 1; } - if ( $reserve_status eq "Reserved" ) { $item_info->{'onhold'} = 1; } - my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers( $item->itemnumber ); if ( defined($transfertwhen) && $transfertwhen ne '' ) { -- 2.30.2