Ticket List Colors

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


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” );
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

Thanks Jeff, I also thought of this. But we only
use priorities 0-9, so I was too lazy to fix this.


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

I do consider this interesting (not a wob), but wouldn’t it be
easier to make a formula space the (any number of) colors equally
along the (range of) priorites along the lines of

you’ll have t6o find out about these:

$m= ;
$n= ;
$p= ;

and you use this formula:

$colorindex=int($p/(($m+1)/$n)) }

Just an Idea… Stucki

Christoph von Stuckrad * * |nickname |stucki@math.fu-berlin.de
Freie Universitaet Berlin |/_*|‘stucki’ |Tel(days):+49 30 838-75 459|
Fachbereich Mathematik, EDV|\ |if online|Tel(else):+49 30 77 39 6600|
Arnimallee 2-6/14195 Berlin
* |on IRCnet|Fax(alle):+49 30 838-75454/