X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FDirHistory.pm;h=2ba2aff37e398e7d647108a67d04f99e4ae1ad3b;hp=728068fe3e0021118efd34a21538bd82ab6830ff;hb=f6fbcc3682d2bc9e7dfdc26e95bd5fcdb359496d;hpb=a7e968ce327855f2ba2624ca8517069a936c9b5b diff --git a/lib/BackupPC/CGI/DirHistory.pm b/lib/BackupPC/CGI/DirHistory.pm index 728068f..2ba2aff 100644 --- a/lib/BackupPC/CGI/DirHistory.pm +++ b/lib/BackupPC/CGI/DirHistory.pm @@ -10,7 +10,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2003 Craig Barratt +# Copyright (C) 2003-2007 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 3.2.0beta0, released 5 April 2009. # # See http://backuppc.sourceforge.net. # @@ -40,6 +40,7 @@ use strict; use BackupPC::CGI::Lib qw(:all); use BackupPC::View; use BackupPC::Attrib qw(:all); +use Encode; sub action { @@ -61,7 +62,7 @@ sub action ErrorExit($Lang->{Empty_host_name}) if ( $host eq "" ); my @Backups = $bpc->BackupInfoRead($host); - my $view = BackupPC::View->new($bpc, $host, \@Backups); + my $view = BackupPC::View->new($bpc, $host, \@Backups, {inode => 1}); my $hist = $view->dirHistory($share, $dir); my($backupNumStr, $backupTimeStr, $fileStr); @@ -71,7 +72,8 @@ sub action ErrorExit($Lang->{Nice_try__but_you_can_t_put}); } - for ( $i = 0 ; $i < @Backups ; $i++ ) { + my @backupList = $view->backupList($share, $dir); + foreach $i ( @backupList ) { my $backupTime = timeStamp2($Backups[$i]{startTime}); my $num = $Backups[$i]{num}; $backupNumStr .= "$fDisp"; - my($colSpan, $url, $inode, $type); - my $tdClass = ' class="histView"'; - for ( $i = 0 ; $i < @Backups ; $i++ ) { + $fDisp = decode_utf8($fDisp); + $fileStr .= "$fDisp"; + my($colSpan, $url, $inode, $type); + my $tdClass = ' class="histView"'; + foreach $i ( @backupList ) { my($path); if ( $colSpan > 0 ) { # @@ -110,16 +113,16 @@ sub action $colSpan++; next; } - $fileStr .= "" + $fileStr .= "" . "$url"; $colSpan = 0; - $tdClass = ' class="histView"'; + $tdClass = ' class="histView"'; } if ( !defined($hist->{$f}[$i]) ) { $colSpan = 1; $url = " "; $inode = -3; # special value for missing - $tdClass = ' class="histViewMis"'; + $tdClass = ' class="histViewMis"'; next; } if ( $dir eq "" ) { @@ -155,18 +158,18 @@ EOF $colSpan = 1; } if ( $colSpan > 0 ) { - $fileStr .= "$url"; + $fileStr .= "$url"; $colSpan = 0; } $fileStr .= "\n"; } - my $dirDisplay = "$share/$dir"; + my $dirDisplay = decode_utf8("$share/$dir"); $dirDisplay =~ s{//+}{/}g; $dirDisplay =~ s{/+$}{}g; $dirDisplay = "/" if ( $dirDisplay eq "" ); - my $content = eval("qq{$Lang->{DirHistory_for__host}}"); - Header(eval("qq{$Lang->{DirHistory_backup_for__host}}"), $content); + my $content = eval("qq{$Lang->{DirHistory_for__host}}"); + Header(eval("qq{$Lang->{DirHistory_backup_for__host}}"), $content); Trailer(); }