Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [SOLVED] [Admin Extension] UI doesn't displayed.

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default [SOLVED] [Admin Extension] UI doesn't displayed.

    Hello Guys,

    I am developing an Admin Extension. Which adds a new tab to "Accounts" and also add a textbox to configure GID number. I've wrote following javascript code. With the code the tab is displayed under account edit form. But I cannot see any textbox or anything. Please help.

    Code:
    function GIdExtension() {}
    
    ZaAccount.A_GId = "zimbraAccountGId";
    
    
    // Add my new LDAP attrributes to ZaAccount.myXModel
    if(ZaAccount.myXModel && ZaAccount.myXModel.items) {
        ZaAccount.myXModel.items.push(
            {id:ZaAccount.A_GId, 
             type:_STRING_, 
             ref:"attrs/"+ZaAccount.A_GId
             }
        );
    }
    
    
    
    if(ZaTabView.XFormModifiers["ZaAccountXFormView"]) {
    
      GIdExtension.AccountXFormModifier = function (xFormObject) {
            try{
    
        /* find the SWITCH element which is the parent element for all tabs */
    
        var cnt = xFormObject.items.length;
    
        var i = 0;
    
        for (i = 0; i <cnt; i++) {
    
          if(xFormObject.items[i].type=="switch")
    
            break; //index i now points to the SWITCH element
    
               }
    
          //find the index of the next tab
    
          var posixTabIx = ++this.TAB_INDEX;
    
          //tab bar is the element with index 1
    
          var tabBar = xFormObject.items[1];
    
          //add the new tab button to the tab bar
    
          tabBar.choices.push({value:posixTabIx, label:"GID"});
    
          //define meta data for new form elements
    
          var posixAccountTab = {
    
            type:_ZATABCASE_, numCols:1,
    
            relevant:("instance[ZaModel.currentTab] == " + posixTabIx),
    
            items: [
             {type:_ZAGROUP_,
                items:[
    
                 {ref:ZaAccount.A_GId, 
    
                   type:_TEXTFIELD_, 
    
                   msgName:ZaAccount.A_GId,
    
                   label:ZaAccount.A_GId, 
    
                   labelLocation:_LEFT_, 
    
                   onChange:ZaTabView.onFormFieldChanged
                    }
    
                  ]  
                }
              ]
            };
    
                //add the new tab to the list of tabs
    
               xFormObject.items[i].items.push(posixAccountTab);
            }catch(e){
                    alert(e);
            }
    
          };
    
    
      ZaTabView.XFormModifiers["ZaAccountXFormView"].push(GIdExtension.AccountXFormModifier);
    
    }
    
    
    GIdExtension.AccountXFormModifier = function (xFormObject){
            alert("I am here");
            ZaTabView.XFormModifiers["ZaAccountXFormView"].push(GIdExtension.AccountXFormModifier);
    }
    Thank You.

  2. #2
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    Hello Guys,

    Now I am able to get textbox and tab with following code. But the textbox got display in every tab. What is wrong. Please help me. Just a hint would be good for me.

    Code:
    function GIdExtension() {}
    
    ZaAccount.A_GId = "zimbraAccountGId";
    
    
    // Add my new LDAP attrributes to ZaAccount.myXModel
    if(ZaAccount.myXModel && ZaAccount.myXModel.items) {
        ZaAccount.myXModel.items.push(
            {id:ZaAccount.A_GId, 
             type:_STRING_, 
             ref:"attrs/"+ZaAccount.A_GId
             }
        );
    }
    
    
    
    if(ZaTabView.XFormModifiers["ZaAccountXFormView"]) {
    
      GIdExtension.AccountXFormModifier = function (xFormObject) {
    
          //find the index of the next tab
    
          var posixTabIx = ++this.TAB_INDEX;
    
          //tab bar is the element with index 1
    
          var tabBar = xFormObject.items[1];
    
          //add the new tab button to the tab bar
          tabBar.choices.push({value:posixTabIx, label:GId.Tab_GId});
    
          //define meta data for new form elements
          
          var posixAccountTab = {
            type:_ZAGROUP_, relevant:("instance[ZaModel.currentTab] == " + posixTabIx), 
            items: [
                 {ref:ZaAccount.A_GId, 
    
                   type:_TEXTFIELD_, 
    
                   msgName:ZaAccount.A_GId,
    
                   label:GId.GId_label, 
    
                   labelLocation:_LEFT_,
                   relevant:("instance[ZaModel.currentTab] == " + posixTabIx) 
    
                    }
                  ]  
                };
    
    
        /* find the SWITCH element which is the parent element for all tabs */
    
            for (var i = 0; i <xFormObject.items.length; i++) {
                    if(xFormObject.items[i].type=="switch"){
                            xFormObject.items[i].items.push(posixAccountTab);
                            break; //index i now points to the SWITCH element
                    }
            }
    
          }
    
    
      ZaTabView.XFormModifiers["ZaAccountXFormView"].push(GIdExtension.AccountXFormModifier);
    
    }

    Thanks in advance.

  3. #3
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    Bump.. Anybody?

  4. #4
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    4

    Default Please share code

    Can you please share the procedure add this in zimbra admin ui with source code

  5. #5
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    Well, I cannot share more code. But can I help you with any other thing?

    Quote Originally Posted by mbhanage View Post
    Can you please share the procedure add this in zimbra admin ui with source code

  6. #6
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    4

    Default I want to add one tab such as Mailbox Quota Under Domains

    Hi,

    I want add tab mailbox quota under domains so selected domain user mailbox quota will be displayed.

  7. #7
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    Quote Originally Posted by mbhanage View Post
    Hi,

    I want add tab mailbox quota under domains so selected domain user mailbox quota will be displayed.
    You like to know the admin extension zimlet code or adding an attribute to LDAP?

  8. #8
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    4

    Default

    Hi stalker,

    I want zimbra admin extension zimlet code.

  9. #9
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    Here is the final working code but it will add a new tab into Account and not in domain. You'll have to change it to add it to domain. I hope you can do it.

    Code:
    function GIdExtension() {}
    
    ZaAccount.A_GId = "zimbraAccountGId";
    ZaAccount.A_GIdTitle = "This is Title";
    
    
    // Add my new LDAP attrributes to ZaAccount.myXModel
    if(ZaAccount.myXModel && ZaAccount.myXModel.items) {
        ZaAccount.myXModel.items.push(
            {id:ZaAccount.A_GId, 
             type:_STRING_, 
             ref:"attrs/"+ZaAccount.A_GId
             }
        );
    }
    
    if(ZaTabView.XFormModifiers["ZaAccountXFormView"]) {
    
      GIdExtension.AccountXFormModifier = function (xFormObject) {
    
          //find the index of the next tab
    
          var posixTabIx = ++this.TAB_INDEX;
    
          //tab bar is the element with index 1
    
          var tabBar = xFormObject.items[1];
    
          //add the new tab button to the tab bar
          tabBar.choices.push({value:posixTabIx, label:GId.Tab_GId});
    
          //define meta data for new form elements
          
    	var posixAccountTab = {
    
            type:_ZATABCASE_,id:"account_form_GId",numCols:1, colSizes:["800px"],
                caseKey:  posixTabIx,
    
            items: [
    
                   {type:_ZAGROUP_,
    
                items:[
    
                 {ref:ZaAccount.A_GId, 
    
                   type:_TEXTFIELD_, editable:true,
    
                   msgName:"GId group",
    
                   label:GId.GId_label, 
    
                   labelLocation:_LEFT_, 
    
                   onChange:ZaTabView.onFormFieldChanged} ]  
    
                }
    
              ]
    
            };
        /* find the SWITCH element which is the parent element for all tabs */
    
    	for (var i = 0; i <xFormObject.items.length; i++) {
    		if(xFormObject.items[i].type=="switch"){
    			break; //index i now points to the SWITCH element
    		}
    	}
    	xFormObject.items[i].items.push(posixAccountTab);
    
          }
      ZaTabView.XFormModifiers["ZaAccountXFormView"].push(GIdExtension.AccountXFormModifier);
    }

  10. #10
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    4

    Default Thanks

    Hi stalker,

    Thanks for giving the code, I am new for zimbra development Please tell me how deploy this or I have to write zimlet for this or if you have any zimlet example for admin ui please share with me. I make Hello World zimlet and properly updated in Zimbra Webmail but I have issue in admin UI.

    Thanks & Regards

    Mangesh Bhanage
    India

Similar Threads

  1. Replies: 10
    Last Post: 03-19-2010, 02:02 PM
  2. Replies: 0
    Last Post: 11-01-2007, 08:55 AM
  3. Replies: 6
    Last Post: 11-18-2006, 11:42 AM
  4. Mailbox size displayed in user account list
    By kurt2 in forum Developers
    Replies: 2
    Last Post: 04-06-2006, 12:50 PM
  5. Nothing's displayed after changed password?!?
    By chotima in forum Administrators
    Replies: 6
    Last Post: 01-26-2006, 07:29 PM

Posting Permissions

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