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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transfer_limits.tt (-13 / +21 lines)
Lines 429-447 Link Here
429
            if (val) {
429
            if (val) {
430
                $('#loading_limits').show();
430
                $('#loading_limits').show();
431
431
432
                $.getJSON(url, function(data) {
432
                $.ajax({
433
                    $(".limit-checkboxes").attr("disabled", false);
433
                    dataType: "json",
434
                    $(".limit-checkboxes").attr("checked", true);
434
                    url: url,
435
                    $(".limit-checkboxes").data('limit_id', null);
435
                    success: function(data) {
436
436
                        $(".limit-checkboxes").attr("disabled", false);
437
                    for (var i = 0; i < data.length; i++) {
437
                        $(".limit-checkboxes").attr("checked", true);
438
                        let limit = data[i];
438
                        $(".limit-checkboxes").data('limit_id', null);
439
                        let checkbox = $(`#limit-${limit.from_library_id}-${limit.to_library_id}`);
439
440
                        checkbox.attr('checked', false);
440
                        for (var i = 0; i < data.length; i++) {
441
                        checkbox.data('limit_id', limit.limit_id);
441
                            let limit = data[i];
442
                            let checkbox = $(`#limit-${limit.from_library_id}-${limit.to_library_id}`);
443
                            checkbox.attr('checked', false);
444
                            checkbox.data('limit_id', limit.limit_id);
445
                        }
446
                    },
447
                    complete: function() {
448
                        $('#loading_limits').hide();
449
                    },
450
                    error: function(xhr, status, error) {
451
                        var errorMessage = xhr.status + ': ' + xhr.statusText
452
                        alert('Error - ' + errorMessage);
442
                    }
453
                    }
443
444
                    $('#loading_limits').hide();
445
                });
454
                });
446
            }
455
            }
447
        }
456
        }
448
- 

Return to bug 26633