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 % foreach my $priority ( @custom_priorities, '' ) {
28 % FS::TicketSystem->num_customer_tickets($custnum,$priority);
30 % $ahref= '<A HREF="'.
31 % FS::TicketSystem->href_customer_tickets($custnum,$priority).
35 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
44 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
45 Unknown customer number <% $custnum %>
51 % } elsif ( $line =~ /^\-\-+$/ ) { #divider
54 <TH CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 2 %>"></TH>
59 % } elsif ( $line =~ /^\s*$/ ) {
62 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 2 %>" BGCOLOR="<% $bgcolor %>"> </TD>
65 % } elsif ( $line =~ /^\S/ ) { #label line
68 <TH CLASS="grid" BGCOLOR="#cccccc"><% $line %></TH>
69 % foreach my $priority ( @custom_priorities, '' ) {
70 <TH CLASS="grid" BGCOLOR="#cccccc">
71 <% $priority || '<i>(none)</i>'%>
76 % } else { #regular line
79 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 2 %>" BGCOLOR="<% $bgcolor %>"><% $line %></TD>
93 my $conf = new FS::Conf;
95 #false laziness w/httemplate/search/cust_main.cgi... care if
96 # custom_priority_field becomes anything but a local hack...
97 my @custom_priorities = ();
98 if ( $conf->config('ticket_system-custom_priority_field')
99 && @{[ $conf->config('ticket_system-custom_priority_field-values') ]} ) {
101 $conf->config('ticket_system-custom_priority_field-values');