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 %>" ALIGN="right">
27 <FONT SIZE="-1"><A HREF="<% FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">(new ticket)</A></FONT>
30 % foreach my $priority ( @custom_priorities, '' ) {
32 % FS::TicketSystem->num_customer_tickets($custnum,$priority);
34 % $ahref= '<A HREF="'.
35 % FS::TicketSystem->href_customer_tickets($custnum,$priority).
39 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
48 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
49 Unknown customer number <% $custnum %>
55 % } elsif ( $line =~ /^\-\-+$/ ) { #divider
58 <TH CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 3 %>"></TH>
63 % } elsif ( $line =~ /^\s*$/ ) {
66 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 3 %>" BGCOLOR="<% $bgcolor %>"> </TD>
69 % } elsif ( $line =~ /^\S/ ) { #label line
72 <TH CLASS="grid" BGCOLOR="#cccccc"><% $line %></TH>
73 <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
74 % foreach my $priority ( @custom_priorities, '' ) {
75 <TH CLASS="grid" BGCOLOR="#cccccc">
76 <% $priority || '<i>(none)</i>'%>
81 % } else { #regular line
84 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 3 %>" BGCOLOR="<% $bgcolor %>"><% $line %></TD>
98 my $conf = new FS::Conf;
100 #false laziness w/httemplate/search/cust_main.cgi... care if
101 # custom_priority_field becomes anything but a local hack...
102 my @custom_priorities = ();
103 if ( $conf->config('ticket_system-custom_priority_field')
104 && @{[ $conf->config('ticket_system-custom_priority_field-values') ]} ) {
106 $conf->config('ticket_system-custom_priority_field-values');