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 41-46 For example: [% TablesSettings.GetColumns( 'circ', 'circulation', 'holdst' ) %] Link Here
41
41
42
=cut
42
=cut
43
43
44
=head3 GetColumns
45
46
var columns_settings = [% TablesSettings.GetColumns( module, page, table 'json' ) | $raw%]
47
48
This method is usually be used to retrieve the columns settings for a DataTable init.
49
50
So the 'json' format will be provided and the columns_settings JS var will be
51
passed as argument of the constructor.
52
53
=cut
54
44
sub GetColumns {
55
sub GetColumns {
45
    my ( $self, $module, $page, $table, $format ) = @_;
56
    my ( $self, $module, $page, $table, $format ) = @_;
46
    $format //= q{};
57
    $format //= q{};
Lines 52-55 sub GetColumns { Link Here
52
        : $columns
63
        : $columns
53
}
64
}
54
65
66
=head3 GetTableSettings
67
68
[% SET table_settings = GetTableSettings( module, page, table ) %]
69
70
This method is used to retrieve the tables settings (like table_settings.default_display_length and
71
table_settings.default_sort_order).
72
They can be passed to the DataTable constructor (for iDisplayLength and order parameters)
73
74
=cut
75
76
sub GetTableSettings {
77
    my ( $self, $module, $page, $table, $format ) = @_;
78
    $format //= q{};
79
80
    my $settings = C4::Utils::DataTables::TablesSettings::get_table_settings( $module, $page, $table );
81
82
    return $format eq 'json'
83
        ? to_json( $settings || {} )
84
        : $settings
85
}
86
55
1;
87
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 919-924 Link Here
919
    [% END %]
919
    [% END %]
920
    <script>
920
    <script>
921
        var columns_settings = [% TablesSettings.GetColumns( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
921
        var columns_settings = [% TablesSettings.GetColumns( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
922
        [% SET table_settings = TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders' ) %];
922
        $(document).ready(function() {
923
        $(document).ready(function() {
923
            KohaTable("orders", {
924
            KohaTable("orders", {
924
                [% IF ( active ) %]
925
                [% IF ( active ) %]
Lines 929-935 Link Here
929
                [% END %]
930
                [% END %]
930
                "sPaginationType": "full",
931
                "sPaginationType": "full",
931
                "autoWidth": false,
932
                "autoWidth": false,
932
                "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13]
933
                "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13],
934
                "iDisplayLength": [% table_settings.default_display_length | html %],
935
                "order": [[ [% table_settings.default_sort_order | html %], 'asc']],
933
            }, columns_settings);
936
            }, columns_settings);
934
937
935
            var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
938
            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
    <div class="pagelist">
8
    <div class="pagelist">
7
        <form method="post" action="/cgi-bin/koha/admin/columns_settings.pl">
9
        <form method="post" action="/cgi-bin/koha/admin/columns_settings.pl">
Lines 11-85 Link Here
11
            [% SET panel_id = panel_id + 1 %]
13
            [% SET panel_id = panel_id + 1 %]
12
            [% IF module.keys and module.keys.size > 0 %]
14
            [% IF module.keys and module.keys.size > 0 %]
13
                [% FOR pagename IN module.keys %]
15
                [% FOR pagename IN module.keys %]
14
                    <h5>[% pagename | html %]</h5>
16
                    <h5>Page [% pagename | html %]</h5>
15
                    [% SET tables = module %]
17
                    [% SET tables = module %]
16
                    [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
18
                    [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
17
                        [% FOR tablename IN tables.$pagename.keys.sort %]
19
                        [% FOR tablename IN tables.$pagename.keys.sort %]
18
                            [% IF pagename == 'additem' AND tablename == 'itemst' %]
20
                            [% SET table_id = pagename _ '#' _ tablename %]
19
                                <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>
21
                            <div class="datatable_config" id="[% table_id | html %]" style="border:1px solid #7EA6B2; padding: 1em;">
20
                            [% END %]
22
                                <input type="hidden" name="table_id" value="[% table_id| html %]" />
21
                            <table>
23
                                [% IF pagename == 'additem' AND tablename == 'itemst' %]
22
                                <caption>
24
                                    <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>
23
                                    [% IF tablename == 'currencies-table' %]
25
                                [% END %]
24
                                        Currency
26
                                <table>
25
                                    [% ELSIF pagename == 'additem' AND tablename == 'itemst' %]
27
                                    <caption>
26
                                        Items Editor
28
                                        [% IF tablename == 'currencies-table' %]
27
                                    [% END %]
29
                                            Currency
28
                                    (id=[% tablename | html %])
30
                                        [% ELSIF pagename == 'additem' AND tablename == 'itemst' %]
29
                                </caption>
31
                                            Items Editor
30
                                <thead>
32
                                        [% END %]
31
                                    <tr>
33
                                        (id=[% tablename | html %])
32
                                        <th>Column name</th>
34
                                    </caption>
33
                                        <th>Is hidden by default</th>
35
                                    <thead>
34
                                        <th>Cannot be toggled</th>
35
                                    </tr>
36
                                </thead>
37
                                <tbody>
38
                                    [% FOR column IN tables.$pagename.$tablename %]
39
                                        [% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %]
40
                                        <tr>
36
                                        <tr>
41
                                            <td>
37
                                            <th>Column name</th>
42
                                                [% column.columnname | html %]
38
                                            <th>Is hidden by default</th>
43
                                                <input type="hidden" name="columnid" value="[% value | html %]" />
39
                                            <th>Cannot be toggled</th>
44
                                            </td>
40
                                        </tr>
45
                                            <td>
41
                                    </thead>
46
                                                [% IF column.is_hidden %]
42
                                    <tbody>
47
                                                    [% IF column.cannot_be_modified %]
43
                                        [% FOR column IN tables.$pagename.$tablename.columns %]
48
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" disabled="disabled" />
44
                                            [% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %]
49
                                                        <input type="hidden" name="[% value | html %]_hidden" value="1" />
45
                                            <tr>
50
                                                    [% ELSE %]
46
                                                <td>
51
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" />
47
                                                    [% column.columnname | html %]
52
                                                    [% END %]
48
                                                    <input type="hidden" name="columnid" value="[% value | html %]" />
53
                                                [% ELSE %]
49
                                                </td>
54
                                                    [% IF column.cannot_be_modified %]
50
                                                <td>
55
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" disabled="disabled" />
51
                                                    [% IF column.is_hidden %]
56
                                                        <input type="hidden" name="[% value | html %]_hidden" value="0" />
52
                                                        [% IF column.cannot_be_modified %]
53
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" disabled="disabled" />
54
                                                            <input type="hidden" name="[% value | html %]_hidden" value="1" />
55
                                                        [% ELSE %]
56
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" />
57
                                                        [% END %]
57
                                                    [% ELSE %]
58
                                                    [% ELSE %]
58
                                                        <input type="checkbox" name="[% value | html %]_hidden" value="1" />
59
                                                        [% IF column.cannot_be_modified %]
60
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" disabled="disabled" />
61
                                                            <input type="hidden" name="[% value | html %]_hidden" value="0" />
62
                                                        [% ELSE %]
63
                                                            <input type="checkbox" name="[% value | html %]_hidden" value="1" />
64
                                                        [% END %]
59
                                                    [% END %]
65
                                                    [% END %]
60
                                                [% END %]
66
                                                </td>
61
                                            </td>
67
                                                <td>
62
                                            <td>
68
                                                    [% IF column.cannot_be_toggled %]
63
                                                [% IF column.cannot_be_toggled %]
69
                                                        [% IF column.cannot_be_modified %]
64
                                                    [% IF column.cannot_be_modified %]
70
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" disabled="disabled" />
65
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" disabled="disabled" />
71
                                                            <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="1" />
66
                                                        <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="1" />
72
                                                        [% ELSE %]
73
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" />
74
                                                        [% END %]
67
                                                    [% ELSE %]
75
                                                    [% ELSE %]
68
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" />
76
                                                        [% IF column.cannot_be_modified %]
77
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" disabled="disabled" />
78
                                                            <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="0" />
79
                                                        [% ELSE %]
80
                                                            <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" />
81
                                                        [% END %]
69
                                                    [% END %]
82
                                                    [% END %]
83
                                                </td>
84
                                            </tr>
85
                                        [% END %]
86
                                    </tbody>
87
                                </table>
88
                                [% SET table_settings = TablesSettings.GetTableSettings( modulename, pagename, tablename ) %]
89
                                [% IF table_settings.default_display_length %]
90
                                    <p>
91
                                        Default display length:
92
                                        <select name="[% table_id | html %]_default_display_length">
93
                                            [% IF table_settings.default_display_length == 10 %]
94
                                                <option value="10" selected="selected">10</option>
95
                                            [% ELSE %]
96
                                            [% END %]
97
                                            [% IF table_settings.default_display_length == 20 %]
98
                                                <option value="20" selected="selected">20</option>
99
                                            [% ELSE %]
100
                                                <option value="20">20</option>
101
                                            [% END %]
102
                                            [% IF table_settings.default_display_length == 50 %]
103
                                                <option value="50" selected="selected">50</option>
104
                                            [% ELSE %]
105
                                                <option value="50">50</option>
106
                                            [% END %]
107
                                            [% IF table_settings.default_display_length == 100 %]
108
                                                <option value="100" selected="selected">100</option>
109
                                            [% ELSE %]
110
                                                <option value="100">100</option>
111
                                            [% END %]
112
                                            [% IF table_settings.default_display_length == -1 %]
113
                                                <option value="-1" selected="selected">All</option>
114
                                            [% ELSE %]
115
                                                <option value="-1">All</option>
116
                                            [% END %]
117
                                        </select>
118
                                    </p>
119
                                [% END %]
120
                                [% IF table_settings.default_sort_order.defined %]
121
                                    <p>
122
                                        Default sort order:
123
                                        <select name="[% pagename | html %]#[% tablename | html %]_default_sort_order">
124
                                            [% FOR column IN tables.$pagename.$tablename.columns %]
125
                                                [% IF table_settings.default_sort_order == loop.count - 1 %]
126
                                                    <option value="[% loop.count - 1 %]" selected="selected">[% column.columnname | html %]</option>
70
                                                [% ELSE %]
127
                                                [% ELSE %]
71
                                                    [% IF column.cannot_be_modified %]
128
                                                    <option value="[% loop.count - 1 %]">[% column.columnname | html %]</option>
72
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" disabled="disabled" />
73
                                                        <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="0" />
74
                                                    [% ELSE %]
75
                                                        <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" />
76
                                                    [% END %]
77
                                                [% END %]
129
                                                [% END %]
78
                                            </td>
130
                                            [% END %]
79
                                        </tr>
131
                                        </select>
80
                                    [% END %]
132
                                    </p>
81
                                </tbody>
133
                                [% END %]
82
                            </table>
134
135
                            </div>
83
                        [% END %]
136
                        [% END %]
84
                        <input type="submit" value="Save" />
137
                        <input type="submit" value="Save" />
85
                    [% ELSE %]
138
                    [% ELSE %]
(-)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