diff --git a/module/build/model.php b/module/build/model.php index b772f63115..cc3d94961a 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -293,7 +293,7 @@ class buildModel extends model ->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build') ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.product')->in($products) - ->andWhere('t1.PRJ')->eq($this->session->PRJ) + ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.PRJ')->eq($this->session->PRJ)->fi() ->beginIF($branch)->andWhere('t1.branch')->in("0,$branch")->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); diff --git a/module/caselib/model.php b/module/caselib/model.php index d62bb81110..e27644a7c4 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -275,7 +275,7 @@ class caselibModel extends model { $cases = $this->dao->select('*')->from(TABLE_CASE) ->where('lib')->eq((int)$libID) - ->andWhere('PRJ')->eq($this->session->PRJ) + ->beginIF($this->lang->navGroup->caselib != 'qa')->andWhere('PRJ')->eq($this->session->PRJ)->fi() ->andWhere('product')->eq(0) ->beginIF($moduleIdList)->andWhere('module')->in($moduleIdList)->fi() ->beginIF($browseType == 'wait')->andWhere('status')->eq($browseType)->fi() @@ -312,7 +312,7 @@ class caselibModel extends model $cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery) ->beginIF($queryLibID != 'all')->andWhere('lib')->eq((int)$libID)->fi() - ->andWhere('PRJ')->eq($this->session->PRJ) + ->beginIF($this->lang->navGroup->caselib != 'qa')->andWhere('PRJ')->eq($this->session->PRJ)->fi() ->andWhere('product')->eq(0) ->andWhere('deleted')->eq(0) ->orderBy($sort)->page($pager)->fetchAll(); @@ -627,7 +627,7 @@ class caselibModel extends model $data[$i]->openedDate = $now; $data[$i]->status = $forceNotReview ? 'normal' : 'wait'; $data[$i]->version = 1; - if($this->config->systemMode == 'new') $data[$i]->PRJ = $this->session->PRJ; + if($this->config->systemMode == 'new' and $this->lang->navGroup->caselib != 'qa') $data[$i]->PRJ = $this->session->PRJ; $this->dao->insert(TABLE_CASE)->data($data[$i]) ->autoCheck() diff --git a/module/testtask/control.php b/module/testtask/control.php index c3c27f09b5..cf64e6ff3a 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -175,7 +175,8 @@ class testtask extends control /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); - $projects = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID); + $projectID = $this->lang->navGroup->testtask == 'project' ? $this->session->PRJ : 0; + $projects = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_asc', $projectID); $builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk', true); /* Set menu. */