Few bug fixes messages and bugzilla id submission

Signed-off-by: Edouard Poitras <edouard@eclipse.org>
diff --git a/ajaxBugzilla.php b/ajaxBugzilla.php
index a00d9eb..0bfdc2a 100644
--- a/ajaxBugzilla.php
+++ b/ajaxBugzilla.php
@@ -10,6 +10,7 @@
  *    Christopher Guindon (Eclipse Foundation) - Initial implementation
  *    Edouard Poitras (Eclipse Foundation) - Some modifications
  *******************************************************************************/
+
 	require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");	$App 	= new App();
 	require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/friends/friend.class.php");
 
diff --git a/content/tpl/en_thankyou_membership_update.tpl.php b/content/tpl/en_thankyou_membership_update.tpl.php
index 1c1dee9..4199d00 100644
--- a/content/tpl/en_thankyou_membership_update.tpl.php
+++ b/content/tpl/en_thankyou_membership_update.tpl.php
@@ -31,9 +31,9 @@
   <?php endif;?>
   <?php if ($data['firstname'] != "" || $data['lastname'] != "" || $friend->getFirstName() != "" || $friend->getLastName() != "" || $Paypal->get_show_all()) :?>
   <h3>Donor List</h3>
-    <input class="input-radio" type="radio" id="os1" name="os1" value="Pulic" <?php if(!$data['anonymous']){ print(' checked="checked" ');}?>>
+    <input class="input-radio" type="radio" id="os1public" name="os1" value="Public" <?php if(!$data['anonymous']){ print(' checked="checked" ');}?>>
       Please list me as <strong><?php print $data['firstname'] . ' ' . $data['lastname'];?></strong>.<br />
-    <input class="input-radio" type="radio" id="os1" name="os1" value="Private" <?php if($data['anonymous']){ print(' checked="checked" ');}?>>
+    <input class="input-radio" type="radio" id="os1private" name="os1" value="Private" <?php if($data['anonymous']){ print(' checked="checked" ');}?>>
       I prefer to remain anonymous.
   <?php endif;?>
   <h3>Donation Comment</h3>
diff --git a/functions.js b/functions.js
index 3bb9266..9b7c4dc 100644
--- a/functions.js
+++ b/functions.js
@@ -30,12 +30,10 @@
 function amountCheck() {
 	var a = document.getElementById("amount");
 	var b = document.getElementById("bugzilla");
-	if (a.value >=35)
-	{
+	if (a.value >= 35) {
 		b.disabled=false;
 		b.className = "enabled";
-	}
-	else {
+	} else {
 		b.disabled=true;
 		b.className = "disabled";
 	}
@@ -47,16 +45,16 @@
 	var a = document.getElementById("amount");
 	var b = document.getElementById("bugzilla");
 	var v = document.getElementById("verify");
-	var anon = document.getElementById("os1");
+	var anon = document.getElementById("os1private");
 
 	if (parseInt(a.value) >= 35) {
-			if (b.value.length !=0)	{
+			if (b.value.length != 0)	{
 				if (v.innerHTML.length == 0) {
 					alert("Please verify your Eclipse.org login to continue");
 					return false;
 				}
 				if (v.innerHTML != "Verified!") {
-					alert ("Your Eclipse.org ID could not be verified." + '\n' + "For donations of $35 dollars or more we require you to provide a valid ID.  If you do not wish to provide your Eclipse.org ID please list your name Anonymously.");
+					alert ("Your Eclipse.org ID could not be verified. If you have recently created an account, please ensure you have verified your email address." + '\n' + "For donations of $35 dollars or more we require you to provide a valid ID.  If you do not wish to provide your Eclipse.org ID please list your name Anonymously.");
 					return false;
 				}
 			}
@@ -65,18 +63,14 @@
 }
 
 
-function isNumeric(input)
-{
+function isNumeric(input) {
 	var numbers = "01234567890.-";
 	var singleChar;
 	var retVal = true;
-	if (input.length > 0)
-	{
-		for (i = 0; i < input.length && retVal == true; i++)
-		{
+	if (input.length > 0) {
+		for (i = 0; i < input.length && retVal == true; i++) {
 			singleChar = input.charAt(i);
-			if (numbers.indexOf(singleChar) == -1)
-			{
+			if (numbers.indexOf(singleChar) == -1) {
 				retVal = false;
 			}
 		}
@@ -84,13 +78,11 @@
 	return retVal;
 }
 
-function verifyBugzillaLogin()
-{
+function verifyBugzillaLogin() {
 	var v = document.getElementById('verify');
 	var a = document.getElementById('amount');
 	var bugzillaLogin = document.getElementById('bugzilla');
-	if (bugzillaLogin.value.length == 0 || parseInt(a.value) < 35)
-	{
+	if (bugzillaLogin.value.length == 0 || parseInt(a.value) < 35) {
 		v.innerHTML = "";
 		v.removeAttribute("class");
 		bugzillaLogin.value = "";
@@ -104,26 +96,26 @@
 
 }
 
-function updatePage()
-{
+function updatePage() {
 	var v = document.getElementById('verify');
 	var b = document.getElementById('bugzilla');
-	var anon = document.getElementById('os1');
+	var anon = document.getElementById('os1private');
     if (ajaxObject.readyState == 4){
     	response = ajaxObject.responseText;
-    	if (response == "Verified!" || b.value.length == 0 || anon.checked == false)
-   		{
-    		if (response == "Verified!")
-			{
-				v.innerHTML = response;
+    	if (response.indexOf("Verified!") > -1 || b.value.length == 0 || anon.checked) {
+    		if (response.indexOf("Verified!") > -1) {
+				v.innerHTML = "Verified!";
 				v.setAttribute("class", "green");
 				b.setAttribute("style","border:2px solid green;");
-			}
-    		if (validateForm())
+            }
+    		if (validateForm()) {
     			document.donateForm.submit();
+            } else {
+                return false;
+            }
 	    }
-    	else {
-    		v.innerHTML = response;
+    	else { // Anonymous
+            v.innerHTML = "Invalid Login";
     		v.setAttribute("class", "red");
     		b.setAttribute("style","border:2px solid #FF0000;");
     		validateForm();
diff --git a/thankyou.php b/thankyou.php
index 6e48958..6b40888 100644
--- a/thankyou.php
+++ b/thankyou.php
@@ -168,9 +168,12 @@
 // Check to see if this transaction has already been processed.
 $check_contribution = new Contribution();
 $check_transaction = $check_contribution->selectContributionExists($data['transaction_id']);
-if ($check_transaction == TRUE) { // Contribution Already Exist - Check for name change
-  // Get friend from friend_id from transaction
+if ($check_transaction == TRUE) { // Contribution Already Exist - Check for name and message change
+  // Update contribution
   $check_contribution->selectContributionWithTransaction($data['transaction_id']);
+  $check_contribution->setMessage($data['comment']);
+  $check_contribution->updateContribution();
+  // Get friend from friend_id from transaction
   $check_friends = new Friend();
   $check_friends->selectFriend($check_contribution->getFriendID());
   if ($friend_id != 0) { // User Doesn't Already Exist