diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 81ac714ce543d0db18e1f8555eab2fb9a220afd0..2ccd9f3da395127c6caa09ed1d1fd731601a8442 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -50,6 +50,10 @@ if ($file && ! $what) +/* + * View + */ + llxHeader(); $html=new Form($db); @@ -179,6 +183,7 @@ if ($what == 'mysql') if ($compression == 'bz') $handle = bzopen($outputfile, 'r'); if ($hanlde) { +print 'eeee'; $errormsg = fgets($handle,10); if ($compression == 'none') fclose($handle); if ($compression == 'gz') gzclose($handle); @@ -218,7 +223,7 @@ if ($what) } } -$result=$formfile->show_documents('systemtools','',DOL_DATA_ROOT.'/admin/temp',$_SERVER['PHP_SELF'],0,1); +$result=$formfile->show_documents('systemtools','',DOL_DATA_ROOT.'/admin/temp',$_SERVER['PHP_SELF'],0,1,'',array(),0,0,48); if ($result == 0) { diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php index 3bc2bed24bb229f2aacb767b5684268ad8eaae07..ffd5aa08d64d517313528870797824a5ea4e1022 100644 --- a/htdocs/html.formfile.class.php +++ b/htdocs/html.formfile.class.php @@ -119,15 +119,16 @@ class FormFile * \param modelliste Tableau des modeles possibles * \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS d�fini * \param iconPDF N'affiche que l'icone PDF avec le lien (1/0) + * \param maxfilenamelength Max length for filename shown * \remarks Le fichier de facture d�taill�e est de la forme * REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse * \return int <0 si ko, nbre de fichiers affich�s si ok */ - function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0) + function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28) { // filedir = conf->...dir_ouput."/".get_exdir(id) include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); - + global $langs,$bc,$conf; $var=true; @@ -319,7 +320,7 @@ class FormFile print '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'">'; if (!$iconPDF) { - print img_mime($file["name"]).' '.dolibarr_trunc($file["name"],28); + print img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dolibarr_trunc($file["name"],$maxfilenamelength); } else { @@ -334,7 +335,7 @@ class FormFile if ($delallowed) { - print '<td><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&modulepart='.$modulepart.'&file='.urlencode($relativepath).'&urlsource='.urlencode($urlsource).'">'.img_delete().'</a></td>'; + print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&modulepart='.$modulepart.'&file='.urlencode($relativepath).'&urlsource='.urlencode($urlsource).'">'.img_delete().'</a></td>'; } if (!$iconPDF) print '</tr>'; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index b1ad6e235bc75c5fb902fd51aa26b90bca3523e9..c1de1d8fc9da2e32f3e4aab67e5724315852dd49 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -728,7 +728,7 @@ function dol_phone_link($phone,$option=0) } /** - \brief Tronque une chaine a une taille donn�e en ajoutant les points de suspension si cela d�passe + \brief Truncate a string to a particular length adding '...' if string larger than length \param string String to truncate \param size Max string size. 0 for no limit. \param trunc Where to trunc: right, left, middle @@ -1205,9 +1205,10 @@ function img_allow($allow) /** * \brief Show mime picto * \param file Filename + * \param alt Alternate text * \return string Return img tag */ -function img_mime($file) +function img_mime($file,$alt='') { $mime='other'; if (eregi('\.pdf',$file)) { $mime='pdf'; } @@ -1220,7 +1221,7 @@ function img_mime($file) if (eregi('\.(mp3|ogg|au)',$file)) $mime='audio'; if (eregi('\.(avi|mvw|divx|xvid)',$file)) $mime='video'; if (eregi('\.(zip|rar|gz|tgz|z|cab)',$file)) $mime='archive'; - $alt='Mime type: '.$mime; + if (empty($alt)) $alt='Mime type: '.$mime; $mime.='.png'; return '<img src="'.DOL_URL_ROOT.'/theme/common/mime/'.$mime.'" border="0" alt="'.$alt.'" title="'.$alt.'">';