* Finish task #38176.

This commit is contained in:
tianshujie98
2021-05-21 11:00:32 +08:00
parent daa23b66af
commit 301d4371b0
12 changed files with 239 additions and 3 deletions
+8
View File
@@ -49,6 +49,7 @@ $lang->testreport->legendLegacyBugs = 'Legacy Bugs';
$lang->testreport->legendReport = 'Bericht';
$lang->testreport->legendComment = 'Summe';
$lang->testreport->legendMore = 'Mehr';
$lang->testreport->date = 'Date';
$lang->testreport->bugSeverityGroups = 'Nach Dringlichkeit';
$lang->testreport->bugTypeGroups = 'Nach Typ';
@@ -57,10 +58,17 @@ $lang->testreport->bugOpenedByGroups = 'Nach Ersteller';
$lang->testreport->bugResolvedByGroups = 'Nach Löser';
$lang->testreport->bugResolutionGroups = 'Nach Lösung';
$lang->testreport->bugModuleGroups = 'Nach Modul';
$lang->testreport->bugStageGroups = 'Bug importance stage distribution';
$lang->testreport->bugHandleGroups = 'Distribution of daily bug processing';
$lang->testreport->legacyBugs = 'Legacy Bugs';
$lang->testreport->bugConfirmedRate = 'Bestätigte Bugs Rate (Lösung ist gelöst oder verschoben / Status ist gelöst oder Geschlossen)';
$lang->testreport->bugCreateByCaseRate = 'Bug in Fall Rate (Bugs erstellt in Fall / Neu hinzugefügte Bugs)';
$lang->testreport->bugStageList = array();
$lang->testreport->bugStageList['generated'] = 'Generated Bugs';
$lang->testreport->bugStageList['legacy'] = 'Legacy Bugs';
$lang->testreport->bugStageList['resolved'] = 'Resolved Bugs';
$lang->testreport->caseSummary = ' <strong>%s</strong> Fälle in Summe : <strong>%s</strong> ausgeführt, <strong>%s</strong> Ergebnisse, <strong>%s</strong> fehlgeschlagen.';
$lang->testreport->buildSummary = 'Getsetetes <strong>%s</strong> Build.';
$lang->testreport->confirmDelete = 'Möchten Sie diesen Bericht löschen?';
+8
View File
@@ -49,6 +49,7 @@ $lang->testreport->legendLegacyBugs = 'Left Bugs';
$lang->testreport->legendReport = 'Report';
$lang->testreport->legendComment = 'Summary';
$lang->testreport->legendMore = 'More';
$lang->testreport->date = 'Date';
$lang->testreport->bugSeverityGroups = 'Bug Severity Distribution';
$lang->testreport->bugTypeGroups = 'Bug Type Distribution';
@@ -57,10 +58,17 @@ $lang->testreport->bugOpenedByGroups = 'Bug ReportedBy Distribution';
$lang->testreport->bugResolvedByGroups = 'Bug ResolvedBy Distribution';
$lang->testreport->bugResolutionGroups = 'Bug Resolution Distribution';
$lang->testreport->bugModuleGroups = 'Bug Module Distribution';
$lang->testreport->bugStageGroups = 'Bug importance stage distribution';
$lang->testreport->bugHandleGroups = 'Distribution of daily bug processing';
$lang->testreport->legacyBugs = 'Left Bugs';
$lang->testreport->bugConfirmedRate = 'Confirmed-Bug Rate (Resolution is fixed or postponed / status is resolved or closed)';
$lang->testreport->bugCreateByCaseRate = 'Bug-Reported-in-Case Rate (Bugs reported in cases / New added bugs)';
$lang->testreport->bugStageList = array();
$lang->testreport->bugStageList['generated'] = 'Generated Bugs';
$lang->testreport->bugStageList['legacy'] = 'Legacy Bugs';
$lang->testreport->bugStageList['resolved'] = 'Resolved Bugs';
$lang->testreport->caseSummary = 'Total <strong>%s</strong> cases. <strong>%s</strong> cases run. <strong>%s</strong> results generated. <strong>%s</strong> cases failed.';
$lang->testreport->buildSummary = 'Tested <strong>%s</strong> builds.';
$lang->testreport->confirmDelete = 'Do you want to delete this report?';
+8
View File
@@ -49,6 +49,7 @@ $lang->testreport->legendLegacyBugs = 'Bugs Restants';
$lang->testreport->legendReport = 'Rapport';
$lang->testreport->legendComment = 'Résumé';
$lang->testreport->legendMore = 'Plus...';
$lang->testreport->date = 'Date';
$lang->testreport->bugSeverityGroups = 'Distribution Sévérité de Bug';
$lang->testreport->bugTypeGroups = 'Distribution Type de Bug';
@@ -57,10 +58,17 @@ $lang->testreport->bugOpenedByGroups = 'Distribution Bug Signalé par';
$lang->testreport->bugResolvedByGroups = 'Distribution Bug Résolu par';
$lang->testreport->bugResolutionGroups = 'Distribution Bug Résolution';
$lang->testreport->bugModuleGroups = 'Distribution Bug Module';
$lang->testreport->bugStageGroups = 'Bug importance stage distribution';
$lang->testreport->bugHandleGroups = 'Distribution of daily bug processing';
$lang->testreport->legacyBugs = 'Bugs Restants';
$lang->testreport->bugConfirmedRate = 'Taux de Bugs confirmés (Résolution est corrigée ou reportée / statut est résolu ou fermé)';
$lang->testreport->bugCreateByCaseRate = 'Taux Bug Signalés par CasTest (Bugs signalés dans les CasTests / Nouveaux bugs)';
$lang->testreport->bugStageList = array();
$lang->testreport->bugStageList['generated'] = 'Generated Bugs';
$lang->testreport->bugStageList['legacy'] = 'Legacy Bugs';
$lang->testreport->bugStageList['resolved'] = 'Resolved Bugs';
$lang->testreport->caseSummary = 'Total <strong>%s</strong> casTests. <strong>%s</strong> casTests joués. <strong>%s</strong> résultats générés. <strong>%s</strong> casTests ont échoué.';
$lang->testreport->buildSummary = 'Testé <strong>%s</strong> builds.';
$lang->testreport->confirmDelete = 'Voulez-vous supprimer ce rapport ?';
+8
View File
@@ -49,6 +49,7 @@ $lang->testreport->legendLegacyBugs = 'Bug còn lại';
$lang->testreport->legendReport = 'Báo cáo';
$lang->testreport->legendComment = 'Tóm tắt';
$lang->testreport->legendMore = 'Thêm';
$lang->testreport->date = 'Date';
$lang->testreport->bugSeverityGroups = 'Phân chia mức độ Bug';
$lang->testreport->bugTypeGroups = 'Phân chia loại Bug';
@@ -57,10 +58,17 @@ $lang->testreport->bugOpenedByGroups = 'Phân chia người báo cáo Bug';
$lang->testreport->bugResolvedByGroups = 'Phân chia người giải quyết Bug';
$lang->testreport->bugResolutionGroups = 'Phân chia giải pháp Bug';
$lang->testreport->bugModuleGroups = 'Phân chia Module Bug';
$lang->testreport->bugStageGroups = 'Bug importance stage distribution';
$lang->testreport->bugHandleGroups = 'Distribution of daily bug processing';
$lang->testreport->legacyBugs = 'Bug còn lại';
$lang->testreport->bugConfirmedRate = 'Đánh giá Bug đã xác nhận (Nghị quyết đã ban hành hoặc tạm hoãn / tình trạng được giải quyết hoặc đóng)';
$lang->testreport->bugCreateByCaseRate = 'Đánh giá Bug được báo cáo trong Tình huống (Bug được báo cáo trong tình huống /Thêm mới Bugs)';
$lang->testreport->bugStageList = array();
$lang->testreport->bugStageList['generated'] = 'Generated Bugs';
$lang->testreport->bugStageList['legacy'] = 'Legacy Bugs';
$lang->testreport->bugStageList['resolved'] = 'Resolved Bugs';
$lang->testreport->caseSummary = 'Tổng <strong>%s</strong> tình huống. <strong>%s</strong> tình huống đang chạy. <strong>%s</strong> kết quả được tạo. <strong>%s</strong> cases thất bại';
$lang->testreport->buildSummary = 'Đã test <strong>%s</strong> bản dựng.';
$lang->testreport->confirmDelete = 'Bạn có muốn xóa báo cáo này?';
+8
View File
@@ -49,6 +49,7 @@ $lang->testreport->legendLegacyBugs = '遗留的Bug';
$lang->testreport->legendReport = '报表';
$lang->testreport->legendComment = '总结';
$lang->testreport->legendMore = '更多功能';
$lang->testreport->date = '日期';
$lang->testreport->bugSeverityGroups = 'Bug严重级别分布';
$lang->testreport->bugTypeGroups = 'Bug类型分布';
@@ -57,10 +58,17 @@ $lang->testreport->bugOpenedByGroups = 'Bug创建者分布';
$lang->testreport->bugResolvedByGroups = 'Bug解决者分布';
$lang->testreport->bugResolutionGroups = 'Bug解决方案分布';
$lang->testreport->bugModuleGroups = 'Bug模块分布';
$lang->testreport->bugStageGroups = 'Bug重要程度阶段分布';
$lang->testreport->bugHandleGroups = 'Bug每日处理情况分布';
$lang->testreport->legacyBugs = '遗留的Bug';
$lang->testreport->bugConfirmedRate = '有效Bug率 (方案为已解决或延期 / 状态为已解决或已关闭)';
$lang->testreport->bugCreateByCaseRate = '用例发现Bug率 (用例创建的Bug / 时间区间中新增的Bug)';
$lang->testreport->bugStageList = array();
$lang->testreport->bugStageList['generated'] = '产生的Bug';
$lang->testreport->bugStageList['legacy'] = '遗留的Bug';
$lang->testreport->bugStageList['resolved'] = '解决的Bug';
$lang->testreport->caseSummary = '共有<strong>%s</strong>个用例,共执行<strong>%s</strong>个用例,产生了<strong>%s</strong>个结果,失败的用例有<strong>%s</strong>个。';
$lang->testreport->buildSummary = '共测试了<strong>%s</strong>个版本。';
$lang->testreport->confirmDelete = '是否删除该报告?';
+58 -2
View File
@@ -138,23 +138,77 @@ class testreportModel extends model
public function getBugInfo($tasks, $productIdList, $begin, $end, $builds)
{
$generatedBugs = $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();
$resolvedBugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->in($productIdList)->andWhere('resolvedDate')->ge($begin)->andWhere('resolvedDate')->le("$end 23:59:59")->andWhere('deleted')->eq(0)->fetchAll();
$foundBugs = array();
$legacyBugs = array();
$byCaseNum = 0;
$buildIdList = array_keys($builds);
$taskIdList = array_keys($tasks);
$severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = $typeGroups = $stageGoups = $handleGroups = array();
/* Init stageGroups. */
foreach($this->lang->bug->priList as $priKey => $priValue)
{
$stageGroups[$priKey]['generated'] = 0;
$stageGroups[$priKey]['legacy'] = 0;
$stageGroups[$priKey]['resolved'] = 0;
}
/* Init handleGroups. */
$beginTimeStamp = strtotime($begin);
$endTimeStamp = strtotime($end);
for($i = $beginTimeStamp; $i <= $endTimeStamp; $i += 86400)
{
$date = date('m-d', $i);
$handleGroups['generated'][$date] = 0;
$handleGroups['legacy'][$date] = 0;
$handleGroups['resolved'][$date] = 0;
}
/* Get the resolved bug data. */
foreach($resolvedBugs as $bug)
{
if(array_intersect(explode(',', $bug->openedBuild), $buildIdList))
{
$resolvedDate = date('m-d', strtotime($bug->resolvedDate));
$stageGroups[$bug->pri]['resolved'] += 1;
$handleGroups['resolved'][$resolvedDate] += 1;
}
}
/* Get the generated and leagcy bug data. */
foreach($generatedBugs as $bug)
{
if(array_intersect(explode(',', $bug->openedBuild), $buildIdList))
{
$openedDate = date('m-d', strtotime($bug->openedDate));
$foundBugs[$bug->id] = $bug;
if($bug->status == 'active' or $bug->resolvedDate > "$end 23:59:59") $legacyBugs[$bug->id] = $bug;
$stageGroups[$bug->pri]['generated'] += 1;
$handleGroups['generated'][$openedDate] += 1;
if($bug->status == 'active' or $bug->resolvedDate > "$end 23:59:59")
{
$legacyBugs[$bug->id] = $bug;
$stageGroups[$bug->pri]['legacy'] += 1;
$beginTimeStamp = strtotime($begin);
$endTimeStamp = strtotime($end);
for($i = $beginTimeStamp; $i <= $endTimeStamp; $i += 86400)
{
$dateTime = date('Y-m-d 23:59:59', $i);
if($bug->openedDate <= $dateTime and (helper::isZeroDate($bug->resolvedDate) or $bug->resolvedDate > $dateTime))
{
$date = date('m-d', $i);
$handleGroups['legacy'][$date] += 1;
}
}
}
if($bug->case and !empty($bug->testtask) and in_array($bug->testtask, $taskIdList)) $byCaseNum ++;
}
}
$severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = $typeGroups = array();
$resolvedBugs = 0;
foreach($foundBugs as $bug)
{
@@ -174,6 +228,8 @@ class testreportModel extends model
$bugInfo['countBugByTask'] = $byCaseNum;
$bugInfo['bugConfirmedRate'] = empty($resolvedBugs) ? 0 : round((zget($resolutionGroups, 'fixed', 0) + zget($resolutionGroups, 'postponed', 0)) / $resolvedBugs * 100, 2);
$bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($foundBugs) * 100, 2);
$bugInfo['bugStageGroups'] = $stageGroups;
$bugInfo['bugHandleGroups'] = $handleGroups;
$this->app->loadLang('bug');
$users = $this->loadModel('user')->getPairs('noclosed|noletter|nodeleted');
+131 -1
View File
@@ -48,7 +48,7 @@
<?php foreach($bugInfo as $infoKey => $infoValue):?>
<tr>
<td class='text-top'>
<table class='table table-condensed table-report' id='bugSeverityGroups'>
<table class='table table-condensed table-report' id='bugStageGroups'>
<?php if(empty($infoValue)):?>
<tr>
<td class='none-data'>
@@ -56,6 +56,85 @@
<?php echo $lang->testreport->none;?>
</td>
</tr>
<?php elseif($infoKey == 'bugStageGroups'):?>
<tr class='text-top'>
<td class='w-p70'>
<div class='chart-wrapper text-center'>
<h5><?php echo $lang->testreport->$infoKey?></h5>
<div class='chart-canvas'>
<?php if(isset($_POST["chart-{$infoKey}"])):?>
<img src='<?php echo strip_tags($_POST["chart-{$infoKey}"])?>' />
<?php else:?>
<canvas id='chart-<?php echo $infoKey?>' width='90' height='20' data-responsive='true'></canvas>
<?php endif;?>
</div>
</div>
</td>
<td class='text-top'>
<div class='table-wrapper' style='overflow:auto'>
<table class='table table-condensed table-hover table-striped table-bordered' data-chart='bar' data-target='#chart-<?php echo $infoKey?>' data-animation='false'>
<thead>
<tr>
<th class='w-60px'><?php echo $lang->bug->pri;?></th>
<th class='w-80px'><?php echo $lang->testreport->bugStageList['generated'];?></th>
<th class='w-80px'><?php echo $lang->testreport->bugStageList['legacy'];?></th>
<th class='w-80px'><?php echo $lang->testreport->bugStageList['resolved'];?></th>
</tr>
</thead>
<?php foreach($lang->bug->priList as $key => $value):?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class="chart-color-dot pri-<?php echo $key;?>"></i> <?php echo $key == 0 ? $lang->null : $value;?></td>
<td class='chart-value'><?php echo $infoValue[$key]['generated'];?></td>
<td class='chart-value'><?php echo $infoValue[$key]['legacy'];?></td>
<td class='chart-value'><?php echo $infoValue[$key]['resolved'];?></td>
</tr>
<?php endforeach?>
</table>
</div>
</td>
</tr>
<?php elseif($infoKey == 'bugHandleGroups'):?>
<tr class='text-top'>
<td class='w-p70'>
<div class='chart-wrapper text-center'>
<h5><?php echo $lang->testreport->$infoKey?></h5>
<div class='chart-canvas'>
<?php if(isset($_POST["chart-{$infoKey}"])):?>
<img src='<?php echo strip_tags($_POST["chart-{$infoKey}"])?>' />
<?php else:?>
<canvas id='chart-<?php echo $infoKey?>' width='90' height='20' data-responsive='true'></canvas>
<?php endif;?>
</div>
</div>
</td>
<td class='text-top'>
<div class='table-wrapper' style='overflow:auto'>
<table class='table table-condensed table-hover table-striped table-bordered' data-chart='line' data-target='#chart-<?php echo $infoKey?>' data-animation='false'>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->testreport->date;?></th>
<th class='w-80px'><i class='chart-color-dot generated'></i> <?php echo $lang->testreport->bugStageList['generated'];?></th>
<th class='w-80px'><i class='chart-color-dot legacy'></i> <?php echo $lang->testreport->bugStageList['legacy'];?></th>
<th class='w-80px'><i class='chart-color-dot resolved'></i> <?php echo $lang->testreport->bugStageList['resolved'];?></th>
</tr>
</thead>
<?php
$beginTime = strtotime($report->begin);
$endTime = strtotime($report->end);
?>
<?php for($time = $beginTime; $time <= $endTime; $time += 86400):?>
<?php $date = date('m-d', $time);?>
<tr class='text-center'>
<td class='chart-value'><?php echo $date?></td>
<td class='chart-value'><?php echo $infoValue['generated'][$date];?></td>
<td class='chart-value'><?php echo $infoValue['legacy'][$date];?></td>
<td class='chart-value'><?php echo $infoValue['resolved'][$date];?></td>
</tr>
<?php endfor?>
</table>
</div>
</td>
</tr>
<?php else:?>
<?php $sum = 0; foreach($infoValue as $value) $sum += $value->value;?>
<tr class='text-top'>
@@ -115,3 +194,54 @@
</tr>
<?php endforeach;?>
</table>
<?php js::set('bugStageList', $lang->testreport->bugStageList);?>
<?php js::set('bugStageValueList', array_values($lang->testreport->bugStageList));?>
<?php js::set('bugPriList', $lang->bug->priList);?>
<?php js::set('zeroPri', $lang->null);?>
<?php js::set('bugStageGroups', $bugInfo['bugStageGroups']);?>
<?php js::set('bugHandleGroups', $bugInfo['bugHandleGroups']);?>
<?php js::set('dateGroups', array_keys($bugInfo['bugHandleGroups']['generated']));?>
<script>
var priList = [];
var stageList = [];
var colorList = ['#d5d9df', '#d50000', '#ff9800', '#2098ee', '#009688'];
var colorKey = 0;
for(var key in bugPriList)
{
$('.pri-' + key).css('background', colorList[colorKey]);
var priName = key == 0 ? zeroPri : bugPriList[key];
var pri = {
label: priName,
color: colorList[colorKey],
data: [bugStageGroups[key]['generated'], bugStageGroups[key]['legacy'], bugStageGroups[key]['resolved']]
}
priList.push(pri);
colorKey++;
if(colorKey >= 5) colorKey -= 5;
}
var data = {
labels: bugStageValueList,
datasets: priList,
};
var options = {responsive: true};
var bugStageGroups = $('#chart-bugStageGroups').barChart(data, options);
colorKey = 2;
for(var key in bugHandleGroups)
{
$('.' + key).css('background', colorList[colorKey]);
var stageName = bugStageList[key];
var stage = {
label: stageName,
color: colorList[colorKey],
data: bugHandleGroups[key]
}
stageList.push(stage);
colorKey++;
}
var data = {
labels: dateGroups,
datasets: stageList,
};
var bugHandleGroups = $('#chart-bugHandleGroups').lineChart(data, options);
</script>
+2
View File
@@ -176,6 +176,8 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Bugersteller Bericht'
$lang->testtask->report->charts['bugResolvedByGroups'] = 'Gelöst von Bericht';
$lang->testtask->report->charts['bugResolutionGroups'] = 'Lösungsbersicht';
$lang->testtask->report->charts['bugModuleGroups'] = 'Bug Modul Bericht';
$lang->testtask->report->charts['bugStageGroups'] = 'Bug importance stage distribution';
$lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing';
$lang->testtask->report->options = new stdclass();
$lang->testtask->report->options->graph = new stdclass();
+2
View File
@@ -179,6 +179,8 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Bug ReportedBy Distri
$lang->testtask->report->charts['bugResolvedByGroups'] = 'Bug ResolvedBy Distribution';
$lang->testtask->report->charts['bugResolutionGroups'] = 'Bug Resolution Distribution';
$lang->testtask->report->charts['bugModuleGroups'] = 'Bug Module Distribution';
$lang->testtask->report->charts['bugStageGroups'] = 'Bug importance stage distribution';
$lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing';
$lang->testtask->report->options = new stdclass();
$lang->testtask->report->options->graph = new stdclass();
+2
View File
@@ -176,6 +176,8 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Distribution signalem
$lang->testtask->report->charts['bugResolvedByGroups'] = 'Distribution Résolus par';
$lang->testtask->report->charts['bugResolutionGroups'] = 'Distribution Résolution';
$lang->testtask->report->charts['bugModuleGroups'] = 'Distribution Bug Module';
$lang->testtask->report->charts['bugStageGroups'] = 'Bug importance stage distribution';
$lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing';
$lang->testtask->report->options = new stdclass();
$lang->testtask->report->options->graph = new stdclass();
+2
View File
@@ -176,6 +176,8 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Phân chia người b
$lang->testtask->report->charts['bugResolvedByGroups'] = 'Phân chia người giải quyết Bug';
$lang->testtask->report->charts['bugResolutionGroups'] = 'Phân chia giải pháp Bug';
$lang->testtask->report->charts['bugModuleGroups'] = 'Phân chia Module Bug';
$lang->testtask->report->charts['bugStageGroups'] = 'Bug importance stage distribution';
$lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing';
$lang->testtask->report->options = new stdclass();
$lang->testtask->report->options->graph = new stdclass();
+2
View File
@@ -179,6 +179,8 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Bug创建者分布';
$lang->testtask->report->charts['bugResolvedByGroups'] = 'Bug解决者分布';
$lang->testtask->report->charts['bugResolutionGroups'] = 'Bug解决方案分布';
$lang->testtask->report->charts['bugModuleGroups'] = 'Bug模块分布';
$lang->testtask->report->charts['bugStageGroups'] = 'Bug重要程度阶段分布';
$lang->testtask->report->charts['bugHandleGroups'] = 'Bug每日处理情况分布';
$lang->testtask->report->options = new stdclass();
$lang->testtask->report->options->graph = new stdclass();