diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2025-04-28 11:42:31 +0200 |
|---|---|---|
| committer | Thomas Hackl <hackl@data-quest.de> | 2025-04-28 11:42:31 +0200 |
| commit | 3539991a6e0bd7ea5c2be93bd5958513e940b70e (patch) | |
| tree | e711d54690e64262b41652d595c9b72032b69fd9 /db | |
| parent | f304ad1e231e68128fae9055b681242a7c728e3c (diff) | |
Resolve "Töne in den neuen Benachrichtigungen ausbauen"
Closes #5562
Merge request studip/studip!4186
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/6.0.50_cleanup_audio_notification_settings.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/db/migrations/6.0.50_cleanup_audio_notification_settings.php b/db/migrations/6.0.50_cleanup_audio_notification_settings.php new file mode 100644 index 0000000..111a336 --- /dev/null +++ b/db/migrations/6.0.50_cleanup_audio_notification_settings.php @@ -0,0 +1,46 @@ +<?php +final class CleanupAudioNotificationSettings extends Migration +{ + public function description() + { + return 'Cleans up the automatic setting of audio notifications done in migration 6.0.22'; + } + + public function up() + { + // Delete config setting for audio notifications. + DBManager::get()->exec("DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED'"); + + // Delete all personal notifications generated by migration 6.0.22. + $texts = [ + 'Aus technischen Gründen wurde das Audio-Feedback zu Benachrichtigungen in Ihrem Konto deaktiviert. ' + . 'Bitte aktivieren Sie dieses erneut, wenn Sie es weiterhin nutzen möchten.', + 'For technical reasons, the audio feedback for notifications has been deactivated in your account. ' + . 'Please reactivate it if you wish to continue using it.' + ]; + DBManager::get()->execute( + "DELETE `personal_notifications`, `personal_notifications_user` + FROM `personal_notifications` + LEFT JOIN `personal_notifications_user` USING (`personal_notification_id`) + WHERE `text` IN (:texts);", + ['texts' => $texts] + ); + } + + public function down() + { + DBManager::get()->execute("INSERT IGNORE INTO `config` + (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`) + VALUES (:field, :value, 'boolean', 'user', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)", + [ + ':field' => 'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED', + ':value' => '0', + ':description' => 'Deaktiviert das Abspielen von Tönen für die persönlichen Benachrichtigungen', + ] + ); + } + +} |
