From a6fce48399bf1c745d1404ae458967a49b256155 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 22 Nov 2004 09:58:11 +0000 Subject: [PATCH] =?UTF-8?q?Modif=20gestion=20de=20la=20creation=20des=20r?= =?UTF-8?q?=E9pertoires=20int=E9gr=E9es=20dor=E9navant=20=E0=20la=20classe?= =?UTF-8?q?=20h=E9rit=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../includes/modules/modTelephonie.class.php | 50 ++++--------------- 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/htdocs/includes/modules/modTelephonie.class.php b/htdocs/includes/modules/modTelephonie.class.php index 979bd5499ed..49f02642a22 100644 --- a/htdocs/includes/modules/modTelephonie.class.php +++ b/htdocs/includes/modules/modTelephonie.class.php @@ -57,6 +57,8 @@ class modTelephonie extends DolibarrModules $this->special = 1; + $this->dirs = array(); + // Dépendances $this->depends = array(); $this->requiredby = array(); @@ -87,47 +89,13 @@ class modTelephonie extends DolibarrModules * Documents * */ - if (defined("DOL_DATA_ROOT")) - { - $dir = DOL_DATA_ROOT . "/telephonie/" ; - - if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error="Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; - } - } - - - $dir[0] = DOL_DATA_ROOT . "/telephonie/ligne/" ; - $dir[1] = DOL_DATA_ROOT . "/telephonie/ligne/commande" ; - $dir[2] = DOL_DATA_ROOT . "/telephonie/logs" ; - - - for ($i = 0 ; $i < sizeof($dir) ; $i++) - { - if (is_dir($dir[$i])) - { - dolibarr_syslog ("Le dossier '".$dir[$i]."' existe"); - } - else - { - if (! @mkdir($dir[$i], 0755)) - { - print "Impossible de créer : ".$dir[$i]."Erreur"; - $error++; - } - else - { - dolibarr_syslog ("Le dossier '".$dir[$i]."' a ete créé"); - } - } - } - } - - + $this->dirs[0] = DOL_DATA_ROOT . "/telephonie/" ; + $this->dirs[1] = DOL_DATA_ROOT . "/telephonie/ligne/" ; + $this->dirs[2] = DOL_DATA_ROOT . "/telephonie/ligne/commande" ; + $this->dirs[3] = DOL_DATA_ROOT . "/telephonie/logs" ; + $this->dirs[4] = DOL_DATA_ROOT . "/telephonie/client" ; + $this->dirs[5] = DOL_DATA_ROOT . "/telephonie/client/rapports" ; + return $this->_init($sql);