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 18:14:50 +00:00
parent de62cad5bd
commit 3d149a33ca
25 changed files with 199 additions and 113 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->commande->dir_temp; $dir=$conf->fournisseur->dir_commande_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->commande->dir_temp; $dir=$conf->fournisseur->dir_commande_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->facture->dir_temp; $dir=$conf->fournisseur->dir_facture_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->facture->dir_temp; $dir=$conf->fournisseur->dir_facture_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

@ -174,22 +174,13 @@ class Conf
$this->tax->dir_output=DOL_DATA_ROOT."/taxes"; $this->tax->dir_output=DOL_DATA_ROOT."/taxes";
$this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp"; $this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp";
// Module don
$this->don->dir_output=DOL_DATA_ROOT."/dons";
$this->don->dir_temp =DOL_DATA_ROOT."/dons/temp";
// Module fournisseur
$this->fournisseur->dir_output=DOL_DATA_ROOT."/fournisseur";
$this->fournisseur->dir_temp=DOL_DATA_ROOT."/fournisseur/temp";
$this->fournisseur->commande->dir_output=DOL_DATA_ROOT."/fournisseur/commande";
$this->fournisseur->commande->dir_temp =DOL_DATA_ROOT."/fournisseur/commande/temp";
$this->fournisseur->facture->dir_output =DOL_DATA_ROOT."/fournisseur/facture";
$this->fournisseur->facture->dir_temp =DOL_DATA_ROOT."/fournisseur/facture/temp";
// Module ficheinter // Module ficheinter
$this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter"; $this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter";
$this->fichinter->dir_temp =DOL_DATA_ROOT."/ficheinter/temp"; $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 if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
// Module produit // Module produit
$this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0; $this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0;
// Module droipret // Module droipret
$this->droitpret->cat=defined('DROITPRET_CAT')?DROITPRET_CAT:''; $this->droitpret->cat=defined('DROITPRET_CAT')?DROITPRET_CAT:'';
$this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:''; $this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:'';
@ -229,9 +220,6 @@ class Conf
if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4); if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $this->propale->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";
// Module domaine // Module domaine
$this->domaine->enabled=0; $this->domaine->enabled=0;
// Module voyage // Module voyage

View File

@ -180,7 +180,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fournisseur->commande->dir_output.'/'.$original_file; $original_file=$conf->fournisseur->dir_commande.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE ref='$refname'"; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE ref='$refname'";
} }
@ -192,7 +192,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; $original_file=$conf->fournisseur->dir_facture.'/'.$original_file;
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='$refname'"; //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='$refname'";
} }

View File

