https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106375

Revision: 106375
Author:   awjrichards
Date:     2011-12-15 21:29:49 +0000 (Thu, 15 Dec 2011)
Log Message:
-----------
MFT r103611, r103620, r103622, r104210, r104368, r106136, r106367

Modified Paths:
--------------
    
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.php
    
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php
    
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php

Property Changed:
----------------
    branches/wmf/1.18wmf1/extensions/ContributionTracking/
    
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php
    
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php


Property changes on: branches/wmf/1.18wmf1/extensions/ContributionTracking
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/wmf/1.16wmf4/extensions/ContributionTracking:67177,69199,76243,77266
/branches/wmf-deployment/extensions/ContributionTracking:60970
/trunk/extensions/ContributionReporting:74440-74491
/trunk/extensions/ContributionTracking:64690-95543
/trunk/phase3/extensions/ContributionTracking:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573
   + 
/branches/wmf/1.16wmf4/extensions/ContributionTracking:67177,69199,76243,77266
/branches/wmf-deployment/extensions/ContributionTracking:60970
/trunk/extensions/ContributionReporting:74440-74491
/trunk/extensions/ContributionTracking:64690-95543,103611,103620,103622,104210,104368,106136,106367
/trunk/phase3/extensions/ContributionTracking:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573

Modified: 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.php
===================================================================
--- 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.php  
    2011-12-15 21:27:42 UTC (rev 106374)
+++ 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.php  
    2011-12-15 21:29:49 UTC (rev 106375)
@@ -12,7 +12,7 @@
 $wgExtensionCredits['specialpage'][] = array(
        'path'           => __FILE__,
        'name'           => 'ContributionTracking',
-       'url'            => 
'http://www.mediawiki.org/wiki/Extension:ContributionTracking',
+       'url'            => 
'https://www.mediawiki.org/wiki/Extension:ContributionTracking',
        'author'         => 'David Strauss',
        'descriptionmsg' => 'contributiontracking-desc',
 );
@@ -33,7 +33,7 @@
 
 $wgAutoloadClasses['ApiContributionTracking'] = $dir . 
'ApiContributionTracking.php';
 $wgAutoloadClasses['ContributionTrackingProcessor'] = $dir . 
'ContributionTracking.processor.php';
-
+ 
 //this only works if contribution tracking is inside a mediawiki DB, which 
typically it isn't.
 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efContributionTrackingLoadUpdates';
 
@@ -75,6 +75,12 @@
  */
 $wgContributionTrackingPayPalBusiness = '[email protected]';
 
+/**
+ * Recurring PayPal subscription Length. Default of 0 is unlimited until 
canceled
+ */
+
+$wgContributionTrackingRPPLength = '0';
+
 # Unit tests
 $wgHooks['UnitTestsList'][] = 'efContributionTrackingUnitTests';
 
