Commit a063aa36 authored by gerv%gerv.net's avatar gerv%gerv.net

show_bug.cgi templatisation.

parent 99f91c79
...@@ -20,17 +20,17 @@ ...@@ -20,17 +20,17 @@
# Contributor(s): Terry Weissman <terry@mozilla.org> # Contributor(s): Terry Weissman <terry@mozilla.org>
# Dave Miller <justdave@syndicomm.com> # Dave Miller <justdave@syndicomm.com>
# Joe Robins <jmrobins@tgix.com> # Joe Robins <jmrobins@tgix.com>
# Gervase Markham <gerv@gerv.net>
##############################################################################
########################################################################
# #
# enter_bug.cgi # enter_bug.cgi
# ------------- # -------------
# Displays bug entry form. Bug fields are specified through popup menus, # Displays bug entry form. Bug fields are specified through popup menus,
# drop-down lists, or text fields. Default for these values can be passed # drop-down lists, or text fields. Default for these values can be
# in as parameters to the cgi. # passed in as parameters to the cgi.
# #
######################################################################## ##############################################################################
use diagnostics; use diagnostics;
use strict; use strict;
...@@ -39,105 +39,81 @@ use lib qw(.); ...@@ -39,105 +39,81 @@ use lib qw(.);
require "CGI.pl"; require "CGI.pl";
# Shut up misguided -w warnings about "used only once". "use vars" just use vars qw(
# doesn't work for me. $unconfirmedstate
$template
sub sillyness { $vars
my $zz; %COOKIE
$zz = $::unconfirmedstate; @legal_opsys
$zz = @::legal_opsys; @legal_platform
$zz = @::legal_platform; @legal_priority
$zz = @::legal_priority; @legal_severity
$zz = @::legal_severity; %MFORM
} );
# I've moved the call to confirm_login up to here, since if we're using bug # Use template variables
# groups to restrict bug entry, we need to know who the user is right from my $template = $::template;
# the start. If that parameter is turned off, there's still no harm done in my $vars = $::vars;
# doing it now instead of a bit later. -JMR, 2/18/00
# Except that it will cause people without cookies enabled to have to log # If we're using bug groups to restrict bug entry, we need to know who the
# in an extra time. Only do it here if we really need to. -terry, 3/10/00 # user is right from the start.
if (Param("usebuggroupsentry")) { confirm_login() if (Param("usebuggroupsentry"));
confirm_login();
}
if (!defined $::FORM{'product'}) { if (!defined $::FORM{'product'}) {
GetVersionTable(); GetVersionTable();
my @prodlist;
foreach my $p (sort(keys %::versions)) { foreach my $p (sort(keys(%::versions))) {
if (defined $::proddesc{$p} && $::proddesc{$p} eq '0') { # Special hack: "0" in proddesc means disallownew was set.
# Special hack. If we stuffed a "0" into proddesc, that means # Also, if we're using bug groups to restrict entry on products,
# that disallownew was set for this bug, and so we don't want # and this product has a bug group, and the user is not in that
# to allow people to specify that product here.
next;
}
if(Param("usebuggroupsentry")
&& 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. # group, we don't want to include that product in this list.
next; if ((defined $::proddesc{$p} && $::proddesc{$p} eq '0')
|| (Param("usebuggroupsentry")
&& GroupExists($p)
&& !UserInGroup($p)))
{
delete $::proddesc{$p};
} }
push(@prodlist, $p);
} }
if (0 == @prodlist) {
print "Content-type: text/html\n\n";
PutHeader("No Products Available");
print "Either no products have been defined to enter bugs against ";
print "or you have not been given access to any. Please email ";
print "<A HREF=\"mailto:" . Param("maintainer") . "\">";
print Param("maintainer") . "</A> if you feel this is in error.<P>\n";
PutFooter(); my $prodsize = scalar(keys %::proddesc);
if ($prodsize == 0) {
DisplayError("Either no products have been defined to enter bugs ".
"against or you have not been given access to any.\n");
exit; exit;
} elsif (1 < @prodlist) {
print "Content-type: text/html\n\n";
PutHeader("Enter Bug");
print "<H2>First, you must pick a product on which to enter\n";
print "a bug.</H2>\n";
print "<table>";
foreach my $p (@prodlist) {
# removed $::proddesc{$p} eq '0' check and UserInGroup($p) check from here
# because it's redundant. See the foreach loop above that created @prodlist.
# 1/13/01 - dave@intrec.com
print "<tr><th align=right valign=top><a href=\"enter_bug.cgi?product=" . url_quote($p) . "\">$p</a>:</th>\n";
if (defined $::proddesc{$p}) {
print "<td valign=top>$::proddesc{$p}</td>\n";
} }
print "</tr>"; elsif ($prodsize > 1) {
} $vars->{'proddesc'} = \%::proddesc;
print "</table>\n";
PutFooter(); $vars->{'target'} = "enter_bug.cgi";
$vars->{'title'} = "Enter Bug";
$vars->{'h2'} =
"First, you must pick a product on which to enter a bug.";
print "Content-type: text/html\n\n";
$template->process("global/choose_product.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error());
exit; exit;
} }
$::FORM{'product'} = $prodlist[0];
}
my $product = $::FORM{'product'}; $::FORM{'product'} = (keys %::proddesc)[0];
$::MFORM{'product'} = [$::FORM{'product'}];
confirm_login(); }
print "Content-type: text/html\n\n"; my $product = $::FORM{'product'};
##############################################################################
# Useful Subroutines
##############################################################################
sub formvalue { sub formvalue {
my ($name, $default) = (@_); my ($name, $default) = (@_);
if (exists $::FORM{$name}) { return $::FORM{$name} || $default || "";
return $::FORM{$name};
}
if (defined $default) {
return $default;
}
return "";
} }
sub pickplatform { sub pickplatform {
my $value = formvalue("rep_platform"); return formvalue("rep_platform") if formvalue("rep_platform");
if ($value ne "") {
return $value;
}
if ( Param('usebrowserinfo') ) { if ( Param('usebrowserinfo') ) {
for ($ENV{'HTTP_USER_AGENT'}) { for ($ENV{'HTTP_USER_AGENT'}) {
#PowerPC #PowerPC
...@@ -181,42 +157,6 @@ sub pickplatform { ...@@ -181,42 +157,6 @@ sub pickplatform {
return "Other"; return "Other";
} }
sub pickversion {
my $version = formvalue('version');
if ( Param('usebrowserinfo') ) {
if ($version eq "") {
if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) {
$version = $1;
}
}
}
if (lsearch($::versions{$product}, $version) >= 0) {
return $version;
} else {
if (defined $::COOKIE{"VERSION-$product"}) {
if (lsearch($::versions{$product},
$::COOKIE{"VERSION-$product"}) >= 0) {
return $::COOKIE{"VERSION-$product"};
}
}
}
return $::versions{$product}->[0];
}
sub pickcomponent {
my $result =formvalue('component');
if ($result ne "" && lsearch($::components{$product}, $result) < 0) {
$result = "";
}
return $result;
}
sub pickos { sub pickos {
if (formvalue('op_sys') ne "") { if (formvalue('op_sys') ne "") {
return formvalue('op_sys'); return formvalue('op_sys');
...@@ -253,18 +193,18 @@ sub pickos { ...@@ -253,18 +193,18 @@ sub pickos {
/\(.*Mac OS 9.*\)/ && do {return "Mac System 9.x";}; /\(.*Mac OS 9.*\)/ && do {return "Mac System 9.x";};
/\(.*Mac OS 8\.6.*\)/ && do {return "Mac System 8.6";}; /\(.*Mac OS 8\.6.*\)/ && do {return "Mac System 8.6";};
/\(.*Mac OS 8\.5.*\)/ && do {return "Mac System 8.5";}; /\(.*Mac OS 8\.5.*\)/ && do {return "Mac System 8.5";};
#we don't know 8.1 # Bugzilla doesn't have an entry for 8.1
/\(.*Mac OS 8\.1.*\)/ && do {return "Mac System 8.0";}; /\(.*Mac OS 8\.1.*\)/ && do {return "Mac System 8.0";};
/\(.*Mac OS 8\.0.*\)/ && do {return "Mac System 8.0";}; /\(.*Mac OS 8\.0.*\)/ && do {return "Mac System 8.0";};
/\(.*Mac OS 8[^.].*\)/ && do {return "Mac System 8.0";}; /\(.*Mac OS 8[^.].*\)/ && do {return "Mac System 8.0";};
/\(.*Mac OS 8.*\)/ && do {return "Mac System 8.6";}; /\(.*Mac OS 8.*\)/ && do {return "Mac System 8.6";};
/\(.*Mac OS X.*\)/ && do {return "MacOS X";}; /\(.*Mac OS X.*\)/ && do {return "MacOS X";};
/\(.*Darwin.*\)/ && do {return "MacOS X";}; /\(.*Darwin.*\)/ && do {return "MacOS X";};
#silly # Silly
/\(.*Mac.*PowerPC.*\)/ && do {return "Mac System 9.x";}; /\(.*Mac.*PowerPC.*\)/ && do {return "Mac System 9.x";};
/\(.*Mac.*PPC.*\)/ && do {return "Mac System 9.x";}; /\(.*Mac.*PPC.*\)/ && do {return "Mac System 9.x";};
/\(.*Mac.*68k.*\)/ && do {return "Mac System 8.0";}; /\(.*Mac.*68k.*\)/ && do {return "Mac System 8.0";};
#evil # Evil
/Amiga/i && do {return "other";}; /Amiga/i && do {return "other";};
/\(.*PowerPC.*\)/ && do {return "Mac System 9.x";}; /\(.*PowerPC.*\)/ && do {return "Mac System 9.x";};
/\(.*PPC.*\)/ && do {return "Mac System 9.x";}; /\(.*PPC.*\)/ && do {return "Mac System 9.x";};
...@@ -274,271 +214,152 @@ sub pickos { ...@@ -274,271 +214,152 @@ sub pickos {
# default # default
return "other"; return "other";
} }
##############################################################################
# End of subroutines
##############################################################################
confirm_login() if (!(Param("usebuggroupsentry")));
GetVersionTable(); # If the usebuggroupsentry parameter is set, we need to check and make sure
# that the user has permission to enter a bug against this product.
my $assign_element = GeneratePersonInput('assigned_to', 1, if(Param("usebuggroupsentry")
formvalue('assigned_to')); && GroupExists($product)
my $cc_element = GeneratePeopleInput('cc', formvalue('cc')); && !UserInGroup($product))
{
DisplayError("Sorry; you do not have the permissions necessary to " .
"enter a bug against this product.\n");
exit;
}
my $priority = Param('defaultpriority'); GetVersionTable();
my $priority_popup = make_popup('priority', \@::legal_priority, if (!defined($::proddesc{$product}) || $::proddesc{$product} eq "0") {
formvalue('priority', $priority), 0); DisplayError("'" . html_quote($product) . "' is not a valid product.");
my $sev_popup = make_popup('bug_severity', \@::legal_severity, exit;
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);
if (0 == @{$::components{$product}}) { if (0 == @{$::components{$product}}) {
print "<H1>Permission Denied</H1>\n"; my $error = "Sorry; there needs to be at least one component for this " .
print "Sorry. You need to have at least one component for this product\n"; "product in order to create a new bug. ";
print "in order to create a new bug. Go to the \"Components\" link to create\n"; if (UserInGroup('editcomponents')) {
print "a new component\n"; $error .= "<a href=\"editcomponents.cgi\">" .
print "<P>\n"; "Create a new component</a>\n";
PutFooter(); }
else {
$error .= "Please contact " . Param("maintainer") . ", detailing " .
"the product in which you tried to create a new bug.\n";
}
DisplayError($error);
exit; exit;
} elsif (1 == @{$::components{$product}}) { }
elsif (1 == @{$::components{$product}}) {
# Only one component; just pick it. # Only one component; just pick it.
$::FORM{'component'} = $::components{$product}->[0]; $::FORM{'component'} = $::components{$product}->[0];
} }
my $component_popup = make_popup('component', $::components{$product}, my %default;
formvalue('component'), 1);
PutHeader ("Enter Bug","Enter Bug","This page lets you enter a new bug into Bugzilla."); $vars->{'component_'} = $::components{$product};
$default{'component_'} = formvalue('component');
# Modified, -JMR, 2/24,00 $vars->{'assigned_to'} = formvalue('assigned_to');
# If the usebuggroupsentry parameter is set, we need to check and make sure $vars->{'cc'} = formvalue('cc');
# that the user has permission to enter a bug against this product. $vars->{'reporter'} = $::COOKIE{'Bugzilla_login'};
# Modified, -DDM, 3/11/00 $vars->{'user_agent'} = $ENV{'HTTP_USER_AGENT'};
# added GroupExists check so we don't choke on a groupless product $vars->{'product'} = $product;
if(Param("usebuggroupsentry") $vars->{'bug_file_loc'} = formvalue('bug_file_loc', "http://");
&& GroupExists($product) $vars->{'short_desc'} = formvalue('short_desc');
&& !UserInGroup($product)) { $vars->{'comment'} = formvalue('comment');
print "<H1>Permission denied.</H1>\n";
print "Sorry; you do not have the permissions necessary to enter\n";
print "a bug against this product.\n";
print "<P>\n";
PutFooter();
exit;
}
# Modified, -JMR, 2/18/00 $vars->{'priority'} = \@legal_priority;
# I'm putting in a select box in order to select whether to restrict this bug to $default{'priority'} = formvalue('priority', Param('defaultpriority'));
# the product's bug group or not, if the usebuggroups parameter is set, and if
# this product has a bug group. This box will default to selected, but can be
# turned off if this bug should be world-viewable for some reason.
#
# To do this, I need to (1) get the bit and description for the bug group from
# the database, (2) insert the select box in the giant print statements below,
# and (3) update post_bug.cgi to process the additional input field.
# Modified, -DDM, 3/11/00
# Only need the bit here, and not the description. Description is gotten
# when the select boxes for all the groups this user has access to are read
# in later on.
# First we get the bit and description for the group.
my $group_bit=0;
if(Param("usebuggroups") && GroupExists($product)) {
SendSQL("select bit from groups ".
"where name = ".SqlQuote($product)." ".
"and isbuggroup != 0");
($group_bit) = FetchSQLData();
}
print " $vars->{'bug_severity'} = \@legal_severity;
<FORM METHOD=POST ACTION=\"post_bug.cgi\"> $default{'bug_severity'} = formvalue('bug_severity', 'normal');
<INPUT TYPE=HIDDEN NAME=reporter VALUE=\"$::COOKIE{'Bugzilla_login'}\">
<INPUT TYPE=HIDDEN NAME=product VALUE=\"" . value_quote($product) . "\">
<TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0>";
if (Param("entryheaderhtml")){
print "
<TR>
<td></td>
<td colspan=3>" .
Param("entryheaderhtml") . "\n" .
" </td>
</TR>
<TR><td><br></td></TR>";
}
print " $vars->{'rep_platform'} = \@legal_platform;
<TR> $default{'rep_platform'} = pickplatform();
<td ALIGN=right valign=top><B>Reporter:</B></td>
<td valign=top>$::COOKIE{'Bugzilla_login'}</td> $vars->{'op_sys'} = \@legal_opsys;
<td ALIGN=right valign=top><B>Product:</B></td> $default{'op_sys'} = pickos();
<td valign=top>$product</td>
</TR> # Default version is the last one in the list (hopefully the latest one).
<TR> # Eventually maybe each product should have a "current version" parameter.
<td ALIGN=right valign=top><B>Version:</B></td> $vars->{'version'} = $::versions{$product} || [];
<td>" . Version_element(pickversion(), $product) . "</td> $default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
<td align=right valign=top><b><a href=\"describecomponents.cgi?product=" .
url_quote($product) . "\">Component:</a></b></td> # There must be at least one status in @status.
<td>$component_popup</td> my @status = "NEW";
</TR>
<tr><td>&nbsp<td> <td> <td> <td> <td> </tr>
<TR>
<td align=right><B><A HREF=\"bug_status.html#rep_platform\">Platform:</A></B></td>
<TD>$platform_popup</TD>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#op_sys\">OS:</A></B></TD>
<TD>$opsys_popup</TD>
<td align=right valign=top></td>
<td rowspan=3></td>
<td></td>
</TR>
<TR>";
if (Param('letsubmitterchoosepriority')) {
print "
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Resolution<br>Priority</A>:</B></TD>
<TD>$priority_popup</TD>";
} else {
print '<INPUT TYPE=HIDDEN NAME=priority VALUE="' .
value_quote($priority) . '">';
}
print "
<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>&nbsp<td> <td> <td> <td> <td> </tr>
";
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) { if (UserInGroup("editbugs") || UserInGroup("canconfirm")) {
SendSQL("SELECT votestoconfirm FROM products WHERE product = " . SendSQL("SELECT votestoconfirm FROM products WHERE product = " .
SqlQuote($product)); SqlQuote($product));
if (FetchOneColumn()) { push(@status, $unconfirmedstate) if (FetchOneColumn());
print qq{
<TR>
<TD ALIGN="right"><B><A HREF="bug_status.html#status">Initial state:</B></A></TD>
<TD COLSPAN="5">
};
print BuildPulldown("bug_status",
[[$::unconfirmedstate], ["NEW"]],
"NEW");
print "</TD></TR>";
}
} }
$vars->{'bug_status'} = \@status;
$default{'bug_status'} = $status[0];
print " # Select whether to restrict this bug to the product's bug group or not,
<tr> # if the usebuggroups parameter is set, and if this product has a bug group.
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned To:</A></B></TD>
<TD colspan=5>$assign_element
(Leave blank to assign to default component owner)</td>
</tr>
<tr>
<TD ALIGN=RIGHT><B>Cc:</B></TD>
<TD colspan=5>$cc_element</TD>
</tr>
<tr><td>&nbsp<td> <td> <td> <td> <td> </tr>
<TR>
<TD ALIGN=RIGHT><B>URL:</B>
<TD COLSPAN=5>
<INPUT NAME=bug_file_loc SIZE=60 value=\"" .
((formvalue('bug_file_loc') !~ /:/o) ? 'http://' : '') .
value_quote(formvalue('bug_file_loc')) .
"\"></TD>
</TR>
<TR>
<TD ALIGN=RIGHT><B>Summary:</B>
<TD COLSPAN=5>
<INPUT NAME=short_desc SIZE=60 value=\"" .
value_quote(formvalue('short_desc')) .
"\"></TD>
</TR>
<tr><td align=right valign=top><B>Description:</b></td>
<!-- </tr> <tr> -->
<td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" .
value_quote(formvalue('comment')) .
"</TEXTAREA><BR></td>
</tr>";
print "
<tr>
<td></td><td colspan=5>
";
if ($::usergroupset ne '0') { if ($::usergroupset ne '0') {
# First we get the bit and description for the group.
my $group_bit = '0';
if(Param("usebuggroups") && GroupExists($product)) {
SendSQL("SELECT bit FROM groups ".
"WHERE name = " . SqlQuote($product) . " " .
"AND isbuggroup != 0");
($group_bit) = FetchSQLData();
}
SendSQL("SELECT bit, name, description FROM groups " . SendSQL("SELECT bit, name, description FROM groups " .
"WHERE bit & $::usergroupset != 0 " . "WHERE bit & $::usergroupset != 0 " .
" AND isbuggroup != 0 AND isactive = 1 ORDER BY description"); "AND isbuggroup != 0 AND isactive = 1 ORDER BY description");
# We only print out a header bit for this section if there are any
# results. my @groups;
my $groupFound = 0;
while (MoreSQLData()) { while (MoreSQLData()) {
my ($bit, $prodname, $description) = (FetchSQLData()); my ($bit, $prodname, $description) = FetchSQLData();
# Don't want to include product groups other than this product. # Don't want to include product groups other than this product.
unless(($prodname eq $product) || (!defined($::proddesc{$prodname}))) { next unless($prodname eq $product ||
next; !defined($::proddesc{$prodname}));
}
if(!$groupFound) { my $check;
print "<br><b>Only users in the selected groups can view this bug:</b><br>\n";
print "<font size=\"-1\">(Leave all boxes unchecked to make this a public bug.)</font><br><br>\n";
$groupFound = 1;
}
# Rather than waste time with another Param check and another database
# access, $group_bit will only have a non-zero value if we're using
# bug groups and have one for this product, so I'll check on that
# instead here. -JMR, 2/18/00
# Moved this check to this location to fix conflict with existing
# select-box patch. Also, if $group_bit is 0, it won't match the
# current group, either, so I'll compare it to the current bit
# instead of checking for non-zero. -DDM, 3/11/00
# Modifying this to use checkboxes instead of a select list.
# -JMR, 5/11/01
# If this is the group for this product, make it checked. # If this is the group for this product, make it checked.
my $check = ($group_bit == $bit); if(formvalue("maketemplate") eq
# If this is a bookmarked template, then we only want to set the bit "Remember values as bookmarkable template")
# for those bits set in the template. {
if(formvalue("maketemplate","") eq "Remember values as bookmarkable template") { # If this is a bookmarked template, then we only want to set the
$check = formvalue("bit-$bit",0); # bit for those bits set in the template.
$check = formvalue("bit-$bit", 0);
} }
my $checked = $check ? " CHECKED" : ""; else {
# indent these a bit # $group_bit will only have a non-zero value if we're using
print "&nbsp;&nbsp;&nbsp;&nbsp;"; # bug groups and have one for this product.
print "<input type=checkbox name=\"bit-$bit\" value=1$checked>\n"; # If $group_bit is 0, it won't match the current group, so compare
print "$description<br>\n"; # it to the current bit instead of checking for non-zero.
$check = ($group_bit == $bit);
} }
}
print " my $group =
</td> {
</tr> 'bit' => $bit ,
<tr> 'checked' => $check ,
<td></td> 'description' => $description
<td colspan=5> };
<INPUT TYPE=\"submit\" VALUE=\" Commit \" ONCLICK=\"if (this.form.short_desc.value =='') { alert('Please enter a summary sentence for this bug.'); return false; }\">
&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=\"reset\" VALUE=\"Reset\">
&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=\"submit\" NAME=maketemplate VALUE=\"Remember values as bookmarkable template\">
</td>
</tr>";
if ( Param('usebrowserinfo') ) {
print "
<tr>
<td></td>
<td colspan=3>
<br>
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.
</td>
</tr>";
}
print "
</TABLE>
<INPUT TYPE=hidden name=form_name VALUE=enter_bug>
</FORM>\n";
PutFooter(); push @groups, $group;
}
print "</BODY></HTML>\n"; $vars->{'group'} = \@groups;
}
$vars->{'default'} = \%default;
print "Content-type: text/html\n\n";
$template->process("entry/enter_bug.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error());
exit;
[%# 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.
#
# 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): Gervase Markham <gerv@gerv.net>
#%]
[% INCLUDE global/header
title = "Enter Bug"
h2 = "This page lets you enter a new bug into Bugzilla."
%]
<form method="post" action="post_bug.cgi">
<input type="hidden" name="product" value="[% product FILTER html %]" />
<table cellspacing="2" cellpadding="0" border="0">
<tr>
<td><br /></td>
</tr>
<tr>
<td></td>
<td colspan="3">
Before filling this in, please read the
<a href="bugwritinghelp.html">bug-writing guidelines</a>.
</td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr>
<td align="right" valign="top"><strong>Reporter:</strong></td>
<td valign="top">[% reporter FILTER html %]</td>
<td align="right" valign="top"><strong>Product:</strong></td>
<td valign="top">[% product FILTER html %]</td>
</tr>
[%# We can't use the select block in these two cases for various reasons. %]
<tr>
<td align="right" valign="top">
<strong>Version:</strong>
</td>
<td>
<select name="version" size="5">
[%- FOREACH v = version %]
<option value="[% v FILTER html %]"
[% " selected" IF v == default.version %]>[% v FILTER html -%]
</option>
[%- END %]
</select>
</td>
<td align="right" valign="top">
<strong>
<a href="describecomponents.cgi?product=[% product FILTER uri %]">
Component:</a>
</strong>
</td>
<td>
<select name="component" size="5">
[%- FOREACH c = component_ %]
<option value="[% c FILTER html %]"
[% " selected" IF c == default.component_ %]>[% c FILTER html -%]
</option>
[%- END %]
</select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"></td>
</tr>
<tr>
[% sel = { description => 'Platform', name => 'rep_platform' } %]
[% INCLUDE select %]
[% sel = { description => 'OS', name => 'op_sys' } %]
[% INCLUDE select %]
</tr>
<tr>
[% IF Param('letsubmitterchoosepriority') %]
[% sel = { description => 'Priority', name => 'priority' } %]
[% INCLUDE select %]
[% ELSE %]
<input type="hidden" name="priority" value="[% default.priority %]" />
[% END %]
[% sel = { description => 'Severity', name => 'bug_severity' } %]
[% INCLUDE select %]
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"></td>
</tr>
[% IF bug_status.size > 1 %]
<tr>
[% sel = { description => 'Initial State', name => 'bug_status' } %]
[% INCLUDE select %]
<td colspan="2"></td>
</tr>
[% ELSE %]
<input type="hidden" name="bug_status" value="[% default.bug_status %]" />
[% END %]
<tr>
<td align="right">
<strong>
<a href="bug_status.html#assigned_to">Assigned To:</a>
</strong>
</td>
<td colspan="3">
<input name="assigned_to" size="32"
value="[% assigned_to FILTER html %]" />
(Leave blank to assign to default component owner)
</td>
</tr>
<tr>
<td align="right"><strong>Cc:</strong></td>
<td colspan="3">
<input name="cc" size="45" value="[% cc FILTER html %]" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"></td>
</tr>
<tr>
<td align="right"<strong>URL:</strong></td>
<td colspan="3">
<input name="bug_file_loc" size="60"
value="[% bug_file_loc FILTER html %]" />
</td>
</tr>
<tr>
<td align="right"><strong>Summary:</strong></td>
<td colspan="3">
<input name="short_desc" size="60" value="[% short_desc FILTER html %]" />
</td>
</tr>
<tr><td align="right" valign="top"><strong>Description:</strong></td>
<td colspan="3">
<textarea wrap="hard" name="comment" rows="10" cols="80">
[% comment FILTER html %]</textarea>
<br />
</td>
</tr>
<tr>
<td></td>
<td colspan="3">
[% IF group.size %]
<br />
<strong>
Only users in the selected groups can view this bug:
</strong>
<br />
<font size="-1">
(Leave all boxes unchecked to make this a public bug.)
</font>
<br />
<br />
<!-- Checkboxes -->
[% FOREACH g = group %]
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="bit-[% g.bit %]" value="1"
[% " checked" IF g.checked %] />[% g.description %]<br />
[% END %]
<br />
[% END %]
</td>
</tr>
<tr>
<td></td>
<td colspan="3">
<input type="submit" value=" Commit "
onclick="if (this.form.short_desc.value == '')
{ alert('Please enter a summary sentence for this bug.');
return false; }">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="maketemplate"
value="Remember values as bookmarkable template" />
</td>
</tr>
[% IF Param('usebrowserinfo') %]
<tr>
<td></td>
<td colspan="3">
<br />
We've made a guess at your operating system and platform.
Please check them and, if we got it wrong, email
[% Param('maintainer') %].
</td>
</tr>
[% END %]
</table>
<input type="hidden" name="form_name" value="enter_bug" />
</form>
[% INCLUDE global/footer %]
[%############################################################################%]
[%# Block for SELECT fields #%]
[%############################################################################%]
[% BLOCK select %]
[% IF sel.description %]
<td align="right">
<strong>
<a href="bug_status.html#[% sel.name %]">[% sel.description %]:</a>
</strong>
</td>
[% END %]
<td>
<select name="[% sel.name %]">
[%- FOREACH x = ${sel.name} %]
<option value="[% x FILTER html %]"
[% " selected" IF x == default.${sel.name} %]>[% x FILTER html -%]
</option>
[%- END %]
</select>
</td>
[% END %]
[%# 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.
#
# 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): Gervase Markham <gerv@gerv.net>
#%]
[% DEFAULT title = "Choose a Product" %]
[% INCLUDE global/header %]
<table>
[% FOREACH p = proddesc.keys.sort %]
<tr>
<th align="right" valign="top">
<a href="[% target %]?product=[% p FILTER uri %]">
[% p FILTER html %]</a>:
</th>
[% IF proddesc.$p %]
<td valign="top">&nbsp;[% proddesc.$p %]</td>
[% END %]
</tr>
[% END %]
</table>
[% INCLUDE global/footer %]
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