View | Details | Raw Unified | Return to bug 15565
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-3 / +4 lines)
Lines 146-151 Link Here
146
                        <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
146
                        <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
147
                            <input type="hidden" name="place_reserve" value="1"/>
147
                            <input type="hidden" name="place_reserve" value="1"/>
148
                            <!-- These values are set dynamically by js -->
148
                            <!-- These values are set dynamically by js -->
149
                            <input type="hidden" name="biblionumbers" id="biblionumbers"/>
149
                            <div id="bigloop">
150
                            <div id="bigloop">
150
151
151
                                [% FOREACH bibitemloo IN bibitemloop %]
152
                                [% FOREACH bibitemloo IN bibitemloop %]
Lines 614-620 Link Here
614
                    total += parseInt($("input[name='checkitem_'"+biblioNum+"]:checked").length);
615
                    total += parseInt($("input[name='checkitem_'"+biblioNum+"]:checked").length);
615
                    total -= 2;
616
                    total -= 2;
616
                } else {
617
                } else {
617
                    total += parseInt($("select[name='holds_to_place_count_"+biblioNum+"']").val());
618
                    total += parseInt($("input[name='holds_to_place_count_"+biblioNum+"']").val());
618
                }
619
                }
619
            });
620
            });
620
            return total;
621
            return total;
Lines 669-675 Link Here
669
            var badBib = null;
670
            var badBib = null;
670
            $("input[name='biblionumbers']:checked").each(function() {
671
            $("input[name='biblionumbers']:checked").each(function() {
671
                var biblioNum = $(this).val();
672
                var biblioNum = $(this).val();
672
673
                biblionumbers += biblioNum + "/";
673
                // If required hold note is empty, make it visible
674
                // If required hold note is empty, make it visible
674
                if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
675
                if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
675
                    if( !$("#hold-options-"+biblioNum).is(':visible')) {
676
                    if( !$("#hold-options-"+biblioNum).is(':visible')) {
Lines 693-699 Link Here
693
            if (badBib) { // alert has been raised already
694
            if (badBib) { // alert has been raised already
694
                return false;
695
                return false;
695
            }
696
            }
696
697
            $("#biblionumbers").val(biblionumbers);
697
            return true;
698
            return true;
698
        });
699
        });
699
700
(-)a/opac/opac-reserve.pl (-4 / +13 lines)
Lines 119-125 my @biblionumbers = ref($query->param('biblionumbers')) eq 'Array' Link Here
119
unless (@biblionumbers) {
119
unless (@biblionumbers) {
120
    push(@biblionumbers, $query->multi_param('biblionumber'));
120
    push(@biblionumbers, $query->multi_param('biblionumber'));
121
}
121
}
122
122
my $multiBibHolds;
123
if (scalar(@biblionumbers) > 1) {
124
    $multiBibHolds = 1;
125
}
123
# Pass the numbers to the page so they can be fed back
126
# Pass the numbers to the page so they can be fed back
124
# when the hold is confirmed. TODO: Not necessary?
127
# when the hold is confirmed. TODO: Not necessary?
125
$template->param( biblionumbers => @biblionumbers );
128
$template->param( biblionumbers => @biblionumbers );
Lines 190-200 if ( $query->param('place_reserve') ) { Link Here
190
    }
193
    }
191
194
192
    my $failed_holds = 0;
195
    my $failed_holds = 0;
196
193
    foreach my $biblioNum (@biblionumbers) {
197
    foreach my $biblioNum (@biblionumbers) {
194
        my $itemNum = $query->param("checkitem_$biblioNum");
198
        my $itemNum = $query->param("checkitem_$biblioNum");
195
        my @itemnumbers = $query->param("checkitem_$biblioNum");
199
        my @itemnumbers = $query->param("checkitem_$biblioNum");
196
        my $branch = $query->param("branch");
200
        my $branch = $query->param("branch");
197
        my $reqtype = $query->param("reqtype_$biblioNum");
201
        my $reqtype = $query->param("reqtype_$biblioNum");
202
198
        if (!$reqtype) {
203
        if (!$reqtype) {
199
            #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.
204
            #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.
200
            # Determine what the forced_hold_level is.
205
            # Determine what the forced_hold_level is.
Lines 283-290 if ( $query->param('place_reserve') ) { Link Here
283
                    ++$reserve_cnt;
288
                    ++$reserve_cnt;
284
                }
289
                }
285
            }
290
            }
286
            print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds");
291
287
            exit;
292
            # $multiBibHolds indicates if holds on multiple biblio records has been placed
293
            # If not set then can exit and re-direct out of loop otherwise loop through other biblionumbers in @biblionumbers
294
            if (!$multiBibHolds) {
295
                print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds");
296
                exit;
297
            }
288
        }
298
        }
289
        $canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK';
299
        $canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK';
290
        unless ( $can_place_hold_if_available_at_pickup ) {
300
        unless ( $can_place_hold_if_available_at_pickup ) {
291
- 

Return to bug 15565