[freeside-commits] freeside/httemplate/view svc_acct.cgi, 1.49, 1.49.2.1

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Apr 11 20:18:27 PDT 2007


Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail:/tmp/cvs-serv8008/httemplate/view

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	svc_acct.cgi 
Log Message:
input and output on data volume fields specified with k,m,g,or t (backport)

Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_acct.cgi,v
retrieving revision 1.49
retrieving revision 1.49.2.1
diff -u -d -r1.49 -r1.49.2.1
--- svc_acct.cgi	5 Feb 2007 12:51:05 -0000	1.49
+++ svc_acct.cgi	12 Apr 2007 03:18:25 -0000	1.49.2.1
@@ -245,17 +245,19 @@
     </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 @@
   <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 



More information about the freeside-commits mailing list