@@ -109,7 +115,7 @@
        } else {
                global $wgContributionTrackingDBname;
 
-               if($updater->getDB()->getDBName() === 
$wgContributionTrackingDBname) {
+               if( $updater->getDB()->getDBname() === 
$wgContributionTrackingDBname ) {
                        $updater->addExtensionTable( 'contribution_tracking', 
$dir . 'ContributionTracking.sql' );
                        $updater->addExtensionTable( 
'contribution_tracking_owa_ref', $dir . 'ContributionTracking_OWA_ref.sql' );
                        $updater->addExtensionUpdate( array( 'addField', 
'contribution_tracking', 'owa_session',

Modified: 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php
===================================================================
--- 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php
    2011-12-15 21:27:42 UTC (rev 106374)
+++ 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php
    2011-12-15 21:29:49 UTC (rev 106375)
@@ -151,7 +151,7 @@
 
        /**
         * Effectively changes the name of a key in an array. If the key does 
not
-        * exist, no change is made. 
+        * exist, no change is made.
         * @param array $array The array to rekey (by reference)
         * @param string $oldkey The key to change
         * @param string $newkey The new value for the key
@@ -169,7 +169,7 @@
         * table.
         * For these values, if the key exists (and is not explicit false), it 
is
         * received as "true". Therefore, the rekey'd value should be false.
-        * However, the old key not existing isn't exactly conclusive. 
+        * However, the old key not existing isn't exactly conclusive.
         * @param array $array The array to rekey (by reference)
         * @param string $oldkey The key to change
         * @param string $invertedkey The key meant to contain the inverted 
boolean
@@ -255,12 +255,12 @@
                        'notify_url' => '',
                        'item_name' => '',
                        'address1' => '',
-                       'city' => '',                   
+                       'city' => '',
                        'state' => '',
                        'zip' => '',
                        'country' => 'US',
                        'address_override' => '0'
-                       
+
                );
        }
 
@@ -301,7 +301,7 @@
         * gateway to complete the transaction.
         */
        static function getRepostFields( $input ) {
-               global $wgContributionTrackingPayPalBusiness, 
$wgContributionTrackingReturnToURLDefault;
+               global $wgContributionTrackingPayPalBusiness, 
$wgContributionTrackingReturnToURLDefault, $wgContributionTrackingRPPLength;
                // Set the action and tracking ID fields
                $input = ContributionTrackingProcessor::stage_repost( $input );
 
@@ -331,7 +331,7 @@
                        if ( $returnTitle ) {
                                $returnto = wfExpandUrl( 
$returnTitle->getFullUrl(), PROTO_CURRENT );
                        } else {
-                               $returnto = 
$wgContributionTrackingReturnToURLDefault . "/$language";
+                               $returnto = 
$wgContributionTrackingReturnToURLDefault . "/$language"; // FIXME: $language 
is undefined
                        }
                        $repost['fields']['return'] = $returnto;
                        $repost['fields']['currency_code'] = 
$input['currency_code'];
@@ -378,7 +378,7 @@
 
                                $repost['fields']['t3'] = "M"; // The unit of 
measurement for for p3 (M = month)
                                $repost['fields']['p3'] = '1'; // Billing cycle 
duration
-                               $repost['fields']['srt'] = '12'; // # of 
billing cycles
+                               $repost['fields']['srt'] = 
$wgContributionTrackingRPPLength; // # of billing cycles
                                $repost['fields']['src'] = '1'; // Make this 
'recurring'
                                $repost['fields']['sra'] = '1'; // Turn on 
re-attempt on failure
                                $repost['fields']['cmd'] = 
'_xclick-subscriptions';
@@ -390,7 +390,7 @@
                                $repost['fields']['notify_url'] = 
$input['notify_url'];
                                $repost['fields']['item_name'] = 
$input['item_name'];
                        }
-               } else if ( $input['gateway'] == 'moneybookers' ) {
+               } elseif ( $input['gateway'] == 'moneybookers' ) {
                        $repost['action'] = 
'https://www.moneybookers.com/app/payment.pl';
 
                        // Tracking
@@ -408,10 +408,12 @@
                }
 
                // Normalized amount
-               $repost['fields'][$amount_field_name] = $input['amount'];
-               if ( $input['amount_given'] ) {
-                       $repost['fields'][$amount_field_name] = 
$input['amount_given'];
+               $amount = $input['amount'];
+               // If amount is not a number, use amount_given
+               if ( !( preg_match( '/^\d+(\.(\d+)?)?$/', $amount ) ) && 
$input['amount_given'] ) {
+                       $amount = $input['amount_given'];
                }
+               $repost['fields'][$amount_field_name] = $amount;
 
                // Tracking
                $repost['fields']['custom'] = 
$input['contribution_tracking_id'];


Property changes on: 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.processor.php:67177,69199,76243,77266
/branches/wmf-deployment/extensions/ContributionTracking/ContributionTracking.processor.php:60970
/trunk/extensions/ContributionReporting/ContributionTracking.processor.php:74440-74491
/trunk/extensions/ContributionTracking/ContributionTracking.processor.php:64690-95543,95664-96036
/trunk/phase3/extensions/ContributionTracking/ContributionTracking.processor.php:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573
   + 
/branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.processor.php:67177,69199,76243,77266
/branches/wmf-deployment/extensions/ContributionTracking/ContributionTracking.processor.php:60970
/trunk/extensions/ContributionReporting/ContributionTracking.processor.php:74440-74491
/trunk/extensions/ContributionTracking/ContributionTracking.processor.php:64690-95543,95664-96036,103611,103620,103622,104210,104368,106136,106367
/trunk/phase3/extensions/ContributionTracking/ContributionTracking.processor.php:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573

Modified: 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php
===================================================================
--- 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php
 2011-12-15 21:27:42 UTC (rev 106374)
+++ 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php
 2011-12-15 21:29:49 UTC (rev 106375)
@@ -76,7 +76,7 @@
 
                $repost = ContributionTrackingProcessor::getRepostFields( 
$params );
 
-               $wgOut->addWikiText( "{{2009/Donate-banner/$language}}" );
+               #$wgOut->addWikiText( "{{2009/Donate-banner/$language}}" );
                $wgOut->addHTML( $this->msgWiki( 'contrib-tracking-submitting' 
) );
 
                // Output the repost form


Property changes on: 
branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_body.php:67177,69199,76243,77266
/branches/wmf-deployment/extensions/ContributionTracking/ContributionTracking_body.php:60970
/trunk/extensions/ContributionReporting/ContributionTracking_body.php:74440-74491
/trunk/extensions/ContributionTracking/ContributionTracking_body.php:64690-96037
/trunk/phase3/extensions/ContributionTracking/ContributionTracking_body.php:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573
   + 
/branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_body.php:67177,69199,76243,77266
/branches/wmf-deployment/extensions/ContributionTracking/ContributionTracking_body.php:60970
/trunk/extensions/ContributionReporting/ContributionTracking_body.php:74440-74491
/trunk/extensions/ContributionTracking/ContributionTracking_body.php:64690-96037,103622,104210,104368,106136,106367
/trunk/phase3/extensions/ContributionTracking/ContributionTracking_body.php:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to