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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/hold-group-modal.inc (+15 lines)
Line 0 Link Here
1
<div id="hold-group-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="hold-group-modal-label">
2
    <div class="modal-dialog" role="document">
3
        <div class="modal-content">
4
            <div class="modal-header">
5
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
6
                <h4 class="modal-title" id="hold-group-modal-label">Hold group</h4>
7
            </div>
8
            <div class="modal-body">
9
            </div>
10
            <div class="modal-footer">
11
                <button type="button" class="btn btn-default deny" data-dismiss="modal">Close</button>
12
            </div>
13
        </div><!-- /.modal-content -->
14
    </div><!-- /.modal-dialog -->
15
</div><!-- /.modal -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (+3 lines)
Lines 177-182 Link Here
177
                [% IF hold.non_priority %]
177
                [% IF hold.non_priority %]
178
                    <br><i>Non priority hold</i>
178
                    <br><i>Non priority hold</i>
179
                [% END %]
179
                [% END %]
180
                [% IF hold.hold_group_id %]
181
                    <div>(part of a <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% hold.hold_group_id %]" class="hold-group">hold group</a>)</div>
182
                [% END %]
180
            </td>
183
            </td>
181
184
182
            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
185
            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+3 lines)
Lines 1082-1087 Link Here
1082
    </div> <!-- /.modal-dialog -->
1082
    </div> <!-- /.modal-dialog -->
1083
</div> <!-- /#barcodeSubmittedModal -->
1083
</div> <!-- /#barcodeSubmittedModal -->
1084
1084
1085
[% INCLUDE 'hold-group-modal.inc' %]
1086
1085
[% MACRO jsinclude BLOCK %]
1087
[% MACRO jsinclude BLOCK %]
1086
    [% INCLUDE 'calendar.inc' %]
1088
    [% INCLUDE 'calendar.inc' %]
1087
    [% INCLUDE 'datatables.inc' %]
1089
    [% INCLUDE 'datatables.inc' %]
Lines 1115-1120 Link Here
1115
    [% Asset.js("js/checkouts.js") | $raw %]
1117
    [% Asset.js("js/checkouts.js") | $raw %]
1116
    [% Asset.js("js/holds.js") | $raw %]
1118
    [% Asset.js("js/holds.js") | $raw %]
1117
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1119
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1120
    [% Asset.js("js/hold-group.js") | $raw %]
1118
    <script>
1121
    <script>
1119
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1122
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1120
        columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1123
        columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (+6 lines)
Lines 90-95 Link Here
90
                [% ELSE %]
90
                [% ELSE %]
91
                    [% IF ( biblio.biblioitem.publicationyear ) %]<p>[% biblio.biblioitem.publicationyear | html %]</p>[% END %]
91
                    [% IF ( biblio.biblioitem.publicationyear ) %]<p>[% biblio.biblioitem.publicationyear | html %]</p>[% END %]
92
                [% END %]
92
                [% END %]
93
                [% IF ( hold.hold_group_id ) %]
94
                    <p>(part of a <a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% hold.hold_group_id | html %]">hold group</a>)</p>
95
                [% END %]
93
            </td>
96
            </td>
94
        [% ELSE %]
97
        [% ELSE %]
95
            <td>"</td>
98
            <td>"</td>
Lines 273-282 Link Here
273
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
276
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
274
     </div> <!-- /.row -->
277
     </div> <!-- /.row -->
275
278
279
     [% INCLUDE 'hold-group-modal.inc' %]
280
276
[% MACRO jsinclude BLOCK %]
281
[% MACRO jsinclude BLOCK %]
277
    [% INCLUDE 'calendar.inc' %]
282
    [% INCLUDE 'calendar.inc' %]
278
    [% INCLUDE 'datatables.inc' %]
283
    [% INCLUDE 'datatables.inc' %]
279
    [% INCLUDE 'columns_settings.inc' %]
284
    [% INCLUDE 'columns_settings.inc' %]
285
    [% Asset.js("js/hold-group.js") | $raw %]
280
    <script>
286
    <script>
