Merge remote-tracking branch 'upstream/develop' into entrepotlibelle
This commit is contained in:
commit
2098021010
@ -657,7 +657,7 @@ class Adherent extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -927,8 +927,6 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -936,7 +934,6 @@ class Adherent extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Remove adherent
|
// Remove adherent
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|||||||
@ -409,7 +409,7 @@ class AdherentType extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -202,7 +202,7 @@ class AssetType extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -461,7 +461,7 @@ class Categorie extends CommonObject
|
|||||||
$action = 'create';
|
$action = 'create';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -553,7 +553,7 @@ class Categorie extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -646,7 +646,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -567,15 +567,12 @@ class ActionComm extends CommonObject
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && !$notrigger)
|
if (!$error && !$notrigger)
|
||||||
{
|
{
|
||||||
@ -1048,7 +1045,7 @@ class ActionComm extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -511,7 +511,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1252,8 +1252,6 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1261,7 +1259,6 @@ class Propal extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && !$notrigger)
|
if (!$error && !$notrigger)
|
||||||
{
|
{
|
||||||
@ -1683,7 +1680,7 @@ class Propal extends CommonObject
|
|||||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
$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();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3052,8 +3049,6 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3063,7 +3058,6 @@ class Propal extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
@ -4152,7 +4146,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
{
|
{
|
||||||
$this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet');
|
$this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet');
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->id = $this->rowid;
|
$this->id = $this->rowid;
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
@ -4204,7 +4198,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->id = $this->rowid;
|
$this->id = $this->rowid;
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
@ -4334,7 +4328,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->id = $this->rowid;
|
$this->id = $this->rowid;
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
|
|||||||
@ -384,7 +384,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used
|
if (method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
|
|||||||
@ -3342,7 +3342,7 @@ class Commande extends CommonOrder
|
|||||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
$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();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3437,8 +3437,6 @@ class Commande extends CommonOrder
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
|
||||||
{
|
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -3446,7 +3444,6 @@ class Commande extends CommonOrder
|
|||||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
@ -4255,7 +4252,7 @@ class OrderLine extends CommonOrderLine
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->id = $this->rowid;
|
$this->id = $this->rowid;
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
@ -4401,7 +4398,7 @@ class OrderLine extends CommonOrderLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet');
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet');
|
||||||
$this->rowid = $this->id;
|
$this->rowid = $this->id;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -4534,7 +4531,7 @@ class OrderLine extends CommonOrderLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->id = $this->rowid;
|
$this->id = $this->rowid;
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
|
|||||||
@ -285,7 +285,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -823,14 +823,11 @@ class Account extends CommonObject
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && !$notrigger)
|
if (!$error && !$notrigger)
|
||||||
{
|
{
|
||||||
@ -1107,7 +1104,7 @@ class Account extends CommonObject
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -1146,7 +1146,7 @@ if (empty($reshook))
|
|||||||
foreach ($facture_source->lines as $line)
|
foreach ($facture_source->lines as $line)
|
||||||
{
|
{
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, 'fetch_optionals')) {
|
if (method_exists($line, 'fetch_optionals')) {
|
||||||
// load extrafields
|
// load extrafields
|
||||||
$line->fetch_optionals();
|
$line->fetch_optionals();
|
||||||
}
|
}
|
||||||
@ -1644,7 +1644,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -342,7 +342,7 @@ class FactureRec extends CommonInvoice
|
|||||||
if ($objectline->fetch($result_insert))
|
if ($objectline->fetch($result_insert))
|
||||||
{
|
{
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($facsrc->lines[$i], 'fetch_optionals')) {
|
if (method_exists($facsrc->lines[$i], 'fetch_optionals')) {
|
||||||
$facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid);
|
$facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid);
|
||||||
$objectline->array_options = $facsrc->lines[$i]->array_options;
|
$objectline->array_options = $facsrc->lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
@ -438,7 +438,7 @@ class FactureRec extends CommonInvoice
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -2112,7 +2112,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -1881,7 +1881,7 @@ class Facture extends CommonInvoice
|
|||||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
$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();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -5237,7 +5237,7 @@ class FactureLigne extends CommonInvoiceLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet');
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet');
|
||||||
$this->rowid = $this->id; // For backward compatibility
|
$this->rowid = $this->id; // For backward compatibility
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -5423,7 +5423,7 @@ class FactureLigne extends CommonInvoiceLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->id = $this->rowid;
|
$this->id = $this->rowid;
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
|
|||||||
@ -489,7 +489,7 @@ class Contact extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1168,7 +1168,7 @@ class Contact extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) {
|
if (!$error) {
|
||||||
// For avoid conflicts if trigger used
|
// For avoid conflicts if trigger used
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
|
|||||||
@ -316,7 +316,7 @@ if (empty($reshook))
|
|||||||
// Extrafields
|
// Extrafields
|
||||||
$array_options = array();
|
$array_options = array();
|
||||||
// For avoid conflicts if trigger used
|
// For avoid conflicts if trigger used
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1035,7 +1035,7 @@ class Contrat extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1383,7 +1383,7 @@ class Contrat extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
if (!$resql) { $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();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1588,7 +1588,7 @@ class Contrat extends CommonObject
|
|||||||
{
|
{
|
||||||
$contractlineid = $this->db->last_insert_id(MAIN_DB_PREFIX."contratdet");
|
$contractlineid = $this->db->last_insert_id(MAIN_DB_PREFIX."contratdet");
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$contractline = new ContratLigne($this->db);
|
$contractline = new ContratLigne($this->db);
|
||||||
$contractline->array_options = $array_options;
|
$contractline->array_options = $array_options;
|
||||||
@ -1777,7 +1777,7 @@ class Contrat extends CommonObject
|
|||||||
$result = $this->update_statut($user);
|
$result = $this->update_statut($user);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
|
if (is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$contractline = new ContratLigne($this->db);
|
$contractline = new ContratLigne($this->db);
|
||||||
$contractline->fetch($rowid);
|
$contractline->fetch($rowid);
|
||||||
@ -1859,10 +1859,8 @@ class Contrat extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if (!$error) {
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
|
||||||
$contractline = new ContratLigne($this->db);
|
$contractline = new ContratLigne($this->db);
|
||||||
$contractline->id = $idline;
|
$contractline->id = $idline;
|
||||||
$result = $contractline->deleteExtraFields();
|
$result = $contractline->deleteExtraFields();
|
||||||
@ -1872,7 +1870,6 @@ class Contrat extends CommonObject
|
|||||||
$this->error = "Error ".get_class($this)."::deleteline deleteExtraFields error -4 ".$contractline->error;
|
$this->error = "Error ".get_class($this)."::deleteline deleteExtraFields error -4 ".$contractline->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -3092,7 +3089,7 @@ class ContratLigne extends CommonObjectLine
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) // For avoid conflicts if trigger used
|
if (!$error) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3202,6 +3199,8 @@ class ContratLigne extends CommonObjectLine
|
|||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
// Insertion dans la base
|
// Insertion dans la base
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contratdet";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contratdet";
|
||||||
$sql .= " (fk_contrat, label, description, fk_product, qty, vat_src_code, tva_tx,";
|
$sql .= " (fk_contrat, label, description, fk_product, qty, vat_src_code, tva_tx,";
|
||||||
@ -3240,7 +3239,7 @@ class ContratLigne extends CommonObjectLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'contratdet');
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'contratdet');
|
||||||
|
|
||||||
// Insert of extrafields
|
// Insert of extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -751,7 +751,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5351,9 +5351,14 @@ abstract class CommonObject
|
|||||||
* Delete all extra fields values for the current object.
|
* Delete all extra fields values for the current object.
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
|
* @see deleteExtraLanguages(), insertExtraField(), updateExtraField(), setValueFrom()
|
||||||
*/
|
*/
|
||||||
public function deleteExtraFields()
|
public function deleteExtraFields()
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$table_element = $this->table_element;
|
$table_element = $this->table_element;
|
||||||
@ -5383,18 +5388,18 @@ abstract class CommonObject
|
|||||||
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
||||||
* @param User $userused Object user
|
* @param User $userused Object user
|
||||||
* @return int -1=error, O=did nothing, 1=OK
|
* @return int -1=error, O=did nothing, 1=OK
|
||||||
* @see insertExtraLanguages(), updateExtraField(), setValueFrom()
|
* @see insertExtraLanguages(), updateExtraField(), deleteExtraField(), setValueFrom()
|
||||||
*/
|
*/
|
||||||
public function insertExtraFields($trigger = '', $userused = null)
|
public function insertExtraFields($trigger = '', $userused = null)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0;
|
||||||
|
|
||||||
if (empty($userused)) $userused = $user;
|
if (empty($userused)) $userused = $user;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
|
|
||||||
|
|
||||||
if (!empty($this->array_options))
|
if (!empty($this->array_options))
|
||||||
{
|
{
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@ -5792,18 +5797,18 @@ abstract class CommonObject
|
|||||||
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
||||||
* @param User $userused Object user
|
* @param User $userused Object user
|
||||||
* @return int -1=error, O=did nothing, 1=OK
|
* @return int -1=error, O=did nothing, 1=OK
|
||||||
* @see updateExtraLanguages(), setValueFrom(), insertExtraFields()
|
* @see updateExtraLanguages(), insertExtraFields(), deleteExtraFields(), setValueFrom()
|
||||||
*/
|
*/
|
||||||
public function updateExtraField($key, $trigger = null, $userused = null)
|
public function updateExtraField($key, $trigger = null, $userused = null)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0;
|
||||||
|
|
||||||
if (empty($userused)) $userused = $user;
|
if (empty($userused)) $userused = $user;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
|
|
||||||
|
|
||||||
if (!empty($this->array_options) && isset($this->array_options["options_".$key]))
|
if (!empty($this->array_options) && isset($this->array_options["options_".$key]))
|
||||||
{
|
{
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@ -8174,7 +8179,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -8335,7 +8340,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$tmpobjectline = new $tmpforobjectlineclass($this->db);
|
$tmpobjectline = new $tmpforobjectlineclass($this->db);
|
||||||
$tmpobjectline->id = $idline;
|
$tmpobjectline->id = $idline;
|
||||||
|
|||||||
@ -971,6 +971,7 @@ class FormFile
|
|||||||
// Get object entity
|
// Get object entity
|
||||||
if (!empty($conf->multicompany->enabled))
|
if (!empty($conf->multicompany->enabled))
|
||||||
{
|
{
|
||||||
|
$regs = array();
|
||||||
preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs);
|
preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs);
|
||||||
$entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
|
$entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
|
||||||
}
|
}
|
||||||
|
|||||||
@ -432,7 +432,7 @@ class Don extends CommonObject
|
|||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -519,7 +519,7 @@ class Don extends CommonObject
|
|||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -380,7 +380,7 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1046,7 +1046,8 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$line->entrepot_id = $linebatch->entrepot_id;
|
$line->entrepot_id = $linebatch->entrepot_id;
|
||||||
$line->origin_line_id = $dbatch['ix_l'];
|
$line->origin_line_id = $dbatch['ix_l']; // deprecated
|
||||||
|
$line->fk_origin_line = $dbatch['ix_l'];
|
||||||
$line->qty = $dbatch['qty'];
|
$line->qty = $dbatch['qty'];
|
||||||
$line->detail_batch = $tab;
|
$line->detail_batch = $tab;
|
||||||
|
|
||||||
@ -2617,7 +2618,7 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."expeditiondet");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."expeditiondet");
|
||||||
|
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -2691,7 +2692,7 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
if (!$error && $this->db->query($sql))
|
if (!$error && $this->db->query($sql))
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -2895,7 +2896,7 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -305,7 +305,7 @@ class Fichinter extends CommonObject
|
|||||||
if (!$resql) $error++;
|
if (!$resql) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -385,7 +385,7 @@ class Fichinter extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1001,7 +1001,7 @@ class Fichinter extends CommonObject
|
|||||||
if (!$resql) $error++;
|
if (!$resql) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
$res = $this->deleteExtraFields();
|
$res = $this->deleteExtraFields();
|
||||||
@ -1552,7 +1552,7 @@ class FichinterLigne extends CommonObjectLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'fichinterdet');
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'fichinterdet');
|
||||||
$this->rowid = $this->id;
|
$this->rowid = $this->id;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1623,7 +1623,7 @@ class FichinterLigne extends CommonObjectLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -2063,7 +2063,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3626,7 +3626,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||||
$this->rowid = $this->id;
|
$this->rowid = $this->id;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3716,7 +3716,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -210,22 +210,11 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Create extrafields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
if (! $error)
|
||||||
$hookmanager->initHooks(array('commandefournisseurdispatchdao'));
|
|
||||||
$parameters = array('id'=>$this->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
|
if ($result < 0) $error++;
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -373,7 +362,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($this->id) && !empty($this->rowid))$this->id = $this->rowid;
|
if (empty($this->id) && !empty($this->rowid))$this->id = $this->rowid;
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
|
|||||||
@ -558,7 +558,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields(); // This also set $this->error or $this->errors if errors are found
|
$result = $this->insertExtraFields(); // This also set $this->error or $this->errors if errors are found
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -977,7 +977,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1243,7 +1243,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3145,7 +3145,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
$this->deleteObjectLinked();
|
$this->deleteObjectLinked();
|
||||||
|
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result=$this->deleteExtraFields();
|
$result=$this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3265,7 +3265,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
$this->rowid = $this->id;
|
$this->rowid = $this->id;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3406,7 +3406,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||||
$this->rowid = $this->id; // backward compatibility
|
$this->rowid = $this->id; // backward compatibility
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -1064,7 +1064,7 @@ if (empty($reshook))
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $object->insertExtraFields('ORDER_SUPPLIER_MODIFY');
|
$result = $object->insertExtraFields('ORDER_SUPPLIER_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1190,7 +1190,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
|
if (method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
|
||||||
{
|
{
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_option = $lines[$i]->array_options;
|
$array_option = $lines[$i]->array_options;
|
||||||
|
|||||||
@ -951,7 +951,7 @@ if (empty($reshook))
|
|||||||
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
|
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,7 +1597,7 @@ if (empty($reshook))
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $object->insertExtraFields('BILL_SUPPLIER_MODIFY');
|
$result = $object->insertExtraFields('BILL_SUPPLIER_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -58,7 +58,7 @@ create table llx_commande
|
|||||||
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
|
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
|
||||||
|
|
||||||
module_source varchar(32), -- name of module when order generated by a dedicated module (POS, ...)
|
module_source varchar(32), -- name of module when order generated by a dedicated module (POS, ...)
|
||||||
pos_source varchar(32), -- name of POS station when order is generated by a POS module
|
pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket.
|
||||||
facture tinyint default 0,
|
facture tinyint default 0,
|
||||||
fk_account integer, -- bank account
|
fk_account integer, -- bank account
|
||||||
fk_currency varchar(3), -- currency code
|
fk_currency varchar(3), -- currency code
|
||||||
|
|||||||
@ -65,7 +65,7 @@ create table llx_facture
|
|||||||
fk_user_closing integer, -- user closing
|
fk_user_closing integer, -- user closing
|
||||||
|
|
||||||
module_source varchar(32), -- name of module when invoice generated by a dedicated module (POS, ...)
|
module_source varchar(32), -- name of module when invoice generated by a dedicated module (POS, ...)
|
||||||
pos_source varchar(32), -- name of POS station when invoice is generated by a POS module
|
pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket.
|
||||||
fk_fac_rec_source integer, -- facture rec source
|
fk_fac_rec_source integer, -- facture rec source
|
||||||
fk_facture_source integer, -- facture origin if credit notes or replacement invoice
|
fk_facture_source integer, -- facture origin if credit notes or replacement invoice
|
||||||
fk_projet integer DEFAULT NULL, -- project invoice is linked to
|
fk_projet integer DEFAULT NULL, -- project invoice is linked to
|
||||||
|
|||||||
@ -20,15 +20,15 @@ CREATE TABLE llx_societe_account(
|
|||||||
-- BEGIN MODULEBUILDER FIELDS
|
-- BEGIN MODULEBUILDER FIELDS
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
entity integer DEFAULT 1,
|
entity integer DEFAULT 1,
|
||||||
key_account varchar(128), -- the id of third party in external web site (for site_account if site_account defined)
|
|
||||||
login varchar(128) NOT NULL,
|
login varchar(128) NOT NULL,
|
||||||
pass_encoding varchar(24),
|
pass_encoding varchar(24),
|
||||||
pass_crypted varchar(128),
|
pass_crypted varchar(128),
|
||||||
pass_temp varchar(128), -- temporary password when asked for forget password
|
pass_temp varchar(128), -- temporary password when asked for forget password
|
||||||
fk_soc integer,
|
fk_soc integer,
|
||||||
|
fk_website integer, -- id of local web site
|
||||||
site varchar(128), -- name of external web site
|
site varchar(128), -- name of external web site
|
||||||
site_account varchar(128), -- a key to identify the account on external web site
|
site_account varchar(128), -- a key to identify the account on external web site
|
||||||
fk_website integer, -- id of local web site
|
key_account varchar(128), -- the id of third party in external web site (for site_account if site_account defined)
|
||||||
note_private text,
|
note_private text,
|
||||||
date_last_login datetime,
|
date_last_login datetime,
|
||||||
date_previous_login datetime,
|
date_previous_login datetime,
|
||||||
|
|||||||
@ -77,7 +77,7 @@ BlogPost=Blog post
|
|||||||
WebsiteAccount=Website account
|
WebsiteAccount=Website account
|
||||||
WebsiteAccounts=Website accounts
|
WebsiteAccounts=Website accounts
|
||||||
AddWebsiteAccount=Create web site account
|
AddWebsiteAccount=Create web site account
|
||||||
BackToListOfThirdParty=Back to list for Third Party
|
BackToListForThirdParty=Back to list for the third-party
|
||||||
DisableSiteFirst=Disable website first
|
DisableSiteFirst=Disable website first
|
||||||
MyContainerTitle=My web site title
|
MyContainerTitle=My web site title
|
||||||
AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists)
|
AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists)
|
||||||
|
|||||||
@ -1052,7 +1052,7 @@ class Product extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
if (!$error) {
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -1265,7 +1265,7 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class Entrepot extends CommonObject
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$this->label = !empty($this->label) ? trim($this->label) : trim($this->libelle);
|
$this->label = trim(!empty($this->label) ? $this->label : $this->libelle);
|
||||||
|
|
||||||
// Error if label not defined
|
// Error if label not defined
|
||||||
if ($this->label == '') {
|
if ($this->label == '') {
|
||||||
@ -224,7 +224,7 @@ class Entrepot extends CommonObject
|
|||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -322,7 +322,7 @@ class Entrepot extends CommonObject
|
|||||||
$this->errors[] = "Error ".$this->db->lasterror();
|
$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();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -386,7 +386,7 @@ class Entrepot extends CommonObject
|
|||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -185,7 +185,7 @@ class Productlot extends CommonObject
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -359,7 +359,7 @@ class Productlot extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -316,7 +316,7 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -405,7 +405,7 @@ class Project extends CommonObject
|
|||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -205,7 +205,7 @@ class Task extends CommonObject
|
|||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -384,7 +384,7 @@ class Task extends CommonObject
|
|||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -186,26 +186,21 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute'));
|
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
$result = $object->insertExtraFields('RECEPTION_MODIFY');
|
||||||
$hookmanager->initHooks(array('receptiondao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields();
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} elseif ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -305,24 +305,12 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Create extrafields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
if (! $error)
|
||||||
$action = 'add';
|
|
||||||
$hookmanager->initHooks(array('receptiondao'));
|
|
||||||
$parameters = array('socid'=>$this->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0) $error++;
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (!$error && !$notrigger)
|
if (!$error && !$notrigger)
|
||||||
{
|
{
|
||||||
@ -330,6 +318,7 @@ class Reception extends CommonObject
|
|||||||
$result = $this->call_trigger('RECEPTION_CREATE', $user);
|
$result = $this->call_trigger('RECEPTION_CREATE', $user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
@ -348,14 +337,6 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
|
||||||
$this->db->rollback();
|
|
||||||
return -3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||||
@ -769,7 +750,7 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// extrafields
|
// extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0)
|
||||||
$line->array_options = $array_options;
|
$line->array_options = $array_options;
|
||||||
|
|
||||||
$line->fk_product = $fk_product;
|
$line->fk_product = $fk_product;
|
||||||
|
|||||||
@ -136,7 +136,7 @@ class Dolresource extends CommonObject
|
|||||||
$action = 'create';
|
$action = 'create';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -309,7 +309,7 @@ class Dolresource extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -160,7 +160,7 @@ class PaymentSalary extends CommonObject
|
|||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -449,7 +449,7 @@ class PaymentSalary extends CommonObject
|
|||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -1393,7 +1393,7 @@ class Societe extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1771,7 +1771,7 @@ class Societe extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -79,15 +79,15 @@ class SocieteAccount extends CommonObject
|
|||||||
public $fields = array(
|
public $fields = array(
|
||||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
|
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
|
||||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1),
|
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1),
|
||||||
'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Key account',),
|
'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1),
|
||||||
'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>10),
|
|
||||||
'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30),
|
'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30),
|
||||||
'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1),
|
'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1),
|
||||||
'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,),
|
'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,),
|
||||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1),
|
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1),
|
||||||
'site' => array('type'=>'varchar(128)', 'label'=>'Site', 'visible'=>-1, 'enabled'=>1, 'position'=>41),
|
'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'index'=>1),
|
||||||
'site_account' => array('type'=>'varchar(128)', 'label'=>'SiteAccount', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'help'=>'A key to identify the account on external web site'),
|
'site' => array('type'=>'varchar(128)', 'label'=>'ExternalSite', 'visible'=>0, 'enabled'=>1, 'position'=>43, 'help'=>'Name of the website or service if this is account on an external website or service'),
|
||||||
'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>43, 'notnull'=>-1, 'index'=>1),
|
'site_account' => array('type'=>'varchar(128)', 'label'=>'ExternalSiteAccount', 'visible'=>0, 'enabled'=>1, 'position'=>44, 'help'=>'A key to identify the account on external web site if this is an account on an external website'),
|
||||||
|
'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>0, 'enabled'=>1, 'position'=>48, 'notnull'=>0, 'index'=>1, 'searchall'=>1, 'comment'=>'The id of third party in the external web site (for site_account if site_account defined)',),
|
||||||
'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,),
|
'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,),
|
||||||
'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,),
|
'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,),
|
||||||
//'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,),
|
//'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,),
|
||||||
@ -405,11 +405,10 @@ class SocieteAccount extends CommonObject
|
|||||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$companylink = '';
|
|
||||||
|
|
||||||
$this->ref = $this->login;
|
$this->ref = $this->login;
|
||||||
|
|
||||||
$label = '<u>'.$langs->trans("SocieteAccount").'</u>';
|
$label = '<u>'.$langs->trans("WebsiteAccount").'</u>';
|
||||||
$label .= '<br>';
|
$label .= '<br>';
|
||||||
$label .= '<b>'.$langs->trans('Login').':</b> '.$this->ref;
|
$label .= '<b>'.$langs->trans('Login').':</b> '.$this->ref;
|
||||||
//$label.= '<b>' . $langs->trans('WebSite') . ':</b> ' . $this->ref;
|
//$label.= '<b>' . $langs->trans('WebSite') . ':</b> ' . $this->ref;
|
||||||
@ -429,7 +428,7 @@ class SocieteAccount extends CommonObject
|
|||||||
{
|
{
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
{
|
{
|
||||||
$label = $langs->trans("ShowsocieteAccount");
|
$label = $langs->trans("WebsiteAccount");
|
||||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
}
|
}
|
||||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
|||||||
@ -449,6 +449,8 @@ while ($i < min($num, $limit))
|
|||||||
|
|
||||||
// Store properties in $object
|
// Store properties in $object
|
||||||
$objectwebsiteaccount->id = $obj->rowid;
|
$objectwebsiteaccount->id = $obj->rowid;
|
||||||
|
$objectwebsiteaccount->login = $obj->login;
|
||||||
|
$objectwebsiteaccount->ref = $obj->login;
|
||||||
foreach ($objectwebsiteaccount->fields as $key => $val)
|
foreach ($objectwebsiteaccount->fields as $key => $val)
|
||||||
{
|
{
|
||||||
if (property_exists($obj, $key)) $object->$key = $obj->$key;
|
if (property_exists($obj, $key)) $object->$key = $obj->$key;
|
||||||
|
|||||||
@ -353,7 +353,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals();
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1063,7 +1063,7 @@ class SupplierProposal extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -2115,8 +2115,6 @@ class SupplierProposal extends CommonObject
|
|||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -2126,7 +2124,6 @@ class SupplierProposal extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
@ -3106,7 +3103,7 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet');
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet');
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3155,7 +3152,7 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -3277,7 +3274,7 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -408,13 +408,11 @@ class Ticket extends CommonObject
|
|||||||
|
|
||||||
//Update extrafield
|
//Update extrafield
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used
|
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -838,13 +836,11 @@ class Ticket extends CommonObject
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Update extrafields
|
// Update extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used
|
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
if (!$error && !$notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
|
|||||||
@ -1094,7 +1094,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1762,7 +1762,7 @@ class User extends CommonObject
|
|||||||
$action = 'update';
|
$action = 'update';
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
// Object card
|
// Object card
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
$linkback = '';
|
$linkback = '';
|
||||||
if ($socid) $linkback = '<a href="'.DOL_URL_ROOT.'/societe/website.php?socid='.$socid.'&restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToListOfThirdParty").'</a>';
|
if ($socid) $linkback = '<a href="'.DOL_URL_ROOT.'/societe/website.php?socid='.$socid.'&restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToListForThirdParty").'</a>';
|
||||||
if ($fk_website) $linkback = '<a href="'.DOL_URL_ROOT.'/website/website_card.php?fk_website='.$fk_website.'&restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
if ($fk_website) $linkback = '<a href="'.DOL_URL_ROOT.'/website/website_card.php?fk_website='.$fk_website.'&restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
|
|||||||
$result=$localobject->create($user);
|
$result=$localobject->create($user);
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertLessThanOrEqual($result, 0);
|
$this->assertGreaterThan(0, $result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -242,24 +242,4 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* testEntrepotStatic
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function testEntrepotStatic()
|
|
||||||
{
|
|
||||||
global $conf,$user,$langs,$db;
|
|
||||||
$conf=$this->savconf;
|
|
||||||
$user=$this->savuser;
|
|
||||||
$langs=$this->savlangs;
|
|
||||||
$db=$this->savdb;
|
|
||||||
|
|
||||||
$localobject=new Entrepot($db);
|
|
||||||
|
|
||||||
//$this->assertLessThan(1, 0);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user