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 10-19-2011, 03:40 AM
Special Member
 
Posts: 117
Question Trouble extending domain functionality in admin UI

Hello Everyone,

I am trying to extend add domain wizard as well as edit domain with some my custom requirement. I am using admin zimlet to do the same. Following is the code with does the same. Problem is the signature form is getting displayed in edit domain page but not in new domain wizard.

Quote:
function SignatureExtension() {}

ZaDomain.A_SignatureID = "zimbraDomainSignatureId";
ZaDomain.A_SignatureIDTitle = "This is Title";


// Add my new LDAP attrributes to ZaDomain.myXModel
if(ZaDomain.myXModel && ZaDomain.myXModel.items) {
ZaDomain.myXModel.items.push(
{id:ZaDomain.A_SignatureID,
type:_STRING_,
ref:"attrs/"+ZaDomain.A_SignatureID
}
);
}



if(ZaTabView.XFormModifiers["ZaDomainXFormView"]) {

SignatureExtension.DomainXFormModifier = 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({valueosixTabIx, label:signature.Tab_signature});

//define meta data for new form elements

var posixAccountTab = {

type:_ZATABCASE_,id:"domain_form_signature",numCol s:1, colSizes:["800px"],
caseKey: posixTabIx,

items: [

{type:_ZAGROUP_,

items:[

{ref:ZaDomain.A_SignatureID,

type:_TEXTFIELD_, editable:true,

msgName:"signature group",

label:signature.signature_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["ZaDomainXFormView"].push(SignatureExtension.DomainXFormModifier);
//alert("Finally Account Form");

}

if(ZaXDialog.XFormModifiers["ZaNewDomainXWizard"]) {
SignatureExtension.NewDomainWizXFormModifier = function(xFormObject,entry) {
var cnt = xFormObject.items.length;
var switchGroup;
for(var i = 0; i <cnt; i++) {
if(xFormObject.items[i].type=="switch") {
switchGroup = xFormObject.items[i];
break;
}
}
ZaNewDomainXWizard.signature_STEP = ++this.TAB_INDEX;
//this._lastStep++;
this.stepChoices.push({value:ZaNewDomainXWizard.si gnature_STEP, label:signature.Tab_signature});


var posixWizAccountTab = {
type:_CASE_,id:"domain_wiz_form_signature",numCols :1,
caseKey: ZaNewDomainXWizard.signature_STEP,tabGroupKey:ZaNe wDomainXWizard.signature_STEP,

items: [

{type:_ZAGROUP_,

items:[

{ref:ZaDomain.A_SignatureID,

type:_TEXTFIELD_, editable:true,

msgName:"signature group",

label:signature.signature_label,

labelLocation:_LEFT_
}
]
}
]
};
switchGroup.items.push(posixWizAccountTab);
}
ZaXDialog.XFormModifiers["ZaNewDomainXWizard"].push(SignatureExtension.NewDomainWizXFormModifier );
}
Please help..

Thank You!
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.