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'),
66 { value => 'E911 Information',
67 type => 'tablebreak-tr-title',
70 { field => 'locationnum',
71 type => 'select-cust_location',
72 label => 'E911 location',
73 include_opt_callback => sub {
74 my $svc_phone = shift;
75 my $pkgnum = $svc_phone->get('pkgnum')
76 || $cgi->param('pkgnum')
77 || $svc_phone->cust_svc->pkgnum; #hua?
78 #cross agent location exposure? sheesh
79 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
80 my $cust_main = $cust_pkg ? $cust_pkg->cust_main : '';
82 'cust_pkg' => $cust_pkg,
83 'cust_main' => $cust_main,
87 { field => 'e911_class',
89 options => [ keys(%{ FS::svc_phone->e911_classes }) ],
90 labels => FS::svc_phone->e911_classes,
92 { field => 'e911_type',
94 options => [ keys(%{ FS::svc_phone->e911_types }) ],
95 labels => FS::svc_phone->e911_types,
97 { field => 'custnum', type=> 'hidden' }, #for new cust_locations
101 if ( $conf->exists('svc_phone-lnp') && !$bulk ) {
103 { value => 'Number Portability',
104 type => 'tablebreak-tr-title',
107 { field => 'lnp_status',
108 type => 'select-lnp_status',
111 { field => 'portable',
115 { field => 'lnp_desired_due_date',
116 type => 'input-date-field',
118 { field => 'lnp_due_date',
119 type => 'input-date-field',
122 'lnp_other_provider',
123 'lnp_other_provider_account',
131 type => 'tablebreak-tr-title',
132 value => 'Carrier Information',
135 { field => 'sip_server',
136 type => 'select-sip_server',
138 { field => 'sms_carrierid',
139 label => 'SMS Carrier',
140 type => 'select-cdr_carrier',
150 # svc_edit_callback / svc_new_callback
151 my $svc_callback = sub {
152 my ($cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_;
155 field => 'circuit_svcnum',
156 type => 'select-svc_circuit',
157 cust_pkg => $cust_pkg,
158 part_svc => $part_svc,
161 if ( $cust_pkg and not $svc_x->svcnum ) {
162 # new service, default to package location
163 $svc_x->set('locationnum', $cust_pkg->locationnum);
166 if ( not $conf->exists('showpasswords') and $svc_x->svcnum ) {
167 $svc_x->sip_password('*HIDDEN*');