Merge branch 'ent-5206-9287-exportacion-a-csv-con-dato-con-muchos-decimales-y-miles-trae-confusion' into 'develop'

Ent 5206 9287 exportacion a csv con dato con muchos decimales y miles trae confusion

See merge request artica/pandorafms!3348
This commit is contained in:
Daniel Rodriguez 2020-07-23 16:52:24 +02:00
commit 00a4936077
2 changed files with 17 additions and 0 deletions

View File

@ -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');

View File

@ -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');
}