Debug v16

This commit is contained in:
Laurent Destailleur 2022-06-28 13:09:53 +02:00
parent 941245c5e2
commit 4c4e081997
46 changed files with 186 additions and 732 deletions

View File

@ -592,16 +592,9 @@ class AccountingAccount extends CommonObject
if ($this->db->num_rows($resql)) {
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
}

View File

@ -2777,24 +2777,10 @@ class Adherent extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_mod) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_mod);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_validation_id = $obj->fk_user_valid;
$this->user_modification_id = $obj->fk_user_mod;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = $this->db->jdate($obj->datem);

View File

@ -155,6 +155,7 @@ class Asset extends CommonObject
public $import_key;
public $model_pdf;
public $status;
public $user_cloture_id;
// /**
// * @var string Field with ID of parent key if this object has a parent
@ -1441,24 +1442,10 @@ class Asset extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_validation_id = $obj->fk_user_valid;
$this->user_cloture_id = $obj->fk_user_cloture;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);

View File

@ -734,27 +734,11 @@ class AssetModel extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
}
$this->db->free($result);

View File

@ -909,27 +909,11 @@ class BOM extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if (!empty($obj->fk_user_author)) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if (!empty($obj->fk_user_valid)) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if (!empty($obj->fk_user_cloture)) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = !empty($obj->datem) ? $this->db->jdate($obj->datem) : "";
$this->date_validation = !empty($obj->datev) ? $this->db->jdate($obj->datev) : "";
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);
@ -1581,29 +1565,11 @@ class BOMLine extends CommonObjectLine
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);
} else {
dol_print_error($this->db);

View File

@ -371,6 +371,8 @@ class Categorie extends CommonObject
$this->entity = (int) $res['entity'];
$this->date_creation = $this->db->jdate($res['date_creation']);
$this->date_modification = $this->db->jdate($res['tms']);
$this->user_creation_id = (int) $res['fk_user_creat'];
$this->user_modification_id = (int) $res['fk_user_modif'];
$this->user_creation = (int) $res['fk_user_creat'];
$this->user_modification = (int) $res['fk_user_modif'];

View File

@ -1448,21 +1448,10 @@ class ActionComm extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->id;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_mod) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_mod);
$this->user_modification = $muser;
}
$this->date_creation = $this->db->jdate($obj->datec);
if (!empty($obj->fk_user_mod)) {
$this->date_modification = $this->db->jdate($obj->datem);
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_mod;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);
} else {

View File

@ -3258,7 +3258,7 @@ class Propal extends CommonObject
public function info($id)
{
$sql = "SELECT c.rowid, ";
$sql .= " c.datec, c.date_valid as datev, c.date_signature, c.date_cloture as dateo,";
$sql .= " c.datec, c.date_valid as datev, c.date_signature, c.date_cloture,";
$sql .= " c.fk_user_author, c.fk_user_valid, c.fk_user_signature, c.fk_user_cloture";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as c";
$sql .= " WHERE c.rowid = ".((int) $id);
@ -3274,7 +3274,7 @@ class Propal extends CommonObject
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_signature = $this->db->jdate($obj->date_signature);
$this->date_cloture = $this->db->jdate($obj->dateo);
$this->date_cloture = $this->db->jdate($obj->date_cloture);
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);

View File

@ -1882,8 +1882,11 @@ class Commande extends CommonOrder
$this->status = $obj->fk_statut;
$this->user_author_id = $obj->fk_user_author;
$this->user_creation_id = $obj->fk_user_author;
$this->user_validation_id = $obj->fk_user_valid;
$this->user_valid = $obj->fk_user_valid;
$this->user_modification = $obj->fk_user_modif;
$this->user_modification_id = $obj->fk_user_modif;
$this->user_modification = $obj->fk_user_modif;
$this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->total_localtax1;

View File

@ -469,7 +469,7 @@ class Deplacement extends CommonObject
public function info($id)
{
$sql = 'SELECT c.rowid, c.datec, c.fk_user_author, c.fk_user_modif,';
$sql .= ' c.tms';
$sql .= ' c.tms as datem';
$sql .= ' FROM '.MAIN_DB_PREFIX.'deplacement as c';
$sql .= ' WHERE c.rowid = '.((int) $id);
@ -480,18 +480,11 @@ class Deplacement extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);
} else {

View File

@ -521,21 +521,44 @@ abstract class CommonObject
public $date_modification; // Date last change (tms field)
/**
* @var string User id of author
* @deprecated
* @var User|int User author/creation
* @TODO Merge with user_creation
*/
public $user_author;
/**
* @var string User id of validation
* @deprecated
* @var User|int User author/creation
* @TODO Remove type id
*/
public $user_valid;
public $user_creation;
/**
* @var int User id author/creation
*/
public $user_creation_id;
/**
* @var string User id of last modifier
* @deprecated
* @var User|int User of validation
* @TODO Merge with user_validation
*/
public $user_valid;
/**
* @var User|int User of validation
* @TODO Remove type id
*/
public $user_validation;
/**
* @var int User id of validation
*/
public $user_validation_id;
/**
* @var User|int User last modifier
* @TODO Remove type id
*/
public $user_modification;
/**
* @var int User id last modifier
*/
public $user_modification_id;
public $next_prev_filter;

View File

@ -415,7 +415,7 @@ class Fiscalyear extends CommonObject
public function info($id)
{
$sql = "SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,";
$sql .= " fy.tms";
$sql .= " fy.tms as datem";
$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear as fy";
$sql .= " WHERE fy.rowid = ".((int) $id);
@ -426,18 +426,10 @@ class Fiscalyear extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
$this->date_modification = $this->db->jdate($obj->datem);
}
$this->db->free($result);
} else {

View File

@ -1032,10 +1032,11 @@ class Cronjob extends CommonObject
if ($this->db->num_rows($resql)) {
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->user_modification_id = $obj->fk_user_mod;
$this->user_creation_id = $obj->fk_user_author;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
$this->user_modification = $obj->fk_user_mod;
$this->user_creation = $obj->fk_user_author;
}
$this->db->free($resql);

View File

@ -974,7 +974,7 @@ class Don extends CommonObject
public function info($id)
{
$sql = 'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,';
$sql .= ' d.tms';
$sql .= ' d.tms as datem';
$sql .= ' FROM '.MAIN_DB_PREFIX.'don as d';
$sql .= ' WHERE d.rowid = '.((int) $id);
@ -985,16 +985,9 @@ class Don extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_modification = $vuser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_validation_id = $obj->fk_user_valid;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
}

View File

@ -615,7 +615,7 @@ class EmailCollector extends CommonObject
*/
public function info($id)
{
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql .= ' fk_user_creat, fk_user_modif';
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql .= ' WHERE t.rowid = '.((int) $id);
@ -624,27 +624,11 @@ class EmailCollector extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -484,27 +484,11 @@ class EmailCollectorAction extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -458,27 +458,11 @@ class EmailCollectorFilter extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -679,14 +679,11 @@ class ConferenceOrBooth extends ActionComm
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -947,27 +947,11 @@ class ConferenceOrBoothAttendee extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -395,7 +395,7 @@ class Establishment extends CommonObject
*/
public function info($id)
{
$sql = 'SELECT e.rowid, e.ref, e.datec, e.fk_user_author, e.tms, e.fk_user_mod, e.entity';
$sql = 'SELECT e.rowid, e.ref, e.datec, e.fk_user_author, e.tms as datem, e.fk_user_mod, e.entity';
$sql .= ' FROM '.MAIN_DB_PREFIX.'establishment as e';
$sql .= ' WHERE e.rowid = '.((int) $id);
@ -407,19 +407,10 @@ class Establishment extends CommonObject
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->date_creation = $this->db->jdate($obj->datec);
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_mod) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_mod);
$this->user_modification = $muser;
$this->date_modification = $this->db->jdate($obj->tms);
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_mod;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);
} else {

View File

@ -878,27 +878,11 @@ class Evaluation extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -850,27 +850,11 @@ class Evaluationline extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -884,27 +884,11 @@ class Job extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -930,27 +930,11 @@ class Position extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -924,27 +924,11 @@ class Skill extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -838,27 +838,11 @@ class Skilldet extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -877,27 +877,11 @@ class SkillRank extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -862,27 +862,11 @@ class KnowledgeRecord extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -690,7 +690,7 @@ class Loan extends CommonObject
public function info($id)
{
$sql = 'SELECT l.rowid, l.datec, l.fk_user_author, l.fk_user_modif,';
$sql .= ' l.tms';
$sql .= ' l.tms as datem';
$sql .= ' WHERE l.rowid = '.((int) $id);
dol_syslog(get_class($this).'::info', LOG_DEBUG);
@ -700,21 +700,11 @@ class Loan extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->date_creation = $this->db->jdate($obj->datec);
if (empty($obj->fk_user_modif)) {
$obj->tms = "";
}
$this->date_modification = $this->db->jdate($obj->tms);
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
$this->db->free($result);
return 1;

View File

@ -915,7 +915,8 @@ class MyObject extends CommonObject
*/
public function info($id)
{
$sql = "SELECT rowid, date_creation as datec, tms as datem,";
$sql = "SELECT rowid,";
$sql .= " date_creation as datec, tms as datem,";
$sql .= " fk_user_creat, fk_user_modif";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
$sql .= " WHERE t.rowid = ".((int) $id);
@ -927,28 +928,15 @@ class MyObject extends CommonObject
$this->id = $obj->rowid;
if (!empty($obj->fk_user_creat)) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_creat);
$this->user_creation = $cuser;
}
if (!empty($obj->fk_user_modif)) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
if (!empty($obj->fk_user_valid)) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
$this->user_validation_id = $obj->fk_user_valid;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
if (!empty($obj->datev)) {
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev);
}
}

