mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js, godmode/alerts/alert_list.builder.php, godmode/alerts/alert_list.list.php, godmode/gis_maps/configure_gis_map.php, include/functions_visual_map_editor.php, include/functions_ui.php, operation/tree.php, operation/agentes/exportdata.excel.php, operation/agentes/exportdata.php, operation/agentes/ver_agente.php, operation/snmpconsole/snmp_view.php, operation/users/user_edit.php, operation/gis_maps/ajax.php, operation/events/events_validate.php, operation/messages/message_edit.php, operation/messages/message_list.php, operation/reporting/reporting_viewer.php, operation/netflow/nf_live_view.php, operation/incidents/incident.php, operation/search_modules.php: started to use the new function "ui_print_agent_autocomplete_input" to make more easy (and standar) the autocomplete agent input. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
06d7ae7d34
commit
4f629c08e5
@ -1,3 +1,22 @@
|
|||||||
|
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/reporting/visual_console_builder.editor.js,
|
||||||
|
godmode/alerts/alert_list.builder.php,
|
||||||
|
godmode/alerts/alert_list.list.php,
|
||||||
|
godmode/gis_maps/configure_gis_map.php,
|
||||||
|
include/functions_visual_map_editor.php, include/functions_ui.php,
|
||||||
|
operation/tree.php, operation/agentes/exportdata.excel.php,
|
||||||
|
operation/agentes/exportdata.php, operation/agentes/ver_agente.php,
|
||||||
|
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
|
||||||
|
operation/gis_maps/ajax.php, operation/events/events_validate.php,
|
||||||
|
operation/messages/message_edit.php,
|
||||||
|
operation/messages/message_list.php,
|
||||||
|
operation/reporting/reporting_viewer.php,
|
||||||
|
operation/netflow/nf_live_view.php,
|
||||||
|
operation/incidents/incident.php, operation/search_modules.php:
|
||||||
|
started to use the new function "ui_print_agent_autocomplete_input"
|
||||||
|
to make more easy (and standar) the autocomplete agent input.
|
||||||
|
|
||||||
2012-09-18 Ramon Novoa <rnovoa@artica.es>
|
2012-09-18 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandoradb.postgreSQL.sql,
|
* pandoradb.postgreSQL.sql,
|
||||||
|
@ -44,12 +44,15 @@ $table->align[1] = 'left';
|
|||||||
|
|
||||||
/* Add an agent selector */
|
/* Add an agent selector */
|
||||||
if (! $id_agente) {
|
if (! $id_agente) {
|
||||||
|
|
||||||
$table->data['agent'][0] = __('Agent');
|
$table->data['agent'][0] = __('Agent');
|
||||||
$src_code = html_print_image('images/lightning.png', true, false, true);
|
|
||||||
$table->data['agent'][1] = html_print_input_text_extended ('id_agent', '', 'text_id_agent', '', 30, 100, false, '',
|
$params = array();
|
||||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true)
|
$params['return'] = true;
|
||||||
. ui_print_help_tip(__('Type at least two characters to search'), true);
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'id_agent';
|
||||||
|
$params['selectbox_id'] = 'id_agent_module';
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$table->data['agent'][1] = ui_print_agent_autocomplete_input($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[0][0] = __('Module');
|
$table->data[0][0] = __('Module');
|
||||||
@ -141,94 +144,6 @@ ui_require_jquery_file ('bgiframe');
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
$("#text_id_agent").autocomplete({
|
|
||||||
minLength: 2,
|
|
||||||
source: function( request, response ) {
|
|
||||||
var term = request.term; //Word to search
|
|
||||||
|
|
||||||
var data_params = {
|
|
||||||
page: "include/ajax/agent",
|
|
||||||
"search_agents_2": 1,
|
|
||||||
id_group: function() { return $("#id_group").val(); },
|
|
||||||
"q": term};
|
|
||||||
|
|
||||||
jQuery.ajax ({
|
|
||||||
data: data_params,
|
|
||||||
async: false,
|
|
||||||
type: "POST",
|
|
||||||
url: action="ajax.php",
|
|
||||||
timeout: 10000,
|
|
||||||
dataType: "json",
|
|
||||||
success: function (data) {
|
|
||||||
response(data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
},
|
|
||||||
select: function( event, ui ) {
|
|
||||||
var agent_name = ui.item.name;
|
|
||||||
|
|
||||||
//Put the name
|
|
||||||
$(this).val(agent_name);
|
|
||||||
|
|
||||||
$('#id_agent_module').fadeOut ('normal', function () {
|
|
||||||
$('#id_agent_module').empty ();
|
|
||||||
var inputs = [];
|
|
||||||
inputs.push ("agent_name=" + agent_name);
|
|
||||||
inputs.push ('filter=delete_pending = 0 AND id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_estado WHERE utimestamp = 0)');
|
|
||||||
inputs.push ("get_agent_modules_json=1");
|
|
||||||
inputs.push ("page=operation/agentes/ver_agente");
|
|
||||||
/* This will force to get local modules although metaconsole is active */
|
|
||||||
inputs.push ("force_local_modules=1");
|
|
||||||
jQuery.ajax ({
|
|
||||||
data: inputs.join ("&"),
|
|
||||||
type: 'GET',
|
|
||||||
url: action="ajax.php",
|
|
||||||
timeout: 10000,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function (data) {
|
|
||||||
$('#id_agent_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
|
||||||
jQuery.each (data, function (i, val) {
|
|
||||||
s = js_html_entity_decode (val['nombre']);
|
|
||||||
$('#id_agent_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
|
||||||
});
|
|
||||||
$('#id_agent_module').enable();
|
|
||||||
$('#id_agent_module').fadeIn ('normal');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.data( "autocomplete")._renderItem = function( ul, item ) {
|
|
||||||
if (item.ip == "") {
|
|
||||||
text = "<a>" + item.name + "</a>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
text = "<a>" + item.name
|
|
||||||
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $("<li></li>")
|
|
||||||
.data("item.autocomplete", item)
|
|
||||||
.append(text)
|
|
||||||
.appendTo(ul);
|
|
||||||
};
|
|
||||||
|
|
||||||
//Force the size of autocomplete
|
|
||||||
$(".ui-autocomplete").css("max-height", "100px");
|
|
||||||
$(".ui-autocomplete").css("overflow-y", "auto");
|
|
||||||
/* prevent horizontal scrollbar */
|
|
||||||
$(".ui-autocomplete").css("overflow-x", "hidden");
|
|
||||||
/* add padding to account for vertical scrollbar */
|
|
||||||
$(".ui-autocomplete").css("padding-right", "20px");
|
|
||||||
|
|
||||||
//Force to style of items
|
|
||||||
$(".ui-autocomplete").css("text-align", "left");
|
|
||||||
|
|
||||||
<?php if (! $id_agente) : ?>
|
<?php if (! $id_agente) : ?>
|
||||||
$("#id_group").pandoraSelectGroupAgent ({
|
$("#id_group").pandoraSelectGroupAgent ({
|
||||||
callbackBefore: function () {
|
callbackBefore: function () {
|
||||||
|
@ -57,11 +57,17 @@ if ($temp){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form_filter .= "<td>".__('Agents')."</td><td>";
|
$form_filter .= "<td>".__('Agents')."</td><td>";
|
||||||
//Image src with skins
|
|
||||||
$src_code = html_print_image('images/lightning.png', true, false, true);
|
|
||||||
$form_filter .= html_print_input_text_extended ('agent_name', $agentName, 'text-agent_name', '', 12, 100, false, '',
|
$params = array();
|
||||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true);
|
$params['return'] = true;
|
||||||
$form_filter .= ui_print_help_tip(__('Type at least two characters to search'), true); //'<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a>';
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent_name';
|
||||||
|
$params['value'] = $agentName;
|
||||||
|
$params['size'] = 12;
|
||||||
|
$form_filter .= ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
|
|
||||||
$form_filter .= "</td>\n";
|
$form_filter .= "</td>\n";
|
||||||
|
|
||||||
$form_filter .= "<td>".__('Module name')."</td><td>";
|
$form_filter .= "<td>".__('Module name')."</td><td>";
|
||||||
@ -580,37 +586,10 @@ ui_require_css_file ('cluetip');
|
|||||||
ui_require_jquery_file ('cluetip');
|
ui_require_jquery_file ('cluetip');
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
ui_require_jquery_file ('autocomplete');
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$("#text-agent_name").autocomplete ("ajax.php",
|
|
||||||
{
|
|
||||||
scroll: true,
|
|
||||||
minChars: 2,
|
|
||||||
extraParams: {
|
|
||||||
page: "godmode/agentes/agent_manager",
|
|
||||||
search_parents: 1,
|
|
||||||
id_group: function() { return $("#grupo").val(); },
|
|
||||||
id_agent: <?php echo $id_agente ?>
|
|
||||||
},
|
|
||||||
formatItem: function (data, i, total) {
|
|
||||||
if (total == 0)
|
|
||||||
$("#text-id_parent").css ('background-color', '#cc0000');
|
|
||||||
else
|
|
||||||
$("#text-id_parent").css ('background-color', 'none');
|
|
||||||
if (data == "")
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
|
|
||||||
},
|
|
||||||
delay: 200
|
|
||||||
}
|
|
||||||
);
|
|
||||||
//----------------------------
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (! $id_agente) {
|
if (! $id_agente) {
|
||||||
?>
|
?>
|
||||||
|
@ -413,12 +413,23 @@ $table->data[1][1] = '<div id="form_layer">
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>' . __('Agent') . ':</td>
|
<td>' . __('Agent') . ':</td>
|
||||||
<td colspan="3">
|
<td colspan="3">';
|
||||||
' . html_print_input_text_extended ('id_agent', __('Select'), 'text_id_agent', '', 30, 100, false, '',
|
|
||||||
array('style' => 'background: url(images/lightning.png) no-repeat right;'), true)
|
|
||||||
. '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a> ' .
|
|
||||||
html_print_button(__('Add agent'), 'add_agent', true, 'addAgentLayer();', 'class="sub add"', true) .'
|
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, 'addAgentLayer();', 'class="sub add"', true);
|
||||||
</td>
|
|
||||||
|
$params = array();
|
||||||
|
$params['return'] = true;
|
||||||
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'id_agent';
|
||||||
|
$params['value'] = '';
|
||||||
|
$params['javascript_function_action_after_select'] = 'active_button_add_agent';
|
||||||
|
$table->data[1][1] .= ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$table->data[1][1] .= '</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
@ -508,7 +519,6 @@ ui_require_css_file ('cluetip');
|
|||||||
ui_require_jquery_file ('cluetip');
|
ui_require_jquery_file ('cluetip');
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
ui_require_jquery_file ('autocomplete');
|
|
||||||
ui_require_jquery_file ('json');
|
ui_require_jquery_file ('json');
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -551,38 +561,11 @@ function refreshMapView() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#text_id_agent").autocomplete(
|
function active_button_add_agent() {
|
||||||
"ajax.php",
|
|
||||||
{
|
|
||||||
minChars: 2,
|
|
||||||
scroll:true,
|
|
||||||
extraParams: {
|
|
||||||
page: "operation/agentes/exportdata",
|
|
||||||
search_agents: 1,
|
|
||||||
id_group: function() { return $("#id_group").val(); }
|
|
||||||
},
|
|
||||||
formatItem: function (data, i, total) {
|
|
||||||
if (total == 0)
|
|
||||||
$("#text_id_agent").css ('background-color', '#cc0000');
|
|
||||||
else
|
|
||||||
$("#text_id_agent").css ('background-color', '');
|
|
||||||
if (data == "")
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
|
|
||||||
},
|
|
||||||
delay: 200
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$("#text_id_agent").result (
|
|
||||||
function () {
|
|
||||||
$("#button-add_agent").removeAttr('disabled');
|
$("#button-add_agent").removeAttr('disabled');
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
function loadAgents(agent_list) {
|
function loadAgents(agent_list) {
|
||||||
if (agent_list != null) {
|
if (agent_list != null) {
|
||||||
@ -750,7 +733,7 @@ function deleteAgentLayer(idRow) {
|
|||||||
|
|
||||||
function addAgentLayer(agent_name) {
|
function addAgentLayer(agent_name) {
|
||||||
if (typeof(agent_name) == 'undefined')
|
if (typeof(agent_name) == 'undefined')
|
||||||
agent_name = $("#text_id_agent").val(); //default value
|
agent_name = $("#text-id_agent").val(); //default value
|
||||||
|
|
||||||
tableRow = $("#chuck_agent").clone();
|
tableRow = $("#chuck_agent").clone();
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ function visual_map_main() {
|
|||||||
|
|
||||||
eventsBackground();
|
eventsBackground();
|
||||||
eventsItems();
|
eventsItems();
|
||||||
eventsTextAgent();
|
|
||||||
|
|
||||||
//Fixed to wait the load of images.
|
//Fixed to wait the load of images.
|
||||||
$(window).load(function() {
|
$(window).load(function() {
|
||||||
@ -51,95 +50,6 @@ function visual_map_main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventsTextAgent() {
|
|
||||||
var idText = $("#ip_text").html();
|
|
||||||
|
|
||||||
$("#text-agent").autocomplete({
|
|
||||||
minLength: 2,
|
|
||||||
source: function( request, response ) {
|
|
||||||
var term = request.term; //Word to search
|
|
||||||
|
|
||||||
var params = [];
|
|
||||||
params.push("all=enabled");
|
|
||||||
params.push("search_agents_2=1");
|
|
||||||
params.push("page=include/ajax/agent");
|
|
||||||
params.push("id_group="+ $("#group").val());
|
|
||||||
params.push("q="+ term);
|
|
||||||
jQuery.ajax ({
|
|
||||||
data: params.join ("&"),
|
|
||||||
async: false,
|
|
||||||
type: 'POST',
|
|
||||||
url: action="ajax.php",
|
|
||||||
timeout: 10000,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function (data) {
|
|
||||||
response(data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
},
|
|
||||||
select: function( event, ui ) {
|
|
||||||
var agent_name = ui.item.name;
|
|
||||||
|
|
||||||
//Put the name
|
|
||||||
$(this).val(agent_name);
|
|
||||||
|
|
||||||
//Fill the modules select box
|
|
||||||
$('#module').fadeOut ('normal', function () {
|
|
||||||
$('#module').empty ();
|
|
||||||
var inputs = [];
|
|
||||||
inputs.push ("filter=disabled = 0");
|
|
||||||
inputs.push ("agent_name=" + agent_name);
|
|
||||||
inputs.push ("get_agent_modules_json=1");
|
|
||||||
inputs.push ("page=operation/agentes/ver_agente");
|
|
||||||
jQuery.ajax ({
|
|
||||||
data: inputs.join ("&"),
|
|
||||||
type: 'GET',
|
|
||||||
url: action="ajax.php",
|
|
||||||
timeout: 10000,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function (data) {
|
|
||||||
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
|
||||||
jQuery.each (data, function (i, val) {
|
|
||||||
s = js_html_entity_decode (val['nombre']);
|
|
||||||
$('#module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
|
||||||
});
|
|
||||||
$('#module').fadeIn ('normal');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.data( "autocomplete")._renderItem = function( ul, item ) {
|
|
||||||
if (item.ip == '') {
|
|
||||||
text = "<a>" + item.name + "</a>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
text = "<a>" + item.name
|
|
||||||
+ "<br><span style='font-size: 70%; font-style: italic;'>IP:" + item.ip + "</span></a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $("<li></li>")
|
|
||||||
.data("item.autocomplete", item)
|
|
||||||
.append(text)
|
|
||||||
.appendTo(ul);
|
|
||||||
};
|
|
||||||
|
|
||||||
//Force the size of autocomplete
|
|
||||||
$(".ui-autocomplete").css("max-height", "100px");
|
|
||||||
$(".ui-autocomplete").css("overflow-y", "auto");
|
|
||||||
/* prevent horizontal scrollbar */
|
|
||||||
$(".ui-autocomplete").css("overflow-x", "hidden");
|
|
||||||
/* add padding to account for vertical scrollbar */
|
|
||||||
$(".ui-autocomplete").css("padding-right", "20px");
|
|
||||||
|
|
||||||
//Force to style of items
|
|
||||||
$(".ui-autocomplete").css("text-align", "left");
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancel_button_palette_callback() {
|
function cancel_button_palette_callback() {
|
||||||
if (is_opened_palette) {
|
if (is_opened_palette) {
|
||||||
toggle_item_palette();
|
toggle_item_palette();
|
||||||
|
@ -2140,6 +2140,38 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
|
|
||||||
// Javascript configurations
|
// Javascript configurations
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
|
$javascript_function_action_after_select = ''; //Default value
|
||||||
|
$javascript_function_action_after_select_js_call = ''; //Default value
|
||||||
|
if (isset($parameters['javascript_function_action_after_select'])) {
|
||||||
|
$javascript_function_action_after_select = $parameters['javascript_function_action_after_select'];
|
||||||
|
$javascript_function_action_after_select_js_call =
|
||||||
|
$javascript_function_action_after_select . '();';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($parameters['javascript_function_action_after_select_js_call'])) {
|
||||||
|
if ($javascript_function_action_after_select_js_call !=
|
||||||
|
$parameters['javascript_function_action_after_select_js_call']) {
|
||||||
|
$javascript_function_action_after_select_js_call =
|
||||||
|
$parameters['javascript_function_action_after_select_js_call'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$javascript_function_action_into_source = ''; //Default value
|
||||||
|
$javascript_function_action_into_source_js_call = ''; //Default value
|
||||||
|
if (isset($parameters['javascript_function_action_into_source'])) {
|
||||||
|
$javascript_function_action_into_source = $parameters['javascript_function_action_into_source'];
|
||||||
|
$javascript_function_action_into_source_js_call =
|
||||||
|
$javascript_function_action_into_source . '();';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($parameters['javascript_function_action_into_source_js_call'])) {
|
||||||
|
if ($javascript_function_action_into_source_js_call !=
|
||||||
|
$parameters['javascript_function_action_into_source_js_call']) {
|
||||||
|
$javascript_function_action_into_source_js_call =
|
||||||
|
$parameters['javascript_function_action_into_source_js_call'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$javascript = true; //Default value
|
$javascript = true; //Default value
|
||||||
if (isset($parameters['javascript'])) {
|
if (isset($parameters['javascript'])) {
|
||||||
$javascript = $parameters['javascript'];
|
$javascript = $parameters['javascript'];
|
||||||
@ -2205,6 +2237,53 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
$javascript_page = $parameters['javascript_page'];
|
$javascript_page = $parameters['javascript_page'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$javascript_change_ajax_params_original = array('page' => '"' . $javascript_page . '"',
|
||||||
|
'search_agents_2' => 1,
|
||||||
|
'id_group' => 'function() {
|
||||||
|
var group_id = 0;
|
||||||
|
|
||||||
|
if (' . ((int)!empty($selectbox_group)) . ') {
|
||||||
|
group_id = $("#' . $selectbox_group . '").val();
|
||||||
|
}
|
||||||
|
|
||||||
|
return group_id;
|
||||||
|
}',
|
||||||
|
'q' => 'term');
|
||||||
|
if (isset($parameters['javascript_change_ajax_params'])) {
|
||||||
|
$javascript_change_ajax_params = array();
|
||||||
|
|
||||||
|
$found_page = false;
|
||||||
|
foreach ($parameters['javascript_change_ajax_params'] as $key => $param_ajax) {
|
||||||
|
if ($key == 'page') {
|
||||||
|
$found_page = true;
|
||||||
|
if ($javascript_page != $param_ajax) {
|
||||||
|
$javascript_change_ajax_params['page'] = $param_ajax;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$javascript_change_ajax_params['page'] = $javascript_page;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$javascript_change_ajax_params[$key] = $param_ajax;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$found_page) {
|
||||||
|
$javascript_change_ajax_params['page'] = $javascript_page;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$javascript_change_ajax_params = $javascript_change_ajax_params_original;
|
||||||
|
}
|
||||||
|
$first = true;
|
||||||
|
$javascript_change_ajax_params_text = 'var data_params = {';
|
||||||
|
foreach ($javascript_change_ajax_params as $key => $param_ajax) {
|
||||||
|
if (!$first) $javascript_change_ajax_params_text .= ",\n";
|
||||||
|
else $first = false;
|
||||||
|
$javascript_change_ajax_params_text .= '"' . $key . '":' . $param_ajax;
|
||||||
|
}
|
||||||
|
$javascript_change_ajax_params_text .= '};';
|
||||||
|
|
||||||
$javascript_function_change ='';
|
$javascript_function_change ='';
|
||||||
$javascript_function_change .='
|
$javascript_function_change .='
|
||||||
function set_functions_change_autocomplete_' . $input_name . '() {
|
function set_functions_change_autocomplete_' . $input_name . '() {
|
||||||
@ -2213,19 +2292,13 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
source: function( request, response ) {
|
source: function( request, response ) {
|
||||||
var term = request.term; //Word to search
|
var term = request.term; //Word to search
|
||||||
|
|
||||||
var data_params = {
|
' . $javascript_change_ajax_params_text . '
|
||||||
"page": "' . $javascript_page . '",
|
|
||||||
"search_agents_2": 1,
|
|
||||||
id_group: function() {
|
|
||||||
var group_id = 0;
|
|
||||||
|
|
||||||
if (' . ((int)!empty($selectbox_group)) . ') {
|
//Function to call when the source
|
||||||
group_id = $("#' . $selectbox_group . '").val();
|
if (' . ((int)!empty($javascript_function_action_into_source_js_call)) . ') {
|
||||||
|
' . $javascript_function_action_into_source_js_call . '
|
||||||
}
|
}
|
||||||
|
|
||||||
return group_id;
|
|
||||||
},
|
|
||||||
"q": term};
|
|
||||||
|
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: data_params,
|
data: data_params,
|
||||||
@ -2260,10 +2333,16 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
$("#' . $hidden_input_idagent_id . '").val(agent_id);
|
$("#' . $hidden_input_idagent_id . '").val(agent_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Put the server id into the hidden input
|
||||||
if (' . ((int)$use_input_server) . ') {
|
if (' . ((int)$use_input_server) . ') {
|
||||||
$("#' . $input_server_id . '").val(server_name);
|
$("#' . $input_server_id . '").val(server_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Function to call after the select
|
||||||
|
if (' . ((int)!empty($javascript_function_action_after_select_js_call)) . ') {
|
||||||
|
' . $javascript_function_action_after_select_js_call . '
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -101,10 +101,20 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$form_items['agent_row']['items'] = array('static_graph',
|
$form_items['agent_row']['items'] = array('static_graph',
|
||||||
'percentile_bar', 'percentile_item', 'module_graph',
|
'percentile_bar', 'percentile_item', 'module_graph',
|
||||||
'simple_value', 'datos');
|
'simple_value', 'datos');
|
||||||
$form_items['agent_row']['html'] = '<td>' . __('Agent') .
|
$form_items['agent_row']['html'] = '<td>' . __('Agent') . '</td>';
|
||||||
'<a href="#" class="tip"> <span>' . __("Type at least two characters to search.") . '</span></a>' . '</td>
|
|
||||||
<td>' . html_print_input_text_extended ('agent', '', 'text-agent', '', 25, 100, false, '',
|
|
||||||
array('style' => 'background: #ffffff url(images/lightning.png) no-repeat right;'), true) . '</td>';
|
|
||||||
|
$params = array();
|
||||||
|
$params['return'] = true;
|
||||||
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent';
|
||||||
|
$params['size'] = 20;
|
||||||
|
$params['selectbox_id'] = 'module';
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$form_items['agent_row']['html'] .= '<td>' . ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$form_items['module_row'] = array();
|
$form_items['module_row'] = array();
|
||||||
$form_items['module_row']['items'] = array('static_graph',
|
$form_items['module_row']['items'] = array('static_graph',
|
||||||
|
@ -68,9 +68,9 @@ if (!empty ($module)) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
// Starts, ends and dividers
|
// Starts, ends and dividers
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
|
|
||||||
//Excel is tab-delimited, needs quotes and needs Windows-style newlines
|
//Excel is tab-delimited, needs quotes and needs Windows-style newlines
|
||||||
$datastart = __('Agent')."\t".__('Module')."\t".__('Data')."\t".__('Timestamp')."\r\n";
|
$datastart = __('Agent')."\t".__('Module')."\t".__('Data')."\t".__('Timestamp')."\r\n";
|
||||||
@ -80,9 +80,9 @@ if (!empty ($module)) {
|
|||||||
$dataend = "\r\n";
|
$dataend = "\r\n";
|
||||||
$extension = "xls";
|
$extension = "xls";
|
||||||
|
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
// Header output
|
// Header output
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
|
|
||||||
$config['ignore_callback'] = true;
|
$config['ignore_callback'] = true;
|
||||||
while (@ob_end_clean ());
|
while (@ob_end_clean ());
|
||||||
@ -92,9 +92,9 @@ if (!empty ($module)) {
|
|||||||
header("Pragma: no-cache");
|
header("Pragma: no-cache");
|
||||||
header("Expires: 0");
|
header("Expires: 0");
|
||||||
|
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
// Data processing
|
// Data processing
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
@ -162,5 +162,4 @@ if (!empty ($module)) {
|
|||||||
else {
|
else {
|
||||||
ui_print_error_message (__('No modules specified'));
|
ui_print_error_message (__('No modules specified'));
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -79,7 +79,6 @@ if (!empty ($export_btn) && !empty ($module)) {
|
|||||||
//******************************************************************
|
//******************************************************************
|
||||||
// Starts, ends and dividers
|
// Starts, ends and dividers
|
||||||
//******************************************************************
|
//******************************************************************
|
||||||
|
|
||||||
switch ($export_type) {
|
switch ($export_type) {
|
||||||
case "data":
|
case "data":
|
||||||
case "avg":
|
case "avg":
|
||||||
@ -96,7 +95,6 @@ if (!empty ($export_btn) && !empty ($module)) {
|
|||||||
//******************************************************************
|
//******************************************************************
|
||||||
// Data processing
|
// Data processing
|
||||||
//******************************************************************
|
//******************************************************************
|
||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
switch ($export_type) {
|
switch ($export_type) {
|
||||||
case "data":
|
case "data":
|
||||||
|
@ -143,7 +143,8 @@ switch ($opt) {
|
|||||||
$returnJSON['content'] .= __('Start contact') . ': ' . $row['start_timestamp'] . '<br />';
|
$returnJSON['content'] .= __('Start contact') . ': ' . $row['start_timestamp'] . '<br />';
|
||||||
$returnJSON['content'] .= __('Last contact') . ': ' . $row['end_timestamp'] . '<br />';
|
$returnJSON['content'] .= __('Last contact') . ': ' . $row['end_timestamp'] . '<br />';
|
||||||
$returnJSON['content'] .= __('Num reports') . ': '.$row['number_of_packages'].'<br />';
|
$returnJSON['content'] .= __('Num reports') . ': '.$row['number_of_packages'].'<br />';
|
||||||
if ($row['manual_placemen']) $returnJSON['content'] .= '<br />' . __('Manual placement') . '<br />';
|
if ($row['manual_placemen'])
|
||||||
|
$returnJSON['content'] .= '<br />' . __('Manual placement') . '<br />';
|
||||||
|
|
||||||
echo json_encode($returnJSON);
|
echo json_encode($returnJSON);
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@ elseif ($action == "update") {
|
|||||||
ui_print_result_message ($result,
|
ui_print_result_message ($result,
|
||||||
__('Successfully updated'),
|
__('Successfully updated'),
|
||||||
__('Could not be updated'));
|
__('Could not be updated'));
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($action == "insert") {
|
elseif ($action == "insert") {
|
||||||
//Create incident
|
//Create incident
|
||||||
@ -366,7 +365,9 @@ else {
|
|||||||
echo '</form>';
|
echo '</form>';
|
||||||
unset ($table);
|
unset ($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<br><br>';
|
echo '<br><br>';
|
||||||
|
|
||||||
if (check_acl ($config["id_user"], 0, "IW")) {
|
if (check_acl ($config["id_user"], 0, "IW")) {
|
||||||
echo '<div style="text-align:right; float:right; padding-right: 2px;">';
|
echo '<div style="text-align:right; float:right; padding-right: 2px;">';
|
||||||
echo '<form method="post" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form=1">';
|
echo '<form method="post" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form=1">';
|
||||||
|
@ -221,7 +221,6 @@ echo "</form>";
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function check_all_checkboxes() {
|
function check_all_checkboxes() {
|
||||||
if ($("input[name=all_delete]").attr('checked')) {
|
if ($("input[name=all_delete]").attr('checked')) {
|
||||||
$(".check_delete").attr('checked', true);
|
$(".check_delete").attr('checked', true);
|
||||||
@ -230,5 +229,4 @@ function check_all_checkboxes() {
|
|||||||
$(".check_delete").attr('checked', false);
|
$(".check_delete").attr('checked', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user