2012-09-13 Miguel de Dios <miguel.dedios@artica.es>
* operation/incidents/incident_detail.php, operation/agentes/exportdata.php, operation/events/events_list.php, operation/events/events.php, godmode/events/event_edit_filter.php, godmode/massive/massive_edit_agents.php, include/functions_api.php, include/constants.php, include/javascript/pandora.js, include/functions_ui.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@6974 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
8082d6b81a
commit
8afc508476
|
@ -1,3 +1,14 @@
|
||||||
|
2012-09-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/incidents/incident_detail.php,
|
||||||
|
operation/agentes/exportdata.php, operation/events/events_list.php,
|
||||||
|
operation/events/events.php, godmode/events/event_edit_filter.php,
|
||||||
|
godmode/massive/massive_edit_agents.php, include/functions_api.php,
|
||||||
|
include/constants.php, include/javascript/pandora.js,
|
||||||
|
include/functions_ui.php: started to use the new function
|
||||||
|
"ui_print_agent_autocomplete_input" to make more easy (and standar)
|
||||||
|
the autocomplete agent input.
|
||||||
|
|
||||||
2012-09-13 Sergio Martin <sergio.martin@artica.es>
|
2012-09-13 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/styles/pandora_legacy.css
|
* include/styles/pandora_legacy.css
|
||||||
|
|
|
@ -80,7 +80,7 @@ else {
|
||||||
$search = '';
|
$search = '';
|
||||||
$text_agent = __('All');
|
$text_agent = __('All');
|
||||||
$pagination = '';
|
$pagination = '';
|
||||||
$event_view_hr = '';
|
$event_view_hr = '';
|
||||||
$id_user_ack = '';
|
$id_user_ack = '';
|
||||||
$group_rep = '';
|
$group_rep = '';
|
||||||
$tag = '';
|
$tag = '';
|
||||||
|
@ -101,14 +101,14 @@ if ($update) {
|
||||||
$id_user_ack = get_parameter('id_user_ack', '');
|
$id_user_ack = get_parameter('id_user_ack', '');
|
||||||
$group_rep = get_parameter('group_rep', '');
|
$group_rep = get_parameter('group_rep', '');
|
||||||
$tag = get_parameter('tag', '');
|
$tag = get_parameter('tag', '');
|
||||||
$filter_only_alert = get_parameter('filter_only_alert','');
|
$filter_only_alert = get_parameter('filter_only_alert','');
|
||||||
|
|
||||||
if ($id_name == '') {
|
if ($id_name == '') {
|
||||||
ui_print_error_message (__('Not updated. Blank name'));
|
ui_print_error_message (__('Not updated. Blank name'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$values = array ('id_filter' => $id,
|
$values = array ('id_filter' => $id,
|
||||||
'id_name' => $id_name,
|
'id_name' => $id_name,
|
||||||
'id_group_filter' => $id_group_filter,
|
'id_group_filter' => $id_group_filter,
|
||||||
'id_group' => $id_group,
|
'id_group' => $id_group,
|
||||||
'event_type' => $event_type,
|
'event_type' => $event_type,
|
||||||
|
@ -125,7 +125,7 @@ if ($update) {
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = db_process_sql_update ('tevent_filter', $values, array ('id_filter' => $id));
|
$result = db_process_sql_update ('tevent_filter', $values, array ('id_filter' => $id));
|
||||||
|
|
||||||
ui_print_result_message ($result,
|
ui_print_result_message ($result,
|
||||||
__('Successfully updated'),
|
__('Successfully updated'),
|
||||||
__('Not updated. Error updating data'));
|
__('Not updated. Error updating data'));
|
||||||
|
@ -150,7 +150,7 @@ if ($create) {
|
||||||
|
|
||||||
$values = array (
|
$values = array (
|
||||||
'id_name' => $id_name,
|
'id_name' => $id_name,
|
||||||
'id_group_filter' => $id_group_filter,
|
'id_group_filter' => $id_group_filter,
|
||||||
'id_group' => $id_group,
|
'id_group' => $id_group,
|
||||||
'event_type' => $event_type,
|
'event_type' => $event_type,
|
||||||
'severity' => $severity,
|
'severity' => $severity,
|
||||||
|
@ -190,46 +190,49 @@ $table->data[0][1] = html_print_input_text ('id_name', $id_name, false, 20, 80,
|
||||||
|
|
||||||
$table->data[1][0] = '<b>'.__('Filter group').'</b>' . ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
|
$table->data[1][0] = '<b>'.__('Filter group').'</b>' . ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
|
||||||
$table->data[1][1] = html_print_select_groups($config['id_user'], "IW",
|
$table->data[1][1] = html_print_select_groups($config['id_user'], "IW",
|
||||||
$own_info['is_admin'], 'id_group_filter', $id_group_filter, '', '', -1, true,
|
$own_info['is_admin'], 'id_group_filter', $id_group_filter, '', '', -1, true,
|
||||||
false, false);
|
false, false);
|
||||||
|
|
||||||
$table->data[2][0] = '<b>'.__('Group').'</b>';
|
$table->data[2][0] = '<b>'.__('Group').'</b>';
|
||||||
$table->data[2][1] = html_print_select_groups($config['id_user'], "IW",
|
$table->data[2][1] = html_print_select_groups($config['id_user'], "IW",
|
||||||
$own_info['is_admin'], 'id_group', $id_group, '', '', -1, true,
|
$own_info['is_admin'], 'id_group', $id_group, '', '', -1, true,
|
||||||
false, false);
|
false, false);
|
||||||
|
|
||||||
$types = get_event_types ();
|
$types = get_event_types ();
|
||||||
// Expand standard array to add not_normal (not exist in the array, used only for searches)
|
// Expand standard array to add not_normal (not exist in the array, used only for searches)
|
||||||
$types["not_normal"] = __("Not normal");
|
$types["not_normal"] = __("Not normal");
|
||||||
|
|
||||||
$table->data[3][0] = '<b>' . __('Event type') . '</b>';
|
$table->data[3][0] = '<b>' . __('Event type') . '</b>';
|
||||||
$table->data[3][1] = html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true);
|
$table->data[3][1] = html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true);
|
||||||
|
|
||||||
$table->data[4][0] = '<b>' . __('Severity') . '</b>';
|
$table->data[4][0] = '<b>' . __('Severity') . '</b>';
|
||||||
$table->data[4][1] = html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', true);
|
$table->data[4][1] = html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', true);
|
||||||
|
|
||||||
$fields = events_get_all_status();
|
$fields = events_get_all_status();
|
||||||
|
|
||||||
$table->data[5][0] = '<b>' . __('Event status') . '</b>';
|
$table->data[5][0] = '<b>' . __('Event status') . '</b>';
|
||||||
$table->data[5][1] = html_print_select ($fields, 'status', $status, '', '', '', true);
|
$table->data[5][1] = html_print_select ($fields, 'status', $status, '', '', '', true);
|
||||||
|
|
||||||
$table->data[6][0] = '<b>' . __('Free search') . '</b>';
|
$table->data[6][0] = '<b>' . __('Free search') . '</b>';
|
||||||
$table->data[6][1] = html_print_input_text ('search', io_safe_output($search), '', 15, 255, true);
|
$table->data[6][1] = html_print_input_text ('search', io_safe_output($search), '', 15, 255, true);
|
||||||
|
|
||||||
$table->data[7][0] = '<b>' . __('Agent search') . '</b>';
|
$table->data[7][0] = '<b>' . __('Agent search') . '</b>';
|
||||||
$src_code = html_print_image('images/lightning.png', true, false, true);
|
$params = array();
|
||||||
$table->data[7][1] = html_print_input_text_extended ('text_agent', $text_agent, 'text_id_agent', '', 30, 100, false, '',
|
$params['return'] = true;
|
||||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true)
|
$params['show_helptip'] = true;
|
||||||
. '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a>';
|
$params['input_name'] = 'text_agent';
|
||||||
|
$params['selectbox_group'] = 'id_group';
|
||||||
|
$params['value'] = $text_agent;
|
||||||
|
$table->data[7][1] = ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
$lpagination[25] = 25;
|
$lpagination[25] = 25;
|
||||||
$lpagination[50] = 50;
|
$lpagination[50] = 50;
|
||||||
$lpagination[100] = 100;
|
$lpagination[100] = 100;
|
||||||
$lpagination[200] = 200;
|
$lpagination[200] = 200;
|
||||||
$lpagination[500] = 500;
|
$lpagination[500] = 500;
|
||||||
$table->data[8][0] = '<b>' . __('Block size for pagination') . '</b>';
|
$table->data[8][0] = '<b>' . __('Block size for pagination') . '</b>';
|
||||||
$table->data[8][1] = html_print_select ($lpagination, "pagination", $pagination, '', __('Default'), $config["block_size"], true);
|
$table->data[8][1] = html_print_select ($lpagination, "pagination", $pagination, '', __('Default'), $config["block_size"], true);
|
||||||
|
|
||||||
$table->data[9][0] = '<b>' . __('Max. hours old') . '</b>';
|
$table->data[9][0] = '<b>' . __('Max. hours old') . '</b>';
|
||||||
$table->data[9][1] = html_print_input_text ('event_view_hr', $event_view_hr, '', 5, 255, true);
|
$table->data[9][1] = html_print_input_text ('event_view_hr', $event_view_hr, '', 5, 255, true);
|
||||||
|
|
||||||
|
@ -257,7 +260,7 @@ $table->data[12][1] = html_print_select ($tags_name, "tag", $tag, '', __('All'),
|
||||||
|
|
||||||
$table->data[13][0] = '<b>' . __('Alert events') . '</b>';
|
$table->data[13][0] = '<b>' . __('Alert events') . '</b>';
|
||||||
$table->data[13][1] = html_print_select (array('-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true);
|
$table->data[13][1] = html_print_select (array('-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true);
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/event_edit_filter">';
|
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/event_edit_filter">';
|
||||||
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.'">';
|
||||||
|
@ -274,71 +277,4 @@ echo '</div>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
/* <![CDATA[ */
|
|
||||||
$(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);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.data( "autocomplete")._renderItem = function( ul, item ) {
|
|
||||||
if ((item.ip == "") || (typeof(item.ip) == "undefined")) {
|
|
||||||
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");
|
|
||||||
|
|
||||||
});
|
|
||||||
/* ]]> */
|
|
||||||
</script>
|
|
|
@ -236,9 +236,12 @@ $groups = users_get_groups ($config["id_user"], "AR",false);
|
||||||
$agents = agents_get_group_agents (array_keys ($groups));
|
$agents = agents_get_group_agents (array_keys ($groups));
|
||||||
|
|
||||||
$table->data[0][0] = __('Parent');
|
$table->data[0][0] = __('Parent');
|
||||||
$table->data[0][1] = html_print_input_text_extended ('id_parent', agents_get_name ($id_parent), 'text-id_parent', '', 30, 100, false, '',
|
$params = array();
|
||||||
array('style' => 'background: url(images/lightning.png) no-repeat right;'), true)
|
$params['return'] = true;
|
||||||
. '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a>';
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'id_parent';
|
||||||
|
$params['value'] = agents_get_name ($id_parent);
|
||||||
|
$table->data[0][1] = ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
$table->data[0][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . ui_print_help_icon("cascade_protection", true);
|
$table->data[0][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . ui_print_help_icon("cascade_protection", true);
|
||||||
|
|
||||||
|
@ -377,7 +380,7 @@ if ($fields === false) $fields = array();
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
|
|
||||||
$data[0] = '<b>'.$field['name'].'</b>';
|
$data[0] = '<b>'.$field['name'].'</b>';
|
||||||
|
|
||||||
$custom_value = db_get_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
|
$custom_value = db_get_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
|
||||||
|
|
||||||
if ($custom_value === false) {
|
if ($custom_value === false) {
|
||||||
|
@ -413,17 +416,12 @@ ui_require_jquery_file ('pandora.controls');
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
ui_require_jquery_file ('ajaxqueue');
|
ui_require_jquery_file ('ajaxqueue');
|
||||||
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[ */
|
||||||
|
|
||||||
//Use this function for change 3 icons when change the selectbox
|
//Use this function for change 3 icons when change the selectbox
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
function get_n_conf_files(idAgents) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#id_agents").change (function () {
|
$("#id_agents").change (function () {
|
||||||
var idAgents = Array();
|
var idAgents = Array();
|
||||||
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||||
|
@ -447,7 +445,7 @@ $(document).ready (function () {
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#form_agents").attr("style", "");
|
$("#form_agents").attr("style", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -457,29 +455,6 @@ $(document).ready (function () {
|
||||||
|
|
||||||
$("select#id_os").pandoraSelectOS ();
|
$("select#id_os").pandoraSelectOS ();
|
||||||
|
|
||||||
$("#text-id_parent").autocomplete ("ajax.php",
|
|
||||||
{
|
|
||||||
scroll: true,
|
|
||||||
minChars: 2,
|
|
||||||
extraParams: {
|
|
||||||
page: "godmode/agentes/agent_manager",
|
|
||||||
search_parents: 1,
|
|
||||||
id_group: function() { return $("#group").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', '');
|
|
||||||
if (data == "")
|
|
||||||
return false;
|
|
||||||
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
|
|
||||||
},
|
|
||||||
delay: 200
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
var recursion;
|
var recursion;
|
||||||
$("#checkbox-recursion").click(function (){
|
$("#checkbox-recursion").click(function (){
|
||||||
recursion = this.checked ? 1 : 0;
|
recursion = this.checked ? 1 : 0;
|
||||||
|
|
|
@ -99,7 +99,7 @@ switch ($config["dbtype"]) {
|
||||||
define ('BACKUP_FULLPATH', $config['homedir'] . '/' . BACKUP_DIR);
|
define ('BACKUP_FULLPATH', $config['homedir'] . '/' . BACKUP_DIR);
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
define ('BACKUP_DIR', 'DATA_PUMP_DIR');
|
define ('BACKUP_DIR', 'DATA_PUMP_DIR');
|
||||||
define ('BACKUP_FULLPATH', 'DATA_PUMP_DIR');
|
define ('BACKUP_FULLPATH', 'DATA_PUMP_DIR');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ enterprise_include_once ('include/functions_local_components.php');
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function parseOtherParameter($other, $otherType) {
|
function parseOtherParameter($other, $otherType) {
|
||||||
|
|
||||||
switch ($otherType) {
|
switch ($otherType) {
|
||||||
case 'url_encode':
|
case 'url_encode':
|
||||||
$returnVar = array('type' => 'string', 'data' => urldecode($other));
|
$returnVar = array('type' => 'string', 'data' => urldecode($other));
|
||||||
|
@ -4737,7 +4737,7 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||||
$pagination = $filter['limit'];
|
$pagination = $filter['limit'];
|
||||||
if (isset($filter['offset']))
|
if (isset($filter['offset']))
|
||||||
$offset = $filter['offset'];
|
$offset = $filter['offset'];
|
||||||
if (isset($filter['id_group'])) {
|
if (isset($filter['id_group'])) {
|
||||||
$id_group = $filter['id_group'];
|
$id_group = $filter['id_group'];
|
||||||
//A little hack to make the query fetch all groups and not only "All" (with id=0)
|
//A little hack to make the query fetch all groups and not only "All" (with id=0)
|
||||||
if ($id_group == 0)
|
if ($id_group == 0)
|
||||||
|
|
|
@ -2047,6 +2047,11 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
$input_id = $parameters['input_id'];
|
$input_id = $parameters['input_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$selectbox_group = ''; //Default value
|
||||||
|
if (isset($parameters['selectbox_group'])) {
|
||||||
|
$selectbox_group = $parameters['selectbox_group'];
|
||||||
|
}
|
||||||
|
|
||||||
//Default value
|
//Default value
|
||||||
$icon_image = html_print_image('images/lightning.png', true, false, true);
|
$icon_image = html_print_image('images/lightning.png', true, false, true);
|
||||||
if (isset($parameters['icon_image'])) {
|
if (isset($parameters['icon_image'])) {
|
||||||
|
@ -2103,6 +2108,16 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
$disabled = $parameters['disabled'];
|
$disabled = $parameters['disabled'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$selectbox_id = 'id_agent_module'; //Default value
|
||||||
|
if (isset($parameters['selectbox_id'])) {
|
||||||
|
$selectbox_id = $parameters['selectbox_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$add_none_module = true; //Default value
|
||||||
|
if (isset($parameters['add_none_module'])) {
|
||||||
|
$add_none_module = $parameters['add_none_module'];
|
||||||
|
}
|
||||||
|
|
||||||
// Javascript configurations
|
// Javascript configurations
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
$javascript = true; //Default value
|
$javascript = true; //Default value
|
||||||
|
@ -2110,11 +2125,6 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
$javascript = $parameters['javascript'];
|
$javascript = $parameters['javascript'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$selectbox_id = 'id_agent_module'; //Default value
|
|
||||||
if (isset($parameters['selectbox_id'])) {
|
|
||||||
$selectbox_id = $parameters['selectbox_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$javascript_is_function_select = false; //Default value
|
$javascript_is_function_select = false; //Default value
|
||||||
if (isset($parameters['javascript_is_function_select'])) {
|
if (isset($parameters['javascript_is_function_select'])) {
|
||||||
$javascript_is_function_select = $parameters['javascript_is_function_select'];
|
$javascript_is_function_select = $parameters['javascript_is_function_select'];
|
||||||
|
@ -2130,11 +2140,13 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
function function_select_' . $input_name . '(agent_name) {
|
function function_select_' . $input_name . '(agent_name) {
|
||||||
|
|
||||||
$("#' . $selectbox_id . '").empty ();
|
$("#' . $selectbox_id . '").empty ();
|
||||||
|
|
||||||
var inputs = [];
|
var inputs = [];
|
||||||
inputs.push ("agent_name=" + agent_name);
|
inputs.push ("agent_name=" + agent_name);
|
||||||
inputs.push ("filter=delete_pending = 0");
|
inputs.push ("filter=delete_pending = 0");
|
||||||
inputs.push ("get_agent_modules_json=1");
|
inputs.push ("get_agent_modules_json=1");
|
||||||
inputs.push ("page=operation/agentes/ver_agente");
|
inputs.push ("page=operation/agentes/ver_agente");
|
||||||
|
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: inputs.join ("&"),
|
data: inputs.join ("&"),
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
@ -2142,9 +2154,11 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$("#' . $selectbox_id . '")
|
if (' . ((int)$add_none_module) . ') {
|
||||||
.append($("<option></option>")
|
$("#' . $selectbox_id . '")
|
||||||
.attr("value", 0).text("--"));
|
.append($("<option></option>")
|
||||||
|
.attr("value", 0).text("--"));
|
||||||
|
}
|
||||||
|
|
||||||
jQuery.each (data, function(i, val) {
|
jQuery.each (data, function(i, val) {
|
||||||
s = js_html_entity_decode(val["nombre"]);
|
s = js_html_entity_decode(val["nombre"]);
|
||||||
|
@ -2166,7 +2180,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Default value
|
//Default value
|
||||||
$javascript_page = 'godmode/agentes/agent_manager';
|
$javascript_page = 'include/ajax/agent';
|
||||||
if (isset($parameters['javascript_page'])) {
|
if (isset($parameters['javascript_page'])) {
|
||||||
$javascript_page = $parameters['javascript_page'];
|
$javascript_page = $parameters['javascript_page'];
|
||||||
}
|
}
|
||||||
|
@ -2181,7 +2195,16 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
|
|
||||||
var data_params = {
|
var data_params = {
|
||||||
"page": "' . $javascript_page . '",
|
"page": "' . $javascript_page . '",
|
||||||
"search_parents_2": 1,
|
"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};
|
"q": term};
|
||||||
|
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
|
@ -2202,6 +2225,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
},
|
},
|
||||||
select: function( event, ui ) {
|
select: function( event, ui ) {
|
||||||
var agent_name = ui.item.name;
|
var agent_name = ui.item.name;
|
||||||
|
var agent_id = ui.item.id;
|
||||||
|
|
||||||
//Put the name
|
//Put the name
|
||||||
$(this).val(agent_name);
|
$(this).val(agent_name);
|
||||||
|
@ -2210,6 +2234,10 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
' . $javascript_name_function_select . '(agent_name);
|
' . $javascript_name_function_select . '(agent_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (' . ((int)$print_hidden_input_idagent) . ') {
|
||||||
|
$("#' . $hidden_input_idagent_id . '").val(agent_id);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -2227,19 +2255,19 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
.append(text)
|
.append(text)
|
||||||
.appendTo(ul);
|
.appendTo(ul);
|
||||||
};
|
};
|
||||||
|
|
||||||
//Force the size of autocomplete
|
//Force the size of autocomplete
|
||||||
$(".ui-autocomplete").css("max-height", "100px");
|
$(".ui-autocomplete").css("max-height", "100px");
|
||||||
$(".ui-autocomplete").css("overflow-y", "auto");
|
$(".ui-autocomplete").css("overflow-y", "auto");
|
||||||
/* prevent horizontal scrollbar */
|
/* prevent horizontal scrollbar */
|
||||||
$(".ui-autocomplete").css("overflow-x", "hidden");
|
$(".ui-autocomplete").css("overflow-x", "hidden");
|
||||||
/* add padding to account for vertical scrollbar */
|
/* add padding to account for vertical scrollbar */
|
||||||
$(".ui-autocomplete").css("padding-right", "20px");
|
$(".ui-autocomplete").css("padding-right", "20px");
|
||||||
|
|
||||||
//Force to style of items
|
//Force to style of items
|
||||||
$(".ui-autocomplete").css("text-align", "left");
|
$(".ui-autocomplete").css("text-align", "left");
|
||||||
}
|
}';
|
||||||
';
|
|
||||||
if (isset($parameters['javascript_function_change'])) {
|
if (isset($parameters['javascript_function_change'])) {
|
||||||
$javascript_function_change = $parameters['javascript_function_change'];
|
$javascript_function_change = $parameters['javascript_function_change'];
|
||||||
}
|
}
|
||||||
|
@ -2262,10 +2290,8 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
$attrs = '';
|
|
||||||
if ($show_helptip) {
|
$attrs = array('style' => 'background: url(' . $icon_image . ') no-repeat right;');
|
||||||
$attrs = array('style' => 'background: url(' . $icon_image . ') no-repeat right;');
|
|
||||||
}
|
|
||||||
|
|
||||||
$html = html_print_input_text_extended($input_name, $value,
|
$html = html_print_input_text_extended($input_name, $value,
|
||||||
$input_id, $helptip_text, $size, $maxlength, $disabled, '', $attrs, true);
|
$input_id, $helptip_text, $size, $maxlength, $disabled, '', $attrs, true);
|
||||||
|
|
|
@ -4,7 +4,8 @@ var ENTERPRISE_DIR = 'enterprise';
|
||||||
function toggleDiv (divid){
|
function toggleDiv (divid){
|
||||||
if (document.getElementById(divid).style.display == 'none') {
|
if (document.getElementById(divid).style.display == 'none') {
|
||||||
document.getElementById(divid).style.display = 'block';
|
document.getElementById(divid).style.display = 'block';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
document.getElementById(divid).style.display = 'none';
|
document.getElementById(divid).style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,10 +32,11 @@ function js_html_entity_decode (str) {
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
str2 = str.replace (/</g, "<").
|
str2 = str.replace (/</g, "<").
|
||||||
replace (/>/g,">").replace(/</g,'<').replace(/>/g,'>')
|
replace (/>/g,">").replace(/</g,'<')
|
||||||
.replace(/\/g,'\\').replace(/"/g,'\"').replace(/'/g,'\'')
|
.replace(/>/g,'>').replace(/\/g,'\\')
|
||||||
.replace(/&/g,'&').replace(/ /g,' ')
|
.replace(/"/g,'\"').replace(/'/g,'\'')
|
||||||
.replace(/ /g, '\r').replace(/ /g, '\n');
|
.replace(/&/g,'&').replace(/ /g,' ')
|
||||||
|
.replace(/ /g, '\r').replace(/ /g, '\n');
|
||||||
|
|
||||||
return str2;
|
return str2;
|
||||||
}
|
}
|
||||||
|
@ -53,6 +55,7 @@ Array.prototype.in_array = function () {
|
||||||
if(this[j] == arguments[0])
|
if(this[j] == arguments[0])
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -173,50 +176,50 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
||||||
homedir = event.data.homedir;
|
homedir = event.data.homedir;
|
||||||
|
|
||||||
jQuery.post (homedir + '/ajax.php',
|
jQuery.post (homedir + '/ajax.php',
|
||||||
{"page": "operation/agentes/ver_agente",
|
{"page": "operation/agentes/ver_agente",
|
||||||
"get_agent_modules_json_for_multiple_agents": 1,
|
"get_agent_modules_json_for_multiple_agents": 1,
|
||||||
"id_agent[]": idAgents,
|
"id_agent[]": idAgents,
|
||||||
"all": find_modules,
|
"all": find_modules,
|
||||||
"custom_condition": custom_condition,
|
"custom_condition": custom_condition,
|
||||||
"selection_mode": selection_mode
|
"selection_mode": selection_mode
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
$('#module').empty ();
|
$('#module').empty ();
|
||||||
|
|
||||||
if (isEmptyObject(data)) {
|
if (isEmptyObject(data)) {
|
||||||
var noneText = $("#none_text").html(); //Trick for catch the translate text.
|
var noneText = $("#none_text").html(); //Trick for catch the translate text.
|
||||||
|
|
||||||
if (noneText == null) {
|
if (noneText == null) {
|
||||||
noneText = 'None';
|
noneText = 'None';
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#module').append ($('<option></option>').html (noneText).attr ("None", "").attr('selected', true));
|
$('#module').append ($('<option></option>').html (noneText).attr ("None", "").attr('selected', true));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof($(document).data('text_for_module')) != 'undefined') {
|
if (typeof($(document).data('text_for_module')) != 'undefined') {
|
||||||
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true));
|
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (typeof(data['any_text']) != 'undefined') {
|
if (typeof(data['any_text']) != 'undefined') {
|
||||||
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true));
|
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
||||||
|
|
||||||
if (anyText == null) {
|
if (anyText == null) {
|
||||||
anyText = 'Any';
|
anyText = 'Any';
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true));
|
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
s = js_html_entity_decode(val);
|
s = js_html_entity_decode(val);
|
||||||
$('#module').append ($('<option></option>').html (s).attr ("value", i));
|
$('#module').append ($('<option></option>').html (s).attr ("value", i));
|
||||||
$('#module').fadeIn ('normal');
|
$('#module').fadeIn ('normal');
|
||||||
});
|
});
|
||||||
if (selected != undefined)
|
if (selected != undefined)
|
||||||
$('#module').attr ('value', selected);
|
$('#module').attr ('value', selected);
|
||||||
$('#module').css ("width", "auto");
|
$('#module').css ("width", "auto");
|
||||||
|
@ -347,28 +350,28 @@ function module_changed_by_multiple_modules (event, id_module, selected) {
|
||||||
else {
|
else {
|
||||||
if (typeof(data['any_text']) != 'undefined') {
|
if (typeof(data['any_text']) != 'undefined') {
|
||||||
$('#agents').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true));
|
$('#agents').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
||||||
|
|
||||||
if (anyText == null) {
|
if (anyText == null) {
|
||||||
anyText = 'Any';
|
anyText = 'Any';
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#agents').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true));
|
$('#agents').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
s = js_html_entity_decode(val);
|
s = js_html_entity_decode(val);
|
||||||
$('#agents').append ($('<option></option>').html (s).attr ("value", val));
|
$('#agents').append ($('<option></option>').html (s).attr ("value", val));
|
||||||
$('#agents').fadeIn ('normal');
|
$('#agents').fadeIn ('normal');
|
||||||
});
|
});
|
||||||
if (selected != undefined)
|
if (selected != undefined)
|
||||||
$('#agents').attr ('value', selected);
|
$('#agents').attr ('value', selected);
|
||||||
$('#agents').removeAttr('disabled');
|
$('#agents').removeAttr('disabled');
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -190,7 +190,9 @@ if (empty($export_btn)) {
|
||||||
|
|
||||||
$groups = users_get_groups ($config['id_user'], "AR");
|
$groups = users_get_groups ($config['id_user'], "AR");
|
||||||
|
|
||||||
$table->data[0][1] = html_print_select_groups($config['id_user'], "AR", true, "group", $group, 'submit_group();', '', 0, true, false, true, 'w130', false);
|
$table->data[0][1] = html_print_select_groups($config['id_user'],
|
||||||
|
"AR", true, "group", $group, '', '', 0, true, false, true,
|
||||||
|
'w130', false);
|
||||||
|
|
||||||
//Agent selector
|
//Agent selector
|
||||||
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
|
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
|
||||||
|
@ -212,9 +214,16 @@ if (empty($export_btn)) {
|
||||||
//Src code of lightning image with skins
|
//Src code of lightning image with skins
|
||||||
$src_code = html_print_image ('images/lightning.png', true, false, true);
|
$src_code = html_print_image ('images/lightning.png', true, false, true);
|
||||||
|
|
||||||
$table->data[1][1] = html_print_input_text_extended ('agent', agents_get_name ($agent), 'text-agent', '', 40, 100, false, '',
|
$params = array();
|
||||||
array('style' => "background: url($src_code) no-repeat right;"), true)
|
$params['return'] = true;
|
||||||
. '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a>';
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent';
|
||||||
|
$params['selectbox_group'] = 'group';
|
||||||
|
$params['value'] = agents_get_name ($agent);
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['add_none_module'] = false;
|
||||||
|
$params['selectbox_id'] = 'module_arr';
|
||||||
|
$table->data[1][1] = ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
//Module selector
|
//Module selector
|
||||||
$table->data[2][0] = '<b>'.__('Modules').'</b>';
|
$table->data[2][0] = '<b>'.__('Modules').'</b>';
|
||||||
|
@ -279,7 +288,7 @@ if (empty($export_btn)) {
|
||||||
|
|
||||||
// Submit button
|
// Submit button
|
||||||
echo '<div class="action-buttons" style="width:98%;">';
|
echo '<div class="action-buttons" style="width:98%;">';
|
||||||
html_print_button (__('Export'), 'export_btn', $disabled_export_button, 'change_action()', 'class="sub wand"');
|
html_print_button (__('Export'), 'export_btn', false, 'change_action()', 'class="sub wand"');
|
||||||
echo '</div></form>';
|
echo '</div></form>';
|
||||||
}
|
}
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
|
@ -287,113 +296,24 @@ ui_require_jquery_file ('ajaxqueue');
|
||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
$(document).ready (function () {
|
function change_action() {
|
||||||
var inputActive = true;
|
type = $("#export_type").val();
|
||||||
|
var f = document.forms.export_form;
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
switch (type) {
|
||||||
url: "ajax.php",
|
case 'csv':
|
||||||
data: "page=operation/agentes/exportdata&search_agents=1&id_group=" + $("#group").val(),
|
f.action = "operation/agentes/exportdata.csv.php";
|
||||||
success: function(msg){
|
break;
|
||||||
if (msg.length == 0) {
|
case 'excel':
|
||||||
$("#text-agent").css ('background-color', '#FF8080');
|
f.action = "operation/agentes/exportdata.excel.php";
|
||||||
$("#text-agent").val("<?php echo __("No agents in this category");?>");
|
break;
|
||||||
$("#text-agent").attr("disabled", true);
|
case 'avg':
|
||||||
$("#text-agent").css ('color', '#000000');
|
case 'data':
|
||||||
inputActive = false;
|
f.action = "index.php?sec=reporting&sec2=operation/agentes/exportdata&export_btn=1";
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
});
|
$("#export_form").submit();
|
||||||
|
|
||||||
if (inputActive) {
|
|
||||||
$("#text-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 $("#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);
|
|
||||||
|
|
||||||
this.form.submit();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.data( "autocomplete")._renderItem = function( ul, item ) {
|
|
||||||
if ((item.ip == "") || (typeof(item.ip) == "undefined")) {
|
|
||||||
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 change_action() {
|
|
||||||
type = $("#export_type").val();
|
|
||||||
var f = document.forms.export_form;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case 'csv':
|
|
||||||
f.action = "operation/agentes/exportdata.csv.php";
|
|
||||||
break;
|
|
||||||
case 'excel':
|
|
||||||
f.action = "operation/agentes/exportdata.excel.php";
|
|
||||||
break;
|
|
||||||
case 'avg':
|
|
||||||
case 'data':
|
|
||||||
f.action = "index.php?sec=reporting&sec2=operation/agentes/exportdata&export_btn=1";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$("#export_form").submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
function submit_group() {
|
|
||||||
var f = document.forms.export_form;
|
|
||||||
f.action = "index.php?sec=reporting&sec2=operation/agentes/exportdata";
|
|
||||||
f.form.submit();
|
|
||||||
}
|
|
||||||
/* ]]> */
|
|
||||||
</script>
|
</script>
|
|
@ -78,7 +78,7 @@ if (is_ajax ()) {
|
||||||
$event = events_get_event ($id);
|
$event = events_get_event ($id);
|
||||||
if ($event === false)
|
if ($event === false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
alerts_agent_module_standby ($event['id_alert_am'], 1);
|
alerts_agent_module_standby ($event['id_alert_am'], 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -88,13 +88,13 @@ if (is_ajax ()) {
|
||||||
$similars = (bool) get_parameter ('similars');
|
$similars = (bool) get_parameter ('similars');
|
||||||
$comment = (string) get_parameter ('comment');
|
$comment = (string) get_parameter ('comment');
|
||||||
$new_status = get_parameter ('new_status');
|
$new_status = get_parameter ('new_status');
|
||||||
|
|
||||||
// Set off the standby mode when close an event
|
// Set off the standby mode when close an event
|
||||||
if($new_status == 1) {
|
if($new_status == 1) {
|
||||||
$event = events_get_event ($id);
|
$event = events_get_event ($id);
|
||||||
alerts_agent_module_standby ($event['id_alert_am'], 0);
|
alerts_agent_module_standby ($event['id_alert_am'], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = events_validate_event ($id, $similars, $comment, $new_status);
|
$return = events_validate_event ($id, $similars, $comment, $new_status);
|
||||||
if ($return)
|
if ($return)
|
||||||
echo 'ok';
|
echo 'ok';
|
||||||
|
@ -277,7 +277,7 @@ if ($config["pure"] == 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_print_page_header (__("Events"), "images/lightning_go.png", false, "eventview", false, $onheader);
|
ui_print_page_header (__("Events"), "images/lightning_go.png", false, "eventview", false, $onheader);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function openSoundEventWindow() {
|
function openSoundEventWindow() {
|
||||||
|
@ -348,7 +348,7 @@ if ($validate) {
|
||||||
__('Could not be set in process'));
|
__('Could not be set in process'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($standby_alert) {
|
if ($standby_alert) {
|
||||||
foreach($ids as $id) {
|
foreach($ids as $id) {
|
||||||
$event = events_get_event ($id);
|
$event = events_get_event ($id);
|
||||||
|
@ -389,63 +389,6 @@ ui_require_jquery_file ('bgiframe');
|
||||||
/* <![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": "godmode/agentes/agent_manager",
|
|
||||||
"search_parents_2": 1,
|
|
||||||
"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);
|
|
||||||
|
|
||||||
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");
|
|
||||||
|
|
||||||
$("input[name=allbox]").change (function() {
|
$("input[name=allbox]").change (function() {
|
||||||
$("input[name='eventid[]']").attr('checked', $(this).attr('checked'));
|
$("input[name='eventid[]']").attr('checked', $(this).attr('checked'));
|
||||||
|
@ -531,7 +474,7 @@ $(document).ready( function() {
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
$("#comment_row_"+id).html(data);
|
$("#comment_row_"+id).html(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get event comment in header
|
// Get event comment in header
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "operation/events/events",
|
{"page" : "operation/events/events",
|
||||||
|
@ -645,7 +588,7 @@ $(document).ready( function() {
|
||||||
"get_comment" : 1,
|
"get_comment" : 1,
|
||||||
"id" : id
|
"id" : id
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
$("#comment_row_"+id).html(data);
|
$("#comment_row_"+id).html(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -656,7 +599,7 @@ $(document).ready( function() {
|
||||||
"id" : id
|
"id" : id
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
$("#comment_header_"+id).html(data);
|
$("#comment_header_"+id).html(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,13 +650,12 @@ $(document).ready( function() {
|
||||||
document.getElementById(divid).style.display = 'none';
|
document.getElementById(divid).style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
|
|
||||||
function toggleCommentForm(id_event) {
|
function toggleCommentForm(id_event) {
|
||||||
display = $('.event_form_' + id_event).css('display');
|
display = $('.event_form_' + id_event).css('display');
|
||||||
|
|
||||||
$('#select_validate_' + id_event).change (function() {
|
$('#select_validate_' + id_event).change (function() {
|
||||||
$option = $('#select_validate_' + id_event).val();
|
$option = $('#select_validate_' + id_event).val();
|
||||||
if ($option == 2) {
|
if ($option == 2) {
|
||||||
|
@ -738,7 +680,7 @@ $(document).ready( function() {
|
||||||
|
|
||||||
function toggleVisibleExtendedInfo(id_event) {
|
function toggleVisibleExtendedInfo(id_event) {
|
||||||
display = $('.event_info_' + id_event).css('display');
|
display = $('.event_info_' + id_event).css('display');
|
||||||
|
|
||||||
if (display != 'none') {
|
if (display != 'none') {
|
||||||
$('.event_info_' + id_event).css('display', 'none');
|
$('.event_info_' + id_event).css('display', 'none');
|
||||||
}
|
}
|
||||||
|
@ -746,4 +688,4 @@ $(document).ready( function() {
|
||||||
$('.event_info_' + id_event).css('display', '');
|
$('.event_info_' + id_event).css('display', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -308,14 +308,19 @@ html_print_input_text ('search', io_safe_output($search), '', 15);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
||||||
//Agent search
|
//Agent search
|
||||||
$src_code = html_print_image('images/lightning.png', true, false, true);
|
echo "<td>" . __('Agent search') . "</td>";
|
||||||
echo "<td>".__('Agent search')."</td><td>";
|
echo '<td class="datos">';
|
||||||
html_print_input_text_extended ('text_agent', $text_agent, 'text_id_agent', '', 30, 100, false, '',
|
$params = array();
|
||||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'))
|
$params['show_helptip'] = false;
|
||||||
. '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a>';
|
$params['input_name'] = 'id_agent';
|
||||||
|
$params['value'] = $text_agent;
|
||||||
|
ui_print_agent_autocomplete_input($params);
|
||||||
|
echo '</td>';
|
||||||
|
|
||||||
|
|
||||||
echo "</td></tr>";
|
|
||||||
|
|
||||||
|
echo "</tr>";
|
||||||
|
|
||||||
// User selectable block size
|
// User selectable block size
|
||||||
echo '<tr><td>';
|
echo '<tr><td>';
|
||||||
|
@ -765,7 +770,7 @@ foreach ($result as $event) {
|
||||||
|
|
||||||
if (in_array('id_agentmodule',$show_fields)) {
|
if (in_array('id_agentmodule',$show_fields)) {
|
||||||
$data[$i] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=data">'
|
$data[$i] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=data">'
|
||||||
.db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $event["id_agentmodule"]).'</a>';
|
.db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $event["id_agentmodule"]).'</a>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -776,7 +781,7 @@ foreach ($result as $event) {
|
||||||
WHERE id IN (SELECT id_alert_template
|
WHERE id IN (SELECT id_alert_template
|
||||||
FROM talert_template_modules
|
FROM talert_template_modules
|
||||||
WHERE id = ' . $event["id_alert_am"] . ');';
|
WHERE id = ' . $event["id_alert_am"] . ');';
|
||||||
|
|
||||||
$templateName = db_get_sql($sql);
|
$templateName = db_get_sql($sql);
|
||||||
$data[$i] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=alert">'.$templateName.'</a>';
|
$data[$i] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=alert">'.$templateName.'</a>';
|
||||||
}
|
}
|
||||||
|
@ -785,7 +790,7 @@ foreach ($result as $event) {
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('criticity',$show_fields)) {
|
if (in_array('criticity',$show_fields)) {
|
||||||
$data[$i] = get_priority_name ($event["criticity"]);
|
$data[$i] = get_priority_name ($event["criticity"]);
|
||||||
$i++;
|
$i++;
|
||||||
|
@ -815,7 +820,8 @@ foreach ($result as $event) {
|
||||||
else {
|
else {
|
||||||
$data[$i] = '';
|
$data[$i] = '';
|
||||||
}
|
}
|
||||||
$i++;
|
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('source',$show_fields)) {
|
if (in_array('source',$show_fields)) {
|
||||||
|
@ -835,7 +841,7 @@ foreach ($result as $event) {
|
||||||
if (($event["estado"] != 1) and (check_acl ($config["id_user"], $event["id_grupo"], "IW") == 1)) {
|
if (($event["estado"] != 1) and (check_acl ($config["id_user"], $event["id_grupo"], "IW") == 1)) {
|
||||||
$data[$i] .= '<a href="javascript: toggleCommentForm(' . $event['id_evento'] . ')" id="validate-'.$event["id_evento"].'">';
|
$data[$i] .= '<a href="javascript: toggleCommentForm(' . $event['id_evento'] . ')" id="validate-'.$event["id_evento"].'">';
|
||||||
$data[$i] .= html_print_image ("images/ok.png", true,
|
$data[$i] .= html_print_image ("images/ok.png", true,
|
||||||
array ("title" => __('Validate event')));
|
array ("title" => __('Validate event')));
|
||||||
$data[$i] .= '</a> ';
|
$data[$i] .= '</a> ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -854,12 +860,12 @@ foreach ($result as $event) {
|
||||||
array ("title" => __('Is not allowed delete events in process'))).' ';
|
array ("title" => __('Is not allowed delete events in process'))).' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[$i] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $event["id_evento"] . ');">';
|
$data[$i] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $event["id_evento"] . ');">';
|
||||||
$data[$i] .= html_print_image ("images/eye.png", true,
|
$data[$i] .= html_print_image ("images/eye.png", true,
|
||||||
array ("title" => __('Show more')));
|
array ("title" => __('Show more')));
|
||||||
$data[$i] .= '</a> ';
|
$data[$i] .= '</a> ';
|
||||||
|
|
||||||
// Create incident from this event
|
// Create incident from this event
|
||||||
if (check_acl ($config["id_user"], $event["id_grupo"], "IW") == 1) {
|
if (check_acl ($config["id_user"], $event["id_grupo"], "IW") == 1) {
|
||||||
if(isset($config['integria_enabled']) && $config['integria_enabled'] == 1) {
|
if(isset($config['integria_enabled']) && $config['integria_enabled'] == 1) {
|
||||||
|
@ -874,7 +880,7 @@ foreach ($result as $event) {
|
||||||
$data[$i] .= '</a>';
|
$data[$i] .= '</a>';
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if (check_acl ($config["id_user"], $event["id_grupo"], "IW") == 1) {
|
if (check_acl ($config["id_user"], $event["id_grupo"], "IW") == 1) {
|
||||||
//Checkbox
|
//Checkbox
|
||||||
$data[$i] = html_print_checkbox_extended ("eventid[]", $event["id_evento"], false, false, false, 'class="chk"', true);
|
$data[$i] = html_print_checkbox_extended ("eventid[]", $event["id_evento"], false, false, false, 'class="chk"', true);
|
||||||
|
@ -889,16 +895,16 @@ foreach ($result as $event) {
|
||||||
$string .= '<td align="left" width="450px"><b>' . html_print_textarea("comment_".$event["id_evento"], 2, 10, '', 'style="min-height: 10px; width: 250px;"', true) . '</b></td>';
|
$string .= '<td align="left" width="450px"><b>' . html_print_textarea("comment_".$event["id_evento"], 2, 10, '', 'style="min-height: 10px; width: 250px;"', true) . '</b></td>';
|
||||||
$string .= '<td align="left" width="200px">';
|
$string .= '<td align="left" width="200px">';
|
||||||
$string .= '<div style="text-align:center;">';
|
$string .= '<div style="text-align:center;">';
|
||||||
|
|
||||||
if($event["estado"] == 0) {
|
if($event["estado"] == 0) {
|
||||||
$string .= html_print_select(array('1' => __('Validate'), '2' => __('Set in process'), '3' => __('Add comment')), 'select_validate_'.$event["id_evento"], '', '', '', 0, true, false, false, 'select_validate').'<br><br>';
|
$string .= html_print_select(array('1' => __('Validate'), '2' => __('Set in process'), '3' => __('Add comment')), 'select_validate_'.$event["id_evento"], '', '', '', 0, true, false, false, 'select_validate').'<br><br>';
|
||||||
}
|
}
|
||||||
if($event["estado"] == 2) {
|
if($event["estado"] == 2) {
|
||||||
$string .= html_print_select(array('1' => __('Validate'), '3' => __('Add comment')), 'select_validate_'.$event["id_evento"], '', '', '', 0, true, false, false, 'select_validate').'<br><br>';
|
$string .= html_print_select(array('1' => __('Validate'), '3' => __('Add comment')), 'select_validate_'.$event["id_evento"], '', '', '', 0, true, false, false, 'select_validate').'<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$string .= '<a class="validate_event" href="javascript: toggleCommentForm(' . $event['id_evento'] . ')" id="validate-'.$event["id_evento"].'">';
|
$string .= '<a class="validate_event" href="javascript: toggleCommentForm(' . $event['id_evento'] . ')" id="validate-'.$event["id_evento"].'">';
|
||||||
|
|
||||||
$string .= html_print_button (__('Update'), 'validate', false, '', 'class="sub ok validate_event" id="validate-'.$event["id_evento"].'"', true).'</div>';
|
$string .= html_print_button (__('Update'), 'validate', false, '', 'class="sub ok validate_event" id="validate-'.$event["id_evento"].'"', true).'</div>';
|
||||||
$string .= '</a>';
|
$string .= '</a>';
|
||||||
$string .= '</td><td width="400px">';
|
$string .= '</td><td width="400px">';
|
||||||
|
@ -915,14 +921,14 @@ foreach ($result as $event) {
|
||||||
$table->colspan[$idx][0] = 10;
|
$table->colspan[$idx][0] = 10;
|
||||||
$table->rowstyle[$idx] = 'display: none;';
|
$table->rowstyle[$idx] = 'display: none;';
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
|
|
||||||
//Hiden row with extended description
|
//Hiden row with extended description
|
||||||
$string = '<table width="99%" style="border:solid 1px #D3D3D3;" class="toggle" cellpadding="6"><tr>';
|
$string = '<table width="99%" style="border:solid 1px #D3D3D3;" class="toggle" cellpadding="6"><tr>';
|
||||||
$string .= '<td align="left" valign="top" width="25%" border="solid 1px">';
|
$string .= '<td align="left" valign="top" width="25%" border="solid 1px">';
|
||||||
$string .= '<b>' . __('Event ID') . '</b></td><td align="left">';
|
$string .= '<b>' . __('Event ID') . '</b></td><td align="left">';
|
||||||
$string .= io_safe_output($event["id_evento"]);
|
$string .= io_safe_output($event["id_evento"]);
|
||||||
$string .= '</td></tr><tr class="rowOdd">';
|
$string .= '</td></tr><tr class="rowOdd">';
|
||||||
|
|
||||||
$string .= '<td align="left" valign="top" width="25%" border="solid 1px">';
|
$string .= '<td align="left" valign="top" width="25%" border="solid 1px">';
|
||||||
$string .= '<b>' . __('Event name') . '</b></td><td align="left">';
|
$string .= '<b>' . __('Event name') . '</b></td><td align="left">';
|
||||||
$string .= io_safe_output($event["evento"]);
|
$string .= io_safe_output($event["evento"]);
|
||||||
|
@ -953,7 +959,7 @@ foreach ($result as $event) {
|
||||||
$string .= date ($config["date_format"], strtotime($event["timestamp"]));
|
$string .= date ($config["date_format"], strtotime($event["timestamp"]));
|
||||||
}
|
}
|
||||||
$string .= '</td></tr><tr>';
|
$string .= '</td></tr><tr>';
|
||||||
|
|
||||||
$odd = 'rowOdd';
|
$odd = 'rowOdd';
|
||||||
|
|
||||||
$string .= '<td align="left" valign="top" width="15%">';
|
$string .= '<td align="left" valign="top" width="15%">';
|
||||||
|
@ -965,7 +971,7 @@ foreach ($result as $event) {
|
||||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||||
}
|
}
|
||||||
$string .= '</td></tr><tr class="'. $odd .'">';
|
$string .= '</td></tr><tr class="'. $odd .'">';
|
||||||
|
|
||||||
$odd = ($odd == '')? 'rowOdd' : '';
|
$odd = ($odd == '')? 'rowOdd' : '';
|
||||||
|
|
||||||
if ($event["id_agentmodule"] != 0) {
|
if ($event["id_agentmodule"] != 0) {
|
||||||
|
@ -1053,7 +1059,7 @@ foreach ($result as $event) {
|
||||||
$string .= '</td></tr><tr class="' . $odd . '">';
|
$string .= '</td></tr><tr class="' . $odd . '">';
|
||||||
$odd = ($odd == '')? 'rowOdd' : '';
|
$odd = ($odd == '')? 'rowOdd' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$string .= '</td></tr>';
|
$string .= '</td></tr>';
|
||||||
$odd = ($odd == '')? 'rowOdd' : '';
|
$odd = ($odd == '')? 'rowOdd' : '';
|
||||||
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td id="comment_row_' . $event['id_evento'] . '" align="left">';
|
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td id="comment_row_' . $event['id_evento'] . '" align="left">';
|
||||||
|
@ -1085,7 +1091,7 @@ foreach ($result as $event) {
|
||||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||||
$odd = ($odd == '')? 'rowOdd' : '';
|
$odd = ($odd == '')? 'rowOdd' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Source') . '</td><td align="left">';
|
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Source') . '</td><td align="left">';
|
||||||
if ($event["source"] != '') {
|
if ($event["source"] != '') {
|
||||||
$string .= $event["source"];
|
$string .= $event["source"];
|
||||||
|
@ -1157,6 +1163,17 @@ foreach ($result as $event) {
|
||||||
$string .= '</td></tr>';
|
$string .= '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Unknown instructions') . '</td><td align="left">';
|
||||||
|
if ($event["unknown_instructions"] != '') {
|
||||||
|
$string .= $event["unknown_instructions"];
|
||||||
|
$string .= '</td></tr><tr>';
|
||||||
|
$odd = ($odd == '')? 'rowOdd' : '';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||||
|
}
|
||||||
|
$string .= '</td></tr>';
|
||||||
|
|
||||||
$string .= '</table>';
|
$string .= '</table>';
|
||||||
|
|
||||||
$data = array($string);
|
$data = array($string);
|
||||||
|
@ -1210,7 +1227,6 @@ unset ($table);
|
||||||
/*
|
/*
|
||||||
<![CDATA[ */
|
<![CDATA[ */
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
|
|
||||||
// Don't collapse filter if update button has been pushed
|
// Don't collapse filter if update button has been pushed
|
||||||
if ($("#hidden-toogle_filter").val() == 'false'){
|
if ($("#hidden-toogle_filter").val() == 'false'){
|
||||||
$("#event_control").toggle ();
|
$("#event_control").toggle ();
|
||||||
|
@ -1224,7 +1240,7 @@ $(document).ready( function() {
|
||||||
|
|
||||||
$("#filter_id").change(function () {
|
$("#filter_id").change(function () {
|
||||||
// If selected 'none' flush filter
|
// If selected 'none' flush filter
|
||||||
if ( $("#filter_id").val() == 0 ){
|
if ( $("#filter_id").val() == 0 ) {
|
||||||
$("#text-id_name").val('');
|
$("#text-id_name").val('');
|
||||||
$("#ev_group").val(0);
|
$("#ev_group").val(0);
|
||||||
$("#event_type").val('');
|
$("#event_type").val('');
|
||||||
|
@ -1238,9 +1254,9 @@ $(document).ready( function() {
|
||||||
$("#group_rep").val(1);
|
$("#group_rep").val(1);
|
||||||
$("#tag").val('');
|
$("#tag").val('');
|
||||||
$("#filter_only_alert").val(-1);
|
$("#filter_only_alert").val(-1);
|
||||||
$("#row_name").css('visibility', 'hidden');
|
$("#row_name").css('visibility', 'hidden');
|
||||||
$("#submit-update_filter").css('visibility', 'hidden');
|
$("#submit-update_filter").css('visibility', 'hidden');
|
||||||
$("#id_group").val(0);
|
$("#id_group").val(0);
|
||||||
}
|
}
|
||||||
// If filter selected then load filter
|
// If filter selected then load filter
|
||||||
else {
|
else {
|
||||||
|
@ -1253,35 +1269,35 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
if (i == 'id_name')
|
if (i == 'id_name')
|
||||||
$("#text-id_name").val(val);
|
$("#text-id_name").val(val);
|
||||||
if (i == 'id_group')
|
if (i == 'id_group')
|
||||||
$("#ev_group").val(val);
|
$("#ev_group").val(val);
|
||||||
if (i == 'event_type')
|
if (i == 'event_type')
|
||||||
$("#event_type").val(val);
|
$("#event_type").val(val);
|
||||||
if (i == 'severity')
|
if (i == 'severity')
|
||||||
$("#severity").val(val);
|
$("#severity").val(val);
|
||||||
if (i == 'status')
|
if (i == 'status')
|
||||||
$("#status").val(val);
|
$("#status").val(val);
|
||||||
if (i == 'search')
|
if (i == 'search')
|
||||||
$("#text-search").val(val);
|
$("#text-search").val(val);
|
||||||
if (i == 'text_agent')
|
if (i == 'text_agent')
|
||||||
$("#text_id_agent").val(val);
|
$("#text_id_agent").val(val);
|
||||||
if (i == 'pagination')
|
if (i == 'pagination')
|
||||||
$("#pagination").val(val);
|
$("#pagination").val(val);
|
||||||
if (i == 'event_view_hr')
|
if (i == 'event_view_hr')
|
||||||
$("#text-event_view_hr").val(val);
|
$("#text-event_view_hr").val(val);
|
||||||
if (i == 'id_user_ack')
|
if (i == 'id_user_ack')
|
||||||
$("#id_user_ack").val(val);
|
$("#id_user_ack").val(val);
|
||||||
if (i == 'group_rep')
|
if (i == 'group_rep')
|
||||||
$("#group_rep").val(val);
|
$("#group_rep").val(val);
|
||||||
if (i == 'tag')
|
if (i == 'tag')
|
||||||
$("#tag").val(val);
|
$("#tag").val(val);
|
||||||
if (i == 'filter_only_alert')
|
if (i == 'filter_only_alert')
|
||||||
$("#filter_only_alert").val(val);
|
$("#filter_only_alert").val(val);
|
||||||
if (i == 'id_group_filter')
|
if (i == 'id_group_filter')
|
||||||
$("#id_group").val(val);
|
$("#id_group").val(val);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
|
@ -1293,7 +1309,8 @@ $(document).ready( function() {
|
||||||
// Checks if the filter has name or not
|
// Checks if the filter has name or not
|
||||||
if ($('#row_name').css('visibility') == 'hidden') {
|
if ($('#row_name').css('visibility') == 'hidden') {
|
||||||
$('#row_name').css('visibility', '');
|
$('#row_name').css('visibility', '');
|
||||||
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Define name and group for the filter and click on Save filter again'); ?> </h3>');
|
$('#show_filter_error')
|
||||||
|
.html('<h3 class="error"> <?php echo __('Define name and group for the filter and click on Save filter again'); ?> </h3>');
|
||||||
$('#filter_name_color').css('color', '#CC0000');
|
$('#filter_name_color').css('color', '#CC0000');
|
||||||
$('#filter_group_color').css('color', '#CC0000');
|
$('#filter_group_color').css('color', '#CC0000');
|
||||||
// If the filter has name insert in database
|
// If the filter has name insert in database
|
||||||
|
@ -1343,36 +1360,39 @@ $(document).ready( function() {
|
||||||
$('#filter_id').append ($('<option></option>').html ( <?php echo "'" . __('none') . "'" ?> ).attr ("value", 0));
|
$('#filter_id').append ($('<option></option>').html ( <?php echo "'" . __('none') . "'" ?> ).attr ("value", 0));
|
||||||
// Reload filters select
|
// Reload filters select
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "operation/events/events_list",
|
{
|
||||||
"get_event_filters" : 1
|
"page" : "operation/events/events_list",
|
||||||
},
|
"get_event_filters" : 1
|
||||||
function (data) {
|
},
|
||||||
jQuery.each (data, function (i, val) {
|
function (data) {
|
||||||
s = js_html_entity_decode(val);
|
jQuery.each (data, function (i, val) {
|
||||||
|
s = js_html_entity_decode(val);
|
||||||
if (i == id_filter_save){
|
|
||||||
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
|
if (i == id_filter_save){
|
||||||
}
|
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
|
||||||
else {
|
}
|
||||||
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
|
else {
|
||||||
}
|
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
|
||||||
});
|
}
|
||||||
},
|
});
|
||||||
"json"
|
},
|
||||||
);
|
"json"
|
||||||
|
);
|
||||||
$("#submit-update_filter").css('visibility', '');
|
$("#submit-update_filter").css('visibility', '');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// This updates an event filter
|
// This updates an event filter
|
||||||
$("#submit-update_filter").click(function () {
|
$("#submit-update_filter").click(function () {
|
||||||
|
|
||||||
// If the filter name is blank show error
|
// If the filter name is blank show error
|
||||||
if ($('#text-id_name').val() == '') {
|
if ($('#text-id_name').val() == '') {
|
||||||
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Filter name cannot be left blank'); ?> </h3>');
|
$('#show_filter_error')
|
||||||
|
.html('<h3 class="error"> <?php echo __('Filter name cannot be left blank'); ?> </h3>');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var id_filter_update = $("#filter_id").val();
|
var id_filter_update = $("#filter_id").val();
|
||||||
|
|
||||||
|
@ -1388,7 +1408,7 @@ $(document).ready( function() {
|
||||||
"search" : $("#text-search").val(),
|
"search" : $("#text-search").val(),
|
||||||
"text_agent" : $("#text_id_agent").val(),
|
"text_agent" : $("#text_id_agent").val(),
|
||||||
"pagination" : $("#pagination").val(),
|
"pagination" : $("#pagination").val(),
|
||||||
"event_view_hr" : $("#text-event_view_hr").val(),
|
"event_view_hr" : $("#text-event_view_hr").val(),
|
||||||
"id_user_ack" : $("#id_user_ack").val(),
|
"id_user_ack" : $("#id_user_ack").val(),
|
||||||
"group_rep" : $("#group_rep").val(),
|
"group_rep" : $("#group_rep").val(),
|
||||||
"tag" : $("#tag").val(),
|
"tag" : $("#tag").val(),
|
||||||
|
@ -1396,13 +1416,13 @@ $(document).ready( function() {
|
||||||
"id_group_filter": $("#id_group").val()
|
"id_group_filter": $("#id_group").val()
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data == 'ok'){
|
if (data == 'ok') {
|
||||||
$('#show_filter_error').html('<h3 class="suc"> <?php echo __('Filter updated'); ?> </h3>');
|
$('#show_filter_error').html('<h3 class="suc"> <?php echo __('Filter updated'); ?> </h3>');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Error updating filter'); ?> </h3>');
|
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Error updating filter'); ?> </h3>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// First remove all options of filters select
|
// First remove all options of filters select
|
||||||
$('#filter_id').find('option').remove().end();
|
$('#filter_id').find('option').remove().end();
|
||||||
|
@ -1415,20 +1435,20 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
s = js_html_entity_decode(val);
|
s = js_html_entity_decode(val);
|
||||||
if (i == id_filter_update){
|
if (i == id_filter_update) {
|
||||||
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
|
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
|
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Change toggle arrow when it's clicked
|
// Change toggle arrow when it's clicked
|
||||||
$("#tgl_event_control").click(function() {
|
$("#tgl_event_control").click(function() {
|
||||||
|
@ -1447,7 +1467,7 @@ $(document).ready( function() {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$("#toggle_arrow").attr('src', data);
|
$("#toggle_arrow").attr('src', data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var params = [];
|
var params = [];
|
||||||
|
@ -1467,8 +1487,6 @@ $(document).ready( function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -340,17 +340,7 @@ echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="datos"><b>'.__('Agent').'</b></td>';
|
echo '<td class="datos"><b>' . __('Agent') . '</b></td>';
|
||||||
echo '<td class="datos">';
|
|
||||||
//html_print_input_hidden('id_agent', $id_agent);
|
|
||||||
//html_print_input_text_extended ('agent', agents_get_name ($id_agent), 'text-agent', '', 30, 100, false, '', array('style' => 'background: url(images/lightning.png) no-repeat right;'));
|
|
||||||
//ui_print_help_tip(__("Type at least two characters to search"), false);
|
|
||||||
echo '</td>';
|
|
||||||
echo '</tr>';
|
|
||||||
|
|
||||||
//////////
|
|
||||||
echo '<tr>';
|
|
||||||
echo '<td class="datos"><b>'.__('Teste').'</b></td>';
|
|
||||||
echo '<td class="datos">';
|
echo '<td class="datos">';
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['show_helptip'] = true;
|
$params['show_helptip'] = true;
|
||||||
|
@ -389,9 +379,9 @@ echo "</div></form>";
|
||||||
|
|
||||||
//If we're actually working on an incident
|
//If we're actually working on an incident
|
||||||
if (isset ($id_inc)) {
|
if (isset ($id_inc)) {
|
||||||
// ********************************************************************
|
//******************************************************************
|
||||||
// Notes
|
// Notes
|
||||||
// ********************************************************************
|
//******************************************************************
|
||||||
|
|
||||||
echo '<div>';
|
echo '<div>';
|
||||||
|
|
||||||
|
@ -439,9 +429,9 @@ if (isset ($id_inc)) {
|
||||||
unset ($table);
|
unset ($table);
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************
|
//******************************************************************
|
||||||
// Files attached to this incident
|
// Files attached to this incident
|
||||||
// ************************************************************
|
//******************************************************************
|
||||||
|
|
||||||
$result = incidents_get_attach ($id_inc);
|
$result = incidents_get_attach ($id_inc);
|
||||||
|
|
||||||
|
@ -487,9 +477,9 @@ if (isset ($id_inc)) {
|
||||||
}
|
}
|
||||||
unset ($table);
|
unset ($table);
|
||||||
|
|
||||||
// ************************************************************
|
//******************************************************************
|
||||||
// Upload control
|
// Upload control
|
||||||
// ************************************************************
|
//******************************************************************
|
||||||
|
|
||||||
|
|
||||||
// Upload control
|
// Upload control
|
||||||
|
@ -510,9 +500,4 @@ if (isset ($id_inc)) {
|
||||||
</table></form></div>';
|
</table></form></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script>
|
|
||||||
$(document).ready (function () {
|
|
||||||
//agent_autocomplete('#text-agent', '#hidden-server_name', '#hidden-id_agent');
|
|
||||||
});
|
|
||||||
</script>
|
|
Loading…
Reference in New Issue