SugarCRM: Customize Web To Lead Capture via Ext Framework

In alcuni casi potrebbe essere necessario eseguire delle personalizzazioni del processo di cattura per il potenziale cliente. Questo processo di cattura è scatenato tramite un determinato entryPoint che prende il nome di WebToLeadCapture. Il metodo che consiglierei per apportare delle modifiche al processo standard di cattura, è sicuramente quello di realizzare un proprio entryPoint e registrarlo tramite l’Ext Framework sul vostro sistema. A seguire un esempio su come creare un proprio entryPoint e definirlo (anche installarlo) tramite l’Ext Framework. A questo punto sarà possibile accedere al proprio entrypoint tramite l’URI index.php?entryPoint=myEntryPointWebToLeadCapture.

Per maggiori informazioni sull’Ext Framework consiglio di consultare la documentazione di SugarCRM ma in particolare questo post What’s new in Sugar 6.3: Ext framework enhancements.

<?php
echo "My Custom WebToLeadCapture";
[/sourcecode]

Source 1. Codice dell’entryPoint

&lt;?php
$entry_point_registry['myEntryPointWebToLeadCapture'] = array('file' =&gt; 'custom/myEntryPointWebToLeadCapture.php', 'auth' =&gt; false);

Source 2. Definizione nuovo entryPoint su myentrypoint_registry.php

&lt;?php
$manifest = array (
    'acceptable_sugar_versions' =&gt; array (
        'regex_matches' =&gt; array(
            '6.[56789].dw*'
            ),
        ),
    'acceptable_sugar_flavors' =&gt; array(
        'PRO',
        'CORP',
        'ENT',
        'ULT',
        ),
    'readme' =&gt; '',
    'key' =&gt; 'myEntryPointWebToLeadCapture',
    'author' =&gt; '',
    'description' =&gt; 'My Custom WebToLeadCapture',
    'icon' =&gt; '',
    'is_uninstallable' =&gt; true,
    'name' =&gt; 'My Custom WebToLeadCapture',
    'published_date' =&gt; '2013-03-21 23:22:07',
    'type' =&gt; 'module',
    'version' =&gt; '1.0',
    'remove_tables' =&gt; false,
    );

$installdefs = array (
    'id' =&gt; 'TestEntrypoint',
    'copy' =&gt; array (
        array (
            'from' =&gt; '&lt;basepath&gt;/myEntryPointWebToLeadCapture.php',
            'to' =&gt; 'custom/myEntryPointWebToLeadCapture.php',
            ),
        ),
    'entrypoints' =&gt; array (
        array (
            'from' =&gt; '&lt;basepath&gt;/myentrypoint_registry.php',
            'to_module' =&gt; 'application',
            ),
        ),
    );

Source 3. Manifest file per l’installazione del nuovo entryPoint

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC (http://it.wikipedia.org/wiki/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until … Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.

You may also like...