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

Re: Hacking the Zimbra UI



Steve,

That's perfect...  I just put it up on our test server.  I had to adjust the patch code to get it to work (missing tabs, different line#s -- we're 5.0.12).  But after those simple changes, it worked perfectly.  Way too cool.  I'm not a proponent of modifying source code, but this fixes a major problem we've been having at our campus so I think we can argue to use it.

Thanks again for your efforts!

Fred

--
Fred Seaton
Research & Instructional Consultant, Senior UNIX Specialist
University Technology - Infrastructure
Western Illinois University
107 Morgan Hall
Macomb, IL  61455

----- Original Message -----
From: "Steve Hillman" <hillman@sfu.ca>
To: "Fred Seaton" <F-Seaton@wiu.edu>
Cc: "zimbra-hied-admins" <zimbra-hied-admins@sfu.ca>
Sent: Tuesday, February 17, 2009 5:03:05 PM GMT -06:00 US/Canada Central
Subject: Re: Hacking the Zimbra UI

Thanks everyone for the help. I've managed to put together a possible solution, though we've only deployed it to our dev environment so far. I've also voted for the bug below, since their solution would almost certainly end up being more elegant than mine!

Here's what I did
 - modified the zimbraGalLdapAttrMap parameter and mapped ldap 'ou' to 'company'. That put our dept into one of the available Zimbra Contract attributes
 - modified both CalendarCore_all.js and ContactsCore_all.js with the following patch:

*** CalendarCore_all.js.orig    Tue Feb 17 09:38:23 2009
--- CalendarCore_all.js Tue Feb 17 13:35:56 2009
***************
*** 2269,2280 ****
--- 2269,2290 ----
                        var field = ZmContactList.AC_NAME_FIELDS[i];
                        var val = ZmContact.getAttr(contact, field);
                        if (val) {
                                names.push((match.matchedField == field) ? match.savedMatch : val);
                        }
                }
+               // SFU Addition - add department (stored in Company attribute)
+               // to the end of any named retrieved from the GAL - Steve H. (hillman@sfu.ca)
+               if (contact.isGal) {
+                   var val = ZmContact.getAttr(contact, ZmContact.F_company);
+                   if (val) {
+                       names.push("- (" + val + ")" );
+                   }
+               }
+               // End of SFU Addition
+
                name = names.join(" ");
        }
        var results = [];
        var fullName = contact.getFullName();
        if (match.matchedField == ZmContact.F_email || match.matchedField == ZmContact.F_email2 || match.matchedField == ZmContact.F_email3) {
                results.push(this._createMatch(name, match.savedMatch, fullName, ZmContact.getAttr(contact, match.matchedField), contact));

------------------------

(although this patch is for Calendar, Contacts is exactly the same, just with different line numbers. You might just be able to edit the filename in the patch and patch's fuzzing should do the rest)

 - recreated the CalendarCore_all.js.zgz and ContactsCore_all.js.zgz files by gzipping the .js files.
 - Note that in the distribution, the js files are run through a minimizer before being gzipped. If you're paranoid about the file size, you can unzip the .zgz file and figure out in the minimized code where this patch would go (one of our guys may yet do that before we go prod with this mod)

----- "Fred Seaton" <F-Seaton@wiu.edu> wrote:
>
> Thank, Alan.  I just voted.  I noticed you hadn't copied the list, so I included them so everyone on hied-admins could vote for this as well.  Definitely a must in higher ed.
>
> Fred
>
> ----- Original Message -----
> From: "Alan Sutter" <alan.sutter@fandm.edu>
> To: "Fred Seaton" <F-Seaton@wiu.edu>
> Sent: Monday, February 16, 2009 5:28:35 PM GMT -06:00 US/Canada Central
> Subject: Re: Hacking the Zimbra UI
>
>
> There is already an enhancement request for this.  It is bug 27362. 
> http://bugzilla.zimbra.com/show_bug.cgi?id=27362

>
Please add you vote!

>
Alan

> ----- Original Message -----
> From: "Fred Seaton" <F-Seaton@wiu.edu>
> To: "zimbra-hied-admins" <zimbra-hied-admins@sfu.ca>
> Sent: Monday, February 16, 2009 5:43:25 PM GMT -05:00 US/Canada Eastern
> Subject: Re: Hacking the Zimbra UI
>
>
> Steve,
>
> We would like EXACTLY the same thing!  In fact, I was thinking of hacking that myself, because as you noted, it seems like it would be a relatively simple modification to add.  Trying to distinguish faculty and staff from students in our LDAP server is way too difficult right now, and a feature like this would resolve that.  However, I haven't taken the time to look.
>
> If you find and make this mod, we would love to have it.
>
> Good luck!
>
> --
> Fred Seaton
> Research & Instructional Consultant, Senior UNIX Specialist
> University Technology - Infrastructure
> Western Illinois University
> 107 Morgan Hall
> Macomb, IL  61455
>
> ----- Original Message -----
> From: "Steve Hillman" <hillman@sfu.ca>
> To: "zimbra-hied-admins" <zimbra-hied-admins@sfu.ca>
> Sent: Monday, February 16, 2009 4:18:15 PM GMT -06:00 US/Canada Central
> Subject: Hacking the Zimbra UI
>
> 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