mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6925 - Enable on any search result edition of OQL (#711)
This commit is contained in:
@@ -1555,6 +1555,11 @@ class utils
|
||||
}
|
||||
$aResult[] = new JSPopupMenuItem('UI:Menu:AddToDashboard', Dict::S('UI:Menu:AddToDashboard'), "DashletCreationDlg('$sOQL', '$sContext')");
|
||||
$aResult[] = new JSPopupMenuItem('UI:Menu:ShortcutList', Dict::S('UI:Menu:ShortcutList'), "ShortcutListDlg('$sOQL', '$sDataTableId', '$sContext')");
|
||||
if (ApplicationMenu::IsMenuIdEnabled('RunQueriesMenu')) {
|
||||
$oMenuItemPlay = new JSPopupMenuItem('UI:Menu:OpenOQL', Dict::S('UI:Edit:TestQuery'), "OpenOql('$sOQL')");
|
||||
$oMenuItemPlay->SetIconClass('fas fa-play');
|
||||
$aResult[] = $oMenuItemPlay;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
18
js/utils.js
18
js/utils.js
@@ -369,6 +369,24 @@ function DashletCreationDlg(sOQL, sContext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function OpenOql(sOQL) {
|
||||
sBaseUrl = GetAbsoluteUrlAppRoot() + 'pages/run_query.php';
|
||||
var form = document.createElement("form");
|
||||
form.setAttribute("method", "post");
|
||||
form.setAttribute("action", sBaseUrl);
|
||||
form.setAttribute("target", '_blank');
|
||||
form.setAttribute("id", 'run_query_form');
|
||||
var input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.name = 'expression';
|
||||
input.value = sOQL;
|
||||
form.appendChild(input);
|
||||
document.body.appendChild(form);
|
||||
// form.submit() is blocked by the browser
|
||||
$('#run_query_form').submit();
|
||||
document.body.removeChild(form);
|
||||
}
|
||||
|
||||
function ShortcutListDlg(sOQL, sDataTableId, sContext) {
|
||||
var sDataTableName = 'datatable_'+sDataTableId;
|
||||
var oTableSettings = {
|
||||
|
||||
Reference in New Issue
Block a user