From 6332c80690ec7f79db7727678a596a9d7efd6041 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 4 Feb 2013 14:47:08 +0000 Subject: [PATCH] 2013-02-04 Miguel de Dios * include/functions_graph.php: re-enabled the baseline for the reports. Fixes: #3599961 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7573 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++++++ pandora_console/include/functions_graph.php | 25 ++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2d255f0e3a..7a9bddf060 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-02-04 Miguel de Dios + + * include/functions_graph.php: re-enabled the baseline for the + reports. + + Fixes: #3599961 + 2013-02-04 Miguel de Dios * godmode/reporting/reporting_builder.item_editor.php: fixed the diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 90c79a8b61..da135bad8b 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -450,11 +450,11 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, - $width, $height , $title = '', $unit_name = null, - $show_alerts = false, $avg_only = 0, $date = 0, $unit = '', - $baseline = 0, $return_data = 0, $show_title = true, $projection = false, - $adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '', - $show_unknown = false) { + $width, $height , $title = '', $unit_name = null, + $show_alerts = false, $avg_only = 0, $date = 0, $unit = '', + $baseline = 0, $return_data = 0, $show_title = true, $projection = false, + $adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '', + $show_unknown = false) { global $config; global $chart; @@ -589,9 +589,8 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, } // Get baseline data - //Baseline was replaced by compare graph feature $baseline_data = array(); - /*if ($baseline) { + if ($baseline) { $baseline_data = array (); if ($baseline == 1) { $baseline_data = enterprise_hook ('reporting_enterprise_get_baseline', array ($agent_module_id, $period, $width, $height , $title, $unit_name, $date)); @@ -599,9 +598,9 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $baseline_data = array (); } } - }*/ + } - if (empty($unit)){ + if (empty($unit)) { $unit = modules_get_unit($agent_module_id); } @@ -708,18 +707,18 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, global $critical_min; $series_suffix_str = ''; - if($compare !== false) { + if ($compare !== false) { $series_suffix = '2'; $series_suffix_str = ' ('.__('Previous').')'; // Build the data of the previous period - + grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $width, $height, $title, $unit_name, $show_alerts, $avg_only, $date-$period, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, $series_suffix, $series_suffix_str, $show_unknown); - + switch($compare) { case 'separated': // Store the chart calculated @@ -744,7 +743,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $show_alerts, $avg_only, $date, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, '', '', $show_unknown); - + if ($return_data) { return $data_returned; }