//participant method (addParticipant)
$this->_params['participant_status_id'] = $params['status_id'];
$this->_params['participant_role_id'] = is_array($params['role_id']) ? $params['role_id'] : explode(',', $params['role_id']);
- $this->_params['participant_register_date'] = $params['register_date'];
$roleIdWithSeparator = implode(CRM_Core_DAO::VALUE_SEPARATOR, $this->_params['participant_role_id']);
$now = date('YmdHis');
$fields['email-Primary'] = 1;
$params['email-Primary'] = $params["email-{$this->_bltID}"] = $this->_contributorEmail;
- $params['register_date'] = $now;
-
// now set the values for the billing location.
foreach ($this->_fields as $name => $dontCare) {
$fields[$name] = 1;
$params = $form->_params;
$transaction = new CRM_Core_Transaction();
- // handle register date CRM-4320
- $registerDate = NULL;
- if (!empty($form->_allowConfirmation) && $form->_participantId) {
- $registerDate = $params['participant_register_date'];
- }
- elseif (!empty($params['participant_register_date']) &&
- is_array($params['participant_register_date']) &&
- !empty($params['participant_register_date'])
- ) {
- $registerDate = CRM_Utils_Date::format($params['participant_register_date']);
- }
-
$participantFields = CRM_Event_DAO_Participant::fields();
$participantParams = array(
'id' => CRM_Utils_Array::value('participant_id', $params),
$params, 1
),
'role_id' => CRM_Utils_Array::value('participant_role_id', $params) ?: self::getDefaultRoleID(),
- 'register_date' => ($registerDate) ? $registerDate : date('YmdHis'),
+ 'register_date' => $params['register_date'],
'source' => CRM_Utils_String::ellipsify(
isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
$participantFields['participant_source']['maxlength']
$paymentProcessorID = $this->processorCreate(['is_test' => 0]);
$form->submit($this->getSubmitParams($form->_eventId, $paymentProcessorID));
$participant = $this->callAPISuccessGetSingle('Participant', []);
+ $this->assertEquals('2018-09-04 00:00:00', $participant['participant_register_date']);
$this->assertEquals('Offline Registration for Event: Annual CiviCRM meet by: ', $participant['participant_source']);
$contribution = $this->callAPISuccessGetSingle('Contribution', []);
$this->assertEquals(1550.55, $contribution['total_amount']);
*/
private function getSubmitParams(int $eventID, int $paymentProcessorID): array {
$submitParams = [
- 'register_date' => date('Ymd'),
+ 'register_date' => '2018-09-04',
'status_id' => 1,
'role_id' => 1,
'event_id' => $eventID,