--- trunk/lib/BackupPC/SearchLib.pm 2005/07/13 09:57:41 25 +++ trunk/lib/BackupPC/SearchLib.pm 2005/07/29 17:30:25 26 @@ -4,7 +4,6 @@ use strict; use BackupPC::CGI::Lib qw(:all); use BackupPC::Attrib qw(:all); -use Data::Dumper; use DBI; sub getUnits() { @@ -53,7 +52,7 @@ push( @conditions, ' backups.hostID = ' . $param->{'search_host'} ) if ($param->{'search_host'}); - push (@conditions, " files.name LIKE '".$param->{'search_filename'}."%'") if ($param->{'search_filename'}); + push (@conditions, " upper(files.name) LIKE upper('%".$param->{'search_filename'}."%')") if ($param->{'search_filename'}); return ( join(" and ", @conditions), @@ -279,7 +278,7 @@ $retHTML .= qq{ - + @@ -297,15 +296,22 @@ return $html; } + sub restore_link($$$$$$) { + my $type = shift; + my $action = 'RestoreFile'; + $action = 'browse' if (lc($type) eq 'dir'); + return sprintf(qq{%s}, $action, @_); + } + foreach $file (@files) { my $typeStr = BackupPC::Attrib::fileType2Text(undef, $file->{'type'}); $retHTML .= ""; foreach my $v (( - $file->{'hname'}, + $file->{'sharename'}, qq{ } . hilite_html( $file->{'fpath'}, $hilite ), $typeStr, - $file->{'backupno'}, + restore_link( $typeStr, $file->{'hname'}, $file->{'backupno'}, $file->{'sname'}, $file->{'fpath'}, $file->{'backupno'} ), $file->{'size'}, $file->{'date'}, $file->{'dvd'}
HostShare Name Type #