2012-10-09 18:05:32 +02:00
|
|
|
// Show the modal window of an event
|
2012-10-01 13:15:31 +02:00
|
|
|
function show_event_dialog(event_id, group_rep, dialog_page, result) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
if (dialog_page == undefined) {
|
|
|
|
dialog_page = "general";
|
|
|
|
}
|
|
|
|
|
|
|
|
var similar_ids = $("#hidden-similar_ids_" + event_id).val();
|
|
|
|
var timestamp_first = $("#hidden-timestamp_first_" + event_id).val();
|
|
|
|
var timestamp_last = $("#hidden-timestamp_last_" + event_id).val();
|
|
|
|
var user_comment = $("#hidden-user_comment_" + event_id).val();
|
|
|
|
var event_rep = $("#hidden-event_rep_" + event_id).val();
|
|
|
|
var server_id = $("#hidden-server_id_" + event_id).val();
|
|
|
|
var childrens_ids = $("#hidden-childrens_ids").val();
|
|
|
|
|
|
|
|
// Metaconsole mode flag
|
|
|
|
var meta = $("#hidden-meta").val();
|
|
|
|
|
|
|
|
// History mode flag
|
|
|
|
var history = $("#hidden-history").val();
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
ajax_file,
|
|
|
|
{
|
|
|
|
page: "include/ajax/events",
|
|
|
|
get_extended_event: 1,
|
|
|
|
group_rep: group_rep,
|
|
|
|
event_rep: event_rep,
|
|
|
|
dialog_page: dialog_page,
|
|
|
|
similar_ids: similar_ids,
|
|
|
|
timestamp_first: timestamp_first,
|
|
|
|
timestamp_last: timestamp_last,
|
|
|
|
user_comment: user_comment,
|
|
|
|
event_id: event_id,
|
|
|
|
server_id: server_id,
|
|
|
|
meta: meta,
|
|
|
|
childrens_ids: childrens_ids,
|
|
|
|
history: history
|
|
|
|
},
|
|
|
|
function(data, status) {
|
|
|
|
$("#event_details_window")
|
|
|
|
.hide()
|
|
|
|
.empty()
|
|
|
|
.append(data)
|
|
|
|
.dialog({
|
|
|
|
title: get_event_name(event_id, meta, history),
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
close: function() {
|
|
|
|
$("#refrcounter").countdown("resume");
|
|
|
|
$("div.vc-countdown").countdown("resume");
|
|
|
|
},
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 725,
|
|
|
|
height: 530
|
|
|
|
})
|
|
|
|
.show();
|
|
|
|
|
|
|
|
$("#refrcounter").countdown("pause");
|
|
|
|
$("div.vc-countdown").countdown("pause");
|
|
|
|
|
|
|
|
switch (result) {
|
|
|
|
case "comment_ok":
|
|
|
|
$("#notification_comment_success").show();
|
|
|
|
break;
|
|
|
|
case "comment_error":
|
|
|
|
$("#notification_comment_error").show();
|
|
|
|
break;
|
|
|
|
case "status_ok":
|
|
|
|
$("#notification_status_success").show();
|
|
|
|
break;
|
|
|
|
case "status_error":
|
|
|
|
$("#notification_status_error").show();
|
|
|
|
break;
|
|
|
|
case "owner_ok":
|
|
|
|
$("#notification_owner_success").show();
|
|
|
|
break;
|
|
|
|
case "owner_error":
|
|
|
|
$("#notification_owner_error").show();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
forced_title_callback();
|
|
|
|
},
|
|
|
|
"html"
|
|
|
|
);
|
|
|
|
return false;
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
|
|
|
|
2013-02-28 19:01:03 +01:00
|
|
|
function show_save_filter_dialog() {
|
2019-01-30 12:27:18 +01:00
|
|
|
$('input:radio[name="filter_mode"]')
|
|
|
|
.filter('[value="new"]')
|
|
|
|
.trigger("click");
|
|
|
|
$("#save_filter_layer")
|
|
|
|
.dialog({
|
|
|
|
title: $("#save_filter_text").html(),
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 688,
|
|
|
|
height: 200
|
|
|
|
})
|
|
|
|
.show();
|
|
|
|
return false;
|
2013-02-28 19:01:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function show_load_filter_dialog() {
|
2019-01-30 12:27:18 +01:00
|
|
|
$("#load_filter_layer")
|
|
|
|
.dialog({
|
|
|
|
title: $("#load_filter_text").html(),
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 520,
|
|
|
|
height: 300
|
|
|
|
})
|
|
|
|
.show();
|
|
|
|
return false;
|
2013-02-28 19:01:03 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 12:27:18 +01:00
|
|
|
// Check the response type and open it in a modal dialog or new window
|
2012-12-20 16:33:23 +01:00
|
|
|
function execute_response(event_id, server_id) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var response_id = $("#select_custom_response option:selected").val();
|
|
|
|
|
|
|
|
var response = get_response(response_id);
|
|
|
|
|
|
|
|
// If cannot get response abort it
|
|
|
|
if (response == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
response["target"] = get_response_target(event_id, response_id, server_id);
|
|
|
|
|
|
|
|
switch (response["type"]) {
|
|
|
|
case "command":
|
|
|
|
show_response_dialog(event_id, response_id, response);
|
|
|
|
break;
|
|
|
|
case "url":
|
|
|
|
if (response["new_window"] == 1) {
|
|
|
|
window.open(response["target"], "_blank");
|
|
|
|
} else {
|
|
|
|
show_response_dialog(event_id, response_id, response);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
2012-10-01 13:15:31 +02:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
//Show the modal window of an event response
|
|
|
|
function show_response_dialog(event_id, response_id, response) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("dialogue_event_response=1");
|
|
|
|
params.push("massive=0");
|
|
|
|
params.push("event_id=" + event_id);
|
|
|
|
params.push("target=" + response["target"]);
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
$("#event_response_window")
|
|
|
|
.hide()
|
|
|
|
.empty()
|
|
|
|
.append(data)
|
|
|
|
.dialog({
|
|
|
|
title: $("#select_custom_response option:selected").html(),
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: false,
|
|
|
|
open: function(event, ui) {
|
|
|
|
perform_response(response["target"], response_id);
|
|
|
|
},
|
|
|
|
width: response["modal_width"],
|
|
|
|
height: response["modal_height"]
|
|
|
|
})
|
|
|
|
.show();
|
|
|
|
}
|
|
|
|
});
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
2019-01-14 12:10:43 +01:00
|
|
|
//Show the modal window of event responses when multiple events are selected
|
2019-01-30 12:27:18 +01:00
|
|
|
function show_massive_response_dialog(
|
|
|
|
event_id,
|
|
|
|
response_id,
|
|
|
|
response,
|
|
|
|
out_iterator,
|
|
|
|
end
|
|
|
|
) {
|
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("dialogue_event_response=1");
|
|
|
|
params.push("massive=1");
|
|
|
|
params.push("end=" + end);
|
|
|
|
params.push("out_iterator=" + out_iterator);
|
|
|
|
params.push("event_id=" + event_id);
|
|
|
|
params.push("target=" + response["target"]);
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
response_tg: response["target"],
|
|
|
|
response_id: response_id,
|
|
|
|
out_iterator: out_iterator,
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
if (out_iterator === 0) $("#event_response_window").empty();
|
|
|
|
|
|
|
|
$("#event_response_window")
|
|
|
|
.hide()
|
|
|
|
.append(data)
|
|
|
|
.dialog({
|
|
|
|
title: $("#select_custom_response option:selected").html(),
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: false,
|
|
|
|
open: function(event, ui) {
|
|
|
|
$("#response_loading_dialog").hide();
|
|
|
|
$("#button-submit_event_response").show();
|
|
|
|
},
|
|
|
|
close: function(event, ui) {
|
|
|
|
$(".chk_val").prop("checked", false);
|
2019-02-27 10:59:44 +01:00
|
|
|
$("#event_response_command_window").dialog("close");
|
2019-01-30 12:27:18 +01:00
|
|
|
},
|
|
|
|
width: response["modal_width"],
|
|
|
|
height: response["modal_height"]
|
|
|
|
})
|
|
|
|
.show();
|
|
|
|
|
|
|
|
perform_response_massive(
|
|
|
|
this.response_tg,
|
|
|
|
this.response_id,
|
|
|
|
this.out_iterator
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
2019-01-14 12:10:43 +01:00
|
|
|
}
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
// Get an event response from db
|
|
|
|
function get_response(response_id) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var response = "";
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_response=1");
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
response = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return response;
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response params from db
|
|
|
|
function get_response_params(response_id) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var response_params;
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_response_params=1");
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
response_params = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return response_params;
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response description from db
|
|
|
|
function get_response_description(response_id) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var response_description = "";
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_response_description=1");
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
response_description = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return response_description;
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
2012-10-11 19:49:17 +02:00
|
|
|
// Get an event response description from db
|
2013-01-16 13:57:11 +01:00
|
|
|
function get_event_name(event_id, meta, history) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var name = "";
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_event_name=1");
|
|
|
|
params.push("event_id=" + event_id);
|
|
|
|
params.push("meta=" + meta);
|
|
|
|
params.push("history=" + history);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
name = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return name;
|
2012-10-11 19:49:17 +02:00
|
|
|
}
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
function add_row_param(id_table, param) {
|
2019-01-30 12:27:18 +01:00
|
|
|
$("#" + id_table).append(
|
2019-04-26 11:57:41 +02:00
|
|
|
'<tr class="params_rows"><td style="text-align:left; padding-left:40px; font-weight: normal; font-style: italic;">' +
|
2019-01-30 12:27:18 +01:00
|
|
|
param +
|
2019-04-26 11:57:41 +02:00
|
|
|
'</td><td style="text-align:left" colspan="2"><input type="text" name="' +
|
2019-01-30 12:27:18 +01:00
|
|
|
param +
|
|
|
|
'" id="' +
|
|
|
|
param +
|
|
|
|
'"></td></tr>'
|
|
|
|
);
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response from db
|
2019-02-27 10:59:44 +01:00
|
|
|
function get_response_target(
|
|
|
|
event_id,
|
|
|
|
response_id,
|
|
|
|
server_id,
|
|
|
|
response_command
|
|
|
|
) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var target = "";
|
|
|
|
|
|
|
|
// Replace the main macros
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_response_target=1");
|
|
|
|
params.push("event_id=" + event_id);
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
params.push("server_id=" + server_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
target = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-02-27 10:59:44 +01:00
|
|
|
// Replace the custom params macros.
|
2019-01-30 12:27:18 +01:00
|
|
|
var response_params = get_response_params(response_id);
|
|
|
|
if (response_params.length > 1 || response_params[0] != "") {
|
|
|
|
for (i = 0; i < response_params.length; i++) {
|
2019-02-27 10:59:44 +01:00
|
|
|
if (!response_command) {
|
|
|
|
target = target.replace(
|
|
|
|
"_" + response_params[i] + "_",
|
|
|
|
$("#" + response_params[i]).val()
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
target = target.replace(
|
|
|
|
"_" + response_params[i] + "_",
|
|
|
|
response_command[response_params[i] + "-" + i]
|
|
|
|
);
|
|
|
|
}
|
2019-01-30 12:27:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return target;
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Perform a response and put the output into a div
|
2017-08-24 13:25:03 +02:00
|
|
|
function perform_response(target, response_id) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
$("#re_exec_command").hide();
|
|
|
|
$("#response_loading_command").show();
|
|
|
|
$("#response_out").html("");
|
|
|
|
|
|
|
|
var finished = 0;
|
|
|
|
var time = Math.round(+new Date() / 1000);
|
|
|
|
var timeout = time + 10;
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("perform_event_response=1");
|
|
|
|
params.push("target=" + target);
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
var out = data.replace(/[\n|\r]/g, "<br>");
|
|
|
|
$("#response_out").html(out);
|
|
|
|
$("#response_loading_command").hide();
|
|
|
|
$("#re_exec_command").show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
2012-10-09 18:05:32 +02:00
|
|
|
}
|
|
|
|
|
2019-01-14 12:10:43 +01:00
|
|
|
// Perform a response and put the output into a div
|
|
|
|
function perform_response_massive(target, response_id, out_iterator) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
$("#re_exec_command").hide();
|
|
|
|
$("#response_loading_command_" + out_iterator).show();
|
|
|
|
$("#response_out_" + out_iterator).html("");
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("perform_event_response=1");
|
|
|
|
params.push("target=" + target);
|
|
|
|
params.push("response_id=" + response_id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
var out = data.replace(/[\n|\r]/g, "<br>");
|
|
|
|
$("#response_out_" + out_iterator).html(out);
|
|
|
|
$("#response_loading_command_" + out_iterator).hide();
|
|
|
|
$("#re_exec_command_" + out_iterator).show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
2019-01-14 12:10:43 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 10:59:44 +01:00
|
|
|
// Change the status of an event to new, in process or validated.
|
2012-10-11 19:49:17 +02:00
|
|
|
function event_change_status(event_ids) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var new_status = $("#estado").val();
|
|
|
|
var event_id = $("#hidden-id_event").val();
|
|
|
|
var meta = $("#hidden-meta").val();
|
|
|
|
var history = $("#hidden-history").val();
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("change_status=1");
|
|
|
|
params.push("event_ids=" + event_ids);
|
|
|
|
params.push("new_status=" + new_status);
|
|
|
|
params.push("meta=" + meta);
|
|
|
|
params.push("history=" + history);
|
|
|
|
|
|
|
|
$("#button-status_button").attr("disabled", "disabled");
|
|
|
|
$("#response_loading").show();
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
$("#button-status_button").removeAttr("disabled");
|
|
|
|
$("#response_loading").hide();
|
|
|
|
show_event_dialog(
|
|
|
|
event_id,
|
|
|
|
$("#hidden-group_rep").val(),
|
|
|
|
"responses",
|
|
|
|
data
|
|
|
|
);
|
|
|
|
if (data == "status_ok") {
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
// Change te owner of an event to one user of empty
|
2012-10-01 13:15:31 +02:00
|
|
|
function event_change_owner() {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var event_id = $("#hidden-id_event").val();
|
|
|
|
var new_owner = $("#id_owner").val();
|
|
|
|
var meta = $("#hidden-meta").val();
|
|
|
|
var history = $("#hidden-history").val();
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("change_owner=1");
|
|
|
|
params.push("event_id=" + event_id);
|
|
|
|
params.push("new_owner=" + new_owner);
|
|
|
|
params.push("meta=" + meta);
|
|
|
|
params.push("history=" + history);
|
|
|
|
|
|
|
|
$("#button-owner_button").attr("disabled", "disabled");
|
|
|
|
$("#response_loading").show();
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
$("#button-owner_button").removeAttr("disabled");
|
|
|
|
$("#response_loading").hide();
|
|
|
|
|
|
|
|
show_event_dialog(
|
|
|
|
event_id,
|
|
|
|
$("#hidden-group_rep").val(),
|
|
|
|
"responses",
|
|
|
|
data
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
// Save a comment into an event
|
2012-10-01 13:15:31 +02:00
|
|
|
function event_comment() {
|
2019-01-30 12:27:18 +01:00
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var event_id = $("#hidden-id_event").val();
|
|
|
|
var comment = $("#textarea_comment").val();
|
|
|
|
var meta = $("#hidden-meta").val();
|
|
|
|
var history = $("#hidden-history").val();
|
|
|
|
|
|
|
|
if (comment == "") {
|
|
|
|
show_event_dialog(
|
|
|
|
event_id,
|
|
|
|
$("#hidden-group_rep").val(),
|
|
|
|
"comments",
|
|
|
|
"comment_error"
|
|
|
|
);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("add_comment=1");
|
|
|
|
params.push("event_id=" + event_id);
|
|
|
|
params.push("comment=" + comment);
|
|
|
|
params.push("meta=" + meta);
|
|
|
|
params.push("history=" + history);
|
|
|
|
|
|
|
|
$("#button-comment_button").attr("disabled", "disabled");
|
|
|
|
$("#response_loading").show();
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
$("#button-comment_button").removeAttr("disabled");
|
|
|
|
$("#response_loading").show();
|
|
|
|
|
|
|
|
show_event_dialog(
|
|
|
|
event_id,
|
|
|
|
$("#hidden-group_rep").val(),
|
|
|
|
"comments",
|
|
|
|
data
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
2016-07-22 16:08:45 +02:00
|
|
|
|
|
|
|
//Show event list when fielter repetead is Group agents
|
2019-01-30 12:27:18 +01:00
|
|
|
function show_events_group_agent(id_insert, id_agent, server_id) {
|
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
parameter = [];
|
|
|
|
parameter.push({ name: "id_agent", value: id_agent });
|
|
|
|
parameter.push({ name: "server_id", value: server_id });
|
|
|
|
parameter.push({ name: "event_type", value: $("#event_type").val() });
|
|
|
|
parameter.push({ name: "severity", value: $("#severity").val() });
|
|
|
|
parameter.push({ name: "status", value: $("#status").val() });
|
|
|
|
parameter.push({ name: "search", value: $("#text-search").val() });
|
|
|
|
parameter.push({
|
|
|
|
name: "id_agent_module",
|
|
|
|
value: $("input:hidden[name=module_search_hidden]").val()
|
|
|
|
});
|
|
|
|
parameter.push({
|
|
|
|
name: "event_view_hr",
|
|
|
|
value: $("#text-event_view_hr").val()
|
|
|
|
});
|
|
|
|
parameter.push({ name: "id_user_ack", value: $("#id_user_ack").val() });
|
|
|
|
parameter.push({
|
|
|
|
name: "tag_with",
|
|
|
|
value: Base64.decode($("#hidden-tag_with").val())
|
|
|
|
});
|
|
|
|
parameter.push({
|
|
|
|
name: "tag_without",
|
|
|
|
value: Base64.decode($("#hidden-tag_without").val())
|
|
|
|
});
|
|
|
|
parameter.push({
|
|
|
|
name: "filter_only_alert",
|
|
|
|
value: $("#filter_only_alert").val()
|
|
|
|
});
|
|
|
|
parameter.push({ name: "date_from", value: $("#text-date_from").val() });
|
|
|
|
parameter.push({ name: "date_to", value: $("#text-date_to").val() });
|
|
|
|
parameter.push({ name: "server_id_search", value: $("#server_id").val() });
|
|
|
|
parameter.push({
|
|
|
|
name: "page",
|
|
|
|
value: "include/ajax/events"
|
|
|
|
});
|
|
|
|
parameter.push({
|
|
|
|
name: "get_list_events_agents",
|
|
|
|
value: 1
|
|
|
|
});
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
data: parameter,
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
$("#" + id_insert).html(data);
|
|
|
|
$("#" + id_insert).toggle();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-02-27 10:59:44 +01:00
|
|
|
|
|
|
|
function show_event_response_command_dialog(id, response, total_checked) {
|
|
|
|
var ajax_file = $("#hidden-ajax_file").val();
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_table_response_command=1");
|
|
|
|
params.push("event_response_id=" + id);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params.join("&"),
|
|
|
|
type: "POST",
|
|
|
|
url: (action = ajax_file),
|
|
|
|
dataType: "html",
|
|
|
|
success: function(data) {
|
|
|
|
$("#event_response_command_window")
|
|
|
|
.hide()
|
|
|
|
.empty()
|
|
|
|
.append(data)
|
|
|
|
.dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: false,
|
|
|
|
open: function() {
|
|
|
|
$("#response_loading_dialog").hide();
|
|
|
|
$("#button-submit_event_response").show();
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 300
|
|
|
|
})
|
|
|
|
.show();
|
|
|
|
|
|
|
|
$("#submit-enter_command").on("click", function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var response_command = [];
|
|
|
|
|
|
|
|
$(".response_command_input").each(function() {
|
|
|
|
response_command[$(this).attr("name")] = $(this).val();
|
|
|
|
});
|
|
|
|
|
|
|
|
check_massive_response_event(
|
|
|
|
id,
|
|
|
|
response,
|
|
|
|
total_checked,
|
|
|
|
response_command
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|