2
0
forked from Wavyzz/dolibarr

[Qual] Uniformize code

This commit is contained in:
philippe grand
2015-12-14 20:54:55 +01:00
parent 0ec62c05cc
commit 0fe64c6091
9 changed files with 63 additions and 61 deletions

View File

@@ -149,21 +149,21 @@ if (empty($reshook))
else $errors[] = 'FailedToValidateBarCode'; else $errors[] = 'FailedToValidateBarCode';
$error++; $error++;
setEventMessage($errors,'errors'); setEventMessages($errors, null, 'errors');
} }
} }
if ($action == 'setaccountancy_code_buy') { if ($action == 'setaccountancy_code_buy') {
$result = $object->setAccountancyCode('buy', GETPOST('accountancy_code_buy')); $result = $object->setAccountancyCode('buy', GETPOST('accountancy_code_buy'));
if ($result < 0) setEventMessage(join(',',$object->errors), 'errors'); if ($result < 0) setEventMessages(join(',',$object->errors), null, 'errors');
$action=""; $action="";
} }
if ($action == 'setaccountancy_code_sell') if ($action == 'setaccountancy_code_sell')
{ {
$result = $object->setAccountancyCode('sell', GETPOST('accountancy_code_sell')); $result = $object->setAccountancyCode('sell', GETPOST('accountancy_code_sell'));
if ($result < 0) setEventMessage(join(',',$object->errors), 'errors'); if ($result < 0) setEventMessages(join(',',$object->errors), null, 'errors');
$action=""; $action="";
} }
@@ -174,13 +174,13 @@ if (empty($reshook))
if (! GETPOST('label')) if (! GETPOST('label'))
{ {
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Label')), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('Label')), null, 'errors');
$action = "create"; $action = "create";
$error++; $error++;
} }
if (empty($ref)) if (empty($ref))
{ {
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Ref')), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('Ref')), null, 'errors');
$action = "create"; $action = "create";
$error++; $error++;
} }
@@ -224,7 +224,8 @@ if (empty($reshook))
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors'); $mesg='Failed to get bar code type information ';
setEventMessages($mesg.$stdobject->error, $mesg.$stdobject->errors, 'errors');
} }
$object->barcode_type_code = $stdobject->barcode_type_code; $object->barcode_type_code = $stdobject->barcode_type_code;
$object->barcode_type_coder = $stdobject->barcode_type_coder; $object->barcode_type_coder = $stdobject->barcode_type_coder;
@@ -290,8 +291,8 @@ if (empty($reshook))
} }
else else
{ {
if (count($object->errors)) setEventMessage($object->errors, 'errors'); if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors');
else setEventMessage($langs->trans($object->error), 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors');
$action = "create"; $action = "create";
} }
} }
@@ -353,7 +354,8 @@ if (empty($reshook))
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors'); $mesg='Failed to get bar code type information ';
setEventMessages($mesg.$stdobject->error, $mesg.$stdobject->errors, 'errors');
} }
$object->barcode_type_code = $stdobject->barcode_type_code; $object->barcode_type_code = $stdobject->barcode_type_code;
$object->barcode_type_coder = $stdobject->barcode_type_coder; $object->barcode_type_coder = $stdobject->barcode_type_coder;
@@ -378,15 +380,15 @@ if (empty($reshook))
} }
else else
{ {
if (count($object->errors)) setEventMessage($object->errors, 'errors'); if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors');
else setEventMessage($langs->trans($object->error), 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors');
$action = 'edit'; $action = 'edit';
} }
} }
else else
{ {
if (count($object->errors)) setEventMessage($object->errors, 'errors'); if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors');
else setEventMessage($langs->trans("ErrorProductBadRefOrLabel"), 'errors'); else setEventMessages($langs->trans("ErrorProductBadRefOrLabel"), null, 'errors');
$action = 'edit'; $action = 'edit';
} }
} }
@@ -400,7 +402,7 @@ if (empty($reshook))
{ {
if (! GETPOST('clone_content') && ! GETPOST('clone_prices') ) if (! GETPOST('clone_content') && ! GETPOST('clone_prices') )
{ {
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} }
else else
{ {
@@ -427,7 +429,7 @@ if (empty($reshook))
if ($result < 1) if ($result < 1)
{ {
$db->rollback(); $db->rollback();
setEventMessage($langs->trans('ErrorProductClone'), 'errors'); setEventMessages($langs->trans('ErrorProductClone'), null, 'errors');
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$originalId); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$originalId);
exit; exit;
} }
@@ -454,7 +456,7 @@ if (empty($reshook))
$mesg=$langs->trans("ErrorProductAlreadyExists",$object->ref); $mesg=$langs->trans("ErrorProductAlreadyExists",$object->ref);
$mesg.=' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$object->ref.'">'.$langs->trans("ShowCardHere").'</a>.'; $mesg.=' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$object->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
setEventMessage($mesg, 'errors'); setEventMessages($mesg, null, 'errors');
$object->fetch($id); $object->fetch($id);
} }
else else
@@ -462,12 +464,12 @@ if (empty($reshook))
$db->rollback(); $db->rollback();
if (count($object->errors)) if (count($object->errors))
{ {
setEventMessage($object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
dol_print_error($db,$object->errors); dol_print_error($db,$object->errors);
} }
else else
{ {
setEventMessage($langs->trans($object->error), 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
dol_print_error($db,$object->error); dol_print_error($db,$object->error);
} }
} }
@@ -498,7 +500,7 @@ if (empty($reshook))
} }
else else
{ {
setEventMessage($langs->trans($object->error), 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
$reload = 0; $reload = 0;
$action=''; $action='';
} }
@@ -624,7 +626,7 @@ if (empty($reshook))
return; return;
} }
setEventMessage($langs->trans("ErrorUnknown") . ": $result", 'errors'); setEventMessages($langs->trans("ErrorUnknown") . ": $result", null, 'errors');
} elseif (GETPOST('commandeid') > 0) { } elseif (GETPOST('commandeid') > 0) {
$result = $commande->addline( $result = $commande->addline(
$desc, $desc,
@@ -696,7 +698,7 @@ if (empty($reshook))
} }
else { else {
$action=""; $action="";
setEventMessage($langs->trans("WarningSelectOneDocument"), 'warnings'); setEventMessages($langs->trans("WarningSelectOneDocument"), null, 'warnings');
} }
} }

