diff --git a/module/tree/control.php b/module/tree/control.php index c34909b326..767b4e968e 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -306,7 +306,7 @@ class tree extends control if($returnType == 'html') { $changeFunc = ''; - if($viewType == 'task' or $viewType == 'bug' or $viewType == 'testcase') $changeFunc = "onchange='loadModuleRelated()'"; + if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'"; $output = html::select("module", $optionMenu, '', "class='form-control' $changeFunc"); if(count($optionMenu) == 1 and $needManage) { diff --git a/module/tree/model.php b/module/tree/model.php index 28bf019034..233f78f08b 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -171,7 +171,7 @@ class treeModel extends model { $modules = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = $rootID and type = 'task') OR (root = $id and type = 'story'))") ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() - ->orderBy('grade desc, type, `order`') + ->orderBy('grade desc, branch, type, `order`') ->fetchAll('id'); } else @@ -563,7 +563,7 @@ class treeModel extends model foreach($modules as $module) { if(empty($module->branch)) $paths[$module->id] = $module->id; - if(isset($productGroups[$module->root][$module->branch])) $paths[$module->id] = $module->id; + if(isset($productGroups[$module->root][0]) or isset($productGroups[$module->root][$module->branch])) $paths[$module->id] = $module->id; } }