2009-01-21 Esteban Sanchez <estebans@artica.es>

* 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
This commit is contained in:
Esteban Sanchez 2009-01-21 08:07:18 +00:00
parent 210467560d
commit 497488da98
3 changed files with 21 additions and 8 deletions

View File

@ -1,12 +1,21 @@
2009-01-21 Esteban Sanchez <estebans@artica.es>
* 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 <slerena@artica.es>
* 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 <estebans@artica.es>

View File

@ -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'));

View File

@ -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');
}