fix pending payment popups
[freeside.git] / httemplate / search / cust_pay_pending.html
index f0a3a01..2afce0c 100755 (executable)
@@ -5,11 +5,11 @@
                 'name_verb'     => 'pending',
                 'disable_link'  => 1,
                 'disable_by'    => 1, #add otaker to cust_pay_pending?
-                'html_init'     => include('/elements/init_overlib.html'),
                 'addl_header'   => [ 'Time', 'Payment Status', ],
                 'addl_fields'   => [ sub { time2str('%r', shift->_date ) },
                                      $status_sub,
                                    ],
+                'redirect_empty' => $redirect_empty,
           )
 %>
 <%init>
@@ -18,7 +18,7 @@ my %statusaction = (
   'new'        => 'delete',
   'pending'    => 'complete',
   #'authorized' => '',
-  #'captured'   => '',
+  'captured'   => 'capture',
   #'declined'   => '',
   #wouldn't need to take action on a done state#'done'
 );
@@ -44,4 +44,13 @@ my $status_sub = sub {
   $return. qq! <FONT SIZE="-1">($link)</FONT>!;
 };
 
+my $redirect_empty = sub {
+  my $cgi = shift;
+  if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+    $p. "view/cust_main.cgi?$1";
+  } else {
+    '';
+  }
+};
+
 </%init>