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.
This commit is contained in:
bryce-mozilla%nextbus.com 1999-05-04 00:05:27 +00:00
parent 04f62c0f29
commit 4b6033e72e
2 changed files with 54 additions and 43 deletions

View File

@ -238,7 +238,7 @@ You will get this message once a day until you've dealt with these bugs!
DefParam("defaultquery", 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!", "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", "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", DefParam("letsubmitterchoosepriority",
@ -286,8 +286,11 @@ DefParam("usestatuswhiteboard",
"b", "b",
0); 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; 1;

View File

@ -83,28 +83,33 @@ sub pickplatform {
if ($value ne "") { if ($value ne "") {
return $value; return $value;
} }
for ($ENV{'HTTP_USER_AGENT'}) { if ( Param('usebrowserinfo') ) {
/Mozilla.*\(Windows/ && do {return "PC";}; for ($ENV{'HTTP_USER_AGENT'}) {
/Mozilla.*\(Macintosh/ && do {return "Macintosh";}; /Mozilla.*\(Windows/ && do {return "PC";};
/Mozilla.*\(Win/ && do {return "PC";}; /Mozilla.*\(Macintosh/ && do {return "Macintosh";};
/Mozilla.*Linux.*86/ && do {return "PC";}; /Mozilla.*\(Win/ && do {return "PC";};
/Mozilla.*Linux.*alpha/ && do {return "DEC";}; /Mozilla.*Linux.*86/ && do {return "PC";};
/Mozilla.*OSF/ && do {return "DEC";}; /Mozilla.*Linux.*alpha/ && do {return "DEC";};
/Mozilla.*HP-UX/ && do {return "HP";}; /Mozilla.*OSF/ && do {return "DEC";};
/Mozilla.*IRIX/ && do {return "SGI";}; /Mozilla.*HP-UX/ && do {return "HP";};
/Mozilla.*(SunOS|Solaris)/ && do {return "Sun";}; /Mozilla.*IRIX/ && do {return "SGI";};
# default /Mozilla.*(SunOS|Solaris)/ && do {return "Sun";};
return "Other"; }
} }
# default
return "Other";
} }
sub pickversion { sub pickversion {
my $version = formvalue('version'); my $version = formvalue('version');
if ($version eq "") {
if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) { if ( Param('usebrowserinfo') ) {
$version = $1; if ($version eq "") {
if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) {
$version = $1;
}
} }
} }
@ -135,24 +140,26 @@ sub pickos {
if (formvalue('op_sys') ne "") { if (formvalue('op_sys') ne "") {
return formvalue('op_sys'); return formvalue('op_sys');
} }
for ($ENV{'HTTP_USER_AGENT'}) { if ( Param('usebrowserinfo') ) {
/Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";}; for ($ENV{'HTTP_USER_AGENT'}) {
/Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";}; /Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";};
/Mozilla.*\(.*;.*; 16bit.*\)/ && do {return "Windows 3.1";}; /Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";};
/Mozilla.*\(.*;.*; 68K.*\)/ && do {return "Mac System 8.5";}; /Mozilla.*\(.*;.*; 16bit.*\)/ && do {return "Windows 3.1";};
/Mozilla.*\(.*;.*; PPC.*\)/ && do {return "Mac System 8.5";}; /Mozilla.*\(.*;.*; 68K.*\)/ && do {return "Mac System 8.5";};
/Mozilla.*\(.*;.*; OSF.*\)/ && do {return "OSF/1";}; /Mozilla.*\(.*;.*; PPC.*\)/ && do {return "Mac System 8.5";};
/Mozilla.*\(.*;.*; Linux.*\)/ && do {return "Linux";}; /Mozilla.*\(.*;.*; OSF.*\)/ && do {return "OSF/1";};
/Mozilla.*\(.*;.*; SunOS 5.*\)/ && do {return "Solaris";}; /Mozilla.*\(.*;.*; Linux.*\)/ && do {return "Linux";};
/Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";}; /Mozilla.*\(.*;.*; SunOS 5.*\)/ && do {return "Solaris";};
/Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";}; /Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";};
/Mozilla.*\(.*;.*; BSD\/OS.*\)/ && do {return "BSDI";}; /Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";};
/Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";}; /Mozilla.*\(.*;.*; BSD\/OS.*\)/ && do {return "BSDI";};
/Mozilla.*\(Win95.*\)/ && do {return "Windows 95";}; /Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";};
/Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";}; /Mozilla.*\(Win95.*\)/ && do {return "Windows 95";};
# default /Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";};
return "other"; }
} }
# default
return "other";
} }
@ -226,10 +233,10 @@ print "
<tr> <tr>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned To:</A></B></TD> <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned To:</A></B></TD>
<TD colspan=5>$assign_element <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>
<tr> <tr>
<TD ALIGN=RIGHT ><B>Cc:</B></TD> <TD ALIGN=RIGHT><B>Cc:</B></TD>
<TD colspan=5>$cc_element</TD> <TD colspan=5>$cc_element</TD>
</tr> </tr>
<tr><td>&nbsp<td> <td> <td> <td> <td> </tr> <tr><td>&nbsp<td> <td> <td> <td> <td> </tr>
@ -247,9 +254,8 @@ print "
value_quote(formvalue('short_desc')) . value_quote(formvalue('short_desc')) .
"\"></TD> "\"></TD>
</TR> </TR>
<tr><td>&nbsp<td> <td> <td> <td> <td> </tr> <tr><td align=right valign=top><B>Description:</b></tr>
<tr> <tr>
<td align=right valign=top><B>Description:</b>
<td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" . <td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" .
value_quote(formvalue('comment')) . value_quote(formvalue('comment')) .
"</TEXTAREA><BR></td> "</TEXTAREA><BR></td>
@ -266,9 +272,11 @@ print "
</tr> </tr>
</TABLE> </TABLE>
<INPUT TYPE=hidden name=form_name VALUE=enter_bug> <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 ( Param('usebrowserinfo') ) {
If you think it got it wrong, please tell " . Param('maintainer') . " what it should have been. 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>";