From: eileen Date: Fri, 7 Jun 2019 02:41:43 +0000 (+1200) Subject: Move retrieval of basicSearchFields to 'get' fn X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=723e3e6bc6760c6febb6c63494c6c9ff856f7253;p=civicrm-core.git Move retrieval of basicSearchFields to 'get' fn This is a partial of https://github.com/civicrm/civicrm-core/pull/14418 --- diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 7ce75635f7..240ade9aea 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -260,9 +260,16 @@ class CRM_Contact_Form_Search_Criteria { * @param CRM_Core_Form $form */ protected static function setBasicSearchFields($form) { - $userFramework = CRM_Core_Config::singleton()->userFramework; + $form->assign('basicSearchFields', self::getBasicSearchFields()); + } - $form->assign('basicSearchFields', [ + /** + * Return list of basic contact fields that can be displayed for the basic search section. + * + */ + public static function getBasicSearchFields() { + $userFramework = CRM_Core_Config::singleton()->userFramework; + return [ 'sort_name' => ['name' => 'sort_name'], 'email' => ['name' => 'email'], 'contact_type' => ['name' => 'contact_type'], @@ -319,7 +326,7 @@ class CRM_Contact_Form_Search_Criteria { 'name' => 'uf_user', 'description' => ts('Does the contact have a %1 Account?', [$userFramework]), ], - ]); + ]; } /**