aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2024-06-18 12:18:17 +0000
committerThomas Hackl <hackl@data-quest.de>2024-06-18 12:18:17 +0000
commit26e02e32841671fa162cf11cb0fa925aa4452da5 (patch)
treee6dc3f0264f966b6095d967828f7971595d27060 /db
parentab3352dec1bc28b5b828b35afb5f2d974d6c3fb1 (diff)
Resolve "Neues Benachrichtungssystem für Stud.IP"
Closes #660 Merge request studip/studip!2557
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.0.9_notification_positioning.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/db/migrations/6.0.9_notification_positioning.php b/db/migrations/6.0.9_notification_positioning.php
new file mode 100644
index 0000000..d6693f3
--- /dev/null
+++ b/db/migrations/6.0.9_notification_positioning.php
@@ -0,0 +1,35 @@
+<?php
+class NotificationPositioning extends Migration
+{
+ public function description()
+ {
+ return 'Adds a personal config option to select the on-screen position of system notifications';
+ }
+
+ protected function up()
+ {
+ DBManager::get()->execute(
+ "INSERT IGNORE INTO `config` VALUES (:field, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc)",
+ [
+ 'field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT',
+ 'value' => 'topcenter',
+ 'type' => 'string',
+ 'range' => 'user',
+ 'section' => '',
+ 'desc' => 'Wo sollen Systembenachrichtigungen im Fenster angezeigt werden? Gültige Werte sind "topcenter" und "bottomright"'
+ ]
+ );
+ }
+
+ protected function down()
+ {
+ DBManager::get()->execute(
+ "DELETE FROM `config_values` WHERE `field` = :field",
+ ['field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT']
+ );
+ DBManager::get()->execute(
+ "DELETE FROM `config` WHERE `field` = :field",
+ ['field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT']
+ );
+ }
+};