X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FGraph%2FTickets.pm;h=cd1254eb6aabcca6a2ce6f919e484571fa1de5ab;hp=6fc5310d0072e4a562015ef69e59fa31706657a2;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=ae14e320388fa5e7f400bff1c251ef885b7952e6 diff --git a/rt/lib/RT/Graph/Tickets.pm b/rt/lib/RT/Graph/Tickets.pm index 6fc5310d0..cd1254eb6 100644 --- a/rt/lib/RT/Graph/Tickets.pm +++ b/rt/lib/RT/Graph/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -104,16 +104,19 @@ sub gv_escape($) { return $value; } +sub loc { return HTML::Mason::Commands::loc(@_) }; + our (%fill_cache, @available_colors) = (); our %property_cb = ( - Queue => sub { return $_[0]->QueueObj->Name || $_[0]->Queue }, - CF => sub { + Queue => sub { return $_[0]->QueueObj->Name || $_[0]->Queue }, + Status => sub { return loc($_[0]->Status) }, + CF => sub { my $values = $_[0]->CustomFieldValues( $_[1] ); return join ', ', map $_->Content, @{ $values->ItemsArrayRef }; }, ); -foreach my $field (qw(Subject Status TimeLeft TimeWorked TimeEstimated)) { +foreach my $field (qw(Subject TimeLeft TimeWorked TimeEstimated)) { $property_cb{ $field } = sub { return $_[0]->$field }, } foreach my $field (qw(Creator LastUpdatedBy Owner)) { @@ -163,7 +166,8 @@ sub TicketProperties { next if $seen{ lc $cf->Name }++; next if $cf->Type eq 'Image'; if ( $first ) { - push @res, 'CustomFields', []; + push @res, 'Custom Fields', # loc + []; $first = 0; } push @{ $res[-1] }, 'CF.{'. $cf->Name .'}'; @@ -203,7 +207,8 @@ sub _PropertiesToFields { $RT::Logger->error("Couldn't find property handler for '$key' and '@subkeys' subkeys"); next; } - push @fields, ($subkeys[0] || $key) .': '. $property_cb{ $key }->( $args{'Ticket'}, @subkeys ); + my $label = $key eq 'CF' ? $subkeys[0] : loc($key); + push @fields, $label .': '. $property_cb{ $key }->( $args{'Ticket'}, @subkeys ); } return @fields;