2010-03-03 Ramon Novoa <rnovoa@artica.es>

* include/functions_db.php: Use mysql_fetch_assoc instead of
          mysql_fetch_array to avoid duplicate results (hash and array).

        * godmode/alerts/configure_alert_template.php: Added 'matches_value'
          support to 'onchange' alerts.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2457 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2010-03-03 13:13:11 +00:00
parent 2f5021cbf8
commit 28159d9fa0
3 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2010-03-03 Ramon Novoa <rnovoa@artica.es>
* include/functions_db.php: Use mysql_fetch_assoc instead of
mysql_fetch_array to avoid duplicate results (hash and array).
* godmode/alerts/configure_alert_template.php: Added 'matches_value'
support to 'onchange' alerts.
2010-03-03 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: add new parameter to function "addPath" the

View File

@ -433,6 +433,9 @@ if ($step == 2) {
case "min":
$table->rowstyle['min'] = '';
break;
case "onchange":
$show_matches = true;
break;
}
$table->data[0][0] = __('Name');
@ -525,6 +528,8 @@ var under = "<?php echo __('The alert would fire when the value is below <span i
var over = "<?php echo __('The alert would fire when the value is above <span id=\"max\"></span>');?>";
var warning = "<?php echo __('The alert would fire when the module is in warning status');?>";
var critical = "<?php echo __('The alert would fire when the module is in critical status');?>";
var onchange = "<?php echo __('The alert would fire when the module value changes');?>";
var onchange_not = "<?php echo __('The alert would fire when the module value does not change');?>";
function check_regex () {
if ($("#type").attr ('value') != 'regex') {
@ -641,6 +646,16 @@ $(document).ready (function () {
/* Show example */
$("span#example").empty ().append (critical);
break;
case "onchange":
$("#template-value, #template-max, #template-min").hide ();
$("#template-example, span#matches_value").show ();
/* Show example */
if ($("#checkbox-matches_value")[0].checked)
$("span#example").empty ().append (onchange);
else
$("span#example").empty ().append (onchange_not);
break;
default:
$("#template-value, #template-max, #template-min, #template-example, span#matches_value").hide ();
break;
@ -664,7 +679,13 @@ $(document).ready (function () {
} else {
$("span#example").empty ().append (between_not);
}
}
} else if (type == "onchange") {
if (enabled) {
$("span#example").empty ().append (onchange);
} else {
$("span#example").empty ().append (onchange_not);
}
}
render_example ();
});

View File

@ -2075,7 +2075,7 @@ function process_sql ($sql, $rettype = "affected_rows", $dbconnection = '', $cac
else {
add_database_debug_trace ($sql, 0, mysql_affected_rows (),
array ('time' => $time));
while ($row = mysql_fetch_array ($result)) {
while ($row = mysql_fetch_assoc ($result)) {
array_push ($retval, $row);
}