diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 701c72f3cf9..a2b71df348c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -354,14 +354,14 @@ class FormFile print ''; print_titre($langs->trans("Documents")); - print ''; + print '
'; print ''; // Model if (! empty($modellist)) { - print ''; } // Language code (if multilang) - print ''; // Button - print '
'; + print ''; print $langs->trans('Model').' '; print $html->selectarray('model',$modellist,$modelselected,$showempty,0,0); if (sizeof($cgvlist) > 0) @@ -372,13 +372,13 @@ class FormFile } else { - print ''; + print ''; print $langs->trans("Files"); print ''; + print ''; if (($allowgenifempty || (is_array($modellist) && sizeof($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang) { include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'); @@ -393,7 +393,7 @@ class FormFile print ''; + print ''; print 'label). For modules that need directory scan, key is completed with ":filename". + * @param $db Database handler + * @param $type Type of models (company, invoice, ...) + * @param $maxfilenamelength Max length of value to show + * @return int or array 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename". */ -function getListOfModels($db,$type) +function getListOfModels($db,$type,$maxfilenamelength=0) { global $conf,$langs; $liste=array(); @@ -1057,7 +1058,8 @@ function getListOfModels($db,$type) { foreach($listoffiles as $record) { - $liste[$obj->id.':'.$record['fullname']]=dol_trunc($record['name'],24,'middle'); + $max=($maxfilenamelength?$maxfilenamelength:28); + $liste[$obj->id.':'.$record['fullname']]=dol_trunc($record['name'],$max,'middle'); } } else