put each CDR web import into a batch
[freeside.git] / httemplate / misc / process / cdr-import.html
1 % if ( $error ) {
2 %   errorpage($error);
3 % } else {
4     <% include("/elements/header.html",'Import successful') %>
5     <!-- XXX redirect to batch search like the payment entry... -->
6     <% include("/elements/footer.html",'Import successful') %> 
7 % }
8 <%init>
9
10 die "access denied"
11   unless $FS::CurrentUser::CurrentUser->access_right('Import');
12
13 my $fh = $cgi->upload('csvfile');
14
15 my $error = defined($fh)
16   ? FS::cdr::batch_import( {
17       'filehandle' => $fh,
18       'format'     => scalar($cgi->param('format')),
19       'cdrbatch'   => scalar($cgi->param('cdrbatch')),
20     } )
21   : 'No file';
22
23 </%init>