[rt-users] Ticket List Colors

Jeff Hoover jeff.hoover at infotechfl.com
Thu Oct 31 11:18:43 EST 2002


I saw an email in the archive that said to do the following to 
Search/Listing.html to get a color coded ticket list:

41a42,51
 > my @todo_colors = ( "#dadada", "#dad0d0",
 >  "#dacaca", "#dac0c0",
 >  "#dababa", "#dab0b0",
 >  "#daaaaa", "#da9090",
 >  "#da8a8a", "#da7070" );
 > my @done_colors = ( "#dadada", "#d0dad0",
 >  "#cadaca", "#c0dac0",
 >  "#badaba", "#b0dab0",
 >  "#aadaaa", "#90da90",
 >  "#8ada8a", "#70da70" );
49a60,66
 >  }
 >  my $status = eval("\$Ticket->Status");
 >  my $prio = eval("\$Ticket->Priority");
 >  if ($status eq "new" || $status eq "open") {
 >     $bgcolor = $todo_colors[$prio];
 >  } else {
 >     $bgcolor = $done_colors[$prio];

This works well if you are using 1 digit priorities.  If you use 0-99, then 
you could change the my $prio line to:

my $prio = substr(sprintf("%02d",eval("\$Ticket->Priority")),0,1);

Anything from 0-9 = 0, 10-19 = 1, 20-29 = 2, etc. for the colors 
array.  Just thought I would share.  Sorry if you consider this a wob.

-- Jeff




More information about the rt-users mailing list