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',
47 { field => 'phone_name',
49 maxlength => $conf->config('svc_phone-phone_name-max_length'),
52 { value => 'E911 Information',
53 type => 'tablebreak-tr-title',
56 { field => 'locationnum',
57 type => 'select-cust_location',
58 label => 'E911 location',
59 include_opt_callback => sub {
60 my $svc_phone = shift;
61 my $pkgnum = $svc_phone->get('pkgnum')
62 || $cgi->param('pkgnum')
63 || $svc_phone->cust_svc->pkgnum; #hua?
64 #cross agent location exposure? sheesh
65 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
66 my $cust_main = $cust_pkg ? $cust_pkg->cust_main : '';
68 'cust_pkg' => $cust_pkg,
69 'cust_main' => $cust_main,
73 { field => 'custnum', type=> 'hidden' }, #for new cust_locations