From 9f8a2a65372c9c191046969e4d84e23a681c8e86 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 8 Aug 2005 14:32:58 +0000 Subject: [PATCH] Ajout test sur le nombre de valeur --- scripts/energie/graph.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/energie/graph.php b/scripts/energie/graph.php index 16dad5a4e89..bcc529555dd 100644 --- a/scripts/energie/graph.php +++ b/scripts/energie/graph.php @@ -168,7 +168,8 @@ if ($resql_c) $file= DOL_DATA_ROOT."/energie/graph/day.".$obj_c->rowid.".png"; - $graph->Stroke($file); + if (sizeof($gdatas) > 2) + $graph->Stroke($file); $width = 450; $height = 300; @@ -204,7 +205,8 @@ if ($resql_c) $file= DOL_DATA_ROOT."/energie/graph/month.".$obj_c->rowid.".png"; - $graph->Stroke($file); + if (sizeof($gmdatas)) + $graph->Stroke($file); // Hebdomadaire $width = 750; @@ -238,7 +240,8 @@ if ($resql_c) $file= DOL_DATA_ROOT."/energie/graph/week.".$obj_c->rowid.".png"; - $graph->Stroke($file); + if (sizeof($gwdatas)) + $graph->Stroke($file); // Annuel $width = 450; @@ -272,11 +275,13 @@ if ($resql_c) $file= DOL_DATA_ROOT."/energie/graph/year.".$obj_c->rowid.".png"; - $graph->Stroke($file); + if (sizeof($gydatas)) + $graph->Stroke($file); } else { dolibarr_syslog("Erreur SQL"); + dolibarr_syslog("$sql"); } $i_c++; } @@ -285,6 +290,7 @@ if ($resql_c) else { dolibarr_syslog("Erreur SQL"); + dolibarr_syslog($db->error($resql_c)); }