Bug 16547: Do not display "multi holds" view if only one is selected
[koha-equinox.git] / reserve / request.pl
index 23bd88e..61f853d 100755 (executable)
@@ -168,9 +168,8 @@ if ( $biblionumbers ) {
     push @biblionumbers, $input->multi_param('biblionumber');
 }
 
-my $multihold = scalar $input->param('multi_hold');
-# FIXME multi_hold should not be a variable but depends on the number of elements in @biblionumbers
-$template->param(multi_hold => scalar $input->param('multi_hold'));
+my $multi_hold = @biblionumbers > 1;
+$template->param(multi_hold => $multi_hold);
 
 # If we have the borrowernumber because we've performed an action, then we
 # don't want to try to place another reserve.
@@ -461,7 +460,7 @@ foreach my $biblionumber (@biblionumbers) {
                 $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
                 if ( $do_check && $wants_check ) {
                     $item->{checked_previously} = $do_check;
-                    if ( $multihold ) {
+                    if ( $multi_hold ) {
                         $biblioloopiter{checked_previously} = $do_check;
                     } else {
                         $template->param( checked_previously => $do_check );