View File

@@ -105,7 +105,7 @@ if (empty($reshook))
$filetomerge->file_name=$filename; $filetomerge->file_name=$filename;
$result=$filetomerge->delete_by_file($user); $result=$filetomerge->delete_by_file($user);
if ($result<0) { if ($result<0) {
setEventMessage($filetomerge->error,'errors'); setEventMessages($filetomerge->error, $filetomerge->errors, 'errors');
} }
} }
} }
@@ -137,7 +137,7 @@ if ($action=='filemerge')
$result=$filetomerge->delete_by_product($user, $object->id); $result=$filetomerge->delete_by_product($user, $object->id);
} }
if ($result<0) { if ($result<0) {
setEventMessage($filetomerge->error,'errors'); setEventMessages($filetomerge->error, $filetomerge->errors, 'errors');
} }
// for each file checked add it to the product // for each file checked add it to the product
@@ -152,7 +152,7 @@ if ($action=='filemerge')
$result=$filetomerge->create($user); $result=$filetomerge->create($user);
if ($result<0) { if ($result<0) {
setEventMessage($filetomerge->error,'errors'); setEventMessages($filetomerge->error, $filetomerge->errors, 'errors');
} }
} }
} }

View File

@@ -101,7 +101,7 @@ if (empty($reshook))
if ($result > 0) if ($result > 0)
{ {
$object->cost_price = price2num($cost_price); $object->cost_price = price2num($cost_price);
setEventMessage($langs->trans("RecordSaved")); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} }
else else
{ {
@@ -119,7 +119,7 @@ if (empty($reshook))
$action = ''; $action = '';
$result=$object->remove_product_fournisseur_price($rowid); $result=$object->remove_product_fournisseur_price($rowid);
if($result > 0){ if($result > 0){
setEventMessage($langs->trans("PriceRemoved")); setEventMessages($langs->trans("PriceRemoved"), null, 'mesgs');
}else{ }else{
$error++; $error++;
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@@ -151,7 +151,7 @@ if (empty($reshook))
{ {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",'eeee'), 'errors'); setEventMessages($langs->trans("ErrorFieldMustBeANumeric",'eeee'), null, 'errors');
} }
if (empty($quantity)) if (empty($quantity))
{ {
@@ -199,12 +199,12 @@ if (empty($reshook))
$object->fetch($object->product_id_already_linked); $object->fetch($object->product_id_already_linked);
$productLink = $object->getNomUrl(1,'supplier'); $productLink = $object->getNomUrl(1,'supplier');
setEventMessage($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), 'errors'); setEventMessages($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), null, 'errors');
} }
else if ($ret < 0) else if ($ret < 0)
{ {
$error++; $error++;
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -220,7 +220,7 @@ if (empty($reshook))
{ {
$error++; $error++;
setEventMessage($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
else else
{ {
@@ -231,7 +231,7 @@ if (empty($reshook))
$price_result = $priceparser->parseProductSupplier($id, $price_expression, $quantity, $tva_tx); $price_result = $priceparser->parseProductSupplier($id, $price_expression, $quantity, $tva_tx);
if ($price_result < 0) { //Expression is not valid if ($price_result < 0) { //Expression is not valid
$error++; $error++;
setEventMessage($priceparser->translatedError(), 'errors'); setEventMessages($priceparser->translatedError(), null, 'errors');
} }
} }
if (! $error && ! empty($conf->dynamicprices->enabled)) { if (! $error && ! empty($conf->dynamicprices->enabled)) {
@@ -239,7 +239,7 @@ if (empty($reshook))
if ($ret < 0) if ($ret < 0)
{ {
$error++; $error++;
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }

View File

@@ -293,7 +293,7 @@ else
// Displays product removal confirmation // Displays product removal confirmation
if (GETPOST('delprod')) { if (GETPOST('delprod')) {
setEventMessage($langs->trans("ProductDeleted", GETPOST('delprod'))); setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs');
} }
if ($sref) $param="&amp;sref=".$sref; if ($sref) $param="&amp;sref=".$sref;

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2014-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Ion agorria <ion@agorria.com> * Copyright (C) 2014 Ion agorria <ion@agorria.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
@@ -131,7 +131,7 @@ if (empty($reshook))
if ($priceparser->parseProduct($object) < 0) { if ($priceparser->parseProduct($object) < 0) {
$error ++; $error ++;
setEventMessage($priceparser->translatedError(), 'errors'); setEventMessages($priceparser->translatedError(), null, 'errors');
} }
} }
} }
@@ -194,7 +194,7 @@ if (empty($reshook))
$newprice_min = price2num($val['price_min'], 'MU'); $newprice_min = price2num($val['price_min'], 'MU');
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) { if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) {
setEventMessage($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, - 1, - 1, 'auto')), 'errors'); setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, - 1, - 1, 'auto')), null, 'errors');
$error ++; $error ++;
break; break;
} }
@@ -203,7 +203,7 @@ if (empty($reshook))
if ($res < 0) { if ($res < 0) {
$error ++; $error ++;
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
break; break;
} }
} }
@@ -211,12 +211,12 @@ if (empty($reshook))
if (!$error && $object->update($object->id, $user) < 0) { if (!$error && $object->update($object->id, $user) < 0) {
$error++; $error++;
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
if (empty($error)) { if (empty($error)) {
$action = ''; $action = '';
setEventMessage($langs->trans("RecordSaved")); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$db->commit(); $db->commit();
} else { } else {
$action = 'edit_price'; $action = 'edit_price';
@@ -229,7 +229,7 @@ if (empty($reshook))
{ {
$result = $object->log_price_delete($user, $_GET ["lineid"]); $result = $object->log_price_delete($user, $_GET ["lineid"]);
if ($result < 0) { if ($result < 0) {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -341,7 +341,7 @@ if (empty($reshook))
if (! empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $prodcustprice->price_min<$maxpricesupplier) if (! empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $prodcustprice->price_min<$maxpricesupplier)
{ {
setEventMessage($langs->trans("MinimumPriceLimit",price($maxpricesupplier,0,'',1,-1,-1,'auto')),'errors'); setEventMessages($langs->trans("MinimumPriceLimit",price($maxpricesupplier,0,'',1,-1,-1,'auto')), null, 'errors');
$error++; $error++;
$action='add_customer_price'; $action='add_customer_price';
} }
@@ -351,9 +351,9 @@ if (empty($reshook))
$result = $prodcustprice->create($user, 0, $update_child_soc); $result = $prodcustprice->create($user, 0, $update_child_soc);
if ($result < 0) { if ($result < 0) {
setEventMessage($prodcustprice->error, 'errors'); setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
} else { } else {
setEventMessage($langs->trans('RecordSaved'), 'mesgs'); setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
} }
$action = ''; $action = '';
@@ -367,9 +367,9 @@ if (empty($reshook))
$result = $prodcustprice->delete($user); $result = $prodcustprice->delete($user);
if ($result < 0) { if ($result < 0) {
setEventMessage($prodcustprice->error, 'mesgs'); setEventMessages($prodcustprice->error, $prodcustprice->errors, 'mesgs');
} else { } else {
setEventMessage($langs->trans('RecordDeleted'), 'errors'); setEventMessages($langs->trans('RecordDeleted'), null, 'errors');
} }
$action = ''; $action = '';
} }
@@ -391,7 +391,7 @@ if (empty($reshook))
if ($prodcustprice->price_min<$maxpricesupplier && !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) if ($prodcustprice->price_min<$maxpricesupplier && !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE))
{ {
setEventMessage($langs->trans("MinimumPriceLimit",price($maxpricesupplier,0,'',1,-1,-1,'auto')),'errors'); setEventMessages($langs->trans("MinimumPriceLimit",price($maxpricesupplier,0,'',1,-1,-1,'auto')), null, 'errors');
$error++; $error++;
$action='update_customer_price'; $action='update_customer_price';
} }
@@ -401,9 +401,9 @@ if (empty($reshook))
$result = $prodcustprice->update($user, 0, $update_child_soc); $result = $prodcustprice->update($user, 0, $update_child_soc);
if ($result < 0) { if ($result < 0) {
setEventMessage($prodcustprice->error, 'errors'); setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
} else { } else {
setEventMessage($langs->trans('Save'), 'mesgs'); setEventMessages($langs->trans('Save'), null, 'mesgs');
} }
$action = ''; $action = '';
@@ -1257,7 +1257,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$result = $prodcustprice->fetch(GETPOST('lineid', 'int')); $result = $prodcustprice->fetch(GETPOST('lineid', 'int'));
if ($result < 0) { if ($result < 0) {
setEventMessage($prodcustprice->error, 'errors'); setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
} }
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">'; print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
@@ -1346,7 +1346,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$result = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); $result = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
if ($result < 0) { if ($result < 0) {
setEventMessage($prodcustprice->error, 'errors'); setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
} }
$option = '&socid=' . GETPOST('socid', 'int') . '&id=' . $object->id; $option = '&socid=' . GETPOST('socid', 'int') . '&id=' . $object->id;
@@ -1422,7 +1422,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
if ($result < 0) { if ($result < 0) {
setEventMessage($prodcustprice->error, 'errors'); setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
} }
$option = '&search_soc=' . $search_soc . '&id=' . $object->id; $option = '&search_soc=' . $search_soc . '&id=' . $object->id;

View File

@@ -100,7 +100,7 @@ if ($action == "correct_stock")
if (! is_numeric($_POST["nbpiece"])) if (! is_numeric($_POST["nbpiece"]))
{ {
$error++; $error++;
setEventMessage($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors');
$action='correction'; $action='correction';
} }

View File

@@ -77,7 +77,7 @@ if ($action == 'setstocklimit')
$object->seuil_stock_alerte=$stocklimit; $object->seuil_stock_alerte=$stocklimit;
$result=$object->update($object->id,$user,0,'update'); $result=$object->update($object->id,$user,0,'update');
if ($result < 0) if ($result < 0)
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action=''; $action='';
} }
@@ -89,7 +89,7 @@ if ($action == 'setdesiredstock')
$object->desiredstock=$desiredstock; $object->desiredstock=$desiredstock;
$result=$object->update($object->id,$user,0,'update'); $result=$object->update($object->id,$user,0,'update');
if ($result < 0) if ($result < 0)
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action=''; $action='';
} }

View File

@@ -176,7 +176,7 @@ if ($action == 'order' && isset($_POST['valid']))
$fail++; $fail++;
$msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;"; $msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;";
$msg .= $order->error; $msg .= $order->error;
setEventMessage($msg, 'errors'); setEventMessages($msg, null, 'errors');
} else { } else {
$id = $result; $id = $result;
} }
@@ -195,7 +195,7 @@ if ($action == 'order' && isset($_POST['valid']))
$fail++; $fail++;
$msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;"; $msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;";
$msg .= $order->error; $msg .= $order->error;
setEventMessage($msg, 'errors'); setEventMessages($msg, null, 'errors');
} }
$i++; $i++;
} }
@@ -205,7 +205,7 @@ if ($action == 'order' && isset($_POST['valid']))
{ {
$db->commit(); $db->commit();
setEventMessage($langs->trans('OrderCreated'), 'mesgs'); setEventMessages($langs->trans('OrderCreated'), null, 'mesgs');
header('Location: replenishorders.php'); header('Location: replenishorders.php');
exit; exit;
} }
@@ -216,7 +216,7 @@ if ($action == 'order' && isset($_POST['valid']))
} }
if ($box == 0) if ($box == 0)
{ {
setEventMessage($langs->trans('SelectProductWithNotNullQty'), 'warnings'); setEventMessages($langs->trans('SelectProductWithNotNullQty'), null, 'warnings');
} }
} }

View File

@@ -94,7 +94,7 @@ $cancel != $langs->trans("Cancel") &&
else else
{ {
$action = 'add'; $action = 'add';
setEventMessage($object->error,'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -130,7 +130,7 @@ $cancel != $langs->trans("Cancel") &&
else else
{ {
$action = 'edit'; $action = 'edit';
setEventMessage($object->error,'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -151,7 +151,7 @@ $cancel != $langs->trans("Cancel") &&
else else
{ {
$action = 'edit'; $action = 'edit';
setEventMessage($object->error,'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }