Massive stomp on the query page and buglist page. Added the ability

to use the "boolean charts" to do very powerful queries.
This commit is contained in:
terry%mozilla.org 2000-01-28 01:01:40 +00:00
Родитель 163d1d2283
Коммит 7ecba992bf
5 изменённых файлов: 768 добавлений и 374 удалений

Просмотреть файл

@ -78,10 +78,10 @@ sub url_quote {
}
sub ProcessFormFields {
my ($buffer) = (@_);
undef %::FORM;
undef %::MFORM;
sub ParseUrlString {
my ($buffer, $f, $m) = (@_);
undef %$f;
undef %$m;
my %isnull;
my $remaining = $buffer;
@ -105,13 +105,13 @@ sub ProcessFormFields {
$value = "";
}
if ($value ne "") {
if (defined $::FORM{$name}) {
$::FORM{$name} .= $value;
my $ref = $::MFORM{$name};
if (defined $f->{$name}) {
$f->{$name} .= $value;
my $ref = $m->{$name};
push @$ref, $value;
} else {
$::FORM{$name} = $value;
$::MFORM{$name} = [$value];
$f->{$name} = $value;
$m->{$name} = [$value];
}
} else {
$isnull{$name} = 1;
@ -119,15 +119,21 @@ sub ProcessFormFields {
}
if (defined %isnull) {
foreach my $name (keys(%isnull)) {
if (!defined $::FORM{$name}) {
$::FORM{$name} = "";
$::MFORM{$name} = [];
if (!defined $f->{$name}) {
$f->{$name} = "";
$m->{$name} = [];
}
}
}
}
sub ProcessFormFields {
my ($buffer) = (@_);
return ParseUrlString($buffer, \%::FORM, \%::MFORM);
}
sub ProcessMultipartFormFields {
my ($boundary) = (@_);
$boundary =~ s/^-*//;

Просмотреть файл

@ -0,0 +1,79 @@
<html> <head>
<title>The "boolean chart" section of the query page</title>
</head>
<body>
<h1>The "boolean chart" section of the query page</h1>
("Boolean chart" is a terrible term; anyone got a better one I can use
instead?)
<p>
The Bugzilla query page is designed to be reasonably easy to use.
But, with such ease of use always comes some lack of power. The
"boolean chart" section is designed to let you do very powerful
queries, but it's not the easiest thing to learn (or explain).
<p>
So.
<p>
The boolean chart starts with a single "term". A term is a
combination of two pulldown menus and a text field.
You choose items from the menus, specifying "what kind of thing
am I searching for" and "what kind of matching do I want", and type in
a value on the text field, specifying "what should it match".
<p>
The real fun starts when you click on the "Or" or "And" buttons. If
you bonk on the "Or" button, then you get a second term to the right
of the first one. You can then configure that term, and the result of
the query will be anything that matches either of the terms.
<p>
Or, you can bonk the "And" button, and get a new term below the
original one, and now the result of the query will be anything that
matches both of the terms.
<p>
And you can keep clicking "And" and "Or", and get a page with tons of
terms. "Or" has higher precedence than "And". (In other words, you
can think of each line of "Or" stuff as having parenthesis around it.)
<p>
The most subtle thing is this "Add another boolean chart" button.
This is almost the same thing as the "And" button. The difference is
if you use one of the fields where several items can be associated
with a single bug. This includes "Comments", "CC", and all the
"changed [something]" entries. Now, if you have multiple terms that
all talk about one of these fields, it's ambiguous whether they are
allowed to be talking about different instances of that field. So,
to let you have it both ways, they always mean the same instance,
unless the terms appear on different charts.
<p>
For example: if you search for "priority changed to P5" and
"priority changed by person@addr", it will only find bugs where the
given person at some time changed the priority to P5. However, if
what you really want is to find all bugs where the milestone was
changed at some time by the person, and someone (possibly someone
else) at some time changed the milestone to P5, then you would put
the two terms in two different charts.
<p>
Clear as mud? Please, I beg you, rewrite this document to make
everything crystal clear, and send the improved version to <a
href="terry@mozilla.org">Terry</a>.
<hr>
<!-- hhmts start -->
Last modified: Thu Jan 27 16:56:11 2000
<!-- hhmts end -->
</body> </html>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -882,19 +882,24 @@ AddFDef("short_desc", "Summary", 1);
AddFDef("product", "Product", 1);
AddFDef("version", "Version", 1);
AddFDef("rep_platform", "Platform", 1);
AddFDef("bug_file_loc", "URL", 1);
AddFDef("op_sys", "OS/Version", 1);
AddFDef("bug_status", "Status", 1);
AddFDef("status_whiteboard", "Status Whiteboard", 1);
AddFDef("keywords", "Keywords", 1);
AddFDef("resolution", "Resolution", 1);
AddFDef("bug_severity", "Severity", 1);
AddFDef("priority", "Priority", 1);
AddFDef("component", "Component", 1);
AddFDef("assigned_to", "AssignedTo", 1);
AddFDef("reporter", "ReportedBy", 1);
AddFDef("votes", "Votes", 0);
AddFDef("qa_contact", "QAContact", 0);
AddFDef("cc", "CC", 0);
AddFDef("dependson", "BugsThisDependsOn", 0);
AddFDef("blocked", "OtherBugsDependingOnThis", 0);
AddFDef("target_milestone", "Target Milestone", 0);
AddFDef("longdesc", "Comment", 0);

Просмотреть файл

@ -468,7 +468,7 @@ print "
</td>
<td align=left valign=top>
@{[make_selection_widget(\"platform\",\@::legal_platform,$default{'platform'}, $type{'platform'}, 1)]}
@{[make_selection_widget(\"rep_platform\",\@::legal_platform,$default{'platform'}, $type{'platform'}, 1)]}
</td>
<td align=left valign=top>
@ -663,6 +663,104 @@ print "
<p>
";
my @fields;
push(@fields, ["noop", "---"]);
SendSQL("SELECT name, description FROM fielddefs ORDER BY sortkey");
while (MoreSQLData()) {
my ($name, $description) = (FetchSQLData());
push(@fields, [$name, $description]);
}
my @types = (
["noop", "---"],
["equals", "equal to"],
["notequals", "not equal to"],
["casesubstring", "contains (case-sensitive) substring"],
["substring", "contains (case-insensitive) substring"],
["notsubstring", "does not contain (case-insensitive) substring"],
["regexp", "contains regexp"],
["notregexp", "does not contain regexp"],
["lessthan", "less than"],
["greaterthan", "greater than"],
["anywords", "any words"],
["allwords", "all words"],
["nowords", "none of the words"],
["changedbefore", "changed before"],
["changedafter", "changed after"],
["changedto", "changed to"],
["changedby", "changed by"],
);
foreach my $cmd (grep(/^cmd-/, keys(%::FORM))) {
if ($cmd =~ /^cmd-add(\d+)-(\d+)-(\d+)$/) {
$::FORM{"field$1-$2-$3"} = "xyzzy";
}
}
# foreach my $i (sort(keys(%::FORM))) {
# print "$i : " . value_quote($::FORM{$i}) . "<BR>\n";
# }
if (!exists $::FORM{'field0-0-0'}) {
$::FORM{'field0-0-0'} = "xyzzy";
}
print qq{<A NAME="chart"> </A>\n};
my $chart;
for ($chart=0 ; exists $::FORM{"field$chart-0-0"} ; $chart++) {
my @rows;
my $row;
for ($row = 0 ; exists $::FORM{"field$chart-$row-0"} ; $row++) {
my @cols;
my $col;
for ($col = 0 ; exists $::FORM{"field$chart-$row-$col"} ; $col++) {
my $key = "$chart-$row-$col";
my $deffield = $::FORM{"field$key"} || "";
my $deftype = $::FORM{"type$key"} || "";
my $defvalue = value_quote($::FORM{"value$key"} || "");
my $line = "";
$line .= "<TD>";
$line .= BuildPulldown("field$key", \@fields, $deffield);
$line .= BuildPulldown("type$key", \@types, $deftype);
$line .= qq{<INPUT NAME="value$key" VALUE="$defvalue">};
$line .= "</TD>\n";
push(@cols, $line);
}
push(@rows, "<TR>" . join(qq{<TD ALIGN="center"> or </TD>\n}, @cols) .
qq{<TD><INPUT TYPE="submit" VALUE="Or" NAME="cmd-add$chart-$row-$col"></TD></TR>});
}
print qq{
<HR>
<TABLE>
};
print join('<TR><TD>And</TD></TR>', @rows);
print qq{
<TR><TD><INPUT TYPE="submit" VALUE="And" NAME="cmd-add$chart-$row-0">
};
my $n = $chart + 1;
if (!exists $::FORM{"field$n-0-0"}) {
print qq{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="submit" VALUE="Add another boolean chart" NAME="cmd-add$n-0-0">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<NOBR><A HREF="booleanchart.html">What is this stuff?</A></NOBR>
};
}
print qq{
</TD>
</TR>
</TABLE>
};
}
print qq{<HR>};
if (!$userid) {
print qq{<INPUT TYPE="hidden" NAME="cmdtype" VALUE="doit">};
} else {