diff options
Diffstat (limited to 'httemplate/view/cust_main/tickets.html')
-rw-r--r-- | httemplate/view/cust_main/tickets.html | 110 |
1 files changed, 67 insertions, 43 deletions
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index 72d68152a..84cc90299 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -1,54 +1,78 @@ -<% - my( $cust_main ) = @_; +% +% my( $cust_main ) = @_; +% +% my $conf = new FS::Conf; +% my $num = $conf->config('cust_main-max_tickets') || 10; +% +% my @tickets = (); +% unless ( $conf->config('ticket_system-custom_priority_field') ) { +% +% @tickets = +% @{ FS::TicketSystem->customer_tickets($cust_main->custnum, $num) }; +% +% } else { +% +% foreach my $priority ( +% $conf->config('ticket_system-custom_priority_field-values'), '' +% ) { +% last if scalar(@tickets) >= $num; +% push @tickets, +% @{ FS::TicketSystem->customer_tickets( $cust_main->custnum, +% $num - scalar(@tickets), +% $priority, +% ) +% }; +% } +% +% } +% +% - my $conf = new FS::Conf; - my $num = 10; +<A NAME="tickets"><FONT SIZE="+2">Tickets</FONT></A> +<BR> - my @tickets = (); - unless ( $conf->config('ticket_system-custom_priority_field') ) { +(<A HREF="<% FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>) +(<A HREF="<% FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>) - @tickets = - @{ FS::TicketSystem->customer_tickets($cust_main->custnum, $num) }; +<% include("/elements/table-grid.html") %> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; +% - } else { - foreach my $priority ( - $conf->config('ticket_system-custom_priority_field-values'), '' - ) { - last if scalar(@tickets) >= $num; - push @tickets, - @{ FS::TicketSystem->customer_tickets( $cust_main->custnum, - $num - scalar(@tickets), - $priority, - ) - }; - } - - } - -%> - -Highest priority tickets -(<A HREF="<%= FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>) -(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>) -<%= table() %> <TR> - <TH>#</TH> - <TH>Subject</TH> - <TH>Priority</TH> - <TH>Queue</TH> - <TH>Status</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">#</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Subject</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Priority</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Queue</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH> </TR> -<% foreach my $ticket ( @tickets ) { - my $href = FS::TicketSystem->href_ticket($ticket->{id}); -%> +% foreach my $ticket ( @tickets ) { +% my $href = FS::TicketSystem->href_ticket($ticket->{id}); +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% + + <TR> - <TD><A HREF=<%=$href%>><%= $ticket->{id} %></A></TD> - <TD><A HREF=<%=$href%>><%= $ticket->{subject} %></A></TD> - <TD ALIGN="right"><%= $ticket->{content} || $ticket->{priority} %></TD> - <TD><%= $ticket->{name} %></TD> - <TD><%= $ticket->{status} %></TD> + + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF=<%$href%>><% $ticket->{id} %></A></TD> + + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF=<%$href%>><% $ticket->{subject} %></A></TD> + + <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $ticket->{content} || $ticket->{priority} %></TD> + + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $ticket->{name} %></TD> + + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $ticket->{status} %></TD> + </TR> -<% } %> +% } + + </TABLE> |