* finished the feature of manage doc lib modules.

This commit is contained in:
wangchunsheng
2010-07-30 06:00:00 +00:00
parent 12e4374afe
commit 3c8f46b6d5
7 changed files with 31 additions and 26 deletions
+1 -1
View File
@@ -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');
+1 -11
View File
@@ -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"));
}
}
}
+5 -3
View File
@@ -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'] = '项目文档库';
+18 -6
View File
@@ -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');
+1
View File
@@ -45,3 +45,4 @@ $lang->tree->name = '模块名称';
$lang->tree->parent = '上级模块';
$lang->tree->child = '子模块';
$lang->tree->owner = '负责人';
$lang->tree->order = '排序';
+3 -3
View File
@@ -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 .= '<span class="owner">[' . $users[$module->owner] . ']</span>';
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;
}
+2 -2
View File
@@ -25,7 +25,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<script language='javascript'>
var rootID = <?php echo $rootID;?>;
var rootID = '<?php echo $rootID;?>';
function syncModule()
{
link = createLink('tree', 'ajaxGetSonModules', 'moduleID=' + $('#productModule').val() + '&rootID=' + rootID);
@@ -74,7 +74,7 @@ $(document).ready(function()
</td>
<td id='moduleBox'>
<?php
if($viewType != 'story' and $viewType != 'customdoc')
if($viewType != 'story' and strpos($viewType, 'doc') === false)
{
echo html::select('productModule', $productModules, '', 'class=select-3');
echo html::commonButton($lang->tree->syncFromProduct, 'onclick=syncModule()');