[turba] Re: Turba search API

Jan Schneider jan at horde.org
Thu Mar 10 15:46:25 PST 2005


Zitat von Etienne Goyer <etienne.goyer at linuxquebec.com>:

> I have sources defined in Turba which have more than one email attribute
> (email1, email2, etc).  From imp/contacts.php for example, the contact
> is only listed once with the first email attribute listed.  I suppose
> any other program using the API would show the same behavior.
>
> Would there be a clean way to make program using the Turba search API
> retrieve (and possibly display) all the defined email fields ?
>
> So far, I think not.  I am currently looking at the _turba_search()
> function in turba/lib/api.php.  Around line 639, we can see the
> following code :
>
>     $email = null;
>     foreach (array_keys($att) as $key) {
>         if ($ob->getValue($key) && isset($attributes[$key]) &&
>             $attributes[$key]['type'] == 'email') {
>             $email = $ob->getValue($key);
>             break;
>         }
>     }
>
>
> IIUC, the API will always return just the field of type "email".  Is
> that right ?  If yes, how could we change that ?

Yes, it is right. But it might make sense to return a separate contact for
each email address. IIRC there is even a ticket for that on bugs.horde.org.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the turba mailing list