From 2e558150c15fe01ad6367a0c2e5ef01e1bca7c33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 Dec 2004 16:39:20 +0000 Subject: [PATCH] Doc: Plus de commentaires pour mieux comprendre la fonction --- htdocs/product/stats/fiche.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index 9cb36956fef..8c6de10c3bd 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -66,20 +66,27 @@ if ($_GET["id"]) if ( $result ) { + // Efface rep obsolete + if(is_dir(DOL_DOCUMENT_ROOT."/document/produits")) + rmdir(DOL_DOCUMENT_ROOT."/document/produits"); + + // Création répertoire pour images générées $dir = DOL_DOCUMENT_ROOT."/document/produit/".$product->id; if (! file_exists($dir)) { + umask(0); - if(is_dir(DOL_DOCUMENT_ROOT."/document/produits")) - rmdir(DOL_DOCUMENT_ROOT."/document/produits"); - //mkdir(DOL_DOCUMENT_ROOT."/document"); - if(!file_exists(DOL_DOCUMENT_ROOT."/document/produit")) + if(!file_exists(DOL_DOCUMENT_ROOT."/document/produit")) { + mkdir(DOL_DOCUMENT_ROOT."/document"); mkdir(DOL_DOCUMENT_ROOT."/document/produit"); + } if (! mkdir($dir, 0755)) { $mesg = $langs->trans("ErrorCanNotCreateDir",$dir); } } + + $img_propal_name = "propal12mois.png"; $filenbpropal = $dir . "/" . $img_propal_name; $filenbvente = $dir . "/vente12mois.png";