From 25535445faacc00df197039dc7836f5c2246e134 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 23 Jan 2017 17:39:33 +0100 Subject: [PATCH] Order by agent and module in general reports, fix group reports - #24 --- 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 6bfe86cdd5..bbbc813ce0 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2148,8 +2148,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, @@ -2157,8 +2157,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 a81eb7099d..c37d96045f 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2478,6 +2478,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(