From 291f149a9b4b291d254b2c1f38de38d10053e66d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Jul 2018 20:26:48 +0200 Subject: [PATCH] NEW Can set a tooltip help text on extrafields --- htdocs/core/actions_extrafields.inc.php | 4 ++-- htdocs/core/tpl/admin_extrafields_add.tpl.php | 9 ++++++--- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 8 ++++++-- htdocs/core/tpl/admin_extrafields_view.tpl.php | 4 ++-- htdocs/langs/en_US/admin.lang | 2 ++ 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 6b6d40acd9c..599b847b49e 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -178,7 +178,7 @@ if ($action == 'add') (GETPOST('alwayseditable', 'alpha')?1:0), (GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''), $visibility, - 0, + GETPOST('help','alpha'), GETPOST('computed_value','alpha'), (GETPOST('entitycurrentorall', 'alpha')?0:''), GETPOST('langfile', 'alpha') @@ -344,7 +344,7 @@ if ($action == 'update') (GETPOST('alwayseditable', 'alpha')?1:0), (GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''), $visibility, - 0, + GETPOST('help','alpha'), GETPOST('default_value','alpha'), GETPOST('computed_value','alpha'), (GETPOST('entitycurrentorall', 'alpha')?0:''), diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 81b49719e98..e80685154fc 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -186,12 +186,15 @@ $langs->load("modulebuilder"); trans("Required"); ?>> trans("AlwaysEditable"); ?>> -multicompany->enabled) { ?> - trans("AllEntities"); ?>> - textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> + +textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> +multicompany->enabled) { ?> + + trans("AllEntities"); ?>> + diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 1d40a851576..cb5ef26bc57 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -156,6 +156,7 @@ $param=$extrafields->attributes[$elementtype]['param'][$attrname]; $perms=$extrafields->attributes[$elementtype]['perms'][$attrname]; $langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname]; $list=$extrafields->attributes[$elementtype]['list'][$attrname]; +$help=$extrafields->attributes[$elementtype]['help'][$attrname]; $entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname]; if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) @@ -248,12 +249,15 @@ else trans("Required"); ?>> trans("AlwaysEditable"); ?>> +textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> + + +textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> multicompany->enabled) { ?> + trans("AllEntities"); ?>> -textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> - diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index f6d5cebcc9e..a03c06f2d1d 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -56,8 +56,8 @@ print ''.$langs->trans("TranslationString").''; print ''.$langs->trans("AttributeCode").''; print ''.$langs->trans("Type").''; print ''.$langs->trans("Size").''; -print ''.$langs->trans("Unique").''; print ''.$langs->trans("ComputedFormula").''; +print ''.$langs->trans("Unique").''; print ''.$langs->trans("Required").''; print ''.$langs->trans("AlwaysEditable").''; print ''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''; @@ -83,8 +83,8 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print "".$key."\n"; print "".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."\n"; print ''.$extrafields->attributes[$elementtype]['size'][$key]."\n"; - print ''.yn($extrafields->attributes[$elementtype]['unique'][$key])."\n"; print ''.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."\n"; + print ''.yn($extrafields->attributes[$elementtype]['unique'][$key])."\n"; print ''.yn($extrafields->attributes[$elementtype]['required'][$key])."\n"; print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."\n"; print ''.$extrafields->attributes[$elementtype]['list'][$key]."\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a7cb30d970d..adaa93103db 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1796,6 +1796,8 @@ COMPANY_AQUARIUM_REMOVE_SPECIAL=Remove special characters COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) GDPRContact=GDPR contact GDPRContactDesc=If you store data about European companies/citizen, you can store here the contact who is responsible for the General Data Protection Regulation +HelpOnTooltip=Help text to show on tooltip +HelpOnTooltipDesc=Put here a text or a translation key for a text to show on a tooltip when this field appears into a form ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).