* Move code.
This commit is contained in:
@@ -1844,6 +1844,22 @@ class taskModel extends model
|
||||
$task = $this->getById($oldEffort->objectID);
|
||||
$data = $this->buildTaskForUpdateEffort($task, $oldEffort, $effort);
|
||||
|
||||
/* Process multi-task by effort. */
|
||||
if(!empty($task->team))
|
||||
{
|
||||
$currentTeam = $this->getTeamByAccount($task->team, $oldEffort->account, array('order' => $oldEffort->order));
|
||||
if($currentTeam)
|
||||
{
|
||||
$newTeamInfo = new stdclass();
|
||||
$newTeamInfo->consumed = $currentTeam->consumed + $effort->consumed - $oldEffort->consumed;
|
||||
if($currentTeam->status != 'done') $newTeamInfo->left = $left;
|
||||
if($currentTeam->status != 'done' and $newTeamInfo->consumed > 0 and $left == 0) $newTeamInfo->status = 'done';
|
||||
$this->dao->update(TABLE_TASKTEAM)->data($newTeamInfo)->where('id')->eq($currentTeam->id)->exec();
|
||||
|
||||
$data = $this->computeMultipleHours($task, $data);
|
||||
}
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($task->id)->exec();
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
Reference in New Issue
Block a user