From 31c58cb54a157f953b5a9926a172cb89d2ebb821 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 15 Jun 2018 13:10:14 +0000 Subject: [PATCH] Bug 19288: Only display holds if next in queue or waiting To test: 1 - Place a title level hold on a biblio for a patron 2 - View the details, the item(s) has no info about holds 3 - Place an item level hold for an item on the same biblio for another patron 4 - View the details page, note the item indicates it is held for the second patron 5 - Apply patch 6 - Refresh details, the hold is not indicated 7 - Set the item specific hold to be priority #1 8 - Refresh details, the hold should now be indicated 9 - Confirm the hold 10 - Refresh details, the hold should show as waiting --- catalogue/detail.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 86a0698..7c6bf47 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -260,7 +260,8 @@ foreach my $item (@items) { # checking for holds my $item_object = Koha::Items->find( $item->{itemnumber} ); my $holds = $item_object->current_holds; - if ( my $first_hold = $holds->next ) { + my $first_hold = $holds->next; + if ( $first_hold && $first_hold->priority <= 1 ) { #we should only display if this hold is up next in the queue my $patron = Koha::Patrons->find( $first_hold->borrowernumber ); $item->{backgroundcolor} = 'reserved'; $item->{reservedate} = $first_hold->reservedate; -- 2.1.4