From a20b4643df96efbf3547d4c4443e8d5c107cf1f3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 28 Apr 2009 13:52:08 +0000 Subject: [PATCH] =?UTF-8?q?New:=20parametre=20de=20config=20des=20repertoi?= =?UTF-8?q?res=20dans=20les=20proprietes=20de=20la=20classe=20du=20module?= =?UTF-8?q?=20=20avec=20un=20r=E9pertoire=20parent=20en=20fonction=20de=20?= =?UTF-8?q?l'entit=E9=20Fix:=20uniformisation=20propal=20to=20propale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/propale.php | 2 +- htdocs/comm/index.php | 4 +- htdocs/comm/propal.php | 10 ++--- htdocs/comm/propal/apercu.php | 2 +- htdocs/comm/propal/document.php | 6 +-- htdocs/comm/propal/stats/index.php | 2 +- htdocs/comm/propal/stats/month.php | 2 +- htdocs/compta/propal.php | 4 +- htdocs/core/conf.class.php | 38 +++--------------- htdocs/document.php | 2 +- htdocs/includes/modules/modAdherent.class.php | 11 ++++- htdocs/includes/modules/modAgenda.class.php | 13 ++++-- htdocs/includes/modules/modBanque.class.php | 11 +++++ htdocs/includes/modules/modBoutique.class.php | 10 ++--- htdocs/includes/modules/modCommande.class.php | 10 ++++- .../includes/modules/modCommercial.class.php | 40 +++++++++++-------- .../modules/modComptabilite.class.php | 26 ++++++++---- .../modules/modComptabiliteExpert.class.php | 19 +++++++++ htdocs/includes/modules/modContrat.class.php | 14 +++++-- .../includes/modules/modExpedition.class.php | 10 ++++- htdocs/includes/modules/modFacture.class.php | 12 +++++- htdocs/includes/modules/modPropale.class.php | 14 +++++-- .../modules/propale/modules_propale.php | 4 +- .../propale/pdf_propale_azur.modules.php | 6 +-- .../propale/pdf_propale_jaune.modules.php | 6 +-- htdocs/propal.class.php | 6 +-- htdocs/viewimage.php | 4 +- 27 files changed, 181 insertions(+), 107 deletions(-) diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index 118d151ff46..4b1b1532219 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -499,7 +499,7 @@ print "\n"; print " ".$langs->trans("Name")."\n"; print " ".$langs->trans("Value")."\n"; print "\n"; -print "\n ".$langs->trans("PathDirectory")."\n ".$conf->propal->dir_output."\n\n"; +print "\n ".$langs->trans("PathDirectory")."\n ".$conf->propale->dir_output."\n\n"; print "\n
"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 51ec459ce9f..71a163ae2e0 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -305,7 +305,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) print ''; print ''; $filename=sanitizeFileName($objp->ref); - $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref); + $filedir=$conf->propale->dir_output . '/' . sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid; $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); print ''; @@ -504,7 +504,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) print ''; print ''; $filename=sanitizeFileName($obj->ref); - $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($obj->ref); + $filedir=$conf->propale->dir_output . '/' . sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$obj->propalid; $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); print ''; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 22b4ec6c3fa..7f6689c2e29 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -405,7 +405,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel']) if ( $propal->fetch($_POST['propalid']) ) { $propalref = sanitizeFileName($propal->ref); - $file = $conf->propal->dir_output . '/' . $propalref . '/' . $propalref . '.pdf'; + $file = $conf->propale->dir_output . '/' . $propalref . '/' . $propalref . '.pdf'; if (is_readable($file)) { @@ -1786,7 +1786,7 @@ if ($id > 0 || ! empty($ref)) if ($propal->statut == 1 && $user->rights->propale->envoyer) { $propref = sanitizeFileName($propal->ref); - $file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf'; + $file = $conf->propale->dir_output . '/'.$propref.'/'.$propref.'.pdf'; if (file_exists($file)) { print ''.$langs->trans('SendByMail').''; @@ -1850,7 +1850,7 @@ if ($id > 0 || ! empty($ref)) * Documents generes */ $filename=sanitizeFileName($propal->ref); - $filedir=$conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); + $filedir=$conf->propale->dir_output . "/" . sanitizeFileName($propal->ref); $urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id; $genallowed=$user->rights->propale->creer; $delallowed=$user->rights->propale->supprimer; @@ -1911,7 +1911,7 @@ if ($id > 0 || ! empty($ref)) if ($_GET['action'] == 'presend') { $ref = sanitizeFileName($propal->ref); - $file = $conf->propal->dir_output . '/' . $ref . '/' . $ref . '.pdf'; + $file = $conf->propale->dir_output . '/' . $ref . '/' . $ref . '.pdf'; print '
'; print_titre($langs->trans('SendPropalByMail')); @@ -2116,7 +2116,7 @@ else print ''; $filename=sanitizeFileName($objp->ref); - $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref); + $filedir=$conf->propale->dir_output . '/' . sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid; $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index f2e9a3c8a37..946e8944ab8 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -134,7 +134,7 @@ if ($_GET["propalid"] > 0) * Documents */ $propalref = sanitizeFileName($propal->ref); - $dir_output = $conf->propal->dir_output . "/"; + $dir_output = $conf->propale->dir_output . "/"; $filepath = $dir_output . $propalref . "/"; $file = $filepath . $propalref . ".pdf"; $filedetail = $filepath . $propalref . "-detail.pdf"; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 11713ce106a..51c212428f2 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -72,7 +72,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($propal->fetch($propalid)) { - $upload_dir = $conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); + $upload_dir = $conf->propale->dir_output . "/" . sanitizeFileName($propal->ref); if (! is_dir($upload_dir)) create_exdir($upload_dir); if (is_dir($upload_dir)) @@ -100,7 +100,7 @@ if ($action=='delete') $propalid=$_GET["id"]; if ($propal->fetch($propalid)) { - $upload_dir = $conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); + $upload_dir = $conf->propale->dir_output . "/" . sanitizeFileName($propal->ref); $file = $upload_dir . '/' . urldecode($_GET['urlfile']); dol_delete_file($file); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; @@ -119,7 +119,7 @@ if ($propalid > 0) $propal = new Propal($db); if ($propal->fetch($propalid)) { - $upload_dir = $conf->propal->dir_output.'/'.sanitizeFileName($propal->ref); + $upload_dir = $conf->propale->dir_output.'/'.sanitizeFileName($propal->ref); $societe = new Societe($db); $societe->fetch($propal->socid); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index a54b8a72ee7..197ae969bdc 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -51,7 +51,7 @@ llxHeader(); print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg); -$dir=$conf->propal->dir_temp; +$dir=$conf->propale->dir_temp; create_exdir($dir); diff --git a/htdocs/comm/propal/stats/month.php b/htdocs/comm/propal/stats/month.php index 4f604738b5d..9979267aa76 100644 --- a/htdocs/comm/propal/stats/month.php +++ b/htdocs/comm/propal/stats/month.php @@ -47,7 +47,7 @@ $year = isset($_GET["year"])?$_GET["year"]:date("Y",time()); llxHeader(); -$dir=$conf->propal->dir_temp; +$dir=$conf->propale->dir_temp; $mesg = ''.img_previous().' '; $mesg.= $langs->trans("Year")." $year"; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 0449ea60e9c..63677dc1dc9 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -492,7 +492,7 @@ if ($id > 0 || ! empty($ref)) * Documents generes */ $filename=sanitizeFileName($propal->ref); - $filedir=$conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); + $filedir=$conf->propale->dir_output . "/" . sanitizeFileName($propal->ref); $urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id; $genallowed=0; $delallowed=0; @@ -774,7 +774,7 @@ else print ''; $filename=sanitizeFileName($objp->ref); - $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref); + $filedir=$conf->propale->dir_output . '/' . sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid; $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); diff --git a/htdocs/core/conf.class.php b/htdocs/core/conf.class.php index 9d3655e74ea..f204ba6d902 100644 --- a/htdocs/core/conf.class.php +++ b/htdocs/core/conf.class.php @@ -155,20 +155,9 @@ class Conf $this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0; $this->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0; - // Module agenda - $this->agenda->dir_temp=DOL_DATA_ROOT."/agenda/temp"; - // Module externalrss $this->externalrss->dir_temp=DOL_DATA_ROOT."/rss/temp"; - // Module commande client - $this->commande->dir_output=DOL_DATA_ROOT."/commande"; - $this->commande->dir_temp =DOL_DATA_ROOT."/commande/temp"; - - // Module expeditions - $this->expedition->dir_output=DOL_DATA_ROOT."/expedition"; - $this->expedition->dir_temp =DOL_DATA_ROOT."/expedition/temp"; - // 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"; @@ -183,23 +172,11 @@ class Conf $this->societe->dir_temp =DOL_DATA_ROOT."/societe/temp"; $this->societe->dir_logos =DOL_DATA_ROOT."/societe/logos"; if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $this->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut - // Module commercial - $this->commercial->dir_output=DOL_DATA_ROOT."/comm"; - $this->commercial->dir_temp =DOL_DATA_ROOT."/comm/temp"; // Module taxes et charges sociales $this->tax->dir_output=DOL_DATA_ROOT."/taxes"; $this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp"; - // Module comptaexpert - $this->comptaexpert->dir_output=DOL_DATA_ROOT."/comptaexpert"; - $this->comptaexpert->dir_temp =DOL_DATA_ROOT."/comptaexpert/temp"; - // Module compta - $this->compta->dir_output=DOL_DATA_ROOT."/compta"; - $this->compta->dir_temp =DOL_DATA_ROOT."/compta/temp"; - // Module banque - $this->banque->dir_output=DOL_DATA_ROOT."/banque"; - $this->banque->dir_temp =DOL_DATA_ROOT."/banque/temp"; // Module don $this->don->dir_output=DOL_DATA_ROOT."/dons"; $this->don->dir_temp =DOL_DATA_ROOT."/dons/temp"; @@ -214,17 +191,13 @@ class Conf $this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter"; $this->fichinter->dir_temp =DOL_DATA_ROOT."/ficheinter/temp"; if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut - // Module adherent - $this->adherent->dir_output=DOL_DATA_ROOT."/adherent"; - $this->adherent->dir_tmp=DOL_DATA_ROOT."/adherent/temp"; // Module produit $this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0; // Module droipret $this->droitpret->cat=defined('DROITPRET_CAT')?DROITPRET_CAT:''; $this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:''; $this->droitpret->dir_temp=DOL_DATA_ROOT."/droitpret/temp"; - // Module contrat - $this->contrat->dir_output=DOL_DATA_ROOT."/contracts"; + // Module prelevement $this->prelevement->dir_output=DOL_DATA_ROOT."/prelevement"; $this->prelevement->dir_temp =DOL_DATA_ROOT."/prelevement/temp"; @@ -251,15 +224,14 @@ class Conf $this->mantis->db->user=defined('PHPMANTIS_USER')?PHPMANTIS_USER:''; $this->mantis->db->pass=defined('PHPMANTIS_PASS')?PHPMANTIS_PASS:''; $this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:''; + // Module facture - $this->facture->dir_output=DOL_DATA_ROOT."/facture"; - $this->facture->dir_temp =DOL_DATA_ROOT."/facture/temp"; if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $this->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par defaut + // Module propal if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4); - $this->propal->dir_output=DOL_DATA_ROOT."/propale"; - $this->propal->dir_temp =DOL_DATA_ROOT."/propale/temp"; - if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $this->propal->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par defaut + if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $this->propale->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par defaut + // Module telephonie $this->telephonie->dir_output=DOL_DATA_ROOT."/telephonie"; $this->telephonie->dir_temp =DOL_DATA_ROOT."/telephonie/temp"; diff --git a/htdocs/document.php b/htdocs/document.php index be862814c6c..ff6ab2181da 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -157,7 +157,7 @@ if ($modulepart) $accessallowed=1; } - $original_file=$conf->propal->dir_output.'/'.$original_file; + $original_file=$conf->propale->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='$refname'"; } // Wrapping pour les commandes diff --git a/htdocs/includes/modules/modAdherent.class.php b/htdocs/includes/modules/modAdherent.class.php index 5525e908b80..83d07c2d21d 100644 --- a/htdocs/includes/modules/modAdherent.class.php +++ b/htdocs/includes/modules/modAdherent.class.php @@ -60,9 +60,16 @@ class modAdherent extends DolibarrModules $this->special = 0; $this->picto='user'; - // Dir - //---- + // Data directories to create when module is enabled $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/adherent"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/adherent/temp"; // Config pages //------------- diff --git a/htdocs/includes/modules/modAgenda.class.php b/htdocs/includes/modules/modAgenda.class.php index 560c61ea8c8..7084a8918bc 100644 --- a/htdocs/includes/modules/modAgenda.class.php +++ b/htdocs/includes/modules/modAgenda.class.php @@ -62,11 +62,16 @@ class modAgenda extends DolibarrModules $this->special = 0; $this->picto='calendar'; - // Dir - //---- + // Data directories to create when module is enabled $this->dirs = array(); - //$this->dirs[0] = DOL_DATA_ROOT.'/mymodule; - //$this->dirs[1] = DOL_DATA_ROOT.'/mymodule/temp; + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/agenda"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/agenda/temp"; // Config pages //------------- diff --git a/htdocs/includes/modules/modBanque.class.php b/htdocs/includes/modules/modBanque.class.php index 3a6eac1d789..75f4dc6777d 100644 --- a/htdocs/includes/modules/modBanque.class.php +++ b/htdocs/includes/modules/modBanque.class.php @@ -63,6 +63,17 @@ class modBanque extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; $this->picto='account'; + + // Data directories to create when module is enabled + $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/banque"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/banque/temp"; // Dépendances $this->depends = array(); diff --git a/htdocs/includes/modules/modBoutique.class.php b/htdocs/includes/modules/modBoutique.class.php index f6a2c37936f..f8c6fe29e8b 100644 --- a/htdocs/includes/modules/modBoutique.class.php +++ b/htdocs/includes/modules/modBoutique.class.php @@ -43,7 +43,7 @@ class modBoutique extends DolibarrModules /** * \brief Constructeur. Definit les noms, constantes et boites - * \param DB handler d'acc�s base + * \param DB handler d'acces base */ function modBoutique($DB) { @@ -65,7 +65,7 @@ class modBoutique extends DolibarrModules // $this->config_page_url = array("boutique.php","osc-languages.php"); $this->config_page_url = array("boutique.php"); - // D�pendances + // Dependances $this->depends = array(); $this->requiredby = array(); $this->conflictwith = array("modOSCommerceWS"); @@ -83,8 +83,8 @@ class modBoutique extends DolibarrModules } /** - * \brief Fonction appel�e lors de l'activation du module. Ins�re en base les constantes, boites, permissions du module. - * D�finit �galement les r�pertoires de donn�es � cr�er pour ce module. + * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. + * Definit egalement les repertoires de donnees a creer pour ce module. */ function init() { @@ -94,7 +94,7 @@ class modBoutique extends DolibarrModules } /** - * \brief Fonction appel�e lors de la d�sactivation d'un module. + * \brief Fonction appelee lors de la desactivation d'un module. * Supprime de la base les constantes, boites et permissions du module. */ function remove() diff --git a/htdocs/includes/modules/modCommande.class.php b/htdocs/includes/modules/modCommande.class.php index 2e598fe2aa3..0cb5096a814 100644 --- a/htdocs/includes/modules/modCommande.class.php +++ b/htdocs/includes/modules/modCommande.class.php @@ -63,8 +63,16 @@ class modCommande extends DolibarrModules $this->special = 0; $this->picto='order'; - // Dir + // Data directories to create when module is enabled $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/commande"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/commande/temp"; // Config pages $this->config_page_url = array("commande.php"); diff --git a/htdocs/includes/modules/modCommercial.class.php b/htdocs/includes/modules/modCommercial.class.php index af79c37ae9f..f8fb45320d1 100644 --- a/htdocs/includes/modules/modCommercial.class.php +++ b/htdocs/includes/modules/modCommercial.class.php @@ -46,23 +46,31 @@ class modCommercial extends DolibarrModules */ function modCommercial($DB) { - $this->db = $DB ; - $this->numero = 2 ; + $this->db = $DB ; + $this->numero = 2 ; - $this->family = "crm"; - // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = eregi_replace('^mod','',get_class($this)); - $this->description = "Gestion commercial"; - - // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'dolibarr'; - - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->special = 0; - $this->picto='commercial'; - - // Dir - $this->dirs = array(); + $this->family = "crm"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = eregi_replace('^mod','',get_class($this)); + $this->description = "Gestion commercial"; + + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; + + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + $this->special = 0; + $this->picto='commercial'; + + // Data directories to create when module is enabled + $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/comm"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/comm/temp"; // Dependancies $this->depends = array("modSociete"); diff --git a/htdocs/includes/modules/modComptabilite.class.php b/htdocs/includes/modules/modComptabilite.class.php index e33077e63c7..468848b11ab 100644 --- a/htdocs/includes/modules/modComptabilite.class.php +++ b/htdocs/includes/modules/modComptabilite.class.php @@ -66,7 +66,7 @@ class modComptabilite extends DolibarrModules // Config pages $this->config_page_url = array("compta.php"); - // D�pendances + // Dependances $this->depends = array("modFacture","modBanque"); $this->requiredby = array(); $this->conflictwith = array("modComptabiliteExpert"); @@ -74,13 +74,25 @@ class modComptabilite extends DolibarrModules // Constantes $this->const = array(); - - // R�pertoires + + // Data directories to create when module is enabled $this->dirs = array(); - $this->dirs[0] = $conf->compta->dir_output; - $this->dirs[1] = $conf->compta->dir_output."/rapport"; - $this->dirs[2] = $conf->compta->dir_output."/export"; - $this->dirs[3] = $conf->compta->dir_temp; + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/compta"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/compta/temp"; + + $r++; + $this->dirs[$r][0] = "rapport"; + $this->dirs[$r][1] = "/compta/rapport"; + + $r++; + $this->dirs[$r][0] = "export"; + $this->dirs[$r][1] = "/compta/export"; // Boites $this->boxes = array(); diff --git a/htdocs/includes/modules/modComptabiliteExpert.class.php b/htdocs/includes/modules/modComptabiliteExpert.class.php index 3345715c827..867351ef546 100644 --- a/htdocs/includes/modules/modComptabiliteExpert.class.php +++ b/htdocs/includes/modules/modComptabiliteExpert.class.php @@ -75,6 +75,25 @@ class modComptabiliteExpert extends DolibarrModules // Constantes $this->const = array(); + + // Data directories to create when module is enabled + $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/comptaexpert"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/comptaexpert/temp"; + + $r++; + $this->dirs[$r][0] = "rapport"; + $this->dirs[$r][1] = "/comptaexpert/rapport"; + + $r++; + $this->dirs[$r][0] = "export"; + $this->dirs[$r][1] = "/comptaexpert/export"; // Repertoires $this->dirs = array(); diff --git a/htdocs/includes/modules/modContrat.class.php b/htdocs/includes/modules/modContrat.class.php index 653c8901aae..38e9fe7460f 100644 --- a/htdocs/includes/modules/modContrat.class.php +++ b/htdocs/includes/modules/modContrat.class.php @@ -61,10 +61,18 @@ class modContrat extends DolibarrModules $this->special = 0; $this->picto='contract'; - // Dir - $this->dirs = array(); + // Data directories to create when module is enabled + $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/contracts"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/contracts/temp"; - // D�pendances + // Dependances $this->depends = array("modService"); $this->requiredby = array(); diff --git a/htdocs/includes/modules/modExpedition.class.php b/htdocs/includes/modules/modExpedition.class.php index 1b2036b875d..6ea83321494 100644 --- a/htdocs/includes/modules/modExpedition.class.php +++ b/htdocs/includes/modules/modExpedition.class.php @@ -58,8 +58,16 @@ class modExpedition extends DolibarrModules $this->special = 0; $this->picto = "sending"; - // Dir + // Data directories to create when module is enabled $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/expedition"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/expedition/temp"; // Config pages $this->config_page_url = array("confexped.php"); diff --git a/htdocs/includes/modules/modFacture.class.php b/htdocs/includes/modules/modFacture.class.php index 38c2ac5a90a..c6ffb524d02 100644 --- a/htdocs/includes/modules/modFacture.class.php +++ b/htdocs/includes/modules/modFacture.class.php @@ -64,8 +64,16 @@ class modFacture extends DolibarrModules $this->special = 0; $this->picto='bill'; - // Dir - $this->dirs = array(); + // Data directories to create when module is enabled + $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/facture"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/facture/temp"; // Dependencies $this->depends = array("modSociete"); diff --git a/htdocs/includes/modules/modPropale.class.php b/htdocs/includes/modules/modPropale.class.php index 272f7c03fc6..236bc2a9b8a 100644 --- a/htdocs/includes/modules/modPropale.class.php +++ b/htdocs/includes/modules/modPropale.class.php @@ -63,8 +63,16 @@ class modPropale extends DolibarrModules $this->special = 0; $this->picto='propal'; - // Dir + // Data directories to create when module is enabled $this->dirs = array(); + $r=0; + + $this->dirs[$r][0] = "output"; + $this->dirs[$r][1] = "/propale"; + + $r++; + $this->dirs[$r][0] = "temp"; + $this->dirs[$r][1] = "/propale/temp"; // Dependances $this->depends = array("modSociete","modCommercial"); @@ -143,8 +151,8 @@ class modPropale extends DolibarrModules $this->remove(); // Repertoires - $this->dirs[0] = $conf->propal->dir_output; - $this->dirs[1] = $conf->propal->dir_temp; + $this->dirs[0] = $conf->propale->dir_output; + $this->dirs[1] = $conf->propale->dir_temp; $sql = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php index f85a517bf97..1a8d5a05d63 100644 --- a/htdocs/includes/modules/propale/modules_propale.php +++ b/htdocs/includes/modules/propale/modules_propale.php @@ -250,10 +250,10 @@ function propale_delete_preview($db, $propalid, $propalref='') $propalref = $propal->ref; } - if ($conf->propal->dir_output) + if ($conf->propale->dir_output) { $propalref = sanitizeFileName($propalref); - $dir = $conf->propal->dir_output . "/" . $propalref ; + $dir = $conf->propale->dir_output . "/" . $propalref ; $file = $dir . "/" . $propalref . ".pdf.png"; $multiple = $file . "."; diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 29243c1b1f8..d7521c35e06 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -123,7 +123,7 @@ class pdf_propale_azur extends ModelePDFPropales $outputlangs->setPhpLang(); - if ($conf->propal->dir_output) + if ($conf->propale->dir_output) { // Définition de l'objet $propale (pour compatibilite ascendante) if (! is_object($propale)) @@ -138,13 +138,13 @@ class pdf_propale_azur extends ModelePDFPropales // Définition de $dir et $file if ($propale->specimen) { - $dir = $conf->propal->dir_output; + $dir = $conf->propale->dir_output; $file = $dir . "/SPECIMEN.pdf"; } else { $propref = sanitizeFileName($propale->ref); - $dir = $conf->propal->dir_output . "/" . $propref; + $dir = $conf->propale->dir_output . "/" . $propref; $file = $dir . "/" . $propref . ".pdf"; } diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index a802d262d96..a606c633038 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -107,7 +107,7 @@ class pdf_propale_jaune extends ModelePDFPropales $outputlangs->setPhpLang(); - if ($conf->propal->dir_output) + if ($conf->propale->dir_output) { // D�finition de l'objet $propal (pour compatibilite ascendante) if (! is_object($propale)) @@ -122,13 +122,13 @@ class pdf_propale_jaune extends ModelePDFPropales // Definition de $dir et $file if ($propale->specimen) { - $dir = $conf->propal->dir_output; + $dir = $conf->propale->dir_output; $file = $dir . "/SPECIMEN.pdf"; } else { $propref = sanitizeFileName($propale->ref); - $dir = $conf->propal->dir_output . "/" . $propref; + $dir = $conf->propale->dir_output . "/" . $propref; $file = $dir . "/" . $propref . ".pdf"; } diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 439b60c5721..570fc592fd6 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -1495,10 +1495,10 @@ class Propal extends CommonObject { // We remove directory $propalref = sanitizeFileName($this->ref); - if ($conf->propal->dir_output) + if ($conf->propale->dir_output) { - $dir = $conf->propal->dir_output . "/" . $propalref ; - $file = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . ".pdf"; + $dir = $conf->propale->dir_output . "/" . $propalref ; + $file = $conf->propale->dir_output . "/" . $propalref . "/" . $propalref . ".pdf"; if (file_exists($file)) { propale_delete_preview($this->db, $this->id, $this->ref); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index f64b2d941bb..e68e2f56fc2 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -110,7 +110,7 @@ if ($modulepart) { $accessallowed=1; } - $original_file=$conf->propal->dir_output.'/'.$original_file; + $original_file=$conf->propale->dir_output.'/'.$original_file; } // Wrapping pour les apercu commande @@ -143,7 +143,7 @@ if ($modulepart) { $accessallowed=1; } - $original_file=$conf->propal->dir_temp.'/'.$original_file; + $original_file=$conf->propale->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats commandes