Hi
I want to use different styles for Comment and Correspond in History.
As far as I can see ShowTransaction use data from %TRANSACTION_CLASSIFICATION as css classes.
Is this correct?
And how I can change
our %TRANSACTION_CLASSIFICATION = (
…
Create => ‘message’,
Correspond => ‘message’,
Comment => ‘message’,
…
);
to something like
our %TRANSACTION_CLASSIFICATION = (
…
Create => ‘message Create’,
Correspond => ‘message Correspond’,
Comment => ‘message Comment’,
…
);
?
Or should I overlay sub ClassifyTransaction instead?
Rather than modifying Record.pm, you should use the callback in ShowTransaction:
$m->callback(
CallbackName => 'MassageTypeClass',
Transaction => $Transaction,
TypeClassRef => \$type_class,
ARGSRef => \%ARGS,
);
So You have to put a file rt/local/html/Callbacks/YourOrg/Elements/ShowTransaction/MassageTypeClass with a content such as (untested):
<%init>
if ( $Transaction && $Transaction->Type =~ m/^(Create|Comment|Correspond)$/ ) {
$$TypeClassRef .= ' '.$Transaction->Type;
}
</%init>
<%args>
$Transaction =>undef
$TypeClassRef => undef
</%args>
Thank You very much for this solution! Way better than Record.pm overlaying.
I missed type_class in this callback.