Optionally allow to assign bugs to other people
parent
327fbcb87e
commit
a0deb31c5b
|
@ -796,9 +796,11 @@ sub _check_bug_status
|
||||||
@valid_statuses = grep { $_->is_confirmed } @valid_statuses;
|
@valid_statuses = grep { $_->is_confirmed } @valid_statuses;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($self->assigned_to_id && $user->id != $self->assigned_to_id)
|
my $allow_assigned = 1;
|
||||||
|
if (!Bugzilla->params->{assign_to_others} && $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
|
||||||
|
$allow_assigned = 0;
|
||||||
@valid_statuses = grep { !$_->is_assigned } @valid_statuses;
|
@valid_statuses = grep { !$_->is_assigned } @valid_statuses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,14 +819,15 @@ sub _check_bug_status
|
||||||
}
|
}
|
||||||
|
|
||||||
# We skip this check if we are changing from a status to itself.
|
# We skip this check if we are changing from a status to itself.
|
||||||
if ((!$old_status || $old_status->id != $new_status->id) &&
|
if ((!$old_status || $old_status->id != $new_status->id ||
|
||||||
|
!$new_status->is_confirmed && !$product->allows_unconfirmed) &&
|
||||||
!grep { $_->id == $new_status->id } @valid_statuses)
|
!grep { $_->id == $new_status->id } @valid_statuses)
|
||||||
{
|
{
|
||||||
ThrowUserError('illegal_bug_status_transition', {
|
ThrowUserError('illegal_bug_status_transition', {
|
||||||
old => $old_status,
|
old => $old_status,
|
||||||
new => $new_status,
|
new => $new_status,
|
||||||
allow_unconfirmed => $product->allows_unconfirmed,
|
allow_unconfirmed => $product->allows_unconfirmed,
|
||||||
allow_assigned => !$self->assigned_to_id || $user->id == $self->assigned_to_id,
|
allow_assigned => $allow_assigned,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,13 @@ sub get_param_list
|
||||||
name => 'noresolveonopenblockers',
|
name => 'noresolveonopenblockers',
|
||||||
type => 'b',
|
type => 'b',
|
||||||
default => 0,
|
default => 0,
|
||||||
}
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name => 'assign_to_others',
|
||||||
|
type => 'b',
|
||||||
|
default => 1,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
return @param_list;
|
return @param_list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,4 +60,8 @@
|
||||||
"Don\'t allow $terms.bugs to be resolved as fixed " _
|
"Don\'t allow $terms.bugs to be resolved as fixed " _
|
||||||
"if they have unresolved dependencies."
|
"if they have unresolved dependencies."
|
||||||
|
|
||||||
|
assign_to_others =>
|
||||||
|
"Allow to assign bugs to other people, i.e. allow to set bug status " _
|
||||||
|
"that has 'is assigned' flag turned on if 'assigned to' is not equal to you."
|
||||||
|
|
||||||
} %]
|
} %]
|
||||||
|
|
Loading…
Reference in New Issue