2009-06-10 Esteban Sanchez <estebans@artica.es>

* include/functions_reporting.php: Return false if no data were found
        on get_agentmodule_sla(). Fixes #2777541

        * operation/reporting/reporting_viewer.php: Style correction.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1748 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2009-06-10 14:25:44 +00:00
parent e5c4ad5406
commit 534a7925f7
3 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2009-06-10 Esteban Sanchez <estebans@artica.es>
* 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 <estebans@artica.es>
* godmode/modules/manage_network_templates_form.php: Applied

View File

@ -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(*)

View File

@ -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] .= '<strong>'.__('SLA Limit')."</strong> : ";
$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] = '<span style="font: bold 3em Arial, Sans-serif; color: #0000FF;">';
$data[1] .= __('Unknown');
@ -513,5 +511,4 @@ foreach ($contents as $content) {
print_table ($table);
flush ();
}
?>