diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang
index b17ab4fdeb2..792070e3d43 100644
--- a/htdocs/langs/en_US/modulebuilder.lang
+++ b/htdocs/langs/en_US/modulebuilder.lang
@@ -1,4 +1,5 @@
# Dolibarr language file - Source file is en_US - loan
+IdModule= Module id
ModuleBuilderDesc=This tool must be used only by experienced users or developers. It provides utilities to build or edit your own module. Documentation for alternative manual development is here.
EnterNameOfModuleDesc=Enter the name of the module/application to create with no spaces. Use uppercase to separate words (For example: MyModule, EcommerceForShop, SyncWithMySystem...)
EnterNameOfObjectDesc=Enter the name of the object to create with no spaces. Use uppercase to separate words (For example: MyObject, Student, Teacher...). The CRUD class file, but also API file, pages to list/add/edit/delete object and SQL files will be generated.
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index fd84cb5e4dd..3416c1c69b8 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -71,6 +71,12 @@ $file = GETPOST('file', 'alpha');
$modulename = dol_sanitizeFileName(GETPOST('modulename', 'alpha'));
$objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha'));
$dicname = dol_sanitizeFileName(GETPOST('dicname', 'alpha'));
+$editorname= GETPOST('editorname', 'alpha');
+$editorurl= GETPOST('editorurl', 'alpha');
+$version= GETPOST('version', 'alpha');
+$family= GETPOST('family', 'alpha');
+$picto= GETPOST('idpicto', 'alpha');
+$idmodule= GETPOST('idmodule', 'alpha');
// Security check
if (!isModEnabled('modulebuilder')) {
@@ -334,7 +340,13 @@ if ($dirins && $action == 'initmodule' && $modulename) {
'Mon module'=>$modulename,
'mon module'=>$modulename,
'htdocs/modulebuilder/template'=>strtolower($modulename),
- '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
+ '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : ''),
+ 'Editor name'=>$editorname,
+ 'https://www.example.com'=>$editorurl,
+ '1.0'=>$version,
+ 'idpicto'=>(empty($picto)) ? 'generic' : $picto,
+ "modulefamily" =>$family,
+ 500000=>$idmodule
);
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_EDITOR_NAME)) {
@@ -350,7 +362,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
$arrayreplacement['1.0'] = $conf->global->MODULEBUILDER_SPECIFIC_VERSION;
}
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_FAMILY)) {
- $arrayreplacement['other'] = $conf->global->MODULEBUILDER_SPECIFIC_FAMILY;
+ $arrayreplacement['modulefamily'] = $conf->global->MODULEBUILDER_SPECIFIC_FAMILY;
}
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
@@ -2075,10 +2087,32 @@ if ($module == 'initmodule') {
print '';
//print ''.$langs->trans("ModuleBuilderDesc2", 'conf/conf.php', $newdircustom).'
';
- print $langs->trans("EnterNameOfModuleDesc").'
';
print '
';
- print '
';
+ print '';
+ print ' '.$form->textwithpicto('', $langs->trans("EnterNameOfModuleDesc")).'
';
+
+
+
+ print '
';
+ print '
';
+ print '
';
+ print '
';
+ print $langs->trans("Family").'
';
+ print '
';
print '
';
print '';