* adjust for setMenu method.

This commit is contained in:
wangyidong
2018-06-20 14:26:19 +08:00
parent 6506886dc3
commit 146c148586
7 changed files with 234 additions and 153 deletions
+40 -31
View File
@@ -32,47 +32,56 @@ class bugModel extends model
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$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 = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
}
else
{
if(common::hasPriv('bug', 'report'))
if($this->config->global->flow == 'full')
{
$link = helper::createLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon-common-report icon-bar-chart muted'></i> <span class='text'>" . $this->lang->bug->report->common . '</span>', '', "class='btn btn-link'");
}
if(common::hasPriv('bug', 'export'))
{
$link = helper::createLink('bug', 'export', "productID=$productID&orderBy=$orderBy");
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>";
$pageActions .= "<i class='icon icon-export muted'></i><span class='text'>{$this->lang->export}</span><span class='caret'></span></button>";
$pageActions .= '</button>';
$pageActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
$pageActions .= '<li>' . html::a($link, $this->lang->bug->export, '', "class='export'") . '</li>';
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
if(common::hasPriv('bug', 'batchCreate'))
{
$link = helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i>" . $this->lang->bug->batchCreate, '', "class='btn btn-secondary'");
}
if(commonModel::isTutorialMode())
{
$wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&extra=moduleID=$moduleID");
$link = helper::createLink('tutorial', 'wizard', "module=bug&method=create&params=$wizardParams");
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->bug->create, '', "class='btn btn-primary btn-bug-create'");
$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>';
}
else
{
if(common::hasPriv('bug', 'create'))
if(common::hasPriv('bug', 'report'))
{
$link = helper::createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i>" . $this->lang->bug->create, '', "class='btn btn-primary'");
$link = helper::createLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon-common-report icon-bar-chart muted'></i> <span class='text'>" . $this->lang->bug->report->common . '</span>', '', "class='btn btn-link'");
}
if(common::hasPriv('bug', 'export'))
{
$link = helper::createLink('bug', 'export', "productID=$productID&orderBy=$orderBy");
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>";
$pageActions .= "<i class='icon icon-export muted'></i><span class='text'>{$this->lang->export}</span><span class='caret'></span></button>";
$pageActions .= '</button>';
$pageActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
$pageActions .= '<li>' . html::a($link, $this->lang->bug->export, '', "class='export'") . '</li>';
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
if(common::hasPriv('bug', 'batchCreate'))
{
$link = helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i>" . $this->lang->bug->batchCreate, '', "class='btn btn-secondary'");
}
if(commonModel::isTutorialMode())
{
$wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&extra=moduleID=$moduleID");
$link = helper::createLink('tutorial', 'wizard', "module=bug&method=create&params=$wizardParams");
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->bug->create, '', "class='btn btn-primary btn-bug-create'");
}
else
{
if(common::hasPriv('bug', 'create'))
{
$link = helper::createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i>" . $this->lang->bug->create, '', "class='btn btn-primary'");
}
}
}
}
+21 -11
View File
@@ -56,22 +56,32 @@ class productModel extends model
if($currentModule == 'product' && $currentMethod == 'all') $label = $this->lang->product->all;
if($currentModule == 'product' && $currentMethod == 'create') $label = $this->lang->product->create;
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
$pageNav .= '<ul class="dropdown-menu">';
if($this->config->global->flow == 'full' && common::hasPriv('product', 'index')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
if(common::hasPriv('product', 'all')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
if(common::isTutorialMode())
$pageNav = '';
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$wizardParams = helper::safe64Encode('');
$link = helper::createLink('tutorial', 'wizard', "module=product&method=create&params=$wizardParams");
$pageNav .= '<li>' . html::a($link, "<i class='icon icon-plus'></i> {$this->lang->product->create}", '', "class='create-product-btn'") . '</li>';
$pageNav = html::a(helper::createLink('product', 'index'), $this->lang->product->index) . $this->lang->colon;
$pageNav .= $selectHtml;
}
else
{
if(common::hasPriv('product', 'create')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
$pageNav .= '<ul class="dropdown-menu">';
if($this->config->global->flow == 'full' && common::hasPriv('product', 'index')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
if(common::hasPriv('product', 'all')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
if(common::isTutorialMode())
{
$wizardParams = helper::safe64Encode('');
$link = helper::createLink('tutorial', 'wizard', "module=product&method=create&params=$wizardParams");
$pageNav .= '<li>' . html::a($link, "<i class='icon icon-plus'></i> {$this->lang->product->create}", '', "class='create-product-btn'") . '</li>';
}
else
{
if(common::hasPriv('product', 'create')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
}
$pageNav .= '</ul></div></div>';
$pageNav .= $selectHtml;
}
$pageNav .= '</ul></div></div>';
$pageNav .= $selectHtml;
$pageActions = '';
if($this->config->global->flow != 'full')
+23 -13
View File
@@ -107,24 +107,34 @@ class projectModel extends model
if($moduleName == 'project' && $methodName == 'all') $label = $this->lang->project->allProjects;
if($moduleName == 'project' && $methodName == 'create') $label = $this->lang->project->create;
$projectIndex = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
$projectIndex .= '<ul class="dropdown-menu">';
if(common::hasPriv('project', 'index')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->project->index) . '</li>';
if(common::hasPriv('project', 'all')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'all', 'status=all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->project->allProjects) . '</li>';
if(common::isTutorialMode())
$projectIndex = '';
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$wizardParams = helper::safe64Encode('');
$link = helper::createLink('tutorial', 'wizard', "module=project&method=create&params=$wizardParams");
$projectIndex .= '<li>' . html::a($link, "<i class='icon icon-plus'></i> {$this->lang->project->create}", '', "class='create-project-btn'") . '</li>';
$projectIndex = html::a(helper::createLink('project', 'index'), $this->lang->project->index) . $this->lang->colon;
$projectIndex .= $selectHtml;
}
else
{
if(common::hasPriv('project', 'create')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->project->create) . '</li>';
}
$projectIndex = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
$projectIndex .= '<ul class="dropdown-menu">';
if(common::hasPriv('project', 'index')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->project->index) . '</li>';
if(common::hasPriv('project', 'all')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'all', 'status=all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->project->allProjects) . '</li>';
$projectIndex .= '</ul></div></div>';
$projectIndex .= $selectHtml;
if(common::isTutorialMode())
{
$wizardParams = helper::safe64Encode('');
$link = helper::createLink('tutorial', 'wizard', "module=project&method=create&params=$wizardParams");
$projectIndex .= '<li>' . html::a($link, "<i class='icon icon-plus'></i> {$this->lang->project->create}", '', "class='create-project-btn'") . '</li>';
}
else
{
if(common::hasPriv('project', 'create')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->project->create) . '</li>';
}
$projectIndex .= '</ul></div></div>';
$projectIndex .= $selectHtml;
}
$this->lang->modulePageNav = $projectIndex;
if($moduleName != 'project') $this->lang->$moduleName->dividerMenu = $this->lang->project->dividerMenu;
+12 -2
View File
@@ -25,8 +25,18 @@ class qaModel extends model
$this->loadModel('product')->setMenu($products, $productID, $branch);
$selectHtml = $this->product->select($products, $productID, 'qa', 'index', '', $branch);
$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;
$productIndex = '';
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$productIndex = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
$productIndex .= $selectHtml;
}
else
{
$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;
}
$this->lang->modulePageNav = $productIndex;
foreach($this->lang->qa->menu as $key => $menu)
+58 -49
View File
@@ -32,69 +32,78 @@ class testcaseModel extends model
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$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 = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
}
else
{
$exportPriv = common::hasPriv('testcase', 'export');
$exportTempletPriv = common::hasPriv('testcase', 'exportTemplet');
$importPriv = common::hasPriv('testcase', 'import');
$importFromLibPriv = common::hasPriv('testcase', 'importFromLib');
if($exportPriv or $exportTempletPriv)
if($this->config->global->flow == 'full')
{
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>";
$pageActions .= "<i class='icon icon-export muted'></i> {$this->lang->export}";
$pageActions .= "<span class='caret'></span>";
$pageActions .= '</button>';
$pageActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
if($exportPriv)
{
$link = helper::createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->export, '', "class='export'") . '</li>';
}
if($exportTempletPriv)
{
$link = helper::createLink('testcase', 'exportTemplet', "productID=$productID");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->exportTemplet, '', "class='export'") . '</li>';
}
$pageActions .= '</ul>';
$pageActions .= '</div>';
$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>';
}
if($importPriv or $importFromLibPriv)
else
{
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon icon-import muted'></i> {$this->lang->import}<span class='caret'></span></button>";
$pageActions .= "<ul class='dropdown-menu' id='importActionMenu'>";
if($importPriv)
$exportPriv = common::hasPriv('testcase', 'export');
$exportTempletPriv = common::hasPriv('testcase', 'exportTemplet');
$importPriv = common::hasPriv('testcase', 'import');
$importFromLibPriv = common::hasPriv('testcase', 'importFromLib');
if($exportPriv or $exportTempletPriv)
{
$link = helper::createLink('testcase', 'import', "productID=$productID&branch=$branch");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->importFile, '', "class='export'") . '</li>';
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>";
$pageActions .= "<i class='icon icon-export muted'></i> {$this->lang->export}";
$pageActions .= "<span class='caret'></span>";
$pageActions .= '</button>';
$pageActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
if($exportPriv)
{
$link = helper::createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->export, '', "class='export'") . '</li>';
}
if($exportTempletPriv)
{
$link = helper::createLink('testcase', 'exportTemplet', "productID=$productID");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->exportTemplet, '', "class='export'") . '</li>';
}
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
if($importFromLibPriv)
if($importPriv or $importFromLibPriv)
{
$link = helper::createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->importFromLib) . '</li>';
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon icon-import muted'></i> {$this->lang->import}<span class='caret'></span></button>";
$pageActions .= "<ul class='dropdown-menu' id='importActionMenu'>";
if($importPriv)
{
$link = helper::createLink('testcase', 'import', "productID=$productID&branch=$branch");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->importFile, '', "class='export'") . '</li>';
}
if($importFromLibPriv)
{
$link = helper::createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->importFromLib) . '</li>';
}
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
$initModule = isset($moduleID) ? (int)$moduleID : 0;
$initModule = isset($moduleID) ? (int)$moduleID : 0;
if(common::hasPriv('testcase', 'batchCreate'))
{
$link = helper::createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule");
$pageActions .= html::a($link, "<i class='icon-plus'></i> " . $this->lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testcase', 'batchCreate'))
{
$link = helper::createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule");
$pageActions .= html::a($link, "<i class='icon-plus'></i> " . $this->lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testcase', 'create'))
{
$link = helper::createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule");
$pageActions .= html::a($link, "<i class='icon-plus'></i> " . $this->lang->testcase->create, '', "class='btn btn-primary'");
if(common::hasPriv('testcase', 'create'))
{
$link = helper::createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule");
$pageActions .= html::a($link, "<i class='icon-plus'></i> " . $this->lang->testcase->create, '', "class='btn btn-primary'");
}
}
}
$pageNav .= $selectHtml;
+66 -42
View File
@@ -29,17 +29,26 @@ class testsuiteModel extends model
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$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 = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
}
else
{
if(common::hasPriv('testsuite', 'create'))
if($this->config->global->flow == 'full')
{
$link = helper::createLink('testsuite', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testsuite->create}", '', "class='btn btn-primary'");
$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>';
}
else
{
if(common::hasPriv('testsuite', 'create'))
{
$link = helper::createLink('testsuite', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testsuite->create}", '', "class='btn btn-primary'");
}
}
}
$pageNav .= $selectHtml;
@@ -102,17 +111,24 @@ class testsuiteModel extends model
{
$currentLibName = zget($libraries, $libID, '');
$selectHtml = '';
$isMobile = $this->app->viewType == 'mhtml';
if(!empty($libraries))
{
$dropMenuLink = helper::createLink('testsuite', 'ajaxGetDropMenu', "objectID=$libID&module=testsuite&method=library");
$selectHtml = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem'>{$currentLibName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$selectHtml .= '<div class="input-control search-box search-box-circle 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>';
$selectHtml .= "</div></div>";
if($isMobile)
{
$selectHtml = "<a id='currentItem' href=\"javascript:showSearchMenu('testsuite', '$libID', 'testsuite', 'library', '')\">{$currentLibName} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
}
else
{
$dropMenuLink = helper::createLink('testsuite', 'ajaxGetDropMenu', "objectID=$libID&module=testsuite&method=library");
$selectHtml = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem'>{$currentLibName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$selectHtml .= '<div class="input-control search-box search-box-circle 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>';
$selectHtml .= "</div></div>";
}
}
if($this->config->global->flow == 'onlyTest')
{
$isMobile = $this->app->viewType == 'mhtml';
$modules = $this->loadModel('tree')->getModulePairs($libID, 'caselib');
$moduleName = ($moduleID && isset($modules[$moduleID])) ? $modules[$moduleID] : $this->lang->tree->all;
@@ -128,51 +144,59 @@ class testsuiteModel extends model
$selectHtml .= "<a id='currentModule' href=\"javascript:showSearchMenu('tree', '$libID', 'testsuite', 'library', '')\">{$moduleName} <span class='icon-caret-down'></span></a><div id='currentBranchDropMenu' class='hidden affix enter-from-bottom layer'></div>";
}
}
$selectHtml .= '</div>';
setCookie("lastCaseLib", $libID, $this->config->cookieLife, $this->config->webRoot);
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$this->app->loadLang('qa');
$pageNav .= '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $this->lang->qa->index . ' <span class="caret"></span></button>';
$pageNav .= '<ul class="dropdown-menu">';
if(common::hasPriv('testsuite', 'createLib')) $pageNav .= '<li>' . html::a(helper::createLink('testsuite', 'createLib'), '<i class="icon icon-plus"></i> ' . $this->lang->testsuite->createLib) . '</li>';
$pageNav .= '</ul></div></div>';
if(common::hasPriv('testsuite', 'libView'))
{
$link = helper::createLink('testsuite', 'libView', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon icon-list-alt muted'> </i>" . $this->lang->testsuite->view, '', "class='btn'");
}
$pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
}
else
{
$this->app->loadLang('testcase');
$pageActions .= "<div class='btn-group'>";
if(common::hasPriv('testsuite', 'exportTemplet'))
if($this->config->global->flow == 'full')
{
$link = helper::createLink('testsuite', 'exportTemplet', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon icon-export muted'> </i>" . $this->lang->testsuite->exportTemplet, '', "class='btn btn-link export'");
$this->app->loadLang('qa');
$pageNav .= '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $this->lang->qa->index . ' <span class="caret"></span></button>';
$pageNav .= '<ul class="dropdown-menu">';
if(common::hasPriv('testsuite', 'createLib')) $pageNav .= '<li>' . html::a(helper::createLink('testsuite', 'createLib'), '<i class="icon icon-plus"></i> ' . $this->lang->testsuite->createLib) . '</li>';
$pageNav .= '</ul></div></div>';
if(common::hasPriv('testsuite', 'libView'))
{
$link = helper::createLink('testsuite', 'libView', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon icon-list-alt muted'> </i>" . $this->lang->testsuite->view, '', "class='btn'");
}
}
if(common::hasPriv('testsuite', 'import'))
else
{
$link = helper::createLink('testsuite', 'import', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon muted icon-import'> </i>" . $this->lang->testcase->importFile, '', "class='btn btn-link export'");
}
$pageActions .= '</div>';
$params = "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0);
if(common::hasPriv('testsuite', 'batchCreateCase'))
{
$link = helper::createLink('testsuite', 'batchCreateCase', $params);
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testsuite', 'createCase'))
{
$link = helper::createLink('testsuite', 'createCase', $params);
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->testcase->create, '', "class='btn btn-primary'");
$this->app->loadLang('testcase');
$pageActions .= "<div class='btn-group'>";
if(common::hasPriv('testsuite', 'exportTemplet'))
{
$link = helper::createLink('testsuite', 'exportTemplet', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon icon-export muted'> </i>" . $this->lang->testsuite->exportTemplet, '', "class='btn btn-link export'");
}
if(common::hasPriv('testsuite', 'import'))
{
$link = helper::createLink('testsuite', 'import', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon muted icon-import'> </i>" . $this->lang->testcase->importFile, '', "class='btn btn-link export'");
}
$pageActions .= '</div>';
$params = "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0);
if(common::hasPriv('testsuite', 'batchCreateCase'))
{
$link = helper::createLink('testsuite', 'batchCreateCase', $params);
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testsuite', 'createCase'))
{
$link = helper::createLink('testsuite', 'createCase', $params);
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->testcase->create, '', "class='btn btn-primary'");
}
}
}
$pageNav .= $selectHtml;
+14 -5
View File
@@ -46,17 +46,26 @@ class testtaskModel extends model
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
$isMobile = $this->app->viewType == 'mhtml';
if($isMobile)
{
$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 = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
}
else
{
if(common::hasPriv('testtask', 'create'))
if($this->config->global->flow == 'full')
{
$link = helper::createLink('testtask', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testtask->create}", '', "class='btn btn-primary'");
$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>';
}
else
{
if(common::hasPriv('testtask', 'create'))
{
$link = helper::createLink('testtask', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testtask->create}", '', "class='btn btn-primary'");
}
}
}
$pageNav .= $selectHtml;