r78136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78135‎ | r78136 | r78137 >
Date:20:10, 9 December 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Syncing ContributionTracking from r74494 through r78134
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.alias.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.i18n.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.sql (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_OWA_ref.sql (added) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_body.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ContributionTracking/patch-owa.sql (added) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.alias.php
@@ -78,7 +78,7 @@
7979 'ContributionTracking' => array( '기여추적' ),
8080 );
8181
82 -/** Ripoarisch (Ripoarisch) */
 82+/** Colognian (Ripoarisch) */
8383 $specialPageAliases['ksh'] = array(
8484 'ContributionTracking' => array( 'MetmaacherVerfoljung' ),
8585 );
@@ -151,4 +151,4 @@
152152 /**
153153 * For backwards compatibility with MediaWiki 1.15 and earlier.
154154 */
155 -$aliases =& $specialPageAliases;
\ No newline at end of file
 155+$aliases =& $specialPageAliases;
Property changes on: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.alias.php
___________________________________________________________________
Deleted: svn:mergeinfo
156156 Reverse-merged /trunk/extensions/ContributionTracking/ContributionTracking.alias.php:r64690-74436,74440-78133
157157 Reverse-merged /trunk/phase3/extensions/ContributionTracking/ContributionTracking.alias.php:r63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573
158158 Reverse-merged /trunk/extensions/ContributionReporting/ContributionTracking.alias.php:r74440-74491
159159 Reverse-merged /branches/wmf-deployment/extensions/ContributionTracking/ContributionTracking.alias.php:r60970
Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.sql
@@ -1,4 +1,4 @@
2 -CREATE TABLE `contribution_tracking` (
 2+CREATE TABLE IF NOT EXISTS /*_*/`contribution_tracking` (
33 `id` int(10) unsigned NOT NULL auto_increment,
44 `contribution_id` int(10) unsigned default NULL,
55 `note` text,
@@ -13,4 +13,4 @@
1414 PRIMARY KEY (`id`),
1515 UNIQUE KEY `contribution_id` (`contribution_id`),
1616 KEY `ts` (`ts`)
17 -) /*wgDBTableOptions/*;
 17+) /*wgDBTableOptions*/;
Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/patch-owa.sql
@@ -0,0 +1,5 @@
 2+--
 3+-- create contribution_tracking.owa_session and owa_ref
 4+--
 5+ALTER TABLE /*_*/contribution_tracking ADD owa_session varbinary(255);
 6+ALTER TABLE /*_*/contribution_tracking ADD owa_ref INTEGER;
Property changes on: branches/wmf/1.16wmf4/extensions/ContributionTracking/patch-owa.sql
___________________________________________________________________
Added: svn:eol-style
17 + native
Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_OWA_ref.sql
@@ -0,0 +1,14 @@
 2+--
 3+-- Schema for OWA_ref
 4+--
 5+-- Used to normalize target pages for OWA "conversions"
 6+--
 7+
 8+CREATE TABLE IF NOT EXISTS /*_*/contribution_tracking_owa_ref (
 9+ -- URL of event
 10+ url VARBINARY(255) unique,
 11+
 12+ -- event ID
 13+ id INTEGER AUTO_INCREMENT PRIMARY KEY
 14+) /*$wgDBTableOptions*/;
 15+
Property changes on: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_OWA_ref.sql
___________________________________________________________________
Added: svn:eol-style
116 + native
Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking_body.php
@@ -5,16 +5,36 @@
66 parent::__construct( 'ContributionTracking' );
77 }
88
 9+ function get_owa_ref_id($ref){
 10+ // Replication lag means sometimes a new event will not exist in the table yet
 11+ $dbw = contributionTrackingConnection(); //wfGetDB( DB_MASTER );
 12+ $id_num = $dbw->selectField(
 13+ 'contribution_tracking_owa_ref',
 14+ 'id',
 15+ array( 'url' => $ref ),
 16+ __METHOD__
 17+ );
 18+ // Once we're on mysql 5, we can use replace() instead of this selectField --> insert or update hooey
 19+ if ( $id_num === false ) {
 20+ $dbw->insert(
 21+ 'contribution_tracking_owa_ref',
 22+ array( 'url' => (string) $event_name ),
 23+ __METHOD__
 24+ );
 25+ $id_num = $dbw->insertId();
 26+ }
 27+ return $id_num === false ? 0 : $id_num;
 28+ }
 29+
 30+
