* add the feature of roadmap.

This commit is contained in:
wangchunsheng
2010-01-15 08:41:04 +00:00
parent 415d9efcbd
commit ed2ced880e
11 changed files with 215 additions and 3 deletions

View File

@@ -41,6 +41,9 @@ $lang->zentaoSite = "官方网站";
$lang->myControl = "我的地盘";
$lang->sponser = "<a href='http://www.pujia.com' target='_blank'>普加赞助</a>";
$lang->at = ' 于 ';
$lang->feature = '未来';
$lang->year = '年';
$lang->downArrow = '↓';
/* 主导航菜单。*/
$lang->menu->index = '首页|index|index';
@@ -70,6 +73,7 @@ $lang->product->menu->list = '%s';
$lang->product->menu->story = array('link' => '需求列表|product|browse|productID=%s', 'subModule' => 'story');
$lang->product->menu->plan = array('link' => '计划列表|productplan|browse|productID=%s', 'subModule' => 'productplan');
$lang->product->menu->release= array('link' => '发布列表|release|browse|productID=%s', 'subModule' => 'release');
$lang->product->menu->roadmap= '路线图|product|roadmap|productID=%s';
$lang->product->menu->edit = '编辑产品|product|edit|productID=%s';
$lang->product->menu->delete = array('link' => '删除产品|product|delete|productID=%s', 'target' => 'hiddenwin');
$lang->product->menu->module = '维护模块|tree|browse|productID=%s&view=product';

View File

@@ -66,15 +66,23 @@ $lang->resource->product->browse = 'browse';
$lang->resource->product->create = 'create';
$lang->resource->product->edit = 'edit';
$lang->resource->product->delete = 'delete';
$lang->resource->product->roadmap= 'roadmap';
$lang->resource->product->ajaxGetProjects = 'ajaxGetProjects';
$lang->resource->productplan->browse = 'browse';
$lang->resource->productplan->create = 'create';
$lang->resource->productplan->edit = 'edit';
$lang->resource->productplan->delete = 'delete';
$lang->resource->productplan->view = 'view';
$lang->resource->productplan->linkStory = 'linkStory';
$lang->resource->productplan->unlinkStory = 'unlinkStory';
$lang->resource->release->browse = 'browse';
$lang->resource->release->create = 'create';
$lang->resource->release->edit = 'edit';
$lang->resource->release->delete = 'delete';
$lang->resource->release->view = 'view';
$lang->resource->story->create = 'create';
$lang->resource->story->edit = 'edit';
$lang->resource->story->delete = 'delete';
@@ -110,6 +118,11 @@ $lang->resource->task->view = 'view';
$lang->resource->task->ajaxGetUserTasks = 'ajaxGetUserTasks';
$lang->resource->task->ajaxGetProjectTasks = 'ajaxGetProjectTasks';
$lang->resource->build->create = 'create';
$lang->resource->build->edit = 'edit';
$lang->resource->build->delete = 'delete';
$lang->resource->build->view = 'view';
$lang->resource->qa->index = 'index';
$lang->resource->bug->index = 'index';

View File

@@ -166,6 +166,22 @@ class product extends control
}
}
/* 产品路线图。*/
public function roadmap($productID)
{
/* 设置菜单。*/
$this->product->setMenu($this->products, $productID);
/* 赋值。*/
$product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch();
$this->view->header->title = $this->lang->product->roadmap;
$this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name);
$this->view->position[] = $this->lang->product->roadmap;
$this->view->product = $product;
$this->view->roadmaps = $this->product->getRoadmap($productID);
$this->display();
}
/* 获得某一个产品对应的项目列表。*/
public function ajaxGetProjects($productID, $projectID = 0)
{

View File

@@ -30,6 +30,8 @@ $lang->product->read = "产品详情";
$lang->product->edit = "编辑产品";
$lang->product->delete = "删除产品";
$lang->product->roadmap = '路线图';
$lang->product->selectProduct = "请选择产品";
$lang->product->saveButton = " 保存 (S) ";
$lang->product->confirmDelete = " 您确定删除该产品吗?";

View File

@@ -32,6 +32,7 @@ class productModel extends model
common::setMenuVars($this->lang->product->menu, 'list', $selectHtml . $this->lang->arrow);
common::setMenuVars($this->lang->product->menu, 'story', $productID);
common::setMenuVars($this->lang->product->menu, 'plan', $productID);
common::setMenuVars($this->lang->product->menu, 'roadmap',$productID);
common::setMenuVars($this->lang->product->menu, 'release',$productID);
common::setMenuVars($this->lang->product->menu, 'edit', $productID);
common::setMenuVars($this->lang->product->menu, 'delete', $productID);
@@ -112,4 +113,26 @@ class productModel extends model
$projects = array('' => '') + $projects;
return $projects;
}
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ·<C6B7><C2B7>ͼ<EFBFBD><CDBC>*/
public function getRoadmap($productID)
{
$plans = $this->loadModel('productplan')->getList($productID);
$releases = $this->loadModel('release')->getList($productID);
$roadmap = array();
if(is_array($releases)) $releases = array_reverse($releases);
foreach($releases as $release)
{
$year = substr($release->date, 0, 4);
$roadmap[$year][] = $release;
}
foreach($plans as $plan)
{
if($plan->end != '0000-00-00' and strtotime($plan->end) - time() <= 0) continue;
$year = substr($plan->end, 0, 4);
$roadmap[$year][] = $plan;
}
arsort($roadmap);
return $roadmap;
}
}

View File

