Merge pull request #14475 from eileenmcnaughton/contact_def
[civicrm-core.git] / CRM / Contact / Form / Search / Criteria.php
index 3ff122c8d4b65b0c1e09e4285f6a25d67efe0b9a..1a533342a05e6ac8ab4e603d122229b93dbda4a9 100644 (file)
@@ -275,9 +275,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'],
@@ -334,7 +341,7 @@ class CRM_Contact_Form_Search_Criteria {
         'name' => 'uf_user',
         'description' => ts('Does the contact have a %1 Account?', [$userFramework]),
       ],
-    ]);
+    ];
   }
 
   /**