Fix removecc

master
Vitaliy Filippov 2014-05-19 14:17:55 +04:00
parent 1cc0fa1590
commit 7c4236d2aa
3 changed files with 12 additions and 9 deletions

View File

@ -796,7 +796,7 @@ sub _check_bug_status
@valid_statuses = grep { $_->is_confirmed } @valid_statuses;
}
if ($self->{assigned_to} && $user->id != $self->{assigned_to})
if ($self->assigned_to_id && $user->id != $self->assigned_to_id)
{
# You can not assign bugs to other people
@valid_statuses = grep { !$_->is_assigned } @valid_statuses;
@ -1007,6 +1007,7 @@ sub save_cc
push @{$self->{restricted_cc}}, $_;
}
}
$self->{restricted_cc} = undef if !@{$self->{restricted_cc}};
}
my $removed_cc = [ grep { !$new_cc{$_} } keys %old_cc ];
@ -2358,7 +2359,7 @@ sub remove_cc
my ($self, $user_or_name) = @_;
my $user = ref $user_or_name ? $user_or_name : Bugzilla::User->check($user_or_name);
my $cc_users = $self->cc_users;
if (grep { $_->id != $user->id } @$cc_users)
if (grep { $_->id == $user->id } @$cc_users)
{
$self->make_dirty;
@$cc_users = grep { $_->id != $user->id } @$cc_users;
@ -2733,7 +2734,7 @@ sub cc_users
{
my $self = shift;
return $self->{cc_users} if exists $self->{cc_users};
return [] if !$self->id;
return $self->{cc_users} = [] if !$self->id;
my $dbh = Bugzilla->dbh;
my $cc_ids = $dbh->selectcol_arrayref('SELECT who FROM cc WHERE bug_id = ?', undef, $self->id);

View File

@ -494,9 +494,9 @@ if ($ARGS->{newcc} || $ARGS->{addselfcc} || $ARGS->{removecc} || $ARGS->{masscc}
$cc_add = $ARGS->{newcc};
# We came from bug_form which uses a select box to determine what cc's
# need to be removed...
if (defined $ARGS->{removecc} && $ARGS->{cc}) # FIXME array[]
if (defined $ARGS->{removecc} && $ARGS->{cc})
{
$cc_remove = join ",", @{$ARGS->{cc}};
$cc_remove = $ARGS->{cc};
}
}
@ -674,7 +674,7 @@ foreach my $bug (@bug_objects)
# CustIS Bug 38616 - CC list restriction
if ($bug->{restricted_cc})
{
$vars->{restricted_cc} = [map { $_->login } @{$bug->{restricted_cc}}];
$vars->{restricted_cc} = [ map { $_->login } @{$bug->{restricted_cc}} ];
$vars->{cc_restrict_group} = $bug->product_obj->cc_group;
$vars->{message} = 'cc_list_restricted';
}

View File

@ -903,11 +903,13 @@
[% BLOCK error_illegal_bug_status_transition %]
[% title = "Illegal $terms.Bug Status Change" %]
[% IF old.defined %]
[% IF old.defined && old.id != new.id %]
You are not allowed to change the [% terms.bug %] status from
[%+ old.name FILTER html %] to [% new.name FILTER html %].
[% ELSIF new.name == "ASSIGNED" %]
You are not allowed to assign new [% terms.bugs %] to other people.
[% ELSIF new.is_assigned %]
You are not allowed to assign [% terms.bugs %] to other people.
[% ELSIF !new.is_confirmed %]
Unconfirmed states are disabled in this product.
[% ELSE %]
You are not allowed to file new [% terms.bugs %] with the
[%+ new.name FILTER html %] status.