From cd46c5dc75f9381d4766b0bd70b3d089e53e539b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Dec 2015 15:10:46 +0000 Subject: [PATCH] Bug 15324: Do not display 'Waiting holds:" if no holds are waiting MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test plan: - Make sure that you have a patron A with waiting holds and a patron B without waiting holds - Go to the checkout page for patron A (Home > Circulation > Checkouts > ...) - At the right, there is a title "Waiting holds:" and a list of holds waiting - Go to the checkout page for patron B => Without this patch "Waiting holds:" is displayed Sign-off on Jonathan's patch Signed-off-by: Marc Véron http://bugs.koha-community.org/show_bug.cgi?id=14324 Signed-off-by: Katrin Fischer Signed-off-by: Brendan A Gallagher --- circ/circulation.pl | 3 ++- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 3748d97081..5747fbf6fd 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -457,9 +457,10 @@ if ($borrowernumber) { # show all reserves of this borrower, and the position of the reservation .... if ($borrowernumber) { my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); + my $waiting_holds = $holds->waiting; $template->param( holds_count => $holds->count(), - WaitingHolds => scalar $holds->waiting(), + WaitingHolds => $waiting_holds, ); $template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 9abbefdba0..4da74d89aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -797,7 +797,7 @@ No patron matched [% message %] - [% IF ( WaitingHolds ) %] + [% IF WaitingHolds.count %]

Holds waiting:

[% FOREACH w IN WaitingHolds %] -- 2.39.5