* finish task #3429.
This commit is contained in:
@@ -869,6 +869,35 @@ class bugModel extends model
|
||||
$this->linkBugToBuild($bugID, $bug->resolvedBuild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch change branch.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @param int $branchID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchChangeBranch($bugIDList, $branchID)
|
||||
{
|
||||
$now = helper::now();
|
||||
$allChanges = array();
|
||||
$oldBugs = $this->getByList($bugIDList);
|
||||
foreach($bugIDList as $bugID)
|
||||
{
|
||||
$oldBug = $oldBugs[$bugID];
|
||||
if($branchID == $oldBug->branch) continue;
|
||||
|
||||
$bug = new stdclass();
|
||||
$bug->lastEditedBy = $this->app->user->account;
|
||||
$bug->lastEditedDate = $now;
|
||||
$bug->branch = $branchID;
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec();
|
||||
if(!dao::isError()) $allChanges[$bugID] = common::createChanges($oldBug, $bug);
|
||||
}
|
||||
return $allChanges;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch change the module of bug.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user