Fix: Echec génération images car répertoire inexistant.
This commit is contained in:
parent
44dc622723
commit
b5cc17953f
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -17,11 +18,21 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/rapport/Atome.class.php
|
||||
\brief Fichier de la classe mère Atome de génération de rapports
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/bargraph.class.php';
|
||||
|
||||
|
||||
/**
|
||||
\class Atome
|
||||
\brief Classe mère des classes de génération des images de rapports
|
||||
*/
|
||||
|
||||
class Atome
|
||||
{
|
||||
var $id;
|
||||
@ -29,11 +40,11 @@ class Atome
|
||||
var $name;
|
||||
var $periode;
|
||||
var $graph_values;
|
||||
|
||||
/**
|
||||
* Initialisation de la classe
|
||||
*
|
||||
*/
|
||||
|
||||
function AtomeInitialize($periode, $name, $daystart)
|
||||
{
|
||||
$this->year = strftime("%Y", $daystart);
|
||||
@ -41,20 +52,21 @@ class Atome
|
||||
$this->periode = $periode;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function BarGraph()
|
||||
{
|
||||
$filename = DOL_DOCUMENT_ROOT.'/document/';
|
||||
$dir = DOL_DATA_ROOT.'/rapport/images/';
|
||||
if (! is_dir($dir)) create_exdir($dir);
|
||||
|
||||
$this->graph_values = array();
|
||||
|
||||
if ($this->periode == 'year')
|
||||
{
|
||||
$filename .= $this->name.$this->year.'.png';
|
||||
$filename = $dir . $this->name.$this->year.'.png';
|
||||
|
||||
for ($i = 0 ; $i < 12 ; $i++)
|
||||
{
|
||||
@ -73,7 +85,7 @@ class Atome
|
||||
|
||||
if ($this->periode == 'month')
|
||||
{
|
||||
$filename .= $this->name.$this->year.$this->month.'.png';
|
||||
$filename = $dir . $this->name.$this->year.$this->month.'.png';
|
||||
|
||||
$datex = mktime(12,0,0,$this->month, 1, $this->year);
|
||||
$i = 0;
|
||||
@ -108,5 +120,5 @@ class Atome
|
||||
|
||||
return $filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -87,7 +87,7 @@ print $img."<br>";
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user