list($this->userDisplayName,
$this->userEmail
) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
- $this->assign('displayName', $this->userDisplayName);
}
$this->setPageTitle(ts('Pledge'));
$this->assign('installments', $defaults['installments']);
}
else {
+ if ($this->_contactID) {
+ $defaults['contact_id'] = $this->_contactID;
+ }
// default values.
$defaults['create_date'] = date('Y-m-d');
$defaults['start_date'] = date('Y-m-d');
return;
}
- if ($this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Contact'), [
- 'create' => TRUE,
- 'api' => ['extra' => ['email']],
- ], TRUE);
+ $contactField = $this->addEntityRef('contact_id', ts('Contact'), ['create' => TRUE, 'api' => ['extra' => ['email']]], TRUE);
+ if ($this->_context != 'standalone') {
+ $contactField->freeze();
}
$showAdditionalInfo = FALSE;
// send Acknowledgment mail.
CRM_Pledge_BAO_Pledge::sendAcknowledgment($this, $params);
- if (!isset($this->userEmail)) {
- list($this->userDisplayName,
- $this->userEmail
- ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
- }
-
$statusMsg .= ' ' . ts("An acknowledgment email has been sent to %1.<br />", [1 => $this->userEmail]);
// build the payment urls.