Merge pull request #3569 from tysauron/patch-5

For not error Undefined property: stdClass::$MAIN_AGENDA_EXPORT_CACHE
This commit is contained in:
Laurent Destailleur 2015-09-23 18:26:20 +02:00
commit 1c421a2fd2

View File

@ -59,12 +59,14 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
fwrite($calfileh,"CALSCALE:GREGORIAN\n");
fwrite($calfileh,"X-WR-CALNAME:".$encoding.format_cal($format,$title)."\n");
fwrite($calfileh,"X-WR-CALDESC:".$encoding.format_cal($format,$desc)."\n");
$hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
$mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
//fwrite($calfileh,"X-WR-TIMEZONE:Europe/Paris\n");
if (! empty($conf->global->MAIN_AGENDA_EXPORT_CACHE)
&& $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60) fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
&& $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60){
$hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
$mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
}
foreach ($events_array as $date => $event)
{