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) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2013-07-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php,
include/javascript/jquery.pandora.controls.js: improved the
functions to pass the php vars to js, now it supports json.
* include/javascript/d3.v3.js: added this library for to make
beautiful things.
* include/functions_ui.php, include/graphs/fgraph.php,
include/javascript/pandora_events.js, include/javascript/pandora.js,
include/functions_treeview.php,
include/include_graph_dependencies.php,
include/functions_categories.php, include/db/postgresql.php,
include/db/oracle.php, include/db/mysql.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8528 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-07-16 16:13:23 +02:00
|
|
|
if (dialog_page == undefined) {
|
2012-10-01 13:15:31 +02:00
|
|
|
dialog_page = 'general';
|
|
|
|
}
|
2012-10-11 19:49:17 +02:00
|
|
|
|
|
|
|
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();
|
2012-12-18 12:54:22 +01:00
|
|
|
var server_id = $('#hidden-server_id_'+event_id).val();
|
2014-11-18 11:41:42 +01:00
|
|
|
var childrens_ids = $('#hidden-childrens_ids').val();
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-12-18 12:54:22 +01:00
|
|
|
// Metaconsole mode flag
|
|
|
|
var meta = $('#hidden-meta').val();
|
|
|
|
|
2013-01-16 13:57:11 +01:00
|
|
|
// History mode flag
|
|
|
|
var history = $('#hidden-history').val();
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-12-18 12:54:22 +01:00
|
|
|
jQuery.post (ajax_file,
|
2012-10-01 13:15:31 +02:00
|
|
|
{"page": "include/ajax/events",
|
|
|
|
"get_extended_event": 1,
|
|
|
|
"group_rep": group_rep,
|
2012-10-11 19:49:17 +02:00
|
|
|
"event_rep": event_rep,
|
2012-10-01 13:15:31 +02:00
|
|
|
"dialog_page": dialog_page,
|
2012-10-11 19:49:17 +02:00
|
|
|
"similar_ids": similar_ids,
|
|
|
|
"timestamp_first": timestamp_first,
|
|
|
|
"timestamp_last": timestamp_last,
|
|
|
|
"user_comment": user_comment,
|
2012-12-18 12:54:22 +01:00
|
|
|
"event_id": event_id,
|
|
|
|
"server_id": server_id,
|
2013-01-16 13:57:11 +01:00
|
|
|
"meta": meta,
|
2014-11-18 11:41:42 +01:00
|
|
|
"childrens_ids": childrens_ids,
|
2013-01-16 13:57:11 +01:00
|
|
|
"history": history},
|
2012-10-01 13:15:31 +02:00
|
|
|
function (data, status) {
|
2012-10-09 18:05:32 +02:00
|
|
|
$("#event_details_window").hide ()
|
2012-10-01 13:15:31 +02:00
|
|
|
.empty ()
|
|
|
|
.append (data)
|
|
|
|
.dialog ({
|
2013-01-16 13:57:11 +01:00
|
|
|
title: get_event_name(event_id, meta, history),
|
2012-10-01 13:15:31 +02:00
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
2013-09-09 18:21:45 +02:00
|
|
|
width: 725,
|
Changes some bad colors and others aesthetic changes. Thanks Carla.
2014-09-04 Miguel de Dios <miguel.dedios@artica.es>
* pandora_console/extensions/module_groups.php,
pandora_console/general/login_help_dialog.php,
pandora_console/images/close_button_dialog.png,
pandora_console/images/documentation.png,
pandora_console/images/enterprise_version.png,
pandora_console/images/error_login.png,
pandora_console/images/online_help.png,
pandora_console/images/support.png,
pandora_console/include/ajax/events.php,
pandora_console/include/constants.php,
pandora_console/include/functions_events.php,
pandora_console/include/javascript/pandora_events.js,
pandora_console/include/styles/jquery-ui-1.10.0.custom.css,
pandora_console/include/styles/pandora.css,
pandora_console/mobile/include/style/main.css,
pandora_console/operation/events/events_list.php: changes some
bad colors and others aesthetic changes. Thanks Carla.
2014-09-04 12:19:55 +02:00
|
|
|
height: 530
|
2012-10-01 13:15:31 +02:00
|
|
|
})
|
|
|
|
.show ();
|
|
|
|
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
switch (result) {
|
2012-10-01 13:15:31 +02:00
|
|
|
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;
|
|
|
|
}
|
Changes some bad colors and others aesthetic changes. Thanks Carla.
2014-09-04 Miguel de Dios <miguel.dedios@artica.es>
* pandora_console/extensions/module_groups.php,
pandora_console/general/login_help_dialog.php,
pandora_console/images/close_button_dialog.png,
pandora_console/images/documentation.png,
pandora_console/images/enterprise_version.png,
pandora_console/images/error_login.png,
pandora_console/images/online_help.png,
pandora_console/images/support.png,
pandora_console/include/ajax/events.php,
pandora_console/include/constants.php,
pandora_console/include/functions_events.php,
pandora_console/include/javascript/pandora_events.js,
pandora_console/include/styles/jquery-ui-1.10.0.custom.css,
pandora_console/include/styles/pandora.css,
pandora_console/mobile/include/style/main.css,
pandora_console/operation/events/events_list.php: changes some
bad colors and others aesthetic changes. Thanks Carla.
2014-09-04 12:19:55 +02:00
|
|
|
|
2013-04-16 12:10:44 +02:00
|
|
|
forced_title_callback();
|
2012-10-01 13:15:31 +02:00
|
|
|
},
|
|
|
|
"html"
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
);
|
2012-10-01 13:15:31 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-02-28 19:01:03 +01:00
|
|
|
function show_save_filter_dialog() {
|
|
|
|
$('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: 420,
|
|
|
|
height: 200
|
|
|
|
})
|
|
|
|
.show ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_load_filter_dialog() {
|
|
|
|
$("#load_filter_layer").dialog ({
|
|
|
|
title: $('#load_filter_text').html(),
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 420,
|
|
|
|
height: 200
|
|
|
|
})
|
|
|
|
.show ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-10-09 18:05:32 +02: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) {
|
2012-10-09 18:05:32 +02:00
|
|
|
var response_id = $('#select_custom_response option:selected').val();
|
|
|
|
|
|
|
|
var response = get_response(response_id);
|
|
|
|
|
|
|
|
// If cannot get response abort it
|
2013-07-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php,
include/javascript/jquery.pandora.controls.js: improved the
functions to pass the php vars to js, now it supports json.
* include/javascript/d3.v3.js: added this library for to make
beautiful things.
* include/functions_ui.php, include/graphs/fgraph.php,
include/javascript/pandora_events.js, include/javascript/pandora.js,
include/functions_treeview.php,
include/include_graph_dependencies.php,
include/functions_categories.php, include/db/postgresql.php,
include/db/oracle.php, include/db/mysql.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8528 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-07-16 16:13:23 +02:00
|
|
|
if (response == null) {
|
2012-10-09 18:05:32 +02:00
|
|
|
return;
|
|
|
|
}
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-12-20 16:33:23 +01:00
|
|
|
response['target'] = get_response_target(event_id, response_id, server_id);
|
2012-10-09 18:05:32 +02:00
|
|
|
|
|
|
|
switch(response['type']) {
|
|
|
|
case 'command':
|
|
|
|
show_response_dialog(event_id, response_id, response);
|
|
|
|
break;
|
|
|
|
case 'url':
|
2013-07-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php,
include/javascript/jquery.pandora.controls.js: improved the
functions to pass the php vars to js, now it supports json.
* include/javascript/d3.v3.js: added this library for to make
beautiful things.
* include/functions_ui.php, include/graphs/fgraph.php,
include/javascript/pandora_events.js, include/javascript/pandora.js,
include/functions_treeview.php,
include/include_graph_dependencies.php,
include/functions_categories.php, include/db/postgresql.php,
include/db/oracle.php, include/db/mysql.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8528 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-07-16 16:13:23 +02:00
|
|
|
if (response['new_window'] == 1) {
|
2012-10-09 18:05:32 +02:00
|
|
|
window.open(response['target'],'_blank');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
show_response_dialog(event_id, response_id, response);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
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) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("dialogue_event_response=1");
|
|
|
|
params.push("event_id="+event_id);
|
|
|
|
params.push("target="+response['target']);
|
|
|
|
params.push("response_id="+response_id);
|
|
|
|
|
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-09 18:05:32 +02:00
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
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']);
|
|
|
|
},
|
|
|
|
width: response['modal_width'],
|
|
|
|
height: response['modal_height']
|
|
|
|
})
|
|
|
|
.show ();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response from db
|
|
|
|
function get_response(response_id) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
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',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-09 18:05:32 +02:00
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'json',
|
|
|
|
success: function (data) {
|
|
|
|
response = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response params from db
|
|
|
|
function get_response_params(response_id) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
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',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-09 18:05:32 +02:00
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'json',
|
|
|
|
success: function (data) {
|
|
|
|
response_params = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return response_params;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response description from db
|
|
|
|
function get_response_description(response_id) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
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',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-09 18:05:32 +02:00
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
|
|
|
response_description = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return response_description;
|
|
|
|
}
|
|
|
|
|
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) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-10-11 19:49:17 +02:00
|
|
|
var name = '';
|
|
|
|
|
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("get_event_name=1");
|
|
|
|
params.push("event_id="+event_id);
|
2012-12-18 12:54:22 +01:00
|
|
|
params.push("meta="+meta);
|
2013-01-16 13:57:11 +01:00
|
|
|
params.push("history="+history);
|
2012-10-11 19:49:17 +02:00
|
|
|
|
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-11 19:49:17 +02:00
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
|
|
|
name = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
function add_row_param(id_table, param) {
|
|
|
|
$('#'+id_table).append('<tr class="params_rows"><td style="text-align:left; padding-left:40px;">'+param+'</td><td style="text-align:left"><input type="text" name="'+param+'" id="'+param+'"></td></tr>');
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get an event response from db
|
2012-12-20 16:33:23 +01:00
|
|
|
function get_response_target(event_id, response_id, server_id) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
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);
|
2012-12-20 16:33:23 +01:00
|
|
|
params.push("server_id="+server_id);
|
2012-10-09 18:05:32 +02:00
|
|
|
|
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-09 18:05:32 +02:00
|
|
|
async: false,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
|
|
|
target = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Replace the custom params macros
|
|
|
|
var response_params = get_response_params(response_id);
|
|
|
|
|
2013-07-17 13:12:37 +02:00
|
|
|
if (response_params.length > 1 || response_params[0] != '') {
|
|
|
|
for (i = 0; i < response_params.length; i++) {
|
2012-10-09 18:05:32 +02:00
|
|
|
target = target.replace('_'+response_params[i]+'_',$('#'+response_params[i]).val());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Perform a response and put the output into a div
|
|
|
|
function perform_response(target) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
2013-07-17 13:12:37 +02:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#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);
|
|
|
|
|
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-09 18:05:32 +02:00
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
2014-02-25 13:38:53 +01:00
|
|
|
if (data == '') {
|
|
|
|
$('#response_out').html('<i>No output</i>');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
var out = data.replace(/[\n|\r]/g, "<br>");
|
|
|
|
$('#response_out').html(out);
|
|
|
|
}
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading_command').hide();
|
|
|
|
$('#re_exec_command').show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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) {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
var new_status = $('#estado').val();
|
2012-10-11 19:49:17 +02:00
|
|
|
var event_id = $('#hidden-id_event').val();
|
2012-12-18 12:54:22 +01:00
|
|
|
var meta = $('#hidden-meta').val();
|
2013-01-16 13:57:11 +01:00
|
|
|
var history = $('#hidden-history').val();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
var params = [];
|
|
|
|
params.push("page=include/ajax/events");
|
|
|
|
params.push("change_status=1");
|
2012-10-11 19:49:17 +02:00
|
|
|
params.push("event_ids="+event_ids);
|
2012-10-01 13:15:31 +02:00
|
|
|
params.push("new_status="+new_status);
|
2012-12-18 12:54:22 +01:00
|
|
|
params.push("meta="+meta);
|
2013-01-16 13:57:11 +01:00
|
|
|
params.push("history="+history);
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
$('#button-status_button').attr('disabled','disabled');
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading').show();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-01 13:15:31 +02:00
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
|
|
|
$('#button-status_button').removeAttr('disabled');
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading').hide();
|
|
|
|
show_event_dialog(event_id, $('#hidden-group_rep').val(), 'responses', data);
|
2013-07-17 13:12:37 +02:00
|
|
|
if (data == 'status_ok') {
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
}
|
|
|
|
}
|
2013-07-17 13:12:37 +02:00
|
|
|
});
|
2012-10-01 13:15:31 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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() {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
var event_id = $('#hidden-id_event').val();
|
|
|
|
var new_owner = $('#id_owner').val();
|
2012-12-18 12:54:22 +01:00
|
|
|
var meta = $('#hidden-meta').val();
|
2013-01-16 13:57:11 +01:00
|
|
|
var history = $('#hidden-history').val();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
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);
|
2012-12-18 12:54:22 +01:00
|
|
|
params.push("meta="+meta);
|
2013-01-16 13:57:11 +01:00
|
|
|
params.push("history="+history);
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
$('#button-owner_button').attr('disabled','disabled');
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading').show();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-01 13:15:31 +02:00
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
|
|
|
$('#button-owner_button').removeAttr('disabled');
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading').hide();
|
|
|
|
|
|
|
|
show_event_dialog(event_id, $('#hidden-group_rep').val(), 'responses', data);
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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() {
|
2012-12-18 12:54:22 +01:00
|
|
|
var ajax_file = $('#hidden-ajax_file').val();
|
2013-07-17 13:12:37 +02:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
var event_id = $('#hidden-id_event').val();
|
|
|
|
var comment = $('#textarea_comment').val();
|
2012-12-18 12:54:22 +01:00
|
|
|
var meta = $('#hidden-meta').val();
|
2013-01-16 13:57:11 +01:00
|
|
|
var history = $('#hidden-history').val();
|
2013-07-17 13:12:37 +02:00
|
|
|
|
|
|
|
if (comment == '') {
|
2012-10-01 13:15:31 +02:00
|
|
|
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);
|
2012-12-18 12:54:22 +01:00
|
|
|
params.push("meta="+meta);
|
2013-01-16 13:57:11 +01:00
|
|
|
params.push("history="+history);
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
$('#button-comment_button').attr('disabled','disabled');
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading').show();
|
2013-07-17 13:12:37 +02:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
jQuery.ajax ({
|
|
|
|
data: params.join ("&"),
|
|
|
|
type: 'POST',
|
2012-12-18 12:54:22 +01:00
|
|
|
url: action=ajax_file,
|
2012-10-01 13:15:31 +02:00
|
|
|
async: true,
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'html',
|
|
|
|
success: function (data) {
|
|
|
|
$('#button-comment_button').removeAttr('disabled');
|
2012-10-09 18:05:32 +02:00
|
|
|
$('#response_loading').show();
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
show_event_dialog(event_id, $('#hidden-group_rep').val(), 'comments', data);
|
|
|
|
}
|
2013-07-17 13:12:37 +02:00
|
|
|
});
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|