[turba] Adding Custom Communication Fields to Turba

Jan Schneider jan at horde.org
Tue Apr 26 10:37:45 UTC 2011


Zitat von Simon Brereton <simon.brereton at dada.net>:

>> From: turba-bounces at lists.horde.org [mailto:turba-
>> bounces at lists.horde.org] On Behalf Of Michael Rubinsky
>> Quoting Simon Brereton <simon.brereton at dada.net>:
>>
>> > Hi
>> >
>> > Previously with Horde3, to add a custom field I had to manually
>> edit
>> > sources.php and attributes.php in the turba/config directory like
>> > this:
>> >
>> > $attributes['homeEmail'] = array(
>> >         'label' => _("Home Email"),
>> >         'type' => 'email',
>> >         'required' => false,
>> >         'params' => array('allow_multi' => false, 'strip_domain' =>
>> > false, 'link_compose' => true) );
>> >
>> > In Horde4 there is no sources.php for me edit.  Is the process
>> still
>> > the same?  How does one add a Work Email and Work Cell field?
>>
>> sources.php is now called backends.php
>
> I may be too stupid but how do I add something to this file?
>
> For example to add a Work Email and Work Cell Number to the back end  
> I'm looking at this part of the file:
>
> 289         'email' => 'object_email',
> 290         'homePhone' => 'object_homephone',
> 291         'workPhone' => 'object_workphone',
> 292         'cellPhone' => 'object_cellphone',
>
>
> Do I just want to add:
> 289         'email' => 'object_email',
> 		'workEmail' => object_email',
> 290         'homePhone' => 'object_homephone',
> 291         'workPhone' => 'object_workphone',
> 292         'cellPhone' => 'object_cellphone',
> 		'workcellPhone' => 'object_cellphone',
>
> What's the format for adding this then to attributes.php?
>
> $attributes['workEmail'] = array(
>         'label' => _("Work Email"),
>         'type' => 'email',
>         'required' => false,
>         'params' => array('allow_multi' => false, 'strip_domain' =>  
> false, 'link_compose' => true)
> );
>
> and
>
> $attributes['workCellPhone'] = array(
>     'label' => _("Work Mobile Phone"),
>     'type' => 'cellphone',
>     'required' => false
> );

Looks fine, but you should add it to attributes.local.php

> Presumably then I also have to add this to the DB?

Yes, and still to backends.php, i.e. backends.local.php.

Jan.

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



More information about the turba mailing list