From c21156dd13dd412cb2b2fc303f30fb2219ded59e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jun 2015 18:58:42 +0200 Subject: [PATCH] Fix: strict mode hunter --- htdocs/core/lib/ajax.lib.php | 4 ++-- htdocs/index.php | 4 ++-- htdocs/main.inc.php | 4 ++-- htdocs/product/card.php | 10 +++++----- htdocs/user/class/user.class.php | 3 ++- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 47c4773cf62..db47ad041e2 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007-2014 Regis Houssin + * Copyright (C) 2007-2015 Regis Houssin * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -340,7 +340,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ if ($forcefocus) $msg.= '.select2(\'focus\')'; $msg.= ';'."\n"; - if (count($event)) + if (count($events)) { $msg.= ' jQuery("#'.$htmlname.'").change(function () { diff --git a/htdocs/index.php b/htdocs/index.php index eaebe195fd4..8c37688c0f8 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2015 Marcos GarcĂ­a * @@ -268,7 +268,7 @@ if (empty($user->societe_id)) else $board=$boardloaded[$classe]; $var=!$var; - if ($langfile[$key]) $langs->load($langfile[$key]); + if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text=$langs->trans($titres[$key]); print ''; print '
'; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6789abc3f54..bb574a68b77 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2011-2014 Philippe Grand * Copyright (C) 2008 Matteli * Copyright (C) 2011-2013 Juanjo Menent @@ -1803,7 +1803,7 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput { global $conf,$langs; - if (!$htmlinputid) { + if (empty($htmlinputid)) { $htmlinputid = $htmlinputname; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 81a8d5131c0..65845a5dd2c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006 Auguria SARL * Copyright (C) 2010-2014 Juanjo Menent @@ -1385,7 +1385,7 @@ else print ''; + if (($action != 'editbarcodetype') && ! empty($user->rights->barcode->creer)) print ''; print '
'; print $langs->trans("BarcodeType"); print ''; - if (($action != 'editbarcodetype') && $user->rights->barcode->creer) print 'id.'">'.img_edit($langs->trans('Edit'),1).'id.'">'.img_edit($langs->trans('Edit'),1).'
'; print ''; if ($action == 'editbarcodetype') @@ -1406,7 +1406,7 @@ else print ''; + if (($action != 'editbarcode') && ! empty($user->rights->barcode->creer)) print ''; print '
'; print $langs->trans("BarcodeValue"); print ''; - if (($action != 'editbarcode') && $user->rights->barcode->creer) print 'id.'">'.img_edit($langs->trans('Edit'),1).'id.'">'.img_edit($langs->trans('Edit'),1).'
'; print ''; if ($action == 'editbarcode') @@ -1461,7 +1461,7 @@ else print ''; // Batch number management (to batch) - if ($conf->productbatch->enabled) { + if (! empty($conf->productbatch->enabled)) { print ''.$langs->trans("ManageLotSerial").''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch'); @@ -1552,7 +1552,7 @@ else } // Unit - if($conf->global->PRODUCT_USE_UNITS) + if (! empty($conf->global->PRODUCT_USE_UNITS)) { $unit = $object->getLabelOfUnit(); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index bca20fccbb9..b55723d3735 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4,7 +4,7 @@ * Copyright (c) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2013-2014 Philippe Grand @@ -1823,6 +1823,7 @@ class User extends CommonObject { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; $result = '';