]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: More explicit Job level description in jobs report
authorDavide Franco <bacula-dev@dflc.ch>
Wed, 12 Jan 2011 14:04:14 +0000 (15:04 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:35 +0000 (14:43 +0200)
 - Modified php code in jobs.php (Full instead of F, Diff instead of D and Incr instead of I)

gui/bacula-web/jobs.php

index 931020229d721bd83e2a57a0819bdfa0f88db9e9..fba9becf79635456a005ea8a7e2fc511e831abc9 100644 (file)
@@ -19,6 +19,9 @@
   $smarty->compile_dir = "./templates_c";
   $smarty->config_dir     = "./configs";
   
+  // Global variables
+  $job_status = array( 'D' => 'Diff', 'I' => 'Incr', 'F' => 'Full' );
+
   // Running jobs
   $running_jobs = array();
   
   }else {
          while( $job = $jobsresult->fetchRow( DB_FETCHMODE_ASSOC ) ) {
        
-               $elapsed = 'N/A';
-               
-               /*
-               if( $job['JobStatus'] == 'R') {
-                       $elapsed = mktime() - strtotime($job['StartTime']);
-                       if( $elapsed > 3600 )
-                               $elapsed = date( "H:i:s", $elapsed );
-                       elseif( $elapsed > 86400 )
-                               $elapsed = date( "d day(s) i:s", $elapsed );
-                       else
-                               $elapsed = date( "i:s", $elapsed );
-               }
-               */
                // Elapsed time for this job
+               $elapsed = 'N/A';
                if( $job['JobStatus'] == 'R' )
                        $job['elapsed_time'] = $dbSql->Get_ElapsedTime( strtotime($job['StartTime']), time() );
                else
@@ -59,6 +50,9 @@
                // Odd or even row
                if( count($running_jobs) % 2)
                        $job['Job_classe'] = 'odd';
+
+               // Job Status
+               $job['Level'] = $job_status[ $job['Level'] ];
                
                array_push( $running_jobs, $job);
          }
                
                // Elapsed time for this job
                $job['elapsed_time'] = $dbSql->Get_ElapsedTime( strtotime($job['StartTime']), strtotime($job['EndTime']) );
+
+               // Job Status
+                $job['Level'] = $job_status[ $job['Level'] ];
+
                array_push( $last_jobs, $job);
          }
   }