diff options
-rw-r--r-- | httemplate/index.html | 63 | ||||
-rw-r--r-- | httemplate/pref/pref-process.html | 2 | ||||
-rw-r--r-- | httemplate/pref/pref.html | 9 |
3 files changed, 43 insertions, 31 deletions
diff --git a/httemplate/index.html b/httemplate/index.html index 342d88c77..ea8d7578e 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -11,45 +11,49 @@ % <& /elements/dashboard-toplist.html &> -% warn time.": fetching recently changed customers\n" if $debug; +% my $curuser = $FS::CurrentUser::CurrentUser; +% my $numcust = $curuser->option('dashboard_customers'); +% $numcust ||= 10 unless $numcust =~ /^\s*0+\s*$/; +% if ( $numcust ) { % -% my $sth = dbh->prepare( -% #"SELECT DISTINCT custnum FROM h_cust_main JOIN cust_main USING ( custnum ) -% "SELECT custnum FROM h_cust_main JOIN cust_main USING ( custnum ) -% WHERE ( history_action = 'insert' OR history_action = 'replace_new' ) -% AND ( history_usernum = ? OR history_user = ? ) -% ORDER BY history_date desc" # LIMIT 10 -% ) or die dbh->errstr; +% warn time.": fetching recently changed customers\n" if $debug; % -% my $curuser = $FS::CurrentUser::CurrentUser; +% my $sth = dbh->prepare( +% #"SELECT DISTINCT custnum FROM h_cust_main JOIN cust_main USING ( custnum ) +% "SELECT custnum FROM h_cust_main JOIN cust_main USING ( custnum ) +% WHERE ( history_action = 'insert' OR history_action = 'replace_new' ) +% AND ( history_usernum = ? OR history_user = ? ) +% ORDER BY history_date desc LIMIT 1000" # LIMIT 10 +% ) or die dbh->errstr; % -% $sth->execute( $curuser->usernum, $curuser->username ) or die $sth->errstr; % -% my %saw = (); -% my @custnums = grep { !$saw{$_}++ } map $_->[0], @{ $sth->fetchall_arrayref }; +% $sth->execute( $curuser->usernum, $curuser->username ) or die $sth->errstr; % -% @custnums = splice(@custnums, 0, 10); +% my %saw = (); +% my @custnums = grep { !$saw{$_}++ } map $_->[0], @{ $sth->fetchall_arrayref }; % -% if ( @custnums ) { -% warn time.": displaying recently changed customers\n" if $debug; +% @custnums = splice(@custnums, 0, $numcust); +% +% if ( @custnums ) { +% warn time.": displaying recently changed customers\n" if $debug; - <& /elements/table-grid.html &> + <& /elements/table-grid.html &> -% my $bgcolor1 = '#eeeeee'; +% my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; % my $bgcolor = $bgcolor2; - <TR> - <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=1><% mt('Customers I recently added or modified') |h %></TH> - </TR> + <TR> + <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=1><% mt('Customers I recently added or modified') |h %></TH> + </TR> -% foreach my $custnum ( @custnums ) { -% my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); -% next unless $cust_main; +% foreach my $custnum ( @custnums ) { +% my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); +% next unless $cust_main; - <TR> - <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->display_custnum %>: <% $cust_main->name |h %></A></TD> - </TR> + <TR> + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->display_custnum %>: <% $cust_main->name |h %></A></TD> + </TR> % if ( $bgcolor eq $bgcolor1 ) { % $bgcolor = $bgcolor2; @@ -57,10 +61,11 @@ % $bgcolor = $bgcolor1; % } % -% } +% } - </TABLE> + </TABLE> -% } +% } +% } <& /elements/footer.html &> diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index 6d4f89a77..887e58bde 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -54,7 +54,7 @@ unless ( $error ) { # if ($access_user) { spreadsheet_format mobile_menu enable_fuzzy_on_exact disable_html_editor disable_enter_submit_onetimecharge - enable_mask_clipboard_hack + enable_mask_clipboard_hack dashboard_customers email_address snom-ip snom-username snom-password vonage-fromnumber vonage-username vonage-password diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index eaa7d3281..5455e428e 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -80,7 +80,7 @@ Interface <TR> <TH ALIGN="right">Hide package changes: </TH> - <TD> + <TD COLSPAN=2> <& /elements/select.html, field => 'hide_package_changes', options => [ '', 'location', 'all' ], @@ -160,6 +160,13 @@ Interface </TD> </TR> + <TR> + <TH ALIGN="right">How many recently-modified customers displayed on dashboard</TH> + <TD ALIGN="left" COLSPAN=2> + <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD> + </TD> + </TR> + </TABLE> <BR> |