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

(-)a/C4/Utils/DataTables/TablesSettings.pm (-4 / +57 lines)
Lines 14-20 sub get_yaml { Link Here
14
14
15
    unless ($yaml) {
15
    unless ($yaml) {
16
        $yaml = eval { YAML::LoadFile($yml_path) };
16
        $yaml = eval { YAML::LoadFile($yml_path) };
17
        warn "ERROR: the yaml file for DT::TablesSettings is not correctly formated: $@"
17
        warn "ERROR: the yaml file for DT::TablesSettings is not correctly formatted: $@"
18
          if $@;
18
          if $@;
19
        $cache->set_in_cache( 'TablesSettingsYaml', $yaml, { expiry => 3600 } );
19
        $cache->set_in_cache( 'TablesSettingsYaml', $yaml, { expiry => 3600 } );
20
    }
20
    }
Lines 39-50 sub get_columns { Link Here
39
39
40
    while ( my $c = $rs->next ) {
40
    while ( my $c = $rs->next ) {
41
        my $column = first { $c->columnname eq $_->{columnname} }
41
        my $column = first { $c->columnname eq $_->{columnname} }
42
        @{ $list->{modules}{ $c->module }{ $c->page }{ $c->tablename } };
42
        @{ $list->{modules}{ $c->module }{ $c->page }{ $c->tablename }{ columns } };
43
        $column->{is_hidden}         = $c->is_hidden;
43
        $column->{is_hidden}         = $c->is_hidden;
44
        $column->{cannot_be_toggled} = $c->cannot_be_toggled;
44
        $column->{cannot_be_toggled} = $c->cannot_be_toggled;
45
    }
45
    }
46
46
47
    my $columns = $list->{modules}{$module}{$page}{$tablename} || [];
47
    my $columns = $list->{modules}{$module}{$page}{$tablename}{columns} || [];
48
48
49
    # Assign default value if does not exist
49
    # Assign default value if does not exist
50
    $columns = [ map {
50
    $columns = [ map {
Lines 59-64 sub get_columns { Link Here
59
    return $columns;
59
    return $columns;
60
}
60
}
61
61
62
sub get_table_settings {
63
    my ( $module, $page, $tablename ) = @_;
64
    my $list = get_yaml;
65
66
    my $schema = Koha::Database->new->schema;
67
68
    my $rs = $schema->resultset('TablesSetting')->search(
69
        {
70
            module    => $module,
71
            page      => $page,
72
            tablename => $tablename,
73
        }
74
    )->next;
75
    return $rs ? $rs : $list->{modules}{$module}{$page}{$tablename};
76
}
77
62
sub get_modules {
78
sub get_modules {
63
    my $list = get_yaml;
79
    my $list = get_yaml;
64
80
Lines 67-73 sub get_modules { Link Here
67
83
68
    while ( my $c = $rs->next ) {
84
    while ( my $c = $rs->next ) {
69
        my $column = first { $c->columnname eq $_->{columnname} }
85
        my $column = first { $c->columnname eq $_->{columnname} }
70
        @{ $list->{modules}{ $c->module }{ $c->page }{ $c->tablename } };
86
        @{ $list->{modules}{ $c->module }{ $c->page }{ $c->tablename }{columns} };
71
        $column->{is_hidden}         = $c->is_hidden;
87
        $column->{is_hidden}         = $c->is_hidden;
72
        $column->{cannot_be_toggled} = $c->cannot_be_toggled;
88
        $column->{cannot_be_toggled} = $c->cannot_be_toggled;
73
        $column->{cannot_be_modified} = 0
89
        $column->{cannot_be_modified} = 0
Lines 100-103 sub update_columns { Link Here
100
    }
116
    }
101
}
117
}
102
118
119
=head3 update_table_settings
120
121
C4::Utils::DataTables::TablesSettings::update_table_settings(
122
    {
123
        module                 => $module,
124
        pag                    => $page,
125
        tablename              => $tablename,
126
        default_display_length => $default_display_length,
127
        default_sort_order     => $default_sort_order
128
    }
129
);
130
131
Will update the default_display_length and default_sort_order for the given table.
132
133
=cut
134
135
sub update_table_settings {
136
    my ($params)               = @_;
137
    my $module                 = $params->{module};
138
    my $page                   = $params->{page};
139
    my $tablename              = $params->{tablename};
140
    my $default_display_length = $params->{default_display_length};
141
    my $default_sort_order     = $params->{default_sort_order};
142
143
    my $schema = Koha::Database->new->schema;
144
145
    $schema->resultset('TablesSetting')->update_or_create(
146
        {
147
            module                 => $module,
148
            page                   => $page,
149
            tablename              => $tablename,
150
            default_display_length => $default_display_length,
151
            default_sort_order     => $default_sort_order,
152
        }
153
    );
154
}
155
103
1;
156
1;
(-)a/Koha/Template/Plugin/TablesSettings.pm (+32 lines)
Lines 74-79 datatables instantiator. Link Here
74
74
75
=cut
75
=cut
76
76
77
=head3 GetColumns
78
79
var columns_settings = [% TablesSettings.GetColumns( module, page, table 'json' ) | $raw%]
80
81
This method is usually be used to retrieve the columns settings for a DataTable init.
82
83
So the 'json' format will be provided and the columns_settings JS var will be
84
passed as argument of the constructor.
85
86
=cut
87
77
sub GetColumns {
88
sub GetColumns {
78
    my ( $self, $module, $page, $table, $format ) = @_;
89
    my ( $self, $module, $page, $table, $format ) = @_;
79
    $format //= q{};
90
    $format //= q{};
Lines 107-110 sub is_hidden { Link Here
107
    return 0;
118
    return 0;
108
}
119
}
109
120
121
=head3 GetTableSettings
122
123
[% SET table_settings = GetTableSettings( module, page, table ) %]
124
125
This method is used to retrieve the tables settings (like table_settings.default_display_length and
126
table_settings.default_sort_order).
127
They can be passed to the DataTable constructor (for iDisplayLength and order parameters)
128
129
=cut
130
131
sub GetTableSettings {
132
    my ( $self, $module, $page, $table, $format ) = @_;
133
    $format //= q{};
134
135
    my $settings = C4::Utils::DataTables::TablesSettings::get_table_settings( $module, $page, $table );
136
137
    return $format eq 'json'
138
        ? to_json( $settings || {} )
139
        : $settings
140
}
141
110
1;
142
1;
(-)a/admin/columns_settings.pl (+18 lines)
Lines 48-53 if ( $action eq 'save' ) { Link Here
48
        }
48
        }
49
    );
49
    );
50
50
51
    my @table_ids = $input->multi_param('table_id');
52
    for my $table_id (@table_ids) {
53
        next unless $table_id =~ m|^([^#]*)#(.*)$|;
54
        my $default_display_length = $input->param( $table_id . '_default_display_length' );
55
        my $default_sort_order     = $input->param( $table_id . '_default_sort_order' );
56
        if ( $default_display_length && $default_sort_order ) {
57
            C4::Utils::DataTables::TablesSettings::update_table_settings(
58
                {
59
                    module                 => $module,
60
                    page                   => $1,
61
                    tablename              => $2,
62
                    default_display_length => $default_display_length,
63
                    default_sort_order     => $default_sort_order,
64
                }
65
            );
66
        }
67
    }
68
51
    $action = 'list';
69
    $action = 'list';
52
}
70
}
53
71
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-1 / +4 lines)
Lines 925-930 Link Here
925
    [% END %]
925
    [% END %]
926
    <script>
926
    <script>
927
        var columns_settings = [% TablesSettings.GetColumns( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
927
        var columns_settings = [% TablesSettings.GetColumns( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
928
        [% SET table_settings = TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders' ) %];
928
        $(document).ready(function() {
929
        $(document).ready(function() {
929
            KohaTable("orders", {
930
            KohaTable("orders", {
930
                [% IF ( active ) %]
931
                [% IF ( active ) %]
Lines 935-941 Link Here
935
                [% END %]
936
                [% END %]
936
                "sPaginationType": "full",
937
                "sPaginationType": "full",
937
                "autoWidth": false,
938
                "autoWidth": false,
938
                "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13]
939
                "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13],
940
                "iDisplayLength": [% table_settings.default_display_length | html %],
941
                "order": [[ [% table_settings.default_sort_order | html %], 'asc']],
939
            }, columns_settings);
942
            }, columns_settings);
940
943
941
            var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
944
            var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt (-59 / +112 lines)
Lines 1-7 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE TablesSettings %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
4
[% SET panel_id = 0 %]
5
[% SET panel_id = 0 %]
6
[% USE Dumper %]
5
[% BLOCK pagelist %]
7
[% BLOCK pagelist %]
6
    [% IF module.keys and module.keys.size > 0 %]
8
    [% IF module.keys and module.keys.size > 0 %]
7
        Jump to:
9
        Jump to:
Lines 22-93 Link Here
22
                    [% SET tables = module %]
24
                    [% SET tables = module %]
23
                    [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
25
                    [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
24
                        [% FOR tablename IN tables.$pagename.keys.sort %]
26
                        [% FOR tablename IN tables.$pagename.keys.sort %]
25
                            [% IF pagename == 'additem' AND tablename == 'itemst' %]
27
                            [% SET table_id = pagename _ '#' _ tablename %]
26
                                <div class="alert">Changes made below will only apply to item subfields that are mapped to the 'items' table. <a href="/cgi-bin/koha/admin/koha2marclinks.pl?tablename=items">Go to Koha to MARC mapping</a></div>
28
                            <div class="datatable_config" id="[% table_id | html %]" style="border:1px solid #7EA6B2; padding: 1em;">
27
                            [% END %]
29
                                <input type="hidden" name="table_id" value="[% table_id| html %]" />
28
                            <table>
30
                                [% IF pagename == 'additem' AND tablename == 'itemst' %]
29
                                <caption>
31
                                    <div class="alert">Changes made below will only apply to item subfields that are mapped to the 'items' table. <a href="/cgi-bin/koha/admin/koha2marclinks.pl?tablename=items">Go to Koha to MARC mapping</a></div>
30
                                    [% IF tablename == 'currencies-table' %]
32
                                [% END %]
31
                                        Currency
33
                                <table>
32
                                    [% ELSIF pagename == 'additem' AND tablename == 'itemst' %]
34
                                    <caption>
33
                                        Items Editor
35
                                        [% IF tablename == 'currencies-table' %]
34
                                    [% ELSE %]
36
                                            Currency
35
                                        Table id: [% tablename | html %]
37
                                        [% ELSIF pagename == 'additem' AND tablename == 'itemst' %]
36
                                    [% END %]
38
                                            Items Editor
37
                                </caption>
39
                                        [% ELSE %]
38
                                <thead>
40
                                            Table id: [% tablename | html %]
39
                                    <tr>
41
                                        [% END %]
40
                                        <th>Column name</th>
42
                                    </caption>
41
                                        <th>Is hidden by default</th>
43
                                    <thead>
42
                                        <th>Cannot be toggled</th>
43
                                    </tr>
44
                                </thead>
45
                                <tbody>
46
                                    [% FOR column IN tables.$pagename.$tablename %]
47
                                        [% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %]
48
                                        <tr>
44
                                        <tr>
49
                                            <td>
45
                                            <th>Column name</th>
50
                                                [% column.columnname | html %]
46
                                            <th>Is hidden by default</th>
51
                                                <input type="hidden" name="columnid" value="[% value | html %]" />
47
                                            <th>Cannot be toggled</th>
52
                                            </td>
48
                                        </tr>
53
                                            <td>
49
                                    </thead>
54
                                                [% IF column.is_hidden %]
50
                                    <tbody>
55
                                                    [% IF column.cannot_be_modified %]
51
                                        [% FOR column IN tables.$pagename.$tablename.columns %]
56
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" disabled="disabled" />
52
                                            [% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %]
57
                                                        <input type="hidden" name="[% value | html %]_hidden" value="1" />
53
                                            <tr>
58
                                                    [% ELSE %]
54
                                                <td>
59
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" />
55
                                                    [% column.columnname | html %]
60
                                                    [% END %]
56
                                                    <input type="hidden" name="columnid" value="[% value | html %]" />
61
                                                [% ELSE %]
57
                                                </td>
62
                                                    [% IF column.cannot_be_modified %]
58
                                                <td>
63
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" disabled="disabled" />
59
                                                    [% IF column.is_hidden %]
64
                                                        <input type="hidden" name="[% value | html %]_hidden" value="0" />
60
                                                        [% IF column.cannot_be_modified %]
61
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" disabled="disabled" />
62
                                                            <input type="hidden" name="[% value | html %]_hidden" value="1" />
63
                                                        [% ELSE %]
64
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" />
65
                                                        [% END %]
65
                                                    [% ELSE %]
66
                                                    [% ELSE %]
66
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" />
67
                                                        [% IF column.cannot_be_modified %]
68
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" disabled="disabled" />
69
                                                            <input type="hidden" name="[% value | html %]_hidden" value="0" />
70
                                                        [% ELSE %]
71
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" />
72
                                                        [% END %]
67
                                                    [% END %]
73
                                                    [% END %]
68
                                                [% END %]
74
                                                </td>
69
                                            </td>
75
                                                <td>
70
                                            <td>
76
                                                    [% IF column.cannot_be_toggled %]
71
                                                [% IF column.cannot_be_toggled %]
77
                                                        [% IF column.cannot_be_modified %]
72
                                                    [% IF column.cannot_be_modified %]
78
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" disabled="disabled" />
73
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" disabled="disabled" />
79
                                                            <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="1" />
74
                                                        <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="1" />
80
                                                        [% ELSE %]
81
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" />
82
                                                        [% END %]
75
                                                    [% ELSE %]
83
                                                    [% ELSE %]
76
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" />
84
                                                        [% IF column.cannot_be_modified %]
85
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" disabled="disabled" />
86
                                                            <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="0" />
87
                                                        [% ELSE %]
88
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" />
89
                                                        [% END %]
77
                                                    [% END %]
90
                                                    [% END %]
91
                                                </td>
92
                                            </tr>
93
                                        [% END %]
94
                                    </tbody>
95
                                </table>
96
                                [% SET table_settings = TablesSettings.GetTableSettings( modulename, pagename, tablename ) %]
97
                                [% IF table_settings.default_display_length %]
98
                                    <p>
99
                                        Default display length:
100
                                        <select name="[% table_id | html %]_default_display_length">
101
                                            [% IF table_settings.default_display_length == 10 %]
102
                                                <option value="10" selected="selected">10</option>
103
                                            [% ELSE %]
104
                                            [% END %]
105
                                            [% IF table_settings.default_display_length == 20 %]
106
                                                <option value="20" selected="selected">20</option>
107
                                            [% ELSE %]
108
                                                <option value="20">20</option>
109
                                            [% END %]
110
                                            [% IF table_settings.default_display_length == 50 %]
111
                                                <option value="50" selected="selected">50</option>
112
                                            [% ELSE %]
113
                                                <option value="50">50</option>
114
                                            [% END %]
115
                                            [% IF table_settings.default_display_length == 100 %]
116
                                                <option value="100" selected="selected">100</option>
117
                                            [% ELSE %]
118
                                                <option value="100">100</option>
119
                                            [% END %]
120
                                            [% IF table_settings.default_display_length == -1 %]
121
                                                <option value="-1" selected="selected">All</option>
122
                                            [% ELSE %]
123
                                                <option value="-1">All</option>
124
                                            [% END %]
125
                                        </select>
126
                                    </p>
127
                                [% END %]
128
                                [% IF table_settings.default_sort_order.defined %]
129
                                    <p>
130
                                        Default sort order:
131
                                        <select name="[% pagename | html %]#[% tablename | html %]_default_sort_order">
132
                                            [% FOR column IN tables.$pagename.$tablename.columns %]
133
                                                [% IF table_settings.default_sort_order == loop.count - 1 %]
134
                                                    <option value="[% loop.count - 1 %]" selected="selected">[% column.columnname | html %]</option>
78
                                                [% ELSE %]
135
                                                [% ELSE %]
79
                                                    [% IF column.cannot_be_modified %]
136
                                                    <option value="[% loop.count - 1 %]">[% column.columnname | html %]</option>
80
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" disabled="disabled" />
81
                                                        <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="0" />
82
                                                    [% ELSE %]
83
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" />
84
                                                    [% END %]
85
                                                [% END %]
137
                                                [% END %]
86
                                            </td>
138
                                            [% END %]
87
                                        </tr>
139
                                        </select>
88
                                    [% END %]
140
                                    </p>
89
                                </tbody>
141
                                [% END %]
90
                            </table>
142
143
                            </div>
91
                        [% END %]
144
                        [% END %]
92
                        <fieldset class="action">
145
                        <fieldset class="action">
93
                            <input type="submit" value="Save" />
146
                            <input type="submit" value="Save" />
(-)a/t/db_dependent/TablesSettings.t (-78 / +96 lines)
Lines 1-7 Link Here
1
#!/usr/bin/perl;
1
#!/usr/bin/perl;
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use Test::More tests => 2;
4
use Test::More tests => 3;
5
use Test::MockModule;
5
use Test::MockModule;
6
6
7
use C4::Context;
7
use C4::Context;
Lines 22-59 $module->mock( Link Here
22
            modules => {
22
            modules => {
23
                admin => {
23
                admin => {
24
                    currency => {
24
                    currency => {
25
                        'currencies-table' => [
25
                        'currencies-table' => {
26
                            {
26
                            default_display_length => 20,
27
                                columnname         => 'currency',
27
                            default_sort_order => 1,
28
                                cannot_be_toggled  => '1',
28
                            columns => [
29
                                cannot_be_modified => '1'
29
                                {
30
                            },
30
                                    columnname         => 'currency',
31
                            {
31
                                    cannot_be_toggled  => '1',
32
                                columnname         => 'rate',
32
                                    cannot_be_modified => '1'
33
                                cannot_be_toggled  => '1',
33
                                },
34
                                cannot_be_modified => '1'
34
                                {
35
                            },
35
                                    columnname         => 'rate',
36
                            {
36
                                    cannot_be_toggled  => '1',
37
                                columnname => 'symbol'
37
                                    cannot_be_modified => '1'
38
                            },
38
                                },
39
                            {
39
                                {
40
                                is_hidden  => '1',
40
                                    columnname => 'symbol'
41
                                columnname => 'iso_code'
41
                                },
42
                            },
42
                                {
43
                            {
43
                                    is_hidden  => '1',
44
                                columnname => 'last_updated'
44
                                    columnname => 'iso_code'
45
                            },
45
                                },
46
                            {
46
                                {
47
                                columnname => 'active'
47
                                    columnname => 'last_updated'
48
                            },
48
                                },
49
                            {
49
                                {
50
                                columnname => 'actions'
50
                                    columnname => 'active'
51
                            }
51
                                },
52
                        ]
52
                                {
53
                                    columnname => 'actions'
54
                                }
55
                            ]
56
                        }
53
                    }
57
                    }
54
                }
58
                },
55
              }
59
            }
56
57
        };
60
        };
58
    }
61
    }
59
);
62
);
Lines 119-168 my $modules = C4::Utils::DataTables::TablesSettings::get_modules(); Link Here
119
my $modules_expected = {
122
my $modules_expected = {
120
    'admin' => {
123
    'admin' => {
121
        'currency' => {
124
        'currency' => {
122
            'currencies-table' => [
125
            'currencies-table' => {
123
                {
126
                default_display_length => 20,
124
                    columnname         => 'currency',
127
                default_sort_order => 1,
125
                    cannot_be_toggled  => 1,
128
                columns => [
126
                    cannot_be_modified => 1,
129
                    {
127
                    is_hidden  => 0,
130
                        columnname         => 'currency',
128
                },
131
                        cannot_be_toggled  => 1,
129
                {
132
                        cannot_be_modified => 1,
130
                    columnname         => 'rate',
133
                        is_hidden  => 0,
131
                    cannot_be_toggled  => 1,
134
                    },
132
                    cannot_be_modified => 1,
135
                    {
133
                    is_hidden  => 0,
136
                        columnname         => 'rate',
134
                },
137
                        cannot_be_toggled  => 1,
135
                {
138
                        cannot_be_modified => 1,
136
                    columnname => 'symbol',
139
                        is_hidden  => 0,
137
                    cannot_be_toggled  => 0,
140
                    },
138
                    cannot_be_modified => 0,
141
                    {
139
                    is_hidden  => 0,
142
                        columnname => 'symbol',
140
                },
143
                        cannot_be_toggled  => 0,
141
                {
144
                        cannot_be_modified => 0,
142
                    columnname => 'iso_code',
145
                        is_hidden  => 0,
143
                    cannot_be_toggled  => 0,
146
                    },
144
                    cannot_be_modified => 0,
147
                    {
145
                    is_hidden  => 0,
148
                        columnname => 'iso_code',
146
                },
149
                        cannot_be_toggled  => 0,
147
                {
150
                        cannot_be_modified => 0,
148
                    columnname => 'last_updated',
151
                        is_hidden  => 0,
149
                    cannot_be_toggled  => 0,
152
                    },
150
                    cannot_be_modified => 0,
153
                    {
151
                    is_hidden  => 0,
154
                        columnname => 'last_updated',
152
                },
155
                        cannot_be_toggled  => 0,
153
                {
156
                        cannot_be_modified => 0,
154
                    columnname => 'active',
157
                        is_hidden  => 0,
155
                    cannot_be_toggled  => 0,
158
                    },
156
                    cannot_be_modified => 0,
159
                    {
157
                    is_hidden  => 1,
160
                        columnname => 'active',
158
                },
161
                        cannot_be_toggled  => 0,
159
                {
162
                        cannot_be_modified => 0,
160
                    columnname        => 'actions',
163
                        is_hidden  => 1,
161
                    cannot_be_toggled => 1,
164
                    },
162
                    cannot_be_modified => 0,
165
                    {
163
                    is_hidden  => 0,
166
                        columnname        => 'actions',
164
                },
167
                        cannot_be_toggled => 1,
165
            ]
168
                        cannot_be_modified => 0,
169
                        is_hidden  => 0,
170
                    },
171
                ]
172
            }
166
        }
173
        }
167
    }
174
    }
168
};
175
};
Lines 176-184 for my $m ( keys %$modules ) { Link Here
176
              C4::Utils::DataTables::TablesSettings::get_columns( $m, $p, $t );
183
              C4::Utils::DataTables::TablesSettings::get_columns( $m, $p, $t );
177
            is_deeply(
184
            is_deeply(
178
                $columns,
185
                $columns,
179
                $modules->{$m}{$p}{$t},
186
                $modules->{$m}{$p}{$t}{columns},
180
                "columns for $m>$p>$t"
187
                "columns for $m>$p>$t"
181
            );
188
            );
189
            my $table_settings =
190
              C4::Utils::DataTables::TablesSettings::get_table_settings( $m, $p, $t );
191
            is_deeply(
192
                {
193
                    default_display_length => $table_settings->{default_display_length},
194
                    default_sort_order     => $table_settings->{default_sort_order}
195
                },
196
                {
197
                    default_display_length => $modules->{$m}{$p}{$t}{default_display_length},
198
                    default_sort_order     => $modules->{$m}{$p}{$t}{default_sort_order},
199
                }
200
            );
182
        }
201
        }
183
    }
202
    }
184
}
203
}
185
- 

Return to bug 24156