Modif gestion de la creation des répertoires intégrées dorénavant à la
classe héritée
This commit is contained in:
parent
a6055716b4
commit
a6fce48399
@ -57,6 +57,8 @@ class modTelephonie extends DolibarrModules
|
|||||||
|
|
||||||
$this->special = 1;
|
$this->special = 1;
|
||||||
|
|
||||||
|
$this->dirs = array();
|
||||||
|
|
||||||
// Dépendances
|
// Dépendances
|
||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
$this->requiredby = array();
|
$this->requiredby = array();
|
||||||
@ -87,47 +89,13 @@ class modTelephonie extends DolibarrModules
|
|||||||
* Documents
|
* Documents
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (defined("DOL_DATA_ROOT"))
|
$this->dirs[0] = DOL_DATA_ROOT . "/telephonie/" ;
|
||||||
{
|
$this->dirs[1] = DOL_DATA_ROOT . "/telephonie/ligne/" ;
|
||||||
$dir = DOL_DATA_ROOT . "/telephonie/" ;
|
$this->dirs[2] = DOL_DATA_ROOT . "/telephonie/ligne/commande" ;
|
||||||
|
$this->dirs[3] = DOL_DATA_ROOT . "/telephonie/logs" ;
|
||||||
if (! file_exists($dir))
|
$this->dirs[4] = DOL_DATA_ROOT . "/telephonie/client" ;
|
||||||
{
|
$this->dirs[5] = DOL_DATA_ROOT . "/telephonie/client/rapports" ;
|
||||||
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 "<tr><td>Impossible de créer : ".$dir[$i]."</td><td bgcolor=\"red\">Erreur</td></tr>";
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_syslog ("Le dossier '".$dir[$i]."' a ete créé");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return $this->_init($sql);
|
return $this->_init($sql);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user