From b8c6922902ae76dd3e458c2904b4d73c04aab4e9 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 3 Jun 2021 12:04:25 +0200 Subject: [PATCH] minor fixes in report item --- .../reporting_builder.item_editor.php | 10 +++++++++- .../include/functions_reporting.php | 18 ++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index b77188a023..bffe894931 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -3139,6 +3139,10 @@ $class = 'databox filters'; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 65daf41679..a2ace0502a 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2310,7 +2310,7 @@ function reporting_agents_inventory($report, $content) } if ($es_agent_group_filter != 0) { - $search_sql .= ' AND tagente.id_grupo = '.$es_agent_group_filter; + $search_sql .= ' AND (tagente.id_grupo = '.$es_agent_group_filter.' OR tasg.id_group = '.$es_agent_group_filter.')'; } if ($es_agent_remote_conf != 0) { @@ -2331,7 +2331,7 @@ function reporting_agents_inventory($report, $content) tagente.remote FROM tagente LEFT JOIN tagent_secondary_group tasg ON tagente.id_agente = tasg.id_agent - INNER JOIN tagente_modulo tam + LEFT JOIN tagente_modulo tam ON tam.id_agente = tagente.id_agente WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s)) %s', @@ -2346,7 +2346,7 @@ function reporting_agents_inventory($report, $content) $servers_ids = [0]; } - $return['data'] = []; + $return_data = []; foreach ($servers_ids as $server_id) { if (is_metaconsole()) { @@ -2412,13 +2412,23 @@ function reporting_agents_inventory($report, $content) } } - $return['data'] = array_merge($return['data'], $agents); + $return_data[$server_id] = $agents; if (is_metaconsole()) { metaconsole_restore_db(); } } + $all_data = []; + + foreach ($return_data as $server_agents) { + foreach ($server_agents as $agent) { + $all_data[] = $agent; + } + } + + $return['data'] = $all_data; + return reporting_check_structure_content($return); }