[freeside-commits] freeside/httemplate/view svc_phone.cgi, 1.27, 1.28
Ivan,,,
ivan at wavetail.420.am
Sun Apr 10 11:04:14 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv19891/view
Modified Files:
svc_phone.cgi
Log Message:
fix CDR links on svc_phone when using a default_prefix, RT#12338
Index: svc_phone.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_phone.cgi,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -w -d -r1.27 -r1.28
--- svc_phone.cgi 1 Apr 2011 02:52:20 -0000 1.27
+++ svc_phone.cgi 10 Apr 2011 18:04:12 -0000 1.28
@@ -135,21 +135,30 @@
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";
}
- #XXX default prefix as per voip_cdr.pm
- #XXX handle toll free too
+ $search = 'charged_party='
+ unless !@part_pkg || grep { ! $_->option('disable_src',1) } @part_pkg;
+
+ }
+
+ $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>";
More information about the freeside-commits
mailing list