mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-25 02:34:17 +00:00
Cope better when we're given a timezone that we're not given a definition for.
This commit is contained in:
parent
c53ee7e240
commit
97577a6e9d
@ -279,6 +279,7 @@ function import_collection( $ics_content, $user_no, $path, $caldav_context ) {
|
|||||||
if ( isset($resource[$tzid]) ) {
|
if ( isset($resource[$tzid]) ) {
|
||||||
$tz = $resource[$tzid];
|
$tz = $resource[$tzid];
|
||||||
$tz_locn = $tz->GetPValue('X-LIC-LOCATION');
|
$tz_locn = $tz->GetPValue('X-LIC-LOCATION');
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
unset($tz);
|
unset($tz);
|
||||||
unset($tz_locn);
|
unset($tz_locn);
|
||||||
@ -294,12 +295,10 @@ function import_collection( $ics_content, $user_no, $path, $caldav_context ) {
|
|||||||
$sql .= ( $tz_locn == '' ? '' : "SET TIMEZONE TO ".qpg($tz_locn).";" );
|
$sql .= ( $tz_locn == '' ? '' : "SET TIMEZONE TO ".qpg($tz_locn).";" );
|
||||||
$last_tz_locn = $tz_locn;
|
$last_tz_locn = $tz_locn;
|
||||||
}
|
}
|
||||||
if ( isset($tz) ) {
|
$qry = new PgQuery("SELECT tz_locn FROM time_zone WHERE tz_id = ?", $tzid );
|
||||||
$qry = new PgQuery("SELECT tz_locn FROM time_zone WHERE tz_id = ?", $tzid );
|
if ( $qry->Exec() && $qry->rows == 0 ) {
|
||||||
if ( $qry->Exec() && $qry->rows == 0 ) {
|
$qry = new PgQuery("INSERT INTO time_zone (tz_id, tz_locn, tz_spec) VALUES(?,?,?)", $tzid, $tz_locn, (isset($tz) ? $tz->Render() : null) );
|
||||||
$qry = new PgQuery("INSERT INTO time_zone (tz_id, tz_locn, tz_spec) VALUES(?,?,?)", $tzid, $tz_locn, $tz->Render() );
|
$qry->Exec();
|
||||||
$qry->Exec();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ( !isset($tz_locn) || $tz_locn == "" ) $tz_locn = $tzid;
|
if ( !isset($tz_locn) || $tz_locn == "" ) $tz_locn = $tzid;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user