Fix download of mass generated files.

This commit is contained in:
Laurent Destailleur 2016-06-22 21:06:08 +02:00
parent 00749b2a65
commit 4a408e76e7
3 changed files with 5 additions and 5 deletions

View File

@ -1479,7 +1479,7 @@ if ($resql)
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param); $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>'; $title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
print $formfile->showdocuments('massfilesarea','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); print $formfile->showdocuments('massfilesarea_facture','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
} }
else else
{ {

View File

@ -569,15 +569,15 @@ class FormFile
$reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']); $reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']);
$out.= $hookmanager->resPrint; $out.= $hookmanager->resPrint;
} }
}
}
// Get list of files // Get list of files
if (! empty($filedir)) if (! empty($filedir))
{ {
$file_list=dol_dir_list($filedir,'files',0,'','(\.meta|_preview\.png)$','date',SORT_DESC); $file_list=dol_dir_list($filedir,'files',0,'','(\.meta|_preview\.png)$','date',SORT_DESC);
// Show title of array if not already shown // Show title of array if not already shown
if ((! empty($file_list) || $modulepart == 'massfilesarea') && ! $headershown) if ((! empty($file_list) || preg_match('/^massfilesarea', $modulepart)) && ! $headershown)
{ {
$headershown=1; $headershown=1;
$out.= '<div class="titre">'.$titletoshow.'</div>'; $out.= '<div class="titre">'.$titletoshow.'</div>';

View File

@ -1983,13 +1983,13 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
} }
else if ($modulepart == 'unpaid') else if ($modulepart == 'massfilesarea')
{ {
if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->facture->dir_output.'/unpaid/temp/'.$original_file; $original_file=$conf->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
} }
// Wrapping pour les fiches intervention // Wrapping pour les fiches intervention