diff --git a/pandora_console/godmode/massive/massive_delete_policies_alerts.php b/pandora_console/godmode/massive/massive_delete_policies_alerts.php index d4976f83a1..564e2afba6 100644 --- a/pandora_console/godmode/massive/massive_delete_policies_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_policies_alerts.php @@ -68,8 +68,9 @@ if (is_ajax() === true) { $alerts = []; foreach ($ids_policies as $policie) { - foreach (policies_get_alerts($policie) as $row) { - $alerts[$row['id']] = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.policies_get_module_name($row['id_policy_module'])); + foreach (policies_get_alerts($policie, ['id_policy_module' => '<>0']) as $row) { + $name = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.policies_get_module_name($row['id_policy_module'])); + $alerts[$row['id'].'__'.policies_get_name($policie).' - '.$name] = $name; } } @@ -82,6 +83,9 @@ if (is_ajax() === true) { $actions = []; foreach ($array_alerts as $alert) { + $alert_policie = explode('__', $alert); + $alert_id = $alert_policie[0]; + $alert_name = $alert_policie[1]; $array_actions = db_get_all_rows_filter( 'tpolicy_alerts_actions', ['id_policy_alert' => $alert] @@ -91,7 +95,7 @@ if (is_ajax() === true) { 'talert_actions', ['id' => $row['id_alert_action']] ); - $actions[$row['id']] = $action['name']; + $actions[$row['id']] = $alert_name.' - '.$action['name']; } } @@ -193,6 +197,7 @@ $table->data[1][1] = html_print_label_input_block( ) ); +$table->colspan[2][0] = 2; $table->data[2][0] = html_print_label_input_block( __('Actions'), html_print_select( diff --git a/pandora_console/godmode/massive/massive_delete_policies_alerts_action_external.php b/pandora_console/godmode/massive/massive_delete_policies_alerts_action_external.php index 840326bd5a..a3d251ae09 100644 --- a/pandora_console/godmode/massive/massive_delete_policies_alerts_action_external.php +++ b/pandora_console/godmode/massive/massive_delete_policies_alerts_action_external.php @@ -69,7 +69,8 @@ if (is_ajax() === true) { $alerts = []; foreach ($ids_policies as $policie) { foreach (policies_get_alerts($policie, ['id_policy_module' => '0']) as $row) { - $alerts[$row['id']] = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.$row['name_extern_module']); + $name = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.$row['name_extern_module']); + $alerts[$row['id'].'__'.policies_get_name($policie).' - '.$name] = $name; } } @@ -82,6 +83,9 @@ if (is_ajax() === true) { $actions = []; foreach ($array_alerts as $alert) { + $alert_policie = explode('__', $alert); + $alert_id = $alert_policie[0]; + $alert_name = $alert_policie[1]; $array_actions = db_get_all_rows_filter( 'tpolicy_alerts_actions', ['id_policy_alert' => $alert] @@ -91,7 +95,7 @@ if (is_ajax() === true) { 'talert_actions', ['id' => $row['id_alert_action']] ); - $actions[$row['id']] = $action['name']; + $actions[$row['id']] = $alert_name.' - '.$action['name']; } } @@ -193,6 +197,7 @@ $table->data[1][1] = html_print_label_input_block( ) ); +$table->colspan[2][0] = 2; $table->data[2][0] = html_print_label_input_block( __('Actions'), html_print_select(