mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +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">
|
||||||
@ -517,7 +527,7 @@ function refreshMapView() {
|
|||||||
$("#map").html('');
|
$("#map").html('');
|
||||||
|
|
||||||
id_connection_default = $("input[name=map_connection_default]:checked").val();
|
id_connection_default = $("input[name=map_connection_default]:checked").val();
|
||||||
|
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: "page=operation/gis_maps/ajax&opt=get_map_connection_data&id_connection=" + id_connection_default,
|
data: "page=operation/gis_maps/ajax&opt=get_map_connection_data&id_connection=" + id_connection_default,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@ -538,7 +548,7 @@ function refreshMapView() {
|
|||||||
center_latitude = mapConnection['initial_latitude'];
|
center_latitude = mapConnection['initial_latitude'];
|
||||||
center_longitude = mapConnection['initial_longitude'];
|
center_longitude = mapConnection['initial_longitude'];
|
||||||
center_altitude = mapConnection['initial_altitude'];
|
center_altitude = mapConnection['initial_altitude'];
|
||||||
|
|
||||||
baseLayer = jQuery.evalJSON(mapConnection['conection_data']);
|
baseLayer = jQuery.evalJSON(mapConnection['conection_data']);
|
||||||
|
|
||||||
var objBaseLayers = Array();
|
var objBaseLayers = Array();
|
||||||
@ -546,43 +556,16 @@ function refreshMapView() {
|
|||||||
objBaseLayers[0]['type'] = baseLayer['type'];
|
objBaseLayers[0]['type'] = baseLayer['type'];
|
||||||
objBaseLayers[0]['name'] = mapConnection['conection_name'];
|
objBaseLayers[0]['name'] = mapConnection['conection_name'];
|
||||||
objBaseLayers[0]['url'] = baseLayer['url'];
|
objBaseLayers[0]['url'] = baseLayer['url'];
|
||||||
|
|
||||||
js_printMap('map', inital_zoom, center_latitude, center_longitude, objBaseLayers, arrayControls);
|
js_printMap('map', inital_zoom, center_latitude, center_longitude, objBaseLayers, arrayControls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#text_id_agent").autocomplete(
|
function active_button_add_agent() {
|
||||||
"ajax.php",
|
$("#button-add_agent").removeAttr('disabled');
|
||||||
{
|
}
|
||||||
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');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
function loadAgents(agent_list) {
|
function loadAgents(agent_list) {
|
||||||
if (agent_list != null) {
|
if (agent_list != null) {
|
||||||
@ -614,7 +597,7 @@ function deleteLayer(idRow) {
|
|||||||
$("#hidden-layer_edit_id_form").val('');
|
$("#hidden-layer_edit_id_form").val('');
|
||||||
|
|
||||||
for (var index in layerList) {
|
for (var index in layerList) {
|
||||||
|
|
||||||
//int because in the object array there are method as string
|
//int because in the object array there are method as string
|
||||||
if (isInt(index)) {
|
if (isInt(index)) {
|
||||||
if (layerList[index] == idRow) {
|
if (layerList[index] == idRow) {
|
||||||
@ -622,9 +605,9 @@ function deleteLayer(idRow) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateArrowLayers();
|
updateArrowLayers();
|
||||||
|
|
||||||
//If delete the layer in edit progress, must clean the form.
|
//If delete the layer in edit progress, must clean the form.
|
||||||
if ($("#hidden-layer_edit_id_form").val() == idRow) {
|
if ($("#hidden-layer_edit_id_form").val() == idRow) {
|
||||||
$("#form_layer_table").css('visibility', 'hidden');
|
$("#form_layer_table").css('visibility', 'hidden');
|
||||||
@ -656,7 +639,7 @@ function serializeForm() {
|
|||||||
else
|
else
|
||||||
layer.layer_visible = 0;
|
layer.layer_visible = 0;
|
||||||
layer.layer_agent_list = Array();
|
layer.layer_agent_list = Array();
|
||||||
|
|
||||||
for (var index2 in agentList) {
|
for (var index2 in agentList) {
|
||||||
if (isInt(index2)) {
|
if (isInt(index2)) {
|
||||||
layer.layer_agent_list[index2] = $("#name_agent_" + agentList[index2]).val();
|
layer.layer_agent_list[index2] = $("#name_agent_" + agentList[index2]).val();
|
||||||
@ -669,15 +652,15 @@ function serializeForm() {
|
|||||||
function editLayer(indexLayer) {
|
function editLayer(indexLayer) {
|
||||||
agentList = Array();
|
agentList = Array();
|
||||||
countAgentList = 0;
|
countAgentList = 0;
|
||||||
|
|
||||||
stringValuesLayer = $("#layer_values_" + indexLayer).val();
|
stringValuesLayer = $("#layer_values_" + indexLayer).val();
|
||||||
layer = $.evalJSON(stringValuesLayer);
|
layer = $.evalJSON(stringValuesLayer);
|
||||||
|
|
||||||
setFieldsFormLayer(layer.layer_name, layer.layer_group, layer.layer_visible, layer.layer_agent_list);
|
setFieldsFormLayer(layer.layer_name, layer.layer_group, layer.layer_visible, layer.layer_agent_list);
|
||||||
$("#hidden-layer_edit_id_form").val(indexLayer);
|
$("#hidden-layer_edit_id_form").val(indexLayer);
|
||||||
|
|
||||||
$("input[name=save_layer]").val('<?php echo __("Update Layer"); ?>');
|
$("input[name=save_layer]").val('<?php echo __("Update Layer"); ?>');
|
||||||
|
|
||||||
$("#form_layer_table").css('visibility', 'visible');
|
$("#form_layer_table").css('visibility', 'visible');
|
||||||
|
|
||||||
hightlightRow(indexLayer);
|
hightlightRow(indexLayer);
|
||||||
@ -700,7 +683,7 @@ function hightlightRow(idLayer) {
|
|||||||
|
|
||||||
function saveLayer() {
|
function saveLayer() {
|
||||||
layer_id = $("#hidden-layer_edit_id_form").val();
|
layer_id = $("#hidden-layer_edit_id_form").val();
|
||||||
|
|
||||||
if (layer_id == '') {
|
if (layer_id == '') {
|
||||||
id = countLayer;
|
id = countLayer;
|
||||||
tableRow = $("#chuck_layer_item").clone();
|
tableRow = $("#chuck_layer_item").clone();
|
||||||
@ -712,7 +695,7 @@ function saveLayer() {
|
|||||||
id = layer_id;
|
id = layer_id;
|
||||||
tableRow = $("#layer_item_" + id);
|
tableRow = $("#layer_item_" + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".col1", tableRow).html($("#text-layer_name_form").val());
|
$(".col1", tableRow).html($("#text-layer_name_form").val());
|
||||||
$("#edit_layer", tableRow).attr("href", "javascript: editLayer(" + id + ");");
|
$("#edit_layer", tableRow).attr("href", "javascript: editLayer(" + id + ");");
|
||||||
$("#delete_row", tableRow).attr("href", "javascript: deleteLayer(" + id + ")");
|
$("#delete_row", tableRow).attr("href", "javascript: deleteLayer(" + id + ")");
|
||||||
@ -720,17 +703,17 @@ function saveLayer() {
|
|||||||
$("#down_arrow", tableRow).attr("href", "javascript: downLayer(" + id + ")");
|
$("#down_arrow", tableRow).attr("href", "javascript: downLayer(" + id + ")");
|
||||||
|
|
||||||
$("#layer_values_" + id, tableRow).val(serializeForm());
|
$("#layer_values_" + id, tableRow).val(serializeForm());
|
||||||
|
|
||||||
if (layer_id == '') {
|
if (layer_id == '') {
|
||||||
$("#list_layers").append(tableRow);
|
$("#list_layers").append(tableRow);
|
||||||
layerList.push(countLayer);
|
layerList.push(countLayer);
|
||||||
|
|
||||||
countLayer++;
|
countLayer++;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateArrowLayers();
|
updateArrowLayers();
|
||||||
hightlightRow(id);
|
hightlightRow(id);
|
||||||
|
|
||||||
editLayer(id);
|
editLayer(id);
|
||||||
$("input[name=save_layer]").val('<?php echo __("Update Layer"); ?>');
|
$("input[name=save_layer]").val('<?php echo __("Update Layer"); ?>');
|
||||||
}
|
}
|
||||||
@ -750,13 +733,13 @@ 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();
|
||||||
|
|
||||||
tableRow.attr('id','agent_' + countAgentList);
|
tableRow.attr('id','agent_' + countAgentList);
|
||||||
agentList.push(countAgentList);
|
agentList.push(countAgentList);
|
||||||
|
|
||||||
$(".col1", tableRow).html(agent_name);
|
$(".col1", tableRow).html(agent_name);
|
||||||
$("#delete_row", tableRow).attr("href", 'javascript: deleteAgentLayer(' + countAgentList + ')');
|
$("#delete_row", tableRow).attr("href", 'javascript: deleteAgentLayer(' + countAgentList + ')');
|
||||||
$("#name_agent", tableRow).val(agent_name);
|
$("#name_agent", tableRow).val(agent_name);
|
||||||
@ -771,7 +754,7 @@ function addAgentLayer(agent_name) {
|
|||||||
|
|
||||||
function deleteConnectionMap(idConnectionMap) {
|
function deleteConnectionMap(idConnectionMap) {
|
||||||
for (var index in connectionMaps) {
|
for (var index in connectionMaps) {
|
||||||
|
|
||||||
//int because in the object array there are method as string
|
//int because in the object array there are method as string
|
||||||
if (isInt(index)) {
|
if (isInt(index)) {
|
||||||
if (connectionMaps[index] == idConnectionMap) {
|
if (connectionMaps[index] == idConnectionMap) {
|
||||||
@ -779,15 +762,15 @@ function deleteConnectionMap(idConnectionMap) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked');
|
checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked');
|
||||||
$("#map_connection_" + idConnectionMap).remove();
|
$("#map_connection_" + idConnectionMap).remove();
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
//Checked first, but not is index = 0 maybe.
|
//Checked first, but not is index = 0 maybe.
|
||||||
|
|
||||||
for (var index in connectionMaps) {
|
for (var index in connectionMaps) {
|
||||||
|
|
||||||
//int because in the object array there are method as string
|
//int because in the object array there are method as string
|
||||||
if (isInt(index)) {
|
if (isInt(index)) {
|
||||||
$("#radiobtn0001", $("#map_connection_" + connectionMaps[index])).attr('checked', 'checked');
|
$("#radiobtn0001", $("#map_connection_" + connectionMaps[index])).attr('checked', 'checked');
|
||||||
@ -829,7 +812,7 @@ function changeDefaultConection(id) {
|
|||||||
function addConnectionMap() {
|
function addConnectionMap() {
|
||||||
idConnectionMap = $("#map_connection :selected").val();
|
idConnectionMap = $("#map_connection :selected").val();
|
||||||
connectionMapName = $("#map_connection :selected").text();
|
connectionMapName = $("#map_connection :selected").text();
|
||||||
|
|
||||||
//Test if before just added
|
//Test if before just added
|
||||||
for (var index in connectionMaps) {
|
for (var index in connectionMaps) {
|
||||||
if (isInt(index)) {
|
if (isInt(index)) {
|
||||||
@ -848,11 +831,11 @@ function addConnectionMap() {
|
|||||||
if (connectionMaps.length == 0) {
|
if (connectionMaps.length == 0) {
|
||||||
//The first is checked
|
//The first is checked
|
||||||
$("#radiobtn0001", tableRows).attr('checked', 'checked');
|
$("#radiobtn0001", tableRows).attr('checked', 'checked');
|
||||||
|
|
||||||
//Set the fields with conexion data (in ajax)
|
//Set the fields with conexion data (in ajax)
|
||||||
setFieldsRequestAjax(idConnectionMap);
|
setFieldsRequestAjax(idConnectionMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
connectionMaps.push(idConnectionMap);
|
connectionMaps.push(idConnectionMap);
|
||||||
|
|
||||||
$("#text-map_connection_name", tableRows).val(connectionMapName);
|
$("#text-map_connection_name", tableRows).val(connectionMapName);
|
||||||
@ -872,7 +855,7 @@ function upLayer(idLayer) {
|
|||||||
var toDownIndex = null;
|
var toDownIndex = null;
|
||||||
|
|
||||||
for (var index in layerList) {
|
for (var index in layerList) {
|
||||||
|
|
||||||
//int because in the object array there are method as string
|
//int because in the object array there are method as string
|
||||||
if (isInt(index)) {
|
if (isInt(index)) {
|
||||||
toUpIndex = index;
|
toUpIndex = index;
|
||||||
@ -890,7 +873,7 @@ function upLayer(idLayer) {
|
|||||||
temp = layerList[toUpIndex];
|
temp = layerList[toUpIndex];
|
||||||
layerList[toUpIndex] = layerList[toDownIndex];
|
layerList[toUpIndex] = layerList[toDownIndex];
|
||||||
layerList[toDownIndex] = temp;
|
layerList[toDownIndex] = temp;
|
||||||
|
|
||||||
updateArrowLayers();
|
updateArrowLayers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -924,8 +907,8 @@ function downLayer(idLayer) {
|
|||||||
temp = layerList[toUpIndex];
|
temp = layerList[toUpIndex];
|
||||||
layerList[toUpIndex] = layerList[toDownIndex];
|
layerList[toUpIndex] = layerList[toDownIndex];
|
||||||
layerList[toDownIndex] = temp;
|
layerList[toDownIndex] = temp;
|
||||||
|
|
||||||
updateArrowLayers();
|
updateArrowLayers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -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,
|
//Function to call when the source
|
||||||
id_group: function() {
|
if (' . ((int)!empty($javascript_function_action_into_source_js_call)) . ') {
|
||||||
var group_id = 0;
|
' . $javascript_function_action_into_source_js_call . '
|
||||||
|
}
|
||||||
if (' . ((int)!empty($selectbox_group)) . ') {
|
|
||||||
group_id = $("#' . $selectbox_group . '").val();
|
|
||||||
}
|
|
||||||
|
|
||||||
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',
|
||||||
|
@ -50,28 +50,28 @@ $export_type = get_parameter_post ('export_type', 'data');
|
|||||||
$export_btn = get_parameter_post ('export_btn', 0);
|
$export_btn = get_parameter_post ('export_btn', 0);
|
||||||
|
|
||||||
if (!empty ($module)) {
|
if (!empty ($module)) {
|
||||||
|
|
||||||
// Disable SQL cache
|
// Disable SQL cache
|
||||||
global $sql_cache;
|
global $sql_cache;
|
||||||
$sql_cache = array ('saved' => 0);
|
$sql_cache = array ('saved' => 0);
|
||||||
|
|
||||||
|
|
||||||
//Convert start time and end time to unix timestamps
|
//Convert start time and end time to unix timestamps
|
||||||
$start = strtotime ($start_date." ".$start_time);
|
$start = strtotime ($start_date." ".$start_time);
|
||||||
$end = strtotime ($end_date." ".$end_time);
|
$end = strtotime ($end_date." ".$end_time);
|
||||||
$period = $end - $start;
|
$period = $end - $start;
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
//If time is negative or zero, don't process - it's invalid
|
//If time is negative or zero, don't process - it's invalid
|
||||||
if ($start < 1 || $end < 1) {
|
if ($start < 1 || $end < 1) {
|
||||||
ui_print_error_message (__('Invalid time specified'));
|
ui_print_error_message (__('Invalid time specified'));
|
||||||
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";
|
||||||
$rowstart = '"';
|
$rowstart = '"';
|
||||||
@ -80,10 +80,10 @@ 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 ());
|
||||||
|
|
||||||
@ -91,29 +91,29 @@ if (!empty ($module)) {
|
|||||||
header("Content-Disposition: attachment; filename=export_".date("Ymd", $start)."_".date("Ymd", $end).".".$extension);
|
header("Content-Disposition: attachment; filename=export_".date("Ymd", $start)."_".date("Ymd", $end).".".$extension);
|
||||||
header("Pragma: no-cache");
|
header("Pragma: no-cache");
|
||||||
header("Expires: 0");
|
header("Expires: 0");
|
||||||
|
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
// Data processing
|
// Data processing
|
||||||
// ***************************************************
|
//******************************************************************
|
||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
// Show header
|
// Show header
|
||||||
echo $datastart;
|
echo $datastart;
|
||||||
|
|
||||||
foreach ($module as $selected) {
|
foreach ($module as $selected) {
|
||||||
|
|
||||||
$output = "";
|
$output = "";
|
||||||
$work_period = 120000;
|
$work_period = 120000;
|
||||||
if ($work_period > $period) {
|
if ($work_period > $period) {
|
||||||
$work_period = $period;
|
$work_period = $period;
|
||||||
}
|
}
|
||||||
|
|
||||||
$work_end = $end - $period + $work_period;
|
$work_end = $end - $period + $work_period;
|
||||||
//Buffer to get data, anyway this will report a memory exhaustin
|
//Buffer to get data, anyway this will report a memory exhaustin
|
||||||
|
|
||||||
while ($work_end <= $end) {
|
while ($work_end <= $end) {
|
||||||
|
|
||||||
$data = array (); // Reinitialize array for each module chunk
|
$data = array (); // Reinitialize array for each module chunk
|
||||||
if ($export_type == "avg") {
|
if ($export_type == "avg") {
|
||||||
$arr = array ();
|
$arr = array ();
|
||||||
@ -157,10 +157,9 @@ if (!empty ($module)) {
|
|||||||
unset ($output);
|
unset ($output);
|
||||||
$output = "";
|
$output = "";
|
||||||
} // main foreach
|
} // main foreach
|
||||||
echo $dataend;
|
echo $dataend;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui_print_error_message (__('No modules specified'));
|
ui_print_error_message (__('No modules specified'));
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
?>
|
|
@ -68,7 +68,7 @@ if (!empty ($export_btn) && !empty ($module)) {
|
|||||||
$start = strtotime ($start_date." ".$start_time);
|
$start = strtotime ($start_date." ".$start_time);
|
||||||
$end = strtotime ($end_date." ".$end_time);
|
$end = strtotime ($end_date." ".$end_time);
|
||||||
$period = $end - $start;
|
$period = $end - $start;
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
//If time is negative or zero, don't process - it's invalid
|
//If time is negative or zero, don't process - it's invalid
|
||||||
if ($start < 1 || $end < 1) {
|
if ($start < 1 || $end < 1) {
|
||||||
@ -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":
|
||||||
|
@ -803,23 +803,23 @@ switch($tab) {
|
|||||||
break;
|
break;
|
||||||
case "inventory":
|
case "inventory":
|
||||||
$header_description = ' - ' . __('Inventory');
|
$header_description = ' - ' . __('Inventory');
|
||||||
break;
|
break;
|
||||||
case "collection":
|
case "collection":
|
||||||
$header_description = ' - ' . __('Collection');
|
$header_description = ' - ' . __('Collection');
|
||||||
break;
|
break;
|
||||||
case "gis":
|
case "gis":
|
||||||
$header_description = ' - ' . __('Gis');
|
$header_description = ' - ' . __('Gis');
|
||||||
break;
|
break;
|
||||||
case "custom_fields":
|
case "custom_fields":
|
||||||
$header_description = ' - ' . __('Custom fields');
|
$header_description = ' - ' . __('Custom fields');
|
||||||
break;
|
break;
|
||||||
case "graphs":
|
case "graphs":
|
||||||
$header_description = ' - ' . __('Graphs');
|
$header_description = ' - ' . __('Graphs');
|
||||||
break;
|
break;
|
||||||
case "policy":
|
case "policy":
|
||||||
$header_description = ' - ' . __('Policy');
|
$header_description = ' - ' . __('Policy');
|
||||||
break;
|
break;
|
||||||
case "incident":
|
case "incident":
|
||||||
$header_description = ' - ' . __('Incident');
|
$header_description = ' - ' . __('Incident');
|
||||||
break;
|
break;
|
||||||
case "url_address":
|
case "url_address":
|
||||||
|
@ -70,13 +70,13 @@ foreach($ids as $key => $id) {
|
|||||||
case 1:
|
case 1:
|
||||||
$img_st = "images/tick.png";
|
$img_st = "images/tick.png";
|
||||||
$title_st = __('Event validated');
|
$title_st = __('Event validated');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$img_st = "images/hourglass.png";
|
$img_st = "images/hourglass.png";
|
||||||
$title_st = __('Event in process');
|
$title_st = __('Event in process');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$icon = html_print_image ($img_st, true,
|
$icon = html_print_image ($img_st, true,
|
||||||
array ("class" => "image_status",
|
array ("class" => "image_status",
|
||||||
"width" => 16,
|
"width" => 16,
|
||||||
@ -112,7 +112,7 @@ $string .= '</td><td width="400px">';
|
|||||||
if($any_alert) {
|
if($any_alert) {
|
||||||
$string .= '<div class="standby_alert_checkbox" style="display: none">'.__('Set alert on standby').'<br>'.html_print_checkbox('standby-alert', 'ff2', false, true).'</div>';
|
$string .= '<div class="standby_alert_checkbox" style="display: none">'.__('Set alert on standby').'<br>'.html_print_checkbox('standby-alert', 'ff2', false, true).'</div>';
|
||||||
}
|
}
|
||||||
$string .= '</td></tr></table></form>';
|
$string .= '</td></tr></table></form>';
|
||||||
|
|
||||||
echo $string;
|
echo $string;
|
||||||
|
|
||||||
|
@ -139,11 +139,12 @@ switch ($opt) {
|
|||||||
$returnJSON = array();
|
$returnJSON = array();
|
||||||
$returnJSON['correct'] = 1;
|
$returnJSON['correct'] = 1;
|
||||||
$returnJSON['content'] = __('Agent') . ': <a style="font-weight: bolder;" href="?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $row['tagente_id_agente'] . '">'.agents_get_name($row['tagente_id_agente']).'</a><br />';
|
$returnJSON['content'] = __('Agent') . ': <a style="font-weight: bolder;" href="?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $row['tagente_id_agente'] . '">'.agents_get_name($row['tagente_id_agente']).'</a><br />';
|
||||||
$returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $row['longitude'] . ', ' . $row['latitude'] . ', ' . $row['altitude'] . ') <br />';
|
$returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $row['longitude'] . ', ' . $row['latitude'] . ', ' . $row['altitude'] . ') <br />';
|
||||||
$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);
|
||||||
|
|
||||||
|
@ -91,9 +91,9 @@ elseif ($action == "update") {
|
|||||||
$id_agent = get_parameter ("id_agent");
|
$id_agent = get_parameter ("id_agent");
|
||||||
|
|
||||||
$sql = sprintf ("UPDATE tincidencia SET titulo = '%s', origen = '%s', estado = %d, id_grupo = %d, id_usuario = '%s', prioridad = %d, descripcion = '%s', id_lastupdate = '%s', id_agent = %d WHERE id_incidencia = %d",
|
$sql = sprintf ("UPDATE tincidencia SET titulo = '%s', origen = '%s', estado = %d, id_grupo = %d, id_usuario = '%s', prioridad = %d, descripcion = '%s', id_lastupdate = '%s', id_agent = %d WHERE id_incidencia = %d",
|
||||||
$titulo, $origen, $estado, $grupo, $usuario, $prioridad, $descripcion, $config["id_user"], $id_agent, $id_inc);
|
$titulo, $origen, $estado, $grupo, $usuario, $prioridad, $descripcion, $config["id_user"], $id_agent, $id_inc);
|
||||||
$result = db_process_sql ($sql);
|
$result = db_process_sql ($sql);
|
||||||
|
|
||||||
if ($result !== false) {
|
if ($result !== false) {
|
||||||
db_pandora_audit("Incident updated","User ".$config['id_user']." updated incident #".$id_inc);
|
db_pandora_audit("Incident updated","User ".$config['id_user']." updated incident #".$id_inc);
|
||||||
}
|
}
|
||||||
@ -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
|
||||||
@ -112,7 +111,7 @@ elseif ($action == "insert") {
|
|||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read input variables
|
// Read input variables
|
||||||
$titulo = get_parameter ("titulo");
|
$titulo = get_parameter ("titulo");
|
||||||
$titulo = io_safe_input(strip_tags(io_safe_output($titulo)));
|
$titulo = io_safe_input(strip_tags(io_safe_output($titulo)));
|
||||||
@ -123,11 +122,11 @@ elseif ($action == "insert") {
|
|||||||
$estado = get_parameter ("estado_form");
|
$estado = get_parameter ("estado_form");
|
||||||
$id_agent = get_parameter ("id_agent");
|
$id_agent = get_parameter ("id_agent");
|
||||||
$sql = sprintf ("INSERT INTO tincidencia (inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator, id_agent, id_agente_modulo) VALUES
|
$sql = sprintf ("INSERT INTO tincidencia (inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator, id_agent, id_agente_modulo) VALUES
|
||||||
(NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0)", $titulo, $descripcion, $config["id_user"], $origen, $estado, $prioridad, $grupo, $config["id_user"], $id_agent);
|
(NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0)", $titulo, $descripcion, $config["id_user"], $origen, $estado, $prioridad, $grupo, $config["id_user"], $id_agent);
|
||||||
$id_inc = db_process_sql ($sql, "insert_id");
|
$id_inc = db_process_sql ($sql, "insert_id");
|
||||||
|
|
||||||
if ($id_inc === false) {
|
if ($id_inc === false) {
|
||||||
echo '<h3 class="error">'.__('Error creating incident').'</h3>';
|
echo '<h3 class="error">'.__('Error creating incident').'</h3>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
db_pandora_audit("Incident created", "User ".$config["id_user"]." created incident #".$id_inc);
|
db_pandora_audit("Incident created", "User ".$config["id_user"]." created incident #".$id_inc);
|
||||||
@ -254,7 +253,7 @@ html_print_select_groups($config["id_user"], "IR", true, "grupo", $grupo, 'javas
|
|||||||
|
|
||||||
echo " ";
|
echo " ";
|
||||||
|
|
||||||
html_print_input_text ('texto', $texto, '', 45);
|
html_print_input_text ('texto', $texto, '', 45);
|
||||||
echo ' ';
|
echo ' ';
|
||||||
html_print_input_image ("submit", "images/zoom.png", __('Search'), 'padding:0;', false, array ("alt" => __('Search')));
|
html_print_input_image ("submit", "images/zoom.png", __('Search'), 'padding:0;', false, array ("alt" => __('Search')));
|
||||||
|
|
||||||
@ -283,7 +282,7 @@ else {
|
|||||||
$url .= "&texto=".$texto;
|
$url .= "&texto=".$texto;
|
||||||
|
|
||||||
// Show pagination
|
// Show pagination
|
||||||
ui_pagination ($count, $url, $offset, 0, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
|
ui_pagination ($count, $url, $offset, 0, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
|
||||||
// Show headers
|
// Show headers
|
||||||
@ -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">';
|
||||||
@ -375,4 +376,4 @@ if (check_acl ($config["id_user"], 0, "IW")) {
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
echo '<div style="clear:both"> </div>';
|
echo '<div style="clear:both"> </div>';
|
||||||
?>
|
?>
|
@ -137,7 +137,7 @@ if (($new_msg) && (!empty ($dst_user)) && (!$reply)) {
|
|||||||
// Create message (destination group)
|
// Create message (destination group)
|
||||||
if (($new_msg) && ($dst_group!='') && (!$reply)) {
|
if (($new_msg) && ($dst_group!='') && (!$reply)) {
|
||||||
$return = messages_create_group ($config["id_user"], $dst_group, $subject, $message);
|
$return = messages_create_group ($config["id_user"], $dst_group, $subject, $message);
|
||||||
|
|
||||||
ui_print_result_message ($return,
|
ui_print_result_message ($return,
|
||||||
__('Message successfully sent'),
|
__('Message successfully sent'),
|
||||||
__('Error sending message to group %s', groups_get_name ($dst_group)));
|
__('Error sending message to group %s', groups_get_name ($dst_group)));
|
||||||
@ -172,7 +172,7 @@ foreach ($users_full as $user_id => $user_info) {
|
|||||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
||||||
$return_all_groups = true;
|
$return_all_groups = true;
|
||||||
else
|
else
|
||||||
$return_all_groups = false;
|
$return_all_groups = false;
|
||||||
|
|
||||||
$groups = users_get_groups ($config["id_user"], "AR"); //Get a list of all groups
|
$groups = users_get_groups ($config["id_user"], "AR"); //Get a list of all groups
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ echo '<form method="post" action="index.php?sec=workspace&sec2=operation/mes
|
|||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
html_print_submit_button (__('Send message'), 'send_mes', false, 'class="sub wand"');
|
html_print_submit_button (__('Send message'), 'send_mes', false, 'class="sub wand"');
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
?>
|
?>
|
||||||
|
@ -28,16 +28,16 @@ if ($show_sent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$buttons['message_list'] = array('active' => $active_list,
|
$buttons['message_list'] = array('active' => $active_list,
|
||||||
'text' => '<a href="index.php?sec=workspace&sec2=operation/messages/message_list">' .
|
'text' => '<a href="index.php?sec=workspace&sec2=operation/messages/message_list">' .
|
||||||
html_print_image("images/email.png", true, array ("title" => __('Message list'))) .'</a>');
|
html_print_image("images/email.png", true, array ("title" => __('Message list'))) .'</a>');
|
||||||
|
|
||||||
$buttons['sent_messages'] = array('active' => $active_sent,
|
$buttons['sent_messages'] = array('active' => $active_sent,
|
||||||
'text' => '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&show_sent=1">' .
|
'text' => '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&show_sent=1">' .
|
||||||
html_print_image("images/email_go.png", true, array ("title" => __('Sent messages'))) .'</a>');
|
html_print_image("images/email_go.png", true, array ("title" => __('Sent messages'))) .'</a>');
|
||||||
|
|
||||||
$buttons['create_message'] = array('active' => false,
|
$buttons['create_message'] = array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit">' .
|
'text' => '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit">' .
|
||||||
html_print_image("images/email_edit.png", true, array ("title" => __('Create message'))) .'</a>');
|
html_print_image("images/email_edit.png", true, array ("title" => __('Create message'))) .'</a>');
|
||||||
|
|
||||||
if (!is_ajax ()) {
|
if (!is_ajax ()) {
|
||||||
ui_print_page_header (__('Messages'), "images/email.png", false, "", false, $buttons);
|
ui_print_page_header (__('Messages'), "images/email.png", false, "", false, $buttons);
|
||||||
@ -65,7 +65,7 @@ if ($multiple_delete) {
|
|||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$result = db_process_sql_delete ('tmensajes',
|
$result = db_process_sql_delete ('tmensajes',
|
||||||
array ('id_mensaje' => $id));
|
array ('id_mensaje' => $id));
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
db_process_sql_rollback();
|
db_process_sql_rollback();
|
||||||
break;
|
break;
|
||||||
@ -190,15 +190,15 @@ else {
|
|||||||
|
|
||||||
if ($show_sent) {
|
if ($show_sent) {
|
||||||
$data[4] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&show_sent=1&delete_message=1&id='.$message_id.'"
|
$data[4] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&show_sent=1&delete_message=1&id='.$message_id.'"
|
||||||
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
||||||
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
|
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
|
||||||
html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true);
|
html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data[4] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&delete_message=1&id='.$message_id.'"
|
$data[4] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&delete_message=1&id='.$message_id.'"
|
||||||
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
||||||
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
|
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
|
||||||
html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true);
|
html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true);
|
||||||
}
|
}
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ else {
|
|||||||
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
|
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
|
||||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=workspace&sec2=operation/messages/message_edit">';
|
echo '<form method="post" action="index.php?sec=workspace&sec2=operation/messages/message_edit">';
|
||||||
@ -221,14 +221,12 @@ 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);
|
}
|
||||||
|
else {
|
||||||
|
$(".check_delete").attr('checked', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$(".check_delete").attr('checked', false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -308,22 +308,22 @@ if ($draw != '') {
|
|||||||
//displayNormalFilter ();
|
//displayNormalFilter ();
|
||||||
$("#table2-3").css('display', '');
|
$("#table2-3").css('display', '');
|
||||||
$("#table2-4").css('display', '');
|
$("#table2-4").css('display', '');
|
||||||
$("#table2-5").css('display', 'none');
|
$("#table2-5").css('display', 'none');
|
||||||
|
|
||||||
// Check right filter type
|
// Check right filter type
|
||||||
$("#radiobtn0001").attr("checked", "checked");
|
$("#radiobtn0001").attr("checked", "checked");
|
||||||
$("#radiobtn0002").attr("checked", "");
|
$("#radiobtn0002").attr("checked", "");
|
||||||
|
|
||||||
$("#text-ip_dst").val('');
|
$("#text-ip_dst").val('');
|
||||||
$("#text-ip_src").val('');
|
$("#text-ip_src").val('');
|
||||||
$("#text-dst_port").val('');
|
$("#text-dst_port").val('');
|
||||||
$("#text-src_port").val('');
|
$("#text-src_port").val('');
|
||||||
$("#textarea_advanced_filter").val('');
|
$("#textarea_advanced_filter").val('');
|
||||||
$("#aggregate").val('');
|
$("#aggregate").val('');
|
||||||
$("#output").val('');
|
$("#output").val('');
|
||||||
|
|
||||||
// Hide update filter button
|
// Hide update filter button
|
||||||
$("#submit-update_button").css("visibility", "hidden");
|
$("#submit-update_button").css("visibility", "hidden");
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -354,12 +354,12 @@ if ($draw != '') {
|
|||||||
|
|
||||||
// Check right filter type
|
// Check right filter type
|
||||||
$("#radiobtn0001").attr("checked", "");
|
$("#radiobtn0001").attr("checked", "");
|
||||||
$("#radiobtn0002").attr("checked", "checked");
|
$("#radiobtn0002").attr("checked", "checked");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Shows update filter button
|
// Shows update filter button
|
||||||
$("#submit-update_button").css("visibility", "");
|
$("#submit-update_button").css("visibility", "");
|
||||||
|
|
||||||
// Get filter values from DB
|
// Get filter values from DB
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
@ -368,22 +368,22 @@ if ($draw != '') {
|
|||||||
"id" : $("#filter_id").val()
|
"id" : $("#filter_id").val()
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
if (i == 'ip_dst')
|
if (i == 'ip_dst')
|
||||||
$("#text-ip_dst").val(val);
|
$("#text-ip_dst").val(val);
|
||||||
if (i == 'ip_src')
|
if (i == 'ip_src')
|
||||||
$("#text-ip_src").val(val);
|
$("#text-ip_src").val(val);
|
||||||
if (i == 'dst_port')
|
if (i == 'dst_port')
|
||||||
$("#text-dst_port").val(val);
|
$("#text-dst_port").val(val);
|
||||||
if (i == 'src_port')
|
if (i == 'src_port')
|
||||||
$("#text-src_port").val(val);
|
$("#text-src_port").val(val);
|
||||||
if (i == 'advanced_filter')
|
if (i == 'advanced_filter')
|
||||||
$("#textarea_advanced_filter").val(val);
|
$("#textarea_advanced_filter").val(val);
|
||||||
if (i == 'aggregate')
|
if (i == 'aggregate')
|
||||||
$("#aggregate").val(val);
|
$("#aggregate").val(val);
|
||||||
if (i == 'output')
|
if (i == 'output')
|
||||||
$("#output").val(val);
|
$("#output").val(val);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"json");
|
"json");
|
||||||
}
|
}
|
||||||
@ -393,21 +393,21 @@ if ($draw != '') {
|
|||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
// Hide update filter button
|
// Hide update filter button
|
||||||
if ($("#filter_id").val() == 0) {
|
if ($("#filter_id").val() == 0) {
|
||||||
$("#submit-update_button").css("visibility", "hidden");
|
$("#submit-update_button").css("visibility", "hidden");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#submit-update_button").css("visibility", "");
|
$("#submit-update_button").css("visibility", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change color of name and group if save button has been pushed
|
// Change color of name and group if save button has been pushed
|
||||||
$("#submit-save_button").click(function () {
|
$("#submit-save_button").click(function () {
|
||||||
if ($("#text-name").val() == "") {
|
if ($("#text-name").val() == "") {
|
||||||
$('#filter_name_color').css('color', '#CC0000');
|
$('#filter_name_color').css('color', '#CC0000');
|
||||||
$('#filter_group_color').css('color', '#CC0000');
|
$('#filter_group_color').css('color', '#CC0000');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#filter_name_color').css('color', '#000000');
|
$('#filter_name_color').css('color', '#000000');
|
||||||
$('#filter_group_color').css('color', '#000000');
|
$('#filter_group_color').css('color', '#000000');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -92,11 +92,11 @@ else {
|
|||||||
if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
|
||||||
// Bread crumbs
|
// Bread crumbs
|
||||||
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
||||||
|
|
||||||
ui_meta_print_page_header($nav_bar);
|
ui_meta_print_page_header($nav_bar);
|
||||||
|
|
||||||
// Print header
|
// Print header
|
||||||
ui_meta_print_header(__('Reporting'), "", $options);
|
ui_meta_print_header(__('Reporting'), "", $options);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ui_print_page_header (__('Reporting'). " » ". __('Custom reporting'). " - ".$report["name"],
|
ui_print_page_header (__('Reporting'). " » ". __('Custom reporting'). " - ".$report["name"],
|
||||||
|
@ -165,7 +165,7 @@ else {
|
|||||||
'&sort_field=module_name&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectModuleNameUp)) . '</a>' .
|
'&sort_field=module_name&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectModuleNameUp)) . '</a>' .
|
||||||
'<a href="index.php?search_category=modules&keywords=' .
|
'<a href="index.php?search_category=modules&keywords=' .
|
||||||
$config['search_keywords'] . '&head_search_keywords=abc&offset=' . $offset .
|
$config['search_keywords'] . '&head_search_keywords=abc&offset=' . $offset .
|
||||||
'&sort_field=module_name&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleNameDown)) . '</a>';
|
'&sort_field=module_name&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleNameDown)) . '</a>';
|
||||||
$table->head[1] = __('Agent') . ' ' .
|
$table->head[1] = __('Agent') . ' ' .
|
||||||
'<a href="index.php?search_category=modules&keywords=' .
|
'<a href="index.php?search_category=modules&keywords=' .
|
||||||
$config['search_keywords'] . '&head_search_keywords=abc&offset=' . $offset .
|
$config['search_keywords'] . '&head_search_keywords=abc&offset=' . $offset .
|
||||||
|
@ -452,7 +452,7 @@ if ($traps !== false) {
|
|||||||
if (! check_acl ($config["id_user"], 0, "AR")) {
|
if (! check_acl ($config["id_user"], 0, "AR")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$data[1] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$trap["source"].'" title="'.__('Create agent').'">'.$trap["source"].'</a>';
|
$data[1] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$trap["source"].'" title="'.__('Create agent').'">'.$trap["source"].'</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) {
|
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) {
|
||||||
@ -563,7 +563,7 @@ if ($traps !== false) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$desc_trap_type = __('Other');
|
$desc_trap_type = __('Other');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>';
|
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -586,7 +586,7 @@ if ($idx == 0) {
|
|||||||
echo '<div class="nf">'.__('No matching traps found').'</div>';
|
echo '<div class="nf">'.__('No matching traps found').'</div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
unset ($table);
|
unset ($table);
|
||||||
|
@ -92,7 +92,7 @@ if (is_ajax ())
|
|||||||
//Skip agents which only have not init modules
|
//Skip agents which only have not init modules
|
||||||
|
|
||||||
$search_sql .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM
|
$search_sql .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM
|
||||||
tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)";
|
tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)";
|
||||||
|
|
||||||
$sql = agents_get_agents(array (
|
$sql = agents_get_agents(array (
|
||||||
'order' => 'nombre COLLATE utf8_general_ci ASC',
|
'order' => 'nombre COLLATE utf8_general_ci ASC',
|
||||||
@ -386,7 +386,7 @@ if (is_ajax ())
|
|||||||
if ($lessBranchs == 1)
|
if ($lessBranchs == 1)
|
||||||
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
else
|
else
|
||||||
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
|
|
||||||
echo $img;
|
echo $img;
|
||||||
echo "</a>";
|
echo "</a>";
|
||||||
@ -504,20 +504,20 @@ if (is_ajax ())
|
|||||||
echo "<li style='margin: 0; padding: 0;'>";
|
echo "<li style='margin: 0; padding: 0;'>";
|
||||||
switch ($lessBranchs) {
|
switch ($lessBranchs) {
|
||||||
case 0:
|
case 0:
|
||||||
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
echo "<i>" . __("Empty") . "</i>";
|
echo "<i>" . __("Empty") . "</i>";
|
||||||
|
@ -60,7 +60,7 @@ if (is_ajax ()){
|
|||||||
}
|
}
|
||||||
// Activate shortcut var
|
// Activate shortcut var
|
||||||
else {
|
else {
|
||||||
db_process_sql_update('tusuario', array('shortcut' => 1), array('id_user' => $id));
|
db_process_sql_update('tusuario', array('shortcut' => 1), array('id_user' => $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
|||||||
$upd_info["phone"] = get_parameter_post ("phone", $user_info["phone"]);
|
$upd_info["phone"] = get_parameter_post ("phone", $user_info["phone"]);
|
||||||
$upd_info["comments"] = get_parameter_post ("comments", $user_info["comments"]);
|
$upd_info["comments"] = get_parameter_post ("comments", $user_info["comments"]);
|
||||||
$upd_info["language"] = get_parameter_post ("language", $user_info["language"]);
|
$upd_info["language"] = get_parameter_post ("language", $user_info["language"]);
|
||||||
$upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]);
|
$upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]);
|
||||||
$upd_info["block_size"] = get_parameter ("block_size", $config["block_size"]);
|
$upd_info["block_size"] = get_parameter ("block_size", $config["block_size"]);
|
||||||
$default_block_size = get_parameter ("default_block_size", 0);
|
$default_block_size = get_parameter ("default_block_size", 0);
|
||||||
if($default_block_size) {
|
if($default_block_size) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user