From e6f2f72a7d7635da4c13c41b6c391ccd4da3e7f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jul 2006 15:07:28 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Meilleur=20gestion=20erreur=20si=20libra?= =?UTF-8?q?irie=20jpgraph=20non=20trouv=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/banque/graph-solde.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/banque/graph-solde.php b/scripts/banque/graph-solde.php index c6ae1fba6b3..27f37ea5eea 100644 --- a/scripts/banque/graph-solde.php +++ b/scripts/banque/graph-solde.php @@ -41,15 +41,23 @@ $path=eregi_replace('graph-solde.php','',$_SERVER["PHP_SELF"]); require_once($path."../../htdocs/master.inc.php"); // Vérifie que chemin vers JPGRAHP est connu et defini $jpgraph -if (! defined('JPGRAPH_DIR') && ! defined('JPGRAPH_PATH')) +if (! $conf->global->JPGRAPH_DIR && ! defined('JPGRAPH_PATH')) { print 'Erreur: Définissez la constante JPGRAPH_PATH sur la valeur du répertoire contenant JPGraph'; exit; } -if (! defined('JPGRAPH_DIR')) define('JPGRAPH_DIR', JPGRAPH_PATH); -$jpgraphdir=JPGRAPH_DIR; +if (! $conf->global->JPGRAPH_DIR) $conf->global->JPGRAPH_DIR=JPGRAPH_PATH; +$jpgraphdir=$conf->global->JPGRAPH_DIR; if (! eregi('[\\\/]$',$jpgraphdir)) $jpgraphdir.='/'; +if (! file_exists($jpgraphdir."jpgraph.php")) +{ + print 'Erreur: Impossible de trouver les librairies graphiques.'."\n"; + print 'Vérifier la variable JPGRAPH_PATH'; + if ($conf->global->JPGRAPH_DIR) print ' ('.$conf->global->JPGRAPH_DIR.')'."\n"; + elseif (defined('JPGRAPH_PATH')) print ' ('.JPGRAPH_PATH.')'."\n"; + exit; +} include_once($jpgraphdir."jpgraph.php"); include_once($jpgraphdir."jpgraph_line.php");