* Finish task#42862

This commit is contained in:
zenggang
2021-09-23 15:18:34 +08:00
parent f182feb33c
commit d77af31e52
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ class build extends control
if($this->app->tab == 'project')
{
$this->loadModel('project')->setMenu($projectID);
$executions = $this->execution->getPairs($projectID);
$executions = $this->execution->getPairs($projectID, 'all', 'waterfallfilter');
$executionID = empty($executionID) ? key($executions) : $executionID;
$this->session->set('project', $projectID);
}
@@ -136,7 +136,7 @@ class build extends control
$execution->name = '';
}
$executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project);
$executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'waterfallfilter');
if(!isset($executions[$build->execution])) $executions[$build->execution] = $execution->name;
$productGroups = $this->execution->getProducts($build->execution);
+2 -1
View File
@@ -986,7 +986,7 @@ class executionModel extends model
*
* @param int $projectID
* @param string $type all|sprint|stage|kanban
* @param string $mode all|noclosed or empty
* @param string $mode all|noclosed|waterfallfilter or empty
* @access public
* @return array
*/
@@ -1024,6 +1024,7 @@ class executionModel extends model
foreach($executions as $execution)
{
if(strpos($mode, 'noclosed') !== false and ($execution->status == 'done' or $execution->status == 'closed')) continue;
if(strpos($mode, 'waterfallfilter') !== false and isset($executionModel) and $executionModel == 'waterfall' and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need.
$pairs[$execution->id] = $execution->name;
}
+4 -2
View File
@@ -1026,10 +1026,11 @@ class productModel extends model
* @param int $branch
* @param string $orderBy
* @param int $projectID
* @param string $mode waterfallfilter or empty
* @access public
* @return array
*/
public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0)
public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0, $mode = '')
{
if(empty($productID)) return array();
if(empty($projectID) or $this->config->systemMode == 'classic') return $this->getAllExecutionPairsByProduct($productID, $branch);
@@ -1037,7 +1038,7 @@ class productModel extends model
$project = $this->loadModel('project')->getByID($projectID);
$orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc';
$executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent,t2.attribute')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.project')->eq($projectID)
@@ -1068,6 +1069,7 @@ class productModel extends model
$executionList = $executionList + $execution->children;
continue;
}
if(strpos($mode, 'waterfallfilter') !== false and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need.
$executionList[$execution->id] = $execution->name;
}
}