diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 8ff533df259b1694d54d719a18f712f943f0afe0..706d14ebe129813cb5380e95f77de47d42e5cbc6 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -73,7 +73,7 @@ if ($action == 'remises') { if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', $_POST['MARGIN_METHODE_FOR_DISCOUNT'], 'chaine', 0, '', $conf->entity) > 0) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } else { @@ -85,7 +85,7 @@ if ($action == 'typemarges') { if (dolibarr_set_const($db, 'MARGIN_TYPE', $_POST['MARGIN_TYPE'], 'chaine', 0, '', $conf->entity) > 0) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } else { @@ -97,7 +97,7 @@ if ($action == 'contact') { if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', $_POST['AGENT_CONTACT_TYPE'], 'chaine', 0, '', $conf->entity) > 0) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } else { diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 7a36a316d13c70853b2cc05d0d3fcf263a720dcc..c419a8042103946fc3ed356f33ff0d6fa733c04c 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -99,7 +99,7 @@ if ($action == 'update') $res=$object->update($user); if ($res < 0) { - setEventMessage($object->error,'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action='edit'; } } @@ -131,7 +131,7 @@ if (GETPOST('ajoutcomment')) if (! $resql) { - setEventMessage($langs->trans('ErrorInsertingComment'), 'errors'); + setEventMessages($langs->trans('ErrorInsertingComment'), null, 'errors'); } } } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index ca10eac09b9a6ba9f85bc2d2a2429be7f2d501f0..5c14a20de23cac5f722b5ea861b4d25efa3775e9 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -91,7 +91,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout $num_rows = $db->num_rows($resql); if ($num_rows > 0) { - setEventMessage($langs->trans("VoteNameAlreadyExists"),'errors'); + setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); $error++; } else @@ -1024,11 +1024,11 @@ if (isset($_POST["boutonp"]) && $_POST["nom"] == "") { } if (isset($erreur_prenom) && $erreur_prenom) { - setEventMessage($langs->trans('VoteNameAlreadyExists'), 'errors'); + setEventMessages($langs->trans('VoteNameAlreadyExists'), null, 'errors'); } if (isset($erreur_ajout_date) && $erreur_ajout_date) { - setEventMessage($langs->trans("ErrorWrongDate"), 'errors'); + setEventMessages($langs->trans("ErrorWrongDate"), null, 'errors'); } //fin du tableau diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index 9797762d6cbed3ca6703fffc20bc797bfc22b5eb..a415d6b49872f0bab83ecbdd6a4cd394d4fb5f0f 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -84,7 +84,7 @@ if (isset($_POST["confirmecreation"])) //message d'erreur si aucun champ renseigné if ($testremplissage != "ok" || (!$toutchoix)) { - setEventMessage($langs->trans("ErrorOpenSurveyOneChoice"), 'errors'); + setEventMessages($langs->trans("ErrorOpenSurveyOneChoice"), null, 'errors'); } else { //format du sondage AUTRE diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 6a1efd3961748692dccb497d7d74066ac586fca8..ecfe319828ad732542969d1bdee4455828c87dff 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -156,13 +156,13 @@ if (GETPOST('confirmation')) } if (isset($errheure)) { - setEventMessage($langs->trans("ErrorBadFormat"), 'errors'); + setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors'); } } //If just one day and no other time options, error message if (count($_SESSION["totalchoixjour"])=="1" && $_POST["horaires0"][0]=="" && $_POST["horaires0"][1]=="" && $_POST["horaires0"][2]=="" && $_POST["horaires0"][3]=="" && $_POST["horaires0"][4]=="") { - setEventMessage($langs->trans("MoreChoices"), 'errors'); + setEventMessages($langs->trans("MoreChoices"), null, 'errors'); $erreur=true; } diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index ec78e9789ca786b9060f7fd6603f4078452e8568..c9ba1324a70f583e5af61c73f713b8d7728756fd 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -94,12 +94,12 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre")) $_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc'); //$testdate = false; //$_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc'); - setEventMessage('ExpireDate','warnings'); + setEventMessages('ExpireDate', null, 'warnings'); } } if (! $testdate) { - setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("ExpireDate")), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("ExpireDate")), null, 'errors'); } if ($titre && $testdate) diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 5a7301613c4410127a3d86b6d8efed3ae0fb16d8..98645575a13a649e8ec816dd02c94139e27388d5 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -67,7 +67,7 @@ if ($action == 'setvalue' && $user->admin) if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 89065cb7c77f3873c86cef4b9ba5299a05c5e347..f794989c59ebe98c0728c391c000133dcbceb06e 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -75,7 +75,7 @@ if ($action == 'setvalue' && $user->admin) if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -113,7 +113,7 @@ print $langs->trans("PaypalDesc")."<br>\n"; if (! function_exists('curl_version')) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorPhpCurlNotInstalled"), 'errors'); + setEventMessages($langs->trans("ErrorPhpCurlNotInstalled"), null, 'errors'); } diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index 79d7cdebfc2a6c3cc1e5e0a6197a15d85291f325..45086630c47ac811ac9e21aa0b10eb8e55c71be5 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -43,14 +43,14 @@ $price_globals = new PriceGlobalVariable($db); if ($action == 'edit_variable') { $res = $price_globals->fetch($selection); if ($res < 1) { - setEventMessage($price_globals->error, 'errors'); + setEventMessages($price_globals->error, $price_globals->errors, 'errors'); } } $price_updaters = new PriceGlobalVariableUpdater($db); if ($action == 'edit_updater') { $res = $price_updaters->fetch($selection); if ($res < 1) { - setEventMessage($price_updaters->error, 'errors'); + setEventMessages($price_updaters->error, $price_updaters->errors, 'errors'); } } @@ -67,7 +67,7 @@ if (!empty($action) && empty($cancel)) { if (!empty($save)) { foreach ($price_globals->listGlobalVariables() as $entry) { if ($price_globals->id != $entry->id && dol_strtolower($price_globals->code) == dol_strtolower($entry->code)) { - setEventMessage($langs->trans("ErrorRecordAlreadyExists"), 'errors'); + setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); $save = null; } } @@ -78,21 +78,21 @@ if (!empty($action) && empty($cancel)) { if ($res > 0) { $action = ''; } else { - setEventMessage($price_globals->error, 'errors'); + setEventMessages($price_globals->error, $price_globals->errors, 'errors'); } } elseif ($action == 'edit_variable' && !empty($save)) { $res = $price_globals->update($user); if ($res > 0) { $action = ''; } else { - setEventMessage($price_globals->error, 'errors'); + setEventMessages($price_globals->error, $price_globals->errors, 'errors'); } } elseif ($action == 'delete_variable') { $res = $price_globals->delete($selection, $user); if ($res > 0) { $action = ''; } else { - setEventMessage($price_globals->error, 'errors'); + setEventMessages($price_globals->error, $price_globals->errors, 'errors'); } } @@ -113,7 +113,7 @@ if (!empty($action) && empty($cancel)) { if ($res > 0) { $action = ''; } else { - setEventMessage($price_updaters->error, 'errors'); + setEventMessages($price_updaters->error, $price_updaters->errors, 'errors'); } } elseif ($action == 'edit_updater' && !empty($save)) { //Verify if process() works @@ -124,14 +124,14 @@ if (!empty($action) && empty($cancel)) { if ($res > 0) { $action = ''; } else { - setEventMessage($price_updaters->error, 'errors'); + setEventMessages($price_updaters->error, $price_updaters->errors, 'errors'); } } elseif ($action == 'delete_updater') { $res = $price_updaters->delete($selection, $user); if ($res > 0) { $action = ''; } else { - setEventMessage($price_updaters->error, 'errors'); + setEventMessages($price_updaters->error, $price_updaters->errors, 'errors'); } } } elseif (!empty($cancel)) { diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php index 83d90485b3d77dbdda723b073ffe8a5e74bc9568..64fa982fff1a7046bc58cda220bb577a235ed312 100644 --- a/htdocs/product/admin/price_rules.php +++ b/htdocs/product/admin/price_rules.php @@ -89,13 +89,13 @@ if ($_POST) { SET fk_level = ".$db->escape($i_fk_level).", var_percent = ".$i_var_percent.", var_min_percent = ".$i_var_min_percent." WHERE level = ".$i; if (!$db->query($sql)) { - setEventMessage($langs->trans('ErrorSavingChanges'), 'errors'); + setEventMessages($langs->trans('ErrorSavingChanges'), null, 'errors'); } } } - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } /* diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index b3d17646db523ee265d18c0ae115fa7679bcd484..57f6577f7897250d28c79a371db22b21caaa71f8 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -98,12 +98,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -196,11 +196,11 @@ if ($action) if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index 1f2820358e158245e8771b8f03b323adf08e45d4..0d3ea7584f1058b7197edd0d6f0494a3854efb4e 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -57,7 +57,7 @@ if ($action == 'convert') if ($oldvatrate == $newvatrate) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorNewValueCantMatchOldValue"),'errors'); + setEventMessages($langs->trans("ErrorNewValueCantMatchOldValue"), null, 'errors'); $error++; } @@ -225,12 +225,12 @@ if ($action == 'convert') // Output result if (! $error) { - if ($nbrecordsmodified > 0) setEventMessage($langs->trans("RecordsModified",$nbrecordsmodified)); - else setEventMessage($langs->trans("NoRecordFound"),'warnings'); + if ($nbrecordsmodified > 0) setEventMessages($langs->trans("RecordsModified",$nbrecordsmodified), null, 'mesgs'); + else setEventMessages($langs->trans("NoRecordFound"), null, 'warnings'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 86dfb8a8fd484f652c03f09671f2a00b0cc067a1..9686c4683ae4f05bf1074ebb6ebf42dcf7e576d1 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -85,9 +85,11 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se $error++; $action = 're-edit'; if ($object->error == "isFatherOfThis") { - setEventMessage($langs->trans("ErrorAssociationIsFatherOfThis"), 'errors'); - } else { - setEventMessage($object->error, 'errors'); + setEventMessages($langs->trans("ErrorAssociationIsFatherOfThis"), null, 'errors'); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -101,7 +103,7 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se { $error++; $action = 're-edit'; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index dc7c670f4cbd001a762c921459540d44ec092fa8..d7d059ae10de714ec9a6c94b6754b8b1c9a0ef7e 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -75,7 +75,7 @@ if ($action == 'add') $priceparser = new PriceParser($db); $price_result = $priceparser->parseProductSupplierExpression($id, $expression, 0, 0); if ($price_result < 0) { //Expression is not valid - setEventMessage($priceparser->translatedError(), 'errors'); + setEventMessages($priceparser->translatedError(), null, 'errors'); } else { @@ -85,21 +85,21 @@ if ($action == 'add') if ($result > 0) //created successfully, set the eid to newly created entry { $eid = $price_expression->id; - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } else { - setEventMessage("add: ".$price_expression->error, 'errors'); + setEventMessages("add: ".$price_expression->error, $price_expression->errors, 'errors'); } } } else if ($result < 0) { - setEventMessage("add find: ".$price_expression->error, 'errors'); + setEventMessages("add find: ".$price_expression->error, $price_expression->errors, 'errors'); } else { - setEventMessage($langs->trans("ErrorRecordAlreadyExists"), 'errors'); + setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); } } } @@ -115,7 +115,7 @@ if ($action == 'update') $priceparser = new PriceParser($db); $price_result = $priceparser->parseProductSupplierExpression($id, $expression, 0, 0); if ($price_result < 0) { //Expression is not valid - setEventMessage($priceparser->translatedError(), 'errors'); + setEventMessages($priceparser->translatedError(), null, 'errors'); } else { @@ -125,21 +125,21 @@ if ($action == 'update') $result = $price_expression->update($user); if ($result < 0) { - setEventMessage("update: ".$price_expression->error, 'errors'); + setEventMessages("update: ".$price_expression->error, $price_expression->errors, 'errors'); } else { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } } } else if ($result < 0) { - setEventMessage("update find: ".$price_expression->error, 'errors'); + setEventMessages("update find: ".$price_expression->error, $price_expression->errors, 'errors'); } else { - setEventMessage($langs->trans("ErrorRecordAlreadyExists"), 'errors'); + setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); } } } @@ -151,7 +151,7 @@ if ($action == 'delete') $result = $price_expression->delete($eid, $user); if ($result < 0) { - setEventMessage("delete: ".$price_expression->error, 'errors'); + setEventMessages("delete: ".$price_expression->error, $price_expression->errors, 'errors'); } $eid = 0; } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 522d2cf242ab6fc35e6801cbb8463f16bf39216a..5cc9e27a8cb997704736d0239d63f5c6b5cdf6d6 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -78,7 +78,7 @@ if ($action == 'add' && $user->rights->stock->creer) $id = $object->create($user); if ($id > 0) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); if (! empty($backtopage)) { @@ -94,11 +94,12 @@ if ($action == 'add' && $user->rights->stock->creer) else { $action = 'create'; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } - else { - setEventMessage($langs->trans("ErrorWarehouseRefRequired"), 'errors'); + else + { + setEventMessages($langs->trans("ErrorWarehouseRefRequired"), null, 'errors'); $action="create"; // Force retour sur page creation } } @@ -116,7 +117,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->stock->su } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action=''; } } @@ -143,13 +144,13 @@ if ($action == 'update' && $cancel <> $langs->trans("Cancel")) else { $action = 'edit'; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else { $action = 'edit'; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 604d7d30280c19ad41d247247fad729774bc6f45..ffce2e4db8fcbdcdba670492e2dde7c358fadeec 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -95,7 +95,7 @@ if ($action == 'addline') { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorWarehouseMustDiffers"),'errors'); + setEventMessages($langs->trans("ErrorWarehouseMustDiffers"), null, 'errors'); } if (! $qty) { @@ -113,7 +113,7 @@ if ($action == 'addline') if (empty($batch)) { $error++; - setEventMessage($langs->trans("ErrorTryToMakeMoveOnProductRequiringBatchData"), 'errors'); + setEventMessages($langs->trans("ErrorTryToMakeMoveOnProductRequiringBatchData"), null, 'errors'); } } } @@ -161,7 +161,7 @@ if ($action == 'createmovements') if (! GETPOST("label")) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired"),$langs->transnoentitiesnoconv("LabelMovement")); + setEventMessages($langs->trans("ErrorFieldRequired"),$langs->transnoentitiesnoconv("LabelMovement"), null, 'errors'); } $db->begin(); @@ -209,7 +209,7 @@ if ($action == 'createmovements') if ($result1 < 0) { $error++; - setEventMessage($product->errors,'errors'); + setEventMessages($product->errors, $product->errorss, 'errors'); } // Add stock @@ -225,7 +225,7 @@ if ($action == 'createmovements') if ($result2 < 0) { $error++; - setEventMessage($product->errors,'errors'); + setEventMessages($product->errors, $product->errorss, 'errors'); } } else @@ -260,7 +260,7 @@ if ($action == 'createmovements') if ($result1 < 0) { $error++; - setEventMessage($product->errors,'errors'); + setEventMessages($product->errors, $product->errorss, 'errors'); } // Add stock @@ -279,7 +279,7 @@ if ($action == 'createmovements') if ($result2 < 0) { $error++; - setEventMessage($product->errors,'errors'); + setEventMessages($product->errors, $product->errorss, 'errors'); } } } @@ -296,14 +296,14 @@ if ($action == 'createmovements') unset($_SESSION['massstockmove']); $db->commit(); - setEventMessage($langs->trans("StockMovementRecorded"),'mesgs'); + setEventMessages($langs->trans("StockMovementRecorded"), null, 'mesgs'); header("Location: ".DOL_URL_ROOT.'/product/stock/index.php'); // Redirect to avoid pb when using back exit; } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } }