+ finish the task #541 543

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-10-12 01:53:19 +00:00
parent 896dcce902
commit 62b09d8dad
13 changed files with 268 additions and 147 deletions
+29 -1
View File
@@ -161,6 +161,19 @@ class bugModel extends model
if(!dao::isError()) return common::createChanges($oldBug, $bug);
}
/**
* Resolve a bug.
*
* @param int $bugID
* @access public
* @return void
*/
public function confirm($bugID)
{
$now = helper::now();
$this->dao->update(TABLE_BUG)->set('confirm')->eq(1)->set('confirmedBy')->eq($this->app->user->account)->set('confirmedDate')->eq($now)->where('id')->eq($bugID)->exec();
}
/**
* Resolve a bug.
*
@@ -176,6 +189,7 @@ class bugModel extends model
->add('resolvedBy', $this->app->user->account)
->add('resolvedDate', $now)
->add('status', 'resolved')
->add('confirm', 1)
->add('assignedDate', $now)
->add('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)
@@ -208,7 +222,7 @@ class bugModel extends model
->setDefault('assignedTo', $oldBug->resolvedBy)
->add('assignedDate', $now)
->add('resolution', '')
->add('status', 'reactivated')
->add('status', 'active')
->add('resolvedDate', '0000-00-00')
->add('resolvedBy', '')
->add('resolvedBuild', '')
@@ -542,6 +556,20 @@ class bugModel extends model
return $datas;
}
/**
* Get report data of bugs per status.
*
* @access public
* @return array
*/
public function getDataOfBugsPerActivatedCount()
{
$datas = $this->dao->select('activatedCount AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name');
if(!$datas) return array();
foreach($datas as $data) $data->name = $this->lang->bug->report->bugsPerActivatedCount->graph->xAxisName . ':' . $data->name;
return $datas;
}
/**
* Get report data of bugs per type.
*