From 723e3e6bc6760c6febb6c63494c6c9ff856f7253 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 7 Jun 2019 14:41:43 +1200 Subject: [PATCH] Move retrieval of basicSearchFields to 'get' fn This is a partial of https://github.com/civicrm/civicrm-core/pull/14418 --- CRM/Contact/Form/Search/Criteria.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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]), ], - ]); + ]; } /** -- 2.25.1