Skip to content

Instantly share code, notes, and snippets.

@JimMackin
Created July 3, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JimMackin/0dba3b993dc069228c38 to your computer and use it in GitHub Desktop.
Save JimMackin/0dba3b993dc069228c38 to your computer and use it in GitHub Desktop.
Small PHP script to highlight fields in SuiteCRM with no name.
<?php
$base = "/path/to/suitecrm";
$searchBase = $base.DIRECTORY_SEPARATOR."cache".DIRECTORY_SEPARATOR."modules";
$dirs = scandir($searchBase);
$GLOBALS["dictionary"] = array();
foreach($dirs as $dir){
$dir = $searchBase .DIRECTORY_SEPARATOR . $dir;
if($dir == '.' || $dir == '..' || !is_dir($dir)){
continue;
}
$files = glob($dir.DIRECTORY_SEPARATOR.'*vardefs.php');
foreach($files as $file){
include $file;
}
}
foreach($GLOBALS["dictionary"] as $module => $arr){
foreach($arr["fields"] as $key => $field){
if(empty($key)){
echo "Empty key for field in $module\n";
}
if(empty($field['name'])){
echo "Empty name for $key field in $module\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment