From 4141b05b7b151e1d2cff7e55b3e07bf7863a9e71 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 30 Aug 2021 11:13:53 +0800 Subject: [PATCH] * Fix bug #12802. --- module/execution/model.php | 1 - module/story/model.php | 6 +++--- module/story/view/view.html.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 5a337c622c..18f4f9eb6f 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1716,7 +1716,6 @@ class executionModel extends model $this->config->product->search['params']['product']['values'] = $productPairs + array('all' => $this->lang->product->allProductsOfProject); $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts($products); $this->config->product->search['params']['module']['values'] = $modules; - unset($this->lang->story->statusList['draft']); if($productType == 'normal') { unset($this->config->product->search['fields']['branch']); diff --git a/module/story/model.php b/module/story/model.php index df25d701b4..330fac34c6 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -204,7 +204,7 @@ class storyModel extends model ->setDefault('plan,verify', '') ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) - ->setIF($this->post->needNotReview or $executionID > 0, 'status', 'active') + ->setIF($this->post->needNotReview, 'status', 'active') ->setIF($this->post->plan > 0, 'stage', 'planned') ->setIF($this->post->estimate, 'estimate', (float)$this->post->estimate) ->setIF($executionID > 0, 'stage', 'projected') @@ -270,7 +270,7 @@ class storyModel extends model } /* Project or execution linked story. */ - if($executionID != 0 and $story->status != 'draft') + if($executionID != 0) { $this->linkStory($executionID, $this->post->product, $storyID); if($executionID != $this->session->project) $this->linkStory($this->session->project, $this->post->product, $storyID); @@ -1764,7 +1764,7 @@ class storyModel extends model $stories = $this->getByList($data->storyIdList); foreach($stories as $story) { - if($story->status == 'closed') continue; + if(strpos('draft,closed', $story->status) !== false) continue; $task = new stdclass(); $task->execution = $executionID; diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 33defff1a0..690221f1cd 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -222,7 +222,7 @@ echo ""; } - if($from == 'execution') common::printIcon('task', 'create', "execution=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'plus', '', 'showinonlybody'); + if($from == 'execution' and strpos('draft,closed', $story->status) === false) common::printIcon('task', 'create', "execution=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'plus', '', 'showinonlybody'); echo $this->buildOperateMenu($story, 'view');