[freeside-commits] freeside/httemplate/view svc_phone.cgi, 1.20.2.6, 1.20.2.7

Ivan,,, ivan at wavetail.420.am
Sun Apr 10 11:07:15 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv20287/view

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	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.20.2.6
retrieving revision 1.20.2.7
diff -u -w -d -r1.20.2.6 -r1.20.2.7
--- svc_phone.cgi	18 Jan 2011 03:49:19 -0000	1.20.2.6
+++ svc_phone.cgi	10 Apr 2011 18:07:13 -0000	1.20.2.7
@@ -135,21 +135,29 @@
     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') ) {
-    $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