From e30247bb614d1f20b56aae9f6ec92e4c56203b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Thu, 3 Dec 2015 22:53:24 +0100 Subject: [PATCH] Bug 15324: Checkout page: Hide title "Waiting holds:" for patrons without waiting holds To reproduce: - 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 - At the right, you see a stray title "Waiting holds:" To test: - Apply patch - Repeat steps above - Verify that the title "Waiting holds: does no longer display for patrons without waiting holds. --- circ/circulation.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index f16475e..2f51625 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -457,9 +457,11 @@ if ($borrowernumber) { # show all reserves of this borrower, and the position of the reservation .... if ($borrowernumber) { my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); + my $waitingHolds = $holds->waiting(); + $waitingHolds = undef if (! $waitingHolds->count() ); $template->param( holds_count => $holds->count(), - WaitingHolds => scalar $holds->waiting(), + WaitingHolds => $waitingHolds, ); $template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' ); -- 1.7.10.4