From cb551cfd5a070c4e19fa63346fcac6b7e922dbaa Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Mon, 11 May 2020 14:55:37 +0100 Subject: [PATCH] fix:non editable fields must not be editable in creation either --- htdocs/core/tpl/commonfields_add.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index a31cd3eb778..0bf2a60d0fe 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -56,7 +56,8 @@ foreach ($object->fields as $key => $val) if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int'); elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOST($key, 'none'); else $value = GETPOST($key, 'alpha'); - print $object->showInputField($val, $key, $value, '', '', '', 0); + if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0); + else print $object->showInputField($val, $key, $value, '', '', '', 0); print ''; print ''; }