protected function assignContactEmailDetails() {
if ($this->_contactID) {
list($this->userDisplayName, $this->userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
+ if (empty($this->userDisplayName)) {
+ $this->userDisplayName = civicrm_api3('contact', 'getvalue', ['id' => $this->_contactID, 'return' => 'display_name']);
+ }
$this->assign('displayName', $this->userDisplayName);
}
}
return $controller->run();
}
+ public function delete() {
+ $controller = new CRM_Core_Controller_Simple(
+ 'CRM_Event_Form_Participant',
+ ts('Delete Participant'),
+ $this->_action
+ );
+
+ $controller->setEmbedded(TRUE);
+ $controller->set('id', $this->_id);
+ $controller->set('cid', $this->_contactId);
+ $controller->run();
+ }
+
public function preProcess() {
$context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
}
- elseif ($this->_action & (CRM_Core_Action::UPDATE |
- CRM_Core_Action::ADD |
- CRM_Core_Action::DELETE
- )
- ) {
+ elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD)) {
$this->edit();
}
+ elseif ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::DETACH)) {
+ $this->delete();
+ }
else {
$this->browse();
}