RT78356 - fixed exportname error added missing file
authorChristopher Burger <burgerc@freeside.biz>
Thu, 29 Mar 2018 15:16:09 +0000 (11:16 -0400)
committerChristopher Burger <burgerc@freeside.biz>
Thu, 29 Mar 2018 15:16:09 +0000 (11:16 -0400)
httemplate/edit/part_export.cgi
httemplate/view/svc_export/run_script.cgi [new file with mode: 0644]

index 381fbca..f6ec208 100644 (file)
@@ -293,7 +293,7 @@ my $widget = new HTML::Widgets::SelectLayers(
     foreach my $script ( keys %{$exports->{$layer}{scripts}} ) {
       $html .= '<TR><TD ALIGN="left" COLSPAN=2>' .
         include('/elements/progress-init.html',
     foreach my $script ( keys %{$exports->{$layer}{scripts}} ) {
       $html .= '<TR><TD ALIGN="left" COLSPAN=2>' .
         include('/elements/progress-init.html',
-              $part_export->exportname,
+              $part_export->exporttype,
               [ $script.'_exportnum', $script.'_script' ],
               rooturl().'view/svc_export/run_script.cgi',
               rooturl().'edit/part_export.cgi?'.$part_export->{Hash}->{exportnum},
               [ $script.'_exportnum', $script.'_script' ],
               rooturl().'view/svc_export/run_script.cgi',
               rooturl().'edit/part_export.cgi?'.$part_export->{Hash}->{exportnum},
diff --git a/httemplate/view/svc_export/run_script.cgi b/httemplate/view/svc_export/run_script.cgi
new file mode 100644 (file)
index 0000000..ba58bbd
--- /dev/null
@@ -0,0 +1,31 @@
+<% $server->process %>
+<%init>
+
+my @args = $cgi->param('arg');
+my %param = ();
+  while ( @args ) {
+    my( $field, $value ) = splice(@args, 0, 2);
+    unless ( exists( $param{$field} ) ) {
+      $param{$field} = $value;
+    } elsif ( ! ref($param{$field}) ) {
+      $param{$field} = [ $param{$field}, $value ];
+    } else {
+      push @{$param{$field}}, $value;
+    }
+  }
+
+my $exportnum;
+my $method;
+for (grep /^*_script$/, keys %param) { 
+       $exportnum = $param{$param{$_}.'_exportnum'};
+       $method = $param{$param{$_}.'_script'};
+}
+
+my $part_export = qsearchs('part_export', { 'exportnum'=> $exportnum, } )
+       or die "unknown exportnum $exportnum";
+
+my $class = 'FS::part_export::'.$part_export->{Hash}->{exporttype}.'::'.$method;
+
+my $server = new FS::UI::Web::JSRPC $class, $cgi;
+
+</%init>
\ No newline at end of file