diff --git a/module/project/control.php b/module/project/control.php index 610f4a4fa3..bdb751d4bf 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -376,9 +376,15 @@ class project extends control $storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $projectID); $users = $this->user->getPairs('noletter'); + /* Get project's product. */ + $productID = 0; + $products = $this->loadModel('product')->getProductsByProject($projectID); + if($products) $productID = key($products); + /* Assign. */ $this->view->header = $header; $this->view->position = $position; + $this->view->productID = $productID; $this->view->stories = $stories; $this->view->orderBy = $orderBy; $this->view->storyTasks = $storyTasks; diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 5b40034917..b7361326fa 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -17,7 +17,7 @@
project->story;?>
id", $lang->story->create); + if($productID) common::printLink('story', 'create', "productID=0&moduleID=0&story=0&project=$project->id", $lang->story->create); if(common::hasPriv('project', 'linkstory')) echo html::a($this->createLink('project', 'linkstory', "project=$project->id"), $lang->project->linkStory); ?>