mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-11-29 08:56:03 +00:00
Create the Timezone if we need to
Detected now due to a change from a few years ago to use a clean database for each set of tests.
This commit is contained in:
1 parent
ec9159fd69
commit
d2d36399d3
2 files changed
+17
-1
No files matched your search
@@ -198,6 +198,18 @@ class WritableCollection extends DAVResource {
|
||||
$qry->QDo('SET TIMEZONE TO \''.$olson."'" );
|
||||
$last_olson = $olson;
|
||||
}
|
||||
|
||||
$params = array( ':tzid' => $tzid);
|
||||
$qry = new AwlQuery('SELECT 1 FROM timezones WHERE tzid = :tzid', $params );
|
||||
if ( $qry->Exec('PUT',__LINE__,__FILE__) && $qry->rows() == 0 ) {
|
||||
$params[':olson_name'] = $olson;
|
||||
$params[':vtimezone'] = (isset($tz) ? $tz->Render() : null );
|
||||
$params[':last_modified'] = (isset($tz) ? $tz->GetPValue('LAST-MODIFIED') : null );
|
||||
if ( empty($params[':last_modified']) ) {
|
||||
$params[':last_modified'] = gmdate('Ymd\THis\Z');
|
||||
}
|
||||
$qry->QDo('INSERT INTO timezones (tzid, olson_name, active, vtimezone, last_modified) VALUES(:tzid,:olson_name,false,:vtimezone,:last_modified)', $params );
|
||||
}
|
||||
}
|
||||
|
||||
$created = $first->GetPValue('CREATED');
|
||||
@@ -239,7 +251,8 @@ EOSQL;
|
||||
}
|
||||
else {
|
||||
$sql = <<<EOSQL
|
||||
UPDATE calendar_item SET dav_etag=:etag, uid=:uid, dtstamp=:dtstamp,
|
||||
UPDATE calendar_item
|
||||
SET dav_etag=:etag, uid=:uid, dtstamp=:dtstamp,
|
||||
dtstart=:dtstart, dtstart_orig=:dtstart_orig, dtend=$dtend,
|
||||
dtend_orig=:dtend_orig, summary=:summary, location=:location, class=:class,
|
||||
transp=:transp, description=:description, rrule=:rrule, tz_id=:tzid,
|
||||
|
||||
Reference in new issue
Block a user