Skip to content

Commit

Permalink
fix(Mobile):fix #177. Add support to uitype 51 on related search.
Browse files Browse the repository at this point in the history
We have this uitype value and not uitype 10 on module Contacts and Account point to Accounts module.
Uitype 51 will disapear on the future and we will can remove this code.
  • Loading branch information
omarllorens committed Feb 5, 2018
1 parent 88cd1d8 commit 366191f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/Mobile/actions/getRelatedFieldAjax.php
Expand Up @@ -40,6 +40,17 @@ function process(crmtogo_API_Request $request) {
for($i=0;$i<count($searchqueryresult);$i++){
$searchresult[] = Array($searchqueryresult[$i]['id'],decode_html(getTranslatedString($modulename)." :: ".$searchqueryresult[$i][$fieldname]));
}
} elseif ($parentid == 'account_id' && ($module == 'Contacts' || $module == 'Accounts')){ //Support to uitype 51
$query = "SELECT fieldname FROM vtiger_entityname WHERE entityidcolumn = ? AND modulename = 'Accounts'";
$result = $adb->pquery($query, array($parentid));
$modulename = 'Accounts';
$fieldname = $adb->query_result($result,0,'fieldname');
$config = crmtogo_WS_Controller::getUserConfigSettings();
$limit = $config['NavigationLimit'];
$searchqueryresult = vtws_query("SELECT ".$fieldname." FROM ".$modulename." WHERE ".$fieldname." like '%".$searchvalue."%' LIMIT ".$limit.";", $current_user);
for($i=0;$i<count($searchqueryresult);$i++){
$searchresult[] = Array($searchqueryresult[$i]['id'],decode_html(getTranslatedString($modulename)." :: ".$searchqueryresult[$i][$fieldname]));
}
}
//get relmodule
$res_fmrel = $adb->pquery("SELECT relmodule FROM `vtiger_fieldmodulerel`
Expand Down

0 comments on commit 366191f

Please sign in to comment.