Created
June 6, 2016 19:03
-
-
Save vjaro-metrix/875a2d11afa1b64dfe87580a3a687e92 to your computer and use it in GitHub Desktop.
Extract Module list and get field an field names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ini_set("display_errors", true); | |
| if (! defined('sugarEntry')) { | |
| define('sugarEntry', true); | |
| } | |
| require_once('include/entryPoint.php'); | |
| $user = BeanFactory::getBean("Users", 1); | |
| $GLOBALS["current_user"] = $user; | |
| $file = fopen("modulesFieldsLabels.csv", "w"); | |
| $header = array("Module", "Label", "Field"); | |
| fputcsv($file,$header); | |
| foreach ($GLOBALS['moduleList'] as $module_name) { | |
| $bean = BeanFactory::getBean($module_name); | |
| if (is_object($bean)) { | |
| $fieldDef = $bean->getFieldDefinitions(); | |
| foreach ($fieldDef as $fieldName => $fieldDefArray) { | |
| if (! empty($fieldDefArray['vname'])) { | |
| $fieldLabel = translate($fieldDefArray['vname'], $bean->module_dir); | |
| $moduleLabel = translate('LBL_MODULE_NAME', $bean->module_dir); | |
| $field_defs[] = array( | |
| $moduleLabel, | |
| $fieldLabel, | |
| $fieldName | |
| ); | |
| fputcsv($file, array($moduleLabel, $fieldLabel,$fieldName)); | |
| } | |
| } | |
| } | |
| } | |
| fclose($file); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment