[sync] Fields in Turba vor vcard import/export. Appropriate sources.php

Jan Schneider jan at horde.org
Sat Aug 5 09:03:01 PDT 2006


Zitat von Karsten Fourmont <fourmont at gmx.de>:

> Todd Pytel wrote:
>> On a related subject, what's the deal with First/Last names in Turba?
>> Looking at the turba_objects table I can see that names are stored only
>> as full names, rather than being split first/last.
>
> Right. This is as it is for historic reason. Turba is highly   
> flexible when it comes to fields. You can use it to manage cooking   
> recipes if you want. The default fields for address books are   
> somewhat inconvenient when it comes to vcalendar export/import.   
> First name and last name is one thing, having the whole address in   
> one field is another.
>
> I use a different sources.php that does more closely match the VCARD  
>  structure. See below. You need to create approriate fields in your   
> sql database of course.
>
> Changing the defaults would be a good thing. But due to the large   
> user base I'd like to have a final view on what fields we need   
> before proposing a new default set.

I second that idea. I think a more useful default setup that better  
matches other address book structures is a good idea for Turba 3.

> --8<---cut here --8<---------
>
> <?php
> $cfgSources['localsql'] = array(
>     'title' => _("My Addressbook"),
>     'type' => 'sql',
>     'params' => array_merge($GLOBALS['conf']['sql'], array('table'   
> => 'turba_objects')),
>
>     'map' => array(
>         '__key' => 'object_id',
>         '__owner' => 'owner_id',
>         '__type' => 'object_type',
>         '__members' => 'object_members',
>         '__uid' => 'object_uid',
>         'name' => array('fields' => array('firstname', 'lastname'),
>                         'format' => '%s %s'),
>         'firstname' => 'object_firstname',
>         'lastname' => 'object_lastname',
>         'name_prefix' => 'object_nameprefix',
>         'email' => 'object_email',
>         'alias' => 'object_alias',
>         'homeStreet'  => 'object_homestreet',
>         'homeCity'     => 'object_homecity',
>         'homeProvince'     => 'object_homeprovince',
>         'homePostalCode' => 'object_homepostalcode',
>         'homeCountry' => 'object_homecountry',
>         'workStreet' => 'object_workstreet',
>         'workCity'     => 'object_workcity',
>         'workProvince'     => 'object_workprovince',
>         'workPostalCode' => 'object_workpostalcode',
>         'workCountry' => 'object_workcountry',
>         'homePhone' => 'object_homephone',
>         'workPhone' => 'object_workphone',
>         'cellPhone' => 'object_cellphone',
>         'fax' => 'object_fax',
>         'pager' => 'object_pager',
>         'title' => 'object_title',
>         'company' => 'object_company',
>         'website' => 'object_url',
>         'notes' => 'object_notes',
>         'pgpPublicKey' => 'object_pgppublickey',
>         'smimePublicKey' => 'object_smimepublickey',
>         'freebusyUrl' => 'object_freebusyurl'
>     ),
>     'search' => array(
>         'name',
>         'email'
>     ),
>     'strict' => array(
>         'object_id',
>         'owner_id',
>         'object_type',
>     ),
>     'export' => true,
>     'browse' => true,
>     'use_shares' => true,
> );
>
> -- 
> sync mailing list - Join the hunt: http://horde.org/bounties/#sync
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: sync-unsubscribe at lists.horde.org



Jan.

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



More information about the sync mailing list