fix : warning error if no graphfiles

append when we have no element present (start from new)
This commit is contained in:
BENKE Charlie 2016-07-20 01:53:06 +02:00 committed by GitHub
parent 3fb80d9678
commit f54bc367a4

View File

@ -244,7 +244,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
$px = new DolGraph(); $px = new DolGraph();
if (! $error) if (! $error && count($graphfiles)>0)
{ {
$mesg = $px->isGraphKo(); $mesg = $px->isGraphKo();
if (! $mesg) if (! $mesg)
@ -301,6 +301,8 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
// Show graphs // Show graphs
$i=0; $i=0;
if ( count($graphfiles)>0)
{
foreach($graphfiles as $key => $val) foreach($graphfiles as $key => $val)
{ {
if (! $graphfiles[$key]['file']) continue; if (! $graphfiles[$key]['file']) continue;
@ -360,6 +362,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
$i++; $i++;
} }
}
// div not closed // div not closed
if ($i % 2 == 1) if ($i % 2 == 1)
{ {