1 <& elements/svc_Common.html,
2 'table' => 'svc_phone',
4 'begin_callback' => $begin_callback,
5 'svc_new_callback' => $svc_callback,
6 'svc_edit_callback' => $svc_callback,
7 'svc_error_callback' => $svc_callback,
10 my $conf = new FS::Conf;
12 my $begin_callback = sub {
13 my( $cgi, $fields, $opt ) = @_;
15 my $bulk = $cgi->param('bulk') ? 1 : 0;
17 my $right = $bulk ? 'Bulk provision customer service'
18 : 'Provision customer service';
21 unless $FS::CurrentUser::CurrentUser->access_right($right);
25 { field => 'phonenum',
27 label => 'Phone number',
30 { field => 'sim_imsi',
36 push @$fields, { field => 'domsvc',
37 type => 'select-svc-domain',
40 if $conf->exists('svc_phone-domain');
42 push @$fields, { field => 'pbxsvc',
43 type => 'select-svc_pbx',
49 push @$fields, { field => 'bulk',
59 { field => 'phone_name',
61 maxlength => $conf->config('svc_phone-phone_name-max_length'),
63 { field => 'forward_svcnum',
64 type => 'select-svc_phone-forward',
69 { value => 'E911 Information',
70 type => 'tablebreak-tr-title',
73 { field => 'locationnum',
74 type => 'select-cust_location',
75 label => 'E911 location',
76 include_opt_callback => sub {
77 my $svc_phone = shift;
78 my $pkgnum = $svc_phone->get('pkgnum')
79 || $cgi->param('pkgnum')
80 || $svc_phone->cust_svc->pkgnum; #hua?
81 #cross agent location exposure? sheesh
82 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
83 my $cust_main = $cust_pkg ? $cust_pkg->cust_main : '';
85 'cust_pkg' => $cust_pkg,
86 'cust_main' => $cust_main,
90 { field => 'e911_class',
92 options => [ keys(%{ FS::svc_phone->e911_classes }) ],
93 labels => FS::svc_phone->e911_classes,
95 { field => 'e911_type',
97 options => [ keys(%{ FS::svc_phone->e911_types }) ],
98 labels => FS::svc_phone->e911_types,
100 { field => 'custnum', type=> 'hidden' }, #for new cust_locations
104 if ( $conf->exists('svc_phone-lnp') && !$bulk ) {
106 { value => 'Number Portability',
107 type => 'tablebreak-tr-title',
110 { field => 'lnp_status',
111 type => 'select-lnp_status',
114 { field => 'portable',
118 { field => 'lnp_desired_due_date',
119 type => 'input-date-field',
121 { field => 'lnp_due_date',
122 type => 'input-date-field',
125 'lnp_other_provider',
126 'lnp_other_provider_account',
134 type => 'tablebreak-tr-title',
135 value => 'Carrier Information',
138 { field => 'sip_server',
139 type => 'select-sip_server',
141 { field => 'sms_carrierid',
142 label => 'SMS Carrier',
143 type => 'select-cdr_carrier',
153 # svc_edit_callback / svc_new_callback
154 my $svc_callback = sub {
155 my ($cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_;
158 field => 'circuit_svcnum',
159 type => 'select-svc_circuit',
160 cust_pkg => $cust_pkg,
161 part_svc => $part_svc,
164 if ( $cust_pkg and not $svc_x->svcnum ) {
165 # new service, default to package location
166 $svc_x->set('locationnum', $cust_pkg->locationnum);
169 if ( not $conf->exists('showpasswords') and $svc_x->svcnum ) {
170 $svc_x->sip_password('*HIDDEN*');