Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public function preProcess() {
break;

case 'builder':
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$searchType = $searchPath;
$this->_action = CRM_Core_Action::PROFILE;
break;
Expand Down
1 change: 1 addition & 0 deletions CRM/Contact/BAO/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ public static function createHiddenSmartGroup($params) {
$ssId = $params['saved_search_id'] ?? NULL;

//add mapping record only for search builder saved search
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$mappingId = NULL;
if ($params['search_context'] == 'builder') {
//save the mapping for search builder
Expand Down
3 changes: 3 additions & 0 deletions CRM/Contact/BAO/Query/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public function getContactFields(): array {
/**
* @param $apiEntities
* @param $fieldOptions
*
* @deprecated will be replaced by core extension search_kit
* Only used by the legacy Search Builder - see CRM_Contact_Form_Search_Builder.
*/
public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
foreach (self::getSearchQueryObjects() as $obj) {
Expand Down
3 changes: 3 additions & 0 deletions CRM/Contact/BAO/Query/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type
* For boolean options, use value "yesno". For pseudoconstants/FKs, use the name of an API entity
* from which the metadata of the field may be queried. (Yes - that is a mouthful.)
* @void
*
* @deprecated will be replaced by core extension search_kit
* Only used by the legacy Search Builder - see CRM_Contact_Form_Search_Builder.
*/
public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/SavedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public static function getEditSearchUrl($id) {
if (!empty($savedSearch->api_entity)) {
return CRM_Utils_System::url('civicrm/admin/search', NULL, FALSE, "/edit/$id?tab=group");
}
// Classic search builder
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
if (!empty($savedSearch->mapping_id)) {
$path = 'civicrm/contact/search/builder';
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Contact/Controller/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function invalidKey() {
$path = 'civicrm/contact/search/basic';
}
elseif (str_contains($qString, 'builder')) {
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$path = 'civicrm/contact/search/builder';
}
$url = CRM_Utils_System::url($path, $args);
Expand Down
18 changes: 17 additions & 1 deletion CRM/Contact/Form/Search/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@
*/

/**
* This class is for search builder processing.
* Legacy Search Builder form (civicrm/contact/search/builder).
*
* @deprecated will be replaced by core extension search_kit
*
* SearchKit is the replacement and where effort should go. Rather than fixing or
* extending this form, fix whatever stops people moving from it to SearchKit.
* Changes here should be limited to security issues, fatal errors and PHP compatibility.
*
* It is not in the navigation menu on new installs but can still be reached:
* - directly at civicrm/contact/search/builder, including from menu items kept by
* sites upgraded from versions that had one;
* - via "Edit Smart Group Criteria" on a smart group created with it
* (CRM_Contact_BAO_SavedSearch::getEditSearchUrl());
* - by returning from a task (e.g. send mailing, add to group) run on its results.
*
* Code paths elsewhere that exist only to serve this form are marked with a
* comment pointing back here.
*/
class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {

Expand Down
1 change: 1 addition & 0 deletions CRM/Contact/Form/Task/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function preProcess() {
$fragment = 'search';
}
elseif ($this->_action == CRM_Core_Action::PROFILE) {
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$fragment = 'search/builder';
}
elseif ($this->_action == CRM_Core_Action::ADVANCED) {
Expand Down
2 changes: 2 additions & 0 deletions CRM/Contact/Form/Task/SaveSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function preProcess() {
$values = $this->controller->exportValues('Advanced');
}
elseif ($this->_action == CRM_Core_Action::PROFILE) {
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$values = $this->controller->exportValues('Builder');
}
elseif ($this->_action == CRM_Core_Action::COPY) {
Expand Down Expand Up @@ -140,6 +141,7 @@ public function postProcess() {
$isSearchBuilder = $this->get('isSearchBuilder');

// add mapping record only for search builder saved search
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$mappingId = NULL;
if ($isAdvanced == '2' && $isSearchBuilder == '1') {
//save the mapping for search builder
Expand Down
6 changes: 4 additions & 2 deletions CRM/Contact/StateMachine/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine {
/**
* Class constructor.
*
* @param object $controller
* @param \const|int $action
* @param CRM_Core_Controller $controller
* @param int $action
* A CRM_Core_Action constant selecting which search form to show.
*/
public function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
Expand All @@ -38,6 +39,7 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) {
[$task, $result] = $this->taskName($controller, 'Advanced');
}
elseif ($action == CRM_Core_Action::PROFILE) {
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$this->_pages['CRM_Contact_Form_Search_Builder'] = NULL;
[$task, $result] = $this->taskName($controller, 'Builder');
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Core/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public function getSearchFormValues() {
return $this->controller->exportValues('Advanced');
}
if ($this->_action === CRM_Core_Action::PROFILE) {
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
return $this->controller->exportValues('Builder');
}
if ($this->_action == CRM_Core_Action::COPY) {
Expand Down
7 changes: 3 additions & 4 deletions CRM/Core/StateMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ class CRM_Core_StateMachine {
/**
* Class constructor.
*
* @param object $controller
* @param CRM_Core_Controller $controller
* The controller for this state machine.
*
* @param \const|int $action
*
* @return \CRM_Core_StateMachine
* @param int $action
* A CRM_Core_Action constant.
*/
public function __construct(&$controller, $action = CRM_Core_Action::NONE) {
$this->_controller = &$controller;
Expand Down
1 change: 1 addition & 0 deletions CRM/Core/xml/Menu/Contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<page_type>1</page_type>
<weight>12</weight>
</item>
<!-- Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement. -->
<item>
<path>civicrm/contact/search/builder</path>
<title>Search Builder</title>
Expand Down
1 change: 1 addition & 0 deletions CRM/Event/Form/Task/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function assignUrlPath() {
break;

case 'builder':
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$urlString = 'civicrm/contact/search/builder';
$this->_action = CRM_Core_Action::PROFILE;
break;
Expand Down
1 change: 1 addition & 0 deletions CRM/Mailing/Form/Approve.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public function postProcess() {
$fragment = 'search';
}
elseif ($this->_action == CRM_Core_Action::PROFILE) {
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$fragment = 'search/builder';
}
elseif ($this->_action == CRM_Core_Action::ADVANCED) {
Expand Down
1 change: 1 addition & 0 deletions api/v3/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ function _civicrm_api3_participant_create_spec(&$params) {
$params['event_id']['api.required'] = 1;
$params['contact_id']['api.required'] = 1;
// These are for the sake of search builder options - can be removed if that is fixed
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
$params['role_id']['api.aliases'] = ['participant_role'];
$params['status_id']['api.aliases'] = ['participant_status'];
}
Expand Down
3 changes: 3 additions & 0 deletions ext/civigrant/CRM/Grant/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type
*
* @param array $apiEntities
* @param array $fieldOptions
*
* @deprecated will be replaced by core extension search_kit
* Only used by the legacy Search Builder - see CRM_Contact_Form_Search_Builder.
*/
public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
$apiEntities[] = 'grant';
Expand Down
1 change: 1 addition & 0 deletions templates/CRM/Contact/Form/Search/Builder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// http://civicrm.org/licensing
// Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement.
(function($) {
'use strict';

Expand Down
1 change: 1 addition & 0 deletions templates/CRM/Contact/Form/Search/Builder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
+--------------------------------------------------------------------+
*}
{* Search Builder *}
{* Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement. *}
<div class="messages status no-popup">
{icon icon="fa-info-circle"}{/icon}
{capture assign='skUrl'}{crmURL p='civicrm/admin/search'}{/capture}
Expand Down
1 change: 1 addition & 0 deletions templates/CRM/Contact/Form/Search/table.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
+--------------------------------------------------------------------+
*}
{* template for search builder *}
{* Legacy Search Builder only (deprecated, see CRM_Contact_Form_Search_Builder) - SearchKit is the replacement. *}
<div id="map-field">
{strip}
{section start=1 name=blocks loop=$blockCount}
Expand Down