diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 01c05dadac8..7389e2ea7a5 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -473,7 +473,11 @@ if ($dirins && $action == 'initsqlextrafields' && !empty($module)) {
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile2), null, 'errors');
}
}
- // TODO Enable in class the property $isextrafieldmanaged = 1
+
+ // Now we update the object file to set $isextrafieldmanaged to 0
+ $srcfile = $dirins.'/'.strtolower($module).'/class/'.strtolower($objectname).'.class.php';
+ $arrayreplacement = array('/\$isextrafieldmanaged = 0;/' => '$isextrafieldmanaged = 1;');
+ dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1);
}
@@ -775,6 +779,8 @@ if ($dirins && $action == 'addlanguage' && !empty($module)) {
// remove/delete File
if ($dirins && $action == 'confirm_removefile' && !empty($module)) {
+ $objectname = $tabobj;
+
$relativefilename = dol_sanitizePathName(GETPOST('file', 'restricthtml'));
if ($relativefilename) {
$dirnametodelete = dirname($relativefilename);
@@ -808,6 +814,11 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) {
$arrayreplacement = array('/^\s*\''.preg_quote('/'.$relativefilename, '/').'\',*/m'=>' // \'/'.$relativefilename.'\',');
dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1);
}
+
+ // Now we update the object file to set $isextrafieldmanaged to 0
+ $srcfile = $dirins.'/'.strtolower($module).'/class/'.strtolower($objectname).'.class.php';
+ $arrayreplacement = array('/\$isextrafieldmanaged = 1;/' => '$isextrafieldmanaged = 0;');
+ dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1);
}
}
}
@@ -2064,6 +2075,7 @@ if ($module == 'initmodule') {
// Note module is inside $dirread
if ($tab == 'description') {
+ print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
$pathtofilereadme = $modulelowercase.'/README.md';
$pathtochangelog = $modulelowercase.'/ChangeLog.md';
@@ -2224,6 +2236,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'languages') {
+ print ''."\n";
if ($action != 'editfile' || empty($file)) {
print ''.$langs->trans("LanguageDefDesc").'
';
print '
';
@@ -2263,7 +2276,7 @@ if ($module == 'initmodule') {
$pathtofile = 'langs/'.$langfile['relativename'];
}
print '
| '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.'';
- print ' | '.img_picto($langs->trans("Edit"), 'edit').'';
+ print ' | '.img_picto($langs->trans("Edit"), 'edit').'';
print ' | '.img_picto($langs->trans("Delete"), 'delete').'';
print ' | ';
}
@@ -2299,6 +2312,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'dictionaries') {
+ print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
$dicts = $moduleobj->dictionaries;
@@ -2333,7 +2347,7 @@ if ($module == 'initmodule') {
print '';
print '';
- print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, ' aaa ');
+ print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'thsticky thstickygrey ');
print_liste_field_titre("Table", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("SQL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
@@ -2351,7 +2365,7 @@ if ($module == 'initmodule') {
while ($i < $maxi) {
print '
';
- print '| ';
+ print ' | ';
print ($i + 1);
print ' | ';
@@ -2395,7 +2409,7 @@ if ($module == 'initmodule') {
$i++;
}
} else {
- print '
| '.$langs->trans("None").' |
';
+ print '| '.$langs->trans("None").' |
';
}
print '
';
@@ -2429,6 +2443,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'objects') {
+ print ''."\n";
$head3 = array();
$h = 0;
@@ -3096,6 +3111,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'menus') {
+ print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
$menus = $moduleobj->menu;
@@ -3126,6 +3142,7 @@ if ($module == 'initmodule') {
print '';
print '';
+ print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'thsticky ');
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("LinkToParentMenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
@@ -3141,9 +3158,16 @@ if ($module == 'initmodule') {
print "
\n";
if (count($menus)) {
+ $i = 0;
foreach ($menus as $menu) {
+ $i++;
+
print '';
+ print '| ';
+ print $i;
+ print ' | ';
+
print '';
print dol_escape_htmltag($menu['type']);
print ' | ';
@@ -3229,6 +3253,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'permissions') {
+ print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
$perms = $moduleobj->rights;
@@ -3322,6 +3347,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'hooks') {
+ print ''."\n";
if ($action != 'editfile' || empty($file)) {
print ''.$langs->trans("HooksDefDesc").'
';
print '
';
@@ -3342,7 +3368,7 @@ if ($module == 'initmodule') {
print ''.$pathtohook.'';
print '';
print ''.img_picto($langs->trans("Edit"), 'edit').' ';
- print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
+ print ''.img_picto($langs->trans("Delete"), 'delete').'';
} else {
print ''.$langs->trans("FileNotYetGenerated").'';
print ''.img_picto('Generate', 'generate', 'class="paddingleft"').'';
@@ -3376,6 +3402,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'triggers') {
+ print ''."\n";
require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
$interfaces = new Interfaces($db);
@@ -3401,7 +3428,7 @@ if ($module == 'initmodule') {
print '| ';
print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.'';
print ' | '.img_picto($langs->trans("Edit"), 'edit').' | ';
- print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
+ print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
print '
';
}
} else {
@@ -3441,6 +3468,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'css') {
+ print ''."\n";
if ($action != 'editfile' || empty($file)) {
print ''.$langs->trans("CSSDesc").'
';
print '
';
@@ -3452,8 +3480,8 @@ if ($module == 'initmodule') {
print ' '.$langs->trans("CSSFile").' : ';
if (dol_is_file($dirins.'/'.$pathtohook)) {
print ''.$pathtohook.'';
- print ''.img_picto($langs->trans("Edit"), 'edit').' | ';
- print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
+ print ''.img_picto($langs->trans("Edit"), 'edit').' | ';
+ print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
} else {
print ''.$langs->trans("FileNotYetGenerated").'';
print ''.img_picto('Generate', 'generate', 'class="paddingleft"').' | ';
@@ -3486,6 +3514,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'js') {
+ print ''."\n";
if ($action != 'editfile' || empty($file)) {
print ''.$langs->trans("JSDesc").'
';
print '
';
@@ -3531,6 +3560,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'widgets') {
+ print ''."\n";
require_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
$widgets = ModeleBoxes::getWidgetsList(array('/'.strtolower($module).'/core/boxes'));
@@ -3582,6 +3612,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'exportimport') {
+ print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
$exportlist = $moduleobj->export_label;
@@ -3621,6 +3652,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'cli') {
+ print ''."\n";
$clifiles = array();
$i = 0;
@@ -3699,6 +3731,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'cron') {
+ print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
$cronjobs = $moduleobj->cronjobs;
@@ -3820,6 +3853,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'specifications') {
+ print ''."\n";
$specs = dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$', array('\/temp\/'));
if ($action != 'editfile' || empty($file)) {
@@ -3933,6 +3967,7 @@ if ($module == 'initmodule') {
}
if ($tab == 'buildpackage') {
+ print ''."\n";
print ''.$langs->trans("BuildPackageDesc").'';
print '
';