Commit b078a812 authored by terry%mozilla.org's avatar terry%mozilla.org

Can now search for people who have added text to a bug.

parent 04824af9
...@@ -276,6 +276,9 @@ if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) || ...@@ -276,6 +276,9 @@ if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) ||
$query =~ s/bugs,/bugs left join cc on bugs.bug_id = cc.bug_id left join profiles ccname on cc.who = ccname.userid,/; $query =~ s/bugs,/bugs left join cc on bugs.bug_id = cc.bug_id left join profiles ccname on cc.who = ccname.userid,/;
} }
my $needlongdescs = 0; # Whether we need to patch in the longdescs
# table.
if (defined $::FORM{'sql'}) { if (defined $::FORM{'sql'}) {
$query .= "and (\n$::FORM{'sql'}\n)" $query .= "and (\n$::FORM{'sql'}\n)"
} else { } else {
...@@ -359,7 +362,8 @@ foreach my $id ("1", "2") { ...@@ -359,7 +362,8 @@ foreach my $id ("1", "2") {
my $foundone = 0; my $foundone = 0;
my $lead= "and (\n"; my $lead= "and (\n";
foreach my $field ("assigned_to", "reporter", "cc", "qa_contact") { foreach my $field ("assigned_to", "reporter", "cc", "qa_contact",
"longdesc") {
my $doit = $::FORM{"email$field$id"}; my $doit = $::FORM{"email$field$id"};
if (!$doit) { if (!$doit) {
next; next;
...@@ -372,12 +376,17 @@ foreach my $id ("1", "2") { ...@@ -372,12 +376,17 @@ foreach my $id ("1", "2") {
$table = "report"; $table = "report";
} elsif ($field eq "qa_contact") { } elsif ($field eq "qa_contact") {
$table = "qacont"; $table = "qacont";
} elsif ($field eq "longdesc") {
$table = "longdescname";
$needlongdescs = 1;
} else { } else {
$table = "ccname"; $table = "ccname";
} }
if ($type eq "exact") { if ($type eq "exact") {
if ($field eq "cc") { if ($field eq "cc") {
$query .= "\t$lead cc.who = $emailid\n"; $query .= "\t$lead cc.who = $emailid\n";
} elsif ($field eq "longdesc") {
$query .= "\t$lead longdesc.who = $emailid\n";
} else { } else {
$query .= "\t$lead $field = $emailid\n"; $query .= "\t$lead $field = $emailid\n";
} }
...@@ -524,8 +533,7 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc", ...@@ -524,8 +533,7 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc",
my $q = SqlQuote($s); my $q = SqlQuote($s);
my $type = $::FORM{$f . "_type"}; my $type = $::FORM{$f . "_type"};
if ($f eq "long_desc") { if ($f eq "long_desc") {
# Patch in the longdescs table. $needlongdescs = 1; # Patch in the longdescs table.
$query =~ s/where/, longdescs where/;
$query .= "and longdescs.bug_id = bugs.bug_id\n"; $query .= "and longdescs.bug_id = bugs.bug_id\n";
$n = "longdescs.thetext"; $n = "longdescs.thetext";
} }
...@@ -546,6 +554,12 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc", ...@@ -546,6 +554,12 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc",
} }
} }
if ($needlongdescs) {
$query =~ s/where/, longdescs left join profiles longdescname on longdescs.who = longdescname.userid where/;
$query .= " AND longdescs.bug_id = bugs.bug_id ";
}
$query .= "group by bugs.bug_id\n"; $query .= "group by bugs.bug_id\n";
...@@ -585,6 +599,11 @@ if (defined $::FORM{'order'} && $::FORM{'order'} ne "") { ...@@ -585,6 +599,11 @@ if (defined $::FORM{'order'} && $::FORM{'order'} ne "") {
} }
if ($::FORM{'debug'} && $serverpush) {
print "<PRE>$query</PRE>\n";
}
if (Param('expectbigqueries')) { if (Param('expectbigqueries')) {
SendSQL("set option SQL_BIG_TABLES=1"); SendSQL("set option SQL_BIG_TABLES=1");
} }
......
...@@ -75,8 +75,10 @@ foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform", ...@@ -75,8 +75,10 @@ foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform",
"chfieldto", "chfieldvalue", "chfieldto", "chfieldvalue",
"email1", "emailtype1", "emailreporter1", "email1", "emailtype1", "emailreporter1",
"emailassigned_to1", "emailcc1", "emailqa_contact1", "emailassigned_to1", "emailcc1", "emailqa_contact1",
"emaillongdesc1",
"email2", "emailtype2", "emailreporter2", "email2", "emailtype2", "emailreporter2",
"emailassigned_to2", "emailcc2", "emailqa_contact2", "emailassigned_to2", "emailcc2", "emailqa_contact2",
"emaillongdesc2",
"changedin", "votes", "short_desc", "short_desc_type", "changedin", "votes", "short_desc", "short_desc_type",
"long_desc", "long_desc_type", "bug_file_loc", "long_desc", "long_desc_type", "bug_file_loc",
"bug_file_loc_type", "status_whiteboard", "bug_file_loc_type", "status_whiteboard",
...@@ -138,6 +140,7 @@ sub GenerateEmailInput { ...@@ -138,6 +140,7 @@ sub GenerateEmailInput {
my $assignedto = ($default{"emailassigned_to$id"} eq "1") ? "checked" : ""; my $assignedto = ($default{"emailassigned_to$id"} eq "1") ? "checked" : "";
my $reporter = ($default{"emailreporter$id"} eq "1") ? "checked" : ""; my $reporter = ($default{"emailreporter$id"} eq "1") ? "checked" : "";
my $cc = ($default{"emailcc$id"} eq "1") ? "checked" : ""; my $cc = ($default{"emailcc$id"} eq "1") ? "checked" : "";
my $longdesc = ($default{"emaillongdesc$id"} eq "1") ? "checked" : "";
my $qapart = ""; my $qapart = "";
my $qacontact = ""; my $qacontact = "";
...@@ -188,7 +191,13 @@ sub GenerateEmailInput { ...@@ -188,7 +191,13 @@ sub GenerateEmailInput {
<tr> <tr>
<td align=right>(Will match any of the selected fields)</td> <td align=right>(Will match any of the selected fields)</td>
<td> <td>
<input type="checkbox" name="emailcc$id" value=1 $cc>CC &nbsp;&nbsp; <input type="checkbox" name="emailcc$id" value=1 $cc>CC
</td>
</tr>
<tr>
<td></td>
<td>
<input type="checkbox" name="emaillongdesc$id" value=1 $longdesc>Added comment
</td> </td>
</tr> </tr>
</table> </table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment