summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2010-12-14 06:33:29 +0000
committerivan <ivan>2010-12-14 06:33:29 +0000
commit93f811c014058da26e734fc621028741b156c5d7 (patch)
treee9944f30be0830e9216a5420883420662c31e45c /httemplate
parent08967951bf4e26aaf45b45fd1a8724691666ac74 (diff)
show formatted dates on change history, per-user pref for full cust_pkg timestamps, RT#10757
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/pref/pref-process.html1
-rw-r--r--httemplate/pref/pref.html4
-rw-r--r--httemplate/view/cust_main/change_history.html17
-rwxr-xr-xhttemplate/view/cust_main/packages.html4
4 files changed, 23 insertions, 3 deletions
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index a340b7fc9..897be252c 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -53,6 +53,7 @@ unless ( $error ) { # if ($access_user) {
email_address
snom-ip snom-username snom-password
vonage-fromnumber vonage-username vonage-password
+ cust_pkg-display_times
show_pkgnum show_confitem_counts export_getsettings
show_db_profile save_db_profile
height width availHeight availWidth colorDepth
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index ab76c3bdc..c7083e9d0 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -83,6 +83,10 @@ Development
<% ntable("#cccccc",2) %>
<TR>
+ <TH>Show customer package timestamps: </TH>
+ <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
+ </TR>
+ <TR>
<TH>Show internal package numbers: </TH>
<TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
</TR>
diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html
index 53a79f47f..78ff67ca4 100644
--- a/httemplate/view/cust_main/change_history.html
+++ b/httemplate/view/cust_main/change_history.html
@@ -94,6 +94,11 @@
map { my $value = ( $_ =~ /(^pay(info|cvv)|^ss|_password)$/ )
? 'N/A'
: $item->get($_);
+ $value = time2str($cust_pkg_date_format, $value)
+ if $item->table eq 'h_cust_pkg'
+ && $cust_pkg_date_fields{$_}
+ && $value;
+
$value = substr($value, 0, 77).'...' if length($value) > 80;
$value = encode_entities($value);
"<I>$_</I>:<B>$value</B>";
@@ -231,7 +236,7 @@ my %h_table_labelsub = (
#svc_*
# svc_acct
# radius_usergroup
-# acct_snarf? is this even used?
+# acct_snarf? is this even used? it is now, for communigate RPOP
# svc_domain
# domain_record
# registrar
@@ -266,6 +271,16 @@ my $curuser = $FS::CurrentUser::CurrentUser;
die "access deined"
unless $curuser->access_right('View customer history');
+my $cust_pkg_date_format = '%b %o, %Y';
+$cust_pkg_date_format .= '%l:%M:%S%P'
+ if $conf->exists('cust_pkg-display_times')
+ || $curuser->option('cust_pkg-display_times');
+
+my %cust_pkg_date_fields = map { $_=>1 } qw(
+ start_date setup bill last_bill susp adjourn cancel expire contract_end
+ change_date
+);
+
# find out the beginning of this customer history, if possible
my $h_insert = qsearchs({
'table' => 'h_cust_main',
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index ed4ca60c4..ce34158d8 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -156,8 +156,8 @@ my $show_location = $conf->exists('cust_pkg-always_show_location')
my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
my %conf_opt = (
#for services.html and status.html
- 'cust_pkg-display_times' => $conf->exists('cust_pkg-display_times'),
-
+ 'cust_pkg-display_times' => ($conf->exists('cust_pkg-display_times')
+ || $curuser->option('cust_pkg-display_times')),
#for status.html
'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'),
#for status.html pkg-balances