@ -76,7 +76,7 @@ if ($commande->fetch($_GET['id'],$_GET['ref']) < 0)
// Envoi fichier // Envoi fichier
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{ {
$upload_dir = $conf->fournisseur->commande->dir_output . "/" . sanitizeFileName($commande->ref); $upload_dir = $conf->fournisseur->dir_commande . "/" . sanitizeFileName($commande->ref);
if (! is_dir($upload_dir)) create_exdir($upload_dir); if (! is_dir($upload_dir)) create_exdir($upload_dir);
if (is_dir($upload_dir)) if (is_dir($upload_dir))
@ -98,7 +98,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
// Delete // Delete
if ($action=='delete') if ($action=='delete')
{ {
$upload_dir = $conf->fournisseur->commande->dir_output . "/" . sanitizeFileName($commande->ref); $upload_dir = $conf->fournisseur->dir_commande . "/" . sanitizeFileName($commande->ref);
$file = $upload_dir . '/' . urldecode($_GET['urlfile']); $file = $upload_dir . '/' . urldecode($_GET['urlfile']);
dol_delete_file($file); dol_delete_file($file);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>'; $mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
@ -117,7 +117,7 @@ if ($id > 0 || ! empty($ref))
{ {
llxHeader(); llxHeader();
$upload_dir = $conf->fournisseur->commande->dir_output.'/'.sanitizeFileName($commande->ref); $upload_dir = $conf->fournisseur->dir_commande.'/'.sanitizeFileName($commande->ref);
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socid); $soc->fetch($commande->socid);

View File

@ -996,9 +996,9 @@ if ($id > 0 || ! empty($ref))
* Documents generes * Documents generes
*/ */
$comfournref = sanitizeFileName($commande->ref); $comfournref = sanitizeFileName($commande->ref);
$file = $conf->fournisseur->commande->dir_output . '/' . $comfournref . '/' . $comfournref . '.pdf'; $file = $conf->fournisseur->dir_commande . '/' . $comfournref . '/' . $comfournref . '.pdf';
$relativepath = $comfournref.'/'.$comfournref.'.pdf'; $relativepath = $comfournref.'/'.$comfournref.'.pdf';
$filedir = $conf->fournisseur->commande->dir_output . '/' . $comfournref; $filedir = $conf->fournisseur->dir_commande . '/' . $comfournref;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$commande->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$commande->id;
$genallowed=$user->rights->fournisseur->commande->creer; $genallowed=$user->rights->fournisseur->commande->creer;
$delallowed=$user->rights->fournisseur->commande->supprimer; $delallowed=$user->rights->fournisseur->commande->supprimer;

View File

@ -69,7 +69,7 @@ if ($_POST['sendit'] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$facture = new FactureFournisseur($db); $facture = new FactureFournisseur($db);
if ($facture->fetch($facid)) if ($facture->fetch($facid))
{ {
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$facture->id; $upload_dir = $conf->fournisseur->dir_facture.'/'.get_exdir($facture->id,2).$facture->id;
if (! is_dir($upload_dir)) create_exdir($upload_dir); if (! is_dir($upload_dir)) create_exdir($upload_dir);
@ -98,7 +98,7 @@ if ($action=='delete')
$facture = new FactureFournisseur($db); $facture = new FactureFournisseur($db);
if ($facture->fetch($facid)) if ($facture->fetch($facid))
{ {
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$facture->id; $upload_dir = $conf->fournisseur->dir_facture.'/'.get_exdir($facture->id,2).$facture->id;
$file = $upload_dir . '/' . urldecode($_GET['urlfile']); $file = $upload_dir . '/' . urldecode($_GET['urlfile']);
dol_delete_file($file); dol_delete_file($file);
@ -120,7 +120,7 @@ if ($facid > 0)
{ {
$facture->fetch_fournisseur(); $facture->fetch_fournisseur();
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$facture->id; $upload_dir = $conf->fournisseur->dir_facture.'/'.get_exdir($facture->id,2).$facture->id;
$head = facturefourn_prepare_head($facture); $head = facturefourn_prepare_head($facture);
dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice')); dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'));

View File

@ -71,6 +71,10 @@ class modAdherent extends DolibarrModules
$this->dirs[$r][0] = "temp"; $this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/adherent/temp"; $this->dirs[$r][1] = "/adherent/temp";
$r++;
$this->dirs[$r][0] = "photos";
$this->dirs[$r][1] = "/adherent/photos";
// Config pages // Config pages
//------------- //-------------
$this->config_page_url = array("adherent.php"); $this->config_page_url = array("adherent.php");
@ -230,12 +234,6 @@ class modAdherent extends DolibarrModules
*/ */
function init() function init()
{ {
global $conf;
// Dir
$this->dirs[0] = $conf->adherent->dir_output;
$this->dirs[1] = $conf->adherent->dir_output."/photos";
$this->dirs[2] = $conf->adherent->dir_export;
$sql = array(); $sql = array();

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* 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

View File

@ -85,17 +85,20 @@ class modCommande extends DolibarrModules
// Constantes // Constantes
$this->const = array(); $this->const = array();
$this->const[0][0] = "COMMANDE_ADDON_PDF"; $r=0;
$this->const[0][1] = "chaine";
$this->const[0][2] = "einstein";
$this->const[0][3] = 'Nom du gestionnaire de generation des commandes en PDF';
$this->const[0][4] = 0;
$this->const[1][0] = "COMMANDE_ADDON"; $this->const[$r][0] = "COMMANDE_ADDON_PDF";
$this->const[1][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[1][2] = "mod_commande_marbre"; $this->const[$r][2] = "einstein";
$this->const[1][3] = 'Nom du gestionnaire de numerotation des commandes'; $this->const[$r][3] = 'Nom du gestionnaire de generation des commandes en PDF';
$this->const[1][4] = 0; $this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "COMMANDE_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_commande_marbre";
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes';
$this->const[$r][4] = 0;
// Boites // Boites
$this->boxes = array(); $this->boxes = array();

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -59,9 +60,16 @@ class modDocument extends DolibarrModules
$this->special = 3; $this->special = 3;
$this->picto='dir'; $this->picto='dir';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$this->dirs[0] = DOL_DATA_ROOT."/ged"; $r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/ged";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/ged/temp";
// Config pages // Config pages
//$this->config_page_url = array("document.php"); //$this->config_page_url = array("document.php");

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -57,10 +58,18 @@ class modDon extends DolibarrModules
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
// D<>pendances $this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/dons";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/dons/temp";
// Dependances
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> /* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -59,8 +60,10 @@ class modDroitPret extends DolibarrModules
// Dir // Dir
global $dolibarr_smarty_compile; global $dolibarr_smarty_compile;
global $dolibarr_smarty_cache; global $dolibarr_smarty_cache;
$this->dirs = array($dolibarr_smarty_compile, $this->dirs = array();
$dolibarr_smarty_cache);
$this->dirs[0] = $dolibarr_smarty_compile;
$this->dirs[1] = $dolibarr_smarty_cache;
// Dependances // Dependances
$this->depends = array(); $this->depends = array();
@ -74,9 +77,21 @@ class modDroitPret extends DolibarrModules
$this->config_page_url = array("droitpret.php"); $this->config_page_url = array("droitpret.php");
// Constantes // Constantes
$this->const=array(0=>array('PRODUCT_CANVAS_ABILITY','chaine',1,'This is a constant',1), $this->const=array();
1=>array('MAIN_NEED_SMARTY','chaine',1,'Need smarty',0) $r=0;
);
$this->const[$r][0] = "PRODUCT_CANVAS_ABILITY";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = 1;
$this->const[$r][3] = 'This is a constant';
$this->const[$r][4] = 1;
$r++;
$this->const[$r][0] = "MAIN_NEED_SMARTY";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = 1;
$this->const[$r][3] = 'Need smarty';
$this->const[$r][4] = 0;
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
@ -84,18 +99,20 @@ class modDroitPret extends DolibarrModules
// Permissions // Permissions
$this->rights = array(); $this->rights = array();
$this->rights_class = 'droitpret'; $this->rights_class = 'droitpret';
$r=0;
$this->rights[1][0] = 2200; $this->rights[$r][0] = 2200;
$this->rights[1][1] = 'Lire les droits de prets'; $this->rights[$r][1] = 'Lire les droits de prets';
$this->rights[1][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[1][3] = 1; $this->rights[$r][3] = 1;
$this->rights[1][4] = 'lire'; $this->rights[$r][4] = 'lire';
$this->rights[2][0] = 2201; $r++;
$this->rights[2][1] = 'Creer/modifier les droits de prets'; $this->rights[$r][0] = 2201;
$this->rights[2][2] = 'w'; $this->rights[$r][1] = 'Creer/modifier les droits de prets';
$this->rights[2][3] = 0; $this->rights[$r][2] = 'w';
$this->rights[2][4] = 'creer'; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'creer';
} }

View File

@ -62,8 +62,10 @@ class modEditeur extends DolibarrModules
// Dir // Dir
global $dolibarr_smarty_compile; global $dolibarr_smarty_compile;
global $dolibarr_smarty_cache; global $dolibarr_smarty_cache;
$this->dirs = array($dolibarr_smarty_compile, $this->dirs = array();
$dolibarr_smarty_cache);
$this->dirs[0] = $dolibarr_smarty_compile;
$this->dirs[1] = $dolibarr_smarty_cache;
// Config pages // Config pages
$this->config_page_url = array("editeur.php"); $this->config_page_url = array("editeur.php");

View File

@ -62,10 +62,22 @@ class modEnergie extends DolibarrModules
$this->special = 3; $this->special = 3;
$this->picto='energie'; $this->picto='energie';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
// D<>pendances $this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/energie";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/energie/temp";
$r++;
$this->dirs[$r][0] = "graph";
$this->dirs[$r][1] = "/energie/graph";
// Dependances
$this->depends = array(); $this->depends = array();
// Config pages // Config pages
@ -95,7 +107,7 @@ class modEnergie extends DolibarrModules
function init() function init()
{ {
global $conf; global $conf;
// Permissions et valeurs par d<EFBFBD>faut // Permissions et valeurs par defaut
$this->remove(); $this->remove();
$sql = array(); $sql = array();

View File

@ -60,10 +60,35 @@ class modFournisseur extends DolibarrModules
$this->special = 0; $this->special = 0;
$this->picto='company'; $this->picto='company';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
// D<>pendances $this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/fournisseur";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/fournisseur/temp";
$r++
$this->dirs[$r][0] = "commande";
$this->dirs[$r][1] = "/fournisseur/commande";
$r++;
$this->dirs[$r][0] = "commande_temp";
$this->dirs[$r][1] = "/fournisseur/commande/temp";
$r++
$this->dirs[$r][0] = "facture";
$this->dirs[$r][1] = "/fournisseur/facture";
$r++;
$this->dirs[$r][0] = "commande_temp";
$this->dirs[$r][1] = "/fournisseur/facture/temp";
// Dependances
$this->depends = array("modSociete"); $this->depends = array("modSociete");
$this->requiredby = array(); $this->requiredby = array();
$this->langfiles = array("bills","companies","suppliers"); $this->langfiles = array("bills","companies","suppliers");
@ -257,11 +282,6 @@ class modFournisseur extends DolibarrModules
{ {
$this->remove(); $this->remove();
// Dir
$this->dirs[0] = $conf->fournisseur->dir_output;
//$this->dirs[1] = $conf->fournisseur->commande->dir_output;
//$this->dirs[2] = $conf->fournisseur->facture->dir_output;
$sql = array(); $sql = array();
$this->load_datas(); $this->load_datas();

View File

@ -21,7 +21,7 @@
/** /**
\defgroup telephonie Module telephonie \defgroup telephonie Module telephonie
\brief Module pour g<EFBFBD>rer la t<EFBFBD>l<EFBFBD>phonie \brief Module pour gerer la telephonie
*/ */
/** /**
@ -63,8 +63,49 @@ class modTelephonie extends DolibarrModules
$this->special = 3; $this->special = 3;
$this->picto='phoning'; $this->picto='phoning';
// 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] = "/telephonie";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/telephonie/temp";
$r++;
$this->dirs[$r][0] = "graph";
$this->dirs[$r][1] = "/telephonie/graph";
$r++;
$this->dirs[$r][0] = "logs";
$this->dirs[$r][1] = "/telephonie/logs";
$r++;
$this->dirs[$r][0] = "client";
$this->dirs[$r][1] = "/telephonie/client";
$r++;
$this->dirs[$r][0] = "rapports";
$this->dirs[$r][1] = "/telephonie/rapports";
$r++;
$this->dirs[$r][0] = "ligne";
$this->dirs[$r][1] = "/telephonie/ligne";
$r++;
$this->dirs[$r][0] = "ligne_commande";
$this->dirs[$r][1] = "/telephonie/ligne/commande";
$r++;
$this->dirs[$r][0] = "ligne_commande_retour";
$this->dirs[$r][1] = "/telephonie/ligne/commande/retour";
$r++;
$this->dirs[$r][0] = "ligne_commande_retour_traite";
$this->dirs[$r][1] = "/telephonie/ligne/commande/retour/traite";
$r++;
$this->dirs[$r][0] = "cdr";
$this->dirs[$r][1] = "/telephonie/cdr";
$r++;
$this->dirs[$r][0] = "cdr_archive";
$this->dirs[$r][1] = "/telephonie/cdr_archive";
$r++;
$this->dirs[$r][0] = "cdr_atraiter";
$this->dirs[$r][1] = "/telephonie/cdr/atraiter";
// Dependances // Dependances
$this->depends = array(); $this->depends = array();
@ -274,18 +315,6 @@ class modTelephonie extends DolibarrModules
// Permissions // Permissions
$this->remove(); $this->remove();
// Dir
$this->dirs[0] = $conf->telephonie->dir_output;
$this->dirs[1] = $conf->telephonie->dir_output."/ligne";
$this->dirs[2] = $conf->telephonie->dir_output."/ligne/commande" ;
$this->dirs[3] = $conf->telephonie->dir_output."/logs" ;
$this->dirs[4] = $conf->telephonie->dir_output."/client" ;
$this->dirs[5] = $conf->telephonie->dir_output."/rapports" ;
$this->dirs[6] = $conf->telephonie->dir_output."/ligne/commande/retour" ;
$this->dirs[7] = $conf->telephonie->dir_output."/cdr" ;
$this->dirs[8] = $conf->telephonie->dir_output."/cdr/archive" ;
$this->dirs[9] = $conf->telephonie->dir_output."/cdr/atraiter" ;
$this->dirs[10] = $conf->telephonie->dir_output."/ligne/commande/retour/traite" ;
// //
$this->load_tables(); $this->load_tables();
// //

View File

@ -225,7 +225,7 @@ function supplier_order_delete_preview($db, $propalid)
$client = new Societe($db); $client = new Societe($db);
$client->fetch($comfourn->socid); $client->fetch($comfourn->socid);
if ($conf->fournisseur->commande->dir_output) if ($conf->fournisseur->dir_commande)
{ {
$comfournref = sanitizeFileName($comfourn->ref); $comfournref = sanitizeFileName($comfourn->ref);
$dir = $conf->commande->dir_output . "/" . $comfournref ; $dir = $conf->commande->dir_output . "/" . $comfournref ;

View File

@ -124,7 +124,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$outputlangs->setPhpLang(); $outputlangs->setPhpLang();
if ($conf->fournisseur->commande->dir_output) if ($conf->fournisseur->dir_commande)
{ {
// D<>finition de l'objet $com (pour compatibilite ascendante) // D<>finition de l'objet $com (pour compatibilite ascendante)
if (! is_object($com)) if (! is_object($com))
@ -138,13 +138,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// D<>finition de $dir et $file // D<>finition de $dir et $file
if ($com->specimen) if ($com->specimen)
{ {
$dir = $conf->fournisseur->commande->dir_output; $dir = $conf->fournisseur->dir_commande;
$file = $dir . "/SPECIMEN.pdf"; $file = $dir . "/SPECIMEN.pdf";
} }
else else
{ {
$comref = sanitizeFileName($com->ref); $comref = sanitizeFileName($com->ref);
$dir = $conf->fournisseur->commande->dir_output . "/" . $comref; $dir = $conf->fournisseur->dir_commande . "/" . $comref;
$file = $dir . "/" . $comref . ".pdf"; $file = $dir . "/" . $comref . ".pdf";
} }

View File

@ -132,7 +132,7 @@ class InterfaceNotification
$action_notify = 3; $action_notify = 3;
$ref = sanitizeFileName($object->ref); $ref = sanitizeFileName($object->ref);
$filepdf = $conf->fournisseur->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf'; $filepdf = $conf->fournisseur->dir_commande . '/' . $ref . '/' . $ref . '.pdf';
$mesg = 'La commande fournisseur '.$object->ref." a été validée.\n"; $mesg = 'La commande fournisseur '.$object->ref." a été validée.\n";
$notify = new Notify($this->db); $notify = new Notify($this->db);

View File

@ -163,7 +163,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fournisseur->commande->dir_temp.'/'.$original_file; $original_file=$conf->fournisseur->dir_commande_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->facture->dir_temp.'/'.$original_file; $original_file=$conf->fournisseur->dir_facture_temp.'/'.$original_file;
} }
// Wrapping pour les images des stats expeditions // Wrapping pour les images des stats expeditions
@ -236,14 +236,14 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=DOL_DATA_ROOT.'/graph/telephonie/'.$original_file; $original_file=$conf->telephonie->dir_graph.'/'.$original_file;
} }
// Wrapping pour les graph energie // Wrapping pour les graph energie
elseif ($modulepart == 'energie') elseif ($modulepart == 'energie')
{ {
$accessallowed=1; $accessallowed=1;
$original_file=DOL_DATA_ROOT.'/energie/graph/'.$original_file; $original_file=$conf->energie->dir_graph.'/'.$original_file;
} }
// Wrapping pour les graph bank // Wrapping pour les graph bank
@ -278,14 +278,14 @@ if ($modulepart)
elseif ($modulepart == 'graph_fourn') elseif ($modulepart == 'graph_fourn')
{ {
$accessallowed=1; $accessallowed=1;
$original_file=DOL_DATA_ROOT.'/fournisseur/temp/'.$original_file; $original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
} }
// Wrapping pour les graph des produits // Wrapping pour les graph des produits
elseif ($modulepart == 'graph_product') elseif ($modulepart == 'graph_product')
{ {
$accessallowed=1; $accessallowed=1;
$original_file=DOL_DATA_ROOT.'/product/temp/'.$original_file; $original_file=$conf->produit->dir_temp.'/'.$original_file;
} }
// Wrapping pour les code barre // Wrapping pour les code barre

View File

@ -149,7 +149,7 @@ if ($resql_c)
$width = 750; $width = 750;
$height = 300; $height = 300;
$file= DOL_DATA_ROOT."/energie/graph/all.".$obj_c->rowid.".png"; $file = $conf->energie->dir_graph."/all.".$obj_c->rowid.".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -173,7 +173,7 @@ if ($resql_c)
$width = 300; $width = 300;
$height = 90; $height = 90;
$file= DOL_DATA_ROOT."/energie/graph/small-all.".$obj_c->rowid.".png"; $file = $conf->energie->dir_graph."/small-all.".$obj_c->rowid.".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);

View File

@ -140,7 +140,7 @@ if ($resql_c)
$height = 300; $height = 300;
if (sizeof($gdatas) > 2) if (sizeof($gdatas) > 2)
{ {
$file= DOL_DATA_ROOT."/energie/graph/day.".$obj_c->rowid.".png"; $file = $conf->energie->dir_graph."/day.".$obj_c->rowid.".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -176,7 +176,7 @@ if ($resql_c)
} }
if (sizeof($gmdatas)) if (sizeof($gmdatas))
{ {
$file= DOL_DATA_ROOT."/energie/graph/month.".$obj_c->rowid.".png"; $file = $conf->energie->dir_graph."/month.".$obj_c->rowid.".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -213,7 +213,7 @@ if ($resql_c)
} }
if (sizeof($gwdatas)) if (sizeof($gwdatas))
{ {
$file= DOL_DATA_ROOT."/energie/graph/week.".$obj_c->rowid.".png"; $file = $conf->energie->dir_graph."/week.".$obj_c->rowid.".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -252,7 +252,7 @@ if ($resql_c)
if (sizeof($gydatas)) if (sizeof($gydatas))
{ {
$file= DOL_DATA_ROOT."/energie/graph/year.".$obj_c->rowid.".png"; $file = $conf->energie->dir_graph."/year.".$obj_c->rowid.".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -335,7 +335,7 @@ if ($resql_g)
$height = 300; $height = 300;
// Hebdo // Hebdo
$file= DOL_DATA_ROOT."/energie/graph/groupe.week.".$row_g[0].".png"; $file = $conf->energie->dir_graph."/groupe.week.".$row_g[0].".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -379,7 +379,7 @@ if ($resql_g)
// //
// //
// //
$file= DOL_DATA_ROOT."/energie/graph/groupe.month.".$row_g[0].".png"; $file = $conf->energie->dir_graph."/groupe.month.".$row_g[0].".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);
@ -424,7 +424,7 @@ if ($resql_g)
// //
// //
// //
$file= DOL_DATA_ROOT."/energie/graph/groupe.year.".$row_g[0].".png"; $file = $conf->energie->dir_graph."/groupe.year.".$row_g[0].".png";
$group = new PlotGroup; $group = new PlotGroup;
$group->setPadding(30, 10, NULL, NULL); $group->setPadding(30, 10, NULL, NULL);