[turba] Turba search API

Etienne Goyer etienne.goyer at linuxquebec.com
Thu Mar 10 13:06:23 PST 2005


Hi again,

Not related to the previous problem, something else.

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 ?

Thanks very much !

Etienne Goyer


More information about the turba mailing list