+
+
+ id", '', '', '', true), " " . $lang->testcase->create, '', "class='btn btn-primary'");?>
+
+From 526fb0d7080c52515f7e5c2d5619eee1a8905754 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 12 Mar 2021 15:16:20 +0800 Subject: [PATCH] * Add execution case. --- module/bug/control.php | 5 ++ module/common/lang/zh-cn.php | 51 +++++++++++----- module/common/model.php | 5 +- module/execution/control.php | 71 +++++++++++++++++++--- module/execution/lang/de.php | 1 - module/execution/lang/en.php | 1 - module/execution/lang/fr.php | 1 - module/execution/lang/zh-cn.php | 2 +- module/execution/model.php | 6 +- module/execution/view/qa.html.php | 2 + module/execution/view/testcase.html.php | 48 +++++++++++++++ module/qa/control.php | 5 ++ module/testcase/control.php | 5 ++ module/testcase/model.php | 78 ++++++++++++------------- module/testreport/control.php | 5 ++ module/testtask/control.php | 8 ++- 16 files changed, 217 insertions(+), 77 deletions(-) create mode 100644 module/execution/view/qa.html.php create mode 100644 module/execution/view/testcase.html.php diff --git a/module/bug/control.php b/module/bug/control.php index 0064887470..61f883a4eb 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -54,6 +54,11 @@ class bug extends control foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; $this->lang->noMenuModule[] = $this->app->rawModule; } + else + { + $this->lang->bug->menu = $this->lang->projectQa->menu; + $this->lang->bug->subMenu = $this->lang->projectQa->subMenu; + } $this->view->products = $this->products = $this->product->getProductPairsByProject($this->projectID); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', 'fromModule=bug&moduleGroup=' . $this->lang->navGroup->bug . '&activeMenu=bug'))); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index eca049449f..35e0d93e50 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -335,25 +335,32 @@ $lang->story->menu = $lang->product->menu; /* 执行视图菜单设置。*/ $lang->execution = new stdclass(); +$lang->execution->homeMenu = new stdclass(); +$lang->execution->homeMenu->index = '仪表盘|execution|index|'; +$lang->execution->homeMenu->list = '执行|execution|all|'; + $lang->execution->menu = new stdclass(); -$lang->execution->menu->index = '仪表盘|execution|index|'; -$lang->execution->menu->list = '执行|execution|all|'; +$lang->execution->menu->task = array('link' => '任务|execution|task|executionID=%s', 'subModule' => 'task,tree', 'alias' => 'importtask,importbug'); +$lang->execution->menu->kanban = array('link' => '看板|execution|kanban|executionID=%s'); +$lang->execution->menu->burn = array('link' => '燃尽图|execution|burn|executionID=%s'); +$lang->execution->menu->view = array('link' => '视图|execution|grouptask|executionID=%s', 'alias' => 'grouptask,tree', 'class' => 'dropdown dropdown-hover'); +$lang->execution->menu->story = array('link' => "{$lang->SRCommon}|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'linkstory,storykanban'); +$lang->execution->menu->qa = array('link' => '测试|execution|qa|', 'alias' => 'qa,bug,testcase,testtask,testreport'); +$lang->execution->menu->doc = array('link' => '文档|doc|objectLibs|type=execution&objectID=%s&from=execution', 'subModule' => 'doc'); +$lang->execution->menu->build = array('link' => '版本|execution|build|executionID=%s', 'subModule' => 'build'); +$lang->execution->menu->action = array('link' => '动态|execution|dynamic|executionID=%s'); +$lang->execution->menu->setting = array('link' => '设置|execution|view|executionID=%s', 'subModule' => 'personnel', 'alias' => 'edit,manageproducts,team,whitelist,addwhitelist,managemembers', 'class' => 'dropdown dropdown-hover'); $lang->execution->viewMenu = new stdclass(); -$lang->execution->viewMenu->task = array('link' => '任务|execution|task|executionID=%s', 'subModule' => 'task,tree', 'alias' => 'importtask,importbug'); -$lang->execution->viewMenu->kanban = array('link' => '看板|execution|kanban|executionID=%s'); -$lang->execution->viewMenu->burn = array('link' => '燃尽图|execution|burn|executionID=%s'); -$lang->execution->viewMenu->view = array('link' => '视图|execution|grouptask|executionID=%s', 'alias' => 'grouptask,tree', 'class' => 'dropdown dropdown-hover'); -$lang->execution->viewMenu->story = array('link' => "{$lang->SRCommon}|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'linkstory,storykanban'); -$lang->execution->viewMenu->qa = array('link' => '测试|qa|index|'); -$lang->execution->viewMenu->doc = array('link' => '文档|doc|objectLibs|type=execution&objectID=%s&from=execution', 'subModule' => 'doc'); -$lang->execution->viewMenu->build = array('link' => '版本|execution|build|executionID=%s', 'subModule' => 'build'); -$lang->execution->viewMenu->action = array('link' => '动态|execution|dynamic|executionID=%s'); -$lang->execution->viewMenu->setting = array('link' => '设置|execution|view|executionID=%s', 'subModule' => 'personnel', 'alias' => 'edit', 'class' => 'dropdown dropdown-hover'); +$lang->execution->viewMenu->groupTask = '分组视图|execution|grouptask|executionID=%s'; +$lang->execution->viewMenu->tree = '树状图|execution|tree|executionID=%s'; -$lang->execution->groupMenu = new stdclass(); -$lang->execution->groupMenu->groupTask = '分组视图|execution|grouptask|executionID={EXECUTION}'; -$lang->execution->groupMenu->tree = '树状图|execution|tree|executionID={EXECUTION}'; +$lang->execution->qaMenu = new stdclass(); +$lang->execution->qaMenu->qa = array('link' => '仪表盘|execution|qa|executionID=%s'); +$lang->execution->qaMenu->bug = array('link' => 'Bug|execution|bug|executionID=%s'); +$lang->execution->qaMenu->testcase = array('link' => '用例|execution|testcase|executionID=%s'); +$lang->execution->qaMenu->testtask = array('link' => '测试单|execution|testtask|executionID=%s'); +$lang->execution->qaMenu->testreport = array('link' => '报告|execution|testreport|exeutionID=%s'); $lang->execution->settingMenu = new stdclass(); $lang->execution->settingMenu = new stdclass(); @@ -895,13 +902,25 @@ $lang->menu->scrum->index = '仪表盘|project|index|project={PROJECT}' $lang->menu->scrum->execution = "$lang->executionCommon|execution|all|status=all&projectID={PROJECT}&from=project"; $lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story', 'alias' => 'story,track'); $lang->menu->scrum->doc = '文档|doc|index|'; -$lang->menu->scrum->qa = '测试|qa|index'; +$lang->menu->scrum->qa = array('link' => '测试|qa|index', 'subModule' => 'testcase,testtask'); $lang->menu->scrum->ci = '代码|repo|browse'; $lang->menu->scrum->projectbuild = array('link' => '版本|projectbuild|browse|project={PROJECT}'); $lang->menu->scrum->projectrelease = array('link' => '发布|projectrelease|browse|project={PROJECT}'); $lang->menu->scrum->dynamic = array('link' => '动态|project|dynamic|project={PROJECT}'); $lang->menu->scrum->projectsetting = array('link' => '设置|project|view|project={PROJECT}', 'subModule' => 'stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist'); +$lang->projectQa = new stdclass(); +$lang->projectQa->menu = new stdclass(); +$lang->projectQa->menu->index = array('link' => '仪表盘|qa|index'); +$lang->projectQa->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'subModule' => 'bug'); +$lang->projectQa->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testsuite,testcase,caselib'); +$lang->projectQa->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testtask', 'class' => 'dropdown dropdown-hover'); + +$lang->projectQa->subMenu = new stdclass(); +$lang->projectQa->subMenu->testtask = new stdclass(); +$lang->projectQa->subMenu->testtask->testtask = array('link' => '测试单|testtask|browse|productID=%s'); +$lang->projectQa->subMenu->testtask->report = array('link' => '报告|testreport|browse|productID=%s'); + $lang->scrum = new stdclass(); $lang->scrum->setMenu = new stdclass(); $lang->scrum->setMenu->view = array('link' => '概况|project|view|project={PROJECT}', 'alias' => 'edit'); diff --git a/module/common/model.php b/module/common/model.php index c596284c5e..801d0503d3 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -782,8 +782,9 @@ class commonModel extends model } if($group == 'execution') { - if(in_array($methodName, array('grouptask', 'tree'))) $lang->execution->menu = self::processMenuVars($lang->execution->groupMenu); - if(in_array($methodName, array('view', 'manageproducts', 'team', 'whitelist'))) $lang->execution->menu = self::processMenuVars($lang->execution->settingMenu); + if(in_array($methodName, array('grouptask', 'tree'))) $lang->execution->menu = $lang->execution->viewMenu; + if(in_array($methodName, array('qa', 'bug', 'testtask', 'testcase', 'testreport'))) $lang->execution->menu = $lang->execution->qaMenu; + if(in_array($methodName, array('view', 'manageproducts', 'team', 'whitelist', 'edit', 'managemembers', 'addwhitelist'))) $lang->execution->menu = self::processMenuVars($lang->execution->settingMenu); } if(strpos('qa|bug|testcase|testreport|testtask', $moduleName) !== false and $group == 'project') { diff --git a/module/execution/control.php b/module/execution/control.php index 80a9d7810f..0962089abf 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -59,6 +59,7 @@ class execution extends control */ public function index($locate = 'auto', $executionID = 0) { + $this->lang->execution->menu = $this->lang->execution->homeMenu; if($locate == 'yes') $this->locate($this->createLink('execution', 'task')); $this->commonAction($executionID); @@ -265,9 +266,7 @@ class execution extends control */ public function grouptask($executionID = 0, $groupBy = 'story', $filter = '') { - $moduleIndex = array_search('execution', $this->lang->noMenuModule); - if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); - + $this->showModuleMenu(); $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -819,6 +818,21 @@ class execution extends control $this->display(); } + /** + * Exectuion qa dashboard. + * + * @param int $executionID + * @access public + * @return void + */ + public function qa($executionID = 0) + { + $this->showModuleMenu(); + $this->commonAction($executionID); + $this->view->title = $this->lang->execution->qa; + $this->display(); + } + /** * Browse bugs of a execution. * @@ -835,6 +849,8 @@ class execution extends control */ public function bug($executionID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $this->showModuleMenu(); + /* Load these two models. */ $this->loadModel('bug'); $this->loadModel('user'); @@ -893,6 +909,27 @@ class execution extends control $this->display(); } + /** + * Execution case list. + * + * @param int $executionID + * @access public + * @return void + */ + public function testcase($executionID = 0, $type = 'all', $param = 0, $productID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + $this->loadModel('testcase'); + $this->showModuleMenu(); + $this->commonAction($executionID); + + $this->view->title = $this->lang->execution->testcase; + $this->view->executionID = $executionID; + $this->view->productID = $productID; + $this->view->execution = $this->execution->getByID($executionID); + + $this->display(); + } + /** * Browse builds of a execution. * @@ -967,6 +1004,8 @@ class execution extends control */ public function testtask($executionID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $this->showModuleMenu(); + $this->loadModel('testtask'); /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true)); @@ -1260,6 +1299,8 @@ class execution extends control */ public function edit($executionID, $action = 'edit', $extra = '') { + $this->showModuleMenu(); + /* Load language files and get browseExecutionLink. */ $this->app->loadLang('program'); $this->app->loadLang('stage'); @@ -1652,8 +1693,7 @@ class execution extends control */ public function view($executionID) { - $moduleIndex = array_search('execution', $this->lang->noMenuModule); - if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + $this->showModuleMenu(); $execution = $this->execution->getById($executionID, true); if(empty($execution) || strpos('stage,sprint', $execution->type) === false) die(js::error($this->lang->notFound) . js::locate('back')); @@ -1768,8 +1808,7 @@ class execution extends control */ public function tree($executionID, $type = 'task') { - $moduleIndex = array_search('execution', $this->lang->noMenuModule); - if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + $this->showModuleMenu(); $this->execution->setMenu($this->executions, $executionID); $execution = $this->loadModel('execution')->getById($executionID); @@ -2088,6 +2127,8 @@ class execution extends control */ public function manageMembers($executionID = 0, $team2Import = 0, $dept = 0) { + $this->showModuleMenu(); + if(!empty($_POST)) { $this->execution->manageMembers($executionID); @@ -2597,6 +2638,8 @@ class execution extends control */ public function all($status = 'all', $projectID = 0, $from = 'execution', $orderBy = 'id_desc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1) { + $this->lang->execution->menu = $this->lang->execution->homeMenu; + $this->app->loadLang('my'); $this->app->loadLang('product'); $this->app->loadLang('programplan'); @@ -2662,6 +2705,8 @@ class execution extends control */ public function addWhitelist($executionID = 0, $deptID = 0) { + $this->showModuleMenu(); + /* use first execution if executionID does not exist. */ if(!isset($this->executions[$executionID])) $executionID = key($this->executions); @@ -2935,4 +2980,16 @@ class execution extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->display(); } + + /** + * Show module menu for some module. + * + * @access public + * @return void + */ + public function showModuleMenu() + { + $moduleIndex = array_search('execution', $this->lang->noMenuModule); + if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + } } diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index f67c7dbf5c..3fa4db04ca 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -43,7 +43,6 @@ $lang->execution->PO = 'PO'; $lang->execution->PM = 'PM'; $lang->execution->QD = 'QS Manager'; $lang->execution->RD = 'Release Manager'; -$lang->execution->qa = 'Test'; $lang->execution->release = 'Release'; $lang->execution->acl = 'Zugriffskontrolle'; $lang->execution->teamname = 'Team Name'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 7236582339..9ea94d3389 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -43,7 +43,6 @@ $lang->execution->PO = "{$lang->executionCommon} Owner"; $lang->execution->PM = "{$lang->executionCommon} Manager"; $lang->execution->QD = 'Test Manager'; $lang->execution->RD = 'Release Manager'; -$lang->execution->qa = 'Test'; $lang->execution->release = 'Release'; $lang->execution->acl = 'Access Control'; $lang->execution->teamname = 'Team Name'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 8e7d0a4805..915d1c7ac6 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -42,7 +42,6 @@ $lang->execution->PO = "Propriétaire {$lang->executionCommon}"; $lang->execution->PM = "Directeur {$lang->executionCommon}"; $lang->execution->QD = 'Quality Manager'; $lang->execution->RD = 'Release Manager'; -$lang->execution->qa = 'QA'; $lang->execution->release = 'Release'; $lang->execution->acl = "Contrôle d'accès"; $lang->execution->teamname = "Nom de l'équipe"; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 1113bf5973..d37ba1c443 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -47,7 +47,6 @@ $lang->execution->PO = $lang->productCommon . '负责人'; $lang->execution->PM = $lang->executionCommon . '负责人'; $lang->execution->QD = '测试负责人'; $lang->execution->RD = '发布负责人'; -$lang->execution->qa = '测试'; $lang->execution->release = '发布'; $lang->execution->acl = '访问控制'; $lang->execution->teamname = '团队名称'; @@ -152,6 +151,7 @@ $lang->execution->task = '任务列表'; $lang->execution->groupTask = '分组浏览任务'; $lang->execution->story = "{$lang->SRCommon}列表"; $lang->execution->bug = 'Bug列表'; +$lang->execution->testcase = '用例列表'; $lang->execution->dynamic = '动态'; $lang->execution->latestDynamic = '最新动态'; $lang->execution->build = '所有版本'; diff --git a/module/execution/model.php b/module/execution/model.php index 184905b82e..bf1b09a299 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -62,8 +62,6 @@ class executionModel extends model */ public function setMenu($executions, $executionID, $buildID = 0, $extra = '') { - if($this->app->rawMethod != 'index' and $this->app->rawMethod != 'all') $this->lang->execution->menu = $this->lang->execution->viewMenu; - if(empty($executions)) { $project = $this->loadModel('project')->getByID($this->session->PRJ); @@ -115,8 +113,8 @@ class executionModel extends model if($methodName == 'all') $label = $this->lang->execution->allExecutions; if($methodName == 'create' and $moduleName == 'execution') $label = $this->lang->execution->create; - //$executionIndex = $this->select($executions, $executionID, null, $moduleName, $methodName, $extra); - //if($this->config->systemMode == 'new') $this->lang->modulePageNav = $executionIndex; + foreach($this->lang->execution->viewMenu as $key => $menu) common::setMenuVars($this->lang->execution->viewMenu, $key, $executionID); + foreach($this->lang->execution->qaMenu as $key => $menu) common::setMenuVars($this->lang->execution->qaMenu, $key, $executionID); foreach($this->lang->execution->menu as $key => $menu) { diff --git a/module/execution/view/qa.html.php b/module/execution/view/qa.html.php new file mode 100644 index 0000000000..679560fa37 --- /dev/null +++ b/module/execution/view/qa.html.php @@ -0,0 +1,2 @@ + + diff --git a/module/execution/view/testcase.html.php b/module/execution/view/testcase.html.php new file mode 100644 index 0000000000..3a2c3a26b1 --- /dev/null +++ b/module/execution/view/testcase.html.php @@ -0,0 +1,48 @@ + +
+ testcase->noCase;?> + + id", '', '', '', true), " " . $lang->testcase->create, '', "class='btn btn-info'");?> + +
+