From d120f6acdf8e9bb2ad0dc49b1acedb34fc1ea9dc Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 20 Jun 2012 17:11:53 +0000 Subject: [PATCH] 2012-06-20 Sergio Martin * include/functions_graph.php include/functions_reporting.php: Fixed layout issues in SLA reports and add ttl param to slice graphs function to pdf side Merged from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6634 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 ++++++ pandora_console/include/functions_graph.php | 4 +-- .../include/functions_reporting.php | 28 +++++++------------ 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a55cc8d87b..1afe9911c4 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2012-06-20 Sergio Martin + + * include/functions_graph.php + include/functions_reporting.php: Fixed layout issues in + SLA reports and add ttl param to slice graphs + function to pdf side + + Merged from 4.0.2 + 2012-06-20 Sancho Lerena * extensions/update_manager/sql/update_manager.sql: 4.0.2 comes with a fixed diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 3804303d82..168732e98a 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1014,14 +1014,14 @@ function progress_bubble($progress, $width, $height, $title = '', $mode = 1, $va "&colorRGB=". $colorRGB . "' />"; } -function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek = null, $time_from = null, $time_to = null, $width, $height, $home_url) { +function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek = null, $time_from = null, $time_to = null, $width, $height, $home_url, $ttl = 1) { global $config; $data = reporting_get_agentmodule_sla_array ($id, $period, $sla_min, $sla_max, $date, $daysWeek, $time_from, $time_to); $colors = array(1 => '#38B800', 2 => '#FFFF00', 3 => '#FF0000', 4 => '#C3C3C3'); return slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'], - $config['round_corner'], $home_url); + $config['round_corner'], $home_url, $ttl); } /** diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 5d1170f35c..2c9dcf5a40 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2394,11 +2394,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f if ($total_result_SLA != 'fail') $total_result_SLA = 'unknown'; } - else if ($sla_value >= $sla['sla_limit']) { - if ($total_result_SLA == 'ok') - $total_result_SLA = 'ok'; - } - else { + else if ($sla_value < $sla['sla_limit']) { $total_result_SLA = 'fail'; } @@ -2475,21 +2471,23 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f unset($table1->data[$i][6]); } - $table->colspan[2][0] = 3; + $next_row = 2; if ($show_graph == 0 || $show_graph == 1) { $data = array(); $data[0] = html_print_table($table1, true); array_push ($table->data, $data); + $table->colspan[$next_row][0] = 3; + $next_row++; } - $table->colspan[3][0] = 2; + $table->colspan[$next_row][0] = 2; + $next_row++; $data = array(); $data_pie_graph = json_encode ($data_graph); if (($show_graph == 1 || $show_graph == 2) && !empty($slas)) { $data[0] = pie3d_graph(false, $data_graph, 500, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png", - - $config['fontpath'], $config['font_size']); + $config['fontpath'], $config['font_size']); //Print resume @@ -2508,20 +2506,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table_resume->data[0][0] = ''; $table_resume->data[0][1] = ''.__('Unknown').''; } - $table_resume->data[0][0] .= (int)($total_SLA / count($slas)); + $table_resume->data[0][0] .= format_numeric($total_SLA / count($slas), 2); $table_resume->data[0][0] .= "%"; $data[1] = html_print_table($table_resume, true); - array_push ($table->data, $data); - //Display horizontal bar graphs - $days = array ('monday' => $content['monday'], 'tuesday' => $content['tuesday'], - 'wednesday' => $content['wednesday'], 'thursday' => $content['thursday'], - 'friday' => $content['friday'], 'saturday' => $content['saturday'], 'sunday' => $content['sunday']); - $daysWeek = json_encode ($days); - $table2->width = '99%'; $table2->style[0] = 'text-align: right'; $table2->data = array (); @@ -2537,7 +2528,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f array_push ($table2->data, $data); } - $table->colspan[4][0] = 3; + $table->colspan[$next_row][0] = 3; + $next_row++; $data = array(); $data[0] = html_print_table($table2, true); array_push ($table->data, $data);