[kune-commits] r1438 - donate/src/cc/kune/sandbox/donate/client

Esteban Carreras Genis ecarrerasg at ourproject.org
Fri Jul 1 03:37:34 CEST 2011


Author: ecarrerasg
Date: 2011-07-01 03:37:33 +0200 (Fri, 01 Jul 2011)
New Revision: 1438

Modified:
   donate/src/cc/kune/sandbox/donate/client/ButtonsPanel.java
   donate/src/cc/kune/sandbox/donate/client/DonateConstants.java
   donate/src/cc/kune/sandbox/donate/client/DonateConstants.properties
Log:
Fixed some links

Modified: donate/src/cc/kune/sandbox/donate/client/ButtonsPanel.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/ButtonsPanel.java	2011-07-01 01:02:17 UTC (rev 1437)
+++ donate/src/cc/kune/sandbox/donate/client/ButtonsPanel.java	2011-07-01 01:37:33 UTC (rev 1438)
@@ -14,6 +14,8 @@
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
+import com.google.gwt.user.client.ui.FormPanel.SubmitHandler;
 
 public class ButtonsPanel extends Composite {
 	DonateMessages donateMessages = (DonateMessages) GWT.create(DonateMessages.class);
@@ -83,8 +85,19 @@
 					tbOtherValue.setText("");
 				}
 			}
-		});	
+		});
 		
+		panelForm.addSubmitHandler(new SubmitHandler() {
+			public void onSubmit(SubmitEvent event) 
+			{
+				String sActualValue = tbOtherValue.getText();
+				if(sActualValue.isEmpty() || sActualValue.equals(donateMessages.otherValue()))
+				{
+					event.cancel();
+				}
+			}
+		});
+		
 		tbOtherValue.addBlurHandler(new BlurHandler() {
 			public void onBlur(BlurEvent event) {
 				String sActualValue = tbOtherValue.getText();
@@ -247,30 +260,39 @@
 		String sEqual = "=";
 		String sAnd = "&";
 		String sLink = "";
+
 		sLink += donateConstants.paypal_url();
 		sLink +=donateConstants.param1()+sEqual;
 		sLink +=donateConstants.valueParam1()+sAnd;
-		sLink +=donateConstants.param2()+sEqual;
-		sLink +=donateConstants.valueParam2()+sAnd;
 		sLink +=donateConstants.param3()+sEqual;
 		sLink +=donateConstants.valueParam3()+sAnd;
 		sLink +=donateConstants.param4()+sEqual;
-		sLink +=donateConstants.valueParam4()+sAnd;
-		sLink +=donateConstants.param5()+sEqual;
-		sLink +=donateConstants.valueParam5()+sAnd;
-		sLink +=donateConstants.param6()+sEqual;
-		sLink +=donateConstants.valueParam6()+sAnd;
-		sLink +=donateConstants.param7()+sEqual;
-		sLink +=donateConstants.valueParam7()+sAnd;
-		sLink +=donateConstants.param8()+sEqual;
-		sLink +=donateConstants.valueParam8()+sAnd;
+		sLink +=sCurrency+sAnd;
 		sLink +=donateConstants.param9()+sEqual;
 		sLink +=donateConstants.valueParam9()+sAnd;
-		sLink +=donateConstants.param10()+sEqual;
-		sLink +=donateConstants.valueParam10()+sAnd;
-		sLink +=donateConstants.param11()+sEqual;
-		sLink +=donateConstants.valueParam11()+sAnd;
-		sLink +=donateConstants.paypal_param_a3()+sEqual;
+		sLink +=donateConstants.param2()+sEqual;
+		if(iType == 2) //Only for regular donations
+		{
+			sLink +=donateConstants.valueParam2()+sAnd;
+			sLink +=donateConstants.param5()+sEqual;
+			sLink +=donateConstants.valueParam5()+sAnd;
+			sLink +=donateConstants.param6()+sEqual;
+			sLink +=donateConstants.valueParam6()+sAnd;
+			sLink +=donateConstants.param7()+sEqual;
+			sLink +=donateConstants.valueParam7()+sAnd;
+			sLink +=donateConstants.param8()+sEqual;
+			sLink +=donateConstants.valueParam8()+sAnd;
+			sLink +=donateConstants.param10()+sEqual;
+			sLink +=donateConstants.valueParam10()+sAnd;
+			sLink +=donateConstants.param11()+sEqual;
+			sLink +=donateConstants.valueParam11()+sAnd;
+			sLink +=donateConstants.paypal_param_a3()+sEqual;
+		}else
+		{
+			sLink +=donateConstants.valueParam2_single()+sAnd;
+			sLink +=donateConstants.paypal_param_amount()+sEqual;
+		}
+		
 		sLink +=sValue;
 
 		return sLink;

Modified: donate/src/cc/kune/sandbox/donate/client/DonateConstants.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonateConstants.java	2011-07-01 01:02:17 UTC (rev 1437)
+++ donate/src/cc/kune/sandbox/donate/client/DonateConstants.java	2011-07-01 01:37:33 UTC (rev 1438)
@@ -17,10 +17,12 @@
 	String single_donations();
 	String paypal_url();
 	String paypal_param_a3();
+	String paypal_param_amount();
 	String param1();
 	String valueParam1();
 	String param2();
 	String valueParam2();
+	String valueParam2_single();
 	String param3();
 	String valueParam3();
 	String param4();

Modified: donate/src/cc/kune/sandbox/donate/client/DonateConstants.properties
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonateConstants.properties	2011-07-01 01:02:17 UTC (rev 1437)
+++ donate/src/cc/kune/sandbox/donate/client/DonateConstants.properties	2011-07-01 01:37:33 UTC (rev 1438)
@@ -13,11 +13,13 @@
 
 paypal_url = https\u003A\u002F\u002Fwww.paypal.com\u002Fcgi-bin\u002Fwebscr\u003F
 paypal_param_a3 = a3
+paypal_param_amount = amount
 param1 = business
-valueParam1 = donate\u0040ourproject\u002Eorg				
+valueParam1 = donate\u0040ourproject\u002Eorg
 param2 = cmd
 valueParam2 =\u005Fxclick\u002Dsubscriptions
-param3 = item_name 
+valueParam2_single = \u005Fdonations
+param3 = item_name
 valueParam3 = Donate to comunes\u002Eorg
 param4 = currency\u005Fcode
 valueParam4 = 




More information about the kune-commits mailing list