diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 19cb9e06e6..ed73eab0e0 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -178,7 +178,7 @@ $lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|inde $lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|projectID=%s"); $lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory', 'alias' => 'story,track'); $lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s", 'subModule' => 'doc'); -$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|qa|projectID=%s", 'subModule' => 'testcase,testtask,bug', 'alias' => 'bug,testtask,testcase'); +$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|qa|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); $lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); $lang->scrum->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); @@ -198,10 +198,12 @@ $lang->scrum->menuOrder[48] = 'dynamic'; $lang->scrum->menuOrder[50] = 'settings'; $lang->scrum->menu->qa['subMenu'] = new stdclass(); -$lang->scrum->menu->qa['subMenu']->index = array('link' => "$lang->dashboard|project|qa|projectID=%s"); -$lang->scrum->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|project|bug|projectID=%s", 'subModule' => 'bug'); -$lang->scrum->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|project|testcase|projectID=%s", 'subModule' => 'testsuite,testcase,caselib,tree'); -$lang->scrum->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|project|testtask|projectID=%s", 'subModule' => 'testtask', 'class' => 'dropdown dropdown-hover'); +$lang->scrum->menu->qa['subMenu']->index = array('link' => "$lang->dashboard|project|qa|projectID=%s"); +$lang->scrum->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|project|bug|projectID=%s", 'subModule' => 'bug'); +$lang->scrum->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|project|testcase|projectID=%s", 'subModule' => 'testsuite,testcase,caselib,tree'); +$lang->scrum->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|project|testtask|projectID=%s", 'subModule' => 'testtask', 'class' => 'dropdown dropdown-hover'); +$lang->scrum->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|project|testtask|projectID=%s", 'subModule' => 'testtask', 'class' => 'dropdown dropdown-hover'); +$lang->scrum->menu->qa['subMenu']->testreport = array('link' => "{$lang->testreport->common}|project|testreport|projectID=%s", 'subModule' => 'testreport'); $lang->scrum->menu->settings['subMenu'] = new stdclass(); $lang->scrum->menu->settings['subMenu']->view = array('link' => "$lang->overview|project|view|project=%s", 'alias' => 'edit'); diff --git a/module/execution/control.php b/module/execution/control.php index 8f690b67c3..7f3f720f4e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -947,10 +947,11 @@ class execution extends control } /** - * Execution case list. + * List of test reports for the execution. * * @param int $executionID - * @param string $type + * @param string $objectType project|execution|product + * @param string $extra * @param string $orderBy * @param int $recTotal * @param int $recPerPage diff --git a/module/execution/view/testtask.html.php b/module/execution/view/testtask.html.php index 6c79854f26..bc1c6c43c6 100644 --- a/module/execution/view/testtask.html.php +++ b/module/execution/view/testtask.html.php @@ -29,7 +29,7 @@
- project", " " . $lang->testtask->create, '', "class='btn btn-primary'");?> + project", " " . $lang->testtask->create, '', "class='btn btn-primary'");?>
diff --git a/module/project/control.php b/module/project/control.php index ee3e2d3ed7..36d1c16483 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -769,6 +769,24 @@ class project extends control echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID"); } + /** + * List of test reports for the project. + * + * @param int $projectID + * @param string $objectType project|execution|product + * @param string $extra + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function testreport($projectID = 0, $objectType = 'project', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + echo $this->fetch('testreport', 'browse', "objectID=$projectID&objectType=$objectType&extra=$extra&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); + } + /** * Project test task list. * @@ -783,9 +801,11 @@ class project extends control public function testtask($projectID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->loadModel('testtask'); + $this->app->loadLang('testreport'); /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true), 'qa'); + $this->session->set('buildList', $this->app->getURI(true), 'execution'); $this->project->setMenu($projectID); diff --git a/module/project/css/testtask.css b/module/project/css/testtask.css new file mode 100644 index 0000000000..7d167eb581 --- /dev/null +++ b/module/project/css/testtask.css @@ -0,0 +1,7 @@ +.table-group-btns {width: 200px;} +.table-footer, +.table-grouped {box-shadow: none !important;} +.table-footer {margin-left: 205px; margin-top: 10px;} +.table-grouped > thead>tr>th.c-id, +.table-grouped > tbody>tr>td.c-id {padding-left: 15px;} +.table-grouped > tbody>tr>td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php index cf017b5960..382fab123b 100644 --- a/module/project/view/testtask.html.php +++ b/module/project/view/testtask.html.php @@ -29,7 +29,6 @@
- " . $lang->testtask->create, '', "class='btn btn-primary'");?>
@@ -91,15 +90,14 @@ id", $task, 'list', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); - common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag'); - common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); - if(common::hasPriv('testtask', 'delete', $task)) + common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); + common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); + if(common::hasPriv('execution', 'testreport')) { - $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"taskList\", confirmDelete)", '', '', "class='btn' title='{$lang->testtask->delete}'"); + echo html::a($this->createLink('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="qa"'); } + common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); + common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'list', 'trash', 'hiddenwin'); } ?> diff --git a/module/testreport/control.php b/module/testreport/control.php index 85b0f5e7fb..b5a55141f1 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -165,13 +165,6 @@ class testreport extends control die(js::locate(inlink('view', "reportID=$reportID"), 'parent')); } - /* - if($this->app->openApp == 'execution') - { - $this->loadModel('execution')->setMenu($); - } - */ - if($objectType == 'testtask') { if(empty($objectID) and $extra) $productID = $extra; @@ -352,12 +345,20 @@ class testreport extends control $this->view->position[] = html::a($browseLink, $product->name); $this->view->position[] = $this->lang->testreport->edit; } - elseif($this->app->openApp == 'execution') + elseif($this->app->openApp == 'execution' or $this->app->openApp == 'project') { - $executionID = $this->commonAction($report->execution, 'execution'); - if($executionID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($this->app->openApp == 'execution') + { + $objectID = $this->commonAction($report->execution, 'execution'); + if($objectID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + } + else + { + $objectID = $this->commonAction($report->project, 'project'); + if($objectID != $report->project) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + } - $browseLink = inlink('browse', "objectID=$executionID&objectType=execution"); + $browseLink = inlink('browse', "objectID=$objectID&objectType=execution"); $this->view->position[] = html::a($browseLink, $execution->name); $this->view->position[] = $this->lang->testreport->edit; } @@ -458,12 +459,20 @@ class testreport extends control $browseLink = inlink('browse', "objectID=$productID&objectType=product"); $this->view->position[] = html::a($browseLink, $product->name); } - elseif($this->app->openApp == 'execution') + elseif($this->app->openApp == 'execution' or $this->app->openApp == 'project') { - $executionID = $this->commonAction($report->execution, 'execution'); - if($executionID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($this->app->openApp == 'execution') + { + $objectID = $this->commonAction($report->execution, 'execution'); + if($objectID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + } + else + { + $objectID = $this->commonAction($report->project, 'project'); + if($objectID != $report->project) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + } - $browseLink = inlink('browse', "objectID=$executionID&objectType=execution"); + $browseLink = inlink('browse', "objectID=$objectID&objectType=execution"); $this->view->position[] = html::a($browseLink, $execution->name); } diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php index 468fbae256..bf675f5f87 100644 --- a/module/testreport/lang/zh-cn.php +++ b/module/testreport/lang/zh-cn.php @@ -65,7 +65,7 @@ $lang->testreport->buildSummary = '共测试了%s个版本。 $lang->testreport->confirmDelete = '是否删除该报告?'; $lang->testreport->moreNotice = '更多功能可以参考禅道扩展机制进行扩展,也可以联系我们进行定制。'; $lang->testreport->exportNotice = "由禅道项目管理软件导出"; -$lang->testreport->noReport = "暂无报告,请到测试单下生成测试报告。"; +$lang->testreport->noReport = "暂无报告,请选择测试单生成测试报告。"; $lang->testreport->foundBugTip = "影响版本在测试轮次内,并且创建时间在测试时间范围内产生的Bug数。"; $lang->testreport->legacyBugTip = "Bug状态是激活,或Bug的解决时间在测试结束时间之后。"; $lang->testreport->fromCaseBugTip = "测试时间范围内,用例执行失败后创建的Bug。"; diff --git a/module/testreport/model.php b/module/testreport/model.php index 2f024b961d..1bd97273b3 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -146,9 +146,10 @@ class testreportModel extends model public function getList($objectID, $objectType, $extra = '', $orderBy = 'id_desc', $pager = null) { $objectID = (int)$objectID; - return $this->dao->select('*')->from(TABLE_TESTREPORT)->where('deleted')->eq(0) + return $this->dao->select('*')->from(TABLE_TESTREPORT) + ->where('deleted')->eq(0) ->beginIF($objectType == 'execution')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('execution')->fi() - ->beginIF($objectType == 'project')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('project')->fi() + ->beginIF($objectType == 'project')->andWhere('project')->eq($objectID)->andWhere('objectType')->eq('execution')->fi() ->beginIF($objectType == 'product' and $extra)->andWhere('objectID')->eq((int)$extra)->andWhere('objectType')->eq('testtask')->fi() ->beginIF($objectType == 'product' and empty($extra))->andWhere('product')->eq($objectID)->fi() ->orderBy($orderBy) diff --git a/module/testtask/model.php b/module/testtask/model.php index 85bdc8d3a7..48bc6ce960 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -20,11 +20,17 @@ class testtaskModel extends model * @access public * @return void */ - function create($projectID) + function create($projectID = 0) { + if($this->post->execution) + { + $execution = $this->loadModel('execution')->getByID($this->post->execution); + $projectID = $execution->project; + } + $task = fixer::input('post') ->setDefault('build', '') - ->setIF($this->config->systemMode == 'new' and $this->app->openApp != 'qa', 'project', $projectID) + ->setIF($this->config->systemMode == 'new', 'project', $projectID) ->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') ->remove('uid,contactListMenu')