931 function execute( $language ) {
10 - global $wgRequest, $wgOut;
11 - wfLoadExtensionMessages( 'ContributionTracking' );
 32+ global $wgRequest, $wgOut, $wgContributionTrackingPayPalIPN, $wgContributionTrackingReturnToURLDefault,
 33+ $wgContributionTrackingPayPalRecurringIPN, $wgContributionTrackingPayPalBusiness;
1234
1335 if ( !preg_match( '/^[a-z-]+$/', $language ) ) {
1436 $language = 'en';
1537 }
1638 $this->lang = Language::factory( $language );
17 - wfLoadExtensionMessages( 'ContributionTracking' );
18 - wfLoadExtensionMessages( 'ContributionTracking', $language );
1939
2040 $this->setHeaders();
2141
@@ -28,6 +48,11 @@
2949
3050 $ts = $db->timestamp();
3151
 52+ $owa_ref = $wgRequest->getText('owa_ref', null);
 53+ if($owa_ref != null && !is_numeric($owa_ref)){
 54+ $owa_ref = $this->get_owa_ref_id($owa_ref);
 55+ }
 56+
3257 $tracked_contribution = array(
3358 'note' => $wgRequest->getText('comment', null),
3459 'referrer' => $wgRequest->getText('referrer', null),
@@ -37,6 +62,8 @@
3863 'utm_campaign' => $wgRequest->getText('utm_campaign', null),
3964 'optout' => ($wgRequest->getCheck('email-opt', 0) ? 0 : 1),
4065 'language' => $wgRequest->getText('language', null),
 66+ 'owa_session' => $wgRequest->getText('owa_session', null),
 67+ 'owa_ref' => $owa_ref,
4168 'ts' => $ts,
4269 );
4370
@@ -58,33 +85,57 @@
5986 if( $returnTitle ) {
6087 $returnto = $returnTitle->getFullUrl();
6188 } else {
62 - $returnto = "http://wikimediafoundation.org/wiki/Thank_You/$language";
 89+ $returnto = $wgContributionTrackingReturnToURLDefault . "/$language";
6390 }
6491
6592 // Set the action and tracking ID fields
6693 $repost = array();
6794 $action = 'http://wikimediafoundation.org/';
 95+ $amount_field_name = 'amount'; // the amount fieldname may be different depending on the service
6896 if ( $gateway == 'paypal' ) {
 97+
6998 $action = 'https://www.paypal.com/cgi-bin/webscr';
 99+
 100+ /*
 101+ Commenting this out until we're ready to launch premiums.
 102+ // Premiums
 103+ if ( $wgRequest->getCheck( 'shirt') ) {
 104+ $repost['on0'] = 'Shirt Size';
 105+ $repost['os0'] = $wgRequest->getText( 'size', null );
 106+ $repost['no_shipping'] = 2;
 107+ }
 108+ */
70109
71110 // Tracking
72111 $repost['on0'] = 'contribution_tracking_id';
73112
74113 // PayPal
75 - $repost['business'] = 'donations@wikimedia.org';
 114+ $repost['business'] = $wgContributionTrackingPayPalBusiness;
76115 $repost['item_name'] = 'One-time donation';
77116 $repost['item_number'] = 'DONATE';
78 - $repost['cmd'] = '_xclick';
79117 $repost['no_note'] = '0';
80 - $repost['notify_url'] = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal';
81118 $repost['return'] = $returnto;
82 -
83119 $repost['currency_code'] = $wgRequest->getText( 'currency_code', 'USD' );
84120
85121 // additional fields to pass to PayPal from single-step credit card form
86122 $repost[ 'first_name' ] = $wgRequest->getText( 'fname', null );
87123 $repost[ 'last_name' ] = $wgRequest->getText( 'lname', null );
88124 $repost[ 'email' ] = $wgRequest->getText( 'email', null );
 125+
 126+ // if this is a recurring donation, we have add'l fields to send to paypal
 127+ if ( $wgRequest->getText( 'recurring_paypal' ) == 'true' ) {
 128+ $repost[ 't3' ] = "M"; // The unit of measurement for for p3 (M = month)
 129+ $repost[ 'p3' ] = '1'; // Billing cycle duration
 130+ $repost[ 'srt' ] = '12'; // # of billing cycles
 131+ $repost[ 'src' ] = '1'; // Make this 'recurring'
 132+ $repost[ 'sra' ] = '1'; // Turn on re-attempt on failure
 133+ $repost[ 'cmd' ] = '_xclick-subscriptions';
 134+ $amount_field_name = 'a3';
 135+ $repost['notify_url'] = $wgContributionTrackingPayPalRecurringIPN;
 136+ } else {
 137+ $repost['cmd'] = '_xclick';
 138+ $repost['notify_url'] = $wgContributionTrackingPayPalIPN;
 139+ }
89140 }
90141 else if ( $gateway == 'moneybookers' ) {
91142 $action = 'https://www.moneybookers.com/app/payment.pl';
@@ -104,13 +155,15 @@
105156 }
106157
107158 // Normalized amount
108 - $repost['amount'] = $wgRequest->getVal( 'amount' );
 159+ $repost[ $amount_field_name ] = $wgRequest->getVal( 'amount' );
109160 if ( $wgRequest->getVal( 'amountGiven' ) ) {
110 - $repost['amount'] = $wgRequest->getVal( 'amountGiven' );
 161+ $repost[ $amount_field_name ] = $wgRequest->getVal( 'amountGiven' );
111162 }
112163
113164 // Tracking
 165+ // passing contrib tracking id in two places to ease transition to new model (custom field)
114166 $repost['os0'] = $contribution_tracking_id;
 167+ $repost['custom'] = $contribution_tracking_id;
115168
116169 $wgOut->addWikiText( "{{2009/Donate-banner/$language}}" );
117170 $wgOut->addHTML( $this->msgWiki( 'contrib-tracking-submitting' ) );
@@ -143,6 +196,7 @@
144197 return wfMsgExt( $key, array( 'escape', 'language' => $this->lang ) );
145198 }
146199
 200+
