From 1ec49b28c30c84962670d80d1c143e65b5b9370a Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 15 Dec 2006 12:43:44 +0000 Subject: add a quick start at a "dashboard" customer list, mostly for internal use for starters --- httemplate/elements/dashboard-toplist.html | 98 ++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 httemplate/elements/dashboard-toplist.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/dashboard-toplist.html b/httemplate/elements/dashboard-toplist.html new file mode 100644 index 000000000..6276f9fd3 --- /dev/null +++ b/httemplate/elements/dashboard-toplist.html @@ -0,0 +1,98 @@ +% 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 %> + +% 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*$/ ) { + + +   + + +% } else { #label line + + + <% $line %> +% foreach my $priority ( @custom_priorities, '' ) { + + <% $priority || '(none)'%> + +% } + + +% } + +% +% } + + +
+ +% } +<%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'); +} + + -- cgit v1.2.1