From 3eabe83d8e2e85183d93d76fb43b8db180f79da9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 23 Jan 2013 17:46:58 +0000 Subject: [PATCH] Fix export birthday filtering --- ...class.addressbook_export_contacts_csv.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php index ac8b7bbbe5..bbd9fa07bc 100644 --- a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php @@ -85,6 +85,21 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi $query['col_filter'][$field] = implode(',',$value); 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) { $field = 'contact_'.$field; @@ -314,7 +329,6 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi public function get_selectors_etpl() { return array( 'name' => 'importexport.export_csv_selectors', - 'content' => 'use_all', ); }