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 );
22 $labels{pbx_title} = 'PBX';
24 if ( $conf->exists('showpasswords') ) {
25 push @fields, qw( sip_password );
27 push @fields, { 'field' => 'sip_password', #'_HIDDEN_sip_password',
29 'value' => '<I>('. mt('hidden') .')</I>',
33 push @fields, qw( pin phone_name forwarddst email );
35 push @fields, { field => 'sms_carrierid',
37 value_callback => sub {
38 $_[0]->sms_carriername,
45 if ( $conf->exists('svc_phone-lnp') ) {
46 push @fields, 'lnp_status',
48 { field => 'portable', type => 'checkbox', },
50 { field => 'lnp_desired_due_date', type => 'date', },
51 { field => 'lnp_due_date', type => 'date', },
53 'lnp_other_provider_account',
57 $labels{circuit_label} = mt('Circuit');
58 push @fields, { field => 'circuit_label',
59 link => [ $p.'view/svc_circuit.html?', 'circuit_svcnum' ]
62 push @fields, 'sip_server';
65 my $svc_phone = shift;
72 emt('E911 Information').
73 &ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
74 '<TR><TD>'.emt('Location').'</TD>'.
75 '<TD BGCOLOR="#FFFFFF">'.
76 $svc_phone->location_label( 'join_string' => '<BR>',
77 'double_space' => ' ',
78 'escape_function' => \&encode_entities,
79 'countrydefault' => $countrydefault,
82 '</TABLE></TD></TR></TABLE>'.
89 #remove this when svc_phone isa device_Common, as elements/svc_Common will display it
90 my $devices = include('/view/elements/svc_devices.html',
91 'svc_x' => $svc_phone,
92 'table' => 'phone_device',
95 my $status = include('/view/elements/svc_export_status.html', $svc_phone );
101 tie my %what, 'Tie::IxHash',
104 'skipped' => 'failed',
107 my $number = $svc_phone->phonenum;
108 $number = $svc_phone->countrycode. $number
109 unless $svc_phone->countrycode eq '1';
111 #src & charged party as per voip_cdr.pm
112 #XXX handle toll free too
114 my $search = "charged_party_or_src=";
116 my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
120 #XXX handle voip_inbound too
122 my @part_pkg = grep { $_->plan eq 'voip_cdr' }
123 $cust_pkg->part_pkg->self_and_bill_linked;
125 foreach my $prefix (grep $_, map $_->option('default_prefix'), @part_pkg) {
126 $number .= ",$prefix$number";
129 $search = 'charged_party='
130 unless !@part_pkg || grep { ! $_->option('disable_src',1) } @part_pkg;
137 qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;$search;freesidestatus=$what{$_}">).
141 my @ilinks = ( qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;dst=$number">).
142 'View incoming CDRs</A>' );
145 # concatenate & return
151 join(' | ', @links ). '<BR>'.
152 join(' | ', @ilinks). '<BR>';