From 2201edfe6ee630cdca086abcd84525d7b4d2bb56 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 23 Jun 2020 11:29:05 +0200 Subject: [PATCH] Bug 24156: Fix some QA failures * Add POD to get_table_settings * Remove USE Dumper debug statement * Add missing "10" entry * Fix newly created test file (and renamed) Signed-off-by: Alex Arnaud Signed-off-by: Jonathan Druart --- C4/Utils/DataTables/TablesSettings.pm | 16 ++++++++++++++++ .../prog/en/modules/admin/columns_settings.tt | 2 +- .../{ColumnsSettings.t => TablesSettings.t} | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) rename t/db_dependent/Koha/Template/Plugin/{ColumnsSettings.t => TablesSettings.t} (69%) diff --git a/C4/Utils/DataTables/TablesSettings.pm b/C4/Utils/DataTables/TablesSettings.pm index a343944407..518f53fac6 100644 --- a/C4/Utils/DataTables/TablesSettings.pm +++ b/C4/Utils/DataTables/TablesSettings.pm @@ -59,6 +59,22 @@ sub get_columns { return $columns; } +=head3 get_table_settings + +my $settings = C4::Utils::DataTables::TablesSettings::get_table_settings( + { + module => $module, + pag => $page, + tablename => $tablename, + } +); + +Returns the settings for a given table. + +The settings are default_display_length and default_sort_order. + +=cut + sub get_table_settings { my ( $module, $page, $tablename ) = @_; my $list = get_yaml; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt index 04c6fad899..ce2c9c4e0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt @@ -3,7 +3,6 @@ [% USE TablesSettings %] [% SET footerjs = 1 %] [% SET panel_id = 0 %] -[% USE Dumper %] [% BLOCK pagelist %] [% IF module.keys and module.keys.size > 0 %] Jump to: @@ -101,6 +100,7 @@ [% IF table_settings.default_display_length == 10 %] [% ELSE %] + [% END %] [% IF table_settings.default_display_length == 20 %] diff --git a/t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t b/t/db_dependent/Koha/Template/Plugin/TablesSettings.t similarity index 69% rename from t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t rename to t/db_dependent/Koha/Template/Plugin/TablesSettings.t index 6a9777719f..4c5d333ba5 100644 --- a/t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t +++ b/t/db_dependent/Koha/Template/Plugin/TablesSettings.t @@ -10,10 +10,10 @@ use Test::More tests => 3; use t::lib::Mocks; BEGIN { - use_ok('Koha::Template::Plugin::ColumnsSettings', "Can use Koha::Template::Plugin::ColumnsSettings"); + use_ok('Koha::Template::Plugin::TablesSettings', "Can use Koha::Template::Plugin::TablesSettings"); } -ok( my $settings = Koha::Template::Plugin::ColumnsSettings->new(), 'Able to instantiate template plugin' ); +ok( my $settings = Koha::Template::Plugin::TablesSettings->new(), 'Able to instantiate template plugin' ); subtest "is_hidden" => sub { plan tests => 2; -- 2.39.5