From 795a344643e0dbd7e830843e5494dbfdc05d52b5 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 22 Sep 2022 15:40:52 +0800 Subject: [PATCH] * Hide the project's name when create tesk task for a no-product project. --- module/product/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 099db7ece5..19e477fdf6 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1480,7 +1480,7 @@ class productModel extends model public function getAllExecutionPairsByProduct($productID, $branch = 0, $projectID = 0) { 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.hasProduct')->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') @@ -1500,7 +1500,7 @@ class productModel extends model { if($execution->grade == 2 && isset($executions[$execution->parent])) { - $execution->name = $projectPairs[$execution->project] . '/' . $executions[$execution->parent]->name . '/' . $execution->name; + $execution->name = ($execution->hasProduct ? $projectPairs[$execution->project] . '/' : '') . $executions[$execution->parent]->name . '/' . $execution->name; $executions[$execution->parent]->children[$id] = $execution->name; unset($executions[$id]); } @@ -1513,7 +1513,7 @@ 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 == 'new' and isset($projectPairs[$execution->project])) $executionPairs[$execution->id] = ($execution->hasProduct ? $projectPairs[$execution->project] . '/' : '') . $execution->name; if($this->config->systemMode == 'classic') $executionPairs[$execution->id] = $execution->name; }