X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FRelatedContact.php;h=7c01ebaa37c0da7ec930b8b114708f8e1ea41096;hb=709e574bfc8b047d9e9f9a6ad84595bc3f560b54;hp=e950ed69c3fe789576c12db171f9606bfe586f91;hpb=23e35f75793a63e1c50249d322bcf1f2439415f8;p=civicrm-core.git diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index e950ed69c3..7c01ebaa37 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -1,7 +1,7 @@ _action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'update' ); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); - $rcid = CRM_Utils_Request::retrieve('rcid', 'Positive', $this); - $rcid = $rcid ? "&id={$rcid}" : ''; + $rcid = CRM_Utils_Request::retrieve('rcid', 'Positive', $this); + $rcid = $rcid ? "&id={$rcid}" : ''; $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1{$rcid}")); @@ -104,27 +99,22 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { } /** - * Set default values for the form. Note that in edit/view mode - * the default values are retrieved from the database - * - * @access public + * Set default values for the form. * - * @return void + * Note that in edit/view mode the default values are retrieved from the + * database */ - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } /** - * Build the form object - * - * @return void - * @access public + * Build the form object. */ public function buildQuickForm() { - $params = array(); + $params = array(); $params['id'] = $params['contact_id'] = $this->_contactId; - $contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults); + $contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults); $countryID = ''; $stateID = ''; @@ -144,24 +134,20 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { ); $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - )); + array( + 'type' => 'next', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } /** * Form submission of new/edit contact is processed. - * - * @access public - * - * @return void */ public function postProcess() { // store the submitted values in an array @@ -169,7 +155,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $locType = CRM_Core_BAO_LocationType::getDefault(); foreach (array( - 'phone', 'email', 'address') as $locFld) { + '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']; @@ -182,7 +171,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $params['contact_type'] = $this->_contactType; //CRM-14904 - if ( isset($this->_defaults['contact_sub_type']) ) { + if (isset($this->_defaults['contact_sub_type'])) { $params['contact_sub_type'] = $this->_defaults['contact_sub_type']; } $params['contact_id'] = $this->_contactId; @@ -198,5 +187,5 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { } CRM_Core_Session::setStatus($message, ts('Contact Saved'), 'success'); } -} +}