* finish task #503.
This commit is contained in:
@@ -157,7 +157,8 @@ $lang->project->menu->product = 'Link Product|project|manageproducts|projectID
|
||||
$lang->project->menu->linkstory = array('link' => 'Link Story|project|linkstory|projectID=%s');
|
||||
$lang->project->menu->view = 'Info|project|view|projectID=%s';
|
||||
$lang->project->menu->edit = 'Edit|project|edit|projectID=%s';
|
||||
$lang->project->menu->create = array('link' => 'New Project|project|create', 'float' => 'right');
|
||||
$lang->project->menu->create = array('link' => 'New Project|project|create', 'float' => 'right');
|
||||
$lang->project->menu->all = array('link' => 'Project list|project|index|locate=no', 'float' => 'right');
|
||||
$lang->task->menu = $lang->project->menu;
|
||||
$lang->build->menu = $lang->project->menu;
|
||||
|
||||
|
||||
@@ -157,7 +157,8 @@ $lang->project->menu->product = '产品|project|manageproducts|projectID=%s';
|
||||
$lang->project->menu->linkstory = array('link' => '关联需求|project|linkstory|projectID=%s');
|
||||
$lang->project->menu->view = '概况|project|view|projectID=%s';
|
||||
$lang->project->menu->edit = '编辑|project|edit|projectID=%s';
|
||||
$lang->project->menu->create = array('link' => '新增项目|project|create', 'float' => 'right');
|
||||
$lang->project->menu->create = array('link' => '新增项目|project|create', 'float' => 'right');
|
||||
$lang->project->menu->all = array('link' => '项目列表|project|index|locate=false', 'float' => 'right');
|
||||
$lang->task->menu = $lang->project->menu;
|
||||
$lang->build->menu = $lang->project->menu;
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
$config->project->projectCounts = 50;
|
||||
|
||||
global $lang, $app;
|
||||
$app->loadLang('task');
|
||||
$config->project->create->requiredFields = 'name,code,team,begin,end';
|
||||
|
||||
@@ -31,13 +31,20 @@ class project extends control
|
||||
/**
|
||||
* The index page.
|
||||
*
|
||||
* @param string $locate yes|no locate to the browse page or not.
|
||||
* @param string $status the projects status, if locate is no, then get projects by the $status.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
public function index($locate = 'yes', $status = 'undone')
|
||||
{
|
||||
if(empty($this->projects)) $this->locate($this->createLink('project', 'create'));
|
||||
$this->locate($this->createLink('project', 'browse'));
|
||||
if($locate == 'yes') $this->locate($this->createLink('project', 'browse'));
|
||||
|
||||
$this->app->loadLang('my');
|
||||
$this->view->projectStats = $this->project->getProjectStats($this->config->project->projectCounts, $status);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -903,7 +910,15 @@ class project extends control
|
||||
$this->session->set('caseList', $uri);
|
||||
$this->session->set('testtaskList', $uri);
|
||||
|
||||
/* Set the menu. If the projectID = 0, use the indexMenu instead. */
|
||||
$this->project->setMenu($this->projects, $projectID);
|
||||
if($projectID == 0)
|
||||
{
|
||||
$this->projects = array('0' => $this->lang->project->selectProject) + $this->projects;
|
||||
unset($this->lang->project->menu);
|
||||
$this->lang->project->menu = $this->lang->project->indexMenu;
|
||||
$this->lang->project->menu->list = $this->project->select($this->projects, 0, 'project', 'dynamic');
|
||||
}
|
||||
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
|
||||
@@ -7,3 +7,8 @@ function switchGroup(projectID, groupBy)
|
||||
link = createLink('project', 'groupTask', 'project=' + projectID + '&groupBy=' + groupBy);
|
||||
location.href=link;
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
if($('#submenuall').size()) $("#submenuall").colorbox({width:1000, height:600, iframe:true, transition:'elastic', speed:350, scrolling:true});
|
||||
})
|
||||
|
||||
+14
-11
@@ -117,17 +117,20 @@ $lang->project->byQuery = 'Search';
|
||||
$lang->project->allProject = 'All projects';
|
||||
|
||||
/* Notcie. */
|
||||
$lang->project->selectProject = "Select project";
|
||||
$lang->project->beginAndEnd = 'Begin and end';
|
||||
$lang->project->lblStats = 'Stats';
|
||||
$lang->project->stats = 'Total estimate is『%s』hours,<br />confused『%s』hours<br />left『%s』hours';
|
||||
$lang->project->oneLineStats = "Project『%s』, code is『%s』, products is『%s』,begin from『%s』to 『%s』,total estimate『%s』hours,consumed『%s』hours,left『%s』hours.";
|
||||
$lang->project->taskSummary = "<strong>%s</strong> tasks this page, wait:<strong>%s</strong>, doing:<strong>%s</strong>, estimate <strong>%s</strong>, consumed <strong>%s</strong>, left <strong>%s</strong> hours.";
|
||||
$lang->project->groupSummary = "<strong>%s</strong> tasks this group, wait:<strong>%s</strong>, doing:<strong>%s</strong>, estimate <strong>%s</strong>, consumed <strong>%s</strong>, left <strong>%s</strong> hours.";
|
||||
$lang->project->wbs = "WBS";
|
||||
$lang->project->largeBurnChart = 'View large';
|
||||
$lang->project->howToUpdateBurn= "<a href='%s' class='helplink'><i>How?</i></a>";
|
||||
$lang->project->whyNoStories = "There no active stories to added to this project. Please check the linked product.";
|
||||
$lang->project->selectProject = "Select project";
|
||||
$lang->project->beginAndEnd = 'Begin and end';
|
||||
$lang->project->lblStats = 'Stats';
|
||||
$lang->project->stats = 'Total estimate is『%s』hours,<br />confused『%s』hours<br />left『%s』hours';
|
||||
$lang->project->oneLineStats = "Project『%s』, code is『%s』, products is『%s』,begin from『%s』to 『%s』,total estimate『%s』hours,consumed『%s』hours,left『%s』hours.";
|
||||
$lang->project->taskSummary = "<strong>%s</strong> tasks this page, wait:<strong>%s</strong>, doing:<strong>%s</strong>, estimate <strong>%s</strong>, consumed <strong>%s</strong>, left <strong>%s</strong> hours.";
|
||||
$lang->project->groupSummary = "<strong>%s</strong> tasks this group, wait:<strong>%s</strong>, doing:<strong>%s</strong>, estimate <strong>%s</strong>, consumed <strong>%s</strong>, left <strong>%s</strong> hours.";
|
||||
$lang->project->wbs = "WBS";
|
||||
$lang->project->largeBurnChart = 'View large';
|
||||
$lang->project->howToUpdateBurn = "<a href='%s' class='helplink'><i>How?</i></a>";
|
||||
$lang->project->whyNoStories = "There no active stories to added to this project. Please check the linked product.";
|
||||
$lang->project->doneProjects = 'Done';
|
||||
$lang->project->unDoneProjects = 'Undone';
|
||||
|
||||
|
||||
/* Confirm. */
|
||||
$lang->project->confirmDelete = 'Are you sure to delete project [%s]?';
|
||||
|
||||
@@ -117,17 +117,19 @@ $lang->project->byQuery = '搜索';
|
||||
$lang->project->allProject = '所有项目';
|
||||
|
||||
/* 页面提示。*/
|
||||
$lang->project->selectProject = "请选择项目";
|
||||
$lang->project->beginAndEnd = '起止时间';
|
||||
$lang->project->lblStats = '工时统计';
|
||||
$lang->project->stats = '总共预计<strong>%s</strong>工时<br />已经消耗<strong>%s</strong>工时<br />预计剩余<strong>%s</strong>工时';
|
||||
$lang->project->oneLineStats = "项目<strong>%s</strong>, 代号为<strong>%s</strong>, 相关产品为<strong>%s</strong>,<strong>%s</strong>开始,<strong>%s</strong>结束,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,预计剩余<strong>%s</strong>工时。";
|
||||
$lang->project->taskSummary = "本页共 <strong>%s</strong> 个任务,未开始<strong>%s</strong>,进行中<strong>%s</strong>,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,剩余<strong>%s</strong>工时。";
|
||||
$lang->project->groupSummary = "本组共 <strong>%s</strong> 个任务,未开始<strong>%s</strong>,进行中<strong>%s</strong>,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,剩余<strong>%s</strong>工时。";
|
||||
$lang->project->wbs = "分解任务";
|
||||
$lang->project->largeBurnChart = '点击查看大图';
|
||||
$lang->project->howToUpdateBurn= "<a href='%s' class='helplink'><i>如何更新?</i></a>";
|
||||
$lang->project->whyNoStories = "看起来没有需求可以关联。请检查下项目关联的产品中有没有需求,而且要确保它们已经审核通过。";
|
||||
$lang->project->selectProject = "请选择项目";
|
||||
$lang->project->beginAndEnd = '起止时间';
|
||||
$lang->project->lblStats = '工时统计';
|
||||
$lang->project->stats = '总共预计<strong>%s</strong>工时<br />已经消耗<strong>%s</strong>工时<br />预计剩余<strong>%s</strong>工时';
|
||||
$lang->project->oneLineStats = "项目<strong>%s</strong>, 代号为<strong>%s</strong>, 相关产品为<strong>%s</strong>,<strong>%s</strong>开始,<strong>%s</strong>结束,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,预计剩余<strong>%s</strong>工时。";
|
||||
$lang->project->taskSummary = "本页共 <strong>%s</strong> 个任务,未开始<strong>%s</strong>,进行中<strong>%s</strong>,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,剩余<strong>%s</strong>工时。";
|
||||
$lang->project->groupSummary = "本组共 <strong>%s</strong> 个任务,未开始<strong>%s</strong>,进行中<strong>%s</strong>,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,剩余<strong>%s</strong>工时。";
|
||||
$lang->project->wbs = "分解任务";
|
||||
$lang->project->largeBurnChart = '点击查看大图';
|
||||
$lang->project->howToUpdateBurn = "<a href='%s' class='helplink'><i>如何更新?</i></a>";
|
||||
$lang->project->whyNoStories = "看起来没有需求可以关联。请检查下项目关联的产品中有没有需求,而且要确保它们已经审核通过。";
|
||||
$lang->project->doneProjects = '已结束';
|
||||
$lang->project->unDoneProjects = '未结束';
|
||||
|
||||
/* 交互提示。*/
|
||||
$lang->project->confirmDelete = '您确定删除项目[%s]吗?';
|
||||
|
||||
@@ -248,7 +248,7 @@ class projectModel extends model
|
||||
/**
|
||||
* Get project lists.
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $status all|undone|wait|running
|
||||
* @param int $limit
|
||||
* @access public
|
||||
* @return array
|
||||
@@ -256,9 +256,10 @@ class projectModel extends model
|
||||
public function getList($status = 'all', $limit = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)
|
||||
->beginIF($status != 'all')->andWhere('status')->in($status)->fi()
|
||||
->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, end DESC')
|
||||
->orderBy('status, code')
|
||||
->beginIF($limit)->limit($limit)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
@@ -295,15 +296,15 @@ class projectModel extends model
|
||||
* Get project stats.
|
||||
*
|
||||
* @param int $counts
|
||||
*
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectStats($counts)
|
||||
public function getProjectStats($counts, $status = 'undone')
|
||||
{
|
||||
$this->loadModel('report');
|
||||
|
||||
$projects = $this->getList('wait, doing');
|
||||
$projects = $this->getList($status);
|
||||
$stats = array();
|
||||
$i = 1;
|
||||
|
||||
@@ -349,7 +350,7 @@ class projectModel extends model
|
||||
{
|
||||
if($this->checkPriv($project))
|
||||
{
|
||||
if($i <= $counts and $project->status == 'doing')
|
||||
if($i <= $counts)
|
||||
{
|
||||
// Process the end time.
|
||||
$project->end = date(DT_DATE4, strtotime($project->end));
|
||||
|
||||
@@ -1,122 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* The index view file of project module of ZenTaoPMS.
|
||||
* 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 project
|
||||
* @package ZenTaoPMS
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<table class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->selectProject;?>
|
||||
<?php echo html::select('projectID', $projects, $project->id, 'onchange="selectProject(this.value);" style="width:200px"');?>
|
||||
</caption>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/sparkline.html.php';?>
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<?php if(count($projectStats) == 0):?>
|
||||
<table class='table-1 a-center' height='100%'>
|
||||
<caption><?php echo $lang->my->home->projects;?></caption>
|
||||
<tr>
|
||||
<th width='60'><?php echo $lang->project->name;?></th>
|
||||
<td><?php echo $project->name;?></td>
|
||||
<td valign='middle'><?php printf($lang->my->home->noProjectsTip, $this->createLink('project', 'create'));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->code;?></th>
|
||||
<td><?php echo $project->code;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->beginAndEnd;?></th>
|
||||
<td><?php echo $project->begin . ' ~ ' . $project->end;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->goal;?></th>
|
||||
<td><?php echo nl2br($project->goal);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->desc;?></th>
|
||||
<td><?php echo nl2br($project->desc);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<h3>
|
||||
<?php echo html::a(inlink("index", "locate=no&status=undone"), $lang->project->unDoneProjects);?>
|
||||
<?php echo html::a(inlink("index", "locate=no&status=done"), $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->end;?></th>
|
||||
<th><?php echo $lang->project->status;?></th>
|
||||
<td class='<?php echo $project->status;?>'><?php $lang->show($lang->project->statusList, $project->status);?></td>
|
||||
<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>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->lblStats;?></th>
|
||||
<td><?php printf($lang->project->stats, $project->totalEstimate, $project->totalConsumed, $project->totalLeft, 10)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-right'>
|
||||
<?php
|
||||
if(common::hasPriv('project', 'edit')) echo html::a($this->createLink('project', 'edit', "projectID=$project->id"), $lang->project->edit);
|
||||
if(common::hasPriv('project', 'delete')) echo html::a($this->createLink('project', 'delete', "projectID=$project->id"), $lang->project->delete, 'hiddenwin');
|
||||
//echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=product"), $lang->tree->manage);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->products;?>
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php foreach($products as $productID => $productName) echo html::a($this->createLink('product', 'browse', "productID=$productID"), $productName) . '<br />';?>
|
||||
<div class='a-right'>
|
||||
<?php
|
||||
if(common::hasPriv('project', 'manageproducts')) echo html::a($this->createLink('project', 'manageproducts', "projectID=$project->id"), $lang->project->manageProducts);
|
||||
if(common::hasPriv('project', 'linkstory')) echo html::a($this->createLink('project', 'linkstory', "projectID=$project->id"), $lang->project->linkStory);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->childProjects;?>
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php foreach($childProjects as $childProjectID => $childProjectName) echo html::a($this->createLink('project', 'browse', "projectID=$childProjectID"), $childProjectName) . '<br />';?>
|
||||
<div class='a-right'>
|
||||
<?php echo html::a($this->createLink('project', 'managechilds', "projectID=$project->id"), $lang->project->manageChilds) . '<br />';?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>-->
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->team . $lang->colon . $project->team; ?>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->team->account;?></th>
|
||||
<th><?php echo $lang->team->role;?></th>
|
||||
<th><?php echo $lang->team->joinDate;?></th>
|
||||
<th><?php echo $lang->team->workingHour;?></th>
|
||||
<?php if(common::hasPriv('project', 'unlinkmember')) echo "<th>$lang->actions</th>";?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($teamMembers as $member):?>
|
||||
<?php foreach($projectStats as $project):?>
|
||||
<tr class='a-center'>
|
||||
<td>
|
||||
<?php
|
||||
if(common::hasPriv('user', 'view')) echo html::a($this->createLink('user', 'view', "account=$member->account"), $member->realname);
|
||||
else echo $member->realname;
|
||||
?>
|
||||
<td class='a-left'><?php echo html::a($this->createLink('project', 'task', 'project=' . $project->id), $project->name, '_parent');?></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><?php echo $member->role;?></td>
|
||||
<td><?php echo substr($member->joinDate, 2);?></td>
|
||||
<td><?php echo $member->workingHour;?></td>
|
||||
<?php if(common::hasPriv('project', 'unlinkmember')) echo "<td>" . html::a($this->createLink('project', 'unlinkmember', "projectID=$project->id&account=$member->account"), $lang->project->unlinkMember, 'hiddenwin') . '</td>';?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<td class='projectline a-left' values='<?php echo join(',', $project->burns);?>'></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('project', 'managemembers')) echo html::a($this->createLink('project', 'managemembers', "projectID=$project->id"), $lang->project->manageMembers) . '<br />';?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user