From eda066592ccd0c2a5c2fbf5d8b8bd87fdd817e93 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 22 Sep 2023 17:25:23 +0800 Subject: [PATCH] + testtaskZen: assign variables to the create page. --- module/testtask/zen.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/module/testtask/zen.php b/module/testtask/zen.php index 0cc005354c..782a4eb648 100644 --- a/module/testtask/zen.php +++ b/module/testtask/zen.php @@ -287,6 +287,46 @@ class testtaskZen extends testtask $this->view->setModule = false; } + /** + * 分配变量给场景测试单页面。 + * Assign variables for create page. + * + * @param int $productID$product + * @param int $projectID + * @param int $executionID + * @param int $build + * @access protected + * @return void + */ + protected function assignForCreate(int $productID, int $projectID, int $executionID, int $build): void + { + if($projectID) + { + /* 如果是无迭代项目,则获取影子迭代的迭代ID。*/ + /* If there is no sprint in the project, get the ID of the shadow sprint. */ + $project = $this->loadModel('project')->getByID($projectID); + if($project && !$project->multiple) $this->view->noMultipleExecutionID = $this->loadModel('execution')->getNoMultipleID($project->id); + } + + if($executionID) + { + /* 根据所选迭代的类型,调整表单字段的文本显示。*/ + /* Adjust the display value based on the type of sprint selected. */ + $execution = $this->loadModel('execution')->getByID($executionID); + if(!empty($execution) && $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution); + } + + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create; + $this->view->product = $this->loadModel('product')->getByID($productID); + $this->view->executions = $productID ? $this->product->getExecutionPairsByProduct($productID, '', $projectID, 'stagefilter') : array(); + $this->view->builds = $productID ? $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project', '', false) : array(); + $this->view->testreports = array('') + $this->loadModel('testreport')->getPairs($productID); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst|nodeleted'); + $this->view->projectID = $projectID; + $this->view->executionID = $executionID; + $this->view->build = $build; + } + /** * Assign variables for editing test task. *