diff --git a/module/my/ui/task.html.php b/module/my/ui/task.html.php index 527a97f4f1..f05c32a344 100644 --- a/module/my/ui/task.html.php +++ b/module/my/ui/task.html.php @@ -42,6 +42,16 @@ $data = array_values($tasks); if($config->edition == 'ipd') { + static $canStartExecution = ''; + static $executionID = ''; + foreach($data as $task) + { + if(empty($canStartExecution) || $executionID != $task->execution) + { + $executionID = $task->execution; + $canStartExecution = $this->execution->checkStageStatus($executionID, 'start'); + } + if(!empty($canStartExecution['disabled'])) { foreach($task->actions as $key => $action) @@ -54,6 +64,7 @@ if($config->edition == 'ipd') } } } + } } dtable diff --git a/module/task/model.php b/module/task/model.php index c600a24167..665be5a0c5 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2191,6 +2191,10 @@ class taskModel extends model $executionInfo = zget($task, 'executionInfo', array()); + /* 如果是IPD串行项目下的任务,则只有当前阶段开始以后才能开始/关闭任务。*/ + /* If it is a task under an IPD serial project, the task can be started / closed only after the current phase begins. */ + if(!empty($executionInfo->canStartExecution['disabled']) && in_array($action, array('start', 'finish', 'recordworkhour'))) return false; + /* 根据状态判断是否可以点击。 Check clickable by status. */ if($action == 'batchcreate') return (empty($task->team) || empty($task->children)) && zget($executionInfo, 'type') != 'kanban'; if($action == 'start') return $task->status == 'wait'; diff --git a/module/task/ui/view.html.php b/module/task/ui/view.html.php index bfc58d7770..7b030efbf6 100644 --- a/module/task/ui/view.html.php +++ b/module/task/ui/view.html.php @@ -34,6 +34,7 @@ $config->task->actionList['batchCreate']['hint'] = $config->task->actionList['ba /* Build confirmeObject. */ if($this->config->edition == 'ipd') { + $execution->canStartExecution = $this->loadModel('execution')->checkStageStatus($execution->id, 'start'); $task = $this->loadModel('story')->getAffectObject(array(), 'task', $task); if(!empty($task->confirmeActionType)) $config->task->actions->view['mainActions'] = array('confirmDemandRetract', 'confirmDemandUnlin');