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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt (-17 / +30 lines)
Lines 41-47 Link Here
41
    [% FOREACH codes_loo IN codes_loop %]
41
    [% FOREACH codes_loo IN codes_loop %]
42
    <div id="[% codes_loo.code | html %]set">
42
    <div id="[% codes_loo.code | html %]set">
43
    <h4>Policy for [% codes_loo.limit_phrase | html %]: [% codes_loo.code | html %]</h4>
43
    <h4>Policy for [% codes_loo.limit_phrase | html %]: [% codes_loo.code | html %]</h4>
44
    <p><a id="CheckAll[% codes_loo.code | html %]table" class="checkall" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="UncheckAll[% codes_loo.code | html %]table" class="uncheckall" href="#"><i class="fa fa-remove"></i> Clear all</a></p>
44
45
    <p><a id="CheckAll[% codes_loo.code | html %]table" data-cb="[% codes_loo.code | html %]" class="checkall" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="UncheckAll[% codes_loo.code | html %]table" data-cb="[% codes_loo.code | html %]" class="uncheckall" href="#"><i class="fa fa-remove"></i> Clear all</a></p>
45
46
46
        <table id="[% codes_loo.code | html %]table" class="sorted">
47
        <table id="[% codes_loo.code | html %]table" class="sorted">
47
            <thead>
48
            <thead>
Lines 57-65 Link Here
57
                            <td><label style="min-width:400px;" for="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row">[% to_branch_loo.toBranch | html %] - [% Branches.GetName( to_branch_loo.toBranch ) | html %]</label></td>
58
                            <td><label style="min-width:400px;" for="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row">[% to_branch_loo.toBranch | html %] - [% Branches.GetName( to_branch_loo.toBranch ) | html %]</label></td>
58
                            <td>
59
                            <td>
59
                            [% IF ( to_branch_loo.isChecked ) %]
60
                            [% IF ( to_branch_loo.isChecked ) %]
60
                                <input type="checkbox" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" checked="checked" />
61
                                <input type="checkbox" class="cb cb[% codes_loo.code | html %]" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" checked="checked" />
61
                            [% ELSE %]
62
                            [% ELSE %]
62
                                <input type="checkbox" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" />
63
                                <input type="checkbox" class="cb cb[% codes_loo.code | html %]" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" />
63
                            [% END %]
64
                            [% END %]
64
                            </td>
65
                            </td>
65
                        </tr>
66
                        </tr>
Lines 91-101 Link Here
91
[% MACRO jsinclude BLOCK %]
92
[% MACRO jsinclude BLOCK %]
92
    [% Asset.js("js/admin-menu.js") | $raw %]
93
    [% Asset.js("js/admin-menu.js") | $raw %]
93
    [% INCLUDE 'datatables.inc' %]
94
    [% INCLUDE 'datatables.inc' %]
94
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
95
    <script>
95
    <script>
96
        $(document).ready(function(){
96
        $(document).ready(function(){
97
            $("#CheckAll").click(function(){ $("#transferlimit_tabs").checkCheckboxes(); return false; });
97
            $("#CheckAll").on("click", function(e){
98
            $("#UncheckAll").click(function(){ $("#transferlimit_tabs").unCheckCheckboxes(); return false; });
98
                e.preventDefault();
99
                $(".cb").each(function(){
100
                    $(this).prop("checked", true);
101
                });
102
            });
103
104
            $("#UncheckAll").on("click", function(e){
105
                e.preventDefault();
106
                $(".cb").each(function(){
107
                    $(this).prop("checked", false);
108
                });
109
            });
99
            $('#transferlimit_tabs').tabs();
110
            $('#transferlimit_tabs').tabs();
100
111
101
             $('#branchselect').change(function() {
112
             $('#branchselect').change(function() {
Lines 105-123 Link Here
105
            var checkall = $(".checkall");
116
            var checkall = $(".checkall");
106
            var uncheckall = $(".uncheckall");
117
            var uncheckall = $(".uncheckall");
107
118
108
            $(checkall).click(function(){
119
            $(checkall).on("click", function(e){
109
                var tid = $(this).attr("id");
120
                e.preventDefault();
110
                tid = tid.replace("CheckAll","");
121
                var tid = $(this).data("cb");
111
                $("#"+tid).checkCheckboxes();
122
                $(".cb" + tid ).each(function(){
112
                return false;
123
                    $(this).prop("checked", true);
124
                })
113
            });
125
            });
114
126
115
            $(uncheckall).click(function(){
127
            $(uncheckall).on("click", function(e){
116
                var tid = $(this).attr("id");
128
                e.preventDefault();
117
                tid = tid.replace("UncheckAll","");
129
                var tid = $(this).data("cb");
118
                $("#"+tid).unCheckCheckboxes();
130
                $(".cb" + tid ).each(function(){
119
                return false;
131
                    $(this).prop("checked", false);
132
                })
120
            });
133
            });
134
121
            $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
135
            $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
122
                "aoColumnDefs": [
136
                "aoColumnDefs": [
123
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
137
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
124
- 

Return to bug 26768