Fix removecc
parent
1cc0fa1590
commit
7c4236d2aa
|
@ -796,7 +796,7 @@ sub _check_bug_status
|
||||||
@valid_statuses = grep { $_->is_confirmed } @valid_statuses;
|
@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
|
# You can not assign bugs to other people
|
||||||
@valid_statuses = grep { !$_->is_assigned } @valid_statuses;
|
@valid_statuses = grep { !$_->is_assigned } @valid_statuses;
|
||||||
|
@ -1007,6 +1007,7 @@ sub save_cc
|
||||||
push @{$self->{restricted_cc}}, $_;
|
push @{$self->{restricted_cc}}, $_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$self->{restricted_cc} = undef if !@{$self->{restricted_cc}};
|
||||||
}
|
}
|
||||||
|
|
||||||
my $removed_cc = [ grep { !$new_cc{$_} } keys %old_cc ];
|
my $removed_cc = [ grep { !$new_cc{$_} } keys %old_cc ];
|
||||||
|
@ -2358,7 +2359,7 @@ sub remove_cc
|
||||||
my ($self, $user_or_name) = @_;
|
my ($self, $user_or_name) = @_;
|
||||||
my $user = ref $user_or_name ? $user_or_name : Bugzilla::User->check($user_or_name);
|
my $user = ref $user_or_name ? $user_or_name : Bugzilla::User->check($user_or_name);
|
||||||
my $cc_users = $self->cc_users;
|
my $cc_users = $self->cc_users;
|
||||||
if (grep { $_->id != $user->id } @$cc_users)
|
if (grep { $_->id == $user->id } @$cc_users)
|
||||||
{
|
{
|
||||||
$self->make_dirty;
|
$self->make_dirty;
|
||||||
@$cc_users = grep { $_->id != $user->id } @$cc_users;
|
@$cc_users = grep { $_->id != $user->id } @$cc_users;
|
||||||
|
@ -2733,7 +2734,7 @@ sub cc_users
|
||||||
{
|
{
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->{cc_users} if exists $self->{cc_users};
|
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 $dbh = Bugzilla->dbh;
|
||||||
my $cc_ids = $dbh->selectcol_arrayref('SELECT who FROM cc WHERE bug_id = ?', undef, $self->id);
|
my $cc_ids = $dbh->selectcol_arrayref('SELECT who FROM cc WHERE bug_id = ?', undef, $self->id);
|
||||||
|
|
|
@ -494,9 +494,9 @@ if ($ARGS->{newcc} || $ARGS->{addselfcc} || $ARGS->{removecc} || $ARGS->{masscc}
|
||||||
$cc_add = $ARGS->{newcc};
|
$cc_add = $ARGS->{newcc};
|
||||||
# We came from bug_form which uses a select box to determine what cc's
|
# We came from bug_form which uses a select box to determine what cc's
|
||||||
# need to be removed...
|
# 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
|
# CustIS Bug 38616 - CC list restriction
|
||||||
if ($bug->{restricted_cc})
|
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->{cc_restrict_group} = $bug->product_obj->cc_group;
|
||||||
$vars->{message} = 'cc_list_restricted';
|
$vars->{message} = 'cc_list_restricted';
|
||||||
}
|
}
|
||||||
|
|
|
@ -903,11 +903,13 @@
|
||||||
|
|
||||||
[% BLOCK error_illegal_bug_status_transition %]
|
[% BLOCK error_illegal_bug_status_transition %]
|
||||||
[% title = "Illegal $terms.Bug Status Change" %]
|
[% 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
|
You are not allowed to change the [% terms.bug %] status from
|
||||||
[%+ old.name FILTER html %] to [% new.name FILTER html %].
|
[%+ old.name FILTER html %] to [% new.name FILTER html %].
|
||||||
[% ELSIF new.name == "ASSIGNED" %]
|
[% ELSIF new.is_assigned %]
|
||||||
You are not allowed to assign new [% terms.bugs %] to other people.
|
You are not allowed to assign [% terms.bugs %] to other people.
|
||||||
|
[% ELSIF !new.is_confirmed %]
|
||||||
|
Unconfirmed states are disabled in this product.
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
You are not allowed to file new [% terms.bugs %] with the
|
You are not allowed to file new [% terms.bugs %] with the
|
||||||
[%+ new.name FILTER html %] status.
|
[%+ new.name FILTER html %] status.
|
||||||
|
|
Loading…
Reference in New Issue