Author Topic: [0.5] LDAP additional fileds  (Read 3246 times)

Offline gok

  • Newbie
  • *
  • Posts: 2
[0.5] LDAP additional fileds
« on: January 20, 2011, 04:14:23 AM »
Hello,

I installed "Roundcube" 0.5 and I set a "LDAP" addressbook.
All works fine but I can not find how to add additional fields to display in the address book. As the phone number or address.
I found examples on the forum for version 0.3 but the file structure of the 0.5 seems to be different.

Thank you in advance for your help :-)
« Last Edit: January 20, 2011, 05:49:41 AM by gok »

Offline Julius Caesar

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 498
    • http://www.de-keizer.net/
[0.5] LDAP additional fileds
« Reply #1 on: January 20, 2011, 04:56:33 AM »
You have to modify several files:

To add, address, zip-code, city, phone, mobile, birthday, company and website

./config/main.inc.php (part from the LDAP config)
Code: [Select]
 'firstname_field' => 'gn',     // this field represents contact's first name
  'address_field' => 'street',
  'zip_field'     => 'postalCode',
  'city_field'    => 'l',
  'phone_field'   => 'homePhone',
  'mobile_field'  => 'mobile',
  'birthday_field' => 'birthDate',
  'company_field' => 'o',
  'url_field'     => 'url',
  'sort'          => 'cn',       // The field to sort the listing by.


./program/steps/addresbook/show.inc:
Code: [Select]
   $form = array(
        'info' => array(
            'name'    => rcube_label('contactproperties'),
            'content' => array(
                'name' => array('type' => 'text', 'size' => $i_size),
                'firstname' => array('type' => 'text', 'size' => $i_size),
                'surname' => array('type' => 'text', 'size' => $i_size),
'address' => array('type' => 'text', 'size' => $i_size),
'zip' => array('type' => 'text', 'size' => $i_size),
'city' => array('type' => 'text', 'size' => $i_size),
'phone' => array('type' => 'text', 'size' => $i_size),
'mobile' => array('type' => 'text', 'size' => $i_size),
'birthday' => array('type' => 'text', 'size' => $i_size),
'company' => array('type' => 'text', 'size' => $i_size),
'url' => array('type' => 'text', 'size' => $i_size),
                'email' => array('type' => 'text', 'size' => $i_size),
            ),
        ),
        'groups' => array(
            'name'    => rcube_label('groups'),
            'content' => '',
        ),
    );



./program/steps/addresbook/edit.inc:
Code: [Select]
   $form = array(
        'info' => array(
            'name'    => rcube_label('contactproperties'),
            'content' => array(
                'name' => array('type' => 'text', 'size' => $i_size),
                'firstname' => array('type' => 'text', 'size' => $i_size),
                'surname' => array('type' => 'text', 'size' => $i_size),
'address' => array('type' => 'text', 'size' => $i_size),
'zip' => array('type' => 'text', 'size' => $i_size),
'city' => array('type' => 'text', 'size' => $i_size),
'phone' => array('type' => 'text', 'size' => $i_size),
'mobile' => array('type' => 'text', 'size' => $i_size),
'birthday' => array('type' => 'text', 'size' => $i_size),
'company' => array('type' => 'text', 'size' => $i_size),
'url' => array('type' => 'text', 'size' => $i_size),
                'email' => array('type' => 'text', 'size' => $i_size),
            ),
        ),
        'groups' => array(
            'name'    => rcube_label('groups'),
            'content' => '',
        ),
    );


./program/steps/addresbook/save.inc:
Code: [Select]
$a_save_cols = array('name', 'firstname', 'surname', 'address', 'zip', 'city', 'phone', 'mobile', 'birthday', 'company', 'url','email');


And the localization files, I.E:
./program/localization/en_US/labels.inc
Code: [Select]
$labels['address']   = 'Address';
$labels['zip']       = 'ZIP';
$labels['city']      = 'City';
$labels['phone']     = 'Phone';
$labels['mobile']    = 'Mobile';
$labels['birthday']  = 'Birthday';
$labels['company']   = 'Company';
$labels['url']       = 'Homepage';
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he

Offline gok

  • Newbie
  • *
  • Posts: 2
[0.5] LDAP additional fileds
« Reply #2 on: January 20, 2011, 05:49:13 AM »
Easy to use!!!
Works fine :-)

My own additional fields in main.inc.php

   // additional fields
  'company_field' => 'o',
  'department_field' => 'ou',
  'address_field' => 'postaladdress',
  'zip_field'     => 'postalcode',
  'city_field'    => 'l',
  'country_field' => 'c',
  'workphone_field'    => 'telephonenumber',
  'cellphone_field'    => 'mobile',
  'homephone_field'    => 'homephone',
  'fax_field'    => 'facsimiletelephonenumber',
  'notes_field'  => 'comment',

Thank you Julius!