From 4aa311431732ba1fb93dbc987c341e07f942e7b4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 6 Sep 2011 12:32:26 +0000 Subject: [PATCH] 2011-09-06 Miguel de Dios * include/functions_graph.php: hidden the legend of datas with 0 value. Fixes: #3379756 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4916 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_graph.php | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3906178d4e..f52a6ccdea 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-09-06 Miguel de Dios + + * include/functions_graph.php: hidden the legend of datas with 0 value. + + Fixes: #3379756 + 2011-09-06 Miguel de Dios * operation/events/events_rss.php, operation/events/export_csv.php: fixed diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 467415bbde..7546b95cbe 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1322,18 +1322,33 @@ function grafico_eventos_total($filter = "") { $sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 0 $filter"; $data[__('Maintenance')] = db_get_sql ($sql); + if ($data[__('Maintenance')] == 0) { + unset($data[__('Maintenance')]); + } $sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 1 $filter"; $data[__('Informational')] = db_get_sql ($sql); + if ($data[__('Informational')] == 0) { + unset($data[__('Informational')]); + } $sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 2 $filter"; $data[__('Normal')] = db_get_sql ($sql); + if ($data[__('Normal')] == 0) { + unset($data[__('Normal')]); + } $sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 3 $filter"; $data[__('Warning')] = db_get_sql ($sql); + if ($data[__('Warning')] == 0) { + unset($data[__('Warning')]); + } $sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 4 $filter"; $data[__('Critical')] = db_get_sql ($sql); + if ($data[__('Critical')] == 0) { + unset($data[__('Critical')]); + } asort ($data);