* Modify the url when refresh the tree browse in project module.

This commit is contained in:
hufangzhou
2021-11-29 15:20:48 +08:00
parent a42131daee
commit bf1ca5893e
5 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -148,7 +148,7 @@
if(methodLowerCase === 'browse')
{
var viewType = link.params.view || link.params.$2;
if(['bug', 'case', 'caselib'].includes(viewType)) return link.params.from === 'project' ? 'project' : 'qa';
if(['bug', 'case', 'caselib'].includes(viewType)) return link.params.$5 === 'project' ? 'project' : 'qa';
if(viewType === 'doc' && (link.params.from === 'product' || link.params.$5 == 'product')) return 'product';
if(viewType === 'doc' && (link.params.from === 'project' || link.params.$5 == 'project')) return 'project';
+1
View File
@@ -964,6 +964,7 @@ class project extends control
{
$this->loadModel('product');
$this->session->set('bugList', $this->app->getURI(true), 'project');
$this->lang->navGroup->testcase = 'project';
$products = array('0' => $this->lang->product->all) + $this->product->getProducts($projectID, 'all', '', false);
+1 -1
View File
@@ -2592,7 +2592,7 @@ class storyModel extends model
$productParam = ($type == 'byproduct' and $param) ? $param : $this->cookie->storyProductParam;
$branchParam = $branchID = ($type == 'bybranch' and $param !== '') ? $param : $this->cookie->storyBranchParam;
$moduleParam = ($type == 'bymodule' and $param) ? $param : $this->cookie->storyModuleParam;
$modules = (empty($moduleParam) or strpos(',all,unclosed,bymodule,', ",$type,") === false) ? array() : $this->dao->select('*')->from(TABLE_MODULE)->where('path')->like("%,$moduleParam,%")->andWhere('type')->eq('story')->andWhere('deleted')->eq(0)->fetchPairs('id', 'id');
$modules = (empty($moduleParam) or strpos(',all,unclosed,bymodule,', ",$type,") === false) ? array() : $this->dao->select('id')->from(TABLE_MODULE)->where('path')->like("%,$moduleParam,%")->andWhere('type')->eq('story')->andWhere('deleted')->eq(0)->fetchPairs();
if(strpos($branchParam, ',') !== false) list($productParam, $branchParam) = explode(',', $branchParam);
$unclosedStatus = $this->lang->story->statusList;
+6 -6
View File
@@ -943,13 +943,13 @@ class treeModel extends model
if($linkObject == 'story')
{
$t1Table = TABLE_PROJECTSTORY;
$t2Table = TABLE_STORY;
$table1 = TABLE_PROJECTSTORY;
$table2 = TABLE_STORY;
}
if($linkObject == 'case')
{
$t1Table = TABLE_PROJECTCASE;
$t2Table = TABLE_CASE;
$table1 = TABLE_PROJECTCASE;
$table2 = TABLE_CASE;
}
if($linkObject)
@@ -957,8 +957,8 @@ class treeModel extends model
if(strpos(',story,case,', ",$linkObject,") === false) return array();
/* Get object paths of this execution. */
$paths = $this->dao->select('DISTINCT t3.' . $field)->from($t1Table)->alias('t1')
->leftJoin($t2Table)->alias('t2')->on('t1.' . $linkObject . ' = t2.id')
$paths = $this->dao->select('DISTINCT t3.' . $field)->from($table1)->alias('t1')
->leftJoin($table2)->alias('t2')->on('t1.' . $linkObject . ' = t2.id')
->leftJoin(TABLE_MODULE)->alias('t3')->on('t2.module = t3.id')
->where('t1.project')->eq($executionID)
->andWhere('t3.deleted')->eq(0)
+2 -2
View File
@@ -154,8 +154,8 @@ if($viewType == 'doc' or $viewType == 'api')
<div class="table-row row-module row-module-new">
<div class="table-col col-module"><?php echo html::input("modules[]", '', "class='form-control' placeholder='{$name}'");?></div>
<?php if($hasBranch):?>
<?php $branchDisabled = $branch === 'all' ? '' : 'disabled';?>
<div class="table-col col-module"><?php echo html::select("branch[]", $branches, $branch, "class='form-control' $branchDisabled");?></div>
<?php $disabledBranch = $branch === 'all' ? '' : 'disabled';?>
<div class="table-col col-module"><?php echo html::select("branch[]", $branches, $branch, "class='form-control' $disabledBranch");?></div>
<?php if($branch !== 'all') echo html::hidden("branch[]", $branch);?>
<?php endif;?>
<div class="table-col col-shorts"><?php echo html::input("shorts[]", '', "class='form-control' placeholder='{$lang->tree->short}'");?></div>