diff --git a/module/tree/control.php b/module/tree/control.php index 01e4641173..93c3343b04 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -401,7 +401,12 @@ class tree extends control $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch, 'noMainBranch|nodeleted'); } - if($type == 'doc') $this->view->libs = $this->loadModel('doc')->getLibs('all', $extra = 'withObject', '', 0, 'book'); + if($type == 'doc') + { + $docLib = $this->loadModel('doc')->getLibById($module->root); + $objectID = isset($docLib->{$docLib->type}) ? $docLib->{$docLib->type} : 0; + $this->view->libs = $this->doc->getLibs($docLib->type, '', '', $objectID, 'book'); + } $this->view->module = $module; $this->view->type = $type; diff --git a/module/tree/model.php b/module/tree/model.php index 3f042e93c9..583f366afd 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1838,7 +1838,7 @@ class treeModel extends model if($self) { $self->parent = $module->parent; - if($self->root) $module->root = $self->root; + if($self->root and !isset($module->root)) $module->root = $self->root; } $repeatName = $this->checkUnique($self, array("id{$self->id}" => $module->name), array("id{$self->id}" => $module->branch)); @@ -1927,6 +1927,7 @@ class treeModel extends model $this->dao->update(TABLE_STORY)->set('product')->eq($newRoot)->where('module')->in($childIdList)->exec(); $this->dao->update(TABLE_BUG)->set('product')->eq($newRoot)->where('module')->in($childIdList)->exec(); $this->dao->update(TABLE_CASE)->set('product')->eq($newRoot)->where('module')->in($childIdList)->exec(); + $this->dao->update(TABLE_DOC)->set('lib')->eq($newRoot)->where('module')->in($childIdList)->exec(); if($type != 'story') return;