2009-06-29 Miguel de Dios <miguel.dedios@artica.es>
* reporting/pChart/pData.class: fix lost var ($url) in function grafico_eventos_grupo and at constants. * reporting/fgraph.php: fix, it's assumed that the arrays was numerical indexes. Fixes: #2805807 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1774 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c2c2c00bdd
commit
49a9b30682
|
@ -1,3 +1,11 @@
|
|||
2009-06-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* reporting/pChart/pData.class: fix lost var ($url) in
|
||||
function grafico_eventos_grupo and at constants.
|
||||
* reporting/fgraph.php: fix, it's assumed that the arrays was numerical
|
||||
indexes.
|
||||
Fixes: #2805807
|
||||
|
||||
2009-06-25 Manuel Arostegui <marostegui@artica.es>
|
||||
|
||||
* pandora_console.spec: RPM spec file for 3.0 version.
|
||||
|
|
|
@ -668,6 +668,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
|
|||
$url = html_entity_decode (rawurldecode ($url), ENT_QUOTES); //It was urlencoded, so we urldecode it
|
||||
$data = array ();
|
||||
$loop = 0;
|
||||
define (NUM_PIECES_PIE, 6);
|
||||
|
||||
$badstrings = array (";", "SELECT ", "DELETE ", "UPDATE ", "INSERT ", "EXEC");
|
||||
//remove bad strings from the query so queries like ; DELETE FROM don't pass
|
||||
|
@ -679,6 +680,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
|
|||
$sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count
|
||||
FROM tevento WHERE 1=1 %s
|
||||
GROUP BY id_agente ORDER BY count DESC', $url);
|
||||
|
||||
$result = get_db_all_rows_sql ($sql);
|
||||
if ($result === false) {
|
||||
$result = array();
|
||||
|
@ -688,7 +690,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
|
|||
if (!give_acl ($config["id_user"], $row["id_grupo"], "AR") == 1)
|
||||
continue;
|
||||
|
||||
if ($loop > 5) {
|
||||
if ($loop >= NUM_PIECES_PIE) {
|
||||
if (!isset ($data[__('Other')]))
|
||||
$data[__('Other')] = 0;
|
||||
$data[__('Other')] += $row["count"];
|
||||
|
@ -702,6 +704,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
|
|||
}
|
||||
$loop++;
|
||||
}
|
||||
|
||||
error_reporting (0);
|
||||
generic_pie_graph ($width, $height, $data, array ('show_legend' => false));
|
||||
}
|
||||
|
@ -1080,6 +1083,7 @@ $stacked = get_parameter ("stacked", 0);
|
|||
$date = get_parameter ("date");
|
||||
$graphic_type = (string) get_parameter ('tipo');
|
||||
$mode = get_parameter ("mode", 1);
|
||||
$url = get_parameter ("url");
|
||||
|
||||
if ($graphic_type) {
|
||||
switch ($graphic_type) {
|
||||
|
@ -1116,7 +1120,7 @@ if ($graphic_type) {
|
|||
|
||||
break;
|
||||
case "group_events":
|
||||
grafico_eventos_grupo ($width, $height);
|
||||
grafico_eventos_grupo ($width, $height,$url);
|
||||
|
||||
break;
|
||||
case "user_events":
|
||||
|
|
|
@ -118,9 +118,10 @@
|
|||
}
|
||||
|
||||
function AddPoint($Value,$Serie="Serie1",$Description="")
|
||||
{
|
||||
{//echo "#$Serie#";print_r($Value);
|
||||
if (is_array($Value) && count($Value) == 1)
|
||||
$Value = $Value[0];
|
||||
$Value = reset($Value); //In previous releases has a bug, because it's
|
||||
//assumed that array have a numerical indexes, now take the first simply.
|
||||
|
||||
$ID = 0;
|
||||
for($i=0;$i<=count($this->Data);$i++)
|
||||
|
|
Loading…
Reference in New Issue