* finish task #4641.
This commit is contained in:
@@ -70,7 +70,9 @@ class search extends control
|
||||
$queryID = $this->search->saveQuery();
|
||||
if(!$queryID) die(js::error(dao::getError()));
|
||||
|
||||
die(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID)}"));
|
||||
$data = fixer::input('post')->get();
|
||||
$shortcut = empty($data->onMenuBar) ? 0 : 1;
|
||||
die(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID, $shortcut, '{$data->title}')}"));
|
||||
}
|
||||
$this->view->module = $module;
|
||||
$this->view->onMenuBar = $onMenuBar;
|
||||
@@ -109,7 +111,7 @@ class search extends control
|
||||
foreach($queries as $queryID => $queryName)
|
||||
{
|
||||
if(empty($queryID)) continue;
|
||||
$html .= html::a("###", $queryName . (common::hasPriv('search', 'deleteQuery') ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$queryID'");
|
||||
$html .= '<li>' . html::a("javascript:executeQuery({$queryID})", $queryName . (common::hasPriv('search', 'deleteQuery') ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$queryID'") . '</li>';
|
||||
}
|
||||
die($html);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ $lang->search->select = 'Stories/Tasks Filter';
|
||||
$lang->search->me = 'Me';
|
||||
$lang->search->noQuery = 'No query saved!';
|
||||
$lang->search->onMenuBar = 'Show in Menu';
|
||||
$lang->search->custom = 'Custom';
|
||||
|
||||
$lang->search->account = 'Account';
|
||||
$lang->search->module = 'Module';
|
||||
|
||||
@@ -24,6 +24,7 @@ $lang->search->select = '需求/任务筛选';
|
||||
$lang->search->me = '自己';
|
||||
$lang->search->noQuery = '还没有保存查询!';
|
||||
$lang->search->onMenuBar = '显示在菜单栏';
|
||||
$lang->search->custom = '自定义';
|
||||
|
||||
$lang->search->account = '用户名';
|
||||
$lang->search->module = '模块';
|
||||
|
||||
@@ -217,6 +217,7 @@ foreach($fieldParams as $fieldName => $param)
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php js::set('searchCustom', $lang->search->custom);?>
|
||||
<script>
|
||||
var dtOptions =
|
||||
{
|
||||
@@ -250,9 +251,18 @@ $(function()
|
||||
/*
|
||||
* Load queries form
|
||||
*/
|
||||
var loadQueries = window.loadQueries = function(queryID)
|
||||
var loadQueries = window.loadQueries = function(queryID, shortcut, name)
|
||||
{
|
||||
$('#userQueries div:first').load($.createLink('search', 'ajaxGetQuery', 'module=' + module + '&queryID=' + queryID));
|
||||
$('#userQueries ul').load($.createLink('search', 'ajaxGetQuery', 'module=' + module + '&queryID=' + queryID));
|
||||
if(shortcut)
|
||||
{
|
||||
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>';
|
||||
$('#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>")
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -431,7 +441,7 @@ $(function()
|
||||
var $query = $(this).closest('.user-query');
|
||||
var queryId = $query.data('queryId');
|
||||
var deleteQueryLink = $.createLink('search', 'deleteQuery', 'queryID=' + queryId);
|
||||
$.getJSON(deleteQueryLink, function(data)
|
||||
$.get(deleteQueryLink, function(data)
|
||||
{
|
||||
if(data == 'success') $query.remove();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user