* Calendar: fixed not working "use event TZ" pref for iCal exports and allways use event TZ for calendar notifications (NOT use file export pref.)

This commit is contained in:
Ralf Becker 2011-04-11 10:59:59 +00:00
parent fd56c47151
commit 440bcb1235
2 changed files with 10 additions and 11 deletions

View File

@ -748,7 +748,13 @@ class calendar_boupdate extends calendar_bo
case 'ical':
if ($method == 'REQUEST')
{
$ics = ExecMethod2('calendar.calendar_ical.exportVCal',$event['id'],'2.0',$method);
if (is_null($ics))
{
$calendar_ical = new calendar_ical();
$calendar_ical->setSupportedFields('groupdav'); // full iCal fields+event TZ
$ics = $calendar_ical->exportVCal($event['id'],'2.0',$method);
unset($calendar_ical);
}
$attachment = array( 'string' => $ics,
'filename' => 'cal.ics',
'encoding' => '8bit',

View File

@ -2067,18 +2067,11 @@ class calendar_ical extends calendar_boupdate
break;
case 'file': // used outside of SyncML, eg. by the calendar itself ==> all possible fields
if (isset($this->cal_prefs['export_timezone']))
if ($this->cal_prefs['export_timezone'])
{
switch ($this->cal_prefs['export_timezone'])
{
case 1:
$this->tzid = false; // use event's TZ
break;
default:
$this->tzid = $this->cal_prefs['export_timezone'];
}
$this->tzid = $this->cal_prefs['export_timezone'];
}
else
else // not set or '0' = use event TZ
{
$this->tzid = false; // use event's TZ
}