From 107039b87bf20cdf57ade051afe9d2fb3751eb9a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 10 Mar 2017 09:58:49 +0800 Subject: [PATCH] * code for 2899. --- module/testreport/control.php | 6 +- module/testreport/lang/zh-cn.php | 24 ++- module/testreport/model.php | 16 +- module/testreport/view/blockbuginfo.html.php | 191 +++++++++--------- module/testreport/view/blockbugs.html.php | 6 +- module/testreport/view/blockbuilds.html.php | 53 +++-- module/testreport/view/blockcases.html.php | 75 ++++--- .../testreport/view/blocklegacybugs.html.php | 6 +- module/testreport/view/blockstories.html.php | 2 +- module/testreport/view/create.html.php | 46 +++-- module/testreport/view/view.html.php | 84 +++++--- 11 files changed, 270 insertions(+), 239 deletions(-) diff --git a/module/testreport/control.php b/module/testreport/control.php index 94a227ad61..6a8eaac2a0 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -320,16 +320,18 @@ class testreport extends control $this->session->set('notHead', false); $style = << -body{font-size:14px}h1{font-size:16px} +body{font-size:14px}h1{font-size:16px;text-align:center} .w-100px{width:100px}.w-p50{width:50%}.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;}.table td, .table th{border-bottom:1px solid #ddd;padding:5px;} +.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;} +.table>thead>tr>th{text-align:center;vertical-align:middle;background-color:#f1f1f1;border-bottom:1px solid #ddd;} .table-form{border: none;}.table-form>tbody>tr>th,.table-form>tbody>tr>td{border-bottom:none;}.table-form>tbody>tr>th{text-align:right;} .input-group{width:100%;}.input-group{position:relative;display:table;border-collapse:separate;} .input-group-addon:first-child {border-right:0;} .input-group-addon{background-color:#f5f5f5;padding:6px 12px;font-size:13px;font-weight:400;line-height:1;color:#222;text-align:center;background-color:#e5e5e5;border:1px solid #ccc;border-radius:0;display:table-cell;} .input-group-addon:first-child{border-top-right-radius:0;border-bottom-right-radius:0;} +fieldset{margin-bottom:15px;border:1px solid #e5e5e5;padding:10px 15px 15px;}fieldset>legend{width:auto;margin:0 0 0 -5px;font-weight:bold;border-bottom:none;padding:0 5px;display:block;} EOD; $content = "\n\n\n\n{$report->title}\n$style\n\n

{$report->title}

\n$output"; diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php index 0f776fee4f..2545eec102 100644 --- a/module/testreport/lang/zh-cn.php +++ b/module/testreport/lang/zh-cn.php @@ -15,7 +15,7 @@ $lang->testreport->builds = '版本信息'; $lang->testreport->goal = '项目目标'; $lang->testreport->coverage = '需求覆盖率'; $lang->testreport->cases = '用例'; -$lang->testreport->bugInfo = '缺陷信息'; +$lang->testreport->bugInfo = '缺陷分布'; $lang->testreport->report = '总结'; $lang->testreport->legacyBugs = '遗留的Bug'; $lang->testreport->createdDate = '创建时间'; @@ -24,15 +24,21 @@ $lang->testreport->value = '值'; $lang->testreport->none = '无'; $lang->testreport->all = '所有报告'; -$lang->testreport->bugSeverityGroups = '严重级别分布'; -$lang->testreport->bugStatusGroups = '状态分布'; -$lang->testreport->bugOpenedByGroups = '创建者分布'; -$lang->testreport->bugResolvedByGroups = '解决者分布'; -$lang->testreport->bugResolutionGroups = '解决方案分布'; -$lang->testreport->bugModuleGroups = '模块分布'; +$lang->testreport->legendBasic = '基本信息'; +$lang->testreport->legendStoryAndBug = '测试的需求和Bug'; +$lang->testreport->legendBuild = '版本信息'; +$lang->testreport->legendCase = '执行的用例的信息'; +$lang->testreport->legendBug = '缺陷信息'; + +$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率'; -$lang->testreport->bugCreateByCaseRate = '用例发现Bug率'; +$lang->testreport->bugConfirmedRate = '有效Bug率 (确认的Bug / 测试创建的Bug)'; +$lang->testreport->bugCreateByCaseRate = '用例发现Bug率 (用例创建的Bug / 时间区间中新增的Bug)'; $lang->testreport->caseSummary = '共有%s个用例,共执行%s个用例,产生了%s个结果,失败的用例有%s个'; $lang->testreport->confirmDelete = '是否删除该报告?'; diff --git a/module/testreport/model.php b/module/testreport/model.php index 74667892b4..852b7515a9 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -112,9 +112,9 @@ class testreportModel extends model */ public function getBugInfo($tasks, $productIdList, $begin, $end, $builds) { - $bugsByTask = $this->dao->select('*')->from(TABLE_BUG)->where('testtask')->in(array_keys($tasks))->andWhere('deleted')->eq(0)->fetchAll(); + $bugsByTask = $this->dao->select('*')->from(TABLE_BUG)->where('testtask')->in(array_keys($tasks))->andWhere('deleted')->eq(0)->fetchAll(); $severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = array(); - $confirmedNum = 0; + $confirmedNum = 0; foreach($bugsByTask as $bug) { $severityGroups[$bug->severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1; @@ -126,15 +126,9 @@ class testreportModel extends model if($bug->confirmed) $confirmedNum ++; } - $newBugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('product')->in($productIdList) - ->andWhere('openedDate')->ge($begin) - ->andWhere('openedDate')->le("$end 23:59:59") - ->andWhere('deleted')->eq(0) - ->fetchAll(); - - $legacyBugs = array(); - $byCaseNum = 0; + $newBugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->in($productIdList)->andWhere('openedDate')->ge($begin)->andWhere('openedDate')->le("$end 23:59:59")->andWhere('deleted')->eq(0)->fetchAll(); + $legacyBugs = array(); + $byCaseNum = 0; $buildIdList = array_keys($builds) + array('trunk' => 'trunk'); foreach($newBugs as $bug) { diff --git a/module/testreport/view/blockbuginfo.html.php b/module/testreport/view/blockbuginfo.html.php index 9c0139afdb..31d3213673 100644 --- a/module/testreport/view/blockbuginfo.html.php +++ b/module/testreport/view/blockbuginfo.html.php @@ -1,110 +1,109 @@ - testreport->bugInfo?> - + testreport->bugInfo?> +
testreport->bugConfirmedRate?> testreport->bugCreateByCaseRate?>
- - - - - - - +
testreport->bugSeverityGroups?>
- - + + + - bug->severityList as $severityKey => $severityValue):?> - - + + + - -
bug->severity?>testreport->value?> + + + + + + + bug->severityList as $severityKey => $severityValue):?> + + + + + +
testreport->bugSeverityGroups?>
bug->severity?>testreport->value?>
+
+ + + + + + + bug->statusList as $statusKey => $statusValue):?> + + + + + + +
testreport->bugStatusGroups?>
bug->status?>testreport->value?>
+
+ + + + + + + bug->resolutionList as $resolutionKey => $resolutionValue):?> + + + + + +
testreport->bugResolutionGroups?>
bug->resolution?>testreport->value?>
+
+ + + + + + + $num):?> + + + + + +
testreport->bugOpenedByGroups?>
bug->openedBy?>testreport->value?>
+
+ + + + + + + + $num):?> + + + + + +
testreport->bugModuleGroups?>
bug->module?>testreport->value?>
+
+ + + + + + + $num):?> + + + + + +
testreport->bugResolvedByGroups?>
bug->resolvedBy?>testreport->value?>
+
- - - - - - - - - bug->statusList as $statusKey => $statusValue):?> - - - - - - -
testreport->bugStatusGroups?>
bug->status?>testreport->value?>
- - - - - - - - - - - $num):?> - - - - - -
testreport->bugOpenedByGroups?>
bug->openedBy?>testreport->value?>
- - - - - - - - - $num):?> - - - - - -
testreport->bugResolvedByGroups?>
bug->resolvedBy?>testreport->value?>
- - - - - - - - - - - bug->resolutionList as $resolutionKey => $resolutionValue):?> - - - - - -
testreport->bugResolutionGroups?>
bug->resolution?>testreport->value?>
- - - - - - - - - - $num):?> - - - - -
testreport->bugModuleGroups?>
bug->module?>testreport->value?>
diff --git a/module/testreport/view/blockbugs.html.php b/module/testreport/view/blockbugs.html.php index 3b0746683b..e3c75c13f0 100644 --- a/module/testreport/view/blockbugs.html.php +++ b/module/testreport/view/blockbugs.html.php @@ -1,5 +1,5 @@ - testreport->bugs?> + testreport->bugs?> @@ -9,7 +9,8 @@ - + + @@ -21,6 +22,7 @@ + diff --git a/module/testreport/view/blockbuilds.html.php b/module/testreport/view/blockbuilds.html.php index d8dbd9e36d..ec7051ad3e 100644 --- a/module/testreport/view/blockbuilds.html.php +++ b/module/testreport/view/blockbuilds.html.php @@ -1,29 +1,24 @@ - - - - + +
priAB;?> bug->title;?> openedByAB;?>bug->resolvedBy;?>bug->resolvedBy;?>bug->resolvedDate;?> statusAB;?>
title?> openedBy);?> resolvedBy);?>resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?> bug->statusList, $bug->status);?>
testreport->builds?> - - - - - - - - - - - - - - - - - - - - -
build->id;?> build->name;?>build->builder;?>build->date;?>
id . html::hidden('builds[]', $build->id)?>name?>builder);?>date;?>
- - - -
+ + + + + + + + + + + + + + + + + + +
build->id;?> build->name;?>build->builder;?>build->date;?>
id . html::hidden('builds[]', $build->id)?>name?>builder);?>date;?>
+ + + diff --git a/module/testreport/view/blockcases.html.php b/module/testreport/view/blockcases.html.php index 1fa1f6e0e2..1ceb5b1bb5 100644 --- a/module/testreport/view/blockcases.html.php +++ b/module/testreport/view/blockcases.html.php @@ -1,40 +1,35 @@ - - testreport->cases?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
idAB;?> priAB;?> testcase->title;?> testcase->type;?> testtask->assignedTo;?> testtask->lastRunAccount;?> testtask->lastRunTime;?> testtask->lastRunResult;?>statusAB;?>
id . html::hidden('cases[]', $case->id)?>testcase->priList, $case->pri);?>title?>testcase->typeList, $case->type);?>assignedTo);?>lastRunner);?>lastRunDate, 2);?>testcase->resultList, $case->lastRunResult);?>testtask->statusList, $case->status);?>
- - testreport->none;?> - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
idAB;?> priAB;?> testcase->title;?> testcase->type;?> testtask->assignedTo;?> testtask->lastRunAccount;?> testtask->lastRunTime;?> testtask->lastRunResult;?>statusAB;?>
id . html::hidden('cases[]', $case->id)?>testcase->priList, $case->pri);?>title?>testcase->typeList, $case->type);?>assignedTo);?>lastRunner);?>lastRunDate, 2);?>testcase->resultList, $case->lastRunResult);?>testtask->statusList, $case->status);?>
+ +testreport->none;?> + diff --git a/module/testreport/view/blocklegacybugs.html.php b/module/testreport/view/blocklegacybugs.html.php index 13c48cf628..bc9fa651aa 100644 --- a/module/testreport/view/blocklegacybugs.html.php +++ b/module/testreport/view/blocklegacybugs.html.php @@ -1,5 +1,5 @@ - testreport->legacyBugs?> + testreport->legacyBugs?> @@ -9,7 +9,8 @@ - + + @@ -21,6 +22,7 @@ + diff --git a/module/testreport/view/blockstories.html.php b/module/testreport/view/blockstories.html.php index cfa221e908..afb7b2fa51 100644 --- a/module/testreport/view/blockstories.html.php +++ b/module/testreport/view/blockstories.html.php @@ -1,5 +1,5 @@ - +
priAB;?> bug->title;?> openedByAB;?>bug->resolvedBy;?>bug->resolvedBy;?>bug->resolvedDate;?> statusAB;?>
title?> openedBy);?> resolvedBy);?>resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?> bug->statusList, $bug->status);?>
testreport->stories?>testreport->stories?> diff --git a/module/testreport/view/create.html.php b/module/testreport/view/create.html.php index 4fac934af6..4a59f4abc6 100644 --- a/module/testreport/view/create.html.php +++ b/module/testreport/view/create.html.php @@ -31,7 +31,10 @@ ?> - +
+ +
+ testreport->legendBasic?>
@@ -65,25 +68,40 @@ +
testreport->startEnd?>testreport->goal?> desc?>
+ +
+ testreport->legendStoryAndBug?> + +
+
+
+ testreport->legendBuild?> +
+
+ testreport->legendCase?> +
+
+ testreport->legendBug?> + - - - - - - - - - - - - -
testreport->report?>
files?>fetch('file', 'buildform');?>
+
+ +
+ testreport->report?> + +
+
+ files?> + fetch('file', 'buildform');?> +
+
+ diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php index 2a14476da2..6adb111498 100644 --- a/module/testreport/view/view.html.php +++ b/module/testreport/view/view.html.php @@ -41,41 +41,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+ testreport->legendBasic?> +
testreport->startEnd?> begin . ' ~ ' . $report->end;?>
testreport->owner?>owner);?>
testreport->member?>members) as $member)echo zget($users, $member) . '   ';?>
testreport->goal?>desc?>
testreport->report?>report;?>
+ + + + + + + + + + + + + + + + + +
testreport->startEnd?> begin . ' ~ ' . $report->end;?>
testreport->owner?>owner);?>
testreport->member?>members) as $member)echo zget($users, $member) . '   ';?>
testreport->goal?>desc?>
+ +
+ testreport->legendStoryAndBug?> + + + +
+
+
+ testreport->legendBuild?> + +
+
+ testreport->legendCase?> + +
+
+ testreport->legendBug?> + + + +
+
+
+ testreport->report?> +
report;?>
+
session->notHead):?> - - files?> - fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'false'));?> - + fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'true'));?> - + session->notHead):?>