147201 function msgWiki( $key ) {
148202 return wfMsgExt( $key, array( 'parse', 'language' => $this->lang ) );
149203 }
Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.i18n.php
@@ -20,7 +20,7 @@
2121
2222 'contrib-tracking-submitting' => 'Submitting to payment processor...',
2323 'contrib-tracking-continue' => 'If you are not automatically redirected, click the button to complete your donation at PayPal.',
24 - 'contrib-tracking-redirect' => 'You will be automatically redirected to complete your donation at PayPal.',
 24+ 'contrib-tracking-redirect' => 'You will be automatically redirected to PayPal to complete your donation.',
2525
2626 'contrib-tracking-button' => 'Continue',
2727
@@ -94,6 +94,19 @@
9595 'contrib-tracking-button' => 'استمر',
9696 );
9797
 98+/** Bashkir (Башҡорт)
 99+ * @author Assele
 100+ */
 101+$messages['ba'] = array(
 102+ 'contributiontracking-desc' => 'Викимедиа файҙаһына иғәнә йыйыуҙы күҙәтеү',
 103+ 'contributiontracking' => 'Иғәнә йыйыуҙы күҙәтеү',
 104+ 'contrib-tracking-error' => 'Хата',
 105+ 'contrib-tracking-error-text' => 'Форманы ебәреү хатаһы',
 106+ 'contrib-tracking-submitting' => 'Түләүҙәрҙе эшкәртеү ҡоралына ебәреү...',
 107+ 'contrib-tracking-continue' => 'Әгәр һеҙ автоматик рәүештә йүнәлтелгән булмаһағыҙ, PayPal сайтында иғәнә биреүҙе тамамлау өсөн, төймәгә баҫығыҙ.',
 108+ 'contrib-tracking-button' => 'Дауам итергә',
 109+);
 110+
