summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorjeff <jeff>2007-04-12 03:18:25 +0000
committerjeff <jeff>2007-04-12 03:18:25 +0000
commit52102268bc5698130474edfda0c3b380426cf325 (patch)
treeee1d02f155302b72b7b4b2bde1e25374d6e4e779 /httemplate/view
parent96c091e3dbda1eb26635aee05d29e6b9ce8bc15c (diff)
input and output on data volume fields specified with k,m,g,or t (backport)
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/svc_acct.cgi15
1 files changed, 5 insertions, 10 deletions
diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi
index 86478681c..2ad9b8ef9 100755
--- a/httemplate/view/svc_acct.cgi
+++ b/httemplate/view/svc_acct.cgi
@@ -245,17 +245,19 @@ Service #<B><% $svcnum %></B>
</TD>
</TR>
% }
-% my %ulabel = ( seconds => 'Seconds',
+% my %ulabel = ( seconds => 'Time',
% upbytes => 'Upload bytes',
% downbytes => 'Download bytes',
% totalbytes => 'Total bytes',
% );
% foreach my $uf ( keys %ulabel ) {
% my $tf = $uf . "_threshold";
-% if ( $svc_acct->$tf ne '' ) {
+% if ( $svc_acct->$uf ne '' ) {
+% my $v = $uf eq 'seconds' ? duration_exact($svc_acct->$uf)
+% : FS::UI::Web::display_bytecount($svc_acct->$uf);
<TR>
<TD ALIGN="right"><% $ulabel{$uf} %> remaining</TD>
- <TD BGCOLOR="#ffffff"><% $svc_acct->$uf %></TD>
+ <TD BGCOLOR="#ffffff"><% $v %></TD>
</TR>
% }
@@ -286,13 +288,6 @@ Service #<B><% $svcnum %></B>
<TD ALIGN="right">RADIUS groups</TD>
<TD BGCOLOR="#ffffff"><% join('<BR>', $svc_acct->radius_groups) %></TD>
</TR>
-% if ( $svc_acct->seconds =~ /^\d+$/ ) {
-
- <TR>
- <TD ALIGN="right">Prepaid time</TD>
- <TD BGCOLOR="#ffffff"><% duration_exact($svc_acct->seconds) %></TD>
- </TR>
-% }
%
%# Can this be abstracted further? Maybe a library function like
%# widget('HTML', 'view', $svc_acct) ? It would definitely make UI