Skip to content

Commit

Permalink
FIX calculate start date of cloned task from cloned project (#31799)
Browse files Browse the repository at this point in the history
* FIX calculate start date of cloned task from cloned project

* Fix wrong strat comment
  • Loading branch information
lvessiller-opendsi authored Nov 13, 2024
1 parent a039a00 commit dccde49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/projet/class/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1984,15 +1984,15 @@ public function createFromClone(User $user, $fromid, $project_id, $parent_task_i
$projectstatic = new Project($this->db);
$projectstatic->fetch($ori_project_id);

//Origin project strat date
$orign_project_dt_start = $projectstatic->date_start;
// Origin project start date
$orign_project_dt_start = (!isset($projectstatic->date_start) || $projectstatic->date_start == '') ? $projectstatic->date_c : $projectstatic->date_start;

//Calcultate new task start date with difference between origin proj start date and origin task start date
// Calculate new task start date with difference between origin proj start date and origin task start date
if (!empty($clone_task->date_start)) {
$clone_task->date_start = $now + $clone_task->date_start - $orign_project_dt_start;
}

//Calcultate new task end date with difference between origin proj end date and origin task end date
// Calculate new task end date with difference between origin proj start date and origin task end date
if (!empty($clone_task->date_end)) {
$clone_task->date_end = $now + $clone_task->date_end - $orign_project_dt_start;
}
Expand Down

0 comments on commit dccde49

Please sign in to comment.