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
            [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%]
184
            [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%]
182
            [%- UNLESS hold.found -%]
185
            [%- UNLESS hold.found -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+3 lines)
Lines 946-951 Link Here
946
    </div> <!-- /.modal-dialog -->
946
    </div> <!-- /.modal-dialog -->
947
</div> <!-- /#barcodeSubmittedModal -->
947
</div> <!-- /#barcodeSubmittedModal -->
948
948
949
[% INCLUDE 'hold-group-modal.inc' %]
950
949
[% MACRO jsinclude BLOCK %]
951
[% MACRO jsinclude BLOCK %]
950
    [% INCLUDE 'calendar.inc' %]
952
    [% INCLUDE 'calendar.inc' %]
951
    [% INCLUDE 'datatables.inc' %]
953
    [% INCLUDE 'datatables.inc' %]
Lines 979-984 Link Here
979
    [% Asset.js("js/pages/circulation.js") | $raw %]
981
    [% Asset.js("js/pages/circulation.js") | $raw %]
980
    [% Asset.js("js/checkouts.js") | $raw %]
982
    [% Asset.js("js/checkouts.js") | $raw %]
981
    [% Asset.js("js/holds.js") | $raw %]
983
    [% Asset.js("js/holds.js") | $raw %]
984
    [% Asset.js("js/hold-group.js") | $raw %]
982
    <script>
985
    <script>
983
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
986
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
984
        columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
987
        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 853-858 Link Here
853
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
853
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
854
        </div> <!-- /.row -->
854
        </div> <!-- /.row -->
855
855
856
        [% INCLUDE 'hold-group-modal.inc' %]
857
856
[% MACRO jsinclude BLOCK %]
858
[% MACRO jsinclude BLOCK %]
857
    [% INCLUDE 'datatables.inc' %]
859
    [% INCLUDE 'datatables.inc' %]
858
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
860
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
Lines 888-893 Link Here
888
    [% Asset.js("js/holds.js") | $raw %]
890
    [% Asset.js("js/holds.js") | $raw %]
889
    [% INCLUDE 'str/members-menu.inc' %]
891
    [% INCLUDE 'str/members-menu.inc' %]
890
    [% Asset.js("js/members-menu.js") | $raw %]
892
    [% Asset.js("js/members-menu.js") | $raw %]
893
    [% Asset.js("js/hold-group.js") | $raw %]
891
    <script>
894
    <script>
892
895
893
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
896
        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 529-535 Link Here
529
529
530
                            [% UNLESS ( multi_hold ) %]
530
                            [% UNLESS ( multi_hold ) %]
531
                                <li>
531
                                <li>
532
                                    <label for="requestany">Hold next available item </label>
532
                                    <label for="requestany">Hold next available item: </label>
533
                                    [% IF force_hold_level == 'item' %]
533
                                    [% IF force_hold_level == 'item' %]
534
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
534
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
535
                                    [% ELSIF force_hold_level == 'record' %]
535
                                    [% ELSIF force_hold_level == 'record' %]
Lines 544-550 Link Here
544
544
545
                                [% IF remaining_holds_for_record > 1 %]
545
                                [% IF remaining_holds_for_record > 1 %]
546
                                    <li>
546
                                    <li>
547
                                        <label for="holds_to_place_count">Holds to place (count)</label>
547
                                        <label for="holds_to_place_count">Holds to place (count): </label>
548
                                        <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" />
548
                                        <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" />
549
                                    </li>
549
                                    </li>
550
                                [% ELSE %]
550
                                [% ELSE %]
Lines 557-562 Link Here
557
                                <input name="non_priority" id="non_priority" type="checkbox" />
557
                                <input name="non_priority" id="non_priority" type="checkbox" />
558
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
558
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
559
                            </li>
559
                            </li>
560
561
                            <li id="hold_group_list_item">
562
                                <label for="hold_group">Treat as hold group: </label>
563
                                <input name="hold_group" id="hold_group" type="checkbox" />
564
                                <span class="hint">Place a hold on the next available title from this group</span>
565
                            </li>
560
                        </ol>
566
                        </ol>
561
567
562
                        [% UNLESS ( multi_hold ) %]
568
                        [% UNLESS ( multi_hold ) %]
Lines 630-638 Link Here
630
                                                                Hold must be record level
636
                                                                Hold must be record level
631
                                                            </span>
637
                                                            </span>
632
                                                        [% ELSIF ( itemloo.available ) %]
638
                                                        [% ELSIF ( itemloo.available ) %]
633
                                                            <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
639
                                                            <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber | html %]" />
634
                                                        [% ELSIF ( itemloo.override ) %]
640
                                                        [% ELSIF ( itemloo.override ) %]
635
                                                            <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
641
                                                            <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
636
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
642
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
637
                                                        [% ELSE %]
643
                                                        [% ELSE %]
638
                                                            <span class="error">
644
                                                            <span class="error">
Lines 1128-1133 Link Here
1128
        </div>
1134
        </div>
1129
    </div>
1135
    </div>
1130
1136
1137
    [% INCLUDE 'hold-group-modal.inc' %]
1138
1131
[% MACRO jsinclude BLOCK %]
1139
[% MACRO jsinclude BLOCK %]
1132
    [% INCLUDE 'datatables.inc' %]
1140
    [% INCLUDE 'datatables.inc' %]
1133
    [% INCLUDE 'calendar.inc' %]
