[turba] Extra email addresses in Turba4

Simon Brereton simon.buongiorno at gmail.com
Wed Jul 11 18:23:30 UTC 2012


Hi

In Horde 3 and 4 I was used to making some changes to allow more than
one email and (later as it became more common) more than one cell
phone number.

I did this by doing the following custom changes and also make
lastname not required.

vim /usr/share/horde4/turba/config/attributes.php
//Added by SPB
$attributes['workEmail'] = array(
        'label' => _("Work Email"),
        'type' => 'email',
        'required' => false,
        'params' => array('allow_multi' => false, 'strip_domain' =>
false, 'link_compose' => true)
);

$attributes['workCellPhone'] = array(
    'label' => _("Work Mobile Phone"),
    'type' => 'cellphone',
    'required' => false
);

cp /usr/share/horde4/turba/config/attributes.php
/usr/share/horde4/turba/config/attributes.local.php
cp /usr/share/horde4/turba/config/backends.php
/usr/share/horde4/turba/config/backends.local.php
vim /usr/share/horde4/turba/config/backends.local.php
//Added by SPB
        'workEmail' => 'object_workemail',
        'homePhone' => 'object_homephone',
        'workPhone' => 'object_workphone',
        'cellPhone' => 'object_cellphone',
        'workCellPhone' => 'object_cellphone',

//Added by SPB
                _("Communications") => array('email', 'workEmail',
'homePhone', 'workPhone',
		'cellPhone', 'workCellPhone', 'fax', 'pager''imaddress',
		'imaddress2', 'imaddress3'),

Run the following SQL commands from the panel
ALTER TABLE `turba_objects`
ADD `object_workemail` VARCHAR( 255 ) NOT NULL AFTER `object_email`,
ADD `object_workcellphone` VARCHAR( 25 ) NOT NULL AFTER `object_cellphone`

In Horde5/Turba4, I noticed that this has changed somewhat.  Firstly
there are two Email arrays, both of which appear to take multiple
email addresses (comma separated)..

274 /* Communication. */
275 $attributes['email'] = array(
276     'label' => _("Email"),
277     'type' => 'email',
278     'required' => false,
279     'params' => array('allow_multi' => false, 'strip_domain' =>
false, 'link_compose' => true, 'link_name' => null, 'delimiters' =>
',', 'size' => null)
280 );
281 $attributes['emails'] = array(
282     'label' => _("Emails"),
283     'type' => 'email',
284     'required' => false,
285     'params' => array('allow_multi' => true, 'strip_domain' =>
false, 'link_compose' => true, 'link_name' => null, 'delimiters' =>
',', 'size' => null)
286 );

Old style
287 //Added by SPB
288 $attributes['workEmail'] = array(
289         'label' => _("Work Email"),
290         'type' => 'email',
291         'required' => false,
292         'params' => array('allow_multi' => false, 'strip_domain'
=> false, 'link_compose' => true)
294 );

However the Contact display page still only shows Email and not
Emails, and attempting to add in a second email address separated by a
comma resulted in an error (Please enter an email address).

Before I proceed and break this totally - is this field now intended
to support multiple addresses?  How does this work with ActiveSync
where addresses are marked as work, home or other?

Is my method above still the correct way to do this?  Does the SQL
line need updating?

Thanks.
Simon


More information about the turba mailing list