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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt (-564 / +551 lines)
Lines 42-667 Link Here
42
    [% END #/ WRAPPER breadcrumbs %]
42
    [% END #/ WRAPPER breadcrumbs %]
43
[% END #/ WRAPPER sub-header.inc %]
43
[% END #/ WRAPPER sub-header.inc %]
44
44
45
<div class="main container-fluid">
45
[% WRAPPER "main-container.inc" aside="tools-menu" %]
46
    <div class="row">
46
    [% IF view == "cud-form" %]
47
        <div class="col-sm-10 col-sm-push-2 order-sm-1">
47
        <h1>Batch modify holds</h1>
48
            <main>
48
        <div id="modify_holds_search">
49
                [% IF view == "cud-form" %]
49
            <form method="get" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="modify_holds_form">
50
                    <h1>Batch modify holds</h1>
50
                <fieldset class="rows">
51
                    <div id="modify_holds_search">
51
                    <legend>Hold search criteria:</legend>
52
                        <form method="get" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="modify_holds_form">
52
                    <ol>
53
                            <fieldset class="rows">
53
                        <li>
54
                                <legend>Hold search criteria:</legend>
54
                            <label for="expirationdate_from">Expiration date from:</label>
55
                                <ol>
55
                            <input type="text" size="10" id="expirationdate_from" name="expirationdate_from" class="flatpickr" />
56
                                    <li>
56
                        </li>
57
                                        <label for="expirationdate_from">Expiration date from:</label>
57
                        <li>
58
                                        <input type="text" size="10" id="expirationdate_from" name="expirationdate_from" class="flatpickr" />
58
                            <label for="expirationdate_to">Expiration date to:</label>
59
                                    </li>
59
                            <input type="text" size="10" id="expirationdate_to" name="expirationdate_to" class="flatpickr" />
60
                                    <li>
60
                        </li>
61
                                        <label for="expirationdate_to">Expiration date to:</label>
61
                        <li>
62
                                        <input type="text" size="10" id="expirationdate_to" name="expirationdate_to" class="flatpickr" />
62
                            <label for="branchcodes">Libraries:</label>
63
                                    </li>
63
                            <select name="branchcodes" id="branchcodes" multiple="multiple">
64
                                    <li>
64
                                [% PROCESS options_for_libraries libraries => Branches.all(selected => "") %]
65
                                        <label for="branchcodes">Libraries:</label>
65
                            </select>
66
                                        <select name="branchcodes" id="branchcodes" multiple="multiple">
66
                        </li>
67
                                            [% PROCESS options_for_libraries libraries => Branches.all(selected => "") %]
67
                        <li>
68
                                        </select>
68
                            <label for="found_status">Found status:</label>
69
                                    </li>
69
                            <select name="found_status" id="found_status" multiple="multiple">
70
                                    <li>
70
                                <option value="NULL">No status</option>
71
                                        <label for="found_status">Found status:</label>
71
                                <option value="T">In transit</option>
72
                                        <select name="found_status" id="found_status" multiple="multiple">
72
                                <option value="P">In processing</option>
73
                                            <option value="NULL">No status</option>
73
                                <option value="W">Waiting</option>
74
                                            <option value="T">In transit</option>
74
                            </select>
75
                                            <option value="P">In processing</option>
75
                        </li>
76
                                            <option value="W">Waiting</option>
76
                        <li>
77
                                        </select>
77
                            <label for="suspend_status">Suspended:</label>
78
                                    </li>
78
                            <select name="suspend_status" id="suspend_status">
79
                                    <li>
79
                                <option value="none" selected="selected"></option>
80
                                        <label for="suspend_status">Suspended:</label>
80
                                <option value="0">Not suspended</option>
81
                                        <select name="suspend_status" id="suspend_status">
81
                                <option value="1">Suspended</option>
82
                                            <option value="none" selected="selected"></option>
82
                            </select>
83
                                            <option value="0">Not suspended</option>
83
                        </li>
84
                                            <option value="1">Suspended</option>
84
                        <li>
85
                                        </select>
85
                            <label for="suspend_until_from">Suspended until from:</label>
86
                                    </li>
86
                            <input type="text" size="10" id="suspend_until_from" name="suspend_until_from" class="flatpickr" data-date_to="suspend_until_to" />
87
                                    <li>
87
                        </li>
88
                                        <label for="suspend_until_from">Suspended until from:</label>
88
                        <li>
89
                                        <input type="text" size="10" id="suspend_until_from" name="suspend_until_from" class="flatpickr" data-date_to="suspend_until_to" />
89
                            <label for="suspend_until_to">Suspended until to:</label>
90
                                    </li>
90
                            <input type="text" size="10" id="suspend_until_to" name="suspend_until_to" class="flatpickr" />
91
                                    <li>
91
                        </li>
92
                                        <label for="suspend_until_to">Suspended until to:</label>
92
                        <li>
93
                                        <input type="text" size="10" id="suspend_until_to" name="suspend_until_to" class="flatpickr" />
93
                            <label for="holdnotes">Hold note:</label>
94
                                    </li>
94
                            <input type="text" id="holdnotes" name="holdnotes" />
95
                                    <li>
95
                        </li>
96
                                        <label for="holdnotes">Hold note:</label>
96
                    </ol>
97
                                        <input type="text" id="holdnotes" name="holdnotes" />
97
                </fieldset>
98
                                    </li>
98
                <fieldset class="action">
99
                                </ol>
99
                    <input type="submit" class="btn btn-primary" value="Search" />
100
                            </fieldset>
100
                </fieldset>
101
                            <fieldset class="action">
101
            </form>
102
                                <input type="submit" class="btn btn-primary" value="Search" />
102
            <!-- /#modify_holds_form -->
103
                            </fieldset>
103
        </div>
104
                        </form>
104
        <!-- /#modify_holds_search -->
105
                        <!-- /#modify_holds_form -->
105
    [% ELSIF view == "report" %]
106
                    </div>
106
        <h1>Modified holds</h1>
107
                    <!-- /#modify_holds_search -->
107
        <div id="modified_holds_results-wrapper">
108
                [% ELSIF view == "report" %]
108
            <div id="modified_holds_results" class="page-section">
109
                    <h1>Modified holds</h1>
109
                <table id="modified_holds">
110
                    <div id="modified_holds_results-wrapper">
110
                    <thead>
111
                        <div id="modified_holds_results" class="page-section">
111
                        <tr>
112
                            <table id="modified_holds">
112
                            <th>Title</th>
113
                                <thead>
113
                            <th>Patron</th>
114
                                    <tr>
114
                            <th>Pickup location</th>
115
                                        <th>Title</th>
115
                            <th>Priority</th>
116
                                        <th>Patron</th>
116
                            <th>Expiration date</th>
117
                                        <th>Pickup location</th>
117
                            <th>Status</th>
118
                                        <th>Priority</th>
118
                            <th>Suspended</th>
119
                                        <th>Expiration date</th>
119
                            <th>Suspended until</th>
120
                                        <th>Status</th>
120
                            <th>Notes</th>
121
                                        <th>Suspended</th>
121
                            <!-- Add other columns as needed -->
122
                                        <th>Suspended until</th>
122
                        </tr>
123
                                        <th>Notes</th>
123
                    </thead>
124
                                        <!-- Add other columns as needed -->
124
                    <tbody>
125
                                    </tr>
125
                        [% FOREACH hold IN updated_holds_obj %]
126
                                </thead>
126
                            <tr>
127
                                <tbody>
127
                                <td>[% INCLUDE 'biblio-title.inc' biblio=hold.biblio link = 1 %]</td>
128
                                    [% FOREACH hold IN updated_holds_obj %]
128
                                <td>[% INCLUDE 'patron-title.inc' invert_name=1 patron=hold.borrower hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]</td>
129
                                        <tr>
129
                                <td>[% hold.branch.branchname | html %]</td>
130
                                            <td>[% INCLUDE 'biblio-title.inc' biblio=hold.biblio link = 1 %]</td>
130
                                <td>[% hold.priority | html %]</td>
131
                                            <td>[% INCLUDE 'patron-title.inc' invert_name=1 patron=hold.borrower hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]</td>
131
                                <td>[% hold.expirationdate | $KohaDates %]</td>
132
                                            <td>[% hold.branch.branchname | html %]</td>
132
                                <td>
133
                                            <td>[% hold.priority | html %]</td>
133
                                    [% IF hold.found == 'F' %]
134
                                            <td>[% hold.expirationdate | $KohaDates %]</td>
134
                                        <span>Fulfilled</span>
135
                                            <td>
135
                                    [% ELSIF hold.cancellationdate %]
136
                                                [% IF hold.found == 'F' %]
136
                                        <span>Cancelled</span>
137
                                                    <span>Fulfilled</span>
137
                                    [% ELSIF hold.found == 'W' %]
138
                                                [% ELSIF hold.cancellationdate %]
138
                                        [% IF hold.cancellation_requests.count == 0 %]
139
                                                    <span>Cancelled</span>
139
                                            <span>Waiting</span>
140
                                                [% ELSIF hold.found == 'W' %]
140
                                        [% ELSE %]
141
                                                    [% IF hold.cancellation_requests.count == 0 %]
141
                                            <span>Cancelled</span>
142
                                                        <span>Waiting</span>
142
                                        [% END %]
143
                                                    [% ELSE %]
143
                                    [% ELSIF hold.found == 'T' %]
144
                                                        <span>Cancelled</span>
144
                                        <span>In transit</span>
145
                                                    [% END %]
145
                                    [% ELSE %]
146
                                                [% ELSIF hold.found == 'T' %]
146
                                        <span>Pending</span>
147
                                                    <span>In transit</span>
148
                                                [% ELSE %]
149
                                                    <span>Pending</span>
150
                                                [% END %]
151
                                            </td>
152
                                            <td>[% IF hold.suspend %]Yes[% ELSE %]No[% END %]</td>
153
                                            <td>[% IF hold.suspend_until %][% hold.suspend_until | $KohaDates %][% ELSE %]-[% END %]</td>
154
                                            <td>[% hold.reservenotes | html %]</td>
155
                                        </tr>
156
                                    [% END %]
147
                                    [% END %]
157
                                </tbody>
148
                                </td>
158
                            </table>
149
                                <td>[% IF hold.suspend %]Yes[% ELSE %]No[% END %]</td>
159
                        </div>
150
                                <td>[% IF hold.suspend_until %][% hold.suspend_until | $KohaDates %][% ELSE %]-[% END %]</td>
160
                        <!-- /#modified_holds_results -->
151
                                <td>[% hold.reservenotes | html %]</td>
161
                        <fieldset class="action">
152
                            </tr>
162
                            <a href="/cgi-bin/koha/tools/batch_modify_holds.pl">Return to batch hold modification</a>
153
                        [% END %]
163
                        </fieldset>
154
                    </tbody>
164
                    </div>
155
                </table>
165
                    <!-- /#modified_holds_results-wrapper -->
156
            </div>
166
                [% END %]
157
            <!-- /#modified_holds_results -->
167
                <div id="modify_holds_results-wrapper" style="display:none;">
158
            <fieldset class="action">
168
                    <div id="toolbar" class="btn-toolbar">
159
                <a href="/cgi-bin/koha/tools/batch_modify_holds.pl">Return to batch hold modification</a>
169
                        <a href="#" id="edit_search" class="btn btn-default"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit search</a>
160
            </fieldset>
170
                    </div>
171
                    <!-- /#toolbar -->
172
                    <form action="/cgi-bin/koha/tools/batch_modify_holds.pl" method="post" id="process_mods">
173
                        [% INCLUDE 'csrf-token.inc' %]
174
                        <div id="modify_holds_results" class="page-section">
175
                            <div id="searchheader" class="searchheader">
176
                                <a id="select_all" href="#" class="btn btn-link"><i class="fa fa-check"></i> Select all visible rows</a>
177
                                | <a id="clear_all" href="#" class="btn btn-link"><i class="fa fa-times"></i> Clear selections</a>
178
                                <div id="table_search_selections" class="btn-group" style="display:none;">
179
                                    <span></span>
180
                                    <a href="#" id="clear-row-selection"><i class="fa fa-times"></i> Clear</a>
181
                                </div>
182
                            </div>
183
                            <!-- /#searchheader -->
184
                            <h3>Holds found for: <span class="searchpattern"></span></h3>
185
                            <table id="holds_to_modify"></table>
186
                        </div>
187
                        <!-- /#modify_holds_results -->
188
                        <div id="modify_holds_form_options" class="page-section">
189
                            <h2>Modify holds</h2>
190
                            <table id="modify_holds_options">
191
                                <thead>
192
                                    <tr>
193
                                        <th>New expiration date</th>
194
                                        <th>New pickup library</th>
195
                                        <th>Suspend holds</th>
196
                                        <th>Suspend until</th>
197
                                        <th>New hold note</th>
198
                                        <th>Clear hold notes</th>
199
                                    </tr>
200
                                </thead>
201
                                <tbody>
202
                                    <tr>
203
                                        <td>
204
                                            <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
205
                                        </td>
206
                                        <td>
207
                                            <select name="new_pickup_loc" id="new_pickup_loc">
208
                                                <option value="" selected="selected"></option>
209
                                                [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ selected => "" }) %]
210
                                            </select>
211
                                        </td>
212
                                        <td>
213
                                            <select id="new_suspend_status" name="new_suspend_status">
214
                                                <option value="" selected="selected"></option>
215
                                                <option value="0">Not suspended</option>
216
                                                <option value="1">Suspend</option>
217
                                            </select>
218
                                        </td>
219
                                        <td>
220
                                            <input type="text" id="new_suspend_date" name="new_suspend_date" class="flatpickr" data-flatpickr-futuredate="true" />
221
                                        </td>
222
                                        <td>
223
                                            <input type="text" id="new_hold_note" name="new_hold_note" />
224
                                        </td>
225
                                        <td>
226
                                            <input class="selection" type="checkbox" id="clear_hold_notes" name="clear_hold_notes" value="1" />
227
                                        </td>
228
                                    </tr>
229
                                </tbody>
230
                            </table>
231
                            <!-- /#modify_holds_options -->
232
                        </div>
233
                        <!-- /#modify_holds_options -->
234
                        <fieldset class="action">
235
                            <input type="hidden" name="op" value="cud-modify" />
236
                            <input type="submit" class="btn btn-primary" value="Modify holds" />
237
                            <a class="cancel" href="/cgi-bin/koha/tools/batch_modify_holds.pl">Cancel</a>
238
                        </fieldset>
239
                    </form>
240
                    <!-- /#process_mods -->
241
                </div>
242
                <!-- /#modify_holds_results-wrapper -->
243
            </main>
244
        </div>
161
        </div>
245
        <!-- /.col-sm-10 col-sm-push-2 -->
162
        <!-- /#modified_holds_results-wrapper -->
246
        <div class="col-sm-2 col-sm-pull-10">
163
    [% END %]
247
            <aside> [% INCLUDE 'tools-menu.inc' %] </aside>
164
    <div id="modify_holds_results-wrapper" style="display:none;">
165
        <div id="toolbar" class="btn-toolbar">
166
            <a href="#" id="edit_search" class="btn btn-default"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit search</a>
248
        </div>
167
        </div>
249
        <!-- /.col-sm-2 col-sm-pull-10 -->
168
        <!-- /#toolbar -->
169
        <form action="/cgi-bin/koha/tools/batch_modify_holds.pl" method="post" id="process_mods">
170
            [% INCLUDE 'csrf-token.inc' %]
171
            <div id="modify_holds_results" class="page-section">
172
                <div id="searchheader" class="searchheader">
173
                    <a id="select_all" href="#" class="btn btn-link"><i class="fa fa-check"></i> Select all visible rows</a>
174
                    | <a id="clear_all" href="#" class="btn btn-link"><i class="fa fa-times"></i> Clear selections</a>
175
                    <div id="table_search_selections" class="btn-group" style="display:none;">
176
                        <span></span>
177
                        <a href="#" id="clear-row-selection"><i class="fa fa-times"></i> Clear</a>
178
                    </div>
179
                </div>
180
                <!-- /#searchheader -->
181
                <h3>Holds found for: <span class="searchpattern"></span></h3>
182
                <table id="holds_to_modify"></table>
183
            </div>
184
            <!-- /#modify_holds_results -->
185
            <div id="modify_holds_form_options" class="page-section">
186
                <h2>Modify holds</h2>
187
                <table id="modify_holds_options">
188
                    <thead>
189
                        <tr>
190
                            <th>New expiration date</th>
191
                            <th>New pickup library</th>
192
                            <th>Suspend holds</th>
193
                            <th>Suspend until</th>
194
                            <th>New hold note</th>
195
                            <th>Clear hold notes</th>
196
                        </tr>
197
                    </thead>
198
                    <tbody>
199
                        <tr>
200
                            <td>
201
                                <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
202
                            </td>
203
                            <td>
204
                                <select name="new_pickup_loc" id="new_pickup_loc">
205
                                    <option value="" selected="selected"></option>
206
                                    [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ selected => "" }) %]
