From 30da9843847bc688130a4a9fb68466b64edfb29b Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Thu, 2 Dec 2010 10:01:41 +0100 Subject: [PATCH] bacula-web: Fixed bug with volume bytes in pool list - Wrong condition in bweb.inc.php, the volume bytes is displayed for all volumes now --- gui/bacula-web/bweb.inc.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gui/bacula-web/bweb.inc.php b/gui/bacula-web/bweb.inc.php index 2d329d5fd7..c697583ead 100644 --- a/gui/bacula-web/bweb.inc.php +++ b/gui/bacula-web/bweb.inc.php @@ -330,17 +330,21 @@ class Bweb extends DB { if( $debug ) { var_dump( $media ); } - + // If the pool is empty (no volumes in this pool) if( $medias->numRows() == 0 ) { if( $debug ) echo "No media in pool " . $pool['name'] . "
"; } else { - if( ($media['lastwritten'] != "0000-00-00 00:00:00") && $media['volstatus'] == 'Full' ) { - // Calculate expiration date - $expire_date = strtotime($media['lastwritten']) + $media['volretention']; - $media['expire'] = strftime("%Y-%m-%d", $expire_date); - - // Media used size in a more readable format + if( $media['lastwritten'] != "0000-00-00 00:00:00" ) { + // Calculate expiration date if the volume is Full + if( $media['volstatus'] == 'Full' ) { + $expire_date = strtotime($media['lastwritten']) + $media['volretention']; + $media['expire'] = strftime("%Y-%m-%d", $expire_date); + }else { + $media['expire'] = 'N/A'; + } + // Media used bytes in a human format $media['volbytes'] = $this->human_file_size( $media['volbytes'] ); + //echo "volume " . $media['volumename'] . 'vol bytes' .$media['volbytes'] . '
'; } else { $media['lastwritten'] = "N/A"; $media['expire'] = "N/A"; -- 2.39.5