r590@athlon: dpavlin | 2006-04-26 13:10:07 +0200
[BackupPC.git] / lib / BackupPC / CGI / SearchArchives.pm
index 76eda90..3e1ce0a 100644 (file)
@@ -26,13 +26,13 @@ sub action() {
        sub date_from_to_html {
                my $name = shift || return;
                return qq{
-                       <input type="text" name="${name}_day_from" size="2">
-                       <input type="text" name="${name}_month_from" size="2">
                        <input type="text" name="${name}_year_from" size="4">
+                       <input type="text" name="${name}_month_from" size="2">
+                       <input type="text" name="${name}_day_from" size="2">
                        -
-                       <input type="text" name="${name}_day_to" size="2">
-                       <input type="text" name="${name}_month_to" size="2">
                        <input type="text" name="${name}_year_to" size="4">
+                       <input type="text" name="${name}_month_to" size="2">
+                       <input type="text" name="${name}_day_to" size="2">
                };
        }
 
@@ -44,7 +44,14 @@ sub action() {
        &nbsp;
        on share
        &nbsp;
-       <select name="search_host">$hosts_html</select>
+       <select name="search_share">$hosts_html</select>
+       &nbsp;show&nbsp;
+       <select name="burned">
+       <option value="">all</a>
+       <option value="burned">burned</a>
+       <option value="pending">pending</a>
+       </select>
+       files
        &nbsp;&nbsp;&nbsp;
        <input type="submit" value="Search">
 </p>
@@ -58,6 +65,10 @@ sub action() {
        (yyyy-mm-dd)
 </p>
 
+<p style="color: gray;">
+       <input type="checkbox" name="use_hest"> use faster full-text search engine
+</p>
+
 <input type="hidden" value="search" name="action">
 <input type="hidden" value="results" name="search_results">
 </form>
@@ -67,24 +78,15 @@ sub action() {
 
        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);
 
-               my ($where, $from_f, $to_f, $from_b, $to_b) = BackupPC::SearchLib::getWhere(\%In);
-
-               my $q = $In{'search_filename'};
-
-               # DEBUG
-               #$html .= "<small>";
-               #$html .= "Filename filter: $q</br>" if ($q);
-               #$html .= "Files date limit: $from_f - $to_f</br>" if ($from_f || $to_f);
-               #$html .= "Backup date limit: $from_b - $to_b</br>" if ($from_b || $to_b);
-               #$html .= "</small>";
-
-               $html .= BackupPC::SearchLib::displayGrid( $where, 1, $In{'offset'}, $q);
+               $html .= BackupPC::SearchLib::displayGrid( \%In );
        }
 
        Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $html );