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

(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-12 / +16 lines)
Lines 26-42 $(document).ready(function() { Link Here
26
        }
26
        }
27
    };
27
    };
28
28
29
    var CheckRenewCheckinBoxes = function() {
30
        $('#RenewChecked').prop('disabled', !$('.renew:checked').length );
31
        $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length );
32
    }
33
29
    // Handle the select all/none links for checkouts table columns
34
    // Handle the select all/none links for checkouts table columns
30
    $("#CheckAllRenewals").on("click",function(){
35
    $("#CheckAllRenewals").on("click",function(){
31
        $("#UncheckAllCheckins").click();
36
        $("#UncheckAllCheckins").click();
32
        $(".renew:visible").prop("checked", true);
37
        $(".renew:visible").prop("checked", true);
33
        $('#RenewChecked').prop('disabled', !$('.renew:checked').length );
38
        CheckRenewCheckinBoxes();
34
        showHideOnHoldRenewal();
39
        showHideOnHoldRenewal();
35
        return false;
40
        return false;
36
    });
41
    });
37
    $("#UncheckAllRenewals").on("click",function(){
42
    $("#UncheckAllRenewals").on("click",function(){
38
        $(".renew:visible").prop("checked", false);
43
        $(".renew:visible").prop("checked", false);
39
        $('#RenewChecked').prop('disabled', !$('.renew:checked').length );
44
        CheckRenewCheckinBoxes();
40
        showHideOnHoldRenewal();
45
        showHideOnHoldRenewal();
41
        return false;
46
        return false;
42
    });
47
    });
Lines 44-55 $(document).ready(function() { Link Here
44
    $("#CheckAllCheckins").on("click",function(){
49
    $("#CheckAllCheckins").on("click",function(){
45
        $("#UncheckAllRenewals").click();
50
        $("#UncheckAllRenewals").click();
46
        $(".checkin:visible").prop("checked", true);
51
        $(".checkin:visible").prop("checked", true);
47
        $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length );
52
        CheckRenewCheckinBoxes();
48
        return false;
53
        return false;
49
    });
54
    });
50
    $("#UncheckAllCheckins").on("click",function(){
55
    $("#UncheckAllCheckins").on("click",function(){
51
        $(".checkin:visible").prop("checked", false);
56
        $(".checkin:visible").prop("checked", false);
52
        $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length );
57
        CheckRenewCheckinBoxes();
53
        return false;
58
        return false;
54
    });
59
    });
55
60
Lines 68-82 $(document).ready(function() { Link Here
68
        if ( $(this).is(":checked") ) {
73
        if ( $(this).is(":checked") ) {
69
            $( "#checkin_" + $(this).val() ).prop("checked", false);
74
            $( "#checkin_" + $(this).val() ).prop("checked", false);
70
        }
75
        }
71
        $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length );
76
        CheckRenewCheckinBoxes();
72
        $('#RenewChecked').prop('disabled', !$('.renew:checked').length );
73
    });
77
    });
74
    $(document).on("change", '.checkin', function(){
78
    $(document).on("change", '.checkin', function(){
75
        if ( $(this).is(":checked") ) {
79
        if ( $(this).is(":checked") ) {
76
            $( "#renew_" + $(this).val() ).prop("checked", false);
80
            $( "#renew_" + $(this).val() ).prop("checked", false);
77
        }
81
        }
78
        $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length );
82
        CheckRenewCheckinBoxes();
79
        $('#RenewChecked').prop('disabled', !$('.renew:checked').length );
80
    });
83
    });
81
84
82
    // Display on hold due dates input when an on hold item is
85
    // Display on hold due dates input when an on hold item is
Lines 154-160 $(document).ready(function() { Link Here
154
        if ( refresh_table ) {
157
        if ( refresh_table ) {
155
            RefreshIssuesTable();
158
            RefreshIssuesTable();
156
        }
159
        }
157
        $('#RenewChecked, #CheckinChecked').prop('disabled' , true );
160
        CheckRenewCheckinBoxes();
158
        // Prevent form submit
161
        // Prevent form submit
159
        return false;
162
        return false;
160
    });
163
    });
Lines 248-253 $(document).ready(function() { Link Here
248
251
249
        if ( refresh_table ) {
252
        if ( refresh_table ) {
250
            RefreshIssuesTable();
253
            RefreshIssuesTable();
254
            CheckRenewCheckinBoxes();
251
        }
255
        }
252
        // Prevent form submit
256
        // Prevent form submit
253
        return false;
257
        return false;
Lines 258-264 $(document).ready(function() { Link Here
258
        $("#UncheckAllCheckins").click();
262
        $("#UncheckAllCheckins").click();
259
        showHideOnHoldRenewal();
263
        showHideOnHoldRenewal();
260
        $("#RenewChecked").click();
264
        $("#RenewChecked").click();
261
        $('#RenewChecked').prop('disabled' , true );
265
        CheckRenewCheckinBoxes();
262
        // Prevent form submit
266
        // Prevent form submit
263
        return false;
267
        return false;
264
    });
268
    });
Lines 301-307 $(document).ready(function() { Link Here
301
            return this.value;
305
            return this.value;
302
        }).get();
306
        }).get();
303
        table.ajax.reload( function() {
307
        table.ajax.reload( function() {
304
            $('#RenewChecked, #CheckinChecked').prop('disabled' , true );
308
            CheckRenewCheckinBoxes();
305
            if ( renewchecked.length ) {
309
            if ( renewchecked.length ) {
306
                $('#RenewChecked').prop('disabled' , false );
310
                $('#RenewChecked').prop('disabled' , false );
307
                renewchecked.forEach( function(checked) {
311
                renewchecked.forEach( function(checked) {
Lines 728-733 $(document).ready(function() { Link Here
728
                }
732
                }
729
            },
733
            },
730
            "initComplete": function(oSettings, json) {
734
            "initComplete": function(oSettings, json) {
735
                CheckRenewCheckinBoxes();
731
                // Build a summary of checkouts grouped by itemtype
736
                // Build a summary of checkouts grouped by itemtype
732
                var checkoutsByItype = json.aaData.reduce(function (obj, row) {
737
                var checkoutsByItype = json.aaData.reduce(function (obj, row) {
733
                    obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1;
738
                    obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1;
734
- 

Return to bug 35709