On Thu, Oct 01, 2009 at 04:27:49PM +0200, mailinglists wrote: > Hi, > > I would like to colorize a CustomField column in the RT at a Glance > page, as described in the ShowStatusInColor wiki page. It works well for > status, but I don't get it for Customfield. What I wrote doesn't give > error, but doen't worh either. (I'm sorry I don't understand very much > CallBacks...). I'm In RT3.8
CustomFields are handled by the entry in ColumnMap named CustomField
You'll have to create your own version of that and use the overlay to
jam it in (or use a callback in ShowCustomField to change the color)
You can't just use the name of the custom field in ColumnMap
-kevin
> My CustomFiled is Named "Criticite" and has 3 possible values : Critique
> / Majeure / Mineure and it is not mandatory
>
> Here is what I add in
> /opt/rt3/local/html/Callbacks/MyCallbacks/Elements/RT__Ticket/ColumnMap/ColumnMap
>
> :
>
> sub criticiteInColor {
> my $Ticket = shift;
> # my $criticite = $Ticket->CustomFieldObj->Type;
> my $criticite = $Ticket->CustomFieldObj->CustomFieldValues('3');
> my $color = undef;
>
> if ($criticite eq 'Critique') {
> $color = "900000";
> } elsif ($criticite eq 'Majeure') {
> $color = "#AA8000";
> } elsif ($criticite eq 'Mineure') {
> $color = "#000090";
> }
>
> $criticite = loc($criticite);
>
> if ( $Ticket->HasUnresolvedDependencies ) {
> $criticite = "<i>$criticite<i>"
> }
>
> if ($color) {
> $criticite = "<font color=$color>$criticite</font>"
> }
>
> return \"<u>$criticite</u>";
> }
>
> $COLUMN_MAP->{Criticite}->{value} = \&criticiteInColor;
>
> help ?
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: [email protected]
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
pgpImUo5YS5rE.pgp
Description: PGP signature
_______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [email protected] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
