[freeside-commits] freeside/httemplate/edit svc_dsl.cgi,1.8,1.9
Ivan,,,
ivan at wavetail.420.am
Sun Mar 27 19:00:55 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv12828/httemplate/edit
Modified Files:
svc_dsl.cgi
Log Message:
finish existing customer dsl order, RT#7111
Index: svc_dsl.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_dsl.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -d -r1.8 -r1.9
--- svc_dsl.cgi 22 Mar 2011 06:00:54 -0000 1.8
+++ svc_dsl.cgi 28 Mar 2011 02:00:53 -0000 1.9
@@ -3,6 +3,7 @@
'fields' => \@fields,
'svc_new_callback' => $new_cb,
'svc_edit_callback' => $edit_cb,
+ 'svc_error_callback' => $error_cb,
'html_foot' => $html_foot,
)
%>
@@ -61,13 +62,10 @@
my $new_cb = sub {
my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
my @exports = $part_svc->part_export_dsl_pull;
- die "more than one DSL-pulling export attached to svcpart ".$part_svc->svcpart
+ die "more than one DSL-pulling export for svcpart ".$part_svc->svcpart
if ( scalar(@exports) > 1 );
my $cust_main = $cust_pkg->cust_main;
- my $defsvctn = $cust_main->ship_daytime ? $cust_main->ship_daytime
- : $cust_main->daytime;
- $defsvctn =~ s/[^0-9]//g;
@fields = (
{ field => 'first',
@@ -83,11 +81,40 @@
value => $cust_main->ship_company ? $cust_main->ship_company
: $cust_main->company,
},
- { field => 'phonenum',
- value => $defsvctn,
- },
);
+ my $vendor_qual_id = '';
+ my $qual = '';
+ if ( $cgi->param('qualnum') ) {
+
+ $qual =
+ qsearchs('qual', { 'qualnum' => scalar($cgi->param('qualnum')) } )
+ or die 'unknown qualnum';
+
+ $vendor_qual_id = $qual->vendor_qual_id;
+
+ push @fields, { 'field' => 'qualnum',
+ 'type' => 'hidden',
+ 'value' => $qual->qualnum,
+ },
+ { 'field' => 'phonenum',
+ 'type' => 'fixed',
+ 'value' => $qual->phonenum,
+ };
+
+ } else {
+
+ my $phonenum = $cust_main->ship_daytime ? $cust_main->ship_daytime
+ : $cust_main->daytime;
+ $phonenum =~ s/[^0-9]//g;
+
+ push @fields,
+ { field => 'phonenum',
+ value => $phonenum,
+ };
+
+ }
+
if ( scalar(@exports) == 1 ) {
my $export = @exports[0];
if($export->exporttype eq 'ikano') {
@@ -104,25 +131,47 @@
.$qual->qualnum;
}
+ if ( $vendor_qual_id ) {
+ splice @fields, -1, 0,
+ { field => 'loop_type',
+ type => 'fixed',
+ value => ( $qual->phonenum ? '' : '0' ),
+ formatted_value => ( $qual->phonenum ? 'Line-share'
+ : 'Standalone' ),
+ };
+ } else {
splice @fields, -1, 0,
{ field => 'loop_type',
type => 'select',
options => [ '', '0' ],
labels => { '' => 'Line-share', '0', => 'Standalone' },
onchange => 'ikano_loop_type_changed',
- },
- ;
+ };
+ }
push @fields,
'password',
{ field => 'isp_chg', type => 'checkbox', value=>'Y', },
'isp_prev',
+ ;
+
+ if ( $vendor_qual_id ) {
+ push @fields,
+ { field => 'vendor_qual_id',
+ type => 'fixed',
+ value => $vendor_qual_id,
+ };
+ } else {
+ push @fields,
{ field => 'vendor_qual_id',
type => 'select',
options => \@prequalids,
labels => \%prequal_labels,
onchange => 'ikano_vendor_qual_id_changed',
- },
+ };
+ }
+
+ push @fields,
{ field => 'vendor_order_type',
type => 'hidden',
value => 'NEW' },
@@ -140,4 +189,15 @@
push @fields, qw( rate_band circuitnum vpi vci );
}
};
+
+my $error_cb = sub {
+ my( $cgi ) = @_;
+ #my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields,$opt) = @_;
+ if ( $cgi->param('svcnum') ) {
+ &{ $edit_cb }( @_ );
+ } else {
+ &{ $new_cb }( @_ );
+ }
+};
+
</%init>
More information about the freeside-commits
mailing list