]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Replaced Get_human_file_size() function by Utils::Get_Human_Size
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 13 Jun 2011 18:12:53 +0000 (20:12 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:12 +0000 (14:49 +0200)
gui/bacula-web/includes/bweb.inc.php
gui/bacula-web/index.php
gui/bacula-web/jobs.php
gui/bacula-web/report.php

index f2a091f33d93698778016336084609906fc2cf14..d4b877d3e5e54c3e669a280f6e610d4cd39745c1 100644 (file)
@@ -178,7 +178,7 @@ class Bweb extends DB {
                }else
                        die( "Unable to get database size<br />" . $result->getMessage() );
                
-               return $this->human_file_size( $database_size );  
+               return Utils::Get_Human_Size( $database_size );
        } // end function GetDbSize()
        
        public function Get_Nb_Clients()
@@ -255,7 +255,7 @@ class Bweb extends DB {
                                                                                $media['expire'] = 'N/A';
                                                                        }
                                                                        // Media used bytes in a human format
-                                                                       $media['volbytes'] = $this->human_file_size( $media['volbytes'] );
+                                                                       $media['volbytes'] = Utils::Get_Human_Size( $media['volbytes'] );
                                                                } else {
                                                                        $media['lastwritten'] = "N/A";
                                                                        $media['expire']      = "N/A";
@@ -600,7 +600,7 @@ class Bweb extends DB {
                        $day = date( "D d", strtotime($end_date) );
                        
                        if( isset( $tmp['stored_bytes'] ) ) {
-                               $hbytes = $this->human_file_size( $tmp['stored_bytes'], 3, 'GB');
+                               $hbytes = Utils::Get_Human_Size( $tmp['stored_bytes'], 3, 'GB' );
                                $hbytes = explode( " ", $hbytes );
                                $stored_bytes = $hbytes[0];
                        }
@@ -626,7 +626,7 @@ class Bweb extends DB {
                        $day = date( "D d", strtotime($end_date) );
                        
                        if( isset( $tmp['stored_bytes'] ) ) {
-                               $hbytes = $this->human_file_size( $tmp['stored_bytes'], 3, 'GB');
+                               $hbytes = Utils::Get_Human_Size( $tmp['stored_bytes'], 3, 'GB' );
                                $hbytes = explode( " ", $hbytes );
                                $stored_bytes = $hbytes[0];
                        }
index a6e2b069401c2125edfd3f14f78875dd5eaf562a..b459a08a4c768ebf195b3999b6a2e7001b0eb452 100644 (file)
@@ -42,11 +42,11 @@ $dbSql->tpl->assign('database_size', $dbSql->GetDbSize());
 
 // Overall stored bytes
 $result = $dbSql->GetStoredBytes( ALL );
-$dbSql->tpl->assign('stored_bytes', $dbSql->human_file_size($result['stored_bytes']) );
+$dbSql->tpl->assign('stored_bytes', Utils::Get_Human_Size( $result['stored_bytes'] ) );
 
 // Total stored bytes since last 24 hours
 $result = $dbSql->GetStoredBytes( LAST_DAY );
-$dbSql->tpl->assign('bytes_last', $dbSql->human_file_size($result['stored_bytes']) );
+$dbSql->tpl->assign('bytes_last', Utils::Get_Human_Size( $result['stored_bytes'] ) );
 
 // Total stored files since last 24 hours
 $files_last = $dbSql->GetStoredFiles( LAST_DAY );
index 27e829d23e60bfe2d45a2b39648bc3e64bb4c285..9a6d7d6a2bf3d46ef484d9674caf25cfd68dd81e 100644 (file)
         $job['Level'] = $job_level[ $job['Level'] ];
                
                // Job Size
-               $job['JobBytes'] = $dbSql->human_file_size( $job['JobBytes'] );
+               $job['JobBytes'] = Utils::Get_Human_Size( $job['JobBytes'] );
 
                array_push( $last_jobs, $job);
          }
index 089cbd8e6ffc7fcf03be3f906ffa9e4d80049700..dcf1c0bb8fd986c5afccf0ca2fd37308aaca620a 100644 (file)
@@ -31,7 +31,7 @@ $bytes = $dbSql->CalculateBytesPeriod($_GET['server'],$dbSql->StartDate,$dbSql->
 $files = $dbSql->CalculateFilesPeriod($_GET['server'],$dbSql->StartDate,$dbSql->EndDate);
 $smarty->assign('startperiod',$dbSql->StartDate);
 $smarty->assign('endperiod',$dbSql->EndDate); 
-$smarty->assign('bytesperiod',$dbSql->human_file_size( $bytes ) );
+$smarty->assign( 'bytesperiod', Utils::Get_Human_Size( $bytes ) );
 $smarty->assign('filesperiod',$files);
 
 // Array with jobs data
@@ -47,7 +47,7 @@ while ( $tmp = $res_jobs->fetchRow(DB_FETCHMODE_ASSOC) ) {
         $tdate = explode (":",$tmp['elapsed']);                // Temporal "workaround" ;) Fix later
         if ( $tdate[0] > 300000 )
                 $tmp['elapsed'] = "00:00:00";
-               $tmp['JobBytes'] = $dbSql->human_file_size( $tmp['JobBytes'] );
+               $tmp['JobBytes'] = Utils::Get_Human_Size( $tmp['JobBytes'] );
         array_push($a_jobs,$tmp);
 }
 $smarty->assign('jobs',$a_jobs);