diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 59e5a3426a2..ea4c529611a 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1608,6 +1608,14 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
$original_file=$conf->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
+ else if ($modulepart == 'massfilesarea_expensereport')
+ {
+ if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->expensereport->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+ }
// Wrapping for interventions
else if (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output))
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 13b95311dee..8e2b46459b0 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -303,7 +303,7 @@ if ($resql)
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
- //'builddoc'=>$langs->trans("PDFMerge"),
+ 'builddoc'=>$langs->trans("PDFMerge"),
);
if ($user->rights->expensereport->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
if ($massaction == 'presend') $arrayofmassactions=array();
@@ -716,7 +716,7 @@ if ($resql)
print ''."\n";
- /*
+
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{
// Show list of available documents
@@ -727,13 +727,12 @@ if ($resql)
$genallowed=$user->rights->expensereport->lire;
$delallowed=$user->rights->expensereport->lire;
- print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
+ print $formfile->showdocuments('massfilesarea_expensereport','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else
{
print '
'.$langs->trans("ShowTempMassFilesArea").'';
}
- */
}
else
{