[freeside-commits] freeside/httemplate/misc cust_main-import.cgi, 1.5.2.4, 1.5.2.5

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


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

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

Index: cust_main-import.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/cust_main-import.cgi,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -d -r1.5.2.4 -r1.5.2.5
--- cust_main-import.cgi	14 Aug 2008 01:58:43 -0000	1.5.2.4
+++ cust_main-import.cgi	14 Aug 2008 11:54:10 -0000	1.5.2.5
@@ -3,31 +3,44 @@
 Import a file containing customer records.
 <BR><BR>
 
-<FORM ACTION="process/cust_main-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
+<% include( '/elements/form-file_upload.html',
+              'name'      => 'CustomerImportForm',
+              'action'    => 'process/cust_main-import.cgi',
+              'num_files' => 1,
+              'fields'    => [ 'agentnum', 'custbatch', 'format' ],
+              'message'   => 'Customer import successful',
+              'url'       => $p."search/cust_main.html?custbatch=$custbatch",
+          )
+%>
 
 <% &ntable("#cccccc", 2) %>
 
-<% include('/elements/tr-select-agent.html', '', #$agentnum,
-              'label'       => "<B>Agent</B>",
-              'empty_label' => 'Select agent',
-           )
-%>
+  <% include('/elements/tr-select-agent.html', '', #$agentnum,
+                'label'       => "<B>Agent</B>",
+                'empty_label' => 'Select agent',
+             )
+  %>
+
+  <INPUT TYPE="hidden" NAME="custbatch" VALUE="<% $custbatch %>"%>
+
+  <TR>
+    <TH ALIGN="right">Format</TH>
+    <TD>
+      <SELECT NAME="format">
+        <!-- <OPTION VALUE="simple">Simple -->
+        <OPTION VALUE="extended" SELECTED>Extended
+        <OPTION VALUE="extended-plus_company">Extended plus company
+      </SELECT>
+    </TD>
+  </TR>
+
+  <% include( '/elements/file-upload.html',
+                'field' => 'file',
+                'label' => 'Filename',
+            )
+  %>
 
-<TR>
-  <TH ALIGN="right">Format</TH>
-  <TD>
-    <SELECT NAME="format">
-<!--      <OPTION VALUE="simple">Simple -->
-      <OPTION VALUE="extended" SELECTED>Extended
-      <OPTION VALUE="extended-plus_company">Extended plus company
-    </SELECT>
-  </TD>
-</TR>
 
-<TR>
-  <TH ALIGN="right">Filename</TH>
-  <TD><INPUT TYPE="file" NAME="file"></TD>
-</TR>
 % #include('/elements/tr-select-part_referral.html')
 %
 
@@ -48,7 +61,15 @@
 </TR>
 -->
 
-<TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import file"></TD></TR>
+  <TR>
+    <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
+      <INPUT TYPE    = "submit"
+             ID      = "submit"
+             VALUE   = "Import file"
+             onClick = "document.CustomerImportForm.submit.disabled=true;"
+      >
+    </TD>
+  </TR>
 
 </TABLE>
 
@@ -108,4 +129,6 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Import');
 
+my $custbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+
 </%init>



More information about the freeside-commits mailing list