Don't complain if the event includes an unused timezone.

This commit is contained in:
Andrew McMillan 2010-04-26 23:27:15 +12:00
parent 8223e2e9f7
commit 8fbb5cf3a2

View File

@ -140,8 +140,6 @@ VALUES( :user_no, :parent_container, :dav_name, :dav_etag, :dav_displayname, TRU
*/
function public_events_only( $user_no, $dav_name ) {
global $c;
// Not supported until DB versions from 1.001.010
if ( $c->schema_version < 1001.010 ) return false;
$sql = 'SELECT public_events_only FROM collection WHERE dav_name = :dav_name';
@ -845,9 +843,10 @@ function write_resource( $user_no, $path, $caldav_data, $collection_id, $author,
/** Calculate what timezone to set, first, if possible */
$last_tz_locn = 'Turkmenikikamukau';
$last_tz_locn = 'Turkmenikikamukau'; // I really hope this location doesn't exist!
$tzid = $first->GetPParamValue('DTSTART','TZID');
if ( !isset($tzid) || $tzid == '' ) $tzid = $first->GetPParamValue('DUE','TZID');
if ( isset($tzid) && $tzid != '' ) {
$timezones = $ic->GetComponents('VTIMEZONE');
foreach( $timezones AS $k => $tz ) {
if ( $tz->GetPValue('TZID') != $tzid ) {
@ -855,7 +854,7 @@ function write_resource( $user_no, $path, $caldav_data, $collection_id, $author,
* We'll pretend they didn't forget to give us a TZID and that they
* really hope the server is running in the timezone they supplied... but be noisy about it.
*/
dbg_error_log( 'ERROR', ' Event includes TZID[%s] but users TZID[%s]!', $tz->GetPValue('TZID'), $tzid );
dbg_error_log( 'ERROR', ' Event includes TZID[%s] but uses TZID[%s]!', $tz->GetPValue('TZID'), $tzid );
$tzid = $tz->GetPValue('TZID');
}
// This is the one
@ -891,6 +890,7 @@ function write_resource( $user_no, $path, $caldav_data, $collection_id, $author,
if ( !isset($tz_locn) || $tz_locn == '' ) $tz_locn = $tzid;
}
}
$created = $first->GetPValue('CREATED');
if ( $created == '00001231T000000Z' ) $created = '20001231T000000Z';