default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / elements / cust_payby.html
index 1d789a4..6765df0 100644 (file)
                VALUE     = "<% scalar($cgi->param($name.'_paycvv')) || ('*' x length($cust_payby->paycvv)) %>"
                onChange  = "<% $onchange %>"
         >
-        <BR><FONT SIZE="-1"><% mt('CVV2') |h %>&nbsp;(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<%$p%>docs/cvv2.html', 480, 275, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)</FONT>
+        <BR><FONT SIZE="-1"><% mt('CVV2') |h %>&nbsp;<& /elements/popup_link.html,
+           'action'      => $p.'docs/cvv2.html',
+           'label'       => mt('(help)'),
+           'actionlabel' => 'CVV2 Help',
+           'width'       => 480,
+           'height'      => 275,
+           'nocenter'    => 1,
+           #popup_name    => 'cvv2_popup',
+        &></FONT>
       </TD>
 
       <TD ID="<%$id%>_td_payname" <%$card_display%>>
@@ -298,8 +306,11 @@ if ( $curr_value ) {
   $cust_payby = new FS::cust_payby {};
 }
 my $sel_payby = $cgi->param($name.'_payby') || $cust_payby->payby;
+# add a weight for CARD/CHEK imports, so we don't turn off auto-charge on edit
 # convert DCRD to CARD + no weight, and the same for DCHK/CHEK
-if ($sel_payby eq 'DCRD') {
+if ( $cust_payby->custpaybynum && $sel_payby =~ /^(CARD|CHEK)$/ && ! $cust_payby->weight ) {
+  $cust_payby->weight(1);
+} elsif ($sel_payby eq 'DCRD') {
   $sel_payby = 'CARD';
   $cust_payby->weight('');
 } elsif ($sel_payby eq 'DCHK') {