1 <% include('elements/svc_Common.html',
3 'edit_url' => $p."edit/svc_Common.html?svcdb=svc_pbx;svcnum=",
5 'html_foot' => $html_foot,
10 my $fields = FS::svc_pbx->table_info->{'fields'};
11 my %labels = map { $_ => ( ref($fields->{$_})
12 ? $fields->{$_}{'label'}
25 tie my %what, 'Tie::IxHash',
30 #matching as per package def cdr_svc_method
31 my $cust_pkg = $svc_pbx->cust_svc->cust_pkg;
32 return '' unless $cust_pkg;
35 grep { $_->plan eq 'voip_cdr' } $cust_pkg->part_pkg->self_and_bill_linked;
36 if ( scalar(@voip_pkgs) > 1 ) {
37 warn "multiple voip_cdr packages bundled\n";
39 } elsif ( !@voip_pkgs ) {
40 warn "no voip_cdr packages\n";
42 my $voip_pkg = @voip_pkgs[0];
44 my $cdr_svc_method = $voip_pkg->option('cdr_svc_method')
45 || 'svc_phone.phonenum';
46 return '' unless $cdr_svc_method =~ /^svc_pbx\.(\w+)$/;
50 if ( $field eq 'title' ) {
51 $search = 'charged_party='. uri_escape($svc_pbx->title);
52 } elsif ( $field eq 'svcnum' ) {
53 $search = 'svcnum='. $svc_pbx->svcnum;
55 warn "unknown cdr_svc_method svc_pbx.$field";
60 qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;$search;freesidestatus=$what{$_}">).
65 # concatenate & return
68 join(' | ', @links ). '<BR>';