2 % $cgi->param('error', $error );
3 <% $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ) %>
5 <% $cgi->redirect(popurl(3). "browse/part_export.cgi") %>
10 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
12 my $exportnum = $cgi->param('exportnum');
14 my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum;
17 #warn join('-', split(',',$cgi->param('options')));
19 my @values = $cgi->param($_);
20 my $value = scalar(@values) > 1 ? join (' ', @values) : $values[0];
21 $value =~ s/\r\n/\n/g; #browsers? (textarea)
23 } split(',', $cgi->param('options'));
25 my $new = new FS::part_export ( {
27 $_, scalar($cgi->param($_));
28 } fields('part_export')
36 $error = $new->replace($old,\%options);
38 $error = $new->insert(\%options);
39 # $exportnum = $new->exportnum;
42 my $info = FS::part_export::export_info()->{$new->exporttype};
44 my @nasnums = map { /^nasnum(\d+)$/ ? $1 : () } keys %{ $cgi->Vars };
45 $error ||= $new->process_m2m(
46 link_table => 'export_nas',
47 target_table => 'nas',