$contact = new CRM_Contact_DAO_Contact();
$contact->id = $this->_contactId;
if (!$contact->find(TRUE)) {
- CRM_Core_Error::statusBounce(ts('contact does not exist: %1', array(1 => $this->_contactId)));
+ CRM_Core_Error::statusBounce(ts('contact does not exist: %1', [1 => $this->_contactId]));
}
$this->_contactType = $contact->contact_type;
* Build the form object.
*/
public function buildQuickForm() {
- $params = array();
+ $params = [];
$params['id'] = $params['contact_id'] = $this->_contactId;
$contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults);
ts('Contact Information')
);
- $this->addButtons(array(
- array(
+ $this->addButtons([
+ [
'type' => 'next',
'name' => ts('Save'),
'isDefault' => TRUE,
- ),
- array(
+ ],
+ [
'type' => 'cancel',
'name' => ts('Cancel'),
- ),
- ));
+ ],
+ ]);
}
/**
$params = $this->controller->exportValues($this->_name);
$locType = CRM_Core_BAO_LocationType::getDefault();
- foreach (array(
- 'phone',
- 'email',
- 'address',
- ) as $locFld) {
+ foreach ([
+ 'phone',
+ 'email',
+ 'address',
+ ] as $locFld) {
if (!empty($this->_defaults[$locFld]) && $this->_defaults[$locFld][1]['location_type_id']) {
$params[$locFld][1]['is_primary'] = $this->_defaults[$locFld][1]['is_primary'];
$params[$locFld][1]['location_type_id'] = $this->_defaults[$locFld][1]['location_type_id'];
// set status message.
if ($this->_contactId) {
- $message = ts('%1 has been updated.', array(1 => $contact->display_name));
+ $message = ts('%1 has been updated.', [1 => $contact->display_name]);
}
else {
- $message = ts('%1 has been created.', array(1 => $contact->display_name));
+ $message = ts('%1 has been created.', [1 => $contact->display_name]);
}
CRM_Core_Session::setStatus($message, ts('Contact Saved'), 'success');
}