From 2a6f050e327ba410395d24a9005ae8b6944aa424 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 24 Jul 2018 18:28:56 +0200 Subject: [PATCH] Clean and update code --- htdocs/comm/propal/card.php | 4 ++-- htdocs/commande/card.php | 8 +++++--- htdocs/compta/bank/ligne.php | 6 ++++-- htdocs/compta/facture/card.php | 8 +++++--- htdocs/langs/en_US/other.lang | 1 + 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index dfde7ce613f..7ddeabb660b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2010-2015 Philippe Grand + * Copyright (C) 2010-2018 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Florian Henry @@ -749,7 +749,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0fe49cf9f12..0c3e4328505 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2016 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012-2016 Marcos GarcĂ­a * Copyright (C) 2012 Cedric Salvador @@ -700,8 +700,10 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + } + else + { + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index e006f78c6e7..10e549dd094 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -98,8 +98,10 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->ban { dol_print_error($db); } - } else { - setEventMessage('Missing ids','errors'); + } + else + { + setEventMessages($langs->trans("MissingIds"), null, 'errors'); } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d5835f96781..1dce30f5c19 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1705,8 +1705,10 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + } + else + { + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } @@ -2430,7 +2432,7 @@ if (empty($reshook)) if($error) { - setEventMessage($langs->trans('ErrorsOnXLines',$error), 'errors'); + setEventMessages($langs->trans('ErrorsOnXLines',$error), null, 'errors'); } } } diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 3556862bfec..b4638ad73f0 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -235,6 +235,7 @@ YourPasswordMustHaveAtLeastXChars=Your password must have at least %s