Bug 28229: Count only if needed

We don't need to count the number of clubs if we selected a patron or
club already

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a197a09feb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3ebd948cf)
This commit is contained in:
Jonathan Druart 2021-05-10 12:08:21 +02:00 committed by Andrew Fuerste-Henry
parent fefd004d88
commit c7fa569399
1 changed files with 5 additions and 3 deletions

View File

@ -167,11 +167,9 @@ if ( $biblionumbers ) {
push @biblionumbers, $input->multi_param('biblionumber');
}
my $clubcount = Koha::Clubs->search->count;
my $multi_hold = @biblionumbers > 1;
$template->param(
multi_hold => $multi_hold,
clubcount => $clubcount,
multi_hold => $multi_hold,
);
# If we have the borrowernumber because we've performed an action, then we
@ -273,6 +271,10 @@ if ($club_hold && !$borrowernumber_hold && !$action) {
);
}
unless ( $club_hold or $borrowernumber_hold ) {
$template->param( clubcount => Koha::Clubs->search->count );
}
$template->param(
messageborrower => $messageborrower,
messageclub => $messageclub