From a72abd8fc5956e66db7e3a1624953c63c58fd8c2 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 21 May 2012 10:28:35 +0000 Subject: [PATCH] 2012-05-21 Sergio Martin * include/javascript/pandora_alerts.js godmode/alerts/configure_alert_action.php: Added descrption of the selected command under the combo when select one in the action editor to help user. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6328 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/godmode/alerts/configure_alert_action.php | 6 ++++++ pandora_console/include/javascript/pandora_alerts.js | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7cae014c28..ce68dd8938 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2012-05-21 Sergio Martin + + * include/javascript/pandora_alerts.js + godmode/alerts/configure_alert_action.php: Added descrption of + the selected command under the combo when select one in + the action editor to help user. + 2012-05-21 Vanessa Gil * pandoradb.sql diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index efbc2b4c37..9ef44ad2d9 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -118,6 +118,7 @@ if (check_acl ($config['id_user'], 0, "PM")){ $table->data[2][1] .= __('Create Command'); $table->data[2][1] .= ''; } +$table->data[2][1] .= '
'; $table->data[3][0] = __('Threshold'); $table->data[3][1] = html_print_input_text ('action_threshold', $action_threshold, '', 5, 7, true); $table->data[3][1] .= ' '.__('seconds') . ui_print_help_icon ('action_threshold', true); @@ -159,6 +160,9 @@ $(document).ready (function () { echo addslashes($command); ?>"; render_command_preview (); + command_description = "",addslashes(io_safe_output(alerts_get_alert_command_description ($id_command)))); ?>"; + + render_command_description(command_description); $("#id_command").change (function () { values = Array (); @@ -173,6 +177,8 @@ $(document).ready (function () { function (data, status) { original_command = js_html_entity_decode (data["command"]); render_command_preview (original_command); + command_description = js_html_entity_decode (data["description"]); + render_command_description(command_description); }, "json" ); diff --git a/pandora_console/include/javascript/pandora_alerts.js b/pandora_console/include/javascript/pandora_alerts.js index 96b11dcaf4..f40c978e75 100644 --- a/pandora_console/include/javascript/pandora_alerts.js +++ b/pandora_console/include/javascript/pandora_alerts.js @@ -19,3 +19,9 @@ function parse_alert_command (command) { function render_command_preview () { $("#textarea_command_preview").text (parse_alert_command (original_command)); } +function render_command_description (command_description) { + if(command_description != '') { + command_description = '
'+command_description; + } + $("#command_description").html(command_description); +}