diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 50fad304e4..518245586e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-06-10 Esteban Sanchez + + * include/functions_reporting.php: Return false if no data were found + on get_agentmodule_sla(). Fixes #2777541 + + * operation/reporting/reporting_viewer.php: Style correction. + 2009-06-10 Esteban Sanchez * godmode/modules/manage_network_templates_form.php: Applied diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index f7911bd88e..a0e9d0a08c 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -28,7 +28,8 @@ require_once ($config["homedir"]."/include/functions_agents.php"); * ignore max value * @param int Beginning date of the report in UNIX time (current date by default). * - * @return float SLA percentage of the requested module. + * @return float SLA percentage of the requested module. False if no data were + * found */ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max_value = false, $date = 0) { if (empty ($date)) { @@ -52,7 +53,7 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max if (empty ($total)) { //No data to calculate on so we return 100 (fail to good) - return 100.0; + return false; } $sql = sprintf ('SELECT COUNT(*) diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 7ff04d2386..4fce417fac 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -13,8 +13,6 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. - - // Login check require ("include/config.php"); @@ -230,7 +228,7 @@ foreach ($contents as $content) { $data[0] .= ''.__('SLA Limit')." : "; $data[0] .= $sla['sla_limit']; $sla_value = get_agentmodule_sla ($sla['id_agent_module'], $content['period'], - $sla['sla_min'], $sla['sla_max'], $datetime); + $sla['sla_min'], $sla['sla_max'], $datetime); if ($sla_value === false) { $data[1] = ''; $data[1] .= __('Unknown'); @@ -513,5 +511,4 @@ foreach ($contents as $content) { print_table ($table); flush (); } - ?>