diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php
index 74560e8ff6af515dd4e3af3bd60b69e51fad9e20..fcafa84a5a2e77723559c3c7d2da601535c90839 100644
--- a/htdocs/cashdesk/admin/cashdesk.php
+++ b/htdocs/cashdesk/admin/cashdesk.php
@@ -66,12 +66,12 @@ if (GETPOST('action','alpha') == 'set')
  	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');
     }
 }
 
diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php
index f5921ac4d0626526fc08fb066c91fbeefe5e05b6..6281307218cc6398479014f06656a51d21beef86 100644
--- a/htdocs/categories/card.php
+++ b/htdocs/categories/card.php
@@ -155,7 +155,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
 		}
 		else
 		{
-			setEventMessage($object->error,'errors');
+			setEventMessages($object->error, $object->errors, 'errors');
 		}
 	}
 }
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index aca45c5ca526b8f09d0bea6ff260660b0ce7924e..d86a351cdff39e3152cf112946fa3273097af67c 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -151,8 +151,7 @@ if (empty($reshook))
 		$result=$cat->del_type($object,$elementtype);
 		if ($result < 0)
 		{
-			setEventMessage($cat->error,'errors');
-			setEventMessage($cat->errors,'errors');
+			setEventMessages($cat->error, $cat->errors, 'errors');
 		}
 	}
 
@@ -199,17 +198,17 @@ if (empty($reshook))
 		$result=$cat->add_type($object,$elementtype);
 		if ($result >= 0)
 		{
-			setEventMessage($langs->trans("WasAddedSuccessfully",$cat->label));
+			setEventMessages($langs->trans("WasAddedSuccessfully",$cat->label), null, 'mesgs');
 		}
 		else
 		{
 			if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
 			{
-				setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
+				setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings');
 			}
 			else
 			{
-				setEventMessages( $cat->error, $cat->errors, 'errors' );
+				setEventMessages($cat->error, $cat->errors, 'errors');
 			}
 		}
 	}
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 1f2f0c3b19ec2eb218a191a2bb15aefd5470b4d9..2fe0df507cb8ac72d61afc6452830feb6ebf9dad 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -140,7 +140,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
 {
 	if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
 	{
-		setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
+		setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
 	}
 	else
 	{
@@ -151,7 +151,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
 				header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
 				exit();
 			} else {
-				setEventMessage($object->error, 'errors');
+				setEventMessages($object->error, $object->errors, 'errors');
 				$action = '';
 			}
 		}
@@ -347,7 +347,7 @@ if ($action == 'add')
 				$db->rollback();
 				$langs->load("errors");
 				$error=$langs->trans($object->error);
-				setEventMessage($error,'errors');
+				setEventMessages($error, null, 'errors');
 				$action = 'create'; $donotclearsession=1;
 			}
 		}
@@ -551,8 +551,7 @@ if ($action == 'mupdate')
         $result=$object->update($user);
         if ($result < 0)
         {
-            setEventMessage($object->error,'errors');
-            setEventMessage($object->errors,'errors');
+            setEventMessages($object->error, $object->errors, 'errors');
         }
     }
     if (! empty($backtopage))
diff --git a/htdocs/comm/askpricesupplier/card.php b/htdocs/comm/askpricesupplier/card.php
index f57cb16e0e03ce366e6a91e0ff255b4adbcafc51..d59922c1cb4b2176df59ace460b225c0553aa1d9 100644
--- a/htdocs/comm/askpricesupplier/card.php
+++ b/htdocs/comm/askpricesupplier/card.php
@@ -114,7 +114,7 @@ if (empty($reshook))
 	{
 		if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
 		{
-			setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
+			setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
 		}
 		else
 		{
@@ -123,8 +123,10 @@ if (empty($reshook))
 				if ($result > 0) {
 					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
 					exit();
-				} else {
-					setEventMessage($object->error, 'errors');
+				} 
+				else 
+				{
+					setEventMessages($object->error, $object->errors, 'errors');
 					$action = '';
 				}
 			}
@@ -140,7 +142,7 @@ if (empty($reshook))
 			exit();
 		} else {
 			$langs->load("errors");
-			setEventMessage($langs->trans($object->error), 'errors');
+			setEventMessages($langs->trans($object->error), null, 'errors');
 		}
 	}
 
@@ -198,8 +200,8 @@ if (empty($reshook))
 			}
 		} else {
 			$langs->load("errors");
-			if (count($object->errors) > 0) setEventMessage($object->errors, 'errors');
-			else setEventMessage($langs->trans($object->error), 'errors');
+			if (count($object->errors) > 0) setEventMessages($object->error, $object->errors, 'errors');
+			else setEventMessages($langs->trans($object->error), null, 'errors');
 		}
 	}
 
@@ -249,7 +251,7 @@ if (empty($reshook))
 
 					$id = $object->create_from($user);
 				} else {
-					setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_askpricesupplier')), 'errors');
+					setEventMessages($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_askpricesupplier')), null, 'errors');
 				}
 			} else {
 				$object->ref = GETPOST('ref');
@@ -484,7 +486,7 @@ if (empty($reshook))
 			if ($object->id > 0) {
 				$result = $object->insert_discount($_POST["remise_id"]);
 				if ($result < 0) {
-					setEventMessage($object->error, 'errors');
+					setEventMessages($object->error, $object->errors, 'errors');
 				}
 			}
 		}
@@ -674,7 +676,7 @@ if (empty($reshook))
 
 			if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
 				$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
-				setEventMessage($mesg, 'errors');
+				setEventMessages($mesg, null, 'errors');
 			} else {
 				// Insert line
 				$ref_fourn = GETPOST('fourn_ref');
@@ -716,7 +718,7 @@ if (empty($reshook))
 				} else {
 					$db->rollback();
 
-					setEventMessage($object->error, 'errors');
+					setEventMessages($object->error, $object->errors, 'errors');
 				}
 			}
 		}
@@ -774,7 +776,7 @@ if (empty($reshook))
 			$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
 
 			if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
-				setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
+				setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
 				$error ++;
 			}
 		} else {
@@ -823,7 +825,7 @@ if (empty($reshook))
 			} else {
 				$db->rollback();
 
-				setEventMessage($object->error, 'errors');
+				setEventMessages($object->error, $object->errors, 'errors');
 			}
 		}
 	}
@@ -865,9 +867,9 @@ if (empty($reshook))
 			$file = $upload_dir . '/' . GETPOST('file');
 			$ret = dol_delete_file($file, 0, 0, 0, $object);
 			if ($ret)
-				setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
+				setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
 			else
-				setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
+				setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
 		}
 	}
 
@@ -1325,7 +1327,7 @@ if ($action == 'create')
 			$numref = $object->getNextNumRef($soc);
 			if (empty($numref)) {
 				$error ++;
-				setEventMessage($object->error, 'errors');
+				setEventMessages($object->error, $object->errors, 'errors');
 			}
 		} else {
 			$numref = $object->ref;