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
|
// Check parameters
|
||||||
if (empty($format)) return -1;
|
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
|
// Clean parameters
|
||||||
if (! $filename)
|
if (! $filename)
|
||||||
{
|
{
|
||||||
$extension='vcs';
|
$extension='vcs';
|
||||||
if ($format == 'ical') $extension='ics';
|
if ($format == 'ical') $extension='ics';
|
||||||
$filename=$format.$prefix.'.'.$extension;
|
$filename=$format.'.'.$extension;
|
||||||
}
|
}
|
||||||
else $filename.=$prefix;
|
|
||||||
|
|
||||||
// Create dir and define output file (definitive and temporary)
|
// Create dir and define output file (definitive and temporary)
|
||||||
$result=create_exdir($conf->agenda->dir_temp);
|
$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)
|
// Define filename with prefix on filters predica (each predica set must have on cache file)
|
||||||
$filename='';
|
$filename='';
|
||||||
if ($format == 'vcal') $filename='dolibarrcalendar.vcs';
|
$shortfilename='';
|
||||||
if ($format == 'ical') $filename='dolibarrcalendar.ics';
|
if ($format == 'vcal') $shortfilename='dolibarrcalendar.vcs';
|
||||||
if ($format == 'rss') $filename='dolibarrcalendar.rss';
|
if ($format == 'ical') $shortfilename='dolibarrcalendar.ics';
|
||||||
// Check filename
|
if ($format == 'rss') $shortfilename='dolibarrcalendar.rss';
|
||||||
|
$filename=$shortfilename;
|
||||||
if (! $filename)
|
if (! $filename)
|
||||||
{
|
{
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
@ -123,7 +124,7 @@ if ($format == 'ical' || $format == 'vcal')
|
|||||||
//$contenttype='ISO-8859-1';
|
//$contenttype='ISO-8859-1';
|
||||||
|
|
||||||
if ($contenttype) header('Content-Type: '.$contenttype.($outputencoding?'; charset='.$outputencoding:''));
|
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
|
// Ajout directives pour resoudre bug IE
|
||||||
//header('Cache-Control: Public, must-revalidate');
|
//header('Cache-Control: Public, must-revalidate');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user