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/tools/batch_modify_holds.tt (-6 / +13 lines)
Lines 16-21 Link Here
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
21
    [% WRAPPER 'sub-header.inc' %]
22
    [% WRAPPER 'sub-header.inc' %]
Lines 251-257 Link Here
251
                </aside>
252
                </aside>
252
            </div> <!-- /.col-sm-2 col-sm-pull-10 -->
253
            </div> <!-- /.col-sm-2 col-sm-pull-10 -->
253
        </div> <!-- /.row -->
254
        </div> <!-- /.row -->
254
255
[% MACRO jsinclude BLOCK %]
255
[% MACRO jsinclude BLOCK %]
256
    [% Asset.js("js/tools-menu.js") | $raw %]
256
    [% Asset.js("js/tools-menu.js") | $raw %]
257
    [% INCLUDE 'calendar.inc' %]
257
    [% INCLUDE 'calendar.inc' %]
Lines 286-291 Link Here
286
            }));
286
            }));
287
287
288
            $("#process").on('submit', function(e) {
288
            $("#process").on('submit', function(e) {
289
                var errors = [];
289
                var reserve_ids = $("input[type=checkbox][name='hold_id']:checked");
290
                var reserve_ids = $("input[type=checkbox][name='hold_id']:checked");
290
291
291
                var new_pickup_loc = $("#new_pickup_loc").val();
292
                var new_pickup_loc = $("#new_pickup_loc").val();
Lines 294-300 Link Here
294
295
295
                if ( reserve_ids.length == 0 ) {
296
                if ( reserve_ids.length == 0 ) {
296
                    e.preventDefault();
297
                    e.preventDefault();
297
                    alert(_("Please select at least one hold to process."));
298
                    errors.push(_("Please select at least one hold to process."));
298
                    return false;
299
                    return false;
299
                }
300
                }
300
                if( new_pickup_loc || new_suspend_status ){
301
                if( new_pickup_loc || new_suspend_status ){
Lines 302-311 Link Here
302
                        if($(this).parents("tr").children(".found_status").data("found") != ""){
303
                        if($(this).parents("tr").children(".found_status").data("found") != ""){
303
                            e.preventDefault();
304
                            e.preventDefault();
304
                            if( new_suspend_status ){
305
                            if( new_suspend_status ){
305
                                alert(_("One or more holds have found status and can't be suspended."));
306
                                errors.push(_("One or more holds have found status and can't be suspended."));
306
                            }
307
                            }
307
                            if( new_pickup_loc ){
308
                            if( new_pickup_loc ){
308
                                alert(_("One or more holds have found status and their pick up location can't be changed."));
309
                                errors.push(_("One or more holds have found status and their pick up location can't be changed."));
309
                            }
310
                            }
310
                            return false;
311
                            return false;
311
                        }
312
                        }
Lines 313-319 Link Here
313
                }
314
                }
314
                if( ( !new_suspend_status || new_suspend_status == "not_suspended") && new_suspend_date ){
315
                if( ( !new_suspend_status || new_suspend_status == "not_suspended") && new_suspend_date ){
315
                    e.preventDefault();
316
                    e.preventDefault();
316
                    alert(_("You have to suspend holds if new suspend until date is set."));
317
                    errors.push(_("You have to suspend holds if new suspend until date is set."));
318
                    return false;
319
                }
320
321
                if (errors.length > 0) {
322
                    e.preventDefault();
323
                    $("#errorList").html(errors.map(error => `<li>${error}</li>`).join(""));
324
                    $("#errorModal").modal('show');
317
                    return false;
325
                    return false;
318
                }
326
                }
319
327
320
- 

Return to bug 36135