1 <% include( 'elements/svc_Common.html',
4 'svc_new_callback' => $new_cb,
5 'svc_edit_callback' => $edit_cb,
6 'html_foot' => $html_foot,
12 unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
14 my $conf = new FS::Conf;
15 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
17 my $ti_fields = FS::svc_dsl->table_info->{'fields'};
21 my $html_foot = sub { "
22 <SCRIPT TYPE=\"text/javascript\">
23 function ikano_loop_type_changed() {
24 var loop_type = document.getElementById('loop_type').value;
25 var phonenum = document.getElementById('phonenum');
26 if(loop_type == '0') {
28 phonenum.disabled = true;
30 else phonenum.disabled = false;
36 my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
37 my @exports = $part_svc->part_export_dsl_pull;
38 die "more than one DSL-pulling export attached to svcpart ".$part_svc->svcpart
39 if ( scalar(@exports) > 1 );
41 if ( scalar(@exports) == 1 ) {
42 my $export = @exports[0];
43 if($export->exporttype eq 'ikano') {
44 @fields = ( 'password', 'monitored', );
46 foreach my $hf ( keys %$ti_fields ) {
51 } unless ( $hf eq 'password' || $hf eq 'monitored' );
54 # else add any other export-specific stuff here
57 push @fields, qw( first last company phonenum circuitnum rate_band vpi vci );
62 my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
63 my @exports = $part_svc->part_export_dsl_pull;
64 die "more than one DSL-pulling export attached to svcpart ".$part_svc->svcpart
65 if ( scalar(@exports) > 1 );
67 my $cust_main = $cust_pkg->cust_main;
68 my $defsvctn = $cust_main->ship_daytime ? $cust_main->ship_daytime
69 : $cust_main->daytime;
70 $defsvctn =~ s/[^0-9]//g;
74 value => $cust_main->ship_first ? $cust_main->ship_first
78 value => $cust_main->ship_last ? $cust_main->ship_last
82 value => $cust_pkg->cust_main->ship_company,
83 value => $cust_main->ship_company ? $cust_main->ship_company
84 : $cust_main->company,
86 { field => 'phonenum',
91 if ( scalar(@exports) == 1 ) {
92 my $export = @exports[0];
93 if($export->exporttype eq 'ikano') {
94 my $ddd = $cust_pkg->start_date;
95 $ddd = time unless $ddd;
97 my @quals = $export->quals_by_cust_and_pkg($cust_pkg->cust_main->custnum,$cust_pkg->pkgpart);
100 foreach my $qual ( @quals ) {
101 my $prequalid = $qual->vendor_qual_id;
102 push @prequalids, $prequalid;
103 $prequal_labels{$prequalid} = "$prequalid - qualification #"
107 splice @fields, -1, 0,
108 { field => 'loop_type',
110 options => [ '', '0' ],
111 labels => { '' => 'Line-share', '0', => 'Standalone' },
112 onchange => 'ikano_loop_type_changed',
118 { field => 'isp_chg', type => 'checkbox', value=>'Y', },
120 { field => 'vendor_qual_id',
122 options => \@prequalids,
123 labels => \%prequal_labels,
124 onchange => 'ikano_vendor_qual_id_changed',
126 { field => 'vendor_order_type',
129 { field => 'desired_due_date',
132 time2str($date_format,$ddd),
137 # else add any other export-specific stuff here
139 } else { # display non-export and non-Ikano fields
140 push @fields, qw( rate_band circuitnum vpi vci );