diff options
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/l10n/cs.js | 1 | ||||
-rw-r--r-- | apps/dav/l10n/cs.json | 1 | ||||
-rw-r--r-- | apps/dav/l10n/pl.js | 1 | ||||
-rw-r--r-- | apps/dav/l10n/pl.json | 1 | ||||
-rw-r--r-- | apps/dav/l10n/tr.js | 2 | ||||
-rw-r--r-- | apps/dav/l10n/tr.json | 2 | ||||
-rw-r--r-- | apps/dav/l10n/zh_TW.js | 1 | ||||
-rw-r--r-- | apps/dav/l10n/zh_TW.json | 1 | ||||
-rw-r--r-- | apps/dav/lib/UserMigration/CalendarMigrator.php | 24 | ||||
-rw-r--r-- | apps/dav/lib/UserMigration/ContactsMigrator.php | 38 |
10 files changed, 42 insertions, 30 deletions
diff --git a/apps/dav/l10n/cs.js b/apps/dav/l10n/cs.js index 5b7ea906260..69d0de5f453 100644 --- a/apps/dav/l10n/cs.js +++ b/apps/dav/l10n/cs.js @@ -137,6 +137,7 @@ OC.L10N.register( "Due on %s by %s" : "Termín do %s od %s", "Due on %s" : "Termín do %s", "Migrated calendar (%1$s)" : "Přesunut kalendář (%1$s)", + "Calendars including events, details and attendees" : "Kalendáře včetně událostí, podrobností a účastníků", "Contacts and groups" : "Kontakty a skupiny", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV endpoint", diff --git a/apps/dav/l10n/cs.json b/apps/dav/l10n/cs.json index 46d083fa035..c3e555519be 100644 --- a/apps/dav/l10n/cs.json +++ b/apps/dav/l10n/cs.json @@ -135,6 +135,7 @@ "Due on %s by %s" : "Termín do %s od %s", "Due on %s" : "Termín do %s", "Migrated calendar (%1$s)" : "Přesunut kalendář (%1$s)", + "Calendars including events, details and attendees" : "Kalendáře včetně událostí, podrobností a účastníků", "Contacts and groups" : "Kontakty a skupiny", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV endpoint", diff --git a/apps/dav/l10n/pl.js b/apps/dav/l10n/pl.js index 03c14a1b50b..e9fd91268fc 100644 --- a/apps/dav/l10n/pl.js +++ b/apps/dav/l10n/pl.js @@ -137,6 +137,7 @@ OC.L10N.register( "Due on %s by %s" : "Na dzień %s w %s", "Due on %s" : "Na dzień %s", "Migrated calendar (%1$s)" : "Przeniesiony kalendarz (%1$s)", + "Calendars including events, details and attendees" : "Kalendarze zawierające wydarzenia, szczegóły i uczestników", "Contacts and groups" : "Kontakty i grupy", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Adres WebDAV", diff --git a/apps/dav/l10n/pl.json b/apps/dav/l10n/pl.json index 147447993f1..4ea51401e82 100644 --- a/apps/dav/l10n/pl.json +++ b/apps/dav/l10n/pl.json @@ -135,6 +135,7 @@ "Due on %s by %s" : "Na dzień %s w %s", "Due on %s" : "Na dzień %s", "Migrated calendar (%1$s)" : "Przeniesiony kalendarz (%1$s)", + "Calendars including events, details and attendees" : "Kalendarze zawierające wydarzenia, szczegóły i uczestników", "Contacts and groups" : "Kontakty i grupy", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Adres WebDAV", diff --git a/apps/dav/l10n/tr.js b/apps/dav/l10n/tr.js index 8f9f15d1de2..aa21694e64e 100644 --- a/apps/dav/l10n/tr.js +++ b/apps/dav/l10n/tr.js @@ -137,6 +137,8 @@ OC.L10N.register( "Due on %s by %s" : "%s tarihine kadar %s tarafından", "Due on %s" : "%s tarihine kadar", "Migrated calendar (%1$s)" : "Aktarılmış takvim (%1$s)", + "Calendars including events, details and attendees" : "Etkinlikler, bilgiler ve katılımcılar ile takvimler", + "Contacts and groups" : "Kişiler ve gruplar", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV bağlantı noktası", "Availability" : "Kullanılabilirlik", diff --git a/apps/dav/l10n/tr.json b/apps/dav/l10n/tr.json index 7b640b0178b..b80217bfa8d 100644 --- a/apps/dav/l10n/tr.json +++ b/apps/dav/l10n/tr.json @@ -135,6 +135,8 @@ "Due on %s by %s" : "%s tarihine kadar %s tarafından", "Due on %s" : "%s tarihine kadar", "Migrated calendar (%1$s)" : "Aktarılmış takvim (%1$s)", + "Calendars including events, details and attendees" : "Etkinlikler, bilgiler ve katılımcılar ile takvimler", + "Contacts and groups" : "Kişiler ve gruplar", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV bağlantı noktası", "Availability" : "Kullanılabilirlik", diff --git a/apps/dav/l10n/zh_TW.js b/apps/dav/l10n/zh_TW.js index 621c28b18bb..414eaad4c01 100644 --- a/apps/dav/l10n/zh_TW.js +++ b/apps/dav/l10n/zh_TW.js @@ -137,6 +137,7 @@ OC.L10N.register( "Due on %s by %s" : "到期於 %s 由 %s", "Due on %s" : "到期於 %s", "Migrated calendar (%1$s)" : "已導入的行事曆 (%1$s)", + "Calendars including events, details and attendees" : "行事曆,包含事件、詳細資訊及參與者", "Contacts and groups" : "聯絡人與群組", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV 端點", diff --git a/apps/dav/l10n/zh_TW.json b/apps/dav/l10n/zh_TW.json index ff5ee940010..29dd4133fc5 100644 --- a/apps/dav/l10n/zh_TW.json +++ b/apps/dav/l10n/zh_TW.json @@ -135,6 +135,7 @@ "Due on %s by %s" : "到期於 %s 由 %s", "Due on %s" : "到期於 %s", "Migrated calendar (%1$s)" : "已導入的行事曆 (%1$s)", + "Calendars including events, details and attendees" : "行事曆,包含事件、詳細資訊及參與者", "Contacts and groups" : "聯絡人與群組", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV 端點", diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php index 908b0a564d1..d94e3ec109e 100644 --- a/apps/dav/lib/UserMigration/CalendarMigrator.php +++ b/apps/dav/lib/UserMigration/CalendarMigrator.php @@ -225,18 +225,20 @@ class CalendarMigrator implements IMigrator { $output->writeln('No calendars to export…'); } - /** - * @var string $name - * @var VCalendar $vCalendar - */ - foreach ($calendarExports as ['name' => $name, 'vCalendar' => $vCalendar]) { - // Set filename to sanitized calendar name appended with the date - $filename = preg_replace('/[^a-zA-Z0-9-_ ]/um', '', $name) . '_' . date('Y-m-d') . CalendarMigrator::FILENAME_EXT; - $exportPath = CalendarMigrator::EXPORT_ROOT . $filename; - - if ($exportDestination->addFileContents($exportPath, $vCalendar->serialize()) === false) { - throw new CalendarMigratorException('Could not export calendars'); + try { + /** + * @var string $name + * @var VCalendar $vCalendar + */ + foreach ($calendarExports as ['name' => $name, 'vCalendar' => $vCalendar]) { + // Set filename to sanitized calendar name appended with the date + $filename = preg_replace('/[^a-zA-Z0-9-_ ]/um', '', $name) . '_' . date('Y-m-d') . CalendarMigrator::FILENAME_EXT; + $exportPath = CalendarMigrator::EXPORT_ROOT . $filename; + + $exportDestination->addFileContents($exportPath, $vCalendar->serialize()); } + } catch (Throwable $e) { + throw new CalendarMigratorException('Could not export calendars', 0, $e); } } diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index 99eea2700a5..065ef05ceea 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -205,26 +205,26 @@ class ContactsMigrator implements IMigrator { $output->writeln('No contacts to export…'); } - /** - * @var string $name - * @var string $displayName - * @var ?string $description - * @var VCard[] $vCards - */ - foreach ($addressBookExports as ['name' => $name, 'displayName' => $displayName, 'description' => $description, 'vCards' => $vCards]) { - // Set filename to sanitized address book name appended with the date - $basename = preg_replace('/[^a-zA-Z0-9-_ ]/um', '', $name) . '_' . date('Y-m-d'); - $exportPath = ContactsMigrator::PATH_ROOT . $basename . '.' . ContactsMigrator::FILENAME_EXT; - $metadataExportPath = ContactsMigrator::PATH_ROOT . $basename . '.' . ContactsMigrator::METADATA_EXT; - - if ($exportDestination->addFileContents($exportPath, $this->serializeCards($vCards)) === false) { - throw new ContactsMigratorException('Could not export address book'); - } - - $metadata = array_filter(['displayName' => $displayName, 'description' => $description]); - if ($exportDestination->addFileContents($metadataExportPath, json_encode($metadata)) === false) { - throw new ContactsMigratorException('Could not export address book metadata'); + try { + /** + * @var string $name + * @var string $displayName + * @var ?string $description + * @var VCard[] $vCards + */ + foreach ($addressBookExports as ['name' => $name, 'displayName' => $displayName, 'description' => $description, 'vCards' => $vCards]) { + // Set filename to sanitized address book name appended with the date + $basename = preg_replace('/[^a-zA-Z0-9-_ ]/um', '', $name) . '_' . date('Y-m-d'); + $exportPath = ContactsMigrator::PATH_ROOT . $basename . '.' . ContactsMigrator::FILENAME_EXT; + $metadataExportPath = ContactsMigrator::PATH_ROOT . $basename . '.' . ContactsMigrator::METADATA_EXT; + + $exportDestination->addFileContents($exportPath, $this->serializeCards($vCards)); + + $metadata = array_filter(['displayName' => $displayName, 'description' => $description]); + $exportDestination->addFileContents($metadataExportPath, json_encode($metadata)); } + } catch (Throwable $e) { + throw new CalendarMigratorException('Could not export address book', 0, $e); } } |