add messages

This commit is contained in:
frederic34 2015-11-09 18:13:17 +01:00
parent 7349862b64
commit b8a84d68ec
3 changed files with 19 additions and 8 deletions

View File

@ -156,12 +156,11 @@ if (empty($reshook))
$result = $object->set_reopen($user);
if ($result > 0)
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
setEventMessages($langs->trans('OrderReopened', $object->ref), null);
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -208,7 +207,7 @@ if (empty($reshook))
}
else
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -471,7 +470,7 @@ if (empty($reshook))
$result = $object->set_date($user, $date);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -481,7 +480,7 @@ if (empty($reshook))
$result = $object->set_date_livraison($user, $datelivraison);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -529,16 +528,25 @@ if (empty($reshook))
elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
{
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// bank account
else if ($action == 'setbankaccount' && $user->rights->commande->creer) {
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// shipping method
else if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
else if ($action == 'setremisepercent' && $user->rights->commande->creer) {
@ -1032,7 +1040,7 @@ if (empty($reshook))
else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) {
$result = $object->cloture($user);
if ($result < 0) {
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors(), 'errors');
}
}

View File

@ -2866,6 +2866,7 @@ abstract class CommonObject
}
else
{
$this->errors[] = $this->db->lasterror();
return false;
}
}
@ -2875,7 +2876,7 @@ abstract class CommonObject
*
* @param int $id_incoterm Id of incoterm to set or '' to remove
* @param string $location location of incoterm
* @return int <0 if KO, >0 if OK
* @return int >0 if KO, <0 if OK
*/
function setIncoterms($id_incoterm, $location)
{
@ -2903,6 +2904,7 @@ abstract class CommonObject
}
else
{
$this->errors[] = $this->db->lasterror();
return -1;
}
}

View File

@ -70,6 +70,7 @@ ValidateOrder=Validate order
UnvalidateOrder=Unvalidate order
DeleteOrder=Delete order
CancelOrder=Cancel order
OrderReopened= Order %s Reopened
AddOrder=Create order
AddToMyOrders=Add to my orders
AddToOtherOrders=Add to other orders