print "A legal $fieldname was not set; ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
if ( !defined $formRef->{$fieldname} ) {
print "$fieldname was not defined; ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
if ( $number !~ /^[1-9][0-9]*$/ ) {
print "Received string \"$number\" when postive integer expected; ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
print " <A HREF=enter_bug.cgi>Enter new bug</A>\n"
}
+sub make_checkboxes {
+ my ($src,$default,$isregexp,$name) = (@_);
+ my $last = "";
+ my $capitalized = "";
+ my $popup = "";
+ my $found = 0;
+ $default = "" if !defined $default;
+
+ if ($src) {
+ foreach my $item (@$src) {
+ if ($item eq "-blank-" || $item ne $last) {
+ if ($item eq "-blank-") {
+ $item = "";
+ }
+ $last = $item;
+ $capitalized = $item;
+ $capitalized =~ tr/A-Z/a-z/;
+ $capitalized =~ s/^(.?)(.*)/\u$1$2/;
+ if ($isregexp ? $item =~ $default : $default eq $item) {
+ $popup .= "<INPUT NAME=$name TYPE=CHECKBOX VALUE=\"$item\" SELECTED>$capitalized<br>";
+ $found = 1;
+ } else {
+ $popup .= "<INPUT NAME=$name TYPE=CHECKBOX VALUE=\"$item\">$capitalized<br>";
+ }
+ }
+ }
+ }
+ if (!$found && $default ne "") {
+ $popup .= "<INPUT NAME=$name TYPE=CHECKBOX SELECTED>$default";
+ }
+ return $popup;
+}
+
+#
+# make_selection_widget: creates an HTML selection widget from a list of text strings.
+# $groupname is the name of the setting (form value) that this widget will control
+# $src is the list of options
+# you can specify a $default value which is either a string or a regex pattern to match to
+# identify the default value
+# $capitalize lets you optionally capitalize the option strings; the default is the value
+# of Param("capitalizelists")
+# $multiple is 1 if several options are selectable (default), 0 otherwise.
+# $size is used for lists to control how many items are shown. The default is 7. A list of
+# size 1 becomes a popup menu.
+# $preferLists is 1 if selection lists should be used in favor of radio buttons and
+# checkboxes, and 0 otherwise. The default is the value of Param("preferlists").
+#
+# The actual widget generated depends on the parameter settings:
+#
+# MULTIPLE PREFERLISTS SIZE RESULT
+# 0 (single) 0 =1 Popup Menu (normal for list of size 1)
+# 0 (single) 0 >1 Radio buttons
+# 0 (single) 1 =1 Popup Menu (normal for list of size 1)
+# 0 (single) 1 n>1 List of size n, single selection
+# 1 (multi) 0 n/a Check boxes; size ignored
+# 1 (multi) 1 n/a List of size n, multiple selection, of size n
+#
+sub make_selection_widget {
+ my ($groupname,$src,$default,$isregexp,$multiple, $size, $capitalize, $preferLists) = (@_);
+ my $last = "";
+ my $popup = "";
+ my $found = 0;
+ my $displaytext = "";
+ $groupname = "" if !defined $groupname;
+ $default = "" if !defined $default;
+ $capitalize = Param("capitalizelists") if !defined $capitalize;
+ $multiple = 1 if !defined $multiple;
+ $preferLists = Param("preferlists") if !defined $preferLists;
+ $size = 7 if !defined $size;
+ my $type = "LIST";
+ if (!$preferLists) {
+ if ($multiple) {
+ $type = "CHECKBOX";
+ } else {
+ if ($size > 1) {
+ $type = "RADIO";
+ }
+ }
+ }
+
+ if ($type eq "LIST") {
+ $popup .= "<SELECT NAME=\"$groupname\"";
+ if ($multiple) {
+ $popup .= " MULTIPLE";
+ }
+ $popup .= " SIZE=$size>\n";
+ }
+ if ($src) {
+ foreach my $item (@$src) {
+ if ($item eq "-blank-" || $item ne $last) {
+ if ($item eq "-blank-") {
+ $item = "";
+ }
+ $last = $item;
+ $displaytext = $item;
+ if ($capitalize) {
+ $displaytext =~ tr/A-Z/a-z/;
+ $displaytext =~ s/^(.?)(.*)/\u$1$2/;
+ }
+
+ if ($isregexp ? $item =~ $default : $default eq $item) {
+ if ($type eq "CHECKBOX") {
+ $popup .= "<INPUT NAME=$groupname type=checkbox VALUE=\"$item\" CHECKED>$displaytext<br>";
+ } elsif ($type eq "RADIO") {
+ $popup .= "<INPUT NAME=$groupname type=radio VALUE=\"$item\" check>$displaytext<br>";
+ } else {
+ $popup .= "<OPTION SELECTED VALUE=\"$item\">$displaytext";
+ }
+ $found = 1;
+ } else {
+ if ($type eq "CHECKBOX") {
+ $popup .= "<INPUT NAME=$groupname type=checkbox VALUE=\"$item\">$displaytext<br>";
+ } elsif ($type eq "RADIO") {
+ $popup .= "<INPUT NAME=$groupname type=radio VALUE=\"$item\">$displaytext<br>";
+ } else {
+ $popup .= "<OPTION VALUE=\"$item\">$displaytext";
+ }
+ }
+ }
+ }
+ }
+ if (!$found && $default ne "") {
+ if ($type eq "CHECKBOX") {
+ $popup .= "<INPUT NAME=$groupname type=checkbox CHECKED>$default";
+ } elsif ($type eq "RADIO") {
+ $popup .= "<INPUT NAME=$groupname type=radio checked>$default";
+ } else {
+ $popup .= "<OPTION SELECTED>$default";
+ }
+ }
+ if ($type eq "LIST") {
+ $popup .= "</SELECT>";
+ }
+ return $popup;
+}
+
$::CheckOptionValues = 1;
"Please send mail to " . Param("maintainer") . " with " .
"details of what you were doing when this message " .
"appeared. Thank you.\n";
+ PutFooter();
exit 0;
} else {
print "syntax checking for a legal email address.\n";
print Param('emailregexpdesc');
print "<p>Please click <b>back</b> and try again.\n";
+ PutFooter();
exit;
}
}
print "Content-type: text/html\n\n";
PutHeader("Password has been emailed");
MailPassword($enteredlogin, $realpwd);
+ PutFooter();
exit;
}
PutHeader("Login failed");
print "The username or password you entered is not valid.\n";
print "Please click <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
$::COOKIE{"Bugzilla_login"} = $enteredlogin;
SendSQL("delete from logincookies where to_days(now()) - to_days(lastused) > 30");
+ PutFooter();
exit;
}
print PerformSubsts(Param("bannerhtml"), undef);
- print "<TABLE BORDER=0 CELLPADDING=12 CELLSPACING=0 WIDTH=\"100%\">\n";
+ print "<TABLE BORDER=0 CELLSPACING=0 WIDTH=\"100%\">\n";
print " <TR>\n";
- print " <TD>\n";
+ print " <TD WIDTH=10% VALIGN=TOP ALIGN=LEFT>\n";
print " <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2>\n";
- print " <TR><TD VALIGN=TOP ALIGN=CENTER NOWRAP>\n";
- print " <FONT SIZE=\"+3\"><B><NOBR>$h1</NOBR></B></FONT>\n";
- print " </TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>\n";
- print " <B>$h2</B>\n";
+ print " <TR><TD VALIGN=TOP ALIGN=LEFT NOWRAP>\n";
+ print " <FONT SIZE=+1><B>$h1</B></FONT>";
print " </TD></TR>\n";
print " </TABLE>\n";
print " </TD>\n";
- print " <TD>\n";
+ print " <TD VALIGN=CENTER> </TD>\n";
+ print " <TD VALIGN=CENTER ALIGN=LEFT>\n";
- print Param("blurbhtml");
+ print "$h2\n";
+ print "</TD></TR></TABLE>\n";
print "</TD></TR></TABLE>\n";
if (Param("shutdownhtml")) {
if (!$ignoreshutdown) {
print Param("shutdownhtml");
+ PutFooter();
exit;
}
}
}
+sub PutFooter {
+ print PerformSubsts(Param("footerhtml"));
+}
+
+
sub DumpBugActivity {
my ($id, $starttime) = (@_);
my $datepart = "";
}
+sub GetCommandMenu {
+ my $loggedin = quietly_check_login();
+ my $html = qq{<FORM METHOD=GET ACTION="show_bug.cgi">};
+ $html .= "<a href='enter_bug.cgi'>New</a> | <a href='query.cgi'>Query</a>";
+ if (-e "query2.cgi") {
+ $html .= "[<a href='query2.cgi'>beta</a>]";
+ }
+
+ $html .= qq{| <INPUT TYPE=SUBMIT VALUE="Find"> bug \# <INPUT NAME=id SIZE=6>};
+
+ $html .= " | <a href='reports.cgi'>Reports</a>";
+ if ($loggedin) {
+ my $mybugstemplate = Param("mybugstemplate");
+ my %substs;
+ $substs{'userid'} = $::COOKIE{"Bugzilla_login"};
+ my $mybugsurl = PerformSubsts($mybugstemplate, \%substs);
+ $html = $html . " | <a href='$mybugsurl'>My Bugs</a>";
+ }
+
+ $html = $html . " | <a href=\"createaccount.cgi\"><NOBR>New account</NOBR></a>\n";
+
+ my $onLogPage = 0;
+ if (defined $ENV{"HTTP_REFERER"}) {
+ #my $referrer = $ENV{"HTTP_REFERER"};
+ #my @parts = split("/",$referrer);
+ #my $called_from = $parts[@parts-1];
+ #confirm_login($called_from);
+ }
+
+ if ($loggedin) {
+ $html .= "| <NOBR>Edit <a href='changepassword.cgi'>prefs</a></NOBR>";
+ if (UserInGroup("tweakparams")) {
+ $html .= ", <a href=editparams.cgi>parameters</a>";
+ }
+ if (UserInGroup("editcomponents")) {
+ $html .= ", <a href=editproducts.cgi>components</a>\n";
+ }
+ if (UserInGroup("editkeywords")) {
+ $html .= ", <a href=editkeywords.cgi>keywords</a>\n";
+ }
+ $html = $html . " | <NOBR><a href=relogin.cgi>Log out</a> $::COOKIE{'Bugzilla_login'}</NOBR>";
+ } else {
+ $html = $html . " | <NOBR><a href=query.cgi?GoAheadAndLogIn=1>Log in</a></NOBR>";
+ }
+ $html .= "</FORM>";
+ return $html;
+}
+
############# Live code below here (that is, not subroutine defs) #############
navigation_header();
+PutFooter();
+
1;
<P>
<A HREF=query.cgi>Go back to the query page.</A>
";
+ PutFooter();
exit;
};
/^asnamed$/ && do {
Click the <B>Back</B> button and type in a valid name for this query.
";
}
+ PutFooter();
exit;
};
/^asdefault$/ && do {
<P><A HREF=query.cgi>Go back to the query page, using the new default.</A>
";
+ PutFooter();
exit;
};
}
print "\n\n<P>The 'At least ___ votes' field must be a simple ";
print "number. You entered \"$c\", which doesn't cut it.";
print "<P>Please click the <B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
$minvotes = $c;
print "<P>The legal keyword names are <A HREF=describekeywords.cgi>";
print "listed here</A>.\n";
print "<P>Please click the <B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
}
if (!$foundone) {
print "\n\n<P>You must specify one or more fields in which to search for <tt>$email</tt>.\n";
print "<P>Please click the <B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
if ($lead eq " or ") {
print "\n\n<P>The 'changed in last ___ days' field must be a simple ";
print "number. You entered \"$c\", which doesn't cut it.";
print "<P>Please click the <B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
$query .= "and to_days(now()) - to_days(bugs.delta_ts) <= $c ";
if (!defined $date) {
print "\n\n<P>The string '<tt>$str</tt>' is not a legal date.\n";
print "<P>Please click the <B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
return time2str("'%Y/%m/%d %H:%M:%S'", $date);
pnl "<FORM NAME=changeform METHOD=POST ACTION=\"process_bug.cgi\">";
}
-my $tablestart = "<TABLE CELLSPACING=0 CELLPADDING=2>
+my $tablestart = "<TABLE CELLSPACING=0 CELLPADDING=4 WIDTH=100%>
<TR ALIGN=LEFT><TH>
<A HREF=\"buglist.cgi?$fields&order=bugs.bug_id\">ID</A>";
my %statushash;
my $buggroupset = "";
+my $pricol = -1;
+my $sevcol = -1;
+for (my $colcount = 0 ; $colcount < @collist ; $colcount++) {
+ my $colname = $collist[$colcount];
+ if ($colname eq "priority") {
+ $pricol = $colcount;
+ }
+ if ($colname eq "severity") {
+ $sevcol = $colcount;
+ }
+}
+
while (@row = FetchSQLData()) {
my $bug_id = shift @row;
my $g = shift @row; # Bug's group set.
pnl "</TABLE>$tablestart";
}
push @bugarray, $bug_id;
- pnl "<TR VALIGN=TOP ALIGN=LEFT><TD>";
+
+ # retrieve this bug's priority and severity, if available,
+ # by looping through all column names -- gross but functional
+ my $priority = "unknown";
+ my $severity;
+ if ($pricol >= 0) {
+ $priority = $row[$pricol];
+ }
+ if ($sevcol >= 0) {
+ $severity = $row[$sevcol];
+ }
+ my $customstyle = "";
+ if ($severity) {
+ if ($severity eq "enhan") {
+ $customstyle = "style='font-style:italic ! important'";
+ }
+ if ($severity eq "block") {
+ $customstyle = "style='color:red ! important; font-weight:bold ! important'";
+ }
+ if ($severity eq "criti") {
+ $customstyle = "style='color:red; ! important'";
+ }
+ }
+ pnl "<TR VALIGN=TOP ALIGN=LEFT CLASS=$priority $customstyle><TD>";
if ($dotweak) {
pnl "<input type=checkbox name=id_$bug_id>";
}
} else {
$value = "<nobr>$value</nobr>";
}
- pnl "<td>$value";
+ pnl "<td class=$c>$value";
} elsif ($c eq "keywords") {
my $query =
$::db->query("SELECT keyworddefs.name
}
print "</FORM>\n";
}
+PutFooter();
+
if ($serverpush) {
print "\n--thisrandomstring--\n";
}
<a href=\"showvotes.cgi\">Review your votes</a>
<hr>
";
- navigation_header();
+ PutFooter();
exit;
}
if ($::FORM{'pwd1'} ne $::FORM{'pwd2'}) {
print "<H1>Try again.</H1>
The two passwords you entered did not match. Please click <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
contains only numbers, letters, hyphens, or underlines.
<p>
Please click <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
print "
Your preferences have been updated.
<p>";
-navigation_header();
+PutFooter();
print "<INPUT TYPE=HIDDEN NAME=resetit VALUE=1>\n";
print "<INPUT TYPE=\"submit\" VALUE=\"Reset to Bugzilla default\">\n";
print "</FORM>\n";
+PutFooter();
print "exists. If you have forgotten the password for it, then\n";
print "<a href=query.cgi?GoAheadAndLogIn>click here</a> and use\n";
print "the <b>E-mail me a password</b> button.\n";
+ PutFooter();
exit;
}
PutHeader("Account created");
print "received, you may <a href=query.cgi?GoAheadAndLogIn>click\n";
print "here</a> and log in. Or, you can just <a href=\"\">go back to\n";
print "the top</a>.";
+ PutFooter();
exit;
}
<input type=submit>
};
+PutFooter();
sub Punt {
my ($str) = (@_);
print "$str<P>Please hit <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
print "<TD><A HREF=\"show_bug.cgi?id=$id\">Go Back to BUG# $id</A></TABLE>\n";
}
-navigation_header();
+PutFooter();
return "";
}
+DefParam("preferlists",
+ "If this is on, Bugzilla will display most selection options as selection lists. If this is off, Bugzilla will use radio buttons and checkboxes instead.",
+ "b",
+ 1);
+
+DefParam("prettyasciimail",
+ "If this is on, Bugzilla will send email reports formatted (assuming 76 character monospace font display). If this is off, email reports are sent using the old 'one-item-per-line' format.",
+ "b",
+ 0);
+
+DefParam("capitalizelists",
+ "If this is on, Bugzilla will capitalize list entries, checkboxes, and radio buttons. If this is off, Bugzilla will leave these items untouched.",
+ "b",
+ 0);
+
+
DefParam("usequip",
"If this is on, Bugzilla displays a silly quip at the beginning of buglists, and lets users add to the list of quips.",
"b",
"l",
'');
+DefParam("footerhtml",
+ "HTML to add to the bottom of every page. By default it displays the blurbhtml, and %commandmenu%, a menu of useful commands. You probably really want either headerhtml or footerhtml to include %commandmenu%.",
+ "l",
+ '<TABLE BORDER="0"><TR><TD BGCOLOR="#000000" VALIGN="TOP">
+<TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%" BGCOLOR="lightyellow">
+<TR><TD>
+%blurbhtml%
+<BR>
+%commandmenu%
+</TD></TR></TABLE></TD></TR></TABLE>');
+
+
DefParam("bannerhtml",
"The html that gets emitted at the head of every Bugzilla page.
<A HREF=\"http://www.mozilla.org/bugs/\"><B>bug pages</B></A>.");
-
+DefParam("mybugstemplate",
+ "This is the URL to use to bring up a simple 'all of my bugs' list for a user. %userid% will get replaced with the login name of a user.",
+ "t",
+ "buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&assigned_to=%userid%");
DefParam("shutdownhtml",
"If this field is non-empty, then Bugzilla will be completely disabled and this text will be displayed instead of all the Bugzilla pages.",
"b",
0);
+
DefParam("strictvaluechecks",
"Do stricter integrity checking on both form submission values and values read in from the database.",
"b",
0);
+
DefParam("browserbugmessage",
"If strictvaluechecks is on, and the bugzilla gets unexpected data from the browser, in addition to displaying the cause of the problem, it will output this HTML as well.",
"l",
<INPUT TYPE=\"submit\" VALUE=\"Submit\">
</FORM>
";
+ PutFooter();
exit;
}
}
print "<tr><td colspan=$cols><hr></td></tr></table>\n";
+
+PutFooter();
print "<p><a href=editkeywords.cgi>Edit keywords</a><p>\n";
}
-navigation_header();
+PutFooter();
if (!UserInGroup("tweakparams")) {
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
print "And so, you aren't allowed to edit the parameters.\n";
+ PutFooter();
exit;
}
if ($ok ne "") {
print "New value for $i is invalid: $ok<p>\n";
print "Please hit <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
}
print "<a href=editparams.cgi>Edit the params some more.</a><p>\n";
print "<a href=query.cgi>Go back to the query page.</a>\n";
+PutFooter();
print "The login info got confused. If you want to adjust the votes\n";
print "for <tt>$::COOKIE{'Bugzilla_login'}</tt>, then please\n";
print "<a href=showvotes.cgi?user=$who>click here</a>.<hr>\n";
- navigation_header();
+ PutFooter();
exit();
}
if (0 == @buglist) {
PutHeader("Oops?");
print "Something got confused. Please click <b>Back</b> and try again.";
- navigation_header();
+ PutFooter();
exit();
}
PutHeader("Numbers only, please");
print "Only use numeric values for your bug votes.\n";
print "Please click <b>Back</b> and try again.<hr>\n";
- navigation_header();
+ PutFooter();
exit();
}
}
print "You may only use $::prodmaxvotes{$prod} votes for bugs in the\n";
print "<tt>$prod</tt> product, but you are using $prodcount{$prod}.\n";
print "Please click <b>Back</b> and try again.<hr>\n";
- navigation_header();
+ PutFooter();
exit();
}
}
PutHeader("Voting tabulated", "Voting tabulated", $::COOKIE{'Bugzilla_login'});
print "Your votes have been recorded.\n";
print qq{<p><a href="showvotes.cgi?user=$who">Review your votes</a><hr>\n};
-navigation_header();
+PutFooter();
exit();
}
$num++;
}
- print "</BODY>\n</HTML>\n";
+ PutFooter();
}
}
$num++;
}
- print "</BODY>\n</HTML>\n";
+ PutFooter();
}
if (!UserInGroup("tweakparams")) {
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
print "And so, you aren't allowed to edit the parameters.\n";
+ PutFooter();
exit;
}
print "</form>\n";
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
+PutFooter();
}
$num++;
}
- print "</BODY>\n</HTML>\n";
+ PutFooter();
}
if ($description ne $descriptionold) {
unless ($description) {
print "Sorry, I can't delete the description.";
- PutTrailer($localtrailer);
SendSQL("UNLOCK TABLES");
+ PutTrailer($localtrailer);
exit;
}
SendSQL("UPDATE products
if ($product ne $productold) {
unless ($product) {
print "Sorry, I can't delete the product name.";
- PutTrailer($localtrailer);
SendSQL("UNLOCK TABLES");
+ PutTrailer($localtrailer);
exit;
}
if (TestProduct($product)) {
print "Sorry, product name '$product' is already in use.";
- PutTrailer($localtrailer);
SendSQL("UNLOCK TABLES");
+ PutTrailer($localtrailer);
exit;
}
}
$num++;
}
- print "</BODY></HTML>\n";
+ PutFooter();
}
}
$num++;
}
- print "</BODY>\n</HTML>\n";
+ PutFooter();
}
# 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.
-#
+# Corporation. Portions created by Netscape are Copyright (C) 1998
+# Netscape Communications Corporation. All Rights Reserved.
+#
# Contributor(s): Terry Weissman <terry@mozilla.org>
+
+########################################################################
+#
+# enter_bug.cgi
+# -------------
+# Displays bug entry form. Bug fields are specified through popup menus,
+# drop-down lists, or text fields. Default for these values can be passed
+# in as parameters to the cgi.
+#
+########################################################################
+
use diagnostics;
use strict;
print "</tr>";
}
print "</table>\n";
+ PutFooter();
exit;
}
$::FORM{'product'} = $prodlist[0];
my $component_popup = make_popup('component', $::components{$product},
formvalue('component'), 1);
-PutHeader ("Enter Bug");
+PutHeader ("Enter Bug","Enter Bug","This page lets you enter a new bug into Bugzilla.");
print "
<FORM METHOD=POST ACTION=\"post_bug.cgi\">
<TR>";
if (Param('letsubmitterchoosepriority')) {
print "
- <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority</A>:</B></TD>
+ <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="' .
<tr>
<td></td>
<td colspan=5>
- <INPUT TYPE=\"submit\" VALUE=\" Commit \">
+ <INPUT TYPE=\"submit\" VALUE=\" Commit \" ONCLICK=\"if (this.form.short_desc.value =='') { alert('Please enter a summary sentence for this bug.'); return false; }\">
<INPUT TYPE=\"reset\" VALUE=\"Reset\">
<INPUT TYPE=hidden name=form_name VALUE=enter_bug>
</FORM>\n";
+PutFooter();
+
print "</BODY></HTML>\n";
$zz = @main::db_errstr;
$zz = @main::default_column_list;
$zz = @main::dontchange;
+ $zz = %main::keywordsbyname;
$zz = @main::legal_bug_status;
$zz = @main::legal_components;
+ $zz = @main::legal_keywords;
$zz = @main::legal_opsys;
$zz = @main::legal_platform;
$zz = @main::legal_priority;
}
-
sub Param {
my ($value) = (@_);
if (defined $::param{$value}) {
return $::param{$value};
}
+
+ # See if it is a dynamically-determined param (can't be changed by user).
+ if ($value eq "commandmenu") {
+ return GetCommandMenu();
+ }
+ if ($value eq "settingsmenu") {
+ return GetSettingsMenu();
+ }
# Um, maybe we haven't sourced in the params at all yet.
if (stat("data/params")) {
# Write down and restore the version # here. That way, we get around
die "Can't find param named $value";
}
-
sub PerformSubsts {
my ($str, $substs) = (@_);
$str =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg;
print "If you put a bookmark <a href=\"$url\">to this link</a>, it will\n";
print "bring up the submit-a-new-bug page with the fields initialized\n";
print "as you've requested.\n";
+ PutFooter();
exit;
}
print "You must choose a component that corresponds to this bug. If\n";
print "necessary, just guess. But please hit the <B>Back</B> button\n";
print "and choose a component.\n";
+ PutFooter();
exit 0
}
if (!defined $::FORM{'short_desc'} || trim($::FORM{'short_desc'}) eq "") {
print "You must enter a summary for this bug. Please hit the\n";
print "<B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
navigation_header();
+PutFooter();
exit;
print "</form>\n";
print "</hr>\n";
print "<a href=query.cgi>Cancel all this and go to the query page.</a>\n";
+ PutFooter();
exit;
}
}
"<p>" .
"Please press <b>Back</b> and give some words " .
"on the reason of the your change.\n" );
+ PutFooter();
exit( 0 );
} else {
$ret = 0;
trim($::FORM{'assigned_to'}) eq "") {
print "You cannot reassign to a bug to noone. Unless you intentionally cleared out the \"Reassign bug to\" field, ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
if ($::FORM{'product'} eq $::dontchange) {
print "You must specify a product to help determine the new\n";
print "owner of these bugs.\n";
+ PutFooter();
exit 0
}
if ($::FORM{'component'} eq $::dontchange) {
print "You must specify a component whose owner should get\n";
print "assigned these bugs.\n";
+ PutFooter();
exit 0
}
ChangeStatus('NEW');
if ($num !~ /^[0-9]*$/) {
print "You must specify a bug number of which this bug is a\n";
print "duplicate. The bug has not been changed.\n";
+ PutFooter();
exit;
}
if (defined($::FORM{'id'}) && $::FORM{'dup_id'} == $::FORM{'id'}) {
print "Nice try, $::FORM{'who'}. But it doesn't really make sense to mark a\n";
print "bug as a duplicate of itself, does it?\n";
+ PutFooter();
exit;
}
AppendComment($::FORM{'dup_id'}, $::FORM{'who'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***");
};
# default
print "Unknown action $::FORM{'knob'}!\n";
+ PutFooter();
exit;
}
if ($#idlist < 0) {
print "You apparently didn't choose any bugs to modify.\n";
print "<p>Click <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
print "<P>The legal keyword names are <A HREF=describekeywords.cgi>";
print "listed here</A>.\n";
print "<P>Please click the <B>Back</B> button and try again.\n";
+ PutFooter();
exit;
}
if (!$keywordseen{$i}) {
if (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/) {
print "Um, you apparently did not change anything on the selected\n";
print "bugs. <p>Click <b>Back</b> and try again.\n";
- exit
+ PutFooter();
+ exit;
}
}
print ", except for the changes to the description";
}
print qq{.</form>\n<li><a href="show_bug.cgi?id=$id">Throw away my changes, and go revisit bug $id</a></ul>\n};
- navigation_header();
+ PutFooter();
exit;
}
if ($comp ne $i) {
print "<H1>$i is not a legal bug number</H1>\n";
print "<p>Click <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
if (!exists $seen{$i}) {
print "The change you are making to dependencies\n";
print "has caused a circular dependency chain.\n";
print "<p>Click <b>Back</b> and try again.\n";
+ PutFooter();
exit;
}
if (!exists $seen{$t}) {
do "bug_form.pl";
} else {
navigation_header();
+ PutFooter();
}
$::bug{'cclist'} = join(',', @cclist);
$::bug{'voterlist'} = join(',', @voterlist);
+ if (Param("prettyasciimail")) {
+ my $temp = formline <<'END',$::bug{'short_desc'},$id,$::bug{'product'},$::bug{'bug_status'},$::bug{'version'},$::bug{'resolution'},$::bug{'rep_platform'},$::bug{'bug_severity'},$::bug{'op_sys'},$::bug{'priority'},$::bug{'component'},$::bug{'assigned_to'},$::bug{'reporter'},$qa_contact,DescCC(\@cclist),$target_milestone,${status_whiteboard},$::bug{'bug_file_loc'},DescDependencies($id);
++============================================================================+
+| @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
++----------------------------------------------------------------------------+
+| Bug #: @<<<<<<<<<<< Product: @<<<<<<<<<<<<<<<<<<<<<< |
+| Status: @<<<<<<<<<<<<<<<<<< Version: @<<<<<<<<<<<<<<<<<<<<<< |
+| Resolution: @<<<<<<<<<<<<<<<<<< Platform: @<<<<<<<<<<<<<<<<<<<<<< |
+| Severity: @<<<<<<<<<<<<<<<<<< OS/Version: @<<<<<<<<<<<<<<<<<<<<<< |
+| Priority: @<<<<<<<<<<<<<<<<<< Component: @<<<<<<<<<<<<<<<<<<<<<< |
++----------------------------------------------------------------------------+
+| Assigned To: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
+| Reported By: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
+| ~QA Contact: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
+| ~ CC list: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
++----------------------------------------------------------------------------+
+| ~ Milestone: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
+|~ Whiteboard: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
+| URL: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
+|~Dependencies: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
++============================================================================+
+| DESCRIPTION |
+END
+
+ my $prettymail = $^A . $::bug{'long_desc'};
+ return $prettymail;
- return "Bug\#: $id
+
+ } else {
+ return "Bug\#: $id
Product: $::bug{'product'}
Version: $::bug{'version'}
Platform: $::bug{'rep_platform'}
" . DescDependencies($id) . "
$::bug{'long_desc'}
";
+}
}
if ($tolist ne "" || $cclist ne "") {
my %substs;
+ $substs{"fullbugreport"} = $text; # added ability to include the full bug report
$substs{"to"} = $tolist;
$substs{"cc"} = $cclist;
$substs{"bugid"} = $i;
# harmless.
open(SENDMAIL, "|/usr/lib/sendmail -t") ||
die "Can't open sendmail";
+
print SENDMAIL $msg;
close SENDMAIL;
$logstr = "$logstr; mail sent to $tolist, $cclist";
# set legal_product [concat $default{"product"} [lreplace $legal_product $w $w]]
# }
-PutHeader("Bugzilla Query Page", "Query Page", "",
+PutHeader("Bugzilla Query Page", "Query", "This page lets you search the database for recorded bugs.",
q{onLoad="selectProduct(document.forms[0]);"});
push @::legal_resolution, "---"; # Oy, what a hack.
</tr>
<tr>
<td align=left valign=top>
-<SELECT NAME=\"bug_status\" MULTIPLE SIZE=7>
-@{[make_options(\@::legal_bug_status, $default{'bug_status'}, $type{'bug_status'})]}
-</SELECT>
+
+@{[make_selection_widget(\"bug_status\",\@::legal_bug_status,$default{'bug_status'}, $type{'bug_status'}, 1)]}
+
</td>
<td align=left valign=top>
-<SELECT NAME=\"resolution\" MULTIPLE SIZE=7>
-@{[make_options(\@::legal_resolution, $default{'resolution'}, $type{'resolution'})]}
-</SELECT>
+@{[make_selection_widget(\"resolution\",\@::legal_resolution,$default{'resolution'}, $type{'resolution'}, 1)]}
+
</td>
<td align=left valign=top>
-<SELECT NAME=\"rep_platform\" MULTIPLE SIZE=7>
-@{[make_options(\@::legal_platform, $default{'rep_platform'}, $type{'rep_platform'})]}
-</SELECT>
+@{[make_selection_widget(\"platform\",\@::legal_platform,$default{'platform'}, $type{'platform'}, 1)]}
+
</td>
<td align=left valign=top>
-<SELECT NAME=\"op_sys\" MULTIPLE SIZE=7>
-@{[make_options(\@::legal_opsys, $default{'op_sys'}, $type{'op_sys'})]}
-</SELECT>
+@{[make_selection_widget(\"op_sys\",\@::legal_platform,$default{'op_sys'}, $type{'op_sys'}, 1)]}
+
</td>
<td align=left valign=top>
-<SELECT NAME=\"priority\" MULTIPLE SIZE=7>
-@{[make_options(\@::legal_priority, $default{'priority'}, $type{'priority'})]}
-</SELECT>
+@{[make_selection_widget(\"priority\",\@::legal_priority,$default{'priority'}, $type{'priority'}, 1)]}
+
</td>
<td align=left valign=top>
-<SELECT NAME=\"bug_severity\" MULTIPLE SIZE=7>
-@{[make_options(\@::legal_severity, $default{'bug_severity'}, $type{'bug_severity'})]}
-</SELECT>
+@{[make_selection_widget(\"bug_severity\",\@::legal_severity,$default{'bug_severity'}, $type{'bug_severity'}, 1)]}
+
</tr>
</table>
print "<a href=\"enter_bug.cgi\">Create 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";
+
+PutFooter();
<p>
";
-navigation_header();
+PutFooter();
exit;
print "<font color=blue>$_</font> : " .
($::FORM{$_} ? $::FORM{$_} : "undef") . "<br>\n";
}
+ PutFooter();
exit;
}
print <<FIN;
<p>
-</body>
-</html>
FIN
+PutFooter();
+
##################################
# user came in with no form data #
##################################
if ($bugs_count == 0)
{
print "No bugs found!\n";
+ PutFooter();
exit;
}
<p>
FIN
+ PutFooter();
exit;
}
Status("Sanity check completed.");
+PutFooter();
DumpBugActivity($::FORM{'id'});
print "<hr><a href=show_bug.cgi?id=$::FORM{'id'}>Back to bug $::FORM{'id'}</a>\n";
+
+PutFooter();
print "<INPUT NAME=id>\n";
print "<INPUT TYPE=\"submit\" VALUE=\"Show Me This Bug\">\n";
print "</FORM>\n";
+ PutFooter();
exit;
}
$! = 0;
do "bug_form.pl" || die "Error doing bug_form.pl: $!";
-print "</BODY>";
-print "</HTML>\n";
</form>
";
-navigation_header();
+PutFooter();
undef %seen;
DumpKids($id, "dependson", "blocked");
-navigation_header();
+PutFooter();
print qq{<a href="votehelp.html">Help! I don't understand this voting stuff</a>};
-navigation_header();
+PutFooter();