Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-19-2008, 10:07 AM
Junior Member
 
Posts: 9
Default Zimlet Not Working Since Upgrade from 4.5 to 5.06

Hello,

I have this zimlet that we were using in 4.5 and is now not working in 5.06:

<zimlet name="com_phpministry_oss" version="1.0" description="Database">
<includeCSS>oss.css</includeCSS>
<resource>oss.gif</resource>
<zimletPanelItem label="Manage My Seminars" icon="oss-panelIcon">
<toolTipText>Right-click to Schedule Seminar</toolTipText>
<contextMenu>
<menuItem label="Online Seminar Scheduling" id="mail.familyfoundations.us:20443/oss" icon="oss-panelIcon">
<canvas type="window" title="Support Form" />
<actionUrl method="post" target="https://mail.familyfoundations.us:20443/oss">
<param name="param">${obj.appCtxt._activeAccount.name}</param>
</actionUrl>
</menuItem>
</contextMenu>
</zimletPanelItem>
</zimlet>


My goal is for the ${obj.appCtxt._activeAccount.name} to be replaced by the current logged in Zimbra user. I know that ${obj.appCtxt._activeAccount.name} is not correct, but I want to end up generating the url:

https://familyfoundations.us:20443?param="dave", where "dave" is the currently logged in user. Previously, in version 4, this was stored in ls_last_username. Under version 5, the lsl_last_username stored in the cookie is no longer there, so I want to pass the username on the url.

I looked in firebug and found that appCtxt._activeAccount.name} contains the current username, so I am trying to extract that from DOM. How do I do that?

Thanks,

Dave
Reply With Quote
  #2 (permalink)  
Old 06-23-2008, 09:30 PM
Zimbra Employee
 
Posts: 52
Default

appCtxt is now a global (window) variable, so try one of these:

appCtxt.getUsername()
appCtxt._activeAccount.name
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 06-25-2008, 10:11 PM
Junior Member
 
Posts: 7
Default Do I have the syntax right?

I tried what you said. Here's how I changed it:

<zimlet name="com_phpministry_oss" version="1.0" description="Database">
<includeCSS>oss.css</includeCSS>
<resource>oss.gif</resource>
<zimletPanelItem label="Manage My Seminars" icon="oss-panelIcon">
<toolTipText>Right-click to Schedule Seminar</toolTipText>
<contextMenu>
<menuItem label="Online Seminar Scheduling" id="www.company.com/oss" icon="oss-panelIcon">
<canvas type="window" title="Support Form" />
<actionUrl method="post" target="https://www.company.com/oss">
<param name="param">${appCtxt._activeAccount.name}</param>
</actionUrl>
</menuItem>
</contextMenu>
</zimletPanelItem>
</zimlet>

Notice the <param line.

This was translated when I clicked on the Zimlet into:


https://www.company.com/oss/?param=$%7BappCtxt._activeAccount.name%7D

(it took it literally, rather than translating it.

Likewise, I changed it to:

<zimlet name="com_phpministry_oss" version="1.0" description="Database">
<includeCSS>oss.css</includeCSS>
<resource>oss.gif</resource>
<zimletPanelItem label="Manage My Seminars" icon="oss-panelIcon">
<toolTipText>Right-click to Schedule Seminar</toolTipText>
<contextMenu>
<menuItem label="Online Seminar Scheduling" id="mail.familyfoundations.us:20443/oss" icon="oss-panelIcon">
<canvas type="window" title="Support Form" />
<actionUrl method="post" target="https://mail.familyfoundations.us:20443/oss">
<param name="param">${appCtxt.getUsername()}</param>
</actionUrl>
</menuItem>
</contextMenu>
</zimletPanelItem>
</zimlet>

(change is on the <param line, above

Here's what got put on to the URL line when the window was popped:

https://mail.familyfoundations.us:20443/oss/?param=$%7BappCtxt.getUsername()%7D

Do I have the syntax of the "<param" line correct?

Thanks,

Dave
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.