]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Fixed bug with volume bytes in pool list
authorDavide Franco <bacula-dev@dflc.ch>
Thu, 2 Dec 2010 09:01:41 +0000 (10:01 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:43 +0000 (14:39 +0200)
 - Wrong condition in bweb.inc.php, the volume bytes is displayed for all volumes now

gui/bacula-web/bweb.inc.php

index 2d329d5fd79ad4380c2d466318d3509e58a872da..c697583eadf257a7359d9e184c2350698db2ffd4 100644 (file)
@@ -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'] . "<br />";
                                                        } 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'] . '<br />';
                                                                        } else {
                                                                                $media['lastwritten'] = "N/A";
                                                                                $media['expire']      = "N/A";