Merge branch 'sprint/170_hufangzhou_tree' into 'sprint/170'

* Deal with the branch is empty.

See merge request easycorp/zentaopms!442
This commit is contained in:
孙广明
2021-11-12 07:30:52 +00:00
6 changed files with 17 additions and 13 deletions
+7 -3
View File
@@ -111,7 +111,7 @@ class bug extends control
$browseType = strtolower($browseType);
/* Set productID, moduleID, queryID and branch. */
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
@@ -125,7 +125,7 @@ class bug extends control
setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
$_COOKIE['bugBranch'] = 0;
setcookie('bugBranch', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
if($browseType == '') setcookie('treeBranch', $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
}
if($browseType == 'bybranch') setcookie('bugBranch', $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('bugBrowseType', $browseType);
@@ -142,6 +142,10 @@ class bug extends control
setcookie('treeBranch', $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
$browseType = 'unclosed';
}
else
{
$branch = $this->cookie->treeBranch;
}
if($this->projectID and !$productID)
{
@@ -149,7 +153,7 @@ class bug extends control
}
else
{
$moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), '', $browseType == '' ? $branch : $this->cookie->treeBranch);
$moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), '', $branch);
}
if(($browseType != 'bymodule' && $browseType != 'bybranch')) $this->session->set('bugBrowseType', $browseType);
+3 -3
View File
@@ -81,7 +81,7 @@ class product extends control
$this->app->loadLang('execution');
$this->app->loadLang('project');
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
$this->product->setMenu($productID, $branch);
@@ -126,7 +126,7 @@ class product extends control
public function browse($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
{
$productID = $this->app->tab != 'project' ? $this->product->saveState($productID, $this->products) : $productID;
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
/* Set menu. */
if($this->app->tab == 'product')
@@ -764,7 +764,7 @@ class product extends control
*/
public function roadmap($productID, $branch = '')
{
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
+1 -1
View File
@@ -29,7 +29,7 @@ class qaModel extends model
die(js::error($this->lang->product->accessDenied) . js::locate('back'));
}
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
if(!in_array($this->app->rawModule, $this->config->qa->noDropMenuModule)) $this->lang->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $extra, $branch);
+1 -1
View File
@@ -1540,7 +1540,7 @@ class story extends control
*/
public function track($productID, $branch = '', $projectID = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
/* Set menu. The projectstory module does not execute. */
+4 -4
View File
@@ -105,7 +105,7 @@ class testcase extends control
/* Set browseType, productID, moduleID and queryID. */
$productID = $this->app->tab != 'project' ? $this->product->saveState($productID, $this->products) : $productID;
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
@@ -227,7 +227,7 @@ class testcase extends control
{
$groupBy = empty($groupBy) ? 'story' : $groupBy;
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = (int)$this->cookie->preBranch;
if($branch === '') $branch = $this->cookie->preBranch;
$this->app->loadLang('testtask');
@@ -352,7 +352,7 @@ class testcase extends control
/* Set productID and branch. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = (int)$this->cookie->preBranch;
if($branch === '') $branch = $this->cookie->preBranch;
/* Set menu. */
if($this->app->tab == 'project')
@@ -510,7 +510,7 @@ class testcase extends control
/* Set productID and currentModuleID. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = (int)$this->cookie->preBranch;
if($branch === '') $branch = $this->cookie->preBranch;
if($storyID and empty($moduleID))
{
$story = $this->loadModel('story')->getByID($storyID);
+1 -1
View File
@@ -109,7 +109,7 @@ class testtask extends control
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
$this->loadModel('qa')->setMenu($this->products, $productID, $branch, $type);
/* Load pager. */