Will things ever be the same again?
[freeside.git] / httemplate / misc / process / cust_main-import.cgi
1 %
2 %
3 %  my $fh = $cgi->upload('csvfile');
4 %  #warn $cgi;
5 %  #warn $fh;
6 %
7 %  my $error = defined($fh)
8 %    ? FS::cust_main::batch_import( {
9 %        filehandle => $fh,
10 %        agentnum   => scalar($cgi->param('agentnum')),
11 %        refnum     => scalar($cgi->param('refnum')),
12 %        pkgpart    => scalar($cgi->param('pkgpart')),
13 %        #'fields'    => [qw( cust_pkg.setup dayphone first last address1 address2
14 %        #                   city state zip comments                          )],
15 %        'format'   => scalar($cgi->param('format')),
16 %      } )
17 %    : 'No file';
18 %
19 %  if ( $error ) {
20 %    
21
22     <!-- mason kludge -->
23 %
24 %    eidiot($error);
25 %#    $cgi->param('error', $error);
26 %#    print $cgi->redirect( "${p}cust_main-import.cgi
27 %  } else {
28 %    
29
30     <!-- mason kludge -->
31     <% include("/elements/header.html",'Import successful') %> 
32 %
33 %  }
34 %
35