]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Allow searching of attachment stuff using boolean charts.
authorterry%mozilla.org <>
Mon, 31 Jan 2000 03:21:42 +0000 (03:21 +0000)
committerterry%mozilla.org <>
Mon, 31 Jan 2000 03:21:42 +0000 (03:21 +0000)
buglist.cgi
checksetup.pl

index 3bc6a036d3daccd888bf07fc9740e95d178c8136..4c0505bc3e88f18c50e3a485de89fd3cfd1d2715 100755 (executable)
@@ -368,6 +368,34 @@ sub GenerateSQL {
              push(@wherepart, "$table.bug_id = bugs.bug_id");
              $f = "$table.thetext";
          },
+         "^attachments\..*," => sub {
+             my $table = "attachments_$chartid";
+             push(@supptables, "LEFT JOIN attachments $table ON bugs.bug_id = $table.bug_id");
+             $f =~ m/^attachments\.(.*)$/;
+             my $field = $1;
+             if ($t eq "changedby") {
+                 $v = DBNameToIdAndCheck($v);
+                 $q = SqlQuote($v);
+                 $field = "submitter_id";
+                 $t = "equals";
+             } elsif ($t eq "changedbefore") {
+                 $v = SqlifyDate($v);
+                 $q = SqlQuote($v);
+                 $field = "creation_ts";
+                 $t = "lessthan";
+             } elsif ($t eq "changedafter") {
+                 $v = SqlifyDate($v);
+                 $q = SqlQuote($v);
+                 $field = "creation_ts";
+                 $t = "greaterthan";
+             }
+             if ($field eq "ispatch") {
+                 if ($v ne "0" && $v ne "1") {
+                     return Error("The only legal values for the 'Attachment is patch' field is 0 or 1.");
+                 }
+             }
+             $f = "$table.$field";
+         },
          "^changedin," => sub {
              $f = "(to_days(now()) - to_days(bugs.delta_ts))";
          },
@@ -826,7 +854,6 @@ query.  You will have to start over at the <A HREF="query.cgi">query page</A>.
         exit;
     }
     my @list = split(/:/, $::COOKIE{'BUGLIST'});
-    $::MFORM{'bug_id'} = \@list;
     $::FORM{'bug_id'} = join(',', @list);
     if (!$::FORM{'order'}) {
         $::FORM{'order'} = 'reuse last sort';
index 8bd430e42b8884afecdcf63e69e458e9675f56f4..05bcf31ac2a9325eb23a55d4a36f05c221733f06 100755 (executable)
@@ -898,6 +898,10 @@ AddFDef("qa_contact", "QAContact", 0);
 AddFDef("cc", "CC", 0);
 AddFDef("dependson", "BugsThisDependsOn", 0);
 AddFDef("blocked", "OtherBugsDependingOnThis", 0);
+AddFDef("attachments.description", "Attachment description", 0);
+AddFDef("attachments.thedata", "Attachment data", 0);
+AddFDef("attachments.mimetype", "Attachment mime type", 0);
+AddFDef("attachments.ispatch", "Attachment is patch", 0);
 AddFDef("target_milestone", "Target Milestone", 0);
 AddFDef("delta_ts", "Last changed date", 0);
 AddFDef("(to_days(now()) - to_days(bugs.delta_ts))", "Days since bug changed",