#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
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)) {
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 .'}';
$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;
}
$args{'Seen'} ||= {};
- return $args{'Graph'} if $args{'Seen'}{ $args{'Ticket'}->id }++;
-
- $self->AddTicket( %args );
+ if ( $args{'Seen'}{ $args{'Ticket'}->id } && $args{'Seen'}{ $args{'Ticket'}->id } <= $args{'CurrentDepth'} ) {
+ return $args{'Graph'};
+ } elsif ( ! defined $args{'Seen'}{ $args{'Ticket'}->id } ) {
+ $self->AddTicket( %args );
+ }
+ $args{'Seen'}{ $args{'Ticket'}->id } = $args{'CurrentDepth'};
return $args{'Graph'} if $args{'MaxDepth'} && $args{'CurrentDepth'} >= $args{'MaxDepth'};