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 1165-1170 Link Here
1165
    </div> <!-- /.modal-dialog -->
1165
    </div> <!-- /.modal-dialog -->
1166
</div> <!-- /#barcodeSubmittedModal -->
1166
</div> <!-- /#barcodeSubmittedModal -->
1167
1167
1168
[% INCLUDE 'hold-group-modal.inc' %]
1169
1168
[% MACRO jsinclude BLOCK %]
1170
[% MACRO jsinclude BLOCK %]
1169
    [% INCLUDE 'calendar.inc' %]
1171
    [% INCLUDE 'calendar.inc' %]
1170
    [% INCLUDE 'datatables.inc' %]
1172
    [% INCLUDE 'datatables.inc' %]
Lines 1198-1203 Link Here
1198
    [% Asset.js("js/checkouts.js") | $raw %]
1200
    [% Asset.js("js/checkouts.js") | $raw %]
1199
    [% Asset.js("js/holds.js") | $raw %]
1201
    [% Asset.js("js/holds.js") | $raw %]
1200
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1202
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1203
    [% Asset.js("js/hold-group.js") | $raw %]
1201
    <script>
1204
    <script>
1202
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1205
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1203
        columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1206
        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 106-111 Link Here
106
                [% ELSE %]
106
                [% ELSE %]
107
                    [% IF ( biblio.biblioitem.publicationyear ) %]<p>[% biblio.biblioitem.publicationyear | html %]</p>[% END %]
107
                    [% IF ( biblio.biblioitem.publicationyear ) %]<p>[% biblio.biblioitem.publicationyear | html %]</p>[% END %]
108
                [% END %]
108
                [% END %]
109
                [% IF ( hold.hold_group_id ) %]
110
                    <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>
111
                [% END %]
109
            </td>
112
            </td>
110
        [% ELSE %]
113
        [% ELSE %]
111
            <td>"</td>
114
            <td>"</td>
Lines 295-304 Link Here
295
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
298
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
296
     </div> <!-- /.row -->
299
     </div> <!-- /.row -->
297
300
301
     [% INCLUDE 'hold-group-modal.inc' %]
302
298
[% MACRO jsinclude BLOCK %]
303
[% MACRO jsinclude BLOCK %]
299
    [% INCLUDE 'calendar.inc' %]
304
    [% INCLUDE 'calendar.inc' %]
300
    [% INCLUDE 'datatables.inc' %]
305
    [% INCLUDE 'datatables.inc' %]
301
    [% INCLUDE 'columns_settings.inc' %]
306
    [% INCLUDE 'columns_settings.inc' %]
307
    [% Asset.js("js/hold-group.js") | $raw %]
302
    <script>
308
    <script>
