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

* godmode/alerts/configure_alert_template.php: Max and min alerts
	were ignored.

	* include/functions_alerts.php: Ensure the max and min alert values
	order.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1345 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2009-01-15 10:54:27 +00:00
parent cf3876ce27
commit 4b6883109e
3 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2009-01-15 Esteban Sanchez <estebans@artica.es>
* godmode/alerts/configure_alert_template.php: Max and min alerts
were ignored.
* include/functions_alerts.php: Ensure the max and min alert values
order.
2009-01-15 Esteban Sanchez <estebans@artica.es>
* include/styles/menu.css: Changed the z-index property of the menu

View File

@ -112,6 +112,8 @@ function update_template ($step) {
$time_to = (string) get_parameter ('time_to');
$time_to = date ("H:s:00", strtotime ($time_to));
$threshold = (int) get_parameter ('threshold');
$max_alerts = (int) get_parameter ('max_alerts');
$min_alerts = (int) get_parameter ('min_alerts');
if ($threshold == -1)
$threshold = (int) get_parameter ('other_threshold');
$field1 = (string) get_parameter ('field1');
@ -138,7 +140,9 @@ function update_template ($step) {
'default_action' => $default_action,
'field1' => $field1,
'field2' => $field2,
'field3' => $field3
'field3' => $field3,
'max_alerts' => $max_alerts,
'min_alerts' => $min_alerts
);
if ($default_action) {

View File

@ -312,6 +312,11 @@ function clean_alert_template_values ($values, $set_empty = true) {
$retvalues['max_alerts'] = (int) $values['max_alerts'];
if (isset ($values['min_alerts']))
$retvalues['min_alerts'] = (int) $values['min_alerts'];
/* Ensure max an min orders */
$max = max ($retvalues['max_alerts'], $retvalues['min_alerts']);
$min = min ($retvalues['max_alerts'], $retvalues['min_alerts']);
$retvalues['max_alerts'] = $max;
$retvalues['min_alerts'] = $min;
if (isset ($values['monday']))
$retvalues['monday'] = (bool) $values['monday'];
if (isset ($values['tuesday']))