self-signup with prepaid card without customer info, RT9713
[freeside.git] / fs_selfservice / FS-SelfService / cgi / signup.html
index 1b97121..405444c 100755 (executable)
 <FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
 
 <FORM NAME="OneTrueForm" ACTION="<%= $self_url %>" METHOD=POST onSubmit="document.OneTrueForm.signup.disabled=true">
+<INPUT TYPE="hidden" NAME="prepaid_shortform" VALUE="<%= $prepaid_shortform %>">
 <INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
 <INPUT TYPE="hidden" NAME="action" VALUE="process_signup">
+<INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
 <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<%= $referral_custnum %>">
 <INPUT TYPE="hidden" NAME="ss" VALUE="">
 <input type="hidden" name="payby">
@@ -38,7 +40,7 @@
 %>
 
 <%=
-  $OUT = join("\n", map { qq|<input type="hidden" name="$_" />| } qw / promo_code reg_code pkgpart username _password _password2 sec_phrase popnum countrycode phonenum sip_password pin / );
+  $OUT = join("\n", map { qq|<input type="hidden" name="$_" />| } qw / promo_code reg_code pkgpart username _password _password2 sec_phrase popnum mac_addr countrycode phonenum sip_password pin / );
 %>
 
 Where did you hear about our service? <SELECT NAME="refnum">
@@ -46,37 +48,40 @@ Where did you hear about our service? <SELECT NAME="refnum">
   $OUT .= '<OPTION VALUE="">' unless $refnum;
   foreach my $part_referral ( @part_referral ) {
     $OUT .= '<OPTION VALUE="'. $part_referral->{'refnum'}. '"';
-    $OUT .= ' SELECTED' if $part_referral->{'refnum'} eq $refnum;
+    $OUT .= ' SELECTED' if $part_referral->{'refnum'} == $refnum;
     $OUT .= '>'. $part_referral->{'referral'};
   }
 %>
 </SELECT><BR><BR>
+
+<%= unless ( $prepaid_template_custnum && $prepaid_shortform  ) {
+
+my $bgcolor = $box_bgcolor || '#c0c0c0';
+$OUT .= qq!
 Contact Information
-<TABLE BGCOLOR="<%= $box_bgcolor || '#c0c0c0' %>" BORDER=0 CELLSPACING=0 WIDTH="100%">
+<TABLE BGCOLOR="$bgcolor" BORDER=0 CELLSPACING=0 WIDTH="100%">
 <TR>
   <TH ALIGN="right"><font color="#ff0000">*</font>Contact name<BR>(last, first)</TH>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="last" VALUE="<%= $last %>">,
-                <INPUT TYPE="text" NAME="first" VALUE="<%= $first %>"></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="last" VALUE="$last">,
+                <INPUT TYPE="text" NAME="first" VALUE="$first"></TD>
 </TR>
 <TR>
   <TD ALIGN="right">Company</TD>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="<%= $company %>"></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="$company"></TD>
 </TR>
 <TR>
   <TH ALIGN="right"><font color="#ff0000">*</font>Address</TH>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="<%= $address1 %>"></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="$address1"></TD>
 </TR>
 <TR>
   <TD ALIGN="right">&nbsp;</TD>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="<%= $address2 %>"></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="$address2"></TD>
 </TR>
 <TR>
   <TH ALIGN="right"><font color="#ff0000">*</font>City</TH>
-  <TD><INPUT TYPE="text" NAME="city" VALUE="<%= $city %>"></TD>
-  <TH ALIGN="right"><font color="#ff0000">*</font>State/Country</TH>
-  <TD>
-    <%=
-        ($county_html, $state_html, $country_html) =
+  <TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD> !;
+
+        my ($county_html, $state_html, $country_html) =
           regionselector( {
             selected_county  => $county,
             selected_state   => $state,
@@ -86,29 +91,30 @@ Contact Information
             locales          => \@cust_main_county,
           } );
  
-        "$county_html $state_html";
-    %>
+$county_out = ($county_html =~ /SELECT/) ? 'County/State' : 'State';
+$OUT .= qq!<TH ALIGN="right"><font color="#ff0000">*</font> $county_out </TH>
+  <TD>
+    $county_html $state_html
   </TD>
   <TH><font color="#ff0000">*</font>Zip</TH>
-  <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="<%= $zip %>"></TD>
+  <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="$zip"></TD>
 </TR>
 <TR>
   <TH ALIGN="right"><font color="#ff0000">*</font>Country</TH>
-  <TD><%= $country_html %></TD>
+  <TD>$country_html</TD>
 <TR>
   <TD ALIGN="right">Day Phone</TD>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="<%= $daytime %>" SIZE=18></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="$daytime" SIZE=18></TD>
 </TR>
 <TR>
   <TD ALIGN="right">Night Phone</TD>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="<%= $night %>" SIZE=18></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="$night" SIZE=18></TD>
 </TR>
 <TR>
   <TD ALIGN="right">Fax</TD>
-  <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="<%= $fax %>" SIZE=12></TD>
+  <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="$fax" SIZE=12></TD>
 </TR>
-<%=
-  $OUT = '';
+!;
   if ( $stateid_enabled ) {
     my ($county_html, $state_html, $country_html) =
       regionselector( {
@@ -122,8 +128,16 @@ Contact Information
     $OUT .= qq!<TD ALIGN="right">!. $label{stateid_state} .'</TD>';
     $OUT .="<TD COLSPAN=3>$county_html $state_html</TD></TR>";
   }
-%>
+$OUT .= qq!
 </TABLE><font color="#ff0000">*</font> required fields<BR>
+!;
+
+}
+else {
+    @payby = ('PREPAY');
+}
+%>
+
 <BR>Billing information<TABLE BGCOLOR="<%= $box_bgcolor || '#c0c0c0' %>" BORDER=0 CELLSPACING=0 WIDTH="100%">
 <TR><TD>
 
@@ -217,9 +231,6 @@ Contact Information
       }
     }
 
-use Tie::IxHash;
-use HTML::Widgets::SelectLayers;
-
   my %payby_index = ( 'CARD'   => qq/Credit Card/,
                       'DCRD'   => qq/Credit Card/,
                       'CHEK'   => qq/Check/,
@@ -245,7 +256,7 @@ HTML::Widgets::SelectLayers->new(
   form_name => 'dummy',
   html_between => '</td></tr></table>',
   form_action => 'dummy.cgi',
-  layer_callback => sub { my $layer = shift; return $paybychecked{$layer}. '</TABLE>'; },
+  layer_callback => sub { my $layer = shift; return ( shift @hide_payment_fields ? '' : $paybychecked{$layer} ) . '</TABLE>'; },
 )->html;
 
 
@@ -316,6 +327,18 @@ SECPHRASE
       $OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
     }
 
+    if ( $nomadix ) {
+
+      warn $mac_addr;
+      $mac_addr ||= $MA;
+      warn $mac_addr;
+
+      $OUT .= <<NOMADIX;
+        <INPUT TYPE="hidden" NAME="mac_addr" VALUE="$mac_addr">
+NOMADIX
+
+    }
+
   }
 
   if ( @svc_acct_pop ) {
@@ -380,6 +403,7 @@ function fixup_form() {
     var signup_elements = new Array (
       'promo_code', 'reg_code', 'pkgpart',
       'username', '_password', '_password2', 'sec_phrase', 'popnum',
+      'mac_addr',
       'countrycode', 'phonenum', 'sip_password', 'pin'
     );