add function writePropsInAsciiDoc when Init object if doc was generated

This commit is contained in:
Lamrani Abdel 2023-03-21 16:00:50 +01:00
parent 55667c5ac4
commit fcbae93328

View File

@ -1586,6 +1586,13 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors');
$error++;
}
// check if documentation was generate and add table of properties object
$file = $destdir.'/class/'.strtolower($objectname).'.class.php';
$destfile = $destdir.'/doc/Documentation.asciidoc';
if (file_exists($destfile)) {
writePropsInAsciiDoc($file, $objectname, $destfile);
}
}
if (!$error) {
// Edit sql with new properties