X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fview_usage.html;h=f7076684ecf2d0c541658e99ec6e050510b91eb1;hb=db5e7f34b1e17ae6ce8909062537cc2fb98ca30d;hp=69437632b8395087cbceb789c021652e49350449;hpb=1958c28884c750ca37979f19bec3e3daf0386731;p=freeside.git
diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html
index 69437632b..f7076684e 100644
--- a/fs_selfservice/FS-SelfService/cgi/view_usage.html
+++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html
@@ -1,6 +1,7 @@
<%= $url = "$selfurl?session=$session_id;action=";
@svc_acct = grep { $_->{svcdb} eq 'svc_acct' } @svcs;
@svc_phone = grep { $_->{svcdb} eq 'svc_phone' } @svcs;
+ @svc_port = grep { $_->{svcdb} eq 'svc_port' } @svcs;
'';
%>
<%= include('header', 'Account usage') %>
@@ -26,8 +27,10 @@
<%= foreach my $svc ( @svc_acct ) {
my $link = "${url}view_usage_details;".
"svcnum=$svc->{'svcnum'};beginning=0;ending=0";
+ my $username = $svc->{'value'};
+ $username =~ s/@.*?$//g if $view_usage_nodomain;
$OUT .= '
';
- $OUT .= qq!!. $svc->{'label'}. ': '. $svc->{'value'}.'';
+ $OUT .= qq!!. $svc->{'label'}. ': '. $username .'';
$OUT .= ' | ';
$OUT .= $svc->{'seconds'};
$OUT .= ' | ';
@@ -59,11 +62,22 @@
<%= scalar(@svc_acct) ? '
' : '' %>
<%= if ( @svc_phone ) {
+ %any = ();
+ for my $dir (qw(outbound inbound)) {
+ $any{$dir} = grep { $_->{$dir} } @svc_phone;
+ }
$OUT.= 'Call usage
- Number | '; #"Account" ?
- #what else?
+ Number | ';
+ if ( $any{outbound} ) {
+ $OUT .= '
+ Dialed | ';
+ }
+ if ( $any{inbound} ) {
+ $OUT .= '
+ Received | ';
+ }
$OUT .= ' ';
} else {
$OUT .= '';
@@ -73,13 +87,86 @@
<%= foreach my $svc_phone ( @svc_phone ) {
my $link = "${url}view_cdr_details;".
"svcnum=$svc_phone->{'svcnum'};beginning=0;ending=0";
- $OUT .= '';
- $OUT .= qq!!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.'';
- $OUT .= ' | ';
+ $OUT .= ''. $svc_phone->{'label'}. ': '. $svc_phone->{'value'};
+ $OUT .= ' | ';
+ # usage summary w/ links
+ for my $dir (qw(outbound inbound)) {
+ if ( $dir eq 'inbound' ) {
+ $link .= ';inbound=1';
+ }
+ if ( $svc_phone->{$dir} ) {
+ $OUT .= ''.qq!! .
+ sprintf('%d calls (%.0f minutes)',
+ $svc_phone->{$dir}->{'count'},
+ $svc_phone->{$dir}->{'duration'} / 60
+ ) .
+ ' | ';
+ } elsif ( $any{$dir} ) {
+ $OUT .= ' | ';
+ }
}
+ $OUT .= ' ';
+}
+'';
%>
<%= scalar(@svc_phone) ? '
' : '' %>
+<%= if ( @svc_port ) {
+ $OUT.= 'Bandwidth Graphs
+
+
+
+ Service |
+
+ |
+ ';
+ }
+ $OUT .= '';
+%>
+
+<%=
+
+sub preset_range {
+ my($start,$end,$label,$date_format,$prefix) = (shift,shift,shift,shift,shift);
+ $start = Date::Format::time2str($date_format,$start);
+ $end = Date::Format::time2str($date_format,$end);
+ return ''.$label.'';
+}
+
+foreach my $svc_port ( @svc_port ) {
+ $svcnum = $svc_port->{'svcnum'};
+ $default_end = time;
+ $default_start = $default_end-86400;
+
+ $OUT .= ''. $svc_port->{'label'}. ': '. $svc_port->{'value'}.' | ';
+ $OUT .= qq! | ';
+}
+%>
+
+<%= scalar(@svc_port) ? '
' : '' %>
+
+
|
<%= include('footer') %>