Bug 15324: Do not display 'Waiting holds:" if no holds are waiting
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 Dec 2015 15:10:46 +0000 (15:10 +0000)
committerJulian Maurice <julian.maurice@biblibre.com>
Thu, 31 Dec 2015 09:06:06 +0000 (10:06 +0100)
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 <veron@veron.ch>

http://bugs.koha-community.org/show_bug.cgi?id=14324

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit cd46c5dc75f9381d4766b0bd70b3d089e53e539b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 3748d97..5747fbf 100755 (executable)
@@ -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' );
index 0e41342..7c5573a 100644 (file)
@@ -798,7 +798,7 @@ No patron matched <span class="ex">[% message %]</span>
                        </ul>
         </div>
 
-            [% IF ( WaitingHolds ) %]
+            [% IF WaitingHolds.count %]
                 <div id="holdswaiting" class="circmessage">
                     <h4>Holds waiting:</h4>
                     [% FOREACH w IN WaitingHolds %]