From ec37e3ad4ff7d011462e0d5b5c2217e44db43461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Farr=C3=A9?= Date: Mon, 9 Sep 2024 13:00:53 +0100 Subject: [PATCH] Enh #221: By default, enabled Mobile notification types for those enabled for Web --- docs/CHANGELOG.md | 4 ++++ module.json | 2 +- notifications/TaskNotificationCategory.php | 21 +------------------- notifications/TaskReminderCategory.php | 23 +--------------------- 4 files changed, 7 insertions(+), 43 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d2918fec..95202586 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +1.8.6 (Unreleased) +---------------------- +- Enh #221: By default, enabled "Mobile" notification types for those enabled for "Web" + 1.8.5 (March 14, 2024) ---------------------- - Fix #249: Fix replaced method `friendship\Module::isEnabled()` diff --git a/module.json b/module.json index 482e1f7b..b3934845 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "name": "Tasks", "description": "Intuitive task management tool with many basic and advanced features.", "keywords": ["task", "todo"], - "version": "1.8.5", + "version": "1.8.6", "homepage": "https://github.com/humhub/tasks", "humhub": { "minVersion": "1.14" diff --git a/notifications/TaskNotificationCategory.php b/notifications/TaskNotificationCategory.php index 87850e99..1c678092 100644 --- a/notifications/TaskNotificationCategory.php +++ b/notifications/TaskNotificationCategory.php @@ -9,12 +9,8 @@ namespace humhub\modules\tasks\notifications; -use Yii; use humhub\modules\notification\components\NotificationCategory; -use humhub\modules\notification\targets\BaseTarget; -use humhub\modules\notification\targets\MailTarget; -use humhub\modules\notification\targets\WebTarget; -use humhub\modules\notification\targets\MobileTarget; +use Yii; /** * SpaceMemberNotificationCategory @@ -44,19 +40,4 @@ public function getDescription() { return Yii::t('TasksModule.base', 'Receive Notifications for Tasks (Deadline Updates, Status changes ...).'); } - - /** - * @inheritdoc - */ - public function getDefaultSetting(BaseTarget $target) - { - if($target instanceof WebTarget || $target instanceof MailTarget) { - return true; - } else if ($target instanceof MobileTarget) { - return false; - } - - return $target->defaultSetting; - } - } diff --git a/notifications/TaskReminderCategory.php b/notifications/TaskReminderCategory.php index 0974e988..e3394a63 100644 --- a/notifications/TaskReminderCategory.php +++ b/notifications/TaskReminderCategory.php @@ -9,12 +9,8 @@ namespace humhub\modules\tasks\notifications; -use Yii; use humhub\modules\notification\components\NotificationCategory; -use humhub\modules\notification\targets\BaseTarget; -use humhub\modules\notification\targets\MailTarget; -use humhub\modules\notification\targets\WebTarget; -use humhub\modules\notification\targets\MobileTarget; +use Yii; /** * SpaceMemberNotificationCategory @@ -44,21 +40,4 @@ public function getDescription() { return Yii::t('TasksModule.base', 'Receive Notifications for Task Reminder.'); } - - /** - * @inheritdoc - */ - public function getDefaultSetting(BaseTarget $target) - { - if ($target->id === MailTarget::getId()) { - return true; - } else if ($target->id === WebTarget::getId()) { - return true; - } else if ($target->id === MobileTarget::getId()) { - return true; - } - - return $target->defaultSetting; - } - }