terms of service for signup server, #16383
authormark <mark>
Fri, 10 Feb 2012 20:59:23 +0000 (20:59 +0000)
committermark <mark>
Fri, 10 Feb 2012 20:59:23 +0000 (20:59 +0000)
FS/FS/ClientAPI/Signup.pm
FS/FS/Conf.pm
fs_selfservice/FS-SelfService/cgi/signup.html

index 595f4fb..b026afd 100644 (file)
@@ -403,6 +403,8 @@ sub signup_info {
           qw( body_bgcolor box_bgcolor menu_bgcolor ) ),
         ( map { $_ => join("\n", $conf->config("selfservice-$_", $agentnum ) ) }
           qw( head body_header body_footer ) ),
+        ( map { $_ => join("\n", $conf->config("signup_server-$_", $agentnum ) ) }
+          qw( terms_of_service ) ),
       };
 
       $cache->set("signup_info_cache_agent$agentnum", $signup_info_cache_agent);
index 51f7093..b3d13e7 100644 (file)
@@ -1982,6 +1982,14 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'signup_server-terms_of_service',
+    'section'     => 'self-service',
+    'description' => 'Terms of Service for the signup server.  May contain HTML.',
+    'type'        => 'textarea',
+    'per_agent'   => 1,
+  },
+
+  {
     'key'         => 'selfservice_server-base_url',
     'section'     => 'self-service',
     'description' => 'Base URL for the self-service web interface - necessary for some widgets to find their way, including retrieval of non-US state information and phone number provisioning.',
index 8204f55..3c71e92 100755 (executable)
@@ -5,7 +5,12 @@
   <%= $head %>
 </HEAD>
 <BODY BGCOLOR="<%= $body_bgcolor || '#e8e8e8' %>" onUnload="myclose()">
-
+<%= if ( $terms_of_service =~ /\S/ ) { # enable overlib
+  $OUT .= qq!<SCRIPT type="text/javascript" src="$_.js"></SCRIPT>\n!
+    foreach (qw(overlibmws overlibmws_iframe overlibmws_draggable 
+                overlibmws_crossframe iframecontentmws ));
+}
+%>
 <script type="text/javascript">
   var mywindow = -1;
   function myopen(filename,windowname,properties) {
@@ -387,9 +392,32 @@ if ( @optional_packages ) {
 $OUT = ''
 }
 %>
-
-<BR><INPUT TYPE="submit" NAME="signup" VALUE="Signup">
-<script language="JavaScript">
+<%=
+  if ( $terms_of_service =~ /\S/ ) {
+    my $title = 'Terms of Service'; #config?
+    my $onclick = qq[overlib( terms_content, CAPTION, "$title", STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, CLOSETEXT, "Close" );];
+    # Container for $terms_of_service to avoid nasty escaping.
+    $OUT .= qq[
+<BR>
+<DIV id="div_terms" style="display:none">$terms_of_service</DIV>
+<SCRIPT type="text/javascript">
+function agree_to_terms (val) {
+  document.getElementById("signup").disabled = !val;
+}
+function show_terms () {
+  overlib( document.getElementById('div_terms').innerHTML,
+    CAPTION, '$title', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE,
+    CLOSECLICK, CLOSETEXT, 'Close' );
+}
+</SCRIPT>
+<INPUT TYPE="checkbox" onchange="agree_to_terms(this.checked)">&nbsp;
+I agree to the <a href="javascript:void(0);" onclick="show_terms();">Terms of Service</a>.
+];
+  }
+%>
+<BR><INPUT TYPE="submit" ID="signup" NAME="signup" VALUE="Signup">
+<script language="javascript">
+<%= length($terms_of_service) ? 'agree_to_terms(false)' : '' %>
 
 function fixup_form() {