X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FSearchArchives.pm;h=3e1ce0a5d27e1d35b1e20844eb5c9489c36ad4b9;hb=25399f28e6bc65ac77bd216ac9d902921a8f6e80;hp=2ecb773b85ea93e3e6d8aa13915d9509647b0fee;hpb=fbea58ccd9a61d2b115d8235cd3be914c7e12afd;p=BackupPC.git
diff --git a/lib/BackupPC/CGI/SearchArchives.pm b/lib/BackupPC/CGI/SearchArchives.pm
index 2ecb773..3e1ce0a 100644
--- a/lib/BackupPC/CGI/SearchArchives.pm
+++ b/lib/BackupPC/CGI/SearchArchives.pm
@@ -9,157 +9,88 @@ use strict;
use BackupPC::CGI::Lib qw(:all);
use BackupPC::SearchLib;
use Data::Dumper;
+use HTML::FillInForm;
use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
sub action() {
- my $cont = "";
- my $host;
- my @hosts;
- my $hosts_html = "";
+ my $hosts_html = "";
- BackupPC::CGI::Lib::NewRequest();
-
- @hosts = BackupPC::SearchLib::getUnits();
- if ( !defined($In{search_results}) ) {
- foreach $host (@hosts) {
- $hosts_html .=
- "\n";
+ BackupPC::CGI::Lib::NewRequest();
+ my @hosts = BackupPC::SearchLib::getUnits();
+
+ foreach my $host (@hosts) {
+ $hosts_html .= "\n";
}
- my $title = eval(q{ ${h1("Search")}});
- my $subtitle = eval(q{ ${h2("Search criteria")}});
-
- $cont .= <
-
+
+ sub date_from_to_html {
+ my $name = shift || return;
+ return qq{
+
+
+
+ -
+
+
+
+ };
+ }
+
+ my $form .= qq{
+
-ENDSTR
- }
- else {
- $cont = eval(q{ ${h1("Search")}});
- $cont .= eval(q{ ${h2("Search results")}});
- my $result;
- my $rows = "";
-
- my $grid = BackupPC::SearchLib::displayGrid( BackupPC::SearchLib::getWhere(\%In), 0);
- $cont .= $grid;
- }
- Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $cont );
- Trailer();
+
-
-
- Share:
-
-
-
-
-
-
-
- All file(s) between:
-
-
-
-
-
-
-
-
- Day
-
-
-
-
-
- Month
-
-
-
-
-
- Year
-
-
-
-
-
-
-
-
- Day
-
-
-
-
-
- Month
-
-
-
-
-
- Year
-
-
-
-
-
-
-
- All backups between:
-
-
-
-
-
-
-
- Day
- Month
- Year
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Filename:
-
-
-
-
-
+ file(s) between: + } . date_from_to_html('search') . qq{ + + backups between: + } . date_from_to_html('search_backup') . qq{ + (yyyy-mm-dd) +
+ ++ use faster full-text search engine +
+ + + + + }; + + my $html = eval(q{ ${h1("Search")}}); + + if ( !defined($In{search_results}) ) { + $html .= eval(q{ ${h2("Search criteria")}}); + + $html .= $form; + } else { + $html .= eval(q{ ${h2("Search results")}}); + + my $fif = new HTML::FillInForm; + $html .= $fif->fill(scalarref => \$form, fdat => \%In); + + $html .= BackupPC::SearchLib::displayGrid( \%In ); + } + + Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $html ); + Trailer(); } 1;