* Code for task#78661.

This commit is contained in:
xieqiyu
2022-12-07 21:42:59 +08:00
parent ae62bdff75
commit ec6f263bd3
3 changed files with 9 additions and 5 deletions
+4 -3
View File
@@ -390,7 +390,7 @@ class tree extends control
}
else
{
$this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch);
$this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch, 'noMainBranch');
}
if($type == 'doc') $this->view->libs = $this->loadModel('doc')->getLibs('all', $extra = 'withObject', '', 0, 'book');
@@ -534,12 +534,13 @@ class tree extends control
}
else
{
$optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch);
$optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch, $extra);
}
if(strpos($extra, 'excludeModuleID') !== false)
{
parse_str($extra, $output);
list($excludeModule, $noMainBranch) = explode(',', $extra);
parse_str($excludeModule, $output);
$excludeModuleID = $output['excludeModuleID'];
if(isset($optionMenu[$excludeModuleID])) unset($optionMenu[$excludeModuleID]);
}
+4 -1
View File
@@ -109,11 +109,14 @@ class treeModel extends model
->andWhere('type')->in($type)
->beginIF($grade)->andWhere('grade')->le($grade)->fi()
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
->beginIF($branch !== 'all' and $branch !== '' and $branch !== false)
->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') === false)
->andWhere('(branch')->eq(0)
->orWhere('branch')->eq($branch)
->markRight(1)
->fi()
->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') !== false)
->andWhere('branch')->eq($branch)
->fi()
->beginIF(strpos($param, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi()
->orderBy('grade desc, `order`')
->get();
+1 -1
View File
@@ -189,7 +189,7 @@ function loadModules(branch)
if(typeof(branchID) == 'undefined') branchID = 0;
if(typeof(moduleID) == 'undefined') moduleID = 0;
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + <?php echo $module->id;?> + '&currentModuleID=' + moduleID);
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + <?php echo $module->id;?> + ',noMainBranch&currentModuleID=' + moduleID);
$(moduleBox).load(link, function()
{
$(this).children('select').attr('id', 'parent').attr('name', 'parent');