* adjust for change parent status.

This commit is contained in:
wangyidong
2019-05-05 17:52:54 +08:00
parent 1615686c56
commit 0936df0edc
3 changed files with 10 additions and 6 deletions
+1
View File
@@ -41,6 +41,7 @@ $lang->doc->extension = '类型';
$lang->doc->size = '大小';
$lang->doc->download = '下载';
$lang->doc->acl = '权限';
$lang->doc->fileName = '附件';
$lang->doc->groups = '分组';
$lang->doc->users = '用户';
$lang->doc->item = '项';
+1
View File
@@ -68,6 +68,7 @@ $lang->story->hour = '小时';
$lang->story->status = '当前状态';
$lang->story->stage = '所处阶段';
$lang->story->stageAB = '阶段';
$lang->story->stagedBy = '设置阶段者';
$lang->story->mailto = '抄送给';
$lang->story->openedBy = '由谁创建';
$lang->story->openedDate = '创建日期';
+8 -6
View File
@@ -441,8 +441,6 @@ class taskModel extends model
$parentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parentID)->fetch();
if($status and $parentTask->status != $status)
{
if($status == 'wait' and $parentTask->status != 'wait') $status = 'doing';
$now = helper::now();
$task = new stdclass();
$task->status = $status;
@@ -473,7 +471,7 @@ class taskModel extends model
$task->closedReason = 'done';
}
if($status == 'doing')
if($status == 'doing' or $status == 'wait')
{
if($parentTask->assignedTo == 'closed')
{
@@ -496,15 +494,19 @@ class taskModel extends model
if(!$createAction) return $task;
$changes = common::createChanges($parentTask, $task);
$action = 'Canceled';
$action = '';
if($status == 'done') $action = 'Finished';
if($status == 'closed') $action = 'Closed';
if($status == 'pause') $action = 'Paused';
if($status == 'cancel') $action = 'Canceled';
if($status == 'doing' and $parentTask->status == 'wait') $action = 'Started';
if($status == 'doing' and $parentTask->status == 'pause') $action = 'Restarted';
if($status == 'doing' and $parentTask->status != 'wait' and $parentTask->status != 'pause') $action = 'Activated';
$actionID = $this->loadModel('action')->create('task', $parentID, $action);
$this->action->logHistory($actionID, $changes);
if($action)
{
$actionID = $this->loadModel('action')->create('task', $parentID, $action);
$this->action->logHistory($actionID, $changes);
}
}
}
}