[rt-users] colorize status

Alex Young alexyoung at scoutsolutions.co.uk
Tue Feb 10 20:38:59 EST 2009


I've been looking at this today and I have it working, but I think the
code needs a bit of a cleanup.

Looking in the files the code that shows the info at the top of the
ticket is in /opt/rt3/share/html/Ticket/Elements/ShowUpdateStatus so I
sourced much of the code from there.

I changed your updated statusInColor code form the WIKI.

# Show status in colour.
sub statusInColor {
	my $Ticket = shift;
	my $status = $Ticket->Status;
	my $css = "status" . lc $status;
	my $cssreply = "status" . lc "reply";
	my $LastUpdater = $Ticket->LastUpdatedByObj->EmailAddress;
	my $TicketRequestors =
$Ticket->Requestors->MemberEmailAddressesAsString;
	my $TicketCC = $Ticket->Cc->MemberEmailAddressesAsString;
	my $CurrentUser = $session{'CurrentUser'}->EmailAddress;

# Added $CurentUser ne $LastUpdater to prevent showing New Reply tag
when the last updater is the current user.
	if (($CurrentUser ne $LastUpdater) && ($TicketRequestors =~
$LastUpdater) || ($TicketCC =~ $LastUpdater))
	{
		my $txn = $Ticket->SeenUpTo or return \"<div
class=\"$css\">$status</div>";
#        my $TicketLink = RT->Config->Get('WebPath')
."/Ticket/Display.html?id=". $Ticket->id. "#txn-".$txn->id;
# Comment out the line above and uncomment the following line to mark
posts as seen when following link.
		my $TicketLink = RT->Config->Get('WebPath')
."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1".
"#txn-".$txn->id;
		$status = "<div class=\"$css\">$status <a
href=\"$TicketLink\"><span class=\"$cssreply\">New
Reply</span></a></div>";
	}
	else {
		$status = "<div class=\"$css\">$status</div>";
	}

	return \"$status";

}


-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Daniel
Cook
Sent: 06 February 2009 22:33
To: rt-users at lists.bestpractical.com
Subject: [rt-users] colorize status

So I've updated the ShowStatusInColor page on the wiki to reflect how I
have implemented this in 3.8.2  The question that I have is this...

When replys are colorized in my list view, the way things are setup
right now, it is done based on who the last person to modify the ticket
was....  

I have noticed that when I open a ticket that has had a reply there is a
little note at the top of the ticket that sais there are new messages.
This message goes away after I have viewed the message.  

This is how I would like this new reply type flag setup for my list
view.  I would like it to drop the rep flag and the reply color after I
view the new message - without necessarily making any reply or physical
change to the ticket.

Is this easily possible?  Any advise on how to go about it?

Thanks,

Dan

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

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


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



More information about the rt-users mailing list