From 9e75cce59f4e4af610c8a2dedf42b2fb12915833 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 12 May 2015 18:18:48 +0200 Subject: [PATCH] Some changes and fixed for the reports in PDF. --- .../include/functions_reporting.php | 101 ++++++++++++++++-- .../include/functions_reporting_html.php | 30 +----- 2 files changed, 92 insertions(+), 39 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 7162dd4405..21061981ec 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -406,7 +406,10 @@ function reporting_make_reporting_data($id_report, $date, $time, case 'event_report_group': $report['contents'][] = reporting_event_report_group( $report, - $content); + $content, + $type, + $force_width_chart, + $force_height_chart); break; case 'top_n': $report['contents'][] = reporting_event_top_n( @@ -1171,7 +1174,10 @@ function reporting_event_top_n($report, $content, $type = 'dinamic', return reporting_check_structure_content($return); } -function reporting_event_report_group($report, $content) { +function reporting_event_report_group($report, $content, + $type = 'dinamic', $force_width_chart = null, + $force_height_chart = null) { + global $config; $return['type'] = 'event_report_group'; @@ -1214,6 +1220,21 @@ function reporting_event_report_group($report, $content) { $return['data'] = $data; } + + + reporting_set_conf_charts($width, $height, $only_image, $type, + $content, $ttl); + + if (!empty($force_width_chart)) { + $width = $force_width_chart; + } + + if (!empty($force_height_chart)) { + $height = $force_height_chart; + } + + + $return['chart']['by_agent'] = null; $return['chart']['by_user_validator'] = null; $return['chart']['by_criticity'] = null; @@ -1230,9 +1251,16 @@ function reporting_event_report_group($report, $content) { $filter_event_filter_search); $return['chart']['by_agent']= pie3d_graph( - false, $data_graph, 500, 150, __("other"), "", + false, + $data_graph, + 500, + 150, + __("other"), + ui_get_full_url(false, false, false, false), ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size']); + $config['fontpath'], + $config['font_size'], + $ttl); } if ($event_graph_by_user_validator) { @@ -1247,9 +1275,16 @@ function reporting_event_report_group($report, $content) { $filter_event_filter_search); $return['chart']['by_user_validator'] = pie3d_graph( - false, $data_graph, 500, 150, __("other"), "", + false, + $data_graph, + 500, + 150, + __("other"), + ui_get_full_url(false, false, false, false), ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size']); + $config['fontpath'], + $config['font_size'], + $ttl); } if ($event_graph_by_criticity) { @@ -1265,9 +1300,18 @@ function reporting_event_report_group($report, $content) { $colors = get_criticity_pie_colors($data_graph); $return['chart']['by_criticity'] = pie3d_graph( - false, $data_graph, 500, 150, __("other"), "", + false, + $data_graph, + 500, + 150, + __("other"), + ui_get_full_url(false, false, false, false), ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size'], 1, false, $colors); + $config['fontpath'], + $config['font_size'], + $ttl, + false, + $colors); } if ($event_graph_validated_vs_unvalidated) { @@ -1282,9 +1326,16 @@ function reporting_event_report_group($report, $content) { $filter_event_filter_search); $return['chart']['validated_vs_unvalidated'] = pie3d_graph( - false, $data_graph, 500, 150, __("other"), "", + false, + $data_graph, + 500, + 150, + __("other"), + ui_get_full_url(false, false, false, false), ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size']); + $config['fontpath'], + $config['font_size'], + $ttl); } return reporting_check_structure_content($return); @@ -6334,4 +6385,34 @@ function reporting_get_planned_downtimes_intervals ($id_agent_module, $start_dat return $downtime_dates; } + +/** + * Gets a detailed reporting of groups's events. + * + * @param unknown_type $id_group Id of the group. + * @param unknown_type $period Time period of the report. + * @param unknown_type $date Date of the report. + * @param unknown_type $return Whether to return or not. + * @param unknown_type $html Whether to return HTML code or not. + * + * @return string Report of groups's events + */ +function reporting_get_count_events_by_agent ($id_group, $period = 0, + $date = 0, + $filter_event_validated = false, $filter_event_critical = false, + $filter_event_warning = false, $filter_event_no_validated = false, + $filter_event_filter_search = null) { + + if (!is_numeric ($date)) { + $date = strtotime ($date); + } + if (empty ($date)) { + $date = get_system_time (); + } + + return events_get_count_events_by_agent($id_group, $period, $date, + $filter_event_validated, $filter_event_critical, + $filter_event_warning, $filter_event_no_validated, + $filter_event_filter_search); +} ?> \ No newline at end of file diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 9c571475e0..3c2fce6db9 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -3603,35 +3603,7 @@ function reporting_template_graphs_get_user ($id_user = 0, $only_names = false, return $templates; } -/** - * Gets a detailed reporting of groups's events. - * - * @param unknown_type $id_group Id of the group. - * @param unknown_type $period Time period of the report. - * @param unknown_type $date Date of the report. - * @param unknown_type $return Whether to return or not. - * @param unknown_type $html Whether to return HTML code or not. - * - * @return string Report of groups's events - */ -function reporting_get_count_events_by_agent ($id_group, $period = 0, - $date = 0, - $filter_event_validated = false, $filter_event_critical = false, - $filter_event_warning = false, $filter_event_no_validated = false, - $filter_event_filter_search = null) { - - if (!is_numeric ($date)) { - $date = strtotime ($date); - } - if (empty ($date)) { - $date = get_system_time (); - } - - return events_get_count_events_by_agent($id_group, $period, $date, - $filter_event_validated, $filter_event_critical, - $filter_event_warning, $filter_event_no_validated, - $filter_event_filter_search); -} +