r77038 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77037‎ | r77038 | r77039 >
Date:22:16, 19 November 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Mergin from r77023 thru r77037 of trunk
Modified paths:
  • /branches/fundraising/deployment/DonationInterface (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter5.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter6.php (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter5.php
@@ -195,7 +195,7 @@
196196 // cc submit button
197197 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) );
198198 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
199 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'document.payment.PaypalRedirect.value=0;return true;', 'type' => 'submit' ) );
 199+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'false\';return true;', 'type' => 'submit' ) );
200200 $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
201201 $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
202202 wfMsg( 'payflowpro_gateway-donate-click' );
@@ -205,8 +205,8 @@
206206 // paypal submit button
207207 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) );
208208 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
209 - $form .= Html::hidden( 'PaypalRedirect', 0 );
210 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button' ), 'onclick' => 'document.payment.PaypalRedirect.value=1;return true;', 'type' => 'submit' ) );
 209+ $form .= Html::hidden( 'PaypalRedirect', false );
 210+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';return true;', 'type' => 'submit' ) );
211211 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
212212 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
213213
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter6.php
@@ -208,7 +208,7 @@
209209 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit', 'style' => 'display: none;' ) );
210210 }
211211 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
212 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'document.payment.PaypalRedirect.value=0;return true;', 'type' => 'submit' ) );
 212+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'false\';return true;', 'type' => 'submit' ) );
213213 $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
214214 $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
215215 wfMsg( 'payflowpro_gateway-donate-click' );
@@ -222,8 +222,8 @@
223223 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) );
224224 }
225225 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
226 - $form .= Html::hidden( 'PaypalRedirect', 0 );
227 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'document.payment.PaypalRedirect.value=1;return true;', 'type' => 'submit' ) );
 226+ $form .= Html::hidden( 'PaypalRedirect', false );
 227+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';return true;', 'type' => 'submit' ) );
228228 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
229229 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
230230 return $form;
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php
@@ -118,7 +118,7 @@
119119 $form .= Html::hidden( 'PaypalRedirect', false );
120120 $form .= Xml::tags( 'div',
121121 array(),
122 - Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos2.gif" ) ) . '&nbsp;&nbsp;&nbsp;<a href="#" onclick="document.payment.PaypalRedirect.value=\'true\';return true;"><img src="' . $scriptPath . '/donate_with_paypal.gif"/></a>'
 122+ Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos2.gif" ) ) . '&nbsp;&nbsp;&nbsp;<a href="#" onclick="document.payment.PaypalRedirect.value=\'true\';document.payment.submit();"><img src="' . $scriptPath . '/donate_with_paypal.gif"/></a>'
123123 );
124124 $form .= '</td>';
125125 $form .= '</tr>';
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php
@@ -55,32 +55,43 @@
5656 i,
5757 output = '',
5858 currField = '';
59 -
60 - for( i = 0; i < numFields; i++ ) {
61 - if( document.getElementById( fields[i] ).value == '' ) {
62 - currField = window['payflowproGatewayErrorMsg'+ msg[i]];
63 - output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
 59+
 60+ var doCheck = true;
 61+ if( typeof( document.payment.PaypalRedirect.value ) !== 'undefined' ) {
 62+ if( document.payment.PaypalRedirect.value == 'true' ) {
 63+ doCheck = false;
6464 }
6565 }
6666
67 - if (document.getElementById('fname').value == '$first') {
68 - output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
 67+ if( doCheck ) {
 68+ for( i = 0; i < numFields; i++ ) {
 69+ if( document.getElementById( fields[i] ).value == '' ) {
 70+ currField = window['payflowproGatewayErrorMsg'+ msg[i]];
 71+ output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
 72+ }
 73+ }
 74+
 75+ if (document.getElementById('fname').value == '$first') {
 76+ output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
 77+ }
 78+ if (document.getElementById('lname').value == '$last') {
 79+ output += payflowproGatewayErrorMsgJs + ' last name.\\r\\n';
 80+ }
 81+
 82+ // validate email address
 83+ var apos = document.payment.emailAdd.value.indexOf("@");
 84+ var dotpos = document.payment.emailAdd.value.lastIndexOf(".");
 85+
 86+ if( apos < 1 || dotpos-apos < 2 ) {
 87+ output += payflowproGatewayErrorMsgEmail;
 88+ }
6989 }
70 - if (document.getElementById('lname').value == '$last') {
71 - output += payflowproGatewayErrorMsgJs + ' last name.\\r\\n';
72 - }
73 -
74 - // validate email address
75 - var apos = document.payment.emailAdd.value.indexOf("@");
76 - var dotpos = document.payment.emailAdd.value.lastIndexOf(".");
77 -
78 - if( apos < 1 || dotpos-apos < 2 ) {
79 - output += payflowproGatewayErrorMsgEmail;
80 - }
8190
8291 if( output ) {
8392 alert( output );
8493 return false;
 94+ } else {
 95+ return true;
8596 }
8697 }
8798 </script>
@@ -152,7 +163,7 @@
153164 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
154165 if ( $this->paypal ) {
155166 $form .= Html::hidden( 'PaypalRedirect', false );
156 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';document.payment.submit();', 'type' => 'submit' ) );
 167+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';return true;', 'type' => 'submit' ) );
157168 } else {
158169 $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-cc-button' ), 'type' => 'submit' ) );
159170 $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
Property changes on: branches/fundraising/deployment/DonationInterface
___________________________________________________________________
Modified: svn:mergeinfo
160171 Merged /trunk/extensions/DonationInterface:r77023-77037

Follow-up revisions

RevisionCommit summaryAuthorDate
r77041Merging r77038 thru r77040 of trunkawjrichards22:37, 19 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77023Merging from r77001 thru r77022 of trunkawjrichards18:58, 19 November 2010
r77037Added public static keywords to static methods.tparscal22:15, 19 November 2010

Status & tagging log