diff options
author | ivan <ivan> | 2011-04-10 18:04:12 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-04-10 18:04:12 +0000 |
commit | ae9fe834eabeb6e0bf3d39b5f5ee1eb22203b345 (patch) | |
tree | a9cf6b1265ad91810f2aa07558744309b244b7ae /httemplate/view | |
parent | 8a76ec0177f2622ef393eba89f65c123a796502f (diff) |
fix CDR links on svc_phone when using a default_prefix, RT#12338
Diffstat (limited to 'httemplate/view')
-rw-r--r-- | httemplate/view/svc_phone.cgi | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index 4a850c21c..6e40fea54 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -135,21 +135,30 @@ my $html_foot = sub { unless $svc_phone->countrycode eq '1'; #src & charged party as per voip_cdr.pm - my $search; + #XXX handle toll free too + + my $search = "charged_party_or_src="; + my $cust_pkg = $svc_phone->cust_svc->cust_pkg; - if ( $cust_pkg && $cust_pkg->part_pkg->option('disable_src',1) ) { - $search = "charged_party=$number"; - } else { - $search = "charged_party_or_src=$number"; + + if ( $cust_pkg ) { + + #XXX handle voip_inbound too + + my @part_pkg = grep { $_->plan eq 'voip_cdr' } + $cust_pkg->part_pkg->self_and_bill_linked; + + foreach my $prefix (grep $_, map $_->option('default_prefix'), @part_pkg) { + $number .= ",$prefix$number"; + } + + $search = 'charged_party=' + unless !@part_pkg || grep { ! $_->option('disable_src',1) } @part_pkg; + } - #XXX default prefix as per voip_cdr.pm - #XXX handle toll free too + $search .= $number; - #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?cdrbatchnum=__ALL__;$search;freesidestatus=$what{$_}">). "View $_ CDRs</A>"; |