1141
    [% INCLUDE 'calendar.inc' %]
Lines 1136-1141 Link Here
1136
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1144
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1137
    [% INCLUDE 'select2.inc' %]
1145
    [% INCLUDE 'select2.inc' %]
1138
    [% Asset.js("js/holds.js") | $raw%]
1146
    [% Asset.js("js/holds.js") | $raw%]
1147
    [% Asset.js("js/hold-group.js") | $raw %]
1139
    <script>
1148
    <script>
1140
        var Sticky;
1149
        var Sticky;
1141
        var biblionumber = "[% biblionumber | $raw %]";
1150
        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 144-149 $(document).ready(function() { Link Here
144
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
144
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes.escapeHtml() + "</span>"
145
                            }
145
                            }
146
146
147
                            if ( oObj.hold_group_id ) {
148
                                title += '<br>';
149
                                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>'
150
                                title += '<span>(' + link + ')</span>';
151
                            }
152
147
                            return title;
153
                            return title;
148
                        }
154
                        }
149
                    },
155
                    },
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 193-199 foreach my $biblioNumber (@biblionumbers) { Link Here
193
if ( $query->param('place_reserve') ) {
193
if ( $query->param('place_reserve') ) {
194
    my $reserve_cnt = 0;
194
    my $reserve_cnt = 0;
195
    if ($maxreserves) {
195
    if ($maxreserves) {
196
        $reserve_cnt = $patron->holds->count;
196
        $reserve_cnt = $patron->holds->count_grouped;
197
    }
197
    }
198
198
199
    # List is composed of alternating biblio/item/branch
199
    # 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 29-34 use C4::Auth qw( checkauth ); Link Here
29
29
30
use Koha::Items;
30
use Koha::Items;
31
use Koha::Patrons;
31
use Koha::Patrons;
32
use Koha::HoldGroup;
32
33
33
my $input = CGI->new();
34
my $input = CGI->new();
34
35
Lines 48-53 my $checkitem = $input->param('checkitem'); Link Here
48
my $expirationdate = $input->param('expiration_date');
49
my $expirationdate = $input->param('expiration_date');
49
my $itemtype       = $input->param('itemtype') || undef;
50
my $itemtype       = $input->param('itemtype') || undef;
50
my $non_priority   = $input->param('non_priority');
51
my $non_priority   = $input->param('non_priority');
52
my $hold_group     = $input->param('hold_group') || undef;
51
53
52
my $borrower = Koha::Patrons->find( $borrowernumber );
54
my $borrower = Koha::Patrons->find( $borrowernumber );
53
$borrower = $borrower->unblessed if $borrower;
55
$borrower = $borrower->unblessed if $borrower;
Lines 72-77 my $found; Link Here
72
74
73
if ( $type eq 'str8' && $borrower ) {
75
if ( $type eq 'str8' && $borrower ) {
74
76
77
    if ( @biblionumbers > 1 && $hold_group ) {
78
        $hold_group = Koha::HoldGroup->new->store;
79
    }
80
75
    foreach my $biblionumber ( keys %bibinfos ) {
81
    foreach my $biblionumber ( keys %bibinfos ) {
76
        my $count = @bibitems;
82
        my $count = @bibitems;
77
        @bibitems = sort @bibitems;
83
        @bibitems = sort @bibitems;
Lines 114-119 if ( $type eq 'str8' && $borrower ) { Link Here
114
                        found            => $found,
120
                        found            => $found,
115
                        itemtype         => $itemtype,
121
                        itemtype         => $itemtype,
116
                        non_priority     => $non_priority,
122
                        non_priority     => $non_priority,
123
                        hold_group_id    => $hold_group ? $hold_group->id : undef,
117
                    }
124
                    }
118
                );
125
                );
119
126
Lines 136-141 if ( $type eq 'str8' && $borrower ) { Link Here
136
                        found            => $found,
143
                        found            => $found,
137
                        itemtype         => $itemtype,
144
                        itemtype         => $itemtype,
138
                        non_priority     => $non_priority,
145
                        non_priority     => $non_priority,
146
                        hold_group_id    => $hold_group ? $hold_group->id : undef,
139
                    }
147
                    }
140
                );
148
                );
141
            }
149
            }
Lines 157-162 if ( $type eq 'str8' && $borrower ) { Link Here
157
                            found            => $found,
165
                            found            => $found,
158
                            itemtype         => $itemtype,
166
                            itemtype         => $itemtype,
159
                            non_priority     => $non_priority,
167
                            non_priority     => $non_priority,
168
                            hold_group_id    => $hold_group ? $hold_group->id : undef,
160
                        }
169
                        }
161
                    );
170
                    );
162
                }
171
                }
(-)a/reserve/request.pl (+1 lines)
Lines 709-714 foreach my $biblionumber (@biblionumbers) { Link Here
709
        $reserve{branchcode}       = $res->branchcode();
709
        $reserve{branchcode}       = $res->branchcode();
710
        $reserve{non_priority}     = $res->non_priority();
710
        $reserve{non_priority}     = $res->non_priority();
711
        $reserve{object}           = $res;
711
        $reserve{object}           = $res;
712
        $reserve{hold_group_id}    = $res->hold_group_id;
712
713
713
        push( @reserveloop, \%reserve );
714
        push( @reserveloop, \%reserve );
714
    }
715
    }
(-)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