diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index deee17606d..a1ba30ff98 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-09-20 Sergio Martin <sergio.martin@artica.es> + + * godmode/alerts/alert_list.list.php + godmode/alerts/alert_list.builder.php: Fix the alerts creation + to allow create an alert with default action. bug #2353 + Improve default actions string too. + 2013-09-18 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * godmode/alerts/configure_alert_action.php: Fix update diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index b37513bb2d..f9686c49e7 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -106,10 +106,9 @@ if (!empty($groups_user)) { $sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)"; $actions = db_get_all_rows_sql($sql); } - $table->data[2][1] = '<div class="actions_container">'; -$table->data[2][1] = html_print_select(index_array ($actions, 'id', 'name'),'action_select','','','','',true, '', true, '', false, 'width: 250px;'); -$table->data[2][1] .= '<span id="advanced_action" class="advanced_actions"><br>'; +$table->data[2][1] .= html_print_select(index_array ($actions, 'id', 'name'),'action_select','','',__('Default action'),'0',true, '', true, '', false, 'width: 250px;'); +$table->data[2][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>'; $table->data[2][1] .= __('Number of alerts match from').' '; $table->data[2][1] .= html_print_input_text ('fires_min', '', '', 4, 10, true); $table->data[2][1] .= ' '.__('to').' '; @@ -176,8 +175,8 @@ $(document).ready (function () { $("#action_loading").show (); }); - $("#action_select").change(function () { - if ($("#action_select").attr ("value") != '0') { + $(".actions_container [name='action_select']").change(function () { + if ($(this).val() != '0') { $('#advanced_action').show(); } else { diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 04a9059e63..bf8361f8e6 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -457,7 +457,7 @@ foreach ($simple_alerts as $alert) { WHERE id = ".$alert["id_alert_template"]); if ($default_action != "") { $data[3] .= "<tr><td>"; - $data[3] .= __("Default"). " : ".db_get_sql ("SELECT name FROM talert_actions WHERE id = $default_action"); + $data[3] .= __("Default"). " : ".db_get_sql ("SELECT name FROM talert_actions WHERE id = $default_action") . ' <em>(' . __('Always') . ')</em>'; $data[3] .= "</td>"; $data[3] .= "<td></td>"; $data[3] .= "</tr>";