Add parameter "usebrowserinfo", to allow disabling the setting of OS and Platform

based on the brower the user makes the report from. Realign text box for narrower windows. Remove Mozilla-specific default parameter.
parent 720ac379
......@@ -238,7 +238,7 @@ You will get this message once a day until you've dealt with these bugs!
DefParam("defaultquery",
"This is the default query that initially comes up when you submit a bug. It's in URL parameter format, which makes it hard to read. Sorry!",
"t",
"bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=Mozilla&order=%22Importance%22");
"bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=%22Importance%22");
DefParam("letsubmitterchoosepriority",
......@@ -286,8 +286,11 @@ DefParam("usestatuswhiteboard",
"b",
0);
DefParam("usebrowserinfo",
"Do you want bug reports to be assigned an OS & Platform based on the browser
the user makes the report from?",
"b",
1);
1;
......@@ -83,6 +83,7 @@ sub pickplatform {
if ($value ne "") {
return $value;
}
if ( Param('usebrowserinfo') ) {
for ($ENV{'HTTP_USER_AGENT'}) {
/Mozilla.*\(Windows/ && do {return "PC";};
/Mozilla.*\(Macintosh/ && do {return "Macintosh";};
......@@ -93,20 +94,24 @@ sub pickplatform {
/Mozilla.*HP-UX/ && do {return "HP";};
/Mozilla.*IRIX/ && do {return "SGI";};
/Mozilla.*(SunOS|Solaris)/ && do {return "Sun";};
}
}
# default
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;
......@@ -135,6 +140,7 @@ sub pickos {
if (formvalue('op_sys') ne "") {
return formvalue('op_sys');
}
if ( Param('usebrowserinfo') ) {
for ($ENV{'HTTP_USER_AGENT'}) {
/Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";};
/Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";};
......@@ -150,9 +156,10 @@ sub pickos {
/Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";};
/Mozilla.*\(Win95.*\)/ && do {return "Windows 95";};
/Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";};
}
}
# default
return "other";
}
}
......@@ -226,10 +233,10 @@ print "
<tr>
<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 owner for component)</td>
(Leave blank to assign to default component owner)</td>
</tr>
<tr>
<TD ALIGN=RIGHT ><B>Cc:</B></TD>
<TD ALIGN=RIGHT><B>Cc:</B></TD>
<TD colspan=5>$cc_element</TD>
</tr>
<tr><td>&nbsp<td> <td> <td> <td> <td> </tr>
......@@ -247,9 +254,8 @@ print "
value_quote(formvalue('short_desc')) .
"\"></TD>
</TR>
<tr><td>&nbsp<td> <td> <td> <td> <td> </tr>
<tr><td align=right valign=top><B>Description:</b></tr>
<tr>
<td align=right valign=top><B>Description:</b>
<td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" .
value_quote(formvalue('comment')) .
"</TEXTAREA><BR></td>
......@@ -266,9 +272,11 @@ print "
</tr>
</TABLE>
<INPUT TYPE=hidden name=form_name VALUE=enter_bug>
</FORM>
</FORM>\n";
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.
if ( Param('usebrowserinfo') ) {
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.";
}
print "</BODY></HTML>\n";
</BODY></HTML>";
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