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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (+16 lines)
Lines 59-64 Link Here
59
                            [% IF HOLD.item_level_hold %]
59
                            [% IF HOLD.item_level_hold %]
60
                                <p class="hint">Item on hold: [% HOLD.item.barcode | html %]</p>
60
                                <p class="hint">Item on hold: [% HOLD.item.barcode | html %]</p>
61
                            [% END %]
61
                            [% END %]
62
                            [% IF HOLD.hold_group_id %]
63
                                <div class="group_hold">
64
                                    <span class="hint">(part of a hold group)</span>
65
                                    <div class="group_hold_list" style="display:none">
66
                                    [% group_holds = HOLD.hold_group.holds %]
67
                                    [% IF ( group_holds.count ) %]
68
                                        <span class="hint">Containing the following:</span>
69
                                        <ul>
70
                                        [% FOREACH hg_member IN group_holds %]
71
                                            <li>[% INCLUDE 'biblio-title.inc' biblio=hg_member.biblio link=>1 %]</li>
72
                                        [% END %]
73
                                        </ul>
74
                                    [% END %]
75
                                    </div>
76
                                </div>
77
                            [% END %]
62
                        </td>
78
                        </td>
63
                        <td class="reservedate" data-order="[% HOLD.reservedate | html %]">
79
                        <td class="reservedate" data-order="[% HOLD.reservedate | html %]">
64
                            <span class="tdlabel">Hold date:</span>
80
                            <span class="tdlabel">Hold date:</span>
(-)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/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +2 lines)
Lines 242-248 Link Here
242
242
243
                            [% IF ( RESERVES.count ) %]
243
                            [% IF ( RESERVES.count ) %]
244
                                <li class="nav-item" role="presentation">
244
                                <li class="nav-item" role="presentation">
245
                                    <a class="nav-link" id="opac-user-holds-tab" data-toggle="tab" role="tab" aria-controls="opac-user-holds" aria-selected="false" href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a>
245
                                    <a class="nav-link" id="opac-user-holds-tab" data-toggle="tab" role="tab" aria-controls="opac-user-holds" aria-selected="false" href="#opac-user-holds">Holds ([% reserves_count | html %])</a>
246
                                </li>
246
                                </li>
247
                            [% END %]
247
                            [% END %]
248
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
248
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
Lines 1393-1396 Link Here
1393
            });
1393
            });
1394
        </script>
1394
        </script>
1395
    [% END %]
1395
    [% END %]
1396
    [% Asset.js("js/holds.js") | $raw %]
1396
[% END %]
1397
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-1 / +1 lines)
Lines 535-540 Link Here
535
    });
535
    });
536
536
537
    </script>
537
    </script>
538
538
    [% Asset.js("js/holds.js") | $raw %]
539
    [% IF ( Koha.Preference('SCOUserJS') ) %]<script>[% Koha.Preference('SCOUserJS') | $raw %]</script>[% END %]
539
    [% IF ( Koha.Preference('SCOUserJS') ) %]<script>[% Koha.Preference('SCOUserJS') | $raw %]</script>[% END %]
540
[% END %]
540
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/holds.js (+5 lines)
Line 0 Link Here
1
$(document).ready(function(){
2
    $("div.group_hold").click(function(){
3
        $(this).find("div.group_hold_list").toggle();
4
    });
5
});
(-)a/opac/opac-reserve.pl (+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 308-313 if ( $query->param('place_reserve') ) { Link Here
308
310
309
        # Here we actually do the reserveration. Stage 3.
311
        # Here we actually do the reserveration. Stage 3.
310
        if ($canreserve) {
312
        if ($canreserve) {
313
            if ($add_to_hold_group){
314
                #NOTE: We wait to create a hold group until we know that we can actually place a hold/reserve
315
                if ( ! $hold_group ){
316
                    $hold_group = Koha::HoldGroup->new->store;
317
                }
318
            }
311
            my $reserve_id = AddReserve(
319
            my $reserve_id = AddReserve(
312
                {
320
                {
313
                    branchcode       => $branch,
321
                    branchcode       => $branch,
Lines 321-326 if ( $query->param('place_reserve') ) { Link Here
321
                    itemnumber       => $itemNum,
329
                    itemnumber       => $itemNum,
322
                    found            => $found,
330
                    found            => $found,
323
                    itemtype         => $itemtype,
331
                    itemtype         => $itemtype,
332
                    hold_group_id    => $hold_group ? $hold_group->id : undef,
324
                }
333
                }
325
            );
334
            );
326
            $failed_holds++ unless $reserve_id;
335
            $failed_holds++ unless $reserve_id;
(-)a/opac/opac-user.pl (-1 / +1 lines)
Lines 330-335 my $reserves = $patron->holds->filter_out_has_cancellation_requests; Link Here
330
330
331
$template->param(
331
$template->param(
332
    RESERVES       => $reserves,
332
    RESERVES       => $reserves,
333
    reserves_count => $reserves->count_holds,
333
    showpriority   => $show_priority,
334
    showpriority   => $show_priority,
334
);
335
);
335
336
336
- 

Return to bug 15516