diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 307b8ae5bc9..e8914298ac3 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos GarcĂ­a * Copyright (C) 2016 Abbes Bahfir * @@ -67,7 +67,7 @@ if ($action == 'add') if ($actionid <= 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), null, 'errors'); $error++; } diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index dc039bf6d5f..57db7c49f20 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -31,15 +31,15 @@ if ($_POST) { $value = GETPOST('PRODUIT_ATTRIBUTES_HIDECHILD'); if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } } diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 547a82d0f63..3addef7ddf9 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -50,9 +50,9 @@ if ($_POST) { $object->label = $label; if ($object->update($user) < 1) { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } else { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2)); exit(); } @@ -77,9 +77,9 @@ if ($_POST) { if (! $error) { if ($objectval->update($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessage($langs->trans('CoreErrorMessage'), null, 'errors'); } } } @@ -99,11 +99,11 @@ if ($confirm == 'yes') { if ($res < 1 || ($object->delete() < 1)) { $db->rollback(); - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); } else { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/list.php', 2)); } exit(); @@ -113,9 +113,9 @@ if ($confirm == 'yes') { if ($objectval->fetch($valueid) > 0) { if ($objectval->delete() < 1) { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } else { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index dbc413542c4..b741fef40bb 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -104,7 +104,7 @@ if ($_POST) { $features = $_SESSION['addvariant_'.$object->id]; if (!$features) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { @@ -147,7 +147,7 @@ if ($_POST) { $result = $prodcomb->createProductCombination($object, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact); if ($result > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); unset($_SESSION['addvariant_'.$object->id]); $db->commit(); @@ -214,7 +214,7 @@ if ($_POST) { } else { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } } @@ -230,7 +230,7 @@ if ($_POST) { $prodcomb->variation_weight = $weight_impact; if ($prodcomb->update($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2)); exit(); } else { @@ -250,13 +250,13 @@ if ($action === 'confirm_deletecombination') { if ($prodcomb->delete($user) > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete($user) > 0) { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2)); exit(); } $db->rollback(); - setEventMessage($langs->trans('ProductCombinationAlreadyUsed'), 'errors'); + setEventMessages($langs->trans('ProductCombinationAlreadyUsed'), null, 'errors'); $action = ''; } } elseif ($action === 'edit') { @@ -284,12 +284,12 @@ if ($action === 'confirm_deletecombination') { header('Location: '.dol_buildpath('/variants/combinations.php?id='.$prodstatic->id, 2)); exit(); } else { - setEventMessage($langs->trans('ErrorCopyProductCombinations'), 'errors'); + setEventMessages($langs->trans('ErrorCopyProductCombinations'), null, 'errors'); } } } else { - setEventMessage($langs->trans('ErrorDestinationProductNotFound'), 'errors'); + setEventMessages($langs->trans('ErrorDestinationProductNotFound'), null, 'errors'); } } diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index f1a34a835b6..c4d775f3d50 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -29,7 +29,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); if ($_POST) { if (empty($ref) || empty($label)) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { $prodattr = new ProductAttribute($db); @@ -38,7 +38,7 @@ if ($_POST) { $resid = $prodattr->create($user); if ($resid > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); if ($backtopage) { header('Location: '.$backtopage); diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index b290182a042..f0dd8e9cb74 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -58,7 +58,7 @@ if ($cancel) if ($action == 'add') { if (empty($ref) || empty($value)) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { $objectval->fk_product_attribute = $object->id; @@ -66,11 +66,11 @@ if ($action == 'add') $objectval->value = $value; if ($objectval->create($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id); exit(); } else { - setEventMessage($langs->trans('ErrorCreatingProductAttributeValue'), 'errors'); + setEventMessages($langs->trans('ErrorCreatingProductAttributeValue'), null, 'errors'); } } } diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 4daa2d8f45a..35cd9fc2a24 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -115,18 +115,18 @@ if ($_POST) { if ($res > 0) { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2)); exit; } } else { - setEventMessage($langs->trans('ErrorDeletingGeneratedProducts'), 'errors'); + setEventMessages($langs->trans('ErrorDeletingGeneratedProducts'), null, 'errors'); } $db->rollback(); } else { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } }