[freeside-commits] branch master updated. 771afd921a4a9c2b0358663774d1d5ce0a499cc8

Ivan ivan at 420.am
Wed Dec 11 14:58:31 PST 2013


The branch, master has been updated
       via  771afd921a4a9c2b0358663774d1d5ce0a499cc8 (commit)
      from  359004f4f4091e9789cb6e23a97c8eb89256d0b2 (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 771afd921a4a9c2b0358663774d1d5ce0a499cc8
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 11 14:58:31 2013 -0800

    RADIUS usage for svc_broadband: show on service view, RT#26451

diff --git a/httemplate/view/elements/svc_radius_usage.html b/httemplate/view/elements/svc_radius_usage.html
new file mode 100644
index 0000000..1d58ef6
--- /dev/null
+++ b/httemplate/view/elements/svc_radius_usage.html
@@ -0,0 +1,77 @@
+% if ( $part_svc->part_export_usage ) {
+%
+%  my $last_bill;
+%  my %plandata;
+%  if ( $cust_pkg ) {
+%    #false laziness w/httemplate/edit/part_pkg... this stuff doesn't really
+%    #belong in plan data
+%    %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
+%                    split("\n", $cust_pkg->part_pkg->plandata );
+%
+%    $last_bill = $cust_pkg->last_bill;
+%  } else {
+%    $last_bill = 0;
+%    %plandata = ();
+%  }
+%
+%  my $seconds = $svc->seconds_since_sqlradacct( $last_bill, time );
+%  my $hour = int($seconds/3600);
+%  my $min = int( ($seconds%3600) / 60 );
+%  my $sec = $seconds%60;
+%
+%  my $input = $svc->attribute_since_sqlradacct(
+%    $last_bill, time, 'AcctInputOctets'
+%  ) / 1048576;
+%  my $output = $svc->attribute_since_sqlradacct(
+%    $last_bill, time, 'AcctOutputOctets'
+%  ) / 1048576;
+
+
+  RADIUS session information<BR>
+  <% ntable('#cccccc',2) %>
+  <TR><TD BGCOLOR="#ffffff">
+% if ( $seconds ) { 
+
+    Online <B><% $hour %></B>h <B><% $min %></B>m <B><% $sec %></B>s
+% } else { 
+
+    Has not logged on
+% } 
+% if ( $cust_pkg ) { 
+
+    since last bill (<% time2str('%a %b %o %Y', $last_bill) %>)
+% if ( length($plandata{recur_included_hours}) ) { 
+
+    - <% $plandata{recur_included_hours} %> total hours in plan
+% } 
+
+    <BR>
+% } else { 
+
+    (no billing cycle available for unaudited account)<BR>
+% } 
+
+
+  Upload: <B><% sprintf("%.3f", $input) %></B> megabytes<BR>
+  Download: <B><% sprintf("%.3f", $output) %></B> megabytes<BR>
+% if ( $svc->table eq 'svc_acct' ) {
+    Last Login: <B><% $svc->last_login_text %></B><BR>
+% }
+% my $href = qq!<A HREF="${p}search/sqlradius.cgi?svcnum=!. $svc->svcnum; 
+
+  View session detail:
+      <% $href %>;begin=<% $last_bill %>">this billing cycle</A>
+    | <% $href %>;begin=<% time-15552000 %>">past six months</A>
+    | <% $href %>">all sessions</A>
+
+  </TD></TR></TABLE><BR>
+% } 
+<%init>
+
+my %opt = @_;
+
+my $svc = $opt{'svc'};
+my $part_svc = $opt{'part_svc'};
+my $cust_pkg = $opt{'cust_pkg'};
+
+</%init>

-----------------------------------------------------------------------

Summary of changes:
 .../svc_radius_usage.html}                         |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
 copy httemplate/view/{svc_acct/radius_usage.html => elements/svc_radius_usage.html} (84%)




More information about the freeside-commits mailing list