From 33d5dc2e765757d32d74c4bc0c5fd9bc0a1e1c8c Mon Sep 17 00:00:00 2001 From: Calvo Date: Tue, 5 Sep 2023 15:33:20 +0200 Subject: [PATCH] Fix group report metaconsole --- .../include/functions_reporting_html.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 588b9d44f4..4419248314 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2590,12 +2590,6 @@ function reporting_html_group_report($table, $item, $pdf=0) } } - if (is_metaconsole() && $item['server_name'] === '0') { - $table_agent = 'tmetaconsole_agent'; - } else { - $table_agent = 'tagente'; - } - $all_group_id = []; $group_events = []; $group_os = []; @@ -2638,13 +2632,13 @@ function reporting_html_group_report($table, $item, $pdf=0) $group_events = db_get_all_rows_sql( 'SELECT COUNT(te.id_evento) as count_events, ta.alias FROM tevento as te - INNER JOIN '.$table_agent.' as ta ON te.id_agente = ta.id_agente + INNER JOIN tagente as ta ON te.id_agente = ta.id_agente GROUP BY te.id_agente' ); $group_os = db_get_all_rows_sql( 'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo FROM tconfig_os as os - INNER JOIN '.$table_agent.' as ta ON ta.id_os = os.id_os GROUP by os.name' + INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name' ); } @@ -2729,7 +2723,7 @@ function reporting_html_group_report($table, $item, $pdf=0) ); $childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id); - $total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM '.$table_agent.' where id_grupo = '.$group_id); + $total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id); if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) { $array_group_id = []; @@ -2747,14 +2741,14 @@ function reporting_html_group_report($table, $item, $pdf=0) $group_events = db_get_all_rows_sql( 'SELECT COUNT(te.id_evento) as count_events, ta.alias FROM tevento as te - INNER JOIN '.$table_agent.' as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.') + INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.') GROUP BY te.id_agente' ); $group_os = db_get_all_rows_sql( 'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo FROM tconfig_os as os - INNER JOIN '.$table_agent.' as ta ON ta.id_os = os.id_os + INNER JOIN tagente as ta ON ta.id_os = os.id_os WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name' ); }