diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8e24009d3676bd83357469579d6a283b7a838977..51be81a7bd5e7444d772a6ac0dc61347ebd15c6c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1807,6 +1807,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 13b95311dee2dab493089a66d314c72edd076509..8e2b46459b0c74a07ec26bf8a9eb755501ed5181 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 '</form>'."\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 '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>'; } - */ } else {