From fee17d178a9ba9688f5920c491213ef4ecc2407f Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 28 May 2025 06:36:46 +0000 Subject: [PATCH 1/2] * [bug#62845,done,0.1h,0h] Move zentaomax code to zentaopms. --- module/execution/model.php | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/module/execution/model.php b/module/execution/model.php index 4cc3bcc3e8..565fe0662e 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -142,6 +142,47 @@ class executionModel extends model $this->lang->execution->menu->story['link'] = str_replace(array($this->lang->common->story, 'story'), array($this->lang->SRCommon, 'storykanban'), $this->lang->execution->menu->story['link']); $this->lang->execution->menu->story['dropMenu']->story = str_replace('execution|story', 'execution|storykanban', $this->lang->execution->menu->story['dropMenu']->story); } + + /* 模板执行过滤部分导航菜单。 */ + if($execution->isTpl) + { + /* 模板执行不显示1.5级导航。 */ + $this->config->hasDropmenuApps = array_diff($this->config->hasDropmenuApps, array('project', 'execution')); + + unset($this->lang->execution->menu->kanban); + unset($this->lang->execution->menu->burn); + unset($this->lang->execution->menu->view); + unset($this->lang->execution->menu->story); + unset($this->lang->execution->menu->qa); + unset($this->lang->execution->menu->devops); + unset($this->lang->execution->menu->build); + unset($this->lang->execution->menu->release); + unset($this->lang->execution->menu->action); + unset($this->lang->execution->menu->dynamic); + unset($this->lang->execution->menu->effort); + unset($this->lang->execution->menu->more); + + if(!empty($this->lang->execution->menu->other['dropMenu']->pssp)) + { + $this->lang->execution->menu->pssp = $this->lang->execution->menu->other['dropMenu']->pssp; + $this->lang->execution->menu->auditplan = $this->lang->execution->menu->other['dropMenu']->auditplan; + + $docOrder = 0; + foreach($this->lang->execution->menuOrder as $order => $menu) if($menu == 'doc') $docOrder = $order; + $this->lang->execution->menuOrder[$docOrder + 1] = 'pssp'; + $this->lang->execution->menuOrder[$docOrder + 2] = 'auditplan'; + + if(!empty($this->lang->project->menuOrder)) + { + $docOrder = 0; + foreach($this->lang->project->menuOrder as $order => $menu) if($menu == 'doc') $docOrder = $order; + $this->lang->project->menuOrder[$docOrder + 1] = 'pssp'; + $this->lang->project->menuOrder[$docOrder + 2] = 'auditplan'; + } + } + + unset($this->lang->execution->menu->other); + } } /** From 33c33de2a5a14b9091217efd941a9bb284d571d9 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 28 May 2025 06:45:27 +0000 Subject: [PATCH 2/2] * Add unit test comment. --- module/execution/test/model/setmenu.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/module/execution/test/model/setmenu.php b/module/execution/test/model/setmenu.php index 2fb735ddb4..a9d9d817ea 100755 --- a/module/execution/test/model/setmenu.php +++ b/module/execution/test/model/setmenu.php @@ -23,10 +23,17 @@ title=测试 executionModel::setMenu(); timeout=0 cid=1 +- 测试构建导航第build条的link属性 @构建|execution|build|executionID=5 +- 测试设置迭代导航第more条的link属性 @更多|execution|more|5 +- 测试设置阶段导航第more条的link属性 @更多|execution|more|5 +- 测试设置看板导航第kanban条的link属性 @看板|execution|kanban|executionID=5 +- 执行不存在的情况 @0 + */ $executionTester = new executionTest(); -r($executionTester->setMenuTest(3)) && p('more:link') && e('更多|execution|more|3'); // 测试设置迭代导航 -r($executionTester->setMenuTest(4)) && p('more:link') && e('更多|execution|more|3'); // 测试设置阶段导航 -r($executionTester->setMenuTest(5)) && p('kanban:link') && e('看板|execution|kanban|executionID=5'); // 测试设置看板导航 -r($executionTester->setMenuTest(10)) && p() && e('0'); // 执行不存在的情况 +r($executionTester->setMenuTest(2)) && p('build:link') && e('构建|execution|build|executionID=5'); // 测试构建导航 +r($executionTester->setMenuTest(3)) && p('more:link') && e('更多|execution|more|5'); // 测试设置迭代导航 +r($executionTester->setMenuTest(4)) && p('more:link') && e('更多|execution|more|5'); // 测试设置阶段导航 +r($executionTester->setMenuTest(5)) && p('kanban:link') && e('看板|execution|kanban|executionID=5'); // 测试设置看板导航 +r($executionTester->setMenuTest(10)) && p() && e('0'); // 执行不存在的情况