diff options
Diffstat (limited to 'apps/files_reminders')
-rw-r--r-- | apps/files_reminders/l10n/fr.js | 2 | ||||
-rw-r--r-- | apps/files_reminders/l10n/fr.json | 2 | ||||
-rw-r--r-- | apps/files_reminders/l10n/sc.js | 19 | ||||
-rw-r--r-- | apps/files_reminders/l10n/sc.json | 17 | ||||
-rw-r--r-- | apps/files_reminders/l10n/sw.js | 37 | ||||
-rw-r--r-- | apps/files_reminders/l10n/sw.json | 35 | ||||
-rw-r--r-- | apps/files_reminders/l10n/tr.js | 4 | ||||
-rw-r--r-- | apps/files_reminders/l10n/tr.json | 4 | ||||
-rw-r--r-- | apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php | 6 | ||||
-rw-r--r-- | apps/files_reminders/lib/Db/ReminderMapper.php | 22 | ||||
-rw-r--r-- | apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php | 4 |
11 files changed, 91 insertions, 61 deletions
diff --git a/apps/files_reminders/l10n/fr.js b/apps/files_reminders/l10n/fr.js index 7faf292ac61..2047eabb255 100644 --- a/apps/files_reminders/l10n/fr.js +++ b/apps/files_reminders/l10n/fr.js @@ -31,7 +31,7 @@ OC.L10N.register( "Set reminder for this weekend" : "Définir un rappel pour ce week-end", "Next week" : "Semaine suivante", "Set reminder for next week" : "Définir un rappel pour la semaine prochaine", - "This files_reminder can work properly." : "Ce fichier_reminder peut fonctionner correctement.", + "This files_reminder can work properly." : "Ce files_reminder peut fonctionner correctement.", "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "L'application files_reminder a besoin de l'application de notifications pour fonctionner correctement. Vous devez activer les notifications ou désactiver files_reminder." }, "nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); diff --git a/apps/files_reminders/l10n/fr.json b/apps/files_reminders/l10n/fr.json index 17f299e934e..107c89ef133 100644 --- a/apps/files_reminders/l10n/fr.json +++ b/apps/files_reminders/l10n/fr.json @@ -29,7 +29,7 @@ "Set reminder for this weekend" : "Définir un rappel pour ce week-end", "Next week" : "Semaine suivante", "Set reminder for next week" : "Définir un rappel pour la semaine prochaine", - "This files_reminder can work properly." : "Ce fichier_reminder peut fonctionner correctement.", + "This files_reminder can work properly." : "Ce files_reminder peut fonctionner correctement.", "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "L'application files_reminder a besoin de l'application de notifications pour fonctionner correctement. Vous devez activer les notifications ou désactiver files_reminder." },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" }
\ No newline at end of file diff --git a/apps/files_reminders/l10n/sc.js b/apps/files_reminders/l10n/sc.js deleted file mode 100644 index 4307fc64679..00000000000 --- a/apps/files_reminders/l10n/sc.js +++ /dev/null @@ -1,19 +0,0 @@ -OC.L10N.register( - "files_reminders", - { - "Set file reminders" : "Cunfigura apuntos de archìviu", - "Set reminder for \"{fileName}\"" : "Cunfigura un'apuntu pro \"{fileName}\"", - "Set reminder at custom date & time" : "Cunfigura un'apuntu pro una data e ora ispetzìfica", - "Reminder set for \"{fileName}\"" : "Apuntu cunfiguradu pro \"{fileName}\"", - "Failed to set reminder" : "Errore in sa cunfiguratzione de s'apuntu", - "Cancel" : "Annulla", - "Set reminder" : "Cunfigura un'apuntu", - "Set custom reminder" : "Cunfigura un'apuntu personalizadu", - "Set reminder for later today" : "Cunfigura un'apuntu pro luego", - "Tomorrow" : "Cras", - "Set reminder for tomorrow" : "Cunfigura un'apuntu pro cras", - "Set reminder for this weekend" : "Cunfigura un'apuntu pro custu fine de chida", - "Next week" : "Sa chida chi benit", - "Set reminder for next week" : "Cunfigura un'apuntu pro chida chi benit" -}, -"nplurals=2; plural=(n != 1);"); diff --git a/apps/files_reminders/l10n/sc.json b/apps/files_reminders/l10n/sc.json deleted file mode 100644 index 1d9eb562048..00000000000 --- a/apps/files_reminders/l10n/sc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ "translations": { - "Set file reminders" : "Cunfigura apuntos de archìviu", - "Set reminder for \"{fileName}\"" : "Cunfigura un'apuntu pro \"{fileName}\"", - "Set reminder at custom date & time" : "Cunfigura un'apuntu pro una data e ora ispetzìfica", - "Reminder set for \"{fileName}\"" : "Apuntu cunfiguradu pro \"{fileName}\"", - "Failed to set reminder" : "Errore in sa cunfiguratzione de s'apuntu", - "Cancel" : "Annulla", - "Set reminder" : "Cunfigura un'apuntu", - "Set custom reminder" : "Cunfigura un'apuntu personalizadu", - "Set reminder for later today" : "Cunfigura un'apuntu pro luego", - "Tomorrow" : "Cras", - "Set reminder for tomorrow" : "Cunfigura un'apuntu pro cras", - "Set reminder for this weekend" : "Cunfigura un'apuntu pro custu fine de chida", - "Next week" : "Sa chida chi benit", - "Set reminder for next week" : "Cunfigura un'apuntu pro chida chi benit" -},"pluralForm" :"nplurals=2; plural=(n != 1);" -}
\ No newline at end of file diff --git a/apps/files_reminders/l10n/sw.js b/apps/files_reminders/l10n/sw.js new file mode 100644 index 00000000000..92d9d55fb40 --- /dev/null +++ b/apps/files_reminders/l10n/sw.js @@ -0,0 +1,37 @@ +OC.L10N.register( + "files_reminders", + { + "File reminders" : "Vikumbusho vya faili", + "Reminder for {name}" : " Kikumbusho kwa {name}", + "View file" : "Tazama faili", + "View folder" : "Tazama folda", + "Files reminder" : "Kikumbusho cha faili", + "The \"files_reminders\" app can work properly." : "Programu ya \"files_reminders\" inaweza kufanya kazi ipasavyo.", + "The \"files_reminders\" app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "Programu ya \"files_reminders\" inahitaji programu ya arifa kufanya kazi ipasavyo. Unapaswa kuwezesha arifa au kuzima kikumbusho cha faili.", + "Set file reminders" : "Weka vikumbusho vya faili", + "**📣 File reminders**\n\nSet file reminders.\n\nNote: to use the `File reminders` app, ensure that the `Notifications` app is installed and enabled. The `Notifications` app provides the necessary APIs for the `File reminders` app to work correctly." : "**📣 Vikumbusho vya faili**\n\nWeka vikumbusho vya faili.\n\nKumbuka: ili kutumia programu ya `Vikumbusho vya faili`, hakikisha kuwa programu ya `Arifa` imesakinishwa na kuwashwa. Programu ya `Arifa` hutoa API zinazohitajika ili programu ya `Vikumbusho vya Faili` ifanye kazi ipasavyo.", + "Set reminder for \"{fileName}\"" : "Weka kikumbusho kwa \"{fileName}\"", + "Set reminder at custom date & time" : "Weka kikumbusho kwa tarehe na saa maalum", + "Clear reminder" : "Futa kikumbusho ", + "Please choose a valid date & time" : " Tafadhali chagua tarehe na saa halali", + "Reminder set for \"{fileName}\"" : " Kikumbusho kimewekwa \"{fileName}\"", + "Failed to set reminder" : "Imeshindwa kuweka kikumbusho", + "Reminder cleared for \"{fileName}\"" : "Kikumbusho kimefutwa kwa \"{fileName}\"", + "Failed to clear reminder" : "Imeshindwa kufuta kikumbusho", + "We will remind you of this file" : "Tutakukumbusha kuhusu faili hii", + "Cancel" : "Ghairi", + "Set reminder" : "Weka ukumbusho", + "Reminder set" : " Kikumbusho kimewekwa", + "Set custom reminder" : " Weka kikumbusho maalum", + "Later today" : "Baadaye leo", + "Set reminder for later today" : "Weka kikumbusho cha baadaye leo", + "Tomorrow" : "Kesho", + "Set reminder for tomorrow" : "Weka kikumbusho cha kesho", + "This weekend" : "Wikendi hii", + "Set reminder for this weekend" : "Weka kikumbusho cha wikendi hii", + "Next week" : "Wiki ijayo", + "Set reminder for next week" : " Weka kikumbusho cha wiki ijayo", + "This files_reminder can work properly." : " Kikumbusho hiki cha faili kinaweza kufanya kazi vizuri.", + "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "Programu ya kikumbusho cha faili inahitaji programu ya arifa kufanya kazi vizuri. Unapaswa kuwezesha arifa au kuzima kikumbusho cha faili" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/apps/files_reminders/l10n/sw.json b/apps/files_reminders/l10n/sw.json new file mode 100644 index 00000000000..35a3f951171 --- /dev/null +++ b/apps/files_reminders/l10n/sw.json @@ -0,0 +1,35 @@ +{ "translations": { + "File reminders" : "Vikumbusho vya faili", + "Reminder for {name}" : " Kikumbusho kwa {name}", + "View file" : "Tazama faili", + "View folder" : "Tazama folda", + "Files reminder" : "Kikumbusho cha faili", + "The \"files_reminders\" app can work properly." : "Programu ya \"files_reminders\" inaweza kufanya kazi ipasavyo.", + "The \"files_reminders\" app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "Programu ya \"files_reminders\" inahitaji programu ya arifa kufanya kazi ipasavyo. Unapaswa kuwezesha arifa au kuzima kikumbusho cha faili.", + "Set file reminders" : "Weka vikumbusho vya faili", + "**📣 File reminders**\n\nSet file reminders.\n\nNote: to use the `File reminders` app, ensure that the `Notifications` app is installed and enabled. The `Notifications` app provides the necessary APIs for the `File reminders` app to work correctly." : "**📣 Vikumbusho vya faili**\n\nWeka vikumbusho vya faili.\n\nKumbuka: ili kutumia programu ya `Vikumbusho vya faili`, hakikisha kuwa programu ya `Arifa` imesakinishwa na kuwashwa. Programu ya `Arifa` hutoa API zinazohitajika ili programu ya `Vikumbusho vya Faili` ifanye kazi ipasavyo.", + "Set reminder for \"{fileName}\"" : "Weka kikumbusho kwa \"{fileName}\"", + "Set reminder at custom date & time" : "Weka kikumbusho kwa tarehe na saa maalum", + "Clear reminder" : "Futa kikumbusho ", + "Please choose a valid date & time" : " Tafadhali chagua tarehe na saa halali", + "Reminder set for \"{fileName}\"" : " Kikumbusho kimewekwa \"{fileName}\"", + "Failed to set reminder" : "Imeshindwa kuweka kikumbusho", + "Reminder cleared for \"{fileName}\"" : "Kikumbusho kimefutwa kwa \"{fileName}\"", + "Failed to clear reminder" : "Imeshindwa kufuta kikumbusho", + "We will remind you of this file" : "Tutakukumbusha kuhusu faili hii", + "Cancel" : "Ghairi", + "Set reminder" : "Weka ukumbusho", + "Reminder set" : " Kikumbusho kimewekwa", + "Set custom reminder" : " Weka kikumbusho maalum", + "Later today" : "Baadaye leo", + "Set reminder for later today" : "Weka kikumbusho cha baadaye leo", + "Tomorrow" : "Kesho", + "Set reminder for tomorrow" : "Weka kikumbusho cha kesho", + "This weekend" : "Wikendi hii", + "Set reminder for this weekend" : "Weka kikumbusho cha wikendi hii", + "Next week" : "Wiki ijayo", + "Set reminder for next week" : " Weka kikumbusho cha wiki ijayo", + "This files_reminder can work properly." : " Kikumbusho hiki cha faili kinaweza kufanya kazi vizuri.", + "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "Programu ya kikumbusho cha faili inahitaji programu ya arifa kufanya kazi vizuri. Unapaswa kuwezesha arifa au kuzima kikumbusho cha faili" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file diff --git a/apps/files_reminders/l10n/tr.js b/apps/files_reminders/l10n/tr.js index 08def3387b1..fed3ae46385 100644 --- a/apps/files_reminders/l10n/tr.js +++ b/apps/files_reminders/l10n/tr.js @@ -7,7 +7,7 @@ OC.L10N.register( "View folder" : "Klasörü görüntüle", "Files reminder" : "Dosyalar anımsatıcısı", "The \"files_reminders\" app can work properly." : "\"files_reminders\" uygulaması düzgün çalışabilir.", - "The \"files_reminders\" app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "\"files_reminders\" uygulamasının düzgün çalışması için bildirim uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın.", + "The \"files_reminders\" app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "\"files_reminders\" uygulamasının düzgün çalışması için Bildirimler uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın.", "Set file reminders" : "Dosya anımsatıcıları ayarla", "**📣 File reminders**\n\nSet file reminders.\n\nNote: to use the `File reminders` app, ensure that the `Notifications` app is installed and enabled. The `Notifications` app provides the necessary APIs for the `File reminders` app to work correctly." : "**📣 Dosya anımsatıcıları**\n\nDosya anımsatıcıları ayarlayın.\n\nNot: `Dosya anımsatıcıları` uygulamasını kullanmak için `Bildirimler` uygulamasının kurulmuş ve etkinleştirilmiş olduğundan emin olun. `Bildirimler` uygulaması `Dosya anımsatıcıları` uygulamasının doğru çalışması için gerekli API uygulamalarını sağlar.", "Set reminder for \"{fileName}\"" : "\"{fileName}\" için anımsatıcı ayarla", @@ -32,6 +32,6 @@ OC.L10N.register( "Next week" : "Sonraki hafta", "Set reminder for next week" : "Gelecek hafta için anımsatıcı ayarla", "This files_reminder can work properly." : "Bu files_reminder düzgün çalışabilir.", - "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "files_reminders uygulamasının düzgün çalışması için bildirim uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın." + "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "files_reminders uygulamasının düzgün çalışması için Bildirimler uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın." }, "nplurals=2; plural=(n > 1);"); diff --git a/apps/files_reminders/l10n/tr.json b/apps/files_reminders/l10n/tr.json index c80e7afa9ab..3a8f47edce7 100644 --- a/apps/files_reminders/l10n/tr.json +++ b/apps/files_reminders/l10n/tr.json @@ -5,7 +5,7 @@ "View folder" : "Klasörü görüntüle", "Files reminder" : "Dosyalar anımsatıcısı", "The \"files_reminders\" app can work properly." : "\"files_reminders\" uygulaması düzgün çalışabilir.", - "The \"files_reminders\" app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "\"files_reminders\" uygulamasının düzgün çalışması için bildirim uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın.", + "The \"files_reminders\" app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "\"files_reminders\" uygulamasının düzgün çalışması için Bildirimler uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın.", "Set file reminders" : "Dosya anımsatıcıları ayarla", "**📣 File reminders**\n\nSet file reminders.\n\nNote: to use the `File reminders` app, ensure that the `Notifications` app is installed and enabled. The `Notifications` app provides the necessary APIs for the `File reminders` app to work correctly." : "**📣 Dosya anımsatıcıları**\n\nDosya anımsatıcıları ayarlayın.\n\nNot: `Dosya anımsatıcıları` uygulamasını kullanmak için `Bildirimler` uygulamasının kurulmuş ve etkinleştirilmiş olduğundan emin olun. `Bildirimler` uygulaması `Dosya anımsatıcıları` uygulamasının doğru çalışması için gerekli API uygulamalarını sağlar.", "Set reminder for \"{fileName}\"" : "\"{fileName}\" için anımsatıcı ayarla", @@ -30,6 +30,6 @@ "Next week" : "Sonraki hafta", "Set reminder for next week" : "Gelecek hafta için anımsatıcı ayarla", "This files_reminder can work properly." : "Bu files_reminder düzgün çalışabilir.", - "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "files_reminders uygulamasının düzgün çalışması için bildirim uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın." + "The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder." : "files_reminders uygulamasının düzgün çalışması için Bildirimler uygulaması gereklidir. Bildirimler uygulamasını kullanıma alın ya da files_reminder uygulamasını kullanımdan kaldırın." },"pluralForm" :"nplurals=2; plural=(n > 1);" }
\ No newline at end of file diff --git a/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php b/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php index d8467d1740c..ab8c762d674 100644 --- a/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php +++ b/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php @@ -13,10 +13,10 @@ use OCA\FilesReminders\Db\ReminderMapper; use OCA\FilesReminders\Service\ReminderService; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\Job; +use OCP\BackgroundJob\TimedJob; use Psr\Log\LoggerInterface; -class ScheduledNotifications extends Job { +class ScheduledNotifications extends TimedJob { public function __construct( ITimeFactory $time, protected ReminderMapper $reminderMapper, @@ -24,6 +24,8 @@ class ScheduledNotifications extends Job { protected LoggerInterface $logger, ) { parent::__construct($time); + + $this->setInterval(60); } /** diff --git a/apps/files_reminders/lib/Db/ReminderMapper.php b/apps/files_reminders/lib/Db/ReminderMapper.php index 0ba5cfc3ecd..63cba437d07 100644 --- a/apps/files_reminders/lib/Db/ReminderMapper.php +++ b/apps/files_reminders/lib/Db/ReminderMapper.php @@ -137,24 +137,14 @@ class ReminderMapper extends QBMapper { * @return Reminder[] */ public function findAllInFolder(IUser $user, Folder $folder) { - $fileIds = array_values(array_filter(array_map( - function (Node $node) { - try { - return $node->getId(); - } catch (NotFoundException $e) { - return null; - } - }, - $folder->getDirectoryListing(), - ))); - $qb = $this->db->getQueryBuilder(); - $qb->select('id', 'user_id', 'file_id', 'due_date', 'updated_at', 'created_at', 'notified') - ->from($this->getTableName()) - ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID(), IQueryBuilder::PARAM_STR))) - ->andWhere($qb->expr()->in('file_id', $qb->createNamedParameter($fileIds, IQueryBuilder::PARAM_INT_ARRAY))) - ->orderBy('due_date', 'ASC'); + $qb->select('r.id', 'r.user_id', 'r.file_id', 'r.due_date', 'r.updated_at', 'r.created_at', 'r.notified') + ->from($this->getTableName(), 'r') + ->innerJoin('r', 'filecache', 'f', $qb->expr()->eq('r.file_id', 'f.fileid')) + ->where($qb->expr()->eq('r.user_id', $qb->createNamedParameter($user->getUID(), IQueryBuilder::PARAM_STR))) + ->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($folder->getId(), IQueryBuilder::PARAM_INT))) + ->orderBy('r.due_date', 'ASC'); return $this->findEntities($qb); } diff --git a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php index 13bf670f401..765bf1e3ce2 100644 --- a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php +++ b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php @@ -30,7 +30,9 @@ class LoadAdditionalScriptsListener implements IEventListener { return; } - if (!$this->appManager->isEnabledForUser('notifications')) { + if (!$this->appManager->isEnabledForUser(Application::APP_ID) + || !$this->appManager->isEnabledForUser('notifications') + ) { return; } |