diff options
author | jeff <jeff> | 2007-04-12 03:16:43 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-04-12 03:16:43 +0000 |
commit | 0dd05e9ff98263d2d42b419b1e278a5a3bc594b2 (patch) | |
tree | ef42a5ed621c73699e3973fd14ef22abdd3a5823 /httemplate/view/svc_acct.cgi | |
parent | b611f02e479f4a7f9840f59f773d282b1c13b62f (diff) |
input and output on data volume fields specified with k,m,g,or t
Diffstat (limited to 'httemplate/view/svc_acct.cgi')
-rwxr-xr-x | httemplate/view/svc_acct.cgi | 15 |
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 |