$now = date('YmdHis');
if ($this->_mode) {
-
- $eventTitle
- = CRM_Core_DAO::getFieldValue(
- 'CRM_Event_DAO_Event',
- $params['event_id'],
- 'title'
- );
-
// set source if not set
if (empty($params['source'])) {
$this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', [
1 => $userName,
- 2 => $eventTitle,
+ 2 => $this->getEventValue('title'),
]);
}
else {
}
}
- if (isset($params['event_id'])) {
- $eventTitle = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event',
- $params['event_id'],
- 'title'
- );
- }
-
if ($this->_single) {
$this->_contactIds[] = $this->_contactId;
}
if (!$this->_onlinePendingContributionId) {
if (empty($params['source'])) {
$contributionParams['source'] = ts('%1 : Offline registration (by %2)', [
- 1 => $eventTitle,
+ 1 => $this->getEventValue('title'),
2 => $userName,
]);
}
$form->_quickConfig = TRUE;
$paymentProcessorID = $this->processorCreate(['is_test' => 0]);
$form->submit($this->getSubmitParams($form->_eventId, $paymentProcessorID));
- $participants = $this->callAPISuccess('Participant', 'get', []);
- $this->assertEquals(1, $participants['count']);
+ $participant = $this->callAPISuccessGetSingle('Participant', []);
+ $this->assertEquals('Offline Registration for Event: Annual CiviCRM meet by: ', $participant['participant_source']);
$contribution = $this->callAPISuccessGetSingle('Contribution', []);
$this->assertEquals(1550.55, $contribution['total_amount']);
$this->assertEquals('Debit Card', $contribution['payment_instrument']);