* adjust for setMenu method.
This commit is contained in:
+58
-49
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user