Fix: action on an ID must not include test on entity.

This commit is contained in:
Laurent Destailleur 2020-05-19 22:06:17 +02:00
parent 82a8c42441
commit 18ec65b4af

View File

@ -937,15 +937,14 @@ class Project extends CommonObject
$error = 0; $error = 0;
if ($this->statut != 2) if ($this->statut != self::STATUS_CLOSED)
{ {
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."projet"; $sql = "UPDATE ".MAIN_DB_PREFIX."projet";
$sql .= " SET fk_statut = 2, fk_user_close = ".$user->id.", date_close = '".$this->db->idate($now)."'"; $sql .= " SET fk_statut = ".self::STATUS_CLOSED.", fk_user_close = ".$user->id.", date_close = '".$this->db->idate($now)."'";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
$sql .= " AND entity = ".$conf->entity; $sql .= " AND fk_statut = ".self::STATUS_VALIDATED;
$sql .= " AND fk_statut = 1";
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
{ {