From d79137148c79bc955e73a149e33dc753fa09de1b Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 28 Jan 2020 10:06:46 +0100 Subject: [PATCH] fix bug in group alert report data visualization --- .../include/functions_reporting.php | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 00909b8d08..61b367ea74 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3821,10 +3821,15 @@ function reporting_alert_report_group($report, $content) foreach ($actions['custom'] as $action) { $data_action[$naction]['name'] = $action['name']; $fired = $action['fired']; - if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)) { + + if ($fired == 0) { $data_action[$naction]['fired'] = '----------------------------'; - } else { - $data_action[$naction]['fired'] = $fired; + } else if ($fired > 0) { + if ($fired > $datelimit && $fired < $datetime) { + $data_action[$naction]['fired'] = $fired; + } else { + continue 2; + } } $naction++; @@ -3833,10 +3838,15 @@ function reporting_alert_report_group($report, $content) foreach ($actions['default'] as $action) { $data_action[$naction]['name'] = $action['name']; $fired = $action['fired']; - if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)) { + + if ($fired == 0) { $data_action[$naction]['fired'] = '----------------------------'; - } else { - $data_action[$naction]['fired'] = $fired; + } else if ($fired > 0) { + if ($fired > $datelimit && $fired < $datetime) { + $data_action[$naction]['fired'] = $fired; + } else { + continue 2; + } } $naction++; @@ -3845,10 +3855,15 @@ function reporting_alert_report_group($report, $content) foreach ($actions['unavailable'] as $action) { $data_action[$naction]['name'] = $action['name']; $fired = $action['fired']; - if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)) { + + if ($fired == 0) { $data_action[$naction]['fired'] = '----------------------------'; - } else { - $data_action[$naction]['fired'] = $fired; + } else if ($fired > 0) { + if ($fired > $datelimit && $fired < $datetime) { + $data_action[$naction]['fired'] = $fired; + } else { + continue 2; + } } $naction++;