+ add time limit of bugsummary.

This commit is contained in:
zhujinyong
2012-06-26 02:44:14 +00:00
parent 0d96a330a2
commit 9fc79a3d63
6 changed files with 118 additions and 5 deletions
+22 -3
View File
@@ -33,17 +33,36 @@ class report extends control
$this->display();
}
public function bugSummary()
public function bugSummary($begin = 0, $end = 0)
{
$this->app->loadLang('bug');
if($begin == 0)
{
$begin = date('Y-m-d', strtotime('last month'));
}
else
{
$begin = date('Y-m-d', strtotime($begin));
}
if($end == 0)
{
$end = date('Y-m-d', strtotime('now'));
}
else
{
$end = date('Y-m-d', strtotime($end));
}
$this->view->header->title = $this->lang->report->bugSummary;
$this->view->bugs = $this->report->getBugs();
$this->view->begin = $begin;
$this->view->end = $end;
$this->view->bugs = $this->report->getBugs($begin, $end);
$this->display();
}
public function workload()
{
$this->view->workload = $this->report->getWorkload();
$this->view->header->title = $this->lang->report->workload;
$this->view->workload = $this->report->getWorkload();
$this->display();
}
}
+23
View File
@@ -0,0 +1,23 @@
function changeDate(begin, end)
{
if(begin.indexOf('-') != -1)
{
var beginarray = begin.split("-");
var begin = '';
for(i=0 ; i < beginarray.length ; i++)
{
begin = begin + beginarray[i];
}
}
if(end.indexOf('-') != -1)
{
var endarray = end.split("-");
var end = '';
for(i=0 ; i < endarray.length ; i++)
{
end = end + endarray[i];
}
}
link = createLink('report', 'bugsummary', 'begin=' + begin + '&end=' + end);
location.href=link;
}
+7
View File
@@ -15,6 +15,7 @@ $lang->report->item = '条目';
$lang->report->value = '值';
$lang->report->percent = '百分比';
$lang->report->undefined = '未设定';
$lang->report->time = '时间';
$lang->report->colors[] = 'AFD8F8';
$lang->report->colors[] = 'F6BD0F';
@@ -33,12 +34,18 @@ $lang->report->singleColor[] = 'F6BD0F';
$lang->report->projectDeviation = '项目偏差报表';
$lang->report->productInfo = '产品信息统计表';
$lang->report->workload = '员工负载表';
$lang->report->bugSummary = 'Bug汇总表';
$lang->report->id = '编号';
$lang->report->project = '项目';
$lang->report->product = '产品';
$lang->report->user = '姓名';
$lang->report->bug = 'Bug';
$lang->report->task = '任务';
$lang->report->estimate = '预计工时';
$lang->report->consumed = '实际消耗';
$lang->report->remain = '剩余';
$lang->report->deviation = '偏差';
$lang->report->deviationRate = '偏差率';
$lang->report->stories = '需求数';
+6 -2
View File
@@ -286,9 +286,13 @@ EOT;
return $products;
}
public function getBugs()
public function getBugs($begin, $end)
{
$bugGroups = $this->dao->select('id, resolution, openedBy')->from(TABLE_BUG)->where('deleted')->eq(0)->fetchGroup('openedBy', 'id');
$bugGroups = $this->dao->select('id, resolution, openedBy')->from(TABLE_BUG)
->where('deleted')->eq(0)
->andWhere('openedDate')->gt($begin)
->andWhere('openedDate')->lt($end)
->fetchGroup('openedBy', 'id');
$bugSummary = array();
foreach($bugGroups as $user => $bugs)
{
+7
View File
@@ -1,4 +1,10 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/ext/view/datepicker.html.php';?>
<style>
.choose-date span, .dp-choose-date{ display:block; float:left; margin:0 10px;}
.dp-applied{float:left;}
.choose-date span{line-height:20px;}
</style>
<table class="cont-lt1">
<tr valign='top'>
<td class='side'>
@@ -9,6 +15,7 @@
</td>
<td class='divider'></td>
<td>
<div class="choose-date mb-10px f-right"><?php echo '<span>' . $lang->report->time . " : </span>" . html::input('date', $begin, "class='select-7 date' onchange='changeDate(this.value, \"$end\")'");?><span> - </span><?php echo html::input('date', $end, "class='select-7 date' onchange='changeDate(\"$begin\", this.value)'");?></div>
<table class='table-1 fixed colored tablesorter datatable border-sep'>
<thead>
<tr class='colhead'>
+53
View File
@@ -0,0 +1,53 @@
<?php include '../../common/view/header.html.php';?>
<table class="cont-lt1">
<tr valign='top'>
<td class='side'>
<div class='box-title'><?php echo $lang->report->list;?></div>
<div class='box-content'>
<?php echo html::a(inlink('workload'), $lang->report->workload);?>
</div>
</td>
<td class='divider'></td>
<td>
<table class='table-1 fixed colored tablesorter datatable border-sep'>
<thead>
<tr class='colhead'>
<th><?php echo $lang->report->user;?></th>
<th colspan="4"><?php echo $lang->report->task;?></th>
<th colspan="3"><?php echo $lang->report->bug;?></th>
</tr>
</thead>
<tbody>
<tr class="a-center">
<td></td>
<td><?php echo $lang->report->project;?></td>
<td><?php echo $lang->report->task;?></td>
<td><?php echo $lang->report->remain;?></td>
<td><?php echo $lang->report->total;?></td>
<td><?php echo $lang->report->product;?></td>
<td><?php echo $lang->report->bug;?></td>
<td><?php echo $lang->report->total;?></td>
</tr>
<?php foreach($workload as $user => $load):?>
<tr class="a-center">
<td rowspan="<?php echo count($load['task']);?>"><?php echo $user;?></td>
<td colspan="4">
<table>
<?php foreach($load['task'] as $project => $task)?>
<tr>
<td><?php echo $task['count']?></td>
<td><?php echo $task['manhour']?></td>
<td rowspan="<?php echo count($load['task']);?>"></td>
</tr>
</table>
</td>
<td colspan="3">
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</td>
</tr>
</table>
<?php include '../../common/view/footer.html.php';?>