diff options
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/l10n/cs.js | 3 | ||||
-rw-r--r-- | apps/dav/l10n/cs.json | 3 | ||||
-rw-r--r-- | apps/dav/l10n/de_DE.js | 3 | ||||
-rw-r--r-- | apps/dav/l10n/de_DE.json | 3 | ||||
-rw-r--r-- | apps/dav/l10n/pl.js | 3 | ||||
-rw-r--r-- | apps/dav/l10n/pl.json | 3 | ||||
-rw-r--r-- | apps/dav/l10n/tr.js | 3 | ||||
-rw-r--r-- | apps/dav/l10n/tr.json | 3 | ||||
-rw-r--r-- | apps/dav/l10n/zh_HK.js | 3 | ||||
-rw-r--r-- | apps/dav/l10n/zh_HK.json | 3 | ||||
-rw-r--r-- | apps/dav/l10n/zh_TW.js | 3 | ||||
-rw-r--r-- | apps/dav/l10n/zh_TW.json | 3 | ||||
-rw-r--r-- | apps/dav/lib/CalDAV/Activity/Provider/Event.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php | 14 | ||||
-rw-r--r-- | apps/dav/src/views/CalDavSettings.vue | 91 |
15 files changed, 93 insertions, 52 deletions
diff --git a/apps/dav/l10n/cs.js b/apps/dav/l10n/cs.js index e9406f6c3a2..6a8bdea52e8 100644 --- a/apps/dav/l10n/cs.js +++ b/apps/dav/l10n/cs.js @@ -156,6 +156,9 @@ OC.L10N.register( "Saturday" : "sobota", "Sunday" : "neděle", "Save" : "Uložit", + "Failed to load availability" : "Nepodařilo se načíst dostupnost", + "Saved availability" : "Uložena dostupnost", + "Failed to save availability" : "Nepodařilo se uložit dostupnost", "Calendar server" : "Kalendářový server", "Send invitations to attendees" : "Poslat pozvánky na adresy účastníků", "Automatically generate a birthday calendar" : "Automaticky vytvořit kalendář s narozeninami", diff --git a/apps/dav/l10n/cs.json b/apps/dav/l10n/cs.json index 66a899594d3..05ed95c0abd 100644 --- a/apps/dav/l10n/cs.json +++ b/apps/dav/l10n/cs.json @@ -154,6 +154,9 @@ "Saturday" : "sobota", "Sunday" : "neděle", "Save" : "Uložit", + "Failed to load availability" : "Nepodařilo se načíst dostupnost", + "Saved availability" : "Uložena dostupnost", + "Failed to save availability" : "Nepodařilo se uložit dostupnost", "Calendar server" : "Kalendářový server", "Send invitations to attendees" : "Poslat pozvánky na adresy účastníků", "Automatically generate a birthday calendar" : "Automaticky vytvořit kalendář s narozeninami", diff --git a/apps/dav/l10n/de_DE.js b/apps/dav/l10n/de_DE.js index 677c38aaf82..b906c0e5465 100644 --- a/apps/dav/l10n/de_DE.js +++ b/apps/dav/l10n/de_DE.js @@ -156,6 +156,9 @@ OC.L10N.register( "Saturday" : "Samstag", "Sunday" : "Sonntag", "Save" : "Speichern", + "Failed to load availability" : "Laden der Verfügbarkeit fehlgeschlagen", + "Saved availability" : "Verfügbarkeit gespeichert", + "Failed to save availability" : "Fehler beim Speichern der Verfügbarkeit", "Calendar server" : "Kalender-Server", "Send invitations to attendees" : "Einladungen an die Teilnehmer versenden", "Automatically generate a birthday calendar" : "Automatisch einen Kalender für Geburtstage erstellen", diff --git a/apps/dav/l10n/de_DE.json b/apps/dav/l10n/de_DE.json index ea3c15aa90f..3a3510e6c82 100644 --- a/apps/dav/l10n/de_DE.json +++ b/apps/dav/l10n/de_DE.json @@ -154,6 +154,9 @@ "Saturday" : "Samstag", "Sunday" : "Sonntag", "Save" : "Speichern", + "Failed to load availability" : "Laden der Verfügbarkeit fehlgeschlagen", + "Saved availability" : "Verfügbarkeit gespeichert", + "Failed to save availability" : "Fehler beim Speichern der Verfügbarkeit", "Calendar server" : "Kalender-Server", "Send invitations to attendees" : "Einladungen an die Teilnehmer versenden", "Automatically generate a birthday calendar" : "Automatisch einen Kalender für Geburtstage erstellen", diff --git a/apps/dav/l10n/pl.js b/apps/dav/l10n/pl.js index 93f1e06069c..9fdf7171906 100644 --- a/apps/dav/l10n/pl.js +++ b/apps/dav/l10n/pl.js @@ -156,6 +156,9 @@ OC.L10N.register( "Saturday" : "Sobota", "Sunday" : "Niedziela", "Save" : "Zapisz", + "Failed to load availability" : "Nie udało się wczytać dostępności", + "Saved availability" : "Zapisana dostępność", + "Failed to save availability" : "Nie udało się zapisać dostępności", "Calendar server" : "Serwer kalendarza", "Send invitations to attendees" : "Wyślij zaproszenia do uczestników", "Automatically generate a birthday calendar" : "Automatycznie generuj kalendarz urodzin", diff --git a/apps/dav/l10n/pl.json b/apps/dav/l10n/pl.json index 25dde4e2304..5315c3b36ed 100644 --- a/apps/dav/l10n/pl.json +++ b/apps/dav/l10n/pl.json @@ -154,6 +154,9 @@ "Saturday" : "Sobota", "Sunday" : "Niedziela", "Save" : "Zapisz", + "Failed to load availability" : "Nie udało się wczytać dostępności", + "Saved availability" : "Zapisana dostępność", + "Failed to save availability" : "Nie udało się zapisać dostępności", "Calendar server" : "Serwer kalendarza", "Send invitations to attendees" : "Wyślij zaproszenia do uczestników", "Automatically generate a birthday calendar" : "Automatycznie generuj kalendarz urodzin", diff --git a/apps/dav/l10n/tr.js b/apps/dav/l10n/tr.js index 70d3736f931..6389a90b5e9 100644 --- a/apps/dav/l10n/tr.js +++ b/apps/dav/l10n/tr.js @@ -156,6 +156,9 @@ OC.L10N.register( "Saturday" : "Cumartesi", "Sunday" : "Pazar", "Save" : "Kaydet", + "Failed to load availability" : "Uygunluk yüklenemedi", + "Saved availability" : "Uygunluk kaydedildi", + "Failed to save availability" : "Uygunluk kaydedilemedi", "Calendar server" : "Takvim sunucusu", "Send invitations to attendees" : "Katılımcılara çağrıları gönder", "Automatically generate a birthday calendar" : "Doğum günü takvimi otomatik oluşturulsun", diff --git a/apps/dav/l10n/tr.json b/apps/dav/l10n/tr.json index b1ba8a73d64..1f2d1561812 100644 --- a/apps/dav/l10n/tr.json +++ b/apps/dav/l10n/tr.json @@ -154,6 +154,9 @@ "Saturday" : "Cumartesi", "Sunday" : "Pazar", "Save" : "Kaydet", + "Failed to load availability" : "Uygunluk yüklenemedi", + "Saved availability" : "Uygunluk kaydedildi", + "Failed to save availability" : "Uygunluk kaydedilemedi", "Calendar server" : "Takvim sunucusu", "Send invitations to attendees" : "Katılımcılara çağrıları gönder", "Automatically generate a birthday calendar" : "Doğum günü takvimi otomatik oluşturulsun", diff --git a/apps/dav/l10n/zh_HK.js b/apps/dav/l10n/zh_HK.js index 737d7491564..b7656743fcf 100644 --- a/apps/dav/l10n/zh_HK.js +++ b/apps/dav/l10n/zh_HK.js @@ -156,6 +156,9 @@ OC.L10N.register( "Saturday" : "星期六", "Sunday" : "星期日", "Save" : "儲存", + "Failed to load availability" : "加載可得性失敗", + "Saved availability" : "已保存可得性", + "Failed to save availability" : "保存可得性失敗", "Calendar server" : "日曆伺服器", "Send invitations to attendees" : "發送邀請函給參加者", "Automatically generate a birthday calendar" : "自動建立生日日曆", diff --git a/apps/dav/l10n/zh_HK.json b/apps/dav/l10n/zh_HK.json index 4e48e518ae6..3cae11cedf0 100644 --- a/apps/dav/l10n/zh_HK.json +++ b/apps/dav/l10n/zh_HK.json @@ -154,6 +154,9 @@ "Saturday" : "星期六", "Sunday" : "星期日", "Save" : "儲存", + "Failed to load availability" : "加載可得性失敗", + "Saved availability" : "已保存可得性", + "Failed to save availability" : "保存可得性失敗", "Calendar server" : "日曆伺服器", "Send invitations to attendees" : "發送邀請函給參加者", "Automatically generate a birthday calendar" : "自動建立生日日曆", diff --git a/apps/dav/l10n/zh_TW.js b/apps/dav/l10n/zh_TW.js index b0d273abc34..909673e3a15 100644 --- a/apps/dav/l10n/zh_TW.js +++ b/apps/dav/l10n/zh_TW.js @@ -156,6 +156,9 @@ OC.L10N.register( "Saturday" : "週六", "Sunday" : "週日", "Save" : "儲存", + "Failed to load availability" : "載入可用性失敗", + "Saved availability" : "已儲存可用性", + "Failed to save availability" : "儲存可用性失敗", "Calendar server" : "日曆伺服器", "Send invitations to attendees" : "發送邀請函給參加者", "Automatically generate a birthday calendar" : "自動生成生日日曆", diff --git a/apps/dav/l10n/zh_TW.json b/apps/dav/l10n/zh_TW.json index 09330f45a9c..a134ffb53c4 100644 --- a/apps/dav/l10n/zh_TW.json +++ b/apps/dav/l10n/zh_TW.json @@ -154,6 +154,9 @@ "Saturday" : "週六", "Sunday" : "週日", "Save" : "儲存", + "Failed to load availability" : "載入可用性失敗", + "Saved availability" : "已儲存可用性", + "Failed to save availability" : "儲存可用性失敗", "Calendar server" : "日曆伺服器", "Send invitations to attendees" : "發送邀請函給參加者", "Automatically generate a birthday calendar" : "自動生成生日日曆", diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index 96366f54942..3ed591219af 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -88,9 +88,9 @@ class Event extends Base { $params = [ 'type' => 'calendar-event', 'id' => $eventData['id'], - 'name' => $eventData['name'], - + 'name' => trim($eventData['name']) !== '' ? $eventData['name'] : $this->l->t('Untitled event'), ]; + if (isset($eventData['link']) && is_array($eventData['link']) && $this->appManager->isEnabledForUser('calendar')) { try { // The calendar app needs to be manually loaded for the routes to be loaded diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index 4a1205e8606..eaa7f1bc2d2 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -115,30 +116,27 @@ class CommentPropertiesPlugin extends ServerPlugin { return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId()); }); - $propFind->handle(self::PROPERTY_NAME_HREF, function () use ($node) { + $propFind->handle(self::PROPERTY_NAME_HREF, function () use ($node): ?string { return $this->getCommentsLink($node); }); - $propFind->handle(self::PROPERTY_NAME_UNREAD, function () use ($node): ?bool { + $propFind->handle(self::PROPERTY_NAME_UNREAD, function () use ($node): ?int { return $this->cachedUnreadCount[$node->getId()] ?? $this->getUnreadCount($node); }); } /** * Returns a reference to the comments node - * - * @return array|string|null */ - public function getCommentsLink(Node $node) { + public function getCommentsLink(Node $node): ?string { $href = $this->server->getBaseUri(); $entryPoint = strpos($href, '/remote.php/'); if ($entryPoint === false) { // in case we end up somewhere else, unexpectedly. return null; } - $commentsPart = 'dav/comments/files/' . rawurldecode($node->getId()); - $href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/')); - return $href; + $commentsPart = 'dav/comments/files/' . rawurldecode((string)$node->getId()); + return substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/')); } /** diff --git a/apps/dav/src/views/CalDavSettings.vue b/apps/dav/src/views/CalDavSettings.vue index f1d39abee42..714fc9a4d32 100644 --- a/apps/dav/src/views/CalDavSettings.vue +++ b/apps/dav/src/views/CalDavSettings.vue @@ -1,20 +1,17 @@ <template> - <div class="section"> - <h2>{{ $t('dav', 'Calendar server') }}</h2> + <SettingsSection :title="$t('dav', 'Calendar server')" + :doc-url="userSyncCalendarsDocUrl"> <!-- Can use v-html as: - $t passes the translated string through DOMPurify.sanitize, - replacement strings are not user-controlled. --> <!-- eslint-disable-next-line vue/no-v-html --> <p class="settings-hint" v-html="hint" /> <p> - <input id="caldavSendInvitations" - v-model="sendInvitations" - type="checkbox" - class="checkbox"> - <label for="caldavSendInvitations"> + <CheckboxRadioSwitch id="caldavSendInvitations" + :checked.sync="sendInvitations" + type="switch"> {{ $t('dav', 'Send invitations to attendees') }} - </label> - <br> + </CheckboxRadioSwitch> <!-- Can use v-html as: - $t passes the translated string through DOMPurify.sanitize, - replacement strings are not user-controlled. --> @@ -22,14 +19,12 @@ <em v-html="sendInvitationsHelpText" /> </p> <p> - <input id="caldavGenerateBirthdayCalendar" - v-model="generateBirthdayCalendar" - type="checkbox" + <CheckboxRadioSwitch id="caldavGenerateBirthdayCalendar" + :checked.sync="generateBirthdayCalendar" + type="switch" class="checkbox"> - <label for="caldavGenerateBirthdayCalendar"> {{ $t('dav', 'Automatically generate a birthday calendar') }} - </label> - <br> + </CheckboxRadioSwitch> <em> {{ $t('dav', 'Birthday calendars will be generated by a background job.') }} </em> @@ -39,14 +34,11 @@ </em> </p> <p> - <input id="caldavSendEventReminders" - v-model="sendEventReminders" - type="checkbox" - class="checkbox"> - <label for="caldavSendEventReminders"> + <CheckboxRadioSwitch id="caldavSendEventReminders" + :checked.sync="sendEventReminders" + type="switch"> {{ $t('dav', 'Send notifications for events') }} - </label> - <br> + </CheckboxRadioSwitch> <!-- Can use v-html as: - $t passes the translated string through DOMPurify.sanitize, - replacement strings are not user-controlled. --> @@ -58,47 +50,47 @@ </em> </p> <p class="indented"> - <input id="caldavSendEventRemindersToSharedGroupMembers" - v-model="sendEventRemindersToSharedGroupMembers" - type="checkbox" - class="checkbox" + <CheckboxRadioSwitch id="caldavSendEventRemindersToSharedGroupMembers" + :checked.sync="sendEventRemindersToSharedGroupMembers" + type="switch" :disabled="!sendEventReminders"> - <label for="caldavSendEventRemindersToSharedGroupMembers"> {{ $t('dav', 'Send reminder notifications to calendar sharees as well' ) }} - </label> - <br> + </CheckboxRadioSwitch> <em> {{ $t('dav', 'Reminders are always sent to organizers and attendees.' ) }} </em> </p> <p class="indented"> - <input id="caldavSendEventRemindersPush" - v-model="sendEventRemindersPush" - type="checkbox" - class="checkbox" + <CheckboxRadioSwitch id="caldavSendEventRemindersPush" + :checked.sync="sendEventRemindersPush" + type="switch" :disabled="!sendEventReminders"> - <label for="caldavSendEventRemindersPush"> {{ $t('dav', 'Enable notifications for events via push') }} - </label> + </CheckboxRadioSwitch> </p> - </div> + </SettingsSection> </template> -<style lang="scss" scoped> - .indented { - padding-left: 28px; - } -</style> - <script> import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' import { loadState } from '@nextcloud/initial-state' +import SettingsSection from '@nextcloud/vue/dist/Components/SettingsSection' +import CheckboxRadioSwitch from '@nextcloud/vue/dist/Components/CheckboxRadioSwitch' const userSyncCalendarsDocUrl = loadState('dav', 'userSyncCalendarsDocUrl', '#') export default { name: 'CalDavSettings', + components: { + CheckboxRadioSwitch, + SettingsSection, + }, + data() { + return { + userSyncCalendarsDocUrl, + } + }, computed: { hint() { const translated = this.$t( @@ -151,3 +143,18 @@ export default { }, } </script> + +<style scoped> + .indented { + padding-left: 28px; + } + /** Use deep selector to affect v-html */ + * >>> a { + text-decoration: underline; + } + .settings-hint { + margin-top: -.2em; + margin-bottom: 1em; + opacity: .7; + } +</style> |