1 <& elements/svc_Common.html,
2 'table' => 'svc_phone',
4 'begin_callback' => $begin_callback,
5 'svc_new_callback' => sub {
6 my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_;
7 $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg;
9 'svc_edit_callback' => sub {
10 my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_;
11 my $conf = new FS::Conf;
12 $svc_x->sip_password('*HIDDEN*') unless $conf->exists('showpasswords');
17 my $begin_callback = sub {
18 my( $cgi, $fields, $opt ) = @_;
20 my $bulk = $cgi->param('bulk') ? 1 : 0;
22 my $right = $bulk ? 'Bulk provision customer service'
23 : 'Provision customer service';
26 unless $FS::CurrentUser::CurrentUser->access_right($right);
28 my $conf = new FS::Conf;
32 { field => 'phonenum',
34 label => 'Phone number',
37 { field => 'sim_imsi',
43 push @$fields, { field => 'domsvc',
44 type => 'select-svc-domain',
47 if $conf->exists('svc_phone-domain');
49 push @$fields, { field => 'pbxsvc',
50 type => 'select-svc_pbx',
56 push @$fields, { field => 'bulk',
66 { field => 'phone_name',
68 maxlength => $conf->config('svc_phone-phone_name-max_length'),
73 { value => 'E911 Information',
74 type => 'tablebreak-tr-title',
77 { field => 'locationnum',
78 type => 'select-cust_location',
79 label => 'E911 location',
80 include_opt_callback => sub {
81 my $svc_phone = shift;
82 my $pkgnum = $svc_phone->get('pkgnum')
83 || $cgi->param('pkgnum')
84 || $svc_phone->cust_svc->pkgnum; #hua?
85 #cross agent location exposure? sheesh
86 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
87 my $cust_main = $cust_pkg ? $cust_pkg->cust_main : '';
89 'cust_pkg' => $cust_pkg,
90 'cust_main' => $cust_main,
94 { field => 'e911_class',
96 options => [ keys(%{ FS::svc_phone->e911_classes }) ],
97 labels => FS::svc_phone->e911_classes,
99 { field => 'e911_type',
101 options => [ keys(%{ FS::svc_phone->e911_types }) ],
102 labels => FS::svc_phone->e911_types,
104 { field => 'custnum', type=> 'hidden' }, #for new cust_locations
108 if ( $conf->exists('svc_phone-lnp') && !$bulk ) {
110 { value => 'Number Portability',
111 type => 'tablebreak-tr-title',
114 { field => 'lnp_status',
115 type => 'select-lnp_status',
118 { field => 'portable',
122 { field => 'lnp_desired_due_date',
123 type => 'input-date-field',
125 { field => 'lnp_due_date',
126 type => 'input-date-field',
129 'lnp_other_provider',
130 'lnp_other_provider_account',
138 type => 'tablebreak-tr-title',
139 value => 'Carrier Information',
142 { field => 'sms_carrierid',
143 label => 'SMS Carrier',
144 type => 'select-cdr_carrier',