X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FProfile%2FForm%2FEdit.php;h=c5d493bacf8880d5d943f61224a241559c467f46;hb=701fd7a63eb4b10a6b91a91c0c05dba1bbaf8b69;hp=c01a868c0649259bb9f180ad259cf5d052ee4f5c;hpb=8d785b7a483ce7cf0099435dae7a86c791537bbd;p=civicrm-core.git diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index c01a868c06..c5d493bacf 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.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 * */ @@ -62,7 +62,7 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form { $this->assign('onPopupClose', $this->_onPopupClose); //set the context for the profile - $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); + $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this); //set the block no $this->_blockNo = CRM_Utils_Request::retrieve('blockNo', 'String', $this); @@ -128,7 +128,7 @@ SELECT module,is_reserved WHERE civicrm_uf_group.id = %1 "; - $params = array(1 => array($this->_gid, 'Integer')); + $params = [1 => [$this->_gid, 'Integer']]; $dao = CRM_Core_DAO::executeQuery($query, $params); $isProfile = FALSE; @@ -142,7 +142,7 @@ SELECT module,is_reserved //Remove need for Profile module type when using reserved profiles [CRM-14488] if (!$dao->N || (!$isProfile && !($dao->is_reserved && $canAdd))) { CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) is not configured to be used for \'Profile\' edit and view forms in its Settings. Contact the site administrator if you need assistance.', - array(1 => $this->_gid) + [1 => $this->_gid] )); } } @@ -242,15 +242,15 @@ SELECT module,is_reserved $buttonName = 'next'; } - $buttons[] = array( + $buttons[] = [ 'type' => $buttonName, 'name' => !empty($this->_ufGroup['submit_button_text']) ? $this->_ufGroup['submit_button_text'] : ts('Save'), 'isDefault' => TRUE, - ); + ]; $this->addButtons($buttons); - $this->addFormRule(array('CRM_Profile_Form', 'formRule'), $this); + $this->addFormRule(['CRM_Profile_Form', 'formRule'], $this); } /** @@ -262,10 +262,10 @@ SELECT module,is_reserved // Send back data for the EntityRef widget if ($this->returnExtra) { - $contact = civicrm_api3('Contact', 'getsingle', array( + $contact = civicrm_api3('Contact', 'getsingle', [ 'id' => $this->_id, 'return' => $this->returnExtra, - )); + ]); foreach (explode(',', $this->returnExtra) as $field) { $field = trim($field); $this->ajaxResponse['extra'][$field] = CRM_Utils_Array::value($field, $contact); @@ -301,10 +301,10 @@ SELECT module,is_reserved } else { // Replace tokens from post URL - $contactParams = array( + $contactParams = [ 'contact_id' => $this->_id, 'version' => 3, - ); + ]; $contact = civicrm_api('contact', 'get', $contactParams); $contact = reset($contact['values']);