* code for task #2522,2579.

This commit is contained in:
wangyidong
2016-04-20 14:51:05 +08:00
parent 164f7630d3
commit d89d674cdd
29 changed files with 385 additions and 173 deletions
+2
View File
@@ -105,8 +105,10 @@ class bug extends control
$bugs = $this->bug->processBuildForBugs($bugs);
/* Build the search form. */
$this->config->bug->search['style'] = 'shortcut';
$actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL);
$this->loadModel('search')->mergeFeatureBar('bug', 'browse');
$showModule = !empty($this->config->datatable->bugbrowse->showModule) ? $this->config->datatable->bugbrowse->showModule : '';
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'bug', $showModule) : array();
-2
View File
@@ -1,7 +1,5 @@
$(document).ready(function()
{
$('#' + bugBrowseType + 'Tab').addClass('active');
$('#module' + moduleID).addClass('active');
if(browseType == 'bysearch') ajaxGetSearchForm();
$('.dropdown-menu .with-search .menu-search').click(function(e)
+1 -1
View File
@@ -224,7 +224,7 @@ class bugModel extends model
{
/* Set modules and browse type. */
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
$browseType = (($browseType == 'bymodule') and ($this->session->bugBrowseType) and ($this->session->bugBrowseType != 'bysearch')) ? $this->session->bugBrowseType : $browseType;
$browseType = ($browseType == 'bymodule' and $this->session->bugBrowseType and $this->session->bugBrowseType != 'bysearch') ? $this->session->bugBrowseType : $browseType;
/* Get bugs by browse type. */
$bugs = array();
+19 -8
View File
@@ -15,7 +15,7 @@ include '../../common/view/header.html.php';
include '../../common/view/datatable.fix.html.php';
js::set('browseType', $browseType);
js::set('moduleID', $moduleID);
js::set('bugBrowseType', $this->session->bugBrowseType);
js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrowseType == 'bysearch') ? 'all' : $this->session->bugBrowseType);
?>
<div id='featurebar'>
<ul class='nav'>
@@ -34,7 +34,12 @@ js::set('bugBrowseType', $this->session->bugBrowseType);
</li>
<?php foreach($app->customMenu['featurebar'] as $type => $featurebar):?>
<?php if($featurebar['status'] == 'hide') continue;?>
<?php if(strpos($type, 'QUERY') === 0):?>
<?php $queryID = (int)substr($type, 5);?>
<li id='<?php echo $type?>Tab'><?php echo html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=bySearch&param=$queryID"), $featurebar['link'])?></li>
<?php else:?>
<li id='<?php echo $type?>Tab'><?php echo html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=$type&param=0"), $featurebar['link'])?></li>
<?php endif;?>
<?php endforeach;?>
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i>&nbsp;<?php echo $lang->bug->byQuery;?></a></li>
</ul>
@@ -211,14 +216,20 @@ js::set('bugBrowseType', $this->session->bugBrowseType);
</form>
</div>
<script>
<?php
$this->app->loadConfig('qa', '', false);
if($this->config->qa->homepage != 'browse'):
?>
$(function()
$('#' + bugBrowseType + 'Tab').addClass('active');
$('#module' + moduleID).addClass('active');
<?php if($browseType == 'bysearch'):?>
$shortcut = $('#QUERY<?php echo (int)$param;?>Tab');
if($shortcut.size() > 0)
{
$('#modulemenu .nav li:last').after("<li class='right'><a href='javascript:setHomepage(\"qa\", \"browse\")'><i class='icon icon-home'></i><?php echo $lang->homepage?></a></li>")
});
$shortcut.addClass('active');
$('#bysearchTab').removeClass('active');
$('#querybox').removeClass('show');
}
<?php endif;?>
<?php $this->app->loadConfig('qa', '', false);?>
<?php if($this->config->qa->homepage != 'browse'):?>
$(function(){$('#modulemenu .nav li:last').after("<li class='right'><a href='javascript:setHomepage(\"qa\", \"browse\")'><i class='icon icon-home'></i><?php echo $lang->homepage?></a></li>")});
<?php endif;?>
</script>
<?php include '../../common/view/footer.html.php';?>