mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
fix entity if interventions are shared between entities (#28317)
This commit is contained in:
parent
05cf98fae8
commit
75ad2e82fd
|
|
@ -575,7 +575,8 @@ class Fichinter extends CommonObject
|
|||
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
||||
$sql .= ", fk_user_valid = ".((int) $user->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
$sql .= " AND entity IN (".getEntity('intervention').")";
|
||||
|
||||
$sql .= " AND fk_statut = 0";
|
||||
|
||||
dol_syslog(get_class($this)."::setValid", LOG_DEBUG);
|
||||
|
|
@ -603,7 +604,7 @@ class Fichinter extends CommonObject
|
|||
|
||||
// Now we rename also files into index
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'ficheinter/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity IN (".getEntity('intervention').")";
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user