* adjust the products of current project, if no products, no create story link.

This commit is contained in:
wangchunsheng
2011-12-07 06:50:24 +00:00
parent 8f7af22077
commit 31f0581a07
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -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;
+1 -1
View File
@@ -17,7 +17,7 @@
<div class='f-left'><?php echo $lang->project->story;?></div>
<div class='f-right'>
<?php
common::printLink('story', 'create', "productID=0&moduleID=0&story=0&project=$project->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);
?>
</div>