From 95b69eaefbea97b0d7f1e7bd5296a7eaac07ce5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 19:57:25 +0200 Subject: [PATCH] Clean code --- htdocs/langs/en_US/modulebuilder.lang | 1 + htdocs/modulebuilder/index.php | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 13bcfdd76de..6de9ada7e4d 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -147,6 +147,7 @@ CSSViewClass=CSS for read form CSSListClass=CSS for list NotEditable=Not editable ForeignKey=Foreign key +ForeignKeyDesc=If the value of this field must be guaranted to exists into another table. Enter here a value matching syntax: tablename.parentfieldtocheck TypeOfFieldsHelp=Example:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]
'1' means we add a + button after the combo to create the record
'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)' TypeOfFieldsHelpIntro=This is the type of the field/attribute. AsciiToHtmlConverter=Ascii to HTML converter diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index a3d3e9d38fd..e247b5fabb5 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2988,7 +2988,7 @@ if ($module == 'initmodule') { print ''.$form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")).''; print ''.$langs->trans("DefaultValue").''; print ''.$langs->trans("DatabaseIndex").''; - print ''.$langs->trans("ForeignKey").''; + print ''.$form->textwithpicto($langs->trans("ForeignKey"), $langs->trans("ForeignKeyDesc"), 1, 'help', 'extracss', 0, 3, 'foreignkeyhelp').''; print ''.$langs->trans("Position").''; print ''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp').''; print ''.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'

'.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp').''; @@ -3099,7 +3099,9 @@ if ($module == 'initmodule') { print ''; print ''; print ''; @@ -3114,7 +3116,7 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -3188,13 +3190,15 @@ if ($module == 'initmodule') { print ''; print dol_escape_htmltag($propposition); print ''; - print ''; + print ''; print $propenabled ? dol_escape_htmltag($propenabled) : ''; print ''; - print ''; + // Visibility + print ''; print $propvisible ? dol_escape_htmltag($propvisible) : '0'; print ''; - print ''; + // Readonly + print ''; print $propnoteditable ? dol_escape_htmltag($propnoteditable) : ''; print ''; print ''; @@ -3206,16 +3210,17 @@ if ($module == 'initmodule') { print ''; print $propisameasure ? dol_escape_htmltag($propisameasure) : ''; print ''; - print ''; + print ''; print $propcss ? dol_escape_htmltag($propcss) : ''; print ''; - print ''; + print ''; print $propcssview ? dol_escape_htmltag($propcssview) : ''; print ''; - print ''; + print ''; print $propcsslist ? dol_escape_htmltag($propcsslist) : ''; print ''; - print ''; + // Key for tooltop + print ''; print $prophelp ? dol_escape_htmltag($prophelp) : ''; print ''; print '';