allow chaining and remove header exit

This commit is contained in:
frederic34 2015-11-07 09:49:25 +01:00
parent 80ec28f9c0
commit becce332dd
2 changed files with 11 additions and 4 deletions

View File

@ -946,16 +946,24 @@ class CommandeFournisseur extends CommonOrder
dol_syslog(get_class($this)."::commande", LOG_DEBUG); dol_syslog(get_class($this)."::commande", LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->statut = 3;
$this->methode_commande_id = $methode;
$this->date_commande = $this->db->idate($date);
$result = 1; $result = 1;
$this->log($user, 3, $date, $comment); $this->log($user, 3, $date, $comment);
} }
else else
{ {
$this->error = $this->db->lasterror();
$this->errors[] = $this->db->lasterror();
$result = -1; $result = -1;
} }
} }
else else
{ {
$result = -1;
$this->error = 'Not Authorized';
$this->errors[] = 'Not Authorized';
dol_syslog(get_class($this)."::commande User not Authorized", LOG_ERR); dol_syslog(get_class($this)."::commande User not Authorized", LOG_ERR);
} }
return $result ; return $result ;

View File

@ -710,8 +710,7 @@ if (empty($reshook))
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); $action = '';
exit;
} }
else else
{ {