10048 Exclude id_alert_action from query

This commit is contained in:
Pablo Aragon 2022-12-23 10:29:18 +01:00
parent c25ad3d4ea
commit fe548936a0
2 changed files with 8 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -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
);
hd($sql, true);
$alerts = db_get_all_rows_sql($sql);
if ($alerts === false) {