Update fichinter.class.php

This commit is contained in:
Frédéric FRANCE 2020-11-01 21:52:34 +01:00 committed by GitHub
parent 41965381fd
commit 5bfab708a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2020 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -635,10 +635,6 @@ class Fichinter extends CommonObject
$this->statut = 1;
$this->brouillon = 0;
$this->date_validation = $now;
}
if (!$error)
{
$this->db->commit();
return 1;
} else {
@ -970,14 +966,13 @@ class Fichinter extends CommonObject
}
}
if (!$error)
{
$main = MAIN_DB_PREFIX.'fichinterdet';
$ef = $main."_extrafields";
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_fichinter = ".$this->id.")";
if (!$error) {
$main = MAIN_DB_PREFIX.'fichinterdet';
$ef = $main."_extrafields";
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_fichinter = ".$this->id.")";
$resql = $this->db->query($sql);
if (!$resql) $error++;
$resql = $this->db->query($sql);
if (!$resql) $error++;
}
if (!$error)