Merge branch 'ent-8208-bug-filtros-en-vista-de-alertas' into 'develop'

Fix monitoring alert detail filter for defautl actions

See merge request artica/pandorafms!4558
This commit is contained in:
vgilc 2022-01-25 10:24:42 +00:00
commit fa0e3c4abb
3 changed files with 8 additions and 7 deletions

View File

@ -2183,6 +2183,7 @@ 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 (is_array($options)) {

View File

@ -1203,7 +1203,7 @@ function ui_format_alert_row(
$actions = alerts_get_alert_agent_module_actions($alert['id'], false, $alert['server_data']['id']);
if (empty($actions) === false) {
if (empty($actions) === false || $actionDefault != '') {
$actionText = '<div><ul class="action_list">';
foreach ($actions as $action) {
$actionText .= '<div class="mrgn_btn_5px" ><span class="action_name"><li>'.$action['name'];
@ -1215,9 +1215,9 @@ function ui_format_alert_row(
}
$actionText .= '</ul></div>';
} else {
if ($actionDefault != '') {
$actionText = db_get_sql(
$actionText .= db_get_sql(
sprintf(
'SELECT name FROM talert_actions WHERE id = %d',
$actionDefault

View File

@ -420,17 +420,17 @@ if ($filter_standby == 'standby_on') {
if (is_metaconsole() === true) {
include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php';
if ($idAgent != 0) {
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user);
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user);
$countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
} else {
$id_groups = array_keys(
users_get_groups($config['id_user'], 'AR', false)
);
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter);
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter);
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
}
} else {
if ($idAgent != 0) {