diff --git a/module/execution/control.php b/module/execution/control.php index 638d79f8d9..b87d2d2788 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2027,7 +2027,7 @@ class execution extends control $productPlans = array(0 => ''); $linkedBranches = array(); $linkedBranchList = array(); - $linkedProducts = $this->product->getProducts($executionID, 'all', '', true, $linkedProductIdList); + $linkedProducts = $this->product->getProducts($executionID, 'all', '', true, $linkedProductIdList, false); $plans = $this->productplan->getGroupByProduct(array_keys($linkedProducts), 'skipParent|unexpired'); $executionStories = $this->project->getStoriesByProject($executionID); @@ -2037,7 +2037,7 @@ class execution extends control $linkedStoryIDList = array(); foreach($linkedProducts as $productID => $linkedProduct) { - if(!isset($allProducts[$productID])) $allProducts[$productID] = $linkedProduct->name; + if(!isset($allProducts[$productID])) $allProducts[$productID] = $linkedProduct->deleted ? $linkedProduct->name . "({$this->lang->product->deleted})" : $linkedProduct->name; $productPlans[$productID] = array(); foreach($branches[$productID] as $branchID => $branch) diff --git a/module/product/model.php b/module/product/model.php index 1ae9044709..a48713473a 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -382,16 +382,17 @@ class productModel extends model * @param int $projectID * @param string $status all|noclosed * @param string|array $append + * @param bool $noDeleted * @access public * @return array */ - public function getProductPairsByProject($projectID = 0, $status = 'all', $append = '') + public function getProductPairsByProject($projectID = 0, $status = 'all', $append = '', $noDeleted = true) { - $products = empty($projectID) ? $this->getList(0, 'all', 0, 0, 'all') : $this->getProducts($projectID, $status, '', true, $append); + $products = empty($projectID) ? $this->getList(0, 'all', 0, 0, 'all') : $this->getProducts($projectID, $status, '', true, $append, $noDeleted); $pairs = array(); if(!empty($products)) { - foreach($products as $product) $pairs[$product->id] = $product->name; + foreach($products as $product) $pairs[$product->id] = $product->deleted ? $product->name . "({$this->lang->product->deleted})" : $product->name; } return $pairs; @@ -424,10 +425,11 @@ class productModel extends model * @param string $orderBy * @param bool $withBranch * @param string|array $append + * @param bool $noDeleted * @access public * @return array */ - public function getProducts($projectID = 0, $status = 'all', $orderBy = '', $withBranch = true, $append = '') + public function getProducts($projectID = 0, $status = 'all', $orderBy = '', $withBranch = true, $append = '', $noDeleted = true) { if(defined('TUTORIAL')) { @@ -441,7 +443,8 @@ class productModel extends model $projectProducts = $this->dao->select("t1.branch, t1.plan, t2.*") ->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') - ->where('t2.deleted')->eq(0) + ->where('1=1') + ->beginIF($noDeleted)->andWhere('t2.deleted')->eq(0)->fi() ->beginIF(!empty($projectID))->andWhere('t1.project')->in($projectID)->fi() ->beginIF(!$this->app->user->admin and $this->config->vision == 'rnd')->andWhere('t2.id')->in($views)->fi() ->andWhere('t2.vision')->eq($this->config->vision) diff --git a/module/programplan/control.php b/module/programplan/control.php index 700ca595b3..615499c657 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -156,7 +156,7 @@ class programplan extends control $productList = array(); $this->app->loadLang('stage'); $project = $this->loadModel('project')->getById($projectID); - if($this->session->hasProduct) $productList = $this->loadModel('product')->getProductPairsByProject($projectID); + if($this->session->hasProduct) $productList = $this->loadModel('product')->getProductPairsByProject($projectID, 'all', '', false); $this->view->title = $this->lang->programplan->create . $this->lang->colon . $project->name; $this->view->position[] = html::a($this->createLink('programplan', 'browse', "projectID=$projectID"), $project->name); diff --git a/module/project/control.php b/module/project/control.php index f88b9241c5..343609f0f6 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1116,7 +1116,7 @@ class project extends control $this->view->executionStats = $executionStats; $this->view->showToggleIcon = $showToggleIcon; - $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); + $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID, 'all', '', false); $this->view->productID = $productID; $this->view->projectID = $projectID; $this->view->project = $project;