Fix: ical export can works if there is two parallele calls
This commit is contained in:
parent
0ba70794df
commit
d28a34dcf8
@ -590,26 +590,13 @@ class ActionComm
|
||||
// Check parameters
|
||||
if (empty($format)) return -1;
|
||||
|
||||
// Define prefix
|
||||
$prefix='';
|
||||
foreach ($filters as $key => $value)
|
||||
{
|
||||
if ($key == 'year') $prefix.='.year'.$value;
|
||||
if ($key == 'idaction') $prefix.='.id'.$value;
|
||||
if ($key == 'login') $prefix.='.login'.$value;
|
||||
if ($key == 'logina') $prefix.='.logina'.$value;
|
||||
if ($key == 'logind') $prefix.='.logind'.$value;
|
||||
if ($key == 'logint') $prefix.='.logint'.$value;
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (! $filename)
|
||||
{
|
||||
$extension='vcs';
|
||||
if ($format == 'ical') $extension='ics';
|
||||
$filename=$format.$prefix.'.'.$extension;
|
||||
$filename=$format.'.'.$extension;
|
||||
}
|
||||
else $filename.=$prefix;
|
||||
|
||||
// Create dir and define output file (definitive and temporary)
|
||||
$result=create_exdir($conf->agenda->dir_temp);
|
||||
|
||||
@ -78,10 +78,11 @@ if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_
|
||||
|
||||
// Define filename with prefix on filters predica (each predica set must have on cache file)
|
||||
$filename='';
|
||||
if ($format == 'vcal') $filename='dolibarrcalendar.vcs';
|
||||
if ($format == 'ical') $filename='dolibarrcalendar.ics';
|
||||
if ($format == 'rss') $filename='dolibarrcalendar.rss';
|
||||
// Check filename
|
||||
$shortfilename='';
|
||||
if ($format == 'vcal') $shortfilename='dolibarrcalendar.vcs';
|
||||
if ($format == 'ical') $shortfilename='dolibarrcalendar.ics';
|
||||
if ($format == 'rss') $shortfilename='dolibarrcalendar.rss';
|
||||
$filename=$shortfilename;
|
||||
if (! $filename)
|
||||
{
|
||||
$langs->load("main");
|
||||
@ -123,7 +124,7 @@ if ($format == 'ical' || $format == 'vcal')
|
||||
//$contenttype='ISO-8859-1';
|
||||
|
||||
if ($contenttype) header('Content-Type: '.$contenttype.($outputencoding?'; charset='.$outputencoding:''));
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$shortfilename.'"');
|
||||
|
||||
// Ajout directives pour resoudre bug IE
|
||||
//header('Cache-Control: Public, must-revalidate');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user