[rt-users] Customize ColumnMaps with CustomFieldValues color
Kevin Falcone
falcone at bestpractical.com
Thu Oct 1 11:35:07 EDT 2009
On Thu, Oct 01, 2009 at 04:27:49PM +0200, mailinglists wrote:
> 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
CustomFields are handled by the entry in ColumnMap named CustomField
You'll have to create your own version of that and use the overlay to
jam it in (or use a callback in ShowCustomField to change the color)
You can't just use the name of the custom field in ColumnMap
-kevin
> 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 ?
> _______________________________________________
> 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20091001/5bd42670/attachment.sig>
More information about the rt-users
mailing list