diff --git a/module/project/control.php b/module/project/control.php
index 1dd93353dc..bc6924e5ff 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -32,17 +32,17 @@ class project extends control
$this->projects = $this->project->getPairs();
}
- /* 项目视图首页,暂时跳转到浏览页面。*/
+ /* 项目视图首页,*/
public function index()
{
if(empty($this->projects)) $this->locate($this->createLink('project', 'create'));
- $this->locate($this->createLink($this->moduleName, 'task'));
+ $this->locate($this->createLink('project', 'browse'));
}
/* 浏览某一个项目。*/
public function browse($projectID = 0)
{
- $this->locate($this->createLink($this->moduleName, 'task', "productID=$projectID"));
+ $this->locate($this->createLink($this->moduleName, 'task', "projectID=$projectID"));
}
/* task, story, bug等方法的一些公共操作。*/
@@ -58,6 +58,9 @@ class project extends control
$childProjects = $this->project->getChildProjects($project->id);
$teamMembers = $this->project->getTeamMembers($project->id);
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, $project->id);
+
/* 将其赋值到模板系统。*/
$this->assign('projects', $this->projects);
$this->assign('project', $project);
@@ -184,6 +187,7 @@ class project extends control
public function burn($projectID = 0)
{
$this->loadModel('report');
+
/* 公共的操作。*/
$project = $this->commonAction($projectID);
@@ -208,6 +212,23 @@ class project extends control
die($this->report->createSingleXML($sets, $this->lang->project->charts->burn->graph));
}
+ /* 团队成员。*/
+ public function team($projectID = 0)
+ {
+ /* 公共的操作。*/
+ $project = $this->commonAction($projectID);
+
+ /* 设定header和position信息。*/
+ $header['title'] = $project->name . $this->lang->colon . $this->lang->project->team;
+ $position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
+ $position[] = $this->lang->project->team;
+
+ $this->assign('header', $header);
+ $this->assign('position', $position);
+
+ $this->display();
+ }
+
/* 创建一个项目。*/
public function create()
{
@@ -218,10 +239,13 @@ class project extends control
die(js::locate($this->createLink('project', 'browse', "projectID=$projectID"), 'parent'));
}
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, '');
+
$header['title'] = $this->lang->project->create;
$position[] = $header['title'];
$projects = array('' => '') + $this->projects;
-
+
$this->assign('header', $header);
$this->assign('position', $position);
$this->assign('projects', $projects);
@@ -236,8 +260,12 @@ class project extends control
{
$this->project->update($projectID);
if(dao::isError()) die(js::error(dao::getError()));
- die(js::locate($browseProjectLink, 'parent'));
+ die(js::locate($this->createLink('project', 'view', "projectID=$projectID"), 'parent'));
}
+
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, $projectID);
+
$projects = array('' => '') + $this->projects;
$project = $this->project->findById($projectID);
@@ -258,6 +286,20 @@ class project extends control
$this->display();
}
+ /* 项目基本信息。*/
+ public function view($projectID)
+ {
+ /* 公共的操作。*/
+ $project = $this->commonAction($projectID);
+
+ $header['title'] = $this->lang->project->view;
+ $position[] = $header['title'];
+
+ $this->assign('header', $header);
+ $this->assign('position', $position);
+ $this->display();
+ }
+
/* 删除一个项目。*/
public function delete($projectID, $confirm = 'no')
{
@@ -288,6 +330,9 @@ class project extends control
$this->loadModel('product');
$project = $this->project->findById($projectID);
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, $project->id);
+
/* 标题和位置信息。*/
$header['title'] = $this->lang->project->manageProducts . $this->lang->colon . $project->name;
$position[] = html::a($browseProjectLink, $project->name);
@@ -329,6 +374,9 @@ class project extends control
$childProjects = $this->project->getChildProjects($project->id);
$childProjects = join(",", array_keys($childProjects));
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, $project->id);
+
/* 赋值。*/
$this->assign('header', $header);
$this->assign('position', $position);
@@ -341,11 +389,10 @@ class project extends control
/* 维护团队成员。*/
public function manageMembers($projectID = 0)
{
- $browseProjectLink = $this->createLink('project', 'browse', "projectID=$projectID");
if(!empty($_POST))
{
$this->project->manageMembers($projectID);
- $this->locate($browseProjectLink);
+ $this->locate($this->createLink('project', 'team', "projectID=$projectID"));
exit;
}
$this->loadModel('user');
@@ -355,8 +402,11 @@ class project extends control
$users = array('' => '') + $users;
$members = $this->project->getTeamMembers($projectID);
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, $project->id);
+
$header['title'] = $this->lang->project->manageMembers . $this->lang->colon . $project->name;
- $position[] = html::a($browseProjectLink, $project->name);
+ $position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
$position[] = $this->lang->project->manageMembers;
$this->assign('header', $header);
$this->assign('position', $position);
@@ -391,6 +441,9 @@ class project extends control
$products = $this->project->getProducts($projectID);
$browseLink = $this->createLink('project', 'story', "projectID=$projectID");
+ /* 设置菜单。*/
+ $this->project->setMenu($this->projects, $project->id);
+
if(empty($products))
{
echo js::alert($this->lang->project->errorNoLinkedProducts);
diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php
index deb46b8eb6..2b4f73817c 100644
--- a/module/project/lang/zh-cn.php
+++ b/module/project/lang/zh-cn.php
@@ -28,6 +28,7 @@ $lang->project->delete = "删除项目";
$lang->project->browse = "浏览项目";
$lang->project->edit = "编辑项目";
$lang->project->manage = "维护模块";
+$lang->project->view = "基本信息";
$lang->project->selectProject = "请选择项目";
$lang->project->manageMembers = '团队管理';
@@ -79,6 +80,7 @@ $lang->project->burnData = '燃烧图数据';
$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->statusList->wait = '未开始';
$lang->project->statusList->doing = '进行中';
diff --git a/module/project/model.php b/module/project/model.php
index 29cb4c117a..75ff7e3bc6 100644
--- a/module/project/model.php
+++ b/module/project/model.php
@@ -28,6 +28,17 @@ class projectModel extends model
/* 每次关联成员的数量。*/
const LINK_MEMBERS_ONE_TIME = 10;
+ /* 设置菜单。*/
+ public function setMenu($projects, $projectID)
+ {
+ $selectHtml = html::select('projectID', $projects, $projectID, 'onchange="switchProject(this.value);"');
+ foreach($this->lang->project->menu as $key => $menu)
+ {
+ if($key == 'list') common::setMenuVars($this->lang->project->menu, 'list', $selectHtml . $this->lang->arrow);
+ else common::setMenuVars($this->lang->project->menu, $key, $projectID);
+ }
+ }
+
/* 新增项目。*/
public function create()
{
diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php
index aad46b8ce0..c35ec09a6f 100644
--- a/module/project/view/bug.html.php
+++ b/module/project/view/bug.html.php
@@ -23,70 +23,38 @@
*/
?>
-
-
-
-
-
-
- ' . html::a($this->createLink('bug', 'create', "productID=0&project=$project->id"), $lang->bug->create) . '
';
- $app->global->vars = "projectID=$project->id";
- $app->global->orderBy = $orderBy;
- function printOrderLink($fieldName)
- {
- global $app, $lang;
- if(strpos($app->global->orderBy, $fieldName) !== false)
- {
- if(stripos($app->global->orderBy, 'desc') !== false) $orderBy = str_replace('desc', 'asc', $app->global->orderBy);
- if(stripos($app->global->orderBy, 'asc') !== false) $orderBy = str_replace('asc', 'desc', $app->global->orderBy);
- }
- else
- {
- $orderBy = $fieldName . '|' . 'asc';
- }
- $link = helper::createLink('project', 'bug', $app->global->vars ."&orderBy=$orderBy");
- $fieldName = str_replace('`', '', $fieldName);
- echo html::a($link, $lang->bug->$fieldName);
- }
- ?>
-
-
-
-
-
- | bug->id;?> |
- bug->severity;?> |
- bug->title;?> |
- bug->openedBy;?> |
- bug->assignedTo;?> |
- bug->resolvedBy;?> |
- bug->resolution;?> |
-
-
-
-
-
- | createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> |
- severity?> |
- title;?> |
- openedBy];?> |
- assignedTo];?> |
- resolvedBy];?> |
- resolution;?> |
-
-
-
-
-
-
+
+
+
id", $lang->bug->create);?>
+
+
+
+
+
+ | bug->id;?> |
+ bug->severity;?> |
+ bug->title;?> |
+ bug->openedBy;?> |
+ bug->assignedTo;?> |
+ bug->resolvedBy;?> |
+ bug->resolution;?> |
+
+
+
+
+
+ | createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> |
+ severity?> |
+ title;?> |
+ openedBy];?> |
+ assignedTo];?> |
+ resolvedBy];?> |
+ resolution;?> |
+
+
+
+
+
diff --git a/module/project/view/burn.html.php b/module/project/view/burn.html.php
index 47c3c21a7f..fe038fc6a0 100644
--- a/module/project/view/burn.html.php
+++ b/module/project/view/burn.html.php
@@ -23,22 +23,5 @@
*/
?>
-
-
+
diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php
index 9c79d8476f..bb3ca2ffa5 100644
--- a/module/project/view/create.html.php
+++ b/module/project/view/create.html.php
@@ -23,7 +23,7 @@
*/
?>
-