New: parametre de config des repertoires dans les proprietes de la classe du module

avec un répertoire parent en fonction de l'entité
This commit is contained in:
Regis Houssin 2009-04-28 21:49:08 +00:00
parent 119604703a
commit e423d4193c
6 changed files with 32 additions and 19 deletions

View File

@ -830,7 +830,7 @@ class BonPrelevement extends CommonObject
{ {
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons"); $prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
$dir=$conf->prelevement->dir_output.'/bon'; $dir=$conf->prelevement->dir_bon;
$file=$filebonprev; $file=$filebonprev;
if (! is_dir($dir)) create_exdir($dir); if (! is_dir($dir)) create_exdir($dir);

View File

@ -58,7 +58,7 @@ if ($_POST["action"] == 'infotrans')
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref) if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref)
{ {
$dir = $conf->prelevement->dir_output.'/bon/'; $dir = $conf->prelevement->dir_bon;
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . $_FILES['userfile']['name'],1) > 0) if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . $_FILES['userfile']['name'],1) > 0)
{ {

View File

@ -161,10 +161,6 @@ class Conf
// Module societe // Module societe
if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $this->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $this->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
// Module taxes et charges sociales
$this->tax->dir_output=DOL_DATA_ROOT."/taxes";
$this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp";
// Module ficheinter // Module ficheinter
if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->ficheinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->ficheinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
@ -176,9 +172,6 @@ class Conf
$this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:''; $this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:'';
$this->droitpret->dir_temp=DOL_DATA_ROOT."/droitpret/temp"; $this->droitpret->dir_temp=DOL_DATA_ROOT."/droitpret/temp";
// Module prelevement
$this->prelevement->dir_output=DOL_DATA_ROOT."/prelevement";
$this->prelevement->dir_temp =DOL_DATA_ROOT."/prelevement/temp";
// Module webcal // Module webcal
$this->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'__dolibarr_main_db_type__'; $this->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'__dolibarr_main_db_type__';
$this->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:''; $this->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';

View File

@ -62,8 +62,22 @@ class modPrelevement extends DolibarrModules
$this->special = 0; $this->special = 0;
// Name of png file (without png) used for this module // Name of png file (without png) used for this module
$this->picto='payment'; $this->picto='payment';
// Dir
// Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/prelevement";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/prelevement/temp";
$r++;
$this->dirs[$r][0] = "bon";
$this->dirs[$r][1] = "/prelevement/bon";
$this->dirs[0] = $conf->prelevement->dir_output . "/bon"; $this->dirs[0] = $conf->prelevement->dir_output . "/bon";
// Dependancies // Dependancies

View File

@ -63,12 +63,23 @@ class modTax extends DolibarrModules
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
$this->picto='bill'; $this->picto='bill';
// Data directories to create when module is enabled
$this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/taxes";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/taxes/temp";
// Config pages // Config pages
$this->config_page_url = array("taxes.php"); $this->config_page_url = array("taxes.php");
// D<>pendances // Dependances
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
$this->conflictwith = array(); $this->conflictwith = array();
@ -77,11 +88,6 @@ class modTax extends DolibarrModules
// Constantes // Constantes
$this->const = array(); $this->const = array();
// Repertoires
$this->dirs = array();
$this->dirs[0] = $conf->tax->dir_output;
$this->dirs[1] = $conf->tax->dir_temp;
// Boites // Boites
$this->boxes = array(); $this->boxes = array();

View File

@ -225,7 +225,7 @@ if ($modulepart)
$user->getrights('prelevement'); $user->getrights('prelevement');
if ($user->rights->prelevement->bons->lire) $accessallowed=1; if ($user->rights->prelevement->bons->lire) $accessallowed=1;
$original_file=$conf->prelevement->dir_output.'/bon/'.$original_file; $original_file=$conf->prelevement->dir_bon.'/'.$original_file;
} }
// Wrapping pour les graph telephonie // Wrapping pour les graph telephonie