r75180 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75179‎ | r75180 | r75181 >
Date:00:54, 22 October 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Removing OWA code from queue2civicrm
Modified paths:
  • /civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm.module (modified) (history)

Diff [purge]

Index: civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm.module
@@ -90,13 +90,6 @@
9191 '#default_value' => variable_get('queue2civicrm_subscription', '/queue/test'),
9292 );
9393
94 - $form['queue2civicrm_OWA_log'] = array(
95 - '#type' => 'textfield',
96 - '#title' => t('OWA log path'),
97 - '#required' => TRUE,
98 - '#default_value' => variable_get('queue2civicrm_OWA_log', 'http://analytics.tesla.usability.wikimedia.org/wiki/d/extensions/owa/log.php'),
99 - );
100 -
10194 $form['queue2civicrm_batch'] = array(
10295 '#type' => 'select',
10396 '#title' => t('Cron batch size'),
@@ -255,8 +248,8 @@
256249 'contact_type' => 'Individual',
257250 'first_name' => $msg['first_name'],
258251 'middle_name' => $msg['middle_name'],
259 - 'last_name' => $msg['last_name'],
260 - 'do_not_trade' => ($msg['anonymous'] ? 1 : 0 ),
 252+ 'last_name' => $msg['last_name'],
 253+ 'do_not_trade' => ($msg['anonymous'] ? 1 : 0 ),
261254 'contact_source' => 'online donation'
262255 );
263256 // Honor the opt-out checkbox, if present
@@ -273,7 +266,7 @@
274267 * When passing CiviCRM a state abbreviation, odd things can happen - like getting the right abbreviation, but the wrong state
275268 * So we'll pull back the correct state/province name based off of a user's country/state abbreviation
276269 */
277 - $query = "SELECT s.name AS state_name FROM civicrm_country c, civicrm_state_province s WHERE s.country_id=c.id AND c.name='" . $msg['country'] . "' AND s.abbreviation='" . $msg['state_province'] . "'";
 270+ $query = "SELECT s.name AS state_name FROM civicrm_country c, civicrm_state_province s WHERE s.country_id=c.id AND c.name='" . $msg['country'] . "' AND s.abbreviation='" . addslashes( $msg['state_province'] ) . "'";
278271 $dao = CRM_Core_DAO::executeQuery( $query );
279272 while ( $dao->fetch() ) {
280273 $state = $dao->state_name;
@@ -353,45 +346,11 @@
354347 'contact_id' => $contact['id']
355348 );
356349 $tag_result = &civicrm_entity_tag_add( $tag );
357 - if(defined(OWA)){
358 - queue2civicrm_record_OWA_contribution($msg);
359 - }
360 -
 350+
361351 return TRUE;
362352
363353 }
364354
365 -function queue2civicrm_record_OWA_contribution($msg){
366 - //NEED:
367 - //utm_campaign
368 - //referer URL
369 - //owa_session_id
370 - //OWA log URL
371 -
372 - $query_params = array(
373 - "owa_event_type" => "ecommerce.transaction",
374 - "owa_ct_order_id" => $msg[ 'contribution_tracking_id' ],
375 - "owa_ct_order_source" => $data['utm_campaign'],
376 - "owa_ct_total" => $msg['gross'],
377 - "owa_ct_tax" => 0,
378 - "owa_ct_shipping" => 0,
379 - "owa_ct_gateway" => $msg['gateway'],
380 - "owa_page_url" => $encodedReqURL,
381 - //ct_line_items[li_product_name]=foo&
382 - "owa_session_id"=> "some_id"
383 - );
384 -
385 - //$owa_log_url = "http://analytics.tesla.usability.wikimedia.org/wiki/d/extensions/owa/log.php";
386 - $owa_log_url = variable_get('queue2civicrm_OWA_log', 'http://analytics.tesla.usability.wikimedia.org/wiki/d/extensions/owa/log.php');
387 - $ch = curl_init();
388 - curl_setopt($ch, CURLOPT_URL, $owa_log_url . "?". http_build_query($query_params));
389 - curl_setopt($ch, CURLOPT_USERAGENT, "WMF Ecommerce web service 1.0");
390 - curl_exec($ch);
391 - curl_close($ch);
392 -}
393 -
394 -
395 -
396355 /**
397356 * Make the form to insert a test message into the queue
398357 */

Status & tagging log