Open Tickets
<%= my $col1 = "ffffff"; my $col2 = "dddddd"; my $col = $col1; my $can_set_priority = grep { exists($_->{'_selfservice_priority'}) } @tickets; if ( $can_set_priority ) { use sort 'stable'; @tickets = sort { ($b->{'_selfservice_priority'} || 0) <=> ($a->{'_selfservice_priority'} || 0) } @tickets; $OUT .= qq!! . qq!! . qq!!; } $date_format ||= '%Y-%m-%d'; my $date_formatter = sub { my $time = Date::Parse::str2time($_[0], 'GMT'); # RT internal dates are GMT # exclude times within 24 hours of zero ($time > 86400) ? Date::Format::time2str($date_format, $time) : '' }; my @titles = ('#', qw(Subject Queue Status Created Due)); push @titles, 'Estimated
Minutes'; push @titles, 'Priority'; $OUT .= join("\n", map { "$_ | " } @titles) . '
--- | ---
'; foreach my $ticket ( @tickets ) { my $id = $ticket->{'id'}; my $td = qq! | !; my $space = $td.' '; my $link = qq!!; $OUT .= '
' . $td. $link . $id . '
'. $space . $td. $link . $ticket->{'subject'} . ''. $space . $td. $ticket->{'queue'} . ''. $space . $td. $ticket->{'status'} . ''. $space . $td. $date_formatter->($ticket->{'created'}) . ''. $space . $td. $date_formatter->($ticket->{'due'}) . ''. $space . qq!!. ($ticket->{'timeestimated'} || '') . ''. $space . qq! | !; if ( $can_set_priority ) { $OUT .= '' . ''; if ( exists($ticket_error{$id}) ) { # display error message compactly $OUT .= ' | *'; } } else { $OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . ''; } $OUT .= ''; $col = $col eq $col1 ? $col2 : $col1; } #foreach my $ticket if ( $can_set_priority ) { $OUT .= '
'; } %>