From 573b3dd7f5441f5c9eb0eb0466bf766c9de387bc Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 9 Jan 2025 10:05:37 +0800 Subject: [PATCH] * [bug#59032,done,1h] assign stoires. --- module/testtask/control.php | 2 +- module/testtask/zen.php | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 8921039327..0ec3744b5b 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -412,7 +412,7 @@ class testtask extends control list($runs, $scenes) = $this->testtask->getSceneCases($productID, $runs); - $this->testtaskZen->setSearchParamsForCases($product, $moduleID, $taskID, $queryID); + $this->testtaskZen->setSearchParamsForCases($product, $moduleID, $testtask, $queryID); $this->testtaskZen->assignForCases($product, $testtask, $runs, $scenes, $moduleID, $browseType, $param, $orderBy, $pager); $this->display(); } diff --git a/module/testtask/zen.php b/module/testtask/zen.php index db1f21ec53..0057de69c9 100644 --- a/module/testtask/zen.php +++ b/module/testtask/zen.php @@ -57,25 +57,37 @@ class testtaskZen extends testtask * * @param object $product * @param int $moduleID - * @param int $testtaskID + * @param object $testtask * @param int $queryID * @access protected * @return void */ - protected function setSearchParamsForCases(object $product, int $moduleID, int $testtaskID, int $queryID): void + protected function setSearchParamsForCases(object $product, int $moduleID, object $testtask, int $queryID): void { $this->loadModel('testcase'); $searchConfig = $this->config->testcase->search; $searchConfig['module'] = 'testtask'; $searchConfig['queryID'] = $queryID; - $searchConfig['actionURL'] = helper::createLink('testtask', 'cases', "taskID=$testtaskID&browseType=bySearch&queryID=myQueryID"); + $searchConfig['actionURL'] = helper::createLink('testtask', 'cases', "taskID=$testtask->id&browseType=bySearch&queryID=myQueryID"); $searchConfig['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($product->id, 'case'); $searchConfig['params']['lib']['values'] = $this->loadModel('caselib')->getLibraries(); $searchConfig['params']['scene']['values'] = $this->testcase->getSceneMenu($product->id, $moduleID); $searchConfig['params']['status']['values'] = $this->lang->testcase->statusList; $searchConfig['params']['product']['values'] = array($product->id => $product->name, 'all' => $this->lang->testcase->allProduct); + if($this->app->tab == 'project') + { + $searchConfig['params']['story']['values'] = $this->loadModel('story')->getExecutionStoryPairs($testtask->project, 0, 'all', $moduleID, 'full', 'active'); + } + elseif($this->app->tab == 'execution') + { + $searchConfig['params']['story']['values'] = $this->loadModel('story')->getExecutionStoryPairs($testtask->execution, 0, 'all', $moduleID, 'full', 'active'); + } + else + { + $searchConfig['params']['story']['values'] = $this->loadModel('story')->getProductStoryPairs($product->id, 'all', array(), 'active,reviewing', 'id_desc', 0, '', 'story', false); + } $searchConfig['fields']['assignedTo'] = $this->lang->testtask->assignedTo; $searchConfig['params']['assignedTo'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');