[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hacking the Zimbra UI



Steve,

There is a feature request to customize GAL contact display, but apparently it is not
available yet.

I tested the following workaround in our test environment, that might give you some ideas how
to display department affiliation. 

If you look at this file:

~zimbra/jetty/webapps/zimbra/templates/abook/Contacts.template.js

I think you can modify the Contacts.template.js to add specific field, but what I did is to
use "company" variable, which is one of the variables that will be displayed if the value is not empty.

In zimbra, there is an attribute map zimbraGalLdapAttrMap: company=company, because
we don't have "company" in central ldap, that value is always empty. However, we do 
have "ou" attribute. "ou" is automatically requested by Zimbra GAL request.  

So I modified that map:

zmprov mcf -zimbraGalLdapAttrMap company=company
zmprov mcf +zimbraGalLdapAttrMap company,ou=company

By given it "ou" value, our GAL lookup returns entries like this:

Firstname LastName
Title, IT services 
...

Alternatively, I can modify Contacts.template.js to add "department" field, which is 
mapped as "zimbraGalLdapAttrMap ou=department", or use "company" field like what I did.

Changing templates should be avoided if possible because you have to remember to
carry your changes from versions to version. 

Hope this helps,

Xueshan



----- "Steve Hillman" <hillman@sfu.ca> wrote:

| Hi folks,
|   We're trying to understand (and potentially modify) how the
| auto-complete code in the advanced client builds the names that it
| displays. It would appear that it uses the firstName/lastName
| attributes concatenated together, but we'd like to modify that to
| include the department. We were hoping the client might actually use
| an XML file or something similar to determine what attributes it
| should display, but that hope is fading fast.
| 
| As a last resort, we can build Yet Another LDAP instance and populate
| it with last names that include the dept, but we'd rather not. 
| 
| Does anyone know where in the UI code this is done? Our Java guy is
| pulling his hair out trying to do string searches on the .js files to
| find where this is done (it's definitely not as elegant as the
| server-side code!)
| 
| -- 
| Steve Hillman                                IT Architect
| hillman@sfu.ca                               IT Infrastructure
| 778-782-3960                                 Simon Fraser University