r77249 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77248‎ | r77249 | r77250 >
Date:21:29, 24 November 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Merging from r77179 thru r77244 of trunk
Modified paths:
  • /branches/fundraising/deployment/DonationInterface (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/donate_interface/donate_interface.i18n.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/extras/extras.body.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/extras/extras.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter7.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/css/TwoColumnLetter7.css (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/includes/continue-button.png (added) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/extras/extras.body.php
@@ -17,33 +17,64 @@
1818 }
1919
2020 /**
21 - * Prepare a log file
 21+ * Prepare logging mechanism
 22+ *
 23+ * If 'syslog' is specified, we can use the syslogger. If a file
 24+ * is specified, we'll writ to the file. Otherwise, do nothing.
2225 *
2326 * @param string path to log file
24 - * @return resource Pointer for the log file
2527 */
2628 protected function prepare_log_file( $log_file ) {
27 - $this->log_fh = fopen( $log_file, 'a+' );
 29+
 30+ if ( strtolower( $log_file ) == "syslog" ) {
 31+
 32+ $this->log_fh = 'syslog';
 33+
 34+ } elseif( is_file( $log_file )) {
 35+
 36+ $this->log_fh = fopen( $log_file, 'a+' );
 37+
 38+ } else {
 39+
 40+ $this->log_fh = null;
 41+
 42+ }
2843 }
2944
3045 /**
31 - * Writes message to a log file
 46+ * Writes message to the log
3247 *
33 - * If a log file does not exist and could not be created,
 48+ * If a log file does not exist and we are not using syslog,
3449 * do nothing.
3550 * @fixme Perhaps lack of log file can be handled better?
3651 * @param string The message to log
3752 */
38 - public function log( $id = '', $status = '', $data = '' ) {
 53+ public function log( $id = '', $status = '', $data = '', $log_level=LOG_INFO ) {
3954 if ( !$this->log_fh ) {
4055 echo "what log file?";
4156 return;
4257 }
 58+
 59+ // format the message
4360 $msg = '"' . date( 'c' ) . '"';
4461 $msg .= "\t" . '"' . $id . '"';
4562 $msg .= "\t" . '"' . $status . '"';
4663 $msg .= "\t" . $data . "\n";
47 - fwrite( $this->log_fh, $msg );
 64+
 65+ // write to the log
 66+ if ( $this->log_fh == 'syslog' ) { //use syslog facility
 67+ // replace tabs with spaces - maybe do this universally? cuz who needs tabs.
 68+ $msg = str_replace( "\t", " ", $msg );
 69+
 70+ openlog( "payflowpro_gateway_trxn", LOG_ODELAY, LOG_SYSLOG );
 71+ syslog( $log_level, $msg );
 72+ closelog();
 73+
 74+ } else { //write to file
 75+
 76+ fwrite( $this->log_fh, $msg );
 77+
 78+ }
4879 }
4980
5081 /**
@@ -74,6 +105,6 @@
75106 * Close the open log file handler if it's open
76107 */
77108 public function __destruct() {
78 - if ( $this->log_fh ) fclose( $this->log_fh );
 109+ if ( is_resource( $this->log_fh ) ) fclose( $this->log_fh );
79110 }
80111 }
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/extras/extras.php
@@ -26,4 +26,4 @@
2727 $wgPayflowGatewayLog = '';
2828
2929 $dir = dirname( __FILE__ ) . "/";
30 -$wgAutoloadClasses['PayflowProGateway_Extras'] = $dir . "extras.body.php";
 30+$wgAutoloadClasses['PayflowProGateway_Extras'] = $dir . "extras.body.php";
\ No newline at end of file
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter7.php
@@ -214,9 +214,9 @@
215215 $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
216216 $form .= '</tr>';
217217 $form .= '<tr>';
218 - $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount' ) . '</td>';
 218+ $form .= '<td class="label" style="position:relative;top:4px;">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount' ) . '</td>';
219219 $form .= '<td>' .
220 - '<table cellspacing="3" cellpadding="0" border="0" style="margin-bottom:0.5em;"><tr>' .
 220+ '<table cellspacing="3" cellpadding="0" border="0" style="margin-bottom:0.2em;"><tr>' .
