When we recently added a feature to our upload scanner that checks the module zip for any missing files we unintentionally found a hidden gem. As many of you are familiar with, sometimes you just have to make a change that is specific to a certain version of SugarCRM. What many do in a case like that is to provide a zip file for that specific version (e.g. MyModule_for_6.5.9.zip). This can become hard to maintain over time.
Christian Knoll (creator of the Google StyleTheme) has a very clever way of dealing with this. In the manifest he takes advantage of the sugar_flavor and sugar_version global variables. Using these he is able to dynamically define what files to copy over based on the user’s current version.
So instead of a zip for each version, we are able to define what flavors and versions to support:
'acceptable_sugar_flavors' => array( | |
'CE', 'PRO','ENT' | |
), | |
'acceptable_sugar_versions' => array( | |
'6.5.7', | |
'6.5.8', | |
'6.5.9' | |
), |
Then in the copy we can utilize the global vars:
'copy' => array( | |
array( | |
'from' => '<basepath>/copy/' . $GLOBALS['sugar_flavor'] . '_' . $GLOBALS['sugar_version'] . '/include/Dashlets/Dashlet.php, | |
'to' => 'include/Dashlets/Dashlet.php', | |
), | |
), |
This would then pull the appropriate version from the module zip’s file structure:
/copy/CE_6.5.7/...
/copy/CE_6.5.8/...
/copy/CE_6.5.9/...
/copy/PRO_6.5.7/...
/copy/PRO_6.5.8/...
/copy/PRO_6.5.9/...
..and so on
This makes it much easier to maintain for multiple versions and flavors of SugarCRM. Unfortunately, it means we have some work to do to add support to the upload scanner for this method. Thanks Christian!
-
SugarCRM Exchange / Office 365 Integration
Scalable, Enterprise-Class solution for integrating SugarCRM with Exchange / Office 365. Synchronize contacts, calendars and tasks. Set rules for auto-archiving of incoming/outgoing emails. Combine (o... -
Last Activity Dates
Last Activity Dates allows users to see when the Target, Lead, Contact, or Account was last communicated with. It can also drill down to each activity type and quickly create a list of customers or pr... -
ActiveCampaign for SugarCRM
Quickly see and review the Status of ActiveCampaign marketing emails along with their Lead Scores from your SugarCRM. The SugarActiveCampaign add-on helps users effectively reach contacts via marketin... - Show more addons