From d9e5382fdf540faa938954462bcc398b8c1d5cf8 Mon Sep 17 00:00:00 2001 From: esanchezm Date: Wed, 21 Jan 2009 08:07:18 +0000 Subject: [PATCH] 2009-01-21 Esteban Sanchez * godmode/alerts/configure_alert_template.php, include/functions_alerts.php: Added missing matches_value field on creation and updating. * ChangeLog: Added missing path to files on previous commit. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1376 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 15 ++++++++++++--- .../godmode/alerts/configure_alert_template.php | 5 +++-- pandora_console/include/functions_alerts.php | 9 ++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c89710a2c9..c59460c110 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,12 +1,21 @@ +2009-01-21 Esteban Sanchez + + * godmode/alerts/configure_alert_template.php, + include/functions_alerts.php: Added missing matches_value field on + creation and updating. + + * ChangeLog: Added missing path to files on previous commit. + 2009-01-21 Sancho Lerena * pandoradb_migrate_20_to_21.sql: Fixes some problems. - * setup.php: Removed AD setup tokens. + * godmode/setup/setup.php: Removed AD setup tokens. - * user_list.php: Link to user edition was wrong. Restored. + * godmode/users/user_list.php: Link to user edition was wrong. + Restored. - * functions_db.php: Support for new auth modules was missing + * include/functions_db.php: Support for new auth modules was missing and fgraph fails to render graphs. 2009-01-20 Esteban Sanchez diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 170611055d..f81a70c61d 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -280,13 +280,14 @@ if ($create_template) { $value = (string) get_parameter ('value'); $max = (float) get_parameter ('max'); $min = (float) get_parameter ('min'); - + $matches = (bool) get_parameter ('matches_value'); $result = create_alert_template ($name, $type, array ('description' => $description, 'value' => $value, 'max_value' => $max, - 'min_value' => $min)); + 'min_value' => $min, + 'matches_value' => $matches)); print_error_message ($result, __('Successfully created'), __('Could not be created')); diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index c3bfa4a272..767eae53d5 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -283,6 +283,7 @@ function clean_alert_template_values ($values, $set_empty = true) { $retvalues['recovery_notify'] = ''; $retvalues['field2_recovery'] = ''; $retvalues['field2_recovery'] = ''; + $retvalues['matches_value'] = true; } if (empty ($values)) @@ -302,6 +303,8 @@ function clean_alert_template_values ($values, $set_empty = true) { $retvalues['field3'] = (string) $values['field3']; if (isset ($values['value'])) $retvalues['value'] = (string) $values['value']; + if (isset ($values['matches_value'])) + $retvalues['matches_value'] = (bool) $values['matches_value']; if (isset ($values['max_value'])) $retvalues['max_value'] = (float) $values['max_value']; if (isset ($values['min_value'])) @@ -363,14 +366,14 @@ function create_alert_template ($name, $type, $values = false) { $sql = sprintf ('INSERT talert_templates (name, type, description, field1, field2, field3, value, max_value, min_value, - time_threshold, max_alerts, min_alerts) + time_threshold, max_alerts, min_alerts, matches_value) VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", %.2f, - %.2f, %d, %d, %d)', + %.2f, %d, %d, %d, %d)', $name, $type, $values['description'], $values['field1'], $values['field2'], $values['field3'], $values['value'], $values['max_value'], $values['min_value'], $values['time_threshold'], $values['max_alerts'], - $values['min_alerts']); + $values['min_alerts'], $values['matches_value']); return process_sql ($sql, 'insert_id'); }