X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fview_usage.html;h=4099a57f514fcb8bb9a41e5d4d73ac07b55c01b2;hb=768ab093771b3305a67c9d929b461ef777ecdad8;hp=b492102ce02b96c2b05eea80fb96d93640d4ca92;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git
diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html
index b492102ce..4099a57f5 100644
--- a/fs_selfservice/FS-SelfService/cgi/view_usage.html
+++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html
@@ -1,17 +1,33 @@
-<%= $url = "$selfurl?session=$session_id;action=";
- @svc_acct = grep { $_->{svcdb} eq 'svc_acct' } @svcs;
- @svc_phone = grep { $_->{svcdb} eq 'svc_phone' } @svcs;
+<%= $url = "$selfurl?action=";
+ %by_pkg_label = (); # not used yet, but I'm sure it will be...
+ @svc_acct = ();
+ @svc_phone = ();
+ @svc_port = ();
+ @svc_pbx = ();
+
+ foreach (@svcs) {
+ $by_pkg_label{ $_->{pkg_label} } ||= [];
+ push @{ $by_pkg_label{ $_->{pkg_label} } }, $_;
+ if ( $_->{svcdb} eq 'svc_acct' ) {
+ push @svc_acct, $_;
+ } elsif ( $_->{svcdb} eq 'svc_phone' ) {
+ push @svc_phone, $_;
+ } elsif ( $_->{svcdb} eq 'svc_port' ) {
+ push @svc_port, $_;
+ } elsif ( $_->{svcdb} eq 'svc_pbx' ) {
+ push @svc_pbx, $_;
+ }
+ }
'';
%>
-<%= include('header') %>
+<%= include('header', 'Account usage') %>
<%= if ( $error ) {
$OUT .= qq!$error
!;
} ''; %>
<%= if ( @svc_acct ) {
- $OUT.= 'Account usage
-
Account | Time remaining | @@ -27,8 +43,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,28 +77,148 @@ <%= scalar(@svc_acct) ? ' |
Number | '; #"Account" ? - #what else? +Number | '; + if ( $any{outbound} ) { + $OUT .= ' +Dialed | '; + } + if ( $any{inbound} ) { + $OUT .= ' +Received | '; + } $OUT .= '
---|---|---|---|
'; - $OUT .= qq!!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.''; - $OUT .= ' | |||
'. $svc_x->{'label'}. ': '. $svc_x->{'value'}; + $OUT .= ' | '; + # usage summary w/ links + for my $dir (qw(outbound inbound)) { + if ( $dir eq 'inbound' ) { + $link .= ';inbound=1'; + } + if ( $svc_x->{$dir} ) { + $OUT .= ''.qq!! . + sprintf('%d calls (%.0f minutes)', + $svc_x->{$dir}->{'count'}, + $svc_x->{$dir}->{'duration'} / 60 + ) . + ' | '; + } elsif ( $any{$dir} ) { + $OUT .= ''; + } } + $OUT .= ' |
Remaining minutes | |||
---|---|---|---|
$description | +$remain | +/ | +$total | +
* shared among all your phone plans |
Service | ++ | +
---|---|
'. $svc_port->{'label'}. ': '. $svc_port->{'value'}.' | '; + $OUT .= qq!