1 <% include( 'elements/svc_Common.html',
4 'svc_new_callback' => $new_cb,
5 'svc_edit_callback' => $edit_cb,
6 'svc_error_callback' => $error_cb,
7 'html_foot' => $html_foot,
13 unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
15 my $conf = new FS::Conf;
16 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
18 my $ti_fields = FS::svc_dsl->table_info->{'fields'};
22 my $html_foot = sub { "
23 <SCRIPT TYPE=\"text/javascript\">
24 function ikano_loop_type_changed() {
25 var loop_type = document.getElementById('loop_type').value;
26 var phonenum = document.getElementById('phonenum');
27 var gateway_access_number = document.getElementById('gateway_access_number');
28 if(loop_type == '0') {
30 phonenum.disabled = true;
31 gateway_access_number.value = '';
32 gateway_access_number.disabled = true;
34 phonenum.disabled = false;
35 gateway_access_number.disabled = false;
42 my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
43 my @exports = $part_svc->part_export_dsl_pull;
44 die "more than one DSL-pulling export attached to svcpart ".$part_svc->svcpart
45 if ( scalar(@exports) > 1 );
47 if ( scalar(@exports) == 1 ) {
48 my $export = @exports[0];
49 if($export->exporttype eq 'ikano' && $export->import_mode) {
52 elsif($export->exporttype eq 'ikano') {
53 @fields = ( 'password', 'monitored', );
55 if ( $svc_x->vendor_qual_id ) {
56 push @fields, { field => 'vendor_qual_id',
58 value => $svc_x->vendor_qual_id,
61 push @fields, 'vendor_qual_id';
65 grep { $_ !~ /^(password|monitored|vendor_qual_id)$/ }
75 # else add any other export-specific stuff here
78 push @fields, qw( first last company phonenum gateway_access_number circuitnum rate_band vpi vci );
83 my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
84 my @exports = $part_svc->part_export_dsl_pull;
85 die "more than one DSL-pulling export for svcpart ".$part_svc->svcpart
86 if ( scalar(@exports) > 1 );
88 if ( scalar(@exports) == 1 ) {
89 my $export = @exports[0];
90 if($export->exporttype eq 'ikano' && $export->import_mode) {
91 @fields = ( 'vendor_order_id' );
96 my $cust_main = $cust_pkg->cust_main;
100 value => $cust_main->ship_first ? $cust_main->ship_first
104 value => $cust_main->ship_last ? $cust_main->ship_last
107 { field => 'company',
108 value => $cust_pkg->cust_main->ship_company,
109 value => $cust_main->ship_company ? $cust_main->ship_company
110 : $cust_main->company,
114 my $vendor_qual_id = '';
116 if ( $cgi->param('qualnum') ) {
119 qsearchs('qual', { 'qualnum' => scalar($cgi->param('qualnum')) } )
120 or die 'unknown qualnum';
122 $vendor_qual_id = $qual->vendor_qual_id;
124 push @fields, { 'field' => 'qualnum',
126 'value' => $qual->qualnum,
128 { 'field' => 'phonenum',
130 'value' => $qual->phonenum,
135 my $phonenum = $cust_main->ship_daytime ? $cust_main->ship_daytime
136 : $cust_main->daytime;
137 $phonenum =~ s/[^0-9]//g;
140 { field => 'phonenum',
143 { field => 'gateway_access_number',
150 if ( scalar(@exports) == 1 ) {
151 my $export = @exports[0];
152 if($export->exporttype eq 'ikano') {
153 my $ddd = $cust_pkg->start_date;
154 $ddd = time unless $ddd;
156 my @quals = $export->quals_by_cust_and_pkg($cust_pkg->cust_main->custnum,$cust_pkg->pkgpart);
159 foreach my $qual ( @quals ) {
160 my $prequalid = $qual->vendor_qual_id;
161 push @prequalids, $prequalid;
162 $prequal_labels{$prequalid} = "$prequalid - qualification #"
166 if ( $vendor_qual_id ) {
167 splice @fields, -1, 0,
168 { field => 'loop_type',
170 value => ( $qual->phonenum ? '' : '0' ),
171 formatted_value => ( $qual->phonenum ? 'Line-share'
175 splice @fields, -1, 0,
176 { field => 'loop_type',
178 options => [ '', '0' ],
179 labels => { '' => 'Line-share', '0', => 'Standalone' },
180 onchange => 'ikano_loop_type_changed',
186 { field => 'isp_chg', type => 'checkbox', value=>'Y', },
190 if ( $vendor_qual_id ) {
192 { field => 'vendor_qual_id',
194 value => $vendor_qual_id,
198 { field => 'vendor_qual_id',
200 options => \@prequalids,
201 labels => \%prequal_labels,
202 onchange => 'ikano_vendor_qual_id_changed',
207 { field => 'vendor_order_type',
210 { field => 'desired_due_date',
213 time2str($date_format,$ddd),
218 # else add any other export-specific stuff here
220 } else { # display non-export and non-Ikano fields
221 push @fields, qw( rate_band circuitnum vpi vci );
227 #my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields,$opt) = @_;
228 if ( $cgi->param('svcnum') ) {