New: parametre de config des repertoires dans les proprietes de la classe du module
avec un rpertoire parent en fonction de l'entit
This commit is contained in:
parent
3d149a33ca
commit
2356abb5c4
@ -160,12 +160,9 @@ class Conf
|
||||
|
||||
// Sous module bons d'expedition
|
||||
$this->expedition_bon->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
|
||||
$this->expedition_bon->dir_output=DOL_DATA_ROOT."/expedition/sending";
|
||||
$this->expedition_bon->dir_temp =DOL_DATA_ROOT."/expedition/sending/temp";
|
||||
|
||||
// Sous module bons de livraison
|
||||
$this->livraison_bon->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0;
|
||||
$this->livraison_bon->dir_output=DOL_DATA_ROOT."/expedition/receipt";
|
||||
$this->livraison_bon->dir_temp =DOL_DATA_ROOT."/expedition/receipt/temp";
|
||||
|
||||
// Module societe
|
||||
if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $this->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
||||
|
||||
@ -240,7 +240,7 @@ if ($modulepart)
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->expedition_bon->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->expedition->dir_bon_expedition.'/'.$original_file;
|
||||
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ if ($modulepart)
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->livraison_bon->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->expedition->dir_bon_livraison.'/'.$original_file;
|
||||
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
|
||||
}
|
||||
|
||||
|
||||
@ -848,7 +848,7 @@ else
|
||||
if ($conf->expedition_bon->enabled)
|
||||
{
|
||||
$expeditionref = sanitizeFileName($expedition->ref);
|
||||
$filedir = $conf->expedition_bon->dir_output . "/" .$expeditionref;
|
||||
$filedir = $conf->expedition->dir_bon_expedition . "/" .$expeditionref;
|
||||
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$this->expe = $obj;
|
||||
|
||||
//Verification de la configuration
|
||||
if ($conf->expedition_bon->dir_output)
|
||||
if ($conf->expedition->dir_bon_expedition)
|
||||
{
|
||||
//Creation du Client
|
||||
$soc = new Societe($this->db);
|
||||
@ -121,13 +121,13 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
// Definition de $dir et $file
|
||||
if ($this->expe->specimen)
|
||||
{
|
||||
$dir = $conf->expedition_bon->dir_output;
|
||||
$dir = $conf->expedition->dir_bon_expedition;
|
||||
$file = $dir . "/SPECIMEN.pdf";
|
||||
}
|
||||
else
|
||||
{
|
||||
$expref = sanitizeFileName($this->expe->ref);
|
||||
$dir = $conf->expedition_bon->dir_output . "/" . $expref;
|
||||
$dir = $conf->expedition->dir_bon_expedition . "/" . $expref;
|
||||
$file = $dir . "/" . $expref . ".pdf";
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
{
|
||||
$pdfrights = array('print'); // Ne permet que l'impression du document
|
||||
$pdfuserpass = ''; // Mot de passe pour l'utilisateur final
|
||||
$pdfownerpass = NULL; // Mot de passe du propri<EFBFBD>taire, cr<63><72> al<61>atoirement si pas d<>fini
|
||||
$pdfownerpass = NULL; // Mot de passe du proprietaire, cree aleatoirement si pas defini
|
||||
$pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass);
|
||||
}
|
||||
|
||||
|
||||
@ -140,20 +140,20 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
|
||||
$outputlangs->setPhpLang();
|
||||
|
||||
if ($conf->expedition_bon->dir_output)
|
||||
if ($conf->expedition->dir_bon_expedition)
|
||||
{
|
||||
$this->expe = $obj;
|
||||
|
||||
// D<>finition de $dir et $file
|
||||
if ($this->expe->specimen)
|
||||
{
|
||||
$dir = $conf->expedition_bon->dir_output;
|
||||
$dir = $conf->expedition->dir_bon_expedition;
|
||||
$file = $dir . "/SPECIMEN.pdf";
|
||||
}
|
||||
else
|
||||
{
|
||||
$expref = sanitizeFileName($this->expe->ref);
|
||||
$dir = $conf->expedition_bon->dir_output . "/" . $expref;
|
||||
$dir = $conf->expedition->dir_bon_expedition . "/" . $expref;
|
||||
$file = $dir . "/" . $expref . ".pdf";
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
|
||||
$outputlangs->setPhpLang();
|
||||
|
||||
if ($conf->livraison_bon->dir_output)
|
||||
if ($conf->expedition->dir_bon_livraison)
|
||||
{
|
||||
// If $delivery is id instead of object
|
||||
if (! is_object($delivery))
|
||||
@ -124,7 +124,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
$nblignes = sizeof($delivery->lignes);
|
||||
|
||||
$deliveryref = sanitizeFileName($delivery->ref);
|
||||
$dir = $conf->livraison_bon->dir_output;
|
||||
$dir = $conf->expedition->dir_bon_livraison;
|
||||
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
$outputlangs->setPhpLang();
|
||||
|
||||
if ($conf->livraison_bon->dir_output)
|
||||
if ($conf->expedition->dir_bon_livraison)
|
||||
{
|
||||
// If $delivery is id instead of object
|
||||
if (! is_object($delivery))
|
||||
@ -145,7 +145,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$nblignes = sizeof($delivery->lignes);
|
||||
|
||||
$deliveryref = sanitizeFileName($delivery->ref);
|
||||
$dir = $conf->livraison_bon->dir_output;
|
||||
$dir = $conf->expedition->dir_bon_livraison;
|
||||
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||
|
||||
|
||||
@ -64,10 +64,21 @@ class modExpedition extends DolibarrModules
|
||||
|
||||
$this->dirs[$r][0] = "output";
|
||||
$this->dirs[$r][1] = "/expedition";
|
||||
|
||||
$r++;
|
||||
$this->dirs[$r][0] = "temp";
|
||||
$this->dirs[$r][1] = "/expedition/temp";
|
||||
$r++
|
||||
$this->dirs[$r][0] = "bon_expedition";
|
||||
$this->dirs[$r][1] = "/expedition/sending";
|
||||
$r++;
|
||||
$this->dirs[$r][0] = "bon_expedition_temp";
|
||||
$this->dirs[$r][1] = "/expedition/sending/temp";
|
||||
$r++
|
||||
$this->dirs[$r][0] = "bon_livraison";
|
||||
$this->dirs[$r][1] = "/expedition/receipt";
|
||||
$r++;
|
||||
$this->dirs[$r][0] = "bon_livraison_temp";
|
||||
$this->dirs[$r][1] = "/expedition/receipt/temp";
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("confexped.php");
|
||||
|
||||
@ -582,7 +582,7 @@ else
|
||||
*/
|
||||
|
||||
$livraisonref = sanitizeFileName($livraison->ref);
|
||||
$filedir = $conf->livraison_bon->dir_output . '/' . $livraisonref;
|
||||
$filedir = $conf->expedition->dir_bon_livraison . '/' . $livraisonref;
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id;
|
||||
|
||||
$genallowed=$user->rights->expedition->livraison->creer;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user