FIX : we can't update task if closed project because of wrong test with PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE conf
This commit is contained in:
parent
10fb793fb1
commit
04cb8453f0
@ -402,7 +402,8 @@ class Task extends CommonObject
|
|||||||
if (!$error && !empty($conf->global->PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE)) {
|
if (!$error && !empty($conf->global->PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE)) {
|
||||||
// Close the parent project if it is open (validated) and its tasks are 100% completed
|
// Close the parent project if it is open (validated) and its tasks are 100% completed
|
||||||
$project = new Project($this->db);
|
$project = new Project($this->db);
|
||||||
if ($project->fetch($this->fk_project) > 0 && $project->statut == Project::STATUS_VALIDATED) {
|
if ($project->fetch($this->fk_project) > 0) {
|
||||||
|
if($project->statut == Project::STATUS_VALIDATED) {
|
||||||
$project->getLinesArray(null); // this method does not return <= 0 if fails
|
$project->getLinesArray(null); // this method does not return <= 0 if fails
|
||||||
$projectCompleted = array_reduce(
|
$projectCompleted = array_reduce(
|
||||||
$project->lines,
|
$project->lines,
|
||||||
@ -416,6 +417,8 @@ class Task extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user