From: ivan Date: Sat, 29 Mar 2008 09:12:06 +0000 (+0000) Subject: add quick links for unprocessed and processed CDRs to svc_phone view X-Git-Tag: freeside_1_7_3rc1~24 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=1c55c2f7b069bec5f64e2f69901cb34abbbef624;p=freeside.git add quick links for unprocessed and processed CDRs to svc_phone view --- diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 0500248b1..b6d8e652f 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -84,6 +84,18 @@ Service #<% $svcnum %>
+ +% if ( defined($opt{'html_foot'}) ) { + + <% ref($opt{'html_foot'}) + ? &{ $opt{'html_foot'} }($svc_x) + : $opt{'html_foot'} + %> +
+ +% } + + <% joblisting({'svcnum'=>$svcnum}, 1) %> <% include('/elements/footer.html') %> diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index 732f3cd79..5dcf35916 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -1,10 +1,36 @@ <% include('elements/svc_Common.html', - 'table' => 'svc_phone', - 'fields' => [qw( countrycode phonenum )], #pin - 'labels' => { - 'countrycode' => 'Country code', - 'phonenum' => 'Phone number', - 'pin' => 'PIN', - }, - ) + 'table' => 'svc_phone', + 'fields' => [qw( countrycode phonenum )], #pin + 'labels' => { + 'countrycode' => 'Country code', + 'phonenum' => 'Phone number', + 'pin' => 'PIN', + }, + '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; + + my @links = map { + qq(). + "View $_ CDRs"; + } keys(%what); + + join(' | ', @links). '
'; + +}; + +