From 97fc94791397d0ee5329cc3dc6b1fc02b67e5aa9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 14 Aug 2019 15:34:43 +0800 Subject: [PATCH] * computeWorkingHours has in updateParentStatus method. --- module/task/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 7e0f0bd64e..c58513a1ef 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -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); }