1 <& elements/svc_Common.html,
2 'table' => 'svc_phone',
5 'html_foot' => $html_foot,
9 my $conf = new FS::Conf;
10 my $countrydefault = $conf->config('countrydefault') || 'US';
12 my $fields = FS::svc_phone->table_info->{'fields'};
13 my %labels = map { $_ => ( ref($fields->{$_})
14 ? $fields->{$_}{'label'}
19 my @fields = qw( countrycode phonenum );
20 push @fields, 'domain' if $conf->exists('svc_phone-domain');
21 push @fields, qw( pbx_title sip_password pin phone_name forwarddst email );
23 if ( $conf->exists('svc_phone-lnp') ) {
24 push @fields, 'lnp_status',
26 { field => 'portable', type => 'checkbox', },
28 { field => 'lnp_desired_due_date', type => 'date', },
29 { field => 'lnp_due_date', type => 'date', },
31 'lnp_other_provider_account';
35 my $svc_phone = shift;
42 emt('E911 Information').
43 &ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
44 '<TR><TD>'.emt('Location').'</TD>'.
45 '<TD BGCOLOR="#FFFFFF">'.
46 $svc_phone->location_label( 'join_string' => '<BR>',
47 'double_space' => ' ',
48 'escape_function' => \&encode_entities,
49 'countrydefault' => $countrydefault,
52 '</TABLE></TD></TR></TABLE>'.
59 my $devices = include('/view/elements/svc_devices.html',
60 'svc_x' => $svc_phone,
61 'table' => 'phone_device',
68 tie my %what, 'Tie::IxHash',
71 'skipped' => 'failed',
74 my $number = $svc_phone->phonenum;
75 $number = $svc_phone->countrycode. $number
76 unless $svc_phone->countrycode eq '1';
78 #src & charged party as per voip_cdr.pm
79 #XXX handle toll free too
81 my $search = "charged_party_or_src=";
83 my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
87 #XXX handle voip_inbound too
89 my @part_pkg = grep { $_->plan eq 'voip_cdr' }
90 $cust_pkg->part_pkg->self_and_bill_linked;
92 foreach my $prefix (grep $_, map $_->option('default_prefix'), @part_pkg) {
93 $number .= ",$prefix$number";
96 $search = 'charged_party='
97 unless !@part_pkg || grep { ! $_->option('disable_src',1) } @part_pkg;
104 qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;$search;freesidestatus=$what{$_}">).
108 my @ilinks = ( qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;dst=$number">).
109 'View incoming CDRs</A>' );
112 # concatenate & return
117 join(' | ', @links ). '<BR>'.
118 join(' | ', @ilinks). '<BR>';