* Modify the code.
This commit is contained in:
@@ -181,6 +181,9 @@ class bug extends control
|
||||
/* Process bug for check story changed. */
|
||||
$bugs = $this->loadModel('story')->checkNeedConfirm($bugs);
|
||||
|
||||
/* Process the openedBuild and resolvedBuild fields. */
|
||||
$bugs = $this->bug->processBuildForBugs($bugs);
|
||||
|
||||
/* Get story and task id list. */
|
||||
$storyIdList = $taskIdList = array();
|
||||
foreach($bugs as $bug)
|
||||
|
||||
@@ -1375,6 +1375,35 @@ class bugModel extends model
|
||||
$this->loadModel('search')->setSearchParams($this->config->bug->search);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the openedBuild and resolvedBuild fields for bugs.
|
||||
*
|
||||
* @param array $bugs
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function processBuildForBugs($bugs)
|
||||
{
|
||||
$productIdList = array();
|
||||
foreach($bugs as $bug) $productIdList[$bug->id] = $bug->product;
|
||||
$builds = $this->loadModel('build')->getBuildPairs(array_unique($productIdList), 'all', $params = '');
|
||||
|
||||
/* Process the openedBuild and resolvedBuild fields. */
|
||||
foreach($bugs as $key => $bug)
|
||||
{
|
||||
$openBuildIdList = explode(',', $bug->openedBuild);
|
||||
$openedBuild = '';
|
||||
foreach($openBuildIdList as $buildID)
|
||||
{
|
||||
$openedBuild .= isset($builds[$buildID]) ? $builds[$buildID] : $buildID;
|
||||
$openedBuild .= ',';
|
||||
}
|
||||
$bug->openedBuild = rtrim($openedBuild, ',');
|
||||
$bug->resolvedBuild = isset($builds[$bug->resolvedBuild]) ? $builds[$bug->resolvedBuild] : $bug->resolvedBuild;
|
||||
}
|
||||
return $bugs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract accounts from some bugs.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user