Bugzilla – Attachment 139005 Details for
Bug 29723
Add a "Configure table" button for KohaTable tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29723: (QA follow-up) Correct scroll to table
Bug-29723-QA-follow-up-Correct-scroll-to-table.patch (text/plain), 5.05 KB, created by
Jonathan Druart
on 2022-08-10 14:47:03 UTC
(
hide
)
Description:
Bug 29723: (QA follow-up) Correct scroll to table
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-10 14:47:03 UTC
Size:
5.05 KB
patch
obsolete
>From 61a6bcdb60551b3728dfd6882d83064a4964b0b6 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >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 <andrewfh@dubcolib.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > admin/columns_settings.pl | 2 ++ > .../prog/en/includes/columns_settings.inc | 4 ++-- > .../prog/en/modules/admin/columns_settings.tt | 11 +++++++++++ > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 4 ++-- > 4 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl >index 994070caf97..55ebb66e2ef 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 f7aa0b6278d..a2541d27c84 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -165,10 +165,10 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { > dt_parameters[ "buttons" ].push( > { > className: "dt_button_configure_table", >- titleAttr: __("Configure this table"), >+ titleAttr: __("Configure this table"), > text: '<i class="fa fa-lg fa-wrench"></i> <span class="dt-button-text">' + _("Configure this table") + '</span>', > 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 3c3e3a6e0c4..865af8739f0 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 @@ > <script> > $(document).ready( function() { > $("#[% panel | uri %]Toggle").click(); >+ [%- IF page.defined -%] >+ $("#[% panel | uri %]").on('shown.bs.collapse', function () { >+ $('html, body').animate({ >+ [%- IF table.defined -%] >+ scrollTop: ($("#[% page | uri %]\\#[% table | uri %]").offset().top) >+ [%- ELSE -%] >+ scrollTop: ($("#[% page | uri %]").offset().top) >+ [%- END -%] >+ }, 500); >+ }); >+ [%- END -%] > }); > </script> > [%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 5db03da28c2..941ecbf351f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -817,10 +817,10 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > settings[ "buttons" ].push( > { > className: "dt_button_configure_table", >- titleAttr: __("Configure this table"), >+ titleAttr: __("Configure this table"), > text: '<i class="fa fa-lg fa-wrench"></i> <span class="dt-button-text">' + __("Configure this table") + '</span>', > 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.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29723
:
128648
|
131874
|
133029
|
138951
|
138952
|
138972
|
138973
|
138974
|
138975
|
138985
|
138986
|
138987
|
138988
|
138989
|
138992
|
138993
|
138994
|
138995
|
138996
|
138997
|
138998
|
138999
|
139000
|
139002
|
139003
|
139004
| 139005 |
139006
|
139194