2 % my( $cust_main ) = @_;
4 % my $conf = new FS::Conf;
5 % my $num = $conf->config('cust_main-max_tickets') || 10;
8 % unless ( $conf->config('ticket_system-custom_priority_field') ) {
11 % @{ FS::TicketSystem->customer_tickets($cust_main->custnum, $num) };
15 % foreach my $priority (
16 % $conf->config('ticket_system-custom_priority_field-values'), ''
18 % last if scalar(@tickets) >= $num;
20 % @{ FS::TicketSystem->customer_tickets( $cust_main->custnum,
21 % $num - scalar(@tickets),
32 Highest priority tickets
33 (<A HREF="<% FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>)
34 (<A HREF="<% FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>)
36 <% include("/elements/table-grid.html") %>
37 % my $bgcolor1 = '#eeeeee';
38 % my $bgcolor2 = '#ffffff';
44 <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
45 <TH CLASS="grid" BGCOLOR="#cccccc">Subject</TH>
46 <TH CLASS="grid" BGCOLOR="#cccccc">Priority</TH>
47 <TH CLASS="grid" BGCOLOR="#cccccc">Queue</TH>
48 <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH>
50 % foreach my $ticket ( @tickets ) {
51 % my $href = FS::TicketSystem->href_ticket($ticket->{id});
52 % if ( $bgcolor eq $bgcolor1 ) {
53 % $bgcolor = $bgcolor2;
55 % $bgcolor = $bgcolor1;
62 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF=<%$href%>><% $ticket->{id} %></A></TD>
64 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF=<%$href%>><% $ticket->{subject} %></A></TD>
66 <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $ticket->{content} || $ticket->{priority} %></TD>
68 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $ticket->{name} %></TD>
70 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $ticket->{status} %></TD>