From f79b4c19105b457a6597cea840f9b165ed22f392 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 10 Jan 2014 18:25:20 +0100 Subject: [PATCH] Bug 10212: Columns configuration for tables - QA FIX - use YAML is missing in package - get_tables and get_excluded are useless routines and can be removed Signed-off-by: Jonathan Druart --- C4/Utils/DataTables/ColumnsSettings.pm | 13 +------------ Koha/Template/Plugin/ColumnsSettings.pm | 15 ++------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/C4/Utils/DataTables/ColumnsSettings.pm b/C4/Utils/DataTables/ColumnsSettings.pm index e40d8d7..e05c808 100644 --- a/C4/Utils/DataTables/ColumnsSettings.pm +++ b/C4/Utils/DataTables/ColumnsSettings.pm @@ -2,6 +2,7 @@ package C4::Utils::DataTables::ColumnsSettings; use Modern::Perl; use List::Util qw( first ); +use YAML; use C4::Context; sub get_yaml { @@ -10,18 +11,6 @@ sub get_yaml { warn "ERROR: the yaml file for DT::ColumnsSettings is not correctly formated: $@" if $@; return $yaml; } -sub get_tables { - my ( $module, $page ) = @_; - my $list = get_yaml; - return $list->{modules}{$module}{$page}; -} - -sub get_excluded { - my ( $module, $page, $table ) = @_; - - my $list = get_yaml; - return $list->{modules}{$module}{$page}{$table}{cannot_be_toggled}; -} sub get_columns { my ( $module, $page, $tablename ) = @_; diff --git a/Koha/Template/Plugin/ColumnsSettings.pm b/Koha/Template/Plugin/ColumnsSettings.pm index 5c81d2a..888389c 100644 --- a/Koha/Template/Plugin/ColumnsSettings.pm +++ b/Koha/Template/Plugin/ColumnsSettings.pm @@ -35,23 +35,12 @@ This plugin allows to get the column configuration for a table. First, include the line '[% USE Tables %]' at the top of the template to enable the plugin. -To use, call ColumnsSettings.GetTables with the module and the page where the template is called. +To use, call ColumnsSettings.GetColumns with the module, the page and the table where the template is called. -For example: [% ColumnsSettings.GetTables( 'circ', 'circulation' ) %] +For example: [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst' ) %] =cut -sub GetTables { - my ( $self, $module, $page, $format ) = @_; - $format //= q{}; - - my $columns = C4::Utils::DataTables::ColumnsSettings::get_tables( $module, $page ); - - return $format eq 'json' - ? to_json( $columns ) - : $columns -} - sub GetColumns { my ( $self, $module, $page, $table, $format ) = @_; $format //= q{}; -- 1.7.10.4