2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2022-07-15 15:35:45 +02:00
parent 504383c4a2
commit 1d0ba05e90
3 changed files with 50 additions and 25 deletions

View File

@@ -1518,9 +1518,10 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
$error++;
}*/
$moduletype = $listofmodules[strtolower($module)]['moduletype'];
// Edit the class file to write properties
if (!$error) {
$moduletype = 'external';
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
if (is_numeric($object) && $object <= 0) {
@@ -1530,21 +1531,20 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
// Edit sql with new properties
if (!$error) {
$moduletype = 'external';
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object, $moduletype);
if ($result <= 0) {
$error++;
}
}
if (!$error) {
clearstatcache(true);
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);
setEventMessages($langs->trans('WarningDatabaseIsNotUpdated'), null);
clearstatcache(true);
// Make a redirect to reload all data
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabobj='.$objectname.'&nocache='.time());