diff --git a/module/build/control.php b/module/build/control.php index 2d9d1d6c36..c3a68a51fd 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -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); diff --git a/module/execution/model.php b/module/execution/model.php index b9108f8aa1..7b84576830 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -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; } diff --git a/module/product/model.php b/module/product/model.php index 9f78b9598a..5cb37db097 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -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; } }