* computeWorkingHours has in updateParentStatus method.

This commit is contained in:
wangyidong
2019-08-14 15:34:43 +08:00
parent e0e6d677b2
commit 97fc947913
+3 -1
View File
@@ -782,7 +782,6 @@ class taskModel extends model
if($oldTask->parent > 0)
{
$oldParentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($oldTask->parent)->fetch();
if($task->parent == 0) $this->computeWorkingHours($oldTask->parent);
$this->updateParentStatus($taskID, $oldTask->parent, !$changed);
$this->computeBeginAndEnd($oldTask->parent);
@@ -792,8 +791,11 @@ class taskModel extends model
if(!$oldChildCount) $this->dao->update(TABLE_TASK)->set('parent')->eq(0)->where('id')->eq($oldTask->parent)->exec();
$this->dao->update(TABLE_TASK)->set('lastEditedBy')->eq($this->app->user->account)->set('lastEditedDate')->eq(helper::now())->where('id')->eq($oldTask->parent)->exec();
$this->action->create('task', $taskID, 'unlinkParentTask', '', $oldTask->parent);
$actionID = $this->action->create('task', $oldTask->parent, 'unLinkChildrenTask', '', $taskID);
$newParentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($oldTask->parent)->fetch();
$changes = common::createChanges($oldParentTask, $newParentTask);
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
}