diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 2fa329406fb..2f32e600841 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -847,8 +847,13 @@ class Utils $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { $this->error = $resarray['error'].' '.$resarray['output']; + $this->errors[] = $this->error; } $result = ($resarray['result'] == 0) ? 1 : 0; + if ($result < 0 && empty($this->errors)) { + $this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOC); + $this->errors[] = $this->error; + } // Build PDF doc $command = $conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF; @@ -856,8 +861,13 @@ class Utils $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { $this->error = $resarray['error'].' '.$resarray['output']; + $this->errors[] = $this->error; } $result = ($resarray['result'] == 0) ? 1 : 0; + if ($result < 0 && empty($this->errors)) { + $this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOCPDF); + $this->errors[] = $this->error; + } chdir($currentdir); } else { @@ -868,8 +878,6 @@ class Utils return 1; } else { $error++; - $langs->load("errors"); - $this->error = $langs->trans("ErrorFailToGenerateFile", $outputfiledoc); } } else { $error++; diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 86ff832cd04..7610aa78e9e 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -110,7 +110,7 @@ DropTableIfEmpty=(Destroy table if empty) TableDoesNotExists=The table %s does not exists TableDropped=Table %s deleted InitStructureFromExistingTable=Build the structure array string of an existing table -UseAboutPage=Disable the about page +UseAboutPage=Do not generate the About page UseDocFolder=Disable the documentation folder UseSpecificReadme=Use a specific ReadMe ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder. @@ -145,4 +145,5 @@ TableNotEmptyDropCanceled=Table not empty. Drop has been canceled. ModuleBuilderNotAllowed=The module builder is available but not allowed to your user. ImportExportProfiles=Import and export profiles ValidateModBuilderDesc=Put 1 if this field need to be validated with $this->validateField() or 0 if validation required -WarningDatabaseIsNotUpdated=Warning: The database is not updated automatically, you must destroy tables and disable-enable the module to have tables recreated \ No newline at end of file +WarningDatabaseIsNotUpdated=Warning: The database is not updated automatically, you must destroy tables and disable-enable the module to have tables recreated +LinkToParentMenu=Parent menu (fk_xxxxmenu) \ No newline at end of file diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index e5ccb0c3966..01a02d0c7dd 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -120,7 +120,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ''; print ''.$langs->trans("UseAboutPage").''; - print ''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MODULEBUILDER_USE_ABOUT'); } else { diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index be0d83a50a6..872a88b28aa 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -3103,14 +3103,14 @@ if ($module == 'initmodule') { print ''; print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("fk_menu", $_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); print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("RelativeURL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right '); @@ -3148,15 +3148,15 @@ if ($module == 'initmodule') { print dol_escape_htmltag($menu['langs']); print ''; - print ''; + print ''; print dol_escape_htmltag($menu['position']); print ''; - print ''; + print ''; print dol_escape_htmltag($menu['enabled']); print ''; - print ''; + print ''; print dol_escape_htmltag($menu['perms']); print ''; @@ -3858,8 +3858,10 @@ if ($module == 'initmodule') { $FILENAMEDOCPDF = $modulelowercase.'.pdf'; $outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC; $outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC; + $outputfiledocrel = $modulelowercase.'/doc/'.$FILENAMEDOC; $outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF; $outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF; + $outputfiledocrelpdf = $modulelowercase.'/doc/'.$FILENAMEDOCPDF; // HTML print ' '.$langs->trans("PathToModuleDocumentation", "HTML").' : '; @@ -3872,6 +3874,7 @@ if ($module == 'initmodule') { print ''; print ''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')'; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print '
'; @@ -3886,6 +3889,7 @@ if ($module == 'initmodule') { print ''; print ''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')'; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print '
'; @@ -3952,8 +3956,11 @@ if ($module == 'initmodule') { $relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP; print ''.$outputfilezip.''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')'; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } - print '
'; + print ''; + + print '
'; print '
';