diff options
| author | Michaela Brückner <brueckner@data-quest.de> | 2024-01-02 08:32:34 +0000 |
|---|---|---|
| committer | Michaela Brückner <brueckner@data-quest.de> | 2024-01-02 08:32:34 +0000 |
| commit | b6bdba58a8e090cb144bae382457c2e439d8a72a (patch) | |
| tree | 39cf8613a72a27eef0caafce856e6ff6e9a7f474 /db/migrations | |
| parent | 89170f146eaab82fa59069a310e25355399e7b7d (diff) | |
Step 2660 closes #2660
Closes #2660
Merge request studip/studip!2124
Diffstat (limited to 'db/migrations')
| -rw-r--r-- | db/migrations/5.5.16_add_tooltip_fields_for_login.php | 71 | ||||
| -rw-r--r-- | db/migrations/5.5.17_add_login_faq_table.php | 29 | ||||
| -rw-r--r-- | db/migrations/5.5.18_add_login_faq_config.php | 53 |
3 files changed, 153 insertions, 0 deletions
diff --git a/db/migrations/5.5.16_add_tooltip_fields_for_login.php b/db/migrations/5.5.16_add_tooltip_fields_for_login.php new file mode 100644 index 0000000..f4d536b --- /dev/null +++ b/db/migrations/5.5.16_add_tooltip_fields_for_login.php @@ -0,0 +1,71 @@ +<?php + + +class AddTooltipFieldsForLogin extends Migration +{ + public function description() + { + return 'Creates config for login username and password tooltip texts'; + } + + public function up() + { + $query = 'INSERT INTO `config` (`field`, `value`, `type`, `section`, `range`, `description`, `mkdate`, `chdate`) + VALUES (:name, :value, :type, :section, :range, :description, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())'; + $statement = DBManager::get()->prepare($query); + $statement->execute([ + 'name' => 'USERNAME_TOOLTIP_TEXT', + 'value' => 'Geben Sie hier Ihren Stud.IP-Benutzernamen ein.', + 'type' => 'i18n', + 'section' => 'Loginseite', + 'range' => 'global', + 'description' => 'Text für den Tooltip des Benutzernamens auf der Loginseite' + ]); + + $statement->execute([ + 'name' => 'PASSWORD_TOOLTIP_TEXT', + 'value' => 'Geben Sie hier Ihr Stud.IP-Passwort ein. Achten Sie bei der Eingabe auf Groß- und Kleinschreibung.', + 'type' => 'i18n', + 'section' => 'Loginseite', + 'range' => 'global', + 'description' => 'Text für den Tooltip des Benutzernamens auf der Loginseite' + ]); + + $statement->execute([ + 'name' => 'USERNAME_TOOLTIP_ACTIVATED', + 'value' => '1', + 'type' => 'boolean', + 'section' => 'Loginseite', + 'range' => 'global', + 'description' => 'Soll der Tooltip beim Benutzernamen auf der Loginseite sichtbar sein?' + ]); + + $statement->execute([ + 'name' => 'PASSWORD_TOOLTIP_ACTIVATED', + 'value' => '1', + 'type' => 'boolean', + 'section' => 'Loginseite', + 'range' => 'global', + 'description' => 'Soll der Tooltip beim Passwort auf der Loginseite sichtbar sein?' + ]); + + } + + public function down() + { + $query = "DELETE `config`, `config_values`, `i18n` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + LEFT JOIN `i18n` + ON `table` = 'config' + AND `field` = 'value' + AND `object_id` = MD5(`config`.`field`) + WHERE `field` IN ( + 'USERNAME_TOOLTIP_TEXT', + 'PASSWORD_TOOLTIP_TEXT', + 'USERNAME_TOOLTIP_ACTIVATED', + 'PASSWORD_TOOLTIP_ACTIVATED' + )"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/5.5.17_add_login_faq_table.php b/db/migrations/5.5.17_add_login_faq_table.php new file mode 100644 index 0000000..2a99909 --- /dev/null +++ b/db/migrations/5.5.17_add_login_faq_table.php @@ -0,0 +1,29 @@ +<?php + +class AddLoginFaqTable extends Migration +{ + public function description() + { + return 'Create table for login page FAQ'; + } + + public function up() + { + $query = "CREATE TABLE IF NOT EXISTS `login_faq` ( + `faq_id` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `description` text NOT NULL, + PRIMARY KEY (`faq_id`) + )"; + DBManager::get()->exec($query); + } + + public function down() + { + DBManager::get()->exec('DROP TABLE IF EXISTS `login_faq`'); + + $query = "DELETE FROM `i18n` + WHERE `table` = 'login_faq`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/5.5.18_add_login_faq_config.php b/db/migrations/5.5.18_add_login_faq_config.php new file mode 100644 index 0000000..3196e34 --- /dev/null +++ b/db/migrations/5.5.18_add_login_faq_config.php @@ -0,0 +1,53 @@ +<?php + + +class AddLoginFaqConfig extends Migration +{ + public function description() + { + return 'Creates configs for login faq: Visibility and title (eg.: Hilfe zum Login)'; + } + + public function up() + { + $query = 'INSERT INTO `config` (`field`, `value`, `type`, `section`, `range`, `description`, `mkdate`, `chdate`) + VALUES (:name, :value, :type, :section, :range, :description, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())'; + $statement = DBManager::get()->prepare($query); + $statement->execute([ + 'name' => 'LOGIN_FAQ_TITLE', + 'value' => 'Hinweise zum Login', + 'type' => 'i18n', + 'section' => 'Loginseite', + 'range' => 'global', + 'description' => 'Überschrift für den FAQ-Bereich auf der Loginseite' + ]); + + $statement->execute([ + 'name' => 'LOGIN_FAQ_VISIBILITY', + 'value' => '1', + 'type' => 'boolean', + 'section' => 'Loginseite', + 'range' => 'global', + 'description' => 'Soll der FAQ-Bereich auf der Loginseite sichtbar sein?' + ]); + + } + + public function down() + { + $query = "DELETE `config`, `config_values`, `i18n` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + LEFT JOIN `i18n` + ON `table` = 'config' + AND `field` = 'value' + AND `object_id` = MD5(`config`.`field`) + WHERE `field` IN ( + 'LOGIN_FAQ_TITLE', + 'LOGIN_FAQ_VISIBILITY', + 'USERNAME_TOOLTIP_ACTIVATED', + 'PASSWORD_TOOLTIP_ACTIVATED' + )"; + DBManager::get()->exec($query); + } +} |
