* Finish task#36938.

This commit is contained in:
leiyong
2021-02-24 10:31:20 +08:00
parent ad77275e2a
commit 13a304980d
13 changed files with 69 additions and 25 deletions
+5 -1
View File
@@ -49,7 +49,11 @@ class bugModel extends model
common::setMenuVars($this->lang->bug->menu, $key, $replace);
}
if($this->lang->navGroup->bug == 'qa') $this->lang->qa->menu = $this->lang->bug->menu;
if($this->lang->navGroup->bug == 'qa')
{
$this->lang->qa->menu = $this->lang->bug->menu;
$this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
}
}
/**
+10 -1
View File
@@ -106,7 +106,16 @@ class caselibModel extends model
}
if($this->config->global->flow != 'full' && $this->app->getMethodName() != 'view') $this->lang->caselib->menu->bysearch = "<a class='querybox-toggle' id='bysearchTab'><i class='icon icon-search muted'> </i>{$this->lang->testcase->bySearch}</a>";
if($this->lang->navGroup->caselib == 'qa') $this->lang->qa->menu = $this->lang->caselib->menu;
if($this->lang->navGroup->caselib == 'qa')
{
$this->lang->qa->menu = $this->lang->caselib->menu;
$dropMenuLink = helper::createLink('caselib', 'ajaxGetDropMenu', "objectID=$libID&module=caselib&method=browse");
$output = "<div class='btn-group header-angle-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentLibName}'><span class='text'><i class='icon icon-product'></i> {$currentLibName}</span> <span class='caret' style='margin-top: 3px'></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>";
$this->lang->qa->switcherMenu = $output;
}
}
/**
+2
View File
@@ -13,12 +13,14 @@ $isProgram = $rawModule == 'program';
$isProduct = $rawModule == 'product';
$isProject = $rawModule == 'project';
$isReport = $rawModule == 'report';
$isQa = $rawModule == 'qa';
?>
<header id='header'>
<div id='mainHeader'>
<div class='container'>
<div id='heading'>
<?php if($isProduct) echo isset($lang->product->switcherMenu) ? $lang->product->switcherMenu : '';?>
<?php if($isQa) echo isset($lang->qa->switcherMenu) ? $lang->qa->switcherMenu : '';?>
<?php if($this->config->global->mode == 'new'):?>
<?php if($isProgram) echo isset($lang->program->switcherMenu) ? $lang->program->switcherMenu : '';?>
<?php if($isProject) echo $this->loadModel('program')->getPRJSwitcher($this->session->PRJ, $app->rawModule, $app->rawMethod);?>
+12 -5
View File
@@ -899,10 +899,17 @@ class product extends control
* @access public
* @return void
*/
public function ajaxGetDropMenu($productID, $module, $method, $extra)
public function ajaxGetDropMenu($productID, $module, $method, $extra = '', $from = '')
{
$inProduct = zget($this->lang->navGroup, $module) == 'product';
$products = $inProduct ? $this->product->getList() : $this->product->getProductsByProject($this->session->PRJ);
if($from == 'qa')
{
$this->app->loadConfig('qa');
foreach($this->config->qa->menuList as $menu) $this->lang->navGroup->$menu = 'qa';
}
$moduleGroup = zget($this->lang->navGroup, $module);
$moduleGroup = in_array($moduleGroup, array('product', 'qa'))? $moduleGroup : 'project';
$products = $moduleGroup == 'project' ? $this->product->getProductsByProject($this->session->PRJ) : $this->product->getList();
$this->view->link = $this->product->getProductLink($module, $method, $extra);
$this->view->productID = $productID;
@@ -910,9 +917,9 @@ class product extends control
$this->view->method = $method;
$this->view->extra = $extra;
$this->view->products = $products;
$this->view->projectID = $this->session->PRJ;
$this->view->projectID = $moduleGroup == 'project' ? $this->session->PRJ : 0;
$this->view->programs = $this->loadModel('program')->getPGMOption();
$this->view->openModule = $inProduct ? 'product' : 'project';
$this->view->openModule = $moduleGroup;
$this->display();
}
+5 -4
View File
@@ -303,7 +303,7 @@ class productModel extends model
*/
public function getProductPairsByProject($projectID, $status = 'all')
{
$products = $this->getProductsByProject($projectID, $status);
$products = empty($projectID) ? $this->getList() : $this->getProductsByProject($projectID, $status);
$pairs = array();
if(!empty($products))
{
@@ -442,7 +442,7 @@ class productModel extends model
$currentMethod = $this->app->methodName;
$this->session->set('moreProductLink', $this->app->getURI(true));
$this->loadModel('project');
$this->app->loadLang('project');
$currentProductName = $this->lang->product->common;
if($productID)
{
@@ -450,7 +450,8 @@ class productModel extends model
$currentProductName = $currentProduct->name;
}
$dropMenuLink = helper::createLink('product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
$fromModule = $this->lang->navGroup->qa == 'qa' ? 'qa' : '';
$dropMenuLink = helper::createLink('product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra&from=$fromModule");
$output = "<div class='btn-group header-angle-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProductName}'><span class='text'><i class='icon icon-product'></i> {$currentProductName}</span> <span class='caret' style='margin-top: 3px'></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>";
@@ -1468,7 +1469,7 @@ class productModel extends model
public function getProductLink($module, $method, $extra, $branch = false)
{
$link = '';
if(strpos('programplan,product,roadmap,bug,testcase,testtask,story,qa,testsuite,testreport,build,projectrelease,projectstory', $module) !== false)
if(strpos('programplan,product,roadmap,bug,testcase,testtask,story,qa,testsuite,testreport,build,projectrelease,projectstory,caselib', $module) !== false)
{
if($module == 'product' && $method == 'project')
{
+1 -4
View File
@@ -59,10 +59,7 @@ class programModel extends model
*/
public function getPGMOption()
{
return $this->dao->select('id,name')->from(TABLE_PROGRAM)
->where('type')->eq('program')
->andWhere('deleted')->eq(0)
->fetchPairs();
return $this->dao->select('id,name')->from(TABLE_PROGRAM)->where('type')->eq('program')->andWhere('deleted')->eq(0)->fetchPairs();
}
/**
+4 -2
View File
@@ -26,8 +26,8 @@ class qaModel extends model
$this->loadModel('product')->setMenu($products, $productID, $branch);
$selectHtml = $this->product->select($products, $productID, 'qa', 'index', $extra, $branch);
$productIndex = '';
$isMobile = $this->app->viewType == 'mhtml';
$productIndex = '';
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$productIndex = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
@@ -46,6 +46,8 @@ class qaModel extends model
$replace = $productID;
common::setMenuVars($this->lang->qa->menu, $key, $replace);
}
if($this->lang->navGroup->qa = 'qa') $this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, $extra, $branch);
}
/**
+5 -1
View File
@@ -49,7 +49,11 @@ class testcaseModel extends model
common::setMenuVars($this->lang->testcase->menu, $key, $replace);
}
if($this->lang->navGroup->testcase == 'qa') $this->lang->qa->menu = $this->lang->testcase->menu;
if($this->lang->navGroup->testcase == 'qa')
{
$this->lang->qa->menu = $this->lang->testcase->menu;
$this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
}
}
/**
+2 -1
View File
@@ -534,7 +534,8 @@ class testreport extends control
{
if($objectType == 'product')
{
$this->products = $this->product->getProductPairsByProject($this->session->PRJ);
$projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->PRJ;
$this->products = $this->product->getProductPairsByProject($projectID);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testreport")));
$productID = $this->product->saveState($objectID, $this->products);
$this->testreport->setMenu($this->products, $productID);
+5 -1
View File
@@ -40,7 +40,11 @@ class testreportModel extends model
common::setMenuVars($this->lang->testreport->menu, $key, $replace);
}
if($this->lang->navGroup->testreport == 'qa') $this->lang->qa->menu = $this->lang->testreport->menu;
if($this->lang->navGroup->testreport == 'qa')
{
$this->lang->qa->menu = $this->lang->testreport->menu;
$this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
}
}
/**
+2 -1
View File
@@ -55,7 +55,8 @@ class testsuite extends control
$this->session->set('testsuiteList', $this->app->getURI(true));
/* Set menu. */
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ);
$projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->PRJ;
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($projectID);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testsuite")));
$productID = $this->product->saveState($productID, $this->products);
$this->testsuite->setMenu($this->products, $productID);
+5 -1
View File
@@ -46,7 +46,11 @@ class testsuiteModel extends model
common::setMenuVars($this->lang->testsuite->menu, $key, $replace);
}
if($this->lang->navGroup->testsuite == 'qa') $this->lang->qa->menu = $this->lang->testsuite->menu;
if($this->lang->navGroup->testsuite == 'qa')
{
$this->lang->qa->menu = $this->lang->testsuite->menu;
$this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', 0);
}
}
/**
+11 -3
View File
@@ -54,7 +54,7 @@ class testtaskModel extends model
if($isMobile)
{
$this->app->loadLang('qa');
$pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
$pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
}
$pageNav .= $selectHtml;
@@ -67,7 +67,11 @@ class testtaskModel extends model
common::setMenuVars($this->lang->testtask->menu, $key, $replace);
}
if($this->lang->navGroup->testtask == 'qa') $this->lang->qa->menu = $this->lang->testtask->menu;
if($this->lang->navGroup->testtask == 'qa')
{
$this->lang->qa->menu = $this->lang->testtask->menu;
$this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
}
}
/**
@@ -133,7 +137,11 @@ class testtaskModel extends model
}
$this->lang->testtask->menu->testcase['subModule'] = 'testtask';
if($this->lang->navGroup->testtask == 'qa') $this->lang->qa->menu = $this->lang->testtask->menu;
if($this->lang->navGroup->testtask == 'qa')
{
$this->lang->qa->menu = $this->lang->testtask->menu;
$this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', $branch);
}
}
/**