diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm index 840cb42cd8..e4a4669beb 100644 --- a/lib/RT/Transaction.pm +++ b/lib/RT/Transaction.pm @@ -1141,11 +1141,34 @@ sub _CanonicalizeRoleName { }, Correspond => sub { my $self = shift; - return ("Correspondence added"); #loc() + + my $created_date = RT::Date->new(RT->SystemUser); + $created_date->Set(Format => 'date', Value => $self->Created); + my $worked_date = RT::Date->new(RT->SystemUser); + $worked_date->Set(Format => 'date', Value => $self->TimeWorkedDate); + + if ( $self->TimeWorkedDate && ( $created_date->Date ne $worked_date->Date ) ) { + return ("Correspondence added for [_1]", $worked_date->Date); #loc() + } + else { + return ("Correspondence added"); #loc() + } }, Comment => sub { my $self = shift; - return ("Comments added"); #loc() + + my $created_date = RT::Date->new(RT->SystemUser); + $created_date->Set(Format => 'date', Value => $self->Created); + my $worked_date = RT::Date->new(RT->SystemUser); + $worked_date->Set(Format => 'date', Value => $self->TimeWorkedDate); + + if ( $self->TimeWorkedDate && ( $created_date->Date ne $worked_date->Date ) ) { + return ("Comments added for [_1]", $worked_date->Date); #loc() + } + else { + return ("Comments added"); #loc() + } + }, CustomField => sub { my $self = shift;