diff options
author | Mark Wells <mark@freeside.biz> | 2013-02-25 17:10:46 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-02-25 17:10:46 -0800 |
commit | db5e7f34b1e17ae6ce8909062537cc2fb98ca30d (patch) | |
tree | ab15f48e4be51356ec5625e55269ec1b68e37375 /fs_selfservice/FS-SelfService/cgi/view_usage.html | |
parent | 2fc12e6b5a376fef9b5f5bf0301aab8497c6a412 (diff) |
display inbound CDRs in selfservice, #18316; Taqua caller ID, #18574
Diffstat (limited to 'fs_selfservice/FS-SelfService/cgi/view_usage.html')
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/view_usage.html | 38 |
1 files changed, 33 insertions, 5 deletions
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) ? '</TABLE><BR><BR>' : '' %> <%= if ( @svc_phone ) { + %any = (); + for my $dir (qw(outbound inbound)) { + $any{$dir} = grep { $_->{$dir} } @svc_phone; + } $OUT.= '<FONT SIZE="4">Call usage</FONT><BR><BR> <TABLE BGCOLOR="#cccccc"> <TR> - <TH ALIGN="left">Number</TH>'; #"Account" ? - #what else? + <TH ALIGN="left">Number</TH>'; + if ( $any{outbound} ) { + $OUT .= ' + <TH>Dialed</TH>'; + } + if ( $any{inbound} ) { + $OUT .= ' + <TH>Received</TH>'; + } $OUT .= '</TR>'; } 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 .= '<TR><TD>'; - $OUT .= qq!<A HREF="$link">!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.'</A>'; - $OUT .= '</TD></TR>'; + $OUT .= '<TR><TD>'. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}; + $OUT .= '</TD>'; + # usage summary w/ links + for my $dir (qw(outbound inbound)) { + if ( $dir eq 'inbound' ) { + $link .= ';inbound=1'; + } + if ( $svc_phone->{$dir} ) { + $OUT .= '<TD ALIGN="right">'.qq!<A HREF="$link">! . + sprintf('%d calls (%.0f minutes)', + $svc_phone->{$dir}->{'count'}, + $svc_phone->{$dir}->{'duration'} / 60 + ) . + '</A></TD>'; + } elsif ( $any{$dir} ) { + $OUT .= '<TD></TD>'; + } } + $OUT .= '</TR>'; +} +''; %> <%= scalar(@svc_phone) ? '</TABLE><BR><BR>' : '' %> |