A hopefully quick question

I implemented SHowStatusInCOlor from the wiki today
(ShowStatusInColor - Request Tracker Wiki) and it is quite handy
for what we are doing here. Now I would also like to color the queue names
in a similar fashion. I used the first implementation shown on the Wiki page
(instead of the CSS version) and then thought, OK easy enough I can just
change this around a bit and do the same thing on the “Queue” column.

As everyone is well aware I consider myself a newb, and definitey NOT a perl
hacker or even close to resembling one, though I do have a copy of the Perl
books from O’Reilly, so maybe someday :slight_smile:

Anyway, after my success with the status coloring, I did this and it doesn’t
work :confused: Can anyone tell me what I did wrong :slight_smile: I have a sneaky suspicion
that it involves the whole $Ticket->Queue bit, and I was admittedly just
guessing that $Ticket->Queue would be proper.

sub queueInColor {
my $Ticket = shift;
my $queue = $Ticket->Queue;
my $qcolor = undef;

if ($queue eq ‘queue1’) {
$qcolor = “#660099”;
} elsif ($queue eq ’ queue2’) {
$qcolor = “#000090”;
} elsif ($queue eq ’ queue3’) {
$qcolor = “#999999”;
} elsif ($queue eq ’ queue4’) {
$qcolor = “#FF6600”;
} elsif ($queue eq ’ queue5’) {
$qcolor = “#009000”;
} elsif ($queue eq ’ queue6’) {
$qcolor = “#900000”;
} elsif ($queue eq ’ queue7’) {
$qcolor = “#AA8000”;
} elsif ($queue eq ’ queue8’) {
$qcolor = “#000000”;
} elsif ($queue eq ’ queue9’) {
$qcolor = “#996633”;
}

$queue = loc($queue);

if ($qcolor) {
$queue = “$queue”
}

return "$queue";

}

Queue names have been changed to protect the innocent :wink:
As always, any insight is appreciated.

Thanks in advance,

Greg Evans
Hood Canal Communications
(360) 898-2481 ext.212

Greg,

Try this:

My $queue = $Ticket->QueueObj->Name;

Cheers,

Ton-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Greg
Evans
Sent: Wednesday, April 02, 2008 2:03 AM
To: ‘RT Users’
Subject: [rt-users] A hopefully quick question…

I implemented SHowStatusInCOlor from the wiki today
(ShowStatusInColor - Request Tracker Wiki) and it is quite
handy for what we are doing here. Now I would also like to color the
queue names in a similar fashion. I used the first implementation shown
on the Wiki page (instead of the CSS version) and then thought, OK easy
enough I can just change this around a bit and do the same thing on the
“Queue” column.

As everyone is well aware I consider myself a newb, and definitey NOT a
perl hacker or even close to resembling one, though I do have a copy of
the Perl books from O’Reilly, so maybe someday :slight_smile:

Anyway, after my success with the status coloring, I did this and it
doesn’t work :confused: Can anyone tell me what I did wrong :slight_smile: I have a sneaky
suspicion that it involves the whole $Ticket->Queue bit, and I was
admittedly just guessing that $Ticket->Queue would be proper.

sub queueInColor {
my $Ticket = shift;
my $queue = $Ticket->Queue;
my $qcolor = undef;

if ($queue eq ‘queue1’) {
$qcolor = “#660099”;
} elsif ($queue eq ’ queue2’) {
$qcolor = “#000090”;
} elsif ($queue eq ’ queue3’) {
$qcolor = “#999999”;
} elsif ($queue eq ’ queue4’) {
$qcolor = “#FF6600”;
} elsif ($queue eq ’ queue5’) {
$qcolor = “#009000”;
} elsif ($queue eq ’ queue6’) {
$qcolor = “#900000”;
} elsif ($queue eq ’ queue7’) {
$qcolor = “#AA8000”;
} elsif ($queue eq ’ queue8’) {
$qcolor = “#000000”;
} elsif ($queue eq ’ queue9’) {
$qcolor = “#996633”;
}

$queue = loc($queue);

if ($qcolor) {
$queue = “$queue”
}

return "$queue";

}

Queue names have been changed to protect the innocent :wink: As always, any
insight is appreciated.

Thanks in advance,

Greg Evans
Hood Canal Communications
(360) 898-2481 ext.212

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com Commercial support:
sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com