diff --git a/module/story/control.php b/module/story/control.php index 4c555b8fc9..4a2bb2c468 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1403,7 +1403,6 @@ class story extends control $this->session->set('bugList', $this->app->getURI(true)); $this->session->set('revisionList', $this->app->getURI(true)); - /* Load pager and get tracks. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); diff --git a/module/story/model.php b/module/story/model.php index 3409d3a4e8..05fb2942cc 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3644,19 +3644,30 @@ class storyModel extends model $stories = empty($stories) ? array() : $stories; foreach($stories as $id => $title) { - $stories[$id] = new stdclass(); - $stories[$id]->title = $title; - $stories[$id]->case = $this->loadModel('testcase')->getStoryCases($id); - $stories[$id]->bug = $this->loadModel('bug')->getStoryBugs($id); - $stories[$id]->design = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id'); - $stories[$id]->revision = $this->dao->select('BID, extra')->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('BType')->eq('commit')->andWhere('AID')->in(array_keys($stories[$id]->design))->fetchPairs(); + $stories[$id] = new stdclass(); + $stories[$id]->title = $title; + $stories[$id]->cases = $this->loadModel('testcase')->getStoryCases($id); + $stories[$id]->bugs = $this->loadModel('bug')->getStoryBugs($id); + $stories[$id]->tasks = $this->loadModel('task')->getStoryTasks($id); + $stories[$id]->designs = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id'); + $stories[$id]->revisions = $this->dao->select('BID, extra')->from(TABLE_RELATION) + ->where('AType')->eq('design') + ->andWhere('BType')->eq('commit') + ->andWhere('AID')->in(array_keys($stories[$id]->designs)) + ->fetchPairs(); } $requirement->track = $stories; } /* Get no requirements story. */ - $subdividedStories = $this->dao->select('BID')->from(TABLE_RELATION)->where('AType')->eq('requirement')->andWhere('BType')->eq('story')->andWhere('relation')->eq('subdivideinto')->andWhere('product')->eq($productID)->fetchPairs('BID', 'BID'); + $subdividedStories = $this->dao->select('BID')->from(TABLE_RELATION) + ->where('AType')->eq('requirement') + ->andWhere('BType')->eq('story') + ->andWhere('relation')->eq('subdivideinto') + ->andWhere('product')->eq($productID) + ->fetchPairs('BID', 'BID'); + $stories = $this->getProductStories($productID, 0, 0, 'all', 'story', 'id_desc', true, $subdividedStories); if($stories) $pager->recTotal += 1; @@ -3664,13 +3675,19 @@ class storyModel extends model { foreach($stories as $id => $story) { - $stories[$id] = new stdclass(); - $stories[$id]->title = $story->title; - $stories[$id]->case = $this->loadModel('testcase')->getStoryCases($id); - $stories[$id]->bug = $this->loadModel('bug')->getStoryBugs($id); - $stories[$id]->design = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id'); - $stories[$id]->revision = $this->dao->select('BID, extra')->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('BType')->eq('commit')->andWhere('AID')->in(array_keys($stories[$id]->design))->fetchPairs(); + $stories[$id] = new stdclass(); + $stories[$id]->title = $story->title; + $stories[$id]->cases = $this->loadModel('testcase')->getStoryCases($id); + $stories[$id]->bugs = $this->loadModel('bug')->getStoryBugs($id); + $stories[$id]->tasks = $this->loadModel('task')->getStoryTasks($id); + $stories[$id]->designs = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id'); + $stories[$id]->revisions = $this->dao->select('BID, extra')->from(TABLE_RELATION) + ->where('AType')->eq('design') + ->andWhere('BType')->eq('commit') + ->andWhere('AID')->in(array_keys($stories[$id]->designs)) + ->fetchPairs(); } + $requirements['noRequirement'] = $stories; } diff --git a/module/story/view/track.html.php b/module/story/view/track.html.php index 68a7b22409..2841a05527 100644 --- a/module/story/view/track.html.php +++ b/module/story/view/track.html.php @@ -38,6 +38,7 @@