* Add product program project menu group.
This commit is contained in:
@@ -153,6 +153,8 @@ $filter->product->index->cookie['preBranch'] = 'int';
|
||||
$filter->product->export->cookie['checkedItem'] = 'reg::checked';
|
||||
$filter->product->project->cookie['PRJMine'] = 'code';
|
||||
|
||||
$filter->program->default->cookie['lastPGM'] = 'int';
|
||||
$filter->program->default->cookie['lastPRJ'] = 'int';
|
||||
$filter->program->prjbrowse->cookie['programType'] = 'code';
|
||||
$filter->program->prjbrowse->cookie['PRJMine'] = 'code';
|
||||
$filter->program->pgmproject->cookie['PRJMine'] = 'code';
|
||||
|
||||
@@ -850,14 +850,7 @@ class baseRouter
|
||||
*/
|
||||
public function setPRJ()
|
||||
{
|
||||
if(isset($_GET['PRJ']))
|
||||
{
|
||||
$this->session->set('PRJ', $_GET['PRJ']); //Set PRJ id into session.
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($_SESSION['PRJ']);
|
||||
}
|
||||
if(isset($_GET['PRJ'])) $this->session->set('PRJ', $_GET['PRJ']); //Set PRJ id into session.
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -18,12 +18,13 @@ class ciModel extends model
|
||||
public function setMenu()
|
||||
{
|
||||
$repoID = $this->session->repoID;
|
||||
$projectID = $this->session->PRJ;
|
||||
$projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0;
|
||||
$moduleName = $this->app->getModuleName();
|
||||
foreach($this->lang->{$moduleName}->menu as $key => $menu) common::setMenuVars($this->lang->{$moduleName}->menu, $key, $repoID);
|
||||
$this->lang->{$moduleName}->menuOrder = $this->lang->ci->menuOrder;
|
||||
if(!$projectID)
|
||||
{
|
||||
$this->lang->navGroup->repo = 'repo';
|
||||
$this->lang->navGroup->jenkins = 'repo';
|
||||
$this->lang->navGroup->job = 'repo';
|
||||
$this->lang->navGroup->compile = 'repo';
|
||||
|
||||
@@ -130,9 +130,9 @@ $lang->common->common = '公有模块';
|
||||
/* 主导航菜单。*/
|
||||
$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|index|';
|
||||
$lang->mainNav->project = '<i class="icon icon-project"></i> 项目|program|prjbrowse|';
|
||||
$lang->mainNav->program = '<i class="icon icon-folder-open-o"></i> 项目集|program|pgmproduct|';
|
||||
$lang->mainNav->product = '<i class="icon icon-product"></i> 产品|product|browse|';
|
||||
$lang->mainNav->project = '<i class="icon icon-project"></i> 项目|program|index|';
|
||||
$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|';
|
||||
|
||||
@@ -20,9 +20,9 @@ include 'chosen.html.php';
|
||||
</div>
|
||||
<nav id='navbar'><?php commonModel::printMainmenu($app->rawModule, $app->rawMethod);?></nav>
|
||||
<div id='toolbar'>
|
||||
<div id="userMenu">
|
||||
<?php common::printSearchBox();?>
|
||||
</div>
|
||||
<?php if($isProgram) echo isset($lang->program->mainMenuAction) ? $lang->program->mainMenuAction : '';?>
|
||||
<?php if($isProject) echo $this->loadModel('program')->getPRJMainAction($app->rawModule, $app->rawMethod);?>
|
||||
<?php if($isProduct) echo isset($lang->product->mainMenuAction) ? $lang->product->mainMenuAction : '';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+16
-5
@@ -27,7 +27,7 @@ class doc extends control
|
||||
$this->loadModel('project');
|
||||
$this->from = $this->cookie->from ? $this->cookie->from : 'doc';
|
||||
$this->productID = $this->cookie->product ? $this->cookie->product : '0';
|
||||
$this->projectID = $this->session->PRJ;
|
||||
$this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0;
|
||||
if(!$this->projectID) $this->lang->navGroup->doc = 'doc';
|
||||
}
|
||||
|
||||
@@ -113,7 +113,10 @@ class doc extends control
|
||||
{
|
||||
$this->lang->navGroup->doc = 'product';
|
||||
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
|
||||
$this->product->setMenu($this->product->getPairs(), $lib->product);
|
||||
$this->product->setMenu($this->product->getPairs(), $productID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->lang->noMenuModule[] = 'doc';
|
||||
$this->lang->set('menugroup.doc', 'product');
|
||||
}
|
||||
elseif($from == 'project')
|
||||
@@ -343,10 +346,13 @@ class doc extends control
|
||||
/* According the from, set menus. */
|
||||
if($this->from == 'product')
|
||||
{
|
||||
$this->lang->navGroup->doc = 'project';
|
||||
$this->lang->navGroup->doc = 'product';
|
||||
$this->lang->doc->menu = $this->lang->product->menu;
|
||||
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
|
||||
$this->product->setMenu($this->product->getPairs(''), $lib->product);
|
||||
$this->product->setMenu($this->product->getPairs(), $lib->product);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($lib->product);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->lang->noMenuModule[] = 'doc';
|
||||
$this->lang->set('menugroup.doc', 'product');
|
||||
|
||||
$this->lang->TRActions = common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib'), "<i class='icon icon-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe' data-width='70%'") : '';
|
||||
@@ -770,6 +776,9 @@ class doc extends control
|
||||
$this->lang->doc->menu = $this->lang->product->menu;
|
||||
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
|
||||
$this->product->setMenu($this->product->getPairs(), $objectID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($objectID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->lang->noMenuModule[] = 'doc';
|
||||
$this->lang->set('menugroup.doc', 'product');
|
||||
}
|
||||
elseif($this->from == 'project')
|
||||
@@ -865,7 +874,9 @@ class doc extends control
|
||||
$this->lang->navGroup->doc = 'product';
|
||||
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
|
||||
$this->product->setMenu($this->product->getPairs(), $objectID);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($objectID);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($objectID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->lang->noMenuModule[] = 'doc';
|
||||
$this->lang->set('menugroup.doc', 'product');
|
||||
}
|
||||
elseif($from == 'project')
|
||||
|
||||
@@ -216,8 +216,9 @@ class personnel extends control
|
||||
public function setProgramNavMenu($programID = 0)
|
||||
{
|
||||
$this->loadModel('program');
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
}
|
||||
}
|
||||
|
||||
+26
-13
@@ -49,7 +49,8 @@ class product extends control
|
||||
*/
|
||||
public function index($locate = 'auto', $productID = 0, $status = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
{
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher();
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher();
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
if($locate == 'yes') $this->locate($this->createLink($this->moduleName, 'browse'));
|
||||
|
||||
@@ -78,7 +79,8 @@ class product extends control
|
||||
public function project($status = 'all', $productID = 0, $branch = 0, $PRJMine = 0)
|
||||
{
|
||||
$this->product->setMenu($this->products, $productID, $branch);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
$this->app->loadLang('my');
|
||||
$this->app->loadLang('program');
|
||||
@@ -146,7 +148,8 @@ class product extends control
|
||||
$this->session->set('productList', $this->app->getURI(true));
|
||||
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, "storyType=$storyType", $branch);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, "storyType=$storyType", $branch);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($this->products, $productID, $branch);
|
||||
}
|
||||
|
||||
@@ -256,7 +259,8 @@ class product extends control
|
||||
*/
|
||||
public function create($programID = 0)
|
||||
{
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher();
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher();
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -279,7 +283,8 @@ class product extends control
|
||||
$this->app->rawMethod = 'pgmproduct';
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->loadModel('program')->setPGMViewMenu($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
}
|
||||
|
||||
$this->loadModel('user');
|
||||
@@ -321,7 +326,8 @@ class product extends control
|
||||
{
|
||||
$this->app->loadLang('custom');
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -357,7 +363,8 @@ class product extends control
|
||||
$this->app->rawMethod = 'pgmproduct';
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->loadModel('program')->setPGMViewMenu($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
}
|
||||
|
||||
$product = $this->product->getById($productID);
|
||||
@@ -441,7 +448,8 @@ class product extends control
|
||||
$this->app->rawMethod = 'pgmproduct';
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->loadModel('program')->setPGMViewMenu($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
|
||||
$this->loadModel('user');
|
||||
$poUsers = $this->user->getPairs('nodeleted|pofirst', $appendPoUsers);
|
||||
@@ -517,7 +525,8 @@ class product extends control
|
||||
if(!$product) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
$product->desc = $this->loadModel('file')->setImgSize($product->desc);
|
||||
$this->product->setMenu($this->products, $productID);
|
||||
@@ -578,7 +587,8 @@ class product extends control
|
||||
public function roadmap($productID, $branch = 0)
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', $branch);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', $branch);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($this->products, $productID, $branch);
|
||||
|
||||
$this->session->set('releaseList', $this->app->getURI(true));
|
||||
@@ -650,7 +660,8 @@ class product extends control
|
||||
$this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->product->dynamic;
|
||||
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $type);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $type);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
$this->view->userIdPairs = $this->loadModel('user')->getPairs('noletter|nodeleted|noclosed|useid');
|
||||
$this->view->accountPairs = $this->user->getPairs('noletter|nodeleted|noclosed');
|
||||
@@ -866,7 +877,8 @@ class product extends control
|
||||
public function whitelist($productID = 0, $module = 'product', $objectType = 'product', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', 0);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', 0);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($this->products, $productID, 0);
|
||||
|
||||
echo $this->fetch('personnel', 'whitelist', "objectID=$productID&module=product&browseType=$objectType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
|
||||
@@ -884,7 +896,8 @@ class product extends control
|
||||
public function addWhitelist($productID = 0, $deptID = 0, $branch = '')
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', $branch);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', $branch);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($this->products, $productID, $branch);
|
||||
$moduleIndex = array_search('product', $this->lang->noMenuModule);
|
||||
if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
|
||||
|
||||
@@ -45,6 +45,7 @@ $lang->product->roadmap = "{$lang->productCommon}路线图";
|
||||
$lang->product->doc = '文档列表';
|
||||
$lang->product->project = $lang->executionCommon . '列表';
|
||||
$lang->product->build = '版本列表';
|
||||
$lang->product->moreProduct = "更多产品";
|
||||
$lang->product->projectInfo = "所有与此产品关联的项目";
|
||||
|
||||
$lang->product->currentExecution = "当前{$lang->sprintCommon}";
|
||||
|
||||
@@ -473,17 +473,6 @@ class productModel extends model
|
||||
$currentModule = $this->app->moduleName;
|
||||
$currentMethod = $this->app->methodName;
|
||||
|
||||
$active = empty($productID) ? 'active' : '';
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$this->lang->product->all}'><span class='text'>{$this->lang->product->all}</span> <span class='caret'></span></button>";
|
||||
$output .= '<ul class="dropdown-menu">';
|
||||
$output .= '<li>' . html::a(helper::createLink('product', 'index'), "<i class='icon icon-home'></i> " . $this->lang->product->index) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('product', 'all'), "<i class='icon icon-cards-view'></i> " . $this->lang->product->all) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('product', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->product->create) . '</li>';
|
||||
$output .= '</ul>';
|
||||
$output .= "</div>";
|
||||
|
||||
if($currentModule == 'product' && ($currentMethod == 'index' || $currentMethod == 'all' || $currentMethod == 'create')) return $output;
|
||||
|
||||
$this->loadModel('project');
|
||||
$currentProductName = $this->lang->product->common;
|
||||
if($productID)
|
||||
@@ -495,7 +484,7 @@ class productModel extends model
|
||||
$active = isset($currentProduct->type) && $currentProduct->type != 'normal' ? '' : 'active';
|
||||
|
||||
$dropMenuLink = helper::createLink('product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
$output .= "<div class='btn-group header-angle-btn $active' id='swapper'><div class='btn btn-span'>{$this->lang->productCommon}</div><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProductName}'><span class='text'>{$currentProductName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='swapper'><div class='btn btn-span'>{$this->lang->productCommon}</div><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProductName}'><span class='text'>{$currentProductName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
|
||||
@@ -514,6 +503,11 @@ class productModel extends model
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function getProductMainAction()
|
||||
{
|
||||
return common::hasPriv('product', 'all') ? html::a(helper::createLink('product', 'all'), $this->lang->product->moreProduct, '', "class='btn btn-link'") : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a product.
|
||||
*
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<tr>
|
||||
<td><?php printf('%03d', $project->id);?></td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('project', 'task', 'project=' . $project->id, '', false, $project->id), $project->name, '_parent');?></td>
|
||||
<td><?php echo $project->programName;?></td>
|
||||
<td><?php echo isset($project->programName) ? $project->programName : '';?></td>
|
||||
<td><?php echo $project->PM;?></td>
|
||||
<td><?php echo $project->begin;?></td>
|
||||
<td><?php echo $project->end;?></td>
|
||||
|
||||
@@ -23,7 +23,8 @@ class productplan extends control
|
||||
public function commonAction($productID, $branch = 0)
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
$this->loadModel('product');
|
||||
$this->app->loadConfig('project');
|
||||
|
||||
+18
-14
@@ -41,7 +41,6 @@ class program extends control
|
||||
public function PGMIndex()
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
$this->view->title = $this->lang->program->PGMIndex;
|
||||
$this->view->position[] = $this->lang->program->PGMIndex;
|
||||
@@ -62,7 +61,6 @@ class program extends control
|
||||
public function PGMBrowse($status = 'all', $orderBy = 'order_asc')
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
if(common::hasPriv('program', 'pgmcreate')) $this->lang->pageActions = html::a($this->createLink('program', 'pgmcreate'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->PGMCreate, '', "class='btn btn-secondary'");
|
||||
|
||||
@@ -105,8 +103,13 @@ class program extends control
|
||||
*/
|
||||
public function PGMProduct($programID = 0, $browseType = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$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();
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
@@ -145,7 +148,6 @@ class program extends control
|
||||
public function PGMCreate($parentProgramID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
@@ -178,7 +180,6 @@ class program extends control
|
||||
public function PGMEdit($programID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
$program = $this->program->getPGMByID($programID);
|
||||
|
||||
@@ -398,7 +399,8 @@ class program extends control
|
||||
public function PGMProject($programID = 0, $browseType = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
$this->loadModel('datatable');
|
||||
@@ -450,7 +452,8 @@ class program extends control
|
||||
{
|
||||
$this->loadModel('user');
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
@@ -487,7 +490,8 @@ class program extends control
|
||||
|
||||
$this->loadModel('user');
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->mainMenuAction = $this->program->getPGMMainAction();
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
$this->loadModel('dept');
|
||||
@@ -737,8 +741,10 @@ class program extends control
|
||||
public function index($projectID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'project';
|
||||
if(!$projectID) $projectID = $this->session->PRJ;
|
||||
$this->session->set('PRJ', $projectID);
|
||||
$projectID = $this->program->savePRJState($projectID, $this->program->getPRJPairs());
|
||||
|
||||
if(!$projectID) $this->locate($this->createLink('program', 'PRJbrowse'));
|
||||
setCookie("lastPRJ", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
$this->view->title = $this->lang->program->common . $this->lang->colon . $this->lang->program->PRJIndex;
|
||||
$this->view->position[] = $this->lang->program->PRJIndex;
|
||||
@@ -762,7 +768,6 @@ class program extends control
|
||||
*/
|
||||
public function PRJBrowse($programID = 0, $browseType = 'doing', $param = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->lang->navGroup->program = 'project';
|
||||
$this->app->session->set('PRJBrowse', $this->app->getURI(true));
|
||||
$this->loadModel('datatable');
|
||||
|
||||
@@ -831,8 +836,7 @@ class program extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
$this->lang->navGroup->program = 'program';
|
||||
}
|
||||
|
||||
if($_POST)
|
||||
|
||||
@@ -89,6 +89,7 @@ $lang->program->cv = 'CV%';
|
||||
$lang->program->PRJTeamCount = '项目成员';
|
||||
$lang->program->PRJLongTime = '长期';
|
||||
$lang->program->future = '待定';
|
||||
$lang->program->morePRJ = '更多项目';
|
||||
|
||||
$lang->program->productNotEmpty = '请关联产品或创建产品。';
|
||||
$lang->program->existProductName = '产品名称已存在。';
|
||||
@@ -196,6 +197,7 @@ $lang->program->PGMStakeholder = '干系人列表';
|
||||
$lang->program->createStakeholder = '添加干系人';
|
||||
$lang->program->unlinkStakeholder = '移除干系人';
|
||||
$lang->program->unlink = '移除';
|
||||
$lang->program->morePGM = '更多项目集';
|
||||
$lang->program->confirmBatchUnlink = "您确定要批量移除这些干系人吗?";
|
||||
$lang->program->stakeholderType = '干系人类型';
|
||||
$lang->program->isStakeholderKey = '关键干系人';
|
||||
|
||||
+67
-38
@@ -1,6 +1,41 @@
|
||||
<?php
|
||||
class programModel extends model
|
||||
{
|
||||
/**
|
||||
* Save program state.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param array $programs
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function savePGMState($programID = 0, $programs = array())
|
||||
{
|
||||
if($programID > 0) $this->session->set('PGM', (int)$programID);
|
||||
if($programID == 0 and $this->cookie->lastPGM) $this->session->set('PGM', (int)$this->cookie->lastPGM);
|
||||
if($programID == 0 and $this->session->PGM == '') $this->session->set('PGM', key($programs));
|
||||
if(!isset($programs[$this->session->PGM]))
|
||||
{
|
||||
$this->session->set('PGM', key($programs));
|
||||
if($programID && strpos(",{$this->app->user->view->programs},", ",{$this->session->PGM},") === false) $this->accessDenied();
|
||||
}
|
||||
|
||||
return $this->session->PGM;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get program main menu action.
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getPGMMainAction()
|
||||
{
|
||||
return common::hasPriv('program', 'pgmbrowse') ? html::a(helper::createLink('program', 'pgmbrowse'), $this->lang->program->morePGM, '', "class='btn btn-link'") : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get program pairs.
|
||||
*
|
||||
@@ -307,28 +342,6 @@ class programModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get program swapper.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param bool $active
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
public function getPGMCommonAction($programID = 0, $active = false)
|
||||
{
|
||||
$active = $active ? 'active' : '';
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' title='{$this->lang->program->PGMCommon}'><span class='text'>{$this->lang->program->PGMCommon}</span> <span class='caret'></span></button>";
|
||||
$output .= '<ul class="dropdown-menu">';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'pgmindex'), "<i class='icon icon-home'></i> " . $this->lang->program->PGMIndex) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'pgmbrowse'), "<i class='icon icon-cards-view'></i> " . $this->lang->program->PGMBrowse) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'pgmcreate'), "<i class='icon icon-plus'></i> " . $this->lang->program->PGMCreate) . '</li>';
|
||||
$output .= '</ul>';
|
||||
$output .= "</div>";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get program swapper.
|
||||
*
|
||||
@@ -742,23 +755,26 @@ class programModel extends model
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/*
|
||||
* Get project swapper.
|
||||
*
|
||||
* @param bool $active
|
||||
/**
|
||||
* Save project state.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param array $projects
|
||||
* @access public
|
||||
* @return string
|
||||
* @return void
|
||||
*/
|
||||
public function printPRJCommonAction($active = false)
|
||||
public function savePRJState($projectID = 0, $projects = array())
|
||||
{
|
||||
$active = $active ? 'active' : '';
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$this->lang->program->PRJAll}'><span class='text'>{$this->lang->program->PRJAll}</span> <span class='caret'></span></button>";
|
||||
$output .= '<ul class="dropdown-menu">';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'prjbrowse'), "<i class='icon icon-cards-view'></i> " . $this->lang->program->PRJAll) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'createGuide'), "<i class='icon icon-plus'></i> " . $this->lang->program->PRJCreate, '', 'data-toggle="modal" data-target="#guideDialog"') . '</li>';
|
||||
$output .= '</ul>';
|
||||
$output .= "</div>";
|
||||
echo $output;
|
||||
if($projectID > 0) $this->session->set('PRJ', (int)$projectID);
|
||||
if($projectID == 0 and $this->cookie->lastPRJ) $this->session->set('PRJ', (int)$this->cookie->lastPRJ);
|
||||
if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects));
|
||||
if(!isset($projects[$this->session->PRJ]))
|
||||
{
|
||||
$this->session->set('PRJ', key($projects));
|
||||
if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false) $this->accessDenied();
|
||||
}
|
||||
|
||||
return $this->session->PRJ;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -773,7 +789,6 @@ class programModel extends model
|
||||
public function getPRJSwitcher($projectID, $currentModule, $currentMethod)
|
||||
{
|
||||
$active = strpos($currentMethod, 'prj') !== false ? true : false;
|
||||
$this->printPRJCommonAction($active);
|
||||
|
||||
if($currentModule == 'program' && $currentMethod != 'index') return;
|
||||
|
||||
@@ -793,6 +808,20 @@ class programModel extends model
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project main menu action.
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getPRJMainAction($module, $method)
|
||||
{
|
||||
if($module == 'program' and $method != 'index') return '';
|
||||
return common::hasPriv('program', 'prjbrowse') ? html::a(helper::createLink('program', 'prjbrowse'), $this->lang->program->morePRJ, '', "class='btn btn-link'") : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project list data.
|
||||
*
|
||||
@@ -1617,7 +1646,7 @@ class programModel extends model
|
||||
break;
|
||||
case 'PRJName':
|
||||
$projectLink = helper::createLink('program', 'index', "projectID=$project->id", '', '', $project->id);
|
||||
echo html::a($projectLink, $project->name);
|
||||
echo html::a($projectLink, $project->name, '', "class='not-in-tab'");
|
||||
if($project->model === 'waterfall') echo "<span class='project-type-label label label-outline label-warning'>{$this->lang->program->waterfall}</span>";
|
||||
if($project->model === 'scrum') echo "<span class='project-type-label label label-outline label-info'>{$this->lang->program->scrum}</span>";
|
||||
break;
|
||||
|
||||
@@ -51,7 +51,7 @@ class projectrelease extends control
|
||||
$this->view->branches = (isset($product->type) and $product->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->branch = $branch;
|
||||
$this->view->project = $this->loadModel('project')->getById($this->session->PRJ);
|
||||
$this->product->setMenu($this->product->getPairs(), $productID, $branch);
|
||||
$this->product->setMenu($this->product->getPairs(), $productID, $branch, '', '', $this->session->PRJ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,8 @@ class release extends control
|
||||
public function commonAction($productID, $branch = 0)
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
$this->loadModel('product');
|
||||
$product = $this->product->getById($productID);
|
||||
|
||||
@@ -28,8 +28,14 @@ class repo extends control
|
||||
}
|
||||
|
||||
/* Set repo menu group. */
|
||||
$this->projectID = $this->session->PRJ ? $this->session->PRJ : 0;
|
||||
if(!$this->projectID) $this->lang->navGroup->repo = 'repo';
|
||||
$this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0;
|
||||
if(!$this->projectID)
|
||||
{
|
||||
$this->lang->navGroup->repo = 'repo';
|
||||
$this->lang->navGroup->jenkins = 'repo';
|
||||
$this->lang->navGroup->job = 'repo';
|
||||
$this->lang->navGroup->compile = 'repo';
|
||||
}
|
||||
|
||||
$this->scm = $this->app->loadClass('scm');
|
||||
$this->repos = $this->repo->getRepoPairs($this->projectID);
|
||||
|
||||
@@ -71,7 +71,7 @@ class stakeholder extends control
|
||||
$this->app->rawModule = 'program';
|
||||
$this->app->rawMethod = 'pgmstakeholder';
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
$this->view->members = $this->program->getPRJTeamMemberPairs($programID);
|
||||
|
||||
@@ -47,7 +47,8 @@ class story extends control
|
||||
{
|
||||
$this->story->replaceURLang($type);
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
/* Whether there is a object to transfer story, for example feedback. */
|
||||
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
|
||||
@@ -301,7 +302,8 @@ class story extends control
|
||||
public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $project = 0, $plan = 0, $type = 'story')
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
/* Clear title when switching products and set the session for the current product. */
|
||||
if($productID != $this->cookie->preProductID) unset($_SESSION['storyImagesFile']);
|
||||
@@ -447,7 +449,8 @@ class story extends control
|
||||
|
||||
/* Set menu. */
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($products, $product->id, $story->branch);
|
||||
|
||||
$this->story->replaceURLang($story->type);
|
||||
@@ -526,7 +529,8 @@ class story extends control
|
||||
public function batchEdit($productID = 0, $projectID = 0, $branch = 0, $storyType = 'story')
|
||||
{
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->story->replaceURLang($storyType);
|
||||
|
||||
/* Load model. */
|
||||
@@ -768,7 +772,8 @@ class story extends control
|
||||
|
||||
/* Set the menu. */
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($this->product->getPairs(), $product->id, $story->branch);
|
||||
|
||||
if($from == 'project')
|
||||
@@ -851,8 +856,9 @@ class story extends control
|
||||
public function review($storyID)
|
||||
{
|
||||
$this->product;
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($this->session->product);
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($this->session->product);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -1285,7 +1291,8 @@ class story extends control
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$products = $this->product->getPairs();
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($products, $productID, $branch);
|
||||
}
|
||||
|
||||
@@ -1654,7 +1661,8 @@ class story extends control
|
||||
|
||||
$this->story->replaceURLang($storyType);
|
||||
$this->products = $this->product->getPairs();
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, $storyType, $branchID);
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, $storyType, $branchID);
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
$this->product->setMenu($this->products, $productID, $branchID);
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->story->reportChart;
|
||||
|
||||
@@ -23,7 +23,7 @@ class testreportModel extends model
|
||||
public function setMenu($products, $productID, $branch = 0)
|
||||
{
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch);
|
||||
$selectHtml = $this->product->select($products, $productID, 'testreport', 'browse', '', $branch);
|
||||
$selectHtml = $this->product->select($products, $productID, 'testreport', 'browse', $this->session->PRJ, $branch);
|
||||
|
||||
/* Remove branch. */
|
||||
if(strpos($selectHtml, 'currentBranch') !== false) $selectHtml = substr($selectHtml, 0, strrpos($selectHtml, "<div class='btn-group'>")) . '</div>';
|
||||
|
||||
@@ -68,7 +68,10 @@ class tree extends control
|
||||
/* Set menu.*/
|
||||
$moduleIndex = array_search('tree', $this->lang->noMenuModule);
|
||||
if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($rootID, 'story');
|
||||
$this->lang->product->menu = $this->lang->product->viewMenu;
|
||||
$this->lang->noMenuModule[] = 'tree';
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($rootID, 'story');
|
||||
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
|
||||
|
||||
$products = $this->product->getPairs();
|
||||
|
||||
|
||||
@@ -60,3 +60,5 @@ a.showMoreImage:hover {opacity: 1;}
|
||||
.table-actions .btn:hover{background: #b3d4fc}
|
||||
|
||||
#menuFooter{height: 50px}
|
||||
|
||||
#header #toolbar a{color: #fff; font-size: 14px; line-height: 15px;}
|
||||
|
||||
Reference in New Issue
Block a user