Debug v16
This commit is contained in:
parent
1b58b5e21f
commit
bd28a7e038
@ -1444,7 +1444,7 @@ class Propal extends CommonObject
|
||||
|
||||
// Clear fields
|
||||
$object->user_author = $user->id;
|
||||
$object->user_valid = '';
|
||||
$object->user_valid = 0;
|
||||
$object->date = $now;
|
||||
$object->datep = $now; // deprecated
|
||||
$object->fin_validite = $object->date + ($object->duree_validite * 24 * 3600);
|
||||
|
||||
@ -507,7 +507,7 @@ class Commande extends CommonOrder
|
||||
$sql .= " SET ref = '".$this->db->escape($num)."',";
|
||||
$sql .= " fk_statut = ".self::STATUS_VALIDATED.",";
|
||||
$sql .= " date_valid='".$this->db->idate($now)."',";
|
||||
$sql .= " fk_user_valid = ".((int) $user->id).",";
|
||||
$sql .= " fk_user_valid = ".($user->id > 0 ? (int) $user->id : "null").",";
|
||||
$sql .= " fk_user_modif = ".((int) $user->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
@ -1234,7 +1234,8 @@ class Commande extends CommonOrder
|
||||
|
||||
// Clear fields
|
||||
$this->user_author_id = $user->id;
|
||||
$this->user_valid = '';
|
||||
$this->user_valid = 0; // deprecated
|
||||
$this->user_validation_id = 0;
|
||||
$this->date = dol_now();
|
||||
$this->date_commande = dol_now();
|
||||
$this->date_creation = '';
|
||||
@ -1884,7 +1885,7 @@ class Commande extends CommonOrder
|
||||
$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_valid = $obj->fk_user_valid; // deprecated
|
||||
$this->user_modification_id = $obj->fk_user_modif;
|
||||
$this->user_modification = $obj->fk_user_modif;
|
||||
$this->total_ht = $obj->total_ht;
|
||||
@ -3351,7 +3352,7 @@ class Commande extends CommonOrder
|
||||
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->statut) ? $this->statut : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->user_author_id) ? $this->user_author_id : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->user_valid) ? $this->user_valid : "null").",";
|
||||
$sql .= " fk_user_valid=".((isset($this->user_valid) && $this->user_valid > 0) ? $this->user_valid : "null").",";
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||
$sql .= " deposit_percent=".(! empty($this->deposit_percent) ? strval($this->deposit_percent) : "null").",";
|
||||
@ -3840,21 +3841,13 @@ class Commande extends CommonOrder
|
||||
$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_author;
|
||||
}
|
||||
|
||||
if ($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;
|
||||
}
|
||||
|
||||
if ($obj->fk_user_cloture) {
|
||||
$cluser = new User($this->db);
|
||||
$cluser->fetch($obj->fk_user_cloture);
|
||||
$this->user_cloture = $cluser;
|
||||
$this->user_closing_id = $obj->fk_user_cloture;
|
||||
}
|
||||
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
|
||||
@ -520,6 +520,11 @@ abstract class CommonObject
|
||||
*/
|
||||
public $date_modification; // Date last change (tms field)
|
||||
|
||||
/**
|
||||
* @var integer|string $date_cloture;
|
||||
*/
|
||||
public $date_cloture; // Date closing (tms field)
|
||||
|
||||
/**
|
||||
* @var User|int User author/creation
|
||||
* @TODO Merge with user_creation
|
||||
@ -549,6 +554,10 @@ abstract class CommonObject
|
||||
* @var int User id of validation
|
||||
*/
|
||||
public $user_validation_id;
|
||||
/**
|
||||
* @var int User id closing object
|
||||
*/
|
||||
public $user_closing_id;
|
||||
|
||||
/**
|
||||
* @var User|int User last modifier
|
||||
|
||||
@ -508,7 +508,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
|
||||
// User signature
|
||||
if (!empty($object->user_signature)) {
|
||||
if (!empty($object->user_signature) || !empty($object->user_signature_id)) {
|
||||
if ($usetable) {
|
||||
print '<tr><td class="titlefield">';
|
||||
}
|
||||
@ -526,7 +526,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
} else {
|
||||
$userstatic = new User($db);
|
||||
$userstatic->fetch($object->user_signature);
|
||||
$userstatic->fetch($object->user_signature_id ? $object->user_signature_id : $object->user_signature);
|
||||
if ($userstatic->id) {
|
||||
print $userstatic->getNomUrl(-1, '', 0, 0, 0);
|
||||
} else {
|
||||
@ -563,7 +563,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
|
||||
// User close
|
||||
if (!empty($object->user_cloture) || !empty($object->user_closing)) {
|
||||
if (!empty($object->user_cloture) || !empty($object->user_closing) || !empty($object->user_closing_id)) {
|
||||
if (isset($object->user_cloture) && !empty($object->user_cloture)) {
|
||||
$object->user_closing = $object->user_cloture;
|
||||
}
|
||||
@ -584,7 +584,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
} else {
|
||||
$userstatic = new User($db);
|
||||
$userstatic->fetch($object->user_closing);
|
||||
$userstatic->fetch($object->user_closing_id ? $object->user_closing_id : $object->user_closing);
|
||||
if ($userstatic->id) {
|
||||
print $userstatic->getNomUrl(-1, '', 0, 0, 0);
|
||||
} else {
|
||||
@ -624,7 +624,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
|
||||
// User conciliate
|
||||
if (!empty($object->user_rappro)) {
|
||||
if (!empty($object->user_rappro) || !empty($object->user_rappro_id)) {
|
||||
if ($usetable) {
|
||||
print '<tr><td class="titlefield">';
|
||||
}
|
||||
@ -642,7 +642,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
} else {
|
||||
$userstatic = new User($db);
|
||||
$userstatic->fetch($object->user_rappro);
|
||||
$userstatic->fetch($object->user_rappro_id ? $object->user_rappro_id : $object->user_rappro);
|
||||
if ($userstatic->id) {
|
||||
print $userstatic->getNomUrl(1, '', 0, 0, 0);
|
||||
} else {
|
||||
|
||||
@ -590,7 +590,7 @@ class Fichinter extends CommonObject
|
||||
$sql .= " SET fk_statut = 1";
|
||||
$sql .= ", ref = '".$this->db->escape($num)."'";
|
||||
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
||||
$sql .= ", fk_user_valid = ".((int) $user->id);
|
||||
$sql .= ", fk_user_valid = ".($user->id > 0 ? (int) $user->id : "null");
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
$sql .= " AND fk_statut = 0";
|
||||
@ -1204,7 +1204,7 @@ class Fichinter extends CommonObject
|
||||
|
||||
// Clear fields
|
||||
$this->user_author_id = $user->id;
|
||||
$this->user_valid = '';
|
||||
$this->user_valid = 0;
|
||||
$this->date_creation = '';
|
||||
$this->date_validation = '';
|
||||
$this->ref_client = '';
|
||||
|
||||
@ -1581,7 +1581,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->statut) ? $this->statut : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->user_author_id) ? $this->user_author_id : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->user_valid) ? $this->user_valid : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->user_valid) && $this->user_valid > 0 ? $this->user_valid : "null").",";
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
||||
@ -1679,7 +1679,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
// Clear fields
|
||||
$this->user_author_id = $user->id;
|
||||
$this->user_valid = '';
|
||||
$this->user_valid = 0;
|
||||
$this->date_creation = '';
|
||||
$this->date_validation = '';
|
||||
$this->ref_supplier = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user