* code for task #2522,2579.
This commit is contained in:
@@ -95,8 +95,10 @@ class testcase extends control
|
||||
$cases = $this->loadModel('story')->checkNeedConfirm($cases);
|
||||
|
||||
/* Build the search form. */
|
||||
$this->config->testcase->search['style'] = 'shortcut';
|
||||
$actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
|
||||
$this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
$this->loadModel('search')->mergeFeatureBar('testcase', 'browse');
|
||||
|
||||
$showModule = !empty($this->config->datatable->testcasebrowse->showModule) ? $this->config->datatable->testcasebrowse->showModule : '';
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
|
||||
|
||||
@@ -23,8 +23,6 @@ function confirmBatchDelete(actionLink)
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#' + caseBrowseType + 'Tab').addClass('active');
|
||||
$('#module' + moduleID).addClass('active');
|
||||
if(browseType == 'bysearch') ajaxGetSearchForm();
|
||||
setTimeout(function(){fixedTfootAction('#batchForm')}, 100);
|
||||
setTimeout(function(){fixedTheadOfList('#caseList')}, 100);
|
||||
|
||||
@@ -262,7 +262,7 @@ class testcaseModel extends model
|
||||
{
|
||||
/* Set modules and browse type. */
|
||||
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
|
||||
$browseType = (($browseType == 'bymodule') and ($this->session->caseBrowseType) and ($this->session->caseBrowseType != 'bysearch')) ? $this->session->caseBrowseType : $browseType;
|
||||
$browseType = ($browseType == 'bymodule' and $this->session->caseBrowseType and $this->session->caseBrowseType != 'bysearch') ? $this->session->caseBrowseType : $browseType;
|
||||
|
||||
/* By module or all cases. */
|
||||
$cases = array();
|
||||
|
||||
@@ -16,7 +16,7 @@ include '../../common/view/datepicker.html.php';
|
||||
include '../../common/view/datatable.fix.html.php';
|
||||
include './caseheader.html.php';
|
||||
js::set('browseType', $browseType);
|
||||
js::set('caseBrowseType', $this->session->caseBrowseType);
|
||||
js::set('caseBrowseType', ($browseType == 'bymodule' and $this->session->caseBrowseType == 'bysearch') ? 'all' : $this->session->caseBrowseType);
|
||||
js::set('moduleID' , $moduleID);
|
||||
js::set('confirmDelete', $lang->testcase->confirmDelete);
|
||||
js::set('batchDelete', $lang->testcase->confirmBatchDelete);
|
||||
@@ -98,4 +98,17 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
|
||||
</tfoot>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$('#module' + moduleID).addClass('active');
|
||||
$('#' + caseBrowseType + 'Tab').addClass('active');
|
||||
<?php if($browseType == 'bysearch'):?>
|
||||
$shortcut = $('#QUERY<?php echo (int)$param;?>Tab');
|
||||
if($shortcut.size() > 0)
|
||||
{
|
||||
$shortcut.addClass('active');
|
||||
$('#bysearchTab').removeClass('active');
|
||||
$('#querybox').removeClass('show');
|
||||
}
|
||||
<?php endif;?>
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<?php if(!isset($branch)) $branch = 0;?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<?php if(isset($moduleID)):?>
|
||||
<li>
|
||||
<span>
|
||||
<?php
|
||||
echo $moduleName;
|
||||
if($moduleID)
|
||||
echo isset($moduleID) ? $moduleName : $this->lang->tree->all;
|
||||
if(!empty($moduleID))
|
||||
{
|
||||
$removeLink = $browseType == 'bymodule' ? inlink('browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("caseModule")';
|
||||
echo ' ' . html::a($removeLink, "<i class='icon icon-remove'></i>") . ' ';
|
||||
@@ -15,15 +14,24 @@
|
||||
?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$hasBrowsePriv = common::hasPriv('testcase', 'browse');
|
||||
$hasGroupPriv = common::hasPriv('testcase', 'groupcase');
|
||||
$hasZeroPriv = common::hasPriv('story', 'zerocase');
|
||||
?>
|
||||
<?php foreach($app->customMenu['featurebar'] as $type => $featurebar):?>
|
||||
<?php if($featurebar['status'] == 'hide') continue;?>
|
||||
<?php
|
||||
if(common::hasPriv('testcase', 'browse') and ($type == 'all' or $type == 'needconfirm'))
|
||||
if($hasBrowsePriv and strpos($type, 'QUERY') === 0)
|
||||
{
|
||||
$queryID = (int)substr($type, 5);
|
||||
echo "<li id='{$type}Tab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=bySearch¶m=$queryID"), $featurebar['link']) . "</li>";
|
||||
}
|
||||
elseif($hasBrowsePriv and ($type == 'all' or $type == 'needconfirm'))
|
||||
{
|
||||
echo "<li id='{$type}Tab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=$type"), $featurebar['link']) . "</li>";
|
||||
}
|
||||
elseif($type == 'group' and common::hasPriv('testcase', 'groupcase'))
|
||||
elseif($hasGroupPriv and $type == 'group')
|
||||
{
|
||||
echo "<li id='groupTab' class='dropdown'>";
|
||||
$groupBy = isset($groupBy) ? $groupBy : '';
|
||||
@@ -39,7 +47,7 @@
|
||||
}
|
||||
echo '</ul></li>';
|
||||
}
|
||||
elseif($type == 'zerocase' and common::hasPriv('story', 'zeroCase'))
|
||||
elseif($hasZeroPriv and $type == 'zerocase')
|
||||
{
|
||||
echo "<li id='zerocaseTab'>" . html::a($this->createLink('story', 'zeroCase', "productID=$productID"), $lang->story->zeroCase) . '</li>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user