Search in vTiger CRM – Part I
We need to change search functionality in vTiger (version 5.0.x) so that we display details of only the leads/fields belonging to the user, and for the rest of the entries, display who it belongs to. How do we do that? This requires an understanding of the search functionality in vTiger.
When you search for an item using the search field on the top-right corner of your vTiger install, it sends a POST back to the index.php page.
The form name is “UnifiedSearch”, and a search for the word ’search’ on index.php takes us to this line:
if($action == 'UnifiedSearch') {
$currentModuleFile = 'modules/Home/'.$action.'.php';
} else {
$currentModuleFile = 'modules/'.$module.'/'.$action.'.php';
}
So, /modules/Home/UnifiedSearch.php is what we need to look at.
It looks like UnifiedSearch.php does the following:
- Gets a list of modules that can be searched for using this function: getSearchModulesComboList($search_module);
- Does the usual applying of templating and styles that are done for pretty much every vTiger page
- Handles tag- and global- searches using getUnifiedWhere() and getTagWhere() function calls.
The getUnifiedWhere() and getTagWhere() function calls contain SQL statements – and something tells me these are the SQL statements that need to be modified for our search to be customized.
No comments yet
Leave a reply