221221 '<td>'.Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$20 '.'</td>'.
222222 '<td>'.Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$35 '.'</td>'.
223223 '<td>'.Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$50 '.'</td>'.
@@ -245,13 +245,17 @@
246246 */
247247
248248 $form .= '<tr>';
249 - $form .= '<td class="label">' . wfMsg( 'payflowpro_gateway-payment-type' ) . '</td>';
 249+ $form .= '<td class="label" style="position:relative;top:8px;">' . wfMsg( 'payflowpro_gateway-payment-type' ) . '</td>';
250250 $form .= '<td>' .
 251+ '<p style="border: 1px solid rgb(187, 187, 187); float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0 8px 0 0; padding: 5px 5px 5px 3px;">'.
251252 Xml::radio( 'card', 'cc1', $this->form_data['card'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-visa.png" ) ). '</label>' .
252 - Xml::radio( 'card', 'cc2', $this->form_data['card'] == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-mastercard.png" ) ). '</label>' .
253 - Xml::radio( 'card', 'cc3', $this->form_data['card'] == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-amex.png" ) ). '</label>' .
254 - Xml::radio( 'card', 'cc4', $this->form_data['card'] == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-discover.png" ) ). '</label>' .
 253+ '&nbsp;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-mastercard.png" ) ). '</label>' .
 254+ '&nbsp;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-amex.png" ) ). '</label>' .
 255+ '&nbsp;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-discover.png" ) ). '</label>' .
 256+ '</p>'.
 257+ '<p style="border: 1px solid transparent; float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0; padding: 5px 5px 5px 3px;">'.
255258 Xml::radio( 'card', 'pp', $this->form_data['card'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-paypal.png" ) ) . '</label>' .
 259+ '</p>'.
256260 '</td>';
257261 $form .= '</tr>';
258262
@@ -375,7 +379,7 @@
376380 }
377381 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
378382 $form .= Html::hidden( 'PaypalRedirect', 0 );
379 - $form .= Xml::element( 'input', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/submit-donation-button.png", 'alt' => 'Submit donation', 'onclick' => 'document.payment.PaypalRedirect.value=1;return true;', 'type' => 'image' ) );
 383+ $form .= Xml::element( 'input', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/continue-button.png", 'alt' => 'Submit donation', 'onclick' => 'document.payment.PaypalRedirect.value=1;return true;', 'type' => 'image' ) );
380384 $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
381385 $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
382386 Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/padlock.gif", 'style' => 'vertical-align:baseline;margin-right:4px;' ) ) . 'Your donation will be securely processed.';
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/css/TwoColumnLetter7.css
@@ -45,14 +45,6 @@
4646 width: 100%;
4747 }
4848
49 -#payflowpro_gateway-cc_form_form {
50 - width: 475px;
51 - float: right;
52 - margin-left: 2em;
53 - padding-left: 2em;
54 - border-left: 1px solid #BBBBBB;
55 -}
56 -
5749 #payflowpro_gateway-cc_form_letter {
5850 height: 100%;
5951 }
@@ -106,7 +98,7 @@
10799 background-color:#cce7cd;
108100 border:1px solid #5EAC58;
109101 padding:16px 24px 24px;
110 - width:450px;
 102+ width:430px;
111103 }
112104 #donate-head {
113105 border:none;
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/includes/continue-button.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/includes/continue-button.png
___________________________________________________________________
Added: svn:mime-type
114106 + application/octet-stream
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
@@ -2066,7 +2066,7 @@
20672067 'payflowpro_gateway-cancel' => 'Storno',
20682068 'payflowpro_gateway-payment' => 'Platba',
20692069 'payflowpro_gateway-payment-type' => 'Způsob platby',
2070 - 'payflowpro_gateway-please-complete' => 'Prosíme, níže dokončete svůj příspěvek…',
 2070+ 'payflowpro_gateway-please-complete' => 'Prosíme, dokončete níže svůj příspěvek…',
20712071 'payflowpro_gateway-description' => 'Popis',
20722072 'payflowpro_gateway-donation' => 'Příspěvek',
20732073 'payflowpro_gateway-email-receipt' => 'E-mailové potvrzení na',
@@ -2867,7 +2867,7 @@
28682868 * @author Yekrats
28692869 */
28702870 $messages['eo'] = array(
2871 - 'payflowprogateway' => 'Subtenu Vikimedion',
 2871+ 'payflowprogateway' => 'Donacu nun',
28722872 'payflowpro_gateway-desc' => 'PayPal Payflow Pro kreditkcarta proceso',
28732873 'payflowpro_gateway-accessible' => 'Ĉi tiu paĝo estas alirebla nur el la donacpaĝo.',
28742874 'payflowpro_gateway-form-message' => 'Uzu la jenan formularon donaci per kreditkarto, aŭ',
@@ -9473,6 +9473,7 @@
94749474 * @author Ainali
94759475 * @author Boivie
94769476 * @author Cohan
 9477+ * @author GameOn
94779478 * @author Nghtwlkr
94789479 * @author Per
94799480 */
@@ -9573,6 +9574,14 @@
95749575 'payflowpro_gateway-noscript-msg' => 'Det verkar som om du inte har JavaScript aktiverat alternativt att din webbläsare stödjer inte det.
95759576 För att tillhandahålla en säker, trygg och behaglig upplevelse, kräver vårt donationsformulär JavaScript.',
95769577 'payflowpro_gateway-noscript-redirect-msg' => 'Om du inte kan eller inte vill aktivera JavaScript, kan du bidra ändå genom att besöka:',
 9578+ 'payflowpro_gateway-or' => 'eller',
 9579+ 'payflowpro_gateway-company-name' => 'Företag eller organisation',
 9580+ 'payflowpro_gateway-apartment-number' => 'Lägenhet',
 9581+ 'payflowpro_gateway-country' => 'Land',
 9582+ 'payflowpro_gateway-telephone' => 'Telefon',
 9583+ 'payflowpro_gateway-next' => 'Nästa',
 9584+ 'payflowpro_gateway-continue' => 'Fortsätt',
 9585+ 'payflowpro_gateway-cancel' => 'Avbryt',
95779586 );
95789587
95799588 /** Swahili (Kiswahili)
Index: branches/fundraising/deployment/DonationInterface/donate_interface/donate_interface.i18n.php
@@ -2512,17 +2512,17 @@
25132513 'donate_interface-comment-label' => 'Maoni:',
25142514 'donate_interface-anon-message' => 'Tafadhali andika jina langu (kando ya maoni yangu) katika orodha ya wachangiaji inayotolewa kwa watu wote.',
25152515 'donate_interface-email-agreement' => 'Nakubali nipokee taarifa mara kwa mara kutoka Wikimedia Foundation.',
2516 - 'donate_interface-comment-title' => 'Maoni yatakayotolewa kwa watu wote',
 2516+ 'donate_interface-comment-title' => 'Maoni ya umma',
25172517 'donate_interface-amount-error' => '**Tafadhali ingiza kiasi halali**',
2518 - 'donate_interface-processing-error' => 'Imetokea hitilafu wakati wa kufanyika ombi lako.
2519 -Mashine ya kufanyika malipo haipatikani.',
 2518+ 'donate_interface-processing-error' => 'Kumetokea hitilafu wakati wa uchakataji wa ombi lako.
 2519+Hakuna vichakataji vinavyopatikana.',
25202520 'donate_interface-GBP' => 'GBP: Pauni ya Uingereza',
25212521 'donate_interface-EUR' => 'EUR: Euro',
2522 - 'donate_interface-USD' => 'USD: Dola ya U.S.A.',
 2522+ 'donate_interface-USD' => 'USD: Dola ya Marekani',
25232523 'donate_interface-AUD' => 'AUD: Dola ya Australia',
25242524 'donate_interface-CAD' => 'CAD: Dola ya Kanada',
25252525 'donate_interface-CZK' => 'CZK: Koruna ya Ucheki',
2526 - 'donate_interface-DKK' => 'DKK: Krone ya Udeni',
 2526+ 'donate_interface-DKK' => 'DKK: Krone ya Denmark',
25272527 'donate_interface-HKD' => 'HKD: Dola ya Hong Kong',
25282528 'donate_interface-NZD' => 'NZD: Dola ya New Zealand',
25292529 'donate_interface-SGD' => 'SGD: Dola ya Singapore',
Property changes on: branches/fundraising/deployment/DonationInterface
___________________________________________________________________
Modified: svn:mergeinfo
25302530 Merged /trunk/extensions/DonationInterface:r77179-77244

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77179Merging from r77174 thru r77178 of trunkawjrichards20:05, 23 November 2010
r77244finishing toucheskaldari20:06, 24 November 2010

Status & tagging log