2
0
forked from Wavyzz/dolibarr

Add: can defined submodule name (ex: $conf->module->submodule->dir_output)

Add: can change the module name if different (ex: $conf->newmodulename->dir_output)
This commit is contained in:
Regis Houssin
2009-04-30 00:36:08 +00:00
parent ad8bed51ef
commit c71c2f39fb
8 changed files with 25 additions and 15 deletions

View File

@@ -62,7 +62,7 @@ if ($mode == 'customer')
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$title=$langs->trans("OrdersStatisticsSuppliers"); $title=$langs->trans("OrdersStatisticsSuppliers");
$dir=$conf->fournisseur->dir_commande_temp; $dir=$conf->fournisseur->commande->dir_temp;
} }
print_fiche_titre($title, $mesg); print_fiche_titre($title, $mesg);

View File

@@ -60,7 +60,7 @@ if ($mode == 'customer')
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$title=$langs->trans("OrdersStatisticsSuppliers"); $title=$langs->trans("OrdersStatisticsSuppliers");
$dir=$conf->fournisseur->dir_commande_temp; $dir=$conf->fournisseur->dir_temp;
} }
$mesg = '<a href="month.php?year='.($year - 1).'&amp;mode='.$mode.'">'.img_previous().'</a> '; $mesg = '<a href="month.php?year='.($year - 1).'&amp;mode='.$mode.'">'.img_previous().'</a> ';

View File

@@ -59,7 +59,7 @@ if ($mode == 'customer')
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$title=$langs->trans("BillsStatisticsSuppliers"); $title=$langs->trans("BillsStatisticsSuppliers");
$dir=$conf->fournisseur->dir_facture_temp; $dir=$conf->fournisseur->facture->dir_temp;
} }
print_fiche_titre($title, $mesg); print_fiche_titre($title, $mesg);

View File

@@ -58,7 +58,7 @@ if ($mode == 'customer')
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$title=$langs->trans("BillsStatisticsSuppliers"); $title=$langs->trans("BillsStatisticsSuppliers");
$dir=$conf->fournisseur->dir_facture_temp; $dir=$conf->fournisseur->facture->dir_temp;
} }
$mesg = '<a href="month.php?year='.($year - 1).'&amp;mode='.$mode.'">'.img_previous().'</a> '; $mesg = '<a href="month.php?year='.($year - 1).'&amp;mode='.$mode.'">'.img_previous().'</a> ';

View File

@@ -115,11 +115,13 @@ class Conf
$dir_name = "dir_".strtolower($reg[2]); $dir_name = "dir_".strtolower($reg[2]);
$submodule = strtolower($reg[1]); $submodule = strtolower($reg[1]);
$this->$module->$submodule->$dir_name = $value; $this->$module->$submodule->$dir_name = $value;
//print '->'.$module.'->'.$submodule.'->'.$dir_name.' = '.$this->$module->$submodule->$dir_name.'<br>';
} }
else if (eregi('_DIR_([A-Z]+)$',$key,$reg)) else if (eregi('_DIR_([A-Z]+)$',$key,$reg))
{ {
$dir_name = "dir_".strtolower($reg[1]); $dir_name = "dir_".strtolower($reg[1]);
$this->$module->$dir_name = $value; // We put only dir name. We will add DOL_DATA_ROOT later $this->$module->$dir_name = $value; // We put only dir name. We will add DOL_DATA_ROOT later
//print '->'.$module.'->'.$dir_name.' = '.$this->$module->$dir_name.'<br>';
} }
} }
// If this is a module constant // If this is a module constant

View File

@@ -974,12 +974,11 @@ class DolibarrModules
$subname = empty($this->dirs[$key][3])?'':strtoupper($this->dirs[$key][3]); // Add submodule name (ex: $conf->module->submodule->dir_output) $subname = empty($this->dirs[$key][3])?'':strtoupper($this->dirs[$key][3]); // Add submodule name (ex: $conf->module->submodule->dir_output)
$forcename = empty($this->dirs[$key][4])?'':strtoupper($this->dirs[$key][4]); // Change the module name if different $forcename = empty($this->dirs[$key][4])?'':strtoupper($this->dirs[$key][4]); // Change the module name if different
if ($forcename) $constname = $forcename."_DIR_"; if ($forcename) $constname = 'MAIN_MODULE_'.$forcename."_DIR_";
if ($subname) $constname = $constname.$subname."_"; if ($subname) $constname = $constname.$subname."_";
$name = $constname.strtoupper($this->dirs[$key][0]); $name = $constname.strtoupper($this->dirs[$key][0]);
// Define directory full path // Define directory full path
if (empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $fulldir = DOL_DATA_ROOT.$dir; if (empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $fulldir = DOL_DATA_ROOT.$dir;
else $fulldir = DOL_DATA_ROOT."/".$conf->entity.$dir; else $fulldir = DOL_DATA_ROOT."/".$conf->entity.$dir;

View File

@@ -69,17 +69,29 @@ class modExpedition extends DolibarrModules
$this->dirs[$r][0] = "temp"; $this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/expedition/temp"; $this->dirs[$r][1] = "/expedition/temp";
$r++; $r++;
$this->dirs[$r][0] = "bon_expedition"; $this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/expedition/sending"; $this->dirs[$r][1] = "/expedition/sending";
$this->dirs[$r][2] = 1;
$this->dirs[$r][3] = '';
$this->dirs[$r][4] = "expedition_bon";
$r++; $r++;
$this->dirs[$r][0] = "bon_expedition_temp"; $this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/expedition/sending/temp"; $this->dirs[$r][1] = "/expedition/sending/temp";
$this->dirs[$r][2] = 1;
$this->dirs[$r][3] = '';
$this->dirs[$r][4] = "expedition_bon";
$r++; $r++;
$this->dirs[$r][0] = "bon_livraison"; $this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/expedition/receipt"; $this->dirs[$r][1] = "/expedition/receipt";
$this->dirs[$r][2] = 1;
$this->dirs[$r][3] = '';
$this->dirs[$r][4] = "livraison_bon";
$r++; $r++;
$this->dirs[$r][0] = "bon_livraison_temp"; $this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/expedition/receipt/temp"; $this->dirs[$r][1] = "/expedition/receipt/temp";
$this->dirs[$r][2] = 1;
$this->dirs[$r][3] = '';
$this->dirs[$r][4] = "livraison_bon";
// Config pages // Config pages
$this->config_page_url = array("confexped.php"); $this->config_page_url = array("confexped.php");
@@ -182,9 +194,6 @@ class modExpedition extends DolibarrModules
// Permissions // Permissions
$this->remove(); $this->remove();
// Dir
$this->dirs[0] = DOL_DATA_ROOT."/expedition";
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql);

View File

@@ -163,7 +163,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fournisseur->dir_commande_temp.'/'.$original_file; $original_file=$conf->fournisseur->commande->dir_temp.'/'.$original_file;
} }
// Wrapping pour les images des stats factures // Wrapping pour les images des stats factures
@@ -183,7 +183,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fournisseur->dir_facture_temp.'/'.$original_file; $original_file=$conf->fournisseur->facture->dir_temp.'/'.$original_file;
} }
// Wrapping pour les images des stats expeditions // Wrapping pour les images des stats expeditions