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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (-18 / +22 lines)
Lines 9-29 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
9
    var included_ids = [];
9
    var included_ids = [];
10
    var selector = '#' + id_selector;
10
    var selector = '#' + id_selector;
11
11
12
    var columns_settings = table_settings['columns'];
12
    if ( table_settings ) {
13
        var columns_settings = table_settings['columns'];
13
14
14
    $(columns_settings).each( function() {
15
        $(columns_settings).each( function() {
15
        var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
16
            var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
16
        var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
17
            var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
17
        if ( used_id == -1 ) return;
18
            if ( used_id == -1 ) return;
18
19
19
        if ( this['is_hidden'] == "1" ) {
20
            if ( this['is_hidden'] == "1" ) {
20
            hidden_ids.push( used_id );
21
                hidden_ids.push( used_id );
21
        }
22
            }
22
        if ( this['cannot_be_toggled'] == "0" ) {
23
            if ( this['cannot_be_toggled'] == "0" ) {
23
            included_ids.push( used_id );
24
                included_ids.push( used_id );
24
        }
25
            }
25
        counter++;
26
            counter++;
26
    });
27
        });
28
    }
27
29
28
    var exportColumns = ":visible:not(.noExport)";
30
    var exportColumns = ":visible:not(.noExport)";
29
    var exportRows = ":visible:not(.noExport)";
31
    var exportRows = ":visible:not(.noExport)";
Lines 184-194 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
184
        });
186
        });
185
    }
187
    }
186
188
187
    if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) {
189
    if ( table_settings ) {
188
        new_parameters["pageLength"] = table_settings['default_display_length'];
190
        if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) {
189
    }
191
            new_parameters["pageLength"] = table_settings['default_display_length'];
190
    if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) {
192
        }
191
        new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]];
193
        if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) {
194
            new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]];
195
        }
192
    }
196
    }
193
197
194
    table.dataTable(new_parameters);
198
    table.dataTable(new_parameters);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (-3 / +1 lines)
Lines 429-440 Link Here
429
    [% INCLUDE 'columns_settings.inc' %]
429
    [% INCLUDE 'columns_settings.inc' %]
430
    <script>
430
    <script>
431
        $(document).ready(function() {
431
        $(document).ready(function() {
432
            var columns_settings = []; // Empty because there are no columns we want to be configurable
433
432
434
            KohaTable("categoriest", {
433
            KohaTable("categoriest", {
435
                "aaSorting": [[ 0, "asc" ]],
434
                "aaSorting": [[ 0, "asc" ]],
436
                "sPaginationType": "full"
435
                "sPaginationType": "full"
437
            }, columns_settings);
436
            });
438
437
439
            if ( $("#branches option:selected").length < 1 ) {
438
            if ( $("#branches option:selected").length < 1 ) {
440
                $("#branches option:first").attr("selected", "selected");
439
                $("#branches option:first").attr("selected", "selected");
441
- 

Return to bug 29648