From 84c1a797a2e2b178183a923f2b6539a41120f3f5 Mon Sep 17 00:00:00 2001 From: slerena Date: Tue, 29 Dec 2009 16:43:35 +0000 Subject: [PATCH] 2009-12-29 Sancho Lerena * include/functions_servers.php: Fixed notice (division by 0). * include/functions_visual_map.php: Fixed problem in graphs embedded in the visual console maps (problem with & in fgraph call !!?). * include/config_process.php: Added supression of DEPRECATED system messages for PHP 5.2.11 or higher insted 5.3 * godmode/agentes/module_manager_editor_prediction.php: Fixed several missing fields in the prediction module edition. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2256 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 14 ++++++++++++++ .../agentes/module_manager_editor_prediction.php | 2 -- pandora_console/include/config_process.php | 2 +- pandora_console/include/functions_servers.php | 6 +++++- pandora_console/include/functions_visual_map.php | 8 ++++++-- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 421a59bea3..9673ffe436 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2009-12-29 Sancho Lerena + + * include/functions_servers.php: Fixed notice (division by 0). + + * include/functions_visual_map.php: Fixed problem in graphs + embedded in the visual console maps (problem with & in fgraph + call !!?). + + * include/config_process.php: Added supression of DEPRECATED + system messages for PHP 5.2.11 or higher insted 5.3 + + * godmode/agentes/module_manager_editor_prediction.php: Fixed several + missing fields in the prediction module edition. + 2009-12-28 Sancho Lerena * module_manager_editor_common.php: Latest changes from mdtrooper break diff --git a/pandora_console/godmode/agentes/module_manager_editor_prediction.php b/pandora_console/godmode/agentes/module_manager_editor_prediction.php index 08ed3f00fe..a6eb7b118d 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_prediction.php +++ b/pandora_console/godmode/agentes/module_manager_editor_prediction.php @@ -64,8 +64,6 @@ $table_simple->colspan['prediction_module'][1] = 3; push_table_simple ($data, 'prediction_module'); /* Removed common useless parameter */ -unset ($table_simple->data[2]); -unset ($table_simple->data[3]); unset ($table_advanced->data[3]); unset ($table_advanced->data[2][2]); unset ($table_advanced->data[2][3]); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f0b4a6cbc3..2566650e82 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -29,7 +29,7 @@ $pandora_version = 'v3.0'; // error_reporting(E_ALL); -if (strnatcmp(phpversion(),'5.3') >= 0) +if (strnatcmp(phpversion(),'5.2.11') >= 0) { error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE); } diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index c382e80229..9f65d4574c 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -84,7 +84,11 @@ function get_server_performance () { $data["avg_interval_local_modules"] = get_db_sql ("SELECT AVG(tagente.intervalo) FROM tagente WHERE disabled = 0 AND intervalo > 0"); - $data["local_modules_rate"] = $data["total_local_modules"] / $data["avg_interval_local_modules"]; + if ($data["avg_interval_local_modules"] > 0){ + $data["local_modules_rate"] = $data["total_local_modules"] / $data["avg_interval_local_modules"]; + } else { + $data["local_modules_rate"] = 0; + } $data["total_modules"] = $data["total_local_modules"] + $data["total_remote_modules"]; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 5ea75590be..673d826086 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -239,9 +239,13 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = } } if ($resizedMap) - print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".((integer)($proportion * $layout_data['height']))."&pure=1&width=".((integer)($proportion * $layout_data['width']))."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0)); + + // ATTENTION: DO NOT USE & here because is bad-translated and doesnt work + // resulting fault image links :( + + print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".((integer)($proportion * $layout_data['height']))."&pure=1&width=".((integer)($proportion * $layout_data['width']))."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0)); else - print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".$layout_data['height']."&pure=1&width=".$layout_data['width']."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0)); + print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".$layout_data['height']."&pure=1&width=".$layout_data['width']."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0)); echo ""; echo ""; break;