From be8f80c2e0cbd987c82ea419c8bcfd3fff813a54 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 17 Feb 2005 12:52:26 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20r=E9pertoires=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/stats/fiche.php | 45 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index 68c86297440..5f185501444 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (c) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -21,11 +21,11 @@ * */ -/** - \file htdocs/product/stats/fiche.php - \ingroup product - \brief Page des stats produits - \version $Revision$ +/*! + \file htdocs/product/stats/fiche.php + \ingroup product + \brief Page des stats produits + \version $Revision$ */ require("./pre.inc.php"); @@ -37,7 +37,6 @@ $langs->load("bills"); $types[0] = $langs->trans("Product"); $types[1] = $langs->trans("Service"); - if ($user->societe_id > 0) { $action = ''; @@ -49,11 +48,10 @@ else } -llxHeader(); +llxHeader('','Statistiques produits'); $mesg = ''; - /* * * @@ -67,14 +65,17 @@ if ($_GET["id"]) if ( $result ) { // Efface rep obsolete - if(is_dir(DOL_DOCUMENT_ROOT."/document/produits")) - rmdir(DOL_DOCUMENT_ROOT."/document/produits"); + if(is_dir(DOL_DOCUMENT_ROOT."/document/produits")) + rmdir(DOL_DOCUMENT_ROOT."/document/produits"); // Création répertoire pour images générées + // TODO A CORRIGER + $conf->produit->dir_images = DOL_DATA_ROOT.'/graph/produits'; + $dir = $conf->produit->dir_images."/".$product->id; + if (! file_exists($dir)) - { - + { umask(0); if(!file_exists($conf->produit->dir_images)) { mkdir($conf->produit->dir_images); @@ -84,7 +85,7 @@ if ($_GET["id"]) $mesg = $langs->trans("ErrorCanNotCreateDir",$dir); } } - + $img_propal_name = "propal12mois.png"; $filenbpropal = $dir . "/" . $img_propal_name; $filenbvente = $dir . "/vente12mois.png"; @@ -120,14 +121,14 @@ if ($_GET["id"]) $head[$h][1] = $langs->trans("Price"); $h++; - if($product->type == 0) - { - if ($conf->stock->enabled) - { - $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; - $head[$h][1] = $langs->trans('Stock'); - $h++; - } + if($product->type == 0) + { + if ($conf->stock->enabled) + { + $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; + $head[$h][1] = $langs->trans('Stock'); + $h++; + } if ($conf->fournisseur->enabled) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;