@@ -, +, @@ tables --- 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(-) --- a/Koha/Template/Plugin/TablesSettings.pm +++ a/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 || {} ) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ a/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 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -29,6 +29,11 @@ [% IF lang && lang != 'en' %] --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ a/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 ) { --