[Vtigercrm-developers] Don't Change the entityfield for Users... [WAS Re: BUG: UI10 with more than 1 target breaking filters...?}

Alan Lord alanslists at gmail.com
Tue Jun 2 09:42:35 GMT 2015


On 01/06/15 16:47, Mariusz Krzaczkowski wrote:
> Alan had a good idea, suggested on your idea and I corrected it. see:
>
> https://github.com/YetiForceCompany/YetiForceCRM/blob/master/include/QueryGenerator/QueryGenerator.php#L721

Thanks for the cluebat :-)

I have also fixed the bit just below it so that if you want to filter a 
column and the Users Module's entityfield is _not_ set to 
first_name,last_name works too (it's around line 744):


> } elseif (in_array($fieldName, $this->ownerFields)) {
> 	if($fieldName == 'created_user_id'){
>           $concatSql = getSqlForNameInDisplayFormat(array('first_name'=>"vtiger_users$fieldName.first_name",'last_name'=>"vtiger_users$fieldName.last_name"), 'Users');
>           $fieldSql .= "$fieldGlue (trim($concatSql) $valueSql)";
>       }else{
>           $entityFields = Vtiger_Functions::getEntityModuleInfoFieldsFormatted('Users');
>           if(count($entityFields['fieldname']) > 1) {
>               $columns = array();
>               foreach($entityFields['fieldname'] as $i => $fieldname) {
>                   $columns[$fieldname] = $entityFields['tablename'] . '.' . $fieldname;
>               }
> 	        $concatSql = getSqlForNameInDisplayFormat($columns, 'Users');
> 	        $fieldSql .= "$fieldGlue (trim($concatSql) $valueSql OR "."vtiger_groups.groupname $valueSql)";
> 	    } else {
> 	        $columnSql = $entityFields['tablename'] . '.' . $entityFields['fieldname'];
> 	        $fieldSql .= "$fieldGlue (trim($columnSql) $valueSql OR "."vtiger_groups.groupname $valueSql)";
> 	    }
> }

Cheers

Al




More information about the vtigercrm-developers mailing list