'."\n";
-
print '';
-
print "\n\n";
print ' '."\n";
+ // Define $box_max_lines
+ $box_max_lines=5;
+ if (! empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines=$conf->global->MAIN_BOXES_MAXLINES;
+
$ii=0;
foreach ($boxarray as $key => $box)
{
@@ -62,7 +64,7 @@ function printBoxesArea($user,$areacode)
//print 'box_id '.$boxarray[$ii]->box_id.' ';
//print 'box_order '.$boxarray[$ii]->box_order.' ';
// Affichage boite key
- $box->loadBox($conf->box_max_lines);
+ $box->loadBox($box_max_lines);
$box->showBox();
}
}
@@ -90,7 +92,7 @@ function printBoxesArea($user,$areacode)
//print 'box_id '.$boxarray[$ii]->box_id.' ';
//print 'box_order '.$boxarray[$ii]->box_order.' ';
// Affichage boite key
- $box->loadBox($conf->box_max_lines);
+ $box->loadBox($box_max_lines);
$box->showBox();
}
}
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index ab58b71972c..2985e4651e0 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -121,15 +121,18 @@ class Categorie
/**
* Add category into database
*
- * @return int -1 : erreur SQL
- * -2 : nouvel ID inconnu
- * -3 : categorie invalide
+ * @param User $user Object user
+ * @return int -1 : erreur SQL
+ * -2 : nouvel ID inconnu
+ * -3 : categorie invalide
*/
- function create()
+ function create($user='')
{
global $conf,$langs;
$langs->load('categories');
+ $error=0;
+
// Clean parameters
if (empty($this->visible)) $this->visible=0;
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
@@ -201,14 +204,17 @@ class Categorie
/**
* Update category
*
- * @return int 1 : OK
- * -1 : SQL error
- * -2 : invalid category
+ * @param User $user Object user
+ * @return int 1 : OK
+ * -1 : SQL error
+ * -2 : invalid category
*/
- function update()
+ function update($user='')
{
global $conf, $langs;
+ $error=0;
+
// Clean parameters
$this->label=trim($this->label);
$this->description=trim($this->description);
@@ -879,12 +885,12 @@ class Categorie
$sql.= " AND c.label='".$this->db->escape($this->label)."'";
}
dol_syslog("Categorie::already_exists sql=".$sql);
- $res = $this->db->query($sql);
- if ($res)
+ $resql = $this->db->query($sql);
+ if ($resql)
{
- if($this->db->num_rows($resql) > 0) // Checking for empty resql
+ if ($this->db->num_rows($resql) > 0) // Checking for empty resql
{
- $obj = $this->db->fetch_array($res);
+ $obj = $this->db->fetch_array($resql);
/* If object called create, obj cannot have is id.
* If object called update, he mustn't have the same label as an other category for this mother.
* So if the result have the same id, update is not for label, and if result have an other one,
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 6450eab568f..82057f92f64 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -381,7 +381,6 @@ class Propal extends CommonObject
$this->line->subprice=$pu_ht;
$this->line->rang=$rangtouse;
$this->line->info_bits=$info_bits;
- $this->line->fk_remise_except=$fk_remise_except;
$this->line->total_ht=$total_ht;
$this->line->total_tva=$total_tva;
$this->line->total_localtax1=$total_localtax1;
@@ -1149,6 +1148,7 @@ class Propal extends CommonObject
{
global $conf,$langs;
+ $error=0;
$now=dol_now();
if ($user->rights->propale->valider)
@@ -1477,7 +1477,8 @@ class Propal extends CommonObject
global $langs,$conf;
$this->statut = $statut;
-
+ $error=0;
+
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
@@ -2536,13 +2537,17 @@ class PropaleLigne
}
/**
- * \brief Insert object line propal in database
- * \return int <0 if KO, >0 if OK
+ * Insert object line propal in database
+ *
+ * @param int $notrigger 1=no trigger ran
+ * @return int <0 if KO, >0 if OK
*/
function insert($notrigger=0)
{
global $conf,$langs,$user;
+ $error=0;
+
dol_syslog("PropaleLigne::insert rang=".$this->rang);
// Clean parameters
@@ -2599,8 +2604,6 @@ class PropaleLigne
$resql=$this->db->query($sql);
if ($resql)
{
- $this->rang=$rangmax;
-
$this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet');
if (! $notrigger)
{
@@ -2632,6 +2635,7 @@ class PropaleLigne
{
global $conf,$langs,$user;
+ $error=0;
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid;
@@ -2667,6 +2671,8 @@ class PropaleLigne
{
global $conf,$langs,$user;
+ $error=0;
+
// Clean parameters
if (empty($this->tva_tx)) $this->tva_tx=0;
if (empty($this->localtax1_tx)) $this->localtax1_tx=0;
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 4734a881ed0..2e663f1fe4d 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -99,15 +99,13 @@ class Commande extends CommonObject
/**
* Constructor
*
- * @param DoliDB $DB Database handler
+ * @param DoliDB $db Database handler
*/
- function Commande($DB)
+ function Commande($db)
{
global $langs;
$langs->load('orders');
- $this->db = $DB;
- $this->socid = $socid;
- $this->id = $commandeid;
+ $this->db = $db;
$this->remise = 0;
$this->remise_percent = 0;
@@ -447,9 +445,10 @@ class Commande extends CommonObject
}
/**
- * Close order
- * @param user Objet user that close
- * @return int <0 if KO, >0 if OK
+ * Close order
+ *
+ * @param user Objet user that close
+ * @return int <0 if KO, >0 if OK
*/
function cloture($user)
{
@@ -501,13 +500,15 @@ class Commande extends CommonObject
}
/**
- * \brief Cancel an order
- * \return int <0 if KO, >0 if OK
- * \remarks If stock is decremented on order validation, we must reincrement it
+ * Cancel an order
+ * If stock is decremented on order validation, we must reincrement it
+ *
+ * @param int $idwarehouse Id warehouse to use for stock change.
+ * @return int <0 if KO, >0 if OK
*/
- function cancel($user)
+ function cancel($user, $idwarehouse=-1)
{
- global $conf;
+ global $conf,$langs;
$error=0;
@@ -526,17 +527,20 @@ class Commande extends CommonObject
// If stock is decremented on validate order, we must reincrement it
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
- require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
- $langs->load("agenda");
-
- if ($this->lines[$i]->fk_product > 0)
- {
- $mouvP = new MouvementStock($this->db);
- // We increment stock of product (and sub-products)
- $entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot
- $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
- if ($result < 0) { $error++; }
- }
+ require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
+ $langs->load("agenda");
+
+ $num=count($this->lines);
+ for ($i = 0; $i < $num; $i++)
+ {
+ if ($this->lines[$i]->fk_product > 0)
+ {
+ $mouvP = new MouvementStock($this->db);
+ // We increment stock of product (and sub-products)
+ $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
+ if ($result < 0) { $error++; }
+ }
+ }
}
if (! $error)
@@ -604,7 +608,6 @@ class Commande extends CommonObject
dol_syslog("Commande::create ".$this->error, LOG_ERR);
return -1;
}
- if (! $remise) $remise=0;
if (! $this->fk_project) $this->fk_project = 0;
// $date_commande is deprecated
@@ -1299,14 +1302,14 @@ class Commande extends CommonObject
}
else
{
- dol_syslog('Commande::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
- $this->error='Order with id '.$rowid.' not found sql='.$sql;
+ dol_syslog('Commande::Fetch Error rowid='.$id.' numrows=0 sql='.$sql);
+ $this->error='Order with id '.$id.' not found sql='.$sql;
return -2;
}
}
else
{
- dol_syslog('Commande::Fetch Error rowid='.$rowid.' Erreur dans fetch de la commande');
+ dol_syslog('Commande::Fetch Error rowid='.$id.' Erreur dans fetch de la commande');
$this->error=$this->db->error();
return -1;
}
@@ -2194,8 +2197,8 @@ class Commande extends CommonObject
$qty=price2num($qty);
$pu = price2num($pu);
$txtva=price2num($txtva);
- $txlocaltax1=price2num($txtlocaltax1);
- $txlocaltax2=price2num($txtlocaltax2);
+ $txlocaltax1=price2num($txlocaltax1);
+ $txlocaltax2=price2num($txlocaltax2);
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
@@ -2287,15 +2290,16 @@ class Commande extends CommonObject
/**
* Delete the customer order
- * @param user User object
- * @return int <=0 if KO, >0 if OK
+ *
+ * @param User $user User object
+ * @return int <=0 if KO, >0 if OK
*/
function delete($user)
{
global $conf, $langs;
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
- $err = 0;
+ $error = 0;
$this->db->begin();
@@ -2305,7 +2309,7 @@ class Commande extends CommonObject
if (! $this->db->query($sql) )
{
dol_syslog("CustomerOrder::delete error", LOG_ERR);
- $err++;
+ $error++;
}
// Delete order
@@ -2314,7 +2318,7 @@ class Commande extends CommonObject
if (! $this->db->query($sql) )
{
dol_syslog("CustomerOrder::delete error", LOG_ERR);
- $err++;
+ $error++;
}
// Delete linked object
@@ -2326,7 +2330,7 @@ class Commande extends CommonObject
if (! $this->db->query($sql) )
{
dol_syslog("CustomerOrder::delete error", LOG_ERR);
- $err++;
+ $error++;
}
// Delete linked contacts
@@ -2334,7 +2338,7 @@ class Commande extends CommonObject
if ($res < 0)
{
dol_syslog("CustomerOrder::delete error", LOG_ERR);
- $err++;
+ $error++;
}
// On efface le repertoire de pdf provisoire
@@ -2365,7 +2369,7 @@ class Commande extends CommonObject
}
}
- if ($err == 0)
+ if ($error == 0)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
@@ -2387,6 +2391,7 @@ class Commande extends CommonObject
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
+ *
* @param user Objet user
* @return int <0 if KO, >0 if OK
*/
@@ -2935,6 +2940,8 @@ class OrderLine
{
global $conf, $user, $langs;
+ $error=0;
+
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';";
dol_syslog("OrderLine::delete sql=".$sql);
@@ -2968,6 +2975,8 @@ class OrderLine
{
global $langs, $conf, $user;
+ $error=0;
+
dol_syslog("OrderLine::insert rang=".$this->rang);
// Clean parameters
@@ -3065,6 +3074,8 @@ class OrderLine
{
global $conf,$langs,$user;
+ $error=0;
+
// Clean parameters
if (empty($this->tva_tx)) $this->tva_tx=0;
if (empty($this->localtax1_tx)) $this->localtax1_tx=0;
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 602da307cc0..b27e00bc39e 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -864,7 +864,6 @@ class Account extends CommonObject
{
$this->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->rappro->warning_delay)) $this->nbtodolate++;
- if ($obj->rappro) $foundaccounttoconciliate++;
}
return $num;
}
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index df4f4f951c9..496c1605cf7 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -54,11 +54,7 @@ llxHeader();
$form = new Form($db);
-// If lib forced
-if (! empty($_GET["lib"])) $conf->global->MAIN_GRAPH_LIBRARY=$_GET["lib"];
-
-
-$datetime = time();
+$datetime = dol_now();
$year = dol_print_date($datetime, "%Y");
$month = dol_print_date($datetime, "%m");
$day = dol_print_date($datetime, "%d");
diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php
index c8e088cc128..f3dc9eee4cf 100644
--- a/htdocs/compta/dons/class/don.class.php
+++ b/htdocs/compta/dons/class/don.class.php
@@ -182,8 +182,8 @@ class Don extends CommonObject
$this->specimen=1;
$this->nom = 'Doe';
$this->prenom = 'John';
- $this->socid = $socids[$socid];
- $this->date = time();
+ $this->socid = 1;
+ $this->date = dol_now();
$this->amount = 100;
$this->public = 1;
$this->societe = 'The Company';
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 0ac3b4da79b..c39b3b2e959 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -190,9 +190,10 @@ class FactureRec extends Facture
/**
- * \brief Recupere l'objet facture et ses lignes de factures
- * \param rowid id de la facture a recuperer
- * \return int >0 si ok, <0 si ko
+ * Recupere l'objet facture et ses lignes de factures
+ *
+ * @param int $rowid Id de la facture a recuperer
+ * @return int >0 si ok, <0 si ko
*/
function fetch($rowid)
{
@@ -209,7 +210,7 @@ class FactureRec extends Facture
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; // TODO remplacer par une fonction
$sql.= ' WHERE f.rowid='.$rowid;
- dol_syslog("FactureRec::Fetch rowid=".$rowid.", societe_id=".$socid." sql=".$sql, LOG_DEBUG);
+ dol_syslog("FactureRec::Fetch rowid=".$rowid." sql=".$sql, LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
@@ -404,7 +405,9 @@ class FactureRec extends Facture
/**
- * \brief Add a line to invoice
+ * Add a line to invoice
+ *
+ * @return int <0 if KO, >0 if OK
*/
function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0)
{
@@ -420,7 +423,6 @@ class FactureRec extends Facture
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
if (! $qty) $qty=1;
- if (! $ventil) $ventil=0;
if (! $info_bits) $info_bits=0;
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 3986a5d8a78..6b8715bd1a1 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1395,6 +1395,8 @@ class Facture extends CommonObject
{
global $conf,$langs;
+ $error=0;
+
dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG);
$this->db->begin();
@@ -1515,7 +1517,7 @@ class Facture extends CommonObject
$result=$facreplaced->set_canceled($user,'replaced','');
if ($result < 0)
{
- $this->error=$facreplaced->error." sql=".$sql;
+ $this->error=$facreplaced->error;
$this->db->rollback();
return -13;
}
@@ -3420,6 +3422,8 @@ class FactureLigne
{
global $langs,$user,$conf;
+ $error=0;
+
dol_syslog(get_class($this)."::Insert rang=".$this->rang, LOG_DEBUG);
// Clean parameters
@@ -3562,12 +3566,16 @@ class FactureLigne
/**
* Update line into database
*
- * @return int <0 if KO, >0 if OK
+ * @param User $user User object
+ * @param int $notrigger Disable triggers
+ * @return int <0 if KO, >0 if OK
*/
- function update()
+ function update($user='',$notrigger=0)
{
global $user,$langs,$conf;
+ $error=0;
+
// Clean parameters
$this->desc=trim($this->desc);
if (empty($this->tva_tx)) $this->tva_tx=0;
@@ -3651,6 +3659,8 @@ class FactureLigne
{
global $conf,$langs,$user;
+ $error=0;
+
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php
index 4e0c70f07fa..97683e912b8 100644
--- a/htdocs/compta/localtax/class/localtax.class.php
+++ b/htdocs/compta/localtax/class/localtax.class.php
@@ -63,6 +63,8 @@ class localtax extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
// Clean parameters
$this->amount=trim($this->amount);
$this->label=trim($this->label);
@@ -128,6 +130,8 @@ class localtax extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
// Clean parameters
$this->amount=trim($this->amount);
$this->label=trim($this->label);
@@ -245,6 +249,8 @@ class localtax extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
$sql.= " WHERE rowid=".$this->id;
@@ -493,7 +499,7 @@ class localtax extends CommonObject
$acc = new Account($this->db);
$result=$acc->fetch($this->accountid);
- if ($result <= 0) dol_print_error($db);
+ if ($result <= 0) dol_print_error($this->db);
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user);
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 0a1fbb8c9f0..f031189d25c 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -471,6 +471,7 @@ class RemiseCheque extends CommonObject
/**
* Build document
+ *
* @param model Model name
* @param outputlangs Object langs
* @return int <0 if KO, >0 if OK
@@ -493,7 +494,7 @@ class RemiseCheque extends CommonObject
require_once($dir.$file);
$classname='BordereauCheque'.ucfirst($model);
- $docmodel = new $classname($db);
+ $docmodel = new $classname($this->db);
$sql = "SELECT b.banque, b.emetteur, b.amount, b.num_chq";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
@@ -535,14 +536,14 @@ class RemiseCheque extends CommonObject
$result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs);
if ($result > 0)
{
- $outputlangs->charset_output=$sav_charset_output;
+ //$outputlangs->charset_output=$sav_charset_output;
return 1;
}
else
{
- $outputlangs->charset_output=$sav_charset_output;
+ //$outputlangs->charset_output=$sav_charset_output;
dol_syslog("Error");
- dol_print_error($db,$docmodel->error);
+ dol_print_error($this->db,$docmodel->error);
return 0;
}
}
diff --git a/htdocs/compta/prelevement/class/bon-prelevement.class.php b/htdocs/compta/prelevement/class/bon-prelevement.class.php
index 8176aa153f9..a7275205caf 100644
--- a/htdocs/compta/prelevement/class/bon-prelevement.class.php
+++ b/htdocs/compta/prelevement/class/bon-prelevement.class.php
@@ -320,7 +320,7 @@ class BonPrelevement extends CommonObject
{
global $user,$conf;
- $error == 0;
+ $error = 0;
if ($this->db->begin())
{
@@ -401,7 +401,7 @@ class BonPrelevement extends CommonObject
{
global $conf,$langs;
- $error == 0;
+ $error = 0;
if ($this->_fetched == 1)
{
@@ -525,7 +525,8 @@ class BonPrelevement extends CommonObject
{
global $conf,$langs;
- $error == 0;
+ $error = 0;
+
dol_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
if ($this->db->begin())
{
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index 98b494120a2..8dc51a45b4e 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -74,8 +74,9 @@ class Tva extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
// Clean parameters
-
$this->amount=trim($this->amount);
$this->label=trim($this->label);
$this->note=trim($this->note);
@@ -83,14 +84,11 @@ class Tva extends CommonObject
$this->fk_user_creat=trim($this->fk_user_creat);
$this->fk_user_modif=trim($this->fk_user_modif);
-
-
// Check parameters
// Put here code to add control on parameters values
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva(";
-
$sql.= "tms,";
$sql.= "datep,";
$sql.= "datev,";
@@ -148,8 +146,9 @@ class Tva extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
// Clean parameters
-
$this->amount=trim($this->amount);
$this->label=trim($this->label);
$this->note=trim($this->note);
@@ -157,8 +156,6 @@ class Tva extends CommonObject
$this->fk_user_creat=trim($this->fk_user_creat);
$this->fk_user_modif=trim($this->fk_user_modif);
-
-
// Check parameters
// Put here code to add control on parameters values
@@ -275,6 +272,8 @@ class Tva extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
$sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
$sql.= " WHERE rowid=".$this->id;
@@ -522,7 +521,7 @@ class Tva extends CommonObject
$acc = new Account($this->db);
$result=$acc->fetch($this->accountid);
- if ($result <= 0) dol_print_error($db);
+ if ($result <= 0) dol_print_error($this->db);
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user);
diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index f65a6a500c0..f456f31b5a8 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -92,10 +92,11 @@ abstract class ActionsContactCardCommon
/**
* Load data control
*
- * @param int $id Id of object
+ * @param string &$action Type of action
+ * @param int $id Id of object
* @return void
*/
- function doActions(&$action)
+ function doActions(&$action, $id)
{
global $conf, $user, $langs;
@@ -397,11 +398,7 @@ abstract class ActionsContactCardCommon
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$login=dol_buildlogin($this->object->nom, $this->object->prenom);
- $generated_password='';
- if (! $ldap_sid)
- {
- $generated_password=getRandomPassword('');
- }
+ $generated_password=getRandomPassword('');
$password=$generated_password;
// Create a form array
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index bb0e08de0fe..c37c500828f 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -867,13 +867,13 @@ class Contact extends CommonObject
$code=$this->civilite_id;
return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : '';
- if (empty($ret))
+ /*if (empty($ret))
{
$ret=$code;
- $langs->getLabelFromKey($db,$reg[1],'c_civilite','code','civilite');
+ $langs->getLabelFromKey($this->db,$reg[1],'c_civilite','code','civilite');
//$ret=dol_getIdFromCode($this->db,$code,'c_civilite',
}
- return $ret;
+ return $ret;*/
}
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 9f58f2b2d81..3466e665f06 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -145,6 +145,8 @@ class Contrat extends CommonObject
{
global $langs,$conf;
+ $error=0;
+
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = 4,";
@@ -191,6 +193,8 @@ class Contrat extends CommonObject
{
global $langs,$conf;
+ $error=0;
+
// statut actif : 4
$this->db->begin();
@@ -225,11 +229,12 @@ class Contrat extends CommonObject
/**
- * \brief Close all lines of a contract
- * \param user Object User making action
- * \param langs Object Lang
- * \param conf Object Conf
- *
+ * Close all lines of a contract
+ *
+ * @param user Object User making action
+ * @param langs Object Lang
+ * @param conf Object Conf
+ * @return void
*/
function cloture($user,$langs='',$conf='')
{
@@ -268,7 +273,7 @@ class Contrat extends CommonObject
}
else
{
- dol_print_error($db,'Error in cloture function');
+ dol_print_error($this->db,'Error in cloture function');
$this->db->rollback();
}
}
@@ -282,6 +287,8 @@ class Contrat extends CommonObject
*/
function validate($user,$langs,$conf)
{
+ $error=0;
+
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET statut = 1";
$sql .= " WHERE rowid = ".$this->id . " AND statut = 0";
@@ -835,7 +842,6 @@ class Contrat extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
if (! $qty) $qty=1;
- if (! $ventil) $ventil=0;
if (! $info_bits) $info_bits=0;
if (! $pu_ht) $pu_ht=0;
if (! $pu_ttc) $pu_ttc=0;
@@ -883,7 +889,7 @@ class Contrat extends CommonObject
$sql.= " price_ht, remise"; // TODO A virer
if ($date_start > 0) { $sql.= ",date_ouverture_prevue"; }
if ($date_end > 0) { $sql.= ",date_fin_validite"; }
- $sql.= ") VALUES ($this->id, '" . $this->db->escape($label) . "','" . $this->db->escape($desc) . "',";
+ $sql.= ") VALUES ($this->id, '', '" . $this->db->escape($desc) . "',";
$sql.= ($fk_product>0 ? $fk_product : "null").",";
$sql.= " '".$qty."',";
$sql.= " '".$txtva."',";
@@ -1031,6 +1037,8 @@ class Contrat extends CommonObject
{
global $conf, $langs;
+ $error=0;
+
if ($this->statut >= 0)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet";
@@ -1105,9 +1113,9 @@ class Contrat extends CommonObject
$langs->load("contracts");
if ($mode == 0)
{
- if ($statut == 0) { return $langs->trans("ContractStatusDraft").$text; }
- if ($statut == 1) { return $langs->trans("ContractStatusValidated").$text; }
- if ($statut == 2) { return $langs->trans("ContractStatusClosed").$text; }
+ if ($statut == 0) { return $langs->trans("ContractStatusDraft"); }
+ if ($statut == 1) { return $langs->trans("ContractStatusValidated"); }
+ if ($statut == 2) { return $langs->trans("ContractStatusClosed"); }
}
if ($mode == 1)
{
@@ -1762,6 +1770,8 @@ class ContratLigne
{
global $conf, $langs;
+ $error=0;
+
// Clean parameters
$this->fk_contrat=trim($this->fk_contrat);
$this->fk_product=trim($this->fk_product);
diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php
index 9d4e59358b4..f61df2d8c4c 100644
--- a/htdocs/core/boxes/box_external_rss.php
+++ b/htdocs/core/boxes/box_external_rss.php
@@ -43,13 +43,15 @@ class box_external_rss extends ModeleBoxes {
/**
* Constructor
+ *
+ * @param DoliDB $db Database handler
*/
- function box_external_rss($DB,$param)
+ function box_external_rss($db,$param)
{
global $langs;
$langs->load("boxes");
- $this->db=$DB;
+ $this->db=$db;
$this->param=$param;
$this->boxlabel=$langs->trans("BoxLastRssInfos");
@@ -80,7 +82,7 @@ class box_external_rss extends ModeleBoxes {
// Get RSS feed
$url=@constant("EXTERNAL_RSS_URLRSS_".$site);
- $rssparser=new RssParser($db);
+ $rssparser=new RssParser($this->db);
$result = $rssparser->parser($url, $this->max, $cachedelay, $conf->externalrss->dir_temp);
// INFO on channel
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 32b51c8dd21..6b3337c4625 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -500,7 +500,8 @@ class CMailFile
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
{
- $fp = fopen($dolibarr_main_data_root."/dolibarr_mail.log","w");
+ $outputfile=$dolibarr_main_data_root."/dolibarr_mail.log";
+ $fp = fopen($outputfile,"w");
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php
index 658e09f2db3..4c0771ba7d8 100755
--- a/htdocs/core/class/CSMSFile.class.php
+++ b/htdocs/core/class/CSMSFile.class.php
@@ -198,7 +198,8 @@ class CSMSFile
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
{
- $fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","w");
+ $outputfile=$dolibarr_main_data_root."/dolibarr_sms.log";
+ $fp = fopen($outputfile,"w");
fputs($fp, $this->message);
@@ -218,7 +219,8 @@ class CSMSFile
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
{
- $fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","a+");
+ $outputfile=$dolibarr_main_data_root."/dolibarr_sms.log";
+ $fp = fopen($outputfile,"a+");
fputs($fp, "\nResult id=".$result);
diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php
index 8a43c28f8a4..e90c208d32e 100644
--- a/htdocs/core/class/antivir.class.php
+++ b/htdocs/core/class/antivir.class.php
@@ -68,7 +68,7 @@ class AntiVir
$return_var=0;
$safemode=ini_get("safe_mode");
// Create a clean fullcommand
- dol_syslog("AntiVir::dol_avscan_file Run command=".$fullcommand." with safe_mode ".($safe_mode?"on":"off"));
+ dol_syslog("AntiVir::dol_avscan_file Run command=".$fullcommand." with safe_mode ".($safemode?"on":"off"));
// Run CLI command. If run of Windows, you can get return with echo %ERRORLEVEL%
$lastline=exec($fullcommand, $output, $return_var);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 476d683c68e..9af3ec03256 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -81,6 +81,8 @@ abstract class CommonObject
{
global $user,$conf,$langs;
+ $error=0;
+
dol_syslog(get_class($this)."::add_contact $fk_socpeople, $type_contact, $source");
// Check parameters
@@ -200,6 +202,8 @@ abstract class CommonObject
{
global $user,$langs,$conf;
+ $error=0;
+
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
$sql.= " WHERE rowid =".$rowid;
@@ -348,7 +352,7 @@ abstract class CommonObject
$sql.= " AND ec.fk_c_type_contact=tc.rowid";
$sql.= " AND tc.element = '".$this->element."'";
- dol_syslog(get_class($object)."::swapContactStatus sql=".$sql);
+ dol_syslog(get_class($this)."::swapContactStatus sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -2055,7 +2059,7 @@ abstract class CommonObject
// Produit
if ($line->fk_product > 0)
{
- $product_static = new Product($db);
+ $product_static = new Product($this->db);
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
@@ -2164,7 +2168,7 @@ abstract class CommonObject
if (($line->info_bits & 2) == 2) // TODO Not sure this is used for source object
{
- $discount=new DiscountAbsolute($db);
+ $discount=new DiscountAbsolute($this->db);
$discount->fk_soc = $this->socid;
$this->tpl['label'].= $discount->getNomUrl(0,'discount');
}
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 242d140dbaf..bd254742731 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -34,41 +34,40 @@
class Conf
{
/** \public */
- //! Object with database handler
- var $db;
//! To store properties found in conf file
var $file;
+ //! Object with database handler
+ var $db;
//! To store properties found into database
var $global;
//! To store if javascript/ajax is enabked
- var $use_javascript_ajax;
+ public $use_javascript_ajax;
//! Used to store current currency
- var $monnaie;
+ public $currency;
//! Used to store current css (from theme)
- var $theme; // Contains current theme ("eldy", "auguria", ...)
- var $css; // Contains full path of css page ("/theme/eldy/style.css.php", ...)
+ public $theme; // Contains current theme ("eldy", "auguria", ...)
+ public $css; // Contains full path of css page ("/theme/eldy/style.css.php", ...)
//! Used to store current menu handlers
- var $top_menu;
- var $smart_menu;
+ public $top_menu;
+ public $smart_menu;
//! To store properties of multi-company
- var $multicompany;
- //! Used to store instance for multi-company (default 1)
- var $entity=1;
-
- var $css_modules = array();
- var $tabs_modules = array();
- var $triggers_modules = array();
- var $hooks_modules = array();
- public $login_method_modules = array();
- var $modules = array();
- var $entities = array();
-
- var $logbuffer = array();
-
- var $filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"');
+ public $multicompany;
+ //! Used to store running instance for multi-company (default 1)
+ public $entity=1;
+ //! Used to store list of entities to use for each element
+ public $entities = array();
+
+ public $modules = array(); // List of modules
+ public $css_modules = array();
+ public $tabs_modules = array();
+ public $triggers_modules = array('/core/triggers');
+ public $hooks_modules = array();
+ public $login_method_modules = array();
+
+ var $logbuffer = array();
/**
@@ -98,10 +97,7 @@ class Conf
*/
function setValues($db)
{
- dol_syslog("Conf::setValues");
-
- // Directory of core triggers
- $this->triggers_modules[] = "/core/triggers"; // Default relative path to triggers file
+ dol_syslog(get_class($this)."::setValues");
// Avoid warning if not defined
if (empty($this->db->dolibarr_main_db_encryption)) $this->db->dolibarr_main_db_encryption=0;
@@ -125,21 +121,21 @@ class Conf
}
$sql.= " ORDER BY entity"; // This is to have entity 0 first, then entity 1 that overwrite.
- $result = $db->query($sql);
- if ($result)
+ $resql = $db->query($sql);
+ if ($resql)
{
- $numr = $db->num_rows($result);
$multicompany_sharing=array();
+
$i = 0;
-
+ $numr = $db->num_rows($resql);
while ($i < $numr)
{
- $objp = $db->fetch_object($result);
+ $objp = $db->fetch_object($resql);
$key=$objp->name;
$value=$objp->value;
if ($key)
{
- if (! defined("$key")) define ("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE_ON and SYSLOG_FILE during install)
+ if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE_ON and SYSLOG_FILE during install)
$this->global->$key=$value;
if ($value && preg_match('/^MAIN_MODULE_/',$key))
@@ -154,7 +150,6 @@ class Conf
{
$params=explode(':',$value,2);
$this->tabs_modules[$params[0]][]=$value;
- //print 'xxx'.$params[0].'-'.$value;
}
// If this is constant for triggers activated by a module
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg))
@@ -207,7 +202,7 @@ class Conf
}
// Sharings between entities
- if (isset($this->multicompany->enabled) && $this->multicompany->enabled && ! empty($multicompany_sharing))
+ if (! empty($this->multicompany->enabled) && ! empty($multicompany_sharing))
{
$ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php');
if ($ret)
@@ -221,7 +216,7 @@ class Conf
}
}
}
- $db->free($result);
+ $db->free($resql);
//var_dump($this->modules);
// Clean some variables
@@ -259,15 +254,15 @@ class Conf
$this->$module->dir_temp=$rootfordata."/".$module."/temp";
}
- // For mycompany setup
+ // For mycompany storage
$this->mycompany->dir_output=$rootfordata."/mycompany";
$this->mycompany->dir_temp=$rootfordata."/mycompany/temp";
- // For admin features
+ // For admin storage
$this->admin->dir_output=$rootfordata.'/admin';
$this->admin->dir_temp=$rootfordata.'/admin/temp';
- // Module user
+ // For user storage
$this->user->dir_output=$rootforuser."/users";
$this->user->dir_temp=$rootforuser."/users/temp";
@@ -291,17 +286,15 @@ class Conf
$this->service->dir_temp =$rootfordata."/produit/temp";
// Module contrat
$this->contrat->dir_output=$rootfordata."/contracts";
- $this->contrat->dir_temp=$rootfordata."/contracts/temp";
+ $this->contrat->dir_temp =$rootfordata."/contracts/temp";
- /*
- * Set some default values
- */
+ // Set some default values
// societe
- if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
- if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
- if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
+ if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
+ if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
+ if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
if (empty($this->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $this->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
if (empty($this->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $this->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
@@ -309,60 +302,44 @@ class Conf
if (empty($this->global->USER_PASSWORD_GENERATED)) $this->global->USER_PASSWORD_GENERATED='standard'; // Default password generator
if (empty($this->global->MAIN_UMASK)) $this->global->MAIN_UMASK='0664'; // Default mask
- // conf->box_max_lines
- $this->box_max_lines=5;
- if (isset($this->global->MAIN_BOXES_MAXLINES)) $this->box_max_lines=$this->global->MAIN_BOXES_MAXLINES;
-
- // conf->use_preview_tabs
- $this->use_preview_tabs=0;
- if (isset($this->global->MAIN_USE_PREVIEW_TABS)) $this->use_preview_tabs=$this->global->MAIN_USE_PREVIEW_TABS;
-
// conf->use_javascript_ajax
$this->use_javascript_ajax=1;
if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) $this->use_javascript_ajax=! $this->global->MAIN_DISABLE_JAVASCRIPT;
// If no javascript_ajax, Ajax features are disabled.
- if (! $this->use_javascript_ajax)
- {
- $this->global->PRODUIT_USE_SEARCH_TO_SELECT=0;
- }
+ if (! $this->use_javascript_ajax) $this->global->PRODUIT_USE_SEARCH_TO_SELECT=0;
// conf->currency
if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR';
$this->currency=$this->global->MAIN_MONNAIE;
- // $this->global->COMPTA_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
+ // conf->global->COMPTA_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
if (empty($this->global->COMPTA_MODE)) $this->global->COMPTA_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
- // $this->liste_limit = constante de taille maximale des listes
+ // conf->liste_limit = constante de taille maximale des listes
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;
$this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT;
- // $this->product->limit_size = constante de taille maximale des select de produit
+ // conf->product->limit_size = constante de taille maximale des select de produit
if (! isset($this->global->PRODUIT_LIMIT_SIZE)) $this->global->PRODUIT_LIMIT_SIZE=100;
$this->product->limit_size=$this->global->PRODUIT_LIMIT_SIZE;
- // $this->theme et $this->css
+ // conf->theme et $this->css
if (empty($this->global->MAIN_THEME)) $this->global->MAIN_THEME="eldy";
$this->theme=$this->global->MAIN_THEME;
$this->css = "/theme/".$this->theme."/style.css.php";
- // $this->email_from = email pour envoi par dolibarr des mails automatiques
+ // conf->email_from = email pour envoi par dolibarr des mails automatiques
$this->email_from = "dolibarr-robot@domain.com";
if (! empty($this->global->MAIN_MAIL_EMAIL_FROM)) $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
- // $this->notification->email_from = email pour envoi par Dolibarr des notifications
+ // conf->notification->email_from = email pour envoi par Dolibarr des notifications
$this->notification->email_from=$this->email_from;
if (! empty($this->global->NOTIFICATION_EMAIL_FROM)) $this->notification->email_from=$this->global->NOTIFICATION_EMAIL_FROM;
- // $this->mailing->email_from = email pour envoi par Dolibarr des mailings
+ // conf->mailing->email_from = email pour envoi par Dolibarr des mailings
$this->mailing->email_from=$this->email_from;
if (! empty($this->global->MAILING_EMAIL_FROM)) $this->mailing->email_from=$this->global->MAILING_EMAIL_FROM;
- // Defini MAIN_GRAPH_LIBRARY
- if (empty($this->global->MAIN_GRAPH_LIBRARY)) $this->global->MAIN_GRAPH_LIBRARY = 'artichow';
-
- if (! isset($this->global->FCKEDITOR_EDITORNAME)) $this->global->FCKEDITOR_EDITORNAME='ckeditor'; // fckeditor to switch
-
// Format for date (used by default when not found or searched in lang)
$this->format_date_short="%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)
$this->format_date_short_java="dd/MM/yyyy"; // Format of day with Java tags
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index a759be3df03..ff065db2bae 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -208,7 +208,7 @@ class DiscountAbsolute
}
else
{
- dol_print_error($db);
+ dol_print_error($this->db);
return -1;
}
}
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 5f4b6708309..55209c975a5 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -139,14 +139,15 @@ class DolEditor
* Output edit area inside the HTML stream.
* Output depends on this->tool (fckeditor, ckeditor, texatrea, ...)
*
- * @param noprint 1=Return HTML string instead of printing it to output
+ * @param int $noprint 1=Return HTML string instead of printing it to output
+ * @return void
*/
function Create($noprint=0)
{
global $conf;
$found=0;
- $out='';
+ $out='';
if ($this->tool == 'fckeditor')
{
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 2ef8ec650c9..dfae7d72d17 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -66,15 +66,15 @@ class DolGraph
var $Legend=array();
var $LegendWidthMin=0;
- var $graph; // Objet Graph (Artichow, Phplot...)
+ var $graph; // Objet Graph (Artichow, Phplot...)
var $error;
- var $library=''; // Par defaut on utiliser PHPlot
+ var $library='artichow'; // Graphic library to use
- var $bordercolor; // array(R,G,B)
- var $bgcolor; // array(R,G,B)
- var $bgcolorgrid; // array(R,G,B)
- var $datacolor; // array(array(R,G,B),...)
+ var $bordercolor; // array(R,G,B)
+ var $bgcolor; // array(R,G,B)
+ var $bgcolorgrid; // array(R,G,B)
+ var $datacolor; // array(array(R,G,B),...)
/**
@@ -85,7 +85,6 @@ class DolGraph
global $conf;
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
-
// Test si module GD present
$modules_list = get_loaded_extensions();
$isgdinstalled=0;
@@ -99,15 +98,11 @@ class DolGraph
return -1;
}
-
- // Defini proprietes de l'objet graphe
- $this->library=$conf->global->MAIN_GRAPH_LIBRARY;
-
$this->bordercolor = array(235,235,224);
$this->datacolor = array(array(120,130,150), array(160,160,180), array(190,190,220));
$this->bgcolor = array(235,235,224);
- $color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
+ $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/graph-color.php';
if (is_readable($color_file))
{
include_once($color_file);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ed5615f79f9..7953349e9a8 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1036,7 +1036,7 @@ class Form
if ($num)
{
$out.= ' |