207
                                </select>
208
                            </td>
209
                            <td>
210
                                <select id="new_suspend_status" name="new_suspend_status">
211
                                    <option value="" selected="selected"></option>
212
                                    <option value="0">Not suspended</option>
213
                                    <option value="1">Suspend</option>
214
                                </select>
215
                            </td>
216
                            <td>
217
                                <input type="text" id="new_suspend_date" name="new_suspend_date" class="flatpickr" data-flatpickr-futuredate="true" />
218
                            </td>
219
                            <td>
220
                                <input type="text" id="new_hold_note" name="new_hold_note" />
221
                            </td>
222
                            <td>
223
                                <input class="selection" type="checkbox" id="clear_hold_notes" name="clear_hold_notes" value="1" />
224
                            </td>
225
                        </tr>
226
                    </tbody>
227
                </table>
228
                <!-- /#modify_holds_options -->
229
            </div>
230
            <!-- /#modify_holds_options -->
231
            <fieldset class="action">
232
                <input type="hidden" name="op" value="cud-modify" />
233
                <input type="submit" class="btn btn-primary" value="Modify holds" />
234
                <a class="cancel" href="/cgi-bin/koha/tools/batch_modify_holds.pl">Cancel</a>
235
            </fieldset>
236
        </form>
237
        <!-- /#process_mods -->
