From ec3fc2c19e500ad113eebe0ac50186cd0a6bdc3b Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sat, 10 Dec 2011 11:48:45 +0100 Subject: [PATCH] fix: specimen wasn't displayed when modele was in custom directory --- htdocs/admin/commande.php | 8 +++++--- htdocs/admin/fichinter.php | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index b3e4f2563c5..31756a2c67f 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -7,6 +7,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011 Philippe Grand * * 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 @@ -72,12 +73,13 @@ if ($action == 'specimen') $commande->initAsSpecimen(); // Charge le modele - $dir = DOL_DOCUMENT_ROOT . "/core/modules/commande/"; + $dir = "/core/modules/commande/"; $file = "pdf_".$modele.".modules.php"; - if (file_exists($dir.$file)) + $file = dol_buildpath($dir.$file); + if (file_exists($file)) { $classname = "pdf_".$modele; - require_once($dir.$file); + require_once($file); $obj = new $classname($db); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 920024d01cf..13dc63c2c6b 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011 Philippe Grand * * 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 @@ -106,12 +107,13 @@ if ($action == 'specimen') $inter->initAsSpecimen(); // Charge le modele - $dir = DOL_DOCUMENT_ROOT . "/core/modules/fichinter/"; + $dir = "/core/modules/fichinter/"; $file = "pdf_".$modele.".modules.php"; - if (file_exists($dir.$file)) + $file = dol_buildpath($dir.$file); + if (file_exists($file)) { $classname = "pdf_".$modele; - require_once($dir.$file); + require_once($file); $obj = new $classname($db);