]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Removed useless function GetJobsStatistics() in bweb class
authorDavide Franco <bacula-dev@dflc.ch>
Fri, 8 Jul 2011 18:14:20 +0000 (20:14 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:21 +0000 (14:49 +0200)
gui/bacula-web/includes/bweb.inc.php

index 4869f39cad1b524f2fd96b70fca39e779391fc5d..6b1d6bbedad43b50fcfc4a8b4168e111dd2d5888 100644 (file)
@@ -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;