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

(-)a/Koha/Holds.pm (-4 / +2 lines)
Lines 218-227 Return the number of holds, where a hold group is counted as one hold. Link Here
218
218
219
sub count_holds {
219
sub count_holds {
220
    my ( $self, $search_params ) = @_;
220
    my ( $self, $search_params ) = @_;
221
221
    $search_params = {} if !$search_params;
222
    $search_params = {
222
    $search_params->{hold_group_id} = undef;
223
        hold_group_id => undef,
224
    };
225
    my $holds_without_group_count = $self->search($search_params)->count();
223
    my $holds_without_group_count = $self->search($search_params)->count();
226
224
227
    $search_params = {
225
    $search_params = {
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 221-226 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
221
('DefaultToLoggedInLibraryNoticesSlips',  '0', NULL ,  'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
221
('DefaultToLoggedInLibraryNoticesSlips',  '0', NULL ,  'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
222
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
222
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
223
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'),
223
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'),
224
('DisplayAddHoldGroups','1','','Display the ability to create hold groups which are fulfilled by one item','YesNo'),
224
('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'),
225
('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'),
225
('displayFacetCount','0',NULL,NULL,'YesNo'),
226
('displayFacetCount','0',NULL,NULL,'YesNo'),
226
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
227
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 960-965 Circulation: Link Here
960
                  1: Enable
960
                  1: Enable
961
                  0: "Don't enable"
961
                  0: "Don't enable"
962
            - "the ability to place holds on different items at the same time in staff interface and OPAC."
962
            - "the ability to place holds on different items at the same time in staff interface and OPAC."
963
        -
964
            - pref: DisplayAddHoldGroups
965
              choices:
966
                  1: Enable
967
                  0: "Don't enable"
968
            - "the ability to create hold groups which are fulfilled by one item"
963
        -
969
        -
964
            - pref: TransferWhenCancelAllWaitingHolds
970
            - pref: TransferWhenCancelAllWaitingHolds
965
              choices:
971
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-8 / +8 lines)
Lines 611-624 Link Here
611
                            <input name="non_priority" id="non_priority" type="checkbox" />
611
                            <input name="non_priority" id="non_priority" type="checkbox" />
612
                            <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
612
                            <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
613
                        </li>
613
                        </li>
614
615
                        [% IF ( Koha.Preference('DisplayAddHoldGroups') && ( multi_hold ) ) %]
616
                            <li id="hold_group_list_item">
617
                                <label for="hold_group">Treat as hold group: </label>
618
                                <input name="hold_group" id="hold_group" type="checkbox" />
619
                                <span class="hint">Place a hold on the next available title from this group</span>
620
                            </li>
621
                        [% END %]
622
                    </ol>
614
                    </ol>
623
                </fieldset>
615
                </fieldset>
624
                <fieldset class="rows any_specific">
616
                <fieldset class="rows any_specific">
Lines 1089-1094 Link Here
1089
                            <label for="to">Hold expires on date:</label>
1081
                            <label for="to">Hold expires on date:</label>
1090
                            <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
1082
                            <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
1091
                        </li>
1083
                        </li>
1084
1085
                        [% IF ( Koha.Preference('DisplayAddHoldGroups') ) %]
1086
                            <li id="hold_group_list_item">
1087
                                <label for="hold_group">Treat as hold group: </label>
1088
                                <input name="hold_group" id="hold_group" type="checkbox" />
1089
                                <span class="hint">Place a hold on the next available title from this group</span>
1090
                            </li>
1091
                        [% END %]
1092
                    </ol>
1092
                    </ol>
1093
                    <table id="requesttitles">
1093
                    <table id="requesttitles">
1094
                        <tr>
1094
                        <tr>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (+16 lines)
Lines 64-69 Link Here
64
                    [% IF HOLD.item_level_hold %]
64
                    [% IF HOLD.item_level_hold %]
65
                        <p class="hint">Item on hold: [% HOLD.item.barcode | html %]</p>
65
                        <p class="hint">Item on hold: [% HOLD.item.barcode | html %]</p>
66
                    [% END %]
66
                    [% END %]
67
                    [% IF HOLD.hold_group_id %]
68
                        <div class="group_hold">
69
                            <span class="hint">(part of a hold group)</span>
70
                            <div class="group_hold_list" style="display:none">
71
                                [% group_holds = HOLD.hold_group.holds %]
72
                                [% IF ( group_holds.count ) %]
73
                                    <span class="hint">Containing the following:</span>
74
                                    <ul>
75
                                        [% FOREACH hg_member IN group_holds %]
76
                                            <li>[% INCLUDE 'biblio-title.inc' biblio=hg_member.biblio link=>1 %]</li>
77
                                        [% END %]
78
                                    </ul>
79
                                [% END %]
80
                            </div>
81
                        </div>
82
                    [% END %]
67
                </td>
83
                </td>
68
                <td class="reservedate" data-order="[% HOLD.reservedate | html %]"> [% HOLD.reservedate | $KohaDates %] </td>
84
                <td class="reservedate" data-order="[% HOLD.reservedate | html %]"> [% HOLD.reservedate | $KohaDates %] </td>
69
                <td class="expirationdate" data-order="[% !HOLD.found ? HOLD.expirationdate : '0000-00-00' | html %]">
85
                <td class="expirationdate" data-order="[% !HOLD.found ? HOLD.expirationdate : '0000-00-00' | html %]">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (+12 lines)
Lines 110-115 Link Here
110
                    [% INCLUDE 'csrf-token.inc' %]
110
                    [% INCLUDE 'csrf-token.inc' %]
111
                    <legend class="sr-only">Hold requests</legend>
111
                    <legend class="sr-only">Hold requests</legend>
112
                    <input type="hidden" name="op" value="cud-place_reserve" />
112
                    <input type="hidden" name="op" value="cud-place_reserve" />
113
                    [% IF ( Koha.Preference('DisplayAddHoldGroups') && ( multi_hold ) ) %]
114
                        <div id="hold_group">
115
                            <fieldset class="rows">
116
                                <ul>
117
                                    <li>
118
                                        <label for="add_to_hold_group_control">Treat as hold group (next available item fulfills all holds):</label>
119
                                        <input type="checkbox" id="add_to_hold_group_control" name="add_to_hold_group" value="add_to_hold_group" />
120
                                    </li>
121
                                </ul>
122
                            </fieldset>
123
                        </div>
124
                    [% END %]
113
                    <!-- These values are set dynamically by js -->
125
                    <!-- These values are set dynamically by js -->
114
                    <input type="hidden" name="biblionumbers" id="biblionumbers" />
126
                    <input type="hidden" name="biblionumbers" id="biblionumbers" />
115
                    <input type="hidden" name="selecteditems" id="selections" />
127
                    <input type="hidden" name="selecteditems" id="selections" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +2 lines)
Lines 272-278 Link Here
272
272
273
                            [% IF ( RESERVES.count ) %]
273
                            [% IF ( RESERVES.count ) %]
274
                                [% WRAPPER tab_item tabname= "opac-user-holds" %]
274
                                [% WRAPPER tab_item tabname= "opac-user-holds" %]
275
                                    <span>Holds ([% RESERVES.count | html %])</span>
275
                                    <span>Holds ([% reserves_count | html %])</span>
276
                                [% END %]
276
                                [% END %]
277
                            [% END %]
277
                            [% END %]
278
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
278
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
Lines 1443-1446 Link Here
1443
            });
1443
            });
