default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / svc_dsl.cgi
index 5896f18..36345b9 100644 (file)
@@ -24,11 +24,16 @@ my $html_foot = sub { "
   function ikano_loop_type_changed() {
         var loop_type = document.getElementById('loop_type').value;
         var phonenum = document.getElementById('phonenum');
+        var gateway_access_number = document.getElementById('gateway_access_number');
         if(loop_type == '0') {
             phonenum.value = '';
             phonenum.disabled = true;        
+            gateway_access_number.value = '';
+            gateway_access_number.disabled = true;
+        } else {
+            phonenum.disabled = false;
+            gateway_access_number.disabled = false;
         }
-        else phonenum.disabled = false;
   }
 </SCRIPT>
 "; };
@@ -41,21 +46,36 @@ my $edit_cb = sub {
 
     if ( scalar(@exports) == 1 ) {
         my $export = @exports[0];                
-        if($export->exporttype eq 'ikano') {
+        if($export->exporttype eq 'ikano' && $export->import_mode) {
+            @fields = ();
+        }
+        elsif($export->exporttype eq 'ikano') {
             @fields = ( 'password', 'monitored', );
 
-            foreach my $hf ( keys %$ti_fields ) {
-                push @fields, {
-                    field => $hf,
-                    type => 'hidden',
-                    value => $svc_x->$hf,
-                } unless ( $hf eq 'password' || $hf eq 'monitored' );
+            if ( $svc_x->vendor_qual_id ) {
+              push @fields, { field => 'vendor_qual_id',
+                              type  => 'hidden',
+                              value => $svc_x->vendor_qual_id,
+                            };
+            } else {
+              push @fields, 'vendor_qual_id';
+            }
+
+            foreach my $hf (
+              grep { $_ !~ /^(password|monitored|vendor_qual_id)$/ }
+                keys %$ti_fields
+            ) {
+              push @fields, {
+                field => $hf,
+                type  => 'hidden',
+                value => $svc_x->$hf,
+              };
             }
         }
         # else add any other export-specific stuff here
     }
     else {
-        push @fields, qw( first last company phonenum circuitnum rate_band vpi vci );
+        push @fields, qw( first last company phonenum gateway_access_number circuitnum rate_band vpi vci );
     }
 };
 
@@ -64,6 +84,14 @@ my $new_cb = sub {
     my @exports = $part_svc->part_export_dsl_pull;
     die "more than one DSL-pulling export for svcpart ".$part_svc->svcpart
       if ( scalar(@exports) > 1 );
+    
+    if ( scalar(@exports) == 1 ) {
+        my $export = @exports[0];                
+        if($export->exporttype eq 'ikano' && $export->import_mode) {
+            @fields = ( 'vendor_order_id' );
+            return;
+        }
+    }
 
     my $cust_main = $cust_pkg->cust_main;
 
@@ -112,6 +140,10 @@ my $new_cb = sub {
         { field => 'phonenum',
           value => $phonenum,
         };
+        { field => 'gateway_access_number',
+          value => '',
+        };
+
 
     }