mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-31 03:34:18 +00:00
Don't complain if the event includes an unused timezone.
This commit is contained in:
parent
8223e2e9f7
commit
8fbb5cf3a2
@ -140,8 +140,6 @@ VALUES( :user_no, :parent_container, :dav_name, :dav_etag, :dav_displayname, TRU
|
|||||||
*/
|
*/
|
||||||
function public_events_only( $user_no, $dav_name ) {
|
function public_events_only( $user_no, $dav_name ) {
|
||||||
global $c;
|
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';
|
$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 */
|
/** 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');
|
$tzid = $first->GetPParamValue('DTSTART','TZID');
|
||||||
if ( !isset($tzid) || $tzid == '' ) $tzid = $first->GetPParamValue('DUE','TZID');
|
if ( !isset($tzid) || $tzid == '' ) $tzid = $first->GetPParamValue('DUE','TZID');
|
||||||
|
if ( isset($tzid) && $tzid != '' ) {
|
||||||
$timezones = $ic->GetComponents('VTIMEZONE');
|
$timezones = $ic->GetComponents('VTIMEZONE');
|
||||||
foreach( $timezones AS $k => $tz ) {
|
foreach( $timezones AS $k => $tz ) {
|
||||||
if ( $tz->GetPValue('TZID') != $tzid ) {
|
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
|
* 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.
|
* 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');
|
$tzid = $tz->GetPValue('TZID');
|
||||||
}
|
}
|
||||||
// This is the one
|
// 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;
|
if ( !isset($tz_locn) || $tz_locn == '' ) $tz_locn = $tzid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$created = $first->GetPValue('CREATED');
|
$created = $first->GetPValue('CREATED');
|
||||||
if ( $created == '00001231T000000Z' ) $created = '20001231T000000Z';
|
if ( $created == '00001231T000000Z' ) $created = '20001231T000000Z';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user