diff --git a/pandora_console/include/ajax/alert_list.ajax.php b/pandora_console/include/ajax/alert_list.ajax.php index a4bbea1071..a92ba9f9d9 100644 --- a/pandora_console/include/ajax/alert_list.ajax.php +++ b/pandora_console/include/ajax/alert_list.ajax.php @@ -884,9 +884,9 @@ if ($get_agent_alerts_datatable === true) { users_get_groups($config['id_user'], $access, false) ); - $alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter); + $alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, false); - $countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter); + $countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, false); } } diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 0a8628e54d..9921419c8b 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2101,7 +2101,8 @@ function get_group_alerts( $count=false, $strict_user=false, $tag=false, - $action_filter=false + $action_filter=false, + $alert_action=true ) { global $config; @@ -2162,7 +2163,9 @@ function get_group_alerts( // WHEN SELECT ALL TAGS TO FILTER ALERTS if ($action_filter) { $filter .= ' AND (talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions where id_alert_action = '.$action_filter.'))'; - $filter .= ' OR talert_template_modules.id_alert_template IN (SELECT talert_templates.id FROM talert_templates where talert_templates.id_alert_action = '.$action_filter.')'; + if ($alert_action) { + $filter .= ' OR talert_template_modules.id_alert_template IN (SELECT talert_templates.id FROM talert_templates where talert_templates.id_alert_action = '.$action_filter.')'; + } } if (is_array($options)) { @@ -2252,6 +2255,7 @@ function get_group_alerts( $filter, $orderbyText ); + $alerts = db_get_all_rows_sql($sql); if ($alerts === false) {