From aaf1caaa73961b9b989446607b47dc6e32461309 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 2 Dec 2024 11:24:47 +0100
Subject: [PATCH] Bug 38594: Remove unused TablesSettings.GetColumns

This is no longer used, and should not.

Test plan:
  git grep TablesSettings.GetColumns
should not return any results

  git grep GetColumns
should not return results related to this method

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
---
 Koha/Template/Plugin/TablesSettings.pm | 38 ++------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/Koha/Template/Plugin/TablesSettings.pm b/Koha/Template/Plugin/TablesSettings.pm
index 9e6eccc433..bed439b6e7 100644
--- a/Koha/Template/Plugin/TablesSettings.pm
+++ b/Koha/Template/Plugin/TablesSettings.pm
@@ -40,8 +40,8 @@ Koha::Template::Plugin::TablesSettings
     . . .
 
     <script>
-        var columns_settings = [% TablesSettings.GetColumns( 'module', 'page', 'table', 'json' ) | $raw %];
-        var table = KohaTable("id", { "autoWidth": false }, columns_settings );
+        var table_settings = [% TablesSettings.GetTableSettings( 'module', 'page', 'table', 'json' ) | $raw %];
+        var table = $("#id").kohaTable({ "autoWidth": false }, table_settings );
     </script>
 
 This plugin allows to get the column configuration for a table. It should be used both in table markup
@@ -61,40 +61,6 @@ use C4::Utils::DataTables::TablesSettings;
 
 =head1 FUNCTIONS
 
-=head2 GetColumns
-
-    <script>
-        var tables_settings = [% TablesSettings.GetColumns( 'module', 'page', 'table', 'json' ) | $raw %];
-        var table = KohaTable("id", { "autoWidth": false }, tables_settings );
-    </script>
-
-Used to get the full column settings configuration for datatables, usually requires a format of 'json' to pass into
-datatables instantiator.
-
-=cut
-
-=head3 GetColumns
-
-var columns_settings = [% TablesSettings.GetColumns( module, page, table 'json' ) | $raw%]
-
-This method is usually be used to retrieve the columns settings for a DataTable init.
-
-So the 'json' format will be provided and the columns_settings JS var will be
-passed as argument of the constructor.
-
-=cut
-
-sub GetColumns {
-    my ( $self, $module, $page, $table, $format ) = @_;
-    $format //= q{};
-
-    my $columns = C4::Utils::DataTables::TablesSettings::get_columns( $module, $page, $table );
-
-    return $format eq 'json'
-        ? to_json( $columns )
-        : $columns
-}
-
 =head2 is_hidden
 
     [% UNLESS TablesSettings.is_hidden( 'module', 'page', 'table', 'column') %]
-- 
2.39.2