From 9071cbc2523cdbe1fcc0da4a67ac3619856d5cf5 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 --- .../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 5ea6f13eb2..8f71a09028 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -90,11 +90,13 @@ [% END %]
- +
@@ -112,22 +114,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 31990f1988..07ebc0d307 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