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
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License
|
|
|
|
# Version 1.0 (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.
|
|
|
|
#
|
|
|
|
# The Original Code is the Bugzilla Bug Tracking System.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
|
|
|
# Corporation. Portions created by Netscape are Copyright (C) 1998
|
|
|
|
# Netscape Communications Corporation. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
|
|
|
|
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-27 14:56:19 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
# Shut up misguided -w warnings about "used only once":
|
|
|
|
use vars @::legal_platform,
|
|
|
|
@::buffer,
|
|
|
|
@::legal_severity,
|
|
|
|
@::legal_opsys,
|
|
|
|
@::legal_priority;
|
|
|
|
|
|
|
|
|
|
|
|
if (!defined $::FORM{'product'}) {
|
|
|
|
GetVersionTable();
|
|
|
|
my @prodlist = keys %::versions;
|
|
|
|
if ($#prodlist != 0) {
|
|
|
|
print "Content-type: text/html\n\n";
|
|
|
|
PutHeader("Enter Bug");
|
1998-08-27 14:56:19 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
print "<H2>First, you must pick a product on which to enter\n";
|
|
|
|
print "a bug.</H2>\n";
|
1998-10-06 20:23:40 +00:00
|
|
|
print "<table>";
|
1998-09-15 21:49:26 +00:00
|
|
|
foreach my $p (sort (@prodlist)) {
|
1999-03-03 18:16:24 +00:00
|
|
|
if (defined $::proddesc{$p} && $::proddesc{$p} eq '0') {
|
|
|
|
# Special hack. If we stuffed a "0" into proddesc, that means
|
|
|
|
# that disallownew was set for this bug, and so we don't want
|
|
|
|
# to allow people to specify that product here.
|
|
|
|
next;
|
|
|
|
}
|
1998-11-20 19:18:37 +00:00
|
|
|
print "<tr><th align=right valign=top><a href=\"enter_bug.cgi?product=" . url_quote($p) . "\"&$::buffer>$p</a>:</th>\n";
|
1998-10-06 20:23:40 +00:00
|
|
|
if (defined $::proddesc{$p}) {
|
1998-11-20 19:18:37 +00:00
|
|
|
print "<td valign=top>$::proddesc{$p}</td>\n";
|
1998-10-06 20:23:40 +00:00
|
|
|
}
|
|
|
|
print "</tr>";
|
1998-08-27 14:56:19 +00:00
|
|
|
}
|
1998-10-06 20:23:40 +00:00
|
|
|
print "</table>\n";
|
1998-09-15 21:49:26 +00:00
|
|
|
exit;
|
1998-08-27 14:56:19 +00:00
|
|
|
}
|
1998-09-15 21:49:26 +00:00
|
|
|
$::FORM{'product'} = $prodlist[0];
|
1998-08-27 14:56:19 +00:00
|
|
|
}
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
my $product = $::FORM{'product'};
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
confirm_login();
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
print "Content-type: text/html\n\n";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
sub formvalue {
|
|
|
|
my ($name, $default) = (@_);
|
|
|
|
if (exists $::FORM{$name}) {
|
|
|
|
return $::FORM{$name};
|
|
|
|
}
|
|
|
|
if (defined $default) {
|
|
|
|
return $default;
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
sub pickplatform {
|
|
|
|
my $value = formvalue("rep_platform");
|
|
|
|
if ($value ne "") {
|
|
|
|
return $value;
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
1999-05-04 00:05:27 +00:00
|
|
|
if ( Param('usebrowserinfo') ) {
|
1999-05-05 22:06:49 +00:00
|
|
|
for ($ENV{'HTTP_USER_AGENT'}) {
|
|
|
|
/Mozilla.*\(Windows/ && do {return "PC";};
|
|
|
|
/Mozilla.*\(Macintosh/ && do {return "Macintosh";};
|
|
|
|
/Mozilla.*\(Win/ && do {return "PC";};
|
|
|
|
/Mozilla.*Linux.*86/ && do {return "PC";};
|
|
|
|
/Mozilla.*Linux.*alpha/ && do {return "DEC";};
|
|
|
|
/Mozilla.*OSF/ && do {return "DEC";};
|
|
|
|
/Mozilla.*HP-UX/ && do {return "HP";};
|
|
|
|
/Mozilla.*IRIX/ && do {return "SGI";};
|
|
|
|
/Mozilla.*(SunOS|Solaris)/ && do {return "Sun";};
|
1999-05-05 22:05:19 +00:00
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
1999-05-05 22:05:19 +00:00
|
|
|
# default
|
|
|
|
return "Other";
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
1998-08-27 14:56:19 +00:00
|
|
|
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
sub pickversion {
|
|
|
|
my $version = formvalue('version');
|
1999-05-04 00:05:27 +00:00
|
|
|
|
|
|
|
if ( Param('usebrowserinfo') ) {
|
1999-05-05 22:06:49 +00:00
|
|
|
if ($version eq "") {
|
|
|
|
if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) {
|
|
|
|
$version = $1;
|
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
if (lsearch($::versions{$product}, $version) >= 0) {
|
|
|
|
return $version;
|
1998-08-26 06:14:20 +00:00
|
|
|
} else {
|
1998-09-15 21:49:26 +00:00
|
|
|
if (defined $::COOKIE{"VERSION-$product"}) {
|
|
|
|
if (lsearch($::versions{$product},
|
|
|
|
$::COOKIE{"VERSION-$product"}) >= 0) {
|
|
|
|
return $::COOKIE{"VERSION-$product"};
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-09-15 21:49:26 +00:00
|
|
|
return $::versions{$product}->[0];
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
sub pickcomponent {
|
|
|
|
my $result =formvalue('component');
|
|
|
|
if ($result ne "" && lsearch($::components{$product}, $result) < 0) {
|
|
|
|
$result = "";
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
1998-09-15 21:49:26 +00:00
|
|
|
return $result;
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
sub pickos {
|
|
|
|
if (formvalue('op_sys') ne "") {
|
|
|
|
return formvalue('op_sys');
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
1999-05-04 00:05:27 +00:00
|
|
|
if ( Param('usebrowserinfo') ) {
|
1999-05-05 22:05:19 +00:00
|
|
|
for ($ENV{'HTTP_USER_AGENT'}) {
|
|
|
|
/Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";};
|
|
|
|
/Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";};
|
|
|
|
/Mozilla.*\(.*;.*; 16bit.*\)/ && do {return "Windows 3.1";};
|
|
|
|
/Mozilla.*\(.*;.*; 68K.*\)/ && do {return "Mac System 8.5";};
|
|
|
|
/Mozilla.*\(.*;.*; PPC.*\)/ && do {return "Mac System 8.5";};
|
|
|
|
/Mozilla.*\(.*;.*; OSF.*\)/ && do {return "OSF/1";};
|
|
|
|
/Mozilla.*\(.*;.*; Linux.*\)/ && do {return "Linux";};
|
|
|
|
/Mozilla.*\(.*;.*; SunOS 5.*\)/ && do {return "Solaris";};
|
|
|
|
/Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";};
|
|
|
|
/Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";};
|
|
|
|
/Mozilla.*\(.*;.*; BSD\/OS.*\)/ && do {return "BSDI";};
|
|
|
|
/Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";};
|
|
|
|
/Mozilla.*\(Win95.*\)/ && do {return "Windows 95";};
|
|
|
|
/Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";};
|
|
|
|
}
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
1999-05-05 22:05:19 +00:00
|
|
|
# default
|
|
|
|
return "other";
|
1998-08-26 06:14:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
GetVersionTable();
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
my $assign_element = GeneratePersonInput('assigned_to', 1,
|
|
|
|
formvalue('assigned_to'));
|
1998-11-20 19:18:37 +00:00
|
|
|
my $cc_element = GeneratePeopleInput('cc', formvalue('cc'));
|
1998-08-26 06:14:20 +00:00
|
|
|
|
|
|
|
|
1999-03-09 02:33:58 +00:00
|
|
|
my $priority = Param('defaultpriority');
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
my $priority_popup = make_popup('priority', \@::legal_priority,
|
1999-03-09 02:33:58 +00:00
|
|
|
formvalue('priority', $priority), 0);
|
1998-09-15 21:49:26 +00:00
|
|
|
my $sev_popup = make_popup('bug_severity', \@::legal_severity,
|
|
|
|
formvalue('bug_severity', 'normal'), 0);
|
|
|
|
my $platform_popup = make_popup('rep_platform', \@::legal_platform,
|
|
|
|
pickplatform(), 0);
|
|
|
|
my $opsys_popup = make_popup('op_sys', \@::legal_opsys, pickos(), 0);
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
my $component_popup = make_popup('component', $::components{$product},
|
|
|
|
formvalue('component'), 1);
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
PutHeader ("Enter Bug");
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
print "
|
1999-05-01 18:43:58 +00:00
|
|
|
<FORM METHOD=POST ACTION=\"post_bug.cgi\">
|
1998-08-26 06:14:20 +00:00
|
|
|
<INPUT TYPE=HIDDEN NAME=bug_status VALUE=NEW>
|
1999-05-01 18:43:58 +00:00
|
|
|
<INPUT TYPE=HIDDEN NAME=reporter VALUE=\"$::COOKIE{'Bugzilla_login'}\">
|
1999-02-25 18:01:02 +00:00
|
|
|
<INPUT TYPE=HIDDEN NAME=product VALUE=\"" . value_quote($product) . "\">
|
1998-08-26 06:14:20 +00:00
|
|
|
<TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0>
|
|
|
|
<TR>
|
1999-05-01 18:43:58 +00:00
|
|
|
<td ALIGN=right valign=top><B>Reporter:</B></td>
|
|
|
|
<td valign=top>$::COOKIE{'Bugzilla_login'}</td>
|
1998-08-26 06:14:20 +00:00
|
|
|
<td ALIGN=right valign=top><B>Product:</B></td>
|
1998-08-27 14:56:19 +00:00
|
|
|
<td valign=top>$product</td>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
1998-08-26 06:14:20 +00:00
|
|
|
<td ALIGN=right valign=top><B>Version:</B></td>
|
1998-09-15 21:49:26 +00:00
|
|
|
<td>" . Version_element(pickversion(), $product) . "</td>
|
1999-02-04 17:13:52 +00:00
|
|
|
<td align=right valign=top><b><a href=\"describecomponents.cgi?product=" .
|
1999-05-01 18:43:58 +00:00
|
|
|
url_quote($product) . "\">Component:</a></b></td>
|
1998-08-26 06:14:20 +00:00
|
|
|
<td>$component_popup</td>
|
|
|
|
</TR>
|
|
|
|
<tr><td> <td> <td> <td> <td> <td> </tr>
|
|
|
|
<TR>
|
1999-05-01 18:43:58 +00:00
|
|
|
<td align=right><B><A HREF=\"bug_status.html#rep_platform\">Platform:</A></B></td>
|
1998-08-26 06:14:20 +00:00
|
|
|
<TD>$platform_popup</TD>
|
1999-01-15 22:05:42 +00:00
|
|
|
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#op_sys\">OS:</A></B></TD>
|
1998-08-26 06:14:20 +00:00
|
|
|
<TD>$opsys_popup</TD>
|
|
|
|
<td align=right valign=top></td>
|
|
|
|
<td rowspan=3></td>
|
|
|
|
<td></td>
|
|
|
|
</TR>
|
1999-03-09 02:33:58 +00:00
|
|
|
<TR>";
|
|
|
|
if (Param('letsubmitterchoosepriority')) {
|
|
|
|
print "
|
1998-08-26 06:14:20 +00:00
|
|
|
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority</A>:</B></TD>
|
1999-03-09 02:33:58 +00:00
|
|
|
<TD>$priority_popup</TD>";
|
|
|
|
} else {
|
|
|
|
print '<INPUT TYPE=HIDDEN NAME=priority VALUE="' .
|
|
|
|
value_quote($priority) . '">';
|
|
|
|
}
|
|
|
|
print "
|
1998-08-26 06:14:20 +00:00
|
|
|
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#severity\">Severity</A>:</B></TD>
|
|
|
|
<TD>$sev_popup</TD>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
</TR>
|
|
|
|
<tr><td> <td> <td> <td> <td> <td> </tr>
|
|
|
|
<tr>
|
1999-05-01 18:43:58 +00:00
|
|
|
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned To:</A></B></TD>
|
1998-08-26 06:14:20 +00:00
|
|
|
<TD colspan=5>$assign_element
|
1999-05-04 00:05:27 +00:00
|
|
|
(Leave blank to assign to default component owner)</td>
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
1999-05-04 00:05:27 +00:00
|
|
|
<TD ALIGN=RIGHT><B>Cc:</B></TD>
|
1998-08-26 06:14:20 +00:00
|
|
|
<TD colspan=5>$cc_element</TD>
|
|
|
|
</tr>
|
|
|
|
<tr><td> <td> <td> <td> <td> <td> </tr>
|
|
|
|
<TR>
|
|
|
|
<TD ALIGN=RIGHT><B>URL:</B>
|
|
|
|
<TD COLSPAN=5>
|
1998-09-15 21:49:26 +00:00
|
|
|
<INPUT NAME=bug_file_loc SIZE=60 value=\"" .
|
|
|
|
value_quote(formvalue('bug_file_loc')) .
|
|
|
|
"\"></TD>
|
1998-08-26 06:14:20 +00:00
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD ALIGN=RIGHT><B>Summary:</B>
|
|
|
|
<TD COLSPAN=5>
|
1998-09-15 21:49:26 +00:00
|
|
|
<INPUT NAME=short_desc SIZE=60 value=\"" .
|
|
|
|
value_quote(formvalue('short_desc')) .
|
|
|
|
"\"></TD>
|
1998-08-26 06:14:20 +00:00
|
|
|
</TR>
|
1999-05-04 00:05:27 +00:00
|
|
|
<tr><td align=right valign=top><B>Description:</b></tr>
|
1998-08-26 06:14:20 +00:00
|
|
|
<tr>
|
1998-09-15 21:49:26 +00:00
|
|
|
<td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" .
|
|
|
|
value_quote(formvalue('comment')) .
|
|
|
|
"</TEXTAREA><BR></td>
|
1998-08-26 06:14:20 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td colspan=5>
|
|
|
|
<INPUT TYPE=\"submit\" VALUE=\" Commit \">
|
|
|
|
|
|
|
|
<INPUT TYPE=\"reset\" VALUE=\"Reset\">
|
|
|
|
|
|
|
|
<INPUT TYPE=\"submit\" NAME=maketemplate VALUE=\"Remember values as bookmarkable template\">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</TABLE>
|
|
|
|
<INPUT TYPE=hidden name=form_name VALUE=enter_bug>
|
1999-05-04 00:05:27 +00:00
|
|
|
</FORM>\n";
|
1998-08-26 06:14:20 +00:00
|
|
|
|
1999-05-04 00:05:27 +00:00
|
|
|
if ( Param('usebrowserinfo') ) {
|
1999-05-05 22:05:19 +00:00
|
|
|
print "Some fields initialized from your user-agent, <b>$ENV{'HTTP_USER_AGENT'}</b>.
|
|
|
|
If you think it got it wrong, please tell " . Param('maintainer') . " what it should have been.";
|
1999-05-04 00:05:27 +00:00
|
|
|
}
|
|
|
|
print "</BODY></HTML>\n";
|
1998-08-26 06:14:20 +00:00
|
|
|
|