allow chaining and remove header exit
This commit is contained in:
parent
80ec28f9c0
commit
becce332dd
@ -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 ;
|
||||||
|
|||||||
@ -704,15 +704,14 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
||||||
{
|
{
|
||||||
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
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
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user