Bug 448815: Support pronouns for the "changed by" field in boolean charts
r=dkl a=LpSolit git-svn-id: svn://10.0.0.236/trunk@264313 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1 +1 @@
|
||||
8418
|
||||
8419
|
||||
@@ -2154,6 +2154,15 @@ sub _contact_exact_group {
|
||||
}
|
||||
}
|
||||
|
||||
sub _get_user_id {
|
||||
my ($self, $value) = @_;
|
||||
|
||||
if ($value =~ /^%\w+%$/) {
|
||||
return pronoun($value, $self->_user);
|
||||
}
|
||||
return login_to_id($value, THROW_ERROR);
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
# Search Functions
|
||||
#####################################################################
|
||||
@@ -2284,7 +2293,7 @@ sub _long_desc_changedby {
|
||||
|
||||
my $table = "longdescs_$chart_id";
|
||||
push(@$joins, { table => 'longdescs', as => $table });
|
||||
my $user_id = login_to_id($value, THROW_ERROR);
|
||||
my $user_id = $self->_get_user_id($value);
|
||||
$args->{term} = "$table.who = $user_id";
|
||||
}
|
||||
|
||||
@@ -2380,7 +2389,7 @@ sub _work_time_changedby {
|
||||
|
||||
my $table = "longdescs_$chart_id";
|
||||
push(@$joins, { table => 'longdescs', as => $table });
|
||||
my $user_id = login_to_id($value, THROW_ERROR);
|
||||
my $user_id = $self->_get_user_id($value);
|
||||
$args->{term} = "$table.who = $user_id AND $table.work_time != 0";
|
||||
}
|
||||
|
||||
@@ -2829,7 +2838,7 @@ sub _changedby {
|
||||
|| ThrowCodeError("invalid_field_name", { field => $field });
|
||||
my $field_id = $field_object->id;
|
||||
my $table = "act_${field_id}_$chart_id";
|
||||
my $user_id = login_to_id($value, THROW_ERROR);
|
||||
my $user_id = $self->_get_user_id($value);
|
||||
my $join = {
|
||||
table => 'bugs_activity',
|
||||
as => $table,
|
||||
|
||||
Reference in New Issue
Block a user