98111 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
99112 * @author EugeneZelenko
100113 * @author Jim-by
@@ -128,9 +141,12 @@
129142
130143 /** Bengali (বাংলা)
131144 * @author Bellayet
 145+ * @author Wikitanvir
132146 */
133147 $messages['bn'] = array(
134148 'contrib-tracking-error' => 'ত্রুটি',
 149+ 'contrib-tracking-submitting' => 'পেমেন্ট প্রসেসরের কাছে প্রদান করা হচ্ছে...',
 150+ 'contrib-tracking-continue' => 'আপনাকে যদি স্বয়ংক্রিয়ভাবে পুনর্নির্দেশিত করা না হয়, তবে পেপ্যাল-এ আপনার অনুদান সম্পন্ন করতে নিচের বাটনে ক্লিক করুন।',
135151 'contrib-tracking-button' => 'অগ্রসর হোন',
136152 );
137153
@@ -158,6 +174,7 @@
159175 'contrib-tracking-error-text' => 'Slanje nevaljanog obrasca',
160176 'contrib-tracking-submitting' => 'Šaljem za proces plaćanja...',
161177 'contrib-tracking-continue' => 'Ako niste automatski preusmjereni, kliknite na dugme da završite Vašu donaciju putem PayPala.',
 178+ 'contrib-tracking-redirect' => 'Bit ćete automatski preusmjereni na PayPal da dovršite vašu donaciju.',
162179 'contrib-tracking-button' => 'nastavi',
163180 );
164181
@@ -235,6 +252,7 @@
236253 'contrib-tracking-error-text' => 'Njepłaśiwe słanje formulara',
237254 'contrib-tracking-submitting' => 'Płaśenje wótpósćeła se k wobźěłowanjeju...',
238255 'contrib-tracking-continue' => 'Joli njepósrědnjaš se awtomatiski dalej, klikni na tłocašk, aby dokóńcył swój dar pśez PayPal.',
 256+ 'contrib-tracking-redirect' => 'Buźošo so awtomatiski k PayPaloju dalej pósrědnjaś, aby wy swójo pósćiwanje skóńcył.',
239257 'contrib-tracking-button' => 'Dalej',
240258 );
241259
@@ -293,6 +311,7 @@
294312 'contrib-tracking-error' => 'Viga',
295313 'contrib-tracking-submitting' => 'Maksevahendaja juurde suunamine...',
296314 'contrib-tracking-continue' => 'Kui sind ei suunata automaatselt, klõpsa nuppu, et annetus PayPalis lõpule viia.',
 315+ 'contrib-tracking-redirect' => 'Annetuse lõpule viimiseks suunatakse sind automaatselt PayPali.',
297316 'contrib-tracking-button' => 'Jätka',
298317 );
299318
@@ -363,6 +382,13 @@
364383 'contrib-tracking-button' => 'Continuar',
365384 );
366385
 386+/** Friulian (Furlan)
 387+ * @author Klenje
 388+ */
 389+$messages['fur'] = array(
 390+ 'contrib-tracking-button' => 'Va indevant',
 391+);
 392+
367393 /** Galician (Galego)
368394 * @author Toliño
369395 */
@@ -370,9 +396,9 @@
371397 'contributiontracking-desc' => 'Seguimento das contribucións da recadación de fondos da Wikimedia',
372398 'contributiontracking' => 'Seguimento das contribucións',
373399 'contrib-tracking-error' => 'Erro',
374 - 'contrib-tracking-error-text' => 'Formulario de proposta inválido',
 400+ 'contrib-tracking-error-text' => 'Envío do formulario inválido',
