* Adjust menu for onlyTest.

This commit is contained in:
daitingting
2017-05-12 14:45:57 +08:00
parent ff5b0639ed
commit b378b53307
20 changed files with 471 additions and 72 deletions
+31 -1
View File
@@ -27,7 +27,37 @@ class testtaskModel extends model
$selectHtml = $this->product->select($products, $productID, 'testtask', 'browse', '', $branch);
foreach($this->lang->testtask->menu as $key => $value)
{
$replace = ($key == 'product') ? $selectHtml : $productID;
if($this->config->global->flow != 'onlyTest')
{
$replace = ($key == 'product') ? $selectHtml : $productID;
}
else
{
if($key == 'product')
{
$replace = $selectHtml;
}
elseif($key == 'scope')
{
$scope = $this->session->testTaskVersionScope;
$status = $this->session->testTaskVersionStatus;
$viewName = $scope == 'local'? $products[$productID] : $this->lang->testtask->all;
$replace = '<li>';
$replace .= "<a data-toggle='dropdown'>{$viewName} <span class='caret'></span></a>";
$replace .= "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
$replace .= "<li>" . html::a(helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=all,$status"), $this->lang->testtask->all) . "</li>";
$replace .= "<li>" . html::a(helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=local,$status"), $products[$productID]) . "</li>";
$replace .= "</ul></li>";
}
else
{
$replace = array();
$replace['productID'] = $productID;
$replace['branch'] = $branch;
$replace['scope'] = $this->session->testTaskVersionScope;
}
}
common::setMenuVars($this->lang->testtask->menu, $key, $replace);
}
}