Results 1 to 4 of 4

Thread: [SOLVED] Help with Zimlet to compose email and set subject

  1. #1
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,016
    Rep Power
    24

    Default [SOLVED] Help with Zimlet to compose email and set subject

    Hi,

    I am trying to follow some of the code for adding a zimlet button to generate a new email and set the subject field. So far I have
    Code:
    com_uxbod_sendfax = function() {
    };
    com_uxbod_sendfax.prototype = new ZmZimletBase;
    com_uxbod_sendfax.prototype.constructor = com_uxbod_sendfax;
    
    com_uxbod_sendfax.prototype.initializeToolbar =
    function(app, toolbar, controller, viewId) {
    
        if (viewId.indexOf("COMPOSE") >= 0) {
    
            var buttonIndex = -1;
            for (var i = 0; i < toolbar.opList.length; i++) {
                if (toolbar.opList[i] == ZmOperation.VIEW_MENU) {
                    buttonIndex = i + 1;
                    break;
                }
            }
    
            var buttonArgs = {
                text    : "Send Fax",
                tooltip : "Uxbod Send Fax Facility",
                index   : buttonIndex,
                image   : "zimbraicon"
            };
    
            var button = toolbar.createOp("UXBOD_ZIMLET_SENDFAX_BUTTON", buttonArgs);
            button.addSelectionListener(new AjxListener(this, this._showSelectedMail, controller));
        }
    };
    
    com_uxbod_sendfax.prototype._showSelectedMail =
    function(controller) {
        var message = controller.getMsg();
        appCtxt.getAppController().setStatusMsg("Subject:"+ message.subject);
    };
    I refresh ZWC but I do not see the button appear, and if I click on new message then nothing happens. Thoughts on what I have done wrong please ?

  2. #2
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,016
    Rep Power
    24

    Default

    Getting a little further by studying rrao's template zimlet. What I am struggling with now is how to position the button. I would like it to always come after the Option button in the mail compose window. Though how would one find the correct identifier ? I tried VIEW_OPTIONS but then the button did not show at all. If I set the variable index to say 4 it positions in the middle

  3. #3
    yutaka is offline Project Contributor
    Join Date
    Oct 2009
    Location
    Tokyo
    Posts
    113
    Rep Power
    5

    Default

    Hi uxbod,

    How about this?
    I have tried something like this in my zimlet.

    var buttonIndex = 0;
    for (var i = 0; i < toolbar.opList.length; i++) {
    if (toolbar.opList[i] == "COMPOSE_OPTIONS") {
    buttonIndex = i + 1;
    break;
    }
    }

  4. #4
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,016
    Rep Power
    24

    Default

    Thanks Slight mod and it is now working
    Code:
    var buttonIndex = 0;
                    for (var i = 0; i < toolbar.opList.length; i++) {
                                    if (toolbar.opList[i] == ZmOperation.COMPOSE_OPTIONS) {
                                            buttonIndex = i + 2;
                                            break;
                                    }
                    }
    I wish the variable options were exposed in a wiki document somewhere.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] mailboxmanager does not start
    By jrefl5 in forum Administrators
    Replies: 18
    Last Post: 01-30-2012, 11:40 PM
  2. need advice on configuring zimbra to work with fax server
    By pheonix1t in forum Administrators
    Replies: 0
    Last Post: 07-11-2007, 07:46 PM
  3. Email Expiary Zimlet
    By Cringer in forum Developers
    Replies: 6
    Last Post: 04-17-2007, 08:01 AM
  4. upgrade to 4.0.3 antispam does'nt work
    By lucanannipieri in forum Administrators
    Replies: 14
    Last Post: 11-07-2006, 03:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •