From: Davide Franco Date: Mon, 13 Jun 2011 18:12:53 +0000 (+0200) Subject: bacula-web: Replaced Get_human_file_size() function by Utils::Get_Human_Size X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fb684092f93108e0cccf3b2b0f383767ea9d28c4;p=bacula%2Fbacula bacula-web: Replaced Get_human_file_size() function by Utils::Get_Human_Size --- diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index f2a091f33d..d4b877d3e5 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -178,7 +178,7 @@ class Bweb extends DB { }else die( "Unable to get database size
" . $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]; } diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index a6e2b06940..b459a08a4c 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -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 ); diff --git a/gui/bacula-web/jobs.php b/gui/bacula-web/jobs.php index 27e829d23e..9a6d7d6a2b 100644 --- a/gui/bacula-web/jobs.php +++ b/gui/bacula-web/jobs.php @@ -126,7 +126,7 @@ $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); } diff --git a/gui/bacula-web/report.php b/gui/bacula-web/report.php index 089cbd8e6f..dcf1c0bb8f 100644 --- a/gui/bacula-web/report.php +++ b/gui/bacula-web/report.php @@ -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);