*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
- * $Id$
- *
*/
/**
* be transferred to this participant - at this point no transaction changes processed
*
* return @void
+ *
+ * @throws \CRM_Core_Exception
*/
public function preProcess() {
- $config = CRM_Core_Config::singleton();
$session = CRM_Core_Session::singleton();
$this->_userContext = $session->readUserContext();
$this->_from_participant_id = CRM_Utils_Request::retrieve('pid', 'Positive', $this, FALSE, NULL, 'REQUEST');
if ($this->_from_participant_id) {
$this->assign('participantId', $this->_from_participant_id);
}
- $event = [];
+
$daoName = 'title';
$this->_event_title = CRM_Event_BAO_Event::getFieldValue('CRM_Event_DAO_Event', $this->_event_id, $daoName);
$daoName = 'start_date';
list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_from_contact_id);
$this->_contact_name = $displayName;
$this->_contact_email = $email;
- $details = [];
+
$details = CRM_Event_BAO_Participant::participantDetails($this->_from_participant_id);
$optionGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'participant_role', 'id', 'name');
$query = "
// verify whether this contact already registered for this event
$contact_details = CRM_Contact_BAO_Contact::getContactDetails($contact_id);
$display_name = $contact_details[0];
- $query = "select event_id from civicrm_participant where contact_id = " . $contact_id;
+ $query = 'select event_id from civicrm_participant where contact_id = ' . $contact_id;
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$to_event_id[] = $dao->event_id;
/**
* Process transfer - first add the new participant to the event, then cancel
* source participant - send confirmation email to transferee
+ *
+ * @throws \CiviCRM_API3_Exception
*/
public function postProcess() {
//For transfer, process form to allow selection of transferree
//cancel 'from' participant row
$contact_id_result = civicrm_api3('Contact', 'get', [
'sequential' => 1,
- 'return' => ["id"],
+ 'return' => ['id'],
'email' => $params['email'],
'options' => ['limit' => 1],
]);
CRM_Core_Error::statusBounce(ts('Contact does not exist.'));
}
}
- $from_participant = $params = [];
- $query = "select role_id, source, fee_level, is_test, is_pay_later, fee_amount, discount_id, fee_currency,campaign_id, discount_amount from civicrm_participant where id = " . $this->_from_participant_id;
+
+ $query = 'select role_id, source, fee_level, is_test, is_pay_later, fee_amount, discount_id, fee_currency,campaign_id, discount_amount from civicrm_participant where id = ' . $this->_from_participant_id;
$dao = CRM_Core_DAO::executeQuery($query);
$value_to = [];
while ($dao->fetch()) {
* Based on input, create participant row for transferee and send email
*
* return @ void
+ *
+ * @throws \CRM_Core_Exception
*/
public function participantTransfer($participant) {
$contactDetails = [];
foreach ($tokens['domain'] as $token) {
$domainValues[$token] = CRM_Utils_Token::getDomainTokenReplacement($token, $domain);
}
- $participantRoles = [];
+
$participantRoles = CRM_Event_PseudoConstant::participantRole();
$participantDetails = [];
$query = "SELECT * FROM civicrm_participant WHERE id = {$this->_from_participant_id}";