mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-05 08:32:53 +01:00
Fix: possibility to use models of external modules
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@@ -181,23 +181,31 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
|
||||
$modele=$tmp[0];
|
||||
$srctemplatepath=$tmp[1];
|
||||
}
|
||||
|
||||
// Search template file
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
foreach(array('doc','pdf') as $prefix)
|
||||
{
|
||||
$file = $prefix."_".$modele.".modules.php";
|
||||
|
||||
// On verifie l'emplacement du modele
|
||||
$file = dol_buildpath($dir.'doc/'.$file);
|
||||
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname=$prefix.'_'.$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is external models to do asked by plugins
|
||||
if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
|
||||
$conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
|
||||
}
|
||||
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
{
|
||||
// Search template file
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
foreach(array('doc','pdf') as $prefix)
|
||||
{
|
||||
$file = $prefix."_".$modele.".modules.php";
|
||||
|
||||
// On verifie l'emplacement du modele
|
||||
$file = $dirroot.$dir.'doc/'.$file;
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname=$prefix.'_'.$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($filefound) break;
|
||||
}
|
||||
|
||||
// Charge le modele
|
||||
if ($filefound)
|
||||
|
||||
Reference in New Issue
Block a user