summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/caldav/caldavbackend.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-16 21:01:27 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-16 21:01:27 +0100
commite4568234a5c2e7f597d511e8fd1cbafa409bf29f (patch)
tree7fa138cbbb0ff6ac91fed66ff450448fb9d0756d /apps/dav/lib/caldav/caldavbackend.php
parenta0b649442cadec1f9b1d97bcd6b0c3e1289671d6 (diff)
downloadnextcloud-server-e4568234a5c2e7f597d511e8fd1cbafa409bf29f.tar.gz
nextcloud-server-e4568234a5c2e7f597d511e8fd1cbafa409bf29f.zip
Use uri as displayname
Diffstat (limited to 'apps/dav/lib/caldav/caldavbackend.php')
-rw-r--r--apps/dav/lib/caldav/caldavbackend.php26
1 files changed, 7 insertions, 19 deletions
diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php
index 19bbc6cb93d..08a2a70c56d 100644
--- a/apps/dav/lib/caldav/caldavbackend.php
+++ b/apps/dav/lib/caldav/caldavbackend.php
@@ -169,19 +169,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return void
*/
function createCalendar($principalUri, $calendarUri, array $properties) {
- $fieldNames = [
- 'principaluri',
- 'uri',
- 'synctoken',
- 'transparent',
- 'components'
- ];
$values = [
'principaluri' => $principalUri,
'uri' => $calendarUri,
'synctoken' => 1,
'transparent' => 0,
- 'components' => 'VEVENT,VTODO'
+ 'components' => 'VEVENT,VTODO',
+ 'displayname' => $calendarUri
];
// Default value
@@ -199,22 +193,16 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
foreach($this->propertyMap as $xmlName=>$dbName) {
if (isset($properties[$xmlName])) {
-
$values[$dbName] = $properties[$xmlName];
- $fieldNames[] = $dbName;
}
}
$query = $this->db->getQueryBuilder();
- $query->insert('calendars')
- ->values([
- 'principaluri' => $query->createNamedParameter($values['principaluri']),
- 'uri' => $query->createNamedParameter($values['uri']),
- 'synctoken' => $query->createNamedParameter($values['synctoken']),
- 'transparent' => $query->createNamedParameter($values['transparent']),
- 'components' => $query->createNamedParameter($values['components']),
- ])
- ->execute();
+ $query->insert('calendars');
+ foreach($values as $column => $value) {
+ $query->setValue($column, $query->createNamedParameter($value));
+ }
+ $query->execute();
}
/**