* finish task #1803.

This commit is contained in:
wyd621
2014-03-13 01:58:09 +00:00
parent 4c17b7b38d
commit 38e449f8bb
11 changed files with 169 additions and 15 deletions
+22 -7
View File
@@ -194,6 +194,21 @@ class bugModel extends model
return $bug;
}
/**
* Get bug list.
*
* @param int|array|string $bugIDList
* @access public
* @return array
*/
public function getList($bugIDList = 0)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
->beginIF($bugIDList)->andWhere('id')->in($bugIDList)->fi()
->fetchAll('id');
}
/**
* getActiveBugs
*
@@ -353,7 +368,7 @@ class bugModel extends model
*
* @param int $bugID
* @access public
* @return void
* @return string
*/
public function assign($bugID)
{
@@ -406,11 +421,11 @@ class bugModel extends model
*/
public function batchConfirm($bugIDList)
{
$now = helper::now();
$now = helper::now();
$bugs = $this->getList($bugIDList);
foreach($bugIDList as $bugID)
{
$oldBug = $this->getById($bugID);
if($oldBug->confirmed) continue;
if($bugs[$bugID]->confirmed) continue;
$bug = new stdclass();
$bug->assignedTo = $this->app->user->account;
@@ -466,10 +481,11 @@ class bugModel extends model
*/
public function batchResolve($bugIDList, $resolution, $resolvedBuild)
{
$now = helper::now();
$now = helper::now();
$bugs = $this->getList($bugIDList);
foreach($bugIDList as $bugID)
{
$oldBug = $this->getById($bugID);
$oldBug = $bugs[$bugID];
if($oldBug->status != 'active') continue;
$bug = new stdClass();
$bug->resolution = $resolution;
@@ -528,7 +544,6 @@ class bugModel extends model
*/
public function close($bugID)
{
$oldBug = $this->getById($bugID);
$now = helper::now();
$bug = fixer::input('post')
->add('assignedTo', 'closed')