if ($this->_mode) {
// exclude events which are not monetary when credit card registration is used
$eventFieldParams['api']['params']['is_monetary'] = 1;
- $this->add('select', 'payment_processor_id', ts('Payment Processor'), $this->_processors, TRUE);
}
+ $this->addPaymentProcessorSelect(TRUE, FALSE, FALSE);
$element = $this->addEntityRef('event_id', ts('Event'), $eventFieldParams, TRUE);
if (empty($values['payment_instrument_id'])) {
$errorMsg['payment_instrument_id'] = ts('Payment Method is a required field.');
}
- CRM_Price_BAO_PriceField::priceSetValidation($values['priceSetId'], $values, $errorMsg);
+ if (!empty($values['priceSetId'])) {
+ CRM_Price_BAO_PriceField::priceSetValidation($values['priceSetId'], $values, $errorMsg);
+ }
}
// validate contribution status for 'Failed'.
$this->assign('module', 'Event Registration');
//use of the message template below requires variables in different format
$event = $events = array();
- $returnProperties = array('fee_label', 'start_date', 'end_date', 'is_show_location', 'title');
+ $returnProperties = array('event_type_id', 'fee_label', 'start_date', 'end_date', 'is_show_location', 'title');
//get all event details.
CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $params['event_id'], $events, $returnProperties);
//format submitted data
foreach ($params['custom'] as $fieldID => $values) {
foreach ($values as $fieldValue) {
- $customFields[$fieldID]['id'] = $fieldID;
- $formattedValue = CRM_Core_BAO_CustomField::displayValue($fieldValue['value'], $fieldID, $participants[0]->id);
- $customGroup[$customFields[$fieldID]['groupTitle']][$customFields[$fieldID]['label']] = str_replace(' ', '', $formattedValue);
+ $isPublic = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $fieldValue['custom_group_id'], 'is_public');
+ if ($isPublic) {
+ $customFields[$fieldID]['id'] = $fieldID;
+ $formattedValue = CRM_Core_BAO_CustomField::displayValue($fieldValue['value'], $fieldID, $participants[0]->id);
+ $customGroup[$customFields[$fieldID]['groupTitle']][$customFields[$fieldID]['label']] = str_replace(' ', '', $formattedValue);
+ }
}
}