From 8fdb0d3601e63fb8a07bff32945fb5d84fbd4678 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Fri, 28 Jan 2000 09:01:36 +0000 Subject: Massive stomp on the query page and buglist page. Added the ability to use the "boolean charts" to do very powerful queries. --- query.cgi | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) (limited to 'query.cgi') diff --git a/query.cgi b/query.cgi index 5ed72da9b..6e3b2bd66 100755 --- a/query.cgi +++ b/query.cgi @@ -468,7 +468,7 @@ print " -@{[make_selection_widget(\"platform\",\@::legal_platform,$default{'platform'}, $type{'platform'}, 1)]} +@{[make_selection_widget(\"rep_platform\",\@::legal_platform,$default{'platform'}, $type{'platform'}, 1)]} @@ -663,6 +663,104 @@ print "

"; + +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}) . "
\n"; +# } + + +if (!exists $::FORM{'field0-0-0'}) { + $::FORM{'field0-0-0'} = "xyzzy"; +} + +print qq{ \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 .= ""; + $line .= BuildPulldown("field$key", \@fields, $deffield); + $line .= BuildPulldown("type$key", \@types, $deftype); + $line .= qq{}; + $line .= "\n"; + push(@cols, $line); + } + push(@rows, "" . join(qq{ or \n}, @cols) . + qq{}); + } + print qq{ +


+ +}; + print join('', @rows); + print qq{ + + +
And
+}; + my $n = $chart + 1; + if (!exists $::FORM{"field$n-0-0"}) { + print qq{ +      + +      +What is this stuff? +}; + } + print qq{ +
+ }; +} +print qq{
}; + + + + if (!$userid) { print qq{}; } else { -- cgit v1.2.3-24-g4f1b