put each CDR web import into a batch
authorivan <ivan>
Tue, 7 Oct 2008 23:57:43 +0000 (23:57 +0000)
committerivan <ivan>
Tue, 7 Oct 2008 23:57:43 +0000 (23:57 +0000)
httemplate/misc/cdr-import.html
httemplate/misc/process/cdr-import.html

index b466078..62e38b2 100644 (file)
@@ -11,6 +11,8 @@ CDR Format:
 
 Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR>
 
+<INPUT TYPE="hidden" NAME="cdrbatch" VALUE="<% $cdrbatch %>"%>
+
 <INPUT TYPE="submit" VALUE="Upload">
 </FORM>
 
@@ -23,4 +25,6 @@ die "access denied"
 
 tie my %formats, 'Tie::IxHash', FS::cdr->import_formats;
 
+my $cdrbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+
 </%init>
index 4848fa3..7c4bf2b 100644 (file)
@@ -15,7 +15,8 @@ my $fh = $cgi->upload('csvfile');
 my $error = defined($fh)
   ? FS::cdr::batch_import( {
       'filehandle' => $fh,
-      'format'     => $cgi->param('format'),
+      'format'     => scalar($cgi->param('format')),
+      'cdrbatch'   => scalar($cgi->param('cdrbatch')),
     } )
   : 'No file';