To enable use of custom directory
This commit is contained in:
parent
b2795a1a3e
commit
072b32262e
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -70,12 +71,13 @@ if ($action == 'specimen') // For orders
|
|||||||
$commande->thirdparty=$specimenthirdparty;
|
$commande->thirdparty=$specimenthirdparty;
|
||||||
|
|
||||||
// Charge le modele
|
// Charge le modele
|
||||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/supplier_order/pdf/";
|
$dir = "/includes/modules/supplier_order/pdf/";
|
||||||
$file = "pdf_".$modele.".modules.php";
|
$file = "pdf_".$modele.".modules.php";
|
||||||
if (file_exists($dir.$file))
|
$file = dol_buildpath($dir.$file);
|
||||||
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$classname = "pdf_".$modele;
|
$classname = "pdf_".$modele;
|
||||||
require_once($dir.$file);
|
require_once($file);
|
||||||
|
|
||||||
$obj = new $classname($db,$commande);
|
$obj = new $classname($db,$commande);
|
||||||
|
|
||||||
@ -106,7 +108,7 @@ if ($action == 'specimenfacture') // For invoices
|
|||||||
$facture->thirdparty=$specimenthirdparty;
|
$facture->thirdparty=$specimenthirdparty;
|
||||||
|
|
||||||
// Charge le modele
|
// Charge le modele
|
||||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/supplier_invoice/pdf/";
|
$dir = "/includes/modules/supplier_invoice/pdf/";
|
||||||
$file = "pdf_".$modele.".modules.php";
|
$file = "pdf_".$modele.".modules.php";
|
||||||
if (file_exists($dir.$file))
|
if (file_exists($dir.$file))
|
||||||
{
|
{
|
||||||
@ -233,8 +235,6 @@ print "<br>";
|
|||||||
|
|
||||||
// Supplier order numbering module
|
// Supplier order numbering module
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT."/includes/modules/supplier_order/";
|
|
||||||
|
|
||||||
print_titre($langs->trans("OrdersNumberingModules"));
|
print_titre($langs->trans("OrdersNumberingModules"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -248,6 +248,12 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($conf->file->dol_document_root as $dirroot)
|
||||||
|
{
|
||||||
|
$dir = $dirroot . "/includes/modules/supplier_order/";
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
@ -259,7 +265,7 @@ if (is_resource($handle))
|
|||||||
{
|
{
|
||||||
$file = substr($file, 0, dol_strlen($file)-4);
|
$file = substr($file, 0, dol_strlen($file)-4);
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/supplier_order/".$file.".php");
|
require_once($dir.$file.".php");
|
||||||
|
|
||||||
$module = new $file;
|
$module = new $file;
|
||||||
|
|
||||||
@ -323,6 +329,8 @@ if (is_resource($handle))
|
|||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
@ -333,8 +341,6 @@ print '</table><br>';
|
|||||||
* Modeles documents for supplier orders
|
* Modeles documents for supplier orders
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/pdf/';
|
|
||||||
|
|
||||||
print_titre($langs->trans("OrdersModelModule"));
|
print_titre($langs->trans("OrdersModelModule"));
|
||||||
|
|
||||||
// Defini tableau def de modele
|
// Defini tableau def de modele
|
||||||
@ -373,9 +379,17 @@ print '</tr>'."\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($conf->file->dol_document_root as $dirroot)
|
||||||
|
{
|
||||||
|
$dir = $dirroot . "/includes/modules/supplier_order/pdf/";
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$var=true;
|
||||||
|
|
||||||
$handle=opendir($dir);
|
$handle=opendir($dir);
|
||||||
|
|
||||||
$var=true;
|
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
@ -450,6 +464,8 @@ if (is_resource($handle))
|
|||||||
|
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table><br/>';
|
print '</table><br/>';
|
||||||
|
|
||||||
@ -457,8 +473,6 @@ print '</table><br/>';
|
|||||||
* Modeles documents for supplier invoices
|
* Modeles documents for supplier invoices
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT.'/includes/modules/supplier_invoice/pdf/';
|
|
||||||
|
|
||||||
print_titre($langs->trans("BillsPDFModules"));
|
print_titre($langs->trans("BillsPDFModules"));
|
||||||
|
|
||||||
// Defini tableau def de modele
|
// Defini tableau def de modele
|
||||||
@ -497,8 +511,16 @@ print '</tr>'."\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
$handle=opendir($dir);
|
foreach ($conf->file->dol_document_root as $dirroot)
|
||||||
|
{
|
||||||
|
$dir = $dirroot . "/includes/modules/supplier_invoice/pdf/";
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
$handle=opendir($dir);
|
||||||
|
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle)) !== false)
|
while (($file = readdir($handle)) !== false)
|
||||||
@ -572,6 +594,8 @@ if (is_resource($handle))
|
|||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table><br/>';
|
print '</table><br/>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user