* Fix bug #16296.
This commit is contained in:
+18
-1
@@ -372,10 +372,11 @@ class treeModel extends model
|
||||
{
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
$this->loadModel('branch');
|
||||
$branches = array($branch => '');
|
||||
if($branch)
|
||||
{
|
||||
$branchName = $this->loadModel('branch')->getById($branch);
|
||||
$branchName = $this->branch->getById($branch);
|
||||
$branches = array($branch => $branchName);
|
||||
$extra = array('rootID' => $rootID, 'branch' => $branch);
|
||||
}
|
||||
@@ -386,6 +387,22 @@ class treeModel extends model
|
||||
{
|
||||
if($product->type != 'normal') $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($rootID, 'noempty');
|
||||
}
|
||||
elseif($type == 'story' and $this->app->rawModule == 'projectstory')
|
||||
{
|
||||
$projectID = zget($extra, 'projectID', 0);
|
||||
if($product->type != 'normal' and $projectID)
|
||||
{
|
||||
$projectBranches = $this->dao->select('branch')->from(TABLE_PROJECTPRODUCT)
|
||||
->where('project')->eq($projectID)
|
||||
->andWhere('product')->eq($product->id)
|
||||
->fetchPairs();
|
||||
|
||||
if(isset($projectBranches[BRANCH_MAIN])) $branches = array(BRANCH_MAIN => $this->lang->branch->main);
|
||||
$branches += $this->dao->select('id, name')->from(TABLE_BRANCH)
|
||||
->where('id')->in($projectBranches)
|
||||
->fetchPairs();
|
||||
}
|
||||
}
|
||||
|
||||
/* Add for task #1945. check the module has case or no. */
|
||||
if($type == 'case' and !empty($extra)) $this->loadModel('testtask');
|
||||
|
||||
Reference in New Issue
Block a user