From 8000f4cf928a216fa33130480341a25a9aa0680b Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Fri, 13 Mar 2020 14:21:25 +0100 Subject: [PATCH] changed event count in group report --- .../include/functions_reporting.php | 26 +++++++++---------- .../include/functions_reporting_html.php | 6 +---- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 040d806898..57db71d31b 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2880,19 +2880,19 @@ function reporting_group_report($report, $content) $return['data'] = []; - $events = events_get_agent( - false, - $content['period'], - $report['datetime'], - false, - true, - false, - false, - false, - false, - $content['id_group'], - true - ); + $id_group = groups_safe_acl($config['id_user'], $content['id_group'], 'ER'); + + if (empty($id_group)) { + $events = []; + } else { + $sql_where = sprintf(' AND id_grupo IN (%s) AND estado<>1 ', implode(',', $id_group)); + $events = events_get_events_grouped( + $sql_where, + 0, + 1000, + is_metaconsole() + ); + } if (empty($events)) { $events = []; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index f859eb8f32..07ec0977ea 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1920,11 +1920,7 @@ function reporting_html_group_report($table, $item, $pdf=0) ".$item['data']['group_stats']['monitor_alerts_fired']." - - ".__('Last %s', human_time_description_raw($item['date']['period']))." - - - ".__('Events')." + ".__('Events (not validated)')." ".$item['data']['count_events'].' ';