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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-3 / +24 lines)
Lines 153-158 Link Here
153
                    [% IF debit_types.count %]
153
                    [% IF debit_types.count %]
154
                        <table id="table_debit_types">
154
                        <table id="table_debit_types">
155
                            <thead>
155
                            <thead>
156
                                <th>System</th>
156
                                <th>Code</th>
157
                                <th>Code</th>
157
                                <th>Description</th>
158
                                <th>Description</th>
158
                                <th>Default amount</th>
159
                                <th>Default amount</th>
Lines 163-168 Link Here
163
                            <tbody>
164
                            <tbody>
164
                                [% FOREACH debit_type IN debit_types %]
165
                                [% FOREACH debit_type IN debit_types %]
165
                                <tr>
166
                                <tr>
167
                                    <td>[% debit_type.is_system | html %]</td>
166
                                    <td>[% debit_type.code | html %]</td>
168
                                    <td>[% debit_type.code | html %]</td>
167
                                    <td>[% debit_type.description | html %]</td>
169
                                    <td>[% debit_type.description | html %]</td>
168
                                    <td>[% debit_type.default_amount | $Price %]</td>
170
                                    <td>[% debit_type.default_amount | $Price %]</td>
Lines 219-232 Link Here
219
221
220
    <script>
222
    <script>
221
        $(document).ready(function() {
223
        $(document).ready(function() {
222
            $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, {
224
            var txtActivefilter = _("Filter system debit types");
225
            var txtInactivefilter = _("Show all debit types");
226
            var table_debit_types = $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, {
223
                "aoColumnDefs": [
227
                "aoColumnDefs": [
224
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
228
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
229
                    { "aTargets": [ 0 ], "bSortable": false, "bVisible": false },
225
                ],
230
                ],
226
                "aaSorting": [[ 1, "asc" ]],
231
                "aaSorting": [[ 1, "asc" ]],
227
                "iDisplayLength": 10,
232
                "sDom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
233
                "iDisplayLength": 20,
228
                "sPaginationType": "full_numbers"
234
                "sPaginationType": "full_numbers"
229
            }));
235
            }));
236
            $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
237
            $('#filter_system').click(function(e) {
238
                e.preventDefault();
239
                if ($(this).hasClass('filtered')) {
240
                    var filteredValue = '';
241
                    $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
242
                } else { //Not filtered. Let's do it!
243
                    var filteredValue = '0';
244
                    $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
245
                }
246
                table_debit_types.fnFilter(filteredValue, 0, false, false);
247
                $(this).toggleClass('filtered');
248
            });
249
250
            //Start filtered
251
            $('#filter_system').click();
230
        });
252
        });
231
    </script>
253
    </script>
232
[% END %]
254
[% END %]
233
- 

Return to bug 23049