From 61ab82d8083dc7b571253c3e3595a656df782672 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 29 Jun 2023 12:59:32 +0200 Subject: [PATCH] #10304 Fix action default in agent detail --- pandora_console/include/functions_ui.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 95a74394c4..1407dd3421 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1446,13 +1446,22 @@ function ui_format_alert_row( $actionText .= ''; - if ($actionDefault != '') { - $actionText .= db_get_sql( + if ($actionDefault !== '') { + $actionDefault_name = db_get_sql( sprintf( 'SELECT name FROM talert_actions WHERE id = %d', $actionDefault ) - ).' ('.__('Default').')'; + ); + foreach ($actions as $action) { + if ($actionDefault_name === $action['name']) { + $hide_actionDefault = true; + } + } + + if ($hide_actionDefault !== true) { + $actionText .= $actionDefault_name.' ('.__('Default').')'; + } } }