From b8a664fe7d3fe210b6f2d798b1ce5c0c0f86f6f0 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 --- .../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 1a397b07ef..486597371b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -113,11 +113,13 @@ [% END %]
- +
@@ -135,22 +137,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 49d8a2fa26..98ffd64d24 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -168,8 +168,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