Patch for bug 248613: Custom global default platform/OS in non-usebrowserinfo scenarios; patch by Marc Schumann <marcschum@web.de>; r=kiko, a=myk.
git-svn-id: svn://10.0.0.236/trunk@161418 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
1267fdbc83
commit
98cd173f30
@ -197,6 +197,19 @@ sub UpdateParams {
|
|||||||
# We don't want it, so get rid of it
|
# We don't want it, so get rid of it
|
||||||
delete $param{'version'};
|
delete $param{'version'};
|
||||||
|
|
||||||
|
# Change from usebrowserinfo to defaultplatform/defaultopsys combo
|
||||||
|
if (exists $param{'usebrowserinfo'}) {
|
||||||
|
if (!$param{'usebrowserinfo'}) {
|
||||||
|
if (!exists $param{'defaultplatform'}) {
|
||||||
|
$param{'defaultplatform'} = 'Other';
|
||||||
|
}
|
||||||
|
if (!exists $param{'defaultopsys'}) {
|
||||||
|
$param{'defaultopsys'} = 'other';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete $param{'usebrowserinfo'};
|
||||||
|
}
|
||||||
|
|
||||||
# Change from a boolean for quips to multi-state
|
# Change from a boolean for quips to multi-state
|
||||||
if (exists $param{'usequip'} && !exists $param{'enablequips'}) {
|
if (exists $param{'usequip'} && !exists $param{'enablequips'}) {
|
||||||
$param{'enablequips'} = $param{'usequip'} ? 'on' : 'off';
|
$param{'enablequips'} = $param{'usequip'} ? 'on' : 'off';
|
||||||
|
|||||||
@ -66,6 +66,26 @@ sub check_priority {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub check_platform {
|
||||||
|
my ($value) = (@_);
|
||||||
|
&::GetVersionTable();
|
||||||
|
if (lsearch(['', @::legal_platform], $value) < 0) {
|
||||||
|
return "Must be empty or a legal platform value: one of " .
|
||||||
|
join(", ", @::legal_platform);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_opsys {
|
||||||
|
my ($value) = (@_);
|
||||||
|
&::GetVersionTable();
|
||||||
|
if (lsearch(['', @::legal_opsys], $value) < 0) {
|
||||||
|
return "Must be empty or a legal operating system value: one of " .
|
||||||
|
join(", ", @::legal_opsys);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
sub check_shadowdb {
|
sub check_shadowdb {
|
||||||
my ($value) = (@_);
|
my ($value) = (@_);
|
||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
@ -740,6 +760,30 @@ You will get this message once a day until you\'ve dealt with these bugs!
|
|||||||
checker => \&check_priority
|
checker => \&check_priority
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name => 'defaultplatform',
|
||||||
|
desc => 'This is the platform that is preselected on the bug '.
|
||||||
|
'entry form.<br>'.
|
||||||
|
'You can leave this empty: '.
|
||||||
|
'Bugzilla will then use the platform that the browser '.
|
||||||
|
'reports to be running on as the default.',
|
||||||
|
type => 't',
|
||||||
|
default => '',
|
||||||
|
checker => \&check_platform
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name => 'defaultopsys',
|
||||||
|
desc => 'This is the operating system that is preselected on the bug '.
|
||||||
|
'entry form.<br>'.
|
||||||
|
'You can leave this empty: '.
|
||||||
|
'Bugzilla will then use the operating system that the browser '.
|
||||||
|
'reports to be running on as the default.',
|
||||||
|
type => 't',
|
||||||
|
default => '',
|
||||||
|
checker => \&check_opsys
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name => 'usetargetmilestone',
|
name => 'usetargetmilestone',
|
||||||
desc => 'Do you wish to use the Target Milestone field?',
|
desc => 'Do you wish to use the Target Milestone field?',
|
||||||
@ -769,14 +813,6 @@ You will get this message once a day until you\'ve dealt with these bugs!
|
|||||||
default => 0
|
default => 0
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
name => 'usebrowserinfo',
|
|
||||||
desc => 'Do you want bug reports to be assigned an OS & Platform based ' .
|
|
||||||
'on the browser the user makes the report from?',
|
|
||||||
type => 'b',
|
|
||||||
default => 1
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name => 'usevotes',
|
name => 'usevotes',
|
||||||
desc => 'Do you wish to allow users to vote for bugs? Note that in order ' .
|
desc => 'Do you wish to allow users to vote for bugs? Note that in order ' .
|
||||||
|
|||||||
@ -155,7 +155,9 @@ sub formvalue {
|
|||||||
sub pickplatform {
|
sub pickplatform {
|
||||||
return formvalue("rep_platform") if formvalue("rep_platform");
|
return formvalue("rep_platform") if formvalue("rep_platform");
|
||||||
|
|
||||||
if ( Param('usebrowserinfo') ) {
|
if (Param('defaultplatform')) {
|
||||||
|
return Param('defaultplatform');
|
||||||
|
} else {
|
||||||
for ($ENV{'HTTP_USER_AGENT'}) {
|
for ($ENV{'HTTP_USER_AGENT'}) {
|
||||||
#PowerPC
|
#PowerPC
|
||||||
/\(.*PowerPC.*\)/i && do {return "Macintosh";};
|
/\(.*PowerPC.*\)/i && do {return "Macintosh";};
|
||||||
@ -196,16 +198,17 @@ sub pickplatform {
|
|||||||
/Amiga/ && do {return "Macintosh";};
|
/Amiga/ && do {return "Macintosh";};
|
||||||
/WinMosaic/ && do {return "PC";};
|
/WinMosaic/ && do {return "PC";};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
# default
|
|
||||||
return "Other";
|
return "Other";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub pickos {
|
sub pickos {
|
||||||
if (formvalue('op_sys') ne "") {
|
if (formvalue('op_sys') ne "") {
|
||||||
return formvalue('op_sys');
|
return formvalue('op_sys');
|
||||||
}
|
}
|
||||||
if ( Param('usebrowserinfo') ) {
|
if (Param('defaultopsys')) {
|
||||||
|
return Param('defaultopsys');
|
||||||
|
} else {
|
||||||
for ($ENV{'HTTP_USER_AGENT'}) {
|
for ($ENV{'HTTP_USER_AGENT'}) {
|
||||||
/\(.*IRIX.*\)/ && do {return "IRIX";};
|
/\(.*IRIX.*\)/ && do {return "IRIX";};
|
||||||
/\(.*OSF.*\)/ && do {return "OSF/1";};
|
/\(.*OSF.*\)/ && do {return "OSF/1";};
|
||||||
@ -259,10 +262,9 @@ sub pickos {
|
|||||||
/\(.*PPC.*\)/ && do {return "Mac System 9.x";};
|
/\(.*PPC.*\)/ && do {return "Mac System 9.x";};
|
||||||
/\(.*68K.*\)/ && do {return "Mac System 8.0";};
|
/\(.*68K.*\)/ && do {return "Mac System 8.0";};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
# default
|
|
||||||
return "other";
|
return "other";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# End of subroutines
|
# End of subroutines
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|||||||
@ -321,13 +321,20 @@ function set_assign_to() {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
[% IF Param('usebrowserinfo') %]
|
[% UNLESS (Param('defaultplatform') && Param('defaultopsys')) %]
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<br>
|
<br>
|
||||||
We've made a guess at your operating system and platform.
|
We've made a guess at your
|
||||||
Please check them and, if we got it wrong, email
|
[% IF Param('defaultplatform') %]
|
||||||
|
operating system. Please check it
|
||||||
|
[% ELSIF Param('defaultopsys') %]
|
||||||
|
platform. Please check it
|
||||||
|
[% ELSE %]
|
||||||
|
operating system and platform. Please check them
|
||||||
|
[% END %]
|
||||||
|
and, if we got it wrong, email
|
||||||
[%+ Param('maintainer') %].
|
[%+ Param('maintainer') %].
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user