Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Documentation
Docs
Developer Documentation
Merge requests
!668
Added doc for hook_civicrm_entityRefFilters
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Added doc for hook_civicrm_entityRefFilters
github/fork/pradpnayak/entityRefFilters
into
master
Overview
1
Commits
0
Pipelines
0
Changes
0
Merged
Pradeep Nayak
requested to merge
github/fork/pradpnayak/entityRefFilters
into
master
5 years ago
Overview
1
Commits
0
Pipelines
0
Changes
2
Expand
For
https://github.com/civicrm/civicrm-core/pull/15231
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
091a4e17
0 commits,
4 years ago
2 files
+
52
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
docs/hooks/hook_civicrm_entityRefFilters.md
0 → 100644
+
51
−
0
Options
# hook_civicrm_entityRefFilters
## Summary
This hook is called when filters and create links for entityRef field is build.
## Definition
hook_civicrm_entityRefFilters(&$filters, &$links)
## Parameters
-
array $filters - reference to list of filters
-
array $links - reference to list of create links
## Returns
## Example
/**
* Implements hook_civicrm_entityRefFilters().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityRefFilters
*/
function modulename_civicrm_entityRefFilters(&$filters, &$links) {
// Add New Staff link on entityRef field of contact
$links['Contact'][] = [
'label' => ts('New Staff'),
'url' => CRM_Utils_System::url('/civicrm/profile/create', 'reset=1&context=dialog&gid=5'),
'type' => 'Individual',
'icon' => 'fa-user',
];
// Add Do not email filter on contact entity ref field.
$filters['Contact'][] = [
'key' => 'do_not_email',
'value' => ts('Do Not Email'),
];
// Add Marital status filter on contact entity ref field.
$filters['Contact'][] = [
'key' => 'custom_2',
'value' => ts('Marital status'),
];
// Add custom field of address as filter on contact entity ref field.
$filters['Contact'][] = [
'key' => 'custom_34',
'value' => ts('Belongs to'),
'entity' => 'Address',
];
}
Loading