[Vtigercrm-commits] [vtiger-commits] r10766 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 23 12:40:05 EDT 2007
Author: saraj
Date: Mon Apr 23 10:40:00 2007
New Revision: 10766
Log:
Advanced search - Searching for empty string not working properly- fixed. Fixes #3503
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 Mon Apr 23 10:40:00 2007
@@ -519,43 +519,36 @@
{
global $log;
$log->debug("Entering getSearch_criteria(".$criteria.",".$searchstring.",".$searchfield.") method ...");
+ $searchstring = ltrim(rtrim($searchstring));
$where_string = '';
switch($criteria)
{
case 'cts':
$where_string = $searchfield." like '%".$searchstring."%' ";
if($searchstring == NULL)
- $where_string = $searchfield." is NULL";
+ $where_string = $searchfield." like ''";
break;
case 'dcts':
$where_string = $searchfield." not like '%".$searchstring."%' ";
if($searchstring == NULL)
- $where_string = $searchfield." is not NULL";
+ $where_string = $searchfield." not like ''";
break;
case 'is':
$where_string = $searchfield." = '".$searchstring."' ";
- if($searchstring == NULL)
- $where_string = $searchfield." is NULL";
break;
case 'isn':
$where_string = $searchfield." <> '".$searchstring."' ";
- if($searchstring == NULL)
- $where_string = $searchfield." is not NULL";
break;
case 'bwt':
$where_string = $searchfield." like '".$searchstring."%' ";
- if($searchstring == NULL)
- $where_string = $searchfield." is NULL";
break;
case 'ewt':
$where_string = $searchfield." like '%".$searchstring."' ";
- if($searchstring == NULL)
- $where_string = $searchfield." is NULL";
break;
case 'grt':
More information about the vtigercrm-commits
mailing list