From b980e7fd5b086243c94d56cdfbdb5abcf59baed3 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 10 May 2023 11:52:17 +0000 Subject: [PATCH] * Optimizing variable operations. --- module/task/zen.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/module/task/zen.php b/module/task/zen.php index 739b789c0d..12afde1794 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -1152,15 +1152,11 @@ class taskZen extends task $this->view->parentPri = $task->pri; } - /* 需求批量分解任务。 */ - $story = $this->story->getByID($storyID); - $moduleID = $story ? $story->module : $moduleID; - $moduleParam = $story ? $moduleID : 0; - /* 获取模块下拉数据。 */ - $showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; - $modules = $this->loadModel('tree')->getTaskOptionMenu($execution->id, 0, 0, $showAllModule ? 'allModule' : ''); - $stories = $this->story->getExecutionStoryPairs($execution->id, 0, 'all', $moduleParam, 'short', 'active'); + $showAllModule = !empty($this->config->execution->task->allModule) ? 'allModule' : ''; + $modules = $this->loadModel('tree')->getTaskOptionMenu($execution->id, 0, 0, $showAllModule); + $story = $this->story->getByID($storyID); + $stories = $this->story->getExecutionStoryPairs($execution->id, 0, 'all', $story ? $story->module : 0, 'short', 'active'); /* Set Custom. */ list($customFields, $showFields) = $this->getCustomFields($execution, 'batchCreate'); @@ -1171,7 +1167,7 @@ class taskZen extends task $this->view->parent = $taskID; $this->view->storyID = $storyID; $this->view->story = $story; - $this->view->moduleID = $moduleID; + $this->view->moduleID = $story ? $story->module : $moduleID; $this->view->stories = $stories; $this->view->storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $execution->id); $this->view->members = $this->loadModel('user')->getTeamMemberPairs($execution->id, 'execution', 'nodeleted');