diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index cb8dace1734..92120f1f8bb 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -138,17 +138,17 @@ class FormFile $out .= ' ('.$langs->trans("UploadDisabled").')'; } $out .= ""; - + if ($savingdocmask) { $out .= ''; if (! empty($options)) $out .= ''.$options.''; $out .= ''; - $out .= ' '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/',$langs->transnoentitiesnoconv("OriginFileName"),$savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); + $out .= ' '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/',$langs->transnoentitiesnoconv("OriginFileName"),$savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); $out .= ''; - $out .= ''; + $out .= ''; } - + $out .= ""; $out .= ''; @@ -663,12 +663,13 @@ class FormFile * @param int $permtodelete Permission to delete * @param int $useinecm Change output for use in ecm module * @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined) - * @param int $maxlength Maximum length of file name shown + * @param int $maxlength Maximum length of file name shown * @param string $title Title before list * @param string $url Full url to use for click links ('' = autodetect) + * @param int $showrelpart 0=Show only filename (default), 1=Show first level 1 dir * @return int <0 if KO, nb of files shown if OK */ - function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='') + function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0) { global $user, $conf, $langs, $hookmanager; global $bc; @@ -741,8 +742,7 @@ class FormFile print '&file='.$filepath.'">'; print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' '; - if ($file['level1name'] <> $object->id) - print $file['level1name'].'/'; + if ($showrelpart == 1) print $file['level1name'].'/'; print dol_trunc($file['name'],$maxlength,'middle'); print ''; print "\n";