From 3c8f46b6d5db7f44b739f07b73e93a6649e9f6fd Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Fri, 30 Jul 2010 06:00:00 +0000 Subject: [PATCH] * finished the feature of manage doc lib modules. --- module/common/lang/zh-cn.php | 2 +- module/doc/control.php | 12 +----------- module/doc/lang/zh-cn.php | 8 +++++--- module/tree/control.php | 24 ++++++++++++++++++------ module/tree/lang/zh-cn.php | 1 + module/tree/model.php | 6 +++--- module/tree/view/browse.html.php | 4 ++-- 7 files changed, 31 insertions(+), 26 deletions(-) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index c6a2583681..f94ba421ec 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -171,7 +171,7 @@ $lang->testtask->menu->testtask = array('link' => '测试任务|testtask|browse| $lang->doc->menu->list = '%s'; $lang->doc->menu->browse = array('link' => '文档列表|doc|browse|libID=%s'); $lang->doc->menu->edit = '编辑文档库|doc|editLib|libID=%s'; -$lang->doc->menu->module = '维护模块|doc|manageModule|libID=%s'; +$lang->doc->menu->module = '维护模块|tree|browse|libID=%s&viewType=doc'; $lang->doc->menu->delete = array('link' => '删除文档库|doc|deleteLib|libID=%s', 'target' => 'hiddenwin'); $lang->doc->menu->create = array('link' => '新增文档库|doc|createLib', 'float' => 'right'); diff --git a/module/doc/control.php b/module/doc/control.php index fb64db6140..1e6f44f61a 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -37,17 +37,7 @@ class doc extends control /* 浏览某一个产品。*/ public function browse($libID = 'product', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - $this->doc->setMenu($this->libs, $libID); + $this->doc->setMenu($this->libs, $libID, 'doc'); $this->display(); } - - /* 维护文档库模块。*/ - public function manageModule($libID) - { - /* 如果是自定义的文档库,则跳转到tree模块。*/ - if($libID != 'product' and $libID != 'project') - { - $this->locate($this->createLink('tree', 'browse', "rootID=$libID&type=customdoc")); - } - } } diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 57e23655af..c185463430 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -39,15 +39,17 @@ $lang->doc->addedDate = '添加时间'; $lang->doc->editedBy = '由谁编辑'; $lang->doc->editedDate = '编辑时间'; +$lang->doc->moduleName = '模块名称'; +$lang->doc->moduleOrder = '模块排序'; + /* 方法列表。*/ $lang->doc->index = '首页'; $lang->doc->create = '创建文档'; $lang->doc->edit = '编辑文档'; $lang->doc->browse = '文档列表'; $lang->doc->view = '文档详情'; -$lang->doc->resolve = '解决文档'; -$lang->doc->close = '关闭文档'; -$lang->doc->activate = '激活文档'; +$lang->doc->manageModule = '维护模块'; +$lang->doc->manageModule = '维护模块'; $lang->doc->systemLibs['product'] = '产品文档库'; $lang->doc->systemLibs['project'] = '项目文档库'; diff --git a/module/tree/control.php b/module/tree/control.php index 297ac82b05..c957877bce 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -35,16 +35,28 @@ class tree extends control $this->view->root = $product; $this->view->productModules = $this->tree->getOptionMenu($rootID, 'story'); } - elseif($viewType == 'customdoc') + elseif(strpos($viewType, 'doc') !== false) { - $lib = $this->loadModel('doc')->getLibById($rootID); - $this->view->root = $lib; + $this->loadModel('doc'); + if($rootID == 'product' or $rootID == 'project') + { + $viewType = $rootID . 'doc'; + $lib->id = $rootID; + $lib->name = $this->lang->doc->systemLibs[$rootID]; + $this->view->root = $lib; + } + else + { + $viewType = 'customdoc'; + $lib = $this->loadModel('doc')->getLibById($rootID); + $this->view->root = $lib; + } } if($viewType == 'story') { /* 设置菜单。*/ - $this->product->setMenu($this->product->getPairs(), $rootID, 'product'); + $this->product->setMenu($this->product->getPairs(), $rootID, 'story'); $this->lang->tree->menu = $this->lang->product->menu; $this->lang->set('menugroup.tree', 'product'); @@ -75,10 +87,10 @@ class tree extends control $position[] = html::a($this->createLink('testcase', 'browse', "product=$rootID"), $product->name); $position[] = $this->lang->tree->manageCase; } - elseif($viewType == 'customdoc') + elseif(strpos($viewType, 'doc') !== false) { /* 设置菜单。*/ - $this->doc->setMenu($this->doc->getLibs(), $rootID); + $this->doc->setMenu($this->doc->getLibs(), $rootID, 'doc'); $this->lang->tree->menu = $this->lang->doc->menu; $this->lang->set('menugroup.tree', 'doc'); diff --git a/module/tree/lang/zh-cn.php b/module/tree/lang/zh-cn.php index 5a51cfb7a7..a9580c1f64 100644 --- a/module/tree/lang/zh-cn.php +++ b/module/tree/lang/zh-cn.php @@ -45,3 +45,4 @@ $lang->tree->name = '模块名称'; $lang->tree->parent = '上级模块'; $lang->tree->child = '子模块'; $lang->tree->owner = '负责人'; +$lang->tree->order = '排序'; diff --git a/module/tree/model.php b/module/tree/model.php index 57b52a76a8..16b3172118 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -154,9 +154,9 @@ class treeModel extends model if(empty($users)) $users = $this->loadModel('user')->getPairs('noletter'); $linkHtml = $module->name; if($module->type == 'bug' and $module->owner) $linkHtml .= '[' . $users[$module->owner] . ']'; - if(common::hasPriv('tree', 'edit')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'edit', "module={$module->id}"), $this->lang->tree->edit, '', 'class="iframe"'); - if(common::hasPriv('tree', 'browse')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'browse', "root={$module->root}&type={$module->type}&module={$module->id}"), $this->lang->tree->child); - if(common::hasPriv('tree', 'delete')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'delete', "root={$module->root}&module={$module->id}"), $this->lang->delete, 'hiddenwin'); + if(common::hasPriv('tree', 'edit')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'edit', "module={$module->id}"), $this->lang->tree->edit, '', 'class="iframe"'); + if(common::hasPriv('tree', 'browse') and strpos($module->type, 'doc') === false) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'browse', "root={$module->root}&type={$module->type}&module={$module->id}"), $this->lang->tree->child); + if(common::hasPriv('tree', 'delete')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'delete', "root={$module->root}&module={$module->id}"), $this->lang->delete, 'hiddenwin'); if(common::hasPriv('tree', 'updateorder')) $linkHtml .= ' ' . html::input("orders[$module->id]", $module->order, 'style="width:30px;text-align:center"'); return $linkHtml; } diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index d560fdc219..43b5c3c830 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -25,7 +25,7 @@