From 1f4742b77b2c58f97ece419cf07010aca18f29bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Nov 2015 19:38:19 +0100 Subject: [PATCH] Remove useles html generated code. More code comment. --- htdocs/core/class/html.form.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 393560b4640..2198cd9df13 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -76,7 +76,7 @@ class Form * @param string $htmlname Name of select field ('edit' prefix will be added) * @param string $preselected Name of Value to show/edit (not used in this function) * @param object $object Object - * @param boolean $perm Permission to allow button to edit parameter + * @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) * @param string $moreparam More param to add on a href URL * @return string HTML edit field @@ -104,11 +104,11 @@ class Form } else { - $ret.='
'; + if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; + if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; - $ret.='
'; $ret.=$langs->trans($text); - $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'
'; + if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='
'; } return $ret;