[Vtigercrm-developers] Packaging newly created module

Support Team TheEasyRef support at theeasyref.com
Thu Nov 7 14:26:33 GMT 2013


Hello Adrian,

If you look at page 17 in vtlib documentation (mentioned as "step 5"), you
need to add to your installation script the relation between your module
and the others. See also the extensive explanation of joe bordes (link in
my original mail hereunder). Concretely, you will add something like that:
$module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
tracking',Array('ADD'),'get_dependents_list');

this create a relation of the new module with the one of the account. This
instruction will create a record in the relatedlists table as already
explained.

However, as joe bordes explained, when exporting the module it will not be
able to have the relationship extracted because this is something at the
account module level.

Assuming my new module is called PaymentML, go to PaymentML.php and add the
relationship instruction
$module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
tracking',Array('ADD'),'get_dependents_list');
to the function vtlib_handler:

    function vtlib_handler($modulename, $event_type) {
        if($event_type == 'module.postinstall') {
            // TODO Handle post installation actions
            !!relation command goes here!!

This will create the relationship in the table immediately after the module
is installed.

I hope that clears up.

Regards,
Joel



On Thu, Nov 7, 2013 at 3:51 PM, <
vtigercrm-developers-request at lists.vtigercrm.com> wrote:

> Send vtigercrm-developers mailing list submissions to
>         vtigercrm-developers at lists.vtigercrm.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers
>
> or, via email, send a message with subject or body 'help' to
>         vtigercrm-developers-request at lists.vtigercrm.com
>
> You can reach the person managing the list at
>         vtigercrm-developers-owner at lists.vtigercrm.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtigercrm-developers digest..."
>
> Today's Topics:
>
>    1. Re: Packaging newly created module (Support Team TheEasyRef)
>    2. Re: Packaging newly created module
>       (Adri?n Granado - Refineria Web)
>
>
> ---------- Forwarded message ----------
> From: Support Team TheEasyRef <support at theeasyref.com>
> To: vtigercrm-developers at lists.vtigercrm.com
> Cc:
> Date: Thu, 7 Nov 2013 15:15:16 +0200
> Subject: Re: [Vtigercrm-developers] Packaging newly created module
> Hello Joe,
>
> Thanks for your tip with vtlib_handler(). That did the job.
>
> I created this simple module mainly as a way to better understand the
> basics writing a custom module. It surely is not as extended as the one you
> developed.
>
> Regards,
> Joel
>
> ---------- Forwarded message ----------
> To: vtigercrm-developers at lists.vtigercrm.com
> Cc:
> Date: Wed, 06 Nov 2013 22:39:16 +0100
> Subject: Re: [Vtigercrm-developers] Packaging newly created module
> Hi,
>
> The export process only registers information directly related with the
> module. The  related list you are adding is information on the other
> module, not yours.
> To overcome this add your setRelatedList call in the vtlib_handler()
> method of your module's main class.
>
> May I ask why you didn't use our payment module?
>
> Joe
> TSolucio
>
>
> El 06/11/13 22:22, Support Team TheEasyRef escribió:
>  Hello,
>
> I have written a small module than enables to track payments of accounts.
> Basically, it is a 1:m relationship with the account module, i.e. one
> account can have multiple payment tracking entities. The idea is that I can
> have my payment tracking module appear as a related list under the accounts
> (organisations), just like other modules as quotes, projects, products etc
> ...
>
> I used vtlib to create a script for the installation. For configuring the
> relationship I use the get_dependents_list function as mentioned by Joe
> Bordes at http://www.crmevolutivo.com/doku.php/es:vtlibrelated
>
> concretely the code for this is :
> $module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
> tracking',Array('ADD'),'get_dependents_list');
>
> this will correctly update the vtiger_relatedlists table with an extra
> record.
>
> So the script works perfectly with no problem. However, when I want to
> export the new module, and install it on a new vtiger instance, I am
> loosing the relationship. This means that the payment tracking will not
> appear as a related list in the accounts. After checking, I found out that
> the import of the zip package will not update the vtiger_relatedlists table.
>
> Any idea why the export process is not working smoothly?
>
> Thanks,
> Joel
>
>
> _______________________________________________http://www.vtiger.com/
>
>
>
> ---------- Forwarded message ----------
> From: "Adrián Granado - Refineria Web" <adrian at refineriaweb.com>
> To: <vtigercrm-developers at lists.vtigercrm.com>
> Cc:
> Date: Thu, 7 Nov 2013 14:51:19 +0100
> Subject: Re: [Vtigercrm-developers] Packaging newly created module
>
> Can you explain more how you resolve the problem?
>
> Thanks!
>
>
>
> [image: Refineria Web]
>
> *Adrián Granado *
> PROGRAMADOR
> adrian at refineriaweb.com <%20adrian at refineriaweb.com>
>
>
>
> C/ Gran Vía Asima, 20 - 2º Oficina 7
>
> 07009 Palma de Mallorca
> Teléfono 971 72 98 83 – Ext. 511
> Fax 971 780 391
>
> [image: Refineria Web] <http://www.refineriaweb.com/>
>
>
>
> [image: Siguenos en Facebook] <https://www.facebook.com/refineriaweb1>[image:
> Siguenos en Twitter] <https://twitter.com/refineriaweb>
>
>
>
>
>
> *De:* vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:
> vtigercrm-developers-bounces at lists.vtigercrm.com] *En nombre de *Support
> Team TheEasyRef
> *Enviado el:* jueves, 07 de noviembre de 2013 14:15
> *Para:* vtigercrm-developers at lists.vtigercrm.com
> *Asunto:* Re: [Vtigercrm-developers] Packaging newly created module
>
>
>
> Hello Joe,
>
> Thanks for your tip with vtlib_handler(). That did the job.
>
> I created this simple module mainly as a way to better understand the
> basics writing a custom module. It surely is not as extended as the one you
> developed.
>
> Regards,
>
> Joel
>
> ---------- Forwarded message ----------
> To: vtigercrm-developers at lists.vtigercrm.com
> Cc:
> Date: Wed, 06 Nov 2013 22:39:16 +0100
> Subject: Re: [Vtigercrm-developers] Packaging newly created module
>
> Hi,
>
> The export process only registers information directly related with the
> module. The  related list you are adding is information on the other
> module, not yours.
> To overcome this add your setRelatedList call in the vtlib_handler()
> method of your module's main class.
>
> May I ask why you didn't use our payment module?
>
> Joe
> TSolucio
>
>
> El 06/11/13 22:22, Support Team TheEasyRef escribió:
>
> Hello,
>
> I have written a small module than enables to track payments of accounts.
> Basically, it is a 1:m relationship with the account module, i.e. one
> account can have multiple payment tracking entities. The idea is that I can
> have my payment tracking module appear as a related list under the accounts
> (organisations), just like other modules as quotes, projects, products etc
> ...
>
> I used vtlib to create a script for the installation. For configuring the
> relationship I use the get_dependents_list function as mentioned by Joe
> Bordes at http://www.crmevolutivo.com/doku.php/es:vtlibrelated
>
> concretely the code for this is :
> $module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
> tracking',Array('ADD'),'get_dependents_list');
>
> this will correctly update the vtiger_relatedlists table with an extra
> record.
>
> So the script works perfectly with no problem. However, when I want to
> export the new module, and install it on a new vtiger instance, I am
> loosing the relationship. This means that the payment tracking will not
> appear as a related list in the accounts. After checking, I found out that
> the import of the zip package will not update the vtiger_relatedlists table.
>
> Any idea why the export process is not working smoothly?
>
> Thanks,
> Joel
>
>
>
> _______________________________________________
>
> http://www.vtiger.com/
>
>
> _______________________________________________
> vtigercrm-developers mailing list
> vtigercrm-developers at lists.vtigercrm.com
> http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20131107/7f68835b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1934 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20131107/7f68835b/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 3354 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20131107/7f68835b/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1186 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20131107/7f68835b/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1099 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20131107/7f68835b/attachment-0007.png>


More information about the vtigercrm-developers mailing list