5.2.0-git
2014-07-28

[#10913] Autocompleter uses "email"-field only
Summary Autocompleter uses "email"-field only
Queue Horde Base
Queue Version Git master
Type Enhancement
State Feedback
Priority 1. Low
Owners
Requester michael.groene (at) zel (dot) uni-hannover (dot) de
Created 2012-01-10 (930 days ago)
Due
Updated 2014-07-28 (today)
Assigned
Resolved
Milestone
Patch No

History
2014-07-28 05:07:10 Michael Slusarz Comment #5 Reply to this comment
This is similar to #12480, but not really.

In short... what we really need is an API method in Turba for plain 
email search.  Pass it a string, and it searches all e-mail fields 
(and name fields, as an additional option).  Returns only the e-mails 
that match, not all entries.

This could all theoretically be done remotely ... but I've just spent 
2 hours trying to implement this in IMP and realized that it makes no 
sense.  Since I'm trying to do things like grab the configuration file 
from Turba and parse various fields (which is not documented in the 
external application API).  This is hackish at best, and will result 
in duplicate code at worst since this common code needs to be 
duplicated elsewhere (IMP is not going to use Horde_Core's 
autocomplete code going forward for multiple reasons).
2014-01-07 23:50:57 Michael Slusarz Comment #4
Version ⇒ Git master
Queue ⇒ Horde Base
Reply to this comment
This is a Horde-wide setting, not an IMP setting (in 
Horde_Core_Ajax_Imple_ContactAutoCompleter).
2013-11-18 14:30:28 registrations (at) baruchgreen (dot) net Comment #3 Reply to this comment
In the current versions of Imp/Turba (6.1.5 and 4.1.3, respectively) 
this is quite easy to fix.  Go to line 67 of ContactAutocompleter.php

                 'returnFields' => array('email', 'name'),

And simply insert the additional email fields from your turba 
backends.local.php into the array between 'email' and 'name'.  For me 
it ends up being:

                 'returnFields' => array('email', 'workEmail', 
'homeEmail', 'name'),

Works like a charm.

-- Seth Green


2012-01-24 15:12:00 Jan Schneider Version ⇒ Git master
 
2012-01-24 15:11:46 Jan Schneider Priority ⇒ 1. Low
State ⇒ Feedback
Type ⇒ Enhancement
 
2012-01-24 15:11:31 Jan Schneider Comment #2 Reply to this comment
I think this should be mentioned somewhere in documentation, is it?
Patch?
Or maybe even better, the autocompleter would accept different 
mail-fields, e.g. all fields, marked as type="email" in 
attributes.php?
Sounds good.
2012-01-10 12:19:02 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Autocompleter uses "email"-field only
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
I was irritated by the results of the Autocompleter in IMP once more...

Our global addressbook contains just work-mailaddresses, so I 
configured turbas database-backend accordingly.

It was like this in backends.local.php:
** snip **
         'homePostalCode' => 'postcode',
         'workEmail' => 'email_zew',
         'workPhone' => 'phone_zew',
** snip **
         'search'=>array('name','workEmail'),
** snip **

Now I found out the reason, why the autocompleter completely ignored 
this source (lib/imp/Ajax/Imple/ContactAutoCompleter.php:46ff):
             foreach ($sparams['fields'] as $val) {
                 array_map('strtolower', $val);
                 sort($val);
                 if ($val != array('email', 'name')) {
                     $success = false;
                     break;
                 }
             }

So at least the keys email and name have to be present in source.
I think this should be mentioned somewhere in documentation, is it?
Or maybe even better, the autocompleter would accept different 
mail-fields, e.g. all fields, marked as type="email" in attributes.php?