From db5e7f34b1e17ae6ce8909062537cc2fb98ca30d Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Mon, 25 Feb 2013 17:10:46 -0800 Subject: display inbound CDRs in selfservice, #18316; Taqua caller ID, #18574 --- fs_selfservice/FS-SelfService/cgi/view_usage.html | 38 ++++++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'fs_selfservice/FS-SelfService/cgi/view_usage.html') diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html index fd5426a75..f7076684e 100644 --- a/fs_selfservice/FS-SelfService/cgi/view_usage.html +++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html @@ -62,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

- '; #"Account" ? - #what else? + '; + if ( $any{outbound} ) { + $OUT .= ' + '; + } + if ( $any{inbound} ) { + $OUT .= ' + '; + } $OUT .= ''; } else { $OUT .= ''; @@ -76,10 +87,27 @@ <%= foreach my $svc_phone ( @svc_phone ) { my $link = "${url}view_cdr_details;". "svcnum=$svc_phone->{'svcnum'};beginning=0;ending=0"; - $OUT .= ''; + $OUT .= ''; + # usage summary w/ links + for my $dir (qw(outbound inbound)) { + if ( $dir eq 'inbound' ) { + $link .= ';inbound=1'; + } + if ( $svc_phone->{$dir} ) { + $OUT .= ''; + } elsif ( $any{$dir} ) { + $OUT .= ''; + } } + $OUT .= ''; +} +''; %> <%= scalar(@svc_phone) ? '
NumberNumberDialedReceived
'; - $OUT .= qq!!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.''; - $OUT .= '
'. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}; + $OUT .= ''.qq!! . + sprintf('%d calls (%.0f minutes)', + $svc_phone->{$dir}->{'count'}, + $svc_phone->{$dir}->{'duration'} / 60 + ) . + '


' : '' %> -- cgit v1.2.1