375401 'contrib-tracking-submitting' => 'Enviando ao procesador de pagamentos...',
376 - 'contrib-tracking-continue' => 'Se non é redirixido automaticamente, faga clic no botón para completar a súa doazón por PayPal.',
 402+ 'contrib-tracking-continue' => 'Se non es redirixido automaticamente, fai clic no botón para completar a túa doazón por PayPal.',
377403 'contrib-tracking-redirect' => 'Serás redirixido automaticamente ao PayPal para completar a túa doazón.',
378404 'contrib-tracking-button' => 'Continuar',
379405 );
@@ -409,6 +435,7 @@
410436
411437 /** Hebrew (עברית)
412438 * @author Rotem Liss
 439+ * @author YaronSh
413440 */
414441 $messages['he'] = array(
415442 'contributiontracking-desc' => 'מעקב תרומות להתרמה לקרן ויקימדיה',
@@ -417,6 +444,7 @@
418445 'contrib-tracking-error-text' => 'שליחת פורום בלתי תקינה',
419446 'contrib-tracking-submitting' => 'נשלח למעבד התרומות...',
420447 'contrib-tracking-continue' => 'אם ההפניה אינה מתבצעת אוטומטית, לחצו על הכפתור כדי להשלים את תרומתכם באתר PayPal.',
 448+ 'contrib-tracking-redirect' => 'כעת תתבצע העברה אוטומטית ל־PayPal כדי להשלים את תרומתך.',
421449 'contrib-tracking-button' => 'המשך',
422450 );
423451
@@ -611,6 +639,7 @@
612640 'contrib-tracking-error-text' => 'Feeler bäi der Iwwermëttlung vum Formulaire',
613641 'contrib-tracking-submitting' => 'Weiderschécken op de System fir ze bezuelen ...',
614642 'contrib-tracking-continue' => 'Wann Dir net automatesch virugeleed gitt, da clickt w.e.g. op de Knäppchen fir ären Don iwwer PayPal ofzeschléissen.',
 643+ 'contrib-tracking-redirect' => 'Dir gitt automatesch op PayPal virugeleet fir Ären Don ofzeschléissen.',
615644 'contrib-tracking-button' => 'Weider',
616645 );
617646
@@ -638,6 +667,13 @@
639668 'contrib-tracking-button' => 'Tęsti',
640669 );
641670
 671+/** Latvian (Latviešu)
 672+ * @author Papuass
 673+ */
 674+$messages['lv'] = array(
 675+ 'contrib-tracking-button' => 'Turpināt',
 676+);
 677+
642678 /** Eastern Mari (Олык Марий)
643679 * @author Сай
644680 */
@@ -717,6 +753,7 @@
718754 'contrib-tracking-error-text' => 'Ongeldige formulierinvoer',
719755 'contrib-tracking-submitting' => 'Bezig met het uitvoeren van de betaling...',
720756 'contrib-tracking-continue' => 'Als u niet automatisch wordt doorgestuurd, klik dan op de knop om uw donatie via PayPal te voltooien.',
 757+ 'contrib-tracking-redirect' => 'U wordt automatisch doorgeleid naar PayPal om de transactie te voltooien.',
