[freeside-commits] branch master updated. 2f55a20e4ca789d73cda7463f5edfce0049ee18d
Ivan
ivan at 420.am
Sun Aug 17 16:26:43 PDT 2014
The branch, master has been updated
via 2f55a20e4ca789d73cda7463f5edfce0049ee18d (commit)
from a618055d3a8cfc55a449847b433dcdc85df92bcd (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 2f55a20e4ca789d73cda7463f5edfce0049ee18d
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sun Aug 17 16:26:41 2014 -0700
user pref for # of customers on dashboard, RT#29794
diff --git a/httemplate/index.html b/httemplate/index.html
index 342d88c..ea8d757 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 6d4f89a..887e58b 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 eaa7d32..5455e42 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>
-----------------------------------------------------------------------
Summary of changes:
httemplate/index.html | 63 ++++++++++++++++++++-----------------
httemplate/pref/pref-process.html | 2 +-
httemplate/pref/pref.html | 9 +++++-
3 files changed, 43 insertions(+), 31 deletions(-)
More information about the freeside-commits
mailing list