diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 20bc55f2569..dfe3514227a 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -54,7 +54,11 @@ $stats = new CommandeStats($db, $socidp); $year = strftime("%Y", time()); $data = $stats->getNbCommandeByMonthWithPrevYear($year); -if (! is_dir($conf->commande->dir_images)) { mkdir($conf->commande->dir_images); } +if (! is_dir($conf->commande->dir_images)) +{ + mkdir($conf->commande->dir_output); + mkdir($conf->commande->dir_images); +} $filename = $conf->commande->dir_images."/nbcommande2year-".$year.".png"; $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=nbcommande2year-'.$year.'.png'; diff --git a/htdocs/includes/modules/modCommande.class.php b/htdocs/includes/modules/modCommande.class.php index 5d3c10540da..dd60ef8e8a6 100644 --- a/htdocs/includes/modules/modCommande.class.php +++ b/htdocs/includes/modules/modCommande.class.php @@ -89,6 +89,8 @@ class modCommande extends DolibarrModules */ function init() { + global $conf; + // Permissions $this->remove(); @@ -117,6 +119,10 @@ class modCommande extends DolibarrModules $this->rights[4][2] = 'd'; $this->rights[4][3] = 0; + // Dir + $this->dirs[0] = $conf->commande->dir_output; + $this->dirs[1] = $conf->commande->dir_images; + $sql = array(); return $this->_init($sql);