X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FProfileContact.php;h=9aaf558b931f264c031c48e2d8e367fd21a4edbd;hb=cda772aae0c600de9033d3360dfde772a2a78f64;hp=e8276c8fff53fc74cfc300960370c10f52b0f5ce;hpb=d44c681d9105af668449d16d9f53832d7982f47e;p=civicrm-core.git diff --git a/CRM/Contact/Form/ProfileContact.php b/CRM/Contact/Form/ProfileContact.php index e8276c8fff..9aaf558b93 100644 --- a/CRM/Contact/Form/ProfileContact.php +++ b/CRM/Contact/Form/ProfileContact.php @@ -1,7 +1,7 @@ get('userID'); @@ -66,7 +65,7 @@ class CRM_Contact_Form_ProfileContact { $requiredProfileFields = array( 'Individual' => array('first_name', 'last_name'), 'Organization' => array('organization_name', 'email'), - 'Household' => array('household_name', 'email') + 'Household' => array('household_name', 'email'), ); $validProfile = CRM_Core_BAO_UFGroup::checkValidProfile($form->_honoreeProfileId, $requiredProfileFields[$profileContactType]); if (!$validProfile) { @@ -75,13 +74,12 @@ class CRM_Contact_Form_ProfileContact { } /** - * build form for honoree contact / on behalf of organization. + * Build form for honoree contact / on behalf of organization. * * @param CRM_Core_Form $form * - * @static */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $ufGroup = new CRM_Core_DAO_UFGroup(); $ufGroup->id = $form->_honoreeProfileId; if (!$ufGroup->find(TRUE)) { @@ -90,11 +88,11 @@ class CRM_Contact_Form_ProfileContact { $prefix = 'honor'; $honoreeProfileFields = CRM_Core_BAO_UFGroup::getFields($form->_honoreeProfileId, FALSE, NULL, - NULL, NULL, - FALSE, NULL, - TRUE, NULL, - CRM_Core_Permission::CREATE - ); + NULL, NULL, + FALSE, NULL, + TRUE, NULL, + CRM_Core_Permission::CREATE + ); $form->addElement('hidden', 'honoree_profile_id', $form->_honoreeProfileId); $form->assign('honoreeProfileFields', $honoreeProfileFields); @@ -111,17 +109,17 @@ class CRM_Contact_Form_ProfileContact { /** * @param $form */ - static function postProcess($form) { + public static function postProcess($form) { $params = $form->_params; if (!empty($form->_honor_block_is_active) && !empty($params['soft_credit_type_id'])) { - $honorId = null; + $honorId = NULL; //check if there is any duplicate contact $profileContactType = CRM_Core_BAO_UFGroup::getContactType($params['honoree_profile_id']); $dedupeParams = CRM_Dedupe_Finder::formatParams($params['honor'], $profileContactType); $dedupeParams['check_permission'] = FALSE; $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, $profileContactType); - if(count($ids)) { + if (count($ids)) { $honorId = CRM_Utils_Array::value(0, $ids); } @@ -151,10 +149,10 @@ class CRM_Contact_Form_ProfileContact { ), 'honor_id' => $honorId, 'honor_profile_id' => $params['honoree_profile_id'], - 'honor_profile_values' => $params['honor'] + 'honor_profile_values' => $params['honor'], ); } } } -} +}