From b5868821ac4157955881975d31be501d6e556f09 Mon Sep 17 00:00:00 2001 From: Didier Gautheron Date: Fri, 11 Dec 2020 10:46:04 +0100 Subject: [PATCH] Bug 22038: Disable excel export if CurrencyFormat is FR DataTables excel export is broken if number decimal separator is a comma. Test plan: 1 - Set syspref CurrencyFormat to US 2 - Export as excel a table with decimal numbers, patrons list with fines for example. 3 - Open in libreoffice or excel, numbers are ok. 4 - Set syspref CurrencyFormat to FR 5 - Export and open again, number are wrong 25,10 is imported as 2510 6 - Apply patch 7 - Redo 1 to 4 8 - Excel export is not available with FR. --- .../prog/en/includes/columns_settings.inc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 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 9a5eb315f5..2287e66f34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -1,3 +1,4 @@ +[% USE Koha %] [% USE TablesSettings %] @@ -43,14 +44,6 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { var export_buttons = [ { - extend: 'excelHtml5', - text: _("Excel"), - exportOptions: { - columns: exportColumns, - format: export_format - }, - }, - { extend: 'csvHtml5', text: _("CSV"), exportOptions: { @@ -75,6 +68,18 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { }, } ]; + [% IF Koha.Preference("CurrencyFormat") != 'FR' %] + export_buttons.unshift ( + { + extend: 'excelHtml5', + text: _("Excel"), + exportOptions: { + columns: exportColumns, + format: export_format + }, + } + ) + [% END %] dt_parameters[ "buttons" ] = [ { -- 2.11.0