I want to add a form to an existing XFromView in zimbra through a zimlet. I wonder how I can call the related XFormObject in this approach

StackOverflow https://stackoverflow.com/questions/15241497

  •  18-03-2022
  •  | 
  •  

سؤال

Based on my researches so far, most of the approaches through zimlets, where the ones that created a new tab, and made their own forms in XformView. But I wonder if it is possible to access the existing forms and modify them (Add a new form there in my case) using a zimlet. If there is a way, how can I access the XFormObject that I want?

To be more specified with the code, I want to add this checkbox:

setupGroup.items.push({ref:ZaAccount.A_zimbraIsAdminAccount, type:_CHECKBOX_,
        msgName:ZaMsg.NAD_IsSystemAdminAccount,label:ZaMsg.NAD_IsSystemAdminAccount,
        bmolsnr:true, trueValue:"TRUE", falseValue:"FALSE"
});

to Zimbra/js/ZimbraAdmin/View/ZaAccountXFormView directory. To account setup group there! Thanks in advanced.

هل كانت مفيدة؟

المحلول

The answer is yes! After a while trying to develop my own zimlet, I realized that it's possible (and even easy) to access all forms in Zimbra Administrator Console through zimlets! XFormObject is already defined since zimlets are being loaded after the relevant module was loaded (specially in dev mode). We just need to consider two things in our zimlet: 1-In Zimlet Definition File (The xml file), The extension must be true:

<zimlet name="com_zimbra_myzimlet" version="1.0" description="myform" extension="true">

2-we should introduce our Modifier function, and in the end, push that to the relevant ZaTabView.XFormModifiers array. in my case, ZaTabView.XFormModifiers["ZaAccountXFormView"].

ZaTabView.XFormModifiers["ZaAccountXFormView"].push(myfunction.AccountXFormModifier);

I hope you enjoy writing your zimlets on form extensions!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top