[freeside-commits] branch FREESIDE_3_BRANCH updated. 57e01509b9c722840218ac65de62d33ab46ea006
Ivan
ivan at 420.am
Sun Aug 17 16:26:49 PDT 2014
The branch, FREESIDE_3_BRANCH has been updated
via 57e01509b9c722840218ac65de62d33ab46ea006 (commit)
from 788275e860cfa8126fd6919c11fce8a46b1062a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 57e01509b9c722840218ac65de62d33ab46ea006
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sun Aug 17 16:26:46 2014 -0700
user pref for # of customers on dashboard, RT#29794
diff --git a/httemplate/index.html b/httemplate/index.html
index bc51e6a..29a3d73 100644
--- a/httemplate/index.html
+++ b/httemplate/index.html
@@ -11,43 +11,48 @@
%
<& /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_user = ?
-% ORDER BY history_date desc" # LIMIT 10
-% ) or die dbh->errstr;
+% warn time.": fetching recently changed customers\n" if $debug;
%
-% $sth->execute( getotaker() ) or die $sth->errstr;
+% 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_user = ?
+% ORDER BY history_date desc LIMIT 1000" # LIMIT 10
+% ) or die dbh->errstr;
%
-% my %saw = ();
-% my @custnums = grep { !$saw{$_}++ } map $_->[0], @{ $sth->fetchall_arrayref };
+% $sth->execute( getotaker() ) 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;
@@ -55,10 +60,11 @@
% $bgcolor = $bgcolor1;
% }
%
-% }
+% }
- </TABLE>
+ </TABLE>
-% }
+% }
+% }
<& /elements/footer.html &>
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index 85e2a34..53cf7ef 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -53,7 +53,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 ab5baab..56cf550 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -78,7 +78,7 @@ Interface
<TR>
<TH ALIGN="right">Hide package changes: </TH>
- <TD>
+ <TD COLSPAN=2>
<& /elements/select.html,
field => 'hide_package_changes',
options => [ '', 'location', 'all' ],
@@ -158,6 +158,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>
-----------------------------------------------------------------------
Summary of changes:
httemplate/index.html | 62 ++++++++++++++++++++-----------------
httemplate/pref/pref-process.html | 2 +-
httemplate/pref/pref.html | 9 +++++-
3 files changed, 43 insertions(+), 30 deletions(-)
More information about the freeside-commits
mailing list