[Vtigercrm-commits] [vtiger-commits] r11018 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 24 09:12:00 EDT 2007
Author: saraj
Date: Thu May 24 07:11:48 2007
New Revision: 11018
Log:
Contact Name is not coming in Basic Search of Notes (For Non-admin User). Fixes #3909
Modified:
vtigercrm/branches/5.0.3/include/utils/SearchUtils.php
Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/SearchUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Thu May 24 07:11:48 2007
@@ -58,7 +58,7 @@
}
//Added to reduce the no. of queries logging for non-admin vtiger_users -- by Minnie-start
$field_list ='(';
- $j=0;
+ $j=0;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
foreach($focus->list_fields as $name=>$tableinfo)
{
@@ -74,10 +74,12 @@
{
$field_list .= ', ';
}
- if($fieldname == "accountname")
+ if($fieldname == "accountname" && $module !="Accounts")
$fieldname = "account_id";
- if($fieldname == "lastname" && $module !="Leads")
+ if($fieldname == "lastname" && $module !="Leads" && $module !="Contacts")
+ {
$fieldname = "contact_id";
+ }
$field_list .= "'".$fieldname."'";
$j++;
}
@@ -119,8 +121,10 @@
$fieldname = $focus->list_fields_name[$name];
}
- if($fieldname == "lastname" && $module != "Leads")
+ if($fieldname == "lastname" && $module !="Leads" && $module !="Contacts")
$fieldname = "contact_id";
+ if($fieldname == "accountname" && $module !="Accounts")
+ $fieldname = "account_id";
}
else
{
@@ -129,10 +133,9 @@
else
$fieldname = $focus->list_fields_name[$name];
- if($fieldname == "lastname" && $module != "Leads")
+ if($fieldname == "lastname" && $module !="Leads" && $module !="Contacts")
$fieldname = "contact_id";
}
-
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0 || in_array($fieldname,$field))
{
if($fieldname!='parent_id')
@@ -332,7 +335,6 @@
{
$column_name=$adb->query_result($result,0,'columnname');
-
//Check added for tickets by accounts/contacts in dashboard
if ($column_name == 'parent_id')
{
@@ -345,6 +347,13 @@
$table_name=$adb->query_result($result,0,'tablename');
$uitype=getUItype($module,$column_name);
+ //Added for Member of search in Accounts
+ if($column_name == "parentid" && $module == "Accounts")
+ {
+ $table_name = "vtiger_account2";
+ $column_name = "accountname";
+ }
+
//Added to support user date format in basic search
if($uitype == 5 || $uitype == 6 || $uitype == 23 || $uitype == 70)
{
@@ -377,7 +386,6 @@
}
else
{
-
$where="$table_name.$column_name like '%".$search_string."%'";
}
}
@@ -472,7 +480,7 @@
$fieldtype = $adb->query_result($result,$i,"typeofdata");
$fieldtype = explode("~",$fieldtype);
$fieldtypeofdata = $fieldtype[0];
- if($fieldcolname == 'account_id' || $fieldcolname == 'accountid' || $fieldcolname == 'product_id' || $fieldcolname == 'vendor_id' || $fieldcolname == 'contact_id' || $fieldcolname == 'contactid' || $fieldcolname == 'vendorid' || $fieldcolname == 'potentialid' || $fieldcolname == 'salesorderid' || $fieldcolname == 'quoteid')
+ if($fieldcolname == 'account_id' || $fieldcolname == 'accountid' || $fieldcolname == 'product_id' || $fieldcolname == 'vendor_id' || $fieldcolname == 'contact_id' || $fieldcolname == 'contactid' || $fieldcolname == 'vendorid' || $fieldcolname == 'potentialid' || $fieldcolname == 'salesorderid' || $fieldcolname == 'quoteid' || $fieldcolname == 'parentid')
$fieldtypeofdata = "V";
$fieldlabel = $mod_strings[$adb->query_result($result,$i,"fieldlabel")];
@@ -565,6 +573,8 @@
else
$searchstring = getDBInsertDateValue($sdate);
}
+ if($searchfield == "vtiger_account.parentid")
+ $searchfield = "vtiger_account2.accountname";
$where_string = '';
switch($criteria)
{
More information about the vtigercrm-commits
mailing list