From d10d9f0fb24f0fe8a5f1710252229c6ea07d86e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Feb 2018 17:22:07 +0100 Subject: [PATCH] Fix scrutinizer --- htdocs/compta/paiement/class/paiement.class.php | 2 +- htdocs/compta/tva/class/tva.class.php | 3 ++- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/fichinter/class/api_interventions.class.php | 1 + htdocs/societe/class/api_thirdparties.class.php | 2 ++ htdocs/societe/class/societe.class.php | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index fdcfc89c4e0..95c366dff0d 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1047,7 +1047,7 @@ class Paiement extends CommonObject */ function getNomUrl($withpicto=0, $option='', $mode='withlistofinvoices', $notooltip=0) { - global $langs; + global $conf, $langs; if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 689e5d8fed3..187d21cb0a6 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -652,9 +652,10 @@ class Tva extends CommonObject * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param string $option link option * @param int $notooltip 1=Disable tooltip + * @param string $morecss More CSS * @return string Chaine with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0) + function getNomUrl($withpicto=0, $option='', $notooltip=0, morecss='') { global $langs, $conf; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e3900d2d89e..9e6b5e4aeb1 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1205,7 +1205,7 @@ class Contrat extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 23073737d7e..2cfe14c7197 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -162,6 +162,7 @@ class Interventions extends DolibarrApi { $num = $db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; while ($i < $min) { $obj = $db->fetch_object($result); diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 35301b06a07..7326d99e2b7 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -261,6 +261,8 @@ class Thirdparties extends DolibarrApi { global $db, $hookmanager; + $error = 0; + if ($id == $idtodelete) { throw new RestException(400, 'Try to merge a thirdparty into itself'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 44e95f4159b..381f50ae218 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3780,7 +3780,7 @@ class Societe extends CommonObject */ public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { - if ($origin_id == $id) + if ($origin_id == $dest_id) { dol_syslog('Error: Try to merge a thirdparty into itself'); return false;