From c54072c794b172d7fc3dd6809ffe377c9571c955 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 17 Jul 2025 00:56:53 +0000 Subject: [PATCH] * [bug#64076,done,0.2h] fix bug. --- module/testcase/control.php | 5 +++-- module/testcase/ui/header.html.php | 4 ++-- module/testcase/zen.php | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 30e69dab92..77b15b0dc0 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -207,8 +207,9 @@ class testcase extends control * @access public * @return void */ - public function groupCase(int $productID = 0, string $branch = '', string $groupBy = 'story', int $objectID = 0, string $caseType = '') + public function groupCase(int $productID = 0, string $branch = '', string $groupBy = 'story', int $objectID = 0, string $caseType = '', string $browseType = 'all') { + if($browseType) $this->session->set('caseBrowseType', $browseType, $this->app->tab); $this->testcaseZen->checkProducts(); // 如果不存在产品,则跳转到产品创建页面。 /* 设置SESSION和COOKIE,获取产品信息。 */ @@ -244,7 +245,7 @@ class testcase extends control $this->view->browseType = 'group'; $this->view->groupBy = $groupBy; $this->view->orderBy = $groupBy; - $this->view->cases = $this->testcaseZen->getGroupCases($productID, $branch, $groupBy, $caseType); + $this->view->cases = $this->testcaseZen->getGroupCases($productID, $branch, $groupBy, $caseType, $browseType); $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); $this->view->branch = $branch; $this->view->caseType = $caseType; diff --git a/module/testcase/ui/header.html.php b/module/testcase/ui/header.html.php index 3e086cb7e5..55cd198fc1 100644 --- a/module/testcase/ui/header.html.php +++ b/module/testcase/ui/header.html.php @@ -156,7 +156,7 @@ if($isFromDoc) ); } -$linkParams = $projectParam . "productID=$productID&branch=$branch&browseType={key}¶m=0" . $suffixParam; +$linkParams = $rawMethod == 'groupcase' ? "productID=$productID&branch=$branch&groupBy=$groupBy&objectID=0&caseType=$caseType&browseType={key}" : $projectParam . "productID=$productID&branch=$branch&browseType={key}¶m=0" . $suffixParam; $browseLink = createLink('testcase', 'browse', $linkParams); if($app->tab == 'project') $browseLink = createLink('project', 'testcase', $linkParams); if($app->tab == 'execution' && $from != 'doc') $browseLink = createLink('execution', 'testcase', "executionID={$executionID}&productID=$productID&branch=$branch&browseType={key}"); @@ -174,7 +174,7 @@ featureBar set::linkParams($rawMethod == 'zerocase' || $rawMethod == 'browseunits' || $rawMethod == 'browsescene' ? null : $linkParams), set::link($rawMethod == 'zerocase' || $rawMethod == 'browseunits' || $rawMethod == 'browsescene' ? $browseLink : null), set::queryMenuLinkCallback(array(fn($key) => str_replace('{queryID}', (string)$key, $queryMenuLink))), - set::current($methodName == 'browse' ? $this->session->caseBrowseType : null), + set::current(in_array($methodName, array('groupcase', 'browse')) ? $this->session->caseBrowseType : null), set::load($load), set::app($app->tab), $canSwitchCaseType ? to::leading diff --git a/module/testcase/zen.php b/module/testcase/zen.php index b6eb2319f1..6d14e416b0 100755 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -2320,14 +2320,15 @@ class testcaseZen extends testcase * @param string $branch * @param string $groupBy * @param string $caseType + * @param string $browseType * @access protected * @return array */ - protected function getGroupCases(int $productID, string $branch, string $groupBy, string $caseType): array + protected function getGroupCases(int $productID, string $branch, string $groupBy, string $caseType, string $browseType = ''): array { /* 获取用例。 */ /* Get cases. */ - $cases = $this->testcase->getModuleCases($productID, $branch, 0, '', 'no', $caseType, $groupBy); + $cases = $this->testcase->getModuleCases($productID, $branch, 0, $browseType, 'no', $caseType, $groupBy); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false); $cases = $this->loadModel('story')->checkNeedConfirm($cases);