r58589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58588‎ | r58589 | r58590 >
Date:16:56, 5 November 2009
Author:diana
Status:ok
Tags:
Comment:
another few code changes, internationalize currency
Modified paths:
  • /trunk/extensions/DonationInterface/donate_interface/donate_interface.i18n.php (modified) (history)
  • /trunk/extensions/DonationInterface/donate_interface/donate_interface.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php (modified) (history)
  • /trunk/extensions/DonationInterface/paypal_gateway/paypal_gateway.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
@@ -89,6 +89,6 @@
9090 global $wgScript;
9191
9292 $url['payflow'] = 'https://payments.wikimedia.org/index.php' . '?title=Special:PayflowProGateway';
93 -
 93+
9494 return true;
9595 }
Index: trunk/extensions/DonationInterface/paypal_gateway/paypal_gateway.php
@@ -82,7 +82,7 @@
8383 //$url['paypal'] = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=" . urlencode( $wgPaypalEmail ) . "&lc=US&no_note=1&no_shipping=1&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted";
8484
8585 // specifically for Wikimedia, goes to processor page
86 - $url['paypal'] = 'http://wikimediafoundation.org/wiki/Special:ContributionTracking/?';
 86+ $url['paypal'] = 'http://wikimediafoundation.org/wiki/Special:ContributionTracking?';
8787
8888 return true;
8989 }
Index: trunk/extensions/DonationInterface/donate_interface/donate_interface.php
@@ -66,7 +66,6 @@
6767 // add JavaScript validation to <head>
6868 $wgOut->addScriptFile( $wgScriptPath . '/extensions/DonationInterface/donate_interface/donate_interface_validate_donation.js' );
6969
70 -
7170 //display form to gather data from user
7271 $output = fnDonateCreateOutput();
7372
@@ -166,7 +165,7 @@
167166 if ( $code == $default_currency ) {
168167 $selected = ' selected="selected"';
169168 }
170 - $currency_options .= '<option value="' . $code . '"' . $selected . '>' . $name . '</option>';
 169+ $currency_options .= '<option value="' . $code . '"' . $selected . '>' . wfMsg( 'donate_interface-' . $code ) . '</option>';
171170 }
172171
173172 $currencyFields = Xml::openElement( 'select', array( 'name' => 'currency_code', 'id' => "input_currency_code" )) .
@@ -193,8 +192,7 @@
194193
195194 $output .= Xml::fieldset(wfMsg( 'donate_interface-comment-title' ), $publicComment, array( 'class' => 'mw-donation-public-comment'));
196195
197 - $output .= Xml::hidden( 'process', '_yes_' ) .
198 - Xml::submitButton(wfMsg( 'donate_interface-submit-button' ));
 196+ $output .= Xml::submitButton(wfMsg( 'donate_interface-submit-button' ));
199197
200198 $output .= Xml::closeElement( 'form' );
201199
@@ -321,9 +319,9 @@
322320 'comment-option' => '',
323321 'email' => '',
324322 );
325 -
 323+
326324 // if form has been submitted, assign data and redirect user to chosen payment gateway
327 - if ( isset($_POST['process']) && $_POST['process'] == "_yes_" ) {
 325+ if ( $wgRequest->wasPosted() ) {
328326 //find out which amount option was chosen for amount, redefined buttons or text box
329327 if ( isset($_POST['amount']) && preg_match('/^\d+(\.(\d+)?)?$/', $wgRequest->getText('amount')) ) {
330328 $amount = number_format( $wgRequest->getText('amount'), 2 );
@@ -345,8 +343,8 @@
346344 'utm_campaign' => $wgRequest->getText( 'utm_campaign', '' ),
347345 'language' => $wgRequest->getText( 'language', 'en' ),
348346 'comment' => $wgRequest->getText( 'comment', '' ),
349 - 'comment-option' => $wgRequest->getText( 'comment-option', '1' ),
350 - 'email' => $wgRequest->getText( 'opt', '1' ),
 347+ 'comment-option' => $wgRequest->getText( 'comment-option', '0' ),
 348+ 'email' => $wgRequest->getText( 'opt', '0' ),
351349 );
352350
353351 // ask payment processor extensions for their URL/page title
@@ -366,3 +364,4 @@
367365 return true;
368366 }
369367
 368+
Index: trunk/extensions/DonationInterface/donate_interface/donate_interface.i18n.php
@@ -33,6 +33,23 @@
3434 'donate_interface-small-amount-value' => '30',
3535 'donate_interface-amount-error' => '**Please enter a valid amount**',
3636 'donate_interface-processing-error' => 'There has been an error processing your request. No processor are available.',
 37+ 'donate_interface-GBP' => 'GBP: British Pound',
 38+ 'donate_interface-EUR' => 'EUR: Euro',
 39+ 'donate_interface-USD' => 'USD: U.S. Dollar',
 40+ 'donate_interface-AUD' => 'AUD: Australian Dollar',
 41+ 'donate_interface-CAD' => 'CAD: Canadian Dollar',
 42+ 'donate_interface-CHF' => 'CHF: Swiss Franc',
 43+ 'donate_interface-CZK' => 'CZK: Czech Koruna',
 44+ 'donate_interface-DKK' => 'DKK: Danish Krone',
 45+ 'donate_interface-HKD' => 'HKD: Hong Kong Dollar',
 46+ 'donate_interface-HUF' => 'HUF: Hungarian Forint',
 47+ 'donate_interface-JPY' => 'JPY: Japanese Yen',
 48+ 'donate_interface-NZD' => 'NZD: New Zealand Dollar',
 49+ 'donate_interface-NOK' => 'NOK: Norwegian Krone',
 50+ 'donate_interface-PLN' => 'PLN: Polish Zloty',
 51+ 'donate_interface-SGD' => 'SGD: Singapore Dollar',
 52+ 'donate_interface-SEK' => 'SEK: Swedish Krona',
 53+ 'donate_interface-ILS' => 'ILS: Isreali Shekel',
3754 );
3855
3956 /** Message documentation (Message documentation)

Follow-up revisions

RevisionCommit summaryAuthorDate
r58601picking up r58589, r58596tomasz19:46, 5 November 2009

Status & tagging log