'fields' => \@fields,
'svc_new_callback' => $new_cb,
'svc_edit_callback' => $edit_cb,
+ 'html_foot' => $html_foot,
)
%>
<%init>
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 "
+<SCRIPT TYPE=\"text/javascript\">
+ function ikano_loop_type_changed() {
+ var loop_type = document.getElementById('loop_type').value;
+ var phonenum = document.getElementById('phonenum');
+ if(loop_type == '0') {
+ phonenum.value = '';
+ phonenum.disabled = true;
+ }
+ else phonenum.disabled = false;
+ }
+</SCRIPT>";
+};
my $edit_cb = sub {
my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
} unless ( $hf eq 'password' || $hf eq 'monitored' );
}
}
- else {
- # XXX
- }
+ # else add any other export-specific stuff here
}
else {
- # XXX
+ # XXX allow editing everything
}
};
value => $cust_main->ship_company ? $cust_main->ship_company
: $cust_main->company,
},
- { field => 'svctn',
+ { field => 'phonenum',
value => $defsvctn,
},
);
- my $loop_type = { field => 'loop_type' };
-
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;
-
- die "no start date set on customer package" if !$cust_pkg->start_date;
+ my $ddd = $cust_pkg->start_date;
+ $ddd = time unless $ddd;
- $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,
- };
+ 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',
+ 'vendor_qual_id',
+ { 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;
}
- else {
- push @fields, 'username';
- }
-
- 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
+ # XXX display everything when no exports attached
}
};
</%init>