diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 570e158637..03eb189666 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-07-07 Miguel de Dios + + * include/functions_visual_map.php: show in the tooltip of + "static graph" the last value of module. + + INCIDENT: #1014 + 2014-07-07 Miguel de Dios * godmode/setup/license.php: fixed the white screen. diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 5500fdcc72..3398090b91 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -114,9 +114,11 @@ function visual_map_print_item($layoutData) { echo '
'; if ($layoutData['image'] != null) { if (($width != 0) && ($height != 0)) - echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "width" => "$width", "height" => "$height", "style" => $borderStyle)); + echo html_print_image($img, true, + array("class" => "image", "id" => "image_" . $id, "width" => "$width", "height" => "$height", "style" => $borderStyle)); else - echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "style" => $borderStyle)); + echo html_print_image($img, true, + array("class" => "image", "id" => "image_" . $id, "style" => $borderStyle)); echo '
'; } echo io_safe_output($text); @@ -1299,7 +1301,27 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line } $img_style = array (); + $img_style["title"] = strip_tags($layout_data["label"]); + if ($layout_data['type'] == STATIC_GRAPH) { + if ($layout_data['id_agente_modulo'] != 0) { + $unit_text = trim(io_safe_output( + modules_get_unit($layout_data['id_agente_modulo']))); + + $value = modules_get_last_value($layout_data['id_agente_modulo']); + + if (!is_string($value)) { + $value = format_for_graph($value, 2); + } + + if (!empty($unit_text)) + $value .= " " . $unit_text; + + $img_style["title"] .= "
" . __("Last value: ") . + $value; + } + } + if (!empty ($layout_data["width"])) { $img_style["width"] = $layout_data["width"];