From 138f187b51b0f688c2962a05804a13728f00f7b3 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 18 Oct 2017 17:29:10 +0200 Subject: [PATCH] Add hide no data item checkbox to report templates - open - #1326 --- .../include/functions_reporting.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) mode change 100644 => 100755 pandora_console/include/functions_reporting.php diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php old mode 100644 new mode 100755 index 8a47d2c7d2..ea3bfa4277 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -127,7 +127,7 @@ function reporting_make_reporting_data($report = null, $id_report, } $metaconsole_on = is_metaconsole(); - + $index_content = 0; foreach ($contents as $content) { $server_name = $content['server_name']; @@ -508,29 +508,41 @@ function reporting_make_reporting_data($report = null, $id_report, break; case 'agent_detailed_event': case 'event_report_agent': - $report['contents'][] = reporting_event_report_agent( + $report_control = reporting_event_report_agent( $report, $content, $type, $force_width_chart, $force_height_chart); + if($report_control['total_events'] == 0 && $content['hide_no_data'] == 1){ + continue; + } + $report['contents'][] = $report_control; break; case 'event_report_module': - $report['contents'][] = reporting_event_report_module( + $report_control = reporting_event_report_module( $report, $content, $type, $force_width_chart, $force_height_chart, $pdf); + if($report_control['total_events'] == 0 && $content['hide_no_data'] == 1){ + continue; + } + $report['contents'][] = $report_control; break; case 'event_report_group': - $report['contents'][] = reporting_event_report_group( + $report_control = reporting_event_report_group( $report, $content, $type, $force_width_chart, $force_height_chart); + if($report_control['total_events'] == 0 && $content['hide_no_data'] == 1){ + continue; + } + $report['contents'][] = $report_control; break; case 'top_n': $report['contents'][] = reporting_event_top_n( @@ -578,6 +590,7 @@ function reporting_make_reporting_data($report = null, $id_report, $pdf); break; } + $index_content++; } return reporting_check_structure_report($report);