diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php
index 8c256beae95..98e404438f8 100644
--- a/htdocs/includes/modules/DolibarrModules.class.php
+++ b/htdocs/includes/modules/DolibarrModules.class.php
@@ -782,7 +782,7 @@ class DolibarrModules
$r_type = $this->rights[$key][2];
$r_def = $this->rights[$key][3];
$r_perms = $this->rights[$key][4];
- $r_subperms = $this->rights[$key][5];
+ $r_subperms = isset($this->rights[$key][5])?$this->rights[$key][5]:'';
$r_modul = $this->rights_class;
if (empty($r_type)) $r_type='w';
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 76c83382355..f43afe643f0 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -64,7 +64,6 @@ else
$includeconferror='';
$conffile = "../conf/conf.php";
-$charset="UTF-8"; // If not output format found in any conf file
if (! defined('DONOTLOADCONF') && file_exists($conffile))
{
$result=include_once($conffile); // Load conf file
@@ -115,7 +114,7 @@ if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_m
define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:''));
define('DOL_DATA_ROOT',(isset($dolibarr_main_data_root)?$dolibarr_main_data_root:''));
-if (empty($conf->character_set_client)) $conf->character_set_client=$charset;
+if (empty($conf->character_set_client)) $conf->character_set_client="UTF-8";
if (empty($conf->db->dolibarr_main_db_collation)) $conf->db->dolibarr_main_db_collation='latin1_swedish_ci';
if (empty($conf->db->user)) $conf->db->user='';
@@ -149,8 +148,10 @@ if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant alrea
else if (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
else if (@is_writable("/")) define('SYSLOG_FILE','/dolibarr_install.log');
}
-define('SYSLOG_FILE_NO_ERROR',1);
-
+if (! defined('SYSLOG_FILE_NO_ERROR'))
+{
+ define('SYSLOG_FILE_NO_ERROR',1);
+}
// Forcage du parametrage PHP magic_quotes_gpc et nettoyage des parametres
// (Sinon il faudrait a chaque POST, conditionner
@@ -209,7 +210,7 @@ function conf($dolibarr_main_document_root)
$conf->db->user = trim($dolibarr_main_db_user);
$conf->db->pass = trim($dolibarr_main_db_pass);
- if (empty($character_set_client)) $character_set_client=$charset;
+ if (empty($character_set_client)) $character_set_client="UTF-8";
$conf->character_set_client=strtoupper($character_set_client);
if (empty($dolibarr_main_db_charset)) $dolibarr_main_db_charset='latin1';
$conf->db->character_set=$dolibarr_main_db_charset;
@@ -226,7 +227,10 @@ function conf($dolibarr_main_document_root)
else if (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
else if (@is_writable("/")) define('SYSLOG_FILE','/dolibarr_install.log');
}
- define('SYSLOG_FILE_NO_ERROR',1);
+ if (! defined('SYSLOG_FILE_NO_ERROR'))
+ {
+ define('SYSLOG_FILE_NO_ERROR',1);
+ }
return 1;
}
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 8bef87ca030..7b9de7bf47b 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -366,7 +366,7 @@ function migrate_paiements_orphelins_1($db,$langs,$conf)
{
$obj=$db->fetch_object($resql);
$facid=$obj->rowid;
-
+
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
$sql .= " VALUES (".$facid.",".$row[$i]['paymentid'].",".$row[$i]['pamount'].")";
$res += $db->query($sql);
@@ -474,7 +474,7 @@ function migrate_paiements_orphelins_2($db,$langs,$conf)
{
$obj=$db->fetch_object($resql);
$facid=$obj->rowid;
-
+
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
$sql .= " VALUES (".$facid.",".$row[$i]['paymentid'].",".$row[$i]['pamount'].")";
$res += $db->query($sql);
@@ -966,7 +966,7 @@ function migrate_price_facture($db,$langs,$conf)
print ''.$langs->trans('MigrationInvoice')."
\n";
// Liste des lignes facture non a jour
- $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_taux, fd.total_ttc,";
+ $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_taux, fd.total_ttc, fd.info_bits,";
$sql.= " f.rowid as facid, f.remise_percent as remise_percent_global, f.total_ttc as total_ttc_f";
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd, ".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE fd.fk_facture = f.rowid";
@@ -990,6 +990,7 @@ function migrate_price_facture($db,$langs,$conf)
$remise_percent = $obj->remise_percent;
$remise_percent_global = $obj->remise_percent_global;
$total_ttc_f = $obj->total_ttc_f;
+ $info_bits = $obj->info_bits;
// On met a jour les 3 nouveaux champs
$facligne= new FactureLigne($db);
@@ -1075,7 +1076,7 @@ function migrate_price_propal($db,$langs,$conf)
print ''.$langs->trans('MigrationProposal')."
\n";
// Liste des lignes propal non a jour
- $sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as tva_taux, ";
+ $sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as tva_taux, pd.info_bits,";
$sql.= " p.rowid as propalid, p.remise_percent as remise_percent_global";
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."propal as p";
$sql.= " WHERE pd.fk_propal = p.rowid";
@@ -1097,6 +1098,7 @@ function migrate_price_propal($db,$langs,$conf)
$txtva = $obj->tva_taux;
$remise_percent = $obj->remise_percent;
$remise_percent_global = $obj->remise_percent_global;
+ $info_bits = $obj->info_bits;
// On met a jour les 3 nouveaux champs
$propalligne= new PropaleLigne($db);
@@ -1144,7 +1146,7 @@ function migrate_price_propal($db,$langs,$conf)
{
print $langs->trans("AlreadyDone");
}
-
+
$db->free($resql);
$db->commit();
@@ -1179,7 +1181,7 @@ function migrate_price_contrat($db,$langs,$conf)
print ''.$langs->trans('MigrationContract')."
\n";
// Liste des lignes contrat non a jour
- $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, ";
+ $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,";
$sql.= " c.rowid as contratid";
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
$sql.= " WHERE cd.fk_contrat = c.rowid";
@@ -1201,6 +1203,7 @@ function migrate_price_contrat($db,$langs,$conf)
$txtva = $obj->tva_taux;
$remise_percent = $obj->remise_percent;
$remise_percent_global = $obj->remise_percent_global;
+ $info_bits = $obj->info_bits;
// On met a jour les 3 nouveaux champs
$contratligne= new ContratLigne($db);
@@ -1249,7 +1252,7 @@ function migrate_price_contrat($db,$langs,$conf)
{
print $langs->trans("AlreadyDone");
}
-
+
$db->free($resql);
$db->commit();
@@ -1283,7 +1286,7 @@ function migrate_price_commande($db,$langs,$conf)
print ''.$langs->trans('MigrationOrder')."
\n";
// Liste des lignes commande non a jour
- $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, ";
+ $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,";
$sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global";
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."commande as c";
$sql.= " WHERE cd.fk_commande = c.rowid";
@@ -1305,6 +1308,7 @@ function migrate_price_commande($db,$langs,$conf)
$txtva = $obj->tva_taux;
$remise_percent = $obj->remise_percent;
$remise_percent_global = $obj->remise_percent_global;
+ $info_bits = $obj->info_bits;
// On met a jour les 3 nouveaux champs
$commandeligne= new CommandeLigne($db);
@@ -1393,7 +1397,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
print ''.$langs->trans('MigrationSupplierOrder')."
\n";
// Liste des lignes commande non a jour
- $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, ";
+ $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,";
$sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd, ".MAIN_DB_PREFIX."commande_fournisseur as c";
$sql.= " WHERE cd.fk_commande = c.rowid";
@@ -1415,6 +1419,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
$txtva = $obj->tva_taux;
$remise_percent = $obj->remise_percent;
$remise_percent_global = $obj->remise_percent_global;
+ $info_bits = $obj->info_bits;
// On met a jour les 3 nouveaux champs
$commandeligne= new CommandeFournisseurLigne($db);
@@ -1624,9 +1629,9 @@ function migrate_commande_expedition($db,$langs,$conf)
if ($obj)
{
$error = 0;
-
+
$db->begin();
-
+
$sql = "SELECT e.rowid, e.fk_commande FROM ".MAIN_DB_PREFIX."expedition as e";
$resql = $db->query($sql);
if ($resql)
@@ -1637,7 +1642,7 @@ function migrate_commande_expedition($db,$langs,$conf)
if ($num)
{
$db->begin();
-
+
while ($i < $num)
{
$obj = $db->fetch_object($resql);
@@ -1696,9 +1701,9 @@ function migrate_commande_livraison($db,$langs,$conf)
if ($obj)
{
$error = 0;
-
+
$db->begin();
-
+
$sql = "SELECT l.rowid, l.fk_commande";
$sql.= ", c.ref_client, c.date_livraison";
$sql.= " FROM ".MAIN_DB_PREFIX."livraison as l, ".MAIN_DB_PREFIX."commande as c";
@@ -1786,7 +1791,7 @@ function migrate_detail_livraison($db,$langs,$conf)
$error = 0;
$db->begin();
-
+
$sql = "SELECT cd.rowid, cd.fk_product, cd.description, cd.subprice, cd.total_ht";
$sql.= ", ld.fk_livraison";
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld";
@@ -1817,7 +1822,7 @@ function migrate_detail_livraison($db,$langs,$conf)
$sql.= " FROM ".MAIN_DB_PREFIX."livraison";
$sql.= " WHERE rowid = ".$obj->fk_livraison;
$resql3=$db->query($sql);
-
+
if ($resql3)
{
$obju = $db->fetch_object($resql3);