+ init the doc module.
This commit is contained in:
@@ -86,7 +86,7 @@ $lang->menu->product = '产品视图|product|index';
|
||||
$lang->menu->project = '项目视图|project|index';
|
||||
$lang->menu->qa = 'QA视图|qa|index';
|
||||
$lang->menu->doc = '文档视图|doc|index';
|
||||
$lang->menu->forum = '讨论视图|doc|index';
|
||||
//$lang->menu->forum = '讨论视图|doc|index';
|
||||
$lang->menu->company = '组织视图|company|index';
|
||||
$lang->menu->admin = '后台管理|admin|index';
|
||||
|
||||
@@ -126,7 +126,7 @@ $lang->product->menu->release= array('link' => '发布列表|release|browse|prod
|
||||
$lang->product->menu->roadmap= '路线图|product|roadmap|productID=%s';
|
||||
$lang->product->menu->view = '基本信息|product|view|productID=%s';
|
||||
$lang->product->menu->edit = '编辑产品|product|edit|productID=%s';
|
||||
$lang->product->menu->module = '维护模块|tree|browse|productID=%s&view=product';
|
||||
$lang->product->menu->module = '维护模块|tree|browse|productID=%s&view=story';
|
||||
$lang->product->menu->delete = array('link' => '删除产品|product|delete|productID=%s', 'target' => 'hiddenwin');
|
||||
$lang->product->menu->create = array('link' => '新增产品|product|create', 'float' => 'right');
|
||||
$lang->story->menu = $lang->product->menu;
|
||||
@@ -168,9 +168,10 @@ $lang->testtask->menu->testcase = array('link' => '用例管理|testcase|browse|
|
||||
$lang->testtask->menu->testtask = array('link' => '测试任务|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases');
|
||||
|
||||
/* 文档视图菜单设置。*/
|
||||
$lang->doc->menu->lib = '%s';
|
||||
$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->delete = array('link' => '删除文档库|doc|deleteLib|libID=%s', 'target' => 'hiddenwin');
|
||||
$lang->doc->menu->create = array('link' => '新增文档库|doc|create', 'float' => 'right');
|
||||
|
||||
|
||||
@@ -23,7 +23,27 @@
|
||||
*/
|
||||
class doc extends control
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->libs = $this->doc->getLibs();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->locate(inlink('browse'));
|
||||
}
|
||||
|
||||
/* 浏览某一个产品。*/
|
||||
public function browse($libID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
if($libID == 0) $libID = key($this->libs);
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 维护文档库模块。*/
|
||||
public function manageModule($libID)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,3 +21,33 @@
|
||||
* @version $Id: zh-cn.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentaoms.com
|
||||
*/
|
||||
/* 字段列表。*/
|
||||
$lang->doc->common = '缺陷管理';
|
||||
$lang->doc->id = '文档编号';
|
||||
$lang->doc->product = '所属产品';
|
||||
$lang->doc->product = '所属项目';
|
||||
$lang->doc->lib = '所属文档库';
|
||||
$lang->doc->module = '所属分类';
|
||||
$lang->doc->title = '文档标题';
|
||||
$lang->doc->digest = '文档摘要';
|
||||
$lang->doc->type = '文档类型';
|
||||
$lang->doc->content = '文档正文';
|
||||
$lang->doc->url = '文档URL';
|
||||
$lang->doc->views = '查阅次数';
|
||||
$lang->doc->addedBy = '由谁添加';
|
||||
$lang->doc->addedDate = '添加时间';
|
||||
$lang->doc->editedBy = '由谁编辑';
|
||||
$lang->doc->editedDate = '编辑时间';
|
||||
|
||||
/* 方法列表。*/
|
||||
$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->systemLibs['product'] = '产品文档库';
|
||||
$lang->doc->systemLibs['project'] = '项目文档库';
|
||||
|
||||
@@ -25,4 +25,24 @@
|
||||
<?php
|
||||
class docModel extends model
|
||||
{
|
||||
/* 设置菜单。*/
|
||||
public function setMenu($libs, $libID, $extra = '')
|
||||
{
|
||||
/* 获得当前的模块和方法,传递给switchDocLib方法,供页面跳转使用。*/
|
||||
$currentModule = $this->app->getModuleName();
|
||||
$currentMethod = $this->app->getMethodName();
|
||||
|
||||
$selectHtml = html::select('libID', $libs, $libID, "onchange=\"switchDocLib(this.value, '$currentModule', '$currentMethod', '$extra');\"");
|
||||
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml . $this->lang->arrow);
|
||||
foreach($this->lang->doc->menu as $key => $menu)
|
||||
{
|
||||
if($key != 'list') common::setMenuVars($this->lang->doc->menu, $key, $libID);
|
||||
}
|
||||
}
|
||||
|
||||
public function getLibs()
|
||||
{
|
||||
$libs = $this->dao->select('id, name')->from(TABLE_DOCLIB)->fetchPairs();
|
||||
return $this->lang->doc->systemLibs + $libs;
|
||||
}
|
||||
}
|
||||
|
||||
136
trunk/module/doc/view/browse.html.php
Normal file
136
trunk/module/doc/view/browse.html.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of product module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package product
|
||||
* @version $Id: browse.html.php 958 2010-07-22 08:09:42Z wwccss $
|
||||
* @link http://www.zentaoms.com
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/treeview.html.php';?>
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<?php include '../../common/view/table2csv.html.php';?>
|
||||
<script language='Javascript'>
|
||||
/* 切换浏览方式。*/
|
||||
function browseByModule()
|
||||
{
|
||||
$('#mainbox').addClass('yui-t1');
|
||||
$('#treebox').removeClass('hidden');
|
||||
$('#bymoduleTab').addClass('active');
|
||||
$('#allTab').removeClass('active');
|
||||
$('#bysearchTab').removeClass('active');
|
||||
$('#querybox').addClass('hidden');
|
||||
}
|
||||
function search(active)
|
||||
{
|
||||
$('#mainbox').removeClass('yui-t1');
|
||||
$('#treebox').addClass('hidden');
|
||||
$('#querybox').removeClass('hidden');
|
||||
$('#bymoduleTab').removeClass('active');
|
||||
$('#' + active + 'Tab').removeClass('active');
|
||||
$('#bysearchTab').addClass('active');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class='yui-d0'>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<span id='bymoduleTab' onclick='browseByModule()'><a href='#'><?php echo $lang->product->moduleStory;?></a></span>
|
||||
<span id='bysearchTab' onclick='search("<?php echo $browseType;?>")'><a href='#'><?php echo $lang->product->searchStory;?></a></span>
|
||||
<span id='allTab'><?php echo html::a($this->createLink('product', 'browse', "productID=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->product->allStory);?></span>
|
||||
</div>
|
||||
<div class='f-right'>
|
||||
<?php echo html::export2csv($lang->exportCSV, $lang->setFileName);?>
|
||||
<?php if(common::hasPriv('story', 'create')) echo html::a($this->createLink('story', 'create', "productID=$productID&moduleID=$moduleID"), $lang->story->create); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
|
||||
</div>
|
||||
|
||||
<div class='yui-d0 <?php if($browseType == 'bymodule') echo 'yui-t1';?>' id='mainbox'>
|
||||
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<table class='table-1 fixed colored tablesorter datatable'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "productID=$productID&browseType=$browseType¶m=$moduleID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='w-p30'><?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
<th><?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->planAB);?></th>
|
||||
<th><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
|
||||
<th class='w-hour'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th><?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
<th class='w-100px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($stories as $key => $story):?>
|
||||
<?php
|
||||
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
|
||||
$canView = common::hasPriv('story', 'view');
|
||||
?>
|
||||
<tr class='a-center'>
|
||||
<td><?php if($canView) echo html::a($viewLink, sprintf('%03d', $story->id)); else printf('%03d', $story->id);?></td>
|
||||
<td><?php echo $story->pri;?></td>
|
||||
<td class='a-left nobr'><nobr><?php echo html::a($viewLink, $story->title);?></nobr></td>
|
||||
<td class='nobr'><?php echo $story->planTitle;?></td>
|
||||
<td><?php echo $users[$story->openedBy];?></td>
|
||||
<td><?php echo $users[$story->assignedTo];?></td>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
|
||||
<td><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
<td>
|
||||
<?php
|
||||
$vars = "story={$story->id}";
|
||||
if(!($story->status != 'closed' and common::printLink('story', 'change', $vars, $lang->story->change))) echo $lang->story->change . ' ';
|
||||
if(!(($story->status == 'draft' or $story->status == 'changed') and common::printLink('story', 'review', $vars, $lang->story->review))) echo $lang->story->review . ' ';
|
||||
if(!common::printLink('story', 'edit', $vars, $lang->edit)) echo $lang->edit;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php $pager->show();?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='yui-b <?php if($browseType != 'bymodule') echo 'hidden';?>' id='treebox'>
|
||||
<div class='box-title'><?php echo $productName;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('product', 'edit')) echo html::a($this->createLink('product', 'edit', "productID=$productID"), $lang->edit);?>
|
||||
<?php if(common::hasPriv('product', 'delete')) echo html::a($this->createLink('product', 'delete', "productID=$productID&confirm=no"), $lang->delete, 'hiddenwin');?>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story"), $lang->tree->manage);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script language='javascript'>
|
||||
$('#module<?php echo $moduleID;?>').addClass('active')
|
||||
$('#<?php echo $browseType;?>Tab').addClass('active')
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user