From b610e6deded070ee96237a21bcc2a06af743b77f Mon Sep 17 00:00:00 2001 From: esanchezm Date: Wed, 25 Mar 2009 14:09:20 +0000 Subject: [PATCH] 2009-03-25 Esteban Sanchez * include/functions_alerts.php: Typo errors on "proces". Fixed an error on create_alert_command() parameters. * godmode/alerts/alert_commands.php: Fixed sec parameter on delete link. * godmode/alerts/configure_alert_command.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/configure_alert_template.php, godmode/alerts/configure_alert_action.php: Fixed textarea sizes. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1561 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 13 +++++++++++++ pandora_console/godmode/alerts/alert_commands.php | 4 ++-- .../godmode/alerts/configure_alert_action.php | 4 ++-- .../godmode/alerts/configure_alert_command.php | 2 +- .../godmode/alerts/configure_alert_compound.php | 4 ++-- .../godmode/alerts/configure_alert_template.php | 4 ++-- pandora_console/include/functions_alerts.php | 10 +++++----- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6b8a943906..ae6e4aa622 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2009-03-25 Esteban Sanchez + + * include/functions_alerts.php: Typo errors on "proces". Fixed an + error on create_alert_command() parameters. + + * godmode/alerts/alert_commands.php: Fixed sec parameter on delete + link. + + * godmode/alerts/configure_alert_command.php, + godmode/alerts/configure_alert_compound.php, + godmode/alerts/configure_alert_template.php, + godmode/alerts/configure_alert_action.php: Fixed textarea sizes. + 2009-03-25 Esteban Sanchez * include/functions_alerts.php: Finished the alerts API by removing diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 22b86c894a..1f3ea4a7e0 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -79,7 +79,7 @@ if ($update_command) { } if ($delete_command) { - $id = get_parameter ('id'); + $id = (int) get_parameter ('id'); // Internal commands cannot be deleted if (get_alert_command_internal ($id)) { @@ -124,7 +124,7 @@ foreach ($commands as $command) { $data[1] = $command['description']; $data[2] = ''; if (! $command['internal']) - $data[2] = ''. ''; diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index e48c6fb83a..c4e9a27a6e 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -67,10 +67,10 @@ $table->data[3][0] = __('Field 2'); $table->data[3][1] = print_input_text ('field2', $field2, '', 35, 255, true); $table->data[4][0] = __('Field 3'); -$table->data[4][1] = print_textarea ('field3', 30, 30, $field3, '', true); +$table->data[4][1] = print_textarea ('field3', 10, 30, $field3, '', true); $table->data[6][0] = __('Command preview'); -$table->data[6][1] = print_textarea ('command_preview', 30, 30, '', 'disabled="disabled"', true); +$table->data[6][1] = print_textarea ('command_preview', 10, 30, '', 'disabled="disabled"', true); echo '
'; print_table ($table); diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index 7510f7b2c0..91e1be13c9 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -54,7 +54,7 @@ $table->data[0][1] = print_input_text ('name', $name, '', 35, 255, true); $table->data[1][0] = __('Command'); $table->data[1][1] = print_input_text ('command', $command, '', 35, 255, true); $table->data[2][0] = __('Description'); -$table->data[2][1] = print_textarea ('description', 30, 30, $description, '', true); +$table->data[2][1] = print_textarea ('description', 10, 30, $description, '', true); echo ''; print_table ($table); diff --git a/pandora_console/godmode/alerts/configure_alert_compound.php b/pandora_console/godmode/alerts/configure_alert_compound.php index cccaf38876..3044b513fe 100644 --- a/pandora_console/godmode/alerts/configure_alert_compound.php +++ b/pandora_console/godmode/alerts/configure_alert_compound.php @@ -409,7 +409,7 @@ if ($step == 2) { $field2_recovery, '', 35, 255, true); $table->data['field3'][0] = __('Field 3'); - $table->data['field3'][1] = print_textarea ('field3_recovery', 30, 30, + $table->data['field3'][1] = print_textarea ('field3_recovery', 10, 30, $field3_recovery, '', true); } else { /* Step 1 by default */ @@ -435,7 +435,7 @@ if ($step == 2) { $table->data[1][1] = print_select (get_group_agents (), 'id_agent', $id_agent, '', __('Select'), 0, true); $table->data[2][0] = __('Description'); - $table->data[2][1] = print_textarea ('description', 30, 30, + $table->data[2][1] = print_textarea ('description', 10, 30, $description, '', true); $table->data[3][0] = __('Condition'); diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 338ae80d51..d00a21b4d3 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -390,7 +390,7 @@ if ($step == 2) { $field2_recovery, '', 35, 255, true); $table->data['field3'][0] = __('Field 3'); - $table->data['field3'][1] = print_textarea ('field3_recovery', 30, 30, + $table->data['field3'][1] = print_textarea ('field3_recovery', 10, 30, $field3_recovery, '', true); } else { /* Step 1 by default */ @@ -425,7 +425,7 @@ if ($step == 2) { $table->data[0][1] = print_input_text ('name', $name, '', 35, 255, true); $table->data[1][0] = __('Description'); - $table->data[1][1] = print_textarea ('description', 30, 30, + $table->data[1][1] = print_textarea ('description', 10, 30, $description, '', true); $table->data[2][0] = __('Condition type'); diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index cc65dcd0c7..8b4c4fabca 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -25,7 +25,7 @@ function create_alert_command ($name, $command, $values = false) { if (! is_array ($values)) $values = array (); $values['name'] = $name; - $values['description'] = $description; + $values['command'] = $command; return @process_sql_insert ('talert_commands', $values); } @@ -47,7 +47,7 @@ function delete_alert_command ($id_alert_command) { if (empty ($id_alert_command)) return false; - return (@proces_sql_delete ('talert_commands', + return (@process_sql_delete ('talert_commands', array ('id' => $id_alert_command))) !== false; } @@ -103,7 +103,7 @@ function create_alert_action ($name, $id_alert_command, $values = false) { $values['name'] = $name; $values['id_alert_command'] = $id_alert_command; - return @proces_sql_insert ('talert_actions', $values); + return @process_sql_insert ('talert_actions', $values); } function update_alert_action ($id_alert_action, $values) { @@ -113,7 +113,7 @@ function update_alert_action ($id_alert_action, $values) { if (! is_array ($values)) return false; - return (@proces_sql_update ('talert_actions', + return (@process_sql_update ('talert_actions', $values, array ('id' => $id_alert_action))) !== false; } @@ -123,7 +123,7 @@ function delete_alert_action ($id_alert_action) { if (empty ($id_alert_action)) return false; - return (@proces_sql_delete ('talert_actions', + return (@process_sql_delete ('talert_actions', array ('id' => $id_alert_action))) !== false; }