281
        $(document).ready(function() {
287
        $(document).ready(function() {
282
          var columns_settings = [% TablesSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
288
          var columns_settings = [% TablesSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+3 lines)
Lines 907-912 Link Here
907
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
907
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
908
        </div> <!-- /.row -->
908
        </div> <!-- /.row -->
909
909
910
        [% INCLUDE 'hold-group-modal.inc' %]
911
910
[% MACRO jsinclude BLOCK %]
912
[% MACRO jsinclude BLOCK %]
911
    [% INCLUDE 'datatables.inc' %]
913
    [% INCLUDE 'datatables.inc' %]
912
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
914
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
Lines 942-947 Link Here
942
    [% INCLUDE 'str/members-menu.inc' %]
944
    [% INCLUDE 'str/members-menu.inc' %]
943
    [% Asset.js("js/members-menu.js") | $raw %]
945
    [% Asset.js("js/members-menu.js") | $raw %]
944
    [% Asset.js("js/messaging-preference-form.js") | $raw %]
946
    [% Asset.js("js/messaging-preference-form.js") | $raw %]
947
    [% Asset.js("js/hold-group.js") | $raw %]
945
    <script>
948
    <script>
946
949
947
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
950
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt (+30 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
  <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Holds group ([% hold_group.id | html %])</title>
3
  [% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="hold-group">
6
  <h1>Holds group ([% hold_group.id | html %])</h1>
7
  <div id="main">
8
    [% holds = hold_group.holds %]
9
    [% IF holds.count %]
10
      <table>
11
        <thead>
12
          <tr>
13
            <th>Title</th>
14
            <th>Priority</th>
15
            <th>Notes</th>
16
          </tr>
17
        </thead>
18
        <tbody>
19
          [% FOREACH hold IN holds %]
20
            [% biblio = hold.biblio %]
21
            <tr>
22
              <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></td>
23
              <td>[% hold.priority %]</td>
24
              <td>[% hold.reservenotes %]</td>
25
            </tr>
26
          [% END %]
27
        </tbody>
28
      <table>
29
    [% END %]
30
  [% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-4 / +13 lines)
Lines 456-462 Link Here
456
456
457
                            [% UNLESS ( multi_hold ) %]
457
                            [% UNLESS ( multi_hold ) %]
458
                                <li>
458
                                <li>
459
                                    <label for="requestany">Hold next available item </label>
459
                                    <label for="requestany">Hold next available item: </label>
460
                                    [% IF force_hold_level == 'item' %]
460
                                    [% IF force_hold_level == 'item' %]
461
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
461
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
462
                                    [% ELSIF force_hold_level == 'record' %]
462
                                    [% ELSIF force_hold_level == 'record' %]
Lines 471-477 Link Here
471
471
472
                                [% IF remaining_holds_for_record > 1 %]
472
                                [% IF remaining_holds_for_record > 1 %]
473
                                    <li>
473
                                    <li>
474
                                        <label for="holds_to_place_count">Holds to place (count)</label>
474
                                        <label for="holds_to_place_count">Holds to place (count): </label>
475
                                        <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" />
475
                                        <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" />
476
                                    </li>
476
                                    </li>
477
                                [% ELSE %]
477
                                [% ELSE %]
Lines 484-489 Link Here
484
                                <input name="non_priority" id="non_priority" type="checkbox" />
484
                                <input name="non_priority" id="non_priority" type="checkbox" />
485
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
485
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
486
                            </li>
486
                            </li>
487
488
                            <li id="hold_group_list_item">
489
                                <label for="hold_group">Treat as hold group: </label>
490
                                <input name="hold_group" id="hold_group" type="checkbox" />
491
                                <span class="hint">Place a hold on the next available title from this group</span>
492
                            </li>
487
                        </ol>
493
                        </ol>
488
494
489
                        [% UNLESS ( multi_hold ) %]
495
                        [% UNLESS ( multi_hold ) %]
Lines 557-565 Link Here
557
                                                                Hold must be record level
563
                                                                Hold must be record level
558
                                                            </span>
564
                                                            </span>
559
                                                        [% ELSIF ( itemloo.available ) %]
565
                                                        [% ELSIF ( itemloo.available ) %]
560
                                                            <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
566
                                                            <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber | html %]" />
561
                                                        [% ELSIF ( itemloo.override ) %]
567
                                                        [% ELSIF ( itemloo.override ) %]
562
                                                            <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
568
                                                            <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
563
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
569
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
564
                                                        [% ELSE %]
570
                                                        [% ELSE %]
565
                                                            <span class="error">
571
                                                            <span class="error">
Lines 983-988 Link Here
983
        </div>
989
        </div>
984
    </div>
990
    </div>
985
991
992
    [% INCLUDE 'hold-group-modal.inc' %]
993
986
[% MACRO jsinclude BLOCK %]
994
[% MACRO jsinclude BLOCK %]
987
    [% INCLUDE 'datatables.inc' %]
995
    [% INCLUDE 'datatables.inc' %]
988
    [% INCLUDE 'calendar.inc' %]
996
    [% INCLUDE 'calendar.inc' %]
Lines 990-995 Link Here
990
    [% Asset.js("lib/hc-sticky.js") | $raw %]
998
    [% Asset.js("lib/hc-sticky.js") | $raw %]
991
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
999
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
992
    [% INCLUDE 'select2.inc' %]
1000
    [% INCLUDE 'select2.inc' %]
1001
    [% Asset.js("js/hold-group.js") | $raw %]
993
    <script>
1002
    <script>
994
        var Sticky;
1003
        var Sticky;
995
        var biblionumber = "[% biblionumber | $raw %]";
1004
        var biblionumber = "[% biblionumber | $raw %]";
(-)a/koha-tmpl/intranet-tmpl/prog/js/hold-group.js (+8 lines)
Line 0 Link Here
1
$(document).ready(function() {
2
    $('body').on('click', 'a.hold-group', function() {
3
        var href = $(this).attr('href');
4
        $('#hold-group-modal .modal-body').load(href + " #main");
5
        $('#hold-group-modal').modal('show');
6
        return false;
7
    });
8
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (+6 lines)
Lines 50-55 $(document).ready(function() { Link Here
50
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
50
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
51
                            }
51
                            }
52
52
53
                            if ( oObj.hold_group_id ) {
54
                                title += '<br>';
55
                                var link = '<a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=' + oObj.hold_group_id + '">' + __("part of a hold group") +'</a>'
56
                                title += '<span>(' + link + ')</span>';
57
                            }
58
53
                            return title;
59
                            return title;
54
                        }
60
                        }
55
                    },
61
                    },
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 196-202 foreach my $biblioNumber (@biblionumbers) { Link Here
196
if ( $query->param('place_reserve') ) {
196
if ( $query->param('place_reserve') ) {
197
    my $reserve_cnt = 0;
197
    my $reserve_cnt = 0;
198
    if ($maxreserves) {
198
    if ($maxreserves) {
199
        $reserve_cnt = $patron->holds->count;
199
        $reserve_cnt = $patron->holds->count_grouped;
200
    }
200
    }
201
201
202
    # List is composed of alternating biblio/item/branch
202
    # List is composed of alternating biblio/item/branch
(-)a/reserve/hold-group.pl (+41 lines)
Line 0 Link Here
1
#!/usr/bin/env perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
use CGI qw( -utf8 );
20
21
use C4::Auth;
22
use C4::Output;
23
use Koha::HoldGroups;
24
25
my $cgi = new CGI;
26
my ($template, $loggedinuser, $cookie) = get_template_and_user({
27
    template_name   => "reserve/hold-group.tt",
28
    query           => $cgi,
29
    type            => "intranet",
30
    authnotrequired => 0,
31
    flagsrequired   => { circulate => 'circulate_remaining_permissions' },
32
});
33
34
my $reserve_group_id = $cgi->param('hold_group_id');
35
my $hold_group = Koha::HoldGroups->find($reserve_group_id);
36
37
$template->param(
38
    hold_group => $hold_group,
39
);
40
41
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/reserve/placerequest.pl (+9 lines)
Lines 34-39 use C4::Auth qw/checkauth/; Link Here
34
34
35
use Koha::Items;
35
use Koha::Items;
36
use Koha::Patrons;
36
use Koha::Patrons;
37
use Koha::HoldGroup;
37
38
38
my $input = CGI->new();
39
my $input = CGI->new();
39
40
Lines 53-58 my $checkitem = $input->param('checkitem'); Link Here
53
my $expirationdate = $input->param('expiration_date');
54
my $expirationdate = $input->param('expiration_date');
54
my $itemtype       = $input->param('itemtype') || undef;
55
my $itemtype       = $input->param('itemtype') || undef;
55
my $non_priority   = $input->param('non_priority');
56
my $non_priority   = $input->param('non_priority');
57
my $hold_group     = $input->param('hold_group') || undef;
56
58
57
my $borrower = Koha::Patrons->find( $borrowernumber );
59
my $borrower = Koha::Patrons->find( $borrowernumber );
58
$borrower = $borrower->unblessed if $borrower;
60
$borrower = $borrower->unblessed if $borrower;
Lines 76-81 my $found; Link Here
76
78
77
if ( $type eq 'str8' && $borrower ) {
79
if ( $type eq 'str8' && $borrower ) {
78
80
81
    if ( @biblionumbers > 1 && $hold_group ) {
82
        $hold_group = Koha::HoldGroup->new->store;
83
    }
84
79
    foreach my $biblionumber ( keys %bibinfos ) {
85
    foreach my $biblionumber ( keys %bibinfos ) {
80
        my $count = @bibitems;
86
        my $count = @bibitems;
81
        @bibitems = sort @bibitems;
87
        @bibitems = sort @bibitems;
Lines 116-121 if ( $type eq 'str8' && $borrower ) { Link Here
116
                        found            => $found,
122
                        found            => $found,
117
                        itemtype         => $itemtype,
123
                        itemtype         => $itemtype,
118
                        non_priority     => $non_priority,
124
                        non_priority     => $non_priority,
125
                        hold_group_id    => $hold_group ? $hold_group->id : undef,
119
                    }
126
                    }
120
                );
127
                );
121
128
Lines 138-143 if ( $type eq 'str8' && $borrower ) { Link Here
138
                        found            => $found,
145
                        found            => $found,
139
                        itemtype         => $itemtype,
146
                        itemtype         => $itemtype,
140
                        non_priority     => $non_priority,
147
                        non_priority     => $non_priority,
148
                        hold_group_id    => $hold_group ? $hold_group->id : undef,
141
                    }
149
                    }
142
                );
150
                );
143
            }
151
            }
Lines 159-164 if ( $type eq 'str8' && $borrower ) { Link Here
159
                            found            => $found,
167
                            found            => $found,
160
                            itemtype         => $itemtype,
168
                            itemtype         => $itemtype,
161
                            non_priority     => $non_priority,
169
                            non_priority     => $non_priority,
170
                            hold_group_id    => $hold_group ? $hold_group->id : undef,
162
                        }
171
                        }
163
                    );
172
                    );
