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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/batch_modify_hold_errors.inc (+17 lines)
Line 0 Link Here
1
<!-- Batch modify hold error modal -->
2
<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel">
3
    <div class="modal-dialog">
4
        <div class="modal-content">
5
            <div class="modal-header">
6
                <h1 class="modal-title" id="errorModalLabel">Errors</h1>
7
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
8
            </div>
9
            <div class="modal-body">
10
                <ul id="errorList"></ul>
11
            </div>
12
            <div class="modal-footer">
13
                <button type="button" class="btn btn-primary" data-bs-dismiss="modal">OK</button>
14
            </div>
15
        </div>
16
    </div>
17
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-4 / +31 lines)
Lines 1071-1076 Link Here
1071
                                    >
1071
                                    >
1072
                                </form>
1072
                                </form>
1073
1073
1074
                                <form method="get" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="batch_modify_holds">
1075
                                    <input type="hidden" name="op" value="list" />
1076
                                    [% FOREACH result IN results %]
1077
                                        [% FOREACH cells IN result.cells %]
1078
                                            [% place = loop.index %]
1079
                                            [% IF header_row.$place.cell == 'reserve_id' || header_types.item(header_row.$place.cell) == 'reserve_id' %]
1080
                                                [% SET batch_reserve_ids = 1 %]
1081
                                                <input type="hidden" name="reserve_ids" value="[% cells.cell | html %]" />
1082
                                            [% END %]
1083
                                        [% END %]
1084
                                    [% END %]
1085
                                </form>
1086
1074
                                [% BLOCK batch_list %]
1087
                                [% BLOCK batch_list %]
1075
                                    [%- FOREACH result IN results %]
1088
                                    [%- FOREACH result IN results %]
1076
                                        [%- FOREACH cells IN result.cells %]
1089
                                        [%- FOREACH cells IN result.cells %]
Lines 1095-1103 Link Here
1095
                                </form>
1108
                                </form>
1096
                                <!-- /#limitselect -->
1109
                                <!-- /#limitselect -->
1097
1110
1098
                                [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers ) || ( unlimited_total > 10 && limit <= 1000 ) %]
1111
                                [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) || ( unlimited_total > 10 && limit <= 1000 ) %]
1099
                                    <div id="toolbar" class="btn-toolbar">
1112
                                    <div id="toolbar" class="btn-toolbar">
1100
                                        [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers ) %]
1113
                                        [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) %]
1101
                                            <div class="btn-group">
1114
                                            <div class="btn-group">
1102
                                                <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="batch_mod_menu" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
1115
                                                <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="batch_mod_menu" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
1103
                                                    Batch operations with [% IF unlimited_total >= limit %][% results.size | html %][% ELSE %][% unlimited_total | html %][% END %] visible records
1116
                                                    Batch operations with [% IF unlimited_total >= limit %][% results.size | html %][% ELSE %][% unlimited_total | html %][% END %] visible records
Lines 1205-1216 Link Here
1205
                                                                >
1218
                                                                >
1206
                                                            </li>
1219
                                                            </li>
1207
                                                        [% END %]
1220
                                                        [% END %]
1221
                                                        [% IF header_ro.cell == 'reserve_id' || header_types.item( header_ro.cell ) == 'reserve_id' %]
1222
                                                            <li class="dropdown-header">Hold records</li>
1223
                                                            <li>
1224
                                                                <a
1225
                                                                    href="#"
1226
                                                                    data-submit="batch_modify_holds"
1227
                                                                    data-toggle="tooltip"
1228
                                                                    data-placement="right"
1229
                                                                    title="Send visible results to batch hold modification"
1230
                                                                    class="batch_op send_to_hold_mod"
1231
                                                                    >Batch hold modification</a
1232
                                                                >
1233
                                                            </li>
1234
                                                        [% END %]
