* finish task#1685.
This commit is contained in:
@@ -451,6 +451,38 @@ class bugModel extends model
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch resolve bugs.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @param string $resolution
|
||||
* @param string $resolvedBuild
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchResolve($bugIDList, $resolution, $resolvedBuild)
|
||||
{
|
||||
$now = helper::now();
|
||||
foreach($bugIDList as $bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
if($oldBug->status != 'active') continue;
|
||||
$bug = new stdClass();
|
||||
$bug->resolution = $resolution;
|
||||
$bug->resolvedBuild = $resolution == 'fixed' ? $resolvedBuild : '';
|
||||
$bug->resolvedBy = $this->app->user->account;
|
||||
$bug->resolvedDate = $now;
|
||||
$bug->status = 'resolved';
|
||||
$bug->confirmed = 1;
|
||||
$bug->assignedTo = $oldBug->openedBy;
|
||||
$bug->assignedDate = $now;
|
||||
$bug->lastEditedBy = $this->app->user->account;
|
||||
$bug->lastEditedDate = $now;
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a bug.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user