% % 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, % ) % }; % } % % } % % Tickets
(View <% join('/', FS::TicketSystem->statuses ) %> tickets for this customer) (View resolved tickets for this customer)
(Create new ticket for this customer) <% include("/elements/table-grid.html") %> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; % my $bgcolor = ''; % # Subject Priority Queue Status % foreach my $ticket ( @tickets ) { % my $href = FS::TicketSystem->href_ticket($ticket->{id}); % if ( $bgcolor eq $bgcolor1 ) { % $bgcolor = $bgcolor2; % } else { % $bgcolor = $bgcolor1; % } ><% $ticket->{id} %> ><% $ticket->{subject} %> <% $ticket->{status} %> <% $ticket->{queue} %> <% $ticket->{owner} %> <% $ticket->{content} ? $ticket->{content}.' ('.$ticket->{priority}.')' : $ticket->{priority} %> % } <%init> my( $cust_main ) = @_; my( @tickets ) = $cust_main->tickets; my $open_link = FS::TicketSystem->href_customer_tickets($cust_main->custnum); my $openlabel = join('/', FS::TicketSystem->statuses ); my $res_link = FS::TicketSystem->href_customer_tickets( $cust_main->custnum, { 'statuses' => [ 'resolved' ] } ); my $new_link = FS::TicketSystem->href_new_ticket( $cust_main, join(', ', $cust_main->invoicing_list_emailonly ) );