250
    </div>
238
    </div>
251
    [% MACRO jsinclude BLOCK %]
239
    <!-- /#modify_holds_results-wrapper -->
252
        [% Asset.js("js/tools-menu.js") | $raw %]
240
[% END %]
253
        [% INCLUDE 'calendar.inc' %]
241
[% MACRO jsinclude BLOCK %]
254
        [% INCLUDE 'datatables.inc' %]
242
    [% Asset.js("js/tools-menu.js") | $raw %]
255
        [% INCLUDE 'select2.inc' %]
243
    [% INCLUDE 'calendar.inc' %]
256
        [% INCLUDE 'js-biblio-format.inc' %]
244
    [% INCLUDE 'datatables.inc' %]
257
        [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
245
    [% INCLUDE 'select2.inc' %]
258
        <script>
246
    [% INCLUDE 'js-biblio-format.inc' %]
259
            let hide_patron_name = [% IF Koha.Preference('HidePatronName') %]true[% ELSE %]false[% END %];
247
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
260
            let hold_ids = [% IF updated_holds %] [% updated_holds | $raw %] [% ELSE %] [] [% END %];
248
    <script>
261
            let hold_ids_from_sql = [% IF reserve_ids_list  %] [% reserve_ids_list  | $raw %] [% ELSE %] [] [% END %];
249
        let hide_patron_name = [% IF Koha.Preference('HidePatronName') %]true[% ELSE %]false[% END %];
262
250
        let hold_ids = [% IF updated_holds %] [% updated_holds | $raw %] [% ELSE %] [] [% END %];
263
            $(document).ready(function() {
251
        let hold_ids_from_sql = [% IF reserve_ids_list  %] [% reserve_ids_list  | $raw %] [% ELSE %] [] [% END %];
264
252
265
                // Apply select2 to all select fields having a "multiple" attribute
253
        $(document).ready(function() {
266
                let selectFields = document.querySelectorAll('select[multiple]');
254
267
                selectFields.forEach((selectField) => {
255
            // Apply select2 to all select fields having a "multiple" attribute
268
                    selectField.style.minWidth = '200px';
256
            let selectFields = document.querySelectorAll('select[multiple]');
269
                    $(selectField).select2();
257
            selectFields.forEach((selectField) => {
270
                });
258
                selectField.style.minWidth = '200px';
259
                $(selectField).select2();
260
            });
271
261
272
                //Empty local storage from previous selections
262
            //Empty local storage from previous selections
273
                localStorage.removeItem("holds_modify_selections");
263
            localStorage.removeItem("holds_modify_selections");
274
264
275
                $("#holds_to_modify").on("change", "input[type='checkbox']", function(){
265
            $("#holds_to_modify").on("change", "input[type='checkbox']", function(){
276
                    var holds_modify_selections = JSON.parse(localStorage.getItem("holds_modify_selections")) || [];
266
                var holds_modify_selections = JSON.parse(localStorage.getItem("holds_modify_selections")) || [];
277
                    var hold_id = $(this).val();
267
                var hold_id = $(this).val();
278
                    if ($(this).prop("checked")) {
268
                if ($(this).prop("checked")) {
279
269
280
                        hold_data = {
270
                    hold_data = {
281
                            hold_id: hold_id,
271
                        hold_id: hold_id,
282
                            found_status: $(this).closest('tr').find('.found_status').children('span').data('found-status'),
272
                        found_status: $(this).closest('tr').find('.found_status').children('span').data('found-status'),
283
                            suspended: $(this).closest('tr').find('.suspended').children('span').data('suspended'),
273
                        suspended: $(this).closest('tr').find('.suspended').children('span').data('suspended'),
284
                        }
274
                    }
285
275
286
                        holds_modify_selections.push(hold_data);
276
                    holds_modify_selections.push(hold_data);
287
                        localStorage.setItem("holds_modify_selections", JSON.stringify(holds_modify_selections));
277
                    localStorage.setItem("holds_modify_selections", JSON.stringify(holds_modify_selections));
288
                        showHoldSelections(holds_modify_selections.length);
278
                    showHoldSelections(holds_modify_selections.length);
279
                } else {
280
                    var filtered = holds_modify_selections.filter(function( hold_obj ){
281
                        return hold_obj.hold_id !== hold_id;
282
                    });
283
                    if( filtered.length > 0 ){
284
                        localStorage.setItem("holds_modify_selections", JSON.stringify( filtered ));
285
                        holds_modify_selections = filtered;
286
                        showHoldSelections( filtered.length );
289
                    } else {
287
                    } else {
290
                        var filtered = holds_modify_selections.filter(function( hold_obj ){
288
                        holds_modify_selections = [];
291
                            return hold_obj.hold_id !== hold_id;
289
                        localStorage.removeItem("holds_modify_selections");
292
                        });
290
                        showHoldSelections( 0 );
293
                        if( filtered.length > 0 ){
294
                            localStorage.setItem("holds_modify_selections", JSON.stringify( filtered ));
295
                            holds_modify_selections = filtered;
296
                            showHoldSelections( filtered.length );
297
                        } else {
298
                            holds_modify_selections = [];
299
                            localStorage.removeItem("holds_modify_selections");
300
                            showHoldSelections( 0 );
301
                        }
302
                    }
291
                    }
303
                });
292
                }
293
            });
304
294
305
                $("#select_all").on("click", function(e){
295
            $("#select_all").on("click", function(e){
306
                    e.preventDefault();
296
                e.preventDefault();
307
                    $("#holds_to_modify input[type='checkbox']").each(function(){
297
                $("#holds_to_modify input[type='checkbox']").each(function(){
308
                        $(this).prop("checked", true).change();
298
                    $(this).prop("checked", true).change();
309
                    });
310
                });
299
                });
300
            });
311
301
312
                $("#clear_all").on("click", function(e){
302
            $("#clear_all").on("click", function(e){
313
                    e.preventDefault();
303
                e.preventDefault();
314
                    $("#holds_to_modify input[type='checkbox']").each(function(){
304
                $("#holds_to_modify input[type='checkbox']").each(function(){
315
                        $(this).prop("checked", false).change();
305
                    $(this).prop("checked", false).change();
316
                    });
317
                });
306
                });
307
            });
318
308
319
                $("#clear-row-selection").on("click", function (e) {
309
            $("#clear-row-selection").on("click", function (e) {
320
                    e.preventDefault();
310
                e.preventDefault();
321
                    $("input[type='checkbox']").prop("checked", false).change();
311
                $("input[type='checkbox']").prop("checked", false).change();
322
                    localStorage.removeItem("holds_modify_selections");
312
                localStorage.removeItem("holds_modify_selections");
323
                    $("#table_search_selections").hide();
313
                $("#table_search_selections").hide();
324
                });
314
            });
325
315
326
                $('#modify_holds_form').submit(function() {
316
            $('#modify_holds_form').submit(function() {
327
                    var modify_holds_form = $(this);
317
                var modify_holds_form = $(this);
328
                    search_holds(modify_holds_form);
318
                search_holds(modify_holds_form);
329
                    $("#modify_holds_search").hide();
319
                $("#modify_holds_search").hide();
330
                    $('#edit_search').show();
320
                $('#edit_search').show();
331
                    return false;
321
                return false;
332
                });
322
            });
333
323
334
                if(hold_ids_from_sql.length > 0){
324
            if(hold_ids_from_sql.length > 0){
335
                    $('#modify_holds_form').trigger('submit');
325
                $('#modify_holds_form').trigger('submit');
326
            }
327
328
            $("#edit_search").on("click", function(e){
329
                e.preventDefault();
330
                $('#modify_holds_search').show();
331
                $('#edit_search').hide();
332
            });
333
334
            function showHoldSelections( number ){
335
                if (number === 0) {
336
                    $("#table_search_selections").hide();
337
                } else {
338
                    $("#table_search_selections")
339
                        .show()
340
                        .find("span")
341
                        .text(_("Holds selected: %s").format(number));
336
                }
342
                }
343
            }
344
345
            function search_holds(modify_holds_form){
346
                var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_hold_modification', 'holds_to_modify', 'json' ) | $raw %];
347
                var searchpattern = "";
348
                var filters = {
349
                    "me.expirationdate": function(){
350
                        var expirationdate_from = modify_holds_form.find("#expirationdate_from").val();
351
                        var expirationdate_to   = modify_holds_form.find("#expirationdate_to").val();
352
353
                        if (expirationdate_from && expirationdate_to){
354
                            searchpattern += _("expiration date between ") + expirationdate_from + " and " + expirationdate_to + " ";
355
                            return {"-between": [expirationdate_from, expirationdate_to]};
356
                        }
357
                        else if (expirationdate_from && !expirationdate_to){
358
                            searchpattern += _("expiration date from ") + expirationdate_from + " ";
359
                            return {">=": expirationdate_from };
360
                        } else if (!expirationdate_from && expirationdate_to){
361
                            searchpattern += _("expiration date to ") + expirationdate_to + " ";
362
                            return {"<=": expirationdate_to };
363
                        }
364
                    },
365
                    "me.branchcode": function(){
366
                        var branchcodes = modify_holds_form.find("#branchcodes").val();
367
                        if( branchcodes.length > 0 ){
368
                            searchpattern += _("from libraries ");
369
                            var selected_libraries = modify_holds_form.find("#branchcodes option:selected");
370
                            $.each(selected_libraries, function(key, value) {
371
                                searchpattern += value.text + " ";
372
                            });
373
                            return {"-in": branchcodes };
374
                        }
375
                    },
376
                    "me.status": function(){
377
                        var found_status = modify_holds_form.find("#found_status").val();
378
                        if( found_status.length > 0 ){
379
                            var filters = [{"-in": found_status}];
380
                            if(jQuery.inArray("NULL", found_status) !== -1){
381
                                filters.push({"=": null});
382
                            }
383
                            searchpattern += _("found status in ");
384
                            $.each(found_status, function(key, value) {
385
                                let status = _("No status ");
386
                                if ( value == "T" ) {
387
                                    status = _("In transit ");
388
                                } else if( value == "P" ) {
389
                                    status = _("In processing ");
390
                                } else if( value == "W" ) {
391
                                    status = _("Waiting ");
392
                                }
393
                                searchpattern += status;
394
                            });
395
                            return filters;
396
                        }
397
                    },
398
                    "me.suspended": function(){
399
                        var suspend_status = modify_holds_form.find("#suspend_status").val();
337
400
338
                $("#edit_search").on("click", function(e){
401
                        if(suspend_status != "none"){
339
                    e.preventDefault();
402
                            var suspended_text = suspend_status == 0 ? _("Not suspended") : _("Suspended");
340
                    $('#modify_holds_search').show();
403
                            searchpattern += _("with suspend status ") + suspended_text;
341
                    $('#edit_search').hide();
342
                });
343
404
344
                function showHoldSelections( number ){
405
                            return {"=": suspend_status};
345
                    if (number === 0) {
406
                        }
346
                        $("#table_search_selections").hide();
407
                    },
347
                    } else {
408
                    "me.suspend_until": function(){
348
                        $("#table_search_selections")
409
                        var suspend_until_from = modify_holds_form.find("#suspend_until_from").val();
349
                            .show()
410
                        var suspend_until_to   = modify_holds_form.find("#suspend_until_to").val();
350
                            .find("span")
411
351
                            .text(_("Holds selected: %s").format(number));
412
                        if (suspend_until_from && suspend_until_to){
413
                            searchpattern += _("suspend date between ") + suspend_until_from + " and " + suspend_until_to + " ";
414
                            return {"-between": [suspend_until_from, suspend_until_to]};
415
                        }
416
                        else if (suspend_until_from && !suspend_until_to){
417
                            searchpattern += _("suspend date from ") + suspend_until_from + " ";
418
                            return {">=": suspend_until_from };
419
                        } else if (!suspend_until_from && suspend_until_to){
420
                            searchpattern += _("suspend date to ") + suspend_until_to + " ";
421
                            return {"<=": suspend_until_to };
422
                        }
423
                    },
424
                    "me.notes": function(){
425
                        var holdnotes = modify_holds_form.find("#holdnotes").val();
426
427
                        searchpattern += holdnotes ? _("hold notes like ") + holdnotes : "";
428
429
                        return holdnotes ? {"-like": "%"+holdnotes+"%"} : "";
430
                    },
431
                    "me.hold_id": function(){
432
                        return hold_ids_from_sql.length > 0 ? { "-in": hold_ids_from_sql } : "";
352
                    }
433
                    }
353
                }
434
                }
354
435
355
                function search_holds(modify_holds_form){
436
                var holds_modify_table = $("#holds_to_modify").kohaTable({
356
                    var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_hold_modification', 'holds_to_modify', 'json' ) | $raw %];
437
                    ajax: {
357
                    var searchpattern = "";
438
                        "url": "/api/v1/holds"
358
                    var filters = {
439
                    },
359
                        "me.expirationdate": function(){
440
                    embed: [
360
                            var expirationdate_from = modify_holds_form.find("#expirationdate_from").val();
441
                        "biblio",
361
                            var expirationdate_to   = modify_holds_form.find("#expirationdate_to").val();
442
                        "item",
362
443
                        "pickup_library",
363
                            if (expirationdate_from && expirationdate_to){
444
                        "patron"
364
                                searchpattern += _("expiration date between ") + expirationdate_from + " and " + expirationdate_to + " ";
445
                    ],
365
                                return {"-between": [expirationdate_from, expirationdate_to]};
446
                    destroy: true,
447
                    autoWidth: false,
448
                    processing: true,
449
                    order: [
450
                        [1, 'asc']
451
                    ],
452
                    columns: [
453
                        {
454
                            "data": "hold_id",
455
                            "name": "checkbox",
456
                            "orderable": false,
457
                            "render": function(data, type, row, meta) {
458
                                return '<input class="selection" type="checkbox" value="'+ encodeURIComponent(data) +'"/>'
366
                            }
459
                            }
367
                            else if (expirationdate_from && !expirationdate_to){
460
                        },
368
                                searchpattern += _("expiration date from ") + expirationdate_from + " ";
461
                        {
369
                                return {">=": expirationdate_from };
462
                            "data": "hold_date",
370
                            } else if (!expirationdate_from && expirationdate_to){
463
                            "name": "hold_date",
371
                                searchpattern += _("expiration date to ") + expirationdate_to + " ";
464
                            "type": "date",
372
                                return {"<=": expirationdate_to };
465
                            "title": _("Hold date"),
466
                            "orderable": true,
467
                            "render": function( data, type, row, meta ) {
468
                                return $date(data);
469
                            }
470
                        },
471
                        {
472
                            "data": "expiration_date",
473
                            "name": "expiration_date",
474
                            "type": "date",
475
                            "title": _("Expiration date"),
476
                            "orderable": true,
477
                            "render": function( data, type, row, meta ) {
478
                                return $date(data);
373
                            }
479
                            }
374
                        },
480
                        },
375
                        "me.branchcode": function(){
481
                        {
376
                            var branchcodes = modify_holds_form.find("#branchcodes").val();
482
                            "data": "biblio.title:biblio.subtitle:biblio.medium",
377
                            if( branchcodes.length > 0 ){
483
                            "title": _("Title"),
378
                                searchpattern += _("from libraries ");
484
                            "searchable": true,
379
                                var selected_libraries = modify_holds_form.find("#branchcodes option:selected");
485
                            "orderable": true,
380
                                $.each(selected_libraries, function(key, value) {
486
                            "render": function(data, type, row, meta) {
381
                                    searchpattern += value.text + " ";
487
                                return $biblio_to_html(row.biblio, { link: 1 });
382
                                });
383
                                return {"-in": branchcodes };
384
                            }
488
                            }
385
                        },
489
                        },
386
                        "me.status": function(){
490
                        {
387
                            var found_status = modify_holds_form.find("#found_status").val();
491
                            "data": "item.external_id",
388
                            if( found_status.length > 0 ){
492
                            "name": "barcode",
389
                                var filters = [{"-in": found_status}];
493
                            "title": _("Barcode"),
390
                                if(jQuery.inArray("NULL", found_status) !== -1){
494
                            "defaultContent": _(""),
391
                                    filters.push({"=": null});
495
                            "orderable": true,
496
                            "render": function( data, type, row, meta ) {
497
                                if( row.item ){
498
                                    let item_id = encodeURIComponent( row.item_id );
499
                                    let biblio_id = encodeURIComponent( row.biblio_id );
500
                                    return '<a href="/cgi-bin/koha/catalogue/moredetail.pl?' +
501
                                    'itemnumber='+ item_id +'&biblionumber='+ biblio_id +'&' +
502
                                    'bi='+ biblio_id +'#item'+ item_id +'">' + escape_str( data ) + '</a>'
392
                                }
503
                                }
393
                                searchpattern += _("found status in ");
394
                                $.each(found_status, function(key, value) {
395
                                    let status = _("No status ");
396
                                    if ( value == "T" ) {
397
                                        status = _("In transit ");
398
                                    } else if( value == "P" ) {
399
                                        status = _("In processing ");
400
                                    } else if( value == "W" ) {
401
                                        status = _("Waiting ");
402
                                    }
403
                                    searchpattern += status;
404
                                });
405
                                return filters;
406
                            }
504
                            }
407
                        },
505
                        },
408
                        "me.suspended": function(){
506
                        {
409
                            var suspend_status = modify_holds_form.find("#suspend_status").val();
507
                            "data": "patron_id",
410
508
                            "name": "patron",
411
                            if(suspend_status != "none"){
509
                            "title": _("Patron"),
412
                                var suspended_text = suspend_status == 0 ? _("Not suspended") : _("Suspended");
510
                            "orderable": true,
413
                                searchpattern += _("with suspend status ") + suspended_text;
511
                            "render": function( data, type, row, meta ) {
414
512
                                let patron_to_html = $patron_to_html(row.patron, { url: true, display_cardnumber: true, hide_patron_name });
415
                                return {"=": suspend_status};
513
                                return patron_to_html;
416
                            }
514
                            }
417
                        },
515
                        },
418
                        "me.suspend_until": function(){
516
                        {
419
                            var suspend_until_from = modify_holds_form.find("#suspend_until_from").val();
517
                            "data": "status",
420
                            var suspend_until_to   = modify_holds_form.find("#suspend_until_to").val();
518
                            "name": "status",
421
519
                            "title": _("Status"),
422
                            if (suspend_until_from && suspend_until_to){
520
                            "className": "found_status",
423
                                searchpattern += _("suspend date between ") + suspend_until_from + " and " + suspend_until_to + " ";
521
                            "orderable": true,
424
                                return {"-between": [suspend_until_from, suspend_until_to]};
522
                            "render": function( data, type, row, meta ) {
523
                                let status = _("No status");
524
                                if ( data == "T" ) {
525
                                    status = _("In transit");
526
                                } else if( data == "P" ) {
527
                                    status = _("In processing");
528
                                } else if( data == "W" ) {
529
                                    status = _("Waiting");
530
                                }
531
                                return "<span data-found-status='" + escape_str( data ) + "'>" + status + "</span>";
425
                            }
532
                            }
426
                            else if (suspend_until_from && !suspend_until_to){
533
                        },
427
                                searchpattern += _("suspend date from ") + suspend_until_from + " ";
534
                        {
428
                                return {">=": suspend_until_from };
535
                            "data": "pickup_library_id",
429
                            } else if (!suspend_until_from && suspend_until_to){
536
                            "name": "pickup_library",
430
                                searchpattern += _("suspend date to ") + suspend_until_to + " ";
537
                            "title": _("Hold pickup library"),
431
                                return {"<=": suspend_until_to };
538
                            "orderable": true,
539
                            "render": function( data, type, row, meta ) {
540
                                return escape_str( row.pickup_library.name );
432
                            }
541
                            }
433
                        },
542
                        },
434
                        "me.notes": function(){
543
                        {
435
                            var holdnotes = modify_holds_form.find("#holdnotes").val();
544
                            "data": "suspended",
436
545
                            "name": "suspended",
437
                            searchpattern += holdnotes ? _("hold notes like ") + holdnotes : "";
546
                            "className": "suspended",
438
547
                            "title": _("Suspended"),
439
                            return holdnotes ? {"-like": "%"+holdnotes+"%"} : "";
548
                            "orderable": true,
549
                            "render": function( data, type, row, meta ) {
550
                                var suspended_string = data == 0 ? _("No") : _("Yes");
551
                                return "<span data-suspended='" + data + "'>" + suspended_string + "</span>";
552
                            }
440
                        },
553
                        },
441
                        "me.hold_id": function(){
554
                        {
442
                            return hold_ids_from_sql.length > 0 ? { "-in": hold_ids_from_sql } : "";
555
                            "data": "suspended_until",
443
                        }
556
                            "name": "suspended_until",
444
                    }
557
                            "title": _("Suspended until"),
445
558
                            "orderable": true,
446
                    var holds_modify_table = $("#holds_to_modify").kohaTable({
559
                            "render": function( data, type, row, meta ) {
447
                        ajax: {
560
                                return $date( data );
448
                            "url": "/api/v1/holds"
561
                            }
449
                        },
562
                        },
450
                        embed: [
563
                        {
451
                            "biblio",
564
                            "data": "notes",
452
                            "item",
565
                            "name": "notes",
453
                            "pickup_library",
566
                            "title": _("Notes"),
454
                            "patron"
567
                            "orderable": true,
455
                        ],
568
                            "render": function( data, type, row, meta ) {
456
                        destroy: true,
569
                                return escape_str( data );
457
                        autoWidth: false,
458
                        processing: true,
459
                        order: [
460
                            [1, 'asc']
461
                        ],
462
                        columns: [
463
                            {
464
                                "data": "hold_id",
465
                                "name": "checkbox",
466
                                "orderable": false,
467
                                "render": function(data, type, row, meta) {
468
                                    return '<input class="selection" type="checkbox" value="'+ encodeURIComponent(data) +'"/>'
469
                                }
470
                            },
471
                            {
472
                                "data": "hold_date",
473
                                "name": "hold_date",
474
                                "type": "date",
475
                                "title": _("Hold date"),
476
                                "orderable": true,
477
                                "render": function( data, type, row, meta ) {
478
                                    return $date(data);
479
                                }
480
                            },
481
                            {
482
                                "data": "expiration_date",
483
                                "name": "expiration_date",
484
                                "type": "date",
485
                                "title": _("Expiration date"),
486
                                "orderable": true,
487
                                "render": function( data, type, row, meta ) {
488
                                    return $date(data);
489
                                }
490
                            },
491
                            {
492
                                "data": "biblio.title:biblio.subtitle:biblio.medium",
493
                                "title": _("Title"),
494
                                "searchable": true,
495
                                "orderable": true,
496
                                "render": function(data, type, row, meta) {
497
                                    return $biblio_to_html(row.biblio, { link: 1 });
498
                                }
499
                            },
500
                            {
501
                                "data": "item.external_id",
502
                                "name": "barcode",
503
                                "title": _("Barcode"),
504
                                "defaultContent": _(""),
505
                                "orderable": true,
506
                                "render": function( data, type, row, meta ) {
507
                                    if( row.item ){
508
                                        let item_id = encodeURIComponent( row.item_id );
509
                                        let biblio_id = encodeURIComponent( row.biblio_id );
510
                                        return '<a href="/cgi-bin/koha/catalogue/moredetail.pl?' +
511
                                        'itemnumber='+ item_id +'&biblionumber='+ biblio_id +'&' +
512
                                        'bi='+ biblio_id +'#item'+ item_id +'">' + escape_str( data ) + '</a>'
513
                                    }
514
                                }
515
                            },
516
                            {
517
                                "data": "patron_id",
518
                                "name": "patron",
519
                                "title": _("Patron"),
520
                                "orderable": true,
521
                                "render": function( data, type, row, meta ) {
522
                                    let patron_to_html = $patron_to_html(row.patron, { url: true, display_cardnumber: true, hide_patron_name });
523
                                    return patron_to_html;
524
                                }
525
                            },
526
                            {
527
                                "data": "status",
528
                                "name": "status",
529
                                "title": _("Status"),
530
                                "className": "found_status",
531
                                "orderable": true,
532
                                "render": function( data, type, row, meta ) {
533
                                    let status = _("No status");
534
                                    if ( data == "T" ) {
535
                                        status = _("In transit");
536
                                    } else if( data == "P" ) {
537
                                        status = _("In processing");
538
                                    } else if( data == "W" ) {
539
                                        status = _("Waiting");
540
                                    }
541
                                    return "<span data-found-status='" + escape_str( data ) + "'>" + status + "</span>";
542
                                }
543
                            },
544
                            {
545
                                "data": "pickup_library_id",
546
                                "name": "pickup_library",
547
                                "title": _("Hold pickup library"),
548
                                "orderable": true,
549
                                "render": function( data, type, row, meta ) {
550
                                    return escape_str( row.pickup_library.name );
551
                                }
552
                            },
553
                            {
554
                                "data": "suspended",
555
                                "name": "suspended",
556
                                "className": "suspended",
557
                                "title": _("Suspended"),
558
                                "orderable": true,
559
                                "render": function( data, type, row, meta ) {
560
                                    var suspended_string = data == 0 ? _("No") : _("Yes");
561
                                    return "<span data-suspended='" + data + "'>" + suspended_string + "</span>";
562
                                }
563
                            },
564
                            {
565
                                "data": "suspended_until",
566
                                "name": "suspended_until",
567
                                "title": _("Suspended until"),
568
                                "orderable": true,
569
                                "render": function( data, type, row, meta ) {
570
                                    return $date( data );
571
                                }
572
                            },
573
                            {
574
                                "data": "notes",
575
                                "name": "notes",
576
                                "title": _("Notes"),
577
                                "orderable": true,
578
                                "render": function( data, type, row, meta ) {
579
                                    return escape_str( data );
580
                                }
581
                            }
570
                            }
582
                        ],
571
                        }
583
                    }, table_settings, 0, filters);
572
                    ],
573
                }, table_settings, 0, filters);
584
574
585
                    $(".searchpattern").text(searchpattern);
575
                $(".searchpattern").text(searchpattern);
586
576
587
                    $("#modify_holds_results-wrapper").show();
577
                $("#modify_holds_results-wrapper").show();
588
                }
578
            }
589
579
590
                $("#process_mods").on('submit', function(e) {
580
            $("#process_mods").on('submit', function(e) {
591
581
592
                    var hold_ids = JSON.parse( localStorage.getItem("holds_modify_selections") ) || [];
582
                var hold_ids = JSON.parse( localStorage.getItem("holds_modify_selections") ) || [];
593
583
594
                    $("#process_mods input[name='hold_id']").remove();
584
                $("#process_mods input[name='hold_id']").remove();
595
585
596
                    hold_ids.forEach(function(hold) {
586
                hold_ids.forEach(function(hold) {
597
                        $('<input>').attr({
587
                    $('<input>').attr({
598
                            type: 'hidden',
588
                        type: 'hidden',
599
                            name: 'hold_id',
589
                        name: 'hold_id',
600
                            value: hold.hold_id
590
                        value: hold.hold_id
601
                        }).appendTo('#process_mods');
591
                    }).appendTo('#process_mods');
602
                    });
592
                });
603
604
                    var errors = [];
605
593
606
                    var new_expiration_date = $("#new_expiration_date").val();
594
                var errors = [];
607
                    var new_pickup_loc      = $("#new_pickup_loc").val();
608
                    var new_suspend_status  = $("#new_suspend_status").val();
609
                    var new_suspend_date    = $("#new_suspend_date").val();
610
                    var new_hold_note       = $("#new_hold_note").val();
611
                    var clear_hold_notes    = $("#clear_hold_notes").val();
612
595
613
                    if ( hold_ids.length == 0 ) {
596
                var new_expiration_date = $("#new_expiration_date").val();
614
                        e.preventDefault();
597
                var new_pickup_loc      = $("#new_pickup_loc").val();
615
                        errors.push(_("Please select at least one hold to process."));
598
                var new_suspend_status  = $("#new_suspend_status").val();
616
                    }
599
                var new_suspend_date    = $("#new_suspend_date").val();
600
                var new_hold_note       = $("#new_hold_note").val();
601
                var clear_hold_notes    = $("#clear_hold_notes").val();
617
602
618
                    if( new_pickup_loc || new_suspend_status || new_suspend_date ){
603
                if ( hold_ids.length == 0 ) {
619
                        var found = false;
604
                    e.preventDefault();
620
                        hold_ids.forEach(function(hold){
605
                    errors.push(_("Please select at least one hold to process."));
621
                            if( hold.found_status ){
606
                }
622
                                e.preventDefault();
623
                                found = true;
624
                            }
625
                        });
626
                        if( ( new_suspend_status || new_suspend_date ) && found ){
627
                            errors.push(_("One or more holds have found status and can't be suspended."));
628
                        }
629
                        if( new_pickup_loc && found ){
630
                            errors.push(_("One or more holds have found status and their pick up location can't be changed."));
631
                        }
632
                    }
633
634
                    var suspended = false;
635
607
608
                if( new_pickup_loc || new_suspend_status || new_suspend_date ){
609
                    var found = false;
636
                    hold_ids.forEach(function(hold){
610
                    hold_ids.forEach(function(hold){
637
                        if( hold.suspened ){
611
                        if( hold.found_status ){
638
                            suspended = true;
612
                            e.preventDefault();
613
                            found = true;
639
                        }
614
                        }
640
                    });
615
                    });
641
616
                    if( ( new_suspend_status || new_suspend_date ) && found ){
642
                    if( ( !new_suspend_status || new_suspend_status == "0" || !suspended ) && new_suspend_date ){
617
                        errors.push(_("One or more holds have found status and can't be suspended."));
643
                        new_suspend_status = 1;
618
                    }
619
                    if( new_pickup_loc && found ){
620
                        errors.push(_("One or more holds have found status and their pick up location can't be changed."));
644
                    }
621
                    }
622
                }
623
624
                var suspended = false;
645
625
646
                    if (errors.length > 0) {
626
                hold_ids.forEach(function(hold){
647
                        e.preventDefault();
627
                    if( hold.suspened ){
648
                        $("#errorList").html(errors.map(error => `<li>${error}</li>`).join(""));
628
                        suspended = true;
649
                        $("#errorModal").modal('show');
650
                        return false;
651
                    }
629
                    }
652
                    return true;
653
                });
630
                });
654
631
655
                //Modified holds table
632
                if( ( !new_suspend_status || new_suspend_status == "0" || !suspended ) && new_suspend_date ){
656
                var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'modified_holds', 'json' ) | $raw %];
633
                    new_suspend_status = 1;
657
                $("#modified_holds").kohaTable({
634
                }
658
                    pagingType: "full",
659
                    autoWidth: false
660
                }, table_settings);
661
635
636
                if (errors.length > 0) {
637
                    e.preventDefault();
638
                    $("#errorList").html(errors.map(error => `<li>${error}</li>`).join(""));
639
                    $("#errorModal").modal('show');
640
                    return false;
641
                }
642
                return true;
662
            });
643
            });
663
        </script>
664
    [% END %]
665
644
666
    [% INCLUDE 'intranet-bottom.inc' %]
645
            //Modified holds table
667
</div>
646
            var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'modified_holds', 'json' ) | $raw %];
647
            $("#modified_holds").kohaTable({
648
                pagingType: "full",
649
                autoWidth: false
650
            }, table_settings);
651
652
        });
653
    </script>
654
[% END %]
655
[% INCLUDE 'intranet-bottom.inc' %]
668
- 

Return to bug 38739