diff --git a/mozilla/webtools/bugzilla/CGI.pl b/mozilla/webtools/bugzilla/CGI.pl
index 91edd28f15c..fb293645b8f 100644
--- a/mozilla/webtools/bugzilla/CGI.pl
+++ b/mozilla/webtools/bugzilla/CGI.pl
@@ -190,6 +190,7 @@ sub CheckFormField (\%$;\@) {
print "A legal $fieldname was not set; ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
@@ -204,6 +205,7 @@ sub CheckFormFieldDefined (\%$) {
if ( !defined $formRef->{$fieldname} ) {
print "$fieldname was not defined; ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
@@ -217,6 +219,7 @@ sub CheckPosInt($) {
if ( $number !~ /^[1-9][0-9]*$/ ) {
print "Received string \"$number\" when postive integer expected; ";
print Param("browserbugmessage");
+ PutFooter();
exit 0;
}
}
@@ -269,6 +272,142 @@ sub navigation_header {
print " Enter new bug\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 .= "$capitalized
";
+ $found = 1;
+ } else {
+ $popup .= "$capitalized
";
+ }
+ }
+ }
+ }
+ if (!$found && $default ne "") {
+ $popup .= "$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 .= "";
+ }
+ return $popup;
+}
+
$::CheckOptionValues = 1;
@@ -303,6 +442,7 @@ sub make_options {
"Please send mail to " . Param("maintainer") . " with " .
"details of what you were doing when this message " .
"appeared. Thank you.\n";
+ PutFooter();
exit 0;
} else {
@@ -393,6 +533,7 @@ sub CheckEmailSyntax {
print "syntax checking for a legal email address.\n";
print Param('emailregexpdesc');
print "
Please click back and try again.\n"; + PutFooter(); exit; } } @@ -459,6 +600,7 @@ sub confirm_login { print "Content-type: text/html\n\n"; PutHeader("Password has been emailed"); MailPassword($enteredlogin, $realpwd); + PutFooter(); exit; } @@ -468,6 +610,7 @@ sub confirm_login { PutHeader("Login failed"); print "The username or password you entered is not valid.\n"; print "Please click Back and try again.\n"; + PutFooter(); exit; } $::COOKIE{"Bugzilla_login"} = $enteredlogin; @@ -539,6 +682,7 @@ name=PleaseMailAPassword> SendSQL("delete from logincookies where to_days(now()) - to_days(lastused) > 30"); + PutFooter(); exit; } @@ -567,32 +711,38 @@ sub PutHeader { print PerformSubsts(Param("bannerhtml"), undef); - print "
| \n"; + print " | \n";
print "
| \n";
- print " \n"; + print " | \n"; + print " | \n"; - print Param("blurbhtml"); + print "$h2\n"; + print " |
Go back to the query page. "; + PutFooter(); exit; }; /^asnamed$/ && do { @@ -103,6 +104,7 @@ Query names can only have letters, digits, spaces, or underbars. You entered Click the Back button and type in a valid name for this query. "; } + PutFooter(); exit; }; /^asdefault$/ && do { @@ -116,6 +118,7 @@ individual query.
Go back to the query page, using the new default. "; + PutFooter(); exit; }; } @@ -195,6 +198,7 @@ if (defined $::FORM{'votes'}) { print "\n\n
The 'At least ___ votes' field must be a simple "; print "number. You entered \"$c\", which doesn't cut it."; print "
Please click the Back button and try again.\n"; + PutFooter(); exit; } $minvotes = $c; @@ -305,6 +309,7 @@ if ($::FORM{'keywords'}) { print "
The legal keyword names are "; print "listed here.\n"; print "
Please click the Back button and try again.\n"; + PutFooter(); exit; } } @@ -367,6 +372,7 @@ foreach my $id ("1", "2") { if (!$foundone) { print "\n\n
You must specify one or more fields in which to search for $email.\n"; print "
Please click the Back button and try again.\n"; + PutFooter(); exit; } if ($lead eq " or ") { @@ -385,6 +391,7 @@ if (defined $::FORM{'changedin'}) { print "\n\n
The 'changed in last ___ days' field must be a simple "; print "number. You entered \"$c\", which doesn't cut it."; print "
Please click the Back button and try again.\n"; + PutFooter(); exit; } $query .= "and to_days(now()) - to_days(bugs.delta_ts) <= $c "; @@ -408,6 +415,7 @@ sub SqlifyDate { if (!defined $date) { print "\n\n
The string '$str' is not a legal date.\n"; print "
Please click the Back button and try again.\n"; + PutFooter(); exit; } return time2str("'%Y/%m/%d %H:%M:%S'", $date); @@ -545,7 +553,7 @@ if ($dotweak) { pnl "
"; + PutFooter(); exit; } @@ -95,3 +96,5 @@ while (MoreSQLData()) { } print "\n"; } -navigation_header(); +PutFooter(); diff --git a/mozilla/webtools/bugzilla/doeditparams.cgi b/mozilla/webtools/bugzilla/doeditparams.cgi index 6743c03781a..7e0a4f193fd 100755 --- a/mozilla/webtools/bugzilla/doeditparams.cgi +++ b/mozilla/webtools/bugzilla/doeditparams.cgi @@ -39,6 +39,7 @@ print "Content-type: text/html\n\n"; if (!UserInGroup("tweakparams")) { print "
\n"; print "Please hit Back and try again.\n"; + PutFooter(); exit; } } @@ -75,3 +77,4 @@ print "OK, done.
\n"; print "Edit the params some more.
\n"; print "Go back to the query page.\n"; +PutFooter(); diff --git a/mozilla/webtools/bugzilla/doeditvotes.cgi b/mozilla/webtools/bugzilla/doeditvotes.cgi index 5147807299c..eef6381d8cf 100755 --- a/mozilla/webtools/bugzilla/doeditvotes.cgi +++ b/mozilla/webtools/bugzilla/doeditvotes.cgi @@ -39,7 +39,7 @@ if ($who ne $::FORM{'who'}) { print "The login info got confused. If you want to adjust the votes\n"; print "for $::COOKIE{'Bugzilla_login'}, then please\n"; print "click here.