From b8528b83f8d87196f943702ef7daeb8907b02aa7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Feb 2005 21:08:37 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20G=E8re=20cas=20ou=20Imagemagick=20est=20?= =?UTF-8?q?install=E9=20dans=20/usr/local/bin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/dossier/client/fiche.php | 51 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/htdocs/dossier/client/fiche.php b/htdocs/dossier/client/fiche.php index b5be6fad13b..c98d75e8b1e 100644 --- a/htdocs/dossier/client/fiche.php +++ b/htdocs/dossier/client/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2005 Laurent Destailleur * * 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 @@ -20,6 +20,7 @@ * $Source$ * */ + require("./pre.inc.php"); require_once DOL_DOCUMENT_ROOT.'/client.class.php'; @@ -49,34 +50,32 @@ if ($user->societe_id > 0) if ($_GET["facid"]) { - require_once DOL_DOCUMENT_ROOT.'/facture.class.php'; - - $fac = new Facture($db); - $fac->fetch($_GET["facid"]); - - $file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf"; - $file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png"; - - if (file_exists($file_img)) + require_once DOL_DOCUMENT_ROOT.'/facture.class.php'; + + $fac = new Facture($db); + $fac->fetch($_GET["facid"]); + + $file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf"; + $file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png"; + + // Si image n'existe pas, on la genere + if (! file_exists($file_img)) { - print '
'; + $converttool=""; + if (file_exists("/usr/bin/convert")) $converttool="/usr/bin/convert"; + elseif (file_exists("/usr/local/bin/convert")) $converttool="/usr/local/bin/convert"; + if ($converttool) { + // Si convert est dispo + //print "x $file_img $converttool $file $file_img x"; + exec("$converttool $file $file_img"); + } } - else + + if (file_exists($file_img)) { - if ( exec("/usr/bin/convert $file $file_img")) - { - - if (file_exists($file_img)) - { - print '
'; - } - } - else - { - print "Erreur "; - } + print '
'; } - + } $db->close();