1998-09-15 21:49:26 +00:00
|
|
|
#!/usr/bonsaitools/bin/perl -w
|
|
|
|
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
1998-08-26 06:14:20 +00:00
|
|
|
#
|
1999-11-01 23:33:56 +00:00
|
|
|
# The contents of this file are subject to the Mozilla Public
|
|
|
|
# License Version 1.1 (the "License"); you may not use this file
|
|
|
|
# except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
# implied. See the License for the specific language governing
|
|
|
|
# rights and limitations under the License.
|
|
|
|
#
|
1998-08-26 06:14:20 +00:00
|
|
|
# The Original Code is the Bugzilla Bug Tracking System.
|
1999-11-01 23:33:56 +00:00
|
|
|
#
|
1998-08-26 06:14:20 +00:00
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
1999-11-01 23:33:56 +00:00
|
|
|
# Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
1998-08-26 06:14:20 +00:00
|
|
|
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
1999-03-19 21:40:14 +00:00
|
|
|
# David Gardiner <david.gardiner@unisa.edu.au>
|
2000-11-20 19:42:36 +00:00
|
|
|
# Matthias Radestock <matthias@sorted.org>
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
use diagnostics;
|
|
|
|
use strict;
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
require "CGI.pl";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1999-12-06 17:09:54 +00:00
|
|
|
$::CheckOptionValues = 0; # It's OK if we have some bogus things in the
|
|
|
|
# pop-up lists here, from a remembered query
|
|
|
|
# that is no longer quite valid. We don't
|
|
|
|
# want to crap out in the query page.
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
# Shut up misguided -w warnings about "used only once":
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-11 21:32:43 +00:00
|
|
|
use vars
|
|
|
|
@::CheckOptionValues,
|
|
|
|
@::legal_resolution,
|
1998-09-15 21:49:26 +00:00
|
|
|
@::legal_bug_status,
|
2000-01-11 21:32:43 +00:00
|
|
|
@::legal_components,
|
|
|
|
@::legal_keywords,
|
1999-01-15 22:05:42 +00:00
|
|
|
@::legal_opsys,
|
1998-09-15 21:49:26 +00:00
|
|
|
@::legal_platform,
|
2000-01-11 21:32:43 +00:00
|
|
|
@::legal_priority,
|
|
|
|
@::legal_product,
|
1998-09-15 21:49:26 +00:00
|
|
|
@::legal_severity,
|
1999-01-27 21:17:10 +00:00
|
|
|
@::legal_target_milestone,
|
2000-01-11 21:32:43 +00:00
|
|
|
@::legal_versions,
|
1999-03-23 22:32:21 +00:00
|
|
|
@::log_columns,
|
1999-03-19 21:40:14 +00:00
|
|
|
%::versions,
|
|
|
|
%::components,
|
1998-09-15 21:49:26 +00:00
|
|
|
%::FORM;
|
|
|
|
|
|
|
|
|
|
|
|
if (defined $::FORM{"GoAheadAndLogIn"}) {
|
1998-08-26 06:14:20 +00:00
|
|
|
# We got here from a login page, probably from relogin.cgi. We better
|
|
|
|
# make sure the password is legit.
|
1998-09-15 21:49:26 +00:00
|
|
|
confirm_login();
|
2000-01-23 20:31:50 +00:00
|
|
|
} else {
|
|
|
|
quietly_check_login();
|
|
|
|
}
|
|
|
|
my $userid = 0;
|
|
|
|
if (defined $::COOKIE{"Bugzilla_login"}) {
|
|
|
|
$userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
# Backwards compatability hack -- if there are any of the old QUERY_*
|
|
|
|
# cookies around, and we are logged in, then move them into the database
|
|
|
|
# and nuke the cookie.
|
|
|
|
if ($userid) {
|
|
|
|
my @oldquerycookies;
|
|
|
|
foreach my $i (keys %::COOKIE) {
|
|
|
|
if ($i =~ /^QUERY_(.*)$/) {
|
|
|
|
push(@oldquerycookies, [$1, $i, $::COOKIE{$i}]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (defined $::COOKIE{'DEFAULTQUERY'}) {
|
|
|
|
push(@oldquerycookies, [$::defaultqueryname, 'DEFAULTQUERY',
|
|
|
|
$::COOKIE{'DEFAULTQUERY'}]);
|
|
|
|
}
|
|
|
|
if (@oldquerycookies) {
|
|
|
|
foreach my $ref (@oldquerycookies) {
|
|
|
|
my ($name, $cookiename, $value) = (@$ref);
|
|
|
|
if ($value) {
|
|
|
|
my $qname = SqlQuote($name);
|
|
|
|
SendSQL("SELECT query FROM namedqueries " .
|
|
|
|
"WHERE userid = $userid AND name = $qname");
|
|
|
|
my $query = FetchOneColumn();
|
|
|
|
if (!$query) {
|
|
|
|
SendSQL("REPLACE INTO namedqueries " .
|
|
|
|
"(userid, name, query) VALUES " .
|
|
|
|
"($userid, $qname, " . SqlQuote($value) . ")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print "Set-Cookie: $cookiename= ; path=/ ; expires=Sun, 30-Jun-1980 00:00:00 GMT\n";
|
|
|
|
}
|
|
|
|
}
|
2000-01-23 17:14:09 +00:00
|
|
|
}
|
2000-01-23 20:31:50 +00:00
|
|
|
|
2000-01-23 17:14:09 +00:00
|
|
|
|
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
if ($::FORM{'nukedefaultquery'}) {
|
|
|
|
if ($userid) {
|
|
|
|
SendSQL("DELETE FROM namedqueries " .
|
|
|
|
"WHERE userid = $userid AND name = '$::defaultqueryname'");
|
|
|
|
}
|
|
|
|
$::buffer = "";
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
my $userdefaultquery;
|
|
|
|
if ($userid) {
|
|
|
|
SendSQL("SELECT query FROM namedqueries " .
|
|
|
|
"WHERE userid = $userid AND name = '$::defaultqueryname'");
|
|
|
|
$userdefaultquery = FetchOneColumn();
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
my %default;
|
|
|
|
my %type;
|
1998-09-15 21:49:26 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
sub ProcessFormStuff {
|
|
|
|
my ($buf) = (@_);
|
|
|
|
my $foundone = 0;
|
|
|
|
foreach my $name ("bug_status", "resolution", "assigned_to",
|
|
|
|
"rep_platform", "priority", "bug_severity",
|
|
|
|
"product", "reporter", "op_sys",
|
|
|
|
"component", "version", "chfield", "chfieldfrom",
|
|
|
|
"chfieldto", "chfieldvalue",
|
|
|
|
"email1", "emailtype1", "emailreporter1",
|
|
|
|
"emailassigned_to1", "emailcc1", "emailqa_contact1",
|
|
|
|
"emaillongdesc1",
|
|
|
|
"email2", "emailtype2", "emailreporter2",
|
|
|
|
"emailassigned_to2", "emailcc2", "emailqa_contact2",
|
|
|
|
"emaillongdesc2",
|
|
|
|
"changedin", "votes", "short_desc", "short_desc_type",
|
|
|
|
"long_desc", "long_desc_type", "bug_file_loc",
|
|
|
|
"bug_file_loc_type", "status_whiteboard",
|
2000-01-26 21:48:36 +00:00
|
|
|
"status_whiteboard_type", "bug_id",
|
|
|
|
"bugidtype", "keywords", "keywords_type") {
|
2000-01-23 20:31:50 +00:00
|
|
|
$default{$name} = "";
|
|
|
|
$type{$name} = 0;
|
1998-09-15 21:49:26 +00:00
|
|
|
}
|
2000-01-23 20:31:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
foreach my $item (split(/\&/, $buf)) {
|
|
|
|
my @el = split(/=/, $item);
|
|
|
|
my $name = $el[0];
|
|
|
|
my $value;
|
|
|
|
if ($#el > 0) {
|
|
|
|
$value = url_decode($el[1]);
|
1998-08-26 06:14:20 +00:00
|
|
|
} else {
|
2000-01-23 20:31:50 +00:00
|
|
|
$value = "";
|
|
|
|
}
|
|
|
|
if (defined $default{$name}) {
|
|
|
|
$foundone = 1;
|
|
|
|
if ($default{$name} ne "") {
|
|
|
|
$default{$name} .= "|$value";
|
|
|
|
$type{$name} = 1;
|
|
|
|
} else {
|
|
|
|
$default{$name} = $value;
|
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
}
|
2000-01-23 20:31:50 +00:00
|
|
|
return $foundone;
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
1998-09-15 21:49:26 +00:00
|
|
|
|
1999-03-23 22:32:21 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
if (!ProcessFormStuff($::buffer)) {
|
|
|
|
# Ah-hah, there was no form stuff specified. Do it again with the
|
|
|
|
# default query.
|
|
|
|
if ($userdefaultquery) {
|
|
|
|
ProcessFormStuff($userdefaultquery);
|
|
|
|
} else {
|
|
|
|
ProcessFormStuff(Param("defaultquery"));
|
|
|
|
}
|
|
|
|
}
|
1999-03-23 22:32:21 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
if ($default{'chfieldto'} eq "") {
|
|
|
|
$default{'chfieldto'} = "Now";
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
print "Set-Cookie: BUGLIST=
|
|
|
|
Content-type: text/html\n\n";
|
|
|
|
|
|
|
|
GetVersionTable();
|
1999-01-19 00:07:46 +00:00
|
|
|
|
|
|
|
sub GenerateEmailInput {
|
|
|
|
my ($id) = (@_);
|
|
|
|
my $defstr = value_quote($default{"email$id"});
|
|
|
|
my $deftype = $default{"emailtype$id"};
|
|
|
|
if ($deftype eq "") {
|
|
|
|
$deftype = "substring";
|
|
|
|
}
|
|
|
|
my $assignedto = ($default{"emailassigned_to$id"} eq "1") ? "checked" : "";
|
|
|
|
my $reporter = ($default{"emailreporter$id"} eq "1") ? "checked" : "";
|
|
|
|
my $cc = ($default{"emailcc$id"} eq "1") ? "checked" : "";
|
2000-01-23 02:22:11 +00:00
|
|
|
my $longdesc = ($default{"emaillongdesc$id"} eq "1") ? "checked" : "";
|
1999-01-19 00:07:46 +00:00
|
|
|
|
1999-01-27 21:17:10 +00:00
|
|
|
my $qapart = "";
|
2000-01-17 22:31:05 +00:00
|
|
|
my $qacontact = "";
|
1999-01-27 21:17:10 +00:00
|
|
|
if (Param("useqacontact")) {
|
2000-01-17 22:31:05 +00:00
|
|
|
$qacontact = ($default{"emailqa_contact$id"} eq "1") ? "checked" : "";
|
1999-01-27 21:17:10 +00:00
|
|
|
$qapart = qq|
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" name="emailqa_contact$id" value=1 $qacontact>QA Contact
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|;
|
|
|
|
}
|
2000-01-17 22:31:05 +00:00
|
|
|
if ($assignedto eq "" && $reporter eq "" && $cc eq "" &&
|
|
|
|
$qacontact eq "") {
|
|
|
|
if ($id eq "1") {
|
|
|
|
$assignedto = "checked";
|
|
|
|
} else {
|
|
|
|
$reporter = "checked";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-01-27 21:17:10 +00:00
|
|
|
|
2000-01-25 07:54:57 +00:00
|
|
|
$default{"emailtype$id"} ||= "substring";
|
|
|
|
|
|
|
|
return qq{
|
1999-01-19 00:07:46 +00:00
|
|
|
<table border=1 cellspacing=0 cellpadding=0>
|
|
|
|
<tr><td>
|
|
|
|
<table cellspacing=0 cellpadding=0>
|
|
|
|
<tr>
|
2001-03-07 05:02:46 +00:00
|
|
|
<td rowspan=2 valign=top><a href="queryhelp.cgi#peopleinvolved">Email:</a>
|
1999-05-05 21:25:29 +00:00
|
|
|
<input name="email$id" size="30" value="$defstr"> matching as
|
2000-01-25 07:54:57 +00:00
|
|
|
} . BuildPulldown("emailtype$id",
|
|
|
|
[["regexp", "regexp"],
|
|
|
|
["notregexp", "not regexp"],
|
|
|
|
["substring", "substring"],
|
|
|
|
["exact", "exact"]],
|
|
|
|
$default{"emailtype$id"}) . qq{
|
1999-01-19 00:07:46 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" name="emailassigned_to$id" value=1 $assignedto>Assigned To
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" name="emailreporter$id" value=1 $reporter>Reporter
|
|
|
|
</td>
|
1999-01-27 21:17:10 +00:00
|
|
|
</tr>$qapart
|
1999-01-19 00:07:46 +00:00
|
|
|
<tr>
|
|
|
|
<td align=right>(Will match any of the selected fields)</td>
|
|
|
|
<td>
|
2000-01-23 02:22:11 +00:00
|
|
|
<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
|
1999-01-19 00:07:46 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</table>
|
2000-01-25 07:54:57 +00:00
|
|
|
};
|
1999-01-19 00:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $emailinput1 = GenerateEmailInput(1);
|
|
|
|
my $emailinput2 = GenerateEmailInput(2);
|
|
|
|
|
2000-07-18 15:28:19 +00:00
|
|
|
# if using usebuggroups, then we don't want people to see products they don't
|
|
|
|
# have access to. remove them from the list.
|
|
|
|
|
|
|
|
@::product_list = ();
|
2000-11-20 19:42:36 +00:00
|
|
|
my %component_set;
|
|
|
|
my %version_set;
|
|
|
|
my %milestone_set;
|
2000-07-18 15:28:19 +00:00
|
|
|
foreach my $p (@::legal_product) {
|
2000-11-20 19:42:36 +00:00
|
|
|
if(Param("usebuggroups")
|
|
|
|
&& GroupExists($p)
|
|
|
|
&& !UserInGroup($p)) {
|
|
|
|
# If we're using bug groups to restrict entry on products, and
|
|
|
|
# this product has a bug group, and the user is not in that
|
|
|
|
# group, we don't want to include that product in this list.
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
push @::product_list, $p;
|
|
|
|
foreach my $c (@{$::components{$p}}) {
|
|
|
|
$component_set{$c} = 1;
|
|
|
|
}
|
|
|
|
foreach my $v (@{$::versions{$p}}) {
|
|
|
|
$version_set{$v} = 1;
|
|
|
|
}
|
|
|
|
foreach my $m (@{$::target_milestone{$p}}) {
|
|
|
|
$milestone_set{$m} = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@::component_list = ();
|
|
|
|
@::version_list = ();
|
|
|
|
@::milestone_list = ();
|
|
|
|
foreach my $c (@::legal_components) {
|
|
|
|
if ($component_set{$c}) {
|
|
|
|
push @::component_list, $c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach my $v (@::legal_versions) {
|
|
|
|
if ($version_set{$v}) {
|
|
|
|
push @::version_list, $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach my $m (@::legal_target_milestone) {
|
|
|
|
if ($milestone_set{$m}) {
|
|
|
|
push @::milestone_list, $m;
|
|
|
|
}
|
2000-07-18 15:28:19 +00:00
|
|
|
}
|
1999-01-19 00:07:46 +00:00
|
|
|
|
1999-03-19 21:40:14 +00:00
|
|
|
# javascript
|
|
|
|
|
|
|
|
my $jscript = << 'ENDSCRIPT';
|
2000-02-14 23:29:20 +00:00
|
|
|
<script language="Javascript1.1" type="text/javascript">
|
1999-03-19 21:40:14 +00:00
|
|
|
<!--
|
|
|
|
var cpts = new Array();
|
|
|
|
var vers = new Array();
|
2000-03-21 16:47:06 +00:00
|
|
|
var tms = new Array();
|
1999-03-19 21:40:14 +00:00
|
|
|
ENDSCRIPT
|
|
|
|
|
|
|
|
|
|
|
|
my $p;
|
|
|
|
my $v;
|
|
|
|
my $c;
|
2000-03-21 16:47:06 +00:00
|
|
|
my $m;
|
1999-03-19 21:40:14 +00:00
|
|
|
my $i = 0;
|
|
|
|
my $j = 0;
|
|
|
|
|
2000-11-20 19:42:36 +00:00
|
|
|
foreach $c (@::component_list) {
|
1999-09-10 18:53:51 +00:00
|
|
|
$jscript .= "cpts['$c'] = new Array();\n";
|
1999-03-19 21:40:14 +00:00
|
|
|
}
|
|
|
|
|
2000-11-20 19:42:36 +00:00
|
|
|
foreach $v (@::version_list) {
|
1999-09-10 18:53:51 +00:00
|
|
|
$jscript .= "vers['$v'] = new Array();\n";
|
1999-03-19 21:40:14 +00:00
|
|
|
}
|
|
|
|
|
2000-03-21 16:47:06 +00:00
|
|
|
my $tm;
|
2000-11-20 19:42:36 +00:00
|
|
|
foreach $tm (@::milestone_list) {
|
2000-03-21 16:47:06 +00:00
|
|
|
$jscript .= "tms['$tm'] = new Array();\n";
|
|
|
|
}
|
1999-03-19 21:40:14 +00:00
|
|
|
|
2000-07-18 15:28:19 +00:00
|
|
|
for $p (@::product_list) {
|
1999-04-27 17:17:49 +00:00
|
|
|
if ($::components{$p}) {
|
|
|
|
foreach $c (@{$::components{$p}}) {
|
2000-02-14 23:29:20 +00:00
|
|
|
$jscript .= "cpts['$c'][cpts['$c'].length] = '$p';\n";
|
1999-04-27 17:17:49 +00:00
|
|
|
}
|
1999-03-19 21:40:14 +00:00
|
|
|
}
|
1999-04-27 17:17:49 +00:00
|
|
|
|
|
|
|
if ($::versions{$p}) {
|
|
|
|
foreach $v (@{$::versions{$p}}) {
|
2000-02-14 23:29:20 +00:00
|
|
|
$jscript .= "vers['$v'][vers['$v'].length] = '$p';\n";
|
1999-04-27 17:17:49 +00:00
|
|
|
}
|
1999-03-19 21:40:14 +00:00
|
|
|
}
|
2000-03-21 16:47:06 +00:00
|
|
|
|
|
|
|
if ($::target_milestone{$p}) {
|
|
|
|
foreach $m (@{$::target_milestone{$p}}) {
|
|
|
|
$jscript .= "tms['$m'][tms['$m'].length] = '$p';\n";
|
|
|
|
}
|
|
|
|
}
|
1999-03-19 21:40:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$i = 0;
|
2001-02-28 23:00:28 +00:00
|
|
|
$jscript .= << 'ENDSCRIPT';
|
1999-03-19 21:40:14 +00:00
|
|
|
|
|
|
|
// Only display versions/components valid for selected product(s)
|
|
|
|
|
|
|
|
function selectProduct(f) {
|
1999-05-13 02:45:20 +00:00
|
|
|
// Netscape 4.04 and 4.05 also choke with an "undefined"
|
|
|
|
// error. if someone can figure out how to "define" the
|
|
|
|
// whatever, we'll remove this hack. in the mean time, we'll
|
|
|
|
// assume that v4.00-4.03 also die, so we'll disable the neat
|
|
|
|
// javascript stuff for Netscape 4.05 and earlier.
|
1999-03-24 21:59:26 +00:00
|
|
|
|
1999-03-19 21:40:14 +00:00
|
|
|
var cnt = 0;
|
|
|
|
var i;
|
|
|
|
var j;
|
2000-08-30 22:49:17 +00:00
|
|
|
|
|
|
|
if (!f) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-03-19 21:40:14 +00:00
|
|
|
for (i=0 ; i<f.product.length ; i++) {
|
|
|
|
if (f.product[i].selected) {
|
|
|
|
cnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var doall = (cnt == f.product.length || cnt == 0);
|
|
|
|
|
|
|
|
var csel = new Array();
|
|
|
|
for (i=0 ; i<f.component.length ; i++) {
|
|
|
|
if (f.component[i].selected) {
|
|
|
|
csel[f.component[i].value] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
f.component.options.length = 0;
|
|
|
|
|
|
|
|
for (c in cpts) {
|
2000-02-14 23:29:20 +00:00
|
|
|
if (typeof(cpts[c]) == 'function') continue;
|
1999-03-19 21:40:14 +00:00
|
|
|
var doit = doall;
|
|
|
|
for (i=0 ; !doit && i<f.product.length ; i++) {
|
|
|
|
if (f.product[i].selected) {
|
|
|
|
var p = f.product[i].value;
|
|
|
|
for (j in cpts[c]) {
|
2000-02-14 23:29:20 +00:00
|
|
|
if (typeof(cpts[c][j]) == 'function') continue;
|
1999-03-19 21:40:14 +00:00
|
|
|
var p2 = cpts[c][j];
|
|
|
|
if (p2 == p) {
|
|
|
|
doit = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (doit) {
|
|
|
|
var l = f.component.length;
|
|
|
|
f.component[l] = new Option(c, c);
|
2001-01-18 02:14:11 +00:00
|
|
|
if (csel.length && csel[c]) {
|
1999-03-19 21:40:14 +00:00
|
|
|
f.component[l].selected = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var vsel = new Array();
|
|
|
|
for (i=0 ; i<f.version.length ; i++) {
|
|
|
|
if (f.version[i].selected) {
|
|
|
|
vsel[f.version[i].value] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
f.version.options.length = 0;
|
|
|
|
|
|
|
|
for (v in vers) {
|
2000-02-14 23:29:20 +00:00
|
|
|
if (typeof(vers[v]) == 'function') continue;
|
2001-01-18 02:14:11 +00:00
|
|
|
doit = doall;
|
1999-03-19 21:40:14 +00:00
|
|
|
for (i=0 ; !doit && i<f.product.length ; i++) {
|
|
|
|
if (f.product[i].selected) {
|
2001-01-18 02:14:11 +00:00
|
|
|
p = f.product[i].value;
|
1999-03-19 21:40:14 +00:00
|
|
|
for (j in vers[v]) {
|
2000-02-14 23:29:20 +00:00
|
|
|
if (typeof(vers[v][j]) == 'function') continue;
|
2001-01-18 02:14:11 +00:00
|
|
|
p2 = vers[v][j];
|
1999-03-19 21:40:14 +00:00
|
|
|
if (p2 == p) {
|
|
|
|
doit = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (doit) {
|
2001-01-18 02:14:11 +00:00
|
|
|
l = f.version.length;
|
1999-03-19 21:40:14 +00:00
|
|
|
f.version[l] = new Option(v, v);
|
2001-01-18 02:14:11 +00:00
|
|
|
if (vsel.length && vsel[v]) {
|
1999-03-19 21:40:14 +00:00
|
|
|
f.version[l].selected = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-02-28 23:00:28 +00:00
|
|
|
ENDSCRIPT
|
|
|
|
if (Param("usetargetmilestone")) {
|
|
|
|
$jscript .= q{
|
|
|
|
if (f.target_milestone) {
|
2000-08-21 20:16:00 +00:00
|
|
|
var tmsel = new Array();
|
|
|
|
for (i=0 ; i<f.target_milestone.length ; i++) {
|
|
|
|
if (f.target_milestone[i].selected) {
|
|
|
|
tmsel[f.target_milestone[i].value] = 1;
|
|
|
|
}
|
2000-03-21 16:47:06 +00:00
|
|
|
}
|
2000-08-21 20:16:00 +00:00
|
|
|
|
|
|
|
f.target_milestone.options.length = 0;
|
|
|
|
|
|
|
|
for (tm in tms) {
|
|
|
|
if (typeof(tms[v]) == 'function') continue;
|
2001-01-18 02:14:11 +00:00
|
|
|
doit = doall;
|
2000-08-21 20:16:00 +00:00
|
|
|
for (i=0 ; !doit && i<f.product.length ; i++) {
|
|
|
|
if (f.product[i].selected) {
|
2001-01-18 02:14:11 +00:00
|
|
|
p = f.product[i].value;
|
2000-08-21 20:16:00 +00:00
|
|
|
for (j in tms[tm]) {
|
|
|
|
if (typeof(tms[tm][j]) == 'function') continue;
|
2001-01-18 02:14:11 +00:00
|
|
|
p2 = tms[tm][j];
|
2000-08-21 20:16:00 +00:00
|
|
|
if (p2 == p) {
|
|
|
|
doit = true;
|
|
|
|
break;
|
|
|
|
}
|
2000-03-21 16:47:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-08-21 20:16:00 +00:00
|
|
|
if (doit) {
|
2001-01-18 02:14:11 +00:00
|
|
|
l = f.target_milestone.length;
|
2000-08-21 20:16:00 +00:00
|
|
|
f.target_milestone[l] = new Option(tm, tm);
|
2001-01-18 02:14:11 +00:00
|
|
|
if (tmsel.length && tmsel[tm]) {
|
2000-08-21 20:16:00 +00:00
|
|
|
f.target_milestone[l].selected = true;
|
|
|
|
}
|
2000-03-21 16:47:06 +00:00
|
|
|
}
|
|
|
|
}
|
2001-02-28 23:00:28 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$jscript .= << 'ENDSCRIPT';
|
1999-03-19 21:40:14 +00:00
|
|
|
}
|
|
|
|
// -->
|
1999-03-24 21:59:26 +00:00
|
|
|
</script>
|
|
|
|
|
2001-02-28 23:00:28 +00:00
|
|
|
ENDSCRIPT
|
1999-03-19 21:40:14 +00:00
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Muck the "legal product" list so that the default one is always first (and
|
|
|
|
# is therefore visibly selected.
|
|
|
|
|
|
|
|
# Commented out, until we actually have enough products for this to matter.
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
# set w [lsearch $legal_product $default{"product"}]
|
1998-08-26 06:14:20 +00:00
|
|
|
# if {$w >= 0} {
|
1998-09-15 21:49:26 +00:00
|
|
|
# set legal_product [concat $default{"product"} [lreplace $legal_product $w $w]]
|
1998-08-26 06:14:20 +00:00
|
|
|
# }
|
|
|
|
|
2000-02-14 23:29:20 +00:00
|
|
|
PutHeader("Bugzilla Query Page", "Query",
|
|
|
|
"This page lets you search the database for recorded bugs.",
|
|
|
|
q{onLoad="selectProduct(document.forms[0]);"},
|
|
|
|
0, $jscript);
|
1998-09-15 21:49:26 +00:00
|
|
|
|
|
|
|
push @::legal_resolution, "---"; # Oy, what a hack.
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1999-05-05 21:18:39 +00:00
|
|
|
my @logfields = ("[Bug creation]", @::log_columns);
|
|
|
|
|
2001-03-07 05:02:46 +00:00
|
|
|
print"<P>Give me a <A HREF=\"queryhelp.cgi\">clue</A> about how to use this form.<P>";
|
|
|
|
|
2000-01-06 21:16:15 +00:00
|
|
|
print qq{
|
|
|
|
<FORM METHOD=GET ACTION="buglist.cgi">
|
1998-08-26 06:14:20 +00:00
|
|
|
|
|
|
|
<table>
|
|
|
|
<tr>
|
2001-03-07 05:02:46 +00:00
|
|
|
<th align=left><A HREF="queryhelp.cgi#status">Status</a>:</th>
|
|
|
|
<th align=left><A HREF="queryhelp.cgi#resolution">Resolution</a>:</th>
|
|
|
|
<th align=left><A HREF="queryhelp.cgi#platform">Platform</a>:</th>
|
|
|
|
<th align=left><A HREF="queryhelp.cgi#opsys">OpSys</a>:</th>
|
|
|
|
<th align=left><A HREF="queryhelp.cgi#priority">Priority</a>:</th>
|
|
|
|
<th align=left><A HREF="queryhelp.cgi#severity">Severity</a>:</th>
|
2000-01-06 21:16:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
print "
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
2000-01-14 22:35:49 +00:00
|
|
|
|
|
|
|
@{[make_selection_widget(\"bug_status\",\@::legal_bug_status,$default{'bug_status'}, $type{'bug_status'}, 1)]}
|
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
</td>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
2000-01-14 22:35:49 +00:00
|
|
|
@{[make_selection_widget(\"resolution\",\@::legal_resolution,$default{'resolution'}, $type{'resolution'}, 1)]}
|
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
</td>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
2000-01-28 01:01:40 +00:00
|
|
|
@{[make_selection_widget(\"rep_platform\",\@::legal_platform,$default{'platform'}, $type{'platform'}, 1)]}
|
2000-01-14 22:35:49 +00:00
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
</td>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
2000-01-17 03:14:14 +00:00
|
|
|
@{[make_selection_widget(\"op_sys\",\@::legal_opsys,$default{'op_sys'}, $type{'op_sys'}, 1)]}
|
2000-01-14 22:35:49 +00:00
|
|
|
|
1999-01-15 22:05:42 +00:00
|
|
|
</td>
|
|
|
|
<td align=left valign=top>
|
2000-01-14 22:35:49 +00:00
|
|
|
@{[make_selection_widget(\"priority\",\@::legal_priority,$default{'priority'}, $type{'priority'}, 1)]}
|
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
</td>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
2000-01-14 22:35:49 +00:00
|
|
|
@{[make_selection_widget(\"bug_severity\",\@::legal_severity,$default{'bug_severity'}, $type{'bug_severity'}, 1)]}
|
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<p>
|
1999-10-08 14:41:17 +00:00
|
|
|
|
|
|
|
<table>
|
|
|
|
<tr><td colspan=2>
|
1999-01-19 00:07:46 +00:00
|
|
|
$emailinput1<p>
|
1999-10-08 14:41:17 +00:00
|
|
|
</td></tr><tr><td colspan=2>
|
1999-01-19 00:07:46 +00:00
|
|
|
$emailinput2<p>
|
2000-01-25 02:50:37 +00:00
|
|
|
</td></tr>";
|
|
|
|
|
|
|
|
my $inclselected = "SELECTED";
|
|
|
|
my $exclselected = "";
|
|
|
|
|
|
|
|
|
|
|
|
if ($default{'bugidtype'} eq "exclude") {
|
|
|
|
$inclselected = "";
|
|
|
|
$exclselected = "SELECTED";
|
|
|
|
}
|
|
|
|
my $bug_id = value_quote($default{'bug_id'});
|
|
|
|
|
|
|
|
print qq{
|
|
|
|
<TR>
|
|
|
|
<TD COLSPAN="3">
|
|
|
|
<SELECT NAME="bugidtype">
|
|
|
|
<OPTION VALUE="include" $inclselected>Only
|
|
|
|
<OPTION VALUE="exclude" $exclselected>Exclude
|
|
|
|
</SELECT>
|
|
|
|
bugs numbered:
|
|
|
|
<INPUT TYPE="text" NAME="bug_id" VALUE="$bug_id" SIZE=30>
|
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
};
|
|
|
|
|
|
|
|
print "
|
1999-10-08 14:41:17 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
1999-03-23 22:32:21 +00:00
|
|
|
Changed in the <NOBR>last <INPUT NAME=changedin SIZE=2 VALUE=\"$default{'changedin'}\"> days.</NOBR>
|
1999-10-08 14:41:17 +00:00
|
|
|
</td>
|
|
|
|
<td align=right>
|
|
|
|
At <NOBR>least <INPUT NAME=votes SIZE=3 VALUE=\"$default{'votes'}\"> votes.</NOBR>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
|
1999-03-23 22:32:21 +00:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td rowspan=2 align=right>Where the field(s)
|
|
|
|
</td><td rowspan=2>
|
|
|
|
<SELECT NAME=\"chfield\" MULTIPLE SIZE=4>
|
1999-05-05 21:18:39 +00:00
|
|
|
@{[make_options(\@logfields, $default{'chfield'}, $type{'chfield'})]}
|
1999-03-23 22:32:21 +00:00
|
|
|
</SELECT>
|
|
|
|
</td><td rowspan=2>
|
|
|
|
changed.
|
|
|
|
</td><td>
|
|
|
|
<nobr>dates <INPUT NAME=chfieldfrom SIZE=10 VALUE=\"$default{'chfieldfrom'}\"></nobr>
|
|
|
|
<nobr>to <INPUT NAME=chfieldto SIZE=10 VALUE=\"$default{'chfieldto'}\"></nobr>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>changed to value <nobr><INPUT NAME=chfieldvalue SIZE=10> (optional)</nobr>
|
|
|
|
</td>
|
|
|
|
</table>
|
1998-08-26 06:14:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<tr>
|
1999-01-27 21:17:10 +00:00
|
|
|
<TH ALIGN=LEFT VALIGN=BOTTOM>Program:</th>
|
|
|
|
<TH ALIGN=LEFT VALIGN=BOTTOM>Version:</th>
|
1999-06-15 04:25:29 +00:00
|
|
|
<TH ALIGN=LEFT VALIGN=BOTTOM><A HREF=describecomponents.cgi>Component:</a></th>
|
1999-01-27 21:17:10 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
if (Param("usetargetmilestone")) {
|
|
|
|
print "<TH ALIGN=LEFT VALIGN=BOTTOM>Target Milestone:</th>";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
1999-03-19 21:40:14 +00:00
|
|
|
<SELECT NAME=\"product\" MULTIPLE SIZE=5 onChange=\"selectProduct(this.form);\">
|
2000-07-18 15:28:19 +00:00
|
|
|
@{[make_options(\@::product_list, $default{'product'}, $type{'product'})]}
|
1998-11-20 19:18:37 +00:00
|
|
|
</SELECT>
|
1998-08-26 06:14:20 +00:00
|
|
|
</td>
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
|
|
|
<SELECT NAME=\"version\" MULTIPLE SIZE=5>
|
2000-11-20 19:42:36 +00:00
|
|
|
@{[make_options(\@::version_list, $default{'version'}, $type{'version'})]}
|
1998-11-20 19:18:37 +00:00
|
|
|
</SELECT>
|
1998-08-26 06:14:20 +00:00
|
|
|
</td>
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
<td align=left valign=top>
|
|
|
|
<SELECT NAME=\"component\" MULTIPLE SIZE=5>
|
2000-11-20 19:42:36 +00:00
|
|
|
@{[make_options(\@::component_list, $default{'component'}, $type{'component'})]}
|
1998-11-20 19:18:37 +00:00
|
|
|
</SELECT>
|
1999-01-27 21:17:10 +00:00
|
|
|
</td>";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1999-01-27 21:17:10 +00:00
|
|
|
if (Param("usetargetmilestone")) {
|
|
|
|
print "
|
|
|
|
<td align=left valign=top>
|
|
|
|
<SELECT NAME=\"target_milestone\" MULTIPLE SIZE=5>
|
2000-11-20 19:42:36 +00:00
|
|
|
@{[make_options(\@::milestone_list, $default{'target_milestone'}, $type{'target_milestone'})]}
|
1999-01-27 21:17:10 +00:00
|
|
|
</SELECT>
|
|
|
|
</td>";
|
|
|
|
}
|
|
|
|
|
1999-05-24 21:16:18 +00:00
|
|
|
|
|
|
|
sub StringSearch {
|
|
|
|
my ($desc, $name) = (@_);
|
|
|
|
my $type = $name . "_type";
|
|
|
|
my $def = value_quote($default{$name});
|
|
|
|
print qq{<tr>
|
|
|
|
<td align=right>$desc:</td>
|
|
|
|
<td><input name=$name size=30 value="$def"></td>
|
|
|
|
<td><SELECT NAME=$type>
|
|
|
|
};
|
|
|
|
if ($default{$type} eq "") {
|
|
|
|
$default{$type} = "substring";
|
|
|
|
}
|
|
|
|
foreach my $i (["substring", "case-insensitive substring"],
|
|
|
|
["casesubstring", "case-sensitive substring"],
|
2000-01-22 17:50:00 +00:00
|
|
|
["allwords", "all words"],
|
|
|
|
["anywords", "any words"],
|
1999-05-24 21:16:18 +00:00
|
|
|
["regexp", "regular expression"],
|
|
|
|
["notregexp", "not ( regular expression )"]) {
|
|
|
|
my ($n, $d) = (@$i);
|
|
|
|
my $sel = "";
|
|
|
|
if ($default{$type} eq $n) {
|
|
|
|
$sel = " SELECTED";
|
|
|
|
}
|
|
|
|
print qq{<OPTION VALUE="$n"$sel>$d\n};
|
|
|
|
}
|
|
|
|
print "</SELECT></TD>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
1999-01-27 21:17:10 +00:00
|
|
|
print "
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
<table border=0>
|
1999-05-24 21:16:18 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
StringSearch("Summary", "short_desc");
|
2000-01-22 19:43:30 +00:00
|
|
|
StringSearch("A description entry", "long_desc");
|
1999-05-24 21:16:18 +00:00
|
|
|
StringSearch("URL", "bug_file_loc");
|
1999-01-27 21:17:10 +00:00
|
|
|
|
|
|
|
if (Param("usestatuswhiteboard")) {
|
1999-05-24 21:16:18 +00:00
|
|
|
StringSearch("Status whiteboard", "status_whiteboard");
|
1999-01-27 21:17:10 +00:00
|
|
|
}
|
|
|
|
|
2000-01-06 21:16:15 +00:00
|
|
|
if (@::legal_keywords) {
|
|
|
|
my $def = value_quote($default{'keywords'});
|
|
|
|
print qq{
|
|
|
|
<TR>
|
|
|
|
<TD ALIGN="right"><A HREF="describekeywords.cgi">Keywords</A>:</TD>
|
2000-01-26 21:48:36 +00:00
|
|
|
<TD><INPUT NAME="keywords" SIZE=30 VALUE="$def"></TD>
|
|
|
|
<TD>
|
2000-01-06 21:16:15 +00:00
|
|
|
};
|
2000-01-26 21:48:36 +00:00
|
|
|
my $type = $default{"keywords_type"};
|
|
|
|
if ($type eq "or") { # Backward compatability hack.
|
|
|
|
$type = "anywords";
|
2000-01-06 21:16:15 +00:00
|
|
|
}
|
2000-01-26 21:48:36 +00:00
|
|
|
print BuildPulldown("keywords_type",
|
|
|
|
[["anywords", "Any of the listed keywords set"],
|
|
|
|
["allwords", "All of the listed keywords set"],
|
|
|
|
["nowords", "None of the listed keywords set"]],
|
|
|
|
$type);
|
|
|
|
print qq{</TD></TR>};
|
2000-01-06 21:16:15 +00:00
|
|
|
}
|
|
|
|
|
1999-01-27 21:17:10 +00:00
|
|
|
print "
|
1998-08-27 17:22:23 +00:00
|
|
|
</table>
|
1998-08-26 06:14:20 +00:00
|
|
|
<p>
|
2000-01-23 20:31:50 +00:00
|
|
|
";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-28 01:01:40 +00:00
|
|
|
|
|
|
|
my @fields;
|
|
|
|
push(@fields, ["noop", "---"]);
|
2000-01-28 07:15:44 +00:00
|
|
|
ConnectToDatabase();
|
2000-01-28 01:01:40 +00:00
|
|
|
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"],
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2000-01-31 18:19:44 +00:00
|
|
|
print qq{<A NAME="chart"> </A>\n};
|
|
|
|
|
2000-01-28 01:01:40 +00:00
|
|
|
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";
|
|
|
|
}
|
|
|
|
|
2000-01-31 18:19:44 +00:00
|
|
|
my $jsmagic = qq{ONCLICK="document.forms[0].action='query.cgi#chart' ; document.forms[0].method='POST' ; return 1;"};
|
2000-01-28 01:01:40 +00:00
|
|
|
|
|
|
|
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) .
|
2000-01-31 18:19:44 +00:00
|
|
|
qq{<TD><INPUT TYPE="submit" VALUE="Or" NAME="cmd-add$chart-$row-$col" $jsmagic></TD></TR>});
|
2000-01-28 01:01:40 +00:00
|
|
|
}
|
|
|
|
print qq{
|
|
|
|
<HR>
|
|
|
|
<TABLE>
|
|
|
|
};
|
|
|
|
print join('<TR><TD>And</TD></TR>', @rows);
|
|
|
|
print qq{
|
2000-01-31 18:19:44 +00:00
|
|
|
<TR><TD><INPUT TYPE="submit" VALUE="And" NAME="cmd-add$chart-$row-0" $jsmagic>
|
2000-01-28 01:01:40 +00:00
|
|
|
};
|
|
|
|
my $n = $chart + 1;
|
|
|
|
if (!exists $::FORM{"field$n-0-0"}) {
|
|
|
|
print qq{
|
|
|
|
|
2000-01-31 18:19:44 +00:00
|
|
|
<INPUT TYPE="submit" VALUE="Add another boolean chart" NAME="cmd-add$n-0-0" $jsmagic>
|
2000-01-28 01:01:40 +00:00
|
|
|
|
2001-03-07 05:02:46 +00:00
|
|
|
<NOBR><A HREF="queryhelp.cgi#advancedquerying">What is this stuff?</A></NOBR>
|
2000-01-28 01:01:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
print qq{
|
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
</TABLE>
|
|
|
|
};
|
|
|
|
}
|
|
|
|
print qq{<HR>};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
if (!$userid) {
|
|
|
|
print qq{<INPUT TYPE="hidden" NAME="cmdtype" VALUE="doit">};
|
|
|
|
} else {
|
|
|
|
print "
|
1998-08-26 06:14:20 +00:00
|
|
|
<BR>
|
1998-11-20 19:18:37 +00:00
|
|
|
<INPUT TYPE=radio NAME=cmdtype VALUE=doit CHECKED> Run this query
|
1998-09-15 21:49:26 +00:00
|
|
|
<BR>
|
|
|
|
";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-23 20:31:50 +00:00
|
|
|
my @namedqueries;
|
|
|
|
if ($userid) {
|
|
|
|
SendSQL("SELECT name FROM namedqueries " .
|
|
|
|
"WHERE userid = $userid AND name != '$::defaultqueryname' " .
|
|
|
|
"ORDER BY name");
|
|
|
|
while (MoreSQLData()) {
|
|
|
|
push(@namedqueries, FetchOneColumn());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (@namedqueries) {
|
|
|
|
my $namelist = make_options(\@namedqueries);
|
|
|
|
print qq{
|
1998-11-20 19:18:37 +00:00
|
|
|
<table cellspacing=0 cellpadding=0><tr>
|
|
|
|
<td><INPUT TYPE=radio NAME=cmdtype VALUE=editnamed> Load the remembered query:</td>
|
|
|
|
<td rowspan=3><select name=namedcmd>$namelist</select>
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr><tr>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td><INPUT TYPE=radio NAME=cmdtype VALUE=runnamed> Run the remembered query:</td>
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr><tr>
|
1998-11-20 19:18:37 +00:00
|
|
|
<td><INPUT TYPE=radio NAME=cmdtype VALUE=forgetnamed> Forget the remembered query:</td>
|
2000-01-23 20:31:50 +00:00
|
|
|
</tr></table>};
|
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2001-02-16 01:22:39 +00:00
|
|
|
print qq{
|
1998-11-20 19:18:37 +00:00
|
|
|
<INPUT TYPE=radio NAME=cmdtype VALUE=asdefault> Remember this as the default query
|
1998-08-26 06:14:20 +00:00
|
|
|
<BR>
|
1998-11-20 19:18:37 +00:00
|
|
|
<INPUT TYPE=radio NAME=cmdtype VALUE=asnamed> Remember this query, and name it:
|
|
|
|
<INPUT TYPE=text NAME=newqueryname>
|
2001-02-16 01:22:39 +00:00
|
|
|
<br> <INPUT TYPE="checkbox" NAME="tofooter" VALUE="1">
|
|
|
|
and put it in my page footer.
|
1998-08-26 06:14:20 +00:00
|
|
|
<BR>
|
2001-02-16 01:22:39 +00:00
|
|
|
};
|
2000-01-23 20:31:50 +00:00
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2001-02-16 01:22:39 +00:00
|
|
|
print qq{
|
1998-08-26 06:14:20 +00:00
|
|
|
<NOBR><B>Sort By:</B>
|
|
|
|
<SELECT NAME=\"order\">
|
2001-02-16 01:22:39 +00:00
|
|
|
};
|
2000-01-22 19:08:57 +00:00
|
|
|
|
|
|
|
my $deforder = "'Importance'";
|
|
|
|
my @orders = ('Bug Number', $deforder, 'Assignee');
|
|
|
|
|
|
|
|
if ($::COOKIE{'LASTORDER'}) {
|
|
|
|
$deforder = "Reuse same sort as last time";
|
|
|
|
unshift(@orders, $deforder);
|
|
|
|
}
|
2000-01-23 17:14:09 +00:00
|
|
|
|
2000-09-13 22:04:30 +00:00
|
|
|
if ($::FORM{'order'}) { $deforder = $::FORM{'order'} }
|
|
|
|
|
2000-01-23 17:14:09 +00:00
|
|
|
my $defquerytype = $userdefaultquery ? "my" : "the";
|
|
|
|
|
2000-01-22 19:08:57 +00:00
|
|
|
print make_options(\@orders, $deforder);
|
|
|
|
print "</SELECT></NOBR>
|
1998-12-03 16:31:10 +00:00
|
|
|
<INPUT TYPE=\"submit\" VALUE=\"Submit query\">
|
2000-01-23 17:14:09 +00:00
|
|
|
<INPUT TYPE=\"reset\" VALUE=\"Reset back to $defquerytype default query\">
|
|
|
|
";
|
|
|
|
|
|
|
|
if ($userdefaultquery) {
|
|
|
|
print qq{<BR><A HREF="query.cgi?nukedefaultquery=1">Set my default query back to the system default</A>};
|
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-23 17:14:09 +00:00
|
|
|
print "
|
|
|
|
</FORM>
|
1998-09-15 21:49:26 +00:00
|
|
|
";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2001-03-07 05:02:46 +00:00
|
|
|
###
|
|
|
|
### I really hate this redudancy, but if somebody for some inexplicable reason doesn't like using
|
|
|
|
### the footer for these links, they can uncomment this section.
|
|
|
|
###
|
|
|
|
|
|
|
|
# if (UserInGroup("tweakparams")) {
|
|
|
|
# print "<a href=editparams.cgi>Edit Bugzilla operating parameters</a><br>\n";
|
|
|
|
# }
|
|
|
|
# if (UserInGroup("editcomponents")) {
|
|
|
|
# print "<a href=editproducts.cgi>Edit Bugzilla products and components</a><br>\n";
|
|
|
|
# }
|
|
|
|
# if (UserInGroup("editkeywords")) {
|
|
|
|
# print "<a href=editkeywords.cgi>Edit Bugzilla keywords</a><br>\n";
|
|
|
|
# }
|
|
|
|
# if ($userid) {
|
|
|
|
# print "<a href=relogin.cgi>Log in as someone besides <b>$::COOKIE{'Bugzilla_login'}</b></a><br>\n";
|
|
|
|
# }
|
|
|
|
# print "<a href=userprefs.cgi>Change your password or preferences.</a><br>\n";
|
|
|
|
# print "<a href=\"enter_bug.cgi\">Report a new bug.</a><br>\n";
|
|
|
|
# print "<a href=\"createaccount.cgi\">Open a new Bugzilla account</a><br>\n";
|
|
|
|
# print "<a href=\"reports.cgi\">Bug reports</a><br>\n";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
2000-01-14 22:35:49 +00:00
|
|
|
|
|
|
|
PutFooter();
|