From 7d5464cfbcfd6182a69f46bef712eb4244ac3156 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 25 Jul 2018 15:25:23 +0200 Subject: [PATCH] Clean and update code --- htdocs/compta/bank/ligne.php | 2 +- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/lib/admin.lib.php | 2 +- .../interface_50_modTicket_TicketEmail.class.php | 9 ++++++--- htdocs/expedition/card.php | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 10e549dd094..94db9607c30 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'compta', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); if (! empty($conf->adherent->enabled)) $langs->load("members"); if (! empty($conf->don->enabled)) $langs->load("donations"); if (! empty($conf->loan->enabled)) $langs->load("loan"); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 646be9a3f92..7ce7ed12bff 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -703,7 +703,7 @@ if ($massaction == 'confirm_createbills') if (! $error) { $db->commit(); - setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); // Make a redirect to avoid to bill twice if we make a refresh or back $param=''; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index eb3ef3698a4..0e7203ba748 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1201,7 +1201,7 @@ function activateModulesRequiredByCountry($country_code) { activateModule($modName); - setEventMessage($objMod->automatic_activation[$country_code],'warnings'); + setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings'); } } diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 56bbd897f3d..3e28ea3e4ef 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -152,9 +152,12 @@ class InterfaceTicketEmail extends DolibarrTriggers } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ab860ced2e9..faecdbd854e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -276,7 +276,7 @@ if (empty($reshook)) // We try to set an amount // Case we dont use the list of available qty for each warehouse/lot // GUI does not allow this yet - setEventMessage('StockIsRequiredToChooseWhichLotToUse', 'errors'); + setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors'); } } }