I want to do some special modules. To know if I can reuse some published modules I would like to get an overview of the relations between the modules.
Yes, the database schema I have found (SchemaSpy). However for me it would be more useful to have an ER model to see the concept.
Does somebody knows if there is something like that somewhere?
There are quite a lot of modules in SuiteCRM so a full diagram is very cluttered. However I’ve threw together this function which reads the relationship data in cache to create a graph. This is quickly put together so I make no claims about accuracy or the like but something like:
function makeGraph(){
global $beanList, $dictionary;
$graph = "digraph{\n";
foreach($beanList as $module => $beanName){
include "cache/modules/$module/{$module}vardefs.php";
}
$graphEntries = array();
foreach($dictionary as $module => $entry){
foreach($entry['relationships'] as $relName => $relEntry){
if(empty($relEntry['lhs_module']) || empty($relEntry['rhs_module'])){
continue;
}
$graphEntries[] = $relEntry['lhs_module'] . " -> " . $relEntry['rhs_module'] . ";\n";
}
}
$graphEntries = array_unique($graphEntries);
$graph .= implode('',$graphEntries);
$graph .= "}";
return $graph;
}
Creates a basic graphviz dot file (this only includes links between modules and does’t display cardinality). This can be turned into the attached image but as I mentioned it’s pretty cluttered.
You could probably update the function to ignore certain modules.
Thanks a lot for your graph function.
That’s exactly what I was looking for.
I’m still a newbie and just learning how to develop for suitecrm. Therefore could you tell me how to integrate your function into my suitecrm installation?
This depends on where you want to place it, how you want it to be fired e.t.c. The first thing to note is that that function returns a string in graphviz format so you would have to convert that. This isn’t something I’ve done before but googling “php graphviz” should throw up some helpful responses.