diff --git a/module/execution/model.php b/module/execution/model.php index 4ce2c4c80b..dc5864a109 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -109,6 +109,12 @@ class executionModel extends model unset($this->lang->execution->menu->build); } + if($config->edition == 'open' and in_array($execution->attribute, array('request', 'design', 'review'))) + { + unset($this->lang->execution->menu->qa); + unset($this->lang->execution->menu->build); + } + if($executions and (!isset($executions[$executionID]) or !$this->checkPriv($executionID))) $this->accessDenied(); $moduleName = $this->app->getModuleName(); diff --git a/module/product/model.php b/module/product/model.php index 3f79ead694..9b9e565835 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1344,7 +1344,7 @@ class productModel extends model 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); + if(empty($projectID) or $this->config->systemMode == 'classic') return $this->getAllExecutionPairsByProduct($productID, $branch, '', $mode); $project = $this->loadModel('project')->getByID($projectID); $orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc'; @@ -1399,13 +1399,14 @@ class productModel extends model * @param int $productID * @param int $branch * @param int $projectID + * @param string $mode stagefilter or empty * @access public * @return array */ - public function getAllExecutionPairsByProduct($productID, $branch = 0, $projectID = 0) + public function getAllExecutionPairsByProduct($productID, $branch = 0, $projectID = 0, $mode = '') { if(empty($productID)) return array(); - $executions = $this->dao->select('t2.id,t2.project,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1') + $executions = $this->dao->select('t2.id,t2.project,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.type')->in('stage,sprint,kanban') @@ -1438,8 +1439,10 @@ class productModel extends model $executionPairs = $executionPairs + $execution->children; continue; } - if($this->config->systemMode == 'new' and isset($projectPairs[$execution->project])) $executionPairs[$execution->id] = $projectPairs[$execution->project] . '/' . $execution->name; - if($this->config->systemMode == 'classic') $executionPairs[$execution->id] = $execution->name; + /* Some stage of waterfall not need.*/ + if(strpos($mode, 'stagefilter') !== false and in_array($execution->attribute, array('request', 'design', 'review'))) continue; + if($this->config->systemMode == 'new' and isset($projectPairs[$execution->project])) $executionPairs[$execution->id] = $projectPairs[$execution->project] . '/' . $execution->name; + if($this->config->systemMode == 'classic') $executionPairs[$execution->id] = $execution->name; } return $executionPairs; diff --git a/module/testtask/control.php b/module/testtask/control.php index 053120b107..1206db6e9a 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -246,7 +246,7 @@ class testtask extends control /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); - $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID); + $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'stagefilter'); $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); $execution = $this->loadModel('execution')->getByID($executionID);