diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 4f2430c1c7..c94c0f7025 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -284,9 +284,9 @@ if ($update_action) { } $values['module_action_threshold'] = (int) get_parameter('module_action_threshold_ajax'); - $values['id_alert_action'] = $id_module_action; + $values['id_alert_action'] = $id_action; - $result = alerts_update_alert_agent_module_action($id_action, $values); + $result = alerts_update_alert_agent_module_action($id_module_action, $values); if ($result) { db_pandora_audit('Alert management', 'Update action '.$id_action.' in alert '.$id_alert_module); } else { diff --git a/pandora_console/include/ajax/alert_list.ajax.php b/pandora_console/include/ajax/alert_list.ajax.php index fc46c66536..81313fc660 100644 --- a/pandora_console/include/ajax/alert_list.ajax.php +++ b/pandora_console/include/ajax/alert_list.ajax.php @@ -411,7 +411,11 @@ if ($show_update_action_menu) { $id_action = (int) get_parameter('id_action'); - $actions = alerts_get_alert_agent_module_actions($id_alert); + $own_groups = users_get_groups($config['id_user'], 'LW', true); + $filter_groups = ''; + $filter_groups = implode(',', array_keys($own_groups)); + $actions = alerts_get_alert_actions_filter(true, 'id_group IN ('.$filter_groups.')'); + $action_option = db_get_row( 'talert_template_module_actions', 'id', @@ -427,7 +431,7 @@ if ($show_update_action_menu) { ); $data .= html_print_input_hidden( 'id_module_action_ajax', - $id_module_action, + $id_action, true ); if (! $id_agente) { @@ -475,9 +479,9 @@ if ($show_update_action_menu) { $data .= html_print_select( $actions, 'action_select_ajax', - $id_action, + $action_option['id_alert_action'], '', - __('None'), + false, 0, true, false,