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
<?php $entry_point_registry['myEntryPointWebToLeadCapture'] = array('file' => 'custom/myEntryPointWebToLeadCapture.php', 'auth' => false);
Source 2. Definizione nuovo entryPoint su myentrypoint_registry.php
<?php $manifest = array ( 'acceptable_sugar_versions' => array ( 'regex_matches' => array( '6.[56789].dw*' ), ), 'acceptable_sugar_flavors' => array( 'PRO', 'CORP', 'ENT', 'ULT', ), 'readme' => '', 'key' => 'myEntryPointWebToLeadCapture', 'author' => '', 'description' => 'My Custom WebToLeadCapture', 'icon' => '', 'is_uninstallable' => true, 'name' => 'My Custom WebToLeadCapture', 'published_date' => '2013-03-21 23:22:07', 'type' => 'module', 'version' => '1.0', 'remove_tables' => false, ); $installdefs = array ( 'id' => 'TestEntrypoint', 'copy' => array ( array ( 'from' => '<basepath>/myEntryPointWebToLeadCapture.php', 'to' => 'custom/myEntryPointWebToLeadCapture.php', ), ), 'entrypoints' => array ( array ( 'from' => '<basepath>/myentrypoint_registry.php', 'to_module' => 'application', ), ), );
Source 3. Manifest file per l'installazione del nuovo entryPoint