* ajdust style.

This commit is contained in:
wangyidong
2017-03-14 11:33:18 +08:00
parent f53fa19bbe
commit d9ec2be130
20 changed files with 452 additions and 368 deletions
+19 -44
View File
@@ -31,6 +31,7 @@ class testreport extends control
$this->loadModel('testcase');
$this->loadModel('testtask');
$this->loadModel('user');
$this->app->loadLang('report');
}
/**
@@ -190,15 +191,9 @@ class testreport extends control
$this->view->cases = $cases;
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$this->view->bugSeverityGroups = $bugInfo['bugSeverityGroups'];
$this->view->bugStatusGroups = $bugInfo['bugStatusGroups'];
$this->view->bugOpenedByGroups = $bugInfo['bugOpenedByGroups'];
$this->view->bugResolvedByGroups = $bugInfo['bugResolvedByGroups'];
$this->view->bugResolutionGroups = $bugInfo['bugResolutionGroups'];
$this->view->bugModuleGroups = $bugInfo['bugModuleGroups'];
$this->view->bugConfirmedRate = $bugInfo['bugConfirmedRate'];
$this->view->bugCreateByCaseRate = $bugInfo['bugCreateByCaseRate'];
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
$this->view->bugInfo = $bugInfo;
$this->view->objectID = $objectID;
$this->view->objectType = $objectType;
@@ -212,22 +207,22 @@ class testreport extends control
* @access public
* @return void
*/
public function view($reportID)
public function view($reportID, $from = 'product')
{
$report = $this->testreport->getById($reportID);
$project = $this->project->getById($report->project);
if($report->objectType == 'testtask')
if($from == 'product' and is_numeric($report->product))
{
$task = $this->testtask->getById($report->objectID);
$productID = $this->commonAction($task->product, 'product');
if($productID != $task->product) die('deny access');
$product = $this->product->getById($report->product);
$productID = $this->commonAction($report->product, 'product');
if($productID != $report->product) die('deny access');
$browseLink = inlink('browse', "objectID=$productID&objectType=product&extra={$report->objectID}");
$this->view->position[] = html::a($browseLink, $task->name);
$browseLink = inlink('browse', "objectID=$productID&objectType=product");
$this->view->position[] = html::a($browseLink, $product->name);
}
elseif($report->objectType == 'project')
else
{
$projectID = $this->commonAction($report->objectID, 'project');
$projectID = $this->commonAction($report->project, 'project');
if($projectID != $report->objectID) die('deny access');
$browseLink = inlink('browse', "objectID=$projectID&objectType=project");
@@ -268,15 +263,9 @@ class testreport extends control
$this->view->storySummary = $this->product->summary($stories);
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$this->view->bugSeverityGroups = $bugInfo['bugSeverityGroups'];
$this->view->bugStatusGroups = $bugInfo['bugStatusGroups'];
$this->view->bugOpenedByGroups = $bugInfo['bugOpenedByGroups'];
$this->view->bugResolvedByGroups = $bugInfo['bugResolvedByGroups'];
$this->view->bugResolutionGroups = $bugInfo['bugResolutionGroups'];
$this->view->bugModuleGroups = $bugInfo['bugModuleGroups'];
$this->view->bugConfirmedRate = $bugInfo['bugConfirmedRate'];
$this->view->bugCreateByCaseRate = $bugInfo['bugCreateByCaseRate'];
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
$this->view->bugInfo = $bugInfo;
$this->display();
}
@@ -318,23 +307,9 @@ class testreport extends control
$this->session->set('notHead', true);
$output = $this->fetch('testreport', 'view', array('reportID' =>$reportID));
$this->session->set('notHead', false);
$style = <<<EOD
<style>
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;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;}
</style>
EOD;
$content = "<!DOCTYPE html>\n<html lang='zh-cn'>\n<head>\n<meta charset='utf-8'>\n<title>{$report->title}</title>\n$style</head>\n<body>\n<h1>{$report->title}</h1>\n$output</body></html>";
$css = '<style>' . $this->getCSS('testreport', 'export') . '</style>';
$js = '<script>' . $this->getJS('testreport', 'export') . '</script>';
$content = "<!DOCTYPE html>\n<html lang='zh-cn'>\n<head>\n<meta charset='utf-8'>\n<title>{$report->title}</title>\n$css\n$js\n</head>\n<body onload='tab()'>\n<h1>{$report->title}</h1>\n$output</body></html>";
$this->fetch('file', 'sendDownHeader', array('fileName' => $data->fileName, 'fileType' => $data->fileType, 'content' =>$content));
}
$this->view->customExport = false;
+1
View File
@@ -0,0 +1 @@
.none-data{padding:8px !important;}
+13
View File
@@ -0,0 +1,13 @@
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;}
.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;}
.table>thead>tr>th{text-align:center;vertical-align:middle;background-color:#f1f1f1;border-bottom:1px solid #ddd;}
.main .nav-tabs{padding-left: 20px;padding-top:10px;margin-bottom:0;list-style:none;}
.main .nav-tabs:after{clear:both;display:table;content:" ";}
.nav-tabs > li{float:left;margin-bottom:-1px;position:relative;display:block;}
.nav-tabs > li > a{padding:5px 10px;color:#333;line-height:20px;max-height:32px;margin-right:2px;border:1px solid transparent;border-radius:0;position:relative;display:block;text-decoration:none;outline:none;}
.nav-tabs > li.active > a,.nav-tabs > li.active > a:hover,.nav-tabs > li.active > a:focus{color:#333;font-weight:bold;line-height: 20px;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;}
.tab-pane{display:none}
.tab-pane.active{display:block}
+5
View File
@@ -0,0 +1,5 @@
.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;}
+16
View File
@@ -0,0 +1,16 @@
$(function()
{
var resizeChartTable = function()
{
$('.table-wrapper').each(function()
{
var $this = $(this);
$this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight());
});
};
resizeChartTable();
fixedTableHead('.table-wrapper');
$('.tab-pane').removeClass('active');
$('.tab-pane:first').addClass('active');
});
+33
View File
@@ -0,0 +1,33 @@
function tab()
{
tabContent = new Array();
var divTags=document.getElementsByTagName("div");
for(var divKey in divTags)
{
if(typeof(divTags[divKey]) == 'object' && divTags[divKey].getAttribute('class').indexOf('tab-pane') >= 0)
{
tabContent.push(divTags[divKey]);
divTags[divKey].setAttribute('class', 'tab-pane');
}
}
tabContent[0].setAttribute('class', 'tab-pane active');
var aTags=document.getElementsByTagName("a");
for(var i = 0;i<aTags.length;i++)
{
if(aTags[i].getAttribute("data-toggle") == 'tab')
{
aTags[i].onclick = function()
{
var liTags=document.getElementsByTagName("li");
for(var liKey in liTags)
{
if(typeof(liTags[liKey]) == 'object' && liTags[liKey].parentNode.getAttribute('class') == 'nav nav-tabs') liTags[liKey].removeAttribute('class');
}
this.parentNode.setAttribute('class', 'active');
for(var divKey in tabContent) tabContent[divKey].setAttribute('class', 'tab-pane');
document.getElementById(this.getAttribute('data-target').replace(/#/, '')).setAttribute('class', 'tab-pane active');
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
$(function()
{
var resizeChartTable = function()
{
$('.table-wrapper').each(function()
{
var $this = $(this);
$this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight());
});
};
resizeChartTable();
fixedTableHead('.table-wrapper');
$('.tab-pane').removeClass('active');
$('.tab-pane:first').addClass('active');
});
+9 -5
View File
@@ -19,15 +19,18 @@ $lang->testreport->report = '总结';
$lang->testreport->legacyBugs = '遗留的Bug';
$lang->testreport->createdDate = '创建时间';
$lang->testreport->objectID = '所属对象';
$lang->testreport->profile = '概况';
$lang->testreport->value = '值';
$lang->testreport->none = '无';
$lang->testreport->all = '所有报告';
$lang->testreport->legendBasic = '基本信息';
$lang->testreport->legendStoryAndBug = '测试的需求和Bug';
$lang->testreport->legendBuild = '版本信息';
$lang->testreport->legendCase = '执行的用例的信息';
$lang->testreport->legendBug = '缺陷信息';
$lang->testreport->legendStoryAndBug = '测试范围';
$lang->testreport->legendBuild = '测试轮次';
$lang->testreport->legendCase = '执行的用例';
$lang->testreport->legendLegacyBugs = '遗留的Bug';
$lang->testreport->legendReport = '报表';
$lang->testreport->legendMore = '更多功能';
$lang->testreport->bugSeverityGroups = '产生Bug严重级别分布';
$lang->testreport->bugStatusGroups = '产生Bug状态分布';
@@ -39,5 +42,6 @@ $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->caseSummary = '共有<strong>%s</strong>个用例,共执行<strong>%s</strong>个用例,产生了<strong>%s</strong>个结果,失败的用例有<strong>%s</strong>个。';
$lang->testreport->bugSummary = '共产生<strong>%s</strong>个Bug,有效Bug率(确认的Bug / 产生的Bug):<strong>%s</strong>,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):<strong>%s</strong>';
$lang->testreport->confirmDelete = '是否删除该报告?';
+4 -3
View File
@@ -93,7 +93,7 @@ class testreportModel extends model
return $this->dao->select('*')->from(TABLE_TESTREPORT)->where('deleted')->eq(0)
->beginIF($objectType == 'project')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('project')->fi()
->beginIF($objectType == 'product' and $extra)->andWhere('objectID')->eq((int)$extra)->andWhere('objectType')->eq('testtask')->fi()
->beginIF($objectType == 'product' and empty($extra))->andWhere("CONCAT(',', product, ',') like '%,$objectID,%'")->fi()
->beginIF($objectType == 'product' and empty($extra))->andWhere('product')->eq($objectID)->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
@@ -136,12 +136,13 @@ class testreportModel extends model
if($bug->case) $byCaseNum ++;
}
$bugInfo['legacyBugs'] = $legacyBugs;
$bugInfo['countBugByTask'] = count($bugsByTask);
$bugInfo['bugSeverityGroups'] = $severityGroups;
$bugInfo['bugStatusGroups'] = $statusGroups;
$bugInfo['bugOpenedByGroups'] = $openedByGroups;
$bugInfo['bugResolvedByGroups'] = $resolvedByGroups;
$bugInfo['bugResolutionGroups'] = $resolutionGroups;
$bugInfo['bugOpenedByGroups'] = $openedByGroups;
$bugInfo['bugModuleGroups'] = $moduleGroups;
$bugInfo['bugResolvedByGroups'] = $resolvedByGroups;
$bugInfo['bugConfirmedRate'] = round($confirmedNum / count($bugsByTask) * 100, 2);
$bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($newBugs) * 100, 2);
return $bugInfo;
@@ -1,109 +0,0 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->bugInfo?></th>
<td class='text-top' colspan='2'>
<div class='input-group' id='bugConfirmedRate'>
<span class='input-group-addon'><?php echo $lang->testreport->bugConfirmedRate?></span>
<span class='input-group-addon'><?php echo $bugConfirmedRate . '%'?></span>
<span class='input-group-addon'><?php echo $lang->testreport->bugCreateByCaseRate?></span>
<span class='input-group-addon'><?php echo $bugCreateByCaseRate . '%'?></span>
</div>
<table class='table table-form'>
<tr>
<td class='text-top' width='33%'>
<table class='table table-condensed' id='bugSeverityGroups'>
<caption><?php echo $lang->testreport->bugSeverityGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->severity?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($lang->bug->severityList as $severityKey => $severityValue):?>
<tr>
<td class='text-right'><?php echo $severityValue === '' ? 'null' : $severityValue?></td>
<td><?php echo zget($bugSeverityGroups, $severityKey, 0);?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top' width='33%'>
<table class='table table-condensed' id='bugStatusGroups'>
<caption><?php echo $lang->testreport->bugStatusGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->status?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($lang->bug->statusList as $statusKey => $statusValue):?>
<?php if(!isset($bugStatusGroups['']) and $statusValue === '') continue;?>
<tr>
<td class='text-right'><?php echo $statusValue === '' ? 'null' : $statusValue?></td>
<td><?php echo zget($bugStatusGroups, $statusKey, 0);?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top' width='33%'>
<table class='table table-condensed' id='bugResolutionGroups'>
<caption><?php echo $lang->testreport->bugResolutionGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->resolution?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($lang->bug->resolutionList as $resolutionKey => $resolutionValue):?>
<tr>
<td class='text-right'><?php echo $resolutionValue === '' ? 'null' : $resolutionValue?></td>
<td><?php echo zget($bugResolutionGroups, $resolutionKey, 0);?></td>
</tr>
<?php endforeach?>
</table>
</td>
</tr>
<tr>
<td class='text-top'>
<table class='table table-condensed' id='bugOpenedByGroups'>
<caption><?php echo $lang->testreport->bugOpenedByGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->openedBy?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($bugOpenedByGroups as $account => $num):?>
<tr>
<td class='text-right'><?php echo zget($users, $account)?></td>
<td><?php echo $num;?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top'>
<table class='table table-condensed' id='bugModuleGroups'>
<caption><?php echo $lang->testreport->bugModuleGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->module?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php ksort($bugModuleGroups)?>
<?php foreach($bugModuleGroups as $moduleKey => $num):?>
<tr>
<td class='text-right'><?php echo zget($modules, $moduleKey);?></td>
<td><?php echo $num;?></td>
</tr>
<?php endforeach?>
</table>
</td>
<td class='text-top'>
<table class='table table-condensed' id='bugResolvedByGroups'>
<caption><?php echo $lang->testreport->bugResolvedByGroups?></caption>
<tr>
<th class='text-right w-100px'><?php echo $lang->bug->resolvedBy?></th>
<th><?php echo $lang->testreport->value?></th>
</tr>
<?php foreach($bugResolvedByGroups as $account => $num):?>
<tr>
<td class='text-right'><?php echo zget($users, $account)?></td>
<td><?php echo $num;?></td>
</tr>
<?php endforeach?>
</table>
</td>
</tr>
</table>
</td>
</tr>
@@ -0,0 +1,65 @@
<table class='table table-form'>
<?php $row = 0;?>
<?php foreach($bugInfo as $infoKey => $infoValue):?>
<?php if(($row % 1) == 0) echo '<tr>';?>
<?php $row++;?>
<td class='text-top' width='33%'>
<?php $sum = array_sum($infoValue);?>
<table class='table table-condensed' id='bugSeverityGroups'>
<caption><?php echo $lang->testreport->$infoKey?></caption>
<?php if($sum == 0):?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php else:?>
<tr class='text-top'>
<td class='w-p60'>
<div class='chart-wrapper text-center'>
<div class='chart-canvas'>
<?php if(isset($_POST["chart-{$infoKey}"])):?>
<img src='<?php echo $_POST["chart-{$infoKey}"]?>' />
<?php else:?>
<canvas id='chart-<?php echo $infoKey?>' width='100' height='20' data-responsive='true'></canvas>
<?php endif;?>
</div>
</div>
</td>
<td>
<div class='table-wrapper' style='overflow:auto'>
<table class='table table-condensed table-hover table-striped table-bordered table-chart' data-chart='pie' data-target='#chart-<?php echo $infoKey?>' data-animation='false'>
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->report->item;?></th>
<th><?php echo $lang->report->value;?></th>
<th><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<?php
$list = $infoValue;
if($infoKey == 'bugSeverityGroups') $list = $lang->bug->severityList;
if($infoKey == 'bugStatusGroups') $list = $lang->bug->statusList;
if($infoKey == 'bugResolutionGroups') $list = $lang->bug->resolutionList;
?>
<?php foreach($list as $listKey => $listValue):?>
<?php
$label = $listValue;
if($infoKey == 'bugOpenedByGroups' or $infoKey == 'bugResolvedByGroups') $label = zget($users, $listKey);
if($infoKey == 'bugModuleGroups') $label = zget($modules, $listKey);
if(empty($label)) continue;
$data = zget($infoValue, $listKey, 0);
?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class='chart-color-dot icon-circle'></i></td>
<td class='chart-label'><?php echo $label;?></td>
<td class='chart-value'><?php echo $data;?></td>
<td><?php echo ($data / $sum * 100) . '%';?></td>
</tr>
<?php endforeach?>
</table>
</div>
</td>
</tr>
<?php endif;?>
</table>
</td>
<?php if(($row % 1) == 0) echo '<tr>';?>
<?php endforeach;?>
</table>
+30 -35
View File
@@ -1,35 +1,30 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->bugs?></th>
<td colspan='2'>
<?php if($bugs):?>
<table class='table' id='bugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<tbody class='text-center'>
<?php foreach($bugs as $bug):?>
<tr>
<td><?php echo $bug->id . html::hidden('bugs[]', $bug->id)?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif?>
</td>
</tr>
<table class='table' id='bugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php if($bugs):?>
<tbody class='text-center'>
<?php foreach($bugs as $bug):?>
<tr>
<td><?php echo $bug->id . html::hidden('bugs[]', $bug->id)?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif?>
</table>
+4 -4
View File
@@ -1,4 +1,3 @@
<?php if($builds):?>
<table class='table' id='builds'>
<thead>
<tr>
@@ -8,6 +7,7 @@
<th class='w-date'><?php echo $lang->build->date;?></th>
</tr>
</thead>
<?php if($builds):?>
<tbody class='text-center'>
<?php foreach($builds as $build):?>
<tr>
@@ -18,7 +18,7 @@
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo 'Trunk'?></td></tr>
<?php endif;?>
</table>
<?php else:?>
<?php echo 'Trunk'?>
<?php endif;?>
+4 -5
View File
@@ -1,4 +1,3 @@
<?php if($cases):?>
<table class='table' id='cases'>
<thead>
<tr>
@@ -13,6 +12,7 @@
<th class='w-status'><?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php if($cases):?>
<tbody class='text-center'>
<?php foreach($cases as $case):?>
<tr>
@@ -28,8 +28,7 @@
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='9'><?php echo $caseSummary;?></td></tr></tfoot>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif;?>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif;?>
+30 -35
View File
@@ -1,35 +1,30 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->legacyBugs?></th>
<td colspan='2'>
<?php if($legacyBugs):?>
<table class='table' id='bugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<tbody class='text-center'>
<?php foreach($legacyBugs as $bug):?>
<tr>
<td><?php echo $bug->id?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif?>
</td>
</tr>
<table class='table' id='legacyBugs'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
<th class='w-130px'><?php echo $lang->bug->resolvedDate;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php if($legacyBugs):?>
<tbody class='text-center'>
<?php foreach($legacyBugs as $bug):?>
<tr>
<td><?php echo $bug->id?></td>
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->resolvedBy);?></td>
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
<td><?php echo zget($lang->bug->statusList, $bug->status);?></td>
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif?>
</table>
+32 -38
View File
@@ -1,38 +1,32 @@
<tr>
<th class='text-top w-80px'><?php echo $lang->testreport->stories?></th>
<td colspan='2'>
<?php if($stories):?>
<table class='table' id='stories'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-80px'><?php echo $lang->assignedToAB;?></th>
<th class='w-hour'><?php echo $lang->story->estimateAB;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-70px'><?php echo $lang->story->stageAB;?></th>
</tr>
</thead>
<tbody class='text-center'>
<?php foreach($stories as $story):?>
<tr>
<td><?php echo $story->id . html::hidden('stories[]', $story->id)?></td>
<td><span class='pri<?php echo $story->pri?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
<td class='text-left' title='<?php echo $story->title?>'><?php echo $story->title?></td>
<td><?php echo zget($users, $story->openedBy);?></td>
<td><?php echo zget($users, $story->assignedTo);?></td>
<td><?php echo $story->estimate?></td>
<td><?php echo zget($lang->story->statusList, $story->status);?></td>
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='8'><?php echo $storySummary?></td></tr></tfoot>
</table>
<?php else:?>
<?php echo $lang->testreport->none;?>
<?php endif?>
</td>
</tr>
<table class='table' id='stories'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-80px'><?php echo $lang->assignedToAB;?></th>
<th class='w-hour'><?php echo $lang->story->estimateAB;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-70px'><?php echo $lang->story->stageAB;?></th>
</tr>
</thead>
<?php if($stories):?>
<tbody class='text-center'>
<?php foreach($stories as $story):?>
<tr>
<td><?php echo $story->id . html::hidden('stories[]', $story->id)?></td>
<td><span class='pri<?php echo $story->pri?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
<td class='text-left' title='<?php echo $story->title?>'><?php echo $story->title?></td>
<td><?php echo zget($users, $story->openedBy);?></td>
<td><?php echo zget($users, $story->assignedTo);?></td>
<td><?php echo $story->estimate?></td>
<td><?php echo zget($lang->story->statusList, $story->status);?></td>
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
</tr>
<?php endforeach;?>
</tbody>
<?php else:?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<?php endif?>
</table>
+1 -1
View File
@@ -34,7 +34,7 @@
<?php foreach($reports as $report):?>
<tr>
<td><?php echo $report->id?></td>
<td class='text-left' title='<?php $report->title?>'><?php echo html::a(inlink('view', "reportID=$report->id"), $report->title)?></td>
<td class='text-left' title='<?php $report->title?>'><?php echo html::a(inlink('view', "reportID=$report->id&from=$objectType"), $report->title)?></td>
<td><?php echo zget($users, $report->createdBy);?></td>
<td><?php echo substr($report->createdDate, 2);?></td>
<?php
+50 -39
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/chart.html.php';?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
@@ -35,47 +36,56 @@
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
<fieldset>
<legend><?php echo $lang->testreport->legendBasic?></legend>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'>
<div class='input-group'>
<?php echo html::input('begin', $begin, "class='form-control form-date'")?>
<span class='input-group-addon'> ~ </span>
<?php echo html::input('end', $end, "class='form-control form-date'")?>
<?php
echo html::hidden('product', $productIdList) . html::hidden('project', $project->id) . html::hidden('tasks', $tasks);
echo html::hidden('objectID', $objectID) . html::hidden('objectType', $objectType);
?>
</div>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->testreport->owner?></span>
<?php echo html::select('owner', $users, $owner, "class='form-control chosen'")?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php echo html::select('members', $users, $members, "class='form-control chosen' multiple")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->title?></th>
<td colspan='2'><?php echo html::input('title', $reportTitle, "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'>
<div class='input-group'>
<?php echo html::input('begin', $begin, "class='form-control form-date'")?>
<span class='input-group-addon'> ~ </span>
<?php echo html::input('end', $end, "class='form-control form-date'")?>
<?php
echo html::hidden('product', $productIdList) . html::hidden('project', $project->id) . html::hidden('tasks', $tasks);
echo html::hidden('objectID', $objectID) . html::hidden('objectType', $objectType);
?>
</div>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->testreport->owner?></span>
<?php echo html::select('owner', $users, $owner, "class='form-control chosen'")?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php echo html::select('members', $users, $members, "class='form-control chosen' multiple")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->title?></th>
<td colspan='2'><?php echo html::input('title', $reportTitle, "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->profile?></th>
<td colspan='2'>
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
?>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendStoryAndBug?></legend>
<table class='table table-form'>
<?php include './blockstories.html.php'?>
<?php include './blockbugs.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBuild?></legend>
@@ -86,11 +96,12 @@
<?php include './blockcases.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBug?></legend>
<table class='table table-form'>
<legend><?php echo $lang->testreport->legendLegacyBugs?></legend>
<?php include './blocklegacybugs.html.php'?>
<?php include './blockbuginfo.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendReport?></legend>
<?php include './blockbugreport.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->report?></legend>
+58 -1
View File
@@ -10,8 +10,65 @@
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php
unset($lang->exportFileTypeList);
$lang->exportFileTypeList['html'] = 'html';
include '../../file/view/export.html.php';
?>
<script>
function setDownloading()
{
if($.browser.opera) return true; // Opera don't support, omit it.
$.cookie('downloading', 0);
time = setInterval("closeWindow()", 300);
return true;
}
function closeWindow()
{
if($.cookie('downloading') == 1)
{
parent.$.closeModal();
$.cookie('downloading', null);
clearInterval(time);
}
}
$(function()
{
parent.$('.chart-canvas canvas').each(function()
{
chartImgData = $(this).get(0).toDataURL("image/png");
chartID = $(this).attr('id');
$('#submit').after("<input type='hidden' name='" + chartID +"' id='" + chartID + "' />");
$('#' + chartID).val(chartImgData);
});
})
</script>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['export']);?></span>
<strong><?php echo $lang->export;?></strong>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin' style='padding: 40px 1% 50px'>
<table class='w-p100 table-fixed'>
<tr>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->setFileName;?></span>
<?php echo html::input('fileName', '', "class='form-control' autocomplete='off'");?>
</div>
</td>
<td class='w-60px'>
<?php echo html::select('fileType', $lang->exportFileTypeList, '', 'onchange=switchEncode(this.value) class="form-control"');?>
</td>
<td style='width:70px'>
<div class='input-group'>
<?php echo html::submitButton($lang->export, "onclick='setDownloading();' ");?>
</div>
</td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
+62 -49
View File
@@ -12,6 +12,7 @@
?>
<?php if(!$this->session->notHead):?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/chart.html.php';?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
@@ -26,6 +27,9 @@
echo "<div class='btn-group'>";
common::printIcon('testreport', 'export', "reportID=$report->id", '', 'button', 'download-alt', '', 'iframe');
echo '</div>';
echo "<div class='btn-group'>";
if(common::hasPriv('testreport', 'create')) echo html::a(inLink('create', "objectID=$report->objectID&objectType=$report->objectType"), "<i class='icon-refresh'></i>", '', "class='btn' title='{$lang->testreport->recreate}'");
common::printIcon('testreport', 'delete', "reportID=$report->id", '', 'button', '', 'hiddenwin');
echo '</div>';
@@ -42,57 +46,66 @@
</div>
<?php endif;?>
<div class='main'>
<fieldset>
<legend><?php echo $lang->testreport->legendBasic?></legend>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'> <?php echo $report->begin . ' ~ ' . $report->end;?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->owner?></th>
<td><?php echo zget($users, $report->owner);?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php foreach(explode(',', $report->members) as $member)echo zget($users, $member) . ' &nbsp; ';?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendStoryAndBug?></legend>
<table class='table table-form'>
<ul class='nav nav-tabs'>
<li class='active'><?php echo html::a('###', $lang->testreport->legendBasic, '', "data-toggle='tab' data-target='#basic'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendStoryAndBug, '', "data-toggle='tab' data-target='#storyAndBug'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendBuild, '', "data-toggle='tab' data-target='#tabBuild'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendCase, '', "data-toggle='tab' data-target='#tabCase'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendLegacyBugs, '', "data-toggle='tab' data-target='#tabLegacyBugs'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendReport, '', "data-toggle='tab' data-target='#tabReport'")?></li>
</ul>
<div class='tab-content'>
<div class='tab-pane' id='basic'>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->testreport->startEnd?></th>
<td class='w-p50'> <?php echo $report->begin . ' ~ ' . $report->end;?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->owner?></th>
<td><?php echo zget($users, $report->owner);?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->member?></th>
<td colspan='2'><?php foreach(explode(',', $report->members) as $member)echo zget($users, $member) . ' &nbsp; ';?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->profile?></th>
<td colspan='2'>
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->report?></th>
<td><?php echo $report->report;?></td>
</tr>
<?php if(!$this->session->notHead):?>
<tr>
<th><?php echo $lang->files?></th>
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'false'));?></td>
</tr>
<?php endif;?>
</table>
</div>
<div class='tab-pane' id='storyAndBug'>
<?php include './blockstories.html.php'?>
<?php include './blockbugs.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBuild?></legend>
<?php include './blockbuilds.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendCase?></legend>
<?php include './blockcases.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->legendBug?></legend>
<table class='table table-form'>
<?php include './blocklegacybugs.html.php'?>
<?php include './blockbuginfo.html.php'?>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->report?></legend>
<div><?php echo $report->report;?></div>
</fieldset>
<?php if(!$this->session->notHead):?>
<?php echo $this->fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'true'));?>
<?php endif;?>
</div>
<div class='tab-pane' id='tabBuild'><?php include './blockbuilds.html.php'?></div>
<div class='tab-pane' id='tabCase'><?php include './blockcases.html.php'?></div>
<div class='tab-pane' id='tabLegacyBugs'><?php include './blocklegacybugs.html.php'?></div>
<div class='tab-pane active' id='tabReport'><?php include './blockbugreport.html.php'?></div>
</div>
</div>
<?php if(!$this->session->notHead):?>
</div>