From 4180999aa58ab2530b377ba11567aff6832c766b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Dec 2017 15:59:24 -0300 Subject: [PATCH] Bug 18474: Restore multiple holds when patron is searched for We lost the ability to place multiple holds when we are searching for patrons. The multi_holds parameter is lost and not handled correctly in the template. Test plan: - Make sure you can place multiple holds for a patron you will search for - Same for simple hold TODO the multiple holds view should not be displayed if only 1 record has been selected from the search result. Signed-off-by: claude brayer Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart (cherry picked from commit dc008b90cd50b80c78520de6379c61e534efce75) Signed-off-by: Fridolin Somers --- .../prog/en/includes/circ-patron-search-results.inc | 13 ++++++++++--- .../prog/en/modules/reserve/request.tt | 5 +++++ reserve/request.pl | 11 ++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc index 29e72a2df9..b72bb5814d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc @@ -25,12 +25,19 @@ [% FOREACH borrower IN borrowers %] - [% IF ( destination == "circ" ) %] + [% IF destination == "circ" %] [% borrower.surname %], [% borrower.firstname %] + [% ELSIF destination == "holds" %] + [% IF multi_hold %] + [% SET data_url = "/cgi-bin/koha/reserve/request.pl?borrowernumber=" _ borrower.borrowernumber _ "&multi_hold=1&biblionumbers=" _ biblionumbers %] + [% ELSE %] + [% SET data_url = "/cgi-bin/koha/reserve/request.pl?borrowernumber=" _ borrower.borrowernumber _ "&biblionumber=" _ biblionumber %] + [% END %] + + [% borrower.surname %], [% borrower.firstname %] [% ELSE %] - - [% borrower.surname %], [% borrower.firstname %] + [%# This does not exist %] [% END %] [% borrower.cardnumber %] [% borrower.dateofbirth | $KohaDates %] 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 02c50b9c2d..f12e1de9e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -256,7 +256,12 @@ function checkMultiHold() {
Enter patron card number or partial name:
+ [% IF multi_hold %] + + + [% ELSE %] + [% END %] [% ELSE %] [% INCLUDE 'circ-patron-search-results.inc' destination = "holds" %] diff --git a/reserve/request.pl b/reserve/request.pl index e6cf6bfa6a..bf2a8a6097 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -61,8 +61,6 @@ my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( } ); -my $multihold = $input->param('multi_hold'); -$template->param(multi_hold => $multihold); my $showallitems = $input->param('showallitems'); my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; @@ -122,13 +120,16 @@ if ($findborrower) { } my @biblionumbers = (); +my $biblionumber = $input->param('biblionumber'); my $biblionumbers = $input->param('biblionumbers'); -if ($multihold) { +if ( $biblionumbers ) { @biblionumbers = split '/', $biblionumbers; } else { push @biblionumbers, $input->multi_param('biblionumber'); } +# 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')); # If we have the borrowernumber because we've performed an action, then we # don't want to try to place another reserve. @@ -632,10 +633,6 @@ $template->param( biblionumbers => $biblionumbers ); $template->param( exceeded_maxreserves => $exceeded_maxreserves ); $template->param( exceeded_holds_per_record => $exceeded_holds_per_record ); -if ($multihold) { - $template->param( multi_hold => 1 ); -} - if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { $template->param( reserve_in_future => 1 ); } -- 2.39.5