From 9fa84762bcf3933418fd130799f119b2cdf0bc0c Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 5 May 2021 21:27:25 +0000 Subject: [PATCH] Bug 28229: Only show clubs on request.tt if clubs exist 1. Have no existing clubs 2. Apply patch 3. Go to request.tt and you will not see the club tab or any mention of clubs 4. Create at least 1 club 5. Go back to request.tt and now see the tab for clubs 6. Make sure you can place holds as an individual with and without clubs. 7. Make sure you can place holds for clubs. 8. rejoice and sign-off Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart (cherry picked from commit b8a664fe7d3fe210b6f2d798b1ce5c0c0f86f6f0) Signed-off-by: Fridolin Somers (cherry picked from commit 9071cbc2523cdbe1fcc0da4a67ac3619856d5cf5) Signed-off-by: Andrew Fuerste-Henry --- .../prog/en/modules/reserve/request.tt | 36 ++++++++++--------- reserve/request.pl | 6 +++- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index d393ca7b6f..a82fd53021 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -89,11 +89,13 @@ [% END %]
- +
@@ -111,22 +113,24 @@ [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %] [% END %]
-
- -
Enter club ID or partial name:
- - - [% IF multi_hold %] - - [% ELSE %] - - [% END %] + [% IF clubcount %] +
+ +
Enter club ID or partial name:
+ + + [% IF multi_hold %] + + [% ELSE %] + + [% END %] - - [% IF clubs %] - [% INCLUDE 'clubs-table.inc' destination = "holds" %] - [% END %] -
+ + [% IF clubs %] + [% INCLUDE 'clubs-table.inc' destination = "holds" %] + [% END %] +
+ [% END %]
[% ELSIF club %] diff --git a/reserve/request.pl b/reserve/request.pl index 931d31def4..e5bbfe5041 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -167,8 +167,12 @@ 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); +$template->param( + multi_hold => $multi_hold, + clubcount => $clubcount, +); # If we have the borrowernumber because we've performed an action, then we # don't want to try to place another reserve. -- 2.39.5