summaryrefslogtreecommitdiff
path: root/plugins/libkolab
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-05 18:37:03 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-05 18:37:13 (GMT)
commit754a4d51bfa6f08ee7aadff2c3b270e9ca185e28 (patch)
tree9e4f0fad9ca0188c1ac1ce34020539cc9dea571c /plugins/libkolab
parente6c11695f9596a0c81efd6a52a4202fa89d967e5 (diff)
downloadroundcubemail-plugins-kolab-754a4d51bfa6f08ee7aadff2c3b270e9ca185e28.tar.gz
Improve search in calendar: consider recurrence exceptions for indexing and matching (#4279); ignore order of search terms (boolean and matching)
Diffstat (limited to 'plugins/libkolab')
-rw-r--r--plugins/libkolab/lib/kolab_format_xcal.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index ad54505..33ada93 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -581,27 +581,38 @@ abstract class kolab_format_xcal extends kolab_format
*
* @return array List of words to save in cache
*/
- public function get_words()
+ public function get_words($obj = null)
{
$data = '';
+ $object = $obj ?: $this->data;
+
foreach (self::$fulltext_cols as $colname) {
list($col, $field) = explode(':', $colname);
if ($field) {
$a = array();
- foreach ((array)$this->data[$col] as $attr)
+ foreach ((array)$object[$col] as $attr)
$a[] = $attr[$field];
$val = join(' ', $a);
}
else {
- $val = is_array($this->data[$col]) ? join(' ', $this->data[$col]) : $this->data[$col];
+ $val = is_array($object[$col]) ? join(' ', $object[$col]) : $object[$col];
}
if (strlen($val))
$data .= $val . ' ';
}
- return array_unique(rcube_utils::normalize_string($data, true));
+ $words = rcube_utils::normalize_string($data, true);
+
+ // collect words from recurrence exceptions
+ if (is_array($object['recurrence']) && $object['recurrence']['EXCEPTIONS']) {
+ foreach((array)$object['recurrence']['EXCEPTIONS'] as $exception) {
+ $words = array_merge($words, $this->get_words($exception));
+ }
+ }
+
+ return array_unique($words);
}
/**