* @array string
*/
protected $contact_id;
+
/**
* Get source values for transfer based on participant id in URL. Line items will
* be transferred to this participant - at this point no transaction changes processed
$details = CRM_Event_BAO_Participant::participantDetails($this->_from_participant_id);
$optionGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'participant_role', 'id', 'name');
$query = "
- SELECT cpst.name as status, cov.name as role, cp.fee_level, cp.fee_amount, cp.register_date
+ SELECT cpst.name as status, cov.name as role, cp.fee_level, cp.fee_amount, cp.register_date, civicrm_event.start_date
FROM civicrm_participant cp
LEFT JOIN civicrm_participant_status_type cpst ON cpst.id = cp.status_id
LEFT JOIN civicrm_option_value cov ON cov.value = cp.role_id and cov.option_group_id = {$optionGroupId}
+ LEFT JOIN civicrm_event ON civicrm_event.id = cp.event_id
WHERE cp.id = {$this->_from_participant_id}";
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
while ($dao->fetch()) {
$details['fee_level'] = $dao->fee_level;
$details['fee_amount'] = $dao->fee_amount;
$details['register_date'] = $dao->register_date;
+ $details['event_start_date'] = $dao->start_date;
}
$this->assign('details', $details);
//This participant row will be cancelled. Get line item(s) to cancel
$this->selfsvctransferText = ts('Update');
$this->selfsvctransferButtonText = ts('Update');
}
+
/**
* Build form for input of transferree email, name
*
*/
public function buildQuickForm() {
$this->add('text', 'email', ts('To Email'), ts($this->_contact_email), TRUE);
- $this->add('text', 'last_name', ts('To Last name'), ts($this->_to_contact_last_name), TRUE);
- $this->add('text', 'first_name', ts('To First name'), ts($this->_to_contact_first_name), TRUE);
+ $this->add('text', 'last_name', ts('To Last Name'), ts($this->_to_contact_last_name), TRUE);
+ $this->add('text', 'first_name', ts('To First Name'), ts($this->_to_contact_first_name), TRUE);
$this->addButtons(array(
array(
'type' => 'submit',
- 'name' => ts('Submit'),),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),),
+ 'name' => ts('Transfer Registration'),),
)
);
$this->addFormRule(array('CRM_Event_Form_SelfSvcTransfer', 'formRule'), $this);
parent::buildQuickForm();
}
+
/**
* Set defaults
*
$this->_defaults = array();
return $this->_defaults;
}
+
/**
* Validate email and name input
*
//return parent::formrule($fields, $files, $self);
return empty($errors) ? TRUE : $errors;
}
+
/**
* Check whether profile (name, email) is complete
*
}
return $contact_id;
}
+
/**
* Check contact details
*
}
}
}
+
/**
* Process transfer - first add the new participant to the event, then cancel
* source participant - send confirmation email to transferee
list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contact_id);
$statusMsg = ts('Event registration information for %1 has been updated.', array(1 => $displayName));
$statusMsg .= ' ' . ts('A confirmation email has been sent to %1.', array(1 => $email));
- CRM_Core_Session::setStatus($statusMsg, ts('Saved'), 'success');
+ CRM_Core_Session::setStatus($statusMsg, ts('Registration Transferred'), 'success');
}
+
/**
* Based on input, create participant row for transferee and send email
*
//now registered_id can be updated (mail won't be send if it is set
return $res;
}
+
/**
* Send confirmation of cancellation to source participant
*
<?php
-
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
$contributionId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $this->_participant_id, 'contribution_id', 'participant_id');
$this->assign('contributionId', $contributionId);
$query = "
- SELECT cpst.name as status, cov.name as role, cp.fee_level, cp.fee_amount, cp.register_date, cp.status_id
+ SELECT cpst.name as status, cov.name as role, cp.fee_level, cp.fee_amount, cp.register_date, cp.status_id, civicrm_event.start_date
FROM civicrm_participant cp
LEFT JOIN civicrm_participant_status_type cpst ON cpst.id = cp.status_id
LEFT JOIN civicrm_option_value cov ON cov.value = cp.role_id and cov.option_group_id = {$optionGroupId}
+ LEFT JOIN civicrm_event ON civicrm_event.id = cp.event_id
WHERE cp.id = {$this->_participant_id}";
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
while ($dao->fetch()) {
$details['fee_level'] = $dao->fee_level;
$details['fee_amount'] = $dao->fee_amount;
$details['register_date'] = $dao->register_date;
+ $details['event_start_date'] = $dao->start_date;
}
//verify participant status is still Registered
if ($details['status'] != "Registered") {
* return @void
*/
public function buildQuickForm() {
- $this->add('text', 'email', ts('Email'), ts($this->_contact_email), TRUE);
- $this->add('text', 'participant', ts('Participant name'), ts($this->_contact_name), TRUE);
- $this->add('select', 'action', 'Action', array('-select-', 'Transfer', 'Cancel'));
+ $this->add('select', 'action', ts('Transfer or Cancel Registration'), array(ts('-select-'), ts('Transfer'), ts('Cancel')), TRUE);
$this->addButtons(array(
array(
'type' => 'submit',
'name' => ts('Submit'),
),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
));
parent::buildQuickForm();
}
+
/**
* Set default values for contact
*
*/
public function setDefaultValues() {
$this->_defaults = array();
- $this->_defaults['email'] = $this->_contact_email;
- $this->_defaults['participant'] = $this->_contact_name;
$this->_defaults['details'] = $this->_details;
return $this->_defaults;
}
+
/**
* Process submit form - based on user selection of action
* transfer or cancel the event
$this->cancelParticipant($params);
}
}
+
/**
* Transfer to a new form, allowing selection of a new contact
* based on email and name. The Event will be transferred to this new participant
$session = CRM_Core_Session::singleton();
$session->replaceUserContext($url);
}
+
/**
* Cancel this participant and finish, send cancellation email. At this point no
* auto-cancellation of payment is handled, so payment needs to be manually cancelled
<page_type>1</page_type>
<weight>850</weight>
</item>
- <item>
+ <item>
<path>civicrm/event/selfsvcupdate</path>
- <title>Self Service Update</title>
+ <title>Self-service Registration Update</title>
+ <is_public>true</is_public>
<page_callback>CRM_Event_Form_SelfSvcUpdate</page_callback>
<access_callback>1</access_callback>
<page_type>1</page_type>
</item>
<item>
<path>civicrm/event/selfsvctransfer</path>
- <title>Self Service Transfer</title>
+ <title>Self-service Registration Transfer</title>
+ <is_public>true</is_public>
<page_callback>CRM_Event_Form_SelfSvcTransfer</page_callback>
<page_type>1</page_type>
<access_callback>1</access_callback>
{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
-<div>
- <table class="form-layout">
- <tr class="crm-selfsvctransfer-form-block-email">
- <td class="label">{$form.email.label}</td>
- <td>{$form.email.html}</td>
- </tr>
- <tr class="crm-selfsvctransfer-form-block-participant">
- <td class="label">{$form.last_name.label}</td>
- <td>{$form.last_name.html}</td>
- <tr class="crm-selfsvctransfer-form-block-participant">
- <td class="label">{$form.first_name.label}</td>
- <td>{$form.first_name.html}</td>
- </tr>
- <table class="crm-selfsvctransfer-form-details"><col width="30"><col width="50"><col width="20"><col width="10"><col width="10"><col width="12"><col width="10">
- <tr><th>Participant</th><th>Event</th><th>Fee Level</th><th>Fee Amt</th><th>Reg Date</th><th>Status</th><th>Role</th>
- </tr>
- <tr class="crm-selfsvctransfer-form-details">
- <td>{$details.name}</td><td>{$details.title}</td>
- <td class="crm-participant-participant_fee_level">{$details.fee_level}</td>
- <td class="right nowrap crm-paticipant-participant_fee_amount">{$details.fee_amount}</td>
- <td>{$details.register_date|truncate:10:''|crmDate}</td>
- <td>{$details.status}</td><td class="crm-participant-participant_role">{$details.role}</td>
- </tr>
- </table>
- </table>
- <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
+<div class="crm-selfsvctransfer-form">
+ <table class="crm-selfsvctransfer-form-details">
+ <tr>
+ <th>{ts}Current<br />Participant{/ts}</th>
+ <th>{ts}Event{/ts}</th>
+ <th>{ts}Fee Level{/ts}</th>
+ <th>{ts}Amount{/ts}</th>
+ <th>{ts}Registered{/ts}</th>
+ <th>{ts}Status{/ts}</th>
+ <th>{ts}Role{/ts}</th>
+ </tr>
+ <tr class="crm-selfsvctransfer-form-details">
+ <td>{$details.name}</td>
+ <td>{$details.title}<br />{$details.event_start_date|truncate:10:''|crmDate}</td>
+ <td class="crm-participant-participant_fee_level">{$details.fee_level}</td>
+ <td class="right nowrap crm-paticipant-participant_fee_amount">{$details.fee_amount}</td>
+ <td>{$details.register_date|truncate:10:''|crmDate}</td>
+ <td>{$details.status}</td>
+ <td class="crm-participant-participant_role">{$details.role}</td>
+ </tr>
+ </table>
+ <div class="crm-public-form-item crm-section selfsvctransfer-section">
+ <div class="crm-public-form-item crm-section selfsvctransfer-firstname-section">
+ <div class="label">{$form.first_name.label}</div>
+ <div class="content">{$form.first_name.html}</div>
+ <div class="clear"></div>
+ </div>
+ <div class="crm-public-form-item crm-section selfsvctransfer-lastname-section">
+ <div class="label">{$form.last_name.label}</div>
+ <div class="content">{$form.last_name.html}</div>
+ <div class="clear"></div>
+ </div>
+ <div class="crm-public-form-item crm-section selfsvctransfer-email-section">
+ <div class="label">{$form.email.label}</div>
+ <div class="content">{$form.email.html}</div>
+ <div class="clear"></div>
+ </div>
+ </div>
+ <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
</div>
{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
-<div>
- <table class="form-layout">
- <tr class="crm-selfsvcupdate-form-block-email">
- <td class="label">{$form.email.label}</td>
- <td>{$form.email.html}</td>
- </tr>
- <tr class="crm-selfsvcupdate-form-block-participant">
- <td class="label">{$form.participant.label}</td>
- <td>{$form.participant.html}</td>
- </tr>
- <tr class="crm-selfsvcupdate-form-block-participant">
- <td class="label">{$form.action.label}</td>
- <td>{$form.action.html}</td>
- </tr>
- <table class="crm-selfsvcupdate-form-details"><col width="30"><col width="50"><col width="20"><col width="10"><col width="10"><col width="12"><col width="10">
- <tr><th>Participant</th><th>Event</th><th>Fee Level</th><th>Fee Amt</th><th>Reg Date</th><th>Status</th><th>Role</th>
- </tr>
- <tr class="crm-selfsvcupdate-form-details">
- <td>{$details.name}</td><td>{$details.title}</td>
- <td class="crm-participant-participant_fee_level">{$details.fee_level}</td>
- <td class="right nowrap crm-paticipant-participant_fee_amount">{$details.fee_amount}</td>
- <td>{$details.register_date|truncate:10:''|crmDate}</td>
- <td>{$details.status}</td><td class="crm-participant-participant_role">{$details.role}</td>
- </tr>
- </table>
- </table>
- <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
+<div class="crm-selfsvcupdate-form">
+ <table class="crm-selfsvcupdate-form-details">
+ <tr>
+ <th>{ts}Participant{/ts}</th>
+ <th>{ts}Event{/ts}</th>
+ <th>{ts}Fee Level{/ts}</th>
+ <th>{ts}Amount{/ts}</th>
+ <th>{ts}Registered{/ts}</th>
+ <th>{ts}Status{/ts}</th>
+ <th>{ts}Role{/ts}</th>
+ </tr>
+ <tr class="crm-selfsvcupdate-form-details">
+ <td>{$details.name}</td><td>{$details.title}<br />{$details.event_start_date|truncate:10:''|crmDate}</td>
+ <td class="crm-participant-participant_fee_level">{$details.fee_level}</td>
+ <td class="right nowrap crm-paticipant-participant_fee_amount">{$details.fee_amount}</td>
+ <td>{$details.register_date|truncate:10:''|crmDate}</td>
+ <td>{$details.status}</td><td class="crm-participant-participant_role">{$details.role}</td>
+ </tr>
+ </table>
+ <div class="crm-public-form-item crm-section selfsvcupdate-section">
+ <div class="label">{$form.action.label}</div>
+ <div class="content">{$form.action.html}</div>
+ <div class="clear"></div>
+ </div>
+ <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
</div>
{literal}
<script type="text/javascript">