303
        $(document).ready(function() {
309
        $(document).ready(function() {
304
          var columns_settings = [% TablesSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
310
          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 926-931 Link Here
926
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
926
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
927
        </div> <!-- /.row -->
927
        </div> <!-- /.row -->
928
928
929
        [% INCLUDE 'hold-group-modal.inc' %]
930
929
[% MACRO jsinclude BLOCK %]
931
[% MACRO jsinclude BLOCK %]
930
    [% INCLUDE 'datatables.inc' %]
932
    [% INCLUDE 'datatables.inc' %]
931
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
933
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
Lines 961-966 Link Here
961
    [% INCLUDE 'str/members-menu.inc' %]
963
    [% INCLUDE 'str/members-menu.inc' %]
962
    [% Asset.js("js/members-menu.js") | $raw %]
964
    [% Asset.js("js/members-menu.js") | $raw %]
963
    [% Asset.js("js/messaging-preference-form.js") | $raw %]
965
    [% Asset.js("js/messaging-preference-form.js") | $raw %]
966
    [% Asset.js("js/hold-group.js") | $raw %]
964
    <script>
967
    <script>
965
968
966
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
969
        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 483-489 Link Here
483
483
484
                            [% UNLESS ( multi_hold ) %]
484
                            [% UNLESS ( multi_hold ) %]
485
                                <li>
485
                                <li>
486
                                    <label for="requestany">Hold next available item </label>
486
                                    <label for="requestany">Hold next available item: </label>
487
                                    [% IF force_hold_level == 'item' %]
487
                                    [% IF force_hold_level == 'item' %]
488
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
488
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
489
                                    [% ELSIF force_hold_level == 'record' %]
489
                                    [% ELSIF force_hold_level == 'record' %]
Lines 498-504 Link Here
498
498
499
                                [% IF remaining_holds_for_record > 1 %]
499
                                [% IF remaining_holds_for_record > 1 %]
500
                                    <li>
500
                                    <li>
501
                                        <label for="holds_to_place_count">Holds to place (count)</label>
501
                                        <label for="holds_to_place_count">Holds to place (count): </label>
502
                                        <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" />
502
                                        <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" />
503
                                    </li>
503
                                    </li>
504
                                [% ELSE %]
504
                                [% ELSE %]
Lines 511-516 Link Here
511
                                <input name="non_priority" id="non_priority" type="checkbox" />
511
                                <input name="non_priority" id="non_priority" type="checkbox" />
512
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
512
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
513
                            </li>
513
                            </li>
514
515
                            <li id="hold_group_list_item">
516
                                <label for="hold_group">Treat as hold group: </label>
517
                                <input name="hold_group" id="hold_group" type="checkbox" />
518
                                <span class="hint">Place a hold on the next available title from this group</span>
519
                            </li>
514
                        </ol>
520
                        </ol>
515
521
516
                        [% UNLESS ( multi_hold ) %]
522
                        [% UNLESS ( multi_hold ) %]
Lines 584-592 Link Here
584
                                                                Hold must be record level
590
                                                                Hold must be record level
585
                                                            </span>
591
                                                            </span>
586
                                                        [% ELSIF ( itemloo.available ) %]
592
                                                        [% ELSIF ( itemloo.available ) %]
587
                                                            <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
593
                                                            <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber | html %]" />
588
                                                        [% ELSIF ( itemloo.override ) %]
594
                                                        [% ELSIF ( itemloo.override ) %]
589
                                                            <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
595
                                                            <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
590
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
596
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
591
                                                        [% ELSE %]
597
                                                        [% ELSE %]
592
                                                            <span class="error">
598
                                                            <span class="error">
Lines 1015-1020 Link Here
1015
        </div>
1021
        </div>
1016
    </div>
1022
    </div>
1017
1023
1024
    [% INCLUDE 'hold-group-modal.inc' %]
1025
1018
[% MACRO jsinclude BLOCK %]
1026
[% MACRO jsinclude BLOCK %]
1019
    [% INCLUDE 'datatables.inc' %]
1027
    [% INCLUDE 'datatables.inc' %]
1020
    [% INCLUDE 'calendar.inc' %]
1028
    [% INCLUDE 'calendar.inc' %]
Lines 1022-1027 Link Here
1022
    [% Asset.js("lib/hc-sticky.js") | $raw %]
1030
    [% Asset.js("lib/hc-sticky.js") | $raw %]
1023
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1031
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1024
    [% INCLUDE 'select2.inc' %]
1032
    [% INCLUDE 'select2.inc' %]
1033
    [% Asset.js("js/hold-group.js") | $raw %]
1025
    <script>
1034
    <script>
1026
        var Sticky;
1035
        var Sticky;
1027
        var biblionumber = "[% biblionumber | $raw %]";
1036
        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 695-700 foreach my $biblionumber (@biblionumbers) { Link Here
695
        $reserve{branchcode}       = $res->branchcode();
695
        $reserve{branchcode}       = $res->branchcode();
696
        $reserve{non_priority}     = $res->non_priority();
696
        $reserve{non_priority}     = $res->non_priority();
697
        $reserve{object}           = $res;
697
        $reserve{object}           = $res;
698
        $reserve{hold_group_id}    = $res->hold_group_id;
698
699
699
        push( @reserveloop, \%reserve );
700
        push( @reserveloop, \%reserve );
700
    }
701
    }
(-)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