From 4babcbe647b638ca1a57303606efbc5adc0c8262 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Oct 2020 18:25:04 +0200 Subject: [PATCH] Forced recursion while selecting All group - group_alert_report --- .../reporting/reporting_builder.item_editor.php | 14 ++++++++++++++ pandora_console/include/functions_reporting.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index db1303d907..dfdc05c1fc 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -3744,6 +3744,19 @@ $(document).ready (function () { $("#combo_group").change ( function () { + + // Alert report group must show all matches when selecting All group + // ignoring 'recursion' option. #6497. + if ($('#type').val() == 'alert_report_group' + && $("#combo_group").val() == 0 + ) { + $('#checkbox-recursion').attr('disabled',true) + $('#checkbox-recursion').attr('checked','checked') + } else { + $('#checkbox-recursion').removeAttr('checked') + $('#checkbox-recursion').removeAttr('disabled') + } + $("#id_agents").html(''); $("#id_agents2").html(''); $("#module").html(''); @@ -3772,6 +3785,7 @@ $(document).ready (function () { ); } ); + $("#combo_group").change(); $("#checkbox-recursion").change ( function () { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 0bfe96e864..3c5aa9c66b 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3912,7 +3912,7 @@ function reporting_alert_report_group($report, $content) $agent_modules = alerts_get_agent_modules( $content['id_group'], - $content['recursion'] + (((string) $content['id_group'] === '0') ? true : $content['recursion']) ); if (empty($alerts)) {