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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (+10 lines)
Lines 159-164 Link Here
159
159
160
            <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
160
            <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
161
                <legend class="sr-only">Hold requests</legend>
161
                <legend class="sr-only">Hold requests</legend>
162
                <div id="hold_group">
163
                    <fieldset class="rows">
164
                        <ul>
165
                            <li>
166
                                <label for="add_to_hold_group_control">Treat as hold group (next available item fulfills all holds):</label>
167
                                <input type="checkbox" id="add_to_hold_group_control" name="add_to_hold_group" value="add_to_hold_group"/>
168
                            </li>
169
                        </ul>
170
                    </fieldset>
171
                </div>
162
                <input type="hidden" name="place_reserve" value="1"/>
172
                <input type="hidden" name="place_reserve" value="1"/>
163
                <!-- These values are set dynamically by js -->
173
                <!-- These values are set dynamically by js -->
164
                    <input type="hidden" name="biblionumbers" id="biblionumbers"/>
174
                    <input type="hidden" name="biblionumbers" id="biblionumbers"/>
(-)a/opac/opac-reserve.pl (-1 / +9 lines)
Lines 191-196 foreach my $biblioNumber (@biblionumbers) { Link Here
191
#
191
#
192
#
192
#
193
if ( $query->param('place_reserve') ) {
193
if ( $query->param('place_reserve') ) {
194
    my $add_to_hold_group = $query->param('add_to_hold_group');
194
    my $reserve_cnt = 0;
195
    my $reserve_cnt = 0;
195
    if ($maxreserves) {
196
    if ($maxreserves) {
196
        $reserve_cnt = $patron->holds->count_holds;
197
        $reserve_cnt = $patron->holds->count_holds;
Lines 224-229 if ( $query->param('place_reserve') ) { Link Here
224
    }
225
    }
225
226
226
    my $failed_holds = 0;
227
    my $failed_holds = 0;
228
    my $hold_group;
227
    while (@selectedItems) {
229
    while (@selectedItems) {
228
        my $biblioNum = shift(@selectedItems);
230
        my $biblioNum = shift(@selectedItems);
229
        my $itemNum   = shift(@selectedItems);
231
        my $itemNum   = shift(@selectedItems);
Lines 307-312 if ( $query->param('place_reserve') ) { Link Here
307
309
308
        # Here we actually do the reserveration. Stage 3.
310
        # Here we actually do the reserveration. Stage 3.
309
        if ($canreserve) {
311
        if ($canreserve) {
312
            if ($add_to_hold_group){
313
                #NOTE: We wait to create a hold group until we know that we can actually place a hold/reserve
314
                if ( ! $hold_group ){
315
                    $hold_group = Koha::HoldGroup->new->store;
316
                }
317
            }
310
            my $reserve_id = AddReserve(
318
            my $reserve_id = AddReserve(
311
                {
319
                {
312
                    branchcode       => $branch,
320
                    branchcode       => $branch,
Lines 320-325 if ( $query->param('place_reserve') ) { Link Here
320
                    itemnumber       => $itemNum,
328
                    itemnumber       => $itemNum,
321
                    found            => $found,
329
                    found            => $found,
322
                    itemtype         => $itemtype,
330
                    itemtype         => $itemtype,
331
                    hold_group_id    => $hold_group ? $hold_group->id : undef,
323
                }
332
                }
324
            );
333
            );
325
            $failed_holds++ unless $reserve_id;
334
            $failed_holds++ unless $reserve_id;
326
- 

Return to bug 15516