mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
- New usage of graphviz: store the life-cycle images and use by default their static version (for those who don;t have graphviz on their server)
SVN:code[44]
This commit is contained in:
@@ -64,12 +64,19 @@ function GraphvizLifecycle($sClass)
|
||||
}
|
||||
|
||||
$sClass = utils::ReadParam('class', 'bizIncidentTicket');
|
||||
$sDotDescription = GraphvizLifecycle($sClass);
|
||||
$sDotFilePath = "F:/iTop/roots/81-iTop/tmp/fsm.dot";
|
||||
$rFile = fopen($sDotFilePath, "w");
|
||||
fwrite($rFile, $sDotDescription);
|
||||
fclose($rFile);
|
||||
$sDir = dirname(__FILE__);
|
||||
$sImageFilePath = realpath($sDir."/../images/lifecycle/$sClass.png");
|
||||
if (!file_exists($sImageFilePath))
|
||||
{
|
||||
// create the file with Graphviz
|
||||
$sDotDescription = GraphvizLifecycle($sClass);
|
||||
$sDotFilePath = $sDir."/tmp-lifecycle.dot";
|
||||
$rFile = fopen($sDotFilePath, "w");
|
||||
fwrite($rFile, $sDotDescription);
|
||||
fclose($rFile);
|
||||
exec("/iTop/Graphviz/bin/dot.exe -Tpng < $sDotFilePath > $sImageFilePath");
|
||||
}
|
||||
|
||||
header('Content-type: image/png');
|
||||
passthru("F:/iTop/Graphviz/bin/dot.exe -Tpng < $sDotFilePath");
|
||||
echo file_get_contents($sImageFilePath);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user