diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 577dfe82f1..6c1938e4d8 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -1746,11 +1746,22 @@ function get_group_alerts($id_group, $filter = '', $options = false, $filter .= ''; break; } + + //WHEN SELECT ALL TAGS TO FILTER ALERTS + + $modules_tags = count(db_process_sql('select * from ttag')); + + $modules_user_tags = count(explode(",", $tag)); + + if($modules_tags != $modules_user_tags){ + if ($tag) { + $filter .= ' AND (id_agent_module IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN ('.$tag.')))'; + } - if ($tag) { - $filter .= ' AND (id_agent_module IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN ('.$tag.')))'; } - + + //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.'))'; }