Skip to content

Commit

Permalink
Display worked date for reply/comment transactions
Browse files Browse the repository at this point in the history
If worked date is different from created date display worked date as part of the
transaction description.
  • Loading branch information
bkembreeBPS committed Dec 2, 2024
1 parent 1a2b5e5 commit 5b2f035
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions lib/RT/Transaction.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5b2f035

Please sign in to comment.