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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-1 / +5 lines)
Lines 151-156 Link Here
151
                        <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
151
                        <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
152
                            <input type="hidden" name="place_reserve" value="1"/>
152
                            <input type="hidden" name="place_reserve" value="1"/>
153
                            <!-- These values are set dynamically by js -->
153
                            <!-- These values are set dynamically by js -->
154
                            <input type="hidden" name="biblionumbers" id="biblionumbers">
154
                            <div id="bigloop">
155
                            <div id="bigloop">
155
156
156
                                [% FOREACH bibitemloo IN bibitemloop %]
157
                                [% FOREACH bibitemloo IN bibitemloop %]
Lines 616-622 Link Here
616
                    total += parseInt($("input[name='checkitem_'"+biblioNum+"]:checked").length);
617
                    total += parseInt($("input[name='checkitem_'"+biblioNum+"]:checked").length);
617
                    total -= 2;
618
                    total -= 2;
618
                } else {
619
                } else {
619
                    total += parseInt($("select[name='holds_to_place_count_"+biblioNum+"']").val());
620
                    total += parseInt($("input[name='holds_to_place_count_"+biblioNum+"']").val());
620
                }
621
                }
621
            });
622
            });
622
            return total;
623
            return total;
Lines 657-662 Link Here
657
658
658
        // When 'Place Hold' button is clicked
659
        // When 'Place Hold' button is clicked
659
        $(".placehold").click(function(){
660
        $(".placehold").click(function(){
661
            var biblionumbers = "";
660
            if (total_requested() + [% reserves_count | html %] > [% maxreserves | html %]) {
662
            if (total_requested() + [% reserves_count | html %] > [% maxreserves | html %]) {
661
                alert(MSG_MAX_HOLDS_EXCEEDED);
663
                alert(MSG_MAX_HOLDS_EXCEEDED);
662
                return false;
664
                return false;
Lines 671-676 Link Here
671
            var badBib = null;
673
            var badBib = null;
672
            $("input[name='biblionumbers']:checked").each(function() {
674
            $("input[name='biblionumbers']:checked").each(function() {
673
                var biblioNum = $(this).val();
675
                var biblioNum = $(this).val();
676
                biblionumbers += biblioNum + "/";
674
677
675
                // If required hold note is empty, make it visible
678
                // If required hold note is empty, make it visible
676
                if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
679
                if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
Lines 695-700 Link Here
695
            if (badBib) { // alert has been raised already
698
            if (badBib) { // alert has been raised already
696
                return false;
699
                return false;
697
            }
700
            }
701
            $("#biblionumbers").val(biblionumbers);
698
702
699
            return true;
703
            return true;
700
        });
704
        });
(-)a/opac/opac-reserve.pl (-4 / +13 lines)
Lines 111-117 my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_l Link Here
111
111
112
# Coming from opac-search biblionumbers param is a string, coming from
112
# Coming from opac-search biblionumbers param is a string, coming from
113
# opac-reserve, it's an array.
113
# opac-reserve, it's an array.
114
my @biblionumbers = ref($query->param('biblionumbers')) eq 'Array'
114
my @biblionumbers = ref($query->multi_param('biblionumbers')) eq 'Array'
115
    ? $query->param('biblionumbers')
115
    ? $query->param('biblionumbers')
116
    : split(/\//, $query->param('biblionumbers'));
116
    : split(/\//, $query->param('biblionumbers'));
117
117
Lines 119-124 unless (@biblionumbers) { Link Here
119
    push(@biblionumbers, $query->multi_param('biblionumber'));
119
    push(@biblionumbers, $query->multi_param('biblionumber'));
120
}
120
}
121
121
122
my $multiBibHolds;
123
if ( scalar( @biblionumbers ) > 1 ){
124
    $multiBibHolds = 1;
125
}
126
122
# Pass the numbers to the page so they can be fed back
127
# Pass the numbers to the page so they can be fed back
123
# when the hold is confirmed. TODO: Not necessary?
128
# when the hold is confirmed. TODO: Not necessary?
124
$template->param( biblionumbers => @biblionumbers );
129
$template->param( biblionumbers => @biblionumbers );
Lines 298-305 if ( $query->param('place_reserve') ) { Link Here
298
                    ++$reserve_cnt;
303
                    ++$reserve_cnt;
299
                }
304
                }
300
            }
305
            }
301
            print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds");
306
302
            exit;
307
            # $multiBibHolds indicates if holds on multiple biblio records has been placed
308
            # If not set then can exit and re-direct out of loop otherwise loop through other biblionumbers in @biblionumbers
309
            if (!$multiBibHolds) {
310
                print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds");
311
                exit;
312
            }
303
        }
313
        }
304
        $canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK';
314
        $canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK';
305
315
306
- 

Return to bug 15565