From 59a95642eba524a514c0755600dca720268b7b82 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 15 Jun 2018 13:35:32 +0000 Subject: [PATCH] Bug 19288: [Alternate] Only show existence of item level hold unless waiting To test: 1 - Please a biblio level hold for one patron, and an item level hold for another on same record 2 - Note that you patron name for item lvel hold 3 - Apply patch 4 - You should now see 'There is a hold on this item' with no patron detail 5 - Confirm hold, patron detail should be visible --- catalogue/detail.pl | 4 +++- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 86a0698..b3d18b4 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -260,7 +260,9 @@ 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; + $item->{holds_count} = $holds->count; + if ( $first_hold && $first_hold->priority == 0 ) { my $patron = Koha::Patrons->find( $first_hold->borrowernumber ); $item->{backgroundcolor} = 'reserved'; $item->{reservedate} = $first_hold->reservedate; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index ec6695c..608be38 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -447,8 +447,10 @@ Hold for: [% INCLUDE 'patron-title.inc' patron=item.ReservedFor hide_patron_infos_if_needed=1 %] [% END %] + [% ELSE %] + [% IF item.holds_count > 0 %]There is a hold on this item[% END %] [% END %] - [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate ) %] + [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate || item.holds_count > 0 ) %] Available [% END %] -- 2.1.4