From a9ffc07a1d9d50785d1031772e96c56a27f8ce85 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 10 Aug 2022 12:14:35 +0100 Subject: [PATCH] Bug 29723: (QA follow-up) Correct scroll to table This patch enabled scrolling directly to the correct table configuration when clicking the 'Configure this table' button from any KohaTable/kohaTable table in Koha. Test plan 1. Navigate to Administration > Cities 2. Click 'Configure this table' 3. Confirm the result is the table settings page and you are scrolled to the cities table configuration Signed-off-by: Andrew Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- admin/columns_settings.pl | 2 ++ .../prog/en/includes/columns_settings.inc | 2 +- .../prog/en/modules/admin/columns_settings.tt | 11 +++++++++++ koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl index 994070caf9..55ebb66e2e 100755 --- a/admin/columns_settings.pl +++ b/admin/columns_settings.pl @@ -75,6 +75,8 @@ if ( $action eq 'list' ) { my $modules = C4::Utils::DataTables::TablesSettings::get_modules; $template->param( panel => defined $input->param('module') ? $input->param('module') : undef, + page => defined $input->param('page') ? $input->param('page') : undef, + table => defined $input->param('table') ? $input->param('table') : undef, modules => $modules, ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc index 1c3af9e495..a2541d27c8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -168,7 +168,7 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { titleAttr: __("Configure this table"), text: ' ' + _("Configure this table") + '', action: function() { - window.location = '/cgi-bin/koha/admin/columns_settings.pl?module=' + table_settings['module'] + '#' + table_settings['page'] + '#' + table_settings['table']; + window.location = '/cgi-bin/koha/admin/columns_settings.pl?module=' + table_settings['module'] + '&page=' + table_settings['page'] + '&table=' + table_settings['table']; }, } ); 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 3c3e3a6e0c..865af8739f 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 @@ -441,6 +441,17 @@ [%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 13f4821e93..941ecbf351 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -820,7 +820,7 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { titleAttr: __("Configure this table"), text: ' ' + __("Configure this table") + '', action: function() { - window.location = '/cgi-bin/koha/admin/columns_settings.pl?module=' + table_settings['module'] + '#' + table_settings['page'] + '#' + table_settings['table']; + window.location = '/cgi-bin/koha/admin/columns_settings.pl?module=' + table_settings['module'] + '&page=' + table_settings['page'] + '&table=' + table_settings['table']; }, } ); -- 2.39.5