[Vtigercrm-commits] [vtiger-commits] r10781 - in /vtigercrm/branches/5.0.3/include: language/en_us.lang.php utils/SearchUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Apr 25 06:17:59 EDT 2007


Author: saraj
Date: Wed Apr 25 04:17:43 2007
New Revision: 10781

Log:
Calendar : Advanced search is not working properly. Fixes #3526

Modified:
    vtigercrm/branches/5.0.3/include/language/en_us.lang.php
    vtigercrm/branches/5.0.3/include/utils/SearchUtils.php

Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original)
+++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Wed Apr 25 04:17:43 2007
@@ -861,6 +861,9 @@
 'LBL_FIRST'=>'First',
 'LBL_LAST'=>'Last',
 
+'LBL_CONTACT_LAST_NAME'=>'Contact - Last Name',
+'LBL_CONTACT_FIRST_NAME'=>'Contact - First Name',
+
 'Office Phone'=>'Office Phone',
 'Sender'=>'Sender',
 'Website'=>'Website',
@@ -872,7 +875,6 @@
 'Lead Status'=>'Lead Status',
 'Lead Source'=>'Lead Source',
 'Quote ID'=>'Quote Id',
-'LBL_CONTACT_LAST_NAME'=>'Contact - Last Name',
 );
 
 $app_list_strings = array (

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 Wed Apr 25 04:17:43 2007
@@ -306,8 +306,7 @@
 			$search_field = "parent_id";
 		}
 		//Check ends
-		
-               if($module == "Notes" && $search_field == "contact_id")
+		if($module == "Calendar" || $module == "Invoice" ||$module == "Notes" || $module == "SalesOrder" || $module== "PurchaseOrder"  && ($search_field == "contact_id"))
 	       {
 	                 $module = 'Contacts';
 	                 $search_field = 'lastname';
@@ -389,7 +388,7 @@
         $log->debug("Entering getAdvSearchfields(".$module.") method ...");
 	global $adb;
 	global $current_user;	
-	global $mod_strings;
+	global $mod_strings,$app_strings;
 	require('user_privileges/user_privileges_'.$current_user->id.'.php');
 
 	$tabid = getTabid($module);
@@ -473,6 +472,11 @@
 				$OPTION_SET .= "<option value=\'".$fieldtablename.".".$fieldcolname."\' selected>".$fieldlabel."</option>";
 			elseif($fieldlabel == "Product Code")
 				$OPTION_SET .= "<option value=\'".$fieldtablename.".".$fieldcolname."\'>".$mod_strings[$fieldlabel]."</option>";
+			elseif($fieldcolname == "contactid")
+			{
+				$OPTION_SET .= "<option value=\'vtiger_contactdetails.lastname\'>".$app_strings['LBL_CONTACT_LAST_NAME']."</option>";
+				$OPTION_SET .= "<option value=\'vtiger_contactdetails.firstname\'>".$app_strings['LBL_CONTACT_FIRST_NAME']."</option>";
+			}
 			else
 				$OPTION_SET .= "<option value=\'".$fieldtablename.".".$fieldcolname."\'>".$fieldlabel."</option>";
 		}
@@ -626,7 +630,12 @@
 			}
 			elseif($tab_col == "vtiger_activity.status")
 			{
-				$adv_string .= " (".getSearch_criteria($srch_cond,$srch_val,'vtiger_activity.status')." or";	
+				if($srch_cond == 'dcts' || $srch_cond == 'isn')
+					$re_cond = "and";
+				else
+					$re_cond = "or";
+
+				$adv_string .= " (".getSearch_criteria($srch_cond,$srch_val,'vtiger_activity.status')." ".$re_cond;
 				$adv_string .= " ".getSearch_criteria($srch_cond,$srch_val,'vtiger_activity.eventstatus')." )".$matchtype;	
 			}
 			elseif($tab_col == "vtiger_cntactivityrel.contactid")





More information about the vtigercrm-commits mailing list