aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2024-11-25 10:13:55 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2024-11-25 10:13:55 +0000
commitcdc7050e5be7a0813b4634ca2aaf33fff311ff52 (patch)
tree8fe6a73dab7c0e43b3158a50b1d517bcfe2d120d /db
parent773d384678349e16ccc41c888a30b10736860816 (diff)
Resolve "Automatisierte Angaben in Fragebögen"
Closes #4259 Merge request studip/studip!3156
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.0.33_add_automated_data_questiontype.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/db/migrations/6.0.33_add_automated_data_questiontype.php b/db/migrations/6.0.33_add_automated_data_questiontype.php
new file mode 100644
index 0000000..7a318fe
--- /dev/null
+++ b/db/migrations/6.0.33_add_automated_data_questiontype.php
@@ -0,0 +1,36 @@
+<?php
+
+class AddAutomatedDataQuestionType extends Migration
+{
+
+ public function description()
+ {
+ return 'Adds a new question type Automated Data. You can disable this question type by changing the config QUESTIONNAIRE_AUTOMATED_DATA_PERM.';
+ }
+
+ public function up()
+ {
+ $query = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`)
+ VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)";
+
+ $statement = DBManager::get()->prepare($query);
+ $statement->execute([
+ ':name' => 'QUESTIONNAIRE_AUTOMATED_DATA_PERM',
+ ':description' => 'Ab welchem Status (autor, tutor, dozent, admin, root) darf man den Fragetyp Automatik in Fragebögen einbauen?',
+ ':range' => 'global',
+ ':type' => 'string',
+ ':section' => 'global',
+ ':value' => 'autor'
+ ]);
+ }
+
+ public function down()
+ {
+ $query = "DELETE FROM `config`
+ WHERE `field` = 'QUESTIONNAIRE_AUTOMATED_DATA_PERM' ";
+ DBManager::get()->exec($query);
+ $query = "DELETE FROM `config_values`
+ WHERE `field` = 'QUESTIONNAIRE_AUTOMATED_DATA_PERM' ";
+ DBManager::get()->exec($query);
+ }
+}