From 9d2f35e04aabf52c00f346df3525e48b966c7e9c Mon Sep 17 00:00:00 2001 From: Enrique Camargo Date: Mon, 23 Jan 2017 17:41:20 +0100 Subject: [PATCH] Merge branch '24-general-report-ordenar-por-nombre-de-agente-y-luego-por-nombre-modulo-integria-4367' into 'develop' Order by agent and module in general reports, fix group reports - #24 See merge request !73 --- pandora_console/include/functions_reporting.php | 10 ++++++---- pandora_console/include/functions_reporting_html.php | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index d737f0a2bb..a72f372695 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2170,8 +2170,8 @@ function reporting_group_report($report, $content) { $return["data"] = array(); - $events = events_get_group_events( - $content['id_group'], + $events = events_get_agent( + false, $content['period'], $report['datetime'], false, @@ -2179,8 +2179,10 @@ function reporting_group_report($report, $content) { false, false, false, - $metaconsole_on); - + false, + $content['id_group'], + true); + if (empty($events)) { $events = array(); } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 35bad17c28..5679a72d23 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2479,6 +2479,16 @@ function reporting_html_general(&$table, $item) { $table1->style[2] = 'text-align: left'; $table1->style[3] = 'text-align: left'; + /* Begin - Order by agent */ + + foreach ($item['data'] as $key => $row) { + $aux[$key] = $row['agent']; + } + + array_multisort($aux, SORT_ASC, $item['data']); + + /* End - Order by agent */ + foreach ($item['data'] as $row) { if ($item['date']['period'] != 0) { $table1->data[] = array(