+ finish the task #616.

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-11-25 02:45:15 +00:00
parent 46749006d2
commit 8ce155b032
8 changed files with 106 additions and 13 deletions

View File

@@ -139,6 +139,7 @@ $lang->product->menu->view = 'Info|product|view|productID=%s';
$lang->product->menu->edit = 'Edit|product|edit|productID=%s';
$lang->product->menu->module = 'Modules|tree|browse|productID=%s&view=story';
$lang->product->menu->create = array('link' => 'New Product|product|create', 'float' => 'right');
$lang->project->menu->project = array('link' => 'Project list|product|index|locate=false&status=all&productID=%s', 'float' => 'right');
$lang->story->menu = $lang->product->menu;
$lang->productplan->menu = $lang->product->menu;
$lang->release->menu = $lang->product->menu;

View File

@@ -139,6 +139,7 @@ $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=story';
$lang->product->menu->create = array('link' => '新增产品|product|create', 'float' => 'right');
$lang->product->menu->project = array('link' => '项目列表|product|index|locate=false&status=all&productID=%s', 'float' => 'right');
$lang->story->menu = $lang->product->menu;
$lang->productplan->menu = $lang->product->menu;
$lang->release->menu = $lang->product->menu;

View File

@@ -41,9 +41,15 @@ class product extends control
* @access public
* @return void
*/
public function index()
public function index($locate = 'yes', $status = 'undone', $productID)
{
$this->locate($this->createLink($this->moduleName, 'browse'));
if($locate == 'yes') $this->locate($this->createLink($this->moduleName, 'browse'));
$this->app->loadLang('my');
$this->view->projectStats = $this->loadModel('project')->getProjectStats($this->config->project->projectCounts, $status, $productID);
$this->view->productID = $productID;
$this->display();
}
/**

View File

@@ -0,0 +1,7 @@
$().ready(function()
{
$('.projectline').each(function()
{
$(this).sparkline('html', {height:'25px'});
})
})

View File

@@ -0,0 +1,48 @@
<?php
/**
* The html template file of index method of index module of ZenTaoPMS.
*
* @copyright Copyright 2009-2011 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id: index.html.php 2343 2011-11-21 05:24:56Z wwccss $
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/sparkline.html.php';?>
<?php include '../../common/view/colorize.html.php';?>
<h3>
<?php echo html::a(inlink("index", "locate=no&status=undone&productID=$productID"), $lang->project->unDoneProjects);?>
<?php echo html::a(inlink("index", "locate=no&status=done&productID=$productID"), $lang->project->doneProjects);?>
</h3>
<table class='table-1 fixed colored'>
<tr class='colhead'>
<th class='w-150px'><?php echo $lang->project->name;?></th>
<th><?php echo $lang->project->code;?></th>
<th><?php echo $lang->project->end;?></th>
<th><?php echo $lang->project->status;?></th>
<th><?php echo $lang->project->totalEstimate;?></th>
<th><?php echo $lang->project->totalConsumed;?></th>
<th><?php echo $lang->project->totalLeft;?></th>
<th class='w-150px'><?php echo $lang->project->progess;?></th>
<th class='w-100px'><?php echo $lang->project->burn;?></th>
</tr>
<?php foreach($projectStats as $project):?>
<tr class='a-center'>
<td class='a-left'><?php echo html::a($this->createLink('project', 'task', 'project=' . $project->id), $project->name, '_parent');?></td>
<td><?php echo $project->code;?></td>
<td><?php echo $project->end;?></td>
<td><?php echo $lang->project->statusList[$project->status];?></td>
<td><?php echo $project->hours->totalEstimate;?></td>
<td><?php echo $project->hours->totalConsumed;?></td>
<td><?php echo $project->hours->totalLeft;?></td>
<td class='a-left w-150px'>
<img src='<?php echo $defaultTheme;?>images/main/green.png' width=<?php echo $project->hours->progress;?> height='13' text-align: />
<small><?php echo $project->hours->progress;?>%</small>
</td>
<td class='projectline a-left' values='<?php echo join(',', $project->burns);?>'></td>
</tr>
<?php endforeach;?>
</table>
<?php include '../../common/view/footer.lite.html.php';?>

View File

@@ -253,15 +253,33 @@ class projectModel extends model
* @access public
* @return array
*/
public function getList($status = 'all', $limit = 0)
public function getList($status = 'all', $limit = 0, $productID = 0)
{
return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)
->beginIF($status == 'undone')->andWhere('status')->ne('done')->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->andWhere('deleted')->eq(0)
->orderBy('status, code')
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
if($productID != 0)
{
return $this->dao->select('t2.*')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.iscat')->eq(0)
->beginIF($status == 'undone')->andWhere('t2.status')->ne('done')->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->orderBy('status, code')
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
}
else
{
return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)
->beginIF($status == 'undone')->andWhere('status')->ne('done')->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->andWhere('deleted')->eq(0)
->orderBy('status, code')
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
}
}
/**
@@ -300,11 +318,11 @@ class projectModel extends model
* @access public
* @return array
*/
public function getProjectStats($counts, $status = 'undone')
public function getProjectStats($counts, $status = 'undone', $productID = 0)
{
$this->loadModel('report');
$projects = $this->getList($status);
$projects = $this->getList($status, 0, $productID);
$stats = array();
$i = 1;

View File

@@ -60,7 +60,7 @@ $(function(){
<tr class='colhead'>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th><?php echo $lang->testcase->stepDesc;?></th>
<th><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-200px'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-100px'><?php echo $lang->actions;?></th>
</tr>
<?php

View File

@@ -513,6 +513,17 @@ function setSubversionLink()
if($('.svnlink').size()) $('.svnlink').colorbox({width:960, height:600, iframe:true, transition:'elastic', speed:350, scrolling:true});
}
/**
* Set the link of the project list menu.
*
* @access public
* @return void
*/
function setProductListLink()
{
if($('#submenuproject').size()) $("#submenuproject").colorbox({width:1000, height:600, iframe:true, transition:'elastic', speed:350, scrolling:true});
}
/**
* Set the link of the project list menu.
*
@@ -744,6 +755,7 @@ $(document).ready(function()
saveProject();
setForm();
setSubversionLink();
setProductListLink();
setProjectListLink();
autoCheck();
togglesearch();