* Finish task #9028.
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = '<i class="icon icon-menu-my"></i> 地盘|my|index|';
|
||||
$lang->mainNav->program = '<i class="icon icon-folder-open-o"></i> 项目集|program|pgmbrowse|';
|
||||
$lang->mainNav->product = '<i class="icon icon-product"></i> 产品|product|browse|';
|
||||
$lang->mainNav->project = '<i class="icon icon-project"></i> 项目|program|index|';
|
||||
$lang->mainNav->program = "<i class='icon icon-folder-open-o'></i> 项目集|$programModule|$programMethod|";
|
||||
$lang->mainNav->product = "<i class='icon icon-product'></i> 产品|$productModule|$productMethod|";
|
||||
$lang->mainNav->project = "<i class='icon icon-project'></i> 项目|$projectModule|$projectMethod|";
|
||||
$lang->mainNav->repo = '<i class="icon icon-code1"></i> 代码|repo|browse|';
|
||||
$lang->mainNav->doc = '<i class="icon icon-doc"></i> 文档|doc|index|';
|
||||
$lang->mainNav->system = '<i class="icon icon-group"></i> 组织|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|');
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ class commonModel extends model
|
||||
if(isset($lang->user->roleList[$app->user->role])) echo '<div class="user-profile-role">' . $lang->user->roleList[$app->user->role] . '</div>';
|
||||
echo '</a></li><li class="divider"></li>';
|
||||
echo '<li>' . html::a(helper::createLink('my', 'profile', '', '', true), "<i class='icon icon-account'></i> " . $lang->profile, '', "class='iframe' data-width='600'") . '</li>';
|
||||
echo '<li>' . html::a(helper::createLink('my', 'preference', '', '', true), "<i class='icon icon-controls'></i> " . $lang->preference, '', "class='iframe' data-width='700'") . '</li>';
|
||||
echo '<li>' . html::a(helper::createLink('my', 'preference', '', '', true), "<i class='icon icon-controls'></i> " . $lang->preference, '', "class='iframe' data-width='650'") . '</li>';
|
||||
echo '<li>' . html::a(helper::createLink('my', 'changepassword', '', '', true), "<i class='icon icon-cog-outline'></i> " . $lang->changePassword, '', "class='iframe' data-width='600'") . '</li>';
|
||||
echo "<li id='menuToggleItem'><a type='button' class='menu-toggle'><i class='icon icon-sm icon-menu-collapse'></i> <span class='is-unfold'>$lang->unfoldMenu</span><span class='is-collapse'>$lang->collapseMenu</span></a></li>";
|
||||
|
||||
|
||||
@@ -494,7 +494,7 @@ class custom extends control
|
||||
{
|
||||
$this->loadModel('setting')->setItem('system.custom.URSR', $key);
|
||||
|
||||
die(js::reload('parent'));
|
||||
die(js::locate(inlink('browseStoryConcept'), 'parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,7 +57,7 @@ body.menu-hide {padding-left: 0;}
|
||||
#userNav>li .top .dropdown-menu{top: -60px}
|
||||
#userNav .dropdown-menu>li>a>.icon { position: initial; display: inline;}
|
||||
#userNav li.open>a{background:#0c64eb}
|
||||
#userNav li.divider{opacity: .24; border-top: 1px solid; height: 0px;}
|
||||
#userNav li.divider{opacity: .24; border-top: 1px solid; height: 2px;}
|
||||
#userNav .dropdown-submenu:focus > a, #userNav .dropdown-submenu:hover > a {background-color: rgba(0,0,0,.2);}
|
||||
#poweredBy{width: 55%; position: absolute; top: 4px; right: 0; padding: 0;}
|
||||
|
||||
|
||||
@@ -801,9 +801,9 @@ class my extends control
|
||||
$this->view->position[] = $this->lang->my->preference;
|
||||
$this->view->URSRList = $this->loadModel('custom')->getURSRPairs();
|
||||
$this->view->URSR = $URSR ? $URSR : $this->setting->getItem('owner=system&module=custom&key=URSR');
|
||||
$this->view->programLink = $programLink ? $programLink : 'PGMList';
|
||||
$this->view->productLink = $productLink ? $productLink : 'productList';
|
||||
$this->view->projectLink = $projectLink ? $projectLink : 'PRJList';
|
||||
$this->view->programLink = $programLink ? $programLink : 'program-pgmbrowse';
|
||||
$this->view->productLink = $productLink ? $productLink : 'product-all';
|
||||
$this->view->projectLink = $projectLink ? $projectLink : 'program-prjbrowse';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -86,19 +86,19 @@ $lang->my->productLink = '产品默认着陆页';
|
||||
$lang->my->projectLink = '项目默认着陆页';
|
||||
|
||||
$lang->my->programLinkList = array();
|
||||
$lang->my->programLinkList['PGMHome'] = '默认进入项目集主页,可以了解公司整体的战略规划状况';
|
||||
$lang->my->programLinkList['PGMList'] = '默认进入项目集列表,可以查看所有的项目集';
|
||||
$lang->my->programLinkList['PGMIndex'] = '默认进入最近一个项目集仪表盘,可以查看当前项目集概况';
|
||||
$lang->my->programLinkList['PGMProject'] = '默认进入最近一个项目集的项目列表,可以查看当前项目集下所有项目';
|
||||
//$lang->my->programLinkList['program-home'] = '默认进入项目集主页,可以了解公司整体的战略规划状况';
|
||||
$lang->my->programLinkList['program-pgmbrowse'] = '默认进入项目集列表,可以查看所有的项目集';
|
||||
//$lang->my->programLinkList['program-pgmindex'] = '默认进入最近一个项目集仪表盘,可以查看当前项目集概况';
|
||||
$lang->my->programLinkList['program-pgmproject'] = '默认进入最近一个项目集的项目列表,可以查看当前项目集下所有项目';
|
||||
|
||||
$lang->my->productLinkList = array();
|
||||
$lang->my->productLinkList['productHome'] = '默认进入产品主页,可以了解公司整体的产品状况';
|
||||
$lang->my->productLinkList['productList'] = '默认进入产品列表,可以查看所有的产品';
|
||||
$lang->my->productLinkList['productIndex'] = '默认进入最近一个产品仪表盘,可以查看当前产品概况';
|
||||
$lang->my->productLinkList['productStory'] = '默认进入最近一个产品的需求列表,可以查看当前产品下的需求信息';
|
||||
$lang->my->productLinkList['product-index'] = '默认进入产品主页,可以了解公司整体的产品状况';
|
||||
$lang->my->productLinkList['product-all'] = '默认进入产品列表,可以查看所有的产品';
|
||||
$lang->my->productLinkList['product-dashboard'] = '默认进入最近一个产品仪表盘,可以查看当前产品概况';
|
||||
$lang->my->productLinkList['product-browse'] = '默认进入最近一个产品的需求列表,可以查看当前产品下的需求信息';
|
||||
|
||||
$lang->my->projectLinkList = array();
|
||||
$lang->my->projectLinkList['PRJHome'] = '默认进入项目主页,可以了解公司整体的项目状况';
|
||||
$lang->my->projectLinkList['PRJList'] = '默认进入项目列表,可以查看所有的项目';
|
||||
$lang->my->projectLinkList['PRJIndex'] = '默认进入最近一个项目仪表盘,可以查看当前项目概况';
|
||||
$lang->my->projectLinkList['PRJTask'] = '默认进入最近一个项目迭代的任务列表,可以查看当前迭代下的任务信息';
|
||||
//$lang->my->projectLinkList['program-home'] = '默认进入项目主页,可以了解公司整体的项目状况';
|
||||
$lang->my->projectLinkList['program-prjbrowse'] = '默认进入项目列表,可以查看所有的项目';
|
||||
$lang->my->projectLinkList['program-index'] = '默认进入最近一个项目仪表盘,可以查看当前项目概况';
|
||||
$lang->my->projectLinkList['project-task'] = '默认进入最近一个项目迭代的任务列表,可以查看当前迭代下的任务信息';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<style> #submit{margin-top: 20px} </style>
|
||||
<style> #submit{margin-top: 40px} </style>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><i class='icon-key'></i> <?php echo $lang->my->preference;?></h2>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
+40
-34
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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, "<i class='icon icon-sm icon-close'></i>", '', "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, "<i class='icon icon-sm icon-close'></i>", '', "class='text-muted'");
|
||||
}
|
||||
@@ -57,12 +57,12 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<?php
|
||||
foreach(customModel::getFeatureMenu('project', 'task') as $menuItem)
|
||||
{
|
||||
if($project->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 ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : '';
|
||||
$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 '<li' . ($key == $taskBrowseType ? " class='active'" : '') . '>';
|
||||
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 '</ul></div>';
|
||||
}
|
||||
@@ -103,7 +103,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<?php
|
||||
if(!isset($browseType)) $browseType = '';
|
||||
if(!isset($orderBy)) $orderBy = '';
|
||||
common::printIcon('task', 'report', "project=$projectID&browseType=$browseType", '', 'button', 'bar-chart muted');
|
||||
common::printIcon('task', 'report', "project=$executionID&browseType=$browseType", '', 'button', 'bar-chart muted');
|
||||
?>
|
||||
|
||||
<div class="btn-group dropdown-hover">
|
||||
@@ -112,25 +112,25 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<?php
|
||||
$class = common::hasPriv('task', 'export') ? '' : "class=disabled";
|
||||
$misc = common::hasPriv('task', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('task', 'export') ? $this->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 "<li $class>" . html::a($link, $lang->task->export, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if(common::canModify('project', $project)):?>
|
||||
<?php if(common::canModify('project', $execution)):?>
|
||||
<div class="btn-group dropdown-hover">
|
||||
<button class="btn btn-link" data-toggle="dropdown"><i class="icon icon-import muted"></i> <span class="text"><?php echo $lang->import;?></span> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu pull-right" id='importActionMenu'>
|
||||
<?php
|
||||
$class = common::hasPriv('project', 'importTask') ? '' : "class=disabled";
|
||||
$misc = common::hasPriv('project', 'importTask') ? "class='import'" : "class=disabled";
|
||||
$link = common::hasPriv('project', 'importTask') ? $this->createLink('project', 'importTask', "project=$project->id") : '#';
|
||||
$link = common::hasPriv('project', 'importTask') ? $this->createLink('project', 'importTask', "project=$execution->id") : '#';
|
||||
echo "<li $class>" . html::a($link, $lang->project->importTask, '', $misc) . "</li>";
|
||||
|
||||
$class = common::hasPriv('project', 'importBug') ? '' : "class=disabled";
|
||||
$misc = common::hasPriv('project', 'importBug') ? "class='import'" : "class=disabled";
|
||||
$link = common::hasPriv('project', 'importBug') ? $this->createLink('project', 'importBug', "project=$project->id") : '#';
|
||||
$link = common::hasPriv('project', 'importBug') ? $this->createLink('project', 'importBug', "project=$execution->id") : '#';
|
||||
echo "<li $class>" . html::a($link, $lang->project->importBug, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
@@ -138,27 +138,27 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$checkObject = new stdclass();
|
||||
$checkObject->project = $projectID;
|
||||
$checkObject->project = $executionID;
|
||||
?>
|
||||
<?php if(!common::checkNotCN()):?>
|
||||
<?php
|
||||
$link = $this->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, "<i class='icon icon-plus'></i> {$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, "<i class='icon icon-plus'></i> {$lang->task->create}", '', "class='btn btn-primary'");
|
||||
?>
|
||||
<?php else:?>
|
||||
<?php
|
||||
echo "<div class='btn-group dropdown-hover'>";
|
||||
$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, "<i class='icon icon-plus'></i> {$lang->task->create} </span><span class='caret'>", '', "class='btn btn-primary'");
|
||||
?>
|
||||
<ul class='dropdown-menu'>
|
||||
<?php $disabled = common::hasPriv('task', 'batchCreate') ? '' : "class='disabled'";?>
|
||||
<li <?php echo $disabled?>>
|
||||
<?php
|
||||
$batchLink = $this->createLink('task', 'batchCreate', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : ''));
|
||||
$batchLink = $this->createLink('task', 'batchCreate', "project=$executionID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : ''));
|
||||
echo "<li>" . html::a($batchLink, "<i class='icon icon-plus'></i>" . $lang->task->batchCreate) . "</li>";
|
||||
?>
|
||||
</li>
|
||||
@@ -173,7 +173,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<div class="cell">
|
||||
<?php echo $moduleTree;?>
|
||||
<div class="text-center">
|
||||
<?php common::printLink('tree', 'browsetask', "rootID=$projectID&productID=0", $lang->tree->manage, '', "class='btn btn-info btn-wide'");?>
|
||||
<?php common::printLink('tree', 'browsetask', "rootID=$executionID&productID=0", $lang->tree->manage, '', "class='btn btn-info btn-wide'");?>
|
||||
<hr class="space-sm" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -185,7 +185,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->task->noTask;?></span>
|
||||
<?php if($canBeChanged and common::hasPriv('task', 'create')):?>
|
||||
<?php echo html::a($this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")), "<i class='icon icon-plus'></i> " . $lang->task->create, '', "class='btn btn-info'");?>
|
||||
<?php echo html::a($this->createLink('task', 'create', "project=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")), "<i class='icon icon-plus'></i> " . $lang->task->create, '', "class='btn btn-info'");?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -197,12 +197,12 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<?php
|
||||
$datatableId = $this->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']);
|
||||
<div class="table-actions btn-toolbar">
|
||||
<div class='btn-group dropup'>
|
||||
<?php
|
||||
$actionLink = $this->createLink('task', 'batchEdit', "projectID=$projectID");
|
||||
$actionLink = $this->createLink('task', 'batchEdit', "executionID=$executionID");
|
||||
$disabled = $canBatchEdit ? '' : "disabled='disabled'";
|
||||
|
||||
echo html::commonButton($lang->edit, "data-form-action='$actionLink' $disabled");
|
||||
@@ -318,7 +318,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->assignedTo;?> <span class="caret"></span></button>
|
||||
<?php
|
||||
$withSearch = count($memberPairs) > 10;
|
||||
$actionLink = $this->createLink('task', 'batchAssignTo', "projectID=$projectID");
|
||||
$actionLink = $this->createLink('task', 'batchAssignTo', "executionID=$executionID");
|
||||
echo html::select('assignedTo', $memberPairs, '', 'class="hidden"');
|
||||
if($withSearch):
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user