Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: civicrm/civicrm-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eb69c38d04737fae4b6c0479034e4016e72cb9d3
Choose a base ref
..
head repository: civicrm/civicrm-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 99dc078c51c7f6b2001f429bd6cb085c17521c2a
Choose a head ref
Showing with 9 additions and 28 deletions.
  1. +9 −28 CRM/Event/Form/Participant.php
37 changes: 9 additions & 28 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
public $_priceSet;

/**
* The id of the participation that we are proceessing.
* The id of the participation that we are processing.
*
* @var int
*/
@@ -372,37 +372,27 @@ public function preProcess() {

// when custom data is included in this page
if (!empty($_POST['hidden_custom'])) {
$eventId = (int) CRM_Utils_Array::value('event_id', $_POST);
// Custom data of type participant role
// Note: Some earlier commits imply $_POST['role_id'] could be a comma separated string,
// not sure if that ever really happens
if (!empty($_POST['role_id'])) {
foreach ($_POST['role_id'] as $roleID) {
CRM_Custom_Form_CustomData::preProcess($this, $this->_roleCustomDataTypeID, $roleID, 1, 'Participant', $this->_id);
CRM_Custom_Form_CustomData::buildQuickForm($this);
CRM_Custom_Form_CustomData::setDefaultValues($this);
CRM_Custom_Form_CustomData::addToForm($this, $roleID, $this->_roleCustomDataTypeID);
}
}

//custom data of type participant event
CRM_Custom_Form_CustomData::preProcess($this, $this->_eventNameCustomDataTypeID, $_POST['event_id'], 1, 'Participant', $this->_id);
CRM_Custom_Form_CustomData::buildQuickForm($this);
CRM_Custom_Form_CustomData::setDefaultValues($this);
CRM_Custom_Form_CustomData::addToForm($this, $eventId, $this->_eventNameCustomDataTypeID);

// custom data of type participant event type
$eventTypeId = NULL;
if ($eventId = CRM_Utils_Array::value('event_id', $_POST)) {
if ($eventId) {
$eventTypeId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $eventId, 'event_type_id', 'id');
}
CRM_Custom_Form_CustomData::preProcess($this, $this->_eventTypeCustomDataTypeID, $eventTypeId,
1, 'Participant', $this->_id
);
CRM_Custom_Form_CustomData::buildQuickForm($this);
CRM_Custom_Form_CustomData::setDefaultValues($this);
CRM_Custom_Form_CustomData::addToForm($this, $eventTypeId, $this->_eventTypeCustomDataTypeID);

//custom data of type participant, ( we 'null' to reset subType and subName)
CRM_Custom_Form_CustomData::preProcess($this, 'null', 'null', 1, 'Participant', $this->_id);
CRM_Custom_Form_CustomData::buildQuickForm($this);
CRM_Custom_Form_CustomData::setDefaultValues($this);
CRM_Custom_Form_CustomData::addToForm($this);
}

// CRM-4395, get the online pending contribution id.
@@ -595,9 +585,6 @@ public function buildQuickForm() {
return CRM_Event_Form_EventFees::buildQuickForm($this);
}

//need to assign custom data type to the template
$this->assign('customDataType', 'Participant');

$this->applyFilter('__ALL__', 'trim');

if ($this->_action & CRM_Core_Action::DELETE) {
@@ -682,10 +669,6 @@ public function buildQuickForm() {

$this->addDateTime('register_date', ts('Registration Date'), TRUE, array('formatType' => 'activityDateTime'));

if ($this->_id) {
$this->assign('entityID', $this->_id);
}

$this->addSelect('role_id', array('multiple' => TRUE, 'class' => 'huge'), TRUE);

// CRM-4395
@@ -1209,10 +1192,8 @@ public function submit($params) {
);
$customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEvent, $customFields);
$customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEventType, $customFields);
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
$this->_id,
'Participant'
);

$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->_id, $this->getDefaultEntity());
}

//do cleanup line items if participant edit the Event Fee.