View File

@ -1229,27 +1229,11 @@ class Mo extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -1126,27 +1126,11 @@ class Partnership extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -516,27 +516,11 @@ class PartnershipType extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -517,20 +517,9 @@ class Entrepot extends CommonObject
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -860,27 +860,11 @@ class StockTransfer extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -879,27 +879,11 @@ class StockTransferLine extends CommonObjectLine
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -849,27 +849,11 @@ class RecruitmentCandidature extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -941,27 +941,11 @@ class RecruitmentJobPosition extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -597,7 +597,7 @@ class Salary extends CommonObject
*/
public function info($id)
{
$sql = 'SELECT ps.rowid, ps.datec, ps.tms, ps.fk_user_author, ps.fk_user_modif';
$sql = 'SELECT ps.rowid, ps.datec, ps.tms as datem, ps.fk_user_author, ps.fk_user_modif';
$sql .= ' FROM '.MAIN_DB_PREFIX.'salary as ps';
$sql .= ' WHERE ps.rowid = '.((int) $id);
@ -608,19 +608,11 @@ class Salary extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_author;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);
} else {

View File

@ -554,27 +554,11 @@ class CompanyPaymentMode extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -3876,7 +3876,7 @@ class Societe extends CommonObject
*/
public function info($id)
{
$sql = "SELECT s.rowid, s.nom as name, s.datec as date_creation, tms as date_modification,";
$sql = "SELECT s.rowid, s.nom as name, s.datec, tms as datem,";
$sql .= " fk_user_creat, fk_user_modif";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.rowid = ".((int) $id);
@ -3888,21 +3888,12 @@ class Societe extends CommonObject
$this->id = $obj->rowid;
if ($obj->fk_user_creat) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_creat);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
$this->ref = $obj->name;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_modification = $this->db->jdate($obj->date_modification);
}
$this->db->free($result);

View File

@ -520,27 +520,12 @@ class SocieteAccount extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -626,27 +626,12 @@ class CTicketCategory extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -869,27 +869,12 @@ class Target extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if (!empty($obj->fk_user_author)) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if (!empty($obj->fk_user_valid)) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if (!empty($obj->fk_user_cloture)) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -881,27 +881,11 @@ class Workstation extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);

View File

@ -635,27 +635,12 @@ class Hook extends CommonObject
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->user_creation_id = $obj->fk_user_creat;
$this->user_modification_id = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
}
$this->db->free($result);