* Fix tree methods.

This commit is contained in:
朱金勇
2023-12-24 22:10:44 +08:00
parent a29e2b11fb
commit cc50de857c
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -820,7 +820,7 @@ class bugZen extends bug
protected function setOptionMenu(object $bug, object $product): object
{
$bug = $this->getBugBranches($bug, $product);
$moduleOptionMenu = $this->tree->getOptionMenu($bug->productID, 'bug', 0, ($bug->branch === 'all' or !isset($bug->branches[$bug->branch])) ? 0 : $bug->branch);
$moduleOptionMenu = $this->tree->getOptionMenu($bug->productID, 'bug', 0, ($bug->branch === 'all' or !isset($bug->branches[$bug->branch])) ? 'all' : (string)$bug->branch);
if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID={$bug->productID}&view=story")));
$this->view->moduleOptionMenu = $moduleOptionMenu;
@@ -1194,7 +1194,7 @@ class bugZen extends bug
$execution = $this->loadModel('execution')->getByID($bug->execution);
/* Get module option menu. */
$moduleOptionMenu = $this->tree->getOptionMenu($bug->product, 'bug', 0, $bug->branch);
$moduleOptionMenu = $this->tree->getOptionMenu($bug->product, 'bug', 0, (string)$bug->branch);
if(!isset($moduleOptionMenu[$bug->module])) $moduleOptionMenu += $this->tree->getModulesName((array)$bug->module);
/* Get bugs of current product. */
@@ -1416,7 +1416,7 @@ class bugZen extends bug
$this->view->builds = $builds;
$this->view->branch = $branch;
$this->view->branches = $branches;
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($product->id, 'bug', 0, $branch === 'all' ? 0 : (int)$branch);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($product->id, 'bug', 0, $branch === 'all' ? 'all' : (string)$branch);
}
/**
+1 -1
View File
@@ -620,7 +620,7 @@ class docModel extends model
list($objects['project'], $objects['execution'], $objects['product']) = $this->getObjectsByDoc(array_keys($docs));
foreach($docs as $docID => $doc)
{
if(!isset($modules[$doc->lib])) $modules[$doc->lib] = $this->tree->getOptionMenu((int)$doc->lib, 'doc', 0, 0, 'nodeleted', 'all', ' > ');
if(!isset($modules[$doc->lib])) $modules[$doc->lib] = $this->tree->getOptionMenu((int)$doc->lib, 'doc', 0, 'all', 'nodeleted', 'all', ' > ');
$doc->moduleName = zget($modules[$doc->lib], $doc->module);
$doc->moduleName = ltrim($doc->moduleName, '/');