diff options
Diffstat (limited to 'httemplate/view/svc_phone.cgi')
-rw-r--r-- | httemplate/view/svc_phone.cgi | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi new file mode 100644 index 000000000..f604daa47 --- /dev/null +++ b/httemplate/view/svc_phone.cgi @@ -0,0 +1,54 @@ +<% include('elements/svc_Common.html', + 'table' => 'svc_phone', + 'fields' => [qw( + countrycode + phonenum + sip_password + pin + phone_name + )], + 'labels' => { + 'countrycode' => 'Country code', + 'phonenum' => 'Phone number', + 'sip_password' => 'SIP password', + 'pin' => 'PIN', + 'phone_name' => 'Name', + }, + 'html_foot' => $html_foot, + ) +%> +<%init> + +my $html_foot = sub { + my $svc_phone = shift; + + tie my %what, 'Tie::IxHash', + 'pending' => 'NULL', + 'billed' => 'done', + ; + + #XXX src & charged party (& default prefix) as per voip_cdr.pm + #XXX handle toll free too + + my $number = $svc_phone->phonenum; + $number = $svc_phone->countrycode. $number + unless $svc_phone->countrycode eq '1'; + + #my @links = map { + # qq(<A HREF="${p}search/cdr.html?src=$number;freesidestatus=$what{$_}">). + # "View $_ CDRs</A>"; + #} keys(%what); + my @links = map { + qq(<A HREF="${p}search/cdr.html?cdrbatch=__ALL__;charged_party=$number;freesidestatus=$what{$_}">). + "View $_ CDRs</A>"; + } keys(%what); + + my @ilinks = ( qq(<A HREF="${p}search/cdr.html?dst=$number">). + 'View incoming CDRs</A>' ); + + join(' | ', @links ). '<BR>'. + join(' | ', @ilinks). '<BR>'; + +}; + +</%init> |