summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/kolab_addressbook/lib/rcube_kolab_contacts.php5
-rw-r--r--plugins/libkolab/lib/kolab_format_contact.php16
2 files changed, 21 insertions, 0 deletions
diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
index bc20970..3fc8527 100644
--- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
+++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
@@ -400,6 +400,11 @@ class rcube_kolab_contacts extends rcube_addressbook
// NOTE: this is only some rough pre-filtering but probably includes false positives
$squery = $this->_search_query($fields, $value, $mode);
+ // add magic selector to select contacts with birthday dates only
+ if (in_array('birthday', $required)) {
+ $squery[] = array('tags', '=', 'x-has-birthday');
+ }
+
// get all/matching records
$this->_fetch_contacts($squery);
diff --git a/plugins/libkolab/lib/kolab_format_contact.php b/plugins/libkolab/lib/kolab_format_contact.php
index a96312a..63efe9a 100644
--- a/plugins/libkolab/lib/kolab_format_contact.php
+++ b/plugins/libkolab/lib/kolab_format_contact.php
@@ -408,6 +408,22 @@ class kolab_format_contact extends kolab_format
}
/**
+ * Callback for kolab_storage_cache to get object specific tags to cache
+ *
+ * @return array List of tags to save in cache
+ */
+ public function get_tags()
+ {
+ $tags = array();
+
+ if (!empty($this->data['birthday'])) {
+ $tags[] = 'x-has-birthday';
+ }
+
+ return $tags;
+ }
+
+ /**
* Helper method to copy contents of an Address vector to the contact data object
*/
private function read_addresses($addresses, &$object, $type = null)