X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FRelatedContact.php;h=2795870041ad4816728be73904025aa585da1ec6;hb=69078420f066e5d038b91372e9a19eb77073121b;hp=2b634ca09891ad443f6755820e64437173162e60;hpb=52c503aac03bba16dff98f57d5647fb98168e9b7;p=civicrm-core.git diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index 2b634ca098..2795870041 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 */ /** @@ -80,7 +80,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $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; @@ -111,7 +111,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { * 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); @@ -132,17 +132,17 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { ts('Contact Information') ); - $this->addButtons(array( - array( + $this->addButtons([ + [ 'type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE, - ), - array( + ], + [ 'type' => 'cancel', 'name' => ts('Cancel'), - ), - )); + ], + ]); } /** @@ -153,11 +153,11 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $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']; @@ -179,10 +179,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { // 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'); }