diff --git a/htdocs/core/conf.class.php b/htdocs/core/conf.class.php
index d5bfb33bedc..7c4d5081839 100644
--- a/htdocs/core/conf.class.php
+++ b/htdocs/core/conf.class.php
@@ -293,6 +293,10 @@ class Conf
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
// Module Barcode
$this->barcode->dir_temp=$rootfordata."/barcode/temp";
+ // Module stock
+ $this->stock->dir_temp=$rootfordata."/stock/temp";
+ // Module prelevement
+ $this->prelevement->dir_output=$rootfordata."/prelevement";
/*
* Modification de quelques variable de conf en fonction des Constantes
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index b0ad17f047d..c6033b4c0c0 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -36,7 +36,7 @@ define('EURO',chr(128));
// Definition des constantes syslog
if (function_exists("define_syslog_variables"))
{
- define_syslog_variables();
+ define_syslog_variables();
}
else
{
@@ -68,7 +68,7 @@ if (empty($dolibarr_main_db_host))
{
print 'Error: Dolibarr setup was run but was not completed.
'."\n";
print 'Please, run Dolibarr install process until the end...'."\n";
- exit;
+ exit;
}
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
if (empty($dolibarr_main_data_root))
@@ -91,7 +91,7 @@ define('DOL_URL_ROOT', $pos); // URL racine relative
*/
if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"))
{
- print "Error: Dolibarr config file content seems to be not correctly defined.
\n";
+ print "Error: Dolibarr config file content seems to be not correctly defined.
\n";
print "Please run dolibarr setup by calling page /install.
\n";
exit;
}
@@ -159,8 +159,8 @@ define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
// Detection browser
if (isset($_SERVER["HTTP_USER_AGENT"]))
{
- if (eregi('firefox',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
- if (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
+ if (eregi('firefox',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
+ if (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
}
// Chargement des includes principaux de librairies communes
@@ -262,17 +262,17 @@ if (! defined('NOREQUIRESOC'))
if (is_numeric($conf->global->MAIN_INFO_SOCIETE_PAYS))
{
$mysoc->pays_id=$conf->global->MAIN_INFO_SOCIETE_PAYS;
- $sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
- $sql .= " WHERE rowid = ".$conf->global->MAIN_INFO_SOCIETE_PAYS;
- $result=$db->query($sql);
- if ($result)
- {
- $obj = $db->fetch_object();
- $mysoc->pays_code=$obj->code;
- }
- else {
- dol_print_error($db);
- }
+ $sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
+ $sql .= " WHERE rowid = ".$conf->global->MAIN_INFO_SOCIETE_PAYS;
+ $result=$db->query($sql);
+ if ($result)
+ {
+ $obj = $db->fetch_object();
+ $mysoc->pays_code=$obj->code;
+ }
+ else {
+ dol_print_error($db);
+ }
}
// Si dans MAIN_INFO_SOCIETE_PAYS on a deja un code, tout est fait
else
diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php
index ac6b18deab5..3883389bf3e 100644
--- a/htdocs/viewimage.php
+++ b/htdocs/viewimage.php
@@ -48,7 +48,7 @@ else
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
-
+
// Pour autre que companylogo, on charge environnement + info issus de logon comme le user
require("./main.inc.php");
// master.inc.php is included in main.inc.php
@@ -90,7 +90,7 @@ if ($modulepart)
$accessallowed=1;
$original_file=$conf->adherent->dir_output.'/'.$original_file;
}
-
+
// Wrapping pour les apercu factures
elseif ($modulepart == 'apercufacture')
{
@@ -112,7 +112,7 @@ if ($modulepart)
}
$original_file=$conf->propale->dir_output.'/'.$original_file;
}
-
+
// Wrapping pour les apercu commande
elseif ($modulepart == 'apercucommande')
{
@@ -123,7 +123,7 @@ if ($modulepart)
}
$original_file=$conf->commande->dir_output.'/'.$original_file;
}
-
+
// Wrapping pour les apercu intervention
elseif ($modulepart == 'apercufichinter')
{
@@ -165,7 +165,7 @@ if ($modulepart)
}
$original_file=$conf->fournisseur->dir_commande_temp.'/'.$original_file;
}
-
+
// Wrapping pour les images des stats factures
elseif ($modulepart == 'billstats')
{
@@ -185,7 +185,7 @@ if ($modulepart)
}
$original_file=$conf->fournisseur->dir_facture_temp.'/'.$original_file;
}
-
+
// Wrapping pour les images des stats expeditions
elseif ($modulepart == 'expeditionstats')
{
@@ -271,7 +271,7 @@ if ($modulepart)
elseif ($modulepart == 'graph_stock')
{
$accessallowed=1;
- $original_file=DOL_DATA_ROOT.'/entrepot/temp/'.$original_file;
+ $original_file=$conf->stock->dir_temp.'/'.$original_file;
}
// Wrapping pour les graph fournisseurs
@@ -294,7 +294,7 @@ if ($modulepart)
$accessallowed=1;
$original_file=''; // No files are built on disk
}
-
+
// images des stats du commercial
elseif ($modulepart == 'graph_comm')
{
@@ -318,7 +318,7 @@ if (! $accessallowed)
}
// Security:
-// On interdit les remont�es de repertoire ainsi que les pipe dans
+// On interdit les remontees de repertoire ainsi que les pipe dans
// les noms de fichiers.
if (eregi('\.\.',$original_file) || eregi('[<>|]',$original_file))
{
@@ -353,7 +353,7 @@ if ($modulepart == 'barcode')
else
{
// Ouvre et renvoi fichier
- clearstatcache();
+ clearstatcache();
// Output files on disk
$filename = basename($original_file);
diff --git a/scripts/books/droits-editeurs.php b/scripts/books/droits-editeurs.php
index 6a95bcf49ce..5d0efd13456 100644
--- a/scripts/books/droits-editeurs.php
+++ b/scripts/books/droits-editeurs.php
@@ -97,7 +97,7 @@ class pdf_courrier_editeur
$fichref = $year;
- $dir = DOL_DATA_ROOT."/societe/courrier/" . get_exdir($id);
+ $dir = $conf->societe->dir_output."/courrier/" . get_exdir($id);
$file = $dir . $fichref . ".pdf";
if (! file_exists($dir))
diff --git a/scripts/cron/batch_produit_buildgraph.php b/scripts/cron/batch_produit_buildgraph.php
index e11a7d5222f..ee64f443b19 100644
--- a/scripts/cron/batch_produit_buildgraph.php
+++ b/scripts/cron/batch_produit_buildgraph.php
@@ -71,7 +71,7 @@ $year = strftime('%Y',$now);
/*
*
*/
-$dir = DOL_DATA_ROOT."/product/temp";
+$dir = $conf->produit->dir_output."/temp";
if (!is_dir($dir) )
{
if (! create_exdir($dir,0755))
@@ -186,7 +186,7 @@ foreach ( $products as $id => $fdir)
$legends[$i] = $row[0];
$num[$i] = $row[1];
$ca[$i] = $row[2];
-
+
$i++;
}
$db->free($resql);
diff --git a/scripts/cron/batch_stock_buildgraph.php b/scripts/cron/batch_stock_buildgraph.php
index 403c725a816..8ca77817a24 100644
--- a/scripts/cron/batch_stock_buildgraph.php
+++ b/scripts/cron/batch_stock_buildgraph.php
@@ -70,7 +70,7 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++)
}
-$dir = DOL_DATA_ROOT."/entrepot/temp";
+$dir = $conf->stock->dir_temp;
$result=create_exdir($dir);
@@ -204,7 +204,7 @@ function graph_datas($file, $title, $values, $legends)
$height=230;
print "Build graph ".$file."\n";
-
+
$newvalues=array();
foreach ($values as $abs=>$ord)
{
diff --git a/scripts/prelevement/prelevement.php b/scripts/prelevement/prelevement.php
index 7c75fba444b..77ce5ff0b27 100644
--- a/scripts/prelevement/prelevement.php
+++ b/scripts/prelevement/prelevement.php
@@ -200,12 +200,12 @@ if (sizeof($factures_prev) > 0)
if ($db->query($sql))
{
- $row = $db->fetch_row();
+ $row = $db->fetch_row();
}
else
{
- $error++;
- dol_syslog("Erreur recherche reference");
+ $error++;
+ dol_syslog("Erreur recherche reference");
}
$ref = $ref . substr("00".($row[0]+1), -2);
@@ -222,15 +222,15 @@ if (sizeof($factures_prev) > 0)
if ($db->query($sql))
{
- $prev_id = $db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
+ $prev_id = $db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
- $bonprev = new BonPrelevement($db, DOL_DATA_ROOT."/prelevement/bon/".$filebonprev);
- $bonprev->id = $prev_id;
+ $bonprev = new BonPrelevement($db, $this->prelevement."/bon/".$filebonprev);
+ $bonprev->id = $prev_id;
}
else
{
- $error++;
- dol_syslog("Erreur création du bon de prelevement");
+ $error++;
+ dol_syslog("Erreur création du bon de prelevement");
}
}