* finish task #5578.
This commit is contained in:
@@ -68,28 +68,9 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
|
||||
}
|
||||
elseif($menuItem->name == 'QUERY')
|
||||
{
|
||||
if(isset($lang->custom->queryList))
|
||||
{
|
||||
echo '<div class="btn-group" id="query">';
|
||||
$active = '';
|
||||
$current = $menuItem->text;
|
||||
$dropdownHtml = "<ul class='dropdown-menu'>";
|
||||
foreach($lang->custom->queryList as $queryID => $queryTitle)
|
||||
{
|
||||
if($browseType == 'bysearch' and $queryID == $param)
|
||||
{
|
||||
$active = 'btn-active-text';
|
||||
$current = "<span class='text'>{$queryTitle}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
}
|
||||
$dropdownHtml .= '<li' . ($param == $queryID ? " class='active'" : '') . '>';
|
||||
$dropdownHtml .= html::a($this->inlink('browse', "productID=$productID&branch=$branch&browseType=bySearch¶m=$queryID"), $queryTitle);
|
||||
}
|
||||
$dropdownHtml .= '</ul>';
|
||||
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown' class='btn btn-link $active'");
|
||||
echo $dropdownHtml;
|
||||
echo '</div>';
|
||||
}
|
||||
$searchBrowseLink = inlink('browse', "productID=$productID&branch=$branch&browseType=bySearch¶m=%s");
|
||||
$isBySearch = $browseType == 'bysearch';
|
||||
include '../../common/view/querymenu.html.php';
|
||||
}
|
||||
elseif($menuItem->name == 'more')
|
||||
{
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<style>
|
||||
#mainMenu #query.btn-group li {position: relative;}
|
||||
#mainMenu #query.btn-group li a{margin-right:20px;}
|
||||
#mainMenu #query.btn-group li .btn-delete{
|
||||
padding:0 7px;
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: -5px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
if(isset($lang->custom->queryList))
|
||||
{
|
||||
echo '<div class="btn-group" id="query">';
|
||||
$active = '';
|
||||
$current = $menuItem->text;
|
||||
$dropdownHtml = "<ul class='dropdown-menu'>";
|
||||
foreach($lang->custom->queryList as $queryID => $queryTitle)
|
||||
{
|
||||
if($isBySearch and $queryID == $param)
|
||||
{
|
||||
$active = 'btn-active-text';
|
||||
$current = "<span class='text'>{$queryTitle}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
}
|
||||
$dropdownHtml .= '<li' . ($param == $queryID ? " class='active'" : '') . '>';
|
||||
$dropdownHtml .= html::a(sprintf($searchBrowseLink, $queryID), $queryTitle);
|
||||
$dropdownHtml .= html::a("###", "<i class='icon icon-close'></i>", '', "class='btn-delete' data-id={$queryID} onclick='removeQueryFromMenu(this)'");
|
||||
$dropdownHtml .= '</li>';
|
||||
}
|
||||
$dropdownHtml .= '</ul>';
|
||||
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown' class='btn btn-link $active'");
|
||||
echo $dropdownHtml;
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function removeQueryFromMenu(obj)
|
||||
{
|
||||
var $obj = $(obj);
|
||||
var link = createLink('search', 'ajaxRemoveMenu', "queryID=" + $obj.data('id'));
|
||||
$.get(link, function()
|
||||
{
|
||||
$obj.closest('li').remove();
|
||||
if($('#mainMenu #query.btn-group').find('li').length == 0) $('#mainMenu #query.btn-group').remove();
|
||||
})
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@@ -111,6 +111,7 @@ class custom extends control
|
||||
elseif($module == 'user' and $field == 'contactField')
|
||||
{
|
||||
$data = fixer::input('post')->join('contactField', ',')->get();
|
||||
if(!isset($data->contactField)) $data->contactField = '';
|
||||
$this->loadModel('setting')->setItem('system.user.contactField', $data->contactField);
|
||||
}
|
||||
elseif($module == 'user' and $field == 'deleted')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$(function()
|
||||
{
|
||||
if($('#storyList thead th.c-title').width() < 150) $('#storyList thead th.c-title').width(150);
|
||||
setTimeout(function(){fixFeatureBar();}, 500);
|
||||
setTimeout(function(){fixFeatureBar();}, 10);
|
||||
|
||||
// Fix state dropdown menu position
|
||||
$('.c-stage > .dropdown').each(function()
|
||||
|
||||
@@ -59,28 +59,9 @@
|
||||
}
|
||||
elseif($menuItem->name == 'QUERY')
|
||||
{
|
||||
if(isset($lang->custom->queryList))
|
||||
{
|
||||
echo '<div class="btn-group" id="query">';
|
||||
$active = '';
|
||||
$current = $menuItem->text;
|
||||
$dropdownHtml = "<ul class='dropdown-menu'>";
|
||||
foreach($lang->custom->queryList as $queryID => $queryTitle)
|
||||
{
|
||||
if($this->session->storyBrowseType == 'bysearch' and $queryID == $param)
|
||||
{
|
||||
$active = 'btn-active-text';
|
||||
$current = "<span class='text'>{$queryTitle}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
}
|
||||
$dropdownHtml .= '<li' . ($param == $queryID ? " class='active'" : '') . '>';
|
||||
$dropdownHtml .= html::a($this->inlink('browse', "productID=$productID&branch=$branch&browseType=$menuBrowseType¶m=$queryID"), $queryTitle);
|
||||
}
|
||||
$dropdownHtml .= '</ul>';
|
||||
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown' class='btn btn-link $active'");
|
||||
echo $dropdownHtml;
|
||||
echo '</div>';
|
||||
}
|
||||
$searchBrowseLink = inlink('browse', "productID=$productID&branch=$branch&browseType=$menuBrowseType¶m=%s");
|
||||
$isBySearch = $this->session->storyBrowseType == 'bysearch';
|
||||
include '../../common/view/querymenu.html.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -55,29 +55,9 @@ js::set('browseType', $browseType);
|
||||
$menuType = $menuItem->name;
|
||||
if($menuType == 'QUERY')
|
||||
{
|
||||
if(isset($lang->custom->queryList))
|
||||
{
|
||||
echo "<div class='btn-group' id='query'>";
|
||||
$current = $menuItem->text;
|
||||
$active = '';
|
||||
$dropdownHtml = "<ul class='dropdown-menu'>";
|
||||
foreach($lang->custom->queryList as $queryID => $queryTitle)
|
||||
{
|
||||
if($this->session->taskBrowseType == 'bysearch' and $queryID == $param)
|
||||
{
|
||||
$current = "<span class='text'>{$queryTitle}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
$active = 'btn-active-text';
|
||||
}
|
||||
|
||||
$dropdownHtml .= '<li' . ($queryID == $param ? " class='active'" : '') . '>';
|
||||
$dropdownHtml .= html::a($this->createLink('project', 'task', "project=$projectID&type=bySearch¶m=$queryID"), $queryTitle);
|
||||
}
|
||||
$dropdownHtml .= '</ul>';
|
||||
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown' class='btn btn-link $active'");
|
||||
echo $dropdownHtml;
|
||||
echo '</div>';
|
||||
}
|
||||
$searchBrowseLink = $this->createLink('project', 'task', "project=$projectID&type=bySearch¶m=%s");
|
||||
$isBySearch = $this->session->taskBrowseType == 'bysearch';
|
||||
include '../../common/view/querymenu.html.php';
|
||||
}
|
||||
elseif($menuType != 'status' and $menuType != 'QUERY')
|
||||
{
|
||||
|
||||
@@ -115,4 +115,16 @@ class search extends control
|
||||
}
|
||||
die($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax remove from menu.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxRemoveMenu($queryID)
|
||||
{
|
||||
$this->dao->update(TABLE_USERQUERY)->set('shortcut')->eq(0)->where('id')->eq($queryID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,9 +296,14 @@ $(function()
|
||||
if($('#mainMenu .btn-toolbar.pull-left #query').size() == 0)
|
||||
{
|
||||
var html = '<div class="btn-group" id="query"><a href="javascript:;" data-toggle="dropdown" class="btn btn-link " style="border-radius: 2px;">' + searchCustom + ' <span class="caret"></span></a><ul class="dropdown-menu"></ul></div>';
|
||||
html += '<style>#mainMenu #query.btn-group li {position: relative;} #mainMenu #query.btn-group li a{margin-right:20px;} #mainMenu #query.btn-group li .btn-delete{ padding:0 7px; position: absolute; right: -10px; top: -5px; display: block; width: 20px; text-align: center; } </style>';
|
||||
html += "<script> function removeQueryFromMenu(obj) { var $obj = $(obj); var link = createLink('search', 'ajaxRemoveMenu', 'queryID=' + $obj.data('id')); $.get(link, function() { $obj.closest('li').remove(); if($('#mainMenu #query.btn-group').find('li').length == 0) $('#mainMenu #query.btn-group').remove(); })}<\/script>";
|
||||
$('#mainMenu .btn-toolbar.pull-left #bysearchTab').before(html);
|
||||
}
|
||||
$('#mainMenu .btn-toolbar.pull-left #query ul.dropdown-menu').append("<li><a href='" + actionURL.replace('myQueryID', queryID) + "'>" + name + "</a></li>")
|
||||
html = "<li><a href='" + actionURL.replace('myQueryID', queryID) + "'>" + name + "</a>";
|
||||
html += "<a href='###' class='btn-delete' data-id='" + queryID + "' onclick='removeQueryFromMenu(this)'><i class='icon icon-close'></i></a></li>";
|
||||
$('#mainMenu .btn-toolbar.pull-left #query ul.dropdown-menu').append(html);
|
||||
fixFeatureBar();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,28 +28,9 @@
|
||||
if($config->global->flow == 'onlyTest' and (strpos(',needconfirm,group,zerocase,', ',' . $menuType . ',') !== false)) continue;
|
||||
if($hasBrowsePriv and $menuType == 'QUERY')
|
||||
{
|
||||
if(isset($lang->custom->queryList))
|
||||
{
|
||||
echo '<div class="btn-group" id="query">';
|
||||
$active = '';
|
||||
$current = $menuItem->text;
|
||||
$dropdownHtml = "<ul class='dropdown-menu'>";
|
||||
foreach($lang->custom->queryList as $queryID => $queryTitle)
|
||||
{
|
||||
if($browseType == 'bysearch' and $queryID == $param)
|
||||
{
|
||||
$active = 'btn-active-text';
|
||||
$current = "<span class='text'>{$queryTitle}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
}
|
||||
$dropdownHtml .= '<li' . ($param == $queryID ? " class='active'" : '') . '>';
|
||||
$dropdownHtml .= html::a($this->inlink('browse', "productID=$productID&branch=$branch&browseType=bySearch¶m=$queryID"), $queryTitle);
|
||||
}
|
||||
$dropdownHtml .= '</ul>';
|
||||
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown' class='btn btn-link $active'");
|
||||
echo $dropdownHtml;
|
||||
echo '</div>';
|
||||
}
|
||||
$searchBrowseLink = inlink('browse', "productID=$productID&branch=$branch&browseType=bySearch¶m=%s");
|
||||
$isBySearch = $browseType == 'bysearch';
|
||||
include '../../common/view/querymenu.html.php';
|
||||
}
|
||||
elseif($hasBrowsePriv and ($menuType == 'all' or $menuType == 'needconfirm' or $menuType == 'wait'))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user