diff --git a/module/execution/model.php b/module/execution/model.php index 4902912395..59e767e243 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3675,7 +3675,13 @@ class executionModel extends model if($changedAccounts) { $this->loadModel('user')->updateUserView($projectID, $projectType, $changedAccounts); - $linkedProducts = $this->loadModel('product')->getProductPairsByProject($projectID); + $linkedProducts = $this->dao->select("t2.id")->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') + ->where('t2.deleted')->eq(0) + ->andWhere('t1.project')->eq($projectID) + ->andWhere('t2.vision')->eq($this->config->vision) + ->fetchPairs(); + if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts); } } diff --git a/module/project/model.php b/module/project/model.php index 10db9ccdc2..e089889aaf 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2204,7 +2204,12 @@ class projectModel extends model $changedAccounts = array_unique($changedAccounts); $childSprints = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($projectID)->andWhere('type')->in('stage,sprint')->andWhere('deleted')->eq('0')->fetchPairs(); - $linkedProducts = $this->loadModel('product')->getProductPairsByProject($projectID); + $linkedProducts = $this->dao->select("t2.id")->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') + ->where('t2.deleted')->eq(0) + ->andWhere('t1.project')->eq($projectID) + ->andWhere('t2.vision')->eq($this->config->vision) + ->fetchPairs(); $this->loadModel('user')->updateUserView(array($projectID), 'project', $changedAccounts); if(!empty($childSprints)) $this->user->updateUserView($childSprints, 'sprint', $changedAccounts);