From 0bf678e09e734f3241c66aa0980ec827b0248c8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Jul 2020 14:57:33 +0200 Subject: [PATCH] Fix label of extrafields --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- htdocs/core/class/extrafields.class.php | 4 ++-- .../core/tpl/admin_extrafields_edit.tpl.php | 19 +++++++++++++++++++ htdocs/langs/en_US/admin.lang | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 912c9953229..37a39e7d1f0 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -219,7 +219,7 @@ if ($action == "update_extras" && !empty($permissiontoadd)) $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; } else { - $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, ' alpha'); + $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); } $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1f38719dbb1..eecb5b54330 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -154,8 +154,8 @@ class ExtraFields public static $type2label = array( - 'varchar'=>'String', - 'text'=>'TextLong', + 'varchar'=>'String1Line', + 'text'=>'TextLongNLines', 'html'=>'HtmlText', 'int'=>'Int', 'double'=>'Float', diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 80a7cac7de3..191b4cf40c8 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -186,8 +186,10 @@ elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($ ?> trans("LabelOrTranslationKey"); ?> + trans("AttributeCode"); ?> + trans("Type"); ?> array('varchar', 'phone', 'mail', 'url', 'select'), 'select'=>array('varchar', 'phone', 'mail', 'url', 'select') ); +/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert +if ($size <= 255 && in_array($type, array('text', 'html'))) { + $typewecanchangeinto['text'][] = 'varchar'; +}*/ if (in_array($type, array_keys($typewecanchangeinto))) { @@ -225,8 +231,10 @@ else } ?> + trans("Size"); ?> + @@ -247,33 +255,44 @@ else + trans("Position"); ?> + trans("LanguageFile"); ?> + global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> + trans("Unique"); ?>> + trans("Required"); ?>> + trans("AlwaysEditable"); ?>> + textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> + textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?> textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?>> + textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> + multicompany->enabled) { ?> trans("AllEntities"); ?>> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c99c436915d..33590b17141 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -409,7 +409,9 @@ PriceBaseTypeToChange=Modify on prices with base reference value defined on MassConvert=Launch bulk conversion PriceFormatInCurrentLanguage=Price Format In Current Language String=String +String1Line=String (1 line) TextLong=Long text +TextLongNLines=Long text (n lines) HtmlText=Html text Int=Integer Float=Float