pari: branch asterisknow r274 - in /branches/asterisknow/config: ./ images/ s...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Fri Jan 19 14:24:51 MST 2007


Author: pari
Date: Fri Jan 19 15:24:50 2007
New Revision: 274

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=274
Log:
updated registration for asterisk now users 

Added:
    branches/asterisknow/config/images/voicepulse.gif   (with props)
Modified:
    branches/asterisknow/config/cfgbasic.html
    branches/asterisknow/config/setup/10.html
    branches/asterisknow/config/users.html

Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=274&r1=273&r2=274
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Fri Jan 19 15:24:50 2007
@@ -246,6 +246,10 @@
 			<font style="margin-left:4px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; font-weight: bold">Tooltips:</font>
 			<div id='tooltip' style="margin-left:4px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; "><script>document.write(tooltip_default);</script></div>
 			</div>
+			<BR><BR>
+			<center>
+				<div id="buynow_div"></div>
+			</center>
 		</td>
 </tr>
 <tr><td colspan="3" align=center height=18>

Added: branches/asterisknow/config/images/voicepulse.gif
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/images/voicepulse.gif?view=auto&rev=274
==============================================================================
Binary file - no diff available.

Propchange: branches/asterisknow/config/images/voicepulse.gif
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/asterisknow/config/images/voicepulse.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/asterisknow/config/setup/10.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/10.html?view=diff&rev=274&r1=273&r2=274
==============================================================================
--- branches/asterisknow/config/setup/10.html (original)
+++ branches/asterisknow/config/setup/10.html Fri Jan 19 15:24:50 2007
@@ -11,6 +11,7 @@
 var usercallbacks = new Object;
 var fieldnames = new Array( 'save','userbase','localextenlength');
 var widgets = new Array;
