This commit is contained in:
Laurent Destailleur 2023-03-22 19:16:06 +01:00
parent 89d25eae96
commit a06815ac29

View File

@ -1589,16 +1589,17 @@ class FichinterLigne extends CommonObjectLine
*/
public function fetch($rowid)
{
dol_syslog("FichinterLigne::fetch", LOG_DEBUG);
$sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang, ft.date';
$sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
$sql .= ' WHERE ft.rowid = '.((int) $rowid);
dol_syslog("FichinterLigne::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
$objp = $this->db->fetch_object($result);
$resql = $this->db->query($sql);
if ($resql) {
$objp = $this->db->fetch_object($resql);
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_fichinter = $objp->fk_fichinter;
$this->date = $this->db->jdate($objp->date);
$this->datei = $this->db->jdate($objp->date); // For backward compatibility
@ -1606,7 +1607,10 @@ class FichinterLigne extends CommonObjectLine
$this->duration = $objp->duree;
$this->rang = $objp->rang;
$this->db->free($result);
$this->db->free($resql);
$this->fetch_optionals();
return 1;
} else {
$this->error = $this->db->error().' sql='.$sql;
@ -1623,8 +1627,6 @@ class FichinterLigne extends CommonObjectLine
*/
public function insert($user, $notrigger = 0)
{
global $langs, $conf;
$error = 0;
dol_syslog("FichinterLigne::insert rang=".$this->rang);
@ -1714,8 +1716,6 @@ class FichinterLigne extends CommonObjectLine
*/
public function update($user, $notrigger = 0)
{
global $langs, $conf;
$error = 0;
if (empty($this->date) && !empty($this->datei)) { // For backward compatibility