summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-20 05:15:17 +0200
committerlpsolit%gmail.com <>2006-06-20 05:15:17 +0200
commit2545c0950c4f0fde8f78b265217fa9f523eff7bf (patch)
tree5bb305644ad11da196c7613b82743e426e2fd337 /Bugzilla/Bug.pm
parentb687ddef9b6dfeec3d87b7ae211decbf21b6e9a9 (diff)
downloadbugzilla-2545c0950c4f0fde8f78b265217fa9f523eff7bf.tar.gz
bugzilla-2545c0950c4f0fde8f78b265217fa9f523eff7bf.tar.xz
Bug 304601: Bugzilla::Config's :locations exports need to be in their own module - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat for the main patch, r=myk for the patch about CGI.pm a=justdave
Bug 328637: Remove all legal_* versioncache arrays - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave Bug 110503 - Eliminate versioncache
Diffstat (limited to 'Bugzilla/Bug.pm')
-rwxr-xr-xBugzilla/Bug.pm40
1 files changed, 25 insertions, 15 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index aa5ad5a83..84f6ebd4b 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -30,10 +30,6 @@ package Bugzilla::Bug;
use strict;
-use vars qw(@legal_platform
- @legal_priority @legal_severity @legal_opsys @legal_bug_status
- @settable_resolution);
-
use CGI::Carp qw(fatalsToBrowser);
use Bugzilla::Attachment;
@@ -651,8 +647,6 @@ sub choices {
return $self->{'choices'} if exists $self->{'choices'};
return {} if $self->{'error'};
- &::GetVersionTable();
-
$self->{'choices'} = {};
$self->{prod_obj} ||= new Bugzilla::Product({name => $self->{product}});
@@ -665,25 +659,41 @@ sub choices {
}
# Hack - this array contains "". See bug 106589.
- my @res = grep ($_, @::settable_resolution);
+ my @res = grep ($_, @{settable_resolutions()});
$self->{'choices'} =
{
'product' => \@prodlist,
- 'rep_platform' => \@::legal_platform,
- 'priority' => \@::legal_priority,
- 'bug_severity' => \@::legal_severity,
- 'op_sys' => \@::legal_opsys,
- 'bug_status' => \@::legal_bug_status,
- 'resolution' => \@res,
- 'component' => [map($_->name, @{$self->{prod_obj}->components})],
- 'version' => [map($_->name, @{$self->{prod_obj}->versions})],
+ 'rep_platform' => get_legal_field_values('rep_platform'),
+ 'priority' => get_legal_field_values('priority'),
+ 'bug_severity' => get_legal_field_values('bug_severity'),
+ 'op_sys' => get_legal_field_values('op_sys'),
+ 'bug_status' => get_legal_field_values('bug_status'),
+ 'resolution' => \@res,
+ 'component' => [map($_->name, @{$self->{prod_obj}->components})],
+ 'version' => [map($_->name, @{$self->{prod_obj}->versions})],
'target_milestone' => [map($_->name, @{$self->{prod_obj}->milestones})],
};
return $self->{'choices'};
}
+# List of resolutions that may be set directly by hand in the bug form.
+# 'MOVED' and 'DUPLICATE' are excluded from the list because setting
+# bugs to those resolutions requires a special process.
+sub settable_resolutions {
+ my $resolutions = get_legal_field_values('resolution');
+ my $pos = lsearch($resolutions, 'DUPLICATE');
+ if ($pos >= 0) {
+ splice(@$resolutions, $pos, 1);
+ }
+ $pos = lsearch($resolutions, 'MOVED');
+ if ($pos >= 0) {
+ splice(@$resolutions, $pos, 1);
+ }
+ return $resolutions;
+}
+
# Convenience Function. If you need speed, use this. If you need
# other Bug fields in addition to this, just create a new Bug with
# the alias.