diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index 18c10af3e6..0b4469de0c 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -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;
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index cdc63701d7..99ca2b9a08 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -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;
diff --git a/module/project/config.php b/module/project/config.php
index 5b665c5393..5c10b02787 100644
--- a/module/project/config.php
+++ b/module/project/config.php
@@ -1,4 +1,6 @@
project->projectCounts = 50;
+
global $lang, $app;
$app->loadLang('task');
$config->project->create->requiredFields = 'name,code,team,begin,end';
diff --git a/module/project/control.php b/module/project/control.php
index 0d3f06631f..877389152f 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -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);
diff --git a/module/project/js/common.js b/module/project/js/common.js
index 1a6080069c..c74ad68e3e 100644
--- a/module/project/js/common.js
+++ b/module/project/js/common.js
@@ -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});
+})
diff --git a/module/project/lang/en.php b/module/project/lang/en.php
index 838cd5a0fc..370d1d989b 100644
--- a/module/project/lang/en.php
+++ b/module/project/lang/en.php
@@ -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,
confused『%s』hours
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 = "%s tasks this page, wait:%s, doing:%s, estimate %s, consumed %s, left %s hours.";
-$lang->project->groupSummary = "%s tasks this group, wait:%s, doing:%s, estimate %s, consumed %s, left %s hours.";
-$lang->project->wbs = "WBS";
-$lang->project->largeBurnChart = 'View large';
-$lang->project->howToUpdateBurn= "How?";
-$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,
confused『%s』hours
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 = "%s tasks this page, wait:%s, doing:%s, estimate %s, consumed %s, left %s hours.";
+$lang->project->groupSummary = "%s tasks this group, wait:%s, doing:%s, estimate %s, consumed %s, left %s hours.";
+$lang->project->wbs = "WBS";
+$lang->project->largeBurnChart = 'View large';
+$lang->project->howToUpdateBurn = "How?";
+$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]?';
diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php
index 3b8d092ea5..d3dc4f586f 100644
--- a/module/project/lang/zh-cn.php
+++ b/module/project/lang/zh-cn.php
@@ -117,17 +117,19 @@ $lang->project->byQuery = '搜索';
$lang->project->allProject = '所有项目';
/* 页面提示。*/
-$lang->project->selectProject = "请选择项目";
-$lang->project->beginAndEnd = '起止时间';
-$lang->project->lblStats = '工时统计';
-$lang->project->stats = '总共预计%s工时
已经消耗%s工时
预计剩余%s工时';
-$lang->project->oneLineStats = "项目%s, 代号为%s, 相关产品为%s,%s开始,%s结束,总预计%s工时,已消耗%s工时,预计剩余%s工时。";
-$lang->project->taskSummary = "本页共 %s 个任务,未开始%s,进行中%s,总预计%s工时,已消耗%s工时,剩余%s工时。";
-$lang->project->groupSummary = "本组共 %s 个任务,未开始%s,进行中%s,总预计%s工时,已消耗%s工时,剩余%s工时。";
-$lang->project->wbs = "分解任务";
-$lang->project->largeBurnChart = '点击查看大图';
-$lang->project->howToUpdateBurn= "如何更新?";
-$lang->project->whyNoStories = "看起来没有需求可以关联。请检查下项目关联的产品中有没有需求,而且要确保它们已经审核通过。";
+$lang->project->selectProject = "请选择项目";
+$lang->project->beginAndEnd = '起止时间';
+$lang->project->lblStats = '工时统计';
+$lang->project->stats = '总共预计%s工时
已经消耗%s工时
预计剩余%s工时';
+$lang->project->oneLineStats = "项目%s, 代号为%s, 相关产品为%s,%s开始,%s结束,总预计%s工时,已消耗%s工时,预计剩余%s工时。";
+$lang->project->taskSummary = "本页共 %s 个任务,未开始%s,进行中%s,总预计%s工时,已消耗%s工时,剩余%s工时。";
+$lang->project->groupSummary = "本组共 %s 个任务,未开始%s,进行中%s,总预计%s工时,已消耗%s工时,剩余%s工时。";
+$lang->project->wbs = "分解任务";
+$lang->project->largeBurnChart = '点击查看大图';
+$lang->project->howToUpdateBurn = "如何更新?";
+$lang->project->whyNoStories = "看起来没有需求可以关联。请检查下项目关联的产品中有没有需求,而且要确保它们已经审核通过。";
+$lang->project->doneProjects = '已结束';
+$lang->project->unDoneProjects = '未结束';
/* 交互提示。*/
$lang->project->confirmDelete = '您确定删除项目[%s]吗?';
diff --git a/module/project/model.php b/module/project/model.php
index 3f5785227c..6fa243078c 100644
--- a/module/project/model.php
+++ b/module/project/model.php
@@ -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));
diff --git a/module/project/view/index.html.php b/module/project/view/index.html.php
index 62b112ce20..6e4dca19f0 100644
--- a/module/project/view/index.html.php
+++ b/module/project/view/index.html.php
@@ -1,122 +1,56 @@
- * @package project
+ * @package ZenTaoPMS
* @version $Id$
- * @link http://www.zentao.net
*/
?>
-
-
-
-
- project->selectProject;?>
- id, 'onchange="selectProject(this.value);" style="width:200px"');?>
-
+
+
+
+
+
+ my->home->projects;?>
- | project->name;?> |
- name;?> |
+ my->home->noProjectsTip, $this->createLink('project', 'create'));?> |
-
- | project->code;?> |
- code;?> |
-
-
- | project->beginAndEnd;?> |
- begin . ' ~ ' . $project->end;?> |
-
-
- | project->goal;?> |
- goal);?> |
-
-
- | project->desc;?> |
- desc);?> |
-
-
+
+
+
+ project->unDoneProjects);?>
+ project->doneProjects);?>
+
+
+
+ | project->name;?> |
+ project->end;?> |
project->status;?> |
- show($lang->project->statusList, $project->status);?> |
+ project->totalEstimate;?> |
+ project->totalConsumed;?> |
+ project->totalLeft;?> |
+ project->progess;?> |
+ project->burn;?> |
-
- | project->lblStats;?> |
- project->stats, $project->totalEstimate, $project->totalConsumed, $project->totalLeft, 10)?> |
-
-
- |
- 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);
- ?>
- |
-
-
-
-
- project->products;?>
-
-
-
- $productName) echo html::a($this->createLink('product', 'browse', "productID=$productID"), $productName) . ' ';?>
-
- 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);
- ?>
-
- |
-
-
-
-
-
- project->team . $lang->colon . $project->team; ?>
-
-
-
- | team->account;?> |
- team->role;?> |
- team->joinDate;?> |
- team->workingHour;?> |
- $lang->actions";?>
-
-
-
-
+
- |
- createLink('user', 'view', "account=$member->account"), $member->realname);
- else echo $member->realname;
- ?>
+ | createLink('project', 'task', 'project=' . $project->id), $project->name, '_parent');?> |
+ end;?> |
+ project->statusList[$project->status];?> |
+ hours->totalEstimate;?> |
+ hours->totalConsumed;?> |
+ hours->totalLeft;?> |
+
+ hours->progress;?> height='13' text-align: />
+ hours->progress;?>%
|
- role;?> |
- joinDate, 2);?> |
- workingHour;?> |
- " . html::a($this->createLink('project', 'unlinkmember', "projectID=$project->id&account=$member->account"), $lang->project->unlinkMember, 'hiddenwin') . '';?>
-
-
-
+ burns);?>'> |
+
+
-
- createLink('project', 'managemembers', "projectID=$project->id"), $lang->project->manageMembers) . '
';?>
+
-
-
+