721758 'contrib-tracking-button' => 'Doorgaan',
722759 );
723760
@@ -823,6 +860,7 @@
824861
825862 /** Brazilian Portuguese (Português do Brasil)
826863 * @author Eduardo.mps
 864+ * @author Giro720
827865 */
828866 $messages['pt-br'] = array(
829867 'contributiontracking-desc' => 'Seguimento de doações para a coleta de fundos da Wikimedia',
@@ -831,15 +869,19 @@
832870 'contrib-tracking-error-text' => 'Submissão de formulário inválida',
833871 'contrib-tracking-submitting' => 'Submetendo ao processador de pagamentos...',
834872 'contrib-tracking-continue' => 'Se você não for redirecionado automaticamente, clique no botão para completar a sua doação no PayPal.',
 873+ 'contrib-tracking-redirect' => 'Será reencaminhado automaticamente para o Paypal para terminar a sua doação.',
835874 'contrib-tracking-button' => 'Continuar',
836875 );
837876
838877 /** Romanian (Română)
 878+ * @author Firilacroco
839879 * @author KlaudiuMihaila
840880 * @author Stelistcristi
841881 */
842882 $messages['ro'] = array(
843883 'contrib-tracking-error' => 'Eroare',
 884+ 'contrib-tracking-error-text' => 'Trimiterea formularului este invalidă',
 885+ 'contrib-tracking-submitting' => 'Trimitere la procesorul de plată...',
844886 'contrib-tracking-button' => 'Continuați',
845887 );
846888
@@ -866,6 +908,17 @@
867909 'contrib-tracking-button' => 'Продолжить',
868910 );
869911
 912+/** Rusyn (Русиньскый)
 913+ * @author Gazeb
 914+ */
 915+$messages['rue'] = array(
 916+ 'contributiontracking' => 'Слїдованя приспевків',
 917+ 'contrib-tracking-error' => 'Хыба',
 918+ 'contrib-tracking-error-text' => 'Одосланый формуларь не быв правилно выповненый',
 919+ 'contrib-tracking-submitting' => 'Платба ся одосылать про спрацованя ...',
 920+ 'contrib-tracking-button' => 'Продовжовати',
 921+);
 922+
870923 /** Yakut (Саха тыла)
871924 * @author HalanTul
872925 */
@@ -947,11 +1000,20 @@
9481001 'contrib-tracking-error' => 'Hitilafu',
9491002 );
9501003
 1004+/** Tamil (தமிழ்)
 1005+ * @author TRYPPN
 1006+ */
 1007+$messages['ta'] = array(
 1008+ 'contrib-tracking-error' => 'தவறு',
 1009+ 'contrib-tracking-button' => 'தொடரவும்',
 1010+);
 1011+
9511012 /** Telugu (తెలుగు)
9521013 * @author Veeven
9531014 */
9541015 $messages['te'] = array(
9551016 'contrib-tracking-error' => 'పొరపాటు',
 1017+ 'contrib-tracking-continue' => 'స్వయంచాలకంగా మిమ్మల్ని దారి మళ్ళించకపోతే, పేపాల్ లో మీ విరాళాన్ని పూర్తిచెయ్యడానికి మీరే బొత్తాన్ని నొక్కండి.',
9561018 'contrib-tracking-button' => 'కొనసాగించు',
9571019 );
9581020
@@ -1024,6 +1086,7 @@
10251087
10261088 /** Ukrainian (Українська)
10271089 * @author Aleksandrit
 1090+ * @author Тест
10281091 */
10291092 $messages['uk'] = array(
10301093 'contributiontracking-desc' => 'Відстеження збору пожертвувань на користь Вікімедіі',
@@ -1032,6 +1095,7 @@
10331096 'contrib-tracking-error-text' => 'Неправильне підпорядкування форми',
10341097 'contrib-tracking-submitting' => 'Відправка оброблювачеві платежів...',
10351098 'contrib-tracking-continue' => 'Якщо ви не були автоматично перенаправлені, натисніть на кнопку, щоб завершити вашу пожертву на сайті PayPal.',
 1099+ 'contrib-tracking-redirect' => 'Ви будете автоматично перенаправлені на PayPal для завершення вашого пожертвування.',
10361100 'contrib-tracking-button' => 'Продовжити',
10371101 );
10381102
Index: branches/wmf/1.16wmf4/extensions/ContributionTracking/ContributionTracking.php
@@ -23,12 +23,73 @@
2424 $wgExtensionAliasesFiles['ContributionTracking'] = $dir . 'ContributionTracking.alias.php';
2525 $wgAutoloadClasses['ContributionTracking'] = $dir . 'ContributionTracking_body.php';
2626 $wgSpecialPages['ContributionTracking'] = 'ContributionTracking';
 27+//this only works if contribution tracking is inside a mediawiki DB, which typically it isn't.
 28+//$wgHooks['LoadExtensionSchemaUpdates'][] = 'efContributionTrackingLoadUpdates';
