diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php
index 6307e81042c..d2072a0c79c 100644
--- a/htdocs/admin/askpricesupplier.php
+++ b/htdocs/admin/askpricesupplier.php
@@ -319,7 +319,6 @@ foreach ($dirmodels as $reldir)
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
';
- $askpricesupplier->type=0;
$nextval=$module->getNextValue($mysoc,$askpricesupplier);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=''.$langs->trans("NextValue").': ';
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index 76af3708c8b..1cd605ea9ca 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -341,7 +341,7 @@ else if ($id || $ref)
llxHeader("","",$langs->trans("CardProduct".$product->type));
- $head=product_prepare_head($product, $user);
+ $head=product_prepare_head($product);
$titre=$langs->trans("CardProduct".$product->type);
$picto=($product->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'category', $titre,0,$picto);
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 900a970d949..b6215165d35 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -781,8 +781,8 @@ class Account extends CommonObject
$result=$this->deleteExtraFields();
if ($result < 0)
{
- return -1;
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
+ return -1;
}
}
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index ad5af8f84c2..f87791dfed9 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -88,8 +88,8 @@ llxHeader("",$langs->trans("SocialContribution"),$help_url);
if ($object->id)
{
$alreadypayed=$object->getSommePaiement();
-
- $head=tax_prepare_head($object, $user);
+
+ $head=tax_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), 0, 'bill');
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index f8ebe12cd9b..5936e596fb7 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -255,7 +255,7 @@ if (empty($reshook))
}
else
{
- setEventMessage($object->error,$object->errors,'errors');
+ setEventMessages($object->error,$object->errors,'errors');
}
}
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 970f3543c45..2241a1e67f1 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -79,7 +79,7 @@ llxHeader("",$langs->trans("Contact"), $helpurl);
if ($object->id)
{
- $head = contact_prepare_head($object, $user);
+ $head = contact_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("Contact"), 0, 'contact');
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index ba2d8ad5772..278402679f8 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -94,7 +94,7 @@ function contact_prepare_head(Contact $object)
$head[$tab][2] = 'category';
$tab++;
}
-
+
// Info
$head[$tab][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Info");
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index a02747bb8aa..a35ab95a24a 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -28,12 +28,11 @@
* Prepare array with list of tabs
*
* @param Product $object Object related to tabs
- * @param User $user Object user
* @return array Array of tabs to show
*/
-function product_prepare_head($object, $user)
+function product_prepare_head($object)
{
- global $langs, $conf;
+ global $langs, $conf, $user;
$langs->load("products");
$h = 0;
diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php
index bee6999d183..f6623362dcc 100644
--- a/htdocs/core/lib/tax.lib.php
+++ b/htdocs/core/lib/tax.lib.php
@@ -36,7 +36,7 @@
*/
function tax_prepare_head(ChargeSociales $object)
{
- global $langs, $conf;
+ global $langs, $conf, $user;
$h = 0;
$head = array();
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index fd039efff24..bd6746c98e4 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -88,7 +88,7 @@ if ($object->id)
{
$object->fetch_thirdparty();
- $head=fichinter_prepare_head($object, $user);
+ $head=fichinter_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), 0, 'intervention');
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 788048a215b..3831f73a7ea 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -81,8 +81,8 @@ llxHeader("",$langs->trans("Loan"),$help_url);
if ($object->id)
{
$alreadypayed=$object->getSumPayment();
-
- $head = loan_prepare_head($object, $user);
+
+ $head = loan_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("Loan"), 0, 'bill');
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index 2123f683c21..eb3ac32c424 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -77,7 +77,7 @@ if ($id > 0 || ! empty($ref))
*/
if ($result > 0)
{
- $head=product_prepare_head($object, $user);
+ $head=product_prepare_head($object);
$titre=$langs->trans("CardProduct".$object->type);
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'margin', $titre, 0, $picto);
diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php
index 84140ee3f6a..260c8996fc4 100644
--- a/htdocs/product/canvas/product/actions_card_product.class.php
+++ b/htdocs/product/canvas/product/actions_card_product.class.php
@@ -138,7 +138,7 @@ class ActionsCardProduct
if ($action == 'view')
{
- $head = product_prepare_head($this->object,$user);
+ $head = product_prepare_head($this->object);
$this->tpl['showrefnav'] = $form->showrefnav($this->object,'ref','',1,'ref');
diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php
index 5926beab083..f7de783cd99 100644
--- a/htdocs/product/canvas/service/actions_card_service.class.php
+++ b/htdocs/product/canvas/service/actions_card_service.class.php
@@ -137,7 +137,7 @@ class ActionsCardService
if ($action == 'view')
{
- $head = product_prepare_head($this->object,$user);
+ $head = product_prepare_head($this->object);
$this->tpl['showrefnav'] = $form->showrefnav($this->object,'ref','',1,'ref');
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index eecec0705f7..1803c35629b 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1306,7 +1306,7 @@ else
// Fiche en mode visu
else
{
- $head=product_prepare_head($object, $user);
+ $head=product_prepare_head($object);
$titre=$langs->trans("CardProduct".$object->type);
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'card', $titre, 0, $picto);
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 96f2a589429..fc3a41a8861 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -174,7 +174,7 @@ if ($action == 'search')
llxHeader("","",$langs->trans("CardProduct".$object->type));
-$head=product_prepare_head($object, $user);
+$head=product_prepare_head($object);
$titre=$langs->trans("CardProduct".$object->type);
$picto=($object->type==Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'subproduct', $titre, 0, $picto);
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 9a71eac4f55..810a131be60 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -100,7 +100,7 @@ llxHeader("","",$langs->trans("CardProduct".$object->type));
if ($object->id)
{
- $head=product_prepare_head($object, $user);
+ $head=product_prepare_head($object);
$titre=$langs->trans("CardProduct".$object->type);
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'documents', $titre, 0, $picto);
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index c2196aba00b..f35e6628ad6 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -143,7 +143,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
$_POST["price"] = 0;
}
}
-
+
$product = new ProductFournisseur($db);
$result=$product->fetch($id);
if ($result <= 0)
@@ -191,7 +191,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
}
else
{
- if ($price_expression !== '')
+ if ($price_expression !== '')
{
//Check the expression validity by parsing it
$priceparser = new PriceParser($db);
@@ -257,7 +257,7 @@ if ($id || $ref)
* En mode visu
*/
- $head=product_prepare_head($product, $user);
+ $head=product_prepare_head($product);
$titre=$langs->trans("CardProduct".$product->type);
$picto=($product->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'suppliers', $titre, 0, $picto);
@@ -323,7 +323,7 @@ if ($id || $ref)
$supplier->fetch($socid);
print $supplier->getNomUrl(1);
print '';
- print '';
+ print '';
print '';
}
else
@@ -380,7 +380,7 @@ if ($id || $ref)
{
print '';
}
- print '';
+ print '';
// Vat rate
$default_vat='';
@@ -450,7 +450,7 @@ if ($id || $ref)
print '';
print '';
-
+
// Delai livraison jours
print '
| ' . $langs->trans("Ref") . ' | '; print $form->showrefnav($product, 'ref', '', 1, 'ref'); print ' | '; print '||
| ' . $langs->trans("Label") . ' | ' . $product->libelle . ' | '; print '||
| ' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ') | '; print $product->getLibStatut(2, 0); print ' | ||
| ' . $langs->trans("Status") . ' (' . $langs->trans("Buy") . ') | '; print $product->getLibStatut(2, 1); print ' | ||