* Finish task #76032.
This commit is contained in:
+25
-12
@@ -1888,19 +1888,19 @@ class bugModel extends model
|
||||
/**
|
||||
* Get bugs of a execution.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param int $branchID
|
||||
* @param int $build
|
||||
* @param string $type
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param string $excludeBugs
|
||||
* @param object $pager
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param int $branchID
|
||||
* @param string|array $builds
|
||||
* @param string $type
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param string $excludeBugs
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionBugs($executionID, $productID = 0, $branchID = 'all', $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
|
||||
public function getExecutionBugs($executionID, $productID = 0, $branchID = 'all', $builds = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
|
||||
{
|
||||
$type = strtolower($type);
|
||||
if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy);
|
||||
@@ -1935,15 +1935,28 @@ class bugModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$condition = '';
|
||||
if($builds)
|
||||
{
|
||||
if(!is_array($builds)) $builds = explode(',', $builds);
|
||||
|
||||
$conditions = array();
|
||||
foreach($builds as $build)
|
||||
{
|
||||
if($build) $conditions[] = "FIND_IN_SET('$build', t1.openedBuild)";
|
||||
}
|
||||
$condition = join(' OR ', $conditions);
|
||||
$condition = "($condition)";
|
||||
}
|
||||
$bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
|
||||
->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module=t2.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF(!empty($productID) and $branchID !== 'all')->andWhere('t1.branch')->eq($branchID)->fi()
|
||||
->beginIF(empty($build))->andWhere('t1.execution')->eq($executionID)->fi()
|
||||
->beginIF(empty($builds))->andWhere('t1.execution')->eq($executionID)->fi()
|
||||
->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi()
|
||||
->beginIF($type == 'unresolved')->andWhere('t1.status')->eq('active')->fi()
|
||||
->beginIF($type == 'noclosed')->andWhere('t1.status')->ne('closed')->fi()
|
||||
->beginIF($build)->andWhere("CONCAT(',', t1.openedBuild, ',') like '%,$build,%'")->fi()
|
||||
->beginIF($condition)->andWhere("$condition")->fi()
|
||||
->beginIF(!empty($param))->andWhere('t2.path')->like("%,$param,%")->andWhere('t2.deleted')->eq(0)->fi()
|
||||
->beginIF($excludeBugs)->andWhere('t1.id')->notIN($excludeBugs)->fi()
|
||||
->orderBy($orderBy)
|
||||
|
||||
@@ -292,7 +292,7 @@ class build extends control
|
||||
$this->view->storyPager = $storyPager;
|
||||
|
||||
$generatedBugPager = new pager($type == 'generatedBug' ? $recTotal : 0, $recPerPage, $type == 'generatedBug' ? $pageID : 1);
|
||||
$this->view->generatedBugs = $this->bug->getExecutionBugs($build->execution, $build->product, 'all', $build->id, $type, $param, $type == 'generatedBug' ? $sort : 'status_desc,id_desc', '', $generatedBugPager);
|
||||
$this->view->generatedBugs = $this->bug->getExecutionBugs($build->execution, $build->product, 'all', "$build->id,{$build->builds}", $type, $param, $type == 'generatedBug' ? $sort : 'status_desc,id_desc', '', $generatedBugPager);
|
||||
$this->view->generatedBugPager = $generatedBugPager;
|
||||
|
||||
$this->executeHooks($buildID);
|
||||
|
||||
@@ -57,6 +57,7 @@ $lang->build->notice = new stdclass();
|
||||
$lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified";
|
||||
$lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}";
|
||||
$lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds";
|
||||
$lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version";
|
||||
|
||||
$lang->build->finishStories = " %s {$lang->SRCommon} sind abgeschlossen.";
|
||||
$lang->build->resolvedBugs = ' %s Bugs sind gelöst.';
|
||||
|
||||
@@ -57,6 +57,7 @@ $lang->build->notice = new stdclass();
|
||||
$lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified";
|
||||
$lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}";
|
||||
$lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds";
|
||||
$lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version";
|
||||
|
||||
$lang->build->finishStories = " Finished {$lang->SRCommon} %s";
|
||||
$lang->build->resolvedBugs = ' Resolved Bug %s';
|
||||
|
||||
@@ -57,6 +57,7 @@ $lang->build->notice = new stdclass();
|
||||
$lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified";
|
||||
$lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}";
|
||||
$lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds";
|
||||
$lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version";
|
||||
|
||||
$lang->build->finishStories = " {$lang->SRCommon} Terminées %s";
|
||||
$lang->build->resolvedBugs = ' Bugs Résolus %s';
|
||||
|
||||
@@ -53,6 +53,7 @@ $lang->build->notice = new stdclass();
|
||||
$lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified";
|
||||
$lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}";
|
||||
$lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds";
|
||||
$lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version";
|
||||
|
||||
$lang->build->finishStories = " {$lang->SRCommon} đã kết thúc %s";
|
||||
$lang->build->resolvedBugs = ' Bug đã giải quyết %s';
|
||||
|
||||
@@ -57,6 +57,7 @@ $lang->build->notice = new stdclass();
|
||||
$lang->build->notice->changeProduct = "已经关联{$lang->SRCommon}、Bug或提交测试单的版本,不能修改其所属{$lang->productCommon}";
|
||||
$lang->build->notice->changeExecution = "提交测试单的版本,不能修改其所属{$lang->executionCommon}";
|
||||
$lang->build->notice->changeBuilds = "提交测试单的版本,不能修改关联版本";
|
||||
$lang->build->notice->autoRelation = "相关版本下完成的需求、解决的Bug、产生的Bug将会自动关联到项目版本中";
|
||||
|
||||
$lang->build->finishStories = " 本次共完成 %s 个{$lang->SRCommon}";
|
||||
$lang->build->resolvedBugs = ' 本次共解决 %s 个Bug';
|
||||
|
||||
@@ -336,6 +336,7 @@ class buildModel extends model
|
||||
->remove('resolvedBy,allchecker,files,labels,uid')
|
||||
->get();
|
||||
|
||||
|
||||
$build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_BUILD)->data($build)
|
||||
->autoCheck()
|
||||
@@ -347,6 +348,7 @@ class buildModel extends model
|
||||
if(!dao::isError())
|
||||
{
|
||||
$buildID = $this->dao->lastInsertID();
|
||||
$this->linkChildBuilds($buildID, $build->builds);
|
||||
$this->file->updateObjectID($this->post->uid, $buildID, 'build');
|
||||
$this->file->saveUpload('build', $buildID);
|
||||
$this->loadModel('score')->create('build', 'create', $buildID);
|
||||
@@ -386,6 +388,8 @@ class buildModel extends model
|
||||
if(isset($build->branch) and $oldBuild->branch != $build->branch) $this->dao->update(TABLE_RELEASE)->set('branch')->eq($build->branch)->where('build')->eq($buildID)->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$addBuilds = array_diff(explode(',', $build->builds), explode(',', $oldBuild->builds));
|
||||
if($addBuilds) $this->linkChildBuilds($buildID, $addBuilds);
|
||||
$this->file->updateObjectID($this->post->uid, $buildID, 'build');
|
||||
return common::createChanges($oldBuild, $build);
|
||||
}
|
||||
@@ -561,6 +565,33 @@ class buildModel extends model
|
||||
foreach($this->post->unlinkBugs as $unlinkBugID) $this->action->create('bug', $unlinkBugID, 'unlinkedfrombuild', '', $buildID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bugs and stories associated with child builds.
|
||||
*
|
||||
* @param int $buildID
|
||||
* @param string $childBuilds
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkChildBuilds($buildID, $childBuilds)
|
||||
{
|
||||
$build = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->eq($buildID)->fetch();
|
||||
$buildList = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($childBuilds)->fetchAll();
|
||||
|
||||
foreach($buildList as $buildInfo)
|
||||
{
|
||||
if($buildInfo->bugs) $build->bugs .= ",{$buildInfo->bugs}";
|
||||
if($buildInfo->stories) $build->stories .= ",{$buildInfo->stories}";
|
||||
}
|
||||
|
||||
$build->bugs = explode(',', $build->bugs);
|
||||
$build->bugs = join(',', array_filter($build->bugs));
|
||||
$build->stories = explode(',', $build->stories);
|
||||
$build->stories = join(',', array_filter($build->stories));
|
||||
|
||||
$this->dao->update(TABLE_BUILD)->data($build)->where('id')->eq($buildID)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build action menu.
|
||||
*
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<tr>
|
||||
<th><?php echo $lang->build->builds;?></th>
|
||||
<td id='buildBox'><?php echo html::select('builds', array(), '', "class='form-control chosen' multiple");?></td>
|
||||
<td><?php echo $lang->build->notice->autoRelation;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user