A somewhat unsatisfactory hack, so that I can import a calendar from

Evolution.  It does work, but it is not the final answer.
This commit is contained in:
Andrew McMillan 2007-01-08 17:43:05 +13:00
parent 5ddf4daefa
commit d276b1006d

View File

@ -63,7 +63,11 @@ foreach( $events AS $k => $event ) {
$request->user_no, $event_path, $etag, $icalendar, $ic->type, $session->user_no );
if ( !$qry->Exec("PUT") ) rollback_on_error();
$sql = ( $ic->tz_locn == '' ? '' : "SET TIMEZONE TO ".qpg($ic->tz_locn).";" );
$sql = "";
if ( preg_match(':^(Africa|America|Antarctica|Arctic|Asia|Atlantic|Australia|Brazil|Canada|Chile|Etc|Europe|Indian|Mexico|Mideast|Pacific|US)/[a-z]+$:i', $ic->tz_locn ) ) {
// We only set the timezone if it looks reasonable enough for us
$sql = ( $ic->tz_locn == '' ? '' : "SET TIMEZONE TO ".qpg($ic->tz_locn).";" );
}
$dtstart = $ic->Get('dtstart');
if ( (!isset($dtstart) || $dtstart == "") && $ic->Get('due') != "" ) {