allow chaining

This commit is contained in:
frederic34 2015-11-07 10:23:56 +01:00
parent becce332dd
commit a597d6c379
2 changed files with 8 additions and 5 deletions

View File

@ -1837,6 +1837,7 @@ class CommandeFournisseur extends CommonOrder
if ($resql) if ($resql)
{ {
$result = 0; $result = 0;
$this->statut = $statut;
$result=$this->log($user, $statut, $date, $comment); $result=$this->log($user, $statut, $date, $comment);
$this->db->commit(); $this->db->commit();
@ -1851,6 +1852,8 @@ class CommandeFournisseur extends CommonOrder
} }
else else
{ {
$this->error = 'Not Authorized';
$this->errors[] = 'Not Authorized';
dol_syslog(get_class($this)."::Livraison Not Authorized"); dol_syslog(get_class($this)."::Livraison Not Authorized");
$result = -3; $result = -3;
} }

View File

@ -766,15 +766,15 @@ if (empty($reshook))
{ {
$date_liv = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear")); $date_liv = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear"));
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); $result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment"));
if ($result > 0) if ($result > 0)
{ {
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); setEventMessages($langs->trans("DeliveryStateSaved"), null);
exit; $action = '';
} }
else if($result == -3) else if($result == -3)
{ {
setEventMessage($langs->trans("NotAuthorized"), 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
else else
{ {