From 74d05da149655e29933b689881d0881833203b7c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 6 Aug 2018 11:28:34 +0200 Subject: [PATCH] fix : display if error --- htdocs/holiday/card.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index b19f63e0ab3..348edcac1e7 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -452,10 +452,15 @@ if ($action == 'confirm_valid') $newSolde = $soldeActuel - ($nbopenedday * $object->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type); - + $result=$object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type); + if ($result<0) { + setEventMessages(null, $object->errors,'errors'); + } // Mise à jour du solde - $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type); + $result=$object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type); + if ($result<0) { + setEventMessages(null, $object->errors,'errors'); + } // To $destinataire = new User($db);