Hi again,
I attach an updated version of my address book expansion patch and also a screenshot of how it looks now. As you can see I have swapped the layout from having a vertical splitter to a horizontal one. I am unsure about which is better and the layout is still a work in progress so any feedback is welcome.
Other changes in this version are the use of tabs to separate the sections of the address book, rather than having it all on one screen and support for expanded LDAP address books.
I have re-structured the code slightly for greater flexibility and now all the address book fields, and what section they are in, are defined in program/steps/addressbook/func.inc. Ultimately perhaps this could be moved to the main config and then people could set which fields they want in their address book.
For the extra fields in LDAP I added this to the setup in my main.inc.php:
… 'title_field' => 'title', // this field represents the contact's title 'telephone_field' => 'homePhone', // this field represents the contact's home telephone number 'cellphone_field' => 'mobile', // this field represents the contact's mobile telephone number 'homeaddress_field' => 'homePostalAddress', // this field represents the contact's home address 'organization_field' => 'o', // this field represents the contact's company name 'orgtelephone_field' => 'telephoneNumber', // this field represents the contact's work telephone number 'orgfax_field' => 'facsimileTelephoneNumber', // this field represents the contact's work fax number 'orgaddress_field' => 'postalAddress', // this field represents the contact's work address 'notes_field' => 'description', // this field represents the contact's notes field …
I don’t really know anything about LDAP so I’m not sure if those field names are standard or just what freeldap.org use. It’s the key names (the *_field bit) which are important, they map to the RC address book fields.
As with the last version no changes to the DB are needed.
One other thing, in the default address book there is a “birthday” field, taken from the vCard, at the moment the input for this is simply a text box and then the data is passed though strtotime(). There is no validation on that field yet. I was thinking perhaps it would be best to use a date picker JS widget to make sure they input is in the right format. Does any one have any other suggestions? I expect there is a nice jQuery plugin we could use.
Phil
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/H9/Z66bnkKF/rc_addressbook.jpg http://detached.gigo.com/rc/H9/Z66bnkKF/rc_addressbook.r3010.patch Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/