Creare campi email aggiuntivi nell'Addressbook Turba di Horde

From RVM Wiki
Jump to navigation Jump to search
  • We are adding two fields
Home Email
Work Email
  • Check if these attributes are already defined in
turba/config/attributes.php
  • Fortunately, they are. If not we need to create a copy of attributes.php named attributes.local.php and add the new attributes here
$attributes['workEmail'] = array(
    'label' => _("Work Email"),
    'type' => 'email',
    'required' => false,
    'params' => array('allow_multi' => false, 'strip_domain' => false, 'link_com
);
$attributes['homeEmail'] = array(
    'label' => _("Home Email"),
    'type' => 'email',
    'required' => false,
    'params' => array('allow_multi' => false, 'strip_domain' => false, 'link_com
);
  • Now we need to create the new attributes fields in the turba_objects table:
ALTER TABLE `turba_objects`
ADD `object_homeemail` VARCHAR( 255 ) NOT NULL AFTER `object_email`,
ADD `object_workemail` VARCHAR( 255 ) NOT NULL AFTER `object_homeemail`
  • After this, we need to define how the new attributes are showed in the user interface.
  • Create a copy of turba/config/backends.php
sudo cp turba/config/backends.php turba/config/backends.local.php
  • Add the new attributes:
...
          'homeEmail' => 'object_homeemail',
          'workEmail' => 'object_workemail',
...
  • Define where they have to be shown:
          _("Communications") => array('email', 'homeEmail','workEmail',

  • And if you want to search these fileds too, add them:
       'search' => array(                
          'name',                       
          'email',
          'homeEmail',
          'workEmail'
      ), 

References