@@ -, +, @@ opac-search.pl --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 7 ++++--- opac/opac-reserve.pl | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -146,6 +146,7 @@
+
[% FOREACH bibitemloo IN bibitemloop %] @@ -614,7 +615,7 @@ total += parseInt($("input[name='checkitem_'"+biblioNum+"]:checked").length); total -= 2; } else { - total += parseInt($("select[name='holds_to_place_count_"+biblioNum+"']").val()); + total += parseInt($("input[name='holds_to_place_count_"+biblioNum+"']").val()); } }); return total; @@ -669,7 +670,7 @@ var badBib = null; $("input[name='biblionumbers']:checked").each(function() { var biblioNum = $(this).val(); - + biblionumbers += biblioNum + "/"; // If required hold note is empty, make it visible if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) { if( !$("#hold-options-"+biblioNum).is(':visible')) { @@ -693,7 +694,7 @@ if (badBib) { // alert has been raised already return false; } - + $("#biblionumbers").val(biblionumbers); return true; }); --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -119,7 +119,10 @@ my @biblionumbers = ref($query->param('biblionumbers')) eq 'Array' unless (@biblionumbers) { push(@biblionumbers, $query->multi_param('biblionumber')); } - +my $multiBibHolds; +if (scalar(@biblionumbers) > 1) { + $multiBibHolds = 1; +} # Pass the numbers to the page so they can be fed back # when the hold is confirmed. TODO: Not necessary? $template->param( biblionumbers => @biblionumbers ); @@ -190,11 +193,13 @@ if ( $query->param('place_reserve') ) { } my $failed_holds = 0; + foreach my $biblioNum (@biblionumbers) { my $itemNum = $query->param("checkitem_$biblioNum"); my @itemnumbers = $query->param("checkitem_$biblioNum"); my $branch = $query->param("branch"); my $reqtype = $query->param("reqtype_$biblioNum"); + if (!$reqtype) { #If no $reqtype value has been passed from the form this means both reqany and reqspecific radio buttons are disabled because a hold has been placed on this biblio previously and so a forced_hold_level exists. # Determine what the forced_hold_level is. @@ -283,8 +288,13 @@ if ( $query->param('place_reserve') ) { ++$reserve_cnt; } } - print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds"); - exit; + + # $multiBibHolds indicates if holds on multiple biblio records has been placed + # If not set then can exit and re-direct out of loop otherwise loop through other biblionumbers in @biblionumbers + if (!$multiBibHolds) { + print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds"); + exit; + } } $canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK'; unless ( $can_place_hold_if_available_at_pickup ) { --