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 / +20 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
                        $('#loading_limits').hide();
448
                    },
449
                    error: function(xhr, status, error) {
450
                        var errorMessage = xhr.status + ': ' + xhr.statusText
451
                        alert('Error - ' + errorMessage);
442
                    }
452
                    }
443
444
                    $('#loading_limits').hide();
445
                });
453
                });
446
            }
454
            }
447
        }
455
        }
448
- 

Return to bug 26633