From ba1f33e6ae69e9e1e499b5fedee299211580469f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 23 Jan 2019 16:40:44 +0000 Subject: [PATCH] Bug 22195: Change default DataTables configuration to consolidate buttons This patch changes the default DataTables configuration provided by the columns settings include file. It consolidates DataTables buttons into to menus: One for column configuration and one for export options. This change would not affect tables which aren't set up for column configuration. To test, apply the patch and view a page with columns configuration. Example: Tools -> Notices & slips - Confirm that the buttons appear as expected. - Confirm that each button menu performs its task correctly (column visiblity, export, print). - Test other pages with columns configuration. For instance: Acquisitions order search, Currencies administration, Holds queue Signed-off-by: David Nind Signed-off-by: Jose-Mario Monteiro-Santos Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../prog/en/includes/columns_settings.inc | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) 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 7aa51cda75..f88f516e8c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -27,15 +27,7 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { exportColumns = dt_parameters["exportColumns"]; } - dt_parameters[ "buttons" ] = [ - { - extend: 'colvis', - columns: included_ids, - text: _("Column visibility"), - exportOptions: { - columns: exportColumns - }, - }, + var export_buttons = [ { extend: 'excelHtml5', text: _("Excel"), @@ -63,7 +55,26 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { exportOptions: { columns: exportColumns }, + } + ]; + + dt_parameters[ "buttons" ] = [ + { + extend: 'colvis', + fade: 100, + columns: included_ids, + text: '', + exportOptions: { + columns: exportColumns + }, }, + { + extend: 'collection', + fade: 100, + text: '', + buttons: export_buttons + } + ]; var table = $(selector); -- 2.39.5