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:
Esteban Sanchez 2009-06-10 14:25:44 +00:00
parent 3b1c24279e
commit cc493cd64a
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> 2009-06-10 Esteban Sanchez <estebans@artica.es>
* godmode/modules/manage_network_templates_form.php: Applied * 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 * ignore max value
* @param int Beginning date of the report in UNIX time (current date by default). * @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) { function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max_value = false, $date = 0) {
if (empty ($date)) { if (empty ($date)) {
@ -52,7 +53,7 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max
if (empty ($total)) { if (empty ($total)) {
//No data to calculate on so we return 100 (fail to good) //No data to calculate on so we return 100 (fail to good)
return 100.0; return false;
} }
$sql = sprintf ('SELECT COUNT(*) $sql = sprintf ('SELECT COUNT(*)

View File

@ -13,8 +13,6 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Login check // Login check
require ("include/config.php"); require ("include/config.php");
@ -513,5 +511,4 @@ foreach ($contents as $content) {
print_table ($table); print_table ($table);
flush (); flush ();
} }
?> ?>