@@ -0,0 +1,63 @@
<?php
/**
* The roadmap 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 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package product
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/header.html.php';?>
<div class='yui-d0'>
<table class='table-1'>
<caption><?php echo $lang->product->roadmap;?></caption>
<?php
$years = array_keys($roadmaps);
echo '<tr class="f-16px">';
foreach($years as $year)
{
if($year == '0000') $year = $lang->feature;
echo "<th>$year$lang->year</th>";
}
echo '</tr>';
echo '<tr valign="top">';
foreach($years as $year)
{
echo '<td class="a-center">';
foreach($roadmaps[$year] as $key => $roadmap)
{
if(isset($roadmap->build))
{
echo "<div class='roadmap release'>";
echo "<p class='f-16px'>" . html::a($this->createLink('release', 'view', "releaseID=$roadmap->id"), $roadmap->name, '_blank') . '</p>' . $roadmap->date;
}
else
{
echo "<div class='roadmap plan'>";
echo "<p class='f-16px'>" . html::a($this->createLink('productplan', 'view', "planID=$roadmap->id"), $roadmap->title, '_blank') . '</p>' . $roadmap->begin . ' ~ ' . $roadmap->end;
}
echo "</div>";
if(isset($roadmaps[$year][$key + 1])) echo "<span class='f-16px'>{$lang->downArrow}</span>";
}
echo '</td>';
}
echo '</tr>';
?>
</table>
</div>
<?php include '../../common/footer.html.php';?>

View File

@@ -92,6 +92,19 @@ class productplan extends control
$this->display();
}
/* 计划详情。*/
public function view($planID = 0)
{
$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product);
$this->view->header->title = $this->lang->productplan->view;
$this->view->position[] = $this->lang->productplan->view;
$this->view->planStories= $this->loadModel('story')->getPlanStories($planID);
$this->view->products = $this->product->getPairs();
$this->view->plan = $plan;
$this->display();
}
/* 关联需求。*/
public function linkStory($planID = 0)
{

View File

@@ -27,6 +27,7 @@ $lang->productplan->index = "计划列表";
$lang->productplan->create = "创建计划";
$lang->productplan->edit = "编辑计划";
$lang->productplan->delete = "删除计划";
$lang->productplan->view = "计划详情";
$lang->productplan->linkStory = "关联需求";
$lang->productplan->unlinkStory = "移除需求";
$lang->productplan->linkedStories = '已关联需求列表';

View File

@@ -34,7 +34,6 @@
<tr>
<th><?php echo $lang->productplan->id;?></th>
<th class='w-p20'><?php echo $lang->productplan->title;?></th>
<th class='w-p40'><?php echo $lang->productplan->desc;?></th>
<th><?php echo $lang->productplan->begin;?></th>
<th><?php echo $lang->productplan->end;?></th>
<th class='w-p20'><?php echo $lang->action;?></th>
@@ -43,9 +42,8 @@
<tbody>
<?php foreach($plans as $plan):?>
<tr class='a-center'>
<td><?php echo $plan->id;?></td>
<td><?php echo html::a(inlink('view', "id=$plan->id"), sprintf('%03d', $plan->id));?></td>
<td class='a-left'><?php echo $plan->title;?></td>
<td class='a-left'><?php echo nl2br($plan->desc);?></td>
<td><?php echo $plan->begin;?></td>
<td><?php echo $plan->end;?></td>
<td class='nobr'>

View File

@@ -0,0 +1,75 @@
<?php
/**
* The view of productplan 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 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package productplan
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/header.html.php';?>
<?php include '../../common/tablesorter.html.php';?>
<div class='yui-d0'>
<table class='table-1'>
<caption><?php echo $plan->title . $lang->colon . $lang->productplan->view;?></caption>
<tr>
<th class='rowhead w-100px'><?php echo $lang->productplan->id;?></th>
<td><?php echo $plan->id;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->title;?></th>
<td><?php echo $plan->title;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->begin;?></th>
<td><?php echo $plan->begin;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->end;?></th>
<td><?php echo $plan->end;?></th>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
<td><?php echo nl2br($plan->desc);?></th>
</tr>
</table>
<table align='center' class='table-1 tablesorter a-center'>
<caption><?php echo $plan->title .$lang->colon . $lang->productplan->linkedStories;?></caption>
<thead>
<tr>
<th class='w-p5'><?php echo $lang->story->id;?></th>
<th class='w-p5'><?php echo $lang->story->pri;?></th>
<th class='w-p10'><?php echo $lang->story->product;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-p10'><?php echo $lang->action?></th>
</tr>
</thead>
<tbody>
<?php foreach($planStories as $story):?>
<tr>
<td><?php echo $story->id;?></td>
<td><?php echo $story->pri;?></td>
<td><?php echo html::a($this->createLink('product', 'browse', "productID=$story->product"), $products[$story->product], '_blank');?></td>
<td class='a-left nobr'><?php echo $story->title;?></td>
<td><?php common::printLink('productplan', 'unlinkStory', "story=$story->id", $lang->productplan->unlinkStory, 'hiddenwin');?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<?php include '../../common/footer.html.php';?>

View File

@@ -210,6 +210,10 @@ caption {border:1px solid #e4e4e4; background:#efefef; margin:0; padding:5
/* ҳ<><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>ء<EFBFBD>*/
.history {border:1px solid gray; background:#efefef; padding:10px; margin-top:10px; margin-bottom:10px}
.content {font-size:14px; padding:10px}
.roadmap {width:200px; margin:10px auto 10px auto; padding:10px; border:1px solid gray;}
.roadmap a{color:white;}
.release {background:darkgreen; color:white}
.plan {background:#9F9F5F;}
/* ҳ<>š<EFBFBD>*/
#footer {width:100%; position:fixed; bottom:0; left:0; margin:0; border-top:2px solid #F4BF20; background-color:#FBF5C6;}