1 <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT>
2 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">
3 <TR><TH BGCOLOR="#ff6666" COLSPAN=16>Open Tickets</TH></TR>
6 my $col1 = $stripe1_bgcolor || "#ffffff";
7 my $col2 = $stripe2_bgcolor || "#dddddd";
10 my $can_set_priority =
11 grep { exists($_->{'_selfservice_priority'}) } @tickets;
12 if ( $can_set_priority ) {
14 $OUT .= qq!<FORM ACTION="$selfurl" METHOD="POST">! .
15 qq!<INPUT TYPE="hidden" NAME="session" VALUE="$session_id">! .
16 qq!<INPUT TYPE="hidden" NAME="action" VALUE="ticket_priority">!;
18 $date_format ||= '%Y-%m-%d';
19 my $date_formatter = sub {
20 my $time = Date::Parse::str2time($_[0], 'GMT'); # RT internal dates are GMT
21 # exclude times within 24 hours of zero
22 ($time > 86400) ? Date::Format::time2str($date_format, $time) : ''
25 my @titles = ('#', qw(Subject Queue Status Created Due));
26 push @titles, 'Estimated<BR>Hours';
27 push @titles, 'Priority';
29 $box_bgcolor ||= '#c0c0c0';
30 my $th = qq(<TH BGCOLOR="$box_bgcolor");
32 $OUT .= join("\n", map { "$th VALIGN=\"top\">$_</TH>$th> </TH>" } @titles)
35 foreach my $ticket ( @tickets ) {
36 my $id = $ticket->{'id'};
37 my $td = qq!<TD BGCOLOR="$col">!;
38 my $space = $td.' </TD>';
39 my $link = qq!<A HREF="${url}tktview;ticket_id=$id">!;
41 $td. $link . $id . '</A></TD>'. $space .
42 $td. $link . $ticket->{'subject'} . '</A></TD>'. $space .
43 $td. $ticket->{'queue'} . '</TD>'. $space .
44 $td. $ticket->{'status'} . '</TD>'. $space .
45 $td. $date_formatter->($ticket->{'created'}) . '</TD>'. $space .
46 $td. $date_formatter->($ticket->{'due'}) . '</TD>'. $space .
47 qq!<TD BGCOLOR="$col" ALIGN="right">!.
48 ($ticket->{'timeestimated'} ?
49 sprintf('%.1f', $ticket->{'timeestimated'} / 60.0) # .1f?
52 qq!<TD BGCOLOR="$col" ALIGN="right">!;
53 if ( $can_set_priority ) {
54 $OUT .= '<INPUT TYPE="hidden" NAME="ticket'.$id.'" VALUE="1">' .
55 '<INPUT TYPE="text" SIZE=4 NAME="priority'.$id.'"' .
56 'VALUE="'.$ticket->{'_selfservice_priority'}.'"></TD>';
57 if ( exists($ticket_error{$id}) ) {
58 # display error message compactly
59 $OUT .= $td. '<FONT COLOR="#ff0000" onmouseover="'.
60 "return overlib('".$ticket_error{$id}."', AUTOSTATUS, WRAP);" .
61 '" onmouseout="nd();">*</FONT></TD>';
67 $OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . '</TD>'.
71 $col = $col eq $col1 ? $col2 : $col1;
73 if ( $can_set_priority ) {
74 $OUT .= '<TR><TD COLSPAN=16 ALIGN="right">
75 <INPUT TYPE="submit" VALUE="Save changes"></TD></TR></FORM>';