164
                }
173
                }
(-)a/reserve/request.pl (+1 lines)
Lines 691-696 foreach my $biblionumber (@biblionumbers) { Link Here
691
        $reserve{branchcode}       = $res->branchcode();
691
        $reserve{branchcode}       = $res->branchcode();
692
        $reserve{non_priority}     = $res->non_priority();
692
        $reserve{non_priority}     = $res->non_priority();
693
        $reserve{object}           = $res;
693
        $reserve{object}           = $res;
694
        $reserve{hold_group_id}    = $res->hold_group_id;
694
695
695
        push( @reserveloop, \%reserve );
696
        push( @reserveloop, \%reserve );
696
    }
697
    }
(-)a/svc/holds (-1 / +1 lines)
Lines 114-119 while ( my $h = $holds_rs->next() ) { Link Here
114
        waiting_here   => $h->branch()->branchcode() eq $branch,
114
        waiting_here   => $h->branch()->branchcode() eq $branch,
115
        priority       => $h->priority(),
115
        priority       => $h->priority(),
116
        itemtype_limit => $itemtype_limit,
116
        itemtype_limit => $itemtype_limit,
117
        hold_group_id  => $h->hold_group_id,
117
        reservedate_formatted => $h->reservedate() ? output_pref(
118
        reservedate_formatted => $h->reservedate() ? output_pref(
118
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
119
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
119
          )
120
          )
120
- 

Return to bug 15516