1 <% include( 'elements/svc_Common.html',
2 'table' => 'svc_phone',
6 'countrycode' => 'Country code',
7 'phonenum' => 'Phone number',
9 'sip_password' => 'SIP password',
10 'pin' => 'Voicemail PIN',
11 'phone_name' => 'Name',
13 'locationnum' => 'E911 location',
15 'svc_new_callback' => sub {
16 my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_;
17 $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg;
24 unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
26 my $conf = new FS::Conf;
28 my @fields = ( 'countrycode',
29 { field => 'phonenum',
31 label => 'Phone number',
35 push @fields, { field => 'domsvc',
36 type => 'select-svc-domain',
39 if $conf->exists('svc_phone-domain');
41 push @fields, { field => 'pbxsvc',
42 type => 'select-svc_pbx',
49 { value => 'E911 Information',
50 type => 'tablebreak-tr-title',
53 { field => 'locationnum',
54 type => 'select-cust_location',
55 label => 'E911 location',
56 include_opt_callback => sub {
57 my $svc_phone = shift;
58 my $pkgnum = $svc_phone->get('pkgnum')
59 || $cgi->param('pkgnum')
60 || $svc_phone->cust_svc->pkgnum; #hua?
61 #cross agent location exposure? sheesh
62 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
63 my $cust_main = $cust_pkg ? $cust_pkg->cust_main : '';
65 'cust_main' => $cust_main,