2014-01-10 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_visual_map.php: fixed the show simple values in
	the visualconsole editor from the old Pandora versions.
	
	Fixes: #2407




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9306 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-01-10 15:11:48 +00:00
parent db92b64223
commit c4f638e2ef
2 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2014-01-10 Miguel de Dios <miguel.dedios@artica.es>
* 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 <sergio.martin@artica.es>
* include/graphs/flot/pandora.flot.js

View File

@ -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 '<div id="' . $id . '" class="item simple_value" style="z-index: 1; left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
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 ' <span id="simplevalue_' . $id . '" style="font-weight:bold;">' . $value . '</span>';
}
//Restore db connection
if ($layoutData['id_metaconsole'] != 0) {