* Fix qa menu.
This commit is contained in:
@@ -24,42 +24,8 @@ class testtaskModel extends model
|
||||
public function setMenu($products, $productID, $branch = 0, $testtask = 0)
|
||||
{
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch);
|
||||
$selectHtml = $this->product->select($products, $productID, 'testtask', 'browse', '', $branch);
|
||||
|
||||
if($testtask and $this->app->viewType != 'mhtml')
|
||||
{
|
||||
$testtasks = $this->getProductTasks($productID, 0, 'id_desc', null, array('local', 'totalStatus'), 0, 0, $this->session->PRJ);
|
||||
if(!isset($testtasks[$testtask])) $testtasks[$testtask] = $this->getById($testtask);
|
||||
|
||||
$selectHtml .= "<div class='btn-group angle-btn'>";
|
||||
$selectHtml .= "<div class='btn-group'>";
|
||||
$selectHtml .= "<a data-toggle='dropdown' class='btn'>" . $testtasks[$testtask]->name . " <span class='caret'></span></a>";
|
||||
$selectHtml .= "<ul class='dropdown-menu'>";
|
||||
foreach($testtasks as $testtask) $selectHtml .= '<li>' . html::a(helper::createLink('testtask', 'cases', "taskID=$testtask->id"), "<i class='icon icon-file-o'></i> {$testtask->name}") . '</li>';
|
||||
$selectHtml .= "</ul>";
|
||||
$selectHtml .= "</div>";
|
||||
$selectHtml .= "</div>";
|
||||
|
||||
$this->lang->TRActions = '';
|
||||
if(common::hasPriv('testtask', 'view')) $this->lang->TRActions .= html::a(helper::createLink('testtask', 'view', "taskID={$testtask->id}"), "<i class='icon icon-file-text'> </i>" . $this->lang->testtask->view, '', "class='btn'");
|
||||
if(common::hasPriv('testreport', 'browse')) $this->lang->TRActions .= html::a(helper::createLink('testreport', 'browse', "objectID=$productID&objectType=product&extra={$testtask->id}"), "<i class='icon icon-flag'> </i>" . $this->lang->testtask->reportField, '', "class='btn'");
|
||||
}
|
||||
|
||||
$this->app->loadLang('qa');
|
||||
$productIndex = $selectHtml;
|
||||
|
||||
$pageNav = '';
|
||||
$pageActions = '';
|
||||
$isMobile = $this->app->viewType == 'mhtml';
|
||||
if($isMobile)
|
||||
{
|
||||
$this->app->loadLang('qa');
|
||||
$pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
|
||||
}
|
||||
$pageNav .= $selectHtml;
|
||||
|
||||
$this->lang->modulePageNav = $pageNav;
|
||||
$this->lang->TRActions = $pageActions;
|
||||
foreach($this->lang->testtask->menu as $key => $value)
|
||||
{
|
||||
if($this->lang->navGroup->testtask != 'qa') $this->loadModel('qa')->setSubMenu('testtask', $key, $productID);
|
||||
@@ -93,48 +59,7 @@ class testtaskModel extends model
|
||||
public function setUnitMenu($products, $productID, $branch = 0, $testtask = 0)
|
||||
{
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch);
|
||||
$selectHtml = $this->product->select($products, $productID, 'testtask', 'browseUnits', '', $branch);
|
||||
|
||||
if($testtask and $this->app->viewType != 'mhtml')
|
||||
{
|
||||
$testtasks = $this->getProductUnitTasks($productID, 'all', 'id_desc');
|
||||
if(!isset($testtasks[$testtask])) $testtasks[$testtask] = $this->getById($testtask);
|
||||
|
||||
$selectHtml .= "<div class='btn-group angle-btn'>";
|
||||
$selectHtml .= "<div class='btn-group'>";
|
||||
$selectHtml .= "<a data-toggle='dropdown' class='btn'>" . $testtasks[$testtask]->name . " <span class='caret'></span></a>";
|
||||
$selectHtml .= "<ul class='dropdown-menu'>";
|
||||
foreach($testtasks as $testtask) $selectHtml .= '<li>' . html::a(helper::createLink('testtask', 'unitCases', "taskID=$testtask->id"), "<i class='icon icon-file-o'></i> {$testtask->name}") . '</li>';
|
||||
$selectHtml .= "</ul>";
|
||||
$selectHtml .= "</div>";
|
||||
$selectHtml .= "</div>";
|
||||
}
|
||||
|
||||
$this->app->loadLang('qa');
|
||||
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
|
||||
$productIndex .= $selectHtml;
|
||||
|
||||
$pageNav = '';
|
||||
$pageActions = '';
|
||||
$isMobile = $this->app->viewType == 'mhtml';
|
||||
if($isMobile)
|
||||
{
|
||||
$this->app->loadLang('qa');
|
||||
$pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->config->global->flow == 'full')
|
||||
{
|
||||
$this->app->loadLang('qa');
|
||||
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
|
||||
}
|
||||
}
|
||||
$pageNav .= $selectHtml;
|
||||
|
||||
$this->lang->modulePageNav = $pageNav;
|
||||
$this->lang->TRActions = $pageActions;
|
||||
if($this->config->global->flow != 'full') $this->lang->testtask->menu = new stdclass();
|
||||
foreach($this->lang->testtask->menu as $key => $value)
|
||||
{
|
||||
if($this->lang->navGroup->testcase != 'qa') $this->loadModel('qa')->setSubMenu('testtask', $key, $productID);
|
||||
|
||||
Reference in New Issue
Block a user