edeca.net logo
  • rss
  • Home
  • Graphics
  • Electronics
    • PCB0002 – LED matrix
  • Computing
    • ROT Util
    • MOTD maker
    • GNU screen config
    • VB6 reverse DNS
    • VB6 RichTextBox control
  • About

Modifying fields in the Turba addressbook

David | January 9, 2010

I have recently started using the Funambol iPhone app to keep my contacts in sync with my webmail addressbook.  However, some fields aren’t included in Turba by default and need adding.  This post is for system administrators rather than users, so if you don’t run your own webmail then point your friendly geek at this post.

Firstly make sure you are using a recent version of Horde (e.g. 3.3.6). There are three easy steps to adding the fields you would like in Turba:

  • define an attribute (e.g. it is called “Home Email” and is of type “email”)
  • add it to list of fields that Turba uses (so it is displayed in the right place)
  • add the backend storage (so Turba can query/save the values)

For this example, we are adding the home and work email fields, which are compatible with the iPhone contacts.  This post assumes you use a database backend, if you don’t then step 3 will be slightly different.

1: Define an attribute

Firstly, check the file turba/config/attributes.php and make sure the following is present:

$attributes['homeEmail'] = array(
'label' => _("Home Email"),
'type' => 'email',
'required' => false,
'params' => array('allow_multi' => false, 'strip_domain' => false, 'link_compose' => true)
);

This defines the field “Home Email”. In recent versions of Horde this should already exist, so you shouldn’t need to modify the config. If you are creating a different type of field that does not exist already, it is easiest to copy the definition of something similar and change the label and attribute name.

2: Tell Turba we want to use this field

Next the file turba/config/sources.php needs to be edited. Find the line 'email' => 'object_email' and add below it the following two lines:

'homeEmail' => 'object_homeemail',
'workEmail' => 'object_workemail',

This tells Turba that the fields homeEmail and workEmail come from the database fields object_homeemail and object_workemail, respectively.  We also need to modify the list of tabs so that Turba knows to display our new values in the right place.

Email addresses should go on the “Communications” tab, after the existing email field, so we modify the array and insert the attribute names like below:

_("Communications") => array('email', 'homeEmail', 'workEmail', 'homePhone', 'workPhone',
'cellPhone', 'fax', 'pager'),

3: Add the backend storage

Assuming you use a database backend, this is as easy as creating two new fields in the database.  They should be named according to the values in sources.php that we defined above and should be similar to an existing row of the same type.  As we are creating email fields, we can use the same data type as the object_email row.

For this example, the following SQL will modify the database appropriately:

ALTER TABLE `turba_objects`
ADD `object_homeemail` VARCHAR( 255 ) NOT NULL AFTER `object_email`,
ADD `object_workemail` VARCHAR( 255 ) NOT NULL AFTER `object_homeemail`

The same process above can be followed for other fields that might be missing, post a comment if there is something that you’d like help adding.

Categories
Computing
Tags
horde
Comments rss
Comments rss
Trackback
Trackback

« Blocking SSH brute forcing using denyhosts Syncing the iPhone addressbook with Horde »

5 Responses to “Modifying fields in the Turba addressbook”

  1. edeca.net » Syncing the iPhone addressbook with Horde says:
    January 9, 2010 at 1:49 pm

    [...] This is very easy to fix, but you’ll need to ask your system administrator to have a look at this post on my [...]

  2. Neal says:
    April 28, 2010 at 4:18 pm

    Thanks a lot. I’ve been looking at how to fix this.

    Great easy to follow instructions

  3. thom says:
    November 5, 2010 at 10:10 pm

    Hi David,

    I simply wanted to add that this works also on blackberry (using the Funambol Client 8.7.1).

    I was not sure that the client was using the same field but a debug of Horde confirm me that the fields were the same.

    Thanks a mill for your post, I finally get evolution in sync with my mobile now o/

  4. Vlad says:
    July 20, 2011 at 12:47 pm

    Hi,
    I’ve been using open source version of Funambol server with syncevolution and Funambol client form Android phone. Everything works more of less fine. However I don’t really like maintaining this Funambol server in addition to Horde. Based on your findings I’ve been able to use Horde as a synchronization server. It works perfectly fine with syncevolution, but for android funambol client I still can’t get additional email addresses synced ;-( Moybe you have any other “hits”?

    Thank you in advance,
    Vlad.

  5. anonymous coward says:
    July 27, 2011 at 8:59 pm

    just what I was looking for! Thanks a lot!

    With horde4, the attributes are already defined, no need to change anything. sources.php is now backends.php and should not be edited – instead create an empty backends.local.php with the following contents:
    $cfgSources['localsql']['map']['homeEmail'] = ‘object_homeemail’;
    $cfgSources['localsql']['map']['workEmail'] = ‘object_workemail’;

    $cfgSources['localsql']['tabs'][_("Communications")][] = ‘homeEmail’;
    $cfgSources['localsql']['tabs'][_("Communications")][] = ‘workEmail’;

    I didn’t set the table attributes in the db “NOT NULL”. guess we don’t need that…

Leave a Reply

Click here to cancel reply.

 

Categories

  • Computing
  • Electronics
  • General
  • Perl
  • Photography
  • Uncategorized

Archives

  • February 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009

Links

  • My photo gallery
  • Pookey's site

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox