From 94256559f1de1a32ceef0de36473dee843a4bd4e Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 11 Dec 2023 16:46:19 +0100 Subject: [PATCH] #11495 Fix agent name in metaconsole module selector --- .../reporting/reporting_builder.item_editor.php | 2 +- pandora_console/include/functions_agents.php | 4 ++-- pandora_console/include/functions_modules.php | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index c9fa71860c..06652894ca 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2335,7 +2335,7 @@ if (is_metaconsole() === true) { $modulegroup, $id_agents, !$selection_a_m, - false + true ); } diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 2d6803ccd4..3f9bd48955 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -3664,7 +3664,7 @@ function select_modules_for_agent_group( $sql = "SELECT * FROM ( - SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.nombre + SELECT (tagente_modulo.id_agente_modulo), tagente_modulo.nombre, tagente.alias FROM tagente_modulo $sql_tags_inner INNER JOIN tagente @@ -3679,7 +3679,7 @@ function select_modules_for_agent_group( $filter_not_string_modules $sql_conditions_tags ) x - GROUP BY nombre + $selection_filter"; $modules = db_get_all_rows_sql($sql); diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index ea776d6fe3..2955cdd4f7 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -3774,9 +3774,15 @@ function get_modules_agents( $t['id_node'] = $tserver; if ($nodes[$tserver] !== null) { - $t['nombre'] = io_safe_output( - $nodes[$tserver]->server_name().' » '.$t['nombre'] - ); + if (isset($t['alias']) === true) { + $t['nombre'] = io_safe_output( + $nodes[$tserver]->server_name().' » '.$t['alias'].' » '.$t['nombre'] + ); + } else { + $t['nombre'] = io_safe_output( + $nodes[$tserver]->server_name().' » '.$t['nombre'] + ); + } } $carry[] = $t;