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 sim_imsi );
20 push @fields, 'domain' if $conf->exists('svc_phone-domain');
21 push @fields, qw( pbx_title );
23 if ( $conf->exists('showpasswords') ) {
24 push @fields, qw( sip_password );
26 push @fields, { 'field' => 'sip_password', #'_HIDDEN_sip_password',
28 'value' => '<I>('. mt('hidden') .')</I>',
32 push @fields, qw( pin phone_name forwarddst email );
34 if ( $conf->exists('svc_phone-lnp') ) {
35 push @fields, 'lnp_status',
37 { field => 'portable', type => 'checkbox', },
39 { field => 'lnp_desired_due_date', type => 'date', },
40 { field => 'lnp_due_date', type => 'date', },
42 'lnp_other_provider_account';
46 my $svc_phone = shift;
53 emt('E911 Information').
54 &ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
55 '<TR><TD>'.emt('Location').'</TD>'.
56 '<TD BGCOLOR="#FFFFFF">'.
57 $svc_phone->location_label( 'join_string' => '<BR>',
58 'double_space' => ' ',
59 'escape_function' => \&encode_entities,
60 'countrydefault' => $countrydefault,
63 '</TABLE></TD></TR></TABLE>'.
70 my $devices = include('/view/elements/svc_devices.html',
71 'svc_x' => $svc_phone,
72 'table' => 'phone_device',
79 tie my %what, 'Tie::IxHash',
82 'skipped' => 'failed',
85 my $number = $svc_phone->phonenum;
86 $number = $svc_phone->countrycode. $number
87 unless $svc_phone->countrycode eq '1';
89 #src & charged party as per voip_cdr.pm
90 #XXX handle toll free too
92 my $search = "charged_party_or_src=";
94 my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
98 #XXX handle voip_inbound too
100 my @part_pkg = grep { $_->plan eq 'voip_cdr' }
101 $cust_pkg->part_pkg->self_and_bill_linked;
103 foreach my $prefix (grep $_, map $_->option('default_prefix'), @part_pkg) {
104 $number .= ",$prefix$number";
107 $search = 'charged_party='
108 unless !@part_pkg || grep { ! $_->option('disable_src',1) } @part_pkg;
115 qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;$search;freesidestatus=$what{$_}">).
119 my @ilinks = ( qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;dst=$number">).
120 'View incoming CDRs</A>' );
123 # concatenate & return
128 join(' | ', @links ). '<BR>'.
129 join(' | ', @ilinks). '<BR>';