From 1b4f8c8939e3b3054531672651c6c9cd280bf1df Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 19 Aug 2011 15:33:41 +0000 Subject: [PATCH] 2011-08-19 Miguel de Dios * include/functions_graph.php: in function "graphic_agentaccess" fixed when the graph is empty, now show the standar Pandora image "no data to show". Fixes: #3393224 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4786 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/include/functions_graph.php | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 219f1f64bb..75e6b3b099 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-08-19 Miguel de Dios + + * include/functions_graph.php: in function "graphic_agentaccess" fixed when + the graph is empty, now show the standar Pandora image "no data to show". + + Fixes: #3393224 + 2011-08-19 Miguel de Dios * include/styles/menu.css, operation/menu.php, images/plotchart.png: move diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 55fb18fdfe..1737db1429 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -730,6 +730,7 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0) { $time = array (); $data = array (); + $empty_data = true; for ($i = 0; $i < $interval; $i++) { $bottom = $datelimit + ($periodtime * $i); if (! $graphic_type) { @@ -755,13 +756,21 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0) { 'utimestamp > '.$bottom, 'utimestamp < '.$top)); break; - } + } + + if ($data[$name]['data'] != 0) { + $empty_data = false; + } } - echo area_graph($config['flash_charts'], $data, $width, $height, - null, null, null, "images/image_problem.opaque.png", "", "", "", - $config['homedir'] . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size'], ""); + if ($empty_data) + echo fs_error_image(); + else { + echo area_graph($config['flash_charts'], $data, $width, $height, + null, null, null, "images/image_problem.opaque.png", "", "", "", + $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size'], ""); + } } /**