Skip to content
Snippets Groups Projects
Commit 948b5a17 authored by madhu sr's avatar madhu sr
Browse files

#Fixes::158620111::madhusr::1784::When we select the company name,filter...

#Fixes::158620111::madhusr::1784::When we select the company name,filter condition is not working properly in the popup
parent 0c4c8699
No related branches found
No related tags found
No related merge requests found
......@@ -274,7 +274,7 @@ class Vtiger_RelationListView_Model extends Vtiger_Base_Model {
if ($this->get('whereCondition') && is_array($this->get('whereCondition'))) {
$currentUser = Users_Record_Model::getCurrentUserModel();
$queryGenerator = new QueryGenerator($relationModuleName, $currentUser);
$queryGenerator = new EnhancedQueryGenerator($relationModuleName, $currentUser);
$queryGenerator->setFields(array_values($relatedColumnFields));
$whereCondition = $this->get('whereCondition');
foreach ($whereCondition as $fieldName => $fieldValue) {
......
......@@ -169,6 +169,25 @@ class Vtiger_Popup_View extends Vtiger_Footer_View {
if(!empty($relatedParentModule) && !empty($relatedParentId)) {
$this->listViewHeaders = $listViewModel->getHeaders();
$relatedModuleModel = Vtiger_Module_Model::getInstance($moduleName);
$moduleFields = $relatedModuleModel->getFields();
if (empty($searchParams)) {
$searchParams = array();
}
$whereCondition = array();
foreach ($searchParams as $fieldListGroup) {
foreach ($fieldListGroup as $fieldSearchInfo) {
$fieldModel = $moduleFields[$fieldSearchInfo[0]];
$tableName = $fieldModel->get('table');
$column = $fieldModel->get('column');
$whereCondition[$fieldSearchInfo[0]] = array($tableName.'.'.$column, $fieldSearchInfo[1], $fieldSearchInfo[2]);
}
}
if (!empty($whereCondition))
$listViewModel->set('whereCondition', $whereCondition);
$models = $listViewModel->getEntries($pagingModel);
$noOfEntries = php7_count($models);
foreach ($models as $recordId => $recordModel) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment