diff options
Diffstat (limited to 'apps/dav')
29 files changed, 126 insertions, 127 deletions
diff --git a/apps/dav/composer/composer/autoload_classmap.php b/apps/dav/composer/composer/autoload_classmap.php index 081f334a4f9..b1b01885eef 100644 --- a/apps/dav/composer/composer/autoload_classmap.php +++ b/apps/dav/composer/composer/autoload_classmap.php @@ -212,11 +212,8 @@ return array( 'OCA\\DAV\\RootCollection' => $baseDir . '/../lib/RootCollection.php', 'OCA\\DAV\\Search\\ACalendarSearchProvider' => $baseDir . '/../lib/Search/ACalendarSearchProvider.php', 'OCA\\DAV\\Search\\ContactsSearchProvider' => $baseDir . '/../lib/Search/ContactsSearchProvider.php', - 'OCA\\DAV\\Search\\ContactsSearchResultEntry' => $baseDir . '/../lib/Search/ContactsSearchResultEntry.php', 'OCA\\DAV\\Search\\EventsSearchProvider' => $baseDir . '/../lib/Search/EventsSearchProvider.php', - 'OCA\\DAV\\Search\\EventsSearchResultEntry' => $baseDir . '/../lib/Search/EventsSearchResultEntry.php', 'OCA\\DAV\\Search\\TasksSearchProvider' => $baseDir . '/../lib/Search/TasksSearchProvider.php', - 'OCA\\DAV\\Search\\TasksSearchResultEntry' => $baseDir . '/../lib/Search/TasksSearchResultEntry.php', 'OCA\\DAV\\Server' => $baseDir . '/../lib/Server.php', 'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir . '/../lib/Settings/CalDAVSettings.php', 'OCA\\DAV\\Storage\\PublicOwnerWrapper' => $baseDir . '/../lib/Storage/PublicOwnerWrapper.php', diff --git a/apps/dav/composer/composer/autoload_static.php b/apps/dav/composer/composer/autoload_static.php index 3bfdb3b8628..ccd0d41d68b 100644 --- a/apps/dav/composer/composer/autoload_static.php +++ b/apps/dav/composer/composer/autoload_static.php @@ -227,11 +227,8 @@ class ComposerStaticInitDAV 'OCA\\DAV\\RootCollection' => __DIR__ . '/..' . '/../lib/RootCollection.php', 'OCA\\DAV\\Search\\ACalendarSearchProvider' => __DIR__ . '/..' . '/../lib/Search/ACalendarSearchProvider.php', 'OCA\\DAV\\Search\\ContactsSearchProvider' => __DIR__ . '/..' . '/../lib/Search/ContactsSearchProvider.php', - 'OCA\\DAV\\Search\\ContactsSearchResultEntry' => __DIR__ . '/..' . '/../lib/Search/ContactsSearchResultEntry.php', 'OCA\\DAV\\Search\\EventsSearchProvider' => __DIR__ . '/..' . '/../lib/Search/EventsSearchProvider.php', - 'OCA\\DAV\\Search\\EventsSearchResultEntry' => __DIR__ . '/..' . '/../lib/Search/EventsSearchResultEntry.php', 'OCA\\DAV\\Search\\TasksSearchProvider' => __DIR__ . '/..' . '/../lib/Search/TasksSearchProvider.php', - 'OCA\\DAV\\Search\\TasksSearchResultEntry' => __DIR__ . '/..' . '/../lib/Search/TasksSearchResultEntry.php', 'OCA\\DAV\\Server' => __DIR__ . '/..' . '/../lib/Server.php', 'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__ . '/..' . '/../lib/Settings/CalDAVSettings.php', 'OCA\\DAV\\Storage\\PublicOwnerWrapper' => __DIR__ . '/..' . '/../lib/Storage/PublicOwnerWrapper.php', diff --git a/apps/dav/l10n/cs.js b/apps/dav/l10n/cs.js index 7e23689cefc..5c93709d8e6 100644 --- a/apps/dav/l10n/cs.js +++ b/apps/dav/l10n/cs.js @@ -80,8 +80,12 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Váš %s potřebuje být nastavený aby používal HTTPS, aby bylo možné používat CalDAV a CardDAV s iOS/macOS.", "Configures a CalDAV account" : "Nastaví CalDAV účet", "Configures a CardDAV account" : "Nastaví CardDAV účet", + "Events" : "Události", "Tasks" : "Úkoly", "Untitled task" : "Nepojmenovaný úkol", + "Completed on %s" : "Dokončeno %s", + "Due on %s by %s" : "Termín do %s od %s", + "Due on %s" : "Termín do %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV endpoint", "There was an error updating your attendance status." : "Vyskytla se chyba při aktualizaci vašeho stavu účasti.", diff --git a/apps/dav/l10n/cs.json b/apps/dav/l10n/cs.json index 619b3a9985d..bf113804e9b 100644 --- a/apps/dav/l10n/cs.json +++ b/apps/dav/l10n/cs.json @@ -78,8 +78,12 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Váš %s potřebuje být nastavený aby používal HTTPS, aby bylo možné používat CalDAV a CardDAV s iOS/macOS.", "Configures a CalDAV account" : "Nastaví CalDAV účet", "Configures a CardDAV account" : "Nastaví CardDAV účet", + "Events" : "Události", "Tasks" : "Úkoly", "Untitled task" : "Nepojmenovaný úkol", + "Completed on %s" : "Dokončeno %s", + "Due on %s by %s" : "Termín do %s od %s", + "Due on %s" : "Termín do %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV endpoint", "There was an error updating your attendance status." : "Vyskytla se chyba při aktualizaci vašeho stavu účasti.", diff --git a/apps/dav/l10n/de.js b/apps/dav/l10n/de.js index b14193d91a4..625f85b1e45 100644 --- a/apps/dav/l10n/de.js +++ b/apps/dav/l10n/de.js @@ -80,8 +80,12 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Dein %s muss konfiguriert werden, um HTTPS zusammen mit CalDAV und CardDAV unter iOS/macOS nutzen zu können.", "Configures a CalDAV account" : "Ein CalDAV-Konto einrichten", "Configures a CardDAV account" : "Ein CardDAV-Konto einrichten", + "Events" : "Ereignisse", "Tasks" : "Aufgaben", "Untitled task" : "Unbenannte Aufgabe", + "Completed on %s" : "Erledigt am %s", + "Due on %s by %s" : "Fällig am %s für %s", + "Due on %s" : "Fällig am %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV-Endpunkt", "There was an error updating your attendance status." : "Es ist ein Fehler beim Aktualisieren Deines Teilnehmerstatus aufgetreten.", diff --git a/apps/dav/l10n/de.json b/apps/dav/l10n/de.json index f7fee66d01c..84357c4889b 100644 --- a/apps/dav/l10n/de.json +++ b/apps/dav/l10n/de.json @@ -78,8 +78,12 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Dein %s muss konfiguriert werden, um HTTPS zusammen mit CalDAV und CardDAV unter iOS/macOS nutzen zu können.", "Configures a CalDAV account" : "Ein CalDAV-Konto einrichten", "Configures a CardDAV account" : "Ein CardDAV-Konto einrichten", + "Events" : "Ereignisse", "Tasks" : "Aufgaben", "Untitled task" : "Unbenannte Aufgabe", + "Completed on %s" : "Erledigt am %s", + "Due on %s by %s" : "Fällig am %s für %s", + "Due on %s" : "Fällig am %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV-Endpunkt", "There was an error updating your attendance status." : "Es ist ein Fehler beim Aktualisieren Deines Teilnehmerstatus aufgetreten.", diff --git a/apps/dav/l10n/de_DE.js b/apps/dav/l10n/de_DE.js index e6cae89495d..44d61deb027 100644 --- a/apps/dav/l10n/de_DE.js +++ b/apps/dav/l10n/de_DE.js @@ -80,8 +80,12 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Ihr %s muss konfiguriert werden, um HTTPS zusammen mit CalDAV und CardDAV unter iOS/macOS nutzen zu können.", "Configures a CalDAV account" : "Ein CalDAV-Konto einrichten", "Configures a CardDAV account" : "Ein CardDAV-Konto einrichten", + "Events" : "Ereignisse", "Tasks" : "Aufgaben", "Untitled task" : "Unbenannte Aufgabe", + "Completed on %s" : "Erledigt am %s", + "Due on %s by %s" : "Fällig am %s für %s", + "Due on %s" : "Fällig am %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV-Endpunkt", "There was an error updating your attendance status." : "Es ist ein Fehler beim Aktualisieren Ihres Teilnehmerstatus aufgetreten.", diff --git a/apps/dav/l10n/de_DE.json b/apps/dav/l10n/de_DE.json index 2f09e01914d..61a04aaea27 100644 --- a/apps/dav/l10n/de_DE.json +++ b/apps/dav/l10n/de_DE.json @@ -78,8 +78,12 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Ihr %s muss konfiguriert werden, um HTTPS zusammen mit CalDAV und CardDAV unter iOS/macOS nutzen zu können.", "Configures a CalDAV account" : "Ein CalDAV-Konto einrichten", "Configures a CardDAV account" : "Ein CardDAV-Konto einrichten", + "Events" : "Ereignisse", "Tasks" : "Aufgaben", "Untitled task" : "Unbenannte Aufgabe", + "Completed on %s" : "Erledigt am %s", + "Due on %s by %s" : "Fällig am %s für %s", + "Due on %s" : "Fällig am %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV-Endpunkt", "There was an error updating your attendance status." : "Es ist ein Fehler beim Aktualisieren Ihres Teilnehmerstatus aufgetreten.", diff --git a/apps/dav/l10n/es.js b/apps/dav/l10n/es.js index 2581907dc46..265917912fa 100644 --- a/apps/dav/l10n/es.js +++ b/apps/dav/l10n/es.js @@ -80,8 +80,11 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Tu %s necesita configurarse para usar HTTPS en caso de usar CalDAV y CardDAV con iOS/macOS.", "Configures a CalDAV account" : "Configura una cuenta CalDAV", "Configures a CardDAV account" : "Configura una cuenta CardDAV", + "Events" : "Eventos", "Tasks" : "Tareas", "Untitled task" : "Tarea sin título", + "Completed on %s" : "Completado el %s", + "Due on %s" : "Finaliza el %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Extremo de WebDAV", "There was an error updating your attendance status." : "Ha habido un error al actualizar tu estado de asistencia.", diff --git a/apps/dav/l10n/es.json b/apps/dav/l10n/es.json index ca715da9d36..3d8e14acec1 100644 --- a/apps/dav/l10n/es.json +++ b/apps/dav/l10n/es.json @@ -78,8 +78,11 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Tu %s necesita configurarse para usar HTTPS en caso de usar CalDAV y CardDAV con iOS/macOS.", "Configures a CalDAV account" : "Configura una cuenta CalDAV", "Configures a CardDAV account" : "Configura una cuenta CardDAV", + "Events" : "Eventos", "Tasks" : "Tareas", "Untitled task" : "Tarea sin título", + "Completed on %s" : "Completado el %s", + "Due on %s" : "Finaliza el %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Extremo de WebDAV", "There was an error updating your attendance status." : "Ha habido un error al actualizar tu estado de asistencia.", diff --git a/apps/dav/l10n/eu.js b/apps/dav/l10n/eu.js index a84abc49b95..a686b564253 100644 --- a/apps/dav/l10n/eu.js +++ b/apps/dav/l10n/eu.js @@ -80,8 +80,10 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Zure %s HTTPS erabiltzeko konfiguratu behar da CalDAV eta CardDAV erabiltzeko iOS eta macOSrekin.", "Configures a CalDAV account" : "CalDAV kontu bat konfiguratzen du", "Configures a CardDAV account" : "CardDAV kontu bat konfiguratzen du", + "Events" : "Gertaerak", "Tasks" : "Zereginak", "Untitled task" : "Izenik gabeko zeregina", + "Completed on %s" : "%s-an osatua", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV amaiera-puntua", "There was an error updating your attendance status." : "Errore bat gertatu da zure parte-hartze egoera eguneratzerakoan.", diff --git a/apps/dav/l10n/eu.json b/apps/dav/l10n/eu.json index b3f747d7ea3..71500484010 100644 --- a/apps/dav/l10n/eu.json +++ b/apps/dav/l10n/eu.json @@ -78,8 +78,10 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Zure %s HTTPS erabiltzeko konfiguratu behar da CalDAV eta CardDAV erabiltzeko iOS eta macOSrekin.", "Configures a CalDAV account" : "CalDAV kontu bat konfiguratzen du", "Configures a CardDAV account" : "CardDAV kontu bat konfiguratzen du", + "Events" : "Gertaerak", "Tasks" : "Zereginak", "Untitled task" : "Izenik gabeko zeregina", + "Completed on %s" : "%s-an osatua", "WebDAV" : "WebDAV", "WebDAV endpoint" : "WebDAV amaiera-puntua", "There was an error updating your attendance status." : "Errore bat gertatu da zure parte-hartze egoera eguneratzerakoan.", diff --git a/apps/dav/l10n/fr.js b/apps/dav/l10n/fr.js index 28e71046a6b..e811182be9c 100644 --- a/apps/dav/l10n/fr.js +++ b/apps/dav/l10n/fr.js @@ -80,8 +80,10 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Votre %s a besoin d'être configuré pour utiliser le HTTPS dans le but d'utiliser CalDAV et CardDAV avec iOS/macOS.", "Configures a CalDAV account" : "Configure un compte CalDAV", "Configures a CardDAV account" : "Configure un compte CardDAV", + "Events" : "Évènements", "Tasks" : "Tâches", "Untitled task" : "Tâche sans titre", + "Completed on %s" : "Terminé le %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Point d'accès WebDAV", "There was an error updating your attendance status." : "Une erreur s'est produite lors de la mise à jour de votre statut de présence.", diff --git a/apps/dav/l10n/fr.json b/apps/dav/l10n/fr.json index 110ec021500..37553234e27 100644 --- a/apps/dav/l10n/fr.json +++ b/apps/dav/l10n/fr.json @@ -78,8 +78,10 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Votre %s a besoin d'être configuré pour utiliser le HTTPS dans le but d'utiliser CalDAV et CardDAV avec iOS/macOS.", "Configures a CalDAV account" : "Configure un compte CalDAV", "Configures a CardDAV account" : "Configure un compte CardDAV", + "Events" : "Évènements", "Tasks" : "Tâches", "Untitled task" : "Tâche sans titre", + "Completed on %s" : "Terminé le %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Point d'accès WebDAV", "There was an error updating your attendance status." : "Une erreur s'est produite lors de la mise à jour de votre statut de présence.", diff --git a/apps/dav/l10n/gl.js b/apps/dav/l10n/gl.js index 64985a6a91b..f26ef7aa064 100644 --- a/apps/dav/l10n/gl.js +++ b/apps/dav/l10n/gl.js @@ -80,8 +80,12 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "É preciso configurar o seu %s para que empregue HTTPS para poder usar CalDAV e CardDAV con iOS / macOS.", "Configures a CalDAV account" : "Configurar unha conta de CalDAV", "Configures a CardDAV account" : "Configurar unha conta de CardDAV", + "Events" : "Eventos", "Tasks" : "Tarefas", "Untitled task" : "Tarefa sen título", + "Completed on %s" : "Rematado o %s", + "Due on %s by %s" : "Caduca o %s por %s", + "Due on %s" : "Caduca o %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Terminación WebDAV", "There was an error updating your attendance status." : "Produciuse un erro ao actualizar o seu estado de asistencia.", diff --git a/apps/dav/l10n/gl.json b/apps/dav/l10n/gl.json index 755ac0871fc..cc783480c4d 100644 --- a/apps/dav/l10n/gl.json +++ b/apps/dav/l10n/gl.json @@ -78,8 +78,12 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "É preciso configurar o seu %s para que empregue HTTPS para poder usar CalDAV e CardDAV con iOS / macOS.", "Configures a CalDAV account" : "Configurar unha conta de CalDAV", "Configures a CardDAV account" : "Configurar unha conta de CardDAV", + "Events" : "Eventos", "Tasks" : "Tarefas", "Untitled task" : "Tarefa sen título", + "Completed on %s" : "Rematado o %s", + "Due on %s by %s" : "Caduca o %s por %s", + "Due on %s" : "Caduca o %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Terminación WebDAV", "There was an error updating your attendance status." : "Produciuse un erro ao actualizar o seu estado de asistencia.", diff --git a/apps/dav/l10n/it.js b/apps/dav/l10n/it.js index 347f0f9f58c..f2730338ef3 100644 --- a/apps/dav/l10n/it.js +++ b/apps/dav/l10n/it.js @@ -80,8 +80,12 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Il tuo %s deve essere configurato all'uso di HTTPS per poter usare CalDAV e CardDAV con iOS/macOS.", "Configures a CalDAV account" : "Configura un account CalDAV", "Configures a CardDAV account" : "Configura un account CardDAV", + "Events" : "Eventi", "Tasks" : "Attività", "Untitled task" : "Attività senza titolo", + "Completed on %s" : "Completata il %s", + "Due on %s by %s" : "Scade il %s per %s", + "Due on %s" : "Scade il %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Terminatore WebDAV", "There was an error updating your attendance status." : "Si è verificato un errore durante l'aggiornamento dello stato della tua partecipazione.", diff --git a/apps/dav/l10n/it.json b/apps/dav/l10n/it.json index a4314eebff5..3e5a6d1bc3a 100644 --- a/apps/dav/l10n/it.json +++ b/apps/dav/l10n/it.json @@ -78,8 +78,12 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "Il tuo %s deve essere configurato all'uso di HTTPS per poter usare CalDAV e CardDAV con iOS/macOS.", "Configures a CalDAV account" : "Configura un account CalDAV", "Configures a CardDAV account" : "Configura un account CardDAV", + "Events" : "Eventi", "Tasks" : "Attività", "Untitled task" : "Attività senza titolo", + "Completed on %s" : "Completata il %s", + "Due on %s by %s" : "Scade il %s per %s", + "Due on %s" : "Scade il %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Terminatore WebDAV", "There was an error updating your attendance status." : "Si è verificato un errore durante l'aggiornamento dello stato della tua partecipazione.", diff --git a/apps/dav/l10n/pl.js b/apps/dav/l10n/pl.js index 47b5ed32f25..b653ed45a39 100644 --- a/apps/dav/l10n/pl.js +++ b/apps/dav/l10n/pl.js @@ -80,8 +80,12 @@ OC.L10N.register( "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "%s musisz używać protokołu HTTPS aby móc korzystać z CalDAV i CardDAV w systemach iOS/macOS.", "Configures a CalDAV account" : "Konfiguruje konto CalDAV", "Configures a CardDAV account" : "Konfiguruje konto CardDAV", + "Events" : "Wydarzenia", "Tasks" : "Zadania", "Untitled task" : "Zadanie bez tytułu", + "Completed on %s" : "Ukończono %s", + "Due on %s by %s" : "Na dzień %s w %s", + "Due on %s" : "Na dzień %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Adres WebDAV", "There was an error updating your attendance status." : "Wystąpił błąd zmiany stanu uczestnictwa", diff --git a/apps/dav/l10n/pl.json b/apps/dav/l10n/pl.json index fc856a306b0..25d23f3bd42 100644 --- a/apps/dav/l10n/pl.json +++ b/apps/dav/l10n/pl.json @@ -78,8 +78,12 @@ "Your %s needs to be configured to use HTTPS in order to use CalDAV and CardDAV with iOS/macOS." : "%s musisz używać protokołu HTTPS aby móc korzystać z CalDAV i CardDAV w systemach iOS/macOS.", "Configures a CalDAV account" : "Konfiguruje konto CalDAV", "Configures a CardDAV account" : "Konfiguruje konto CardDAV", + "Events" : "Wydarzenia", "Tasks" : "Zadania", "Untitled task" : "Zadanie bez tytułu", + "Completed on %s" : "Ukończono %s", + "Due on %s by %s" : "Na dzień %s w %s", + "Due on %s" : "Na dzień %s", "WebDAV" : "WebDAV", "WebDAV endpoint" : "Adres WebDAV", "There was an error updating your attendance status." : "Wystąpił błąd zmiany stanu uczestnictwa", diff --git a/apps/dav/lib/Search/ContactsSearchProvider.php b/apps/dav/lib/Search/ContactsSearchProvider.php index 656b484c2b9..78747ebd70e 100644 --- a/apps/dav/lib/Search/ContactsSearchProvider.php +++ b/apps/dav/lib/Search/ContactsSearchProvider.php @@ -32,6 +32,7 @@ use OCP\IUser; use OCP\Search\IProvider; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; +use OCP\Search\SearchResultEntry; use Sabre\VObject\Component\VCard; use Sabre\VObject\Reader; @@ -82,7 +83,7 @@ class ContactsSearchProvider implements IProvider { * @inheritDoc */ public function getId(): string { - return 'contacts-dav'; + return 'contacts'; } /** @@ -95,6 +96,16 @@ class ContactsSearchProvider implements IProvider { /** * @inheritDoc */ + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'contacts.Page.index') { + return -1; + } + return 25; + } + + /** + * @inheritDoc + */ public function search(IUser $user, ISearchQuery $query): SearchResult { if (!$this->appManager->isEnabledForUser('contacts', $user)) { return SearchResult::complete($this->getName(), []); @@ -116,7 +127,7 @@ class ContactsSearchProvider implements IProvider { 'offset' => $query->getCursor(), ] ); - $formattedResults = \array_map(function (array $contactRow) use ($addressBooksById):ContactsSearchResultEntry { + $formattedResults = \array_map(function (array $contactRow) use ($addressBooksById):SearchResultEntry { $addressBook = $addressBooksById[$contactRow['addressbookid']]; /** @var VCard $vCard */ @@ -130,7 +141,7 @@ class ContactsSearchProvider implements IProvider { $subline = $this->generateSubline($vCard); $resourceUrl = $this->getDeepLinkToContactsApp($addressBook['uri'], (string) $vCard->UID); - return new ContactsSearchResultEntry($thumbnailUrl, $title, $subline, $resourceUrl, 'icon-contacts-dark', true); + return new SearchResultEntry($thumbnailUrl, $title, $subline, $resourceUrl, 'icon-contacts-dark', true); }, $searchResults); return SearchResult::paginated( diff --git a/apps/dav/lib/Search/ContactsSearchResultEntry.php b/apps/dav/lib/Search/ContactsSearchResultEntry.php deleted file mode 100644 index 698fc1b3f4a..00000000000 --- a/apps/dav/lib/Search/ContactsSearchResultEntry.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * @copyright Copyright (c) 2020, Georg Ehrke - * - * @author Georg Ehrke <oc.list@georgehrke.com> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -namespace OCA\DAV\Search; - -use OCP\Search\ASearchResultEntry; - -class ContactsSearchResultEntry extends ASearchResultEntry { -} diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 43fc4f65dfc..c27996f96e7 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -28,6 +28,7 @@ use OCA\DAV\CalDAV\CalDavBackend; use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; +use OCP\Search\SearchResultEntry; use Sabre\VObject\Component; use Sabre\VObject\DateTimeParser; use Sabre\VObject\Property; @@ -68,7 +69,7 @@ class EventsSearchProvider extends ACalendarSearchProvider { * @inheritDoc */ public function getId(): string { - return 'calendar-dav'; + return 'calendar'; } /** @@ -81,6 +82,16 @@ class EventsSearchProvider extends ACalendarSearchProvider { /** * @inheritDoc */ + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'calendar.View.index') { + return -1; + } + return 30; + } + + /** + * @inheritDoc + */ public function search(IUser $user, ISearchQuery $query): SearchResult { if (!$this->appManager->isEnabledForUser('calendar', $user)) { @@ -102,7 +113,7 @@ class EventsSearchProvider extends ACalendarSearchProvider { 'offset' => $query->getCursor(), ] ); - $formattedResults = \array_map(function (array $eventRow) use ($calendarsById, $subscriptionsById):EventsSearchResultEntry { + $formattedResults = \array_map(function (array $eventRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { $component = $this->getPrimaryComponent($eventRow['calendardata'], self::$componentType); $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled event')); $subline = $this->generateSubline($component); @@ -114,7 +125,7 @@ class EventsSearchProvider extends ACalendarSearchProvider { } $resourceUrl = $this->getDeepLinkToCalendarApp($calendar['principaluri'], $calendar['uri'], $eventRow['uri']); - return new EventsSearchResultEntry('', $title, $subline, $resourceUrl, 'icon-calendar-dark', false); + return new SearchResultEntry('', $title, $subline, $resourceUrl, 'icon-calendar-dark', false); }, $searchResults); return SearchResult::paginated( diff --git a/apps/dav/lib/Search/EventsSearchResultEntry.php b/apps/dav/lib/Search/EventsSearchResultEntry.php deleted file mode 100644 index f70f10a6e75..00000000000 --- a/apps/dav/lib/Search/EventsSearchResultEntry.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * @copyright Copyright (c) 2020, Georg Ehrke - * - * @author Georg Ehrke <oc.list@georgehrke.com> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -namespace OCA\DAV\Search; - -use OCP\Search\ASearchResultEntry; - -class EventsSearchResultEntry extends ASearchResultEntry { -} diff --git a/apps/dav/lib/Search/TasksSearchProvider.php b/apps/dav/lib/Search/TasksSearchProvider.php index eee4694f08f..5af694bb85d 100644 --- a/apps/dav/lib/Search/TasksSearchProvider.php +++ b/apps/dav/lib/Search/TasksSearchProvider.php @@ -28,6 +28,7 @@ use OCA\DAV\CalDAV\CalDavBackend; use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; +use OCP\Search\SearchResultEntry; use Sabre\VObject\Component; /** @@ -60,7 +61,7 @@ class TasksSearchProvider extends ACalendarSearchProvider { * @inheritDoc */ public function getId(): string { - return 'tasks-dav'; + return 'tasks'; } /** @@ -73,6 +74,16 @@ class TasksSearchProvider extends ACalendarSearchProvider { /** * @inheritDoc */ + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'tasks.Page.index') { + return -1; + } + return 35; + } + + /** + * @inheritDoc + */ public function search(IUser $user, ISearchQuery $query): SearchResult { if (!$this->appManager->isEnabledForUser('tasks', $user)) { @@ -94,7 +105,7 @@ class TasksSearchProvider extends ACalendarSearchProvider { 'offset' => $query->getCursor(), ] ); - $formattedResults = \array_map(function (array $taskRow) use ($calendarsById, $subscriptionsById):TasksSearchResultEntry { + $formattedResults = \array_map(function (array $taskRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { $component = $this->getPrimaryComponent($taskRow['calendardata'], self::$componentType); $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled task')); $subline = $this->generateSubline($component); @@ -106,7 +117,7 @@ class TasksSearchProvider extends ACalendarSearchProvider { } $resourceUrl = $this->getDeepLinkToTasksApp($calendar['uri'], $taskRow['uri']); - return new TasksSearchResultEntry('', $title, $subline, $resourceUrl, 'icon-checkmark', false); + return new SearchResultEntry('', $title, $subline, $resourceUrl, 'icon-checkmark', false); }, $searchResults); return SearchResult::paginated( diff --git a/apps/dav/lib/Search/TasksSearchResultEntry.php b/apps/dav/lib/Search/TasksSearchResultEntry.php deleted file mode 100644 index ec58ba80af9..00000000000 --- a/apps/dav/lib/Search/TasksSearchResultEntry.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * @copyright Copyright (c) 2020, Georg Ehrke - * - * @author Georg Ehrke <oc.list@georgehrke.com> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -namespace OCA\DAV\Search; - -use OCP\Search\ASearchResultEntry; - -class TasksSearchResultEntry extends ASearchResultEntry { -} diff --git a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php index e0cfe3245ba..1ca0457adb6 100644 --- a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php @@ -26,13 +26,13 @@ namespace OCA\DAV\Tests\unit; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\Search\ContactsSearchProvider; -use OCA\DAV\Search\ContactsSearchResultEntry; use OCP\App\IAppManager; use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; +use OCP\Search\SearchResultEntry; use Sabre\VObject\Reader; use Test\TestCase; @@ -88,7 +88,7 @@ class ContactsSearchProviderTest extends TestCase { } public function testGetId(): void { - $this->assertEquals('contacts-dav', $this->provider->getId()); + $this->assertEquals('contacts', $this->provider->getId()); } public function testGetName(): void { @@ -216,20 +216,20 @@ class ContactsSearchProviderTest extends TestCase { $result1 = $data['entries'][1]; $result1Data = $result1->jsonSerialize(); - $this->assertInstanceOf(ContactsSearchResultEntry::class, $result0); + $this->assertInstanceOf(SearchResultEntry::class, $result0); $this->assertEquals('', $result0Data['thumbnailUrl']); $this->assertEquals('FN of Test', $result0Data['title']); $this->assertEquals('subline', $result0Data['subline']); $this->assertEquals('deep-link-to-contacts', $result0Data['resourceUrl']); - $this->assertEquals('icon-contacts-dark', $result0Data['iconClass']); + $this->assertEquals('icon-contacts-dark', $result0Data['icon']); $this->assertTrue($result0Data['rounded']); - $this->assertInstanceOf(ContactsSearchResultEntry::class, $result1); + $this->assertInstanceOf(SearchResultEntry::class, $result1); $this->assertEquals('absolute-thumbnail-url?photo', $result1Data['thumbnailUrl']); $this->assertEquals('FN of Test2', $result1Data['title']); $this->assertEquals('subline', $result1Data['subline']); $this->assertEquals('deep-link-to-contacts', $result1Data['resourceUrl']); - $this->assertEquals('icon-contacts-dark', $result1Data['iconClass']); + $this->assertEquals('icon-contacts-dark', $result1Data['icon']); $this->assertTrue($result1Data['rounded']); } diff --git a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php index f0d6329db5c..cd905760fac 100644 --- a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php @@ -26,13 +26,13 @@ namespace OCA\DAV\Tests\unit\Search; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Search\EventsSearchProvider; -use OCA\DAV\Search\EventsSearchResultEntry; use OCP\App\IAppManager; use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; +use OCP\Search\SearchResultEntry; use Sabre\VObject\Reader; use Test\TestCase; @@ -250,7 +250,7 @@ class EventsSearchProviderTest extends TestCase { } public function testGetId(): void { - $this->assertEquals('calendar-dav', $this->provider->getId()); + $this->assertEquals('calendar', $this->provider->getId()); } public function testGetName(): void { @@ -392,28 +392,28 @@ class EventsSearchProviderTest extends TestCase { $result2 = $data['entries'][2]; $result2Data = $result2->jsonSerialize(); - $this->assertInstanceOf(EventsSearchResultEntry::class, $result0); + $this->assertInstanceOf(SearchResultEntry::class, $result0); $this->assertEmpty($result0Data['thumbnailUrl']); $this->assertEquals('Untitled event', $result0Data['title']); $this->assertEquals('subline', $result0Data['subline']); $this->assertEquals('deep-link-to-calendar', $result0Data['resourceUrl']); - $this->assertEquals('icon-calendar-dark', $result0Data['iconClass']); + $this->assertEquals('icon-calendar-dark', $result0Data['icon']); $this->assertFalse($result0Data['rounded']); - $this->assertInstanceOf(EventsSearchResultEntry::class, $result1); + $this->assertInstanceOf(SearchResultEntry::class, $result1); $this->assertEmpty($result1Data['thumbnailUrl']); $this->assertEquals('Test Europe Berlin', $result1Data['title']); $this->assertEquals('subline', $result1Data['subline']); $this->assertEquals('deep-link-to-calendar', $result1Data['resourceUrl']); - $this->assertEquals('icon-calendar-dark', $result1Data['iconClass']); + $this->assertEquals('icon-calendar-dark', $result1Data['icon']); $this->assertFalse($result1Data['rounded']); - $this->assertInstanceOf(EventsSearchResultEntry::class, $result2); + $this->assertInstanceOf(SearchResultEntry::class, $result2); $this->assertEmpty($result2Data['thumbnailUrl']); $this->assertEquals('Test Europe Berlin', $result2Data['title']); $this->assertEquals('subline', $result2Data['subline']); $this->assertEquals('deep-link-to-calendar', $result2Data['resourceUrl']); - $this->assertEquals('icon-calendar-dark', $result2Data['iconClass']); + $this->assertEquals('icon-calendar-dark', $result2Data['icon']); $this->assertFalse($result2Data['rounded']); } diff --git a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php index 30f57270e95..732625980e8 100644 --- a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php @@ -26,13 +26,13 @@ namespace OCA\DAV\Tests\unit\Search; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Search\TasksSearchProvider; -use OCA\DAV\Search\TasksSearchResultEntry; use OCP\App\IAppManager; use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; +use OCP\Search\SearchResultEntry; use Sabre\VObject\Reader; use Test\TestCase; @@ -134,7 +134,7 @@ class TasksSearchProviderTest extends TestCase { } public function testGetId(): void { - $this->assertEquals('tasks-dav', $this->provider->getId()); + $this->assertEquals('tasks', $this->provider->getId()); } public function testGetName(): void { @@ -276,28 +276,28 @@ class TasksSearchProviderTest extends TestCase { $result2 = $data['entries'][2]; $result2Data = $result2->jsonSerialize(); - $this->assertInstanceOf(TasksSearchResultEntry::class, $result0); + $this->assertInstanceOf(SearchResultEntry::class, $result0); $this->assertEmpty($result0Data['thumbnailUrl']); $this->assertEquals('Untitled task', $result0Data['title']); $this->assertEquals('subline', $result0Data['subline']); $this->assertEquals('deep-link-to-tasks', $result0Data['resourceUrl']); - $this->assertEquals('icon-checkmark', $result0Data['iconClass']); + $this->assertEquals('icon-checkmark', $result0Data['icon']); $this->assertFalse($result0Data['rounded']); - $this->assertInstanceOf(TasksSearchResultEntry::class, $result1); + $this->assertInstanceOf(SearchResultEntry::class, $result1); $this->assertEmpty($result1Data['thumbnailUrl']); $this->assertEquals('Task title', $result1Data['title']); $this->assertEquals('subline', $result1Data['subline']); $this->assertEquals('deep-link-to-tasks', $result1Data['resourceUrl']); - $this->assertEquals('icon-checkmark', $result1Data['iconClass']); + $this->assertEquals('icon-checkmark', $result1Data['icon']); $this->assertFalse($result1Data['rounded']); - $this->assertInstanceOf(TasksSearchResultEntry::class, $result2); + $this->assertInstanceOf(SearchResultEntry::class, $result2); $this->assertEmpty($result2Data['thumbnailUrl']); $this->assertEquals('Task title', $result2Data['title']); $this->assertEquals('subline', $result2Data['subline']); $this->assertEquals('deep-link-to-tasks', $result2Data['resourceUrl']); - $this->assertEquals('icon-checkmark', $result2Data['iconClass']); + $this->assertEquals('icon-checkmark', $result2Data['icon']); $this->assertFalse($result2Data['rounded']); } |