2729
 30+/**
 31+ * The default 'return to' URL for a thank you page after posting to the contribution
 32+ *
 33+ * NO trailing slash, please
 34+ */
 35+$wgContributionTrackingReturnToURLDefault = 'http://wikimediafoundation.org/wiki/Thank_You';
 36+
2837 $wgContributionTrackingDBserver = $wgDBserver;
2938 $wgContributionTrackingDBname = $wgDBname;
3039 $wgContributionTrackingDBuser = $wgDBuser;
3140 $wgContributionTrackingDBpassword = $wgDBpassword;
3241
 42+/**
 43+ * IPN listener address for regular PayPal trxns
 44+ */
 45+$wgContributionTrackingPayPalIPN = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal';
 46+
 47+/**
 48+ * IPN listener address for recurring payment PayPal trxns
 49+ */
 50+$wgContributionTrackingPayPalRecurringIPN = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal';
 51+
 52+/**
 53+ * 'Business' string for PayPal
 54+ */
 55+$wgContributionTrackingPayPalBusiness = 'donations@wikimedia.org';
 56+
 57+function efContributionTrackingLoadUpdates(){
 58+ global $wgExtNewTables, $wgExtNewFields;
 59+ $dir = dirname( __FILE__ ) . '/';
 60+ $wgExtNewTables[] = array( 'contribution_tracking', $dir . 'ContributionTracking.sql' );
 61+ $wgExtNewTables[] = array( 'contribution_tracking_owa_ref', $dir . 'ContributionTracking_OWA_ref.sql' );
 62+
 63+ $wgExtNewFields[] = array(
 64+ 'contribution_tracking',
 65+ 'owa_session',
 66+ $dir . 'patch-owa.sql',
 67+ );
 68+ return true;
 69+
 70+}
 71+
 72+ //convert a referrer URL to an index in the owa_ref table
 73+function ef_contribution_tracking_owa_get_ref_id($ref){
 74+ // Replication lag means sometimes a new event will not exist in the table yet
 75+ $dbw = contributionTrackingConnection();
 76+ $id_num = $dbw->selectField(
 77+ 'contribution_tracking_owa_ref',
 78+ 'id',
 79+ array( 'url' => $ref ),
 80+ __METHOD__
 81+ );
 82+ // Once we're on mysql 5, we can use replace() instead of this selectField --> insert or update hooey
 83+ if ( $id_num === false ) {
 84+ $dbw->insert(
 85+ 'contribution_tracking_owa_ref',
 86+ array( 'url' => (string) $ref ),
 87+ __METHOD__
 88+ );
 89+ $id_num = $dbw->insertId();
 90+ }
 91+ return $id_num === false ? 0 : $id_num;
 92+ }
 93+
3394 function contributionTrackingConnection() {
3495 global $wgContributionTrackingDBserver, $wgContributionTrackingDBname;
3596 global $wgContributionTrackingDBuser, $wgContributionTrackingDBpassword;
Property changes on: branches/wmf/1.16wmf4/extensions/ContributionTracking
___________________________________________________________________
Modified: svn:mergeinfo
3697 Merged /trunk/extensions/ContributionTracking:r74437-74439,74494-77266,77400-77443,77445-78134

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74494Syncing to head of trunk at r74493tomasz02:50, 8 October 2010
r78134Sync'ing r74494-r77266awjrichards19:22, 9 December 2010

Status & tagging log