]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl cleanup
authorEric Bollengier <eric@eb.homelinux.org>
Sat, 14 Jul 2007 16:03:31 +0000 (16:03 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Sat, 14 Jul 2007 16:03:31 +0000 (16:03 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5182 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/cgi/bfileview.pl

index a6ec97bb137522acb99ab75ff79efd9b0d66f52b..3fa688f2cea71e2ebc97a165c11ace334dc0d072 100755 (executable)
@@ -94,6 +94,8 @@ if (-f "$base_fich/$md5_rep.png" and -f "$base_fich/$md5_rep.tpl")
     exit 0;
 }
 
+
+# if it's a file, display it
 if ($fnid and $pathid)
 {
     my $attribs = fv_get_file_attribute_from_id($jobid, $pathid, $fnid);
@@ -102,17 +104,15 @@ if ($fnid and $pathid)
        $bweb->display_end();
        exit 0;
     }
-}
 
-my $attribs = fv_get_file_attribute($jobid, $where);
-if ($attribs->{found}) {
-    $bweb->display($attribs, 'fv_file_attribs.tpl');
-    $bweb->display_end();
-    exit 0;
-}
+} else {
 
-if ($where !~ m!/$!) {
-    $where = $where . "/" ;
+    my $attribs = fv_get_file_attribute($jobid, $where);
+    if ($attribs->{found}) {
+       $bweb->display($attribs, 'fv_file_attribs.tpl');
+       $bweb->display_end();
+       exit 0;
+    }
 }
 
 my $root;
@@ -120,7 +120,12 @@ my $root;
 if ($pathid) {
     $root = $pathid;
     $where = fv_get_root_path($pathid);
+
 } else {
+    if ($where !~ m!/$!) {
+       $where = $where . "/" ;
+    }
+    
     $root = fv_get_root_pathid($where);
 }
 
@@ -198,14 +203,14 @@ sub fv_display_rep
        }
     }
 
-    # 0: name, 1: size, 2: filenameid
+    # 0: filenameid, 1: filename, 2: size
     my $files = fv_get_big_files($jobid, $rep, 3*100/$max, $max_file/($level+1));
     foreach my $f (@{$files}) {
-       $ccircle->{base_url} =~ s/pathid=\d+;(filenameid=\d+;)?/pathid=$rep;filenameid=$f->[2];/;
-       $ccircle->add_part($f->[1] * 100 / $max, 
-                          $f->[0],
-                          $f->[0] . "\n" . Bweb::human_size($f->[1]));
-       $sum += $f->[1];
+       $ccircle->{base_url} =~ s/pathid=\d+;(filenameid=\d+;)?/pathid=$rep;filenameid=$f->[0];/;
+       $ccircle->add_part($f->[2] * 100 / $max, 
+                          $f->[1],
+                          $f->[1] . "\n" . Bweb::human_size($f->[2]));
+       $sum += $f->[2];
     }
 
     if ($sum < $max) {