1 % if ( $conf->exists('dashboard-toplist') ) {
3 <% include('/elements/table-grid.html') %>
5 % my $bgcolor1 = '#eeeeee';
6 % my $bgcolor2 = '#ffffff';
7 % my $bgcolor = $bgcolor2;
9 % foreach my $line ( $conf->config('dashboard-toplist') ) {
11 % if ( $bgcolor eq $bgcolor1 ) {
12 % $bgcolor = $bgcolor2;
14 % $bgcolor = $bgcolor1;
17 % if ( $line =~ /^\s*cust_main:\s*(\d+)\s*$/ ) { #customer line
19 % my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
23 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
24 <A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->name %></A>
26 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
27 <% include('/elements/mcp_lint.html', 'cust_main'=>$cust_main) %>
29 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
30 <FONT SIZE="-1"><A HREF="<% FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">(new ticket)</A></FONT>
33 % foreach my $priority ( @custom_priorities, '' ) {
35 % FS::TicketSystem->num_customer_tickets($custnum,$priority);
37 % $ahref= '<A HREF="'.
38 % FS::TicketSystem->href_customer_tickets($custnum,$priority).
42 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
51 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
52 Unknown customer number <% $custnum %>
58 % } elsif ( $line =~ /^\-\-+$/ ) { #divider
61 <TH CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 4 %>"></TH>
66 % } elsif ( $line =~ /^\s*$/ ) {
69 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 4 %>" BGCOLOR="<% $bgcolor %>"> </TD>
72 % } elsif ( $line =~ /^\S/ ) { #label line
75 <TH CLASS="grid" BGCOLOR="#cccccc"><% $line %></TH>
76 <TH CLASS="grid" BGCOLOR="#cccccc">Lint</TH>
77 <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
78 % foreach my $priority ( @custom_priorities, '' ) {
79 <TH CLASS="grid" BGCOLOR="#cccccc">
80 <% $priority || '<i>(none)</i>'%>
85 % } else { #regular line
88 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 4 %>" BGCOLOR="<% $bgcolor %>"><% $line %></TD>
102 my $conf = new FS::Conf;
104 #false laziness w/httemplate/search/cust_main.cgi... care if
105 # custom_priority_field becomes anything but a local hack...
106 my @custom_priorities = ();
107 if ( $conf->config('ticket_system-custom_priority_field')
108 && @{[ $conf->config('ticket_system-custom_priority_field-values') ]} ) {
110 $conf->config('ticket_system-custom_priority_field-values');