$params['created_id'] = $session->get('userID');
}
$params['created_date'] = date('YmdHis');
+
+ // Clone from template
+ if (!empty($params['template_id'])) {
+ $copy = self::copy($params['template_id']);
+ $params['id'] = $copy->id;
+ unset($params['template_id']);
+ }
}
$event = self::add($params);
$blockCopyOfCustomValue = (!empty($params['custom']));
+ /** @var \CRM_Event_DAO_Event $copyEvent */
$copyEvent = CRM_Core_DAO::copyGeneric('CRM_Event_DAO_Event',
['id' => $id],
// since the location is sharable, lets use the same loc_block_id.
// @todo - the goal is that all params available to the message template are explicitly defined here rather than
// 'in a smattering of places'. Note that leakage can happen between mailings when not explicitly defined.
+ if ($postProfileID) {
+ $customPostTitles = empty($profilePost[1]) ? NULL : [];
+ foreach ($postProfileID as $offset => $id) {
+ $customPostTitles[$offset] = CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $id);
+ }
+ }
+ else {
+ $customPostTitles = NULL;
+ }
$tplParams = array_merge($values, $participantParams, [
'email' => $email,
'confirm_email_text' => CRM_Utils_Array::value('confirm_email_text', $values['event']),
'customPre' => $profilePre[0],
'customPre_grouptitle' => empty($profilePre[1]) ? NULL : [CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $preProfileID)],
'customPost' => $profilePost[0],
- 'customPost_grouptitle' => empty($profilePost[1]) ? NULL : [CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $postProfileID)],
+ 'customPost_grouptitle' => $customPostTitles,
'participantID' => $participantId,
'conference_sessions' => $sessions,
'credit_card_number' => CRM_Utils_System::mungeCreditCard(CRM_Utils_Array::value('credit_card_number', $participantParams)),