Index: civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm.module |
— | — | @@ -90,13 +90,6 @@ |
91 | 91 | '#default_value' => variable_get('queue2civicrm_subscription', '/queue/test'), |
92 | 92 | ); |
93 | 93 | |
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 | | - |
101 | 94 | $form['queue2civicrm_batch'] = array( |
102 | 95 | '#type' => 'select', |
103 | 96 | '#title' => t('Cron batch size'), |
— | — | @@ -255,8 +248,8 @@ |
256 | 249 | 'contact_type' => 'Individual', |
257 | 250 | 'first_name' => $msg['first_name'], |
258 | 251 | '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 ), |
261 | 254 | 'contact_source' => 'online donation' |
262 | 255 | ); |
263 | 256 | // Honor the opt-out checkbox, if present |
— | — | @@ -273,7 +266,7 @@ |
274 | 267 | * When passing CiviCRM a state abbreviation, odd things can happen - like getting the right abbreviation, but the wrong state |
275 | 268 | * So we'll pull back the correct state/province name based off of a user's country/state abbreviation |
276 | 269 | */ |
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'] ) . "'"; |
278 | 271 | $dao = CRM_Core_DAO::executeQuery( $query ); |
279 | 272 | while ( $dao->fetch() ) { |
280 | 273 | $state = $dao->state_name; |
— | — | @@ -353,45 +346,11 @@ |
354 | 347 | 'contact_id' => $contact['id'] |
355 | 348 | ); |
356 | 349 | $tag_result = &civicrm_entity_tag_add( $tag ); |
357 | | - if(defined(OWA)){ |
358 | | - queue2civicrm_record_OWA_contribution($msg); |
359 | | - } |
360 | | - |
| 350 | + |
361 | 351 | return TRUE; |
362 | 352 | |
363 | 353 | } |
364 | 354 | |
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 | | - |
396 | 355 | /** |
397 | 356 | * Make the form to insert a test message into the queue |
398 | 357 | */ |