From cc50de857ccfff37de9acd32f0703e2a3ea85168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Sun, 24 Dec 2023 22:10:44 +0800 Subject: [PATCH] * Fix tree methods. --- module/bug/zen.php | 6 +++--- module/doc/model.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/bug/zen.php b/module/bug/zen.php index 4a5979e920..6700cfeeee 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -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); } /** diff --git a/module/doc/model.php b/module/doc/model.php index a32c3f8544..c722dff067 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -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, '/');