From cbc8630dfc2ebe3685f3a7fd35912b411687dc58 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 23 Jul 2020 16:52:24 +0200 Subject: [PATCH] Ent 5206 9287 exportacion a csv con dato con muchos decimales y miles trae confusion --- pandora_console/godmode/setup/setup_visuals.php | 9 +++++++++ pandora_console/include/functions_config.php | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 9ecbd495b1..227de5d50a 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1342,6 +1342,15 @@ $row++; $row++; + $decimal_separator = [ + '.' => '.', + ',' => ',', + ]; + $table_other->data[$row][0] = __('CSV decimal separator').ui_print_help_tip(__('Only for csv reports'), true); + $table_other->data[$row][1] = html_print_select($decimal_separator, 'csv_decimal_separator', $config['csv_decimal_separator'], '', '', '', true, false, false); + + $row++; + $table_other->data[$row][0] = __('Data multiplier to use in graphs/data'); $options_data_multiplier = []; $options_data_multiplier[0] = __('Use 1024 when module unit are bytes'); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index e8fc2a392c..3554f091ed 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1340,6 +1340,10 @@ function config_update_config() $error_update[] = __('CSV divider'); } + if (!config_update_value('csv_decimal_separator', (string) get_parameter('csv_decimal_separator', '.'))) { + $error_update[] = __('CSV decimal separator'); + } + if (!config_update_value('use_data_multiplier', get_parameter('use_data_multiplier', '1'))) { $error_update[] = __('Use data multiplier'); } @@ -2875,6 +2879,10 @@ function config_process_config() config_update_value('csv_divider', ';'); } + if (!isset($config['csv_decimal_separator'])) { + config_update_value('csv_decimal_separator', '.'); + } + if (!isset($config['use_data_multiplier'])) { config_update_value('use_data_multiplier', '1'); }