% if ( $conf->exists('dashboard-toplist') ) {
<% include('/elements/table-grid.html') %>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = $bgcolor2;
% foreach my $line ( $conf->config('dashboard-toplist') ) {
%
% if ( $bgcolor eq $bgcolor1 ) {
% $bgcolor = $bgcolor2;
% } else {
% $bgcolor = $bgcolor1;
% }
% if ( $line =~ /^\s*cust_main:\s*(\d+)\s*$/ ) { #customer line
% my $custnum = $1;
% my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
% if ( $cust_main ) {
<% $cust_main->name %>
|
(new ticket)
|
% foreach my $priority ( @custom_priorities, '' ) {
% my $num =
% FS::TicketSystem->num_customer_tickets($custnum,$priority);
% my $ahref = '';
% $ahref= ''
% if $num;
<% $ahref.$num %>
|
% }
% } else {
Unknown customer number <% $custnum %>
|
% }
%
% } elsif ( $line =~ /^\-\-+$/ ) { #divider
%
|
% next;
%
% } elsif ( $line =~ /^\s*$/ ) {
|
% } elsif ( $line =~ /^\S/ ) { #label line
<% $line %> |
|
% foreach my $priority ( @custom_priorities, '' ) {
<% $priority || '(none)'%>
|
% }
% } else { #regular line
<% $line %> |
% }
%
% }
% }
<%init>
my $conf = new FS::Conf;
#false laziness w/httemplate/search/cust_main.cgi... care if
# custom_priority_field becomes anything but a local hack...
my @custom_priorities = ();
if ( $conf->config('ticket_system-custom_priority_field')
&& @{[ $conf->config('ticket_system-custom_priority_field-values') ]} ) {
@custom_priorities =
$conf->config('ticket_system-custom_priority_field-values');
}
%init>