2009-08-31 16:31:26 PDT
I found a small bug on line 127 of pData.class.php
It only causes a problem on some systems though (I think its down to the level of PHP error reporting)
function AddPoint($Value,$Serie="Serie1",$Description="")
{
if (is_array($Value) && count($Value) == 1)
$Value = $Value[0];
$ID = 0;
for($i=0;$i<=count($this->Data);$i++)
// GT Fix - added isset($this->Data[$i]) && to if statement below
// otherwise you get Notice: Uninitialized string offset: 0 in /home/citri/public_html/moodle/blocks/mis_gateway/lib/pchart/pChart/pData.class.php on line 127
{ if(isset($this->Data[$i]) && isset($this->Data[$i][$Serie])) { $ID = $i+1; } }
if ( count($Value) == 1 )
{
$this->Data[$ID][$Serie] = $Value;
if ( $Description != "" )
$this->Data[$ID]["Name"] = $Description;
elseif (!isset($this->Data[$ID]["Name"]))
$this->Data[$ID]["Name"] = $ID;
}
else
{
foreach($Value as $key => $Val)
{
$this->Data[$ID][$Serie] = $Val;
if (!isset($this->Data[$ID]["Name"]))
$this->Data[$ID]["Name"] = $ID;
$ID++;
}
}
}