FIX : multicompany, impossible to add second task

due to ref already exists, it was impossible to add a second task on company > 1

this need to be fixed in all Dolibarr versions 

All datas with more than 1 company are corrupted !
This commit is contained in:
Norbert Penel 2020-01-20 18:54:35 +01:00 committed by GitHub
parent 5b86851cf3
commit 24cb739b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,6 +156,7 @@ class Task extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (";
$sql .= "fk_projet";
$sql .= ", ref";
$sql.= ", entity";
$sql .= ", fk_task_parent";
$sql .= ", label";
$sql .= ", description";
@ -168,6 +169,7 @@ class Task extends CommonObject
$sql .= ") VALUES (";
$sql .= $this->fk_project;
$sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null');
$sql.= ", ".$conf->entity;
$sql .= ", ".$this->fk_task_parent;
$sql .= ", '".$this->db->escape($this->label)."'";
$sql .= ", '".$this->db->escape($this->description)."'";