From 866a7df510fe6528c48a20eadd32127c0b7a4ad3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 Oct 2018 18:23:48 +0200 Subject: [PATCH 1/6] FIX $forceentity is not used, replace by $currentobject if needed --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d15d07e4c6e..ef9703cf946 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -115,16 +115,16 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port) * 'c_paiement', 'c_payment_term', ... * @param int $shared 0=Return id of current entity only, * 1=Return id of current entity + shared entities (default) - * @param int $forceentity Entity id + * @param object $currentobject Current object if needed * @return mixed Entity id(s) to use */ -function getEntity($element, $shared=1, $forceentity=null) +function getEntity($element, $shared=1, $currentobject=null) { global $conf, $mc; if (is_object($mc)) { - return $mc->getEntity($element, $shared, $forceentity); + return $mc->getEntity($element, $shared, $currentobject); } else { From e1625990f27cc2699f90e255fc446762de7c4611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Oct 2018 20:54:53 +0200 Subject: [PATCH 2/6] use strict compare --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ced75842606..bb0f8724907 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -800,8 +801,7 @@ class CommandeFournisseur extends CommonOrder $mybool|=@include_once $dir.$file; } - if (! $mybool) - { + if ($mybool === false) { dol_print_error('',"Failed to include file ".$file); return ''; } From 84219039a21764768254acb121dd6518c41aaaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Oct 2018 20:57:59 +0200 Subject: [PATCH 3/6] use strict compare --- htdocs/fourn/class/paiementfourn.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index a366faa0400..be3b9fbdcaa 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -654,14 +655,12 @@ class PaiementFourn extends Paiement } // For compatibility - if (! $mybool) - { + if ($mybool === false) { $file = $conf->global->SUPPLIER_PAYMENT_ADDON.".php"; $classname = "mod_supplier_payment_".$conf->global->SUPPLIER_PAYMENT_ADDON; $classname = preg_replace('/\-.*$/','',$classname); // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { + foreach ($conf->file->dol_document_root as $dirroot) { $dir = $dirroot."/core/modules/supplier_payment/"; // Load file with numbering class (if found) @@ -671,8 +670,7 @@ class PaiementFourn extends Paiement } } - if (! $mybool) - { + if ($mybool === false) { dol_print_error('',"Failed to include file ".$file); return ''; } From d7507ac858d855923f016134df286a862a0aeed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Oct 2018 21:00:59 +0200 Subject: [PATCH 4/6] use strict compare --- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 58230038fcc..dd33c290f45 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2280,9 +2281,8 @@ class FactureFournisseur extends CommonInvoice $mybool|=@include_once $dir.$file; } - if (! $mybool) - { - dol_print_error('',"Failed to include file ".$file); + if ($mybool === false) { + dol_print_error('', "Failed to include file ".$file); return ''; } From 5ad03fcd35bbc9ba972503c03e2f448337c67baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Oct 2018 21:19:19 +0200 Subject: [PATCH 5/6] use strict compare --- htdocs/fichinter/class/fichinter.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 05a139e2a9a..70e95624c13 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Charlie Benke * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -805,15 +806,14 @@ class Fichinter extends CommonObject $mybool|=@include_once $dir.$file; } - if (! $mybool) - { - dol_print_error('',"Failed to include file ".$file); + if ($mybool === false) { + dol_print_error('', "Failed to include file ".$file); return ''; } $obj = new $classname(); $numref = ""; - $numref = $obj->getNextValue($soc,$this); + $numref = $obj->getNextValue($soc, $this); if ( $numref != "") { From fa48a442d6e2ffa92911c566630bcb7891db64a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Oct 2018 21:21:59 +0200 Subject: [PATCH 6/6] use strict compare --- htdocs/expensereport/class/expensereport.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 2b343dd0074..efb5c41e300 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (c) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1512,7 +1513,7 @@ class ExpenseReport extends CommonObject $classname = $conf->global->EXPENSEREPORT_ADDON; // Include file with class - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/expensereport/"); @@ -1521,9 +1522,8 @@ class ExpenseReport extends CommonObject $mybool|=@include_once $dir.$file; } - if (! $mybool) - { - dol_print_error('',"Failed to include file ".$file); + if ($mybool === false) { + dol_print_error('', "Failed to include file ".$file); return ''; }