Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | } elseif ( isset( $msg[ 'txn_type' ] ) && in_array( $msg[ 'txn_type' ], $txn_subscr_acct ) ) { |
194 | 194 | $ret_val = recurring_import_subscr_acct( $msg ); |
195 | 195 | } else { |
196 | | - watchdog( 'recurring', 'Msg not recognized as a recurring payment related message.', WATCHDOG_NOTICE ); |
| 196 | + watchdog( 'recurring', 'Msg not recognized as a recurring payment related message.' ); |
197 | 197 | $ret_val = 0; |
198 | 198 | } |
199 | 199 | |
— | — | @@ -215,10 +215,10 @@ |
216 | 216 | * otherwise, process the payment. |
217 | 217 | */ |
218 | 218 | if ( !isset( $msg[ 'subscr_id' ] ) ) { |
219 | | - watchdog( 'recurring', 'Msg missing the subscr_id; cannot process.', WATCHDOG_NOTICE ); |
| 219 | + watchdog( 'recurring', 'Msg missing the subscr_id; cannot process.'); |
220 | 220 | return 0; |
221 | 221 | } elseif ( !$recur_record = recurring_get_recur_record( $msg[ 'subscr_id' ] ) ) { // check for parent record in civicrm_contribution_recur and fetch its id |
222 | | - watchdog( 'recurring', 'Msg does not have a matching recurring record in civicrm_contribution_recur; requeueing for future processing.', WATCHDOG_NOTICE ); |
| 222 | + watchdog( 'recurring', 'Msg does not have a matching recurring record in civicrm_contribution_recur; requeueing for future processing.' ); |
223 | 223 | return 2; |
224 | 224 | } |
225 | 225 | |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | break; |
294 | 294 | |
295 | 295 | default: |
296 | | - watchdog( 'recurring', 'Invalid subscription message type.', print_r( $msg, true ), WATCHDOG_NOTICE ); |
| 296 | + watchdog( 'recurring', 'Invalid subscription message type: %msg', array( '%msg' => print_r( $msg, true )), WATCHDOG_NOTICE ); |
297 | 297 | $ret_val = 0; |
298 | 298 | break; |
299 | 299 | } |
— | — | @@ -309,7 +309,7 @@ |
310 | 310 | function recurring_import_subscr_signup( $msg ) { |
311 | 311 | // ensure there is not already a record of this account - if so, mark the message as succesfuly processed |
312 | 312 | if ( $recur_record = recurring_get_recur_record( $msg[ 'subscr_id' ] ) ) { |
313 | | - watchdog( 'recurring', 'Subscription account already exists', print_r( $msg, true ), WATCHDOG_NOTICE ); |
| 313 | + watchdog( 'recurring', 'Subscription account already exists: %msg', array( '%msg' => print_r( $msg, true )), WATCHDOG_NOTICE ); |
314 | 314 | return 1; |
315 | 315 | } |
316 | 316 | |
— | — | @@ -348,10 +348,10 @@ |
349 | 349 | ); |
350 | 350 | |
351 | 351 | if ( !$result ) { |
352 | | - watchdog( 'recurring', 'Failed inserting subscriber signup for subscriber id ', print_r( $msg['subscr_id'], true), WATCHDOG_NOTICE ); |
| 352 | + watchdog( 'recurring', 'Failed inserting subscriber signup for subscriber id: %subscr_id', array( '%subscr_id' => print_r( $msg['subscr_id'], true )), WATCHDOG_NOTICE ); |
353 | 353 | return 0; |
354 | 354 | } else { |
355 | | - watchdog( 'recurring', 'Succesfully inserted subscription signup for subscriber id ', print_r( $msg[ 'subscr_id' ], true), WATCHDOG_NOTICE ); |
| 355 | + watchdog( 'recurring', 'Succesfully inserted subscription signup for subscriber id: %subscr_id ', array( '%subscr_id' => print_r( $msg[ 'subscr_id' ], true )), WATCHDOG_NOTICE ); |
356 | 356 | return 1; |
357 | 357 | } |
358 | 358 | } |
— | — | @@ -365,17 +365,17 @@ |
366 | 366 | function recurring_import_subscr_cancel( $msg ) { |
367 | 367 | // ensure we have a record of the subscription |
368 | 368 | if ( !$recur_record = recurring_get_recur_record( $msg[ 'subscr_id' ] ) ) { |
369 | | - watchdog( 'recurring', 'Subscription account does not exist', print_r( $msg, true ), WATCHDOG_NOTICE ); |
| 369 | + watchdog( 'recurring', 'Subscription account does not exist: %msg', array( '%msg' => print_r( $msg, true )), WATCHDOG_NOTICE ); |
370 | 370 | return 2; |
371 | 371 | } |
372 | 372 | |
373 | 373 | $query = "UPDATE {civicrm.civicrm_contribution_recur} SET cancel_date='%s', end_date='%s' WHERE trxn_id=%d"; |
374 | 374 | $result = db_query( $query, $msg[ 'cancel_date' ], $msg[ 'end_date' ], $msg[ 'subscr_id' ] ); |
375 | 375 | if ( !$result ) { |
376 | | - watchdog( 'recurring', 'There was a problem updating the subscription for cancelation for subscriber id ', print_r( $msg[ 'subscr_id' ], true ), WATCHDOG_NOTICE ); |
| 376 | + watchdog( 'recurring', 'There was a problem updating the subscription for cancelation for subscriber id: %subscr_id', array( '%subscr_id' => print_r( $msg[ 'subscr_id' ], true )), WATCHDOG_NOTICE ); |
377 | 377 | return 0; |
378 | 378 | } else { |
379 | | - watchdog( 'recurring', 'Succesfuly cacneled subscription for subscriber id ', print_r( $msg[ 'subsr_id' ], true ), WATCHDOG_NOTICE ); |
| 379 | + watchdog( 'recurring', 'Succesfuly cacneled subscription for subscriber id %subscr_id', array( '%subscr_id' => print_r( $msg[ 'subsr_id' ], true )), WATCHDOG_NOTICE ); |
380 | 380 | return 1; |
381 | 381 | } |
382 | 382 | } |
— | — | @@ -389,17 +389,17 @@ |
390 | 390 | function recurring_import_subscr_eot( $msg ) { |
391 | 391 | // ensure we have a record of the subscription |
392 | 392 | if ( !$recur_record = recurring_get_recur_record( $msg[ 'subscr_id' ] ) ) { |
393 | | - watchdog( 'recurring', 'Subscription account does not exist', print_r( $msg, true ), WATCHDOG_NOTICE ); |
| 393 | + watchdog( 'recurring', 'Subscription account does not exist: %msg', array( '%msg' => print_r( $msg, true )), WATCHDOG_NOTICE ); |
394 | 394 | return 2; |
395 | 395 | } |
396 | 396 | |
397 | 397 | $query = "UPDATE {civicrm.civicrm_contribution_recur} SET end_date='%s' WHERE trxn_id=%d"; |
398 | 398 | $result = db_query( $query, $msg[ 'end_date' ], $msg[ 'subscr_id' ] ); |
399 | 399 | if ( !$result ) { |
400 | | - watchdog( 'recurring', 'There was a problem updating the subscription for EOT ', print_r( $msg[ 'subscr_id' ], true ), WATCHDOG_NOTICE ); |
| 400 | + watchdog( 'recurring', 'There was a problem updating the subscription for EOT for subscription id: %subscr_id', array( '%subscr_id' => print_r( $msg[ 'subscr_id' ], true )), WATCHDOG_NOTICE ); |
401 | 401 | return 0; |
402 | 402 | } else { |
403 | | - watchdog( 'recurring', 'Succesfuly ended subscription for subscriber id ', print_r( $msg[ 'subsr_id' ], true ), WATCHDOG_NOTICE ); |
| 403 | + watchdog( 'recurring', 'Succesfuly ended subscription for subscriber id: %subscr_id ', array( '%subscr_id' => print_r( $msg[ 'subsr_id' ], true )), WATCHDOG_NOTICE ); |
404 | 404 | return 1; |
405 | 405 | } |
406 | 406 | } |
— | — | @@ -413,7 +413,7 @@ |
414 | 414 | function recurring_import_subscr_modify( $msg ) { |
415 | 415 | // ensure we have a record of the subscription |
416 | 416 | if ( !$recur_record = recurring_get_recur_record( $msg[ 'subscr_id' ] ) ) { |
417 | | - watchdog( 'recurring', 'Subscription account does not exist', print_r( $msg, true ), WATCHDOG_NOTICE ); |
| 417 | + watchdog( 'recurring', 'Subscription account does not exist for subscription id: %subscr_id', array( '%subscr_id' => print_r( $msg, true )), WATCHDOG_NOTICE ); |
418 | 418 | return 2; |
419 | 419 | } |
420 | 420 | |
— | — | @@ -451,7 +451,7 @@ |
452 | 452 | // Tag contact for review |
453 | 453 | $tag = _queu2civicrm_tag_insert( $contact ); |
454 | 454 | |
455 | | - watchdog( 'recurring', 'Subscription succesfully modified for subscription id ', print_r( $msg['subscr_id'], true ), WATCHDOG_NOTICE ); |
| 455 | + watchdog( 'recurring', 'Subscription succesfully modified for subscription id: %subscr_id', array( '%subscr_id' => print_r( $msg['subscr_id'], true )), WATCHDOG_NOTICE ); |
456 | 456 | return 1; |
457 | 457 | } |
458 | 458 | |
— | — | @@ -463,17 +463,17 @@ |
464 | 464 | function recurring_import_subscr_failed( $msg ) { |
465 | 465 | // ensure we have a record of the subscription |
466 | 466 | if ( !$recur_record = recurring_get_recur_record( $msg[ 'subscr_id' ] ) ) { |
467 | | - watchdog( 'recurring', 'Subscription account does not exist', print_r( $msg, true ), WATCHDOG_NOTICE ); |
| 467 | + watchdog( 'recurring', 'Subscription account does not exist for subscription: %subscription', array( "%subscription" => print_r( $msg, true )), WATCHDOG_NOTICE ); |
468 | 468 | return 2; |
469 | 469 | } |
470 | 470 | |
471 | 471 | $query = "UPDATE {civicrm.civicrm_contribution_recur} SET failure_count=%d, failure_retry_date='%s' WHERE trxn_id=%d"; |
472 | 472 | $result = db_query( $query, $msg[ 'failure_count' ], $msg[ 'failure_retery_date' ], $msg[ 'subscr_id' ] ); |
473 | 473 | if ( !$result ) { |
474 | | - watchdog( 'recurring', 'There was a problem updating the subscription for failed payment for subscriber id ', print_r( $msg[ 'subscr_id' ], true ), WATCHDOG_NOTICE ); |
| 474 | + watchdog( 'recurring', 'There was a problem updating the subscription for failed payment for subscriber id: %subscr_id ', array( '%subscr_id' => print_r( $msg[ 'subscr_id' ], true )), WATCHDOG_NOTICE ); |
475 | 475 | return 0; |
476 | 476 | } else { |
477 | | - watchdog( 'recurring', 'Succesfuly cacneled subscription for failed payment for subscriber id ', print_r( $msg[ 'subsr_id' ], true ), WATCHDOG_NOTICE ); |
| 477 | + watchdog( 'recurring', 'Succesfuly cacneled subscription for failed payment for subscriber id: %subscr_id ', array( '%subscr_id' => print_r( $msg[ 'subsr_id' ], true )), WATCHDOG_NOTICE ); |
478 | 478 | return 1; |
479 | 479 | } |
480 | 480 | } |
— | — | @@ -486,7 +486,7 @@ |
487 | 487 | function recurring_get_recur_record( $subscr_id ) { |
488 | 488 | $query = "SELECT * FROM civicrm.civicrm_contribution_recur WHERE trxn_id = %d"; |
489 | 489 | $recur_record = db_fetch_object( db_query( $query, $subscr_id ) ); |
490 | | - watchdog( 'recurring', 'Recurring record: ', print_r( $recur_record, true ), WATCHDOG_DEBUG ); |
| 490 | + watchdog( 'recurring', 'Recurring record: %recur_record', array( '%recur_record' => print_r( $recur_record, true )), WATCHDOG_DEBUG ); |
491 | 491 | return $recur_record; |
492 | 492 | } |
493 | 493 | |
Index: civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm_common.inc |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | $contact['display_name'] = trim($contact['first_name'] . ' ' . $contact['last_name']); |
122 | 122 | $contact_result = &civicrm_contact_add( $contact ); |
123 | 123 | |
124 | | - watchdog( 'queue2civicrm', 'Result for adding contact: ', print_r( $contact_result, true ), WATCHDOG_DEBUG ); |
| 124 | + watchdog( 'queue2civicrm', 'Result for adding contact: %contact', array( '%contact' => print_r( $contact_result, true )), WATCHDOG_DEBUG ); |
125 | 125 | |
126 | 126 | return $contact_result; |
127 | 127 | } |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | 'email' => $msg['email'] |
185 | 185 | ); |
186 | 186 | $location_result = &civicrm_location_add( $address ); |
187 | | - watchdog( 'queue2civicrm', 'Result for adding location: ', print_r( $location_result, true ), WATCHDOG_DEBUG ); |
| 187 | + watchdog( 'queue2civicrm', 'Result for adding location: %location', array( '%location' => print_r( $location_result, true )), WATCHDOG_DEBUG ); |
188 | 188 | return $location_result; |
189 | 189 | } |
190 | 190 | |