<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
}
/**
- * Build the form
+ * Build the form object
*
* @access public
*
// get the option value for custom data type
$this->_roleCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantRole', 'name');
$this->_eventNameCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventName', 'name');
+ $this->_eventTypeCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventType', 'name');
// build custom data getFields array
$customFieldsRole = CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, $this->_roleCustomDataTypeID);
$customFieldsEvent = CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, $this->_eventNameCustomDataTypeID);
+ $customFieldsEventType = CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, $this->_eventTypeCustomDataTypeID);
+
$customFields = CRM_Utils_Array::crmArrayMerge($customFieldsRole,
CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, NULL, TRUE)
);
+ $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEventType, $customFields);
$this->_customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEvent, $customFields);
foreach ($this->_participantIds as $participantId) {
$roleId = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Participant", $participantId, 'role_id');
$eventId = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Participant", $participantId, 'event_id');
+ $eventTypeId = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $eventId, 'event_type_id');
foreach ($this->_fields as $name => $field) {
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {
$customValue = CRM_Utils_Array::value($customFieldID, $this->_customFields);
);
}
$entityColumnValueRole = CRM_Utils_Array::value($roleId, $entityColumnValue);
+ $entityColumnValueEventType = in_array($eventTypeId, $entityColumnValue) ? $eventTypeId : NULL;
if (($this->_roleCustomDataTypeID == $customValue['extends_entity_column_id']) &&
($entityColumnValueRole)
) {
) {
CRM_Core_BAO_UFGroup::buildProfile($this, $field, NULL, $participantId);
}
+ elseif ($this->_eventTypeCustomDataTypeID == $customValue['extends_entity_column_id'] &&
+ ($entityColumnValueEventType == $eventTypeId)
+ ) {
+ CRM_Core_BAO_UFGroup::buildProfile($this, $field, NULL, $participantId);
+ }
elseif (CRM_Utils_System::isNull($entityColumnValueRole)) {
CRM_Core_BAO_UFGroup::buildProfile($this, $field, NULL, $participantId);
}
$buttonName = $this->controller->getButtonName('submit');
if ($suppressFields && $buttonName != '_qf_Batch_next') {
- CRM_Core_Session::setStatus(ts("FILE or Autocomplete Select type field(s) in the selected profile are not supported for Batch Update and have been excluded."), ts('Unsupported Field Type'), 'info');
+ CRM_Core_Session::setStatus(ts("File or Autocomplete-Select type field(s) in the selected profile are not supported for Batch Update."), ts('Unsupported Field Type'), 'info');
}
$this->addDefaultButtons(ts('Update Participant(s)'));
}
/**
- * This function sets the default values for the form.
+ * Set default values for the form.
*
* @access public
*
CRM_Core_Session::setStatus(ts('No updates have been saved.'), ts('Not Saved'), 'alert');
}
}
- //end of function
+ /**
+ * @param $participantId
+ * @param $statusId
+ *
+ * @return Ambigous|void
+ */
static function updatePendingOnlineContribution($participantId, $statusId) {
if (!$participantId || !$statusId) {
return;