diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8835fae988..c5fd3ee593 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2008-09-03 Sancho Lerena + + * reporting/fgraph.php: In grafico_eventos_grupo() array_multisort + was not working as expected. Using a SORT sentence in SQL that provides + the same functionality. + 2008-09-03 Sancho Lerena * reporting/fgraph.php: URL passed should don't get slashes or diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index c2c48f89f4..f90fe89ff6 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -1369,7 +1369,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") { //This will give the distinct id_agente, give the id_grupo that goes //with it and then the number of times it occured. GROUP BY statement //is required if both DISTINCT() and COUNT() are in the statement - $sql = "SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count FROM tevento WHERE 1=1 ".$url." GROUP BY id_agente"; + $sql = "SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count FROM tevento WHERE 1=1 ".$url." GROUP BY id_agente ORDER BY count DESC"; $result = get_db_all_rows_sql ($sql); if ($result === false) $result = array(); @@ -1387,8 +1387,6 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") { } } - array_multisort ($legend, $data); - $max_items = 6; //Maximum items on the piegraph while (count($data) > $max_items) { //Pops an element off the array until the array is small enough