Skip to content

Commit

Permalink
Move retrieval of basicSearchFields to 'get' fn
Browse files Browse the repository at this point in the history
This is a partial of civicrm#14418
  • Loading branch information
eileenmcnaughton committed Jun 7, 2019
1 parent 4741274 commit 723e3e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CRM/Contact/Form/Search/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,16 @@ public static function basic(&$form) {
* @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'],
Expand Down Expand Up @@ -319,7 +326,7 @@ protected static function setBasicSearchFields($form) {
'name' => 'uf_user',
'description' => ts('Does the contact have a %1 Account?', [$userFramework]),
],
]);
];
}

/**
Expand Down

0 comments on commit 723e3e6

Please sign in to comment.