diff --git a/module/testreport/control.php b/module/testreport/control.php index ef44a8e118..37cb35f49c 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -309,7 +309,8 @@ class testreport extends control $this->session->set('notHead', false); $css = ''; $js = ''; - $content = "\n\n\n\n{$report->title}\n$css\n$js\n\n\n

{$report->title}

\n$output"; + $exportNotice = "

" . $this->lang->testreport->exportNotice . '

'; + $content = "\n\n\n\n{$report->title}\n$css\n$js\n\n\n

{$report->title}

\n$output\n$exportNotice"; $this->fetch('file', 'sendDownHeader', array('fileName' => $data->fileName, 'fileType' => $data->fileType, 'content' =>$content)); } $this->view->customExport = false; diff --git a/module/testreport/css/common.css b/module/testreport/css/common.css index 72b1838290..9292beb5a8 100644 --- a/module/testreport/css/common.css +++ b/module/testreport/css/common.css @@ -1 +1,3 @@ .none-data{padding:8px !important;} +.main #stories{margin-bottom:10px} +.main .table-report{border:0px;} diff --git a/module/testreport/css/export.css b/module/testreport/css/export.css index 6fe3f2289d..47a973d389 100644 --- a/module/testreport/css/export.css +++ b/module/testreport/css/export.css @@ -1,5 +1,5 @@ body{font-size:14px}h1{font-size:16px;text-align:center} -.w-100px{width:100px}.w-p50{width:50%}.w-p60{width:60%}.w-id{width:70px}.w-pri{width:40px}.w-user{width:80px}.w-80px{width:80px}.w-70px{width:70px}.w-hour[width:57px].w-status{width:60px}.w-130px{width:130px;}.w-type{width:80px}.w-150px{width:150px;} +.w-100px{width:100px}.w-p50{width:50%}.w-p70{width:70%}.w-id{width:70px}.w-pri{width:40px}.w-user{width:80px}.w-80px{width:80px}.w-70px{width:70px}.w-hour[width:57px].w-status{width:60px}.w-130px{width:130px;}.w-type{width:80px}.w-150px{width:150px;} .text-center{text-align:center}.text-top{vertical-align:top;}.text-left{text-align:left}.text-right{text-align:right;} .table{width:100%;margin-bottom:5px;border:1px solid #ddd;border-collapse:collapse;border-spacing:0;} .table caption{padding:8px 20px;border:1px solid #DDD;border-bottom:0;background:#fafafa;text-align:left}.table td, .table th{border-bottom:1px solid #ddd;padding:5px;} diff --git a/module/testreport/css/view.css b/module/testreport/css/view.css index 9306856b3a..3ac466dc33 100644 --- a/module/testreport/css/view.css +++ b/module/testreport/css/view.css @@ -1,5 +1,4 @@ .main{padding:0px !important;} .main .nav-tabs{padding-left:20px; padding-top:10px;} -.main .tab-content{border:0px; padding:0px;} -.tab-content #builds, .tab-content #cases,.tab-content #stories,.tab-content #bugs,.tab-content #legacyBugs{border:0px;} -.tab-content #builds tr:last-child td, .tab-content #cases tr:last-child td,.tab-content #stories tr:last-child td,.tab-content #bugs tr:last-child td,.tab-content #legacyBugs tr:last-child td{border-bottom:0px;} +.main .tab-content{border:0px;} +.tab-content #builds tr:last-child td, .tab-content #cases tr:last-child td,.tab-content #bugs tr:last-child td,.tab-content #legacyBugs tr:last-child td{border-bottom:0px;} diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php index fc79a22f75..78f03a4656 100644 --- a/module/testreport/lang/zh-cn.php +++ b/module/testreport/lang/zh-cn.php @@ -32,16 +32,18 @@ $lang->testreport->legendLegacyBugs = '遗留的Bug'; $lang->testreport->legendReport = '报表'; $lang->testreport->legendMore = '更多功能'; -$lang->testreport->bugSeverityGroups = '产生Bug严重级别分布'; -$lang->testreport->bugStatusGroups = '产生Bug状态分布'; -$lang->testreport->bugOpenedByGroups = '产生Bug创建者分布'; -$lang->testreport->bugResolvedByGroups = '产生Bug解决者分布'; -$lang->testreport->bugResolutionGroups = '产生Bug解决方案分布'; -$lang->testreport->bugModuleGroups = '产生Bug模块分布'; +$lang->testreport->bugSeverityGroups = 'Bug严重级别分布'; +$lang->testreport->bugStatusGroups = 'Bug状态分布'; +$lang->testreport->bugOpenedByGroups = 'Bug创建者分布'; +$lang->testreport->bugResolvedByGroups = 'Bug解决者分布'; +$lang->testreport->bugResolutionGroups = 'Bug解决方案分布'; +$lang->testreport->bugModuleGroups = 'Bug模块分布'; $lang->testreport->legacyBugs = '遗留的Bug'; $lang->testreport->bugConfirmedRate = '有效Bug率 (确认的Bug / 测试创建的Bug)'; $lang->testreport->bugCreateByCaseRate = '用例发现Bug率 (用例创建的Bug / 时间区间中新增的Bug)'; $lang->testreport->caseSummary = '共有%s个用例,共执行%s个用例,产生了%s个结果,失败的用例有%s个。'; -$lang->testreport->bugSummary = '共产生%s个Bug,有效Bug率(确认的Bug / 产生的Bug):%s,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):%s'; +$lang->testreport->buildSummary = '共测试了%s个版本。'; +$lang->testreport->bugSummary = '共产生%s个Bug,遗留%s个Bug。有效Bug率(确认的Bug / 产生的Bug):%s,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):%s'; $lang->testreport->confirmDelete = '是否删除该报告?'; +$lang->testreport->exportNotice = "由禅道项目管理软件导出"; diff --git a/module/testreport/model.php b/module/testreport/model.php index ff543afba8..982d9317e6 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -176,15 +176,19 @@ class testreportModel extends model */ public function getResultSummary($tasks, $cases) { - $results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->in(array_keys($tasks))->andWhere('`case`')->in(array_keys($cases))->fetchAll(); + $results = $this->dao->select('t1.*')->from(TABLE_TESTRESULT)->alias('t1') + ->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.run=t2.id') + ->where('t2.task')->in(array_keys($tasks)) + ->andWhere('t1.`case`')->in(array_keys($cases)) + ->fetchAll(); $failResults = array(); $runCasesNum = array(); foreach($results as $result) { - $runCases[$result->case] = $result->case; + $runCasesNum[$result->case] = $result->case; if($result->caseResult == 'fail') $failResults[$result->case] = $result->case; } - return sprintf($this->lang->testreport->caseSummary, count($cases), count($results), count($runCasesNum), count($failResults)); + return sprintf($this->lang->testreport->caseSummary, count($cases), count($runCasesNum), count($results), count($failResults)); } /** diff --git a/module/testreport/view/blockbugreport.html.php b/module/testreport/view/blockbugreport.html.php index e3b94b7980..ebaa0219ec 100644 --- a/module/testreport/view/blockbugreport.html.php +++ b/module/testreport/view/blockbugreport.html.php @@ -3,21 +3,26 @@ $infoValue):?> ';?> - + - - +
testreport->$infoKey?>
- + + + - + + + + + + + +
testreport->none;?>
+
testreport->$infoKey?>
+ testreport->none;?> +
+
+
testreport->$infoKey?>
- +
diff --git a/module/testreport/view/create.html.php b/module/testreport/view/create.html.php index f4295e92d5..08e43cd281 100644 --- a/module/testreport/view/create.html.php +++ b/module/testreport/view/create.html.php @@ -74,12 +74,20 @@
' . $storySummary . '

'; - echo '

' . $caseSummary . '

'; - echo '

' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '

'; + echo '

' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '

'; + echo '

' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '

'; unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); ?>
testreport->report?>
files?>fetch('file', 'buildform');?>
@@ -103,14 +111,6 @@ testreport->legendReport?>
-
- testreport->report?> - -
-
- files?> - fetch('file', 'buildform');?> -
diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php index 9b708ace62..4dd6945347 100644 --- a/module/testreport/view/view.html.php +++ b/module/testreport/view/view.html.php @@ -79,8 +79,8 @@ ' . $storySummary . '

'; - echo '

' . $caseSummary . '

'; - echo '

' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '

'; + echo '

' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '

'; + echo '

' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '

'; unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); ?>