1 <% include( 'elements/svc_Common.html',
2 'table' => 'svc_phone',
4 'svc_new_callback' => sub {
5 my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_;
6 $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg;
13 unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
15 my $conf = new FS::Conf;
17 my @fields = ( 'countrycode',
18 { field => 'phonenum',
20 label => 'Phone number',
24 push @fields, { field => 'domsvc',
25 type => 'select-svc-domain',
28 if $conf->exists('svc_phone-domain');
30 push @fields, { field => 'pbxsvc',
31 type => 'select-svc_pbx',
36 { field => 'phone_name',
38 maxlength => $conf->config('svc_phone-phone_name-max_length'),
45 { value => 'E911 Information',
46 type => 'tablebreak-tr-title',
49 { field => 'locationnum',
50 type => 'select-cust_location',
51 label => 'E911 location',
52 include_opt_callback => sub {
53 my $svc_phone = shift;
54 my $pkgnum = $svc_phone->get('pkgnum')
55 || $cgi->param('pkgnum')
56 || $svc_phone->cust_svc->pkgnum; #hua?
57 #cross agent location exposure? sheesh
58 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
59 my $cust_main = $cust_pkg ? $cust_pkg->cust_main : '';
61 'cust_pkg' => $cust_pkg,
62 'cust_main' => $cust_main,
66 { field => 'custnum', type=> 'hidden' }, #for new cust_locations
69 if ( $conf->exists('svc_phone-lnp') ) {
71 { value => 'Number Portability',
72 type => 'tablebreak-tr-title',
75 { field => 'lnp_status',
76 type => 'select-lnp_status',
79 { field => 'portable',
83 { field => 'lnp_desired_due_date',
84 type => 'input-date-field',
86 { field => 'lnp_due_date',
87 type => 'input-date-field',
91 'lnp_other_provider_account',