From 3c0a8aa881ec0aa7541127e8826e2aa361164408 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 10 Dec 2006 13:09:30 +0000 Subject: [PATCH] Ajout creation du repertoire --- scripts/cron/stock-graph.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/cron/stock-graph.php b/scripts/cron/stock-graph.php index d4439d56c1f..292c18fe120 100644 --- a/scripts/cron/stock-graph.php +++ b/scripts/cron/stock-graph.php @@ -41,6 +41,17 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++) $verbose = 3; } } +/* + * + */ +$dir = DOL_DATA_ROOT."/graph/entrepot"; +if (!is_dir($dir) ) +{ + if (! @mkdir($dir,0755)) + { + die ("Can't create $dir"); + } +} /* * */ @@ -108,7 +119,7 @@ require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/LinePlot.class.php"; foreach ($entrepots as $key => $ent) { - $file = DOL_DATA_ROOT."/graph/entrepot/entrepot-".$key."-".$year.".png"; + $file = $dir ."/entrepot-".$key."-".$year.".png"; $title = "Valorisation du stock de l'entrepot (euros HT) sur l'année ".$year; graph_datas($file, $title, $values[$key], $legends);