aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2023-05-11 09:36:46 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-05-11 09:36:46 +0000
commit796233dd7d294f5ff7c6b2547c02b56c5a6533b9 (patch)
treedfc0fd475a19665a5e8d98bb67d9494c122fc402 /db
parentb57422a8a850428c39fb622c597c98a63e398ad5 (diff)
Resolve "Persönliche Angaben: Text sollte konfigurierbar sein"
Closes #2582 Merge request studip/studip!1781
Diffstat (limited to 'db')
-rw-r--r--db/migrations/5.4.4_add_personal_details_info_text_config.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/db/migrations/5.4.4_add_personal_details_info_text_config.php b/db/migrations/5.4.4_add_personal_details_info_text_config.php
new file mode 100644
index 0000000..0cf52d8
--- /dev/null
+++ b/db/migrations/5.4.4_add_personal_details_info_text_config.php
@@ -0,0 +1,44 @@
+<?php
+
+class AddPersonalDetailsInfoTextConfig extends Migration
+{
+ public function description()
+ {
+ return 'Adds the configuration PERSONAL_DETAILS_INFO_TEXT, if it doesn\'t exist yet. Also adds english translation.';
+ }
+
+ protected function up()
+ {
+ $db = DBManager::get();
+
+ $db->exec(
+ "INSERT IGNORE INTO `config`
+ (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`)
+ VALUES
+ (
+ 'PERSONAL_DETAILS_INFO_TEXT', 'Einige Ihrer persönlichen Daten werden nicht in Stud.IP verwaltet und können daher hier nicht geändert werden.',
+ 'i18n', 'global', 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(),
+ 'Der Infotext der unter Profil->Persönliche Angaben->Grunddaten angezeigt wird, wenn man nicht die Standard-Auth nutzt.'
+ )"
+ );
+
+ $db->execute(
+ "INSERT IGNORE INTO `i18n`
+ (`object_id`, `table`, `field`, `lang`, `value`)
+ VALUES
+ (
+ MD5('PERSONAL_DETAILS_INFO_TEXT'), 'config', 'value', 'en_GB',
+ 'Some of your personal data is not managed in Stud.IP and therefore cannot be changed here.'
+ )"
+ );
+ }
+
+ protected function down()
+ {
+ $db = DBManager::get();
+
+ $db->exec("DELETE FROM `config_values` WHERE `field` = 'PERSONAL_DETAILS_INFO_TEXT'");
+ $db->exec("DELETE FROM `config` WHERE `field` = 'PERSONAL_DETAILS_INFO_TEXT'");
+ $db->exec("DELETE FROM `i18n` WHERE `object_id` = MD5('PERSONAL_DETAILS_INFO_TEXT') AND `table` = 'config' AND `field` = 'value'");
+ }
+}