[freeside-commits] freeside/httemplate/misc tax-import.cgi, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Thu Aug 14 04:44:54 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv9076/httemplate/misc

Modified Files:
	tax-import.cgi 
Log Message:
customer import: add progress bar & redirect to a search of the imported customers, #3475

Index: tax-import.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/tax-import.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- tax-import.cgi	15 Apr 2008 20:47:58 -0000	1.3
+++ tax-import.cgi	14 Aug 2008 11:44:52 -0000	1.4
@@ -3,63 +3,50 @@
 Import a CSV file set containing tax rate records.
 <BR><BR>
 
-<% include( '/elements/progress-init.html',
-            'TaxRateUpload',
-            [ 'format', 'uploaded_files' ],
-            'process/tax-import.cgi', 
-            { 'message' => 'Tax rates imported' },
+<% include( '/elements/form-file_upload.html',
+              'name'      => 'TaxRateUpload',
+              'action'    => 'process/tax-import.cgi', 
+              'num_files' => 4,
+              'fields'    => [ 'format', ],
+              'message'   => 'Tax rates imported',
           )
 %>
 
-<SCRIPT>
-
-  function gotLoaded(success, message) {
-
-    var uploaded = document.getElementById('uploaded_files');
-    var a = uploaded.value.split(',');
-    if (uploaded.value.split(',').length == 4){
-      process(); 
-    }else{
-      var p = document.getElementById('uploadError');
-      p.innerHTML='<FONT SIZE="+1" COLOR="#ff0000">Error: '+message+'</FONT><BR><BR>';
-      p.style='display:visible';
-      return false;
-    }
-    
-  }
-
-</SCRIPT>
-
-<div style="display:none:" id="uploadError"></div>
-<FORM NAME="TaxRateUpload" ACTION="<% $fsurl %>misc/file-upload.html" METHOD="post" ENCTYPE="multipart/form-data" onsubmit="return doUpload(this, gotLoaded )">
-
 <% &ntable("#cccccc", 2) %>
-<TR>
-  <TH ALIGN="right">Format</TH>
-  <TD>
-    <SELECT NAME="format">
-      <OPTION VALUE="cch-update" SELECTED>CCH update
-      <OPTION VALUE="cch">CCH initial import
-    </SELECT>
-  </TD>
-</TR>
 
-<% include('/elements/file-upload.html', 'field'    => [ 'codefile',
-                                                         'plus4file',
-                                                         'txmatrix',
-                                                         'detail',
-                                                       ],
-                                         'label'    => [ 'code CSV filename',
-                                                         'plus4 CSV filename',
-                                                         'txmatrix CSV filename',
-                                                         'detail CSV filename',
-                                                       ],
-                                         'callback' => 'gotLoaded',
-                                         'debug'    => 0,
-   )
-%>
+  <TR>
+    <TH ALIGN="right">Format</TH>
+    <TD>
+      <SELECT NAME="format">
+        <OPTION VALUE="cch-update" SELECTED>CCH update
+        <OPTION VALUE="cch">CCH initial import
+      </SELECT>
+    </TD>
+  </TR>
 
-<TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import CSV files" onClick="document.TaxRateUpload.submit.disabled=true;"></TD></TR>
+  <% include( '/elements/file-upload.html',
+                'field'    => [ 'codefile',
+                                'plus4file',
+                                'txmatrix',
+                                'detail',
+                              ],
+                'label'    => [ 'code CSV filename',
+                                'plus4 CSV filename',
+                                'txmatrix CSV filename',
+                                'detail CSV filename',
+                              ],
+                'debug'    => 0,
+            )
+  %>
+
+  <TR>
+    <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
+      <INPUT TYPE    = "submit"
+             VALUE   = "Import CSV files"
+             onClick = "document.TaxRateUpload.submit.disabled=true;"
+      >
+    </TD>
+  </TR>
 
 </TABLE>
 



More information about the freeside-commits mailing list