+var custinfo_filename = "contactinfo.conf" ;
 
 function localinit(){
 	parent.$('next').disabled = true;
@@ -56,7 +57,7 @@
 
 function post_userdetails(){
 
-	var requiredfields = [ 'first_name', 'last_name', 'email', 'phone', 'country' ];
+	var requiredfields = [ 'cust_firstName', 'cust_lastName', 'cust_email', 'cust_phone', 'cust_country' ];
 	for(var i=0; i < requiredfields.length ; i++ ){
 		if ( $(requiredfields[i]).value == "" ){
 			alert( " Please enter your " + requiredfields[i] );
@@ -64,11 +65,43 @@
 			return false;
 		}
 	}
-
-	$('retURL').value = window.location.href + "?registered" ;
-	document.getElementById("form1").submit();
-	$('registration').style.display='none';
-	$('status_message').style.display= "";
+	parent.astmanEngine.run_tool("/bin/touch /etc/asterisk/"+custinfo_filename , save_info );
+}
+
+
+function save_info(){
+		
+		var opt = {
+			method: 'get',
+			asynchronous: true,
+			onSuccess: function(t) { 
+						$('retURL').value = window.location.href + "?registered" ;
+						document.getElementById("form1").submit();
+						$('registration').style.display='none';
+						$('status_message').style.display= "";
+			},
+			onFailure: function(t) {
+				alert("Config Error: " + t.status + ": " + t.statusText);
+			}
+		};
+		var p =0;
+		var uri = build_action('newcat', p, "MyInfo","", "");  p++;
+		uri += build_action('append', p, "MyInfo","cust_firstName", $('cust_firstName').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_lastName", $('cust_lastName').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_company", $('cust_company').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_title", $('cust_title').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_industry", $('cust_industry').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_URL", $('cust_URL').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_email", $('cust_email').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_phone", $('cust_phone').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_street", $('cust_street').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_city", $('cust_city').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_state", $('cust_state').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_zip", $('cust_zip').value); p++;
+		uri += build_action('append', p, "MyInfo","cust_country", $('cust_country').value); p++;
+		
+		opt.parameters ="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent(custinfo_filename) + "&dstfilename=" + encodeURIComponent(custinfo_filename) + uri;
+		var tmp = new Ajax.Request(rawman_url, opt);
 }
 
 //-->
@@ -98,7 +131,7 @@
 				<div class="heading"> Finish</div>
 				<div class="subheading">
 				Congratulations You have sucessfully configured your Asterisk installation<BR></div>
-<form id="form1" action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
+<form id="form1" action="https://asterisknow.digium.com/register" method="POST">
 <div id="registration" STYLE="display:none; position: absolute; left: 180; top: 80; width:600; height:300;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;z-index:5">
 	<table width="100%" cellpadding=0 cellspacing=0>
 		<TR bgcolor="#7E5538" >
@@ -110,20 +143,20 @@
 <TR><TD height=10 colspan=4></TD></TR>
 <TR>
 	<TD>First Name <font color=red>*</font></TD>
-	<TD><input  maxlength="40" type="text" id="first_name" size="16" name="first_name"></TD>
+	<TD><input  maxlength="40" type="text" id="cust_firstName" size="16" name="cust_firstName"></TD>
 	<TD>Last Name <font color=red>*</font></TD>
-	<TD><input  maxlength="40" type="text" id="last_name" size="16" name="last_name"></TD>
+	<TD><input  maxlength="40" type="text" id="cust_lastName" size="16" name="cust_lastName"></TD>
 </TR>
 <TR>
 	<TD>Title</TD>
-	<TD><input  maxlength="80" type="text" id="title" size="16" name="title"></TD>
+	<TD><input  maxlength="80" type="text" id="cust_title" size="16" name="cust_title"></TD>
 	<TD>Company</TD>
-	<TD><input  maxlength="80" type="text" id="company" size="16" name="company"></TD>
+	<TD><input  maxlength="80" type="text" id="cust_company" size="16" name="cust_company"></TD>
 </TR>
 
 <TR>
 	<TD>Industry</TD>
-	<TD><select  id="industry" name="industry">
+	<TD><select  id="cust_industry" name="cust_industry">
 			<option value="">--None--</option>
 			<option value="Agriculture">Agriculture</option>
 			<option value="Apparel">Apparel</option>
@@ -160,29 +193,29 @@
 			</select>
 			</TD>
 	<TD>Website</TD>
-	<TD><input  maxlength="80" type="text" id="URL" size="20" name="URL"></TD>
+	<TD><input  maxlength="80" type="text" id="cust_URL" size="20" name="cust_URL"></TD>
 </TR>
 <TR>
 	<TD>Email <font color=red>*</font></TD>
-	<TD><input  maxlength="80" type="text" id="email" size="16" name="email"></TD>
+	<TD><input  maxlength="80" type="text" id="cust_email" size="16" name="cust_email"></TD>
 	<TD>Phone <font color=red>*</font></TD>
-	<TD><input  maxlength="40" type="text" id="phone" size="14" name="phone"></TD>
+	<TD><input  maxlength="40" type="text" id="cust_phone" size="14" name="cust_phone"></TD>
 </TR>
 <TR>
 	<TD valign=top>Address</TD>
-	<TD><textarea name="street"></textarea></TD>
+	<TD><textarea name="cust_street" id="cust_street"></textarea></TD>
 	<TD valign=top>City</TD>
-	<TD valign=top><input  maxlength="40" type="text" id="city" size="14" name="city"></TD>
+	<TD valign=top><input  maxlength="40" type="text" id="cust_city" size="14" name="cust_city"></TD>
 </TR>
 <TR>
 	<TD>State/Province</TD>
-	<TD><input  maxlength="20" type="text" id="state" size="14" name="state"></TD>
+	<TD><input  maxlength="20" type="text" id="cust_state" size="14" name="cust_state"></TD>
 	<TD>Zip</TD>
-	<TD><input  maxlength="20" type="text" id="zip" size="6" name="zip"></TD>
+	<TD><input  maxlength="20" type="text" id="cust_zip" size="6" name="cust_zip"></TD>
 </TR>
 <TR>
 	<TD>Country <font color=red>*</font></TD>
-	<TD><input  maxlength="40" type="text" id="country" size="14" name="country" value="US"></TD>
+	<TD><input  maxlength="40" type="text" id="cust_country" size="14" name="cust_country" value="US"></TD>
 	<TD></TD>
 	<TD></TD>
 </TR>
@@ -192,7 +225,7 @@
 		<input type=hidden name="oid" id="oid" value="00D300000006mPe">
 		<input type=hidden name="retURL" id="retURL" value="">
 		<input type="hidden" id="recordType" name="recordType" value="012300000004zos">
-		<input type="hidden" id="lead_source" name="lead_source" value="AsteriskNOW_leadID"> 
+		<input type="hidden" id="lead_source" name="lead_source" value="AsteriskNOWLiveCD_ver011"> 
 		<input type="button" value="Skip" onclick="parent.$('next').disabled = false; $('registration').style.display='none';">
 		&nbsp;&nbsp;
 		<input type="button" value="Register AsteriskNOW with Digium" onclick="post_userdetails()">
@@ -218,4 +251,4 @@
 		</tr>
 </table>
 </BODY>
-</HTML>
+</HTML>

Modified: branches/asterisknow/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/users.html?view=diff&rev=274&r1=273&r2=274
==============================================================================
--- branches/asterisknow/config/users.html (original)
+++ branches/asterisknow/config/users.html Fri Jan 19 15:24:50 2007
@@ -36,6 +36,19 @@
 	var fieldnames = new Array( 'delete', 'status', 'new', 'save', 'cancel','name','fullname','secret','email','cid_number','zapchan','context', 'hasvoicemail','hasdirectory','hassip','hasiax','hasmanager','callwaiting','threewaycalling','mailbox','hasagent','group','host');
 	var localextenlength;
 	var allow_aliasextns;
+	var fieldnames_buynow = new Array('cust_firstName', 'cust_lastName',  'cust_company', 'cust_email', 'cust_phone', 'cust_street', 'cust_city', 'cust_state', 'cust_zip', 'cust_country');
+	var userinfowidgets  = new Array();
+	var userinfo_callbacks = new Object;
+	 userinfo_callbacks.format = function(t){
+		if ((t.name != 'MyInfo'))
+                	return null;
+        return t.name;
+      }
+      userinfo_callbacks.loaded = function(){
+			$('userinfo').selectitem(0);
+			$('buynowform').style.display = "";
+		}
+
 
 	extencallbacks.format = function(t, x) {
 		if ((t.name != specialcontext))
@@ -46,6 +59,22 @@
 	extencallbacks.loaded = function() {
 		merge_extensions($('devices'), $('extensions'));
 		parent.loadscreen(this);
+		parent.$('buynow_div').innerHTML = "Need a phone?  Click on the BuyNow button to purchase a phone directly from the Asterisk Configuration GUI.<BR/><BR/><input type=\"button\" id=\"buynow_button\" value=\"BuyNow\">";
+
+		var blah = parent.astmanEngine.config2list("contactinfo.conf", $('userinfo'), userinfowidgets, userinfo_callbacks);
+                for (var x in fieldnames_buynow) {
+			userinfowidgets[fieldnames_buynow[x]] = $(fieldnames_buynow[x]);
+                }
+
+		parent.$('buynow_button').onclick = function(){	 
+			// read the user info
+			for (var x in fieldnames_buynow) {
+				userinfowidgets[fieldnames_buynow[x]] = $(fieldnames_buynow[x]);
+                        }
+			win=window.open('','myWin');
+			document.buynow_form.target='myWin';
+			document.buynow_form.submit();
+		}
 	}
 	
 	extencallbacks.eachline = true;
@@ -345,4 +374,18 @@
 		</tr>
 </table>
 </div>
+<form name="buynow_form" id="buynow_form" action="https://asterisknow.digium.com/phone/buynow" method="post">
+                                        <select id="userinfo" style="display:none"></select>
+                                        <input type="hidden" id="cust_firstName" name="cust_firstName">
+                                        <input type="hidden" id="cust_lastName" name="cust_lastName">
+                                        <input type="hidden" id="cust_company" name="cust_company">
+                                        <input type="hidden" id="cust_email" name="cust_email">
+                                        <input type="hidden" id="cust_phone" name="cust_phone">
+                                        <input type="hidden" id="cust_street" name="cust_street">
+                                        <input type="hidden" id="cust_city" name="cust_city">
+                                        <input type="hidden" id="cust_state" name="cust_state">
+                                        <input type="hidden" id="cust_zip" name="cust_zip">
+                                        <input type="hidden" id="cust_country" name="cust_country">
+                                        <input type="submit" value="Continue" >&nbsp;&nbsp;<input type="button" id="cancel_a" value="Cancel" onclick="$('buynowform').style.display='none';">
+</form>
 </body>



More information about the asterisk-gui-commits mailing list