diff --git a/module/story/control.php b/module/story/control.php index 67f2a48224..3c27e786e4 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1331,14 +1331,17 @@ class story extends control $this->view->hiddenURS = false; if(!empty($product->shadow)) { - $projectID = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($product->id)->fetch('project'); - $project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch(); + $projectModel = $this->dao->select('t2.model')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.product')->eq($product->id) + ->andWhere('t2.type')->eq('project') + ->fetch('model'); - if($project->model === 'waterfall') + if($projectModel === 'waterfall') { $this->view->hiddenPlan = true; } - elseif($project->model === 'kanban') + elseif($projectModel === 'kanban') { $this->view->hiddenPlan = true; $this->view->hiddenURS = true;