diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f837d1d116..0f6a2281c7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-01-10 Miguel de Dios + + * include/functions_visual_map.php: fixed the show simple values in + the visualconsole editor from the old Pandora versions. + + Fixes: #2407 + 2014-01-09 Sergio Martin * include/graphs/flot/pandora.flot.js diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 8657a1a38c..6fe9365c3d 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -209,8 +209,9 @@ function visual_map_print_item($layoutData) { case SIMPLE_VALUE_MAX: case SIMPLE_VALUE_MIN: case SIMPLE_VALUE_AVG: + $io_safe_output_text = io_safe_output($text); echo '
'; - echo io_safe_output($text); + echo $io_safe_output_text; //Metaconsole db connection if ($layoutData['id_metaconsole'] != 0) { @@ -222,7 +223,26 @@ function visual_map_print_item($layoutData) { } } - $value = visual_map_get_simple_value($type, $id_module, $period); + $unit_text = db_get_sql ('SELECT unit + FROM tagente_modulo + WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']); + $unit_text = trim(io_safe_output($unit_text)); + + + $value = db_get_value ('datos', + 'tagente_estado', 'id_agente_modulo', $layoutData['id_agente_modulo']); + + // If the value is a string, dont format it + if (!is_string($value)) { + $value = format_for_graph($value, 2); + } + + if (!empty($unit_text)) + $value .= " " . $unit_text; + + if (strstr($io_safe_output_text, "(_VALUE_)") === false) { + echo ' ' . $value . ''; + } //Restore db connection if ($layoutData['id_metaconsole'] != 0) {