Fix export birthday filtering

This commit is contained in:
Nathan Gray 2013-01-23 17:46:58 +00:00
parent 31d717643c
commit 3eabe83d8e

View File

@ -85,6 +85,21 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi
$query['col_filter'][$field] = implode(',',$value); $query['col_filter'][$field] = implode(',',$value);
continue; continue;
} }
// Birthdays in addressbook are formatted Y-m-d
if($field == 'bday')
{
if($value['from'])
{
$query['col_filter'][] = "contact_bday >= " . $GLOBALS['egw']->db->quote(date('Y-m-d', (int)$value['from']));
}
if($value['to'])
{
$query['col_filter'][] = "contact_bday <= " . $GLOBALS['egw']->db->quote(date('Y-m-d', (int)$value['to']));
}
continue;
}
if(strpos($field, '#') !== 0) if(strpos($field, '#') !== 0)
{ {
$field = 'contact_'.$field; $field = 'contact_'.$field;
@ -314,7 +329,6 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi
public function get_selectors_etpl() { public function get_selectors_etpl() {
return array( return array(
'name' => 'importexport.export_csv_selectors', 'name' => 'importexport.export_csv_selectors',
'content' => 'use_all',
); );
} }