diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2013-05-31 16:16:54 (GMT) |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2013-06-21 10:10:47 (GMT) |
commit | 9321a10124d1fbba87f8a25114fd583e385c2b66 (patch) | |
tree | df43f50aac7d5eaf4563e29cbe7de3810dda56b7 | |
parent | 8502e5f68f4378f9e32cf12ad7015304c114d20d (diff) | |
download | roundcubemail-plugins-kolab-9321a10124d1fbba87f8a25114fd583e385c2b66.tar.gz |
Fix contact fulltext indexing with new email subtypes
-rw-r--r-- | plugins/libkolab/lib/kolab_format_contact.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/libkolab/lib/kolab_format_contact.php b/plugins/libkolab/lib/kolab_format_contact.php index 3852fb7..9944c3d 100644 --- a/plugins/libkolab/lib/kolab_format_contact.php +++ b/plugins/libkolab/lib/kolab_format_contact.php @@ -31,7 +31,7 @@ class kolab_format_contact extends kolab_format protected $read_func = 'readContact'; protected $write_func = 'writeContact'; - public static $fulltext_cols = array('name', 'firstname', 'surname', 'middlename', 'email'); + public static $fulltext_cols = array('name', 'firstname', 'surname', 'middlename', 'email:address'); public $phonetypes = array( 'home' => Telephone::Home, @@ -383,7 +383,18 @@ class kolab_format_contact extends kolab_format { $data = ''; foreach (self::$fulltext_cols as $col) { - $val = is_array($this->data[$col]) ? join(' ', $this->data[$col]) : $this->data[$col]; + list($col, $field) = explode(':', $colname); + + if ($field) { + $a = array(); + foreach ((array)$this->data[$col] as $attr) + $a[] = $attr[$field]; + $val = join(' ', $a); + } + else { + $val = is_array($this->data[$col]) ? join(' ', $this->data[$col]) : $this->data[$col]; + } + if (strlen($val)) $data .= $val . ' '; } |