From 6cd21beca0f3ce6ec37897cfda74604b10ea4e69 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Fri, 30 May 2014 10:34:21 +0000 Subject: [PATCH] 2014-05-30 Sergio Martin * general/news_dialog.php: Missed file in last commit * godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php include/javascript/pandora_alerts.js: fixed preview of commands in action configuration and changed the text input by a textarea in command configuration for ticket: #852 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10046 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++ pandora_console/general/news_dialog.php | 104 ++++++++++++++++++ .../godmode/alerts/configure_alert_action.php | 5 +- .../alerts/configure_alert_command.php | 2 +- .../include/javascript/pandora_alerts.js | 10 +- 5 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 pandora_console/general/news_dialog.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 32c9630f79..4a5030db99 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2014-05-30 Sergio Martin + + * general/news_dialog.php: Missed file in last commit + + * godmode/alerts/configure_alert_action.php + godmode/alerts/configure_alert_command.php + include/javascript/pandora_alerts.js: fixed preview + of commands in action configuration and changed the + text input by a textarea in command configuration for + ticket: #852 + 2014-05-30 Sergio Martin * general/logon_ok.php diff --git a/pandora_console/general/news_dialog.php b/pandora_console/general/news_dialog.php new file mode 100644 index 0000000000..136f70db71 --- /dev/null +++ b/pandora_console/general/news_dialog.php @@ -0,0 +1,104 @@ + $v) { + $news[$k]['text'] = io_safe_output($v['text']); + $news[$k]['subject'] = io_safe_output($v['subject']); +} + +if (!empty($news)) { + $options = array(); + $options['id'] = 'news_json'; + $options['hidden'] = 1; + $options['content'] = base64_encode(json_encode($news)); + html_print_div($options); +} + +// Prints news dialog template +echo ''; + +ui_require_javascript_file ('encode_decode_base64'); +?> + + diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 72bd980401..3049d9395b 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -255,12 +255,13 @@ $(document).ready (function () { } render_command_preview(original_command); - + render_command_recovery_preview(original_command); + $(".fields").keyup (function() { render_command_preview(original_command); }); $(".fields_recovery").keyup (function() { - render_command_preview(original_command); + render_command_recovery_preview(original_command); }); }, "json" diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index c35938560b..82731336d2 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -77,7 +77,7 @@ $table->data[0][2] = html_print_input_text ('name', $name, '', 35, 255, true); $table->colspan[1][1] = 3; $table->data[1][0] = __('Command'); $table->data[1][0] .= ui_print_help_icon ('alert_macros', true); -$table->data[1][1] = html_print_input_text ('command', $command, '', 80, 255, true); +$table->data[1][1] = html_print_textarea ('command', 8, 30, $command, '', true); $table->colspan[2][1] = 3; $table->data[2][0] = __('Description'); diff --git a/pandora_console/include/javascript/pandora_alerts.js b/pandora_console/include/javascript/pandora_alerts.js index 6d6afa3193..ea84156dff 100644 --- a/pandora_console/include/javascript/pandora_alerts.js +++ b/pandora_console/include/javascript/pandora_alerts.js @@ -1,10 +1,13 @@ var original_command = ""; function parse_alert_command (command, classs) { - classs = 'field'; if (classs == 'recovery') { - classs = 'field_recovery'; + classs = 'fields_recovery'; } + else { + classs = 'fields'; + } + var nfield = 1; $('.' + classs).each(function() { // Only render values different from '' @@ -22,6 +25,9 @@ function parse_alert_command (command, classs) { function render_command_preview (original_command) { $("#textarea_command_preview").text (parse_alert_command (original_command, '')); +} + +function render_command_recovery_preview (original_command) { $("#textarea_command_recovery_preview").text (parse_alert_command (original_command, 'recovery')); }