1208
                                                    [% END # /FOREACH header_ro %]
1235
                                                    [% END # /FOREACH header_ro %]
1209
                                                </ul>
1236
                                                </ul>
1210
                                                <!-- /.dropdown-menu -->
1237
                                                <!-- /.dropdown-menu -->
1211
                                            </div>
1238
                                            </div>
1212
                                            <!-- /.dropdown -->
1239
                                            <!-- /.dropdown -->
1213
                                        [% END # /IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) %]
1240
                                        [% END # /IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids ) %]
1214
1241
1215
                                        [% IF ( unlimited_total > 10 && limit <= 1000 ) %]
1242
                                        [% IF ( unlimited_total > 10 && limit <= 1000 ) %]
1216
                                            <div class="btn-group">
1243
                                            <div class="btn-group">
Lines 1238-1244 Link Here
1238
                                            </div>
1265
                                            </div>
1239
                                        [% END # /IF ( unlimited_total > 10 && limit <= 1000 ) %]
1266
                                        [% END # /IF ( unlimited_total > 10 && limit <= 1000 ) %]
1240
1267
1241
                                        [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) %]
1268
                                        [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids ) %]
1242
                                            <a href="#" class="btn btn-link" id="toggle_auto_links">
1269
                                            <a href="#" class="btn btn-link" id="toggle_auto_links">
1243
                                                <i class="fa-solid fa-eye autolink" aria-hidden="true" style="display:none"></i>
1270
                                                <i class="fa-solid fa-eye autolink" aria-hidden="true" style="display:none"></i>
1244
                                                <i class="fa-solid fa-eye-slash autolink" aria-hidden="true"></i>
1271
                                                <i class="fa-solid fa-eye-slash autolink" aria-hidden="true"></i>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt (-85 / +103 lines)
Lines 14-67 Link Here
14
</head>
14
</head>
15
15
16
<body id="tools_batch_extend_due_dates" class="tools">
16
<body id="tools_batch_extend_due_dates" class="tools">
17
    [% WRAPPER 'header.inc' %]
17
[% WRAPPER 'header.inc' %]
18
    [% INCLUDE 'cat-search.inc' %]
18
    [% INCLUDE 'cat-search.inc' %]
19
    [% INCLUDE modals/batch_modify_hold_errors.inc %]
19
[% END %]
20
[% END %]
20
21
[% WRAPPER 'sub-header.inc' %]
21
    [% WRAPPER 'sub-header.inc' %]
22
    [% WRAPPER breadcrumbs %]
22
    <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23
        [% WRAPPER breadcrumb_item %]
23
        <ol>
24
            <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
24
            <li>
25
        [% END %]
25
                <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26
        [% IF ( view == 'form' || view == 'report' ) %]
26
            </li>
27
            [% WRAPPER breadcrumb_item %]
27
            <li>
28
                <a href="/cgi-bin/koha/tools/batch_modify_holds.pl">Batch modify holds</a>
28
                <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
29
            [% END %]
29
            </li>
30
        [% ELSE %]
30
            <li>
31
            [% WRAPPER breadcrumb_item bc_active= 1 %]
31
                <a href="#" aria-current="page">Batch modify holds</a>
32
                <span>Batch modify holds</span>
32
            </li>
33
            [% END %]
33
        </ol>
34
        [% END %]
34
    </nav>
35
    [% END #/ WRAPPER breadcrumbs %]
35
    [% END %]
36
[% END #/ WRAPPER sub-header.inc %]
36
37
37
    <div class="main container-fluid">
38
    <div class="main container-fluid">
38
        <div class="row">
39
        <div class="row">
39
            <div class="col-sm-10 col-sm-push-2">
40
            <div class="col-sm-10 order-md-2 order-sm-1">
40
                <main>
41
                <main>
41
42
42
                    <h1>Batch modify holds</h1>
43
                    <h1>Batch modify holds</h1>
43
44
44
                    [% IF view == 'form' %]
45
                    [% IF view == 'form' %]
45
                        <form method="post" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="modify_holds_form">
46
                        <form method="get" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="modify_holds_form">
46
                            <fieldset class="rows">
47
                            <fieldset class="rows">
47
                                <legend>Hold search criteria:</legend>
48
                                <legend>Hold search criteria:</legend>
48
                                <span class="hint">NOTE! Column patron_expiration_date is used as a main filter for expiration date field. Otherwise column expirationdate is used.</span>
49
                                <span class="hint">NOTE! Column patron_expiration_date is used as a main filter for expiration date field. Otherwise column expirationdate is used.</span>
49
                                <ol>
50
                                <ol>
50
                                    <li>
51
                                    <li>
51
                                        <label for="suspend_until">Expiration date:</label>
52
                                        <label for="expirationdate_from">Expiration date from:</label>
52
                                        <li>
53
                                        <input type="text" size="10" id="expirationdate_from" name="expirationdate_from" class="flatpickr" data-date_to="to" />
53
                                            <label for="expirationdate_from">From</label>
54
                                    </li>
54
                                            <input type="text" size="10" id="from" name="expirationdate_from" class="flatpickr" data-date_to="to" />
55
                                    <li>
55
                                        </li>
56
                                        <label for="expirationdate_to">Expiration date to:</label>
56
                                        <li>
57
                                        <input type="text" size="10" id="expirationdate_to" name="expirationdate_to" class="flatpickr"/>
57
                                            <label for="expirationdate_to">To</label>
58
                                            <input type="text" size="10" id="to" name="expirationdate_to" class="flatpickr"/>
59
                                        </li>
60
                                    </li>
58
                                    </li>
61
                                    <li>
59
                                    <li>
62
                                        <label for="branchcodes">Libraries:</label>
60
                                        <label for="branchcodes">Libraries:</label>
63
                                        <select name="branchcodes" id="branchcodes" multiple="multiple">
61
                                        <select name="branchcodes" id="branchcodes" multiple="multiple">
64
                                            [% PROCESS options_for_libraries libraries => Branches.all() %]
62
                                            [% PROCESS options_for_libraries libraries => Branches.all(selected => "") %]
65
                                        </select>
63
                                        </select>
66
                                    </li>
64
                                    </li>
67
                                    <li>
65
                                    <li>
Lines 82-96 Link Here
82
                                        </select>
80
                                        </select>
83
                                    </li>
81
                                    </li>
84
                                    <li>
82
                                    <li>
85
                                        <label for="suspend_until">Suspended until:</label>
83
                                        <label for="suspend_until_from">Suspended until from:</label>
86
                                        <li>
84
                                        <input type="text" size="10" id="suspend_until_from" name="suspend_until_from" class="flatpickr" data-date_to="to" />
87
                                            <label for="suspend_until_from">From</label>
85
                                    </li>
88
                                            <input type="text" size="10" id="from" name="suspend_until_from" class="flatpickr" data-date_to="to" />
86
                                    <li>
89
                                        </li>
87
                                        <label for="suspend_until_to">Suspended until to:</label>
90
                                        <li>
88
                                        <input type="text" size="10" id="suspend_until_to" name="suspend_until_to" class="flatpickr"/>
91
                                            <label for="suspend_until_to">To</label>
92
                                            <input type="text" size="10" id="to" name="suspend_until_to" class="flatpickr"/>
93
                                        </li>
94
                                    </li>
89
                                    </li>
95
                                    <li>
90
                                    <li>
96
                                        <label for="reservenotes">Hold note:</label>
91
                                        <label for="reservenotes">Hold note:</label>
Lines 106-112 Link Here
106
                        </form> <!-- /#modify_holds_form -->
101
                        </form> <!-- /#modify_holds_form -->
107
                    [% ELSIF view == 'list' %]
102
                    [% ELSIF view == 'list' %]
108
                        <form action="/cgi-bin/koha/tools/batch_modify_holds.pl" method="post" id="process">
103
                        <form action="/cgi-bin/koha/tools/batch_modify_holds.pl" method="post" id="process">
104
                        [% INCLUDE 'csrf-token.inc' %]
109
                        [% IF holds.count %]
105
                        [% IF holds.count %]
106
                            <div><p>Found [% holds.count | html %][% IF holds.count > 1 %] holds [% ELSE %] hold [% END %]to modify.</p></div>
110
                            <div class="page-section">
107
                            <div class="page-section">
111
                                <div class="btn-toolbar selections-toolbar">
108
                                <div class="btn-toolbar selections-toolbar">
112
                                    <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
109
                                    <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
Lines 118-123 Link Here
118
                                            <th>&nbsp;</th>
115
                                            <th>&nbsp;</th>
119
                                            <th>Expiration date</th>
116
                                            <th>Expiration date</th>
120
                                            <th>Patron expiration date</th>
117
                                            <th>Patron expiration date</th>
118
                                            <th>Title</th>
119
                                            <th>Barcode</th>
121
                                            <th>Status</th>
120
                                            <th>Status</th>
122
                                            <th>Hold pickup library</th>
121
                                            <th>Hold pickup library</th>
123
                                            <th>Suspended</th>
122
                                            <th>Suspended</th>
Lines 131-136 Link Here
131
                                                <td><input type="checkbox" name="hold_id" value="[% hold.reserve_id | html %]"/></td>
130
                                                <td><input type="checkbox" name="hold_id" value="[% hold.reserve_id | html %]"/></td>
132
                                                <td>[% hold.expirationdate | $KohaDates %]</td>
131
                                                <td>[% hold.expirationdate | $KohaDates %]</td>
133
                                                <td>[% hold.patron_expiration_date | $KohaDates %]</td>
132
                                                <td>[% hold.patron_expiration_date | $KohaDates %]</td>
133
                                                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">[% hold.biblio.title | html %]</a></td>
134
                                                <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% hold.itemnumber | uri %]&biblionumber=[% hold.biblionumber | uri %]&bi=[% hold.biblionumber | uri %]#item[% hold.itemnumber | uri %]">[% hold.item.barcode | html %]</a></td>
134
                                                <td class="found_status" data-found="[% hold.found | html %]">
135
                                                <td class="found_status" data-found="[% hold.found | html %]">
135
                                                    [% IF hold.found == "T" %]
136
                                                    [% IF hold.found == "T" %]
136
                                                        In transit
137
                                                        In transit
Lines 152-195 Link Here
152
                                </table> <!-- /#holds -->
153
                                </table> <!-- /#holds -->
153
                            </div> <!-- /.page-section -->
154
                            </div> <!-- /.page-section -->
154
                            <h2>Modify holds</h2>
155
                            <h2>Modify holds</h2>
155
                            <table id="hold_modifies">
156
                            <div class="page-section">
156
                                <thead>
157
                                <table id="hold_modifies">
157
                                    <tr>
158
                                    <thead>
158
                                        <th>New expiration date</th>
159
                                        <tr>
159
                                        <th>New pickup library</th>
160
                                            <th>New expiration date</th>
160
                                        <th>Suspend holds</th>
161
                                            <th>New pickup library</th>
161
                                        <th>Suspend until</th>
162
                                            <th>Suspend holds</th>
162
                                        <th>New reserve note</th>
163
                                            <th>Suspend until</th>
163
                                    </tr>
164
                                            <th>New reserve note</th>
164
                                </thead>
165
                                        </tr>
165
                                <tbody>
166
                                    </thead>
166
                                    <tr>
167
                                    <tbody>
167
                                        <td>
168
                                        <tr>
168
                                            <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true"/>
169
                                            <td>
169
                                        </td>
170
                                                <input type="text" id="new_expiration_date" name="new_expiration_date" class="flatpickr" data-flatpickr-futuredate="true"/>
170
                                        <td>
171
                                            </td>
171
                                            <select name="new_pickup_loc" id="new_pickup_loc">
172
                                            <td>
172
                                                [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ selected => hold.branchcode }) %]
173
                                                <select id="new_pickup_loc" name="new_pickup_loc">
173
                                            </select>
174
                                                    <option value="" selected="selected"></option>
174
                                        </td>
175
                                                    [% PROCESS options_for_libraries libraries => Branches.pickup_locations(selected = "") %]
175
                                        <td>
176
                                                </select>
176
                                            <select id="new_suspend_status" name="new_suspend_status">
177
                                            </td>
177
                                                <option value="" selected="selected"></option>
178
                                            <td>
178
                                                <option value="not_suspended">Not suspended</option>
179
                                                <select id="new_suspend_status" name="new_suspend_status">
179
                                                <option value="suspend">Suspend</option>
180
                                                    <option value="" selected="selected"></option>
180
                                            </select>
181
                                                    <option value="not_suspended">Not suspended</option>
181
                                        </td>
182
                                                    <option value="suspend">Suspend</option>
182
                                        <td>
183
                                                </select>
183
                                            <input type="text" id="new_suspend_date" name="new_suspend_date" class="flatpickr" data-flatpickr-futuredate="true"/>
184
                                            </td>
184
                                        </td>
185
                                            <td>
185
                                        <td>
186
                                                <input type="text" id="new_suspend_date" name="new_suspend_date" class="flatpickr" data-flatpickr-futuredate="true"/>
186
                                           <input type="text" id="new_reserve_note" name="new_reserve_note"/>
187
                                            </td>
187
                                        </td>
188
                                            <td>
188
                                    </tr>
189
                                               <input type="text" id="new_reserve_note" name="new_reserve_note"/>
189
                                </tbody>
190
                                            </td>
190
                            </table> <!-- /#hold_modifies -->
191
                                        </tr>
192
                                    </tbody>
193
                                </table> <!-- /#hold_modifies -->
194
                            </div>
191
                            <fieldset class="action">
195
                            <fieldset class="action">
192
                                <input type="hidden" name="op" value="modify"/>
196
                                <input type="hidden" name="op" value="cud-modify"/>
193
                                <input type="submit" class="btn btn-primary" value="Modify selected holds"/>
197
                                <input type="submit" class="btn btn-primary" value="Modify selected holds"/>
194
                                <a class="cancel" href="/cgi-bin/koha/tools/batch_modify_holds.pl">Cancel</a>
198
                                <a class="cancel" href="/cgi-bin/koha/tools/batch_modify_holds.pl">Cancel</a>
195
                            </fieldset>
199
                            </fieldset>
Lines 202-218 Link Here
202
                        [% END %]
206
                        [% END %]
203
                    [% ELSIF view == 'report' %]
207
                    [% ELSIF view == 'report' %]
204
                        <div class="dialog message">
208
                        <div class="dialog message">
205
                            Holds have been modified!
209
                            [% updated_holds.count | html %] holds have been modified!
206
                        </div>
210
                        </div>
207
                        <div class="page-section">
211
                        <div class="page-section">
208
                            <div class="btn-toolbar selections-toolbar">
209
                                <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
210
                                <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
211
                            </div>
212
                            <table id="holds">
212
                            <table id="holds">
213
                                <thead>
213
                                <thead>
214
                                    <tr>
214
                                    <tr>
215
                                        <th>Expiration date</th>
215
                                        <th>Expiration date</th>
216
                                        <th>Title</th>
217
                                        <th>Barcode</th>
216
                                        <th>Hold pickup library</th>
218
                                        <th>Hold pickup library</th>
217
                                        <th>Suspended</th>
219
                                        <th>Suspended</th>
218
                                        <th>Suspended until</th>
220
                                        <th>Suspended until</th>
Lines 223-228 Link Here
223
                                    [% FOREACH hold IN updated_holds %]
225
                                    [% FOREACH hold IN updated_holds %]
224
                                        <tr>
226
                                        <tr>
225
                                            <td>[% hold.expirationdate | $KohaDates %]</td>
227
                                            <td>[% hold.expirationdate | $KohaDates %]</td>
228
                                            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">[% hold.biblio.title | html %]</a></td>
229
                                            <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% hold.itemnumber | uri %]&biblionumber=[% hold.biblionumber | uri %]&bi=[% hold.biblionumber | uri %]#item[% hold.itemnumber | uri %]">[% hold.item.barcode | html %]</a></td>
226
                                            <td>[% Branches.GetName( hold.branchcode ) | html %]</td>
230
                                            <td>[% Branches.GetName( hold.branchcode ) | html %]</td>
227
                                            <td>[% IF hold.suspend == 0 %]No[% ELSE %]Yes[% END %]</td>
231
                                            <td>[% IF hold.suspend == 0 %]No[% ELSE %]Yes[% END %]</td>
228
                                            <td>[% hold.suspend_until | $KohaDates %]</td>
232
                                            <td>[% hold.suspend_until | $KohaDates %]</td>
Lines 244-250 Link Here
244
                </aside>
248
                </aside>
245
            </div> <!-- /.col-sm-2 col-sm-pull-10 -->
249
            </div> <!-- /.col-sm-2 col-sm-pull-10 -->
246
        </div> <!-- /.row -->
250
        </div> <!-- /.row -->
247
251
    </div>
248
[% MACRO jsinclude BLOCK %]
252
[% MACRO jsinclude BLOCK %]
249
    [% Asset.js("js/tools-menu.js") | $raw %]
253
    [% Asset.js("js/tools-menu.js") | $raw %]
250
    [% INCLUDE 'calendar.inc' %]
254
    [% INCLUDE 'calendar.inc' %]
Lines 279-306 Link Here
279
            }));
