@@ -, +, @@ - use YAML is missing in package - get_tables and get_excluded are useless routines and can be removed --- C4/Utils/DataTables/ColumnsSettings.pm | 13 +------------ Koha/Template/Plugin/ColumnsSettings.pm | 15 ++------------- 2 files changed, 3 insertions(+), 25 deletions(-) --- a/C4/Utils/DataTables/ColumnsSettings.pm +++ a/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 ) = @_; --- a/Koha/Template/Plugin/ColumnsSettings.pm +++ a/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{}; --