* Fix bug #11571.
This commit is contained in:
@@ -801,7 +801,7 @@ class execution extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->type = $this->session->executionStoryBrowseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->moduleTree = $this->loadModel('tree')->getExecutionStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createExecutionStoryLink'));
|
||||
$this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createStoryLink'));
|
||||
$this->view->tabID = 'story';
|
||||
$this->view->storyTasks = $storyTasks;
|
||||
$this->view->storyBugs = $storyBugs;
|
||||
|
||||
+14
-19
@@ -174,25 +174,20 @@ class product extends control
|
||||
{
|
||||
setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
$browseType = 'unclosed';
|
||||
if($this->app->rawModule == 'projectstory' and empty($productID))
|
||||
{
|
||||
$moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->project, 0, array('treeModel', 'createProjectStoryLink'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch, "¶m=$param&storyType=$storyType");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->app->rawModule == 'projectstory' and empty($productID))
|
||||
{
|
||||
$moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->project, 0, array('treeModel', 'createProjectStoryLink'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch, "¶m=$param&storyType=$storyType");
|
||||
}
|
||||
$branch = (int)$this->cookie->treeBranch;
|
||||
}
|
||||
|
||||
/* If in project story and not chose product, get project story mdoules. */
|
||||
if($this->app->rawModule == 'projectstory' and empty($productID))
|
||||
{
|
||||
$moduleTree = $this->tree->getProjectStoryTreeMenu($projectID, 0, array('treeModel', $createModuleLink));
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), array('projectID' => $projectID, 'productID' => $productID), $branch, "¶m=$param&storyType=$storyType");
|
||||
}
|
||||
|
||||
if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType);
|
||||
@@ -215,12 +210,12 @@ class product extends control
|
||||
if($this->app->rawModule == 'projectstory')
|
||||
{
|
||||
if(!empty($product)) $this->session->set('currentProductType', $product->type);
|
||||
$this->products = $this->loadModel('project')->getProducts($this->session->project, false);
|
||||
$projectProducts = $this->product->getProducts($this->session->project);
|
||||
$this->products = $this->loadModel('project')->getProducts($projectID, false);
|
||||
$projectProducts = $this->product->getProducts($projectID);
|
||||
$productPlans = $this->execution->getPlans($projectProducts);
|
||||
|
||||
if($browseType == 'bybranch') $param = $branch;
|
||||
$stories = $this->story->getExecutionStories($this->session->project, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager);
|
||||
$stories = $this->story->getExecutionStories($projectID, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+16
-23
@@ -785,7 +785,7 @@ class treeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get execution story tree menu.
|
||||
* Get project story tree menu.
|
||||
*
|
||||
* @param int $rootID
|
||||
* @param int $startModule
|
||||
@@ -793,9 +793,9 @@ class treeModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getExecutionStoryTreeMenu($rootID, $startModule = 0, $userFunc)
|
||||
public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc)
|
||||
{
|
||||
$extra['executionID'] = $rootID;
|
||||
$extra['projectID'] = $rootID;
|
||||
$menu = "<ul id='modules' class='tree' data-ride='tree' data-name='tree-story'>";
|
||||
$startModulePath = '';
|
||||
if($startModule > 0)
|
||||
@@ -817,7 +817,6 @@ class treeModel extends model
|
||||
$productNum = count($products);
|
||||
foreach($products as $id => $product)
|
||||
{
|
||||
$extra['productID'] = $id;
|
||||
$projectProductLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id");
|
||||
$executionProductLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byProduct&praram=$id");
|
||||
$link = $this->app->rawModule == 'projectstory' ? $projectProductLink : $executionProductLink;
|
||||
@@ -1013,12 +1012,22 @@ class treeModel extends model
|
||||
*
|
||||
* @param string $type
|
||||
* @param object $module
|
||||
* @param array $extra
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createStoryLink($type, $module)
|
||||
public function createStoryLink($type, $module, $extra = array())
|
||||
{
|
||||
return html::a(helper::createLink($this->app->rawModule, $this->app->rawMethod, "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
if(isset($extra['projectID']))
|
||||
{
|
||||
$productID = zget($extra , 'productID', 0);
|
||||
$projectID = $extra['projectID'];
|
||||
return html::a(helper::createLink('projectstory', 'story', "projectID=$projectID&productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
return html::a(helper::createLink('product', 'browse', "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1065,23 +1074,7 @@ class treeModel extends model
|
||||
public function createProjectStoryLink($type, $module, $extra)
|
||||
{
|
||||
$productID = $extra['productID'];
|
||||
return html::a(helper::createLink('projectstory', 'story', "projectID={$extra['executionID']}productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create link of execution story.
|
||||
*
|
||||
* @param string $type
|
||||
* @param object $module
|
||||
* @param array $extra
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createExecutionStoryLink($type, $module, $extra)
|
||||
{
|
||||
$executionID = $extra['executionID'];
|
||||
$productID = $extra['productID'];
|
||||
return html::a(helper::createLink('execution', 'story', "executionID={$executionID}&orderBy=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
return html::a(helper::createLink('projectstory', 'story', "projectID={$extra['executionID']}&productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user