* fix the bugs of burn down chart.

+ add the link to update the burn down chart.
This commit is contained in:
wangchunsheng
2010-06-04 06:53:24 +00:00
parent d3729c393a
commit 59c4bc226c
6 changed files with 23 additions and 10 deletions
+10 -5
View File
@@ -422,7 +422,7 @@ class projectModel extends model
}
/* 燃烧图所需要的数据。*/
public function getBurnData($projectID = 0, $itemCounts = 21)
public function getBurnData($projectID = 0, $itemCounts = 30)
{
/* 获得项目的信息,和已经计算过的燃烧图数量。*/
$project = $this->getById($projectID);
@@ -442,17 +442,22 @@ class projectModel extends model
$current = helper::today();
if($project->end != '0000-00-00')
{
$period = helper::diffDate($project->end, $project->begin);
$period = helper::diffDate($project->end, $project->begin) + 1;
$counts = $period > $itemCounts ? $itemCounts : $period;
}
else
{
$counts = $itemCounts;
}
for($i = 0; $i <= $counts - $burnCounts; $i ++)
for($i = 0; $i < $counts - $burnCounts; $i ++)
{
$sets[$current]->name = $current;
$sets[$current]->value = '';
if(helper::diffDate($current, $project->end) > 0) break;
if(!isset($sets[$current]))
{
$sets[$current]->name = $current;
$sets[$current]->value = '';
}
$nextDay = date(DT_DATE1, strtotime('next day', strtotime($current)));
$current = $nextDay;
}