Bugzilla – Attachment 138985 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: Add a "Configure table" button for KohaTable tables
Bug-29723-Add-a-Configure-table-button-for-KohaTab.patch (text/plain), 4.30 KB, created by
Martin Renvoize (ashimema)
on 2022-08-10 13:56:40 UTC
(
hide
)
Description:
Bug 29723: Add a "Configure table" button for KohaTable tables
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-08-10 13:56:40 UTC
Size:
4.30 KB
patch
obsolete
>From 7cad3c56d065daa7cb6538b49b2fd4b59f48496d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 17 Dec 2021 10:19:35 +0100 >Subject: [PATCH] Bug 29723: Add a "Configure table" button for KohaTable > tables > >This patch suggests to have a "Configure table" button when a table can >be configured in the "Table settings" administraition area. > >Test plan: >Go to different views where the table can be configured (you an >exhaustive list on bug 29648), notice the "Configure table" button (if >you have the 'manage_column_config' subpermission. > >Note that the link is correct but the scrollbar is not adjusted at the >correct position. Maybe we could improve that switching to the bootstrap >accordion plugin? > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Template/Plugin/TablesSettings.pm | 8 +++++++- > .../prog/en/includes/columns_settings.inc | 11 +++++++++++ > .../intranet-tmpl/prog/en/includes/doc-head-close.inc | 5 +++++ > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 11 +++++++++++ > 4 files changed, 34 insertions(+), 1 deletion(-) > >diff --git a/Koha/Template/Plugin/TablesSettings.pm b/Koha/Template/Plugin/TablesSettings.pm >index 720b67445a..2eb443f74e 100644 >--- a/Koha/Template/Plugin/TablesSettings.pm >+++ b/Koha/Template/Plugin/TablesSettings.pm >@@ -134,7 +134,13 @@ sub GetTableSettings { > my $settings = C4::Utils::DataTables::TablesSettings::get_table_settings( $module, $page, $table ); > my $columns = C4::Utils::DataTables::TablesSettings::get_columns( $module, $page, $table ); > >- $settings->{columns} = $columns; >+ $settings = { >+ %$settings, >+ columns => $columns, >+ module => $module, >+ page => $page, >+ table => $table, >+ }; > > return $format eq 'json' > ? to_json( $settings || {} ) >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 ea3d2d2888..27a7cbba69 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -161,6 +161,17 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { > } > ); > >+ if ( CAN_user_parameters_manage_column_config ) { >+ dt_parameters[ "buttons" ].push( >+ { >+ 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']; >+ }, >+ } >+ ); >+ } >+ > var table = $(selector); > if ( add_filters ) { > // Duplicate the table header row for columnFilter >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >index b35c001820..e4be83f166 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >@@ -29,6 +29,11 @@ > > <script> > var Koha = {}; >+[% IF CAN_user_parameters_manage_column_config %] >+ var CAN_user_parameters_manage_column_config = 1; >+[% ELSE %] >+ var CAN_user_parameters_manage_column_config = 0; >+[% END %] > </script> > > [% IF lang && lang != 'en' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 21dfe52636..c5f346f60e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -813,6 +813,17 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > } > ); > >+ if ( CAN_user_parameters_manage_column_config ) { >+ settings[ "buttons" ].push( >+ { >+ 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']; >+ }, >+ } >+ ); >+ } >+ > $(".dt_button_clear_filter, .columns_controls, .export_controls").tooltip(); > > if ( add_filters ) { >-- >2.20.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