[Vtigercrm-commits] [vtiger-commits] r10752 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 21 08:22:02 EDT 2007


Author: saraj
Date: Sat Apr 21 06:21:56 2007
New Revision: 10752

Log:
advanced search option is not functioning properly - fixed. Fixes #3291

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 Sat Apr 21 06:21:56 2007
@@ -239,7 +239,7 @@
 */
 
 
-function getValuesforColumns($column_name,$search_string)
+function getValuesforColumns($column_name,$search_string,$criteria='cts')
 {
 	global $log;
 	$log->debug("Entering getValuesforColumns(".$column_name.",".$search_string.") method ...");
@@ -253,17 +253,20 @@
 			$x=count($explode_column);	
 			if($x == 1 )
 			{
-				$where=" $val like '%".$search_string ."%'";
+				$where=getSearch_criteria($criteria,$search_string,$val);
 			}
 			else 
 			{
 				$where="(";
 				for($j=0;$j<count($explode_column);$j++)
 				{
-					$where .= $explode_column[$j]." like '%".$search_string."%'";
+					$where .=getSearch_criteria($criteria,$search_string,$explode_column[$j]);
 					if($j != $x-1)
 					{
-						$where .= " or ";
+						if($criteria == 'dcts')
+							$where .= " and ";
+						else
+							$where .= " or ";
 					}
 				}
 				$where.=")";
@@ -638,7 +641,7 @@
 			}
 			elseif(in_array($column_name,$column_array))
                         {
-                                $adv_string .= getValuesforColumns($column_name,$srch_val)." ".$matchtype;
+                                $adv_string .= getValuesforColumns($column_name,$srch_val,$srch_cond)." ".$matchtype;
                         }
 			else
 			{





More information about the vtigercrm-commits mailing list