diff --git a/config/filter.php b/config/filter.php
index a47397bb0e..81657d9d99 100644
--- a/config/filter.php
+++ b/config/filter.php
@@ -164,6 +164,7 @@ $filter->program->export->cookie['checkedItem'] = 'reg::checked';
$filter->program->ajaxgetpgmdropmenu->cookie['showClosed'] = 'code';
$filter->project->default->cookie['lastProject'] = 'int';
+$filter->project->default->cookie['lastPRJ'] = 'int';
$filter->project->default->cookie['projectMode'] = 'code';
$filter->project->story->cookie['storyModuleParam'] = 'int';
$filter->project->story->cookie['storyPreProjectID'] = 'int';
diff --git a/framework/router.class.php b/framework/router.class.php
index 2aa12e06d9..45e8d26e75 100755
--- a/framework/router.class.php
+++ b/framework/router.class.php
@@ -195,16 +195,19 @@ class router extends baseRouter
if(isset($model->model) && $model->model == 'waterfall') $projectKey = STAGE_KEY;
/* Set productCommon, projectCommon and hourCommon. Default english lang. */
- $lang->productCommon = $this->config->productCommonList[$this->clientLang][PRODUCT_KEY];
+ $lang->productCommon = $this->config->productCommonList[$this->clientLang][PRODUCT_KEY];
$lang->executionCommon = isset($this->config->executionCommonList[$this->clientLang][(int)$projectKey]) ? $this->config->executionCommonList[$this->clientLang][(int)$projectKey] : $this->config->executionCommonList['en'][(int)$$projectKey];
- $lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourKey]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourKey] : $this->config->hourPointCommonList['en'][(int)$hourKey];
+ $lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourKey]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourKey] : $this->config->hourPointCommonList['en'][(int)$hourKey];
+ /* User preference init. */
$config->URSR = $URSR;
- $config->programLink = 'programList';
- $config->productLink = 'productList';
- $config->projectLink = 'projectList';
+ $config->programLink = 'program-pgmbrowse';
+ $config->productLink = 'product-all';
+ $config->projectLink = 'program-prjbrowse';
- $userSetting = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='{$this->session->user->account}' AND `module`='common' and `key` in ('programLink', 'productLink', 'projectLink', 'URSR')")->fetchAll();
+ /* Get user preference. */
+ $account = isset($this->session->user->account) ? $this->session->user->account : '';
+ $userSetting = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='{$account}' AND `module`='common' and `key` in ('programLink', 'productLink', 'projectLink', 'URSR')")->fetchAll();
foreach($userSetting as $setting)
{
if($setting->key == 'URSR') $config->URSR = $setting->value;
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index e13e823578..4d4ad0deb3 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -131,12 +131,17 @@ $lang->typeAB = '类型';
$lang->common = new stdclass();
$lang->common->common = '公有模块';
+global $config;
+list($programModule, $programMethod) = explode('-', $config->programLink);
+list($productModule, $productMethod) = explode('-', $config->productLink);
+list($projectModule, $projectMethod) = explode('-', $config->projectLink);
+
/* 主导航菜单。*/
$lang->mainNav = new stdclass();
$lang->mainNav->my = ' 地盘|my|index|';
-$lang->mainNav->program = ' 项目集|program|pgmbrowse|';
-$lang->mainNav->product = ' 产品|product|browse|';
-$lang->mainNav->project = ' 项目|program|index|';
+$lang->mainNav->program = " 项目集|$programModule|$programMethod|";
+$lang->mainNav->product = " 产品|$productModule|$productMethod|";
+$lang->mainNav->project = " 项目|$projectModule|$projectMethod|";
$lang->mainNav->repo = ' 代码|repo|browse|';
$lang->mainNav->doc = ' 文档|doc|index|';
$lang->mainNav->system = ' 组织|subject|browse|';
@@ -203,7 +208,7 @@ $lang->productplan->menu = $lang->product->menu;
/* System menu. */
$lang->system = new stdclass();
$lang->system->menu = new stdclass();
-$lang->system->menu->company = array('link' => '全局设置|subject|browse|', 'subModule' => 'holiday,custom');
+$lang->system->menu->company = array('link' => '全局设置|subject|browse|', 'subModule' => 'holiday');
$lang->system->menu->scrum = array('link' => '敏捷模型|custom|configurescrum|');
$lang->system->menu->waterfall = array('link' => '瀑布模型|stage|settype|');
diff --git a/module/common/model.php b/module/common/model.php
index 569b453b31..05677a4e8b 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -289,7 +289,7 @@ class commonModel extends model
if(isset($lang->user->roleList[$app->user->role])) echo '
' . $lang->user->roleList[$app->user->role] . '
';
echo '
my->preference;?>
diff --git a/module/product/control.php b/module/product/control.php
index c5a0d1c8f9..07a340d200 100644
--- a/module/product/control.php
+++ b/module/product/control.php
@@ -712,10 +712,11 @@ class product extends control
* @access public
* @return void
*/
- public function dashboard($productID)
+ public function dashboard($productID = 0)
{
- $product = $this->product->getStatByID($productID);
- if(!$product) die(js::error($this->lang->notFound) . js::locate('back'));
+ $productID = $this->product->saveState($productID, $this->products);
+ $product = $this->product->getStatByID($productID);
+ if(!$product) die(js::locate('product', 'all'));
$this->lang->product->menu = $this->lang->product->viewMenu;
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
diff --git a/module/program/control.php b/module/program/control.php
index 08a01dfad2..7cb8ca4c95 100644
--- a/module/program/control.php
+++ b/module/program/control.php
@@ -104,10 +104,6 @@ class program extends control
*/
public function PGMProduct($programID = 0, $browseType = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
- $programID = $this->program->savePGMState($programID, $this->program->getPGMPairs());
- if(!$programID) $this->locate($this->createLink('program', 'PGMbrowse'));
- setCookie("lastPGM", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
-
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
@@ -400,6 +396,10 @@ class program extends control
*/
public function PGMProject($programID = 0, $browseType = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
+ $programID = $this->program->savePGMState($programID, $this->program->getPGMPairs());
+ if(!$programID) $this->locate($this->createLink('program', 'PGMbrowse'));
+ setCookie("lastPGM", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
+
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
diff --git a/module/project/control.php b/module/project/control.php
index 9f7661bca1..7da8bed048 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -67,39 +67,40 @@ class project extends control
/**
* Common actions.
*
- * @param int $projectID
+ * @param int $executionID
+ * @param string $extra
* @access public
* @return object current object
*/
- public function commonAction($projectID = 0, $extra = '')
+ public function commonAction($executionID = 0, $extra = '')
{
$this->loadModel('product');
- /* Get projects and products info. */
- $projectID = $this->project->saveState($projectID, $this->projects);
- $project = $this->project->getById($projectID);
- $products = $this->project->getProducts($projectID);
- $childProjects = $this->project->getChildExecutions($projectID);
- $teamMembers = $this->project->getTeamMembers($projectID);
- $actions = $this->loadModel('action')->getList('execution', $projectID);
+ /* Get executions and products info. */
+ $executionID = $this->project->saveState($executionID, $this->projects);
+ $execution = $this->project->getById($executionID);
+ $products = $this->project->getProducts($executionID);
+ $childExecutions = $this->project->getChildExecutions($executionID);
+ $teamMembers = $this->project->getTeamMembers($executionID);
+ $actions = $this->loadModel('action')->getList('execution', $executionID);
/* Set menu. */
- $this->project->setMenu($this->projects, $projectID, $buildID = 0, $extra);
+ $this->project->setMenu($this->projects, $executionID, $buildID = 0, $extra);
/* Assign. */
$this->view->projects = $this->projects;
- $this->view->project = $project;
- $this->view->childProjects = $childProjects;
+ $this->view->project = $execution;
+ $this->view->childProjects = $childExecutions;
$this->view->products = $products;
$this->view->teamMembers = $teamMembers;
- return $project;
+ return $execution;
}
/**
- * Tasks of a project.
+ * Tasks of a execution.
*
- * @param int $projectID
+ * @param int $executionID
* @param string $status
* @param string $orderBy
* @param int $recTotal
@@ -108,8 +109,13 @@ class project extends control
* @access public
* @return void
*/
- public function task($projectID = 0, $status = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1)
+ public function task($executionID = 0, $status = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
+ /* Save last PRJ. */
+ $projectID = $this->loadModel('program')->savePRJState($this->session->PRJ, $this->program->getPRJPairs());
+ if(!$projectID) $this->locate($this->createLink('program', 'PRJbrowse'));
+ setCookie("lastPRJ", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
+
$this->loadModel('tree');
$this->loadModel('search');
$this->loadModel('task');
@@ -120,13 +126,13 @@ class project extends control
/* Set browse type. */
$browseType = strtolower($status);
- /* Get products by project. */
- $project = $this->commonAction($projectID, $status);
- $projectID = $project->id;
- $products = $this->loadModel('product')->getProductPairsByProject($projectID);
- setcookie('preProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
+ /* Get products by execution. */
+ $execution = $this->commonAction($executionID, $status);
+ $executionID = $execution->id;
+ $products = $this->loadModel('product')->getProductPairsByProject($executionID);
+ setcookie('preProjectID', $executionID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
- if($this->cookie->preProjectID != $projectID)
+ if($this->cookie->preProjectID != $executionID)
{
$_COOKIE['moduleBrowseParam'] = $_COOKIE['productBrowseParam'] = 0;
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, false);
@@ -168,8 +174,8 @@ class project extends control
$sort = $this->loadModel('common')->appendOrder($orderBy);
/* Header and position. */
- $this->view->title = $project->name . $this->lang->colon . $this->lang->project->task;
- $this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
+ $this->view->title = $execution->name . $this->lang->colon . $this->lang->project->task;
+ $this->view->position[] = html::a($this->createLink('project', 'browse', "executionID=$executionID"), $execution->name);
$this->view->position[] = $this->lang->project->task;
/* Load pager and get tasks. */
@@ -178,17 +184,17 @@ class project extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Get tasks. */
- $tasks = $this->project->getTasks($productID, $projectID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager);
+ $tasks = $this->project->getTasks($productID, $executionID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager);
if(empty($tasks) and $pageID > 1)
{
$pager = pager::init(0, $recPerPage, 1);
- $tasks = $this->project->getTasks($productID, $projectID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager);
+ $tasks = $this->project->getTasks($productID, $executionID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager);
}
/* Build the search form. */
- $actionURL = $this->createLink('project', 'task', "projectID=$projectID&status=bySearch¶m=myQueryID");
+ $actionURL = $this->createLink('project', 'task', "executionID=$executionID&status=bySearch¶m=myQueryID");
$this->config->project->search['onMenuBar'] = 'yes';
- $this->project->buildTaskSearchForm($projectID, $this->projects, $queryID, $actionURL);
+ $this->project->buildTaskSearchForm($executionID, $this->projects, $queryID, $actionURL);
/* team member pairs. */
$memberPairs = array();
@@ -197,7 +203,7 @@ class project extends control
$showAllModule = isset($this->config->project->task->allModule) ? $this->config->project->task->allModule : '';
$extra = (isset($this->config->project->task->allModule) && $this->config->project->task->allModule == 1) ? 'allModule' : '';
$showModule = !empty($this->config->datatable->projectTask->showModule) ? $this->config->datatable->projectTask->showModule : '';
- $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($projectID, 'task', $showModule) : array();
+ $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($executionID, 'task', $showModule) : array();
/* Assign. */
$this->view->tasks = $tasks;
@@ -211,16 +217,16 @@ class project extends control
$this->view->status = $status;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->param = $param;
- $this->view->projectID = $projectID;
- $this->view->project = $project;
+ $this->view->executionID = $projectID;
+ $this->view->execution = $execution;
$this->view->productID = $productID;
- $this->view->modules = $this->tree->getTaskOptionMenu($projectID, 0, 0, $showAllModule ? 'allModule' : '');
+ $this->view->modules = $this->tree->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : '');
$this->view->moduleID = $moduleID;
- $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra);
+ $this->view->moduleTree = $this->tree->getTaskTreeMenu($executionID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra);
$this->view->memberPairs = $memberPairs;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty');
$this->view->setModule = true;
- $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable.
+ $this->view->canBeChanged = common::canModify('project', $execution); // Determines whether an object is editable.
$this->display();
}
diff --git a/module/project/model.php b/module/project/model.php
index 5472e7e4d4..6b80915443 100644
--- a/module/project/model.php
+++ b/module/project/model.php
@@ -269,20 +269,27 @@ class projectModel extends model
/**
* Save the project id user last visited to session.
*
- * @param int $projectID
- * @param array $projects
+ * @param int $executionID
+ * @param array $executions
* @access public
* @return int
*/
- public function saveState($projectID, $projects)
+ public function saveState($executionID, $executions)
{
- if($projectID > 0) $this->session->set('project', (int)$projectID);
- if($projectID == 0 and $this->cookie->lastProject) $this->session->set('project', (int)$this->cookie->lastProject);
- if($projectID == 0 and $this->session->project == '') $this->session->set('project', key($projects));
- if(!isset($projects[$this->session->project]))
+ if($executionID > 0) $this->session->set('project', (int)$executionID);
+ if($executionID == 0 and $this->cookie->lastProject)
{
- $this->session->set('project', key($projects));
- if($projectID && strpos(",{$this->app->user->view->sprints},", ",{$this->session->project},") === false) $this->accessDenied();
+ /* Project link is project-task. */
+ $executionID = (int)$this->cookie->lastProject;
+ $executions = $this->getExecutionPairs($this->session->PRJ);
+ $executionID = in_array($executionID, array_keys($executions)) ? $executionID : key($executions);
+ $this->session->set('project', $executionID);
+ }
+ if($executionID == 0 and $this->session->project == '') $this->session->set('project', key($executions));
+ if(!isset($executions[$this->session->project]))
+ {
+ $this->session->set('project', key($executions));
+ if($executionID && strpos(",{$this->app->user->view->sprints},", ",{$this->session->project},") === false) $this->accessDenied();
}
return $this->session->project;
}
diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php
index e3807fe637..e2f8bab1d4 100644
--- a/module/project/view/task.html.php
+++ b/module/project/view/task.html.php
@@ -17,12 +17,12 @@ include '../../common/view/datepicker.html.php';
include '../../common/view/datatable.fix.html.php';
js::set('moduleID', $moduleID);
js::set('productID', $productID);
-js::set('projectID', $projectID);
+js::set('executionID', $executionID);
js::set('browseType', $browseType);
/* Set unfold parent taskID. */
$unfoldTasks = isset($config->project->task->unfoldTasks) ? json_decode($config->project->task->unfoldTasks, true) : array();
-$unfoldTasks = zget($unfoldTasks, $projectID, array());
+$unfoldTasks = zget($unfoldTasks, $executionID, array());
js::set('unfoldTasks', $unfoldTasks);
js::set('unfoldAll', $lang->project->treeLevel['all']);
js::set('foldAll', $lang->project->treeLevel['root']);
@@ -34,14 +34,14 @@ js::set('foldAll', $lang->project->treeLevel['root']);
if(!empty($productID))
{
$product = $this->product->getById($productID);
- $removeLink = $browseType == 'byproduct' ? inlink('task', "projectID=$projectID&browseType=$status¶m=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("productBrowseParam")';
+ $removeLink = $browseType == 'byproduct' ? inlink('task', "executionID=$executionID&browseType=$status¶m=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("productBrowseParam")';
echo $product->name;
echo html::a($removeLink, "", '', "class='text-muted'");
}
elseif(!empty($moduleID))
{
$module = $this->tree->getById($moduleID);
- $removeLink = $browseType == 'bymodule' ? inlink('task', "projectID=$projectID&browseType=$status¶m=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("moduleBrowseParam")';
+ $removeLink = $browseType == 'bymodule' ? inlink('task', "executionID=$executionID&browseType=$status¶m=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("moduleBrowseParam")';
echo $module->name;
echo html::a($removeLink, "", '', "class='text-muted'");
}
@@ -57,12 +57,12 @@ js::set('foldAll', $lang->project->treeLevel['root']);
type == 'ops' && $menuItem->name == 'needconfirm') continue;
+ if($execution->type == 'ops' && $menuItem->name == 'needconfirm') continue;
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
if($menuType == 'QUERY')
{
- $searchBrowseLink = $this->createLink('project', 'task', "project=$projectID&type=bySearch¶m=%s");
+ $searchBrowseLink = $this->createLink('project', 'task', "project=$executionID&type=bySearch¶m=%s");
$isBySearch = $this->session->taskBrowseType == 'bysearch';
include '../../common/view/querymenu.html.php';
}
@@ -72,7 +72,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
$label .= $menuType == $this->session->taskBrowseType ? " {$pager->recTotal}" : '';
$active = $menuType == $this->session->taskBrowseType ? 'btn-active-text' : '';
$title = $menuType == 'needconfirm' ? "title='{$lang->task->storyChange}'" : '';
- echo html::a(inlink('task', "project=$projectID&type=$menuType"), $label, '', "id='{$menuType}' class='btn btn-link $active' $title");
+ echo html::a(inlink('task', "project=$executionID&type=$menuType"), $label, '', "id='{$menuType}' class='btn btn-link $active' $title");
}
elseif($menuType == 'status')
{
@@ -91,7 +91,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
{
if($key == '') continue;
echo '';
- echo html::a($this->createLink('project', 'task', "project=$projectID&type=$key"), $value);
+ echo html::a($this->createLink('project', 'task', "project=$executionID&type=$key"), $value);
}
echo '';
}
@@ -103,7 +103,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
@@ -112,25 +112,25 @@ js::set('foldAll', $lang->project->treeLevel['root']);
createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=$browseType") : '#';
+ $link = common::hasPriv('task', 'export') ? $this->createLink('task', 'export', "project=$executionID&orderBy=$orderBy&type=$browseType") : '#';
echo "
" . html::a($link, $lang->task->export, '', $misc) . "";
?>
-
+
@@ -138,27 +138,27 @@ js::set('foldAll', $lang->project->treeLevel['root']);
project = $projectID;
+ $checkObject->project = $executionID;
?>
createLink('task', 'batchCreate', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : ''));
+ $link = $this->createLink('task', 'batchCreate', "project=$executionID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : ''));
if($canBeChanged and common::hasPriv('task', 'batchCreate', $checkObject)) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'");
- $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
+ $link = $this->createLink('task', 'create', "project=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
if($canBeChanged and common::hasPriv('task', 'create', $checkObject)) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'");
?>
";
- $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
+ $link = $this->createLink('task', 'create', "project=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
if($canBeChanged and common::hasPriv('task', 'create', $checkObject)) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'");
?>
@@ -197,12 +197,12 @@ js::set('foldAll', $lang->project->treeLevel['root']);
moduleName . ucfirst($this->methodName);
$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
- $vars = "projectID=$project->id&status=$status&parma=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage";
+ $vars = "executionID=$execution->id&status=$status&parma=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage";
if($useDatatable) include '../../common/view/datatable.html.php';
$customFields = $this->datatable->getSetting('project');
- if($project->type == 'ops')
+ if($execution->type == 'ops')
{
foreach($customFields as $id => $customField)
{
@@ -265,7 +265,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);