From db2a5492739a143ff828bbf25b1c97ab1524a9b9 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Fri, 18 Jun 2010 13:48:21 -0700 Subject: Bug 556422: Move the existing bug-moving functionality into an extension called OldBugMove. r=dkl, a=mkanat --- Bugzilla/Bug.pm | 12 +---- Bugzilla/Comment.pm | 3 -- Bugzilla/Config/BugMove.pm | 93 --------------------------------------- Bugzilla/Constants.pm | 3 +- Bugzilla/DB.pm | 3 +- Bugzilla/Field/ChoiceInterface.pm | 2 +- Bugzilla/User.pm | 11 ----- 7 files changed, 4 insertions(+), 123 deletions(-) delete mode 100644 Bugzilla/Config/BugMove.pm (limited to 'Bugzilla') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 3fb1dcf98..6df7363d5 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2410,10 +2410,6 @@ sub set_resolution { my $new_res = $self->resolution; if ($new_res ne $old_res) { - # MOVED has a special meaning and can only be used when - # really moving bugs to another installation. - ThrowCodeError('no_manual_moved') if ($new_res eq 'MOVED' && !$params->{moving}); - # Clear the dup_id if we're leaving the dup resolution. if ($old_res eq 'DUPLICATE') { $self->_clear_dup_id(); @@ -3278,7 +3274,6 @@ sub user { return {} if $self->{'error'}; my $user = Bugzilla->user; - my $canmove = Bugzilla->params->{'move-enabled'} && $user->is_mover; my $prod_id = $self->{'product_id'}; @@ -3293,8 +3288,7 @@ sub user { my $isreporter = $user->id && $user->id == $self->{reporter_id}; - $self->{'user'} = {canmove => $canmove, - canconfirm => $canconfirm, + $self->{'user'} = {canconfirm => $canconfirm, canedit => $canedit, isreporter => $isreporter}; return $self->{'user'}; @@ -3326,10 +3320,6 @@ sub choices { my $resolution_field = new Bugzilla::Field({ name => 'resolution' }); # Don't include the empty resolution in drop-downs. my @resolutions = grep($_->name, @{ $resolution_field->legal_values }); - # And don't include MOVED in the list unless the bug is already MOVED. - if ($self->resolution ne 'MOVED') { - @resolutions= grep { $_->name ne 'MOVED' } @resolutions; - } $choices{'resolution'} = \@resolutions; $self->{'choices'} = \%choices; diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index be10329d9..074f28dd6 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -179,9 +179,6 @@ sub _check_extra_data { if (!defined $extra_data) { ThrowCodeError('comment_extra_data_required', { type => $type }); } - if ($type == CMT_MOVED_TO) { - $extra_data = Bugzilla::User->check($extra_data)->login; - } elsif ($type == CMT_ATTACHMENT_CREATED or $type == CMT_ATTACHMENT_UPDATED) { diff --git a/Bugzilla/Config/BugMove.pm b/Bugzilla/Config/BugMove.pm deleted file mode 100644 index 2d973d8ca..000000000 --- a/Bugzilla/Config/BugMove.pm +++ /dev/null @@ -1,93 +0,0 @@ -# -*- Mode: perl; indent-tabs-mode: nil -*- -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is the Bugzilla Bug Tracking System. -# -# The Initial Developer of the Original Code is Netscape Communications -# Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): Terry Weissman -# Dawn Endico -# Dan Mosedale -# Joe Robins -# Jacob Steenhagen -# J. Paul Reed -# Bradley Baetz -# Joseph Heenan -# Erik Stambaugh -# Frédéric Buclin -# - -package Bugzilla::Config::BugMove; - -use strict; - -use Bugzilla::Config::Common; - -our $sortkey = 700; - -sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'move-enabled', - type => 'b', - default => 0 - }, - - { - name => 'move-button-text', - type => 't', - default => 'Move To Bugscape' - }, - - { - name => 'move-to-url', - type => 't', - default => '' - }, - - { - name => 'move-to-address', - type => 't', - default => 'bugzilla-import' - }, - - { - name => 'moved-from-address', - type => 't', - default => 'bugzilla-admin' - }, - - { - name => 'movers', - type => 't', - default => '' - }, - - { - name => 'moved-default-product', - type => 't', - default => '' - }, - - { - name => 'moved-default-component', - type => 't', - default => '' - } ); - return @param_list; -} - -1; diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index d4e8782c6..55ef4a0e3 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -92,7 +92,6 @@ use File::Basename; CMT_NORMAL CMT_DUPE_OF CMT_HAS_DUPE - CMT_MOVED_TO CMT_ATTACHMENT_CREATED CMT_ATTACHMENT_UPDATED @@ -299,7 +298,7 @@ use constant CMT_NORMAL => 0; use constant CMT_DUPE_OF => 1; use constant CMT_HAS_DUPE => 2; # Type 3 was CMT_POPULAR_VOTES, which moved to the Voting extension. -use constant CMT_MOVED_TO => 4; +# Type 4 was CMT_MOVED_TO, which moved to the OldBugMove extension. use constant CMT_ATTACHMENT_CREATED => 5; use constant CMT_ATTACHMENT_UPDATED => 6; diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 79a5639dd..8b8d74c90 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -70,8 +70,7 @@ use constant ENUM_DEFAULTS => { rep_platform => ["All","PC","Macintosh","Other"], bug_status => ["UNCONFIRMED","NEW","ASSIGNED","REOPENED","RESOLVED", "VERIFIED","CLOSED"], - resolution => ["","FIXED","INVALID","WONTFIX", "DUPLICATE","WORKSFORME", - "MOVED"], + resolution => ["","FIXED","INVALID","WONTFIX", "DUPLICATE","WORKSFORME"], }; ##################################################################### diff --git a/Bugzilla/Field/ChoiceInterface.pm b/Bugzilla/Field/ChoiceInterface.pm index 5b796270b..a718377c2 100644 --- a/Bugzilla/Field/ChoiceInterface.pm +++ b/Bugzilla/Field/ChoiceInterface.pm @@ -99,7 +99,7 @@ sub is_static { # If we need to special-case Resolution for *anything* else, it should # get its own subclass. if ($self->field->name eq 'resolution') { - return grep($_ eq $self->name, ('', 'FIXED', 'MOVED', 'DUPLICATE')) + return grep($_ eq $self->name, ('', 'FIXED', 'DUPLICATE')) ? 1 : 0; } elsif ($self->field->custom) { diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 815b435fd..aa01d93a5 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1639,17 +1639,6 @@ sub mail_settings { return $self->{'mail_settings'}; } -sub is_mover { - my $self = shift; - - if (!defined $self->{'is_mover'}) { - my @movers = map { trim($_) } split(',', Bugzilla->params->{'movers'}); - $self->{'is_mover'} = ($self->id - && grep { $_ eq $self->login } @movers); - } - return $self->{'is_mover'}; -} - sub is_insider { my $self = shift; -- cgit v1.2.3-24-g4f1b