This commit is contained in:
Rodolphe Quiedeville 2005-03-22 09:03:27 +00:00
parent 3680885660
commit b9d7ec1992

View File

@ -32,15 +32,16 @@ $img_root = DOL_DATA_ROOT."/graph/telephonie/";
*/ */
$dirs[0] = DOL_DATA_ROOT."/graph/"; $dirs[0] = DOL_DATA_ROOT."/graph/";
$dirs[1] = DOL_DATA_ROOT."/graph/telephonie/"; $dirs[1] = DOL_DATA_ROOT."/graph/telephonie/";
$dirs[2] = DOL_DATA_ROOT."/graph/telephonie/communications/"; $dirs[2] = DOL_DATA_ROOT."/graph/telephonie/ca/";
$dirs[3] = DOL_DATA_ROOT."/graph/telephonie/factures/"; $dirs[3] = DOL_DATA_ROOT."/graph/telephonie/client/";
$dirs[4] = DOL_DATA_ROOT."/graph/telephonie/ca/"; $dirs[4] = DOL_DATA_ROOT."/graph/telephonie/commercials/";
$dirs[5] = DOL_DATA_ROOT."/graph/telephonie/client/"; $dirs[5] = DOL_DATA_ROOT."/graph/telephonie/communications/";
$dirs[6] = DOL_DATA_ROOT."/graph/telephonie/lignes/"; $dirs[6] = DOL_DATA_ROOT."/graph/telephonie/contrats/";
$dirs[7] = DOL_DATA_ROOT."/graph/telephonie/commercials/"; $dirs[7] = DOL_DATA_ROOT."/graph/telephonie/factures/";
$dirs[8] = DOL_DATA_ROOT."/graph/telephonie/contrats/"; $dirs[8] = DOL_DATA_ROOT."/graph/telephonie/lignes/";
$numdir = sizeof($dirs); $numdir = (sizeof($dirs) + 2);
$i = $numdir ;
$sql = "SELECT distinct fk_commercial"; $sql = "SELECT distinct fk_commercial";
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
@ -48,15 +49,16 @@ $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
if ($db->query($sql)) if ($db->query($sql))
{ {
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $j = 0;
while ($i < $num) while ($j < $num)
{ {
$row = $db->fetch_row(); $row = $db->fetch_row();
$dirs[($numdir + $i)] = DOL_DATA_ROOT."/graph/telephonie/commercials/".$row[0]; $dirs[$i] = DOL_DATA_ROOT."/graph/telephonie/commercials/".$row[0];
$i++; $i++;
$j++;
} }
} }
@ -181,20 +183,16 @@ for ($i = 0 ; $i < 10 ; $i++)
function create_dir($dir) function create_dir($dir)
{ {
if (file_exists(dirname($dir)))
if (! file_exists($dir))
{ {
if (! file_exists($dir)) umask(0);
if (! @mkdir($dir, 0755))
{ {
umask(0); die ("Erreur: Le répertoire ".$dir." n'existe pas et Dolibarr n'a pu le créer.");
if (! @mkdir($dir, 0755))
{
die ("Erreur: Le répertoire ".$dir." n'existe pas et Dolibarr n'a pu le créer.");
}
} }
} }
else
{
create_dir(dirname($dir));
}
} }
?> ?>