1 % if ( $conf->exists('dashboard-toplist') ) {
3 <& /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 <& /elements/mcp_lint.html, 'cust_main'=>$cust_main &>
29 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
31 <A HREF="<% FS::TicketSystem->href_new_ticket($cust_main) %>"><% mt('(new ticket)') |h %></A>
35 % foreach my $priority ( @custom_priorities, '' ) {
37 % FS::TicketSystem->num_customer_tickets($custnum,$priority);
39 % $ahref= '<A HREF="'.
40 % FS::TicketSystem->href_customer_tickets($custnum,$priority).
44 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
53 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
54 <% mt("Unknown customer number [_1]", $custnum) |h %>
60 % } elsif ( $line =~ /^\-\-+$/ ) { #divider
63 <TH CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 4 %>"></TH>
68 % } elsif ( $line =~ /^\s*$/ ) {
71 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 4 %>" BGCOLOR="<% $bgcolor %>"> </TD>
74 % } elsif ( $line =~ /^\S/ ) { #label line
77 <TH CLASS="grid" BGCOLOR="#cccccc"><% $line %></TH>
78 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Lint') |h %></TH>
79 <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
80 % foreach my $priority ( @custom_priorities, '' ) {
81 <TH CLASS="grid" BGCOLOR="#cccccc">
82 <% $priority || '<i>(none)</i>'%>
87 % } else { #regular line
90 <TD CLASS="grid" COLSPAN="<% scalar(@custom_priorities) + 4 %>" BGCOLOR="<% $bgcolor %>"><% $line %></TD>
104 my $conf = new FS::Conf;
106 #false laziness w/httemplate/search/cust_main.cgi... care if
107 # custom_priority_field becomes anything but a local hack...
108 my @custom_priorities = ();
109 if ( $conf->config('ticket_system-custom_priority_field')
110 && @{[ $conf->config('ticket_system-custom_priority_field-values') ]} ) {
112 $conf->config('ticket_system-custom_priority_field-values');