1444
        </script>
1444
        </script>
1445
    [% END %]
1445
    [% END %]
1446
    [% Asset.js("js/holds.js") | $raw %]
1446
[% END %]
1447
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (+1 lines)
Lines 522-527 Link Here
522
                    });
522
                    });
523
            });
523
            });
524
        </script>
524
        </script>
525
        [% Asset.js("js/holds.js") | $raw %]
525
        [% IF ( Koha.Preference('SCOUserJS') ) %]
526
        [% IF ( Koha.Preference('SCOUserJS') ) %]
526
            <script>
527
            <script>
527
                [% Koha.Preference('SCOUserJS') | $raw %]
528
                [% Koha.Preference('SCOUserJS') | $raw %]
(-)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 (-1 / +11 lines)
Lines 160-166 $template->param( branch => $branch ); Link Here
160
#
160
#
161
#
161
#
162
if ( $op eq 'cud-place_reserve' ) {
162
if ( $op eq 'cud-place_reserve' ) {
163
    my $reserve_cnt = 0;
163
    my $add_to_hold_group = $query->param('add_to_hold_group');
164
    my $reserve_cnt       = 0;
164
    if ($maxreserves) {
165
    if ($maxreserves) {
165
        $reserve_cnt = $patron->holds->count_holds;
166
        $reserve_cnt = $patron->holds->count_holds;
166
    }
167
    }
Lines 194-199 if ( $op eq 'cud-place_reserve' ) { Link Here
194
    }
195
    }
195
196
196
    my @failed_holds;
197
    my @failed_holds;
198
    my $hold_group;
197
    while (@selectedItems) {
199
    while (@selectedItems) {
198
        my $biblioNum = shift(@selectedItems);
200
        my $biblioNum = shift(@selectedItems);
199
        my $itemNum   = shift(@selectedItems);
201
        my $itemNum   = shift(@selectedItems);
Lines 290-295 if ( $op eq 'cud-place_reserve' ) { Link Here
290
292
291
        # Here we actually do the reserveration. Stage 3.
293
        # Here we actually do the reserveration. Stage 3.
292
        if ($canreserve) {
294
        if ($canreserve) {
295
            if ($add_to_hold_group) {
296
297
                #NOTE: We wait to create a hold group until we know that we can actually place a hold/reserve
298
                if ( !$hold_group ) {
299
                    $hold_group = Koha::HoldGroup->new->store;
300
                }
301
            }
293
            my $reserve_id = AddReserve(
302
            my $reserve_id = AddReserve(
294
                {
303
                {
295
                    branchcode       => $branch,
304
                    branchcode       => $branch,
Lines 304-309 if ( $op eq 'cud-place_reserve' ) { Link Here
304
                    found            => undef,
313
                    found            => undef,
305
                    itemtype         => $itemtype,
314
                    itemtype         => $itemtype,
306
                    item_group_id    => $item_group_id,
315
                    item_group_id    => $item_group_id,
316
                    hold_group_id    => $hold_group ? $hold_group->id : undef,
307
                }
317
                }
308
            );
318
            );
309
            if ($reserve_id) {
319
            if ($reserve_id) {
(-)a/opac/opac-user.pl (-3 / +3 lines)
Lines 347-354 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
347
my $reserves = $patron->holds->filter_out_has_cancellation_requests;
347
my $reserves = $patron->holds->filter_out_has_cancellation_requests;
348
348
349
$template->param(
349
$template->param(
350
    RESERVES     => $reserves,
350
    RESERVES       => $reserves,
351
    showpriority => $show_priority,
351
    reserves_count => $reserves->count_holds,
352
    showpriority   => $show_priority,
352
);
353
);
353
354
354
if ( C4::Context->preference('UseRecalls') ) {
355
if ( C4::Context->preference('UseRecalls') ) {
355
- 

Return to bug 15516