edeca.net logo
  • rss
  • Home
  • Graphics
  • Electronics
  • 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 »

2 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

Leave a Reply

Click here to cancel reply.

Categories

  • Computing
  • Electronics
  • General
  • Perl
  • Photography

Archives

  • 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