mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Complete #13708, normalization of code
This commit is contained in:
@@ -3342,7 +3342,7 @@ class Commande extends CommonOrder
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0)
|
||||
if (!$error)
|
||||
{
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
@@ -3437,14 +3437,11 @@ class Commande extends CommonOrder
|
||||
if (!$error)
|
||||
{
|
||||
// Remove extrafields
|
||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4255,7 +4252,7 @@ class OrderLine extends CommonOrderLine
|
||||
if ($resql)
|
||||
{
|
||||
// Remove extrafields
|
||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->rowid;
|
||||
$result = $this->deleteExtraFields();
|
||||
@@ -4401,7 +4398,7 @@ class OrderLine extends CommonOrderLine
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet');
|
||||
$this->rowid = $this->id;
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
if (!$error)
|
||||
{
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
@@ -4534,7 +4531,7 @@ class OrderLine extends CommonOrderLine
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
if (!$error)
|
||||
{
|
||||
$this->id = $this->rowid;
|
||||
$result = $this->insertExtraFields();
|
||||
|
||||
Reference in New Issue
Block a user