283
            }));
280
284
281
            $("#process").on('submit', function(e) {
285
            $("#process").on('submit', function(e) {
286
                var errors = [];
282
                var reserve_ids = $("input[type=checkbox][name='hold_id']:checked");
287
                var reserve_ids = $("input[type=checkbox][name='hold_id']:checked");
283
288
289
                var new_pickup_loc = $("#new_pickup_loc").val();
284
                var new_suspend_status = $("#new_suspend_status").val();
290
                var new_suspend_status = $("#new_suspend_status").val();
285
                var new_suspend_date = $("#new_suspend_date").val();
291
                var new_suspend_date = $("#new_suspend_date").val();
286
292
287
                if ( reserve_ids.length == 0 ) {
293
                if ( reserve_ids.length == 0 ) {
288
                    e.preventDefault();
294
                    e.preventDefault();
289
                    alert(_("Please select at least one hold to process."));
295
                    errors.push(_("Please select at least one hold to process."));
290
                    return false;
296
                    return false;
291
                }
297
                }
292
                if( new_suspend_status ){
298
                if( new_pickup_loc || new_suspend_status ){
293
                    reserve_ids.each(function(){
299
                    reserve_ids.each(function(){
294
                        if($(this).parents("tr").children(".found_status").data("found") != ""){
300
                        if($(this).parents("tr").children(".found_status").data("found") != ""){
295
                            e.preventDefault();
301
                            e.preventDefault();
296
                            alert(_("One or more holds have found status and can't be suspended."));
302
                            if( new_suspend_status ){
303
                                errors.push(_("One or more holds have found status and can't be suspended."));
304
                            }
305
                            if( new_pickup_loc ){
306
                                errors.push(_("One or more holds have found status and their pick up location can't be changed."));
307
                            }
297
                            return false;
308
                            return false;
298
                        }
309
                        }
299
                    })
310
                    })
300
                }
311
                }
301
                if( ( !new_suspend_status || new_suspend_status == "not_suspended") && new_suspend_date ){
312
                if( ( !new_suspend_status || new_suspend_status == "not_suspended") && new_suspend_date ){
302
                    e.preventDefault();
313
                    e.preventDefault();
303
                    alert(_('You have to suspend holds if new suspend until date is set.'));
314
                    errors.push(_("You have to suspend holds if new suspend until date is set."));
315
                    return false;
316
                }
317
318
                if (errors.length > 0) {
319
                    e.preventDefault();
320
                    $("#errorList").html(errors.map(error => `<li>${error}</li>`).join(""));
321
                    $("#errorModal").modal('show');
304
                    return false;
322
                    return false;
305
                }
323
                }
306
324
(-)a/tools/batch_modify_holds.pl (-5 / +8 lines)
Lines 118-124 if ( $op eq 'form' ) { Link Here
118
        }
118
        }
119
    }
119
    }
120
120
121
    my $holds = Koha::Holds->search($search_params);
121
    my $holds = Koha::Holds->search(
122
        $search_params,
123
        { join => [ "item", "biblio" ] }
124
    );
122
125
123
    $template->param(
126
    $template->param(
124
        holds => $holds,
127
        holds => $holds,
Lines 126-132 if ( $op eq 'form' ) { Link Here
126
    );
129
    );
127
}
130
}
128
131
129
if ( $op eq 'modify' ) {
132
if ( $op eq 'cud-modify' ) {
130
133
131
    my $new_expiration_date = $input->param('new_expiration_date');
134
    my $new_expiration_date = $input->param('new_expiration_date');
132
    my $new_pickup_loc      = $input->param('new_pickup_loc');
135
    my $new_pickup_loc      = $input->param('new_pickup_loc');
Lines 136-142 if ( $op eq 'modify' ) { Link Here
136
139
137
    @hold_ids = $input->multi_param('hold_id');
140
    @hold_ids = $input->multi_param('hold_id');
138
141
139
    my $holds_to_update = Koha::Holds->search( { reserve_id => { -in => \@hold_ids } } );
142
    my $holds_to_update =
143
        Koha::Holds->search( { reserve_id => { -in => \@hold_ids } }, { join => [ "item", "biblio" ] } );
140
144
141
    while ( my $hold = $holds_to_update->next ) {
145
    while ( my $hold = $holds_to_update->next ) {
142
146
Lines 144-150 if ( $op eq 'modify' ) { Link Here
144
            $hold->expirationdate($new_expiration_date)->store;
148
            $hold->expirationdate($new_expiration_date)->store;
145
        }
149
        }
146
150
147
        unless ( $hold->branchcode eq $new_pickup_loc ) {
151
        if ( $new_pickup_loc && ( $hold->branchcode ne $new_pickup_loc ) ) {
148
            $hold->branchcode($new_pickup_loc)->store;
152
            $hold->branchcode($new_pickup_loc)->store;
149
        }
153
        }
150
154
151
- 

Return to bug 36135