diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php
index 7715b17b4d8..27515db3c68 100644
--- a/dev/skeletons/skeleton_list.php
+++ b/dev/skeletons/skeleton_list.php
@@ -530,11 +530,7 @@ if ($resql)
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire;
- print '
';
- $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
- $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')';
-
- print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
+ print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else
{
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 88f8f8fa3df..05b27663b4b 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1016,11 +1016,7 @@ if ($resql)
$genallowed=$user->rights->propal->lire;
$delallowed=$user->rights->propal->lire;
- print '
';
- $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
- $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')';
-
- print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
+ print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
}
else
{
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index d9438d9a93f..ab25895b561 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1438,10 +1438,6 @@ if ($resql)
$genallowed=$user->rights->commande->lire;
$delallowed=$user->rights->commande->lire;
- print '
';
- $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
- $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')';
-
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 36873d15963..48ed568e3f9 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1155,10 +1155,6 @@ if ($resql)
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire;
- print '
';
- $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
- $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')';
-
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 93695201062..6bb6334e085 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -305,12 +305,37 @@ class FormFile
$showempty=0;
$i=0;
- $titletoshow=$langs->trans("Documents");
- if (! empty($title)) $titletoshow=$title;
-
$out.= "\n".''."\n";
//print 'filedir='.$filedir;
+ if (preg_match('/massfilesarea_/', $modulepart))
+ {
+ $out.='
';
+ $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')';
+ $title.='';
+ }
+
+ $titletoshow=$langs->trans("Documents");
+ if (! empty($title)) $titletoshow=$title;
+
// Show table
if ($genallowed)
{
@@ -518,6 +543,7 @@ class FormFile
}
}
+ // Set headershown to avoit to have table opened a second time later
$headershown=1;
$buttonlabeltoshow=$buttonlabel;
@@ -526,7 +552,7 @@ class FormFile
if (empty($noform)) $out.= '