Merge branch 'sprint/239_liuruogu_bug' into 'zentaopms_239'

* Fix bug for menu light.

See merge request easycorp/zentaopms!5472
This commit is contained in:
刘刚
2022-09-22 05:50:54 +00:00
3 changed files with 10 additions and 3 deletions
+5 -2
View File
@@ -1136,12 +1136,14 @@ class productModel extends model
$productIdList = ($this->app->tab == 'project' and empty($productID)) ? array_keys($products) : $productID;
$branchParam = ($this->app->tab == 'project' and empty($productID)) ? '' : $branch;
$projectID = ($this->app->tab == 'project' and empty($projectID)) ? $this->session->project : $projectID;
$productInfo = $this->getById($productID);
$this->config->product->search['actionURL'] = $actionURL;
$this->config->product->search['queryID'] = $queryID;
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productIdList, $branchParam);
$product = ($this->app->tab == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]);
$product = ($this->app->tab == 'project' and empty($productID)) ? $products : array($productID => $productInfo->name);
$this->config->product->search['params']['product']['values'] = $product + array('all' => $this->lang->product->allProduct);
/* Get modules. */
@@ -1186,7 +1188,6 @@ class productModel extends model
}
$this->config->product->search['params']['module']['values'] = array('' => '') + $modules;
$productInfo = $this->getById($productID);
if(!$productID or $productInfo->type == 'normal' or $this->app->tab == 'assetlib')
{
unset($this->config->product->search['fields']['branch']);
@@ -1198,6 +1199,8 @@ class productModel extends model
$this->config->product->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty');
}
if(!empty($productInfo->shadow)) unset($this->config->product->search['fields']['product']);
$this->loadModel('search')->setSearchParams($this->config->product->search);
}
+4
View File
@@ -58,6 +58,10 @@
$otherParam = "storyID=&projectID={$this->session->project}";
$tab = 'project';
}
else if($this->app->rawModule == 'execution')
{
$tab = 'execution';
}
?>
<?php common::printLink('story', 'create', "productID={$story->product}&branch={$story->branch}&moduleID={$story->module}&$otherParam&bugID=0&planID=0&todoID=0&extra=&type=$story->type", "<i class='icon icon-plus'></i> " . $lang->story->create, '', "class='btn btn-primary' data-app='$tab'"); ?>
<?php endif;?>
+1 -1
View File
@@ -445,7 +445,7 @@ class treeModel extends model
{
$this->buildTree($treeMenu, $module, $type, $userFunc, $extra, $branch);
}
elseif(isset($executionModules[$module->id]))
elseif(isset($executionModules[$module->id]) || !empty($product->shadow))
{
$this->buildTree($treeMenu, $module, $type, $userFunc, $extra, $branch);
}