From: Davide Franco Date: Fri, 8 Jul 2011 18:14:20 +0000 (+0200) Subject: bacula-web: Removed useless function GetJobsStatistics() in bweb class X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f0b429b646a5c504c5f77b488c9587abcc3df5c1;p=bacula%2Fbacula bacula-web: Removed useless function GetJobsStatistics() in bweb class --- diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index 4869f39cad..6b1d6bbeda 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -346,79 +346,6 @@ class Bweb extends DB } } - // Return Jobs statistics for a specific interval such as - // - Completed jobs number - // - Failed jobs number - // - Waiting jobs number - // The returned values will be used by a Bgraph classe - public function GetJobsStatistics( $type = 'completed', $delay = LAST_DAY ) - { - $query = ""; - $where = ""; - $jobs = ""; - $label = ""; - $res = ""; - - // Interval calculation - $end_date = mktime(); - $start_date = $end_date - $delay; - - $start_date = date( "Y-m-d H:i:s", $start_date ); - $end_date = date( "Y-m-d H:i:s", $end_date ); - - $interval_where = "(EndTime BETWEEN '$start_date' AND '$end_date') AND "; - - // Job status - switch( $type ) - { - case 'completed': - $where = $interval_where . "JobStatus = 'T' "; - $label = "Completed"; - break; - case 'terminated_errors': - $where = $interval_where . "JobStatus = 'E' "; - $label = "Terminated with errors"; - break; - case 'failed': - $where = $interval_where . "JobStatus = 'f' "; - $label = "Failed"; - break; - case 'waiting': - $where = "JobStatus IN ('F','S','M','m','s','j','c','d','t') "; - $label = "Waiting"; - break; - case 'created': - $where = "JobStatus = 'C' "; - $label = "Created but not running"; - break; - case 'running': - $where = "JobStatus = 'R' "; - $label = "Running"; - break; - case 'error': - $where = $interval_where . "JobStatus IN ('e','f') "; - $label = "Errors"; - break; - } - - $query = 'SELECT COUNT(JobId) AS count '; - $query .= 'FROM Job '; - $query .= "WHERE $where "; - - $res = $this->db_link->query( $query ); - - if (PEAR::isError( $res ) ) { - $this->TriggerDBError( 'Unable to get last' . $type . 'jobs status from catalog', $res); - }else { - $result = $res->fetchRow(); - - if( isset($result['count']) and !empty($result['count']) ) - return $result['count']; - else - return 0; - } - } // end function GetJobsStatistics() - public function CountVolumesByPool( $pool_id ) { $res = null;