[rt-users] Customize ColumnMaps with CustomFieldValues color

mailinglists mailinglists at e-tera.com
Thu Oct 1 10:27:49 EDT 2009


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

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 ?



More information about the rt-users mailing list