X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_dsl.cgi;h=48464fbad61bf5aa794164c23097dc436566ce2f;hb=8d534e61d74e561a15f0863a835cda4af639a9ea;hp=3568fbd7db023d2420d84628d105d6d83ac78ce6;hpb=46ef8524cf2e6db7b851967062ce92ffb0773d10;p=freeside.git diff --git a/httemplate/edit/svc_dsl.cgi b/httemplate/edit/svc_dsl.cgi index 3568fbd7d..48464fbad 100644 --- a/httemplate/edit/svc_dsl.cgi +++ b/httemplate/edit/svc_dsl.cgi @@ -3,6 +3,7 @@ 'fields' => \@fields, 'svc_new_callback' => $new_cb, 'svc_edit_callback' => $edit_cb, + 'html_foot' => $html_foot, ) %> <%init> @@ -16,7 +17,21 @@ my $date_format = $conf->config('date_format') || '%m/%d/%Y'; my $ti_fields = FS::svc_dsl->table_info->{'fields'}; my @fields = (); -my @uneditable = qw( pushed vendor_qual_id isp_chg isp_prev staticips last_pull notes ); + +my $html_foot = sub { + return " +"; +}; my $edit_cb = sub { my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_; @@ -37,12 +52,10 @@ my $edit_cb = sub { } unless ( $hf eq 'password' || $hf eq 'monitored' ); } } - else { - # XXX - } + # else add any other export-specific stuff here } else { - # XXX + push @fields, qw( first last company phonenum circuitnum rate_band vpi vci ); } }; @@ -52,7 +65,6 @@ my $new_cb = sub { die "more than one DSL-pulling export attached to svcpart ".$part_svc->svcpart if ( scalar(@exports) > 1 ); - if ( scalar(@exports) == 1 ) { my $cust_main = $cust_pkg->cust_main; my $defsvctn = $cust_main->ship_daytime ? $cust_main->ship_daytime : $cust_main->daytime; @@ -72,54 +84,59 @@ my $new_cb = sub { value => $cust_main->ship_company ? $cust_main->ship_company : $cust_main->company, }, - { field => 'svctn', + { field => 'phonenum', value => $defsvctn, }, ); - my $loop_type = { field => 'loop_type' }; - + if ( scalar(@exports) == 1 ) { my $export = @exports[0]; if($export->exporttype eq 'ikano') { - $cgi->param('vendor_qual_id') =~ /^(\d+)$/ - or die 'unparsable vendor_qual_id'; - my $vendor_qual_id = $1; + my $ddd = $cust_pkg->start_date; + $ddd = time unless $ddd; - die "no start date set on customer package" if !$cust_pkg->start_date; + my @quals = $export->quals_by_cust_and_pkg($cust_pkg->cust_main->custnum,$cust_pkg->pkgpart); + my @prequalids; + my %prequal_labels; + foreach my $qual ( @quals ) { + my $prequalid = $qual->vendor_qual_id; + push @prequalids, $prequalid; + $prequal_labels{$prequalid} = "$prequalid - qualification #" + .$qual->qualnum; + } - $loop_type = { field => 'loop_type', - type => 'select', - options => [ '', '0' ], - labels => { '' => 'Line-share', '0', => 'Standalone' }, - # onchange => "document.getElementById('svctn').value = ''", - }; - push @fields, { field => 'isp_chg', type => 'checkbox', }; - push @fields, 'isp_prev'; - push @fields, { field => 'vendor_qual_id', - type => 'fixed', - value => $vendor_qual_id, - }; - } - else { - push @fields, 'username'; + my @addl_fields = ( + { field => 'loop_type', + type => 'select', + options => [ '', '0' ], + labels => { '' => 'Line-share', '0', => 'Standalone' }, + onchange => 'ikano_loop_type_changed', + }, + 'password', + { field => 'isp_chg', type => 'checkbox', }, + 'isp_prev', + { field => 'vendor_qual_id', + type => 'select', + options => \@prequalids, + labels => \%prequal_labels, + onchange => 'ikano_vendor_qual_id_changed', + }, + { field => 'vendor_order_type', + type => 'hidden', + value => 'NEW' }, + { field => 'desired_due_date', + type => 'fixed', + formatted_value => + time2str($date_format,$ddd), + value => $ddd, + }, + ); + push @fields, @addl_fields; } - - push @fields, 'password'; - - push @fields, $loop_type; - - push @fields, { field => 'vendor_order_type', - type => 'hidden', - value => 'N' }; - push @fields, { field => 'desired_dd', - type => 'fixed', - formatted_value => - time2str($date_format,$cust_pkg->start_date), - value => $cust_pkg->start_date, - }; + # else add any other export-specific stuff here } - else { - # XXX + else { # display non-export and non-Ikano fields + push @fields, qw( rate_band circuitnum vpi vci ); } };