1 <%init>my $debug = $cgi->param('debug');</%init>
2 % warn time.": header.html\n" if $debug;
4 <& /elements/header.html, mt('Billing Main') &>
6 % warn time.": dashboard-install_welcome.html\n" if $debug;
8 <& /elements/dashboard-install_welcome.html &>
10 % warn time.": dashboard-toplist.html\n" if $debug;
12 <& /elements/dashboard-toplist.html &>
14 % my $curuser = $FS::CurrentUser::CurrentUser;
15 % my $numcust = $curuser->option('dashboard_customers');
16 % $numcust ||= 10 unless $numcust =~ /^\s*0+\s*$/;
19 % warn time.": fetching recently changed customers\n" if $debug;
21 % my $sth = dbh->prepare(
22 % #"SELECT DISTINCT custnum FROM h_cust_main JOIN cust_main USING ( custnum )
23 % "SELECT custnum FROM h_cust_main JOIN cust_main USING ( custnum )
24 % WHERE ( history_action = 'insert' OR history_action = 'replace_new' )
25 % AND ( history_usernum = ? OR history_user = ? )
26 % AND ". $curuser->agentnums_sql( table=>'cust_main' ).
27 % " ORDER BY history_date desc LIMIT 1000" # LIMIT 10
28 % ) or die dbh->errstr;
31 % $sth->execute( $curuser->usernum, $curuser->username ) or die $sth->errstr;
34 % my @custnums = grep { !$saw{$_}++ } map $_->[0], @{ $sth->fetchall_arrayref };
36 % @custnums = splice(@custnums, 0, $numcust);
39 % warn time.": displaying recently changed customers\n" if $debug;
41 <& /elements/table-grid.html &>
43 % my $bgcolor1 = '#eeeeee';
44 % my $bgcolor2 = '#ffffff';
45 % my $bgcolor = $bgcolor2;
48 <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=1><% mt('Customers I recently added or modified') |h %></TH>
51 % foreach my $custnum ( @custnums ) {
52 % my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
53 % next unless $cust_main;
56 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->display_custnum %>: <% $cust_main->name |h %></A></TD>
59 % if ( $bgcolor eq $bgcolor1 ) {
60 % $bgcolor = $bgcolor2;
62 % $bgcolor = $bgcolor1;
72 <& /elements/footer.html &>