Merge branch 'master_feedback_1133' into 'master'

*Fix feedback #1133 for waterfall project choose stagefilteri with Related pages.

See merge request easycorp/zentaopms!5796
This commit is contained in:
王怡栋
2022-10-19 05:29:12 +00:00
3 changed files with 15 additions and 6 deletions
+6
View File
@@ -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();
+8 -5
View File
@@ -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;
+1 -1
View File
@@ -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);