* finish task #3429.

This commit is contained in:
wangyidong
2017-12-13 15:52:36 +08:00
parent 6006f3e93a
commit 221291c0f3
6 changed files with 148 additions and 0 deletions
+29
View File
@@ -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.
*