This commit is contained in:
tianshujie
2021-11-15 14:36:48 +08:00
parent 878b22f8ca
commit f849667ce3
+18 -1
View File
@@ -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');