From ed46d0d65f47974d57305e94fd16b0eb0f249580 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Mar 2012 19:46:29 +0800 Subject: [PATCH] Fix: possibility to add options --- htdocs/core/class/html.form.class.php | 8 +++----- htdocs/core/class/html.formfile.class.php | 11 +++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 05db64b020d..67d2d96883d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3409,22 +3409,20 @@ class Form } $out.='>'; - + + $newval=($translate?$langs->trans(ucfirst($value)):$value); if ($key_in_label) { - $newval=($translate?$langs->trans($value):$value); $selectOptionValue = dol_htmlentitiesbr($key.' - '.($maxlen?dol_trunc($newval,$maxlen):$newval)); - $out.=$selectOptionValue; } else { - $newval=($translate?$langs->trans($value):$value); $selectOptionValue = dol_htmlentitiesbr($maxlen?dol_trunc($newval,$maxlen):$newval); if ($value == '' || $value == '-') { $selectOptionValue=' '; } - $out.=$selectOptionValue; } + $out.=$selectOptionValue; $out.="\n"; } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 148aaf71fa7..4ec03ad1165 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -60,7 +60,7 @@ class FormFile * @param Object $object Object to use (when attachment is done on an element) * @return int <0 if KO, >0 if OK */ - function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='') + function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='') { global $conf,$langs; @@ -82,7 +82,14 @@ class FormFile print ''; print ''; - print ''; + + if (! empty($options)) + { + print ''; + } + + print '
'; + print '
'.$options.''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu