From eddc17064d610dbcf372739dd5c5fd2caa788048 Mon Sep 17 00:00:00 2001 From: Elmar Ludwig Date: Mon, 30 Aug 2021 17:30:55 +0200 Subject: rename all migrations to 1.x --- app/controllers/web_migrate.php | 2 +- db/migrations/01_init_migrations.php | 20 - db/migrations/02_step_102_datenfeldtypen.php | 116 - db/migrations/03_step_87_extern_configurations.php | 46 - db/migrations/04_step_116_participant_view.php | 32 - db/migrations/05_step_25_raumzeit_migrations.php | 169 -- .../06_step_25_raumzeit_db_conversion.php | 241 -- db/migrations/07_table_token_class.php | 35 - db/migrations/08_step_117_studienmodule.php | 261 -- db/migrations/09_step_00111_admission.php | 34 - db/migrations/1.100_step00248_chat_extinction.php | 26 + db/migrations/1.101_step00246_blubber.php | 124 + db/migrations/1.102_remove_guestbook_migration.php | 36 + db/migrations/1.104_setup_cronjobs.php | 165 ++ db/migrations/1.105_step_00247_forum.php | 167 ++ .../1.106_step_00247_forum_data_migration.php | 310 ++ .../1.107_step00247_forum_performance.php | 37 + db/migrations/1.108_visibilityapi.php | 56 + .../1.109_init_custom_blubber_streams.php | 80 + db/migrations/1.10_image_proxy.php | 35 + db/migrations/1.110_scm_add_position.php | 46 + db/migrations/1.111_step_3574_domain.php | 25 + db/migrations/1.113_init_mailqueue.php | 89 + .../1.114_create_table_blubber_reshares.php | 28 + db/migrations/1.115_performance_tic_3759.php | 19 + db/migrations/1.116_step_00263_inst_gendering.php | 15 + db/migrations/1.117_forum_add_close.php | 21 + db/migrations/1.118_forum_sticky_posts.php | 21 + .../1.119_init_termin_related_groups_table.php | 25 + db/migrations/1.11_lock_rulez.php | 38 + .../1.120_create_open_graph_data_table.php | 48 + .../1.121_step_00266_forced_lock_rules.php | 20 + db/migrations/1.122_add_seminar_id_to_folder.php | 103 + .../1.123_tic_3993_remove_dont_delete.php | 33 + .../1.124_step_00255_important_semnumber.php | 34 + .../1.125_repair_statusgroup_user_numberation.php | 46 + .../1.126_tic_4044_invisible_studygroups.php | 32 + db/migrations/1.127_setup_api.php | 217 ++ db/migrations/1.128_step00240_coursesets.php | 500 ++++ db/migrations/1.129_wysiwyg_config_option.php | 24 + db/migrations/1.12_step_120_userpic.php | 37 + .../1.130_step_00267_preliminary_accounts.php | 15 + db/migrations/1.131_score_config_option.php | 21 + db/migrations/1.132_step_00268_event_log.php | 30 + .../1.133_tic_4072_new_password_hashing.php | 26 + db/migrations/1.134_step_00269_plugin_roles.php | 21 + .../1.135_tic_4011_remove_teilnehmer_view.php | 19 + db/migrations/1.136_wiki_remove_camel_case.php | 67 + db/migrations/1.137_studygroup_invitations.php | 24 + db/migrations/1.138_create_tags_for_messaging.php | 73 + db/migrations/1.139_step00272_tours.php | 80 + .../1.13_remove_fields_from_extermine.php | 23 + .../1.140_tic4450_archiv_protected_files.php | 20 + .../1.141_tic4454_roomrequest_options.php | 28 + db/migrations/1.142_tic4463_remove_stm.php | 30 + .../1.143_step00249_my_courses_config.php | 34 + db/migrations/1.144_files.php | 213 ++ db/migrations/1.145_tic4491_help_content.php | 48 + db/migrations/1.146_step_00253_startseite.php | 107 + db/migrations/1.148_tic_4520_sem_tree_display.php | 44 + db/migrations/1.14_step_00123_admission2.php | 30 + db/migrations/1.150_help_tours_and_content.php | 385 +++ .../1.151_add_automatic_updates_to_plugins.php | 25 + .../1.152_tic_5117_course_member_admission.php | 36 + .../1.153_tic_4163_add_studip_shortname.php | 35 + db/migrations/1.154_recalculate_score.php | 145 + db/migrations/1.155_tic_5170_clean_up.php | 25 + .../1.156_tic_5204_add_datafield_type.php | 15 + db/migrations/1.157_contact_rework.php | 48 + db/migrations/1.158_step_00283_calendar_sorm.php | 139 + db/migrations/1.159_step_00275_plus.php | 26 + .../1.15_step_00129_email_restriction.php | 27 + .../1.160_step_00283_update_calendar_settings.php | 66 + db/migrations/1.161_step_00284_help_editor.php | 60 + db/migrations/1.162_step_00283_calendar_user.php | 23 + db/migrations/1.163_transfer_calpermission.php | 18 + db/migrations/1.164_help_tours_en.php | 175 ++ db/migrations/1.166_add_cache_operations_table.php | 34 + db/migrations/1.167_tic5661_setup_cronjob.php | 37 + db/migrations/1.168_tic5661_add_config.php | 37 + .../1.16_step_00126_embedding_flash_movies.php | 29 + db/migrations/1.170_step_00286_coursewizard.php | 63 + db/migrations/1.171_open_personal_file_areas.php | 48 + .../1.172_tic_5961_add_config_default_sem.php | 32 + ...1.173_biest5982_fix_resources_objects_level.php | 61 + db/migrations/1.174_tic_6018_clean_news.php | 32 + .../1.175_biest6024_fix_help_tours_en.php | 55 + db/migrations/1.176_limit_mailqueue.php | 31 + db/migrations/1.177_tic5415_plugin_assets.php | 38 + db/migrations/1.178_change_opengraph_data_pk.php | 29 + .../1.179_tic6188_view_resource_occupation.php | 50 + .../1.17_db_optimierung_kontingentierung.php | 38 + .../1.180_add_seminar_is_complete_status.php | 37 + db/migrations/1.181_extend_wiki_size.php | 38 + db/migrations/1.182_step_raum_zeit_end_offset.php | 28 + .../1.183_tic6000_datafields_visibility.php | 27 + db/migrations/1.184_add_wiki_help_tours.php | 149 + db/migrations/1.185_tic6025_performance.php | 46 + db/migrations/1.186_step_00294_innodb.php | 179 ++ db/migrations/1.187_step_291_questionnaires.php | 275 ++ .../1.188_step_00296_appointment_requests.php | 78 + .../1.189_step_00288_sem_class_raumzeit.php | 49 + .../1.18_step_00139_upload_file_reorg.php | 52 + db/migrations/1.190_allow_topics_to_be_public.php | 25 + db/migrations/1.191_add_dedicated_admins_role.php | 28 + ..._add_user_config_for_admin_display_settings.php | 37 + ...1.193_tic6653_add_advanced_coursewizardstep.php | 23 + .../1.194_tic_6576_preferential_admission.php | 58 + .../1.195_tic_6655_admissionrule_compatibility.php | 105 + db/migrations/1.196_extend_ressources.php | 22 + .../1.197_step_00301_admission_conditiongroups.php | 45 + db/migrations/1.198_add_activities.php | 114 + db/migrations/1.199_step_00302_modulverwaltung.php | 896 ++++++ .../1.19_step_00141_zip_download_restrictions.php | 24 + db/migrations/1.1_init_migrations.php | 20 + db/migrations/1.200_step_00299_statusgroups.php | 41 + db/migrations/1.201_i18n_content.php | 31 + db/migrations/1.202_remove_skype_status.php | 24 + db/migrations/1.203_archive_help_texts.php | 45 + db/migrations/1.204_dialog_from_notification.php | 24 + db/migrations/1.205_course_scm_helptext.php | 37 + .../1.206_alter_columns_weekoffset_to_int.php | 32 + db/migrations/1.207_add_etask_tables.php | 138 + .../1.208_migrate_questionnaire_questions.php | 294 ++ db/migrations/1.209_convert_cronjob_logs.php | 44 + .../1.20_calendar_events_class_default.php | 23 + db/migrations/1.210_tic_7206.php | 13 + .../1.211_tic7307_admission_rule_path.php | 23 + db/migrations/1.212_refactor_config_local.php | 193 ++ db/migrations/1.213_log_action_statusgroups.php | 35 + db/migrations/1.214_textmarkup_datafield.php | 22 + db/migrations/1.215_default_data_field_values.php | 29 + db/migrations/1.216_add_evaldate.php | 22 + .../1.217_course_number_format_config.php | 59 + db/migrations/1.218_extend_phone_fax_size.php | 32 + db/migrations/1.219_loginbackgrounds.php | 36 + db/migrations/1.21_more_indexing.php | 32 + db/migrations/1.220_step_00313_coursegroups.php | 26 + db/migrations/1.221_moadb.php | 516 ++++ db/migrations/1.222_utf8_conversion.php | 242 ++ .../1.223_course_mailing_for_students.php | 19 + db/migrations/1.224_db_cache_table.php | 29 + db/migrations/1.225_extend_course_completion.php | 27 + db/migrations/1.226_config_values.php | 134 + ...27_biest_8034_config_switch_for_child_insts.php | 33 + db/migrations/1.228_show_adressees.php | 47 + db/migrations/1.229_step_00278_global_search.php | 120 + ..._lit_list_content_note_from_varchar_to_text.php | 19 + db/migrations/1.230_widgets.php | 441 +++ db/migrations/1.231_add_files_search_index.php | 190 ++ db/migrations/1.232_step_00315_mvv_i18n.php | 644 ++++ .../1.233_step_00316_mvvkernintegration.php | 36 + .../1.234_add_mkdate_to_statusgruppe_user.php | 17 + .../1.235_tic8335_paper_related_topics.php | 41 + db/migrations/1.236_config_public_topics.php | 44 + db/migrations/1.237_config_mail_subject.php | 39 + db/migrations/1.238_db_updates_for_42.php | 76 + db/migrations/1.239_step_00327.php | 139 + ....23_enlarge_object_contentmodules_module_id.php | 18 + db/migrations/1.240_tic8538.php | 23 + .../1.241_step_00320_config_search_navigation.php | 62 + .../1.242_tic_8546_search_show_admission_state.php | 36 + .../1.243_tic8773_sort_news_by_chdate.php | 26 + db/migrations/1.244_config_default_seats.php | 32 + db/migrations/1.245_tic7804_wiki_permissions.php | 44 + db/migrations/1.246_consultations.php | 315 ++ db/migrations/1.247_step_00330.php | 24 + db/migrations/1.248_step_00331_ilias_interface.php | 56 + db/migrations/1.249_lti_consumer.php | 113 + .../1.24_another_index_for_ex_termine.php | 30 + db/migrations/1.250_disable_archive_search.php | 34 + db/migrations/1.251_log_event_autoincrement.php | 36 + db/migrations/1.252_js_assets.php | 26 + db/migrations/1.253_adjust_token_table.php | 34 + db/migrations/1.254_hash_opengraph_table.php | 26 + .../1.255_tic9368_datafield_for_institution.php | 21 + .../1.256_tic9543_update_help_content.php | 102 + .../1.257_tic9544_add_external_id_semester.php | 22 + ....258_tic7443_create_lvgruppen_independently.php | 34 + db/migrations/1.259_migrations_reloaded.php | 35 + db/migrations/1.25_step_00098_user_domains.php | 41 + db/migrations/1.260_tfa.php | 81 + db/migrations/1.261_gradebook.php | 74 + db/migrations/1.262_blubbermessenger.php | 171 ++ db/migrations/1.263_blubbermessenger_keys.php | 22 + db/migrations/1.264_blubbermessenger_search.php | 101 + db/migrations/1.265_blubbermessenger_flat.php | 212 ++ .../1.266_consultations_option_exclude_expired.php | 31 + .../1.267_jsonapi_dangerous_routes_config.php | 36 + db/migrations/1.268_unrestricted_userdomains.php | 21 + .../1.269_fix_missing_consultation_events.php | 95 + db/migrations/1.26_step_00146_lock_rules2.php | 45 + .../1.270_step_00332_mvv_overlapping_courses.php | 86 + db/migrations/1.271_jsonapi_cors_origin_config.php | 35 + .../1.272_step_00338_instituteplaning.php | 79 + .../1.273_config_for_download_counter_display.php | 31 + ...274_add_enable_free_access_for_courses_only.php | 34 + db/migrations/1.275_additional_mvv_tables.php | 295 ++ .../1.276_tic8458_add_upload_description.php | 36 + db/migrations/1.277_room_management_migration.php | 2390 +++++++++++++++ .../1.278_resize_auth_user_md5_email_field.php | 25 + .../1.279_config_wiki_comments_enable.php | 31 + .../1.27_step_147_mail_activationlink.php | 31 + db/migrations/1.280_step_00338_institutecolors.php | 25 + db/migrations/1.281_step_00333_feedback.php | 108 + .../1.282_config_for_stgteilversion_userfilter.php | 31 + db/migrations/1.283_add_filetypes.php | 48 + ...4_change_schedule_color_with_category_index.php | 61 + db/migrations/1.285_fixes_on_schedule_coloring.php | 79 + db/migrations/1.286_remove_new_widget_system.php | 66 + db/migrations/1.287_replace_library_system.php | 144 + .../1.288_tic9898_add_course_wizard_step.php | 34 + db/migrations/1.289_tic10318_http_proxy.php | 40 + db/migrations/1.28_delete_wiki_links.php | 29 + db/migrations/1.290_termsconfig.php | 35 + db/migrations/1.291_step345_wiki_ancestor.php | 21 + ...2_add_admin_courses_sidebar_active_elements.php | 36 + db/migrations/1.293_adjust_i18n_tables.php | 21 + db/migrations/1.294_mvv_bugs.php | 66 + ...1.295_remove_invalid_modul_user_assignments.php | 22 + db/migrations/1.296_biest_10803_fix.php | 132 + db/migrations/1.297_database_changes_tic_9218.php | 3112 ++++++++++++++++++++ .../1.298_hide_studygroups_from_profile.php | 31 + db/migrations/1.299_tiled_courses.php | 53 + .../1.29_step_00138_studienbereichszuordnung.php | 43 + db/migrations/1.2_step_102_datenfeldtypen.php | 116 + db/migrations/1.300_tiled_courses_2.php | 34 + db/migrations/1.301_tiled_courses_3.php | 31 + .../1.302_add_missing_indices_resources.php | 40 + db/migrations/1.303_add_missing_indices.php | 43 + db/migrations/1.304_config_i18n.php | 36 + db/migrations/1.305_course_members_hide.php | 32 + db/migrations/1.306_tic_9101.php | 54 + db/migrations/1.307_introduce_range_config.php | 28 + db/migrations/1.308_consultation_extension.php | 171 ++ db/migrations/1.309_course_groups_hide.php | 32 + db/migrations/1.30_auth_user_md5_perms.php | 23 + .../1.310_add_seminare_semester_table.php | 43 + .../1.311_add_seminare_semester_course_index.php | 24 + db/migrations/1.312_tic_11041.php | 23 + .../1.313_tic11044_admin_course_notices.php | 49 + db/migrations/1.314_step_00349.php | 650 ++++ db/migrations/1.315_tic_8183_terms_admission.php | 67 + db/migrations/1.316_admin_related_inst.php | 34 + db/migrations/1.317_oercampus_integration.php | 436 +++ db/migrations/1.318_step_00353_cache.php | 62 + .../1.319_change_blubber_thread_following.php | 81 + db/migrations/1.31_high_priority_messages.php | 31 + db/migrations/1.320_migration_history_reworked.php | 44 + db/migrations/1.321_add_terms_accepted_config.php | 26 + .../1.322_add_missing_evaluation_configuration.php | 31 + .../1.323_biest_11462_change_column_types.php | 29 + db/migrations/1.324_drop_citation_style.php | 43 + .../1.325_tic11044_admin_course_notices_2.php | 88 + db/migrations/1.326_courseware_integration.php | 199 ++ db/migrations/1.328_add_content_widget.php | 46 + db/migrations/1.32_restricted_user_management.php | 32 + db/migrations/1.33_lock_rule_admin_perm.php | 43 + .../1.34_add_allow_selfassign_institute.php | 32 + db/migrations/1.35_add_additional_log_actions.php | 127 + .../1.36_step_00156_editierbares_impressum.php | 161 + db/migrations/1.37_log_actions_expires.php | 25 + db/migrations/1.38_allow_admin_useraccess.php | 32 + .../1.39_step_00153_studienmodulmanagement.php | 32 + .../1.3_step_87_extern_configurations.php | 46 + db/migrations/1.40_add_index_to_log_events.php | 15 + db/migrations/1.41_step_00157_rolemanagment.php | 22 + .../1.42_change_action_id_inst_create.php | 21 + db/migrations/1.43_step_00159_datafieldentry.php | 20 + .../1.44_add_switch_to_preselect_semester.php | 23 + db/migrations/1.45_refine_logevents.php | 62 + .../1.46_step00172_remove_ilias_connect.php | 22 + ...add_option_resources_hide_past_single_dates.php | 62 + .../1.48_step_00174_plugin_interfaces.php | 31 + db/migrations/1.49_step_00150_studygroups.php | 74 + db/migrations/1.4_step_116_participant_view.php | 32 + db/migrations/1.50_add_option_step_152.php | 46 + db/migrations/1.51_unhide_dozents.php | 20 + .../1.52_additional_semtree_log_actions.php | 46 + db/migrations/1.53_file_and_folder_priority.php | 19 + db/migrations/1.54_step_00161_plugin_admin.php | 35 + db/migrations/1.55_add_missing_log_actions.php | 57 + db/migrations/1.56_step_00176_wap.php | 24 + db/migrations/1.57_step_00158_privacy.php | 107 + db/migrations/1.58_add_config_allow_fakadmin.php | 38 + db/migrations/1.59_step_00194_studycourse.php | 33 + db/migrations/1.5_step_25_raumzeit_migrations.php | 169 ++ db/migrations/1.60_step_00191_modulesenable.php | 107 + db/migrations/1.61_remove_studygroupdozent.php | 18 + db/migrations/1.62_gender_iso_5218.php | 24 + db/migrations/1.63_tic1207_config.php | 52 + .../1.64_step_00199_forced_course_grouping.php | 40 + db/migrations/1.65_step_00198_deputies.php | 62 + .../1.66_config_filesystem_multicopy_enable.php | 34 + .../1.67_step_00204_no_document_deletion.php | 26 + db/migrations/1.68_add_schedule_table.php | 63 + .../1.69_step_00202_enhanced_seminar_cycle.php | 88 + .../1.6_step_25_raumzeit_db_conversion.php | 241 ++ db/migrations/1.70_step_00184_html5_video.php | 120 + db/migrations/1.71_step_00192_page_layout.php | 45 + .../1.72_config_ajax_autocomplete_disabled.php | 34 + db/migrations/1.73_step_00193_html_email.php | 46 + db/migrations/1.74_tic1422_pagination.php | 46 + db/migrations/1.75_pdf_logo_configuration.php | 46 + db/migrations/1.76_termin_related_persons.php | 36 + db/migrations/1.77_step_00223_lockrules.php | 28 + db/migrations/1.78_step00219_webservice_access.php | 30 + .../1.79_step_216_automatisiertes_eintragen.php | 72 + db/migrations/1.7_table_token_class.php | 35 + .../1.80_skiplinks_enable_configuration.php | 47 + db/migrations/1.81_step_209_teilnehmericon.php | 37 + db/migrations/1.83_tic1992_privacydefaults.php | 71 + db/migrations/1.84_step_226_dozenten_labels.php | 41 + db/migrations/1.85_tic2007_schedule_enable.php | 46 + db/migrations/1.86_step_228_raumanfragen.php | 27 + db/migrations/1.87_tic1091_chat.php | 19 + db/migrations/1.88_biest2055_terms.php | 23 + db/migrations/1.89_step_00205_group_calendar.php | 103 + db/migrations/1.8_step_117_studienmodule.php | 261 ++ db/migrations/1.90_tic2395_smileys.php | 28 + db/migrations/1.91_tic2568_comment_internal.php | 28 + db/migrations/1.92_remove_schedule_user_table.php | 15 + db/migrations/1.93_sem_classes_convert_into_db.php | 286 ++ .../1.94_step237_datafields_mandatory.php | 28 + .../1.95_extend_userstudiengang_primarykey.php | 34 + .../1.96_step00234_homepageplugin_activation.php | 38 + db/migrations/1.97_init_personal_notifications.php | 51 + db/migrations/1.98_user_data_to_config.php | 201 ++ db/migrations/1.99_step00245_simpleormap.php | 13 + db/migrations/1.9_step_00111_admission.php | 34 + db/migrations/100_step00248_chat_extinction.php | 26 - db/migrations/101_step00246_blubber.php | 124 - db/migrations/102_remove_guestbook_migration.php | 36 - db/migrations/104_setup_cronjobs.php | 165 -- db/migrations/105_step_00247_forum.php | 167 -- .../106_step_00247_forum_data_migration.php | 310 -- db/migrations/107_step00247_forum_performance.php | 37 - db/migrations/108_visibilityapi.php | 56 - db/migrations/109_init_custom_blubber_streams.php | 80 - db/migrations/10_image_proxy.php | 35 - db/migrations/110_scm_add_position.php | 46 - db/migrations/111_step_3574_domain.php | 25 - db/migrations/113_init_mailqueue.php | 89 - .../114_create_table_blubber_reshares.php | 28 - db/migrations/115_performance_tic_3759.php | 19 - db/migrations/116_step_00263_inst_gendering.php | 15 - db/migrations/117_forum_add_close.php | 21 - db/migrations/118_forum_sticky_posts.php | 21 - .../119_init_termin_related_groups_table.php | 25 - db/migrations/11_lock_rulez.php | 38 - db/migrations/120_create_open_graph_data_table.php | 48 - db/migrations/121_step_00266_forced_lock_rules.php | 20 - db/migrations/122_add_seminar_id_to_folder.php | 103 - db/migrations/123_tic_3993_remove_dont_delete.php | 33 - .../124_step_00255_important_semnumber.php | 34 - .../125_repair_statusgroup_user_numberation.php | 46 - .../126_tic_4044_invisible_studygroups.php | 32 - db/migrations/127_setup_api.php | 217 -- db/migrations/128_step00240_coursesets.php | 500 ---- db/migrations/129_wysiwyg_config_option.php | 24 - db/migrations/12_step_120_userpic.php | 37 - .../130_step_00267_preliminary_accounts.php | 15 - db/migrations/131_score_config_option.php | 21 - db/migrations/132_step_00268_event_log.php | 30 - .../133_tic_4072_new_password_hashing.php | 26 - db/migrations/134_step_00269_plugin_roles.php | 21 - .../135_tic_4011_remove_teilnehmer_view.php | 19 - db/migrations/136_wiki_remove_camel_case.php | 67 - db/migrations/137_studygroup_invitations.php | 24 - db/migrations/138_create_tags_for_messaging.php | 73 - db/migrations/139_step00272_tours.php | 80 - db/migrations/13_remove_fields_from_extermine.php | 23 - .../140_tic4450_archiv_protected_files.php | 20 - db/migrations/141_tic4454_roomrequest_options.php | 28 - db/migrations/142_tic4463_remove_stm.php | 30 - db/migrations/143_step00249_my_courses_config.php | 34 - db/migrations/144_files.php | 213 -- db/migrations/145_tic4491_help_content.php | 48 - db/migrations/146_step_00253_startseite.php | 107 - db/migrations/148_tic_4520_sem_tree_display.php | 44 - db/migrations/14_step_00123_admission2.php | 30 - db/migrations/150_help_tours_and_content.php | 385 --- .../151_add_automatic_updates_to_plugins.php | 25 - .../152_tic_5117_course_member_admission.php | 36 - .../153_tic_4163_add_studip_shortname.php | 35 - db/migrations/154_recalculate_score.php | 145 - db/migrations/155_tic_5170_clean_up.php | 25 - db/migrations/156_tic_5204_add_datafield_type.php | 15 - db/migrations/157_contact_rework.php | 48 - db/migrations/158_step_00283_calendar_sorm.php | 139 - db/migrations/159_step_00275_plus.php | 26 - db/migrations/15_step_00129_email_restriction.php | 27 - .../160_step_00283_update_calendar_settings.php | 66 - db/migrations/161_step_00284_help_editor.php | 60 - db/migrations/162_step_00283_calendar_user.php | 23 - db/migrations/163_transfer_calpermission.php | 18 - db/migrations/164_help_tours_en.php | 175 -- db/migrations/166_add_cache_operations_table.php | 34 - db/migrations/167_tic5661_setup_cronjob.php | 37 - db/migrations/168_tic5661_add_config.php | 37 - .../16_step_00126_embedding_flash_movies.php | 29 - db/migrations/170_step_00286_coursewizard.php | 63 - db/migrations/171_open_personal_file_areas.php | 48 - .../172_tic_5961_add_config_default_sem.php | 32 - .../173_biest5982_fix_resources_objects_level.php | 61 - db/migrations/174_tic_6018_clean_news.php | 32 - db/migrations/175_biest6024_fix_help_tours_en.php | 55 - db/migrations/176_limit_mailqueue.php | 31 - db/migrations/177_tic5415_plugin_assets.php | 38 - db/migrations/178_change_opengraph_data_pk.php | 29 - .../179_tic6188_view_resource_occupation.php | 50 - .../17_db_optimierung_kontingentierung.php | 38 - .../180_add_seminar_is_complete_status.php | 37 - db/migrations/181_extend_wiki_size.php | 38 - db/migrations/182_step_raum_zeit_end_offset.php | 28 - .../183_tic6000_datafields_visibility.php | 27 - db/migrations/184_add_wiki_help_tours.php | 149 - db/migrations/185_tic6025_performance.php | 46 - db/migrations/186_step_00294_innodb.php | 179 -- db/migrations/187_step_291_questionnaires.php | 275 -- .../188_step_00296_appointment_requests.php | 78 - .../189_step_00288_sem_class_raumzeit.php | 49 - db/migrations/18_step_00139_upload_file_reorg.php | 52 - db/migrations/190_allow_topics_to_be_public.php | 25 - db/migrations/191_add_dedicated_admins_role.php | 28 - ..._add_user_config_for_admin_display_settings.php | 37 - .../193_tic6653_add_advanced_coursewizardstep.php | 23 - .../194_tic_6576_preferential_admission.php | 58 - .../195_tic_6655_admissionrule_compatibility.php | 105 - db/migrations/196_extend_ressources.php | 22 - .../197_step_00301_admission_conditiongroups.php | 45 - db/migrations/198_add_activities.php | 114 - db/migrations/199_step_00302_modulverwaltung.php | 896 ------ .../19_step_00141_zip_download_restrictions.php | 24 - db/migrations/200_step_00299_statusgroups.php | 41 - db/migrations/20190702_tfa.php | 81 - db/migrations/20190705_gradebook.php | 74 - db/migrations/201908014_blubbermessenger.php | 171 -- db/migrations/201908015_blubbermessenger_keys.php | 22 - .../201908016_blubbermessenger_search.php | 101 - db/migrations/201908017_blubbermessenger_flat.php | 212 -- ...190823_consultations_option_exclude_expired.php | 31 - .../20190903_jsonapi_dangerous_routes_config.php | 36 - .../20190904_unrestricted_userdomains.php | 21 - .../20190917_fix_missing_consultation_events.php | 95 - ...20190919_step_00332_mvv_overlapping_courses.php | 86 - .../20191002_jsonapi_cors_origin_config.php | 35 - .../20191014_step_00338_instituteplaning.php | 79 - ...0191018_config_for_download_counter_display.php | 31 - ...105_add_enable_free_access_for_courses_only.php | 34 - db/migrations/20191112_additional_mvv_tables.php | 295 -- .../20191115_tic8458_add_upload_description.php | 36 - .../20191120_room_management_migration.php | 2390 --------------- .../20191122_resize_auth_user_md5_email_field.php | 25 - .../20191210_config_wiki_comments_enable.php | 31 - .../20191211_step_00338_institutecolors.php | 25 - db/migrations/20192208_step_00333_feedback.php | 108 - db/migrations/201_i18n_content.php | 31 - ...200108_config_for_stgteilversion_userfilter.php | 31 - db/migrations/202001291_add_filetypes.php | 48 - ...6_change_schedule_color_with_category_index.php | 61 - .../20200307_fixes_on_schedule_coloring.php | 79 - .../20200414_remove_new_widget_system.php | 66 - db/migrations/20200423_replace_library_system.php | 144 - .../20200514_tic9898_add_course_wizard_step.php | 34 - db/migrations/20200515_tic10318_http_proxy.php | 40 - db/migrations/20200522_termsconfig.php | 35 - db/migrations/20200709_step345_wiki_ancestor.php | 21 - ...3_add_admin_courses_sidebar_active_elements.php | 36 - db/migrations/20200811_adjust_i18n_tables.php | 21 - db/migrations/20200909_mvv_bugs.php | 66 - ...00910_remove_invalid_modul_user_assignments.php | 22 - db/migrations/20201002_biest_10803_fix.php | 132 - .../20201005_database_changes_tic_9218.php | 3112 -------------------- .../20201007_hide_studygroups_from_profile.php | 31 - db/migrations/20201023_tiled_courses.php | 53 - db/migrations/20201024_tiled_courses_2.php | 34 - db/migrations/20201025_tiled_courses_3.php | 31 - .../202011031_add_missing_indices_resources.php | 40 - db/migrations/20201103_add_missing_indices.php | 43 - db/migrations/20201108_config_i18n.php | 36 - db/migrations/20201110_course_members_hide.php | 32 - db/migrations/20201113_tic_9101.php | 54 - db/migrations/20201115_introduce_range_config.php | 28 - db/migrations/20201116_consultation_extension.php | 171 -- db/migrations/20201203_course_groups_hide.php | 32 - .../20201211_add_seminare_semester_table.php | 43 - ...20201212_add_seminare_semester_course_index.php | 24 - db/migrations/20210104_tic_11041.php | 23 - .../20210108_tic11044_admin_course_notices.php | 49 - db/migrations/20210201_step_00349.php | 650 ---- .../20210204_tic_8183_terms_admission.php | 67 - db/migrations/20210212_admin_related_inst.php | 34 - db/migrations/202102161_oercampus_integration.php | 436 --- db/migrations/20210226_step_00353_cache.php | 62 - .../20210317_change_blubber_thread_following.php | 81 - .../20210322_migration_history_reworked.php | 44 - .../20210406_add_terms_accepted_config.php | 26 - ...210422_add_missing_evaluation_configuration.php | 31 - .../20210425_biest_11462_change_column_types.php | 29 - db/migrations/20210503_drop_citation_style.php | 43 - .../20210505_tic11044_admin_course_notices_2.php | 88 - db/migrations/20210511_courseware_integration.php | 199 -- db/migrations/202106231_add_content_widget.php | 46 - db/migrations/202_remove_skype_status.php | 24 - db/migrations/203_archive_help_texts.php | 45 - db/migrations/204_dialog_from_notification.php | 24 - db/migrations/205_course_scm_helptext.php | 37 - .../206_alter_columns_weekoffset_to_int.php | 32 - db/migrations/207_add_etask_tables.php | 138 - .../208_migrate_questionnaire_questions.php | 294 -- db/migrations/209_convert_cronjob_logs.php | 44 - db/migrations/20_calendar_events_class_default.php | 23 - db/migrations/210_tic_7206.php | 13 - db/migrations/211_tic7307_admission_rule_path.php | 23 - db/migrations/212_refactor_config_local.php | 193 -- db/migrations/213_log_action_statusgroups.php | 35 - db/migrations/214_textmarkup_datafield.php | 22 - db/migrations/215_default_data_field_values.php | 29 - db/migrations/216_add_evaldate.php | 22 - db/migrations/217_course_number_format_config.php | 59 - db/migrations/218_extend_phone_fax_size.php | 32 - db/migrations/219_loginbackgrounds.php | 36 - db/migrations/21_more_indexing.php | 32 - db/migrations/220_step_00313_coursegroups.php | 26 - db/migrations/221_moadb.php | 516 ---- db/migrations/222_utf8_conversion.php | 242 -- db/migrations/223_course_mailing_for_students.php | 19 - db/migrations/224_db_cache_table.php | 29 - db/migrations/225_extend_course_completion.php | 27 - db/migrations/226_config_values.php | 134 - ...27_biest_8034_config_switch_for_child_insts.php | 33 - db/migrations/228_show_adressees.php | 47 - db/migrations/229_step_00278_global_search.php | 120 - ..._lit_list_content_note_from_varchar_to_text.php | 19 - db/migrations/230_widgets.php | 441 --- db/migrations/231_add_files_search_index.php | 190 -- db/migrations/232_step_00315_mvv_i18n.php | 644 ---- .../233_step_00316_mvvkernintegration.php | 36 - .../234_add_mkdate_to_statusgruppe_user.php | 17 - db/migrations/235_tic8335_paper_related_topics.php | 41 - db/migrations/236_config_public_topics.php | 44 - db/migrations/237_config_mail_subject.php | 39 - db/migrations/238_db_updates_for_42.php | 76 - db/migrations/239_step_00327.php | 139 - .../23_enlarge_object_contentmodules_module_id.php | 18 - db/migrations/240_tic8538.php | 23 - .../241_step_00320_config_search_navigation.php | 62 - .../242_tic_8546_search_show_admission_state.php | 36 - db/migrations/243_tic8773_sort_news_by_chdate.php | 26 - db/migrations/244_config_default_seats.php | 32 - db/migrations/245_tic7804_wiki_permissions.php | 44 - db/migrations/246_consultations.php | 315 -- db/migrations/247_step_00330.php | 24 - db/migrations/248_step_00331_ilias_interface.php | 56 - db/migrations/249_lti_consumer.php | 113 - db/migrations/24_another_index_for_ex_termine.php | 30 - db/migrations/250_disable_archive_search.php | 34 - db/migrations/251_log_event_autoincrement.php | 36 - db/migrations/252_js_assets.php | 26 - db/migrations/253_adjust_token_table.php | 34 - db/migrations/254_hash_opengraph_table.php | 26 - .../255_tic9368_datafield_for_institution.php | 21 - db/migrations/256_tic9543_update_help_content.php | 102 - .../257_tic9544_add_external_id_semester.php | 22 - .../258_tic7443_create_lvgruppen_independently.php | 34 - db/migrations/259_migrations_reloaded.php | 35 - db/migrations/25_step_00098_user_domains.php | 41 - db/migrations/26_step_00146_lock_rules2.php | 45 - db/migrations/27_step_147_mail_activationlink.php | 31 - db/migrations/28_delete_wiki_links.php | 29 - .../29_step_00138_studienbereichszuordnung.php | 43 - db/migrations/30_auth_user_md5_perms.php | 23 - db/migrations/31_high_priority_messages.php | 31 - db/migrations/32_restricted_user_management.php | 32 - db/migrations/33_lock_rule_admin_perm.php | 43 - .../34_add_allow_selfassign_institute.php | 32 - db/migrations/35_add_additional_log_actions.php | 127 - .../36_step_00156_editierbares_impressum.php | 161 - db/migrations/37_log_actions_expires.php | 25 - db/migrations/38_allow_admin_useraccess.php | 32 - .../39_step_00153_studienmodulmanagement.php | 32 - db/migrations/40_add_index_to_log_events.php | 15 - db/migrations/41_step_00157_rolemanagment.php | 22 - db/migrations/42_change_action_id_inst_create.php | 21 - db/migrations/43_step_00159_datafieldentry.php | 20 - .../44_add_switch_to_preselect_semester.php | 23 - db/migrations/45_refine_logevents.php | 62 - .../46_step00172_remove_ilias_connect.php | 22 - ...add_option_resources_hide_past_single_dates.php | 62 - db/migrations/48_step_00174_plugin_interfaces.php | 31 - db/migrations/49_step_00150_studygroups.php | 74 - db/migrations/50_add_option_step_152.php | 46 - db/migrations/51_unhide_dozents.php | 20 - .../52_additional_semtree_log_actions.php | 46 - db/migrations/53_file_and_folder_priority.php | 19 - db/migrations/54_step_00161_plugin_admin.php | 35 - db/migrations/55_add_missing_log_actions.php | 57 - db/migrations/56_step_00176_wap.php | 24 - db/migrations/57_step_00158_privacy.php | 107 - db/migrations/58_add_config_allow_fakadmin.php | 38 - db/migrations/59_step_00194_studycourse.php | 33 - db/migrations/60_step_00191_modulesenable.php | 107 - db/migrations/61_remove_studygroupdozent.php | 18 - db/migrations/62_gender_iso_5218.php | 24 - db/migrations/63_tic1207_config.php | 52 - .../64_step_00199_forced_course_grouping.php | 40 - db/migrations/65_step_00198_deputies.php | 62 - .../66_config_filesystem_multicopy_enable.php | 34 - .../67_step_00204_no_document_deletion.php | 26 - db/migrations/68_add_schedule_table.php | 63 - .../69_step_00202_enhanced_seminar_cycle.php | 88 - db/migrations/70_step_00184_html5_video.php | 120 - db/migrations/71_step_00192_page_layout.php | 45 - .../72_config_ajax_autocomplete_disabled.php | 34 - db/migrations/73_step_00193_html_email.php | 46 - db/migrations/74_tic1422_pagination.php | 46 - db/migrations/75_pdf_logo_configuration.php | 46 - db/migrations/76_termin_related_persons.php | 36 - db/migrations/77_step_00223_lockrules.php | 28 - db/migrations/78_step00219_webservice_access.php | 30 - .../79_step_216_automatisiertes_eintragen.php | 72 - .../80_skiplinks_enable_configuration.php | 47 - db/migrations/81_step_209_teilnehmericon.php | 37 - db/migrations/83_tic1992_privacydefaults.php | 71 - db/migrations/84_step_226_dozenten_labels.php | 41 - db/migrations/85_tic2007_schedule_enable.php | 46 - db/migrations/86_step_228_raumanfragen.php | 27 - db/migrations/87_tic1091_chat.php | 19 - db/migrations/88_biest2055_terms.php | 23 - db/migrations/89_step_00205_group_calendar.php | 103 - db/migrations/90_tic2395_smileys.php | 28 - db/migrations/91_tic2568_comment_internal.php | 28 - db/migrations/92_remove_schedule_user_table.php | 15 - db/migrations/93_sem_classes_convert_into_db.php | 286 -- db/migrations/94_step237_datafields_mandatory.php | 28 - .../95_extend_userstudiengang_primarykey.php | 34 - .../96_step00234_homepageplugin_activation.php | 38 - db/migrations/97_init_personal_notifications.php | 51 - db/migrations/98_user_data_to_config.php | 201 -- db/migrations/99_step00245_simpleormap.php | 13 - lib/classes/StudipCacheFactory.class.php | 2 +- lib/migrations/DBSchemaVersion.php | 37 +- lib/migrations/Migrator.php | 5 +- 644 files changed, 28036 insertions(+), 28014 deletions(-) delete mode 100644 db/migrations/01_init_migrations.php delete mode 100644 db/migrations/02_step_102_datenfeldtypen.php delete mode 100644 db/migrations/03_step_87_extern_configurations.php delete mode 100644 db/migrations/04_step_116_participant_view.php delete mode 100644 db/migrations/05_step_25_raumzeit_migrations.php delete mode 100644 db/migrations/06_step_25_raumzeit_db_conversion.php delete mode 100644 db/migrations/07_table_token_class.php delete mode 100644 db/migrations/08_step_117_studienmodule.php delete mode 100644 db/migrations/09_step_00111_admission.php create mode 100644 db/migrations/1.100_step00248_chat_extinction.php create mode 100644 db/migrations/1.101_step00246_blubber.php create mode 100644 db/migrations/1.102_remove_guestbook_migration.php create mode 100644 db/migrations/1.104_setup_cronjobs.php create mode 100644 db/migrations/1.105_step_00247_forum.php create mode 100644 db/migrations/1.106_step_00247_forum_data_migration.php create mode 100644 db/migrations/1.107_step00247_forum_performance.php create mode 100644 db/migrations/1.108_visibilityapi.php create mode 100644 db/migrations/1.109_init_custom_blubber_streams.php create mode 100644 db/migrations/1.10_image_proxy.php create mode 100644 db/migrations/1.110_scm_add_position.php create mode 100644 db/migrations/1.111_step_3574_domain.php create mode 100644 db/migrations/1.113_init_mailqueue.php create mode 100644 db/migrations/1.114_create_table_blubber_reshares.php create mode 100644 db/migrations/1.115_performance_tic_3759.php create mode 100644 db/migrations/1.116_step_00263_inst_gendering.php create mode 100644 db/migrations/1.117_forum_add_close.php create mode 100644 db/migrations/1.118_forum_sticky_posts.php create mode 100644 db/migrations/1.119_init_termin_related_groups_table.php create mode 100644 db/migrations/1.11_lock_rulez.php create mode 100644 db/migrations/1.120_create_open_graph_data_table.php create mode 100644 db/migrations/1.121_step_00266_forced_lock_rules.php create mode 100644 db/migrations/1.122_add_seminar_id_to_folder.php create mode 100644 db/migrations/1.123_tic_3993_remove_dont_delete.php create mode 100644 db/migrations/1.124_step_00255_important_semnumber.php create mode 100644 db/migrations/1.125_repair_statusgroup_user_numberation.php create mode 100644 db/migrations/1.126_tic_4044_invisible_studygroups.php create mode 100644 db/migrations/1.127_setup_api.php create mode 100644 db/migrations/1.128_step00240_coursesets.php create mode 100644 db/migrations/1.129_wysiwyg_config_option.php create mode 100644 db/migrations/1.12_step_120_userpic.php create mode 100644 db/migrations/1.130_step_00267_preliminary_accounts.php create mode 100644 db/migrations/1.131_score_config_option.php create mode 100644 db/migrations/1.132_step_00268_event_log.php create mode 100644 db/migrations/1.133_tic_4072_new_password_hashing.php create mode 100644 db/migrations/1.134_step_00269_plugin_roles.php create mode 100644 db/migrations/1.135_tic_4011_remove_teilnehmer_view.php create mode 100644 db/migrations/1.136_wiki_remove_camel_case.php create mode 100644 db/migrations/1.137_studygroup_invitations.php create mode 100644 db/migrations/1.138_create_tags_for_messaging.php create mode 100644 db/migrations/1.139_step00272_tours.php create mode 100644 db/migrations/1.13_remove_fields_from_extermine.php create mode 100644 db/migrations/1.140_tic4450_archiv_protected_files.php create mode 100644 db/migrations/1.141_tic4454_roomrequest_options.php create mode 100644 db/migrations/1.142_tic4463_remove_stm.php create mode 100644 db/migrations/1.143_step00249_my_courses_config.php create mode 100644 db/migrations/1.144_files.php create mode 100644 db/migrations/1.145_tic4491_help_content.php create mode 100644 db/migrations/1.146_step_00253_startseite.php create mode 100644 db/migrations/1.148_tic_4520_sem_tree_display.php create mode 100644 db/migrations/1.14_step_00123_admission2.php create mode 100644 db/migrations/1.150_help_tours_and_content.php create mode 100644 db/migrations/1.151_add_automatic_updates_to_plugins.php create mode 100644 db/migrations/1.152_tic_5117_course_member_admission.php create mode 100644 db/migrations/1.153_tic_4163_add_studip_shortname.php create mode 100644 db/migrations/1.154_recalculate_score.php create mode 100644 db/migrations/1.155_tic_5170_clean_up.php create mode 100644 db/migrations/1.156_tic_5204_add_datafield_type.php create mode 100644 db/migrations/1.157_contact_rework.php create mode 100644 db/migrations/1.158_step_00283_calendar_sorm.php create mode 100644 db/migrations/1.159_step_00275_plus.php create mode 100644 db/migrations/1.15_step_00129_email_restriction.php create mode 100644 db/migrations/1.160_step_00283_update_calendar_settings.php create mode 100644 db/migrations/1.161_step_00284_help_editor.php create mode 100644 db/migrations/1.162_step_00283_calendar_user.php create mode 100644 db/migrations/1.163_transfer_calpermission.php create mode 100644 db/migrations/1.164_help_tours_en.php create mode 100644 db/migrations/1.166_add_cache_operations_table.php create mode 100644 db/migrations/1.167_tic5661_setup_cronjob.php create mode 100644 db/migrations/1.168_tic5661_add_config.php create mode 100644 db/migrations/1.16_step_00126_embedding_flash_movies.php create mode 100644 db/migrations/1.170_step_00286_coursewizard.php create mode 100644 db/migrations/1.171_open_personal_file_areas.php create mode 100644 db/migrations/1.172_tic_5961_add_config_default_sem.php create mode 100644 db/migrations/1.173_biest5982_fix_resources_objects_level.php create mode 100644 db/migrations/1.174_tic_6018_clean_news.php create mode 100644 db/migrations/1.175_biest6024_fix_help_tours_en.php create mode 100644 db/migrations/1.176_limit_mailqueue.php create mode 100644 db/migrations/1.177_tic5415_plugin_assets.php create mode 100644 db/migrations/1.178_change_opengraph_data_pk.php create mode 100644 db/migrations/1.179_tic6188_view_resource_occupation.php create mode 100644 db/migrations/1.17_db_optimierung_kontingentierung.php create mode 100644 db/migrations/1.180_add_seminar_is_complete_status.php create mode 100644 db/migrations/1.181_extend_wiki_size.php create mode 100644 db/migrations/1.182_step_raum_zeit_end_offset.php create mode 100644 db/migrations/1.183_tic6000_datafields_visibility.php create mode 100644 db/migrations/1.184_add_wiki_help_tours.php create mode 100644 db/migrations/1.185_tic6025_performance.php create mode 100644 db/migrations/1.186_step_00294_innodb.php create mode 100644 db/migrations/1.187_step_291_questionnaires.php create mode 100644 db/migrations/1.188_step_00296_appointment_requests.php create mode 100644 db/migrations/1.189_step_00288_sem_class_raumzeit.php create mode 100644 db/migrations/1.18_step_00139_upload_file_reorg.php create mode 100644 db/migrations/1.190_allow_topics_to_be_public.php create mode 100644 db/migrations/1.191_add_dedicated_admins_role.php create mode 100644 db/migrations/1.192_add_user_config_for_admin_display_settings.php create mode 100644 db/migrations/1.193_tic6653_add_advanced_coursewizardstep.php create mode 100644 db/migrations/1.194_tic_6576_preferential_admission.php create mode 100644 db/migrations/1.195_tic_6655_admissionrule_compatibility.php create mode 100644 db/migrations/1.196_extend_ressources.php create mode 100644 db/migrations/1.197_step_00301_admission_conditiongroups.php create mode 100644 db/migrations/1.198_add_activities.php create mode 100644 db/migrations/1.199_step_00302_modulverwaltung.php create mode 100644 db/migrations/1.19_step_00141_zip_download_restrictions.php create mode 100644 db/migrations/1.1_init_migrations.php create mode 100644 db/migrations/1.200_step_00299_statusgroups.php create mode 100644 db/migrations/1.201_i18n_content.php create mode 100644 db/migrations/1.202_remove_skype_status.php create mode 100644 db/migrations/1.203_archive_help_texts.php create mode 100644 db/migrations/1.204_dialog_from_notification.php create mode 100644 db/migrations/1.205_course_scm_helptext.php create mode 100644 db/migrations/1.206_alter_columns_weekoffset_to_int.php create mode 100644 db/migrations/1.207_add_etask_tables.php create mode 100644 db/migrations/1.208_migrate_questionnaire_questions.php create mode 100644 db/migrations/1.209_convert_cronjob_logs.php create mode 100644 db/migrations/1.20_calendar_events_class_default.php create mode 100644 db/migrations/1.210_tic_7206.php create mode 100644 db/migrations/1.211_tic7307_admission_rule_path.php create mode 100644 db/migrations/1.212_refactor_config_local.php create mode 100644 db/migrations/1.213_log_action_statusgroups.php create mode 100644 db/migrations/1.214_textmarkup_datafield.php create mode 100644 db/migrations/1.215_default_data_field_values.php create mode 100644 db/migrations/1.216_add_evaldate.php create mode 100644 db/migrations/1.217_course_number_format_config.php create mode 100644 db/migrations/1.218_extend_phone_fax_size.php create mode 100644 db/migrations/1.219_loginbackgrounds.php create mode 100644 db/migrations/1.21_more_indexing.php create mode 100644 db/migrations/1.220_step_00313_coursegroups.php create mode 100644 db/migrations/1.221_moadb.php create mode 100644 db/migrations/1.222_utf8_conversion.php create mode 100644 db/migrations/1.223_course_mailing_for_students.php create mode 100644 db/migrations/1.224_db_cache_table.php create mode 100644 db/migrations/1.225_extend_course_completion.php create mode 100644 db/migrations/1.226_config_values.php create mode 100644 db/migrations/1.227_biest_8034_config_switch_for_child_insts.php create mode 100644 db/migrations/1.228_show_adressees.php create mode 100644 db/migrations/1.229_step_00278_global_search.php create mode 100644 db/migrations/1.22_lit_list_content_note_from_varchar_to_text.php create mode 100644 db/migrations/1.230_widgets.php create mode 100644 db/migrations/1.231_add_files_search_index.php create mode 100644 db/migrations/1.232_step_00315_mvv_i18n.php create mode 100644 db/migrations/1.233_step_00316_mvvkernintegration.php create mode 100644 db/migrations/1.234_add_mkdate_to_statusgruppe_user.php create mode 100644 db/migrations/1.235_tic8335_paper_related_topics.php create mode 100644 db/migrations/1.236_config_public_topics.php create mode 100644 db/migrations/1.237_config_mail_subject.php create mode 100644 db/migrations/1.238_db_updates_for_42.php create mode 100644 db/migrations/1.239_step_00327.php create mode 100644 db/migrations/1.23_enlarge_object_contentmodules_module_id.php create mode 100644 db/migrations/1.240_tic8538.php create mode 100644 db/migrations/1.241_step_00320_config_search_navigation.php create mode 100644 db/migrations/1.242_tic_8546_search_show_admission_state.php create mode 100644 db/migrations/1.243_tic8773_sort_news_by_chdate.php create mode 100644 db/migrations/1.244_config_default_seats.php create mode 100644 db/migrations/1.245_tic7804_wiki_permissions.php create mode 100644 db/migrations/1.246_consultations.php create mode 100644 db/migrations/1.247_step_00330.php create mode 100644 db/migrations/1.248_step_00331_ilias_interface.php create mode 100644 db/migrations/1.249_lti_consumer.php create mode 100644 db/migrations/1.24_another_index_for_ex_termine.php create mode 100644 db/migrations/1.250_disable_archive_search.php create mode 100644 db/migrations/1.251_log_event_autoincrement.php create mode 100644 db/migrations/1.252_js_assets.php create mode 100644 db/migrations/1.253_adjust_token_table.php create mode 100644 db/migrations/1.254_hash_opengraph_table.php create mode 100644 db/migrations/1.255_tic9368_datafield_for_institution.php create mode 100644 db/migrations/1.256_tic9543_update_help_content.php create mode 100644 db/migrations/1.257_tic9544_add_external_id_semester.php create mode 100644 db/migrations/1.258_tic7443_create_lvgruppen_independently.php create mode 100644 db/migrations/1.259_migrations_reloaded.php create mode 100644 db/migrations/1.25_step_00098_user_domains.php create mode 100644 db/migrations/1.260_tfa.php create mode 100644 db/migrations/1.261_gradebook.php create mode 100644 db/migrations/1.262_blubbermessenger.php create mode 100644 db/migrations/1.263_blubbermessenger_keys.php create mode 100644 db/migrations/1.264_blubbermessenger_search.php create mode 100644 db/migrations/1.265_blubbermessenger_flat.php create mode 100644 db/migrations/1.266_consultations_option_exclude_expired.php create mode 100644 db/migrations/1.267_jsonapi_dangerous_routes_config.php create mode 100644 db/migrations/1.268_unrestricted_userdomains.php create mode 100644 db/migrations/1.269_fix_missing_consultation_events.php create mode 100644 db/migrations/1.26_step_00146_lock_rules2.php create mode 100644 db/migrations/1.270_step_00332_mvv_overlapping_courses.php create mode 100644 db/migrations/1.271_jsonapi_cors_origin_config.php create mode 100644 db/migrations/1.272_step_00338_instituteplaning.php create mode 100644 db/migrations/1.273_config_for_download_counter_display.php create mode 100644 db/migrations/1.274_add_enable_free_access_for_courses_only.php create mode 100644 db/migrations/1.275_additional_mvv_tables.php create mode 100644 db/migrations/1.276_tic8458_add_upload_description.php create mode 100644 db/migrations/1.277_room_management_migration.php create mode 100644 db/migrations/1.278_resize_auth_user_md5_email_field.php create mode 100644 db/migrations/1.279_config_wiki_comments_enable.php create mode 100644 db/migrations/1.27_step_147_mail_activationlink.php create mode 100644 db/migrations/1.280_step_00338_institutecolors.php create mode 100644 db/migrations/1.281_step_00333_feedback.php create mode 100644 db/migrations/1.282_config_for_stgteilversion_userfilter.php create mode 100644 db/migrations/1.283_add_filetypes.php create mode 100644 db/migrations/1.284_change_schedule_color_with_category_index.php create mode 100644 db/migrations/1.285_fixes_on_schedule_coloring.php create mode 100644 db/migrations/1.286_remove_new_widget_system.php create mode 100644 db/migrations/1.287_replace_library_system.php create mode 100644 db/migrations/1.288_tic9898_add_course_wizard_step.php create mode 100644 db/migrations/1.289_tic10318_http_proxy.php create mode 100644 db/migrations/1.28_delete_wiki_links.php create mode 100644 db/migrations/1.290_termsconfig.php create mode 100644 db/migrations/1.291_step345_wiki_ancestor.php create mode 100644 db/migrations/1.292_add_admin_courses_sidebar_active_elements.php create mode 100644 db/migrations/1.293_adjust_i18n_tables.php create mode 100644 db/migrations/1.294_mvv_bugs.php create mode 100644 db/migrations/1.295_remove_invalid_modul_user_assignments.php create mode 100755 db/migrations/1.296_biest_10803_fix.php create mode 100644 db/migrations/1.297_database_changes_tic_9218.php create mode 100644 db/migrations/1.298_hide_studygroups_from_profile.php create mode 100644 db/migrations/1.299_tiled_courses.php create mode 100644 db/migrations/1.29_step_00138_studienbereichszuordnung.php create mode 100644 db/migrations/1.2_step_102_datenfeldtypen.php create mode 100644 db/migrations/1.300_tiled_courses_2.php create mode 100644 db/migrations/1.301_tiled_courses_3.php create mode 100644 db/migrations/1.302_add_missing_indices_resources.php create mode 100644 db/migrations/1.303_add_missing_indices.php create mode 100644 db/migrations/1.304_config_i18n.php create mode 100644 db/migrations/1.305_course_members_hide.php create mode 100644 db/migrations/1.306_tic_9101.php create mode 100644 db/migrations/1.307_introduce_range_config.php create mode 100644 db/migrations/1.308_consultation_extension.php create mode 100644 db/migrations/1.309_course_groups_hide.php create mode 100644 db/migrations/1.30_auth_user_md5_perms.php create mode 100644 db/migrations/1.310_add_seminare_semester_table.php create mode 100644 db/migrations/1.311_add_seminare_semester_course_index.php create mode 100644 db/migrations/1.312_tic_11041.php create mode 100644 db/migrations/1.313_tic11044_admin_course_notices.php create mode 100644 db/migrations/1.314_step_00349.php create mode 100644 db/migrations/1.315_tic_8183_terms_admission.php create mode 100644 db/migrations/1.316_admin_related_inst.php create mode 100644 db/migrations/1.317_oercampus_integration.php create mode 100644 db/migrations/1.318_step_00353_cache.php create mode 100644 db/migrations/1.319_change_blubber_thread_following.php create mode 100644 db/migrations/1.31_high_priority_messages.php create mode 100644 db/migrations/1.320_migration_history_reworked.php create mode 100644 db/migrations/1.321_add_terms_accepted_config.php create mode 100644 db/migrations/1.322_add_missing_evaluation_configuration.php create mode 100644 db/migrations/1.323_biest_11462_change_column_types.php create mode 100644 db/migrations/1.324_drop_citation_style.php create mode 100644 db/migrations/1.325_tic11044_admin_course_notices_2.php create mode 100755 db/migrations/1.326_courseware_integration.php create mode 100644 db/migrations/1.328_add_content_widget.php create mode 100644 db/migrations/1.32_restricted_user_management.php create mode 100644 db/migrations/1.33_lock_rule_admin_perm.php create mode 100644 db/migrations/1.34_add_allow_selfassign_institute.php create mode 100644 db/migrations/1.35_add_additional_log_actions.php create mode 100644 db/migrations/1.36_step_00156_editierbares_impressum.php create mode 100644 db/migrations/1.37_log_actions_expires.php create mode 100644 db/migrations/1.38_allow_admin_useraccess.php create mode 100644 db/migrations/1.39_step_00153_studienmodulmanagement.php create mode 100644 db/migrations/1.3_step_87_extern_configurations.php create mode 100644 db/migrations/1.40_add_index_to_log_events.php create mode 100644 db/migrations/1.41_step_00157_rolemanagment.php create mode 100644 db/migrations/1.42_change_action_id_inst_create.php create mode 100644 db/migrations/1.43_step_00159_datafieldentry.php create mode 100644 db/migrations/1.44_add_switch_to_preselect_semester.php create mode 100644 db/migrations/1.45_refine_logevents.php create mode 100644 db/migrations/1.46_step00172_remove_ilias_connect.php create mode 100644 db/migrations/1.47_add_option_resources_hide_past_single_dates.php create mode 100644 db/migrations/1.48_step_00174_plugin_interfaces.php create mode 100644 db/migrations/1.49_step_00150_studygroups.php create mode 100644 db/migrations/1.4_step_116_participant_view.php create mode 100644 db/migrations/1.50_add_option_step_152.php create mode 100644 db/migrations/1.51_unhide_dozents.php create mode 100644 db/migrations/1.52_additional_semtree_log_actions.php create mode 100644 db/migrations/1.53_file_and_folder_priority.php create mode 100644 db/migrations/1.54_step_00161_plugin_admin.php create mode 100644 db/migrations/1.55_add_missing_log_actions.php create mode 100644 db/migrations/1.56_step_00176_wap.php create mode 100644 db/migrations/1.57_step_00158_privacy.php create mode 100644 db/migrations/1.58_add_config_allow_fakadmin.php create mode 100644 db/migrations/1.59_step_00194_studycourse.php create mode 100644 db/migrations/1.5_step_25_raumzeit_migrations.php create mode 100644 db/migrations/1.60_step_00191_modulesenable.php create mode 100644 db/migrations/1.61_remove_studygroupdozent.php create mode 100644 db/migrations/1.62_gender_iso_5218.php create mode 100644 db/migrations/1.63_tic1207_config.php create mode 100644 db/migrations/1.64_step_00199_forced_course_grouping.php create mode 100644 db/migrations/1.65_step_00198_deputies.php create mode 100644 db/migrations/1.66_config_filesystem_multicopy_enable.php create mode 100644 db/migrations/1.67_step_00204_no_document_deletion.php create mode 100644 db/migrations/1.68_add_schedule_table.php create mode 100644 db/migrations/1.69_step_00202_enhanced_seminar_cycle.php create mode 100644 db/migrations/1.6_step_25_raumzeit_db_conversion.php create mode 100644 db/migrations/1.70_step_00184_html5_video.php create mode 100644 db/migrations/1.71_step_00192_page_layout.php create mode 100644 db/migrations/1.72_config_ajax_autocomplete_disabled.php create mode 100644 db/migrations/1.73_step_00193_html_email.php create mode 100644 db/migrations/1.74_tic1422_pagination.php create mode 100644 db/migrations/1.75_pdf_logo_configuration.php create mode 100644 db/migrations/1.76_termin_related_persons.php create mode 100644 db/migrations/1.77_step_00223_lockrules.php create mode 100644 db/migrations/1.78_step00219_webservice_access.php create mode 100644 db/migrations/1.79_step_216_automatisiertes_eintragen.php create mode 100644 db/migrations/1.7_table_token_class.php create mode 100644 db/migrations/1.80_skiplinks_enable_configuration.php create mode 100644 db/migrations/1.81_step_209_teilnehmericon.php create mode 100644 db/migrations/1.83_tic1992_privacydefaults.php create mode 100644 db/migrations/1.84_step_226_dozenten_labels.php create mode 100644 db/migrations/1.85_tic2007_schedule_enable.php create mode 100644 db/migrations/1.86_step_228_raumanfragen.php create mode 100644 db/migrations/1.87_tic1091_chat.php create mode 100644 db/migrations/1.88_biest2055_terms.php create mode 100644 db/migrations/1.89_step_00205_group_calendar.php create mode 100644 db/migrations/1.8_step_117_studienmodule.php create mode 100644 db/migrations/1.90_tic2395_smileys.php create mode 100644 db/migrations/1.91_tic2568_comment_internal.php create mode 100644 db/migrations/1.92_remove_schedule_user_table.php create mode 100644 db/migrations/1.93_sem_classes_convert_into_db.php create mode 100644 db/migrations/1.94_step237_datafields_mandatory.php create mode 100644 db/migrations/1.95_extend_userstudiengang_primarykey.php create mode 100644 db/migrations/1.96_step00234_homepageplugin_activation.php create mode 100644 db/migrations/1.97_init_personal_notifications.php create mode 100644 db/migrations/1.98_user_data_to_config.php create mode 100644 db/migrations/1.99_step00245_simpleormap.php create mode 100644 db/migrations/1.9_step_00111_admission.php delete mode 100644 db/migrations/100_step00248_chat_extinction.php delete mode 100644 db/migrations/101_step00246_blubber.php delete mode 100644 db/migrations/102_remove_guestbook_migration.php delete mode 100644 db/migrations/104_setup_cronjobs.php delete mode 100644 db/migrations/105_step_00247_forum.php delete mode 100644 db/migrations/106_step_00247_forum_data_migration.php delete mode 100644 db/migrations/107_step00247_forum_performance.php delete mode 100644 db/migrations/108_visibilityapi.php delete mode 100644 db/migrations/109_init_custom_blubber_streams.php delete mode 100644 db/migrations/10_image_proxy.php delete mode 100644 db/migrations/110_scm_add_position.php delete mode 100644 db/migrations/111_step_3574_domain.php delete mode 100644 db/migrations/113_init_mailqueue.php delete mode 100644 db/migrations/114_create_table_blubber_reshares.php delete mode 100644 db/migrations/115_performance_tic_3759.php delete mode 100644 db/migrations/116_step_00263_inst_gendering.php delete mode 100644 db/migrations/117_forum_add_close.php delete mode 100644 db/migrations/118_forum_sticky_posts.php delete mode 100644 db/migrations/119_init_termin_related_groups_table.php delete mode 100644 db/migrations/11_lock_rulez.php delete mode 100644 db/migrations/120_create_open_graph_data_table.php delete mode 100644 db/migrations/121_step_00266_forced_lock_rules.php delete mode 100644 db/migrations/122_add_seminar_id_to_folder.php delete mode 100644 db/migrations/123_tic_3993_remove_dont_delete.php delete mode 100644 db/migrations/124_step_00255_important_semnumber.php delete mode 100644 db/migrations/125_repair_statusgroup_user_numberation.php delete mode 100644 db/migrations/126_tic_4044_invisible_studygroups.php delete mode 100644 db/migrations/127_setup_api.php delete mode 100644 db/migrations/128_step00240_coursesets.php delete mode 100644 db/migrations/129_wysiwyg_config_option.php delete mode 100644 db/migrations/12_step_120_userpic.php delete mode 100644 db/migrations/130_step_00267_preliminary_accounts.php delete mode 100644 db/migrations/131_score_config_option.php delete mode 100644 db/migrations/132_step_00268_event_log.php delete mode 100644 db/migrations/133_tic_4072_new_password_hashing.php delete mode 100644 db/migrations/134_step_00269_plugin_roles.php delete mode 100644 db/migrations/135_tic_4011_remove_teilnehmer_view.php delete mode 100644 db/migrations/136_wiki_remove_camel_case.php delete mode 100644 db/migrations/137_studygroup_invitations.php delete mode 100644 db/migrations/138_create_tags_for_messaging.php delete mode 100644 db/migrations/139_step00272_tours.php delete mode 100644 db/migrations/13_remove_fields_from_extermine.php delete mode 100644 db/migrations/140_tic4450_archiv_protected_files.php delete mode 100644 db/migrations/141_tic4454_roomrequest_options.php delete mode 100644 db/migrations/142_tic4463_remove_stm.php delete mode 100644 db/migrations/143_step00249_my_courses_config.php delete mode 100644 db/migrations/144_files.php delete mode 100644 db/migrations/145_tic4491_help_content.php delete mode 100644 db/migrations/146_step_00253_startseite.php delete mode 100644 db/migrations/148_tic_4520_sem_tree_display.php delete mode 100644 db/migrations/14_step_00123_admission2.php delete mode 100644 db/migrations/150_help_tours_and_content.php delete mode 100644 db/migrations/151_add_automatic_updates_to_plugins.php delete mode 100644 db/migrations/152_tic_5117_course_member_admission.php delete mode 100644 db/migrations/153_tic_4163_add_studip_shortname.php delete mode 100644 db/migrations/154_recalculate_score.php delete mode 100644 db/migrations/155_tic_5170_clean_up.php delete mode 100644 db/migrations/156_tic_5204_add_datafield_type.php delete mode 100644 db/migrations/157_contact_rework.php delete mode 100644 db/migrations/158_step_00283_calendar_sorm.php delete mode 100644 db/migrations/159_step_00275_plus.php delete mode 100644 db/migrations/15_step_00129_email_restriction.php delete mode 100644 db/migrations/160_step_00283_update_calendar_settings.php delete mode 100644 db/migrations/161_step_00284_help_editor.php delete mode 100644 db/migrations/162_step_00283_calendar_user.php delete mode 100644 db/migrations/163_transfer_calpermission.php delete mode 100644 db/migrations/164_help_tours_en.php delete mode 100644 db/migrations/166_add_cache_operations_table.php delete mode 100644 db/migrations/167_tic5661_setup_cronjob.php delete mode 100644 db/migrations/168_tic5661_add_config.php delete mode 100644 db/migrations/16_step_00126_embedding_flash_movies.php delete mode 100644 db/migrations/170_step_00286_coursewizard.php delete mode 100644 db/migrations/171_open_personal_file_areas.php delete mode 100644 db/migrations/172_tic_5961_add_config_default_sem.php delete mode 100644 db/migrations/173_biest5982_fix_resources_objects_level.php delete mode 100644 db/migrations/174_tic_6018_clean_news.php delete mode 100644 db/migrations/175_biest6024_fix_help_tours_en.php delete mode 100644 db/migrations/176_limit_mailqueue.php delete mode 100644 db/migrations/177_tic5415_plugin_assets.php delete mode 100644 db/migrations/178_change_opengraph_data_pk.php delete mode 100644 db/migrations/179_tic6188_view_resource_occupation.php delete mode 100644 db/migrations/17_db_optimierung_kontingentierung.php delete mode 100644 db/migrations/180_add_seminar_is_complete_status.php delete mode 100644 db/migrations/181_extend_wiki_size.php delete mode 100644 db/migrations/182_step_raum_zeit_end_offset.php delete mode 100644 db/migrations/183_tic6000_datafields_visibility.php delete mode 100644 db/migrations/184_add_wiki_help_tours.php delete mode 100644 db/migrations/185_tic6025_performance.php delete mode 100644 db/migrations/186_step_00294_innodb.php delete mode 100644 db/migrations/187_step_291_questionnaires.php delete mode 100644 db/migrations/188_step_00296_appointment_requests.php delete mode 100644 db/migrations/189_step_00288_sem_class_raumzeit.php delete mode 100644 db/migrations/18_step_00139_upload_file_reorg.php delete mode 100644 db/migrations/190_allow_topics_to_be_public.php delete mode 100644 db/migrations/191_add_dedicated_admins_role.php delete mode 100644 db/migrations/192_add_user_config_for_admin_display_settings.php delete mode 100644 db/migrations/193_tic6653_add_advanced_coursewizardstep.php delete mode 100644 db/migrations/194_tic_6576_preferential_admission.php delete mode 100644 db/migrations/195_tic_6655_admissionrule_compatibility.php delete mode 100644 db/migrations/196_extend_ressources.php delete mode 100644 db/migrations/197_step_00301_admission_conditiongroups.php delete mode 100644 db/migrations/198_add_activities.php delete mode 100644 db/migrations/199_step_00302_modulverwaltung.php delete mode 100644 db/migrations/19_step_00141_zip_download_restrictions.php delete mode 100644 db/migrations/200_step_00299_statusgroups.php delete mode 100644 db/migrations/20190702_tfa.php delete mode 100644 db/migrations/20190705_gradebook.php delete mode 100644 db/migrations/201908014_blubbermessenger.php delete mode 100644 db/migrations/201908015_blubbermessenger_keys.php delete mode 100644 db/migrations/201908016_blubbermessenger_search.php delete mode 100644 db/migrations/201908017_blubbermessenger_flat.php delete mode 100644 db/migrations/20190823_consultations_option_exclude_expired.php delete mode 100644 db/migrations/20190903_jsonapi_dangerous_routes_config.php delete mode 100644 db/migrations/20190904_unrestricted_userdomains.php delete mode 100644 db/migrations/20190917_fix_missing_consultation_events.php delete mode 100644 db/migrations/20190919_step_00332_mvv_overlapping_courses.php delete mode 100644 db/migrations/20191002_jsonapi_cors_origin_config.php delete mode 100644 db/migrations/20191014_step_00338_instituteplaning.php delete mode 100644 db/migrations/20191018_config_for_download_counter_display.php delete mode 100644 db/migrations/20191105_add_enable_free_access_for_courses_only.php delete mode 100644 db/migrations/20191112_additional_mvv_tables.php delete mode 100644 db/migrations/20191115_tic8458_add_upload_description.php delete mode 100644 db/migrations/20191120_room_management_migration.php delete mode 100644 db/migrations/20191122_resize_auth_user_md5_email_field.php delete mode 100644 db/migrations/20191210_config_wiki_comments_enable.php delete mode 100644 db/migrations/20191211_step_00338_institutecolors.php delete mode 100644 db/migrations/20192208_step_00333_feedback.php delete mode 100644 db/migrations/201_i18n_content.php delete mode 100644 db/migrations/20200108_config_for_stgteilversion_userfilter.php delete mode 100644 db/migrations/202001291_add_filetypes.php delete mode 100644 db/migrations/20200306_change_schedule_color_with_category_index.php delete mode 100644 db/migrations/20200307_fixes_on_schedule_coloring.php delete mode 100644 db/migrations/20200414_remove_new_widget_system.php delete mode 100644 db/migrations/20200423_replace_library_system.php delete mode 100644 db/migrations/20200514_tic9898_add_course_wizard_step.php delete mode 100644 db/migrations/20200515_tic10318_http_proxy.php delete mode 100644 db/migrations/20200522_termsconfig.php delete mode 100644 db/migrations/20200709_step345_wiki_ancestor.php delete mode 100644 db/migrations/20200713_add_admin_courses_sidebar_active_elements.php delete mode 100644 db/migrations/20200811_adjust_i18n_tables.php delete mode 100644 db/migrations/20200909_mvv_bugs.php delete mode 100644 db/migrations/20200910_remove_invalid_modul_user_assignments.php delete mode 100755 db/migrations/20201002_biest_10803_fix.php delete mode 100644 db/migrations/20201005_database_changes_tic_9218.php delete mode 100644 db/migrations/20201007_hide_studygroups_from_profile.php delete mode 100644 db/migrations/20201023_tiled_courses.php delete mode 100644 db/migrations/20201024_tiled_courses_2.php delete mode 100644 db/migrations/20201025_tiled_courses_3.php delete mode 100644 db/migrations/202011031_add_missing_indices_resources.php delete mode 100644 db/migrations/20201103_add_missing_indices.php delete mode 100644 db/migrations/20201108_config_i18n.php delete mode 100644 db/migrations/20201110_course_members_hide.php delete mode 100644 db/migrations/20201113_tic_9101.php delete mode 100644 db/migrations/20201115_introduce_range_config.php delete mode 100644 db/migrations/20201116_consultation_extension.php delete mode 100644 db/migrations/20201203_course_groups_hide.php delete mode 100644 db/migrations/20201211_add_seminare_semester_table.php delete mode 100644 db/migrations/20201212_add_seminare_semester_course_index.php delete mode 100644 db/migrations/20210104_tic_11041.php delete mode 100644 db/migrations/20210108_tic11044_admin_course_notices.php delete mode 100644 db/migrations/20210201_step_00349.php delete mode 100644 db/migrations/20210204_tic_8183_terms_admission.php delete mode 100644 db/migrations/20210212_admin_related_inst.php delete mode 100644 db/migrations/202102161_oercampus_integration.php delete mode 100644 db/migrations/20210226_step_00353_cache.php delete mode 100644 db/migrations/20210317_change_blubber_thread_following.php delete mode 100644 db/migrations/20210322_migration_history_reworked.php delete mode 100644 db/migrations/20210406_add_terms_accepted_config.php delete mode 100644 db/migrations/20210422_add_missing_evaluation_configuration.php delete mode 100644 db/migrations/20210425_biest_11462_change_column_types.php delete mode 100644 db/migrations/20210503_drop_citation_style.php delete mode 100644 db/migrations/20210505_tic11044_admin_course_notices_2.php delete mode 100755 db/migrations/20210511_courseware_integration.php delete mode 100644 db/migrations/202106231_add_content_widget.php delete mode 100644 db/migrations/202_remove_skype_status.php delete mode 100644 db/migrations/203_archive_help_texts.php delete mode 100644 db/migrations/204_dialog_from_notification.php delete mode 100644 db/migrations/205_course_scm_helptext.php delete mode 100644 db/migrations/206_alter_columns_weekoffset_to_int.php delete mode 100644 db/migrations/207_add_etask_tables.php delete mode 100644 db/migrations/208_migrate_questionnaire_questions.php delete mode 100644 db/migrations/209_convert_cronjob_logs.php delete mode 100644 db/migrations/20_calendar_events_class_default.php delete mode 100644 db/migrations/210_tic_7206.php delete mode 100644 db/migrations/211_tic7307_admission_rule_path.php delete mode 100644 db/migrations/212_refactor_config_local.php delete mode 100644 db/migrations/213_log_action_statusgroups.php delete mode 100644 db/migrations/214_textmarkup_datafield.php delete mode 100644 db/migrations/215_default_data_field_values.php delete mode 100644 db/migrations/216_add_evaldate.php delete mode 100644 db/migrations/217_course_number_format_config.php delete mode 100644 db/migrations/218_extend_phone_fax_size.php delete mode 100644 db/migrations/219_loginbackgrounds.php delete mode 100644 db/migrations/21_more_indexing.php delete mode 100644 db/migrations/220_step_00313_coursegroups.php delete mode 100644 db/migrations/221_moadb.php delete mode 100644 db/migrations/222_utf8_conversion.php delete mode 100644 db/migrations/223_course_mailing_for_students.php delete mode 100644 db/migrations/224_db_cache_table.php delete mode 100644 db/migrations/225_extend_course_completion.php delete mode 100644 db/migrations/226_config_values.php delete mode 100644 db/migrations/227_biest_8034_config_switch_for_child_insts.php delete mode 100644 db/migrations/228_show_adressees.php delete mode 100644 db/migrations/229_step_00278_global_search.php delete mode 100644 db/migrations/22_lit_list_content_note_from_varchar_to_text.php delete mode 100644 db/migrations/230_widgets.php delete mode 100644 db/migrations/231_add_files_search_index.php delete mode 100644 db/migrations/232_step_00315_mvv_i18n.php delete mode 100644 db/migrations/233_step_00316_mvvkernintegration.php delete mode 100644 db/migrations/234_add_mkdate_to_statusgruppe_user.php delete mode 100644 db/migrations/235_tic8335_paper_related_topics.php delete mode 100644 db/migrations/236_config_public_topics.php delete mode 100644 db/migrations/237_config_mail_subject.php delete mode 100644 db/migrations/238_db_updates_for_42.php delete mode 100644 db/migrations/239_step_00327.php delete mode 100644 db/migrations/23_enlarge_object_contentmodules_module_id.php delete mode 100644 db/migrations/240_tic8538.php delete mode 100644 db/migrations/241_step_00320_config_search_navigation.php delete mode 100644 db/migrations/242_tic_8546_search_show_admission_state.php delete mode 100644 db/migrations/243_tic8773_sort_news_by_chdate.php delete mode 100644 db/migrations/244_config_default_seats.php delete mode 100644 db/migrations/245_tic7804_wiki_permissions.php delete mode 100644 db/migrations/246_consultations.php delete mode 100644 db/migrations/247_step_00330.php delete mode 100644 db/migrations/248_step_00331_ilias_interface.php delete mode 100644 db/migrations/249_lti_consumer.php delete mode 100644 db/migrations/24_another_index_for_ex_termine.php delete mode 100644 db/migrations/250_disable_archive_search.php delete mode 100644 db/migrations/251_log_event_autoincrement.php delete mode 100644 db/migrations/252_js_assets.php delete mode 100644 db/migrations/253_adjust_token_table.php delete mode 100644 db/migrations/254_hash_opengraph_table.php delete mode 100644 db/migrations/255_tic9368_datafield_for_institution.php delete mode 100644 db/migrations/256_tic9543_update_help_content.php delete mode 100644 db/migrations/257_tic9544_add_external_id_semester.php delete mode 100644 db/migrations/258_tic7443_create_lvgruppen_independently.php delete mode 100644 db/migrations/259_migrations_reloaded.php delete mode 100644 db/migrations/25_step_00098_user_domains.php delete mode 100644 db/migrations/26_step_00146_lock_rules2.php delete mode 100644 db/migrations/27_step_147_mail_activationlink.php delete mode 100644 db/migrations/28_delete_wiki_links.php delete mode 100644 db/migrations/29_step_00138_studienbereichszuordnung.php delete mode 100644 db/migrations/30_auth_user_md5_perms.php delete mode 100644 db/migrations/31_high_priority_messages.php delete mode 100644 db/migrations/32_restricted_user_management.php delete mode 100644 db/migrations/33_lock_rule_admin_perm.php delete mode 100644 db/migrations/34_add_allow_selfassign_institute.php delete mode 100644 db/migrations/35_add_additional_log_actions.php delete mode 100644 db/migrations/36_step_00156_editierbares_impressum.php delete mode 100644 db/migrations/37_log_actions_expires.php delete mode 100644 db/migrations/38_allow_admin_useraccess.php delete mode 100644 db/migrations/39_step_00153_studienmodulmanagement.php delete mode 100644 db/migrations/40_add_index_to_log_events.php delete mode 100644 db/migrations/41_step_00157_rolemanagment.php delete mode 100644 db/migrations/42_change_action_id_inst_create.php delete mode 100644 db/migrations/43_step_00159_datafieldentry.php delete mode 100644 db/migrations/44_add_switch_to_preselect_semester.php delete mode 100644 db/migrations/45_refine_logevents.php delete mode 100644 db/migrations/46_step00172_remove_ilias_connect.php delete mode 100644 db/migrations/47_add_option_resources_hide_past_single_dates.php delete mode 100644 db/migrations/48_step_00174_plugin_interfaces.php delete mode 100644 db/migrations/49_step_00150_studygroups.php delete mode 100644 db/migrations/50_add_option_step_152.php delete mode 100644 db/migrations/51_unhide_dozents.php delete mode 100644 db/migrations/52_additional_semtree_log_actions.php delete mode 100644 db/migrations/53_file_and_folder_priority.php delete mode 100644 db/migrations/54_step_00161_plugin_admin.php delete mode 100644 db/migrations/55_add_missing_log_actions.php delete mode 100644 db/migrations/56_step_00176_wap.php delete mode 100644 db/migrations/57_step_00158_privacy.php delete mode 100644 db/migrations/58_add_config_allow_fakadmin.php delete mode 100644 db/migrations/59_step_00194_studycourse.php delete mode 100644 db/migrations/60_step_00191_modulesenable.php delete mode 100644 db/migrations/61_remove_studygroupdozent.php delete mode 100644 db/migrations/62_gender_iso_5218.php delete mode 100644 db/migrations/63_tic1207_config.php delete mode 100644 db/migrations/64_step_00199_forced_course_grouping.php delete mode 100644 db/migrations/65_step_00198_deputies.php delete mode 100644 db/migrations/66_config_filesystem_multicopy_enable.php delete mode 100644 db/migrations/67_step_00204_no_document_deletion.php delete mode 100644 db/migrations/68_add_schedule_table.php delete mode 100644 db/migrations/69_step_00202_enhanced_seminar_cycle.php delete mode 100644 db/migrations/70_step_00184_html5_video.php delete mode 100644 db/migrations/71_step_00192_page_layout.php delete mode 100644 db/migrations/72_config_ajax_autocomplete_disabled.php delete mode 100644 db/migrations/73_step_00193_html_email.php delete mode 100644 db/migrations/74_tic1422_pagination.php delete mode 100644 db/migrations/75_pdf_logo_configuration.php delete mode 100644 db/migrations/76_termin_related_persons.php delete mode 100644 db/migrations/77_step_00223_lockrules.php delete mode 100644 db/migrations/78_step00219_webservice_access.php delete mode 100644 db/migrations/79_step_216_automatisiertes_eintragen.php delete mode 100644 db/migrations/80_skiplinks_enable_configuration.php delete mode 100644 db/migrations/81_step_209_teilnehmericon.php delete mode 100644 db/migrations/83_tic1992_privacydefaults.php delete mode 100644 db/migrations/84_step_226_dozenten_labels.php delete mode 100644 db/migrations/85_tic2007_schedule_enable.php delete mode 100644 db/migrations/86_step_228_raumanfragen.php delete mode 100644 db/migrations/87_tic1091_chat.php delete mode 100644 db/migrations/88_biest2055_terms.php delete mode 100644 db/migrations/89_step_00205_group_calendar.php delete mode 100644 db/migrations/90_tic2395_smileys.php delete mode 100644 db/migrations/91_tic2568_comment_internal.php delete mode 100644 db/migrations/92_remove_schedule_user_table.php delete mode 100644 db/migrations/93_sem_classes_convert_into_db.php delete mode 100644 db/migrations/94_step237_datafields_mandatory.php delete mode 100644 db/migrations/95_extend_userstudiengang_primarykey.php delete mode 100644 db/migrations/96_step00234_homepageplugin_activation.php delete mode 100644 db/migrations/97_init_personal_notifications.php delete mode 100644 db/migrations/98_user_data_to_config.php delete mode 100644 db/migrations/99_step00245_simpleormap.php diff --git a/app/controllers/web_migrate.php b/app/controllers/web_migrate.php index 7b8def3..af22959 100644 --- a/app/controllers/web_migrate.php +++ b/app/controllers/web_migrate.php @@ -107,6 +107,6 @@ class WebMigrateController extends StudipController $widget = Sidebar::get()->addWidget(new SidebarWidget()); $widget->setTitle(_('Aktueller Versionsstand')); - $widget->addElement(new WidgetElement($this->version->get())); + $widget->addElement(new WidgetElement($this->version->get($this->branch))); } } diff --git a/db/migrations/01_init_migrations.php b/db/migrations/01_init_migrations.php deleted file mode 100644 index 86f2da5..0000000 --- a/db/migrations/01_init_migrations.php +++ /dev/null @@ -1,20 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `schema_version` ( - `domain` varchar(255) NOT NULL default '', - `version` int(11) NOT NULL default '0', - PRIMARY KEY (`domain`) - ) ENGINE=MyISAM; - "); - } -} -?> diff --git a/db/migrations/02_step_102_datenfeldtypen.php b/db/migrations/02_step_102_datenfeldtypen.php deleted file mode 100644 index 1e7b552..0000000 --- a/db/migrations/02_step_102_datenfeldtypen.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - */ - - -class Step102Datenfeldtypen extends Migration { - - function description() { - return 'modify db schema for StEP00102 to provide typed datafields'; - } - - function up() { - DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `object_type` `object_type` enum('sem','inst','user','userinstrole','usersemdata','roleinstdata') default NULL;"); - DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `view_perms` `view_perms` enum('all','user','autor','tutor','dozent','admin','root') default NULL;"); - DBManager::get()->exec("ALTER TABLE `datafields` ADD `type` enum('bool','textline','textarea','selectbox','date','time','email','url','phone', 'radio', 'combo') NOT NULL default 'textline';"); - DBManager::get()->exec("ALTER TABLE `datafields` ADD `typeparam` text NOT NULL;"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` ADD `sec_range_id` varchar(32) NOT NULL default '';"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP PRIMARY KEY , ADD PRIMARY KEY ( `datafield_id` , `range_id` , `sec_range_id` );"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` ADD INDEX `range_id` ( `range_id` , `datafield_id` );"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` ADD INDEX `datafield_id_2` (`datafield_id`,`sec_range_id`);"); - DBManager::get()->exec("ALTER TABLE `statusgruppe_user` ADD `visible` tinyint(4) NOT NULL default '1';"); - DBManager::get()->exec("ALTER TABLE `statusgruppe_user` ADD `inherit` tinyint(4) NOT NULL default '1';"); - DBManager::get()->exec("CREATE TABLE `aux_lock_rules` (`lock_id` varchar( 32 ) NOT NULL default '', `name` varchar( 255 ) NOT NULL default '', `description` text NOT NULL , `attributes` text NOT NULL , `sorting` text NOT NULL , PRIMARY KEY ( `lock_id` )) ENGINE=MyISAM;"); - DBManager::get()->exec("ALTER TABLE `seminare` ADD `aux_lock_rule` varchar(32) default NULL;"); - - $this->migrate_datafields(); - } - - function down() { - DBManager::get()->exec("ALTER TABLE `seminare` DROP `aux_lock_rule`;"); - DBManager::get()->exec("DROP TABLE `aux_lock_rules`;"); - DBManager::get()->exec("ALTER TABLE `statusgruppe_user` DROP `inherit`;"); - DBManager::get()->exec("ALTER TABLE `statusgruppe_user` DROP `visible`;"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP INDEX `datafield_id_2`;"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP INDEX `range_id`;"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP PRIMARY KEY , ADD PRIMARY KEY ( `datafield_id` , `range_id` );"); - DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP `sec_range_id`;"); - DBManager::get()->exec("ALTER TABLE `datafields` DROP `type`;"); - DBManager::get()->exec("ALTER TABLE `datafields` DROP `typeparam`;"); - DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `view_perms` `view_perms` enum('all','user','autor','tutor','dozent','admin','root') NOT NULL default 'all';"); - DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `object_type` `object_type` ENUM('sem','inst','user') default NULL;"); - } - - function migrate_datafields() { - - # only require, if exists - if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] - . '/config/config_datafields.inc.php')) { - return; - } - require_once 'config/config_datafields.inc.php'; - - if (!isset($DATAFIELDS)) { - return; - } - - require_once 'lib/classes/DataFieldStructure.class.php'; - - $ids = array_keys(DataFieldStructure::getDataFieldStructures()); - - foreach ($DATAFIELDS as $id => $field) { - - if (!in_array($id, $ids)) { - $this->write('Not existent: ' . $id); - continue; - } - - $struct = new DataFieldStructure(['datafield_id' => $id]); - - $mapping = ['text' => 'textline', - 'textarea' => 'textarea', - 'checkbox' => 'bool', - 'select' => 'selectbox', - 'combo' => 'combo', - 'radio' => 'radio', - 'date' => 'date']; - - if (!isset($mapping[$field['type']])) { - # TODO (mlunzena) what to do? - } - - $type = $mapping[$field['type']]; - $type_param = ''; - - if (in_array($type, ['selectbox', 'combo', 'radio'])) { - $type_param = $this->get_type_param($field['options']); - } - - $struct->setType($type); - $struct->setTypeParam($type_param); - $struct->store(); - } - } - - function get_type_param($options) { - $new_options = []; - foreach ((array)$options as $key => $value) { - if (is_string($value)) { - $new_options[] = $value; - } - else { - $new_options[] = $value['name']; - } - } - return join("\n", $new_options); - } -} diff --git a/db/migrations/03_step_87_extern_configurations.php b/db/migrations/03_step_87_extern_configurations.php deleted file mode 100644 index 5b7b1f9..0000000 --- a/db/migrations/03_step_87_extern_configurations.php +++ /dev/null @@ -1,46 +0,0 @@ -exec("ALTER TABLE `extern_config` ADD `config` MEDIUMTEXT NOT NULL AFTER `is_standard`"); - - $configs = DBManager::get()->query("SELECT `range_id`, `config_id` FROM `extern_config`")->fetchAll(PDO::FETCH_ASSOC); - - $this->announce(" KONVERTIERUNG START "); - - $i = 0; - foreach ($configs as $config) { - $old_config = new ExternConfigIni($config['range_id'], '', $config['config_id']); - $new_config = new ExternConfigDb($config['range_id'], '', $config['config_id']); - - $new_config->setConfiguration($old_config->getConfiguration()); - - if ($new_config->store()) { - $this->write(sprintf("Konfiguration mit der id %s konvertiert!", $new_config->getId())); - $i++; - } else { - $this->write(sprintf("FEHLER! Die Konfiguration mit der id %s konnte nicht konvertiert werden!", $config['config_id'])); - } - } - - if (count($configs) == $i) { - $this->write("Alle Konfigurationsdateien vermutlich fehlerfrei in die Datenbank uebertragen!"); - $this->write(sprintf("Es wurden %s Konfigurationsdateien uebertragen.", $i)); - } else { - $this->write("Es wurden nicht alle Konfigurationsdateien uebertragen!"); - $this->write(sprintf("Es wurden %s Konfigurationsdateien von %s Konfigurationsdateien uebertragen!", $i, count($configs))); - $this->write("Bitte die fehlerhaften Konfigurationen manuell ueberpruefen."); - } - - $this->announce(" KONVERTIERUNG ENDE "); - - } -} diff --git a/db/migrations/04_step_116_participant_view.php b/db/migrations/04_step_116_participant_view.php deleted file mode 100644 index b419613..0000000 --- a/db/migrations/04_step_116_participant_view.php +++ /dev/null @@ -1,32 +0,0 @@ -announce(" creating table..."); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `teilnehmer_view` ( - `datafield_id` varchar(40) NOT NULL default '', - `seminar_id` varchar(40) NOT NULL default '', - `active` tinyint(4) default NULL, - PRIMARY KEY (`datafield_id`, `seminar_id`) - )"); - - $this->announce("done."); - - } - - public function down () - { - $this->announce(" removing table..."); - - DBManager::get()->exec("DROP TABLE `teilnehmer_view`"); - - $this->announce("done."); - } -} diff --git a/db/migrations/05_step_25_raumzeit_migrations.php b/db/migrations/05_step_25_raumzeit_migrations.php deleted file mode 100644 index 14b9252..0000000 --- a/db/migrations/05_step_25_raumzeit_migrations.php +++ /dev/null @@ -1,169 +0,0 @@ -write( get_class($this)." - Creating db schema..."); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `themen` ( - `issue_id` varchar(32) NOT NULL default '', - `seminar_id` varchar(32) NOT NULL default '', - `author_id` varchar(32) NOT NULL default '', - `title` varchar(255) NOT NULL default '', - `description` text NOT NULL, - `priority` smallint(5) unsigned NOT NULL default '0', - `mkdate` int(10) unsigned NOT NULL default '0', - `chdate` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`issue_id`), - KEY `seminar_id` (`seminar_id`,`priority`) - ) ENGINE=MyISAM; - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `ex_termine` ( - `termin_id` varchar(32) NOT NULL default '', - `range_id` varchar(32) NOT NULL default '', - `autor_id` varchar(32) NOT NULL default '', - `content` varchar(255) NOT NULL default '', - `description` text, - `date` int(20) NOT NULL default '0', - `end_time` int(20) NOT NULL default '0', - `mkdate` int(20) NOT NULL default '0', - `chdate` int(20) NOT NULL default '0', - `date_typ` tinyint(4) NOT NULL default '0', - `topic_id` varchar(32) default NULL, - `expire` int(20) default NULL, - `repeat` varchar(128) default NULL, - `color` varchar(20) default NULL, - `priority` tinyint(4) default NULL, - `raum` varchar(255) default NULL, - `metadate_id` varchar(32) default NULL, - `resource_id` varchar(32) NOT NULL default '', - PRIMARY KEY (`termin_id`), - KEY `range_id` (`range_id`,`date`), - KEY `metadate_id` (`metadate_id`,`date`) - ) ENGINE=MyISAM PACK_KEYS=1; - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `themen_termine` ( - `issue_id` varchar(32) NOT NULL default '', - `termin_id` varchar(32) NOT NULL default '', - PRIMARY KEY (`issue_id`,`termin_id`), - KEY `termin_id` (`termin_id`,`issue_id`) - ) ENGINE=MyISAM; - "); - DBManager::get()->exec(" - ALTER TABLE `termine` DROP INDEX `autor_id` - "); - DBManager::get()->exec(" - ALTER TABLE `termine` DROP INDEX `range_id` - "); - DBManager::get()->exec(" - ALTER TABLE `termine` ADD `metadate_id` VARCHAR( 32 ); - "); - - DBManager::get()->exec(" - ALTER TABLE `termine` ADD INDEX ( `metadate_id` , `date` ) - "); - - DBManager::get()->exec(" - ALTER TABLE `termine` ADD INDEX ( `range_id` , `date` ); - "); - - DBManager::get()->exec(" - ALTER TABLE `resources_requests` ADD `reply_comment` TEXT AFTER `comment`; - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_UNDELETE_SINGLEDATE'), 'SEM_UNDELETE_SINGLEDATE', 'Einzeltermin wiederherstellen', '%user stellt Einzeltermin %singledate(%affected) in %sem(%coaffected) wieder her.', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_SINGLEDATE'), 'SEM_DELETE_SINGLEDATE', 'Einzeltermin löschen', '%user löscht Einzeltermin %singledate(%affected) in %sem(%coaffected).', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_SET_STARTSEMESTER'), 'SEM_SET_STARTSEMESTER', 'Startsemester ändern', '%user hat in %sem(%affected) das Startsemester auf %semester(%coaffected) geändert.', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_SET_ENDSEMESTER'), 'SEM_SET_ENDSEMESTER', 'Semesterlaufzeit ändern', '%user hat in %sem(%affected) die Laufzeit auf %semester(%coaffected) geändert', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_ADD_CYCLE'), 'SEM_ADD_CYCLE', 'Regelmäßige Zeit hinzugefügt', '%user hat in %sem(%affected) die regelmäßige Zeit %coaffected hinzugefügt.', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_CYCLE'), 'SEM_DELETE_CYCLE', 'Regelmäßige Zeit gelöscht', '%user hat in %sem(%affected) die regelmäßige Zeit %coaffected gelöscht.', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_ADD_SINGLEDATE'), 'SEM_ADD_SINGLEDATE', 'Einzeltermin hinzufügen', '%user hat in %sem(%affected) den Einzeltermin %coaffected hinzugefügt', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_REQUEST'), 'SEM_DELETE_REQUEST', 'Raumanfrage gelöscht', '%user hat in %sem(%affected) die Raumanfrage für die gesamte Veranstaltung gelöscht.', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_SINGLEDATE_REQUEST'), 'SEM_DELETE_SINGLEDATE_REQUEST', 'Einzeltermin, Raumanfrage gelöscht', '%user hat in %sem(%affected) die Raumanfrage für den Termin %coaffected gelöscht.', 1, NULL); - "); - - DBManager::get()->exec(" - INSERT INTO `log_actions` VALUES (MD5('SINGLEDATE_CHANGE_TIME'), 'SINGLEDATE_CHANGE_TIME', 'Einzeltermin bearbeiten', '%user hat in %sem(%affected) den Einzeltermin %coaffected geändert.', 1, NULL); - "); - - // move "RESOURCES_ENABLE" from config_local.inc.php to config table: - if( $GLOBALS["RESOURCES_ENABLE"] ){ - // if "true", insert this as a local customization - DBManager::get()->exec(" - INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES ( 'dade8ea9ac4ec346e796ab9449d35b0e' , '', 'RESOURCES_ENABLE', '1', '0', 'boolean', 'global', '', '0', '0', '0', 'Enable the Stud.IP resource management module', '', ''); - "); - } - - // RESOURCES_ENABLE default value (=false) - DBManager::get()->exec(" - INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES ( '06cdb765fb8f0853e3ebe08f51c3596e' , '', 'RESOURCES_ENABLE', '0', '1', 'boolean', 'global', '', '0', '0', '0', 'Enable the Stud.IP resource management module', '', ''); - "); - - DBManager::get()->exec(" - INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES ( '93da66ca9e2d17df5bc61bd56406add7' , '', 'RESOURCES_ROOM_REQUEST_DEFAULT_ACTION', 'NO_ROOM_INFO_ACTION', '1', 'string', 'global', '', '0', '0', '0', 'Designates the pre-selected action for the room request dialog', 'Valid values are: NO_ROOM_INFO_ACTION, ROOM_REQUEST_ACTION, BOOKING_OF_ROOM_ACTION, FREETEXT_ROOM_ACTION', ''); - "); - - DBManager::get()->exec(" - INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) - VALUES ('0d3f84ed4dd6b7147b504ffb5b6fbc2c', '', 'RESOURCES_ENABLE_EXPERT_SCHEDULE_VIEW', '0', 1, 'boolean', 'global', '', 0, 12, 12, 'Enables the expert view of the course schedules', '', ''); - "); - - DBManager::get()->exec(" - INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES ( 'bc3004618b17b29dc65e10e89be9a7a0', '', 'RESOURCES_ENABLE_BOOKINGSTATUS_COLORING', '1', '1', 'boolean', 'global', '', '0', '0', '0', 'Enable the colored presentation of the room booking status of a date', '', ''); - "); - - $this->write( get_class($this).": Finished with creating db schema."); - - // close logfile - fclose($logfile_handle); - } -} - diff --git a/db/migrations/06_step_25_raumzeit_db_conversion.php b/db/migrations/06_step_25_raumzeit_db_conversion.php deleted file mode 100644 index 1dd8edf..0000000 --- a/db/migrations/06_step_25_raumzeit_db_conversion.php +++ /dev/null @@ -1,241 +0,0 @@ -write( get_class($this).": Starting data conversion... - this may take a very long time"); - - // create secret password for subroutine authentication - $secret_password = md5(uniqid("ditnuc6532ktn")); - - // signal start of conversion and set 'secret' - DBManager::get()->exec(" - REPLACE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES ( - 'migration5' , '', 'MIGRATION_5_TEMPORARY_SECRET', '".$secret_password."', '0', 'string', 'global', '', '0', '0', '0', 'Temporary secret string for migragtion 5', 'Temporary entry of migration 5', '' - ); - "); - - $this->convert_data( $logfile_handle, $secret_password); - - // remove signal - DBManager::get()->exec("DELETE FROM `config` WHERE config_id = 'migration5'"); - - $this->write( get_class($this).": Finished with data conversion..."); - - // close logfile - fclose($logfile_handle); - } - - - public function convert_data($logfile_handle, $secret_password) - { - // data conversion code: - - // we need enough memory - ini_set( "memory_limit", "256M"); - - // set URL of subroutine file - // (needed because of PHP memory problems, if the conversion would be done in one step) - $CONVERSION_SUBROUTINE_URL = $GLOBALS["ABSOLUTE_URI_STUDIP"] ."raumzeit_conversion_subroutine.php"; - - // define step size (number of rows) for subroutine proccessing - $STEP_SIZE= 300; - - - // include business logic - require_once('lib/classes/Seminar.class.php'); - require_once('lib/resources/lib/VeranstaltungResourcesAssign.class.php'); - - - - // lets go... - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Starting conversion of imported seminar dates.\n"); - - - // STEP 1: - // convert the title of dates (="content") to real themes - // converts all dates, that don't have content=='' - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Step 1: Converting the title of dates to real themes:\n"); - - // get all dates (=termine) with content!='' - $query = "SELECT termine.* - FROM seminare - LEFT JOIN termine ON (seminare.Seminar_id = termine.range_id) - WHERE content != '' OR description != ''"; - $data = DBManager::get()->fetchAll($query); - - // create new theme for each date - foreach ($data as $row) { - $new_issue_id = md5(uniqid('Issue', true)); - - $query = "INSERT INTO `themen_termine` (`issue_id`, `termin_id`) - VALUES (:issue_id, :termin_id)"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':issue_id', $new_issue_id); - $statement->bindValue(':termin_id', $row['termin_id']); - $statement->execute(); - - $query = "INSERT INTO themen - (issue_id, seminar_id, author_id, title, description, mkdate, chdate) - VALUES - (:issue_id, :seminar_id, :author_id, :title, :description, :mkdate, :chdate)"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':issue_id', $new_issue_id); - $statement->bindValue(':seminar_id', $row['range_id']); - $statement->bindValue(':author_id', $row['author_id']); - $statement->bindValue(':title', $row['content']); - $statement->bindValue(':description', $row['description']); - $statement->bindValue(':mkdate', $row['mkdate']); - $statement->bindValue(':chdate', $row['chdate']); - $statement->execute(); - - $query = "UPDATE termine - SET content = '', description = '' - WHERE termin_id = :termin_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':termin_id', $row['termin_id']); - $statement->execute(); - - $query = "UPDATE folder - SET range_id = :range_id - WHERE range_id = :termin_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':range_id', $new_issue_id); - $statement->bindValue(':termin_id', $row['termin_id']); - $statement->execute(); - - if ($row['topic_id']) { - $query = "UPDATE px_topics - SET topic_id = :issue_id - WHERE topic_id = :topic_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':issue_id', $new_issue_id); - $statement->bindValue(':topic_id', $row['topic_id']); - $statement->execute(); - - $query = "UPDATE px_topics - SET root_id = :issue_id - WHERE root_id = :topic_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':issue_id', $new_issue_id); - $statement->bindValue(':topic_id', $row['topic_id']); - $statement->execute(); - - $query = "UPDATE px_topics - SET parent_id = :issue_id - WHERE parent_id = :topic_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':issue_id', $new_issue_id); - $statement->bindValue(':topic_id', $row['topic_id']); - $statement->execute(); - } - - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") converting termin_id='".$row['termin_id']."', added theme_id='".$new_issue_id."'\n"); - flush(); - } - - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Finished Step 1. Converted " . count($data) . " dates.\n"); - - // END OF STEP 1 - - - // STEP 2: - // create single dates for all regular dates (turnus_data in metadata_dates) - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Step 2: Creating single dates for all regular dates:\n"); - - // reset counter - $counter = 0; - - // set number of record to start with - $start_at = 0; - - do { - // call the conversion subroutine with number of rows that should get processed - - $subroutine_url = $CONVERSION_SUBROUTINE_URL ."?step_size=".$STEP_SIZE."&start_at=".$start_at."&secret=".$secret_password; - -// curl: - // create cURL-Handle - $ch = curl_init(); - - // set url and other option - curl_setopt($ch, CURLOPT_URL, $subroutine_url); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - - // make the call to the url - $response = curl_exec ($ch); - - // close cURL-Handle und gebe die Systemresourcen frei - curl_close($ch); - -// file_get_contents (fopen wrappers) -// removed file_get_contents access, in favor of curl because file_get_contents could not access the desired URL with -// every data we had for testing; it was not possible to reproduce this error e.g. by calling file_get_contents -// directly from the shell -// // open URL via fopen = "call" subroutine -// $response = file_get_contents( $subroutine_url ); - - // success ? - if( $response == FALSE ){ - $this->write( get_class($this)." - Error while executing subroutine. Can't open URL. Stopping.\n"); - fwrite($logfile_handle, "Error while executing subroutine. Can't open URL '$subroutine_url'. Stopping.\n"); - throw new Exception("Error while executing subroutine."); - } - - - // some not quite nice error handling: - if( substr($response,0,5) == "ERROR" ){ - // write output to logfile - $this->write( get_class($this)." - Error while executing subroutine. Please see logfile for details. Stopping.\n"); - fwrite( $logfile_handle, $response); - fwrite($logfile_handle, "Error while executing subroutine. Stopping.\n"); - throw new Exception("Error while executing subroutine.". $response); - } - - // get last line (holds the number of converted rows) - $begin_of_last_line = strrpos( $response, "\n")+1; - $numberOfConvertedRows = substr($response, $begin_of_last_line, strlen($response)-$begin_of_last_line); - - // check, if $numberOfConvertedRows is really a number - if( !is_numeric($numberOfConvertedRows) ){ - $this->write( get_class($this)." - Error while executing subroutine. Please see logfile for details. Stopping.\n"); - // write output to logfile - fwrite( $logfile_handle, $response."\n"); - fwrite($logfile_handle, "Error while executing subroutine. Invalid number of converted lines found. Stopping.\n"); - throw new Exception("Error while executing subroutine.\n ". $response); - } - - // cutoff last line - $response = substr($response, 0, $begin_of_last_line); - - // write output to logfile - fwrite( $logfile_handle, $response); - - // count total amount of converted seminars - $counter += $numberOfConvertedRows; - - // step to next record package - $start_at += $STEP_SIZE; - - } while( $numberOfConvertedRows != 0); - - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Finished Step 2. Converted $counter seminars.\n"); - - fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Conversion finished."); - - $this->write( get_class($this).": Converted $counter seminars."); - } -} diff --git a/db/migrations/07_table_token_class.php b/db/migrations/07_table_token_class.php deleted file mode 100644 index 7f3a715..0000000 --- a/db/migrations/07_table_token_class.php +++ /dev/null @@ -1,35 +0,0 @@ -announce(" creating table..."); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `user_token` ( - `user_id` VARCHAR( 32 ) NOT NULL , - `token` VARCHAR( 32 ) NOT NULL , - `expiration` INT NOT NULL , - PRIMARY KEY ( `user_id` , `token` , `expiration` ), - INDEX index_expiration (`expiration`), - INDEX index_token (`token`), - INDEX index_user_id (`user_id`) - ) ENGINE=MyISAM;"); - - $this->announce("done."); - - } - - public function down () - { - $this->announce(" removing table..."); - DBManager::get()->exec("DROP TABLE `user_token`"); - - $this->announce("done."); - - } -} diff --git a/db/migrations/08_step_117_studienmodule.php b/db/migrations/08_step_117_studienmodule.php deleted file mode 100644 index e124873..0000000 --- a/db/migrations/08_step_117_studienmodule.php +++ /dev/null @@ -1,261 +0,0 @@ - Studienprogramme'; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_abstract_elements` --- - -CREATE TABLE `stm_abstract_elements` ( - `element_id` varchar(32) NOT NULL default '' COMMENT 'ID eines abstrakten Modulbestandzeiles', - `stm_abstr_id` varchar(32) NOT NULL default '' COMMENT 'ID eines abstrakten Studienmodules', - `element_type_id` varchar(32) NOT NULL default '' COMMENT 'um welche Art von Element handelt es sich', - `custom_name` varchar(50) default NULL COMMENT 'selbstgewählter Name', - `sws` tinyint(4) NOT NULL default '0' COMMENT 'Semesterwochenstunden für den Bestandteil', - `workload` int(4) NOT NULL default '0', - `semester` tinyint(1) default NULL COMMENT 'Sommer od. Winter (Sommer = 1; Winter = 2)', - `elementgroup` tinyint(4) NOT NULL default '0' COMMENT 'Kombinationsvariante', - `position` tinyint(4) NOT NULL default '0' COMMENT 'Reihenfolge ', - PRIMARY KEY (`element_id`), - UNIQUE KEY `elem_integr` (`stm_abstr_id`,`elementgroup`,`position`) -) ENGINE=MyISAM COMMENT='Bestandteile eines Abstrakten Moduls (Elemente)'; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_abstract_text` --- - -CREATE TABLE `stm_abstract_text` ( - `stm_abstr_id` varchar(32) NOT NULL default '' COMMENT 'ID des abstrakten Studienmodules', - `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', - `title` varchar(155) NOT NULL default '' COMMENT 'Allgemeiner Modultitel (Name des Moduls)', - `subtitle` varchar(155) default NULL COMMENT 'optionaler Untertitel', - `topics` text NOT NULL COMMENT 'Inhalte (behandelte Themen etc.)', - `aims` text NOT NULL COMMENT 'Lernziele', - `hints` text, - PRIMARY KEY (`stm_abstr_id`,`lang_id`) -) ENGINE=MyISAM COMMENT='(mehrsprachige) Texte der abstrakten Module'; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_abstract_types` --- - -CREATE TABLE `stm_abstract_types` ( - `stm_type_id` varchar(32) NOT NULL default '' COMMENT 'ID eines Modultyps', - `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', - `abbrev` varchar(5) NOT NULL default '' COMMENT 'Abkuerzung', - `name` varchar(25) NOT NULL default '' COMMENT 'vollstaendige Bezeichnung', - PRIMARY KEY (`stm_type_id`,`lang_id`) -) ENGINE=MyISAM COMMENT='Typen abstrakter Module'; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_element_types` --- - -CREATE TABLE `stm_element_types` ( - `element_type_id` varchar(32) NOT NULL default '' COMMENT 'ID des Modulbestandteils', - `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', - `abbrev` varchar(5) default NULL COMMENT 'Kurzname', - `name` varchar(50) NOT NULL default '' COMMENT 'Name', - PRIMARY KEY (`element_type_id`,`lang_id`) -) ENGINE=MyISAM COMMENT='Typen von möglichen Bestandteilen eines abstrakten Moduls'; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_instances` --- - -CREATE TABLE `stm_instances` ( - `stm_instance_id` varchar(32) NOT NULL default '' COMMENT 'ID eines konkreten Studienmodules', - `stm_abstr_id` varchar(32) NOT NULL default '' COMMENT 'ID eines abstrakten Studienmodules', - `semester_id` varchar(32) NOT NULL default '' COMMENT 'ID des ersten Semesters in dem die Instanz stattfindet', - `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der Sprache in der das Modul angeboten wird', - `homeinst` varchar(32) default NULL COMMENT 'ID des anbietenden Institutes', - `creator` varchar(32) NOT NULL, - `responsible` varchar(32) default NULL COMMENT 'ID des Modulverantwortlichen Dozenten', - `complete` tinyint(1) NOT NULL default '0' COMMENT 'Erfassung komplett (0=FALSE)', - PRIMARY KEY (`stm_instance_id`) -) ENGINE=MyISAM COMMENT='Instanzen der abstrakten Module'; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_instances_elements` --- - -CREATE TABLE `stm_instances_elements` ( - `stm_instance_id` varchar(32) NOT NULL default '' COMMENT 'ID eines konkreten Studienmodules', - `element_id` varchar(32) NOT NULL default '' COMMENT 'ID des abstrakten Modulbestandteils', - `sem_id` varchar(32) NOT NULL default '' COMMENT 'ID der konkreten Veranstaltung', - PRIMARY KEY (`stm_instance_id`,`element_id`,`sem_id`) -) ENGINE=MyISAM; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `stm_instances_text` --- - -CREATE TABLE `stm_instances_text` ( - `stm_instance_id` varchar(32) NOT NULL default '' COMMENT 'ID eines konkreten Studienmodules', - `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', - `title` varchar(155) NOT NULL default '' COMMENT 'Allgemeiner Modultitel', - `subtitle` varchar(155) default NULL COMMENT 'optionaler Untertitel', - `topics` text NOT NULL COMMENT 'Inhalte', - `hints` text, - PRIMARY KEY (`stm_instance_id`,`lang_id`) -) ENGINE=MyISAM COMMENT='(mehrsprachige) Texte der instanziierten abstrakten Module'; -"; - - private $sql_down = "DROP TABLE IF EXISTS `his_abschl`, `his_abstgv`, `his_pvers`, `his_stg`, `stm_abstract`, `stm_abstract_assign`, `stm_abstract_elements`, `stm_abstract_text`, `stm_abstract_types`, `stm_element_types`, `stm_instances`, `stm_instances_elements`, `stm_instances_text`;"; - - public function description () - { - return 'modify db schema StEP00117 Studienmodulstrukturen; '; - } - - public function up () - { - $this->announce(get_class($this) . ": Creating db schema..."); - $statements = preg_split("/;[[:space:]]*\n/", $this->sql_up); - foreach($statements as $sqlstatement) { - DBManager::get()->exec($sqlstatement); - } - } - - public function down () - { - $this->announce(get_class($this) . ": Deleting db schema..."); - $statements = preg_split("/;[[:space:]]*\n/", $this->sql_down); - foreach($statements as $sqlstatement) { - DBManager::get()->exec($sqlstatement); - } - } - -} diff --git a/db/migrations/09_step_00111_admission.php b/db/migrations/09_step_00111_admission.php deleted file mode 100644 index 03a744c..0000000 --- a/db/migrations/09_step_00111_admission.php +++ /dev/null @@ -1,34 +0,0 @@ -announce(" creating table `admission_group`..."); - - DBManager::get()->exec( "CREATE TABLE IF NOT EXISTS `admission_group` ( - `group_id` varchar(32) NOT NULL, - `name` varchar(255) NOT NULL, - `status` tinyint(3) unsigned NOT NULL, - `chdate` int(10) unsigned NOT NULL, - `mkdate` int(10) unsigned NOT NULL, - PRIMARY KEY (`group_id`) - ) ENGINE=MyISAM"); - $this->announce(" fill table with existing groups..."); - DBManager::get()->exec("INSERT IGNORE INTO admission_group - (group_id, status, chdate,mkdate) - SELECT DISTINCT admission_group,0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP() FROM seminare WHERE admission_group <> ''"); - $this->announce("done."); - } - - public function down () - { - $this->announce(" removing table `admission_group`..."); - DBManager::get()->exec("DROP TABLE IF EXISTS `admission_group` "); - $this->announce("done."); - } -} diff --git a/db/migrations/1.100_step00248_chat_extinction.php b/db/migrations/1.100_step00248_chat_extinction.php new file mode 100644 index 0000000..3ff3d31 --- /dev/null +++ b/db/migrations/1.100_step00248_chat_extinction.php @@ -0,0 +1,26 @@ +exec("DROP TABLE IF EXISTS chat_data"); + $db->exec("ALTER TABLE user_visibility DROP COLUMN chat"); + $db->exec("DELETE FROM config WHERE field = 'CHAT_USE_AJAX_CLIENT'"); + $db->exec("DELETE FROM config WHERE field = 'CHAT_ENABLE'"); + $db->exec("DELETE FROM config WHERE field = 'CHAT_VISIBILITY_DEFAULT'"); + $db->exec("DELETE FROM user_config WHERE field = 'CHAT_USE_AJAX_CLIENT'"); + } + + function down() + { + } +} diff --git a/db/migrations/1.101_step00246_blubber.php b/db/migrations/1.101_step00246_blubber.php new file mode 100644 index 0000000..2cb9161 --- /dev/null +++ b/db/migrations/1.101_step00246_blubber.php @@ -0,0 +1,124 @@ +exec(" + CREATE TABLE IF NOT EXISTS `blubber` ( + `topic_id` varchar(32) NOT NULL DEFAULT '', + `parent_id` varchar(32) NOT NULL DEFAULT '', + `root_id` varchar(32) NOT NULL DEFAULT '', + `context_type` enum('public','private','course') NOT NULL DEFAULT 'public', + `name` varchar(255) DEFAULT NULL, + `description` text, + `mkdate` int(20) NOT NULL DEFAULT '0', + `chdate` int(20) NOT NULL DEFAULT '0', + `author_host` varchar(255) DEFAULT NULL, + `Seminar_id` varchar(32) NOT NULL DEFAULT '', + `user_id` varchar(32) NOT NULL DEFAULT '', + `external_contact` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`topic_id`), + KEY `root_id` (`root_id`), + KEY `Seminar_id` (`Seminar_id`), + KEY `parent_id` (`parent_id`), + KEY `chdate` (`chdate`), + KEY `mkdate` (`mkdate`), + KEY `user_id` (`user_id`,`Seminar_id`) + ) ENGINE=MyISAM; + "); + //Spezialevents, bisher nur für Löschen von Beiträgen verwendet + $db->exec(" + CREATE TABLE IF NOT EXISTS `blubber_events_queue` ( + `event_type` varchar(32) NOT NULL, + `item_id` varchar(32) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`event_type`,`item_id`,`mkdate`), + KEY `item_id` (`item_id`) + ) ENGINE=MyISAM + "); + //Blubberautoren, die nicht in Stud.IP angemeldet sind wie anonyme + $db->exec(" + CREATE TABLE IF NOT EXISTS `blubber_external_contact` ( + `external_contact_id` varchar(32) NOT NULL, + `mail_identifier` varchar(256) DEFAULT NULL, + `contact_type` varchar(16) NOT NULL DEFAULT 'anonymous', + `name` varchar(256) NOT NULL, + `data` text, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`external_contact_id`), + KEY `mail_identifier` (`mail_identifier`), + KEY `contact_type` (`contact_type`) + ) ENGINE=MyISAM + "); + $db->exec(" + CREATE TABLE IF NOT EXISTS `blubber_follower` ( + `studip_user_id` varchar(32) NOT NULL, + `external_contact_id` varchar(32) NOT NULL, + `left_follows_right` tinyint(1) NOT NULL, + KEY `studip_user_id` (`studip_user_id`), + KEY `external_contact_id` (`external_contact_id`) + ) ENGINE=MyISAM + "); + //Rechte für private Blubber + $db->exec(" + CREATE TABLE IF NOT EXISTS `blubber_mentions` ( + `topic_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `external_contact` tinyint(4) NOT NULL DEFAULT '0', + `mkdate` int(11) NOT NULL, + UNIQUE KEY `unique_users_per_topic` (`topic_id`,`user_id`,`external_contact`), + KEY `topic_id` (`topic_id`), + KEY `user_id` (`user_id`) + ) ENGINE=MyISAM + "); + + $old_blubber = $db->query( + "SELECT * FROM plugins WHERE pluginclassname = 'Blubber' " . + "")->fetch(PDO::FETCH_ASSOC); + + if ($old_blubber) { + //Umschreiben des Ortes von Blubber + $db->exec(" + UPDATE plugins SET pluginpath = 'core/Blubber' WHERE pluginclassname = 'Blubber' + "); + if ($old_blubber['pluginpath'] !== "core/Blubber") { + @rmdirr($GLOBALS['PLUGINS_PATH']."/".$old_blubber['pluginpath']); + } + $db->exec(" + INSERT IGNORE INTO blubber (`topic_id`,`parent_id`,`root_id`,`context_type`,`name`,`description`,`mkdate`,`chdate`,`author_host`,`Seminar_id`,`user_id`,`external_contact`) + SELECT `topic_id`,`parent_id`,`root_id`,'course',`name`,`description`,`mkdate`,`chdate`,`author_host`,`Seminar_id`,`user_id`,0 + FROM px_topics + "); + } else { + //Installieren des Plugins + $db->exec(" + INSERT INTO plugins + SET pluginclassname = 'Blubber', + pluginpath = 'core/Blubber', + pluginname = 'Blubber', + plugintype = 'StandardPlugin,SystemPlugin', + enabled = 'yes', + navigationpos = '1' + "); + $plugin_id = $db->lastInsertId(); + $db->exec(" + INSERT IGNORE INTO roles_plugins (roleid, pluginid) + SELECT roleid, ".$db->quote($plugin_id)." FROM roles WHERE `system` = 'y' + "); + } + } + + function down() + { + } +} diff --git a/db/migrations/1.102_remove_guestbook_migration.php b/db/migrations/1.102_remove_guestbook_migration.php new file mode 100644 index 0000000..f384ac2 --- /dev/null +++ b/db/migrations/1.102_remove_guestbook_migration.php @@ -0,0 +1,36 @@ +exec(" + INSERT IGNORE INTO blubber (topic_id, parent_id, root_id, context_type, name, description, mkdate, chdate, Seminar_id, user_id, external_contact) + SELECT MD5(CONCAT('guestbook_', user_info.user_id)), '0', MD5(CONCAT('guestbook_', user_info.user_id)), 'public', ".$db->quote($guestbook_text).", ".$db->quote($guestbook_text).", user_info.mkdate, user_info.mkdate, user_info.user_id, user_info.user_id, '0' + FROM user_info + WHERE user_info.guestbook = '1' + "); + $db->exec(" + INSERT IGNORE INTO blubber (topic_id, parent_id, root_id, context_type, name, description, mkdate, chdate, Seminar_id, user_id, external_contact) + SELECT guestbook.post_id, MD5(CONCAT('guestbook_', guestbook.range_id)), MD5(CONCAT('guestbook_', guestbook.range_id)), 'public', ".$db->quote($guestbook_text).", guestbook.content, guestbook.mkdate, guestbook.mkdate, guestbook.range_id, guestbook.user_id, '0' + FROM guestbook + INNER JOIN user_info ON (guestbook.range_id = user_info.user_id) + WHERE user_info.guestbook = '1' + "); + $db->exec(" + DROP TABLE guestbook + "); + } + + function down() + { + } +} diff --git a/db/migrations/1.104_setup_cronjobs.php b/db/migrations/1.104_setup_cronjobs.php new file mode 100644 index 0000000..c25b6a6 --- /dev/null +++ b/db/migrations/1.104_setup_cronjobs.php @@ -0,0 +1,165 @@ +query("CREATE TABLE IF NOT EXISTS `cronjobs_tasks` ( + `task_id` CHAR(32) NOT NULL DEFAULT '', + `filename` VARCHAR(255) NOT NULL, + `class` VARCHAR(255) NOT NULL, + `active` TINYINT(1) NOT NULL DEFAULT 0, + `execution_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `assigned_count` INT(11) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`task_id`) + ) ENGINE=MyISAM"); + + DBManager::get()->query("CREATE TABLE IF NOT EXISTS `cronjobs_schedules` ( + `schedule_id` CHAR(32) NOT NULL DEFAULT '', + `task_id` CHAR(32) NOT NULL DEFAULT '', + `active` TINYINT(1) NOT NULL DEFAULT 0, + `title` VARCHAR(255) NULL DEFAULT NULL, + `description` VARCHAR(4096) DEFAULT NULL, + `parameters` TEXT, + `priority` ENUM('low','normal','high') NOT NULL DEFAULT 'normal', + `type` ENUM('periodic','once') NOT NULL DEFAULT 'periodic', + `minute` TINYINT(2) DEFAULT NULL, + `hour` TINYINT(2) DEFAULT NULL, + `day` TINYINT(2) DEFAULT NULL, + `month` TINYINT(2) DEFAULT NULL, + `day_of_week` TINYINT(1) UNSIGNED DEFAULT NULL, + `next_execution` INT(11) UNSIGNED NOT NULL DEFAULT 0, + `last_execution` INT(11) UNSIGNED DEFAULT NULL, + `last_result` TEXT, + `execution_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`schedule_id`), + KEY `task_id` (`task_id`) + ) ENGINE=MyISAM"); + + DBManager::get()->query("CREATE TABLE IF NOT EXISTS `cronjobs_logs` ( + `log_id` CHAR(32) NOT NULL DEFAULT '', + `schedule_id` CHAR(32) NOT NULL DEFAULT '', + `scheduled` INT(11) UNSIGNED NOT NULL, + `executed` INT(11) UNSIGNED NOT NULL, + `exception` TEXT DEFAULT NULL, + `output` TEXT, + `duration` FLOAT NOT NULL, + PRIMARY KEY (`log_id`), + KEY `schedule_id` (`schedule_id`) + ) ENGINE=MyISAM"); + + // Add config entries + $query = "INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description`) + VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'global', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + $statement = DBManager::get()->prepare($query); + + $statement->execute([ + ':field' => 'CRONJOBS_ENABLE', + ':value' => (int)false, + ':type' => 'boolean', + ':description' => 'Schaltet die Cronjobs an', + ]); + + $statement->execute([ + ':field' => 'CRONJOBS_ESCALATION', + ':value' => 300, + ':type' => 'integer', + ':description' => 'Gibt an, nach wievielen Sekunden ein Cronjob als steckengeblieben angesehen wird', + ]); + + // Add default cron tasks and schedules + $default_data = [ + [ + 'filename' => 'lib/cronjobs/cleanup_log.class.php', + 'class' => 'CleanupLogJob', + 'priority' => 'normal', + 'hour' => 2, + 'minute' => 13, + ], + [ + 'filename' => 'lib/cronjobs/purge_cache.class.php', + 'class' => 'PurgeCacheJob', + 'priority' => 'low', + 'hour' => null, + 'minute' => -30, + ], + [ + 'filename' => 'lib/cronjobs/send_mail_notifications.class.php', + 'class' => 'SendMailNotificationsJob', + 'priority' => 'high', + 'hour' => 1, + 'minute' => 7, + ], + [ + 'filename' => 'lib/cronjobs/check_admission.class.php', + 'class' => 'CheckAdmissionJob', + 'priority' => 'normal', + 'hour' => null, + 'minute' => -30, + ], + [ + 'filename' => 'lib/cronjobs/garbage_collector.class.php', + 'class' => 'GarbageCollectorJob', + 'priority' => 'normal', + 'hour' => 2, + 'minute' => 33, + ], + [ + 'filename' => 'lib/cronjobs/session_gc.class.php', + 'class' => 'SessionGcJob', + 'priority' => 'normal', + 'hour' => 3, + 'minute' => 13, + ], + ]; + + $query = "INSERT IGNORE INTO `cronjobs_tasks` + (`task_id`, `filename`, `class`, `active`) + VALUES (:task_id, :filename, :class, 1)"; + $task_statement = DBManager::get()->prepare($query); + + $query = "INSERT IGNORE INTO `cronjobs_schedules` + (`schedule_id`, `task_id`, `parameters`, `priority`, + `type`, `minute`, `hour`, `mkdate`, `chdate`, + `last_result`) + VALUES (:schedule_id, :task_id, '[]', :priority, 'periodic', + :minute, :hour, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + NULL)"; + $schedule_statement = DBManager::get()->prepare($query); + + foreach ($default_data as $row) { + $task_id = md5(uniqid('task', true)); + + $task_statement->execute([ + ':task_id' => $task_id, + ':filename' => $row['filename'], + ':class' => $row['class'], + ]); + + $schedule_id = md5(uniqid('schedule', true)); + $schedule_statement->execute([ + ':schedule_id' => $schedule_id, + ':task_id' => $task_id, + ':priority' => $row['priority'], + ':hour' => $row['hour'], + ':minute' => $row['minute'], + ]); + } + } + + function down() + { + DBManager::get()->query("DROP TABLE IF EXISTS `cronjobs_tasks`, `cronjobs_schedules`, `cronjobs_logs`"); + + DBManager::get()->query("DELETE FROM config WHERE field IN ('CRONJOB_ENABLE', 'CRONJOBS_ESCALATION')"); + } +} diff --git a/db/migrations/1.105_step_00247_forum.php b/db/migrations/1.105_step_00247_forum.php new file mode 100644 index 0000000..cdcf74c --- /dev/null +++ b/db/migrations/1.105_step_00247_forum.php @@ -0,0 +1,167 @@ +query("SELECT version FROM schema_version + WHERE domain = 'ForumPP'")->fetchColumn(); + + if ($forumpp_version !== false && $forumpp_version != 6) { // version 6 is the DB-Version of the latest ForumPP-Plugin + throw new Exception(_('Sie verwenden das ForumPP-Plugin in einer alten Version. ' + . 'Bitte aktualisieren Sie es zuerst auf die neueste Version, sonst kann ' + . 'Die Stud.IP-Migration nicht ausgeführt werden')); + + } else if ($forumpp_version == 6) { // prepare the tables for the rest of the migration + // rename the forum-tables + DBManager::get()->exec("RENAME TABLE + forumpp_abo_users TO forum_abo_users, + forumpp_categories TO forum_categories, + forumpp_categories_entries TO forum_categories_entries, + forumpp_entries TO forum_entries, + forumpp_favorites TO forum_favorites, + forumpp_likes TO forum_likes, + forumpp_visits TO forum_visits"); + + } else { // create the necessary tables for the forum from scratch + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_categories` ( + `category_id` varchar(32) NOT NULL, + `seminar_id` varchar(32) NOT NULL, + `entry_name` varchar(255) NOT NULL, + `pos` INT NOT NULL DEFAULT '0', + PRIMARY KEY ( `category_id` ) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_categories_entries` ( + `category_id` varchar(32) NOT NULL, + `topic_id` varchar(32) NOT NULL, + `pos` INT NOT NULL DEFAULT '0', + PRIMARY KEY ( `category_id` , `topic_id` ) + ) ENGINE=MyISAM + "); + + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_entries` ( + `topic_id` varchar(32) NOT NULL, + `seminar_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `name` varchar(255) NOT NULL, + `content` text NOT NULL, + `area` TINYINT NOT NULL DEFAULT '0', + `mkdate` int(20) NOT NULL, + `chdate` int(20) NOT NULL, + `author` varchar(255) NOT NULL, + `author_host` varchar(255) NOT NULL, + `lft` int(11) NOT NULL, + `rgt` int(11) NOT NULL, + `depth` int(11) NOT NULL, + `anonymous` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`topic_id`) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_likes` ( + `topic_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + PRIMARY KEY (`topic_id`,`user_id`) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_visits` ( + user_id varchar(32) NOT NULL, + seminar_id varchar(32) NOT NULL, + visitdate int(11) NOT NULL, + last_visitdate int(11) NOT NULL, + PRIMARY KEY ( `user_id` , `seminar_id` ) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_favorites` ( + user_id varchar(32) NOT NULL, + topic_id varchar(32) NOT NULL, + PRIMARY KEY ( `user_id` , `topic_id` ) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `forum_abo_users` ( + `topic_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + PRIMARY KEY (`topic_id`,`user_id`) + ) ENGINE=MyISAM + "); + } + + // add new table for the issue-connection + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `forum_entries_issues` ( + `topic_id` varchar(32) NOT NULL, + `issue_id` varchar(32) NOT NULL, + PRIMARY KEY (`topic_id`,`issue_id`) + ) ENGINE=MyISAM"); + + // add some highly needed indices + DBManager::get()->exec("ALTER TABLE `forum_entries` ADD INDEX ( `seminar_id` , `lft` )"); + DBManager::get()->exec("ALTER TABLE `forum_entries` ADD INDEX ( `seminar_id` , `rgt` )"); + DBManager::get()->exec("ALTER TABLE `forum_entries` ADD INDEX ( `user_id` )"); + DBManager::get()->exec("ALTER TABLE `forum_categories` ADD INDEX ( `seminar_id` )"); + + // get highest position + $navpos = DBManager::get()->query("SELECT navigationpos FROM plugins + ORDER BY navigationpos DESC")->fetchColumn() + 1; + + // insert plugin into db + $stmt = DBManager::get()->prepare("INSERT INTO plugins + (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) + VALUES ('CoreForum', 'core/Forum', 'Forum', 'ForumModule,StandardPlugin,StudipModule', 'yes', ?)"); + $stmt->execute([$navpos]); + + // get id of newly created plugin (we purposely do not use PDO::lastInserId()) + $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins + WHERE pluginpath = 'core/Forum'")->fetchColumn(); + + // set all default roles for the plugin (including nobody) + $stmt = DBManager::get()->prepare("INSERT INTO roles_plugins + (roleid, pluginid) VALUES (?, ?)"); + foreach (range(1,7) as $role_id) { + $stmt->execute([$role_id, $plugin_id]); + } + + + // remove old ForumPP-plugin + $old_forum = DBManager::get()->query("SELECT * FROM plugins + WHERE pluginclassname = 'ForumPP'")->fetch(PDO::FETCH_ASSOC); + + if ($old_forum) { + DBManager::get()->exec("DELETE FROM plugins + WHERE pluginclassname = 'ForumPP'"); + DBManager::get()->exec("DELETE FROM plugins_activated + WHERE pluginid = " . $old_forum['pluginid']); + DBManager::get()->exec("DELETE FROM plugins_default_activations + WHERE pluginid = " . $old_forum['pluginid']); + DBManager::get()->exec("DELETE FROM roles_plugins + WHERE pluginid = " . $old_forum['pluginid']); + DBManager::get()->exec("DELETE FROM schema_version + WHERE domain = 'ForumPP'"); + } + + // remove user-settings for the old forum + DBManager::get()->exec("DELETE FROM user_config WHERE `field` = 'FORUM_SETTINGS'"); + } + + function down() + { + } +} diff --git a/db/migrations/1.106_step_00247_forum_data_migration.php b/db/migrations/1.106_step_00247_forum_data_migration.php new file mode 100644 index 0000000..44fcc18 --- /dev/null +++ b/db/migrations/1.106_step_00247_forum_data_migration.php @@ -0,0 +1,310 @@ +query("SELECT * FROM px_topics WHERE topic_id = parent_id")->fetchAll(); + if (sizeof($problems) > 0) { + echo _('Sie haben fehlerhafte Einträge in ihrer px_topics-Tabelle. Folgende Einträge zeigen auf sich selbst (parent_id = topic_id)'); + echo "\n"; + foreach ($problems as $prob) { + echo implode(', ', $prob) ."\n"; + } + + echo "\n"; + echo _('Beheben Sie zuerst die fehlerhaften Einträge und führen Sie danach diese Migration erneut aus!'); + echo "\n\n"; + die; + } + + // get all seminars that need to be migrated + $stmt = DBManager::get()->prepare("SELECT DISTINCT Seminar_id FROM px_topics + WHERE topic_id = root_id + ORDER BY mkdate ASC"); + $stmt->execute(); + + // get plugin-id + $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins WHERE pluginclassname = 'CoreForum'")->fetchColumn(); + + // first, fetch all seminar_ids (When used inline at foreach, this does not work, must be a strange php-bug) + $seminar_ids = $stmt->fetchAll(PDO::FETCH_COLUMN); + + // then migrate the data for each seminar_id + foreach ($seminar_ids as $seminar_id) { + // prepare seminar for new forum + self::checkRootEntry($seminar_id); + + // migrate content form old forum to the new one + self::migrateEntries($seminar_id); + + // migrate visit-timestamps to the new forum + self::migrateUserVisits($seminar_id); + + // migrate the connections with issues + self::migrateIssues($seminar_id); + + self::activatePlugin($seminar_id, $plugin_id); + } + } + + static function activatePlugin($seminar_id, $plugin_id) { + $stmt = DBManager::get()->prepare("INSERT IGNORE INTO plugins_activated + (`pluginid`, `poiid`, `state`) VALUES (?, ?, 'on')"); + $stmt->execute([$plugin_id, 'sem' . $seminar_id]); + } + + static function migrateIssues($seminar_id) + { + $stmt = DBManager::get()->prepare("SELECT p.topic_id FROM themen_termine t + LEFT JOIN px_topics p ON (p.topic_id = t.issue_id) + WHERE p.topic_id IS NOT NULL + AND p.Seminar_id = ?"); + $stmt->execute([$seminar_id]); + + $stmt_insert = DBManager::get()->prepare("INSERT IGNORE INTO forum_entries_issues + (topic_id, issue_id) + VALUES (?, ?)"); + + while ($topic_id = $stmt->fetchColumn()) { + $stmt_insert->execute([$topic_id, $topic_id]); + } + } + + static function migrateUserVisits($seminar_id) + { + $stmt = DBManager::get()->prepare("SELECT * FROM object_user_visits + WHERE object_id = ? AND type = 'forum'"); + $stmt->execute([$seminar_id]); + + // do not overwrite any existing visit-timestamps, they are more + // accuarate than the one from object_user_visits + $stmt_insert = DBManager::get()->prepare("INSERT IGNORE INTO forum_visits + (user_id, seminar_id, visitdate, last_visitdate) + VALUES (?, ?, ?, ?)"); + + while ($data = $stmt->fetch()) { + $stmt_insert->execute([$data['user_id'], $data['object_id'], + $data['visitdate'], $data['last_visitdate']]); + } + } + + static function getList($seminar_id, $get_childs = true) + { + $ret = []; + + $stmt = DBManager::get()->prepare("SELECT * FROM px_topics + WHERE Seminar_id = ? AND topic_id = root_id + ORDER BY mkdate ASC"); + $stmt->execute([$seminar_id, $parent_id]); + + while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) { + // set depth-level + $data['level'] = 0; + $ret[] = $data; + + if ($get_childs) { + // get childs + $childs = self::getChilds($seminar_id, $data['topic_id']); + + if (!empty($childs)) { + $ret = array_merge($ret, $childs); + } + } + } + + return $ret; + } + + static function getEntries($seminar_id, $parent_id) + { + $stmt = DBManager::get()->prepare("SELECT * FROM px_topics + WHERE Seminar_id = ? AND parent_id = ? + ORDER BY mkdate ASC"); + $stmt->execute([$seminar_id, $parent_id]); + + return $stmt->fetchAll(); + } + + static function getChilds($seminar_id, $parent_id, $level = 1) + { + $ret = []; + + $stmt = DBManager::get()->prepare("SELECT * FROM px_topics + WHERE Seminar_id = ? AND parent_id = ? + ORDER BY mkdate ASC"); + $stmt->execute([$seminar_id, $parent_id]); + $entries = $stmt->fetchAll(PDO::FETCH_ASSOC); + + foreach ($entries as $data) { + // use a queue to prevent max-nesting problems + $queue = []; + $queue[] = $data; + $ret[] = $data; + + while (!empty($queue)) { + // get first element of queue + $checkfor = array_shift($queue); + + // get childs (if any) + $stmt->execute([$seminar_id, $checkfor['topic_id']]); + $childs = $stmt->fetchAll(); + + if (!empty($childs)) { + $ret = array_merge($ret, $childs); + $queue = array_merge($queue, $childs); // append childs to queue to check them for childs as well + } + } + } + + // sort the entries by mkdate + usort($ret, function($a, $b) { + if ($a['mkdate'] == $b['mkdate']) return 0; + return ($a['mkdate'] < $b['mkdate']) ? -1 : 1; + }); + + return $ret; + } + + static function migrateEntries($seminar_id) + { + foreach (self::getList($seminar_id, false) as $element) { + self::insert([ + 'topic_id' => $element['topic_id'], + 'seminar_id' => $seminar_id, + 'user_id' => $element['user_id'], + 'name' => $element['name'], + 'content' => $element['description'], + 'author' => $element['author'], + 'author_host' => $element['author_host'], + 'mkdate' => $element['mkdate'], + 'chdate' => $element['chdate'] + ], $seminar_id); + + //echo $element['name'] . '
'; + + foreach (self::getEntries($seminar_id, $element['topic_id']) as $child1) { + self::insert([ + 'topic_id' => $child1['topic_id'], + 'seminar_id' => $seminar_id, + 'user_id' => $child1['user_id'], + 'name' => $child1['name'], + 'content' => $child1['description'], + 'author' => $child1['author'], + 'author_host' => $child1['author_host'], + 'mkdate' => $child1['mkdate'], + 'chdate' => $child1['chdate'] + ], $element['topic_id']); + + //echo '• ' . $child1['name'] . '
'; + foreach(self::getChilds($seminar_id, $child1['topic_id']) as $child2) { + self::insert([ + 'topic_id' => $child2['topic_id'], + 'seminar_id' => $seminar_id, + 'user_id' => $child2['user_id'], + 'name' => $child2['name'], + 'content' => $child2['description'], + 'author' => $child2['author'], + 'author_host' => $child2['author_host'], + 'mkdate' => $child2['mkdate'], + 'chdate' => $child2['chdate'] + ], $child1['topic_id']); + + //echo '• •' . $child2['name'] . '
'; + } + } + } + } + + + static function flattenList($list) + { + $new_list = []; + $zw = []; + + foreach ($list as $element) { + if ($element['level'] == 0) { + if (!empty($zw)) { + $new_list[] = $zw; + $zw = []; + } + + $zw = $element; + } else { + $zw['childs'][] = $element; + } + } + + if (!empty($zw)) { + $new_list[] = $zw; + } + + return $new_list; + } + + static function insert($data, $parent_id) { + $constraint = self::getConstraints($parent_id); + + DBManager::get()->exec('UPDATE forum_entries SET lft = lft + 2 + WHERE lft > '. $constraint['rgt'] ." AND seminar_id = '". $constraint['seminar_id'] ."'"); + DBManager::get()->exec('UPDATE forum_entries SET rgt = rgt + 2 + WHERE rgt >= '. $constraint['rgt'] ." AND seminar_id = '". $constraint['seminar_id'] ."'"); + + $stmt = DBManager::get()->prepare("INSERT IGNORE INTO forum_entries + (topic_id, seminar_id, user_id, name, content, mkdate, chdate, author, + author_host, lft, rgt, depth, anonymous) + VALUES (? ,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$data['topic_id'], $data['seminar_id'], $data['user_id'], + $data['name'], $data['content'], $data['mkdate'], $data['chdate'], $data['author'], $data['author_host'] ?: '', + $constraint['rgt'], $constraint['rgt'] + 1, $constraint['depth'] + 1, 0]); + } + + static function getConstraints($topic_id) + { + // look up the range of postings + $range_stmt = DBManager::get()->prepare("SELECT * + FROM forum_entries WHERE topic_id = ?"); + $range_stmt->execute([$topic_id]); + if (!$data = $range_stmt->fetch(PDO::FETCH_ASSOC)) { + return false; + } + + if ($data['depth'] == 1) { + $data['area'] = 1; + } + + return $data; + } + + static function checkRootEntry($seminar_id) { + // check, if the root entry in the topic tree exists + $stmt = DBManager::get()->prepare("SELECT COUNT(*) FROM forum_entries + WHERE topic_id = ?"); + $stmt->execute([$seminar_id]); + if ($stmt->fetchColumn() == 0) { + $stmt = DBManager::get()->prepare("INSERT INTO forum_entries + (topic_id, seminar_id, name, mkdate, chdate, lft, rgt, depth) + VALUES (?, ?, 'Übersicht', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 1, 0)"); + $stmt->execute([$seminar_id, $seminar_id]); + } + + // make sure, that the category "Allgemein" exists + $stmt = DBManager::get()->prepare("REPLACE INTO forum_categories + (category_id, seminar_id, entry_name) VALUES (?, ?, 'Allgemein')"); + $stmt->execute([$seminar_id, $seminar_id]); + } + + function down() + { + // empty + } + +} diff --git a/db/migrations/1.107_step00247_forum_performance.php b/db/migrations/1.107_step00247_forum_performance.php new file mode 100644 index 0000000..99d5031 --- /dev/null +++ b/db/migrations/1.107_step00247_forum_performance.php @@ -0,0 +1,37 @@ +exec("ALTER TABLE forum_entries ADD latest_chdate INT(11) AFTER mkdate"); + + $db = DBManager::get()->query("SELECT * FROM forum_entries"); + $stmt = DBManager::get()->prepare("SELECT chdate FROM forum_entries + WHERE lft > ? AND rgt < ? AND seminar_id = ? + ORDER BY chdate DESC LIMIT 1"); + $stmt_update = DBManager::get()->prepare("UPDATE forum_entries + SET latest_chdate = ? WHERE topic_id = ?"); + + while ($data = $db->fetch(PDO::FETCH_ASSOC)) { + $stmt->execute([$data['lft'], $data['rgt'], $data['seminar_id']]); + $chdate = $stmt->fetchColumn(); + + if ($chdate) { + $stmt_update->execute([$chdate, $data['topic_id']]); + } else { + $stmt_update->execute([$data['chdate'], $data['topic_id']]); + } + } + } + + function down() + { + DBManager::get()->exec("ALTER TABLE forum_entries DROP latest_chdate"); + } +} diff --git a/db/migrations/1.108_visibilityapi.php b/db/migrations/1.108_visibilityapi.php new file mode 100644 index 0000000..712a3b4 --- /dev/null +++ b/db/migrations/1.108_visibilityapi.php @@ -0,0 +1,56 @@ +prepare($sql); + $stmt->execute(); + + $result = $db->query("SELECT value FROM config WHERE field = 'HOMEPAGE_VISIBILITY_DEFAULT' ORDER BY is_default LIMIT 1"); + $default_visibility = constant($result->fetchColumn()); + + $sql = "SELECT `user_id` FROM `auth_user_md5`"; + $stmt = $db->prepare($sql); + $stmt->execute(); + while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) { + $user = User::find($result['user_id']); + Visibility::createDefaultCategories($user->user_id); + + //copy all homepage visibility + $elements = $user->getHomepageElements(); + if (is_array($elements)) { + foreach ($elements as $key => $state) { + if ($state['visibility'] != $default_visibility) { + Visibility::addPrivacySetting($state['name'], $key, $state['identifier'], 1, $about->auth_user['user_id'], $state['visibility']); + } + } + } + } + } + + function down() { + + } + +} + +?> diff --git a/db/migrations/1.109_init_custom_blubber_streams.php b/db/migrations/1.109_init_custom_blubber_streams.php new file mode 100644 index 0000000..c1f06f7 --- /dev/null +++ b/db/migrations/1.109_init_custom_blubber_streams.php @@ -0,0 +1,80 @@ +exec(" + CREATE TABLE IF NOT EXISTS `blubber_tags` ( + `topic_id` varchar(32) NOT NULL, + `tag` varchar(128) NOT NULL, + PRIMARY KEY `unique_tags` (`topic_id`,`tag`), + KEY `tag` (`tag`) + ) ENGINE=MyISAM + "); + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `blubber_streams` ( + `stream_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `name` varchar(32) NOT NULL, + `sort` enum('activity','age') NOT NULL DEFAULT 'age', + `defaultstream` tinyint(2) NOT NULL DEFAULT '0', + `pool_courses` text, + `pool_groups` text, + `pool_hashtags` text, + `filter_type` text, + `filter_courses` text, + `filter_groups` text, + `filter_users` text, + `filter_hashtags` text, + `filter_nohashtags` text, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`stream_id`), + KEY `user_id` (`user_id`) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec("ALTER TABLE `blubber` DROP INDEX `root_id` , + ADD INDEX `root_id` ( `root_id` , `mkdate` )"); + + DBManager::get()->exec("ALTER TABLE `blubber` DROP INDEX `Seminar_id` , + ADD INDEX `Seminar_id` ( `Seminar_id` , `context_type` )"); + + //noch Hashtags/Tags in eigene Tabelle packen: + $statement = DBManager::get()->prepare( + "SELECT blubber.* " . + "FROM blubber " . + "WHERE LOCATE('#', blubber.description) > 0 " . + ""); + $statement->execute(); + $hashtag_regexp = "(?:^|\s)#([\w\d_\.\-\?!\+=%]*[\w\d])"; + $insert_statement = DBManager::get()->prepare( + "INSERT IGNORE INTO blubber_tags " . + "SET topic_id = :topic_id, " . + "tag = :tag " . + ""); + + while($blubber = $statement->fetch(PDO::FETCH_ASSOC)) { + preg_match_all("/".$hashtag_regexp."/", $blubber['description'], $matches); + foreach ($matches as $match) { + $match = trim($match[0]); + $tag = $match[0] === "#" ? substr($match, 1) : $match; + if ($tag) { + $insert_statement->execute([ + 'topic_id' => $blubber['root_id'], + 'tag' => strtolower($tag) + ]); + } + } + } + } + + function down() { + + } + +} diff --git a/db/migrations/1.10_image_proxy.php b/db/migrations/1.10_image_proxy.php new file mode 100644 index 0000000..102460e --- /dev/null +++ b/db/migrations/1.10_image_proxy.php @@ -0,0 +1,35 @@ +announce(" creating table `image_proxy_cache`..."); + + DBManager::get()->exec( "CREATE TABLE `image_proxy_cache` ( + `id` char(32) NOT NULL, + `type` char(10) NOT NULL, + `length` int(10) unsigned NOT NULL, + `error` char(15) NOT NULL, + `chdate` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `chdate` (`chdate`,`id`) + ) ENGINE=MyISAM;"); + $this->announce(" config entry EXTERNAL_IMAGE_EMBEDDING ..."); + DBManager::get()->exec("INSERT IGNORE INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES + ('0c81083086adc66714864b1abcff650a', '', 'EXTERNAL_IMAGE_EMBEDDING', 'deny', 1, 'string', 'global', '', 0, 0, 0, 'Sollen externe Bilder über [img] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', '', ''); + "); + $this->announce("done."); + } + + public function down () + { + $this->announce(" removing table `admission_group`..."); + DBManager::get()->exec("DROP TABLE IF EXISTS `image_proxy_cache` "); + $this->announce("done."); + } +} diff --git a/db/migrations/1.110_scm_add_position.php b/db/migrations/1.110_scm_add_position.php new file mode 100644 index 0000000..53847d4 --- /dev/null +++ b/db/migrations/1.110_scm_add_position.php @@ -0,0 +1,46 @@ +exec($query); + + $query = "UPDATE scm + SET position = :position + WHERE range_id = :range_id AND scm_id = :scm_id"; + $update_statement = DBManager::get()->prepare($query); + + $query = "SELECT range_id, scm_id FROM scm ORDER BY range_id ASC, mkdate ASC"; + $statement = DBManager::get()->query($query); + + $last_range = null; + foreach ($statement as $row) { + if ($row['range_id'] != $last_range) { + $position = 0; + $last_range = $row['range_id']; + } else { + $position += 1; + } + + $update_statement->bindValue(':position', $position, PDO::PARAM_INT); + $update_statement->bindValue(':range_id', $row['range_id']); + $update_statement->bindValue(':scm_id', $row['scm_id']); + $update_statement->execute(); + } + } + + public function down() + { + $query = "ALTER TABLE `scm` + DROP COLUMN `position`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.111_step_3574_domain.php b/db/migrations/1.111_step_3574_domain.php new file mode 100644 index 0000000..738bca7 --- /dev/null +++ b/db/migrations/1.111_step_3574_domain.php @@ -0,0 +1,25 @@ +exec($query); + $query = "ALTER TABLE `auto_insert_sem` DROP PRIMARY KEY , + ADD PRIMARY KEY ( `seminar_id` , `status` , `domain_id` )"; + DBManager::get()->exec($query); + $query = "INSERT IGNORE INTO `auto_insert_sem` + SELECT `seminar_id`, `status` , `userdomain_id` FROM `auto_insert_sem` JOIN `userdomains`"; + DBManager::get()->exec($query); + } + + function down() { + $query = "ALTER TABLE `auto_insert_sem` DROP `domain_id`"; + DBManager::get()->exec($query); + } + +} \ No newline at end of file diff --git a/db/migrations/1.113_init_mailqueue.php b/db/migrations/1.113_init_mailqueue.php new file mode 100644 index 0000000..10708fa --- /dev/null +++ b/db/migrations/1.113_init_mailqueue.php @@ -0,0 +1,89 @@ +prepare($query); + $statement->execute(); + + // Add config entries + $query = "INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description`) + VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'global', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + $statement = DBManager::get()->prepare($query); + + $statement->execute([ + ':field' => 'MAILQUEUE_ENABLE', + ':value' => "0", + ':type' => 'boolean', + ':description' => 'Aktiviert bzw. deaktiviert die Mailqueue', + ]); + + // Add default cron tasks and schedules + $new_job = [ + 'filename' => 'lib/cronjobs/send_mail_queue.class.php', + 'class' => 'SendMailQueueJob', + 'priority' => 'normal' + ]; + + $query = "INSERT IGNORE INTO `cronjobs_tasks` + (`task_id`, `filename`, `class`, `active`) + VALUES (:task_id, :filename, :class, 1)"; + $task_statement = DBManager::get()->prepare($query); + + $query = "INSERT IGNORE INTO `cronjobs_schedules` + (`schedule_id`, `task_id`, `parameters`, `priority`, + `type`, `minute`, `hour`, `mkdate`, `chdate`, + `last_result`) + VALUES (:schedule_id, :task_id, '[]', :priority, 'periodic', + :minute, :hour, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + NULL)"; + $schedule_statement = DBManager::get()->prepare($query); + + + $task_id = md5(uniqid('task', true)); + + $task_statement->execute([ + ':task_id' => $task_id, + ':filename' => $new_job['filename'], + ':class' => $new_job['class'], + ]); + + $schedule_id = md5(uniqid('schedule', true)); + $schedule_statement->execute([ + ':schedule_id' => $schedule_id, + ':task_id' => $task_id, + ':priority' => $new_job['priority'], + ':hour' => $new_job['hour'], + ':minute' => $new_job['minute'], + ]); + } + + function down() + { + DBManager::get()->query("DROP TABLE IF EXISTS `cronjobs_tasks`, `cronjobs_schedules`, `cronjobs_logs`"); + + DBManager::get()->query("DELETE FROM config WHERE field IN ('CRONJOB_ENABLE', 'CRONJOBS_ESCALATION')"); + } +} diff --git a/db/migrations/1.114_create_table_blubber_reshares.php b/db/migrations/1.114_create_table_blubber_reshares.php new file mode 100644 index 0000000..0a0f5ae --- /dev/null +++ b/db/migrations/1.114_create_table_blubber_reshares.php @@ -0,0 +1,28 @@ +prepare($query); + $statement->execute(); + } + + function down() + { + } +} diff --git a/db/migrations/1.115_performance_tic_3759.php b/db/migrations/1.115_performance_tic_3759.php new file mode 100644 index 0000000..dd3cc02 --- /dev/null +++ b/db/migrations/1.115_performance_tic_3759.php @@ -0,0 +1,19 @@ +exec("ALTER TABLE `plugins_activated` CHANGE `poiid` `poiid` VARCHAR( 36 ) NOT NULL DEFAULT ''"); + DBManager::get()->exec("ALTER TABLE `plugins_activated` ADD UNIQUE ( `poiid` , `pluginid` , `state` )"); + DBManager::get()->exec("ALTER TABLE `deputies` ADD INDEX ( `user_id` , `range_id` , `edit_about` )"); + } + + function down() + { + } +} diff --git a/db/migrations/1.116_step_00263_inst_gendering.php b/db/migrations/1.116_step_00263_inst_gendering.php new file mode 100644 index 0000000..6f843f6 --- /dev/null +++ b/db/migrations/1.116_step_00263_inst_gendering.php @@ -0,0 +1,15 @@ +exec("ALTER TABLE statusgruppen + ADD (name_w varchar(255), + name_m varchar(255));"); + } +} diff --git a/db/migrations/1.117_forum_add_close.php b/db/migrations/1.117_forum_add_close.php new file mode 100644 index 0000000..dfc0ccd --- /dev/null +++ b/db/migrations/1.117_forum_add_close.php @@ -0,0 +1,21 @@ +exec("ALTER TABLE forum_entries + ADD `closed` TINYINT( 1 ) NOT NULL DEFAULT '0';"); + } + + function down() { + DBManager::get()->exec("ALTER TABLE `forum_entries` + DROP `closed`;"); + } + +} + +?> diff --git a/db/migrations/1.118_forum_sticky_posts.php b/db/migrations/1.118_forum_sticky_posts.php new file mode 100644 index 0000000..b54833d --- /dev/null +++ b/db/migrations/1.118_forum_sticky_posts.php @@ -0,0 +1,21 @@ +exec("ALTER TABLE forum_entries + ADD `sticky` INT(1) NOT NULL DEFAULT '0';"); + } + + function down() { + DBManager::get()->exec("ALTER TABLE `forum_entries` + DROP `sticky`;"); + } + +} + +?> diff --git a/db/migrations/1.119_init_termin_related_groups_table.php b/db/migrations/1.119_init_termin_related_groups_table.php new file mode 100644 index 0000000..3ac24b5 --- /dev/null +++ b/db/migrations/1.119_init_termin_related_groups_table.php @@ -0,0 +1,25 @@ +exec( + "CREATE TABLE IF NOT EXISTS `termin_related_groups` ( + `termin_id` VARCHAR(32) NOT NULL , + `statusgruppe_id` VARCHAR(45) NOT NULL , + UNIQUE KEY `unique` (`termin_id`,`statusgruppe_id`), + INDEX `termin_id` (`termin_id` ASC) , + INDEX `statusgruppe_id` (`statusgruppe_id` ASC) + ) ENGINE=MyISAM;"); + } + + function down() { + DBManager::get()->exec("DROP TABLE `termin_related_groups`;"); + } + +} + diff --git a/db/migrations/1.11_lock_rulez.php b/db/migrations/1.11_lock_rulez.php new file mode 100644 index 0000000..d16f34b --- /dev/null +++ b/db/migrations/1.11_lock_rulez.php @@ -0,0 +1,38 @@ +announce(" creating table..."); + + DBManager::get()->exec( " + CREATE TABLE `lock_rules` ( + `lock_id` varchar(32) NOT NULL default '', + `name` varchar(255) NOT NULL default '', + `description` text NOT NULL, + `attributes` text NOT NULL, + PRIMARY KEY (`lock_id`) + ) ENGINE=MyISAM"); + + DBManager::get()->exec("ALTER TABLE `seminare` ADD `lock_rule` VARCHAR( 32 ) NULL"); + + $this->announce("done."); + + } + + public function down () + { + $this->announce(" removing table..."); + DBManager::get()->exec("DROP TABLE `lock_rules`"); + DBManager::get()->exec("ALTER TABLE `seminare` DROP `lock_rule`"); + + $this->announce("done."); + + } +} diff --git a/db/migrations/1.120_create_open_graph_data_table.php b/db/migrations/1.120_create_open_graph_data_table.php new file mode 100644 index 0000000..3dce2c5 --- /dev/null +++ b/db/migrations/1.120_create_open_graph_data_table.php @@ -0,0 +1,48 @@ +exec(" + CREATE TABLE IF NOT EXISTS `opengraphdata` ( + `url` varchar(1000) NOT NULL, + `is_opengraph` tinyint(2) DEFAULT NULL, + `title` text, + `image` varchar(1024) DEFAULT NULL, + `description` text, + `type` varchar(64) DEFAULT NULL, + `data` text NOT NULL, + `last_update` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`url`) + ) ENGINE=MyISAM + "); + $options[] = + [ + 'name' => 'OPENGRAPH_ENABLE', + 'type' => 'boolean', + 'value' => '1', + 'range' => 'global', + 'section' => 'global', + 'description' => 'De-/Aktiviert OpenGraph-Informationen und deren Abrufen.' + ]; + + $stmt = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + public function down() + { + DBManager::get()->exec("DROP TABLE TABLE IF EXISTS `opengraph`"); + DBManager::get()->exec("DELETE FROM config WHERE field = 'OPENGRAPH_ENABLE'"); + } +} \ No newline at end of file diff --git a/db/migrations/1.121_step_00266_forced_lock_rules.php b/db/migrations/1.121_step_00266_forced_lock_rules.php new file mode 100644 index 0000000..750e65d --- /dev/null +++ b/db/migrations/1.121_step_00266_forced_lock_rules.php @@ -0,0 +1,20 @@ +exec("ALTER TABLE `seminare` ADD `aux_lock_rule_forced` TINYINT NOT NULL DEFAULT '0' AFTER `aux_lock_rule`;"); + + } + + function down() { + DBManager::get()->exec("ALTER TABLE `seminare` DROP `aux_lock_rule_forced`;"); + } + +} + +?> diff --git a/db/migrations/1.122_add_seminar_id_to_folder.php b/db/migrations/1.122_add_seminar_id_to_folder.php new file mode 100644 index 0000000..88f50e4 --- /dev/null +++ b/db/migrations/1.122_add_seminar_id_to_folder.php @@ -0,0 +1,103 @@ +addSeminarIdField(); + $this->updateHeads(); + $this->updateTails(); + } + + function addSeminarIdField() + { + DBManager::get()->exec('ALTER TABLE `folder` ADD `seminar_id` VARCHAR(32) NOT NULL AFTER `range_id`'); + } + + function updateHeads() + { + $this->updateFirstLevelFolders(); + $this->updateSpecialFolders(); + } + + function updateTails() + { + do { + $updated = $this->updateSeminarIds("SELECT f1.folder_id, f2.seminar_id FROM `folder` f1 INNER JOIN folder f2 ON f1.range_id = f2.folder_id WHERE f1.seminar_id = ''"); + } while ($updated > 0); + } + + function updateFirstLevelFolders() + { + $this->updateSeminarIds("SELECT f.folder_id, s.Seminar_id AS seminar_id ". + "FROM `folder` f ". + "INNER JOIN `seminare` s ON s.Seminar_id = f.range_id"); + $this->updateSeminarIds("SELECT f.folder_id, s.Seminar_id AS seminar_id ". + "FROM `folder` f ". + "INNER JOIN `seminare` s ON MD5(CONCAT(s.Seminar_id, 'top_folder')) = f.range_id"); + + $this->updateSeminarIds("SELECT f.folder_id, i.Institut_id AS seminar_id ". + "FROM `folder` f ". + "INNER JOIN `Institute` i ON i.Institut_id = f.range_id"); + $this->updateSeminarIds("SELECT f.folder_id, i.Institut_id AS seminar_id ". + "FROM `folder` f ". + "INNER JOIN `Institute` i ON MD5(CONCAT(i.Institut_id, 'top_folder')) = f.range_id"); + } + + + function updateSpecialFolders() + { + $this->updateSeminarIds("SELECT f.folder_id, s.range_id AS seminar_id ". + "FROM `folder` f ". + "INNER JOIN `statusgruppen` s ON s.statusgruppe_id = f.range_id"); + + $this->updateSeminarIds("SELECT f.folder_id, t.seminar_id AS seminar_id ". + "FROM `folder` f ". + "INNER JOIN `themen` t ON t.issue_id = f.range_id"); + + $this->updateSeminarIds("SELECT f.folder_id, a.user_id AS seminar_id + FROM `folder` f + INNER JOIN `auth_user_md5` a ON a.user_id = f.range_id"); + } + + function updateSeminarIds($sql) + { + $db = DBManager::get(); + + $stmt = $db->prepare($sql); + $stmt->execute([]); + $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); + + $updated = 0; + $stmt = $db->prepare("UPDATE folder SET seminar_id = ? WHERE folder_id = ?"); + foreach ($rows as $row) { + $stmt->execute([$row['seminar_id'], $row['folder_id']]); + $updated += $stmt->rowCount(); + } + + return $updated; + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + + try { + $db->exec("ALTER TABLE `folder` DROP COLUMN `seminar_id`"); + } catch (Exception $e) { } + } +} diff --git a/db/migrations/1.123_tic_3993_remove_dont_delete.php b/db/migrations/1.123_tic_3993_remove_dont_delete.php new file mode 100644 index 0000000..3d7da57 --- /dev/null +++ b/db/migrations/1.123_tic_3993_remove_dont_delete.php @@ -0,0 +1,33 @@ +exec("ALTER TABLE `message` DROP COLUMN `dont_delete`"); + } catch (Exception $e) { } + } + + + /** + * revert this migration + */ + function down() + { + DBManager::get()->exec('ALTER TABLE `message` ADD `dont_delete` tinyint(1) NOT NULL DEFAULT \'0\' AFTER `snd_rec`'); + } +} diff --git a/db/migrations/1.124_step_00255_important_semnumber.php b/db/migrations/1.124_step_00255_important_semnumber.php new file mode 100644 index 0000000..c21030a --- /dev/null +++ b/db/migrations/1.124_step_00255_important_semnumber.php @@ -0,0 +1,34 @@ +create('IMPORTANT_SEMNUMBER', [ + 'value' => 0, + 'is_default' => 0, + 'type' => 'boolean', + 'range' => 'global', + 'section' => 'global', + 'description' => _('Zeigt die Veranstaltungsnummer prominenter in der Suche und auf der Meine Veranstaltungen Seite an') + ]); + } + + /** + * revert this migration + */ + function down() { + Config::get()->delete('IMPORTANT_SEMNUMBER'); + } + +} +?> \ No newline at end of file diff --git a/db/migrations/1.125_repair_statusgroup_user_numberation.php b/db/migrations/1.125_repair_statusgroup_user_numberation.php new file mode 100644 index 0000000..d88b5c4 --- /dev/null +++ b/db/migrations/1.125_repair_statusgroup_user_numberation.php @@ -0,0 +1,46 @@ +query('DELETE FROM statusgruppe_user WHERE statusgruppe_id = ""'); + + $sql = "SELECT DISTINCT statusgruppe_id FROM statusgruppe_user"; + $user_sql = "SELECT user_id, position FROM statusgruppe_user WHERE statusgruppe_id = ? ORDER BY position ASC"; + $update_sql = "UPDATE statusgruppe_user SET position = ? WHERE statusgruppe_id = ? AND user_id = ?"; + $userStmt = DBManager::get()->prepare($user_sql); + $result = DBManager::get()->query($sql); + $update = DBManager::get()->prepare($update_sql); + while ($group = $result->fetch(PDO::FETCH_COLUMN)) { + $userStmt->execute([$group]); + $realPosition = 0; + while ($user = $userStmt->fetch(PDO::FETCH_ASSOC)) { + if ($user['position'] != $realPosition++) { + $update->execute([$realPosition - 1, $group, $user['user_id']]); + } + } + } + } + + /** + * revert this migration + */ + function down() { + // we could randomly assign new position ids here to screw things up like + // it was before the migration + } + +} +?> \ No newline at end of file diff --git a/db/migrations/1.126_tic_4044_invisible_studygroups.php b/db/migrations/1.126_tic_4044_invisible_studygroups.php new file mode 100644 index 0000000..6f050cc --- /dev/null +++ b/db/migrations/1.126_tic_4044_invisible_studygroups.php @@ -0,0 +1,32 @@ +create('STUDYGROUPS_INVISIBLE_ALLOWED', [ + 'value' => 0, + 'is_default' => 0, + 'type' => 'boolean', + 'range' => 'global', + 'section' => 'studygroups', + 'description' => _('Ermöglicht unsichtbare Studiengruppen') + ]); + } + + /** + * revert this migration + */ + function down() { + Config::get()->delete('STUDYGROUPS_INVISIBLE_ALLOWED'); + } + +} \ No newline at end of file diff --git a/db/migrations/1.127_setup_api.php b/db/migrations/1.127_setup_api.php new file mode 100644 index 0000000..7cae3f9 --- /dev/null +++ b/db/migrations/1.127_setup_api.php @@ -0,0 +1,217 @@ +exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `oauth_consumer_token` ( + `oct_id` int(11) NOT NULL AUTO_INCREMENT, + `oct_ocr_id_ref` int(11) NOT NULL, + `oct_usa_id_ref` int(11) NOT NULL, + `oct_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `oct_token` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `oct_token_secret` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `oct_token_type` enum('request','authorized','access') DEFAULT NULL, + `oct_token_ttl` datetime NOT NULL DEFAULT '9999-12-31 00:00:00', + `oct_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`oct_id`), + UNIQUE KEY `oct_ocr_id_ref` (`oct_ocr_id_ref`,`oct_token`), + UNIQUE KEY `oct_usa_id_ref` (`oct_usa_id_ref`,`oct_ocr_id_ref`,`oct_token_type`,`oct_name`), + KEY `oct_token_ttl` (`oct_token_ttl`), + CONSTRAINT `oauth_consumer_token_ibfk_1` FOREIGN KEY (`oct_ocr_id_ref`) REFERENCES `oauth_consumer_registry` (`ocr_id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `oauth_log` ( + `olg_id` int(11) NOT NULL AUTO_INCREMENT, + `olg_osr_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `olg_ost_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `olg_ocr_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `olg_oct_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `olg_usa_id_ref` int(11) DEFAULT NULL, + `olg_received` text NOT NULL, + `olg_sent` text NOT NULL, + `olg_base_string` text NOT NULL, + `olg_notes` text NOT NULL, + `olg_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `olg_remote_ip` bigint(20) NOT NULL, + PRIMARY KEY (`olg_id`), + KEY `olg_osr_consumer_key` (`olg_osr_consumer_key`,`olg_id`), + KEY `olg_ost_token` (`olg_ost_token`,`olg_id`), + KEY `olg_ocr_consumer_key` (`olg_ocr_consumer_key`,`olg_id`), + KEY `olg_oct_token` (`olg_oct_token`,`olg_id`), + KEY `olg_usa_id_ref` (`olg_usa_id_ref`,`olg_id`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `oauth_server_nonce` ( + `osn_id` int(11) NOT NULL AUTO_INCREMENT, + `osn_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `osn_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `osn_timestamp` bigint(20) NOT NULL, + `osn_nonce` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`osn_id`), + UNIQUE KEY `osn_consumer_key` (`osn_consumer_key`,`osn_token`,`osn_timestamp`,`osn_nonce`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `oauth_server_registry` ( + `osr_id` int(11) NOT NULL AUTO_INCREMENT, + `osr_usa_id_ref` int(11) DEFAULT NULL, + `osr_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `osr_consumer_secret` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `osr_enabled` tinyint(1) NOT NULL DEFAULT '1', + `osr_status` varchar(16) NOT NULL, + `osr_requester_name` varchar(64) NOT NULL, + `osr_requester_email` varchar(64) NOT NULL, + `osr_callback_uri` varchar(255) NOT NULL, + `osr_application_uri` varchar(255) NOT NULL, + `osr_application_title` varchar(80) NOT NULL, + `osr_application_descr` text NOT NULL, + `osr_application_notes` text NOT NULL, + `osr_application_type` varchar(20) NOT NULL, + `osr_application_commercial` tinyint(1) NOT NULL DEFAULT '0', + `osr_issue_date` datetime NOT NULL, + `osr_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`osr_id`), + UNIQUE KEY `osr_consumer_key` (`osr_consumer_key`), + KEY `osr_usa_id_ref` (`osr_usa_id_ref`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `oauth_server_token` ( + `ost_id` int(11) NOT NULL AUTO_INCREMENT, + `ost_osr_id_ref` int(11) NOT NULL, + `ost_usa_id_ref` int(11) NOT NULL, + `ost_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `ost_token_secret` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `ost_token_type` enum('request','access') DEFAULT NULL, + `ost_authorized` tinyint(1) NOT NULL DEFAULT '0', + `ost_referrer_host` varchar(128) NOT NULL DEFAULT '', + `ost_token_ttl` datetime NOT NULL DEFAULT '9999-12-31 00:00:00', + `ost_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `ost_verifier` char(10) DEFAULT NULL, + `ost_callback_url` varchar(512) DEFAULT NULL, + PRIMARY KEY (`ost_id`), + UNIQUE KEY `ost_token` (`ost_token`), + KEY `ost_osr_id_ref` (`ost_osr_id_ref`), + KEY `ost_token_ttl` (`ost_token_ttl`), + CONSTRAINT `oauth_server_token_ibfk_1` FOREIGN KEY (`ost_osr_id_ref`) REFERENCES `oauth_server_registry` (`osr_id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; + DBManager::get()->exec($query); + + // Add api tables + $query = "CREATE TABLE IF NOT EXISTS `api_consumer_permissions` ( + `route_id` char(32) NOT NULL, + `consumer_id` char(32) NOT NULL DEFAULT '', + `method` char(6) NOT NULL, + `granted` tinyint(1) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `route_id` (`route_id`,`consumer_id`,`method`) + ) ENGINE=MyISAM"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `api_consumers` ( + `consumer_id` char(32) NOT NULL DEFAULT '', + `consumer_type` enum('http','studip','oauth') NOT NULL DEFAULT 'studip', + `auth_key` varchar(64) DEFAULT NULL, + `auth_secret` varchar(64) DEFAULT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `system` tinyint(1) unsigned NOT NULL DEFAULT '0', + `type` enum('website','mobile','desktop') DEFAULT 'website', + `title` varchar(128) DEFAULT NULL, + `contact` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `callback` varchar(255) DEFAULT NULL, + `commercial` tinyint(1) DEFAULT NULL, + `description` text, + `priority` int(11) unsigned NOT NULL DEFAULT '0', + `notes` text, + `mkdate` int(11) unsigned NOT NULL, + `chdate` int(11) unsigned NOT NULL, + PRIMARY KEY (`consumer_id`) + ) ENGINE=MyISAM"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `api_oauth_user_mapping` ( + `oauth_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `user_id` char(32) NOT NULL DEFAULT '', + `mkdate` int(11) unsigned NOT NULL, + PRIMARY KEY (`oauth_id`) + ) ENGINE=MyISAM"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `api_user_permissions` ( + `user_id` char(32) NOT NULL DEFAULT '', + `consumer_id` char(32) NOT NULL DEFAULT '', + `granted` tinyint(1) unsigned NOT NULL DEFAULT '0', + `mkdate` int(11) unsigned NOT NULL, + `chdate` int(11) unsigned NOT NULL, + PRIMARY KEY (`user_id`,`consumer_id`) + ) ENGINE=MyISAM"; + DBManager::get()->exec($query); + + // Add config entries + $query = "INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description`) + VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'global', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + $statement = DBManager::get()->prepare($query); + + $statement->execute([ + ':field' => 'API_ENABLED', + ':value' => (int)false, + ':type' => 'boolean', + ':description' => 'Schaltet die REST-API an', + ]); + + $statement->execute([ + ':field' => 'API_OAUTH_AUTH_PLUGIN', + ':value' => 'Standard', + ':type' => 'string', + ':description' => 'Definiert das für OAuth verwendete Authentifizierungsverfahren', + ]); + } + + function down() + { + DBManager::get()->exec("DELETE FROM config WHERE field IN ('API_ENABLED', 'API_OAUTH_AUTH_PLUGIN')"); + DBManager::get()->exec("DROP TABLE IF EXISTS `oauth_consumer_registry`, + `oauth_consumer_token`, + `oauth_log`, + `oauth_server_nonce`, + `oauth_server_registry`, + `oauth_server_token` + `api_consumer_permissions`, + `api_consumers`, + `api_oauth_user_mapping`, + `api_user_permissions`"); + } +} diff --git a/db/migrations/1.128_step00240_coursesets.php b/db/migrations/1.128_step00240_coursesets.php new file mode 100644 index 0000000..b767ae3 --- /dev/null +++ b/db/migrations/1.128_step00240_coursesets.php @@ -0,0 +1,500 @@ +exec("CREATE TABLE IF NOT EXISTS `admission_condition` ( + `rule_id` VARCHAR(32) NOT NULL , + `filter_id` VARCHAR(32) NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`, `filter_id`) ) + ENGINE = MyISAM"); + + // "chance adjustment" in seat distribution + $db->exec("CREATE TABLE IF NOT EXISTS `admissionfactor` ( + `list_id` VARCHAR(32) NOT NULL , + `name` VARCHAR(255) NOT NULL , + `factor` DECIMAL(5,2) NOT NULL DEFAULT 1, + `owner_id` VARCHAR(32) NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`list_id`) ) + ENGINE = MyISAM"); + + // available admission rules. + $db->exec("CREATE TABLE IF NOT EXISTS `admissionrules` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ruletype` VARCHAR(255) UNIQUE NOT NULL, + `active` TINYINT(1) NOT NULL DEFAULT 0, + `mkdate` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) + ) ENGINE = MyISAM"); + // Create entries for default admission rule types. + $db->exec("INSERT IGNORE INTO `admissionrules` + (`ruletype`, `active`, `mkdate`) VALUES + ('ConditionalAdmission', 1, UNIX_TIMESTAMP()), + ('LimitedAdmission', 1, UNIX_TIMESTAMP()), + ('LockedAdmission', 1, UNIX_TIMESTAMP()), + ('PasswordAdmission', 1, UNIX_TIMESTAMP()), + ('TimedAdmission', 1, UNIX_TIMESTAMP()), + ('ParticipantRestrictedAdmission', 1, UNIX_TIMESTAMP());"); + + // Admission rules can be available globally or only at selected institutes. + $db->exec("CREATE TABLE IF NOT EXISTS `admissionrule_inst` ( + `rule_id` VARCHAR(32) NOT NULL, + `institute_id` VARCHAR(32) NOT NULL, + `mkdate` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`, `institute_id`) + ) ENGINE = MyISAM"); + + // admission rules specifying conditions for access + $db->exec("CREATE TABLE IF NOT EXISTS `conditionaladmissions` ( + `rule_id` VARCHAR(32) NOT NULL , + `message` TEXT NULL , + `start_time` INT NOT NULL DEFAULT 0, + `end_time` INT NOT NULL DEFAULT 0, + `mkdate` INT NOT NULL DEFAULT 0, + `conditions_stopped` TINYINT(1) NOT NULL DEFAULT 0 , + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) ) + ENGINE = MyISAM"); + + // assign course sets to factor lists + $db->exec("CREATE TABLE IF NOT EXISTS `courseset_factorlist` ( + `set_id` VARCHAR(32) NOT NULL , + `factorlist_id` VARCHAR(32) NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0 , + PRIMARY KEY (`set_id`, `factorlist_id`) ) + ENGINE = MyISAM"); + + // assign course sets to institutes + $db->exec("CREATE TABLE IF NOT EXISTS `courseset_institute` ( + `set_id` VARCHAR(32) NOT NULL , + `institute_id` VARCHAR(32) NOT NULL , + `mkdate` INT NULL , + `chdate` INT NULL , + PRIMARY KEY (`set_id`, `institute_id`), + INDEX `institute_id` (`institute_id`,`set_id`)) + ENGINE = MyISAM"); + + // assign admission rules to course sets + $db->exec("CREATE TABLE IF NOT EXISTS `courseset_rule` ( + `set_id` VARCHAR(32) NOT NULL , + `rule_id` VARCHAR(32) NOT NULL , + `type` VARCHAR(255) NULL , + `mkdate` INT NULL , + PRIMARY KEY (`set_id`, `rule_id`), + INDEX `type` (`type`,`set_id`)) + ENGINE = MyISAM"); + + // sets of courses with common admission rules + $db->exec("CREATE TABLE IF NOT EXISTS `coursesets` ( + `set_id` VARCHAR(32) NOT NULL , + `user_id` VARCHAR(32) NOT NULL , + `name` VARCHAR(255) NOT NULL , + `infotext` TEXT NOT NULL , + `algorithm` VARCHAR(255) NOT NULL , + `algorithm_run` TINYINT(1) NOT NULL DEFAULT 0 , + `private` TINYINT(1) NOT NULL DEFAULT 0, + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`set_id`) , + INDEX `set_user` (`user_id`, `set_id`) ) + ENGINE = MyISAM"); + + // admission rules with max number of courses to register for + $db->exec("CREATE TABLE IF NOT EXISTS `limitedadmissions` ( + `rule_id` VARCHAR(32) NOT NULL , + `message` TEXT NOT NULL , + `start_time` INT NOT NULL DEFAULT 0, + `end_time` INT NOT NULL DEFAULT 0, + `maxnumber` INT NOT NULL DEFAULT 0, + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) ) + ENGINE = MyISAM"); + + // admission rules that completely lock access to courses + $db->exec("CREATE TABLE IF NOT EXISTS `lockedadmissions` ( + `rule_id` VARCHAR(32) NOT NULL , + `message` TEXT NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) ) + ENGINE = MyISAM"); + + // admission rules that specify a password for course access + $db->exec("CREATE TABLE IF NOT EXISTS `passwordadmissions` ( + `rule_id` VARCHAR(32) NOT NULL , + `message` TEXT NULL , + `start_time` INT NOT NULL DEFAULT 0, + `end_time` INT NOT NULL DEFAULT 0, + `password` VARCHAR(255) NULL , + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) ) + ENGINE = MyISAM"); + + // priorities for course assignment + $db->exec("CREATE TABLE IF NOT EXISTS `priorities` ( + `user_id` VARCHAR(32) NOT NULL , + `set_id` VARCHAR(32) NOT NULL , + `seminar_id` VARCHAR(32) NOT NULL , + `priority` INT NOT NULL DEFAULT 0, + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`user_id`, `set_id`, `seminar_id`) , + INDEX `user_rule_priority` (`user_id` ASC, `priority` ASC, `set_id` ASC) ) + ENGINE = MyISAM"); + + // assign courses to course sets + $db->exec("CREATE TABLE IF NOT EXISTS `seminar_courseset` ( + `set_id` VARCHAR(32) NOT NULL , + `seminar_id` VARCHAR(32) NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0 , + PRIMARY KEY (`set_id`, `seminar_id`), + INDEX `seminar_id` (`seminar_id`, `set_id` ) ) + ENGINE = MyISAM"); + + // admission rules concerning time + $db->exec("CREATE TABLE IF NOT EXISTS `timedadmissions` ( + `rule_id` VARCHAR(32) NOT NULL , + `message` TEXT NOT NULL , + `start_time` INT NOT NULL DEFAULT 0, + `end_time` INT NOT NULL DEFAULT 0, + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) , + INDEX `start_time` (`start_time` ASC) , + INDEX `end_time` (`end_time` ASC) , + INDEX `start_end` (`start_time` ASC, `end_time` ASC) ) + ENGINE = MyISAM"); + + $db->exec("CREATE TABLE IF NOT EXISTS `participantrestrictedadmissions` ( + `rule_id` varchar(32), + `message` text NOT NULL, + `distribution_time` int(11) NOT NULL DEFAULT 0, + `mkdate` int(11) NOT NULL DEFAULT 0, + `chdate` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) + ) ENGINE=MyISAM"); + + // assign users to lists with different factor in seat distribution + $db->exec("CREATE TABLE IF NOT EXISTS `user_factorlist` ( + `list_id` VARCHAR(32) NULL , + `user_id` VARCHAR(32) NULL , + `mkdate` INT NULL , + PRIMARY KEY (`list_id`, `user_id`) ) + ENGINE = MyISAM"); + + // filters for users + $db->exec("CREATE TABLE IF NOT EXISTS `userfilter` ( + `filter_id` VARCHAR(32) NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`filter_id`) ) + ENGINE = MyISAM"); + + // several fields form a user filter + $db->exec("CREATE TABLE IF NOT EXISTS `userfilter_fields` ( + `field_id` VARCHAR(32) NOT NULL , + `filter_id` VARCHAR(32) NOT NULL , + `type` VARCHAR(255) NOT NULL , + `value` VARCHAR(255) NOT NULL , + `compare_op` VARCHAR(255) NOT NULL , + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`field_id`) ) + ENGINE = MyISAM"); + + // user defined max number of courses to register for + $db->exec("CREATE TABLE IF NOT EXISTS `userlimits` ( + `rule_id` VARCHAR(32) NOT NULL , + `user_id` VARCHAR(32) NOT NULL , + `maxnumber` INT NULL , + `mkdate` INT NULL , + `chdate` INT NULL , + PRIMARY KEY (`rule_id`, `user_id`) ) + ENGINE = MyISAM"); + + $cs_insert = $db->prepare("INSERT INTO coursesets (set_id,user_id,name,infotext,algorithm,private,mkdate,chdate) + VALUES (?,?,?,?,'',?,?,?)"); + $cs_i_insert = $db->prepare("INSERT INTO courseset_institute (set_id,institute_id,mkdate,chdate) VALUES (?,?,UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); + $cs_r_insert = $db->prepare("INSERT INTO courseset_rule (set_id,rule_id,type,mkdate) VALUES (?,?,?,UNIX_TIMESTAMP())"); + $s_cs_insert = $db->prepare("INSERT INTO seminar_courseset (set_id,seminar_id,mkdate) VALUES (?,?,UNIX_TIMESTAMP())"); + $password_insert = $db->prepare("INSERT INTO passwordadmissions (rule_id,message,password,mkdate,chdate) VALUES (?,'Das Passwort ist falsch',?,UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); + $locked_insert = $db->prepare("INSERT INTO lockedadmissions (rule_id,message,mkdate,chdate) VALUES (?,'Die Anmeldung ist gesperrt',UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); + $hasher = new PasswordHash(8, false); + $user_id = $GLOBALS['user']->id; + + //mit pw wandeln + $pw_admission = $db->fetchAll("SELECT seminar_id, name, passwort, institut_id, chdate FROM seminare WHERE admission_type = 0 AND Lesezugriff = 2"); + foreach ($pw_admission as $course) { + $new_pwd = $hasher->HashPassword($course['passwort']); + $rule_id = md5(uniqid('passwordadmissions',1)); + $password_insert->execute([$rule_id, $new_pwd]); + $set_id = md5(uniqid('coursesets',1)); + $name = 'Anmeldung mit Passwort: ' . $course['name']; + $info = 'Erzeugt durch Migration 128 ' . strftime('%X %x'); + $cs_insert->execute([$set_id,$user_id,$name,$info,1,$course['chdate'],$course['chdate']]); + $cs_r_insert->execute([$set_id, $rule_id, 'PasswordAdmission']); + $s_cs_insert->execute([$set_id, $course['seminar_id']]); + } + //ein globales set für alle gesperrten + $locked_set_id = md5(uniqid('coursesets',1)); + $name = 'Anmeldung gesperrt (global)'; + $info = ''; + $cs_insert->execute([$locked_set_id,'',$name,$info,1,time(),time()]); + $locked_rule_id = md5(uniqid('lockedadmissions',1)); + $locked_insert->execute([$locked_rule_id]); + $cs_r_insert->execute([$locked_set_id,$locked_rule_id,'LockedAdmission']); + + //locked wandeln + $locked_admission = $db->fetchAll("SELECT seminar_id, name, institut_id FROM seminare WHERE admission_type = 3"); + foreach ($locked_admission as $course) { + $s_cs_insert->execute([$locked_set_id, $course['seminar_id']]); + } + + // Lade Daten des aktuellen Semesters. + $semester = Semester::findCurrent(); + $now = time(); + $preserve_waitlists = []; + + //gruppierte wandeln + $grouped_admission = $db->fetchAll("SELECT seminar_id, seminare.name, start_time, duration_time, institut_id, admission_type, admission_starttime, + admission_endtime, admission_endtime_sem, admission_group.name as a_name, admission_group, admission_group.chdate + FROM seminare INNER JOIN admission_group ON group_id = admission_group + WHERE admission_type IN (1, 2) ORDER BY admission_group, admission_starttime, VeranstaltungsNummer"); + foreach ($grouped_admission as $course) { + if ($group_id != $course['admission_group']) { + $group_id = $course['admission_group']; + $group_type = $course['admission_type']; + $group_inst = [$course['institut_id']]; + $group_name = $course['a_name'] ?: ++$g; + + /* + * Check, ob Anmeldeverfahren in der Vergangenheit schon + * abgeschlossen wurde. Hier extra ausführlich, damit es + * verständlich bleibt. + */ + // Veranstaltungen, die (auch implizit) im aktuellen oder kommenden Semestern liegen. + if (($course['start_time'] + $course['duration_time'] >= $semester->beginn || $course['duration_time'] == -1) && + // Checke, ob Warteliste aktiviert, Anmeldezeitraum oder Loszeitpunkt in der Zukunft oder Anmeldezeitraum komplett offen. + ($course['admission_disable_waitlist'] == 0 || $course['admission_starttime'] > $now || $course['admission_endtime'] > $now || + $course['admission_endtime_sem'] > $now || $course['admission_endtime_sem'] == -1)) { + // Erzeuge ein Anmeldeset mit den vorhandenen Einstellungen der Veranstaltung. + $cs = $this->buildCourseset($course, true); + $cs->setName('Beschränkte Teilnehmeranzahl: Gruppe ' . $group_name) + ->setInfoText('Erzeugt durch Migration 128 ' . strftime('%X %x')) + ->addInstitute($course['institut_id'])->setPrivate(true)->setUserId($user_id)->store(); + $set_id = $cs->getId(); + // Losen oder Anmeldezeitraum vorbei => sperren. + // Veranstaltungen in vergangenen Semestern werden einfach gesperrt. + } else { + $group_type = 3; + $rule_id = md5(uniqid('lockedadmissions',1)); + $locked_insert->execute([$rule_id]); + $set_id = md5(uniqid('coursesets',1)); + $name = 'Anmeldung gesperrt: Gruppe ' . $group_name; + $info = 'Erzeugt durch Migration 128 ' . strftime('%X %x'); + $cs_insert->execute([$set_id,$user_id,$name,$info,1,$course['chdate'],$course['chdate']]); + $cs_i_insert->execute([$set_id,$course['institut_id']]); + $cs_r_insert->execute([$set_id,$rule_id,'LockedAdmission']); + } + } + // Veranstaltung mit Losverfahren + if ($group_type == 1) { + // Losliste übernehmen + $db->execute("INSERT INTO priorities (user_id, set_id, seminar_id, priority, mkdate, chdate) + SELECT user_id, ?, seminar_id, 1, mkdate, UNIX_TIMESTAMP() + FROM admission_seminar_user WHERE status = 'claiming' AND seminar_id = ?", [$set_id, $course['seminar_id']]); + // Chronologische Anmeldung + } else if ($group_type == 2) { + $preserve_waitlists[] = $course['seminar_id']; + } + // weitere Einrichtungen zuordnen + if ($group_type != 3 && !in_array($course['institut_id'], $group_inst)) { + $cs_i_insert->execute([$set_id, $course['institut_id']]); + $group_inst[] = $course['institut_id']; + } + $s_cs_insert->execute([$set_id, $course['seminar_id']]); + } + + $admission = $db->fetchAll("SELECT seminar_id, seminare.name, start_time, duration_time, institut_id, admission_type, admission_starttime, admission_endtime, admission_endtime_sem + FROM seminare left join admission_group on(group_id=admission_group) WHERE admission_type in (1, 2) AND group_id is null"); + foreach ($admission as $course) { + /* + * Check, ob Anmeldeverfahren in der Vergangenheit schon + * abgeschlossen wurde. Hier extra ausführlich, damit es + * verständlich bleibt. + */ + // Veranstaltungen, die (auch implizit) im aktuellen oder kommenden Semestern liegen. + if (($course['start_time'] + $course['duration_time'] >= $semester->beginn || $course['duration_time'] == -1) && + // Checke, ob Warteliste aktiviert, Anmeldezeitraum oder Loszeitpunkt in der Zukunft oder Anmeldezeitraum komplett offen. + ($course['admission_disable_waitlist'] == 0 || $course['admission_starttime'] > $now || $course['admission_endtime'] > $now || + $course['admission_endtime_sem'] > $now || $course['admission_endtime_sem'] == -1)) { + // Erzeuge ein Anmeldeset mit den vorhandenen Einstellungen der Veranstaltung. + $cs = $this->buildCourseset($course, false); + $cs->setName('Beschränkte Teilnehmeranzahl: '.$course['name']) + ->setInfoText('Erzeugt durch Migration 128 ' . strftime('%X %x')) + ->setPrivate(true)->setUserId($user_id)->store(); + $set_id = $cs->getId(); + // Veranstaltung mit Losverfahren + if ($course['admission_type'] == 1) { + // Losliste übernehmen + $db->execute("INSERT INTO priorities (user_id, set_id, seminar_id, priority, mkdate, chdate) + SELECT user_id, ?, seminar_id, 1, mkdate, UNIX_TIMESTAMP() + FROM admission_seminar_user WHERE status = 'claiming' AND seminar_id = ?", [$set_id, $course['seminar_id']]); + // Chronologische Anmeldung + } else { + $preserve_waitlists[] = $course['seminar_id']; + } + // Losen oder Anmeldezeitraum vorbei => sperren. + // Veranstaltungen in vergangenen Semestern werden einfach gesperrt. + } else { + $set_id = $locked_set_id; + } + $s_cs_insert->execute([$set_id, $course['seminar_id']]); + } + + $db->exec("UPDATE seminare SET Lesezugriff=1,Schreibzugriff=1 WHERE Lesezugriff=3"); + $db->exec("UPDATE seminare SET Lesezugriff=1,Schreibzugriff=1 WHERE Lesezugriff=2"); + + // Übernehme Veranstaltungen ohne Anmeldeverfahren, aber mit Anmeldezeitraum in der Zukunft. + $now = time(); + $admission = $db->fetchAll("SELECT `seminar_id`,`seminare`.`name`,`institut_id`,`admission_starttime`,`admission_endtime_sem` + FROM `seminare` WHERE `admission_type`=0 AND (`admission_starttime`>:now OR `admission_endtime_sem`>:now)", ['now' => $now]); + foreach ($admission as $course) { + // Erzeuge ein Anmeldeset mit den vorhandenen Einstellungen der Veranstaltung. + $cs = new CourseSet(); + $rule = new TimedAdmission(); + if ($course['admission_starttime'] != -1) { + $rule->setStartTime($course['admission_starttime']); + } + if ($course['admission_endtime_sem'] != -1) { + $rule->setEndTime($course['admission_endtime_sem']); + } + $cs->setName('Anmeldezeitraum: '.$course['name']) + ->setInfoText('Erzeugt durch Migration 128 ' . strftime('%X %x')) + ->addCourse($course['seminar_id'])->addAdmissionRule($rule)->setPrivate(true)->setUserId($user_id)->store(); + } + + //Warte und Anmeldelisten löschen + $db->exec("DELETE FROM admission_seminar_user WHERE status = 'claiming'"); + $db->execute("DELETE FROM admission_seminar_user WHERE status = 'awaiting' AND seminar_id NOT IN(?)", [$preserve_waitlists]); + + $db->exec("DROP TABLE admission_seminar_studiengang"); + $db->exec("DROP TABLE admission_group"); + $db->exec("ALTER TABLE `seminare` DROP `Passwort`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_endtime`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_type`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_selection_take_place`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_group`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_starttime`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_endtime_sem`"); + $db->exec("ALTER TABLE `seminare` DROP `admission_enable_quota`"); + + $db->exec("ALTER TABLE `seminare` ADD `admission_waitlist_max` INT UNSIGNED NOT NULL DEFAULT '0'"); + $db->exec("ALTER TABLE `seminare` ADD `admission_disable_waitlist_move` TINYINT UNSIGNED NOT NULL DEFAULT '0'"); + + $db->exec("ALTER TABLE `seminar_user` DROP `admission_studiengang_id`"); + $db->exec("ALTER TABLE `admission_seminar_user` DROP `studiengang_id`"); + try { + $db->exec("ALTER TABLE `seminar_user` DROP INDEX `Seminar_id`"); + $db->exec("ALTER TABLE `seminar_user` DROP INDEX `user_id`"); + } catch (PDOException $e) { + } + $db->exec("ALTER TABLE `seminar_user` ADD INDEX (`user_id`, `Seminar_id`, `status`)"); + + // Insert global configuration: who may edit course sets? + $db->exec("INSERT IGNORE INTO `config` + (`config_id`, `parent_id`, `field`, `value`, `is_default`, + `type`, `range`, `section`, `position`, `mkdate`, `chdate`, + `description`, `comment`, `message_template`) + VALUES + (MD5('ALLOW_DOZENT_COURSESET_ADMIN'), '', + 'ALLOW_DOZENT_COURSESET_ADMIN', '0', '1', 'boolean', 'global', + 'coursesets', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Sollen Lehrende einrichtungsweite Anmeldesets anlegen und bearbeiten dürfen?', + '', '')"); + // Insert global configuration: who may edit course sets? + $db->exec("INSERT IGNORE INTO `config` + (`config_id`, `parent_id`, `field`, `value`, `is_default`, + `type`, `range`, `section`, `position`, `mkdate`, `chdate`, + `description`, `comment`, `message_template`) + VALUES + (MD5('ENABLE_COURSESET_FCFS'), '', + 'ENABLE_COURSESET_FCFS', '0', '1', 'boolean', 'global', + 'coursesets', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Soll first-come-first-served (Windhundverfahren) bei der Anmeldung erlaubt sein?', + '', '')"); + } + + public function down() + { + $db = DBManager::get(); + // delete all tables related with new admission structure + $db->exec("DROP TABLE `admission_condition`, `admissionfactor`, + `admissionrules`, `conditionaladmissions`, `courseset_factorlist`, + `courseset_rule`, `coursesets`, `limitedadmissions`, + `lockedadmissions`, `priorities`, `seminar_courseset`, + `timedadmissions`, `userfilter_fields`, `userfilter`, + `user_factorlist`, `userlimits`"); + } + + function buildCourseset($course, $grouped) + { + $db = DBManager::get(); + + $cs = new CourseSet(); + $rule = new ParticipantRestrictedAdmission(); + // Loszeitpunkt übernehmen. + $rule->setDistributionTime($course['admission_type'] == 1 ? $course['admission_endtime'] : 0); + $cs->addAdmissionRule($rule); + // Beschränkung 1 aus n, falls erforderlich + if ($grouped) { + $rule = new LimitedAdmission(); + $rule->setMaxNumber(1); + $cs->addAdmissionRule($rule); + } + // Falls Anmeldezeitraum eingestellt, diesen übernehmen. + if ($course['admission_starttime'] != -1 || $course['admission_endtime_sem'] != -1) { + $rule = new TimedAdmission(); + if ($course['admission_starttime'] != -1) { + $rule->setStartTime($course['admission_starttime']); + } + if ($course['admission_endtime_sem'] != -1) { + $rule->setEndTime($course['admission_endtime_sem']); + } + $cs->addAdmissionRule($rule); + } + // Studiengänge eintragen + $stmt = $db->prepare('SELECT studiengang_id FROM admission_seminar_studiengang WHERE seminar_id = ?'); + $stmt->execute([$course['seminar_id']]); + $subjects = $stmt->fetchAll(PDO::FETCH_COLUMN); + if (!in_array('all', $subjects) && $subjects) { + $rule = new ConditionalAdmission(); + foreach ($subjects as $subject) { + $condition = new UserFilter(); + $subject_field = new SubjectCondition(); + $subject_field->setCompareOperator('='); + $subject_field->setValue($subject); + $condition->addField($subject_field); + $rule->addCondition($condition); + } + $cs->addAdmissionRule($rule); + } + return $cs; + } +} diff --git a/db/migrations/1.129_wysiwyg_config_option.php b/db/migrations/1.129_wysiwyg_config_option.php new file mode 100644 index 0000000..f7b933a --- /dev/null +++ b/db/migrations/1.129_wysiwyg_config_option.php @@ -0,0 +1,24 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) + VALUES + ('e8cd96580149cde65ad69b6cf18d5c4A', 'WYSIWYG', '0', 1, 'boolean', 'global', 'global', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Aktiviert den WYSIWYG Editor im JavaScript.', '') + "); + } + + function down() + { + } +} diff --git a/db/migrations/1.12_step_120_userpic.php b/db/migrations/1.12_step_120_userpic.php new file mode 100644 index 0000000..f907b9f --- /dev/null +++ b/db/migrations/1.12_step_120_userpic.php @@ -0,0 +1,37 @@ + + * Copyright (C) 2008 - Marcus Lunzenauer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + */ + +require_once 'lib/classes/Avatar.class.php'; + +class Step120Userpic extends Migration { + + function description() { + return 'modify existing user pictures according to Step00120'; + } + + function up() { + foreach (glob($GLOBALS['DYNAMIC_CONTENT_PATH'].'/user/*.jpg') as $value) { + if (preg_match('/\/([0-9a-f]+).jpg$/', $value, $matches)) { + try { + Avatar::getAvatar($matches[1])->createFrom($value); + } catch (Exception $e) { + $this->announce('Exception while converting avatar "%s"', $value); + $this->write($e->getMessage()."\n"); + } + @unlink($value); + } + } + } + + function down() { + } +} diff --git a/db/migrations/1.130_step_00267_preliminary_accounts.php b/db/migrations/1.130_step_00267_preliminary_accounts.php new file mode 100644 index 0000000..13b2af9 --- /dev/null +++ b/db/migrations/1.130_step_00267_preliminary_accounts.php @@ -0,0 +1,15 @@ +exec("UPDATE auth_user_md5 SET auth_plugin='standard' WHERE auth_plugin IS NULL"); + DBManager::get()->exec("ALTER TABLE `auth_user_md5` CHANGE `auth_plugin` `auth_plugin` VARCHAR(64) NULL DEFAULT 'standard'"); + } +} diff --git a/db/migrations/1.131_score_config_option.php b/db/migrations/1.131_score_config_option.php new file mode 100644 index 0000000..9da9fab --- /dev/null +++ b/db/migrations/1.131_score_config_option.php @@ -0,0 +1,21 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) + VALUES + ('e6b6b8be6caf8abf0904c29e30e9b129', 'SCORE_ENABLE', '1', 1, 'boolean', 'global', 'modules', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Schaltet ein oder aus, ob die Rangliste und die Score-Funktion global verfügbar sind.', '') + "); + } + +} diff --git a/db/migrations/1.132_step_00268_event_log.php b/db/migrations/1.132_step_00268_event_log.php new file mode 100644 index 0000000..99b2ec6 --- /dev/null +++ b/db/migrations/1.132_step_00268_event_log.php @@ -0,0 +1,30 @@ +exec("ALTER TABLE `log_actions` ADD `filename` + VARCHAR( 255 ) NULL DEFAULT NULL , + ADD `class` VARCHAR( 255 ) NULL DEFAULT NULL"); + DBManager::get()->exec("ALTER TABLE `log_actions` ADD `type` + ENUM( 'core', 'plugin', 'file' ) NULL DEFAULT NULL"); + } + + /** + * revert this migration + */ + function down() { + DBManager::get()->exec("ALTER TABLE `log_actions` + DROP `filename`, DROP `class`, DROP `type`"); + } + +} \ No newline at end of file diff --git a/db/migrations/1.133_tic_4072_new_password_hashing.php b/db/migrations/1.133_tic_4072_new_password_hashing.php new file mode 100644 index 0000000..cc29b8c --- /dev/null +++ b/db/migrations/1.133_tic_4072_new_password_hashing.php @@ -0,0 +1,26 @@ +exec("ALTER TABLE `auth_user_md5` CHANGE `password` `password` VARBINARY( 64 ) NOT NULL DEFAULT ''"); + $hasher = UserManagement::getPwdHasher(); + $pwd_up = $db->prepare("UPDATE auth_user_md5 SET password=? WHERE user_id=?"); + foreach($db->query("SELECT user_id,password FROM auth_user_md5 WHERE auth_plugin='standard' AND password <> ''") as $row) { + $new_pwd = $hasher->HashPassword($row['password']); + $pwd_up->execute([$new_pwd, $row['user_id']]); + } + } + + public function down() + { + $db = DBManager::get(); + $db->exec("ALTER TABLE `auth_user_md5` CHANGE `password` `password` VARCHAR( 32 ) NOT NULL DEFAULT ''"); + } +} diff --git a/db/migrations/1.134_step_00269_plugin_roles.php b/db/migrations/1.134_step_00269_plugin_roles.php new file mode 100644 index 0000000..1fc1c40 --- /dev/null +++ b/db/migrations/1.134_step_00269_plugin_roles.php @@ -0,0 +1,21 @@ +exec("ALTER TABLE `roles_user` ADD `institut_id` CHAR(32) NOT NULL DEFAULT ''"); + DBManager::get()->exec("ALTER TABLE `roles_user` DROP PRIMARY KEY"); + DBManager::get()->exec("ALTER TABLE `roles_user` ADD PRIMARY KEY( `roleid`, `userid`, `institut_id`)"); + } + + function down() + { + DBManager::get()->exec("ALTER TABLE `roles_user` DROP `institut_id`"); + } +} diff --git a/db/migrations/1.135_tic_4011_remove_teilnehmer_view.php b/db/migrations/1.135_tic_4011_remove_teilnehmer_view.php new file mode 100644 index 0000000..bbf6b29 --- /dev/null +++ b/db/migrations/1.135_tic_4011_remove_teilnehmer_view.php @@ -0,0 +1,19 @@ +exec("DROP TABLE `teilnehmer_view`"); + } + + function down() + { + ; + } +} diff --git a/db/migrations/1.136_wiki_remove_camel_case.php b/db/migrations/1.136_wiki_remove_camel_case.php new file mode 100644 index 0000000..6ea75c0 --- /dev/null +++ b/db/migrations/1.136_wiki_remove_camel_case.php @@ -0,0 +1,67 @@ + + */ + +class WikiRemoveCamelCase extends Migration +{ + function description() { + return 'Enclose camel-case wiki links in double square brackets.'; + } + + function fixWikiLinks($body) { + // $camel_case = wiki-links-short in WikiFormat.php before migration + $camel_case = '\b(' + . '(?:[A-ZÄÖÜ]|&[AOU]uml;)' // upper-case letter + . '(?:[a-z\däöüß]|&[aou]uml;|ß)+' // lower-case letter, or digit + . '(?:[A-ZÄÖÜ]|&[AOU]uml;)' + . '(?:[\w\däöüß]|&[aou]uml;|ß)*' // underscore, digit, lower-case letter + . ')'; + $open_tag = '(?:\[\[)'; + $close_tag = '(?:(?:\|(?:.*?))?\]\])'; // with optional |text]] + $wiki_link = "/($open_tag)?$camel_case($close_tag)?/"; + return preg_replace_callback($wiki_link, function($m) use ($open_tag, $close_tag) { + $has_open = preg_match('/' . $open_tag . '/', $m[1]); + $has_close = preg_match('/' . $close_tag . '/', $m[3]); + $is_enclosed = $has_open && $has_close; + return $is_enclosed ? $m[0] : $m[1] . '[[' . $m[2] . ']]' . $m[3]; + }, $body); + } + + function up() { + // fetch all wiki versions + $stmt = DBManager::get()->prepare('SELECT * FROM wiki'); + $stmt->execute(); + while ($wiki_page = $stmt->fetch(PDO::FETCH_ASSOC)) { + DBManager::get()->prepare( + 'UPDATE wiki SET body=?' + . ' WHERE range_id=? AND keyword=? AND version=?' + )->execute([ + $this->fixWikiLinks($wiki_page['body']), + $wiki_page['range_id'], + $wiki_page['keyword'], + $wiki_page['version'] + ]); + } + } + + function down() { + } +} diff --git a/db/migrations/1.137_studygroup_invitations.php b/db/migrations/1.137_studygroup_invitations.php new file mode 100644 index 0000000..5d66d3f --- /dev/null +++ b/db/migrations/1.137_studygroup_invitations.php @@ -0,0 +1,24 @@ +exec($query); + } + + function down() + { + DBManager::get()->exec("DROP TABLE IF EXISTS `studygroup_invitations`"); + } +} diff --git a/db/migrations/1.138_create_tags_for_messaging.php b/db/migrations/1.138_create_tags_for_messaging.php new file mode 100644 index 0000000..ca51636 --- /dev/null +++ b/db/migrations/1.138_create_tags_for_messaging.php @@ -0,0 +1,73 @@ +exec(" + CREATE TABLE IF NOT EXISTS `message_tags` ( + `message_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `tag` varchar(64) NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`message_id`,`user_id`,`tag`) + ) ENGINE=MyISAM + "); + + $old_config = DBManager::get()->prepare(" + SELECT user_id, value FROM user_config WHERE field = 'MESSAGING_SETTINGS' + "); + $old_config->execute(); + while ($result = $old_config->fetch(PDO::FETCH_ASSOC)) { + $config = json_decode($result['value'], true); + + //Erstelle alle Tags und verknüpfe sie mit den Nachrichten: + $statement = DBManager::get()->prepare(" + INSERT IGNORE INTO message_tags (message_id, user_id, tag) + SELECT message_user.message_id, message_user.user_id, :tag + FROM message_user + WHERE message_user.user_id = :user_id + AND message_user.folder = :folder_id + AND message_user.snd_rec = :snd_rec + "); + foreach ((array) $config['folder']['in'] as $folder_id => $tag) { + if ($tag !== "dummy") { + $statement->execute([ + 'tag' => $tag, + 'user_id' => $result['user_id'], + 'folder_id' => $folder_id + 1, + 'snd_rec' => "rec" + ]); + } + } + foreach ((array) $config['folder']['out'] as $folder_id => $tag) { + if ($tag !== "dummy") { + $statement->execute([ + 'tag' => $tag, + 'user_id' => $result['user_id'], + 'folder_id' => $folder_id + 1, + 'snd_rec' => "snd" + ]); + } + } + } + + DBManager::get()->exec(" + ALTER TABLE `message_user` DROP `folder` + "); + DBManager::get()->exec(" + ALTER TABLE `message` DROP `reading_confirmation`; + "); + } + + public function down() + { + $query = "DROP TABLE `message_tags`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.139_step00272_tours.php b/db/migrations/1.139_step00272_tours.php new file mode 100644 index 0000000..f6c82bb --- /dev/null +++ b/db/migrations/1.139_step00272_tours.php @@ -0,0 +1,80 @@ +create('TOURS_ENABLE', [ + 'value' => 1, + 'is_default' => 1, + 'type' => 'boolean', + 'range' => 'global', + 'section' => 'global', + 'description' => _('Aktiviert die Funktionen zum Anbieten von Touren in Stud.IP') + ]); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tours` ( + `tour_id` char(32) NOT NULL, + `name` varchar(255) NOT NULL, + `description` text NOT NULL, + `type` enum('tour','wizard') NOT NULL, + `roles` varchar(255) NOT NULL, + `version` int(11) unsigned NOT NULL DEFAULT '1', + `language` char(2) NOT NULL DEFAULT 'de', + `studip_version` varchar(32) NOT NULL DEFAULT '', + `installation_id` varchar(255) NOT NULL DEFAULT 'demo-installation', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`tour_id`) + ) ENGINE=MyISAM;"); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_audiences` ( + `tour_id` char(32) NOT NULL, + `range_id` char(32) NOT NULL, + `type` enum('inst','sem','studiengang','abschluss','userdomain','tour') NOT NULL, + PRIMARY KEY (`tour_id`,`range_id`,`type`) + ) ENGINE=MyISAM;"); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_settings` ( + `tour_id` varchar(32) NOT NULL, + `active` tinyint(4) NOT NULL, + `access` enum('standard','link','autostart','autostart_once') DEFAULT NULL, + PRIMARY KEY (`tour_id`) + ) ENGINE=MyISAM;"); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_steps` ( + `tour_id` char(32) NOT NULL DEFAULT '', + `step` tinyint(4) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL DEFAULT '', + `tip` text NOT NULL, + `orientation` enum('T','TL','TR','L','LT','LB','B','BL','BR','R','RT','RB') NOT NULL DEFAULT 'B', + `interactive` tinyint(4) NOT NULL, + `css_selector` varchar(255) NOT NULL, + `route` varchar(255) NOT NULL DEFAULT '', + `author_id` char(32) NOT NULL DEFAULT '', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`tour_id`,`step`) + ) ENGINE=MyISAM;"); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_user` ( + `tour_id` varchar(32) COLLATE latin1_german1_ci NOT NULL, + `user_id` varchar(32) COLLATE latin1_german1_ci NOT NULL, + `step_nr` int(11) NOT NULL, + `completed` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`tour_id`,`user_id`) + ) ENGINE=MyISAM;"); + } + + /** + * revert this migration + */ + function down() + { + Config::get()->delete('TOURS_ENABLE'); + } +} diff --git a/db/migrations/1.13_remove_fields_from_extermine.php b/db/migrations/1.13_remove_fields_from_extermine.php new file mode 100644 index 0000000..b357498 --- /dev/null +++ b/db/migrations/1.13_remove_fields_from_extermine.php @@ -0,0 +1,23 @@ +announce(" removing fields..."); + + DBManager::get()->exec("ALTER TABLE `ex_termine` DROP `expire`, DROP `repeat`, DROP `color`, DROP `priority`"); + + $this->announce("done."); + + } + + public function down () + { + $this->announce("done."); + } +} diff --git a/db/migrations/1.140_tic4450_archiv_protected_files.php b/db/migrations/1.140_tic4450_archiv_protected_files.php new file mode 100644 index 0000000..47fc905 --- /dev/null +++ b/db/migrations/1.140_tic4450_archiv_protected_files.php @@ -0,0 +1,20 @@ +exec($query); + } + + function down() + { + DBManager::get()->exec("ALTER TABLE `archiv` DROP `archiv_protected_file_id`"); + } +} diff --git a/db/migrations/1.141_tic4454_roomrequest_options.php b/db/migrations/1.141_tic4454_roomrequest_options.php new file mode 100644 index 0000000..7c56916 --- /dev/null +++ b/db/migrations/1.141_tic4454_roomrequest_options.php @@ -0,0 +1,28 @@ +exec("ALTER TABLE `resources_requests` ADD `last_modified_by` VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `user_id`"); + $db->exec("ALTER TABLE `resources_requests` ADD `reply_recipients` ENUM( 'requester', 'lecturer' ) NOT NULL DEFAULT 'requester' AFTER `reply_comment`"); + $db->exec("CREATE TABLE IF NOT EXISTS `resources_requests_user_status` ( + `request_id` char(32) NOT NULL DEFAULT '', + `user_id` char(32) NOT NULL DEFAULT '', + `mkdate` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`request_id`,`user_id`) + ) ENGINE=MyISAM"); + } + + function down() + { + DBManager::get()->exec("ALTER TABLE `resources_requests` DROP `last_modified_by`"); + DBManager::get()->exec("ALTER TABLE `resources_requests` DROP `reply_recipients`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `resources_requests_user_status`"); + } +} diff --git a/db/migrations/1.142_tic4463_remove_stm.php b/db/migrations/1.142_tic4463_remove_stm.php new file mode 100644 index 0000000..1241988 --- /dev/null +++ b/db/migrations/1.142_tic4463_remove_stm.php @@ -0,0 +1,30 @@ +exec("DROP TABLE IF EXISTS `his_abschl`, `his_abstgv`, `his_pvers`, `his_stg`, + `stm_abstract`, `stm_abstract_assign`, `stm_abstract_elements`, + `stm_abstract_text`, `stm_abstract_types`, `stm_element_types`, + `stm_instances`, `stm_instances_elements`, `stm_instances_text`"); + $db->exec("DELETE FROM config WHERE field = 'STM_ENABLE'"); + } + + function down() + { + /* + Pleased to meet you, take my hand + There is no way back from hell + Pleased to meet you, say your prayers + There is no way back from hell + But I don't care + No way back from hell ... YEAH! + */ + } +} diff --git a/db/migrations/1.143_step00249_my_courses_config.php b/db/migrations/1.143_step00249_my_courses_config.php new file mode 100644 index 0000000..00eb30f --- /dev/null +++ b/db/migrations/1.143_step00249_my_courses_config.php @@ -0,0 +1,34 @@ +exec(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) + VALUES + (md5('MY_COURSES_ENABLE_STUDYGROUPS'), 'MY_COURSES_ENABLE_STUDYGROUPS', 0, 0, 'boolean', 'global', 'MeineVeranstaltungen', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Sollen Studiengruppen in einem eigenen Bereich angezeigt werden (Neues Navigationelement in Meine Veranstaltungen)?.', '') + "); + + DBManager::get()->exec(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) + VALUES + (md5('MY_COURSES_ENABLE_ALL_SEMESTERS'), 'MY_COURSES_ENABLE_ALL_SEMESTERS', 0, 0, 'boolean', 'global', 'MeineVeranstaltungen', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Ermöglicht die Anzeige von allen Semestern unter meine Veranstaltungen.', '') + "); + + DBManager::get()->exec("UPDATE config SET value = 'sem_number' WHERE field = 'MY_COURSES_FORCE_GROUPING'"); + } + + function down() + { + } +} diff --git a/db/migrations/1.144_files.php b/db/migrations/1.144_files.php new file mode 100644 index 0000000..4ef726f --- /dev/null +++ b/db/migrations/1.144_files.php @@ -0,0 +1,213 @@ + + * @author Stefan Osterloh + * @author Gerd Hoffmann + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 or later + */ + + +class files extends Migration +{ + public function description() + { + return 'Setup db for personal file space'; + } + + public function up() + { + // Create directory + if (empty($GLOBALS['USER_DOC_PATH'])) { + throw new Exception('Config variable "USER_DOC_PATH" has not been set in file "config/config_local.inc.php". ' + .'If you are upgrading to a newer release, please refer to the file "config/config_local.inc.php.dist" ' + .'or just set it to default value of "$USER_DOC_PATH = $STUDIP_BASE_PATH . \'/data/user_doc\';".'); + } + + if (!file_exists($GLOBALS['USER_DOC_PATH'])) { + $result = mkdir($GLOBALS['USER_DOC_PATH'], 0755, true); + if ($result === false) { + throw new Exception('Could not create user file path. Please check the config variable "USER_DOC_PATH" ' + .'in file "config/config_local.inc.php".'); + } + } + + /* + * Migration for API in lib/files + */ + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files + (file_id CHAR(32) NOT NULL, + user_id CHAR(32) NOT NULL, + filename VARCHAR(255) NOT NULL, + mime_type VARCHAR(64) NOT NULL, + size BIGINT UNSIGNED NOT NULL, + restricted TINYINT(1) NOT NULL DEFAULT 0, + storage VARCHAR(32) NOT NULL DEFAULT 'DiskFileStorage', + storage_id VARCHAR(32) NOT NULL, + mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + chdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (file_id)) ENGINE=MyISAM"); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS file_refs + (id CHAR(32) NOT NULL, + file_id CHAR(32) NOT NULL, + parent_id CHAR(32) NOT NULL, + name VARCHAR(255) NOT NULL, + description TEXT NOT NULL, + downloads INT NOT NULL DEFAULT 0, + PRIMARY KEY (id)) ENGINE=MyISAM"); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files_backend_studip + (id INT UNSIGNED NOT NULL, + files_id VARCHAR(64) NOT NULL, + path VARCHAR(256) NOT NULL, + PRIMARY KEY (id)) ENGINE=MyISAM"); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files_backend_url + (id INT UNSIGNED NOT NULL, + files_id VARCHAR(64) NOT NULL, + url VARCHAR(256) NOT NULL, + PRIMARY KEY (id)) ENGINE=MyISAM"); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files_share + (files_id VARCHAR(64) NOT NULL, + entity_id VARCHAR(32) NOT NULL, + description MEDIUMTEXT NULL, + read_perm BOOLEAN DEFAULT FALSE, + write_perm BOOLEAN DEFAULT FALSE, + start_date INT UNSIGNED NOT NULL, + end_date INT UNSIGNED NOT NULL, + PRIMARY KEY (files_id, entity_id)) ENGINE=MyISAM"); + + /* + * Migration for the Admin-Area + */ + DBManager::get()->query("CREATE TABLE IF NOT EXISTS `doc_filetype` + (`id` INT NOT NULL AUTO_INCREMENT , + `type` VARCHAR(45) NOT NULL , + `description` TEXT NULL , + PRIMARY KEY (`id`)) ENGINE=MyISAM" + ); + + DBManager::get()->query("CREATE TABLE IF NOT EXISTS `doc_usergroup_config` + (`id` INT NOT NULL AUTO_INCREMENT , + `usergroup` VARCHAR(45) NOT NULL , + `upload_quota` TEXT NOT NULL , + `upload_unit` VARCHAR(45) NULL , + `quota` TEXT NULL , + `quota_unit` VARCHAR(45) NULL , + `upload_forbidden` INT NOT NULL DEFAULT 0 , + `area_close` INT NOT NULL DEFAULT 0 , + `area_close_text` TEXT NULL , + `is_group_config` INT NOT NULL DEFAULT 0 , + PRIMARY KEY (`id`, `usergroup`)) ENGINE=MyISAM" + ); + + DBManager::get()->query("CREATE TABLE IF NOT EXISTS `doc_filetype_forbidden` + (`id` INT NOT NULL AUTO_INCREMENT , + `usergroup` VARCHAR(45) NOT NULL , + `dateityp_id` INT NOT NULL , + PRIMARY KEY (`id`) , + INDEX `fk_dateityp_verbot_nutzerbereich_2_idx` (`dateityp_id` ASC) , + INDEX `fk_dateityp_verbot_nutzerbereich_1_idx` (`usergroup` ASC)) ENGINE=MyISAM" + ); + + /* + * Set the entry into the table "config" to enable or disable the Personal Document Area + */ + $query = "INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description`) + VALUES (:id, :field, :value, 1, :type, 'global', 'files', UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), :description)"; + $statement = DBManager::get()->prepare($query); + $statement->execute([ + ':id' => md5(uniqid('PERSONALDOCUMENT_ENABLE')), + ':field' => 'PERSONALDOCUMENT_ENABLE', + ':value' => (int) false, + ':type' => 'boolean', + ':description' => 'Aktiviert den persoenlichen Dateibereich', + ]); + + $query = "INSERT IGNORE INTO `doc_usergroup_config` + (`id`, `usergroup`, `upload_quota`, `upload_unit`, + `quota`, `quota_unit`, `is_group_config`) + VALUES (:id, :group, :uploadQuota, :uploadUnit, :quota, + :quotaUnit, :isGroupConfig)"; + + $statement = DBManager::get()->prepare($query); + $statement->execute([ + ':id' => '1', + ':group' => 'default', + ':uploadQuota' => '5242880', + ':uploadUnit' => 'MB', + ':quota' => '52428800', + ':quotaUnit' => 'MB', + ':isGroupConfig' => '1' + ]); + + $query = "INSERT IGNORE INTO `doc_filetype` (`type`) VALUES (:type)"; + + $statement = DBManager::get()->prepare($query); + foreach (words('exe com pif bat scr') as $value) { + $statement->execute([ + ':type' => $value + ]); + } + } + + public function down() + { + // Remove user directories + $this->rm_rf($GLOBALS['USER_DOC_PATH']); + + // Remove db tables + DBManager::get()->exec("DROP TABLE IF EXISTS + `files`, + `files_layout`, + `files_backend_studip`, + `files_backend_url`, + `files_share`, + `doc_usergroup_config`, + `doc_filetype`, + `doc_filetype_forbidden` + "); + + // Remove config entry + DBManager::get()->query("DELETE FROM config WHERE field IN ('PERSONALDOCUMENT_ENABLE')"); + } + + protected function rm_rf($path) + { + $files = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); + foreach ($files as $file) { + if (is_dir($file)) { + $this->rm_rf($file); + } else { + unlink($file); + } + } + rmdir($path); + } + } diff --git a/db/migrations/1.145_tic4491_help_content.php b/db/migrations/1.145_tic4491_help_content.php new file mode 100644 index 0000000..0ffcab6 --- /dev/null +++ b/db/migrations/1.145_tic4491_help_content.php @@ -0,0 +1,48 @@ + + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 or later + */ + + +class Tic4491HelpContent extends Migration +{ + public function description() + { + return 'Setup db table for helpbar texts'; + } + + public function up() + { + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_content` ( + `content_id` char(32) NOT NULL, + `language` char(2) NOT NULL DEFAULT 'de', + `label` varchar(255) NOT NULL, + `icon` varchar(255) NOT NULL, + `content` text NOT NULL, + `route` varchar(255) NOT NULL, + `studip_version` varchar(32) NOT NULL, + `position` tinyint(4) NOT NULL DEFAULT '1', + `custom` tinyint(4) NOT NULL DEFAULT '0', + `visible` tinyint(4) NOT NULL DEFAULT '1', + `author_id` char(32) NOT NULL DEFAULT '', + `installation_id` varchar(255) NOT NULL, + `mkdate` int(11) unsigned NOT NULL, + PRIMARY KEY (`route`,`studip_version`,`language`,`position`,`custom`) + ) ENGINE=MyISAM;"); + } + + public function down() + { + // Remove db tables + DBManager::get()->exec("DROP TABLE IF EXISTS `help_content`;"); + } + } diff --git a/db/migrations/1.146_step_00253_startseite.php b/db/migrations/1.146_step_00253_startseite.php new file mode 100644 index 0000000..f02f5c6 --- /dev/null +++ b/db/migrations/1.146_step_00253_startseite.php @@ -0,0 +1,107 @@ +exec(" + CREATE TABLE IF NOT EXISTS `widget_user` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `pluginid` int(11) NOT NULL, + `position` int(11) NOT NULL DEFAULT 0, + `range_id` varchar(32) NOT NULL, + `col` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY (`range_id`) + ) ENGINE=MyISAM + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `widget_default` ( + `pluginid` int(11) NOT NULL, + `col` tinyint(1) NOT NULL DEFAULT 0, + `position` tinyint(1) NOT NULL DEFAULT 0, + `perm` enum('user', 'autor', 'tutor', 'dozent', 'admin', 'root') NOT NULL DEFAULT 'autor', + PRIMARY KEY (`perm`,`pluginid`) + ) ENGINE=MyISAM + "); + + // take care of the widgets + foreach (words('EvaluationsWidget NewsWidget QuickSelection ScheduleWidget TerminWidget') as $classname) { + self::addWidget($classname); + } + + // add a default configuration for each + self::addWidgetDefaulConfiguration(words('QuickSelection NewsWidget TerminWidget EvaluationsWidget')); + + + } + + function down() + { + // take care of the widgets + foreach (words('EvaluationsWidget NewsWidget QuickSelection ScheduleWidget TerminWidget') as $classname) { + self::removeWidget($classname); + } + + DBManager::get()->exec("DROP TABLE IF EXISTS `widget_user`,`widget_default`"); + } + + private function addWidget($classname) { + // get highest position + $navpos = DBManager::get()->query("SELECT navigationpos FROM plugins + ORDER BY navigationpos DESC")->fetchColumn() + 1; + + // insert plugin into db + $stmt = DBManager::get()->prepare("INSERT INTO plugins + (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) + VALUES (?, ?, ?, 'PortalPlugin', 'yes', ?)"); + $stmt->execute([$classname, 'core/'.$classname, $classname, $navpos]); + + // get id of newly created plugin (we purposely do not use PDO::lastInserId()) + $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins + WHERE pluginclassname = '$classname'")->fetchColumn(); + + // set all default roles for the plugin + $stmt = DBManager::get()->prepare("INSERT INTO roles_plugins + (roleid, pluginid) VALUES (?, ?)"); + foreach (range(1, 6) as $role_id) { + $stmt->execute([$role_id, $plugin_id]); + } + } + + private function addWidgetDefaulConfiguration($classnames) { + foreach($classnames as $key => $classname) { + $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins + WHERE pluginclassname = '$classname'")->fetchColumn(); + $stmt = DBManager::get()->prepare("INSERT INTO widget_default + (`pluginid`, `col`, `position`, `perm`) VALUES (?, ?, ?, ?)"); + foreach (words("user autor tutor dozent admin root") as $perm) { + $stmt->execute([$plugin_id, 0, $key, $perm]); + } + } + } + + private function removeWidget($classname) { + // get id of widget + $widget_id = DBManager::get()->query("SELECT pluginid FROM plugins + WHERE pluginclassname = '$classname'")->fetchColumn(); + + $stmt = DBManager::get()->prepare("DELETE FROM plugins WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $stmt = DBManager::get()->prepare("DELETE FROM widget_default WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $stmt = DBManager::get()->prepare("DELETE FROM widget_user WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $stmt = DBManager::get()->prepare("DELETE FROM roles_plugins WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + } +} diff --git a/db/migrations/1.148_tic_4520_sem_tree_display.php b/db/migrations/1.148_tic_4520_sem_tree_display.php new file mode 100644 index 0000000..1468f30 --- /dev/null +++ b/db/migrations/1.148_tic_4520_sem_tree_display.php @@ -0,0 +1,44 @@ +create('COURSE_SEM_TREE_DISPLAY', [ + 'value' => 0, + 'is_default' => 0, + 'type' => 'boolean', + 'range' => 'global', + 'section' => 'global', + 'description' => _('Zeigt den Studienbereichsbaum als Baum an') + ]); + Config::get()->create('COURSE_SEM_TREE_CLOSED_LEVELS', [ + 'value' => '[1]', + 'is_default' => '[1]', + 'type' => 'array', + 'range' => 'global', + 'section' => 'global', + 'description' => _('Gibt an, welche Ebenen der Studienbereichszuordnung geschlossen bleiben sollen') + ]); + } + + function down() { + Config::get()->delete('COURSE_SEM_TREE_DISPLAY'); + Config::get()->delete('COURSE_SEM_TREE_CLOSED_LEVELS'); + } + +} diff --git a/db/migrations/1.14_step_00123_admission2.php b/db/migrations/1.14_step_00123_admission2.php new file mode 100644 index 0000000..c7410b4 --- /dev/null +++ b/db/migrations/1.14_step_00123_admission2.php @@ -0,0 +1,30 @@ +announce(" modifying table `seminare` adding field `admission_enable_quota`..."); + + DBManager::get()->exec( "ALTER TABLE `seminare` ADD `admission_enable_quota` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `admission_disable_waitlist`"); + + $this->announce(" update old entries..."); + + DBManager::get()->exec("UPDATE `seminare` SET `admission_enable_quota` =1 WHERE admission_type IN ( 1, 2 )"); + + $this->announce("done."); + } + + public function down () + { + $this->announce(" removing field `admission_enable_quota` from `seminare`..."); + + DBManager::get()->exec("ALTER TABLE `seminare` DROP `admission_enable_quota` "); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.150_help_tours_and_content.php b/db/migrations/1.150_help_tours_and_content.php new file mode 100644 index 0000000..bb33622 --- /dev/null +++ b/db/migrations/1.150_help_tours_and_content.php @@ -0,0 +1,385 @@ +addHelpTours(); + $this->addHelpContent(); + $this->addHelpContentEN(); + + // set version in config + $version = '3.1'; + // see migrate_help_content.php + if (!Config::get()->getValue('HELP_CONTENT_CURRENT_VERSION')) { + Config::get()->create('HELP_CONTENT_CURRENT_VERSION', [ + 'value' => $version, + 'is_default' => 0, + 'type' => 'string', + 'range' => 'global', + 'section' => 'global', + 'description' => _('Aktuelle Version der Helpbar-Einträge in Stud.IP') + ]); + } else { + Config::get()->store('HELP_CONTENT_CURRENT_VERSION', $version); + } + } + + function down() + { + DBManager::get()->exec("TRUNCATE TABLE `help_content`"); + DBManager::get()->exec("TRUNCATE TABLE `help_tours`"); + DBManager::get()->exec("TRUNCATE TABLE `help_tour_settings`"); + DBManager::get()->exec("TRUNCATE TABLE `help_tour_steps`"); + } + + function addHelpTours() { + // add tour data + $query = "INSERT IGNORE INTO `help_tours` (`tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `mkdate`) VALUES +('96ea422f286fb5bbf9e41beadb484a9a', 'Profilseite', 'In dieser Tour werden die Grundfunktionen und Bereiche der Profilseite vorgestellt.', 'tour', 'autor,dozent,root', 1, 'de', '3.1', '', 1406722657), +('25e7421f286fc5bdf9e41beadb484ffa', 'Eigenes Bild hochladen', 'In der Tour wird erklärt, wie Nutzende ein eigenes Profilbild hochladen können.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406722657), +('3629493a16bf2680de64361f07cab096', 'Blubber', 'In der Tour wird die Nutzung von Blubber erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406709759), +('21f487fa74e3bfc7789886f40fe4131a', 'Forum nutzen', 'Die Inhalte dieser Tour stammen aus der alten Tour des Forums (Sidebar > Aktionen > Tour starten).', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405415746), +('44f859c50648d3410c39207048ddd833', 'Forum verwalten', 'Die Inhalte dieser Tour stammen aus der alten Tour des Forums (Sidebar > Aktionen > Tour starten).', 'tour', 'tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405417901), +('3a717a468afb0822cb1455e0ae6b6fce', 'Blubber', 'In der Tour wird die Nutzung von Blubber erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406709041), +('ef5092ba722c81c37a5a6bd703890bd9', 'Blubber', 'In der Tour wird die Nutzung von Blubber erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405507317), +('6849293baa05be5bef8ff438dc7c438b', 'Suche', 'In dieser Feature-Tour werden die wichtigsten Funktionen der Suche vorgestellt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405519609), +('b74f8459dce2437463096d56db7c73b9', 'Meine Veranstaltungen (Studierende)', 'In dieser Tour werden die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\" vorgestellt.', 'tour', 'autor,admin,root', 1, 'de', '3.1', '', 1405521073), +('154e711257d4d32d865fb8f5fb70ad72', 'Meine Dateien', 'In dieser Tour wird der persönliche Dateibereich vorgestellt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405592618), +('19ac063e8319310d059d28379139b1cf', 'Studiengruppe anlegen', 'In dieser Tour wird das Anlegen von Studiengruppen erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405684299), +('edfcf78c614869724f93488c4ed09582', 'Teilnehmerverwaltung', 'In dieser Tour werden die Verwaltungsoptionen der Teilnehmerverwaltung erklärt.', 'tour', 'tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405688156), +('977f41c5c5239c4e86f04c3df27fae38', 'Was ist neu in Stud.IP 3.1?', 'In dieser Tour werden die Neuerungen in Stud.IP 3.1 überblicksartig vorgestellt.', 'tour', 'autor,tutor,dozent,admin', 1, 'de', '3.1', '', 1405932260), +('49604a77654617a745e29ad6b253e491', 'Gestaltung der Startseite', 'In dieser Tour werden die Funktionen und Gestaltungsmöglichkeiten der Startseite vorgestellt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405934780), +('7cccbe3b22dfa745c17cb776fb04537c', 'Meine Veranstaltungen (Lehrende)', 'In dieser Tour werden die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\" vorgestellt.', 'tour', 'tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406125685); +"; + DBManager::get()->exec($query); + + // add steps + $query = "INSERT IGNORE INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `author_id`, `mkdate`) VALUES +('96ea422f286fb5bbf9e41beadb484a9a', 3, 'Stud.IP-Score', 'Der Stud.IP-Score wächst mit den Aktivitäten in Stud.IP und repräsentiert so die Erfahrung mit Stud.IP.', 'BL', 0, '#layout_content TABLE:eq(0) TBODY:eq(0) TR:eq(0) TD:eq(0) A:eq(0)', 'dispatch.php/profile', '', 1406722657), +('96ea422f286fb5bbf9e41beadb484a9a', 5, 'Neue Ankündigung', 'Klicken Sie auf das Plus-Zeichen, wenn Sie eine Ankündigung erstellen möchten.', 'BR', 0, '.contentbox:eq(0) header img:eq(1)', 'dispatch.php/profile', '', 1406722657), +('96ea422f286fb5bbf9e41beadb484a9a', 1, 'Profil-Tour', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen des \"Profils\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'dispatch.php/profile', '', 1406722657), +('96ea422f286fb5bbf9e41beadb484a9a', 6, 'Persönliche Daten', 'Das Bild sowie weitere persönliche Angaben können über diese Seiten geändert werden.', 'BL', 0, '#tabs li:eq(2)', 'dispatch.php/profile', '', 1406722657), +('96ea422f286fb5bbf9e41beadb484a9a', 2, 'Persönliches Bild', 'Wenn ein Bild hochgeladen wurde, wird es hier angezeigt. Dieses kann jederzeit geändert werden.', 'RT', 0, '.avatar-normal', 'dispatch.php/profile', '', 1406722657), +('25e7421f286fc5bdf9e41beadb484ffa', 1, 'Profil', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen des \"Profils\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'B', 0, '', 'dispatch.php/profile', '', 1406722657), +('25e7421f286fc5bdf9e41beadb484ffa', 2, 'Bild hochladen', 'Auf dieser Seite lässt sich ein Profilbild hochladen.', 'BL', 0, '#nav_profile_avatar A SPAN', 'dispatch.php/settings/avatar', '', 1406722657), +('25e7421f286fc5bdf9e41beadb484ffa', 3, 'Bild auswählen', 'Dafür kann eine beliebige Bilddatei hochgeladen werden.', 'L', 0, 'input[name=imgfile]', 'dispatch.php/settings/avatar', '', 1406722657), +('96ea422f286fb5bbf9e41beadb484a9a', 4, 'Ankündigungen', 'Sie können auf dieser Seite persönliche Ankündigungen veröffentlichen.', 'B', 0, '#layout_content SECTION HEADER H1 :eq(0)', 'dispatch.php/profile', '', 1406722657), +('3629493a16bf2680de64361f07cab096', 3, 'Text gestalten', 'Der Text kann formatiert und mit Smileys versehen werden.\r\nEs können die üblichen Formatierungen verwendet werden, wie z. B. **fett** oder %%kursiv%%.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508371), +('6849293baa05be5bef8ff438dc7c438b', 4, 'Navigation', 'Falls nur in einem bestimmten Bereich (wie z.B. Lehre) gesucht werden soll, kann dieser hier ausgewählt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/search/courses', '', 1406121826), +('3a717a468afb0822cb1455e0ae6b6fce', 3, 'Text gestalten', 'Der Text kann formatiert und mit Smileys versehen werden.\r\nEs können die üblichen Formatierungen verwendet werden, wie z. B. **fett** oder %%kursiv%%.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508371), +('3629493a16bf2680de64361f07cab096', 9, 'Beitrag verlinken', 'Wird der Mauszeiger auf dem ersten Diskussionsbeitrag positioniert, erscheint links neben dem Datum ein Link-Icon. Wenn dieses mit der rechten Maustaste angeklickt wird, kann der Link auf diesen Beitrag kopiert werden, um ihn an anderer Stelle einfügen zu können.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/forum', '', 1405508281), +('3629493a16bf2680de64361f07cab096', 8, 'Beitrag ändern', 'Wird der Mauszeiger auf einem beliebigen Beitrag positioniert, erscheint dessen Datum. Bei eigenen Beiträgen erscheint außerdem rechts neben dem Datum ein Icon, mit dem der Beitrag nachträglich geändert werden kann.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/forum', '', 1405507901), +('21f487fa74e3bfc7789886f40fe4131a', 1, 'Forum', 'Diese Tour gibt einen Überblick über die Elemente und Interaktionsmöglichkeiten des Forums.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'BL', 0, '', 'plugins.php/coreforum', '', 1405415772), +('21f487fa74e3bfc7789886f40fe4131a', 2, 'Sie befinden sich hier:...', 'An dieser Stelle wird angezeigt, welcher Bereich des Forums gerade betrachtet wird.', 'BL', 0, 'DIV#tutorBreadcrumb', 'plugins.php/coreforum', '', 1405415875), +('44f859c50648d3410c39207048ddd833', 1, 'Forum verwalten', 'Sie haben die Möglichkeit sich eine Tour zur Verwaltung des Forums anzuschauen.\r\n\r\nUm die Tour zu beginnen, klicken Sie bitte unten rechts auf \"Weiter\".', 'TL', 0, '', 'plugins.php/coreforum', '', 1405418008), +('21f487fa74e3bfc7789886f40fe4131a', 3, 'Kategorie', 'Das Forum ist unterteilt in Kategorien, Themen und Beiträge. Eine Kategorie fasst Forumsbereiche in größere Sinneinheiten zusammen.', 'BL', 0, '#layout_content #forum #sortable_areas TABLE CAPTION .category_name :eq(0)', 'plugins.php/coreforum', '', 1405416611), +('21f487fa74e3bfc7789886f40fe4131a', 4, 'Bereich', 'Das ist ein Bereich innerhalb einer Kategorie. Bereiche beinhalten die Diskussionstränge. Bereiche können mit per drag & drop in ihrer Reihenfolge verschoben werden.', 'BL', 0, '#layout_content #forum TABLE THEAD TR TH :eq(0)', 'plugins.php/coreforum', '', 1405416664), +('21f487fa74e3bfc7789886f40fe4131a', 5, 'Info-Icon', 'Dieses Icon färbt sich rot, sobald es etwas neues in diesem Bereich gibt.', 'B', 0, 'IMG#tutorNotificationIcon', 'plugins.php/coreforum', '', 1405416705), +('21f487fa74e3bfc7789886f40fe4131a', 7, 'Forum abonnieren', 'Das gesamte Forum, oder einzelne Themen können abonniert werden. Dann wird bei jedem neuen Beitrag in diesem Forum eine Benachrichtigung angezeigt und eine Nachricht versendet.', 'B', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(5)', 'plugins.php/coreforum', '', 1405416795), +('21f487fa74e3bfc7789886f40fe4131a', 6, 'Suchen', 'Hier können sämtliche Inhalte dieses Forums durchsucht werden.\r\nUnterstützt werden auch Mehrwortsuchen. Außerdem kann die Suche auf eine beliebige Kombination aus Titel, Inhalt und Autor eingeschränkt werden.', 'BL', 0, '#layout-sidebar SECTION #tutorSearchInfobox DIV #tutorSearchInfobox UL LI INPUT :eq(1)', 'plugins.php/coreforum', '', 1405417134), +('44f859c50648d3410c39207048ddd833', 2, 'Kategorie bearbeiten', 'Mit diesen Icons kann der Name der Kategorie geändert oder aber die gesamte Kategorie gelöscht werden. Die Bereiche werden in diesem Fall in die Kategorie \"Allgemein\" verschoben und bleiben somit erhalten.\r\n\r\nDie Kategorie \"Allgemein\" kann nicht gelöscht werden und ist daher in jedem Forum enthalten.', 'BR', 0, '#forum #sortable_areas TABLE CAPTION #tutorCategoryIcons', 'plugins.php/coreforum', '', 1405424216), +('44f859c50648d3410c39207048ddd833', 3, 'Bereich bearbeiten', 'Wird der Mauszeiger auf einem Bereich positioniert, erscheinen Aktions-Icons.\r\nMit diesen Icons kann der Name und die Beschreibung eines Bereiches geändert oder auch der gesamte Bereich gelöscht werden.\r\nDas Löschen eines Bereichs, führt dazu, dass alle enthaltenen Themen gelöscht werden.', 'B', 0, 'IMG.edit-area', 'plugins.php/coreforum', '', 1405424346), +('44f859c50648d3410c39207048ddd833', 4, 'Bereiche sortieren', 'Mit dieser schraffierten Fläche können Bereiche an einer beliebigen Stelle durch Klicken-und-Ziehen einsortiert werden. Dies kann einerseits dazu verwendet werden, um Bereiche innerhalb einer Kategorie zu sortieren, andererseits können Bereiche in andere Kategorien verschoben werden.', 'BR', 0, 'HTML #plugins #layout_wrapper #layout_page #layout_container #layout_content #forum #sortable_areas TABLE TBODY #tutorArea TD IMG#tutorMoveArea.handle.js :eq(1)', 'plugins.php/coreforum', '', 1405424379), +('44f859c50648d3410c39207048ddd833', 5, 'Neuen Bereich hinzufügen', 'Hier können neue Bereiche zu einer Kategorie hinzugefügt werden.', 'BR', 0, 'TFOOT TR TD A SPAN', 'plugins.php/coreforum', '', 1405424421), +('44f859c50648d3410c39207048ddd833', 6, 'Neue Kategorie erstellen', 'Hier kann eine neue Kategorie im Forum erstellt werden. Geben Sie hierfür den Titel der neuen Kategorie ein.', 'TL', 0, '#tutorAddCategory H2', 'plugins.php/coreforum', '', 1405424458), +('ef5092ba722c81c37a5a6bd703890bd9', 1, 'Was ist Blubbern?', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen von \"Blubber\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'plugins.php/blubber/streams/global', '', 1405507364), +('ef5092ba722c81c37a5a6bd703890bd9', 2, 'Beitrag erstellen', 'Hier kann eine Diskussion durch Schreiben von Text begonnen werden. Absätze lassen sich durch Drücken von Umschalt+Eingabe erzeugen. Der Text wird durch Drücken von Eingabe abgeschickt.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405507478), +('ef5092ba722c81c37a5a6bd703890bd9', 8, 'Beitrag ändern', 'Wird der Mauszeiger auf einem beliebigen Beitrag positioniert, erscheint dessen Datum. Bei eigenen Beiträgen erscheint außerdem rechts neben dem Datum ein Icon, mit dem der Beitrag nachträglich geändert werden kann.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/global', '', 1405507901), +('ef5092ba722c81c37a5a6bd703890bd9', 9, 'Beitrag verlinken', 'Wird der Mauszeiger auf dem ersten Diskussionsbeitrag positioniert, erscheint links neben dem Datum ein Link-Icon. Wenn dieses mit der rechten Maustaste angeklickt wird, kann der Link auf diesen Beitrag kopiert werden, um ihn an anderer Stelle einfügen zu können.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/global', '', 1405508281), +('ef5092ba722c81c37a5a6bd703890bd9', 3, 'Text gestalten', 'Der Text kann formatiert und mit Smileys versehen werden.\r\nEs können die üblichen Formatierungen verwendet werden, wie z. B. **fett** oder %%kursiv%%.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508371), +('ef5092ba722c81c37a5a6bd703890bd9', 5, 'Datei hinzufügen', 'Dateien können in einen Beitrag eingefügt werden, indem sie per Drag&Drop in ein Eingabefeld gezogen werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508401), +('ef5092ba722c81c37a5a6bd703890bd9', 6, 'Schlagworte', 'Beiträge können mit Schlagworten (engl. \"Hashtags\") versehen werden, indem einem beliebigen Wort des Beitrags ein # vorangestellt wird.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508442), +('ef5092ba722c81c37a5a6bd703890bd9', 7, 'Schlagwortwolke', 'Durch Anklicken eines Schlagwortes werden alle Beiträge aufgelistet, die dieses Schlagwort enthalten.', 'RT', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'plugins.php/blubber/streams/global', '', 1405508505), +('3a717a468afb0822cb1455e0ae6b6fce', 9, 'Beitrag verlinken', 'Wird der Mauszeiger auf dem ersten Diskussionsbeitrag positioniert, erscheint links neben dem Datum ein Link-Icon. Wenn dieses mit der rechten Maustaste angeklickt wird, kann der Link auf diesen Beitrag kopiert werden, um ihn an anderer Stelle einfügen zu können.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/profile', '', 1405508281), +('6849293baa05be5bef8ff438dc7c438b', 1, 'Suche', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen der \"Suche\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/search/courses', '', 1405519865), +('6849293baa05be5bef8ff438dc7c438b', 2, 'Suchbegriff eingeben', 'In dieses Eingabefeld kann ein Suchbegriff (wie z.B. der Veranstaltungsname, Dozent) eingegeben werden.', 'B', 0, 'INPUT#search_sem_quick_search_1.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520106), +('6849293baa05be5bef8ff438dc7c438b', 3, 'Semesterauswahl', 'Durch einen Klick auf das Drop-Down Menü kann bestimmt werden, auf welches Semester sich der Suchbegriff beziehen soll. \r\n\r\nStandardgemäß ist das aktuelle Semester eingestellt.', 'TL', 0, 'SELECT#search_sem_sem', 'dispatch.php/search/courses', '', 1405520208), +('6849293baa05be5bef8ff438dc7c438b', 5, 'Erweiterte Suche', 'Mit der Erweiterten Suche kann die Suche um weitere Optionen erweitert werden.', 'R', 0, 'A.options-checkbox.options-unchecked', 'dispatch.php/search/courses', '', 1405520436), +('6849293baa05be5bef8ff438dc7c438b', 6, 'Schnellsuche', 'Die Schnellsuche ist auch auf anderen Seiten von Stud.IP jederzeit verfügbar. Nach der Eingabe eines Stichwortes, wird mit \"Enter\" bestätigt, oder auf die Lupe rechts neben dem Feld geklickt.', 'B', 0, 'INPUT#search_sem_quick_search_2.quicksearchbox.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520634), +('6849293baa05be5bef8ff438dc7c438b', 7, 'Weitere Suchmöglichkeiten', 'Neben Veranstaltungen besteht auch die Möglichkeit, im Archiv, nach Personen, nach Einrichtungen oder nach Ressourcen zu suchen.', 'R', 0, '#nav_search_resources A SPAN', 'dispatch.php/search/courses', '', 1405520751), +('b74f8459dce2437463096d56db7c73b9', 1, 'Hilfe-Tour \"Meine Veranstaltungen\"', 'Diese Tour gibt einen Überblick über die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/my_courses', '', 1405521184), +('b74f8459dce2437463096d56db7c73b9', 2, 'Veranstaltungsüberblick', 'Hier werden die Veranstaltungen des aktuellen und vergangenen Semesters angezeigt. Neue Veranstaltungen erscheinen zunächst in rot.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1405521244), +('154e711257d4d32d865fb8f5fb70ad72', 1, 'Meine Dateien', 'Meine Dateien ist der persönliche Dateibereich. Hier können Dateien auf Stud.IP gespeichert werden, um sie von dort auf andere Rechner herunterladen zu können.\r\n\r\nAndere Studierende oder Lehrende erhalten keinen Zugriff auf Dateien, die in den persönlichen Dateibereich hochgeladen werden.\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/document/files', '', 1405592884), +('154e711257d4d32d865fb8f5fb70ad72', 4, 'Dateiübersicht', 'Alle Dateien und Verzeichnisse werden tabellarisch aufgelistet. Neben dem Namen werden noch weitere Informationen wie der Dateityp oder die Dateigröße angezeigt.', 'TL', 0, '#layout_content FORM TABLE THEAD TR TH :eq(3)', 'dispatch.php/document/files', '', 1405593089), +('154e711257d4d32d865fb8f5fb70ad72', 3, 'Neue Dateien und Verzeichnisse', 'Hier können neue Dateien von dem Computer in den persönlichen Dateibereich hochgeladen und neue Verzeichnisse erstellt werden.', 'TL', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(0)', 'dispatch.php/document/files', '', 1405593409), +('ef5092ba722c81c37a5a6bd703890bd9', 4, 'Personen erwähnen', 'Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405672301), +('154e711257d4d32d865fb8f5fb70ad72', 6, 'Export', 'Hier besteht die Möglichkeit einzelne Ordner oder den vollständigen Dateibereich als ZIP-Datei herunterzuladen. Darin sind alle Dateien und Verzeichnisse enthalten.', 'TL', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/document/files', '', 1405593708), +('154e711257d4d32d865fb8f5fb70ad72', 5, 'Aktionen', 'Bereits hochgeladene Dateien und Ordner können hier bearbeitet, heruntergeladen, verschoben, kopiert und gelöscht werden.', 'TR', 0, '#layout_content FORM TABLE THEAD TR TH :eq(7)', 'dispatch.php/document/files', '', 1405594079), +('154e711257d4d32d865fb8f5fb70ad72', 2, 'Verfügbarer Speicherplatz', 'Der Speicherplatz des persönlichen Dateibereichs ist begrenzt. Es wird angezeigt, wie viel Speicherplatz noch verfügbar ist.', 'BR', 0, 'DIV.caption-actions', 'dispatch.php/document/files', '', 1405594184), +('edfcf78c614869724f93488c4ed09582', 5, 'Rundmail an Nutzergruppe versenden', 'Weiterhin besteht die Möglichkeit eine Rundmail an einzelne Nutzergruppen zu versenden.', 'BR', 0, '#layout_container #layout_content TABLE CAPTION SPAN A IMG :eq(0)', 'dispatch.php/course/members', '', 1406637123), +('25e7421f286fc5bdf9e41beadb484ffa', 4, 'Voraussetzungen', 'Eine Bilddatei muss im **.jpg**, **.png** oder **.gif** Format vorliegen.\r\nDie Dateigröße darf 700 KB nicht überschreiten.', 'L', 0, '#layout_content #edit_avatar TBODY TR TD FORM B :eq(2)', 'dispatch.php/settings/avatar', '', 1406722657), +('19ac063e8319310d059d28379139b1cf', 1, 'Studiengruppe anlegen', 'Studiengruppen ermöglichen die Zusammenarbeit mit anderen. Diese Tour gibt Ihnen einen Überblick darüber wie Sie Studiengruppen anlegen können.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'R', 0, '', 'dispatch.php/my_studygroups', '', 1405684423), +('19ac063e8319310d059d28379139b1cf', 2, 'Studiengruppe anlegen', 'Mit Klick auf \"Neue Studiengruppe anlegen\" kann eine neue Studiengruppe angelegt werden.', 'R', 0, 'A#nav_browse_new', 'dispatch.php/my_studygroups', '', 1406017730), +('19ac063e8319310d059d28379139b1cf', 3, 'Studiengruppe benennen', 'Der Name einer Studiengruppe sollte aussagekräftig sein und einmalig im gesamten Stud.IP.', 'R', 0, 'INPUT#groupname', 'dispatch.php/course/studygroup/new', '', 1405684720), +('19ac063e8319310d059d28379139b1cf', 4, 'Beschreibung hinzufügen', 'Die Beschreibung ermöglicht es weitere Informationen anzuzeigen und somit das Auffinden der Gruppe zu erleichtern.', 'R', 0, 'TEXTAREA#groupdescription', 'dispatch.php/course/studygroup/new', '', 1405684806), +('19ac063e8319310d059d28379139b1cf', 8, 'Studiengruppe speichern', 'Nach dem Speichern einer Studiengruppe erscheint diese unter \"Veranstaltungen > Meine Studiengruppen\".', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(14)', 'dispatch.php/course/studygroup/new', '', 1405686068), +('19ac063e8319310d059d28379139b1cf', 5, 'Inhaltselemente zuordnen', 'Hier können Inhaltselemente aktiviert werden, welche innerhalb der Studiengruppe zur Verfügung stehen sollen. Das Fragezeichen gibt nähere Informationen zur Bedeutung der einzelnen Inhaltselemente.', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(5)', 'dispatch.php/course/studygroup/new', '', 1405685093), +('19ac063e8319310d059d28379139b1cf', 6, 'Zugang festlegen', 'Mit diesem Drop-down-Menü kann der Zugang zur Studiengruppe eingeschränkt werden.\r\n\r\nBeim Zugang \"offen für alle\" können sich alle Studierenden frei eintragen und an der Gruppe beteiligen.\r\n\r\nBeim Zugang \"Auf Anfrage\" müssen Teilnehmer durch den Gruppengründer hinzugefügt werden.', 'R', 0, 'SELECT#groupaccess', 'dispatch.php/course/studygroup/new', '', 1405685334), +('19ac063e8319310d059d28379139b1cf', 7, 'Nutzungsbedingungen akzeptieren', 'Bei der Erstellung einer Studiengruppe müssen die Nutzungsbedingungen akzeptiert werden.', 'R', 0, 'P LABEL', 'dispatch.php/course/studygroup/new', '', 1405685652), +('edfcf78c614869724f93488c4ed09582', 6, 'Gruppen erstellen', 'Hier können die Teilnehmenden der Veranstaltung in Gruppen eingeteilt werden.', 'R', 0, 'A#nav_course_edit_groups', 'dispatch.php/course/members', '', 1405689311), +('b74f8459dce2437463096d56db7c73b9', 3, 'Veranstaltungsdetails', 'Mit Klick auf das \"i\" erscheint ein Fenster mit den wichtigsten Eckdaten der Veranstaltung.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1405931069), +('edfcf78c614869724f93488c4ed09582', 7, 'Gruppe benennen', 'Sie können in den Vorlagen nach einem passenden Gruppennamen suchen und ihn mit dem gelben Doppelpfeil auswählen. Alternativ haben Sie auch die Möglichkeit, einen neuen Gruppennamen zu bestimmen, indem Sie im rechten Feld den Namen direkt eintragen.', 'B', 0, 'SELECT', 'admin_statusgruppe.php', '', 1405689541), +('edfcf78c614869724f93488c4ed09582', 1, 'Teilnehmerverwaltung', 'Diese Tour gibt einen Überblick über die Teilnehmerverwaltung einer Veranstaltung.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'B', 0, '', 'dispatch.php/course/members', '', 1405688399), +('edfcf78c614869724f93488c4ed09582', 2, 'Personen eintragen', 'Mit diesen Funktionen können entweder einzelne Personen in Stud.IP gesucht und direkt als Lehrende, Tutor/-in oder Studierende eintragen werden. Es ist auch möglich eine Teilnehmerliste einzugeben, um viele Personen auf einmal als Tutor/-in der Veranstaltung zuzuordnen.', 'R', 0, '#layout-sidebar SECTION DIV.sidebar-widget :eq(1)', 'dispatch.php/course/members', '', 1405688707), +('edfcf78c614869724f93488c4ed09582', 4, 'Rundmail verschicken', 'Hier kann eine Rundmail an alle Teilnehmende der Veranstaltung verschickt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(3)', 'dispatch.php/course/members', '', 1406636964), +('edfcf78c614869724f93488c4ed09582', 8, 'Gruppengröße', 'Mit dem Feld \"Gruppengröße\" können Sie die maximale Anzahl der Teilnehmer einer Gruppe festlegen. Wenn Sie dies nicht benötigen, lassen Sie das Feld einfach leer.', 'B', 0, 'INPUT#role_size', 'admin_statusgruppe.php', '', 1405689763), +('edfcf78c614869724f93488c4ed09582', 9, 'Selbsteintrag', 'Wenn Sie die Funktion \"Selbsteintrag\" aktivieren, können sich die Teilnehmenden der Veranstaltung selbst in die Gruppen eintragen.', 'B', 0, 'INPUT#self_assign', 'admin_statusgruppe.php', '', 1405689852), +('edfcf78c614869724f93488c4ed09582', 10, 'Dateiordner', 'Wenn Sie die Funktion \"Dateiordner\" aktivieren, wird zusätzlich ein Dateiordner pro Gruppe neu angelegt. In diesen Ordner können gruppenspezifische Dateien hochgeladen werden.', 'B', 0, 'INPUT#group_folder', 'admin_statusgruppe.php', '', 1405689936), +('edfcf78c614869724f93488c4ed09582', 3, 'Hochstufen / Herabstufen', 'Um eine bereits eingetragene Person zum/zur Tutor/-in hochzustufen oder zum/zur LeserIn herabzustufen, wählen Sie diese Person in der Liste aus und führen Sie mit Hilfe des Dropdown-Menü die gewünschte Aktion aus.', 'T', 0, '#autor CAPTION', 'dispatch.php/course/members', '', 1405690324), +('3a717a468afb0822cb1455e0ae6b6fce', 7, 'Schlagwortwolke', 'Durch Anklicken eines Schlagwortes werden alle Beiträge aufgelistet, die dieses Schlagwort enthalten.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/profile', '', 1405508505), +('b74f8459dce2437463096d56db7c73b9', 4, 'Veranstaltungsinhalte', 'Hier werden alle Inhalte (wie z.B. ein Forum) durch entsprechende Symbole angezeigt.\r\nFalls es seit dem letzten Login Neuigkeiten gab, erscheinen diese in rot.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1405931225), +('b74f8459dce2437463096d56db7c73b9', 5, 'Verlassen der Veranstaltung', 'Ein Klick auf das Tür-Icon ermöglicht eine direkte Austragung aus der Veranstaltung.', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1405931272), +('b74f8459dce2437463096d56db7c73b9', 6, 'Zugriff auf archivierte Veranstaltungen', 'Falls Veranstaltungen archiviert sind, kann hier auf diese zugegriffen werden.', 'RT', 0, 'A#nav_browse_archive', 'dispatch.php/my_courses', '', 1405931431), +('3a717a468afb0822cb1455e0ae6b6fce', 2, 'Beitrag erstellen', 'Hier kann eine Diskussion durch Schreiben von Text begonnen werden. Absätze lassen sich durch Drücken von Umschalt+Eingabe erzeugen. Der Text wird durch Drücken von Eingabe abgeschickt.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405507478), +('b74f8459dce2437463096d56db7c73b9', 7, 'Anpassung der Veranstaltungsansicht', 'Zur Anpassung der Veranstaltungsübersicht, kann man die Veranstaltungen nach bestimmten Kriterien (wie z.B. Studienbereiche, Dozenten oder Farben) gliedern.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1405932131), +('b74f8459dce2437463096d56db7c73b9', 8, 'Zugriff auf Veranstaltung vergangener und zukünftiger Semester', 'Durch Klick auf das Drop-Down Menü können beispielsweise Veranstaltung aus vergangenen Semestern angezeigt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1405932230), +('b74f8459dce2437463096d56db7c73b9', 9, 'Weitere mögliche Aktionen', 'Hier können Sie alle Neuigkeiten als gelesen markieren, Farbgruppierungen nach Belieben ändern oder\r\nauch die Benachrichtigungen über Aktivitäten in den einzelnen Veranstaltungen anpassen.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1405932320), +('977f41c5c5239c4e86f04c3df27fae38', 1, 'Willkommen im neuen Stud.IP 3.1', 'Dies ist eine Hilfe-Tour, die die wichtigsten Neuerungen in Stud.IP vorstellt. \r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\". Eine Hilfe-Tour kann jederzeit durch einen Klick auf \"Beenden\" beendet werden.', 'TL', 0, '', 'dispatch.php/start', '', 1405932373), +('977f41c5c5239c4e86f04c3df27fae38', 2, 'Hilfelasche', 'Auf jeder Seite findet sich die Hilfe von nun an in der sogenannten Hilfelasche. Diese öffnet sich mit einem Klick auf das Fragezeichen. \r\n\r\nHier findet sich kurz und knapp zu jeder Seite die wichtigsten Informationen, Links zur ausführlichen Hilfeseite mit Anleitungsvideos und gegebenenfalls Hilfe-Touren.', 'BR', 0, 'DIV.helpbar-container .helpbar-title', 'dispatch.php/start', '', 1405932475), +('977f41c5c5239c4e86f04c3df27fae38', 3, 'Gliederung der Startseite', 'Die Startseite im neuen Stud.IP ist standardmäßig so gegliedert wie die alte Version. Neu ist, dass jedes Element (\"Widget\") individuell entfernt und verschoben werden kann. Darüber hinaus können noch weitere Widgets hinzugefügt werden. Hierzu gibt es eine separate Hilfe-Tour und die Hinweise in der Hilfe.', 'TL', 0, '', 'dispatch.php/start', '', 1405932516), +('b74f8459dce2437463096d56db7c73b9', 10, 'Studiengruppen und Einrichtungen', 'Es besteht zudem die Möglichkeit auf persönliche Studiengruppen oder Einrichtungen zuzugreifen.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1405932519), +('977f41c5c5239c4e86f04c3df27fae38', 4, 'Sidebar', 'Auf allen Seiten ist nun links die Sidebar positioniert. Sie enthält Funktionen für die aktuelle Seite.\r\nIm alten Stud.IP gab es mit der Infobox auf der rechten Seite etwas Ähnliches.', 'R', 0, 'SECTION.sidebar', 'dispatch.php/start', '', 1405932633), +('977f41c5c5239c4e86f04c3df27fae38', 5, 'Änderung der Navigation', 'Häufig ist die Reiternavigation vom alten Stud.IP nun in der Sidebar zu finden. Auf dieser Seite sind das zum Beispiel die Punkte \"Neue Nachricht schreiben\" und der Gesendet-Ordner.', 'R', 0, 'SECTION.sidebar ', 'dispatch.php/messages/overview', '', 1405932671), +('977f41c5c5239c4e86f04c3df27fae38', 6, 'Studiengruppen und Einrichtungen', 'Die Einrichtungen, die früher unter den Veranstaltungen standen und die Studiengruppen, die früher zwischen den Veranstaltungen standen, finden sich nun in eigenen Reitern wieder.', 'R', 0, '#nav_browse_my_institutes A SPAN', 'dispatch.php/my_courses', '', 1405932830), +('977f41c5c5239c4e86f04c3df27fae38', 7, 'Hinweise zu den Anmeldeverfahren', 'Im neuen Stud.IP haben sich die Zugangsberechtigungen und Anmeldeverfahren geändert. Das betrifft sowohl Studierende als auch Lehrende. Hierzu gibt es separate Feature-Touren und die Hinweise in der Hilfe.', 'TL', 0, '', 'dispatch.php/my_courses', '', 1405932890), +('3a717a468afb0822cb1455e0ae6b6fce', 1, 'Was ist Blubbern?', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen von \"Blubber\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'plugins.php/blubber/streams/profile', '', 1405507364), +('3a717a468afb0822cb1455e0ae6b6fce', 6, 'Schlagworte', 'Beiträge können mit Schlagworten (engl. \"Hashtags\") versehen werden, indem einem beliebigen Wort des Beitrags ein # vorangestellt wird.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508442), +('49604a77654617a745e29ad6b253e491', 1, 'Funktionen und Gestaltungs-möglichkeiten der Startseite', '\r\nDiese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen der \"Startseite\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/start', '', 1405934926), +('49604a77654617a745e29ad6b253e491', 2, 'Individuelle Gestaltung der Startseite', 'Die Startseite ist standardmäßig so konfiguriert, dass die Elemente \"Schnellzugriff\", \"Ankündigungen\", \"Meine aktuellen Termine\" und \"Umfragen\" angezeigt werden. Die Elemente werden Widgets genannt und können entfernt, hinzugefügt und verschoben werde.n Jedes Widget kann individuell hinzugefügt, entfernt und verschoben werden.', 'TL', 0, '', 'dispatch.php/start', '', 1405934970), +('49604a77654617a745e29ad6b253e491', 3, 'Widget hinzufügen', 'Hier können Widgets hinzugefügt werden. Zusätzlich zu den Standard-Widgets kann beispielsweise der persönliche Stundenplan auf der Startseite anzeigt werden. Neu hinzugefügte Widgets erscheinen ganz unten auf der Startseite. Darüber hinaus kann in der Sidebar direkt zu jedem Widget gesprungen werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI :eq(4)', 'dispatch.php/start', '', 1405935192), +('49604a77654617a745e29ad6b253e491', 5, 'Widget positionieren', 'Ein Widget kann per Drag&Drop an die gewünschte Position verschoben werden: Dazu wird in die Titelzeile eines Widgets geklickt, die Maustaste gedrückt gehalten und das Widget an die gewünschte Position gezogen.', 'B', 0, '.widget-header', 'dispatch.php/start', '', 1405935687), +('49604a77654617a745e29ad6b253e491', 7, 'Widget entfernen', 'Jedes Widget kann durch Klicken auf das X in der rechten oberen Ecke entfernt werden. Bei Bedarf kann es jederzeit wieder hinzugefügt werden.', 'R', 0, '.widget-header', 'dispatch.php/start', '', 1405935376), +('49604a77654617a745e29ad6b253e491', 6, 'Widget bearbeiten', 'Bei einigen Widgets wird neben dem X zum Schließen noch ein weiteres Symbol angezeigt. Der Schnellzugriff bspw. kann durch Klick auf diesen Button individuell angepasst, die Ankündigungen können abonniert und bei den aktuellen Terminen bzw. Stundenplan können Termine hinzugefügt werden.', 'L', 0, '#layout_content DIV UL DIV SPAN A IMG :eq(0)', 'dispatch.php/start', '', 1405935792), +('3629493a16bf2680de64361f07cab096', 1, 'Was ist Blubbern?', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen von \"Blubber\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'plugins.php/blubber/streams/forum', '', 1405507364), +('3a717a468afb0822cb1455e0ae6b6fce', 4, 'Personen erwähnen', 'Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405672301), +('3629493a16bf2680de64361f07cab096', 2, 'Beitrag erstellen', 'Hier kann eine Diskussion durch Schreiben von Text begonnen werden. Absätze lassen sich durch Drücken von Umschalt+Eingabe erzeugen. Der Text wird durch Drücken von Eingabe abgeschickt.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405507478), +('7cccbe3b22dfa745c17cb776fb04537c', 1, 'Hilfe-Tour \"Meine Veranstaltung\"', 'Diese Tour gibt einen Überblick über die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/my_courses', '', 1406125847), +('7cccbe3b22dfa745c17cb776fb04537c', 2, 'Veranstaltungsüberblick', 'Hier werden die Veranstaltungen des aktuellen und vergangenen Semesters angezeigt. Neue Veranstaltungen erscheinen zunächst in rot.', 'TL', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1406125908), +('7cccbe3b22dfa745c17cb776fb04537c', 3, 'Veranstaltungsdetails', 'Mit Klick auf das \"i\" erscheint ein Fenster mit den wichtigsten Eckdaten der Veranstaltung.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1406125992), +('7cccbe3b22dfa745c17cb776fb04537c', 4, 'Veranstaltungsinhalte', 'Hier werden alle Inhalte (wie z.B. ein Forum) durch entsprechende Symbole angezeigt.\r\nFalls es seit dem letzten Login Neuigkeiten gab, erscheinen diese in rot.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1406126049), +('7cccbe3b22dfa745c17cb776fb04537c', 5, 'Bearbeitung oder Löschung einer Veranstaltung', 'Der Klick auf das Zahnrad ermöglicht die Bearbeitung einer Veranstaltung.\r\nFalls bei einer Veranstaltung Teilnehmerstatus besteht, kann hier eine Austragung, durch Klick auf dasTür-Icon, vorgenommen werden.', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1406126134), +('3a717a468afb0822cb1455e0ae6b6fce', 8, 'Beitrag ändern', 'Wird der Mauszeiger auf einem beliebigen Beitrag positioniert, erscheint dessen Datum. Bei eigenen Beiträgen erscheint außerdem rechts neben dem Datum ein Icon, mit dem der Beitrag nachträglich geändert werden kann.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/profile', '', 1405507901), +('7cccbe3b22dfa745c17cb776fb04537c', 6, 'Anpassung der Veranstaltungsansicht', 'Zur Anpassung der Veranstaltungsübersicht, kann man die Veranstaltungen nach bestimmten Kriterien (wie z.B. Studienbereiche, Dozenten oder Farben) gliedern.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1406126281), +('7cccbe3b22dfa745c17cb776fb04537c', 7, 'Zugriff auf Veranstaltung vergangener und zukünftiger Semester', 'Durch Klick auf das Drop-Down Menü können beispielsweise Veranstaltung aus vergangenen Semestern angezeigt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1406126316), +('7cccbe3b22dfa745c17cb776fb04537c', 8, 'Weitere mögliche Aktionen', 'Hier können Sie alle Neuigkeiten als gelesen markieren, Farbgruppierungen nach Belieben ändern oder\r\nauch die Benachrichtigungen über Aktivitäten in den einzelnen Veranstaltungen anpassen.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1406126374), +('7cccbe3b22dfa745c17cb776fb04537c', 9, 'Studiengruppen und Einrichtungen', 'Es besteht zudem die Möglichkeit auf persönliche Studiengruppen oder Einrichtungen zuzugreifen.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1406126415), +('3a717a468afb0822cb1455e0ae6b6fce', 5, 'Datei hinzufügen', 'Dateien können in einen Beitrag eingefügt werden, indem sie per Drag&Drop in ein Eingabefeld gezogen werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508401), +('977f41c5c5239c4e86f04c3df27fae38', 8, 'Ende der Feature-Tour', 'Durch Klick auf \"Beenden\" in der Box rechts unten wird diese Tour beendet. Über die Hilfelasche lässt sich diese Tour jederzeit wieder starten.', 'TL', 0, '', 'dispatch.php/start', '', 1406539532), +('49604a77654617a745e29ad6b253e491', 4, 'Sprungmarken', 'Darüber hinaus kann mit Sprungmarken direkt zu jedem Widget gesprungen werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/start', '', 1406623464), +('3629493a16bf2680de64361f07cab096', 5, 'Datei hinzufügen', 'Dateien können in einen Beitrag eingefügt werden, indem sie per Drag&Drop in ein Eingabefeld gezogen werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508401), +('3629493a16bf2680de64361f07cab096', 6, 'Schlagworte', 'Beiträge können mit Schlagworten (engl. \"Hashtags\") versehen werden, indem einem beliebigen Wort des Beitrags ein # vorangestellt wird.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508442), +('3629493a16bf2680de64361f07cab096', 7, 'Schlagwortwolke', 'Durch Anklicken eines Schlagwortes werden alle Beiträge aufgelistet, die dieses Schlagwort enthalten.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/forum', '', 1405508505), +('3629493a16bf2680de64361f07cab096', 4, 'Personen erwähnen', 'Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405672301); +"; + DBManager::get()->exec($query); + + // add settings + $query = "INSERT IGNORE INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES +('96ea422f286fb5bbf9e41beadb484a9a', 1, 'standard'), +('25e7421f286fc5bdf9e41beadb484ffa', 1, 'standard'), +('3a717a468afb0822cb1455e0ae6b6fce', 1, 'standard'), +('21f487fa74e3bfc7789886f40fe4131a', 1, 'standard'), +('44f859c50648d3410c39207048ddd833', 1, 'standard'), +('ef5092ba722c81c37a5a6bd703890bd9', 1, 'standard'), +('6849293baa05be5bef8ff438dc7c438b', 1, 'standard'), +('b74f8459dce2437463096d56db7c73b9', 1, 'standard'), +('154e711257d4d32d865fb8f5fb70ad72', 1, 'standard'), +('19ac063e8319310d059d28379139b1cf', 1, 'standard'), +('edfcf78c614869724f93488c4ed09582', 1, 'standard'), +('977f41c5c5239c4e86f04c3df27fae38', 0, 'autostart_once'), +('49604a77654617a745e29ad6b253e491', 1, 'standard'), +('3629493a16bf2680de64361f07cab096', 1, 'standard'), +('7cccbe3b22dfa745c17cb776fb04537c', 1, 'standard'); +"; + DBManager::get()->exec($query); + } + + function addHelpContent() { + $query = "INSERT IGNORE INTO `help_content` (`content_id`, `language`, `label`, `icon`, `content`, `route`, `studip_version`, `position`, `custom`, `visible`, `author_id`, `installation_id`, `mkdate`) VALUES +('5a90d1219dbeb07c124156592fb5d877', 'de', '', '', 'In den allgemeinen Einstellungen können verschiedene Anzeigeoptionen und Benachrichtigungsfunktionen ausgewählt und verändert werden.', 'dispatch.php/settings/general', '3.1', 0, 0, 1, '', '', 1406641688), +('a202eb75df0a1da2a309ad7a4abfac59', 'de', '', '', 'In den Privatsphäre-Einstellungen kann die Sichtbarkeit und Auffindbarkeit des eigenen Profils eingestellt werden.', 'dispatch.php/settings/privacy', '3.1', 0, 0, 1, '', '', 1406641688), +('845d1ce67a62d376ec26c8ffbb22d492', 'de', '', '', 'Die Einstellungen des Nachrichtensystems bieten die Möglichkeit z.B. eine Weiterleitung der in Stud.IP empfangenen Nachrichten an die E-Mail-Adresse zu veranlassen.', 'dispatch.php/settings/messaging', '3.1', 0, 0, 1, '', '', 1406641688), +('85cbaa1648af330cc4420b57df4be29c', 'de', '', '', 'Die Einstellungen des Terminkalenders bieten die Möglichkeit, diesen an eigene Bedürfnisse anzupassen.', 'dispatch.php/settings/calendar', '3.1', 0, 0, 1, '', '', 1406641688), +('1da144f3c6f52af0566c343151a6a6ff', 'de', '', '', 'In den Benachrichtigungseinstellungen kann ausgewählt werden, bei welchen Änderungen innerhalb einer Veranstaltung eine Benachrichtigung erfolgen soll.', 'dispatch.php/settings/notification', '3.1', 0, 0, 1, '', '', 1406641688), +('01ad8998268101ad186babf43dac30a4', 'de', '', '', 'In den Standard-Vertretungseinstellungen können Lehrende eine Standard-Vertretung festlegen, die alle Veranstaltungen des Lehrenden verwalten und ändern kann.', 'dispatch.php/settings/deputies', '3.1', 0, 0, 1, '', '', 1406641688), +('1c61657979ce22a9af023248a617f6b2', 'de', '', '', 'Die Startseite wird nach dem Einloggen angezeigt und kann an persönliche Bedürfnisse mit Hilfe von Widgets angepasst werden.', 'dispatch.php/start', '3.1', 0, 0, 1, '', '', 1406641688), +('74c1da86f33f5adfb43e10220bfad238', 'de', '', '', 'Die Veranstaltungsseite zeigt alle belegten Veranstaltungen (standardmäßig nur die der letzten beiden Semester), alle belegten Studiengruppen sowie alle Einrichtungen, denen man zugeordnet wurde. Die Anzeige lässt sich über Farbgruppierungen, Semesterfilter usw. anpassen.', 'dispatch.php/my_courses', '3.1', 0, 0, 1, '', '', 1406641688), +('437c83a27473ef8139b47198101067fb', 'de', '', '', 'Hier erscheinen archivierte Veranstaltungen, denen der Nutzer zugeordnet ist. Inhalte können nicht mehr verändert, jedoch hinterlegte Dateien als zip-Datei heruntergeladen werden.', 'dispatch.php/my_courses/archive', '3.1', 0, 0, 1, '', '', 1406641688), +('04457f9a66eab07618fe502d470a9711', 'de', '', '', 'In der Übersicht finden sich veranstaltungsbezogene Kurz- und Detail-Informationen, Ankündigungen, Termine und Umfragen.', 'dispatch.php/course/overview', '3.1', 0, 0, 1, '', '', 1406641688), +('1d1323471cf21637f51284f4e6f2d135', 'de', '', '', 'Detaillierte Informationen über die Veranstaltung werden angezeigt, wie z.B. die Veranstaltungsnummer, Zuordnungen, Lehrende, Tutor/-innen etc. In den Detail-Informationen ist unter Aktionen das Eintragen in eine Veranstaltung möglich.', 'dispatch.php/course/details', '3.1', 0, 0, 1, '', '', 1406641688), +('7f4a1f5e3dfe2a459cf0eb357667d91c', 'de', '', '', 'Mit den Verwaltungsfunktionen lassen sich die Eigenschaften der Veranstaltung nachträglich ändern. Unter Aktionen ist die Simulation der Studierendenansicht möglich.', 'dispatch.php/course/management', '3.1', 0, 0, 1, '', '', 1406641688), +('4698cafeb9823735c50fd3a1745950ba', 'de', '', '', 'In den Grunddaten können Titel, Beschreibung, Lehrende etc. geändert werden. Die Bearbeitung kann teilweise gesperrt sein, wenn Daten aus anderen Systemen (z.B. LSF/ UniVZ) übernommen werden.', 'dispatch.php/course/basicdata/view', '3.1', 0, 0, 1, '', '', 1406641688), +('5fab81bbd1e19949f304df08ea21ca1b', 'de', '', '', 'Mit der Bild-Hochladen-Funktion lässt sich das Bild der Veranstaltung ändern, was Studierenden bei der Unterscheidung von Veranstaltungen auf der Meine-Veranstaltungen-Seite helfen kann.', 'dispatch.php/course/avatar/update', '3.1', 0, 0, 1, '', '', 1406641688), +('19c2bc232075602bd39efd4b6623d576', 'de', '', '', 'Mit der Studienbereiche-Funktion kann die Veranstaltung einem Studienbereich zugeordnet werden. Die Bearbeitung kann gesperrt sein, wenn Daten aus anderen Systemen (z.B. LSF/ UniVZ) übernommen werden.', 'dispatch.php/course/study_areas/show', '3.1', 0, 0, 1, '', '', 1406641688), +('70274c459a69e34bbf520e690a8e472b', 'de', '', '', 'Mit der Zeiten/Räume-Funktion können die Semester-, Termin- und Raumangaben der Veranstaltung geändert werden. Die Bearbeitung kann gesperrt sein, wenn Daten aus anderen Systemen (z.B. LSF/ UniVZ) übernommen werden.', 'raumzeit.php', '3.1', 0, 0, 1, '', '', 1406641688), +('19d47b782ac5c8b8b21bd1f94858a0fa', 'de', '', '', 'Mit Zugangsberechtigungen (Anmeldeverfahren) lässt sich z.B. durch Passwörter, Zeitsteuerung und Personenbeschränkung der Zugang zu einer Veranstaltung regulieren.', 'dispatch.php/course/admission', '3.1', 0, 0, 1, '', '', 1406641688), +('e939ac70210674f49a36ac428167a9b8', 'de', '', '', 'Mit der Umfragen-und-Tests-Funktion lassen sich (zeitgesteuerte) Umfragen oder einzelne Multiple-/Single-Choice-Fragen für Veranstaltungen, Studiengruppen oder das Profil erstellen.', 'admin_vote.php', '3.1', 0, 0, 1, '', '', 1406641688), +('2689cecba24e021f05fcece5e4c96057', 'de', '', '', 'Mit der Evaluationen-Funktion lassen sich Befragungen mit Multiple-Choice, Likert- und Freitextfragen für Veranstaltungen, Studiengruppen, das eigene Profil oder Einrichtungen erstellen. Dabei können auch öffentliche Vorlagen anderer Personen verwendet werden. Es werden alle zukünftigen, laufenden und beendeten Evaluationen angezeigt.', 'admin_evaluation.php', '3.1', 0, 0, 1, '', '', 1406641688), +('194874212676ced8d45e1883da1ad456', 'de', '', '', 'Das Forum ist eine textbasierte, zeit- und ortsunabhängige Möglichkeit zum Austausch von Fragen, Meinungen und Erfahrungen. Beiträge können abonniert, exportiert, als Favoriten gekennzeichnet und editiert werden. Über die Navigation links können unterschieldiche Ansichten (z.B. Neue Beiträge seit letztem LogIn) gewählt werden.', 'plugins.php/coreforum', '3.1', 0, 0, 1, '', '', 1406641688), +('a20036992a06e97a984832626121d99a', 'de', '', '', 'Die Personenliste zeigt eine Liste der Teilnehmenden dieser Veranstaltung. Weitere Teilnehmende können von Lehrenden hinzugefügt, entfernt, herabgestuft, heraufgestuft oder selbstdefinierten Gruppen zugeordnet werden.', 'dispatch.php/course/members', '3.1', 0, 0, 1, '', '', 1406641688), +('d79ca3bc4a8251862339b1c934504a54', 'de', '', '', 'Hier werden die selbstdefinierten Gruppen angezeigt. An diese können Nachrichten versendet werden. Ein Klick auf die orangenen Pfeile vor dem Gruppenname ordnet Sie der Gruppe zu.', 'statusgruppen.php', '3.1', 0, 0, 1, '', '', 1406641688), +('e22701c71b4425fb5a95adf725866097', 'de', '', '', 'Hier können Gruppen erstellt und verwaltet werden. Wenn der Selbsteintrag aktiviert ist, können sich Personen selbst ein- und austragen.', 'admin_statusgruppe.php', '3.1', 0, 0, 1, '', '', 1406641688), +('aa77d5ee6e0f9a9e6f4a1bbabeaf4a7e', 'de', '', '', 'Die Anwesenheitsliste zeigt alle Sitzungstermine (Sitzung, Vorlesung, Übung, Praktikum) des Ablaufplans und ermöglicht das Eintragen von Studierenden durch die Lehrenden in Stud.IP sowie einen Export der Liste zur Übersicht oder als Grundlage handschriftlicher Eintragungen.', 'participantsattendanceplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), +('ac7326260fd5ca4fa83c1154f2ffc7b9', 'de', '', '', 'Die Dateiverwaltung bietet die Möglichkeit zum Hochladen, Verlinken, Verwalten und Herunterladen von Dateien. ', 'folder.php', '3.1', 0, 0, 1, '', '', 1406641688), +('29c3bfa01ddbaaa998094d3ee975a06a', 'de', '', '', 'Der Ablaufplan zeigt Termine, Themen und Räume der Veranstaltung an. Einzelne Termine können bearbeitet werden, z.B. können Themen zu Terminen hinzugefügt werden.', 'dispatch.php/course/dates', '3.1', 0, 0, 1, '', '', 1406641688), +('c4dee277f741cfa7d5a65fa0c6bead4c', 'de', '', '', 'Hier können Termine mit Themen versehen werden oder bereits eingegebene Themen übernommen und bearbeitet werden.', 'dispatch.php/course/topics', '3.1', 0, 0, 1, '', '', 1406641688), +('c01725d6a3da568e1b07aee4e68a7e1f', 'de', '', '', 'Diese Seite ermöglicht das Hinterlegen von freien Informationen, Links etc.', 'dispatch.php/course/scm', '3.1', 0, 0, 1, '', '', 1406641688), +('be204bdd0fce91702f51597bf8428fba', 'de', '', '', 'Das Wiki ermöglicht ein gemeinsames, asynchrones Erstellen und Bearbeiten von Texten. Texte lassen sich formatieren und miteinander verknüpfen, so dass ein verzweigtes Nachschlagewerk entsteht. ', 'wiki.php', '3.1', 0, 0, 1, '', '', 1406641688), +('707b0db0e45fc3bab04be7eff38c1d32', 'de', '', '', 'Die Literaturseite bietet Lehrenden die Möglichkeit, Literaturlisten zu erstellen oder aus Literaturverwaltungsprogrammen zu importieren. Diese Listen können in Lehrveranstaltungen kopiert und sichtbar geschaltet werden. Je nach Anbindung kann im tatsächlichen Buchbestand der Hochschule recherchiert werden. ', 'dispatch.php/course/literature', '3.1', 0, 0, 1, '', '', 1406641688), +('8dd3b80d9f95218d67edc3cb570559ff', 'de', '', '', 'Hier lassen sich Literaturlisten bearbeiten und in der Veranstaltung sichtbar schalten (mit Klick auf das \"Auge\").', 'dispatch.php/literature/edit_list', '3.1', 0, 0, 1, '', '', 1406641688), +('e29098d188ae25c298d78978de50bf09', 'de', '', '', 'Hier kann in Katalogen nach Literatur gesucht und diese zur Merkliste hinzugefügt werden.', 'dispatch.php/literature/search', '3.1', 0, 0, 1, '', '', 1406641688), +('a1ea37130799a59f7774473f1a681141', 'de', '', '', 'Die Lernmodulschnittstelle ermöglicht es, Selbstlerneinheiten oder Tests aus externen Programmen wie ILIAS und LON-CAPA in Stud.IP zur Verfügung zu stellen.', 'dispatch.php/course/elearning/show', '3.1', 0, 0, 1, '', '', 1406641688), +('595c46d86f681f7da4bd2fae780db618', 'de', '', '', 'Wählen Sie das gewünschte System und anschließend das Lernmodul/ den Test aus. Schreibrechte bestimmen, wer zukünftig das Lernmodul bearbeiten darf. In der Sidebar befindet sich die Option \"Zuordnungen aktualisieren\", um geänderte Inhalte z.B. im ILIAS Kurs zu Stud.IP zu übertragen.', 'dispatch.php/course/elearning/edit', '3.1', 0, 0, 1, '', '', 1406641688), +('6529fd70b461fa4a9242e874fbf2a5d3', 'de', '', '', 'In DoIT! haben Lehrende die Möglichkeit, verschiedene Arten von Aufgaben zu stellen, inklusive Hochladen von Dateien, Multiple-Choice-Fragen und Peer Reviewing. Die Aufgabenbearbeitung kann zeitlich befristet werden und wahlweise in Gruppen erfolgen.', 'plugins.php/reloadedplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), +('95ff3a2a68dae73bcb14a4a538a8e4b5', 'de', '', '', 'Blubbern ist eine Mischform aus Forum und Chat, bei dem Beiträge der Teilnehmenden in Echtzeit angezeigt werden. Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'plugins.php/blubber/streams/forum', '3.1', 0, 0, 1, '', '', 1406641688), +('633dab120ce3969c42f33aeb3a59fcc1', 'de', '', '', 'Der Gruppenkalender bietet eine Übersicht über Veranstaltungstermine und personalisierte Zusatztermine für diese Veranstaltung. ', 'plugins.php/gruppenkalenderplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), +('1058f03da5b6fc6a5ff3a08c9c1fa5f7', 'de', '', '', 'Hier können der Veranstaltung weitere Funktionen hinzugefügt werden.', 'dispatch.php/course/plus', '3.1', 0, 0, 1, '', '', 1406641688), +('8a1d7d04c70d93be44e8fe6a8e8c3443', 'de', '', '', 'Das Lerntagebuch unterstützt den selbstgesteuerten Lernprozess der Studierenden und wird von ihnen selbstständig geführt. Anfragen zu Arbeitsschritten an die Lehrenden sind möglich, bestimmte Daten können individualisiert freigegeben werden.', 'plugins.php/lerntagebuchplugin/overview', '3.1', 0, 0, 1, '', '', 1406641688), +('72cec29d985f3e6d7df2b5fabb7fe666', 'de', '', '', 'Konfiguation des Lerntagebuchs für Studierende und Anlegen eines Lerntagebuchs für die Lehrenden.', 'plugins.php/lerntagebuchplugin/admin_settings', '3.1', 0, 0, 1, '', '', 1406641688), +('2fcc672d91f2627ab5ca48499e8b1617', 'de', '', '', 'Möglichkeit zur Bereitstellung von Vorlesungsaufzeichnungen und Podcasts für Studierende der Veranstaltung (durch Verlinkung auf die Dateien auf dem Medienserver). ', 'plugins.php/mediacastsplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), +('bd0770f9eef5c10fc211114ac35fbe9b', 'de', '', '', 'Diese Seite zeigt die Studiengruppen an, denen die/der NutzerIn zugeordnet ist. Studiengruppen sind eine einfache Möglichkeit, mit Mitstudierenden, KollegInnen und anderen zusammenzuarbeiten. Jede/r NutzerIn kann Studiengruppen anlegen oder nach ihnen suchen. Die Farbgruppierung kann individuell angepasst werden.', 'dispatch.php/my_studygroups', '3.1', 0, 0, 1, '', '', 1406641688), +('82a17a5f19d211268b1fa90a1ebe0894', 'de', '', '', 'Hier kann eine neue Studiengruppe angelegt werden. Jede/r Stud.IP-NutzerIn kann Studiengruppen anlegen und nach eigenen Bedürfnissen konfigurieren.', 'dispatch.php/course/studygroup/new', '3.1', 0, 0, 1, '', '', 1406641688), +('e03cec310c0a884aee80c2d1eea3a53e', 'de', '', '', 'Diese Seite zeigt alle Studiengruppen an, die in Stud.IP existieren. Studiengruppen sind eine einfache Möglichkeit, mit Mitstudierenden, KollegInnen und anderen zusammenzuarbeiten. Jede/r NutzerIn kann Studiengruppen anlegen oder nach ihnen suchen.', 'dispatch.php/studygroup/browse', '3.1', 0, 0, 1, '', '', 1406641688), +('f92b5422246f585f051de1a81602dd56', 'de', '', '', 'Hier können Name, Funktionen und Zugangsbeschränkung der Studiengruppe bearbeitet werden.', 'dispatch.php/course/studygroup/edit', '3.1', 0, 0, 1, '', '', 1406641688), +('1dca5b0b83f7bca92ec4add50d34b8c5', 'de', '', '', 'Hier können der Studiengruppe Mitglieder hinzugefügt und Nachrichten an diese versendet werden.', 'dispatch.php/course/studygroup/members', '3.1', 0, 0, 1, '', '', 1406641688), +('1f6e2f98affbffb1d12904355e9313e5', 'de', '', '', 'Diese Seite zeigt die Einrichtungen an, denen die/der NutzerIn zugeordnet ist.', 'dispatch.php/my_institutes', '3.1', 0, 0, 1, '', '', 1406641688), +('bf9eb8f2c3842865009342b89fd35476', 'de', '', '', 'Die Nachrichtenseite bietet einen Überblick über erhaltene, systeminterne Nachrichten, welche mit selbstgewählten Schlüsselwörtern (sog. Tags) versehen werden können, um sie später leichter wieder auffinden zu können.', 'dispatch.php/messages/overview', '3.1', 0, 0, 1, '', '', 1406641688), +('6acc653cfabd3a0d4433ff0ab417bf6a', 'de', '', '', 'Übersicht über gesendete, systeminterne Nachrichten, welche mit selbstgewählten Schlüsselwörtern (sog. Tags) versehen werden können, um sie später leichter wieder auffinden zu können. ', 'dispatch.php/messages/sent', '3.1', 0, 0, 1, '', '', 1406641688), +('690e6eff3e83a5f372ec99fc49cafeb2', 'de', '', '', 'Blubbern ist das Stud.IP Echtzeitforum, eine Mischform aus Forum und Chat. Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden. Texte lassen sich formatieren und durch Smileys ergänzen.', 'plugins.php/blubber/streams/global', '3.1', 0, 0, 1, '', '', 1406641688), +('cd69b74cd46172785bf2147fb0582e3c', 'de', '', '', 'Hier kann ein benutzerdefinierter Blubber-Stream erstellt werden. Er besteht immer aus einer Sammlung von Beiträgen aus ausgewählten Veranstaltungen, Kontaktgruppen und Schlagwörten, die auf Basis einer Filterung noch weiter eingeschränkt werden können. Der neue benutzerdefinierte Stream findet sich nach dem Klick auf den Speichern-Button in der Navigation unter Globaler Stream.', 'plugins.php/blubber/streams/edit', '3.1', 0, 0, 1, '', '', 1406641688), +('394a45f94e1d84d3744027a5a69d9e3e', 'de', '', '', 'Auf dieser Seite lässt sich einsehen, welche Kontakte gerade online sind. Diesen Personen kann eine Nachricht geschickt werden. Das Klicken auf den Namen einer Person leitet zu deren Profil weiter.', 'dispatch.php/online', '3.1', 0, 0, 1, '', '', 1406641688), +('245ce01d7a0175ab0b977ae822821e9e', 'de', '', '', 'Diese Seite bietet die Möglichkeit Stud.IP-Nutzende in das eigene Adressbuch einzutragen und alle bereits im Adressbuch befindlichen Kontakte aufzulisten.', 'contact.php', '3.1', 0, 0, 1, '', '', 1406641688), +('752d441cd321b05c55c8a5d9aa48ddce', 'de', '', '', 'Auf dieser Seite können Kontakte aus dem Adressbuch in selbstdefinierte Gruppen sortiert werden.', 'contact_statusgruppen.php', '3.1', 0, 0, 1, '', '', 1406641688), +('94a193baa212abbc9004280a1498e724', 'de', '', '', 'Hier können Kontaktgruppen oder das gesamte Adressbuch exportiert werden, um sie in einem externen Programm importieren zu können.', 'contact_export.php', '3.1', 0, 0, 1, '', '', 1406641688), +('7ebdd278d06f9fc1d2659a54bb3171c1', 'de', '', '', 'Die Rangliste sortiert die Stud.IP-Nutzenden absteigend anhand ihrer Punktzahl. Die Punktzahl wächst mit den Aktivitäten in Stud.IP und repräsentiert so die Erfahrung der Nutzenden mit dem System. Indem das Kästchen links mit einem Haken versehen wird, wird der eigene Wert für andere NutzerInnen in der Rangliste sichtbar gemacht. In der Grundeinstellung ist der eigene Wert nicht öffentlich sichtbar.', 'dispatch.php/score', '3.1', 0, 0, 1, '', '', 1406641688), +('82537b14dd3714ec9636124ed5af3272', 'de', '', '', 'Die Profilseite ermöglicht die Änderung der eigenen perönlichen Angaben inkl. Profilbild und Kategorien. Ähnlich wie in Facebook können Kommentare hinterlassen werden. Das Profil von Lehrenden enthält Sprechstunden und Raumangaben. Daneben bietet die Seite die Verwaltung eigener Dateien.', 'dispatch.php/profile', '3.1', 0, 0, 1, '', '', 1406641688), +('ebb5bc1d831d460c06e3c6662236c159', 'de', '', '', 'Hier kann ein Profilbild hochgeladen werden.', 'dispatch.php/settings/avatar', '3.1', 0, 0, 1, '', '', 1406641688), +('25255dc15fd0d6260bc1abd1f10aecc5', 'de', '', '', 'Individuelle persönliche Angaben, wie bspw. E-Mail-Adresse, können auf dieser Seite verändert und angepasst werden. ', 'dispatch.php/settings/account', '3.1', 0, 0, 1, '', '', 1406641688), +('d704267767d4c559aa9e552be60c49b5', 'de', '', '', 'Hier kann das Passwort für den Stud.IP-Account geändert werden.', 'dispatch.php/settings/password', '3.1', 0, 0, 1, '', '', 1406641688), +('cbd9b2b22fc00bc92df3589018644b70', 'de', '', '', 'Hier können vordefinierte Informationen über die eigene Person eingegeben werden, die auf der Profilseite erscheinen sollen. ', 'dispatch.php/settings/details', '3.1', 0, 0, 1, '', '', 1406641688), +('4e60dd9635f3d3fddecc78e0d1f646c7', 'de', '', '', 'Unter \"Studiendaten\" können manuell zusätzliche Studiengänge und Einrichtungen hinzugefügt werden, wenn sie nicht automatisch aus einem externen System (z.B. LSF/ UniVZ) übernommen wurden.', 'dispatch.php/settings/studies', '3.1', 0, 0, 1, '', '', 1406641688), +('462f1447b1a8a93ab7bdb2524f968b1a', 'de', '', '', 'Hier kann die Zugehörigkeit zu Nutzerdomänen eingesehen, aber nicht geändert werden.', 'dispatch.php/settings/userdomains', '3.1', 0, 0, 1, '', '', 1406641688), +('233564d01b8301ebec7ef2fe918d1290', 'de', '', '', 'Ansicht über die der/ dem Stud.IP-NutzerIn zugeordneten Einrichtungen.', 'dispatch.php/settings/statusgruppen', '3.1', 0, 0, 1, '', '', 1406641688), +('e315a4c547be7f17d427b227f0f9d982', 'de', '', '', 'Auf dieser Seite können selbstdefinierte Informationen über die eigene Person eingegeben werden, die auf der Profilseite erscheinen sollen. ', 'dispatch.php/settings/categories', '3.1', 0, 0, 1, '', '', 1406641688), +('ac5df1de9c75fc92af7718b2103d3037', 'de', '', '', 'Blubbern ist eine Mischform aus Forum und Chat. Nachrichten werden im öffentlichen Stream dargestellt. Andere Nutzer können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'plugins.php/blubber/streams/profile', '3.1', 0, 0, 1, '', '', 1406641688), +('4151003175042b71bea3529e5adc5a9e', 'de', '', '', 'Mit der Terminvergabe können Termine für Sprechstunden, Prüfungen usw. angelegt werden, in die sich Studierende selbst eintragen können.', 'plugins.php/homepageterminvergabeplugin/showadmin', '3.1', 0, 0, 1, '', '', 1406641688), +('63c2ecb12f30816aef0fb203eab4f40a', 'de', '', '', 'Hier können Termine angelegt und bearbeitet werden.', 'plugins.php/homepageterminvergabeplugin/show_category', '3.1', 0, 0, 1, '', '', 1406641688), +('164f77ab2cb7d38fd1ea20ed725834fd', 'de', '', '', 'Hier findet sich eine Übersicht über die Termine, die von Studierenden gebucht wurden.', 'plugins.php/homepageterminvergabeplugin/show_bookings', '3.1', 0, 0, 1, '', '', 1406641688), +('1289e991a93dce5a0b4edd678514325e', 'de', '', '', 'Hier können einzelne Inhaltselemente nachträglich aktiviert oder deaktiviert werden. Aktivierte Inhaltselemente fügen neue Funktionen zu Ihrem Profil oder Ihren Einstellungen hinzu. Diese werden meist als neuer Reiter im Menü erscheinen. Wenn Funktionalitäten nicht benötigt werden, können diese hier deaktiviert werden. Die entsprechenden Menüpunkte werden dann ausgeblendet.', 'dispatch.php/profilemodules', '3.1', 0, 0, 1, '', '', 1406641688), +('b677e8b5f1bd7e8acbe474177449c4e1', 'de', '', '', 'Die Dateiverwaltung bietet die Möglichkeit zum Hochladen, Verwalten und Herunterladen persönlicher Dateien, die nicht für andere einsehbar sind. ', 'dispatch.php/document/files', '3.1', 0, 0, 1, '', '', 1406641688), +('35b1860b95854a2533b6ecfbbf04ab71', 'de', '', '', 'Der Stundenplan besteht aus belegten Veranstaltungen, die ein- und ausgeblendet sowie in Darstellungsgröße und -form angepasst werden können.', 'dispatch.php/calendar/schedule', '3.1', 0, 0, 1, '', '', 1406641688), +('db5a995bd12ba8e2ae96adcabeb8c8f7', 'de', '', '', 'Der Terminkalender besteht aus belegten Veranstaltungen und eigenen Terminen. Er kann bearbeitet, in der Anzeige verändert und mit externen Programmen (z.B. Outlook) abgeglichen werden. ', 'calendar.php', '3.1', 0, 0, 1, '', '', 1406641688), +('87489a40097e5c26f1d1349c072610de', 'de', '', '', 'Mit der Veranstaltungssuche können Veranstaltungen, Studiengruppen usw. in verschiedenen Semestern und nach verschiedenen Suchkriterien (siehe \"Erweiterte Suche anzeigen\"in der Sidebar) gefunden werden. Das aktuelle Semester ist vorgewählt.', 'dispatch.php/search/courses', '3.1', 0, 0, 1, '', '', 1406641688), +('74863847eec53a3d4c8264d8de526be8', 'de', '', '', 'Mit der Archivsuche können Veranstaltungen gefunden werden, die bereits archiviert wurden.', 'archiv.php', '3.1', 0, 0, 1, '', '', 1406641688), +('14b77e9e0b7773c92db9e7344a23fcfc', 'de', '', '', 'Mit der Personensuche können NutzerInnen gefunden werden, solange deren Privatsphäre-Einstellung dies nicht verhindert. Die Suche kann auf bestimmte Veranstaltungen oder Einrichtungen begrenzt werden.', 'browse.php', '3.1', 0, 0, 1, '', '', 1406641688), +('4f9d79fe88e81486b8c1f192d70232d5', 'de', '', '', 'Mit der Einrichtungssuche können Einrichtungen über ein freies Suchfeld oder den Einrichtungsbaum gefunden werden.', 'institut_browse.php', '3.1', 0, 0, 1, '', '', 1406641688), +('014a2106d384c0ca55d9311597029ca0', 'de', '', '', 'Mit der Ressourcensuche können universitäre Ressourcen wie Räume, Gebäude etc. gefunden werden.', 'resources.php', '3.1', 0, 0, 1, '', '', 1406641688), +('60b6caf75d0004dfdb0a1adfd66027ed', 'de', '', '', 'Hier können Lehrende Ankündigungen für ihre Veranstaltungen, Einrichtungen und ihre Profilseite erstellen und anzeigen, wobei die Anzeige gefiltert werden kann.', 'dispatch.php/news/admin_news', '3.1', 0, 0, 1, '', '', 1406641688), +('f3deb7a01205637d71a66e2b90b24cba', 'de', '', '', 'Hier können RSS-Feeds, d.h. Nachrichtenströme von externen Internetseiten, auf der Startseite eingebunden werden. Je mehr Feeds eingebunden werden, desto länger dauert das Laden der Startseite.', 'dispatch.php/admin/rss_feeds', '3.1', 0, 0, 1, '', '', 1406641688), +('bc1d6ecab9364cfe2c549d262bfda437', 'de', '', '', 'Die Lernmodulschnittstelle ermöglicht es, Selbstlerneinheiten aus externen Programmen wie ILIAS und LON-CAPA in Stud.IP zur Verfügung zu stellen. Für jedes externe System wird ein eigener Benutzer-Account erstellt oder zugeordnet. Mit den entsprechenden Rechten können eigene Lernmodule erstellt werden.', 'dispatch.php/elearning/my_accounts', '3.1', 0, 0, 1, '', '', 1406641688), +('d1de152db139d8c12552610d2f7999c2', 'de', '', '', 'Mit dem Export können Daten über Veranstaltungen und MitarbeiterInnen in folgende Formate exportiert werden: RTF, TXT, CSV, PDF, HTML und XML.', 'export.php', '3.1', 0, 0, 1, '', '', 1406641688), +('2c55eab1f52d6f7d1021880836906f5b', 'de', '', '', 'Hier lassen sich Literaturlisten bearbeiten und in der Veranstaltung sichtbar schalten (mit Klick auf das \"Auge\").', 'dispatch.php/literature/edit_list.php', '3.1', 0, 0, 1, '', '', 1406641688); +"; + DBManager::get()->exec($query); + } + + function addHelpContentEN() { + $query = " +INSERT INTO `help_content` (`content_id`, `language`, `label`, `icon`, `content`, `route`, `studip_version`, `position`, `custom`, `visible`, `author_id`, `installation_id`, `mkdate`) VALUES +('c8e789a0efb73f00f00dacf565524c73', 'en', '', '', 'Various display options and notification features can be selected and changed in the general settings.', 'dispatch.php/settings/general', '3.1', 0, 0, 1, '', '', 1412942388), +('f5e59c4fc98e1df7fe29b8e9320853e7', 'en', '', '', 'The visibility and searchability for the own profile can be set in the privacy settings.', 'dispatch.php/settings/privacy', '3.1', 0, 0, 1, '', '', 1412942388), +('3b7a4c04017fef2984ee029610194f26', 'en', '', '', 'The settings of the message system offer the possibility e.g. to arrange for a forwarding of the messages received in Stud.IP to your e-mail address.', 'dispatch.php/settings/messaging', '3.1', 0, 0, 1, '', '', 1412942388), +('260ee12fdc7dccb30eca2cc075ef0096', 'en', '', '', 'The settings of the diary offer the possibility to adjust these to own needs .', 'dispatch.php/settings/calendar', '3.1', 0, 0, 1, '', '', 1412942388), +('43df8e33145c25eb6d941e4e845ada24', 'en', '', '', 'In the notification settings it is possible to select with which changes within a course notification is to be given.', 'dispatch.php/settings/notification', '3.1', 0, 0, 1, '', '', 1412942388), +('85c000e33732c5596d198776cb884860', 'en', '', '', 'In the standard substitution settings lecturers can stipulate a standard substitution, which can manage and change all courses of the lecturer.', 'dispatch.php/settings/deputies', '3.1', 0, 0, 1, '', '', 1412942388), +('b05b27450e363c38c6b4620b902b3496', 'en', '', '', 'The start page will be displayed after the log-in and can be customised to personal needs by using widgets.', 'dispatch.php/start', '3.1', 0, 0, 1, '', '', 1412942388), +('91d6f451c3ef8d8352a076773b0a19ee', 'en', '', '', 'The course page shows all subscribed courses (as a standard only those of the last two semesters), all subscribed study groups as well as all institutions, to which one was allocated. You can customise the display through colour groupings, semester filters, etc. ', 'dispatch.php/my_courses', '3.1', 0, 0, 1, '', '', 1412942388), +('0237ea35a203be81e44c979d82ef5ee6', 'en', '', '', 'Archived courses to which the user is allocated appear here. Contents can no longer be changed, however deposited documents can be downloaded as a zip file.', 'dispatch.php/my_courses/archive', '3.1', 0, 0, 1, '', '', 1412942388), +('d97eff1196f6aed8e94f7c5096ebd2a9', 'en', '', '', 'Course-related brief and detailed information, announcements, dates and surveys can be found in the overview.', 'dispatch.php/course/overview', '3.1', 0, 0, 1, '', '', 1412942388), +('357bbf06015b2738aae15837f581a07d', 'en', '', '', 'More detailed information about the course is displayed, such as e.g. the course number, allocations, lecturers, tutors, etc. In the detailed information it is possible to register for a course under actions.', 'dispatch.php/course/details', '3.1', 0, 0, 1, '', '', 1412942388), +('0c055cc6ae418a96ff3afa9db13098df', 'en', '', '', 'The properties of the course can be subsequently changed with the management functions. The simulation of the students view is possible under actions.', 'dispatch.php/course/management', '3.1', 0, 0, 1, '', '', 1412942388), +('615c1887f0ee080043f133681ebf0def', 'en', '', '', 'Title, description, lecturer, etc. can be changed in the basic data. The processing can partly be blocked if data are taken over from other systems (e.g. LSF/ UniVZ).', 'dispatch.php/course/basicdata/view', '3.1', 0, 0, 1, '', '', 1412942388), +('abfb5d03de288d02df436f9a8bb96d9d', 'en', '', '', 'The photo of the course, which can help students to distinguish between courses on the \"my courses\" page, can be changed with the photo-upload-function.', 'dispatch.php/course/avatar/update', '3.1', 0, 0, 1, '', '', 1412942388), +('eec46c5d8ea5523d959a8c334455c2ef', 'en', '', '', 'The course can be allocated to a field of study by using the field of study function. The processing can be blocked if data are taken over from other systems (e.g. LSF/ UniVZ).', 'dispatch.php/course/study_areas/show', '3.1', 0, 0, 1, '', '', 1412942388), +('85c709de75085bd56a739e4e8ac6fcad', 'en', '', '', 'The semester, date and room details of the course can be changed by using the time/room function. The processing can be blocked if data are taken over from other systems (e.g. LSF/ UniVZ).', 'raumzeit.php', '3.1', 0, 0, 1, '', '', 1412942388), +('4e14c94cda99e2ef6462f7fef06d9c91', 'en', '', '', 'The access to a course can be regulated with access authorisations (enrolment procedure) e.g. by passwords, time control and restriction to participants.', 'dispatch.php/course/admission', '3.1', 0, 0, 1, '', '', 1412942388), +('42060187921376807f90e52fad5f9822', 'en', '', '', '(Time-controlled) surveys or individual Multiple-/Single-Choice questions can be set up for courses, study groups or the profile by using the survey and test function.', 'admin_vote.php', '3.1', 0, 0, 1, '', '', 1412942388), +('5475d65b07fdaf5f234bf6eed3d5e4a9', 'en', '', '', 'With the evaluation function surveys can be set up with Multiple-Choice, Likert and free text questions for courses, study groups, the own profile or institutions. Public templates of other persons can be used hereby. All future, ongoing and ended evaluations are displayed.', 'admin_evaluation.php', '3.1', 0, 0, 1, '', '', 1412942388), +('80286432bf17df20e5f11f86b421b0a7', 'en', '', '', 'The forum is a text-based possibility, which is irrespective of time and place, to exchange questions, opinions and experience. Contributions can be subscribed to, exported, marked as favourites and edited. Various views (e.g. new contributions since the last login) can be chosen via the navigation links.', 'plugins.php/coreforum', '3.1', 0, 0, 1, '', '', 1412942388), +('3607d6daea679dcd7003e076fdd1660a', 'en', '', '', 'The list of participants shows a list of the participants of this course. Further participants can be added, removed, downgraded, upgraded or allocated to self-defined groups by lecturers.', 'dispatch.php/course/members', '3.1', 0, 0, 1, '', '', 1412942388), +('f529bca4d1626b43cbb8149feea41a84', 'en', '', '', 'The self-defined groups are displayed here. Messages can be sent to these. A click on the orange arrows before the group name will allocate you to the group.', 'statusgruppen.php', '3.1', 0, 0, 1, '', '', 1412942388), +('bd5df4fb7b84da79149c96c5f43de46c', 'en', '', '', 'Groups can be set up and managed here. If the self-entry is activated participants can enter and remove themselves.', 'admin_statusgruppe.php', '3.1', 0, 0, 1, '', '', 1412942388), +('8c2fc90bd8175e6d598f895944a8ddc2', 'en', '', '', 'The attendance list shows all meetings (meeting, lecture, exercise, internship) of the schedule and enables the entry of students in Stud.IP by the lecturers as well as an export of the list for the overview or as a basis for handwritten entries.', 'participantsattendanceplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), +('ee91ec0f9085221ada06d171a27d2405', 'en', '', '', 'The document administration offers the possibility to upload, link, administer and download documents. ', 'folder.php', '3.1', 0, 0, 1, '', '', 1412942388), +('8c3067596811d3c6857d253299e01f6f', 'en', '', '', 'The schedule displays dates, topics and rooms of the course. Individual dates can be edited, e.g. topics can be added to dates.', 'dispatch.php/course/dates', '3.1', 0, 0, 1, '', '', 1412942388), +('1f216fe42d879c3fcbb582d67e9ad5a2', 'en', '', '', 'Dates can be allocated topics here or already entered topics can be taken over and edited.', 'dispatch.php/course/topics', '3.1', 0, 0, 1, '', '', 1412942388), +('abaa7b076e6923ac43120f3326322af0', 'en', '', '', 'This page enables the deposit of free information, links, etc.', 'dispatch.php/course/scm', '3.1', 0, 0, 1, '', '', 1412942388), +('7edc08f2f7b0786ca036f8c448441e07', 'en', '', '', 'The Wiki enables a joint, asynchronous creation and editing of texts. Texts can be formatted and linked with each other so that a branched reference work is produced. ', 'wiki.php', '3.1', 0, 0, 1, '', '', 1412942388), +('44edb997707d1458cbf8a3f8f316b908', 'en', '', '', 'The bibliography page offers lecturers the possibility to create bibliographies or to import these from bibliography management programmes. These lists can be copied and placed visibly in courses. Research can be conducted in the actual book stocks of the university depending on the connection. ', 'dispatch.php/course/literature', '3.1', 0, 0, 1, '', '', 1412942388), +('1cb8fd77427ebc092d751eea95454b0a', 'en', '', '', 'Bibliographies can be edited here and placed visibly in the course (with a click on the \"eye\").', 'dispatch.php/literature/edit_list', '3.1', 0, 0, 1, '', '', 1412942388), +('b283b58820db358284f4451dfb691678', 'en', '', '', 'A search can be conducted for literature in catalogues here and these added to the clipboard.', 'dispatch.php/literature/search', '3.1', 0, 0, 1, '', '', 1412942388), +('0d83ce036f2870f873446230c0118bb7', 'en', '', '', 'The learning module interface makes it possible for self-learning units or tests to be made available from external programmes such as ILIAS and LON-CAPA in Stud.IP.', 'dispatch.php/course/elearning/show', '3.1', 0, 0, 1, '', '', 1412942388), +('8b690f942bf0cc0322e5bea0f1b9abed', 'en', '', '', 'Select the requested system and subsequently the learning module/ the test. Writing rights determine who may edit the learning module in future. The option \"update allocations\" is located in the sidebar in order to transfer changed contents e.g. in the ILIAS course to Stud.IP.', 'dispatch.php/course/elearning/edit', '3.1', 0, 0, 1, '', '', 1412942388), +('0838a96b5678e2fc26be0ee38ae67619', 'en', '', '', 'In DoIT! lecturers have the possibility to set various types of tasks, including the uploading of files, Multiple-Choice questions and Peer Reviewing. The processing of tasks can be time limited and alternatively carried out in groups.', 'plugins.php/reloadedplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), +('1804e526c2f6794b877a4b2096eaa67a', 'en', '', '', 'Blubbering is a mixed form of forum and chat, with which contributions of the participants are displayed in real time. Others can be informed about a contribution by the fact that they are mentioned in the contribution by @user name or @''first name''.', 'plugins.php/blubber/streams/forum', '3.1', 0, 0, 1, '', '', 1412942388), +('38d1a86517eb6cc195b2e921270c3035', 'en', '', '', 'The group calendar offers an overview of course dates and personalised additional dates for this course. ', 'plugins.php/gruppenkalenderplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), +('852991dc733639dd2df05fb627abf3db', 'en', '', '', 'Further features can be added to the course here.', 'dispatch.php/course/plus', '3.1', 0, 0, 1, '', '', 1412942388), +('1ea099717ceb1b401aedcedc89814d9c', 'en', '', '', 'The learning diary supports the self-controlled learning process of the students and is kept independently by them. Enquiries for work steps to the lecturers are possible, certain data can be released individualised.', 'plugins.php/lerntagebuchplugin/overview', '3.1', 0, 0, 1, '', '', 1412942388), +('2075fe42f56207fbd153a810188f1beb', 'en', '', '', 'Configuration of the learning diary for students and creation of a learning diary for the lecturers.', 'plugins.php/lerntagebuchplugin/admin_settings', '3.1', 0, 0, 1, '', '', 1412942388), +('7465a4aeedb6a320d3455cf9ad0bebd0', 'en', '', '', 'Possibility for providing lecture recordings and pod casts for students of the course (by linking to the documents on the media server). ', 'plugins.php/mediacastsplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), +('02b4e3ce7b8fe6b3e6a3586d410a51a1', 'en', '', '', 'This page displays the study groups to which the user is allocated. Study groups are a simple possibility to cooperate with fellow students, colleagues and others. Each user can create study groups or search for them. The colour grouping can be adjusted individually.', 'dispatch.php/my_studygroups', '3.1', 0, 0, 1, '', '', 1412942388), +('af7573cce1e898054db89a96284866f9', 'en', '', '', 'A new study group can be created here. Each Stud.IP user can create study groups and configure these according to own needs.', 'dispatch.php/course/studygroup/new', '3.1', 0, 0, 1, '', '', 1412942388), +('960d7bafb618853eced1b1b42a7dd412', 'en', '', '', 'This page displays all study groups, which exist in Stud.IP. Study groups are a simple possibility to cooperate with fellow students, colleagues and others. Each user can create study groups or search for them.', 'dispatch.php/studygroup/browse', '3.1', 0, 0, 1, '', '', 1412942388), +('3d040e95a8c29e733a8d5439ee9f5b59', 'en', '', '', 'The name, functions and access restriction of the study group can be edited here.', 'dispatch.php/course/studygroup/edit', '3.1', 0, 0, 1, '', '', 1412942388), +('b3bd33cb0babbb0cc51a4f429d15d438', 'en', '', '', 'Here you can add new memebers to the study group und send them messages.', 'dispatch.php/course/studygroup/members', '3.1', 0, 0, 1, '', '', 1412942388), +('438c4456f85afec29fd9f47c111136c1', 'en', '', '', 'This page displays the institutions to which the user is allocated.', 'dispatch.php/my_institutes', '3.1', 0, 0, 1, '', '', 1412942388), +('f966e348174927565b94e606bbcf064f', 'en', '', '', 'The message page offers an overview on received, system-internal messages, which can be issued with self-chosen key words (so-called tags) in order to subsequently be able to find them easier.', 'dispatch.php/messages/overview', '3.1', 0, 0, 1, '', '', 1412942388), +('ceb21257092b11dcf6897d5bb3085642', 'en', '', '', 'Overview on sent, system-internal messages, which can be issued with self-chosen key words (so-called \"tags\") in order to subsequently be able to find them easier. ', 'dispatch.php/messages/sent', '3.1', 0, 0, 1, '', '', 1412942388), +('b9586c280a0092f86f9392fe5b5ff2a0', 'en', '', '', 'Blubbering is the Stud.IP real time forum, a mixed form of forum and chat. Others can be informed about a contribution by the fact that they are mentioned in the contribution by @user name or @''first name''. Texts can be formatted and supplemented by Smileys.', 'plugins.php/blubber/streams/global', '3.1', 0, 0, 1, '', '', 1412942388), +('7cb7026818c4b90935009d0548300674', 'en', '', '', 'A user-defined blubber stream can be created here. It always consists of a collection of contributions from selected courses, contact groups and key words, which can be restricted even further based on a filtering. The new user-defined stream can be found after clicking on the save button in the navigation under global stream.', 'plugins.php/blubber/streams/edit', '3.1', 0, 0, 1, '', '', 1412942388), +('2f1602394a4e31c2e30706f0a0b3112f', 'en', '', '', 'On this page it can be viewed which contacts are online at the moment. A message can be sent to these persons. The clicking on the name of one person forwards to their profile.', 'dispatch.php/online', '3.1', 0, 0, 1, '', '', 1412942388), +('27c4d9837cfb1a9a40c079e16daac902', 'en', '', '', 'This page offers the possibility to enter Stud.IP users in the address book and to list all contacts who can already be found in the address book.', 'contact.php', '3.1', 0, 0, 1, '', '', 1412942388), +('362a67fff2ef7af8cca9f8e20583c9f2', 'en', '', '', 'Contacts from the address book can be displayed sorted according to the groups here.', '???', '3.1', 0, 0, 1, '', '', 1412942388), +('6b331f5cc2176daba82a0cc71aaa576f', 'en', '', '', 'Contacts from the address book can be sorted in self-defined groups on this page.', 'contact_statusgruppen.php', '3.1', 0, 0, 1, '', '', 1412942388), +('57f1b29d3c1a558f5cc799c1aade7f14', 'en', '', '', 'Contact groups or the whole address book can be exported here in order to be able to import them in an external programme.', 'contact_export.php', '3.1', 0, 0, 1, '', '', 1412942388), +('90ffbd715843b02b3961907f81caf208', 'en', '', '', 'The ranking sorts the Stud.IP users in descending order based on their number of points. The number of points will grow with the activities in Stud.IP and thus represents the experience of the users with the system. By entering a check mark in the little box on the left the own value will be made visible in the ranking for other users. The own value is not visible to the public in the basic settings.', 'dispatch.php/score', '3.1', 0, 0, 1, '', '', 1412942388), +('e5bff29f7adee43202a2aa8f3f0a6ec7', 'en', '', '', 'You can change your own user data incl. profile photo and categories here. Comments can be left similar to Facebook. The profile of lecturers includes consulting hours and room details. In addition the page offers the administration of own documents.', 'dispatch.php/profile', '3.1', 0, 0, 1, '', '', 1412942388), +('2a389c2472656121a76ca4f3b0e137d4', 'en', '', '', 'A profile photo can be uploaded here.', 'dispatch.php/settings/avatar', '3.1', 0, 0, 1, '', '', 1412942388), +('fe23b56f4d691c0f5e2f872e37ce38b5', 'en', '', '', 'You can change and customise your individual user data, such as for example mail address, on this page. ', 'dispatch.php/settings/account', '3.1', 0, 0, 1, '', '', 1412942388), +('b32cb2c4ec56e925b07a5cb0105a6888', 'en', '', '', 'The password for the Stud.IP-Account can be changed here.', 'dispatch.php/settings/password', '3.1', 0, 0, 1, '', '', 1412942388), +('83fd70727605c485a0d8f2c5ef94289b', 'en', '', '', 'Pre-defined information about the own person can be entered here, which is to appear on the profile page. ', 'dispatch.php/settings/details', '3.1', 0, 0, 1, '', '', 1412942388), +('970ebdf39ad5ca89083a52723c5c35f5', 'en', '', '', 'Additional courses of study and institutions can be added manually under \"study details\", if they are not automatically taken over from an external system (e.g. LSF/UniVZ).', 'dispatch.php/settings/studies', '3.1', 0, 0, 1, '', '', 1412942388), +('0e816d9428a3bc8a73fb0042fb2da540', 'en', '', '', 'The affiliation to user domains can be viewed, however not changed, here.', 'dispatch.php/settings/userdomains', '3.1', 0, 0, 1, '', '', 1412942388), +('d04ca1f9e867ee295a3025dac7ce9c7b', 'en', '', '', 'View of the institutions allocated to the Stud.IP user.', 'dispatch.php/settings/statusgruppen', '3.1', 0, 0, 1, '', '', 1412942388), +('8ad364363acd415631226d5574d5592a', 'en', '', '', 'Self-defined information about the own person can be entered on this page, which is to appear on the profile page. ', 'dispatch.php/settings/categories', '3.1', 0, 0, 1, '', '', 1412942388), +('51a0399250de6365619c961ec3669ad3', 'en', '', '', 'Blubbering is a mixed form of forum and chat. Messages are presented in the public stream. Other users can be informed about a contribution by the fact that they are mentioned in the contribution by @user name or @''first name last name''.', 'plugins.php/blubber/streams/profile', '3.1', 0, 0, 1, '', '', 1412942388), +('5ae72abc0822570bfe839e3ee24f0c81', 'en', '', '', 'With the allocation of dates, dates can be created for consulting hours, examinations, etc., in which students can enter themselves.', 'plugins.php/homepageterminvergabeplugin/showadmin', '3.1', 0, 0, 1, '', '', 1412942388), +('76195b21d485823fd7ca2fd499131c12', 'en', '', '', 'Dates can be created and edited here.', 'plugins.php/homepageterminvergabeplugin/show_category', '3.1', 0, 0, 1, '', '', 1412942388), +('0ad754cc62d1e86e97c1a28dd68ac40c', 'en', '', '', 'An overview on the dates, which were booked by students can be found here.', 'plugins.php/homepageterminvergabeplugin/show_bookings', '3.1', 0, 0, 1, '', '', 1412942388), +('b5fabb1e5aed7ff8520314e9a86c5c87', 'en', '', '', 'Individual content elements can be subsequently activated or deactivated here. Activated content elements add new functions to your profile or your settings. These will mostly appear as a new tab in the menu. If functionalities are not required these can be deactivated here. The corresponding menu tabs are then faded out.', 'dispatch.php/profilemodules/index', '3.1', 0, 0, 1, '', '', 1412942388), +('51b98d659590e1e37dae5e5e5cc028bb', 'en', '', '', 'The document administration offers the possibility to upload, manage and download personal documents,which cannot be viewed by others. ', 'dispatch.php/document/files', '3.1', 0, 0, 1, '', '', 1412942388), +('440e50f7fcc825368aa9026273d2cd0d', 'en', '', '', 'The schedule of studies consists of subscribed courses, which can be faded in and out as well as customised in the size and form of the presentation.', 'dispatch.php/calendar/schedule', '3.1', 0, 0, 1, '', '', 1412942388), +('dddf5fd4406da0d91c9f121fcae607ad', 'en', '', '', 'The diary consists of subscribed courses and own dates. It can be edited, change in the display and compared with external programmes (e.g. Outlook). ', 'calendar.php', '3.1', 0, 0, 1, '', '', 1412942388), +('a1e3da35edc9b605f670e9c7f5019888', 'en', '', '', 'With the course search courses, study groups, etc. can be found in various semesters and according to various search criteria (see \"display extended search\" in the sidebar). The current semester is pre-selected.', 'dispatch.php/search/courses', '3.1', 0, 0, 1, '', '', 1412942388), +('7d40379f54250b550065e062d71e8fd8', 'en', '', '', 'Various courses can be found with the archive search, which have already been archived.', 'archiv.php', '3.1', 0, 0, 1, '', '', 1412942388), +('ebcc460880b8a63af3f6e7eade97db78', 'en', '', '', 'Users can be found with the search for persons as long as their privacy setting does not prevent this. The search can be limited to certain courses or institutions.', 'browse.php', '3.1', 0, 0, 1, '', '', 1412942388), +('8a32ca4e602a68307d4ae6ae51fa667e', 'en', '', '', 'With the institution search institutions can be found via a free search field or the institution tree', 'institut_browse.php', '3.1', 0, 0, 1, '', '', 1412942388), +('e206a4257e31a0f32ac516cefb8e8331', 'en', '', '', 'University resources such as rooms, buildings, etc. can be found using the resource search.', 'resources.php', '3.1', 0, 0, 1, '', '', 1412942388), +('3318ee99a062079b463e902348ad520e', 'en', '', '', 'Lecturers can create and display announcements for their courses, institutions and their profile page here, whereby the display can be filtered.', 'dispatch.php/news/admin_news', '3.1', 0, 0, 1, '', '', 1412942388), +('bcdedaf1b4bd3b96ef574e8230095b28', 'en', '', '', 'RSS-Feeds, i.e. message streams of external websites, can be integrated onto the start page here. The more feeds are integrated, the longer the loading of the start page will take.', 'dispatch.php/admin/rss_feeds', '3.1', 0, 0, 1, '', '', 1412942388), +('bfb70d5f036769d740fb2342b0b58183', 'en', '', '', 'The learning module interface makes it possible for self-learning units to be made available from external programmes such as ILIAS and LON-CAPA in Stud.IP. An own user account will be created or allocated for each external system. Own learning modules can be created with the corresponding rights.', 'dispatch.php/elearning/my_accounts', '3.1', 0, 0, 1, '', '', 1412942388), +('7bf322a6c5f13db67e047b7afae83e58', 'en', '', '', 'With the export data about courses and employees can be exported in the following formats: RTF, TXT, CSV, PDF, HTML and XML.', 'export.php', '3.1', 0, 0, 1, '', '', 1412942388), +('fa4bf491690645a5f12556f77e51233c', 'en', '', '', 'Bibliographies can be edited here and placed visibly in the course (with a click on the \"eye\").', 'dispatch.php/literature/edit_list.php', '3.1', 0, 0, 1, '', '', 1412942388); + + "; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.151_add_automatic_updates_to_plugins.php b/db/migrations/1.151_add_automatic_updates_to_plugins.php new file mode 100644 index 0000000..6b4cbb3 --- /dev/null +++ b/db/migrations/1.151_add_automatic_updates_to_plugins.php @@ -0,0 +1,25 @@ +exec(" + ALTER TABLE `plugins` ADD `automatic_update_url` VARCHAR( 256 ) NULL DEFAULT NULL AFTER `dependentonid` , + ADD `automatic_update_secret` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `automatic_update_url` + "); + } + + function down() + { + DBManager::get()->exec("ALTER TABLE `plugins` DROP COLUMN `automatic_update_secret` "); + DBManager::get()->exec("ALTER TABLE `plugins` DROP COLUMN `automatic_update_url` "); + } +} diff --git a/db/migrations/1.152_tic_5117_course_member_admission.php b/db/migrations/1.152_tic_5117_course_member_admission.php new file mode 100644 index 0000000..e729135 --- /dev/null +++ b/db/migrations/1.152_tic_5117_course_member_admission.php @@ -0,0 +1,36 @@ +exec(" + CREATE TABLE IF NOT EXISTS `coursememberadmissions` ( + `rule_id` varchar(32), + `message` text NOT NULL, + `start_time` int(11) NOT NULL DEFAULT 0, + `end_time` int(11) NOT NULL DEFAULT 0, + `course_id` varchar(32) NOT NULL DEFAULT '', + `modus` tinyint(1) NOT NULL DEFAULT 0, + `mkdate` int(11) NOT NULL DEFAULT 0, + `chdate` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) + ) ENGINE=MyISAM + "); + DBManager::get()->exec("INSERT IGNORE INTO `admissionrules` (`id`, `ruletype`, `active`, `mkdate`) + VALUES (NULL, 'CourseMemberAdmission', '1', UNIX_TIMESTAMP())"); + } + + function down() + { + DBManager::get()->exec("DROP TABLE `coursememberadmissions`"); + DBManager::get()->exec("DELETE FROM `admissionrules` WHERE `ruletype` = 'CourseMemberAdmission'"); + } +} diff --git a/db/migrations/1.153_tic_4163_add_studip_shortname.php b/db/migrations/1.153_tic_4163_add_studip_shortname.php new file mode 100644 index 0000000..793def6 --- /dev/null +++ b/db/migrations/1.153_tic_4163_add_studip_shortname.php @@ -0,0 +1,35 @@ +create('STUDIP_SHORT_NAME', [ + 'value' => 'Stud.IP', + 'is_default' => 'Stud.IP', + 'type' => 'string', + 'range' => 'global', + 'section' => 'global', + 'description' => _('Studip Kurzname') + ]); + } + + function down() { + Config::get()->delete('STUDIP_SHORT_NAME'); + } + +} diff --git a/db/migrations/1.154_recalculate_score.php b/db/migrations/1.154_recalculate_score.php new file mode 100644 index 0000000..158582e --- /dev/null +++ b/db/migrations/1.154_recalculate_score.php @@ -0,0 +1,145 @@ +prepare(" + ALTER TABLE message ADD INDEX autor_id (autor_id) + "); + $statement->execute(); + } catch (PDOException $e) {} + + $statement = DBManager::get()->prepare(" + SELECT user_id FROM user_info WHERE score > 0 + "); + $statement->execute(); + while ($user_id = $statement->fetch(PDO::FETCH_COLUMN, 0)) { + self::getScore($user_id); + } + } + + function down() { + + } + + /** + * Retrieves a user's score by aggregating activities from database + * and writes the result to database and cache. + * + * @param string $user_id the user to calculate the score for + * @return int The given user's score. + */ + private static function getScore($user_id) + { + $user_id || $user_id = $GLOBALS['user']->id; + $cache = StudipCacheFactory::getCache(); + if ($cache->read("user_score_of_".$user_id)) { + return $cache->read("user_score_of_".$user_id); + } + //Behold! The all new mighty score algorithm! + //Step 1: Select all activities as mkdate-timestamps. + //Step 2: Group these activities to timeslots of halfhours + // with COUNT(*) as a weigh of the timeslot. + //Step 3: Calculate the measurement of the timeslot from the weigh of it. + // This makes the first activity count fully, the second + // almost half and so on. We use log_n to make huge amounts of + // activities to not count so much. + //Step 4: Calculate a single score for each timeslot depending on the + // measurement and the mkdate-timestamp. Use arctan as the function + // here so that older activities tend to zero. + //Step 5: Sum all scores from all timeslots together. + $sql = "SELECT ROUND(SUM((-atan(measurement / " . round(31556926 / 1800) . ") / PI() + 0.5) * 200)) AS score + FROM ( + SELECT ((UNIX_TIMESTAMP() / 1800) - timeslot) / (LN(weigh) + 1) AS measurement + FROM ( + SELECT (round(mkdate / 1800)) as timeslot, COUNT(*) AS weigh + FROM (" . self::createTimestampQuery() . ") AS mkdates + GROUP BY timeslot + ) AS measurements + ) AS dates"; + $stmt = DBManager::get()->prepare($sql); + $stmt->execute([':user' => $user_id]); + $score = $stmt->fetchColumn(); + + $query = "UPDATE user_info SET score = ? WHERE user_id = ? AND score > 0"; + $statement = DBManager::get()->prepare($query); + $statement->execute([$score, $user_id]); + + $cache->write("user_score_of_".$user_id, $score, 60 * 5); + + return $score; + } + + private static function createTimestampQuery() + { + $statements = []; + foreach (self::getActivityTables() as $table) { + $statements[] = "SELECT " + . ($table['date_column'] ? : 'mkdate') + . " AS mkdate FROM " + . $table['table'] + . " WHERE " + . ($table['user_id_column'] ? : 'user_id') + . " = :user " + . ($table['where'] ? (' AND ' . $table['where']) : ''); + } + return join(' UNION ', $statements); + } + + private static function getActivityTables() + { + $tables = []; + $tables[] = ['table' => "user_info"]; + $tables[] = ['table' => "comments"]; + $tables[] = ['table' => "dokumente"]; + $tables[] = ['table' => "forum_entries"]; + $tables[] = ['table' => "news"]; + $tables[] = ['table' => "seminar_user"]; + $tables[] = [ + 'table' => "blubber", + 'where' => "context_type != 'private'" + ]; + $tables[] = [ + 'table' => "kategorien", + 'user_id_column' => "range_id" + ]; + $tables[] = [ + 'table' => "message", + 'user_id_column' => "autor_id" + ]; + $tables[] = [ + 'table' => "vote", + 'user_id_column' => "range_id" + ]; + $tables[] = [ + 'table' => "voteanswers_user", + 'date_column' => "votedate" + ]; + $tables[] = [ + 'table' => "vote_user", + 'date_column' => "votedate" + ]; + $tables[] = [ + 'table' => "wiki", + 'date_column' => "chdate" + ]; + + foreach (PluginManager::getInstance()->getPlugins("ScorePlugin") as $plugin) { + foreach ((array) $plugin->getPluginActivityTables() as $table) { + if ($table['table']) { + $tables[] = $table; + } + } + } + + return $tables; + } + +} + diff --git a/db/migrations/1.155_tic_5170_clean_up.php b/db/migrations/1.155_tic_5170_clean_up.php new file mode 100644 index 0000000..7030ead --- /dev/null +++ b/db/migrations/1.155_tic_5170_clean_up.php @@ -0,0 +1,25 @@ +exec("ALTER TABLE `message` DROP `chat_id`, DROP `readed`"); + $db->exec("ALTER TABLE `message_user` DROP `confirmed_read`"); + try { + $db->exec("ALTER TABLE `message_user` DROP COLUMN `dont_delete`"); + } catch (Exception $e) { } + $db->exec("ALTER TABLE `user_info` DROP `guestbook`"); + $db->exec("DROP TABLE object_rate"); + $db->exec("DROP TABLE object_user"); + $db->exec("DROP TABLE px_topics"); + $db->exec("DROP TABLE rss_feeds"); + $db->exec("DELETE FROM user_visibility_settings WHERE plugin IS NOT NULL"); + $db->exec("DELETE FROM user_visibility_settings WHERE identifier = 'plugins'"); + } +} diff --git a/db/migrations/1.156_tic_5204_add_datafield_type.php b/db/migrations/1.156_tic_5204_add_datafield_type.php new file mode 100644 index 0000000..951288a --- /dev/null +++ b/db/migrations/1.156_tic_5204_add_datafield_type.php @@ -0,0 +1,15 @@ +exec("ALTER TABLE `datafields` CHANGE `type` `type` ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') NOT NULL DEFAULT 'textline'"); + $db->exec("ALTER TABLE `datafields` ADD `is_userfilter` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `is_required`"); + } +} diff --git a/db/migrations/1.157_contact_rework.php b/db/migrations/1.157_contact_rework.php new file mode 100644 index 0000000..178847b --- /dev/null +++ b/db/migrations/1.157_contact_rework.php @@ -0,0 +1,48 @@ +exec("DROP TABLE IF EXISTS contact_userinfo"); + DBManager::get()->exec("CREATE TABLE `contact_new` ( + `owner_id` varchar(32) NOT NULL DEFAULT '', + `user_id` varchar(32) NOT NULL DEFAULT '', + `calpermission` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`owner_id`,`user_id`), + KEY `user_id` (`user_id`) + ) ENGINE=MyISAM"); + DBManager::get()->exec("INSERT INTO `contact_new` SELECT `owner_id`,`user_id`, MAX(`calpermission`) FROM `contact` GROUP BY `owner_id`,`user_id`"); + DBManager::get()->exec("DROP TABLE `contact`"); + DBManager::get()->exec("RENAME TABLE `contact_new` TO `contact`"); + + Config::get()->delete("FOAF_ENABLE"); + Config::get()->delete("FOAF_SHOW_IDENTITY"); + } + + public function down() + { + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `contact_userinfo` ( + `userinfo_id` varchar(32) NOT NULL DEFAULT '', + `contact_id` varchar(32) NOT NULL DEFAULT '', + `name` varchar(255) NOT NULL DEFAULT '', + `content` text NOT NULL, + `priority` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`userinfo_id`), + KEY `contact_id` (`contact_id`), + KEY `priority` (`priority`) + ) ENGINE=MyISAM;"); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `contact` ( + `contact_id` varchar(32) NOT NULL DEFAULT '', + `owner_id` varchar(32) NOT NULL DEFAULT '', + `user_id` varchar(32) NOT NULL DEFAULT '', + `buddy` tinyint(4) NOT NULL DEFAULT '1', + `calpermission` tinyint(2) unsigned NOT NULL DEFAULT '1' + ) ENGINE=MyISAM;"); + DBManager::get()->exec("ALTER TABLE contact ADD COLUMN buddy tinyint(4) NOT NULL DEFAULT '1'"); + } +} diff --git a/db/migrations/1.158_step_00283_calendar_sorm.php b/db/migrations/1.158_step_00283_calendar_sorm.php new file mode 100644 index 0000000..3b9bdca --- /dev/null +++ b/db/migrations/1.158_step_00283_calendar_sorm.php @@ -0,0 +1,139 @@ +exec( + "CREATE TABLE IF NOT EXISTS `event_data` ( + `event_id` varchar(32) NOT NULL, + `autor_id` varchar(32) NOT NULL, + `editor_id` varchar(32) DEFAULT NULL, + `uid` varchar(255) NOT NULL, + `start` int(10) unsigned NOT NULL DEFAULT '0', + `end` int(10) unsigned NOT NULL DEFAULT '0', + `summary` varchar(255) NOT NULL DEFAULT '', + `description` text, + `class` enum('PUBLIC','PRIVATE','CONFIDENTIAL') NOT NULL DEFAULT 'PRIVATE', + `categories` tinytext, + `category_intern` tinyint(3) unsigned NOT NULL DEFAULT '0', + `priority` tinyint(3) unsigned NOT NULL DEFAULT '0', + `location` tinytext, + `ts` int(10) unsigned NOT NULL DEFAULT '0', + `linterval` smallint(5) unsigned DEFAULT NULL, + `sinterval` smallint(5) unsigned DEFAULT NULL, + `wdays` varchar(7) DEFAULT NULL, + `month` tinyint(3) unsigned DEFAULT NULL, + `day` tinyint(3) unsigned DEFAULT NULL, + `rtype` enum('SINGLE','DAILY','WEEKLY','MONTHLY','YEARLY') NOT NULL DEFAULT 'SINGLE', + `duration` smallint(5) unsigned NOT NULL DEFAULT '0', + `count` smallint(5) DEFAULT '0', + `expire` int(10) unsigned NOT NULL DEFAULT '0', + `exceptions` text, + `mkdate` int(10) unsigned NOT NULL DEFAULT '0', + `chdate` int(10) unsigned NOT NULL DEFAULT '0', + `importdate` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`event_id`), + UNIQUE KEY `uid` (`uid`), + KEY `autor_id` (`autor_id`) + ) ENGINE=MyISAM"); + DBManager::get()->execute( + "CREATE TABLE IF NOT EXISTS `calendar_event` ( + `range_id` varchar(32) NOT NULL, + `event_id` varchar(32) NOT NULL, + `group_status` tinyint(4) unsigned NOT NULL DEFAULT '0', + `chdate` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`range_id`, `event_id`) + ) ENGINE=MYISAM"); + DBManager::get()->execute( + "INSERT IGNORE INTO `event_data` + (`event_id`, `autor_id`, `editor_id`, `uid`, `start`, `end`, + `summary`, `description`, `class`, `categories`, `category_intern`, + `priority`, `location`, `ts`, `linterval`, `sinterval`, `wdays`, + `month`, `day`, `rtype`, `duration`, `count`, `expire`, `exceptions`, + `mkdate`, `chdate`, `importdate`) + SELECT `event_id`, `autor_id`, NULLIF(`editor_id`, ''), + `uid`, `start`, `end`, + `summary`, `description`, `class`, `categories`, `category_intern`, + `priority`, `location`, `ts`, `linterval`, `sinterval`, `wdays`, + `month`, `day`, `rtype`, `duration`, `count`, `expire`, `exceptions`, + `mkdate`, `chdate`, `importdate` + FROM calendar_events WHERE 1 GROUP BY `event_id`"); + DBManager::get()->execute( + "INSERT IGNORE INTO `calendar_event` + (`range_id`, `event_id`, `chdate`) + SELECT `range_id`, `event_id`, `chdate` + FROM `calendar_events` WHERE 1"); + DBManager::get()->exec('DROP TABLE IF EXISTS calendar_events'); + + DBManager::get()->exec('ALTER TABLE contact CHANGE ' + . "`calpermission` `calpermission` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"); + DBManager::get()->exec("UPDATE IGNORE contact SET calpermission = '0' " + . "WHERE calpermission = '1'"); + } + + public function down() + { + DBManager::get()->execute( + "CREATE TABLE IF NOT EXISTS `calendar_events` ( + `event_id` varchar(32) NOT NULL DEFAULT '', + `range_id` varchar(32) NOT NULL DEFAULT '', + `autor_id` varchar(32) NOT NULL DEFAULT '', + `editor_id` varchar(32) NOT NULL, + `uid` varchar(255) NOT NULL DEFAULT '', + `start` int(10) unsigned NOT NULL DEFAULT '0', + `end` int(10) unsigned NOT NULL DEFAULT '0', + `summary` varchar(255) NOT NULL DEFAULT '', + `description` text, + `class` enum('PUBLIC','PRIVATE','CONFIDENTIAL') NOT NULL DEFAULT 'PRIVATE', + `categories` tinytext, + `category_intern` tinyint(3) unsigned NOT NULL DEFAULT '0', + `priority` tinyint(3) unsigned NOT NULL DEFAULT '0', + `location` tinytext, + `ts` int(10) unsigned NOT NULL DEFAULT '0', + `linterval` smallint(5) unsigned DEFAULT NULL, + `sinterval` smallint(5) unsigned DEFAULT NULL, + `wdays` varchar(7) DEFAULT NULL, + `month` tinyint(3) unsigned DEFAULT NULL, + `day` tinyint(3) unsigned DEFAULT NULL, + `rtype` enum('SINGLE','DAILY','WEEKLY','MONTHLY','YEARLY') NOT NULL DEFAULT 'SINGLE', + `duration` smallint(5) unsigned NOT NULL DEFAULT '0', + `count` smallint(5) DEFAULT '0', + `expire` int(10) unsigned NOT NULL DEFAULT '0', + `exceptions` text, + `mkdate` int(10) unsigned NOT NULL DEFAULT '0', + `chdate` int(10) unsigned NOT NULL DEFAULT '0', + `importdate` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`event_id`), + UNIQUE KEY `uid_range` (`uid`,`range_id`), + KEY `range_id` (`range_id`), + KEY `autor_id` (`autor_id`) + ) ENGINE=MyISAM;"); + DBManager::get()->execute( + "INSERT INTO `calendar_events` + (`event_id`, `range_id`, `autor_id`, `editor_id`, `uid`, `start`, `end`, + `summary`, `description`, `class`, `categories`, `category_intern`, + `priority`, `location`, `ts`, `linterval`, `sinterval`, `wdays`, + `month`, `day`, `rtype`, `duration`, `count`, `expire`, `exceptions`, + `mkdate`, `chdate`, `importdate`) + SELECT e.`event_id`, ce.`range_id`, e.`autor_id`, IFNULL(e.`editor_id`, ''), + e.`uid`, e.`start`, e.`end`, + e.`summary`, e.`description`, e.`class`, e.`categories`, e.`category_intern`, + e.`priority`, e.`location`, e.`ts`, e.`linterval`, e.`sinterval`, e.`wdays`, + e.`month`, e.`day`, e.`rtype`, e.`duration`, e.`count`, e.`expire`, e.`exceptions`, + e.`mkdate`, e.`chdate`, e.`importdate` + FROM `calendar_event` INNER JOIN `event` USING(`event_id`) + WHERE 1"); + DBManager::get()->exec('DROP TABLE IF EXISTS calendar_event'); + DBManager::get()->exec('DROP TABLE IF EXISTS event_data'); + + DBManager::get()->exec('ALTER TABLE contact CHANGE ' + . "`calpermission` `calpermission` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1'"); + DBManager::get()->exec("UPDATE IGNORE contact SET calpermission = '1' " + . "WHERE calpermission = '0'"); + } +} diff --git a/db/migrations/1.159_step_00275_plus.php b/db/migrations/1.159_step_00275_plus.php new file mode 100644 index 0000000..512a36c --- /dev/null +++ b/db/migrations/1.159_step_00275_plus.php @@ -0,0 +1,26 @@ +execute(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, `type`, `range`, mkdate, chdate, description, comment) + VALUES + (MD5(:name), :name, :value, 1, 'array', 'user', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description, '') + ", ['name' => 'PLUS_SETTINGS', + 'value' => '[]', + 'description' => 'Nutzer Konfiguration für Plusseite']); + } + + function down() { + DBManager::get()->exec("DELETE FROM config WHERE field = 'PLUS_SETTINGS'"); + DBManager::get()->exec("DELETE FROM user_config WHERE field = 'PLUS_SETTINGS'"); + } + +} + diff --git a/db/migrations/1.15_step_00129_email_restriction.php b/db/migrations/1.15_step_00129_email_restriction.php new file mode 100644 index 0000000..f0816b1 --- /dev/null +++ b/db/migrations/1.15_step_00129_email_restriction.php @@ -0,0 +1,27 @@ +announce("add new value EMAIL_DOMAIN_RESTRICTION to table config"); + + DBManager::get()->exec("INSERT INTO `config` VALUES ('cb92d5bb08f346567dbd394d0d553454', '', 'EMAIL_DOMAIN_RESTRICTION', '', 1, 'string', 'global', '', 0, 1157107088, 1157107088, 'Beschränkt die gültigkeit von Email-Adressen bei freier Registrierung auf die angegebenen Domains. Komma-separierte Liste von Domains ohne vorangestelltes @.', '', '')"); + + $this->announce("done."); + + } + + public function down () + { + $this->announce("remove value EMAIL_DOMAIN_RESTRICTION from table config"); + + DBManager::get()->exec("DELETE FROM `config` WHERE `field` = 'EMAIL_DOMAIN_RESTRICTION'"); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.160_step_00283_update_calendar_settings.php b/db/migrations/1.160_step_00283_update_calendar_settings.php new file mode 100644 index 0000000..f54956b --- /dev/null +++ b/db/migrations/1.160_step_00283_update_calendar_settings.php @@ -0,0 +1,66 @@ +exec("ALTER TABLE `event_data` CHANGE `autor_id` `author_id` VARCHAR(32) NOT NULL"); + DBManager::get()->exec("ALTER TABLE `calendar_event` ADD `mkdate` INT NOT NULL AFTER `group_status`"); + DBManager::get()->exec("UPDATE calendar_event ce LEFT JOIN event_data ed USING(event_id) SET ce.mkdate = ed.mkdate"); + + $replace = [ + 'showlist' => 'list', + 'showday' => 'day', + 'showweek' => 'week', + 'showmonth' => 'month', + 'showyear' => 'year']; + $res = DBManager::get()->query("SELECT user_id FROM `user_config` WHERE field = 'CALENDAR_SETTINGS'"); + $default_settings = Calendar::getDefaultUserSettings(); + Config::get()->store('CALENDAR_SETTINGS', $default_settings); + foreach ($res as $row) { + $config = new UserConfig($row['user_id']); + $settings = $config->getValue('CALENDAR_SETTINGS'); + if (isset($settings['view'])) { + $default_settings['view'] = $replace[$settings['view']]; + $config->store('CALENDAR_SETTINGS', $default_settings); + } + + } + } + + function down() { + DBManager::get()->execute("ALTER TABLE `event_data` CHANGE `author_id` `autor_id` VARCHAR(32) NOT NULL"); + DBManager::get()->execute("ALTER TABLE `calendar_event` DROP `mkdate`"); + + $replace = [ + 'list' => 'showlist', + 'day' => 'showday', + 'week' => 'showweek', + 'month' => 'showmonth', + 'year' => 'showyear']; + $default_settings = [ + 'view' => 'week', + 'start' => '9', + 'end' => '20', + 'step_day' => '900', + 'step_week' => '1800', + 'type_week' => 'LONG', + 'delete' => '0', + 'step_week_group' => '3600', + 'step_day_group' => '3600' + ]; + $res = DBManager::get()->query("SELECT user_id FROM `user_config` WHERE field = 'CALENDAR_SETTINGS'"); + foreach ($res as $row) { + $config = UserConfig::get($row['user_id']); + $settings = $config->getValue('CALENDAR_SETTINGS'); + if (isset($settings['view'])) { + $default_settings['view'] = $replace[$settings['view']]; + $config->store('CALENDAR_SETTINGS', $default_settings); + } + + } + } + +} diff --git a/db/migrations/1.161_step_00284_help_editor.php b/db/migrations/1.161_step_00284_help_editor.php new file mode 100644 index 0000000..0650318 --- /dev/null +++ b/db/migrations/1.161_step_00284_help_editor.php @@ -0,0 +1,60 @@ +announce("add new fields to table help_content"); + + DBManager::get()->exec("ALTER TABLE `help_content` ADD `global_content_id` varchar(32) NOT NULL FIRST"); + DBManager::get()->exec("UPDATE `help_content` SET `global_content_id` = `content_id`"); + DBManager::get()->exec("ALTER TABLE `help_content` DROP PRIMARY KEY , ADD PRIMARY KEY ( `content_id` )"); + DBManager::get()->exec("ALTER TABLE `help_content` ADD `author_email` varchar(255) NOT NULL AFTER `author_id`"); + DBManager::get()->exec("ALTER TABLE `help_content` ADD `chdate` int(11) NOT NULL AFTER `mkdate`"); + DBManager::get()->exec("ALTER TABLE `help_content` DROP COLUMN `author_id`, DROP COLUMN `label`, DROP COLUMN `icon`"); + + $this->announce("add new fields to table help_tours"); + + DBManager::get()->exec("ALTER TABLE `help_tours` ADD `global_tour_id` varchar(32) NOT NULL FIRST"); + DBManager::get()->exec("UPDATE `help_tours` SET `global_tour_id` = `tour_id`"); + DBManager::get()->exec("ALTER TABLE `help_tours` ADD `author_email` varchar(255) NOT NULL AFTER `installation_id`"); + DBManager::get()->exec("ALTER TABLE `help_tours` ADD `chdate` int(11) NOT NULL AFTER `mkdate`"); + + $this->announce("add new fields to table help_tour_steps"); + + DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `chdate` int(11) NOT NULL AFTER `mkdate`"); + DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `author_email` varchar(255) NOT NULL AFTER `route`"); + DBManager::get()->exec("ALTER TABLE `help_tour_steps` DROP COLUMN `author_id`"); + DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `action_next` varchar(255) NOT NULL AFTER `route`"); + DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `action_prev` varchar(255) NOT NULL AFTER `route`"); + + DBManager::get()->exec("INSERT INTO `roles` (`rolename`, `system`) VALUES ('Hilfe-Administrator(in)', 'n')"); + + $this->announce("done."); + } + + public function down () + { + DBManager::get()->exec("DELETE `roles_user`.*, `roles`.* FROM `roles_user` LEFT JOIN `roles` USING (`roleid`) WHERE `roles`.`rolename` = 'Hilfe-Administrator(in)'"); + + $this->announce("remove fields from table help_content"); + DBManager::get()->exec("ALTER TABLE `help_content` ADD `author_id` varchar(255) NOT NULL AFTER `author_email`"); + DBManager::get()->exec("ALTER TABLE `help_content` ADD `label` varchar(255) NOT NULL AFTER `language`"); + DBManager::get()->exec("ALTER TABLE `help_content` ADD `icon` varchar(255) NOT NULL AFTER `language`"); + DBManager::get()->exec("ALTER TABLE `help_content` DROP COLUMN `author_email`, DROP COLUMN `global_content_id`"); + DBManager::get()->exec("ALTER TABLE `help_content` DROP PRIMARY KEY , ADD PRIMARY KEY ( `content_id`, `language`, `studip_version`, `installation_id` )"); + + $this->announce("remove fields from table help_tours"); + DBManager::get()->exec("ALTER TABLE `help_tours` DROP COLUMN `author_email`, DROP COLUMN `chdate`, DROP COLUMN `global_tour_id`"); + + $this->announce("remove fields from table help_tour_steps"); + DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `author_id` varchar(255) NOT NULL AFTER `author_email`"); + DBManager::get()->exec("ALTER TABLE `help_tour_steps` DROP COLUMN `author_email`, DROP COLUMN `chdate`, DROP COLUMN `action_prev`, DROP COLUMN `action_next`"); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.162_step_00283_calendar_user.php b/db/migrations/1.162_step_00283_calendar_user.php new file mode 100644 index 0000000..4ec8e6c --- /dev/null +++ b/db/migrations/1.162_step_00283_calendar_user.php @@ -0,0 +1,23 @@ +execute("CREATE TABLE IF NOT EXISTS `calendar_user` ( + `owner_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `permission` int(2) NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`owner_id`,`user_id`) + ) ENGINE=MyISAM"); + } + + function down() { + DBManager::get()->execute('DROP TABLE IF EXISTS calendar_user'); + } + +} diff --git a/db/migrations/1.163_transfer_calpermission.php b/db/migrations/1.163_transfer_calpermission.php new file mode 100644 index 0000000..a919c44 --- /dev/null +++ b/db/migrations/1.163_transfer_calpermission.php @@ -0,0 +1,18 @@ +execute("INSERT INTO calendar_user SELECT owner_id, user_id, calpermission as permission, unix_timestamp() as mkdate, unix_timestamp() as chdate FROM contact WHERE calpermission > 0;"); + DBManager::get()->execute('ALTER TABLE contact DROP COLUMN calpermission'); + } + + function down() { + DBManager::get()->execute("ALTER TABLE contact ADD COLUMN `calpermission` tinyint(1) unsigned NOT NULL DEFAULT '0'"); + DBManager::get()->execute("UPDATE contact JOIN calendar_user USING (owner_id, user_id) SET calpermission = permission"); + } + +} diff --git a/db/migrations/1.164_help_tours_en.php b/db/migrations/1.164_help_tours_en.php new file mode 100644 index 0000000..51e3c7d --- /dev/null +++ b/db/migrations/1.164_help_tours_en.php @@ -0,0 +1,175 @@ +addHelpToursEN(); + } + + function down() + { + DBManager::get()->exec("DELETE FROM `help_tours` WHERE `tour_id` = '7af1e1fb7f53c910ba9f42f43a71c723' OR `tour_id` = 'c89ce8e097f212e75686f73cc5008711' OR `tour_id` = 'de1fbce508d01cbd257f9904ff8c3b43' OR `tour_id` = '1badcf28ab5b206d9150b2b9683b4cb6' OR `tour_id` = 'fa963d2ca827b28e0082e98aafc88765' OR `tour_id` = 'f0aeb0f6c4da3bd61f48b445d9b30dc1' OR `tour_id` = '3dbe7099f82dcdbba4580acb1105a0d6' OR `tour_id` = '9e9dca9b1214294b9605824bfe90fba1' OR `tour_id` = '89786eac42f52ac316790825b4f5c0b2' OR `tour_id` = 'e41611616675b218845fe9f55bc11cf6' OR `tour_id` = '83dc1d25e924f2748ee3293aaf0ede8e' OR `tour_id` = '588effa83da976a889a68c152bcabc90' OR `tour_id` = 'd9913517f9c81d2c0fa8362592ce5d0e' OR `tour_id` = '05434e40601a9a2a7f5fa8208ae148c1'"); + DBManager::get()->exec("DELETE FROM `help_tour_steps` WHERE `tour_id` = '7af1e1fb7f53c910ba9f42f43a71c723' OR `tour_id` = 'c89ce8e097f212e75686f73cc5008711' OR `tour_id` = 'de1fbce508d01cbd257f9904ff8c3b43' OR `tour_id` = '1badcf28ab5b206d9150b2b9683b4cb6' OR `tour_id` = 'fa963d2ca827b28e0082e98aafc88765' OR `tour_id` = 'f0aeb0f6c4da3bd61f48b445d9b30dc1' OR `tour_id` = '3dbe7099f82dcdbba4580acb1105a0d6' OR `tour_id` = '9e9dca9b1214294b9605824bfe90fba1' OR `tour_id` = '89786eac42f52ac316790825b4f5c0b2' OR `tour_id` = 'e41611616675b218845fe9f55bc11cf6' OR `tour_id` = '83dc1d25e924f2748ee3293aaf0ede8e' OR `tour_id` = '588effa83da976a889a68c152bcabc90' OR `tour_id` = 'd9913517f9c81d2c0fa8362592ce5d0e' OR `tour_id` = '05434e40601a9a2a7f5fa8208ae148c1'"); + DBManager::get()->exec("DELETE FROM `help_tour_settings` WHERE `tour_id` = '7af1e1fb7f53c910ba9f42f43a71c723' OR `tour_id` = 'c89ce8e097f212e75686f73cc5008711' OR `tour_id` = 'de1fbce508d01cbd257f9904ff8c3b43' OR `tour_id` = '1badcf28ab5b206d9150b2b9683b4cb6' OR `tour_id` = 'fa963d2ca827b28e0082e98aafc88765' OR `tour_id` = 'f0aeb0f6c4da3bd61f48b445d9b30dc1' OR `tour_id` = '3dbe7099f82dcdbba4580acb1105a0d6' OR `tour_id` = '9e9dca9b1214294b9605824bfe90fba1' OR `tour_id` = '89786eac42f52ac316790825b4f5c0b2' OR `tour_id` = 'e41611616675b218845fe9f55bc11cf6' OR `tour_id` = '83dc1d25e924f2748ee3293aaf0ede8e' OR `tour_id` = '588effa83da976a889a68c152bcabc90' OR `tour_id` = 'd9913517f9c81d2c0fa8362592ce5d0e' OR `tour_id` = '05434e40601a9a2a7f5fa8208ae148c1'"); + } + + function addHelpToursEN() { + // add tour data + $query = "INSERT IGNORE INTO `help_tours` (`tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `mkdate`) VALUES +('7af1e1fb7f53c910ba9f42f43a71c723', 'Search', 'In this feature tour the most important search functions are explained', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427720631), +('c89ce8e097f212e75686f73cc5008711', 'Participant administration', 'The administration options of the participant administration are explained in this tour.', 'tour', 'tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427721030), +('de1fbce508d01cbd257f9904ff8c3b43', 'Profile page', 'The basic functions and areas of the profile page are presented in this tour.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427722058), +('1badcf28ab5b206d9150b2b9683b4cb6', 'My courses (lecturers)', 'The most important functions of the site \"My courses\" are presented in this tour.', 'tour', 'tutor,dozent,admin,root', 1, 'en', '', '', 1427722642), +('fa963d2ca827b28e0082e98aafc88765', 'My courses (students)', 'The most important functions of the site \"My courses\" are presented in this tour.', 'tour', 'autor', 1, 'en', '3.1', '', 1427723231), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 'Design of the start page', 'The functions and design possibilities of the start page are presented in this feature tour.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427723894), +('3dbe7099f82dcdbba4580acb1105a0d6', 'Administering the forum', 'The administration of the forum is explained in this tour.', 'tour', 'tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427724314), +('9e9dca9b1214294b9605824bfe90fba1', 'Create study group', 'In this tour the creation of study groups is explained', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427724645), +('89786eac42f52ac316790825b4f5c0b2', 'Use forum', 'The content of this tour is from the old tour of the forum (Sidebar > actions > start tour).', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427783673), +('e41611616675b218845fe9f55bc11cf6', 'Upload own picture', 'This tour explains how users can upload their own profile picture.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784057), +('83dc1d25e924f2748ee3293aaf0ede8e', 'Blubber', 'This tour explains how to use \"Blubber\"', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784655), +('588effa83da976a889a68c152bcabc90', 'Blubber', 'This tour explains how to use \"Blubber\"', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784693), +('d9913517f9c81d2c0fa8362592ce5d0e', 'Blubber', 'This tour explains how to use \"Blubber\"', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784720), +('05434e40601a9a2a7f5fa8208ae148c1', 'My documents', 'The personal document area will be presented in this tour.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427786336); +"; + DBManager::get()->exec($query); + + // add steps + $query = "INSERT IGNORE INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `author_email`, `mkdate`) VALUES +('7af1e1fb7f53c910ba9f42f43a71c723', 1, 'Search', 'This tour gives you an overview of the most important \"search\" functions \n\n\nIn order to reach the next step please click \"next\" on the bottom right', 'TL', 0, '', 'dispatch.php/search/courses', '', 1405519865), +('7af1e1fb7f53c910ba9f42f43a71c723', 2, 'Enter search term', 'A search term (such as event name, lecturer) can be entered in this input field.', 'B', 0, 'INPUT#search_sem_quick_search_1.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520106), +('7af1e1fb7f53c910ba9f42f43a71c723', 3, 'Semester selection', 'With a click on the drop-down menu you can choose to which semester the search term should refer. \n\nThe current semester is set as standard.', 'TL', 0, 'SELECT#search_sem_sem', 'dispatch.php/search/courses', '', 1405520208), +('7af1e1fb7f53c910ba9f42f43a71c723', 4, 'Navigation', 'If you want to search only one particular area, you can select one here.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/search/courses', '', 1406121826), +('7af1e1fb7f53c910ba9f42f43a71c723', 5, 'Extended search', 'The search can be extended by further options with the extended search.', 'R', 0, 'A.options-checkbox.options-unchecked', 'dispatch.php/search/courses', '', 1405520436), +('7af1e1fb7f53c910ba9f42f43a71c723', 6, 'Quick search', 'The quick search is also available on other sites of Stud.IP at all times. After entering a key word it is confirmed with \"Enter\" or by clicking the magnifying glass on the right next to the field.', 'B', 0, 'INPUT#search_sem_quick_search_2.quicksearchbox.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520634), +('7af1e1fb7f53c910ba9f42f43a71c723', 7, 'Further search possibilities', 'In addition to searching for events there is also the possibility to search the archive for persons, facilities, or resources.', 'R', 0, '#nav_search_resources A SPAN', 'dispatch.php/search/courses', '', 1405520751), +('c89ce8e097f212e75686f73cc5008711', 1, 'Participant administration', 'This tour gives an overview of the participant administration of an event.\r\n\r\nIn order to go to the next step please click \"next\" at the bottom right.', 'B', 0, '', 'dispatch.php/course/members', '', 1405688399), +('c89ce8e097f212e75686f73cc5008711', 2, 'Add persons', 'With these functions you can search for individual persons in Stud.IP and directly select them as lecturer, tutor or author. It is also possible to insert a list of participants in order to allocate several persons as a tutor of the event at the same time.', 'R', 0, '#layout-sidebar SECTION DIV.sidebar-widget :eq(1)', 'dispatch.php/course/members', '', 1405688707), +('c89ce8e097f212e75686f73cc5008711', 3, 'Upgrade/ downgrade', 'In order to upgrade an already enroled person to a tutor, or to downgrade them to a reader select this person in the list and carry out the requested action by using the dropdown menu.', 'T', 0, '#autor CAPTION', 'dispatch.php/course/members', '', 1405690324), +('c89ce8e097f212e75686f73cc5008711', 4, 'Send circular e-mail', 'A circular e-mail can be sent to all participants of the event here.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(3)', 'dispatch.php/course/members', '', 1406636964), +('c89ce8e097f212e75686f73cc5008711', 5, 'Send circular e-mail to user group', 'There is further the possibility to send a circular e-mail to individual user groups.', 'BR', 0, '#layout_container #layout_content TABLE CAPTION SPAN A IMG :eq(0)', 'dispatch.php/course/members', '', 1406637123), +('c89ce8e097f212e75686f73cc5008711', 6, 'Create groups', 'The participants of the event can be divided into groups here.', 'R', 0, 'A#nav_course_edit_groups', 'dispatch.php/course/members', '', 1405689311), +('c89ce8e097f212e75686f73cc5008711', 7, 'Name group', 'You can search for a suitable group name in the templates and select it using the yellow double arrow. As an alternative you also have the possibility to determine a new group name by directly entering the name in the right field.', 'B', 0, 'SELECT', 'admin_statusgruppe.php', '', 1405689541), +('c89ce8e097f212e75686f73cc5008711', 8, 'Group size', 'With the field \"group size\" you can set the maximum number of participants of a group. If you do not require this, simply leave the field empty.', 'B', 0, 'INPUT#role_size', 'admin_statusgruppe.php', '', 1405689763), +('c89ce8e097f212e75686f73cc5008711', 9, 'Self-entry', 'If you activate the function \"self-entry\", the participants of the event can enter themselves in the groups.', 'B', 0, 'INPUT#self_assign', 'admin_statusgruppe.php', '', 1405689852), +('c89ce8e097f212e75686f73cc5008711', 10, 'Document folder', 'If you activate the function \"document folder\", an additional document folder will be created per group. Group-specific documents can be uploaded to this folder.', 'B', 0, 'INPUT#group_folder', 'admin_statusgruppe.php', '', 1405689936), +('de1fbce508d01cbd257f9904ff8c3b43', 1, 'Profile tour', 'This tour gives you an overview of the most important functions of the \"profile\".\r\n\r\nIn order to reach the next step please click \"next\" on the bottom right.', 'T', 0, '', 'dispatch.php/profile', '', 1406722657), +('de1fbce508d01cbd257f9904ff8c3b43', 2, 'Personal picture', 'If you uploaded a picture, it will be displayed here. You can change it at all times.', 'RT', 0, '.avatar-normal', 'dispatch.php/profile', '', 1406722657), +('de1fbce508d01cbd257f9904ff8c3b43', 3, 'Stud.IP-Score', 'The Stud.IP-Score increases with the activities in Stud.IP and thus represents the experience with Stud.IP.', 'BL', 0, '#layout_content TABLE:eq(0) TBODY:eq(0) TR:eq(0) TD:eq(0) A:eq(0)', 'dispatch.php/profile', '', 1406722657), +('de1fbce508d01cbd257f9904ff8c3b43', 4, 'Announcements', 'You can publish personal announcements on this site.', 'B', 0, '#layout_content SECTION HEADER H1 :eq(0)', 'dispatch.php/profile', '', 1406722657), +('de1fbce508d01cbd257f9904ff8c3b43', 5, 'New announcement', 'Click on the plus sign, if you would like to create an announcement.', 'BR', 0, '#layout_content SECTION HEADER NAV A :eq(0)', 'dispatch.php/profile', '', 1406722657), +('de1fbce508d01cbd257f9904ff8c3b43', 6, 'Personal details', 'Your picture and additional user data can be changed on these sites.', 'BL', 0, '#tabs li:eq(2)', 'dispatch.php/profile', '', 1406722657), +('1badcf28ab5b206d9150b2b9683b4cb6', 1, 'Help tour \"My event\"', 'This tour gives you an overview of the most important functions of the page \"My courses\".\r\n\r\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'dispatch.php/my_courses', '', 1406125847), +('1badcf28ab5b206d9150b2b9683b4cb6', 2, 'Overview of events', 'The courses of the current and past semester are displayed here. New courses initially appear in red.', 'TL', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1406125908), +('1badcf28ab5b206d9150b2b9683b4cb6', 3, 'Event details', 'With a click on the \"i\" a window appears with the most important facts of the courses.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1406125992), +('1badcf28ab5b206d9150b2b9683b4cb6', 4, 'Course contents', 'All contents (such as e.g. a forum) are displayed by corresponding symbols here.\n\nIf there were any news since the last login these will appear in red.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1406126049), +('1badcf28ab5b206d9150b2b9683b4cb6', 5, 'Editing or deletion of an event', 'A click on the cog wheel enables you to edit a course.\n\nIf you have participant status in a course, you can sign out by clicking on the door icon.', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1406126134), +('1badcf28ab5b206d9150b2b9683b4cb6', 6, 'Adjustment to the event view', 'In order to adjust the course overview you can order your courses according to certain criteria (such as e.g. fields of study, lecturers, or colours).', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1406126281), +('1badcf28ab5b206d9150b2b9683b4cb6', 7, 'Access to an event of past and future semesters', 'For example, by clicking on the drop-down menu, courses from past semesters can be displayed.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1406126316), +('1badcf28ab5b206d9150b2b9683b4cb6', 8, 'Further possible actions', 'Here you can mark all news as read, change colour groups as you please, and also adjust the notifications about activities in the individual courses.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1406126374), +('1badcf28ab5b206d9150b2b9683b4cb6', 9, 'Study groups and facilities', 'There is moreover the possibility to access personal study groups or facilities.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1406126415), +('fa963d2ca827b28e0082e98aafc88765', 1, 'Help tour \"My courses\"', 'This tour gives you an overview of the most important functions of the site \"My courses\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'dispatch.php/my_courses', '', 1405521184), +('fa963d2ca827b28e0082e98aafc88765', 2, 'Overview of courses', 'The courses of the current and past semester are displayed here. New courses initially appear in red.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1405521244), +('fa963d2ca827b28e0082e98aafc88765', 3, 'Course details', 'With a click on the \"i\" a window appears with the most important benchmark data of the course.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1405931069), +('fa963d2ca827b28e0082e98aafc88765', 4, 'Course contents', 'All contents (such as e.g. a forum) are displayed by corresponding symbols here.\n\nIf there were any news since the last login these will appear in red.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1405931225), +('fa963d2ca827b28e0082e98aafc88765', 5, 'Leaving the course', 'A click on the door icon enables a direct removal from the course', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1405931272), +('fa963d2ca827b28e0082e98aafc88765', 6, 'Access to archived courses', 'If courses have been archived, they can be accessed here.', 'RT', 0, 'A#nav_browse_archive', 'dispatch.php/my_courses', '', 1405931431), +('fa963d2ca827b28e0082e98aafc88765', 7, 'Adjustment to the course view', 'In order to adjust the course overview you can arrange your courses according to certain criteria (such as e.g. fields of study, lecturers or colours).', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1405932131), +('fa963d2ca827b28e0082e98aafc88765', 8, 'Access to an course of past and future semesters', 'By clicking on the drop-down menu courses from past semesters can be displayed for example.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1405932230), +('fa963d2ca827b28e0082e98aafc88765', 9, 'Further possible actions', 'Here you can mark all news as read, change colour groups as you please, or\n\nalso adjust the notifications about activities in the individual events.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1405932320), +('fa963d2ca827b28e0082e98aafc88765', 10, 'Study groups and institutes', 'There is moreover the possibility to access personal study groups or institutes.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1405932519), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 1, 'Functions and design possibilities of the start page', 'This tour gives you an overview of the most important functions of the start page.\n\nIn order to reach the next step please click \"next\" on the bottom right', 'TL', 0, '', 'dispatch.php/start', '', 1405934926), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 2, 'Individual design of the start page', 'The default configuration of the start page is that the elements \"Quicklinks\", \"announcements\", \"my current appointments\" and \"surveys\" are displayed. The elements are called widgets and can be deleted, added and moved. Each widget can be individually added, deleted and moved.', 'TL', 0, '', 'dispatch.php/start', '', 1405934970), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 3, 'Add widget', 'Widgets can be added here. In addition to the standard widgets the personal timetable can, for example, be displayed on the start page. Newly added widgets appear right at the bottom on the start page. In addition, it is possible to jump directly to each widget in the sidebar.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI :eq(4)', 'dispatch.php/start', '', 1405935192), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 4, 'Jump labels', 'In addition, it is possible to jump directly to each widget using jump labels.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/start', '', 1406623464), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 5, 'Position widget', 'A widget can be moved to the desired position using drag&drop: For this purpose you click into the headline of a widget, hold down the mouse button, and drag the widget to the desired position.', 'B', 0, '.widget-header', 'dispatch.php/start', '', 1405935687), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 6, 'Edit widget', 'With several widgets a further symbol is displayed in addition to the X for closing. The widget \"Quicklinks\", for example, can be adjusted individually by clicking on this button, the announcements can be subscribed to and appointments can be added with the actual appointments or timetable.', 'L', 0, '#layout_content DIV UL DIV SPAN A IMG :eq(0)', 'dispatch.php/start', '', 1405935792), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 7, 'Remove widget', 'Each widget can be removed by clicking on the X in the right upper corner. If required, it can be added again at all times.', 'R', 0, '.widget-header', 'dispatch.php/start', '', 1405935376), +('3dbe7099f82dcdbba4580acb1105a0d6', 1, 'Administering the forum', 'You have the possibility to look at a tour for the administration of the forum.\n\nIn order to begin the tour please click \"next\" at the bottom right.', 'TL', 0, '', 'plugins.php/coreforum', '', 1405418008), +('3dbe7099f82dcdbba4580acb1105a0d6', 2, 'Edit category', 'The name of the category can be changed or, however, the whole category deleted with these icons. The sectors will in this case be shifted into the category \"General\" and are thus retained.\n\nThe category \"General\" cannot be deleted and is therefore included in each forum.', 'BR', 0, '#forum #sortable_areas TABLE CAPTION #tutorCategoryIcons', 'plugins.php/coreforum', '', 1405424216), +('3dbe7099f82dcdbba4580acb1105a0d6', 3, 'Edit area', 'Action icons will appear, if the cursor is positioned on an area\n\nYou can use the icons to change the name and description of an area, or to delete the whole area.\nThe deletion of an area causes all contained topics to be deleted.', 'B', 0, 'IMG.edit-area', 'plugins.php/coreforum', '', 1405424346), +('3dbe7099f82dcdbba4580acb1105a0d6', 4, 'Sort area', 'With this hatched surface areas can be sorted in at any place by clicking and dragging. This can, on one hand, be used in order to sort areas within a category, and on the other hand, areas can be shifted into other categories.', 'BR', 0, 'HTML #plugins #layout_wrapper #layout_page #layout_container #layout_content #forum #sortable_areas TABLE TBODY #tutorArea TD IMG#tutorMoveArea.handle.js :eq(1)', 'plugins.php/coreforum', '', 1405424379), +('3dbe7099f82dcdbba4580acb1105a0d6', 5, 'Add new area', 'New areas can be added to a category here.', 'BR', 0, 'TFOOT TR TD A SPAN', 'plugins.php/coreforum', '', 1405424421), +('3dbe7099f82dcdbba4580acb1105a0d6', 6, 'Create new category', 'A new category in the forum can be created here. Enter the title of the new category for this purpose.', 'TL', 0, '#tutorAddCategory H2', 'plugins.php/coreforum', '', 1405424458), +('9e9dca9b1214294b9605824bfe90fba1', 1, 'Create study group', 'Study groups enable the cooperation with fellow students or colleagues. This tour gives you an overview of how you can create study groups.\n\nIn order to go to the next step please click \"next\" at the bottom right.', 'R', 0, '', 'dispatch.php/my_studygroups', '', 1405684423), +('9e9dca9b1214294b9605824bfe90fba1', 2, 'Create study group', 'A new study group can be created with a click on \"create new study group\".', 'R', 0, 'A#nav_browse_new', 'dispatch.php/my_studygroups', '', 1406017730), +('9e9dca9b1214294b9605824bfe90fba1', 3, 'Name a study group', 'The name of a study group should be meaningful and unique in the whole Stud.IP.', 'R', 0, 'INPUT#groupname', 'dispatch.php/course/studygroup/new', '', 1405684720), +('9e9dca9b1214294b9605824bfe90fba1', 4, 'Add description', 'The description makes it possible to display additional information that makes it easier to find the group.', 'R', 0, 'TEXTAREA#groupdescription', 'dispatch.php/course/studygroup/new', '', 1405684806), +('9e9dca9b1214294b9605824bfe90fba1', 5, 'Allocate content elements', 'Content elements can be activated here, which are to be available within the study group. The question mark provides more detailed information on the meaning of the individual content elements', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(5)', 'dispatch.php/course/studygroup/new', '', 1405685093), +('9e9dca9b1214294b9605824bfe90fba1', 6, 'Stipulate access', 'The access to the study group can be restricted with this drop down menu.\n\nAll students can register freely and participate in the group with the access \"open for everyone\".\n\nWith the access \"upon request\" participants must be added by the group founder.', 'R', 0, 'SELECT#groupaccess', 'dispatch.php/course/studygroup/new', '', 1405685334), +('9e9dca9b1214294b9605824bfe90fba1', 7, 'Accept terms of use', 'The terms of use have to be accepted before you can create a study group.', 'R', 0, 'P LABEL', 'dispatch.php/course/studygroup/new', '', 1405685652), +('9e9dca9b1214294b9605824bfe90fba1', 8, 'Save study group', 'After you saved a study group it will appear under \"My courses\" > \"My study groups\".', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(14)', 'dispatch.php/course/studygroup/new', '', 1405686068), +('89786eac42f52ac316790825b4f5c0b2', 1, 'Forum', 'This tour provides an overview of the elements and interactional possibilities of the forum.\n\nIn order to go to the next step please click \"next\" on the bottom right.', 'BL', 0, '', 'plugins.php/coreforum', '', 1405415772), +('89786eac42f52ac316790825b4f5c0b2', 2, 'You are here:...', 'Here you can see which sector of the forum you are currently looking at.', 'BL', 0, 'DIV#tutorBreadcrumb', 'plugins.php/coreforum', '', 1405415875), +('89786eac42f52ac316790825b4f5c0b2', 3, 'Category', 'The forum is divided into categories, topics and posts. A category summarises forum areas into larger units of meaning.', 'BL', 0, '#layout_content #forum #sortable_areas TABLE CAPTION .category_name :eq(0)', 'plugins.php/coreforum', '', 1405416611), +('89786eac42f52ac316790825b4f5c0b2', 4, 'Area', 'This is an area within a category. Areas contain threads. The order of areas can be altered using drag&drop', 'BL', 0, '#layout_content #forum TABLE THEAD TR TH :eq(0)', 'plugins.php/coreforum', '', 1405416664), +('89786eac42f52ac316790825b4f5c0b2', 5, 'Info-Icon', 'This icon turns red as soon as there is something new in this sector.', 'B', 0, 'IMG#tutorNotificationIcon', 'plugins.php/coreforum', '', 1405416705), +('89786eac42f52ac316790825b4f5c0b2', 6, 'Search', 'All contents of this forum can be browsed here. Multiple word searches are also supported. In addition, the search can be limited to any combination of title, content and author.', 'BL', 0, '#layout-sidebar SECTION #tutorSearchInfobox DIV #tutorSearchInfobox UL LI INPUT :eq(1)', 'plugins.php/coreforum', '', 1405417134), +('89786eac42f52ac316790825b4f5c0b2', 7, 'Subscribe to forum', 'You can subscribe to the whole forum or individual topics . In this case a notification will be generated and you receive a meassage for each new post in this forum.', 'B', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(5)', 'plugins.php/coreforum', '', 1405416795), +('e41611616675b218845fe9f55bc11cf6', 1, 'Profile', 'This tour gives you an overview of the most important functions of the \"profile\".\n\nIn order to get to the next step please click \"next\" on the bottom right.', 'B', 0, '', 'dispatch.php/profile', '', 1406722657), +('e41611616675b218845fe9f55bc11cf6', 2, 'Upload a picture', 'A profile picture can be uploaded on this site.', 'BL', 0, '#nav_profile_avatar A SPAN', 'dispatch.php/settings/avatar', '', 1406722657), +('e41611616675b218845fe9f55bc11cf6', 3, 'Select picture', 'A image file can be uploaded for this purpose.', 'L', 0, 'input[name=imgfile]', 'dispatch.php/settings/avatar', '', 1406722657), +('e41611616675b218845fe9f55bc11cf6', 4, 'Requirements', 'The image file must be available in **.jpg**, **.png** or **.gif** format.\n\nThe document size must not exceed 700 KB.', 'L', 0, '#layout_content #edit_avatar TBODY TR TD FORM B :eq(2)', 'dispatch.php/settings/avatar', '', 1406722657), +('83dc1d25e924f2748ee3293aaf0ede8e', 1, 'What is Blubber?', 'This tour provides an overview of the most important functions of \"Blubber\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'plugins.php/blubber/streams/forum', '', 1405507364), +('83dc1d25e924f2748ee3293aaf0ede8e', 2, 'Create contribution', 'A discussion can be started here by writing a text. Paragraphs can be created by pressing shift+enter. The text will be sent by pressing enter.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405507478), +('83dc1d25e924f2748ee3293aaf0ede8e', 3, 'Design text', 'The text can be formatted and smileys can be used.\n\nThe customary formatting such as e.g. **bold** or %%italics%% can be used.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508371), +('83dc1d25e924f2748ee3293aaf0ede8e', 4, 'Mention persons', 'Others can be informed about a post by mentioning them in the post, using the format @user name or @''first name last name''.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405672301), +('83dc1d25e924f2748ee3293aaf0ede8e', 5, 'Add document', 'Documents can be inserted into a post by dragging them into an input field using drag&drop.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508401), +('83dc1d25e924f2748ee3293aaf0ede8e', 6, 'Hashtags', 'Posts can be issued with key words (\"hashtags\") by placing a # in front of the chosen word.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508442), +('83dc1d25e924f2748ee3293aaf0ede8e', 7, 'Hashtag cloud', 'By clicking on a hashtag, all posts containing this hashtag will be displayed.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/forum', '', 1405508505), +('83dc1d25e924f2748ee3293aaf0ede8e', 8, 'Change contribution', 'If the cursor is positioned on a post, its date will appear. For your own posts an additional icon will appear on the right next to the date. This icon allow you to subsequently edit your post.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/forum', '', 1405507901), +('83dc1d25e924f2748ee3293aaf0ede8e', 9, 'Link contribution', 'If the cursor is positioned on the first contribution to the discussion a link icon will appear on the left next to the date. If this is clicked using the right mouse button the link can be copied on this contribution in order to be able to insert it in another place.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/forum', '', 1405508281), +('588effa83da976a889a68c152bcabc90', 1, 'What is Blubber?', 'This tour provides an overview of the most important functions of \"Blubber\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'plugins.php/blubber/streams/profile', '', 1405507364), +('588effa83da976a889a68c152bcabc90', 2, 'Create contribution', 'A discussion can be started here by writing a text. Paragraphs can be created by pressing shift+enter. The text will be sent by pressing enter.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405507478), +('588effa83da976a889a68c152bcabc90', 3, 'Design text', 'The text can be formatted and smileys can be used.\n\nThe customary formatting such as e.g. **bold** or %%italics%% can be used.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508371), +('588effa83da976a889a68c152bcabc90', 4, 'Mention persons', 'Others can be informed about a post by mentioning them in the post, using the format @user name or @''first name last name''.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405672301), +('588effa83da976a889a68c152bcabc90', 5, 'Add document', 'Documents can be inserted into a post by dragging them into an input field using drag&drop.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508401), +('588effa83da976a889a68c152bcabc90', 6, 'Hashtags', 'Posts can be issued with key words (\"hashtags\") by placing a # in front of the chosen word.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508442), +('588effa83da976a889a68c152bcabc90', 7, 'Hashtag cloud', 'By clicking on a hashtag, all posts containing this hashtag will be displayed.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/profile', '', 1405508505), +('588effa83da976a889a68c152bcabc90', 8, 'Change contribution', 'If the cursor is positioned on a post, its date will appear. For your own posts an additional icon will appear on the right next to the date. This icon allow you to subsequently edit your post.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/profile', '', 1405507901), +('588effa83da976a889a68c152bcabc90', 9, 'Link contribution', 'If the cursor is positioned on the first contribution to the discussion a link icon will appear on the left next to the date. If this is clicked using the right mouse button the link can be copied on this contribution in order to be able to insert it in another place.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/profile', '', 1405508281), +('d9913517f9c81d2c0fa8362592ce5d0e', 1, 'What is Blubber?', 'This tour provides an overview of the most important functions of \"Blubber\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'plugins.php/blubber/streams/global', '', 1405507364), +('d9913517f9c81d2c0fa8362592ce5d0e', 2, 'Create contribution', 'A discussion can be started here by writing a text. Paragraphs can be created by pressing shift+enter. The text will be sent by pressing enter.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405507478), +('d9913517f9c81d2c0fa8362592ce5d0e', 3, 'Design text', 'The text can be formatted and smileys can be used.\n\nThe customary formatting such as e.g. **bold** or %%italics%% can be used.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508371), +('d9913517f9c81d2c0fa8362592ce5d0e', 4, 'Mention persons', 'Others can be informed about a post by mentioning them in the post, using the format @user name or @''first name last name''.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405672301), +('d9913517f9c81d2c0fa8362592ce5d0e', 5, 'Add document', 'Documents can be inserted into a post by dragging them into an input field using drag&drop.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508401), +('d9913517f9c81d2c0fa8362592ce5d0e', 6, 'Hashtags', 'Posts can be issued with key words (\"hashtags\") by placing a # in front of the chosen word.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508442), +('d9913517f9c81d2c0fa8362592ce5d0e', 7, 'Hashtag cloud', 'By clicking on a hashtag, all posts containing this hashtag will be displayed.', 'RT', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'plugins.php/blubber/streams/global', '', 1405508505), +('d9913517f9c81d2c0fa8362592ce5d0e', 8, 'Change contribution', 'If the cursor is positioned on a post, its date will appear. For your own posts an additional icon will appear on the right next to the date. This icon allow you to subsequently edit your post.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/global', '', 1405507901), +('d9913517f9c81d2c0fa8362592ce5d0e', 9, 'Link contribution', 'If the cursor is positioned on the first contribution to the discussion a link icon will appear on the left next to the date. If this is clicked using the right mouse button the link can be copied on this contribution in order to be able to insert it in another place.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/global', '', 1405508281), +('05434e40601a9a2a7f5fa8208ae148c1', 1, 'My documents', 'My documents is the personal document area. Documents can be stored on Stud.IP here in order to be able to download them from there onto other computers.\n\nOther students or lecturers do not receive any access to documents, which are uploaded into the personal document area.\n\nIn order to reach the next step please click on the right at the bottom on \"next\".', 'TL', 0, '', 'dispatch.php/document/files', '', 1405592884), +('05434e40601a9a2a7f5fa8208ae148c1', 2, 'Available storage space', 'The storage space of the personal document area is limited. It is displayed how much storage space is still available.', 'BR', 0, 'DIV.caption-actions', 'dispatch.php/document/files', '', 1405594184), +('05434e40601a9a2a7f5fa8208ae148c1', 3, 'New documents and indices', 'New documents can be uploaded from the computer into the personal document area and new indices can be created here.', 'TL', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(0)', 'dispatch.php/document/files', '', 1405593409), +('05434e40601a9a2a7f5fa8208ae148c1', 4, 'Document overview', 'All documents and indices are listed in a tabular form. In addition to the name even more information is displayed such as the document type or the document size.', 'TL', 0, '#layout_content FORM TABLE THEAD TR TH :eq(3)', 'dispatch.php/document/files', '', 1405593089), +('05434e40601a9a2a7f5fa8208ae148c1', 5, 'Actions', 'Already uploaded documents and folders can be edited, downloaded, shifted, copied and deleted here.', 'TR', 0, '#layout_content FORM TABLE THEAD TR TH :eq(7)', 'dispatch.php/document/files', '', 1405594079), +('05434e40601a9a2a7f5fa8208ae148c1', 6, 'Export', 'Here you have the possibility to download individual folders or the full document area as a ZIP document. All documents and indices are contained therein.', 'TL', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/document/files', '', 1405593708); +"; + DBManager::get()->exec($query); + + // add settings + $query = "INSERT IGNORE INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES +('7af1e1fb7f53c910ba9f42f43a71c723', 1, 'standard'), +('c89ce8e097f212e75686f73cc5008711', 1, 'standard'), +('de1fbce508d01cbd257f9904ff8c3b43', 1, 'standard'), +('1badcf28ab5b206d9150b2b9683b4cb6', 1, 'standard'), +('fa963d2ca827b28e0082e98aafc88765', 1, 'standard'), +('f0aeb0f6c4da3bd61f48b445d9b30dc1', 1, 'standard'), +('3dbe7099f82dcdbba4580acb1105a0d6', 1, 'standard'), +('9e9dca9b1214294b9605824bfe90fba1', 1, 'standard'), +('89786eac42f52ac316790825b4f5c0b2', 1, 'standard'), +('e41611616675b218845fe9f55bc11cf6', 1, 'standard'), +('83dc1d25e924f2748ee3293aaf0ede8e', 1, 'standard'), +('588effa83da976a889a68c152bcabc90', 1, 'standard'), +('d9913517f9c81d2c0fa8362592ce5d0e', 1, 'standard'), +('05434e40601a9a2a7f5fa8208ae148c1', 1, 'standard'); +"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.166_add_cache_operations_table.php b/db/migrations/1.166_add_cache_operations_table.php new file mode 100644 index 0000000..671152f --- /dev/null +++ b/db/migrations/1.166_add_cache_operations_table.php @@ -0,0 +1,34 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.3 + */ +class AddCacheOperationsTable extends Migration +{ + public function description() + { + return 'Creates the database table for proxied cache operations'; + } + + public function up() + { + $query = "CREATE TABLE IF NOT EXISTS `cache_operations` ( + `cache_key` VARCHAR(256) NOT NULL DEFAULT '', + `operation` CHAR(6) NOT NULL DEFAULT '', + `parameters` TEXT NOT NULL, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`cache_key`(200), `operation`) + )"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "DROP TABLE `cache_operations`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.167_tic5661_setup_cronjob.php b/db/migrations/1.167_tic5661_setup_cronjob.php new file mode 100644 index 0000000..14e3540 --- /dev/null +++ b/db/migrations/1.167_tic5661_setup_cronjob.php @@ -0,0 +1,37 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.3 + */ + +class Tic5661SetupCronjob extends Migration +{ + public function description() + { + return 'Registers the cronjob for TIC 5661 that removes expired ' + . 'entries from the table "object_user_visits".'; + } + + public function up() + { + CronjobScheduler::registerTask($this->getFilename(), false); + } + + public function down() + { + $task_id = CronjobTask::findOneByFilename($this->getFilename())->task_id; + CronjobScheduler::unregisterTask($task_id); + } + + private function getFilename() + { + return 'lib/cronjobs/clean_object_user_visits.php'; + } +} diff --git a/db/migrations/1.168_tic5661_add_config.php b/db/migrations/1.168_tic5661_add_config.php new file mode 100644 index 0000000..713c30c --- /dev/null +++ b/db/migrations/1.168_tic5661_add_config.php @@ -0,0 +1,37 @@ +execute(" + INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + ", [ + 'name' => 'NEW_INDICATOR_THRESHOLD', + 'value' => '180', + 'type' => 'integer', + 'range' => 'global', + 'section' => 'global', + 'description' => 'Gibt an, nach wieviel Tagen ein Eintrag als alt ' + . 'angesehen und nicht mehr rot markiert werden ' + . 'soll (0 angeben, um nur das tatsächliche Alter) ' + . 'zu betrachten.', + ] + ); + } + + public function down() + { + DBManager::get()->exec("DELETE FROM config WHERE `field` = 'NEW_INDICATOR_THRESHOLD'"); + } +} diff --git a/db/migrations/1.16_step_00126_embedding_flash_movies.php b/db/migrations/1.16_step_00126_embedding_flash_movies.php new file mode 100644 index 0000000..13e8159 --- /dev/null +++ b/db/migrations/1.16_step_00126_embedding_flash_movies.php @@ -0,0 +1,29 @@ +announce("add new values EXTERNAL_FLASH_MOVIE_EMBEDDING and to table config"); + + DBManager::get()->exec("INSERT INTO `config` VALUES (MD5('EXTERNAL_FLASH_MOVIE_EMBEDDING'), '', 'EXTERNAL_FLASH_MOVIE_EMBEDDING', 'deny', 1, 'string', 'global', '', 0, 1157107088, 1157107088, 'Sollen externe Flash-Filme mit Hilfe des [flash]-Tags der Schnellformatierung eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', '', '')"); + + DBManager::get()->exec("INSERT INTO `config` VALUES (MD5('DOCUMENTS_EMBEDD_FLASH_MOVIES'), '', 'DOCUMENTS_EMBEDD_FLASH_MOVIES', 'deny', 1, 'string', 'global', '', 0, 1157107088, 1157107088, 'Sollen im Dateibereich Flash-Filme direkt in einem Player angezeigt werden? deny=nicht erlaubt, allow=erlaubt, autoload=Film wird beim aufklappen geladen (incrementiert Downloads), autoplay=Film wird sofort abgespielt', '', '')"); + + $this->announce("done."); + + } + + public function down () + { + $this->announce("remove values EXTERNAL_FLASH_MOVIE_EMBEDDING and DOCUMENTS_EMBEDD_FLASH_MOVIES from table config"); + + DBManager::get()->exec("DELETE FROM `config` WHERE config_id IN(MD5('EXTERNAL_FLASH_MOVIE_EMBEDDING'), MD5('DOCUMENTS_EMBEDD_FLASH_MOVIES'))"); + + $this->announce("done."); + } +} \ No newline at end of file diff --git a/db/migrations/1.170_step_00286_coursewizard.php b/db/migrations/1.170_step_00286_coursewizard.php new file mode 100644 index 0000000..7717d44 --- /dev/null +++ b/db/migrations/1.170_step_00286_coursewizard.php @@ -0,0 +1,63 @@ +execute("CREATE TABLE IF NOT EXISTS `coursewizardsteps` ( + `id` VARCHAR(32) NOT NULL, + `name` VARCHAR(255) NOT NULL, + `classname` VARCHAR(255) NOT NULL UNIQUE, + `number` TINYINT(1) NOT NULL, + `enabled` TINYINT(1) NOT NULL DEFAULT 1, + `mkdate` INT NOT NULL DEFAULT 0, + `chdate` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`))"); + // Add the default steps: + // Step 1: Basic data. + if (!CourseWizardStepRegistry::findByClassName('BasicDataWizardStep')) { + CourseWizardStepRegistry::registerStep('Grunddaten', 'BasicDataWizardStep', 1, true); + } + // Step 2: Study area assignment (there are course classes requiring this). + if (!CourseWizardStepRegistry::findByClassName('StudyAreasWizardStep')) { + CourseWizardStepRegistry::registerStep('Studienbereiche', 'StudyAreasWizardStep', 2, true); + } + // Add text template for studygroup acceptance to global config. + if (!Config::get()->STUDYGROUP_ACCEPTANCE_TEXT) { + DBManager::get()->execute(" + INSERT IGNORE INTO config + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + ", + [ + 'name' => 'STUDYGROUP_ACCEPTANCE_TEXT', + 'value' => _('Die Moderatorinnen und ' . + 'Moderatoren der Studiengruppe können Ihren ' . + 'Aufnahmewunsch bestätigen oder ablehnen. Erst nach ' . + 'Bestätigung erhalten Sie vollen Zugriff auf die ' . + 'Gruppe.'), + 'type' => 'string', + 'range' => 'global', + 'section' => 'studygroups', + 'description' => _('Text, der angezeigt wird, wenn man sich ' . + 'in eine zugriffsbeschränkte Studiengruppe eintragen möchte') + ] + ); + } + } + + function down() + { + DBManager::get()->exec("DROP TABLE IF EXISTS `coursewizardsteps`"); + } + +} diff --git a/db/migrations/1.171_open_personal_file_areas.php b/db/migrations/1.171_open_personal_file_areas.php new file mode 100644 index 0000000..59a5041 --- /dev/null +++ b/db/migrations/1.171_open_personal_file_areas.php @@ -0,0 +1,48 @@ + + * @license GPL2 or any later version + */ + +class OpenPersonalFileAreas extends Migration +{ + public function description() + { + return 'Create config entries for open personal file areas'; + } + + public function up() + { + $query = "INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description`) + VALUES (:id, :field, :value, 1, :type, 'global', 'files', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + $statement = DBManager::get()->prepare($query); + + $statement->execute([ + ':id' => md5(uniqid('PERSONALDOCUMENT_OPEN_ACCESS')), + ':field' => 'PERSONALDOCUMENT_OPEN_ACCESS', + ':value' => (int) false, + ':type' => 'boolean', + ':description' => 'Schaltet die persönlichen Dateibereiche zur Einsicht für alle Nutzer frei', + ]); + + $statement->execute([ + ':id' => md5(uniqid('PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED')), + ':field' => 'PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED', + ':value' => (int) true, + ':type' => 'boolean', + ':description' => 'Erlaubt Root-Accounts das Verändern von persönlichen Dateibereiche im Namen fremder Nutzer', + ]); + } + + public function down() + { + DBManager::get()->query("DELETE FROM config WHERE field IN ('PERSONALDOCUMENT_OPEN_ACCESS', 'PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED')"); + } + } diff --git a/db/migrations/1.172_tic_5961_add_config_default_sem.php b/db/migrations/1.172_tic_5961_add_config_default_sem.php new file mode 100644 index 0000000..9c32999 --- /dev/null +++ b/db/migrations/1.172_tic_5961_add_config_default_sem.php @@ -0,0 +1,32 @@ +execute(" + INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + ", [ + 'name' => 'MY_COURSES_DEFAULT_CYCLE', + 'value' => 'last', + 'type' => 'string', + 'range' => 'global', + 'section' => 'MeineVeranstaltungen', + 'description' => 'Standardeinstellung für den Semester-Filter, falls noch keine Auswahl getätigt wurde. (all, future, current, last)', + ] + ); + } + + function down() + { + DBManager::get()->exec("DELETE FROM config WHERE `field` = 'MY_COURSES_DEFAULT_CYCLE'"); + } +} diff --git a/db/migrations/1.173_biest5982_fix_resources_objects_level.php b/db/migrations/1.173_biest5982_fix_resources_objects_level.php new file mode 100644 index 0000000..1f7a2bc --- /dev/null +++ b/db/migrations/1.173_biest5982_fix_resources_objects_level.php @@ -0,0 +1,61 @@ +prepare($query); + + // Update the level for all children of a set of parent ids. + $query = "UPDATE `resources_objects` + SET `level` = :level + WHERE `parent_id` IN (:ids)"; + $child_statement = DBManager::get()->prepare($query); + + // Loop until the hierarchy has been built. + $level = 0; + do { + // Read parent ids + $parent_statement->bindValue(':level', $level); + $parent_statement->execute(); + $parent_ids = $parent_statement->fetchAll(PDO::FETCH_COLUMN); + + // No parents, no children -> we're done. + if (count($parent_ids) === 0) { + break; + } + + // Increase level + $level = $level + 1; + + // Update level on all children, exit if no children have been + // found/updated. + $child_statement->bindValue(':level', $level); + $child_statement->bindValue(':ids', $parent_ids, StudipPDO::PARAM_ARRAY); + $updated_rows = $child_statement->execute(); + } while ($updated_rows > 0); + } + + public function down() + { + // No, we don't need this. + } +} diff --git a/db/migrations/1.174_tic_6018_clean_news.php b/db/migrations/1.174_tic_6018_clean_news.php new file mode 100644 index 0000000..7683b46 --- /dev/null +++ b/db/migrations/1.174_tic_6018_clean_news.php @@ -0,0 +1,32 @@ +execute(" + INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + ", [ + 'name' => 'NEWS_DISPLAY', + 'value' => '2', + 'type' => 'integer', + 'range' => 'global', + 'section' => 'view', + 'description' => 'Legt fest, wie sich News für Anwender präsentieren. (2 zeigt sowohl Autor als auch Zugriffszahlen an. 1 zeigt nur den Autor an. 0 blendet beides für Benutzer aus.', + ] + ); + } + + function down() + { + DBManager::get()->exec("DELETE FROM config WHERE `field` = 'NEWS_DISPLAY'"); + } +} diff --git a/db/migrations/1.175_biest6024_fix_help_tours_en.php b/db/migrations/1.175_biest6024_fix_help_tours_en.php new file mode 100644 index 0000000..91bf78f --- /dev/null +++ b/db/migrations/1.175_biest6024_fix_help_tours_en.php @@ -0,0 +1,55 @@ + "This tour provides an overview of the supplied search options.\r\n\r\To proceed, please click \"Continue\" in the lower-right corner.", + 'c89ce8e097f212e75686f73cc5008711' => "This tour provides an overview of the participant administration\'s options.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + 'de1fbce508d01cbd257f9904ff8c3b43' => "This tour provides a general overview of the profile page\'s structure.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '1badcf28ab5b206d9150b2b9683b4cb6' => "This tour provides an overview of the functionality of \"My courses\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + 'fa963d2ca827b28e0082e98aafc88765' => "This tour provides an overview of the functionality of \"My courses\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + 'f0aeb0f6c4da3bd61f48b445d9b30dc1' => "This tour provides an overview of the start page\'s features and functions.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '3dbe7099f82dcdbba4580acb1105a0d6' => "This tour provides an overview of the forum\'s administration.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '9e9dca9b1214294b9605824bfe90fba1' => "This tour provides an overview of the creation of study groups to cooperate with fellow students.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '89786eac42f52ac316790825b4f5c0b2' => "This tour provides an overview of the forum\'s elements and options of interaction.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + 'e41611616675b218845fe9f55bc11cf6' => "This tour shows how to upload a picture in the profile page.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '83dc1d25e924f2748ee3293aaf0ede8e' => "This tour provides an overview of the functionality of \"Blubber\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '588effa83da976a889a68c152bcabc90' => "This tour provides an overview of the functionality of \"Blubber\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + 'd9913517f9c81d2c0fa8362592ce5d0e' => "This tour provides an overview of the functionality of \"Blubber\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", + '05434e40601a9a2a7f5fa8208ae148c1' => "This tour provides an overview of the personal document manager.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner." + ]; + + foreach($new_first_steps as $key => $value) { + $update = "UPDATE help_tour_steps + SET tip = '$value' + WHERE tour_id = '$key' AND + step = 1 + "; + DBManager::get()->exec($update); + } + } + + /** + * {@inheritdoc} + */ + public function down() { + // processed in 164_help_tours_en.php + } +} \ No newline at end of file diff --git a/db/migrations/1.176_limit_mailqueue.php b/db/migrations/1.176_limit_mailqueue.php new file mode 100644 index 0000000..5fd9b78 --- /dev/null +++ b/db/migrations/1.176_limit_mailqueue.php @@ -0,0 +1,31 @@ +prepare($query); + + $statement->execute([ + ':field' => 'MAILQUEUE_SEND_LIMIT', + ':value' => "0", + ':type' => 'integer', + ':description' => 'Wieviele Mails soll die Mailqueue maximal auf einmal an den Mailserver schicken. 0 für unendlich viele.', + ]); + } + + function down() + { + DBManager::get()->query("DELETE FROM config WHERE field IN ('MAILQUEUE_SEND_LIMIT')"); + } +} diff --git a/db/migrations/1.177_tic5415_plugin_assets.php b/db/migrations/1.177_tic5415_plugin_assets.php new file mode 100644 index 0000000..64bf392 --- /dev/null +++ b/db/migrations/1.177_tic5415_plugin_assets.php @@ -0,0 +1,38 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.4 + * + * @see https://develop.studip.de/trac/ticket/5415 + */ +class Tic5415PluginAssets extends Migration +{ + function description() + { + return 'Creates the database tables that store the plugin assets information'; + } + + public function up() + { + $query = "CREATE TABLE IF NOT EXISTS `plugin_assets` ( + `asset_id` char(32) NOT NULL DEFAULT '', + `plugin_id` int(10) unsigned NOT NULL, + `type` enum('css') NOT NULL DEFAULT 'css', + `filename` varchar(255) NOT NULL DEFAULT '', + `storagename` varchar(255) NOT NULL DEFAULT '', + `size` int(11) unsigned DEFAULT NULL, + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`asset_id`) + )"; + DBManager::get()->exec($query); + } + + public function down() + { + DBManager::get()->exec("DROP TABLE `plugin_assets`"); + } +} diff --git a/db/migrations/1.178_change_opengraph_data_pk.php b/db/migrations/1.178_change_opengraph_data_pk.php new file mode 100644 index 0000000..d7154bd --- /dev/null +++ b/db/migrations/1.178_change_opengraph_data_pk.php @@ -0,0 +1,29 @@ + + * @license GPL2 or any later version + */ +class ChangeOpengraphDataPk extends Migration +{ + public function up() + { + $query = "ALTER TABLE `opengraphdata` + DROP PRIMARY KEY, + ADD COLUMN `opengraph_id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST, + ADD UNIQUE KEY `url` (`url`(512))"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `opengraphdata` + DROP PRIMARY KEY, + DROP INDEX `url`, + DROP COLUMN `opengraph_id`, + ADD PRIMARY KEY (`url`)"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.179_tic6188_view_resource_occupation.php b/db/migrations/1.179_tic6188_view_resource_occupation.php new file mode 100644 index 0000000..3b2bcb0 --- /dev/null +++ b/db/migrations/1.179_tic6188_view_resource_occupation.php @@ -0,0 +1,50 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.4 + * + * @see https://develop.studip.de/trac/ticket/6188 + */ +class Tic6188ViewResourceOccupation extends Migration +{ + /** + * Describe migration: add config switch. + * @return string + */ + public function description() + { + return 'Creates a config switch for restricting who may view resource occupation schedules'; + } + + /** + * Adds a config switch for configuring resource occupation access. + */ + public function up() + { + // Add config entry. + $query = "INSERT IGNORE INTO `config` + (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description`) + VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'resources', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + $statement = DBManager::get()->prepare($query); + + $statement->execute([ + ':field' => 'RESOURCES_ALLOW_VIEW_RESOURCE_OCCUPATION', + ':value' => '1', + ':type' => 'boolean', + ':description' => 'Dürfen alle Nutzer Ressourcenbelegungen einsehen?', + ]); + } + + /** + * Removes config switch for resource occupation access. + */ + public function down() + { + DBManager::get()->exec("DELETE FROM `config` WHERE `field`='RESOURCES_ALLOW_VIEW_RESOURCE_OCCUPATION'"); + } +} diff --git a/db/migrations/1.17_db_optimierung_kontingentierung.php b/db/migrations/1.17_db_optimierung_kontingentierung.php new file mode 100644 index 0000000..3ff923a --- /dev/null +++ b/db/migrations/1.17_db_optimierung_kontingentierung.php @@ -0,0 +1,38 @@ +announce("add keys..."); + + $db = DBManager::get(); + $mode = $db->getAttribute(PDO::ATTR_ERRMODE); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + $db->query("ALTER TABLE `admission_seminar_studiengang` ADD INDEX `studiengang_id` ( `studiengang_id` )"); + $db->query("ALTER TABLE `admission_seminar_user` ADD INDEX `seminar_id` ( `seminar_id`, `studiengang_id`, `status` )"); + $db->query("ALTER TABLE `seminar_user` ADD INDEX `Seminar_id` ( `Seminar_id`, `admission_studiengang_id` )"); + $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); + + $this->announce("done."); + } + + public function down () + { + $this->announce("delete keys..."); + + $db = DBManager::get(); + $mode = $db->getAttribute(PDO::ATTR_ERRMODE); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + $db->query("ALTER TABLE `admission_seminar_studiengang` DROP INDEX `studiengang_id`"); + $db->query("ALTER TABLE `admission_seminar_user` DROP INDEX `seminar_id`"); + $db->query("ALTER TABLE `seminar_user` DROP INDEX `Seminar_id`"); + $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.180_add_seminar_is_complete_status.php b/db/migrations/1.180_add_seminar_is_complete_status.php new file mode 100644 index 0000000..d1e6ae9 --- /dev/null +++ b/db/migrations/1.180_add_seminar_is_complete_status.php @@ -0,0 +1,37 @@ +exec($query); + + $query = "INSERT INTO `config` (`config_id`, `field`, `value`, `type`, + `range`, `section`, `mkdate`, `chdate`, + `description`, `comment`) + VALUES (MD5(CONCAT('CONFIG_', :field)), :field, 0, 'boolean', + 'global', 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Definiert, ob auf der Admin-Veranstaltunggseite der Komplett-Status für Veranstaltungen aufgeführt sein soll', '')"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':field', 'ADMIN_COURSES_SHOW_COMPLETE'); + $statement->execute(); + } + + public function down() + { + $query = "ALTER TABLE `seminare` + DROP COLUMN `is_complete`"; + DBManager::get()->exec($query); + + $query = "DELETE FROM `config` WHERE `field` = :field"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':field', 'ADMIN_COURSES_SHOW_COMPLETE'); + $statement->execute(); + } +} diff --git a/db/migrations/1.181_extend_wiki_size.php b/db/migrations/1.181_extend_wiki_size.php new file mode 100644 index 0000000..1f64a32 --- /dev/null +++ b/db/migrations/1.181_extend_wiki_size.php @@ -0,0 +1,38 @@ +exec("ALTER TABLE scm CHANGE tab_name tab_name varchar(255) NOT NULL DEFAULT '', + CHANGE content content mediumtext NOT NULL"); + $db->exec("ALTER TABLE user_info CHANGE lebenslauf lebenslauf mediumtext NOT NULL, + CHANGE publi publi mediumtext NOT NULL"); + $db->exec("ALTER TABLE wiki CHANGE keyword keyword varchar(255) BINARY NOT NULL DEFAULT '', + CHANGE body body mediumtext NOT NULL"); + $db->exec("ALTER TABLE wiki_links CHANGE from_keyword from_keyword varchar(255) BINARY NOT NULL DEFAULT '', + CHANGE to_keyword to_keyword varchar(255) BINARY NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE wiki_locks CHANGE keyword keyword varchar(255) BINARY NOT NULL DEFAULT ''"); + } + + public function down() + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE scm CHANGE tab_name tab_name varchar(20) NOT NULL DEFAULT 'Info', + CHANGE content content text"); + $db->exec("ALTER TABLE user_info CHANGE lebenslauf lebenslauf text, + CHANGE publi publi text NOT NULL"); + $db->exec("ALTER TABLE wiki CHANGE keyword keyword varchar(128) BINARY NOT NULL DEFAULT '', + CHANGE body body text"); + $db->exec("ALTER TABLE wiki_links CHANGE from_keyword from_keyword char(128) BINARY NOT NULL DEFAULT '', + CHANGE to_keyword to_keyword char(128) BINARY NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE wiki_locks CHANGE keyword keyword varchar(128) BINARY NOT NULL DEFAULT ''"); + } +} diff --git a/db/migrations/1.182_step_raum_zeit_end_offset.php b/db/migrations/1.182_step_raum_zeit_end_offset.php new file mode 100644 index 0000000..71eb020 --- /dev/null +++ b/db/migrations/1.182_step_raum_zeit_end_offset.php @@ -0,0 +1,28 @@ +exec('ALTER TABLE `seminar_cycle_dates` ADD COLUMN `end_offset` TINYINT(3) NULL AFTER `week_offset`'); + + //CHANGE route entry in help_content from raumzeit.php to new dispatch.php/course/timesrooms + $query = 'UPDATE `help_content` SET route = :new WHERE route = :old'; + $stm = DBManager::get()->prepare($query); + $stm->execute([':new' => 'dispatch.php/course/timesrooms', ':old' => 'raumzeit.php']); + } + + public function down() + { + DBManager::get()->exec('ALTER TABLE `seminar_cycle_dates` DROP COLUMN `end_offset`'); + + //CHANGE route entry in help_content from dispatch.php/course/timesrooms back to raumzeit.php + $query = 'UPDATE `help_content` SET route = :old WHERE route = :new'; + $stm = DBManager::get()->prepare($query); + $stm->execute([':new' => 'dispatch.php/course/timesrooms', ':old' => 'raumzeit.php']); + } +} diff --git a/db/migrations/1.183_tic6000_datafields_visibility.php b/db/migrations/1.183_tic6000_datafields_visibility.php new file mode 100644 index 0000000..a14f5ff --- /dev/null +++ b/db/migrations/1.183_tic6000_datafields_visibility.php @@ -0,0 +1,27 @@ + + * @license GPL2 or any later version + */ +class Tic6000DatafieldsVisibility extends Migration +{ + public function description() + { + return 'Adds another visibility setting to datafields'; + } + + public function up() + { + $query = "ALTER TABLE `datafields` + ADD COLUMN `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `datafields` DROP COLUMN `system`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.184_add_wiki_help_tours.php b/db/migrations/1.184_add_wiki_help_tours.php new file mode 100644 index 0000000..6ffe59d --- /dev/null +++ b/db/migrations/1.184_add_wiki_help_tours.php @@ -0,0 +1,149 @@ + + * @license GPL2 or any later version + */ + +class AddWikiHelpTours extends Migration +{ + /** + * Returns the description of the migration. + */ + public function description() + { + return "Adds the wiki's help tours."; + } + + /** + * Adds the wiki's help tours in to the database. + */ + public function up() + { + // add tour data + $insert = "INSERT IGNORE INTO `help_tours` (`tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `mkdate`) VALUES + ('4d41c9760a3248313236af202275107a', 'Allgemeines zum Wiki', 'Die Tour gibt einen allgemeinen Überblick über das Wiki.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1441276241), + ('4d41c9760a3248313236af202275107b', 'Schreiben im Wiki', 'Die Tour erklärt, wie das Wiki bearbeitet werden kann.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1441276241), + ('4d41c9760a3248313236af202275107c', 'Lesen im Wiki', 'Die Tour erklärt die verschiedenen Anzeige-Modalitäten zum Lesen des Wikis.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1441276241), + ('5d41c9760a3248313236af202275107a', 'General information on the Wiki', 'This tour provides general information about the Wiki.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1441276241), + ('5d41c9760a3248313236af202275107b', 'Editing the Wiki', 'This tour provides help for editing Wiki pages.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1441276241), + ('5d41c9760a3248313236af202275107c', 'Reading the Wiki', 'This tour provides help for reading Wiki pages.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1441276241); + "; + + DBManager::get()->exec($insert); + + // add steps + $insert = "INSERT IGNORE INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `mkdate`) VALUES + ('4d41c9760a3248313236af202275107a', 1, 'Allgemeines zum Wiki', 'Diese Tour gibt einen allgemeinen Überblick über das Wiki.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107a', 2, 'Kooperative Textarbeit', 'Das Wiki ist ein Tool für kooperative Textarbeit. Alle Teilnehmenden einer Veranstaltung haben das Recht, Texte zu erstellen, zu ändern und zu löschen.', 'B', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107a', 3, 'Textänderungen schaden nicht', 'Weil das Wiki alle Textänderungen einer Seite protokolliert, können vorhergehende Versionen der Seite wiederhergestellt werden.', 'B', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107a', 4, 'Textänderungen zurücknehmen', 'Textänderungen in einer Wiki-Seite lassen sich rückgängig machen, indem eine vorhergehende Version der Seite wiederhergestellt wird.', 'B', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107a', 5, 'Neue Version einer Wiki-Seite', 'Wird eine Wiki-Seite bearbeitet, so erfolgt die Übernahme der Textänderungen sofort beim Speichern. Eine neue Version der Seite wird dreißig Minuten nach der Speicherung erstellt.', 'B', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107a', 6, 'Kein synchrones Schreiben', 'Das Wiki ist nicht zum synchronen Schreiben geeignet. Es kann immer nur eine Person an einer Seite gleichzeitig arbeiten. Sobald eine zweite Person die Seite im Editor öffnet, erscheint eine Warnmeldung.', 'B', 0, '', 'wiki.php', 1441276241), + + ('4d41c9760a3248313236af202275107b', 1, 'Schreiben im Wiki', 'Diese Tour gibt einen Überblick über die Erstellung und Bearbeitung von Wiki-Seiten.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 2, 'WikiWikiWeb', 'Zeigt die Basis-Seite des Wikis an. Sie bildet die strukturelle Grundlage des gesamten Wikis.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 3, 'Neue Seiten', 'Zeigt eine tabellarische Übersicht neu erstellter und neu bearbeiteter Wiki-Seiten an.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 4, 'Alle Seiten', 'Zeigt eine tabellarische Übersicht aller Wiki-Seiten an.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 5, 'Wiki-Seite bearbeiten', 'Durch einen Klick auf die Schaltfläche \"Bearbeiten\" öffnet sich ein Editor, über den eine Wiki-Seite mit Inhalt gefüllt werden kann.\r\n\r\nDie Eingabe eines Namens in doppelten eckigen Klammern erzeugt eine neue Wiki-Seite und vernetzt sie mit der angezeigten Seite.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 6, 'Inhalt einer Wiki-Seite löschen', 'Der Inhalt einer Wiki-Seite lässt sich mit Hilfe eines Klicks auf die Schaltfläche \"Löschen\" entfernen. Die Wiki-Seite bleibt dabei erhalten.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(1)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 7, 'QuickLinks', 'Dieser Bildschirmbereich zeigt eine Liste von QuickLinks (Verweisen) auf Wiki-Seiten. Ein Klick auf einen QuickLink öffnet die korrelierende Wiki-Seite. Deren Inhalt lässt sich mit Hilfe der Schaltflächen \"Bearbeiten\" und \"Löschen\" gestalten.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107b', 8, 'QuickLinks bearbeiten', 'Ein Klick auf dieses Icon öffnet einen Editor, der zur Bearbeitung der QuickLinks dient.\r\n\r\nNeue QuickLinks lassen sich mit doppelten eckigen Klammern erstellen: [[Name]]. Das Löschen eines QuickLinks entfernt die korrelierende Seite aus der Liste.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0) DIV:eq(0) A:eq(0) IMG:eq(0)', 'wiki.php', 1441276241), + + ('4d41c9760a3248313236af202275107c', 1, 'Lesen im Wiki', 'Diese Tour gibt einen Überblick über die Anzeige von Wiki-Seiten.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 2, 'WikiWikiWeb', 'Zeigt die Basis-Seite des Wikis an.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 3, 'Neue Seiten', 'Zeigt eine tabellarische Übersicht neu erstellter und neu bearbeiteter Wiki-Seiten an.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 4, 'Alle Seiten', 'Zeigt eine tabellarische Übersicht aller Wiki-Seiten an.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 5, 'Ansichten', 'Wenn eine Textänderung in einer Wiki-Seite vorgenommen wurde, stehen drei Anzeigemodi zur Auswahl:\r\n- Standard: Ohne Zusatzinformation\r\n- Textänderungen anzeigen: Welche Textpassagen wurden geändert?\r\n- Text mit AutorInnenzuordnung anzeigen: Wer hat hat etwas geändert?', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(11) DIV:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 6, 'Suche', 'Zeigt die Wiki-Seiten an, in denen der eingegebene Suchbegriff vorkommt. Die Suche steht nur in der Standard-Ansicht zur Verfügung.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(14) DIV:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 7, 'Kommentare', 'Stellt verschiedene Modalitäten zur Anzeige von Kommentaren bereit, die in einer Wiki-Seite eingetragen wurden.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 8, 'Kommentare einblenden', 'Alle Kommentare werden als Textblock an der Textposition angezeigt, an der sie in die Wiki-Seite eingefügt wurden.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(0) A:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 9, 'Kommentare als Icon einblenden', 'Für jeden Kommentar wird an der Stelle, wo er in die Wiki-Seite eingefügt wurde, ein Icon angezeigt. Ein Klick auf das Icon öffnet den Kommentar.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(1) A:eq(0)', 'wiki.php', 1441276241), + ('4d41c9760a3248313236af202275107c', 10, 'Kommentare ausblenden', 'Die in einer Wiki-Seite eingefügten Kommentare werden nicht angezeigt.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(2) A:eq(0)', 'wiki.php', 1441276241), + + ('5d41c9760a3248313236af202275107a', 1, 'General information on the Wiki', 'This tour provides general information about the Wiki.\r\n\r\nTo proceed, please click \"Continue\" on the lower-right button.', 'T', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107a', 2, 'Tool for collaborative use', 'The Wiki is a collaborative tool. Every user may create, edit and delete content.', 'B', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107a', 3, 'Changes in a Wiki page', 'Since all changes in a Wiki page are saved in a protocol, previous versions of its content can be restored.', 'B', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107a', 4, 'New version of a Wiki page', 'While editing text in a Wiki page, clicking the Save-Button will save its content immediately. A new version of a Wiki page is displayed thirty minutes after saving at the latest.', 'B', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107a', 5, 'Undo changes', 'All changes can be undone by restoring a previous version of text.', 'B', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107a', 6, 'No support of synchronous editing', 'The editor is not designed for synchronous writing. Only one person may edit a page at the same time. If a second person links up to edit the same page, a warning message appears.', 'B', 0, '', 'wiki.php', 1441276241), + + ('5d41c9760a3248313236af202275107b', 1, 'Editing the Wiki', 'This tour provides a general overview of how to create and edit Wiki pages.\r\n\r\nTo proceed, please click \"Continue\" on the lower-right button.', 'T', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 2, 'WikiWikiWeb', 'Displays the basic Wiki page, which is the foundation of all further Wiki pages.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 3, 'New pages', 'Displays a survey of all recently created or edited Wiki pages in table form.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 4, 'All pages', 'Displays a survey of all Wiki pages in table form.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 5, 'Editing the a Wiki page', 'Clicking here will open an editor, allowing to fill a Wiki page with content.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 6, 'Deleting the content of a Wiki page', 'Clicking here will delete all content and links of a Wiki page leaving it blank.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(1)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 7, 'QuickLinks', 'This box displays links, leading to other Wiki pages. Selecting a link will forward to the related page. The content there may be edited the same way as described in step 5 and six.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107b', 8, 'Editing QuickLinks', 'A click on this icon will open an editor to edit the QuickLinks.\r\n\r\nEntering a name within double square brackets like [[name]] in the editor will create a new QuickLink leading to a correlating page. Deleting a QuickLink will cause its deletion in the QuickLink box.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0) DIV:eq(0) A:eq(0) IMG:eq(0)', 'wiki.php', 1441276241), + + ('5d41c9760a3248313236af202275107c', 1, 'Reading the Wiki', 'This tour gives a general overview of the different modes to read Wiki pages.\r\n\r\nTo proceed, please click \"Continue\" on the lower-right button.', 'T', 0, '', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 2, 'WikiWikiWeb', 'Displays the basic Wiki page, which is the foundation of all further Wiki pages.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 3, 'New pages', 'Displays a survey of all recently created or edited Wiki pages in table form.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 4, 'All pages', 'Displays a survey of all Wiki pages in table form.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 5, 'Views', 'If a Wiki page has been edited, the user may choose between three modes of viewing content:\r\n- Standard: Without extra information\r\n- Show text changes: Which parts of text have been edited?\r\n- Show text changes and associated author: Who was editing a part of text?', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(11) DIV:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 6, 'Search', 'Shows all Wiki pages which contain the entered search term. The search is supported in Standard-View only.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(14) DIV:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 7, 'Comments', 'Supports three modes of showing comments added to a Wiki page.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 8, 'Show comments', 'All comments are shown as a block of text exactly in that position, in which they were added.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(0) A:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 9, 'Show comments as icon', 'All comments are represented by an icon exactly in that position, in which a comment was added. A click on an icon shows the correlating comment.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(1) A:eq(0)', 'wiki.php', 1441276241), + ('5d41c9760a3248313236af202275107c', 10, 'Hide comments', 'All added comments are hidden while displaying a page.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(2) A:eq(0)', 'wiki.php', 1441276241); + "; + + DBManager::get()->exec($insert); + + // add settings + $insert = "INSERT IGNORE INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES + ('4d41c9760a3248313236af202275107a', 1, 'standard'), + ('4d41c9760a3248313236af202275107b', 1, 'standard'), + ('4d41c9760a3248313236af202275107c', 1, 'standard'), + ('5d41c9760a3248313236af202275107a', 1, 'standard'), + ('5d41c9760a3248313236af202275107b', 1, 'standard'), + ('5d41c9760a3248313236af202275107c', 1, 'standard'); + "; + + DBManager::get()->exec($insert); + } + + /** + * Removes the wiki's help tours from the database. + */ + public function down() { + + // delete settings + $delete = "DELETE FROM help_tour_settings WHERE + tour_id = '4d41c9760a3248313236af202275107a' OR + tour_id = '4d41c9760a3248313236af202275107b' OR + tour_id = '4d41c9760a3248313236af202275107c' OR + tour_id = '5d41c9760a3248313236af202275107a' OR + tour_id = '5d41c9760a3248313236af202275107b' OR + tour_id = '5d41c9760a3248313236af202275107c' + "; + + DBManager::get()->exec($delete); + + // delete steps + $delete = "DELETE FROM help_tour_steps WHERE + tour_id = '4d41c9760a3248313236af202275107a' OR + tour_id = '4d41c9760a3248313236af202275107b' OR + tour_id = '4d41c9760a3248313236af202275107c' OR + tour_id = '5d41c9760a3248313236af202275107a' OR + tour_id = '5d41c9760a3248313236af202275107b' OR + tour_id = '5d41c9760a3248313236af202275107c' + "; + + DBManager::get()->exec($delete); + + // delete tour data + $delete = "DELETE FROM help_tours WHERE + tour_id = '4d41c9760a3248313236af202275107a' OR + tour_id = '4d41c9760a3248313236af202275107b' OR + tour_id = '4d41c9760a3248313236af202275107c' OR + tour_id = '5d41c9760a3248313236af202275107a' OR + tour_id = '5d41c9760a3248313236af202275107b' OR + tour_id = '5d41c9760a3248313236af202275107c' + "; + + DBManager::get()->exec($delete); + } +} \ No newline at end of file diff --git a/db/migrations/1.185_tic6025_performance.php b/db/migrations/1.185_tic6025_performance.php new file mode 100644 index 0000000..0407024 --- /dev/null +++ b/db/migrations/1.185_tic6025_performance.php @@ -0,0 +1,46 @@ + +* @license GPL2 or any later version +*/ + +class Tic6025Performance extends Migration +{ + public function description() + { + return _('Performance Tweaks'); + } + + public function up() + { + $this->tryExecute("ALTER TABLE personal_notifications ADD INDEX (html_id)"); + $this->tryExecute("ALTER TABLE personal_notifications ADD INDEX (url(256))"); + + $this->tryExecute("ALTER TABLE admission_seminar_user CHANGE status status ENUM('awaiting','accepted') NOT NULL"); + + $this->tryExecute("ALTER TABLE ex_termine DROP INDEX autor_id"); + $this->tryExecute("ALTER TABLE ex_termine ADD INDEX (date)"); + + $this->tryExecute("ALTER TABLE termine ADD INDEX (date)"); + + $this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX `unique`"); + $this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX termin_id"); + $this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX statusgruppe_id"); + $this->tryExecute("ALTER TABLE termin_related_groups CHANGE statusgruppe_id statusgruppe_id VARCHAR(32) NOT NULL"); + $this->tryExecute("ALTER TABLE termin_related_groups ADD PRIMARY KEY( termin_id, statusgruppe_id)"); + + $this->tryExecute("ALTER TABLE `user_config` ADD INDEX (`field`, `value`(10))"); + + } + + private function tryExecute($sql) + { + try { + DBManager::get()->exec($sql); + } catch (PDOException $e) { + $this->announce("sql failed: %s", $sql); + } + } +} diff --git a/db/migrations/1.186_step_00294_innodb.php b/db/migrations/1.186_step_00294_innodb.php new file mode 100644 index 0000000..1a3ecdc --- /dev/null +++ b/db/migrations/1.186_step_00294_innodb.php @@ -0,0 +1,179 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.4 + * + * @see https://develop.studip.de/trac/ticket/6180 + */ +class StEP00294InnoDB extends Migration +{ + + /** + * Describe what the migration does: convert tables to InnoDB. + * @return string + */ + public function description() + { + return 'Converts the Stud.IP database tables to InnoDB engine'; + } + + /** + * Convert all tables to InnoDB engine, using Barracuda format if supported. + */ + public function up() + { + global $DB_STUDIP_DATABASE; + + // Check if InnoDB is enabled in database server. + $engines = DBManager::get()->fetchAll("SHOW ENGINES"); + $innodb = false; + foreach ($engines as $e) { + // InnoDB is found and enabled. + if ($e['Engine'] == 'InnoDB' && in_array(strtolower($e['Support']), ['default', 'yes'])) { + $innodb = true; + break; + } + } + + if ($innodb) { + $start = microtime(true); + + // Tables to ignore on engine conversion. + $ignore_tables = []; + + // Get version of database system (MySQL/MariaDB/Percona) + $data = DBManager::get()->fetchFirst("SELECT VERSION() AS version"); + $version = $data[0]; + + + + // Fetch all tables that need to be converted. + $tables = DBManager::get()->fetchFirst("SELECT TABLE_NAME + FROM `information_schema`.TABLES + WHERE TABLE_SCHEMA=:database AND ENGINE=:oldengine + ORDER BY TABLE_NAME", + [ + ':database' => $DB_STUDIP_DATABASE, + ':oldengine' => 'MyISAM', + ]); + + /* + * lit_catalog needs fulltext indices which InnoDB doesn't support + * in older versions. + */ + if (version_compare($version, '5.6', '<')) { + $stmt_fulltext = DBManager::get()->prepare("SHOW INDEX FROM `:table` WHERE Index_type = 'FULLTEXT'"); + foreach ($tables as $k => $t) { + $stmt_fulltext->bindParam(':table', $t, StudipPDO::PARAM_COLUMN); + $stmt_fulltext->execute(); + if ($stmt_fulltext->fetch()) { + $ignore_tables[] = $t; + unset($tables[$k]); + } + } + if (count($ignore_tables)) { + $this->announce('The following tables needs fulltext indices '. + 'which are not supported for InnoDB in your database '. + 'version, so the tables will be left untouched: ' . join(',', $ignore_tables)); + } + } + + + // Use Barracuda format if database supports it (5.5 upwards). + if (version_compare($version, '5.5', '>=')) { + // Get innodb_file_per_table setting + $data = DBManager::get()->fetchOne("SHOW VARIABLES LIKE 'innodb_file_per_table'"); + $file_per_table = $data['Value'] ?: 'on'; + + // Check if Barracuda file format is enabled + $data = DBManager::get()->fetchOne("SHOW VARIABLES LIKE 'innodb_file_format'"); + $file_format = $data['Value'] ?: 'barracuda'; + + // All settings ok, use Barracuda. + if (strtolower($file_per_table) == 'on' && strtolower($file_format) == 'barracuda') { + $rowformat = 'DYNAMIC'; + // Barracuda cannot be enabled, use Antelope format. + } else { + $this->announce('Barracuda row format cannot be used for '. + 'the following reason(s), falling back to Antelope.'); + if (strtolower($file_per_table) != 'on') { + $this->announce('- file_per_table is not enabled'); + } + if (strtolower($file_format) != 'barracuda') { + $this->announce('- file_format is not set to "Barracuda"'); + } + $rowformat = 'COMPACT'; + } + } else { + $this->announce('Barracuda row format is supported only in '. + 'MySQL 5.5 and up, falling back to Antelope.'); + $rowformat = 'COMPACT'; + } + + // Prepare query for table conversion. + $stmt = DBManager::get()->prepare("ALTER TABLE `:table` ROW_FORMAT=:rowformat ENGINE=:newengine"); + $stmt->bindParam(':rowformat', $rowformat, StudipPDO::PARAM_COLUMN); + $newengine = 'InnoDB'; + $stmt->bindParam(':newengine', $newengine, StudipPDO::PARAM_COLUMN); + + // Now convert the found tables. + foreach ($tables as $t) { + try { + $stmt->bindParam(':table', $t, StudipPDO::PARAM_COLUMN); + $stmt->execute(); + } catch (Exception $e) { + throw new Exception('Error while migrating table "' . $t . '", error: ' . $e->getMessage()); + } + } + + + $end = microtime(true); + + $duration = $end - $start; + $human_duration = sprintf("%02d:%02d:%02d", + ($duration / 60 / 60) % 24, ($duration / 60) % 60, $duration % 60); + + $this->announce('Migration finished, duration ' . $human_duration); + + // InnoDB not enabled, do nothing but show a message. + } else { + throw new Exception('Migration 186: The storage engine InnoDB is not enabled in your '. + 'database installation, tables cannot be converted.'); + } + + } + + /** + * Convert all database tables back to MyISAM engine. + */ + public function down() + { + global $DB_STUDIP_DATABASE; + + // Fetch all tables that need to be converted. + $tables = DBManager::get()->fetchFirst("SELECT TABLE_NAME + FROM `information_schema`.TABLES + WHERE TABLE_SCHEMA=:database AND ENGINE=:oldengine + ORDER BY TABLE_NAME", + [ + ':database' => $DB_STUDIP_DATABASE, + ':oldengine' => 'InnoDB' + ]); + + // Prepare query for table conversion. + $stmt = DBManager::get()->prepare("ALTER TABLE `:table` ENGINE=:newengine"); + $newengine = 'MyISAM'; + $stmt->bindParam(':newengine', $newengine, StudipPDO::PARAM_COLUMN); + + // Now convert the found tables. + foreach ($tables as $t) { + $stmt->bindParam(':table', $t, StudipPDO::PARAM_COLUMN); + $stmt->execute(); + } + + } + +} diff --git a/db/migrations/1.187_step_291_questionnaires.php b/db/migrations/1.187_step_291_questionnaires.php new file mode 100644 index 0000000..c2c896c --- /dev/null +++ b/db/migrations/1.187_step_291_questionnaires.php @@ -0,0 +1,275 @@ +exec(" + CREATE TABLE IF NOT EXISTS `questionnaires` ( + `questionnaire_id` varchar(32) NOT NULL, + `title` varchar(128) NOT NULL, + `description` text NULL, + `user_id` varchar(32) NOT NULL, + `startdate` BIGINT(20) NULL, + `stopdate` BIGINT(20) NULL, + `visible` TINYINT(1) DEFAULT '0' NOT NULL, + `anonymous` TINYINT(1) DEFAULT '0' NOT NULL, + `resultvisibility` ENUM('always', 'never', 'afterending') DEFAULT 'always' NOT NULL, + `editanswers` TINYINT(1) DEFAULT '1' NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`questionnaire_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `questionnaire_questions` ( + `question_id` varchar(32) NOT NULL, + `questionnaire_id` varchar(32) NOT NULL, + `questiontype` varchar(64) NOT NULL, + `questiondata` text NOT NULL, + `position` INT NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`question_id`), + KEY `questionnaire_id` (`questionnaire_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `questionnaire_assignments` ( + `assignment_id` varchar(32) NOT NULL, + `questionnaire_id` varchar(32) NOT NULL, + `range_id` varchar(32) NOT NULL, + `range_type` varchar(64) NOT NULL, + `user_id` varchar(32) NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`assignment_id`), + KEY `questionnaire_id` (`questionnaire_id`), + KEY `range_id_range_type` (`range_id`,`range_type`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `questionnaire_answers` ( + `answer_id` varchar(32) NOT NULL, + `question_id` varchar(32) NOT NULL, + `user_id` varchar(32) NULL, + `answerdata` text NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`answer_id`), + KEY `question_id` (`question_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `questionnaire_anonymous_answers` ( + `anonymous_answer_id` varchar(32) NOT NULL, + `questionnaire_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`anonymous_answer_id`), + KEY `questionnaire_id` (`questionnaire_id`), + UNIQUE KEY `questionnaire_id_user_id` (`questionnaire_id`,`user_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + //now import old data into new tables: + $resultvisibility_mapping = [ + 'ever' => 'always', + 'delivery' => 'always', + 'end' => 'afterending', + 'never' => 'never' + ]; + $all_votes = DBManager::get()->prepare(" + SELECT vote.* FROM vote INNER JOIN auth_user_md5 ON user_id = author_id + "); + $all_votes->execute(); + while ($vote = $all_votes->fetch(PDO::FETCH_ASSOC)) { + //Fragebogen erstellen + $questionnaire = new Questionnaire($vote['vote_id']); + $questionnaire['title'] = $vote['title']; + $questionnaire->setId($vote['vote_id']); + $questionnaire['user_id'] = $vote['author_id']; + $questionnaire['startdate'] = $vote['startdate']; + $questionnaire['stopdate'] = $vote['stopdate'] ?: (in_array($vote['state'], ["stopvis", "stopinvis"]) ? time() : null); + $questionnaire['visible'] = in_array($vote['state'], ["active", "stopvis"]) ? 1 : 0; // stopvis new active stopinvis + $questionnaire['anonymous'] = $vote['anonymous']; + $questionnaire['resultvisibility'] = $resultvisibility_mapping[$vote['resultvisibility']]; + $questionnaire['editanswers'] = $vote['changeable']; + $questionnaire['chdate'] = $vote['chdate']; + $questionnaire['mkdate'] = $vote['mkdate']; + + $questionnaire->store(); + + $question = $this->createQuestion($questionnaire->id, $vote); + + //Bestehende Antworten migrieren + if ($questionnaire['anonymous']) { + foreach ($question['counter'] as $answer_id => $count) { + for ($i = 0; $i < $count; $i++) { + $answer = new QuestionnaireAnswer(); + $answer['user_id'] = null; + $answer['chdate'] = 1; //damit man nicht aus dem chdate auf die user_id schließen kann + $answer['mkdate'] = 1; //mkdate genauso + $answer['question_id'] = $question['id']; + $answerdata = []; + $answers = [$answer_id]; + foreach ($answers as $key => $answer_data) { + $answers[$key] = $question['mapping'][$answer_data]; + } + sort($answers); + $answerdata['answers'] = $answers; + if (!$question['multiplechoice']) { + $answerdata['answers'] = $answerdata['answers'][0]; + } + $answer['answerdata'] = $answerdata; + $answer->store(); + } + } + + $statement = DBManager::get()->prepare(" + SELECT * + FROM vote_user + WHERE vote_id = :vote_id + "); + $statement->execute([ + 'vote_id' => $vote['vote_id'] + ]); + foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $anonymous_vote) { + $anonymous_answer = new QuestionnaireAnonymousAnswer(); + $anonymous_answer['questionnaire_id'] = $questionnaire->getId(); + $anonymous_answer['user_id'] = $anonymous_vote['user_id']; + $anonymous_answer['chdate'] = $anonymous_vote['votedate']; + $anonymous_answer['mkdate'] = $anonymous_vote['votedate']; + $anonymous_answer->store(); + } + + } else { + $statement = DBManager::get()->prepare(" + SELECT GROUP_CONCAT(answer_id SEPARATOR ' ') AS answers, user_id, MAX(votedate) AS votedate + FROM voteanswers_user + WHERE answer_id IN (?) + GROUP BY user_id + "); + $statement->execute([array_keys($question['mapping'])]); + foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $answer_data) { + $answer = new QuestionnaireAnswer(); + $answer['user_id'] = $answer_data['user_id']; + $answer['chdate'] = $answer_data['votedate']; + $answer['mkdate'] = $answer_data['votedate']; + $answer['question_id'] = $question['id']; + $answerdata = []; + $answers = explode(" ", $answer_data['answers']); + foreach ($answers as $key => $answer_data) { + $answers[$key] = $question['mapping'][$answer_data]; + } + sort($answers); + $answerdata['answers'] = $answers; + if (!$question['multiplechoice']) { + $answerdata['answers'] = $answerdata['answers'][0]; + } + $answer['answerdata'] = $answerdata; + $answer->store(); + } + } + + + //Und noch einhängen das ganze: + $binding = new QuestionnaireAssignment(); + $binding['questionnaire_id'] = $questionnaire->getId(); + $binding['range_id'] = $vote['range_id'] !== "studip" ? $vote['range_id'] : "start"; + $binding['range_type'] = $vote['range_id'] === "studip" + ? "static" + : ($vote['range_id'] === $vote['author_id'] + ? "user" + : (Institute::find($vote['range_id']) ? "institute" : "course") + ); + $binding['user_id'] = $vote['author_id']; + $binding['chdate'] = $questionnaire['chdate']; + $binding['mkdate'] = $questionnaire['mkdate']; + + $binding->store(); + } + + //and finally clean up: + + DBManager::get()->exec("DROP TABLE IF EXISTS `vote`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `voteanswers`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `voteanswers_user`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `vote_user`"); + } + + function down() + { + DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_anonymous_answers`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_assignments`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_questions`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_answers`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaires`"); + } + + + private function createQuestion($questionnaireId, $vote) + { + $database = DBManager::get(); + + $data = [ + 'question_id' => md5(uniqid('questionnaire_questions', 1)), + 'questionnaire_id' => $questionnaireId, + 'questiontype' => $vote['type'] === "vote" ? "Vote" : "Test", + 'position' => 1, + 'chdate' => $vote['chdate'], + 'mkdate' => $vote['mkdate'] + ]; + + $questiondata = [ + 'multiplechoice' => $vote['multiplechoice'], + 'question' => $vote['question'], + ]; + + //Antwortmöglichkeiten vorsehen: + $optionsStatement = $database->prepare(" + SELECT * + FROM voteanswers + WHERE vote_id = ? + ORDER BY position ASC + "); + $optionsStatement->execute([$vote['vote_id']]); + $options = $optionsStatement->fetchAll(PDO::FETCH_ASSOC); + $mapping = []; + $counter = []; + foreach ($options as $key => $option) { + $questiondata['options'][] = $option['answer']; + $mapping[$option['answer_id']] = $key + 1; + $counter[$option['answer_id']] = $option['counter']; + if (($vote['type'] === "test") && $option['correct']) { + $questiondata['correctanswer'][] = $key + 1; + } + } + + $data['questiondata'] = json_encode(studip_utf8encode($questiondata)); + + $insertStmt = $database->prepare(" + INSERT INTO questionnaire_questions + (question_id, questionnaire_id, questiontype, questiondata, position, chdate, mkdate) + VALUES (:question_id, :questionnaire_id, :questiontype, :questiondata, :position, :chdate, :mkdate) + "); + $insertStmt->execute($data); + + return [ + 'id' => $data['question_id'], + 'multiplechoice' => $questiondata['multiplechoice'], + 'mapping' => $mapping, + 'counter' => $counter + ]; + } +} diff --git a/db/migrations/1.188_step_00296_appointment_requests.php b/db/migrations/1.188_step_00296_appointment_requests.php new file mode 100644 index 0000000..c671bc3 --- /dev/null +++ b/db/migrations/1.188_step_00296_appointment_requests.php @@ -0,0 +1,78 @@ + 'CALENDAR_GRANT_ALL_INSERT', + 'description' => 'Ermöglicht das Eintragen von Terminen in alle Nutzerkalender, ohne Beachtung des Rechtesystems.', + 'section' => 'modules', + 'type' => 'boolean', + 'value' => '0' + ] + ]; + + /** + * short description of this migration + */ + function description() + { + return "Extends the calendar by the possibility to state an appointment in" + . "another user's calendar as a requested appointment. " + . "Displaying of course appointments is now optional."; + } + + /** + * insert list of options into config table + */ + function insertConfig($options) + { + $db = DBManager::get(); + $time = time(); + + $stmt = $db->prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + /** + * remove list of options from config table + */ + function deleteConfig($options) + { + $db = DBManager::get(); + + $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); + + foreach ($options as $option) { + $stmt->execute(['name' => $option['name']]); + } + } + + /** + * perform this migration + */ + public function up() + { + $this->insertConfig($this->options_new); + } + + /** + * revert this migration + */ + public function down() + { + $this->deleteConfig($this->options_new); + } +} diff --git a/db/migrations/1.189_step_00288_sem_class_raumzeit.php b/db/migrations/1.189_step_00288_sem_class_raumzeit.php new file mode 100644 index 0000000..457a7e5 --- /dev/null +++ b/db/migrations/1.189_step_00288_sem_class_raumzeit.php @@ -0,0 +1,49 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.4 + * + * @see https://develop.studip.de/trac/ticket/5797 + */ +class Step00288SemClassRaumzeit extends Migration +{ + + /** + * short description of this migration + */ + public function description() + { + return 'Registers new sem_class settings for display of raumzeit.'; + } + + /** + * perform this migration + */ + public function up() + { + DBManager::get()->exec('ALTER TABLE `sem_classes` ADD `show_raumzeit` TINYINT( 4 ) NOT NULL DEFAULT "1" AFTER `title_autor_plural`'); + + try { + $sem_class = new SemClass(99); + $sem_class->set('show_raumzeit', '0'); + $sem_class->set('schedule', 'CoreSchedule'); + $modules = $sem_class->getModules(); + $modules['CoreSchedule'] = ['activated' => '1', 'sticky' => '0']; + $sem_class->setModules($modules); + $sem_class->store(); + } catch (Exception $e) { } + + } + + /** + * revert this migration + */ + public function down() + { + DBManager::get()->execute('ALTER TABLE `sem_classes` DROP `show_raumzeit`'); + } + +} diff --git a/db/migrations/1.18_step_00139_upload_file_reorg.php b/db/migrations/1.18_step_00139_upload_file_reorg.php new file mode 100644 index 0000000..51201e2 --- /dev/null +++ b/db/migrations/1.18_step_00139_upload_file_reorg.php @@ -0,0 +1,52 @@ +query('SELECT dokument_id FROM dokumente'); + + foreach ($result as $row) { + $document = $row['dokument_id']; + $file_path = $UPLOAD_PATH.'/'.$document; + + if (is_file($file_path)) { + rename($file_path, get_upload_file_path($document)); + } + } + } + + function down () + { + global $UPLOAD_PATH; + + $db = DBManager::get(); + $result = $db->query('SELECT dokument_id FROM dokumente'); + + foreach ($result as $row) { + $document = $row['dokument_id']; + $file_path = get_upload_file_path($document); + + if (is_file($file_path)) { + rename($file_path, $UPLOAD_PATH.'/'.$document); + } + } + + for ($i = 0; $i <= 0xff; ++$i) { + $directory = sprintf('%s/%02x', $UPLOAD_PATH, $i); + + if (is_dir($directory)) { + rmdir($directory); + } + } + } +} +?> diff --git a/db/migrations/1.190_allow_topics_to_be_public.php b/db/migrations/1.190_allow_topics_to_be_public.php new file mode 100644 index 0000000..b406d25 --- /dev/null +++ b/db/migrations/1.190_allow_topics_to_be_public.php @@ -0,0 +1,25 @@ +exec(" + ALTER TABLE `seminare` ADD `public_topics` TINYINT( 2 ) NOT NULL DEFAULT '1' + "); + DBManager::get()->exec(" + UPDATE `seminare` SET `public_topics` = '0' + "); + } + + public function down() + { + DBManager::get()->execute(' + ALTER TABLE `seminare` DROP `public_topics` + '); + } +} diff --git a/db/migrations/1.191_add_dedicated_admins_role.php b/db/migrations/1.191_add_dedicated_admins_role.php new file mode 100644 index 0000000..3e637a8 --- /dev/null +++ b/db/migrations/1.191_add_dedicated_admins_role.php @@ -0,0 +1,28 @@ +exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('DedicatedAdmin', 'n'); + "); + RolePersistence::expireCaches(); + } + + public function down() + { + DBManager::get()->execute(" + DELETE FROM `roles` WHERE `rolename` = 'DedicatedAdmin' AND `system` = 'n' + "); + RolePersistence::expireCaches(); + } + +} diff --git a/db/migrations/1.192_add_user_config_for_admin_display_settings.php b/db/migrations/1.192_add_user_config_for_admin_display_settings.php new file mode 100644 index 0000000..0ea0c3e --- /dev/null +++ b/db/migrations/1.192_add_user_config_for_admin_display_settings.php @@ -0,0 +1,37 @@ + + * @license GPL2 or any later version + */ +class AddUserConfigForAdminDisplaySettings extends Migration +{ + public function description() + { + return 'Adds user config entry for "PLUGINADMIN_DISPLAY_SETTINGS"'; + } + + public function up() + { + $query = "INSERT INTO `config` ( + `config_id`, `parent_id`, `field`, `value`, `is_default`, + `type`, `range`, `section`, `mkdate`, `chdate`, `description` + ) VALUES ( + MD5(:field), '', :field, :value, 1, 'array', 'user', '', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description + )"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':field', 'PLUGINADMIN_DISPLAY_SETTINGS'); + $statement->bindValue(':value', json_encode(['plugin_filter' => null, 'core_filter' => 'yes'])); + $statement->bindValue(':description', 'Speichert die Darstellungseinstellungen der Pluginadministration'); + $statement->execute(); + } + + public function down() + { + $query = "DELETE FROM `config` WHERE `field` = 'PLUGINADMIN_DISPLAY_SETTINGS'"; + DBManager::get()->exec($query); + + $query = "DELETE FROM `user_config` WHERE `field` = 'PLUGINADMIN_DISPLAY_SETTINGS'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.193_tic6653_add_advanced_coursewizardstep.php b/db/migrations/1.193_tic6653_add_advanced_coursewizardstep.php new file mode 100644 index 0000000..9d3924f --- /dev/null +++ b/db/migrations/1.193_tic6653_add_advanced_coursewizardstep.php @@ -0,0 +1,23 @@ + 'AdvancedBasicDataWizardStep']); + } +} \ No newline at end of file diff --git a/db/migrations/1.194_tic_6576_preferential_admission.php b/db/migrations/1.194_tic_6576_preferential_admission.php new file mode 100644 index 0000000..3547d24 --- /dev/null +++ b/db/migrations/1.194_tic_6576_preferential_admission.php @@ -0,0 +1,58 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.5 + * + * @see https://develop.studip.de/trac/ticket/6576 + */ +class TIC6576PreferentialAdmission extends Migration +{ + public function description() + { + return 'Introduces an admission rule for favoring selected courses '. + 'of study/degrees/semesters or higher semesters of study in seat '. + 'distribution.'; + } + + public function up() + { + // Table for rule definitions. + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `prefadmissions` ( + `rule_id` VARCHAR(32), + `favor_semester` TINYINT(1) NOT NULL DEFAULT 0, + `mkdate` int(11) NOT NULL DEFAULT 0, + `chdate` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + // Table for storing rule - condition relations. + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `prefadmission_condition` ( + `rule_id` VARCHAR(32) NOT NULL, + `condition_id` VARCHAR(32) NOT NULL, + `chance` INT(4) NOT NULL DEFAULT 1, + `mkdate` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_id`,`condition_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + // Install rule to database. + DBManager::get()->exec("INSERT IGNORE INTO `admissionrules` (`id`, `ruletype`, `active`, `mkdate`) + VALUES (0, 'PreferentialAdmission', '1', UNIX_TIMESTAMP())"); + + // Allow higher bonus factors for users (as generated by PreferentialAdmission) + DBManager::get()->exec("ALTER TABLE `admissionfactor` CHANGE `factor` `factor` FLOAT NOT NULL DEFAULT '1.00';"); + + } + + public function down() + { + // Remove entry in admission rule registry. + DBManager::get()->exec("DELETE FROM `admissionrules` WHERE `ruletype` = 'PreferentialAdmission'"); + + // Remove rule data tables. + DBManager::get()->exec("DROP TABLE IF EXISTS `prefadmission`"); + DBManager::get()->exec("DROP TABLE IF EXISTS `prefadmission_condition`"); + } +} diff --git a/db/migrations/1.195_tic_6655_admissionrule_compatibility.php b/db/migrations/1.195_tic_6655_admissionrule_compatibility.php new file mode 100644 index 0000000..f613620 --- /dev/null +++ b/db/migrations/1.195_tic_6655_admissionrule_compatibility.php @@ -0,0 +1,105 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.5 + * + * @see https://develop.studip.de/trac/ticket/6655 + */ +class TIC6655AdmissionRuleCompatibility extends Migration +{ + public function description() + { + return 'Compatibility between admission rules is now stored in database and can be configured via GUI.'; + } + + public function up() + { + // Table for rule definitions. + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `admissionrule_compat` ( + `rule_type` VARCHAR(32) NOT NULL, + `compat_rule_type` VARCHAR(32) NOT NULL, + `mkdate` int(11) NOT NULL DEFAULT 0, + `chdate` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`rule_type`, `compat_rule_type`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + // Initial DB entries, taken from former class variables ($allowed_combinations). + $compat = [ + 'ConditionalAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'LimitedAdmission', + 'ParticipantRestrictedAdmission', + 'PasswordAdmission', + 'PreferentialAdmission', + 'TimedAdmission' + ], + 'CourseMemberAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'LimitedAdmission', + 'ParticipantRestrictedAdmission', + 'PasswordAdmission', + 'PreferentialAdmission', + 'TimedAdmission' + ], + 'LimitedAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'ParticipantRestrictedAdmission', + 'PasswordAdmission', + 'PreferentialAdmission', + 'TimedAdmission' + ], + 'ParticipantRestrictedAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'LimitedAdmission', + 'PreferentialAdmission', + 'TimedAdmission' + ], + 'PasswordAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'PreferentialAdmission', + 'TimedAdmission', + ], + 'PreferentialAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'LimitedAdmission', + 'ParticipantRestrictedAdmission', + 'PasswordAdmission', + 'TimedAdmission' + ], + 'TimedAdmission' => [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'LimitedAdmission', + 'ParticipantRestrictedAdmission', + 'PasswordAdmission', + 'PreferentialAdmission' + ] + ]; + + $stmt = DBManager::get()->prepare("INSERT IGNORE INTO `admissionrule_compat` + (`rule_type`, `compat_rule_type`, `mkdate`, `chdate`) + VALUES (:ruletype, :compat, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())"); + + foreach ($compat as $type => $compat_types) { + foreach ($compat_types as $c) { + $stmt->execute(['ruletype' => $type, 'compat' => $c]); + } + } + } + + public function down() + { + // Remove rule data tables. + DBManager::get()->exec("DROP TABLE IF EXISTS `admissionrule_compat`"); + } +} diff --git a/db/migrations/1.196_extend_ressources.php b/db/migrations/1.196_extend_ressources.php new file mode 100644 index 0000000..3bd06ad --- /dev/null +++ b/db/migrations/1.196_extend_ressources.php @@ -0,0 +1,22 @@ +execute("ALTER TABLE `resources_objects` ADD `requestable` TINYINT( 4 ) NOT NULL DEFAULT '1' AFTER `multiple_assign`"); + DBManager::get()->execute("ALTER TABLE `resources_categories_properties` ADD `protected` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `requestable`"); + DBManager::get()->execute("ALTER TABLE `resources_properties` ADD `info_label` TINYINT( 4 ) NOT NULL DEFAULT '0'"); + } + + public function down() + { + DBManager::get()->execute("ALTER TABLE `resources_objects` DROP `requestable`"); + DBManager::get()->execute("ALTER TABLE `resources_categories_properties` DROP `protected`"); + DBManager::get()->execute("ALTER TABLE `resources_properties` DROP `info_label`"); + } +} diff --git a/db/migrations/1.197_step_00301_admission_conditiongroups.php b/db/migrations/1.197_step_00301_admission_conditiongroups.php new file mode 100644 index 0000000..678186b --- /dev/null +++ b/db/migrations/1.197_step_00301_admission_conditiongroups.php @@ -0,0 +1,45 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.5 + * + * @see https://develop.studip.de/trac/ticket/6574 + */ +class Step00301AdmissionConditiongroups extends Migration +{ + + /** + * short description of this migration + */ + public function description() + { + return 'Adds table admission_conditiongroup.'; + } + + /** + * perform this migration + */ + public function up() + { + DBManager::get()->exec('CREATE TABLE IF NOT EXISTS `admission_conditiongroup` ( + `conditiongroup_id` varchar(32) NOT NULL, + `quota` int(11) NOT NULL, + PRIMARY KEY (`conditiongroup_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC'); + + DBManager::get()->exec("ALTER TABLE `admission_condition` ADD `conditiongroup_id` VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `filter_id`"); + } + + /** + * revert this migration + */ + public function down() + { + DBManager::get()->exec('DROP TABLE `admission_conditiongroup`'); + DBManager::get()->exec('ALTER TABLE `admission_condition` DROP `conditiongroup_id`;'); + } + +} diff --git a/db/migrations/1.198_add_activities.php b/db/migrations/1.198_add_activities.php new file mode 100644 index 0000000..e9ca7ca --- /dev/null +++ b/db/migrations/1.198_add_activities.php @@ -0,0 +1,114 @@ +exec("CREATE TABLE `activities` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `object_id` varchar(255) NOT NULL, + `context` enum('system','course','institute','user') NOT NULL, + `context_id` varchar(32) NOT NULL, + `provider` varchar(255) NOT NULL, + `actor_type` varchar(255) NOT NULL, + `actor_id` varchar(255) NOT NULL, + `verb` enum('answered','attempted','attended','completed','created','deleted','edited','experienced','failed','imported','interacted','passed','shared','sent','voided') NOT NULL DEFAULT 'experienced', + `content` text NULL, + `object_type` varchar(255) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `context_id` (`context_id`), + KEY `mkdate` (`mkdate`) + ) ENGINE = InnoDB ROW_FORMAT=DYNAMIC"); + + + //CHECK IF API IS ENABLED + if (!Config::get()->API_ENABLED) { + $db->exec("UPDATE `config` SET `value` = '1' WHERE `field` = 'API_ENABLED'"); + } + //SET PERMISSION FOR ROUTE + $permissions = RESTAPI\ConsumerPermissions::get('global'); + $permissions->set('/user/:user_id/activitystream','get', true, true); + $permissions->store(); + + //CHECK IF OLD ACTIVITY-FEED-PLUGIN IS ACTIVE + $old_id = $db->query("SELECT pluginid FROM plugins + WHERE pluginclassname = 'ActivityFeed' + AND pluginpath NOT LIKE '%core%'")->fetchColumn(); + + if ($old_id !== false) { + $stmt = $db->prepare("DELETE FROM plugins WHERE pluginid = ?"); + $stmt->execute([$old_id]); + + $stmt = $db->prepare("DELETE FROM plugins_activated WHERE pluginid = ?"); + $stmt->execute([$old_id]); + + $stmt = $db->prepare("DELETE FROM plugins_default_activations WHERE pluginid = ?"); + $stmt->execute([$old_id]); + + $stmt = $db->prepare("DELETE FROM roles_plugins WHERE pluginid = ?"); + $stmt->execute([$old_id]); + } + + // Activate Widget + $classname = "ActivityFeed"; + $navpos = $db->query("SELECT navigationpos FROM plugins + ORDER BY navigationpos DESC")->fetchColumn() + 1; + + // insert plugin into db + $stmt = $db->prepare("INSERT INTO plugins + (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) + VALUES (?, ?, ?, 'PortalPlugin', 'yes', ?)"); + $stmt->execute([$classname, 'core/'.$classname, $classname, $navpos]); + + // get id of newly created plugin ( + $plugin_id = $db->query("SELECT pluginid FROM plugins + WHERE pluginclassname = '$classname'")->fetchColumn(); + + // set all default roles for the plugin + $stmt = $db->prepare("INSERT INTO roles_plugins + (roleid, pluginid) VALUES (?, ?)"); + foreach (range(1, 6) as $role_id) { + $stmt->execute([$role_id, $plugin_id]); + } + } + + public function down() + { + //DEACTIVATE ROUTE + $permissions = RESTAPI\ConsumerPermissions::get('global'); + $permissions->set('/user/:user_id/activitystream','get', false, true); + $permissions->store(); + + $db = DBManager::get(); + + //REMOVE WIDGET + $widget_id = $db->query("SELECT pluginid FROM plugins + WHERE pluginclassname = 'ActivityFeed'")->fetchColumn(); + + $stmt = $db->prepare("DELETE FROM plugins WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $stmt = $db->prepare("DELETE FROM widget_default WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $stmt = $db->prepare("DELETE FROM widget_user WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $stmt = $db->prepare("DELETE FROM roles_plugins WHERE pluginid = ?"); + $stmt->execute([$widget_id]); + + $db->exec("DROP TABLE `activities`"); + + } +} diff --git a/db/migrations/1.199_step_00302_modulverwaltung.php b/db/migrations/1.199_step_00302_modulverwaltung.php new file mode 100644 index 0000000..f6c453e --- /dev/null +++ b/db/migrations/1.199_step_00302_modulverwaltung.php @@ -0,0 +1,896 @@ +query("SELECT * FROM plugins WHERE pluginclassname = 'MVVPlugin'") + ->fetch(PDO::FETCH_ASSOC); + + if ($old_mvv) { + $db->exec("UPDATE plugins SET pluginpath = 'core/Modulverwaltung' WHERE pluginclassname = 'MVVPlugin'"); + if ($old_mvv['pluginpath'] !== 'core/Modulverwaltung') { + @rmdirr($GLOBALS['PLUGINS_PATH'] . '/' . $old_mvv['pluginpath']); + } + } else { + //Installieren des Plugins + $db->exec("INSERT INTO plugins + SET pluginclassname = 'MVVPlugin', + pluginpath = 'core/Modulverwaltung', + pluginname = 'Modulverwaltung', + plugintype = 'SystemPlugin', + enabled = 'yes', + navigationpos = '1'"); + $plugin_id = $db->lastInsertId(); + $db->exec("INSERT IGNORE INTO roles_plugins (roleid, pluginid) + SELECT roleid, " . $db->quote($plugin_id) . " FROM roles WHERE `system` = 'y'"); + } + + + $db->exec(" + ALTER TABLE `datafields` + CHANGE `object_type` `object_type` + ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata', + 'moduldeskriptor','modulteildeskriptor') NULL DEFAULT NULL + "); + + $db->exec(" + ALTER TABLE `datafields` CHANGE `object_class` `object_class` VARCHAR(255) NULL DEFAULT NULL + "); + + if (!$db->fetchOne("SHOW COLUMNS FROM sem_classes WHERE Field = 'module'")) { + $db->exec(" + ALTER TABLE `sem_classes` ADD `module` TINYINT(4) NOT NULL AFTER `bereiche` + "); + } + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_abschl_kategorie` ( + `kategorie_id` varchar(32) NOT NULL, + `name` varchar(255) NOT NULL, + `name_en` varchar(255) DEFAULT NULL, + `name_kurz` varchar(50) DEFAULT NULL, + `name_kurz_en` varchar(50) DEFAULT NULL, + `beschreibung` text, + `beschreibung_en` text, + `position` int(11) DEFAULT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`kategorie_id`), + UNIQUE KEY `name` (`name`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_abschl_zuord` ( + `abschluss_id` varchar(32) NOT NULL, + `kategorie_id` varchar(32) NOT NULL, + `position` int(4) NOT NULL DEFAULT '9999', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`abschluss_id`), + KEY `kategorie_id` (`kategorie_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_dokument` ( + `dokument_id` varchar(32) NOT NULL, + `url` tinytext NOT NULL, + `name` varchar(255) NOT NULL, + `name_en` varchar(255) DEFAULT NULL, + `linktext` varchar(255) NOT NULL, + `linktext_en` varchar(255) DEFAULT NULL, + `beschreibung` text, + `beschreibung_en` text, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`dokument_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_dokument_zuord` ( + `dokument_id` varchar(32) NOT NULL, + `range_id` varchar(32) NOT NULL, + `object_type` varchar(50) NOT NULL, + `position` int(3) NOT NULL DEFAULT '999', + `kommentar` tinytext, + `kommentar_en` tinytext, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`dokument_id`,`range_id`,`object_type`), + KEY `range_id_object_type`(`range_id`,`object_type`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_fach_inst` ( + `fach_id` varchar(32) NOT NULL, + `institut_id` varchar(32) NOT NULL, + `position` int(11) NOT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`fach_id`,`institut_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_fachberater` ( + `stgteil_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `position` int(11) NOT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`stgteil_id`,`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_lvgruppe` ( + `lvgruppe_id` varchar(32) NOT NULL, + `name` varchar(250) NOT NULL, + `name_en` varchar(250) DEFAULT NULL, + `alttext` tinytext, + `alttext_en` tinytext, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`lvgruppe_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_lvgruppe_modulteil` ( + `lvgruppe_id` varchar(32) NOT NULL, + `modulteil_id` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `fn_id` varchar(32) DEFAULT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`lvgruppe_id`,`modulteil_id`), + KEY `fn_id` (`fn_id`), + KEY `modulteil_id` (`modulteil_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_lvgruppe_seminar` ( + `lvgruppe_id` varchar(32) NOT NULL, + `seminar_id` varchar(32) NOT NULL, + `author_id` varchar(32) DEFAULT NULL, + `editor_id` varchar(32) DEFAULT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`lvgruppe_id`,`seminar_id`), + KEY `seminar_id` (`seminar_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modul` ( + `modul_id` varchar(32) NOT NULL, + `quelle` varchar(120) DEFAULT NULL, + `variante` varchar(32) DEFAULT NULL, + `flexnow_modul` varchar(250) DEFAULT NULL, + `code` varchar(250) DEFAULT NULL, + `start` varchar(32) DEFAULT NULL, + `end` varchar(32) DEFAULT NULL, + `beschlussdatum` int(11) DEFAULT NULL, + `fassung_nr` int(2) DEFAULT NULL, + `fassung_typ` varchar(32) DEFAULT NULL, + `version` varchar(120) NOT NULL DEFAULT '1', + `dauer` varchar(50) DEFAULT NULL, + `kapazitaet` varchar(50) NOT NULL DEFAULT '', + `kp` int(11) DEFAULT NULL, + `wl_selbst` int(11) DEFAULT NULL, + `wl_pruef` int(11) DEFAULT NULL, + `pruef_ebene` varchar(32) DEFAULT NULL, + `faktor_note` varchar(10) NOT NULL DEFAULT '1', + `stat` varchar(32) DEFAULT NULL, + `kommentar_status` text, + `verantwortlich` tinytext, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modul_id`), + KEY `stat` (`stat`), + KEY `flexnow_modul` (`flexnow_modul`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modul_deskriptor` ( + `deskriptor_id` varchar(32) NOT NULL, + `modul_id` varchar(32) NOT NULL, + `sprache` varchar(32) NOT NULL, + `verantwortlich` tinytext, + `bezeichnung` tinytext, + `voraussetzung` text, + `kompetenzziele` text, + `inhalte` text, + `literatur` text, + `links` text, + `kommentar` text, + `turnus` tinytext, + `kommentar_kapazitaet` text, + `kommentar_sws` text, + `kommentar_wl_selbst` text, + `kommentar_wl_pruef` text, + `kommentar_note` text, + `pruef_vorleistung` text, + `pruef_leistung` text, + `pruef_wiederholung` text, + `ersatztext` text, + `author_id` varchar(32) DEFAULT NULL, + `editor_id` varchar(32) DEFAULT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`deskriptor_id`), + UNIQUE KEY `modul_id` (`modul_id`,`sprache`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modul_inst` ( + `modul_id` varchar(32) NOT NULL, + `institut_id` varchar(32) NOT NULL, + `gruppe` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modul_id`,`institut_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modul_language` ( + `modul_id` varchar(32) NOT NULL, + `lang` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modul_id`,`lang`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modul_user` ( + `modul_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `gruppe` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modul_id`,`user_id`,`gruppe`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modulteil` ( + `modulteil_id` varchar(32) NOT NULL, + `modul_id` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `flexnow_modul` varchar(250) DEFAULT NULL, + `nummer` varchar(20) DEFAULT NULL, + `num_bezeichnung` varchar(32) DEFAULT NULL, + `lernlehrform` varchar(32) DEFAULT NULL, + `semester` varchar(32) DEFAULT NULL, + `kapazitaet` varchar(50) DEFAULT NULL, + `kp` int(11) DEFAULT NULL, + `sws` int(11) DEFAULT NULL, + `wl_praesenz` int(11) DEFAULT NULL, + `wl_bereitung` int(11) DEFAULT NULL, + `wl_selbst` int(11) DEFAULT NULL, + `wl_pruef` int(11) DEFAULT NULL, + `anteil_note` int(11) DEFAULT NULL, + `ausgleichbar` int(1) NOT NULL DEFAULT '0', + `pflicht` int(2) NOT NULL DEFAULT '0', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modulteil_id`), + KEY `modul_id` (`modul_id`), + KEY `flexnow_modul` (`flexnow_modul`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modulteil_deskriptor` ( + `deskriptor_id` varchar(32) NOT NULL, + `modulteil_id` varchar(32) NOT NULL, + `bezeichnung` tinytext NOT NULL, + `sprache` varchar(32) NOT NULL, + `voraussetzung` text, + `kommentar` text, + `kommentar_kapazitaet` text, + `kommentar_wl_praesenz` text, + `kommentar_wl_bereitung` text, + `kommentar_wl_selbst` text, + `kommentar_wl_pruef` text, + `pruef_vorleistung` text, + `pruef_leistung` text, + `kommentar_pflicht` text, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`deskriptor_id`), + UNIQUE KEY `modulteil_id` (`modulteil_id`,`sprache`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modulteil_language` ( + `modulteil_id` varchar(32) NOT NULL, + `lang` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modulteil_id`,`lang`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_modulteil_stgteilabschnitt` ( + `modulteil_id` varchar(32) NOT NULL, + `abschnitt_id` varchar(32) NOT NULL, + `fachsemester` int(2) NOT NULL, + `differenzierung` varchar(100) NOT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modulteil_id`,`abschnitt_id`,`fachsemester`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_stg_stgteil` ( + `studiengang_id` varchar(32) NOT NULL, + `stgteil_id` varchar(32) NOT NULL, + `stgteil_bez_id` varchar(32) NOT NULL DEFAULT '', + `position` int(11) NOT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`studiengang_id`,`stgteil_id`,`stgteil_bez_id`), + KEY `stgteil_id` (`stgteil_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_stgteil` ( + `stgteil_id` varchar(32) NOT NULL, + `fach_id` varchar(32) DEFAULT NULL, + `kp` varchar(50) DEFAULT NULL, + `semester` int(2) DEFAULT NULL, + `zusatz` varchar(200) NOT NULL, + `zusatz_en` varchar(200) DEFAULT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`stgteil_id`), + KEY `fach_id` (`fach_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_stgteil_bez` ( + `stgteil_bez_id` varchar(32) NOT NULL, + `name` varchar(100) NOT NULL, + `name_en` varchar(100) NOT NULL, + `name_kurz` varchar(20) NOT NULL, + `name_kurz_en` varchar(20) NOT NULL, + `position` int(4) NOT NULL DEFAULT '9999', + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`stgteil_bez_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_stgteilabschnitt` ( + `abschnitt_id` varchar(32) NOT NULL, + `version_id` varchar(32) NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `name` varchar(200) NOT NULL, + `name_en` varchar(200) DEFAULT NULL, + `kommentar` varchar(200) DEFAULT NULL, + `kommentar_en` varchar(200) DEFAULT NULL, + `kp` int(11) DEFAULT NULL, + `ueberschrift` tinytext, + `ueberschrift_en` tinytext, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`abschnitt_id`), + KEY `version_id` (`version_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_stgteilabschnitt_modul` ( + `abschnitt_id` varchar(32) NOT NULL, + `modul_id` varchar(32) NOT NULL, + `flexnow_modul` varchar(250) DEFAULT NULL, + `modulcode` varchar(250) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `bezeichnung` varchar(250) DEFAULT NULL, + `bezeichnung_en` varchar(250) DEFAULT NULL, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`abschnitt_id`,`modul_id`), + KEY `flexnow_modul` (`flexnow_modul`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_stgteilversion` ( + `version_id` varchar(32) NOT NULL, + `stgteil_id` varchar(32) NOT NULL, + `start_sem` varchar(32) DEFAULT NULL, + `end_sem` varchar(32) DEFAULT NULL, + `code` varchar(100) DEFAULT NULL, + `beschlussdatum` int(11) DEFAULT NULL, + `fassung_nr` int(2) DEFAULT NULL, + `fassung_typ` varchar(32) DEFAULT NULL, + `beschreibung` text, + `beschreibung_en` text, + `stat` varchar(32) DEFAULT NULL, + `kommentar_status` text, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`version_id`), + KEY `stgteil_id` (`stgteil_id`), + KEY `stat` (`stat`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `mvv_studiengang` ( + `studiengang_id` varchar(32) NOT NULL, + `abschluss_id` varchar(32) DEFAULT NULL, + `typ` enum('einfach','mehrfach') NOT NULL, + `name` varchar(255) NOT NULL, + `name_kurz` varchar(50) DEFAULT NULL, + `name_kurz_en` varchar(50) DEFAULT NULL, + `name_en` varchar(255) DEFAULT NULL, + `beschreibung` text, + `beschreibung_en` text, + `institut_id` varchar(32) DEFAULT NULL, + `start` varchar(32) DEFAULT NULL, + `end` varchar(32) DEFAULT NULL, + `beschlussdatum` int(11) DEFAULT NULL, + `fassung_nr` int(2) DEFAULT NULL, + `fassung_typ` varchar(32) DEFAULT NULL, + `stat` varchar(32) DEFAULT NULL, + `kommentar_status` text, + `schlagworte` text, + `author_id` varchar(32) NOT NULL, + `editor_id` varchar(32) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`studiengang_id`), + KEY `abschluss_id` (`abschluss_id`), + KEY `institut_id` (`institut_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) + VALUES + (MD5('MVV_ACCESS_ASSIGN_LVGRUPPEN'), 'MVV_ACCESS_ASSIGN_LVGRUPPEN', 'admin', 1, 'string', 'global', 'modules', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Ab welchem Rechtestatus können Veranstaltungen Modulen (LV-Gruppen) zugeordnet werden. Bei Angabe von fakadmin darf nur dieser Zuordnungen vornehmen.', '') + "); + + /** + * New roles for the plug-in + */ + $stmt = DBManager::get()->query("SELECT pluginid FROM plugins WHERE " + . "pluginname = 'Modulverwaltung'"); + $plugin_id = $stmt->fetchColumn(); + $role_ids = []; + + if ($plugin_id !== false) { + + $db->exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('MVVAdmin', 'n'); + "); + + $db->exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('MVVFreigabe', 'n'); + "); + + $db->exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('MVVEntwickler', 'n'); + "); + + $db->exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('MVVRedakteur', 'n'); + "); + + $db->exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('MVVTranslator', 'n'); + "); + + $db->exec(" + INSERT INTO `roles` (`rolename`, `system`) + VALUES ('MVVLvGruppenAdmin', 'n'); + "); + + $roles = RolePersistence::getAllRoles(); + $role_ids = []; + foreach ($roles as $r) { + if (in_array($r->getRolename(), words('MVVAdmin MVVFreigabe MVVEntwickler MVVRedakteur MVVTranslator MVVLvGruppenAdmin'))) { + $role_ids[] = $r->getRoleid(); + } + } + + RolePersistence::assignPluginRoles($plugin_id, $role_ids); + } + + RolePersistence::expireCaches(); + + /** + * Logging + */ + StudipLog::registerActionPlugin('MVV_MODUL_NEW', 'MVV: Modul erstellen', '%user erstellt neues Modul %modul(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_UPDATE', 'MVV: Modul ändern', '%user ändert Modul %modul(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_DEL', 'MVV: Modul löschen', '%user löscht Modul %modul(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STUDIENGANG_NEW', 'MVV: Studiengang erstellen', '%user erstellt neuen Studiengang %stg(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STUDIENGANG_UPDATE', 'MVV: Studiengang ändern', '%user ändert Studiengang %stg(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STUDIENGANG_DEL', 'MVV: Studiengang löschen', '%user löscht Studiengang %stg(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STGTEIL_NEW', 'MVV: Studiengangteil erstellen', '%user erstellt neuen Studiengangteil %stgteil(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEIL_UPDATE', 'MVV: Studiengangteil ändern', '%user ändert Studiengangteil %stgteil(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEIL_DEL', 'MVV: Studiengangteil löschen', '%user löscht Studiengangteil %stgteil(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STGTEILVERSION_NEW', 'MVV: Studiengangteilversion erstellen', '%user erstellt neue Studiengangteilversion %version(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILVERSION_UPDATE', 'MVV: Studiengangteilversion ändern', '%user ändert Studiengangteilversion %version(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILVERSION_DEL', 'MVV: Studiengangteilversion löschen', '%user löscht Studiengangteilversion %version(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STGTEILBEZ_NEW', 'MVV: Studiengangteil-Bezeichnung erstellen', '%user erstellt neue Studiengangteil-Bezeichnung %stgteilbez(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILBEZ_UPDATE', 'MVV: Studiengangteil-Bezeichnung ändern', '%user ändert Studiengangteil-Bezeichnung %stgteilbez(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILBEZ_DEL', 'MVV: Studiengangteil-Bezeichnung löschen', '%user löscht Studiengangteil-Bezeichnung %stgteilbez(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_LVGRUPPE_NEW', 'MVV: LV-Gruppe erstellen', '%user erstellt neue LV-Gruppe %lvgruppe(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_LVGRUPPE_UPDATE', 'MVV: LV-Gruppe ändern', '%user ändert LV-Gruppe %lvgruppe(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_LVGRUPPE_DEL', 'MVV: LV-Gruppe löschen', '%user löscht LV-Gruppe %lvgruppe(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_FACH_NEW', 'MVV: Fach erstellen', '%user erstellt neues Fach %fach(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_FACH_UPDATE', 'MVV: Fach ändern', '%user ändert Fach %fach(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_FACH_DEL', 'MVV: Fach löschen', '%user löscht Fach %fach(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_ABSCHLUSS_NEW', 'MVV: Abschluss erstellen', '%user erstellt neuen Abschluss %abschluss(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_ABSCHLUSS_UPDATE', 'MVV: Abschluss ändern', '%user ändert Abschluss %abschluss(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_ABSCHLUSS_DEL', 'MVV: Abschluss löschen', '%user löscht Abschluss %abschluss(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_KATEGORIE_NEW', 'MVV: Abschluss-Kategorie erstellen', '%user erstellt neue Abschluss-Kategorie %abskategorie(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_KATEGORIE_UPDATE', 'MVV: Abschluss-Kategorie ändern', '%user ändert Abschluss-Kategorie %abskategorie(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_KATEGORIE_DEL', 'MVV: Abschluss-Kategorie löschen', '%user löscht Abschluss-Kategorie %abskategorie(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_DOKUMENT_NEW', 'MVV: Dokument erstellen', '%user erstellt neues Dokument %dokument(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_DOKUMENT_UPDATE', 'MVV: Dokument ändern', '%user ändert Dokument %dokument(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_DOKUMENT_DEL', 'MVV: Dokument löschen', '%user löscht Dokument %dokument(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STGTEILABS_NEW', 'MVV: Studiengangteilabschnitt erstellen', '%user erstellt neuen Studiengangteilabschnitt %stgteilabs(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILABS_UPDATE', 'MVV: Studiengangteilabschnitt ändern', '%user ändert Studiengangteilabschnitt %stgteilabs(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILABS_DEL', 'MVV: Studiengangteilabschnitt löschen', '%user löscht Studiengangteilabschnitt %stgteilabs(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_MODULTEIL_NEW', 'MVV: Modulteil erstellen', '%user erstellt neuen Modulteil %modulteil(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_UPDATE', 'MVV: Modulteil ändern', '%user ändert Modulteil %modulteil(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_DEL', 'MVV: Modulteil löschen', '%user löscht Modulteil %modulteil(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_MODULTEIL_DESK_NEW', 'MVV: Modulteil Deskriptor erstellen', '%user erstellt neuen Modulteil Deskriptor %modulteildesk(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_DESK_UPDATE', 'MVV: Modulteil Deskriptor ändern', '%user ändert Modulteil Deskriptor %modulteildesk(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_DESK_DEL', 'MVV: Modulteil Deskriptor löschen', '%user löscht Modulteil Deskriptor %modulteildesk(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_MODUL_DESK_NEW', 'MVV: Modul Deskriptor erstellen', '%user erstellt neuen Modul Deskriptor %moduldesk(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_DESK_UPDATE', 'MVV: Modul Deskriptor ändern', '%user ändert Modul Deskriptor %moduldesk(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_DESK_DEL', 'MVV: Modul Deskriptor löschen', '%user löscht Modul Deskriptor %moduldesk(%affected).', 'MVVPlugin'); + + //Zuweisungstabellen + StudipLog::registerActionPlugin('MVV_MODULINST_NEW', 'MVV: Modul-Einrichtung Beziehung erstellen', '%user weist dem Modul %modul(%affected) die Einrichtungen %inst(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULINST_DEL', 'MVV: Modul-Einrichtung Beziehung löschen', '%user löscht die Zuweisung der Einrichtungen %inst(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULINST_UPDATE', 'MVV: Modul-Einrichtung Beziehung ändern', '%user ändert die Zuweisung der Einrichtungen %inst(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_ABS_ZUORD_NEW', 'MVV: Abschluss-Kategorien Zuweisung erstellen', '%user weist den Abschluss %abschluss(%affected) der Kategorie %abskategorie(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_ABS_ZUORD_DEL', 'MVV: Abschluss-Kategorien Zuweisung löschen', '%user löscht die Zuweisung des Abschlusses %abschluss(%affected) zur Kategorie %abskategorie(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_ABS_ZUORD_UPDATE', 'MVV: Abschluss-Kategorien Zuweisung ändern', '%user ändert die Zuweisung des Abschlusses %abschluss(%affected) zur Kategorie %abskategorie(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_DOK_ZUORD_NEW', 'MVV: Dokumentzuordnung erstellen', '%user weist das Dokument %dokument(%affected) %object_type(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_DOK_ZUORD_DEL', 'MVV: Dokumentzuordnung löschen', '%user löscht die Zuweisung des Dokumentes %dokument(%affected) zu %object_type(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_DOK_ZUORD_UPDATE', 'MVV: Dokumentzuordnung ändern', '%user ändert die Zuweisung des Dokumentes %dokument(%affected) zu %object_type(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_FACHINST_NEW', 'MVV: Fach-Einrichtung Zuweisung erstellen', '%user weist das Fach %fach(%affected) der Einrichtung %inst(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_FACHINST_DEL', 'MVV: Fach-Einrichtung Zuweisung löschen', '%user löscht die Zuweisung des Faches %fach(%affected) zur Einrichtung %inst(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_FACHINST_UPDATE', 'MVV: Fach-Einrichtung Zuweisung ändern', '%user ändert die Zuweisung des Faches %fach(%affected) zur Einrichtung %inst(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_LVMODULTEIL_NEW', 'MVV: LV-Gruppe zu Modulteil Zuweisung erstellen', '%user weist der LV-Gruppe %lv(%affected) den Modulteil %modulteil(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_LVMODULTEIL_DEL', 'MVV: LV-Gruppe zu Modulteil Zuweisung löschen', '%user löscht die Zuweisung der LV-Gruppe %lv(%affected) zum Modulteil %modulteil(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_LVMODULTEIL_UPDATE', 'MVV: LV-Gruppe zu Modulteil Zuweisung ändern', '%user ändert die Zuweisung der LV-Gruppe %lv(%affected) zum Modulteil %modulteil(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_LVSEMINAR_NEW', 'MVV: LV-Gruppe zu Veranstaltung Zuweisung erstellen', '%user weist der LV-Gruppe %lvgruppe(%affected) der Veranstaltung %sem(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_LVSEMINAR_DEL', 'MVV: LV-Gruppe zu Veranstaltung Zuweisung löschen', '%user löscht die Zuweisung der LV-Gruppe %lvgruppe(%affected) zur Veranstaltung %sem(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_LVSEMINAR_UPDATE', 'MVV: LV-Gruppe zu Veranstaltung Zuweisung ändern', '%user ändert die Zuweisung der LV-Gruppe %lvgruppe(%affected) zur Veranstaltung %sem(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STGTEILABS_MODUL_NEW', 'MVV: Stgteilabschnitt-Modul Zuweisung erstellen', '%user weist dem Studiengangteilabschnitt %stgteilabs(%affected) dem Modul %Modul(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILABS_MODUL_DEL', 'MVV: Stgteilabschnitt-Modul Zuweisung löschen', '%user löscht die Zuweisung des Studiengangteilabschnitts %stgteilabs(%affected) zum Modul %modul(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STGTEILABS_MODUL_UPDATE', 'MVV: Stgteilabschnitt-Modul Zuweisung ändern', '%user ändert die Zuweisung des Studiengangteilabschnitts %stgteilabs(%affected) zum Modul %modul(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_MODULTEIL_LANG_NEW', 'MVV: Sprache zu Modulteil Zuweisung erstellen', '%user weist dem Modulteil %modulteil(%affected) die Unterrichtssprache %language(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_LANG_DEL', 'MVV: Sprache zu Modulteil Zuweisung löschen', '%user löscht die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modulteil %modulteil(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_LANG_UPDATE', 'MVV: Sprache zu Modulteil Zuweisung ändern', '%user ändert die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modulteil %modulteil(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_MODUL_LANG_NEW', 'MVV: Sprache zu Modul Zuweisung erstellen', '%user weist dem Modul %modul(%affected) die Unterrichtssprache %language(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_LANG_DEL', 'MVV: Sprache zu Modul Zuweisung löschen', '%user löscht die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_LANG_UPDATE', 'MVV: Sprache zu Modul Zuweisung ändern', '%user ändert die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_FACHBERATER_NEW', 'MVV: Person zu Fach Zuweisung erstellen', '%user weist dem Studiengangteil %stgteil(%affected) %user(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_FACHBERATER_DEL', 'MVV: Person zu Fach Zuweisung löschen', '%user löscht die Zuweisung von %user(%coaffected) zum Studiengangteil %stgteil(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_FACHBERATER_UPDATE', 'MVV: Person zu Fach Zuweisung ändern', '%user ändert die Zuweisung von %user(%coaffected) zum Studiengangteil %stgteil(%affected).', 'MVVPlugin'); + + //3er Index + StudipLog::registerActionPlugin('MVV_MODUL_USER_NEW', 'MVV: Person zu Modul Zuweisung erstellen', '%user weist dem Modul %modul(%affected) %user(%coaffected) als %gruppe zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_USER_DEL', 'MVV: Person zu Modul Zuweisung löschen', '%user löscht die Zuweisung von %user(%coaffected) als %gruppe zum Modul %modul(%affected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODUL_USER_UPDATE', 'MVV: Person zu Modul Zuweisung ändern', '%user ändert die Zuweisung von %user(%coaffected) als %gruppe zum Modul %modul(%affected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_MODULTEIL_STGTEILABS_NEW', 'MVV: Studiengangteilabschnitt zu Modulteil Zuweisung erstellen', '%user weist den Modulteil %modulteil(%affected) dem Studiengangteilabschnitt %stgteilabs(%coaffected) im %fachsem. Fachsemester zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_STGTEILABS_DEL', 'MVV: Studiengangteilabschnitt zu Modulteil Zuweisung löschen', '%user löscht die Zuweisung des Modulteils %modulteil(%affected) im %fachsem. des Studiengangteilabschnitt %stgteilabs(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_MODULTEIL_STGTEILABS_UPDATE', 'MVV: Studiengangteilabschnitt zu Modulteil Zuweisung ändern', '%user ändert die Zuweisung des Modulteils %modulteil(%affected) im %fachsem. des Studiengangteilabschnitt %stgteilabs(%coaffected).', 'MVVPlugin'); + + StudipLog::registerActionPlugin('MVV_STG_STGTEIL_NEW', 'MVV: Studiengang zu Studiengangteil Zuweisung erstellen', '%user weist den Studiengang %stg(%affected) dem Studiengangteil %stgteil(%coaffected) zu.', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STG_STGTEIL_DEL', 'MVV: Studiengang zu Studiengangteil Zuweisung löschen', '%user löscht die Zuweisung des Studienganges %stg(%affected) zum Studiengangteil %stgteil(%coaffected).', 'MVVPlugin'); + StudipLog::registerActionPlugin('MVV_STG_STGTEIL_UPDATE', 'MVV: Studiengang zu Studiengangteil Zuweisung ändern', '%user ändert die Zuweisung des Studienganges %stg(%affected) zum Studiengangteil %stgteil(%coaffected).', 'MVVPlugin'); + + // migrate table studiengaenge to fach + $db->exec("RENAME TABLE `studiengaenge` TO `fach`"); + $db->exec("ALTER TABLE `fach` CHANGE `studiengang_id` `fach_id` " + . "VARCHAR(32) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE `fach` CHANGE `name` `name` VARCHAR(255) NOT NULL"); + $db->exec("ALTER TABLE `fach` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`, " + . "ADD `name_kurz` VARCHAR(50) NULL DEFAULT NULL AFTER `name_en`, " + . "ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`"); + $db->exec("ALTER TABLE `fach` ADD `beschreibung_en` TINYTEXT NULL DEFAULT NULL AFTER `beschreibung`, " + . "ADD `schlagworte` TEXT NULL DEFAULT NULL AFTER `beschreibung_en`, " + . "ADD `author_id` VARCHAR(32) NOT NULL AFTER `schlagworte`, " + . "ADD `editor_id` VARCHAR(32) NOT NULL AFTER `author_id`"); + + // extend table abschluss + $db->exec("ALTER TABLE `abschluss` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`, " + . "ADD `name_kurz` VARCHAR(50) NULL DEFAULT NULL AFTER `name_en`, " + . "ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`"); + $db->exec("ALTER TABLE `abschluss` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`, " + . "ADD `author_id` VARCHAR(32) NOT NULL AFTER `beschreibung_en`, " + . "ADD `editor_id` VARCHAR(32) NOT NULL AFTER `author_id`"); + + // erweitert Tabelle user_studiengang um die optionale Angabe einer + // Version des Studiengangs (genauer: Studiengangteils), Fremdschlüssel + // aus Tabelle mvv_stgteilversion + $db->exec("ALTER TABLE `user_studiengang` CHANGE `studiengang_id` `fach_id` " + . "VARCHAR(32) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE `user_studiengang` ADD `version_id` VARCHAR(32) " + . "NULL DEFAULT NULL AFTER `abschluss_id`"); + + // Step 3: LVGroup Assign + if (!CourseWizardStepRegistry::findByClassName('LVGroupsWizardStep')) { + CourseWizardStepRegistry::registerStep('LVGruppen', 'LVGroupsWizardStep', 3, true); + } + } + + public function down() { + + $db = DBManager::get(); + + // remove plug-in + $db->exec("DELETE FROM plugins WHERE pluginpath = 'core/Modulverwaltung'"); + + // delete datafiled entries + $db->exec("DELETE FROM datafield_entrie INNER JOIN datafields " + . "USING(datafields_id) WHERE object_type " + . "IN('moduldeskriptor','modulteildeskriptor"); + + // delete datafields for descriptors + $db->exec("DELETE FROM datafields WHERE object_type " + . "IN('moduldeskriptor','modulteildekriptor"); + + // undo changes for datafields + $db->exec(" + ALTER TABLE `datafields` + CHANGE `object_type` `object_type` + ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata') NULL DEFAULT NULL + "); + + $db->exec(" + ALTER TABLE `datafields` CHANGE `object_class` `object_class` VARCHAR(255) NULL DEFAULT NULL + "); + + // undo changes for sem classes + $db->execute(" + ALTER TABLE `sem_classes` DROP `module` + "); + + $db->exec("DROP TABLE IF EXISTS `mvv_abschl_kategorie`"); + $db->exec("DROP TABLE IF EXISTS `mvv_abschl_zuord`"); + $db->exec("DROP TABLE IF EXISTS `mvv_dokument`"); + $db->exec("DROP TABLE IF EXISTS `mvv_dokument_zuord`"); + $db->exec("DROP TABLE IF EXISTS `mvv_fachberater`"); + $db->exec("DROP TABLE IF EXISTS `mvv_fach_inst`"); + $db->exec("DROP TABLE IF EXISTS `mvv_lvgruppe`"); + $db->exec("DROP TABLE IF EXISTS `mvv_lvgruppe_modulteil`"); + $db->exec("DROP TABLE IF EXISTS `mvv_lvgruppe_seminar`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modul`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modulteil`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modulteil_deskriptor`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modulteil_language`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modulteil_stgteilabschnitt`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modul_deskriptor`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modul_inst`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modul_language`"); + $db->exec("DROP TABLE IF EXISTS `mvv_modul_user`"); + $db->exec("DROP TABLE IF EXISTS `mvv_stgteil`"); + $db->exec("DROP TABLE IF EXISTS `mvv_stgteilabschnitt`"); + $db->exec("DROP TABLE IF EXISTS `mvv_stgteilabschnitt_modul`"); + $db->exec("DROP TABLE IF EXISTS `mvv_stgteilversion`"); + $db->exec("DROP TABLE IF EXISTS `mvv_stgteil_bez`"); + $db->exec("DROP TABLE IF EXISTS `mvv_stg_stgteil`"); + $db->exec("DROP TABLE IF EXISTS `mvv_studiengang`"); + + $db->exec("ALTER TABLE `fach` DROP `name_en`, DROP `name_kurz`, " + . "DROP `name_kurz_en`, DROP `beschreibung_en`, " + . "DROP `schlagworte`, DROP `author_id`, DROP `editor_id`"); + + $db->exec("RENAME TABLE `fach` TO `studiengaenge`"); + + $db->exec("ALTER TABLE `abschluss` DROP `name_en`, DROP `name_kurz`, " + . "DROP `name_kurz_en`, DROP `beschreibung_en`, " + . "DROP `author_id`, DROP `editor_id`"); + + $db->exec("ALTER TABLE `user_studiengang` CHANGE `fach_id``studiengang_id` " + . "VARCHAR(32) NOT NULL DEFAULT ''"); + + $db->exec("ALTER TABLE `user_studiengang` DROP `version_id`"); + + // remove course wizard step + CourseWizardStepRegistry::deleteBySQL('classname = ?', ['LVGroupsWizardStep']); + + /** + * Logging + */ + StudipLog::unregisterAction('MVV_MODUL_NEW'); + StudipLog::unregisterAction('MVV_MODUL_UPDATE'); + StudipLog::unregisterAction('MVV_MODUL_DEL'); + + StudipLog::unregisterAction('MVV_STUDIENGANG_NEW'); + StudipLog::unregisterAction('MVV_STUDIENGANG_UPDATE'); + StudipLog::unregisterAction('MVV_STUDIENGANG_DEL'); + + StudipLog::unregisterAction('MVV_STGTEIL_NEW'); + StudipLog::unregisterAction('MVV_STGTEIL_UPDATE'); + StudipLog::unregisterAction('MVV_STGTEIL_DEL'); + + StudipLog::unregisterAction('MVV_STGTEILVERSION_NEW'); + StudipLog::unregisterAction('MVV_STGTEILVERSION_UPDATE'); + StudipLog::unregisterAction('MVV_STGTEILVERSION_DEL'); + + StudipLog::unregisterAction('MVV_STGTEILBEZ_NEW'); + StudipLog::unregisterAction('MVV_STGTEILBEZ_UPDATE'); + StudipLog::unregisterAction('MVV_STGTEILBEZ_DEL'); + + StudipLog::unregisterAction('MVV_LVGRUPPE_NEW'); + StudipLog::unregisterAction('MVV_LVGRUPPE_UPDATE'); + StudipLog::unregisterAction('MVV_LVGRUPPE_DEL'); + + StudipLog::unregisterAction('MVV_FACH_NEW'); + StudipLog::unregisterAction('MVV_FACH_UPDATE'); + StudipLog::unregisterAction('MVV_FACH_DEL'); + + StudipLog::unregisterAction('MVV_ABSCHLUSS_NEW'); + StudipLog::unregisterAction('MVV_ABSCHLUSS_UPDATE'); + StudipLog::unregisterAction('MVV_ABSCHLUSS_DEL'); + + StudipLog::unregisterAction('MVV_KATEGORIE_NEW'); + StudipLog::unregisterAction('MVV_KATEGORIE_UPDATE'); + StudipLog::unregisterAction('MVV_KATEGORIE_DEL'); + + StudipLog::unregisterAction('MVV_DOKUMENT_NEW'); + StudipLog::unregisterAction('MVV_DOKUMENT_UPDATE'); + StudipLog::unregisterAction('MVV_DOKUMENT_DEL'); + + StudipLog::unregisterAction('MVV_STGTEILABS_NEW'); + StudipLog::unregisterAction('MVV_STGTEILABS_UPDATE'); + StudipLog::unregisterAction('MVV_STGTEILABS_DEL'); + + StudipLog::unregisterAction('MVV_MODULTEIL_NEW'); + StudipLog::unregisterAction('MVV_MODULTEIL_UPDATE'); + StudipLog::unregisterAction('MVV_MODULTEIL_DEL'); + + StudipLog::unregisterAction('MVV_MODULTEIL_DESK_NEW'); + StudipLog::unregisterAction('MVV_MODULTEIL_DESK_UPDATE'); + StudipLog::unregisterAction('MVV_MODULTEIL_DESK_DEL'); + + StudipLog::unregisterAction('MVV_MODUL_DESK_NEW'); + StudipLog::unregisterAction('MVV_MODUL_DESK_UPDATE'); + StudipLog::unregisterAction('MVV_MODUL_DESK_DEL'); + + //Zuweisungstabellen + StudipLog::unregisterAction('MVV_MODULINST_NEW'); + StudipLog::unregisterAction('MVV_MODULINST_UPDATE'); + StudipLog::unregisterAction('MVV_MODULINST_DEL'); + + StudipLog::unregisterAction('MVV_ABS_ZUORD_NEW'); + StudipLog::unregisterAction('MVV_ABS_ZUORD_UPDATE'); + StudipLog::unregisterAction('MVV_ABS_ZUORD_DEL'); + + StudipLog::unregisterAction('MVV_DOK_ZUORD_NEW'); + StudipLog::unregisterAction('MVV_DOK_ZUORD_UPDATE'); + StudipLog::unregisterAction('MVV_DOK_ZUORD_DEL'); + + StudipLog::unregisterAction('MVV_FACHINST_NEW'); + StudipLog::unregisterAction('MVV_FACHINST_UPDATE'); + StudipLog::unregisterAction('MVV_FACHINST_DEL'); + + StudipLog::unregisterAction('MVV_LVMODULTEIL_NEW'); + StudipLog::unregisterAction('MVV_LVMODULTEIL_UPDATE'); + StudipLog::unregisterAction('MVV_LVMODULTEIL_DEL'); + + StudipLog::unregisterAction('MVV_LVSEMINAR_NEW'); + StudipLog::unregisterAction('MVV_LVSEMINAR_UPDATE'); + StudipLog::unregisterAction('MVV_LVSEMINAR_DEL'); + + StudipLog::unregisterAction('MVV_STGTEILABS_MODUL_NEW'); + StudipLog::unregisterAction('MVV_STGTEILABS_MODUL_UPDATE'); + StudipLog::unregisterAction('MVV_STGTEILABS_MODUL_DEL'); + + StudipLog::unregisterAction('MVV_MODULTEIL_LANG_NEW'); + StudipLog::unregisterAction('MVV_MODULTEIL_LANG_UPDATE'); + StudipLog::unregisterAction('MVV_MODULTEIL_LANG_DEL'); + + StudipLog::unregisterAction('MVV_MODUL_LANG_NEW'); + StudipLog::unregisterAction('MVV_MODUL_LANG_UPDATE'); + StudipLog::unregisterAction('MVV_MODUL_LANG_DEL'); + + StudipLog::unregisterAction('MVV_FACHBERATER_NEW'); + StudipLog::unregisterAction('MVV_FACHBERATER_UPDATE'); + StudipLog::unregisterAction('MVV_FACHBERATER_DEL'); + + //3er Index + StudipLog::unregisterAction('MVV_MODUL_USER_NEW'); + StudipLog::unregisterAction('MVV_MODUL_USER_UPDATE'); + StudipLog::unregisterAction('MVV_MODUL_USER_DEL'); + + StudipLog::unregisterAction('MVV_MODULTEIL_STGTEILABS_NEW'); + StudipLog::unregisterAction('MVV_MODULTEIL_STGTEILABS_UPDATE'); + StudipLog::unregisterAction('MVV_MODULTEIL_STGTEILABS_DEL'); + + StudipLog::unregisterAction('MVV_STG_STGTEIL_NEW'); + StudipLog::unregisterAction('MVV_STG_STGTEIL_UPDATE'); + StudipLog::unregisterAction('MVV_STG_STGTEIL_DEL'); + } + +} diff --git a/db/migrations/1.19_step_00141_zip_download_restrictions.php b/db/migrations/1.19_step_00141_zip_download_restrictions.php new file mode 100644 index 0000000..622fa1c --- /dev/null +++ b/db/migrations/1.19_step_00141_zip_download_restrictions.php @@ -0,0 +1,24 @@ +exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES (MD5( 'ZIP_DOWNLOAD_MAX_FILES' ) , '', 'ZIP_DOWNLOAD_MAX_FILES', '100', '1', 'integer', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Die maximale Anzahl an Dateien, die gezippt heruntergeladen werden kann', '', '' + )"); + $db->exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES (MD5( 'ZIP_DOWNLOAD_MAX_SIZE' ) , '', 'ZIP_DOWNLOAD_MAX_SIZE', '100', '1', 'integer', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Die maximale Größe aller Dateien, die zusammen in einem Zip heruntergeladen werden kann (in Megabytes).', '', '' + )"); + } + + function down() { + $db = DBManager::get(); + $db->exec("DELETE FROM config WHERE config_id IN (MD5('ZIP_DOWNLOAD_MAX_FILES'),MD5('ZIP_DOWNLOAD_MAX_SIZE'))"); + } +} +?> diff --git a/db/migrations/1.1_init_migrations.php b/db/migrations/1.1_init_migrations.php new file mode 100644 index 0000000..86f2da5 --- /dev/null +++ b/db/migrations/1.1_init_migrations.php @@ -0,0 +1,20 @@ +exec(" + CREATE TABLE IF NOT EXISTS `schema_version` ( + `domain` varchar(255) NOT NULL default '', + `version` int(11) NOT NULL default '0', + PRIMARY KEY (`domain`) + ) ENGINE=MyISAM; + "); + } +} +?> diff --git a/db/migrations/1.200_step_00299_statusgroups.php b/db/migrations/1.200_step_00299_statusgroups.php new file mode 100644 index 0000000..7544ef9 --- /dev/null +++ b/db/migrations/1.200_step_00299_statusgroups.php @@ -0,0 +1,41 @@ + + * @license GPL2 or any later version + * @since Stud.IP 3.5 + * + * @see https://develop.studip.de/trac/ticket/6590 + */ +class StEP00299Statusgroups extends Migration +{ + + /** + * Describe what the migration does. + * @return string + */ + public function description() + { + return 'Adds columns for selfassign start and end time to table statusgruppen'; + } + + /** + * Add a new database column to table statusgruppen: optional start time for self assignment. + */ + public function up() + { + DBManager::get()->execute("ALTER TABLE `statusgruppen` + ADD `selfassign_start` INT NOT NULL DEFAULT 0 AFTER `selfassign`, + ADD `selfassign_end` INT NOT NULL DEFAULT 0 AFTER `selfassign_start`"); + } + + /** + * Drops database column for start time of self assignment. + */ + public function down() + { + DBManager::get()->execute("ALTER TABLE `statusgruppen` DROP `selfassign_start`"); + } + +} diff --git a/db/migrations/1.201_i18n_content.php b/db/migrations/1.201_i18n_content.php new file mode 100644 index 0000000..41422a2 --- /dev/null +++ b/db/migrations/1.201_i18n_content.php @@ -0,0 +1,31 @@ +exec("CREATE TABLE IF NOT EXISTS `i18n` ( + `object_id` varchar(32) NOT NULL, + `table` varchar(255) NOT NULL, + `field` varchar(255) NOT NULL, + `lang` varchar(32) NOT NULL, + `value` text, + PRIMARY KEY (`object_id`,`table`,`field`,`lang`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + } + + public function down() + { + $db = DBManager::get(); + + $db->exec('DROP TABLE IF EXISTS i18n'); + } +} diff --git a/db/migrations/1.202_remove_skype_status.php b/db/migrations/1.202_remove_skype_status.php new file mode 100644 index 0000000..1a4a298 --- /dev/null +++ b/db/migrations/1.202_remove_skype_status.php @@ -0,0 +1,24 @@ + + * @license GPL2 or any later version + */ +class RemoveSkypeStatus extends Migration +{ + public function description() + { + return 'Removes user config entries for skype status'; + } + + public function up() + { + $query = "DELETE FROM `user_config` + WHERE `field` = 'SKYPE_ONLINE_STATUS'"; + DBManager::get()->exec($query); + } + + public function down() + { + // Nothing since there was not default entry for SKYPE_ONLINE_STATUS + } +} diff --git a/db/migrations/1.203_archive_help_texts.php b/db/migrations/1.203_archive_help_texts.php new file mode 100644 index 0000000..c0415af --- /dev/null +++ b/db/migrations/1.203_archive_help_texts.php @@ -0,0 +1,45 @@ + + * @license GPL2 or any later version + */ +class ArchiveHelpTexts extends Migration +{ + public function description() + { + return 'Adds / updates help texts for the controllers search/archive and course/archive.'; + } + + public function up() + { + $db = DBManager::get(); + + $db->exec(" + INSERT INTO help_content (global_content_id, content_id, language, content, route, studip_version) + VALUES('55499281ce1a4757f17aaf73faa072ea', '55499281ce1a4757f17aaf73faa072ea', 'de', 'Auf dieser Seite können sie sich vor dem Archivieren vergewissern, das die richtige(n) Veranstaltunge(n) zum Archivieren ausgewählt wurden.', 'dispatch.php/course/archive/confirm', '4.0'); + "); + $db->exec(" + INSERT INTO help_content (global_content_id, content_id, language, content, route, studip_version) + VALUES('a2a649de15c8d8473b11fccc731dc80f', 'a2a649de15c8d8473b11fccc731dc80f', 'en', 'Before archiving you can check on this page that the right course(s) have been selected for archiving.', 'dispatch.php/course/archive/confirm', '4.0'); + "); + $db->exec(" + UPDATE help_content SET route = 'dispatch.php/search/archive' WHERE route = 'archiv.php'; + "); + + $db = null; + } + + public function down() + { + $db = DBManager::get(); + + $db->exec(" + DELETE FROM help_content where route = 'dispatch.php/course/archive/confirm'; + "); + $db->exec(" + UPDATE help_content SET route = 'archiv.php' WHERE route = 'dispatch.php/search/archive'; + "); + + $db = null; + } +} diff --git a/db/migrations/1.204_dialog_from_notification.php b/db/migrations/1.204_dialog_from_notification.php new file mode 100644 index 0000000..19e32ae --- /dev/null +++ b/db/migrations/1.204_dialog_from_notification.php @@ -0,0 +1,24 @@ +exec(" + ALTER TABLE personal_notifications + ADD `dialog` TINYINT NOT NULL DEFAULT '0' AFTER `avatar` + "); + } + + public function down() + { + DBManager::get()->exec(" + ALTER TABLE personal_notifications + DROP `dialog` + "); + } +} diff --git a/db/migrations/1.205_course_scm_helptext.php b/db/migrations/1.205_course_scm_helptext.php new file mode 100644 index 0000000..071daa3 --- /dev/null +++ b/db/migrations/1.205_course_scm_helptext.php @@ -0,0 +1,37 @@ + + * @license GPL2 or any later version + */ +class CourseScmHelptext extends Migration +{ + public function description() + { + return 'Adds a help text for the free information page in a course.'; + } + + public function up() + { + $db = DBManager::get(); + + $db->exec(" + INSERT INTO help_content (global_content_id, content_id, language, content, route, studip_version) + VALUES + ('142482b4b06a376b2eb4c91d38559a15', '142482b4b06a376b2eb4c91d38559a15', 'de', 'Freie Gestaltung von Reiternamen und Inhalten durch Lehrende. Es gibt Raum für eigene Informationen, der Name des Reiters ist frei definierbar. Es können beliebig viele Einträge (\"neue Einträge\") hinzugefügt werden.', 'dispatch.php/course/scm', '4.0') + ;" + ); + + $db = null; + } + + public function down() + { + $db = DBManager::get(); + + $db->exec( + "DELETE FROM help_content WHERE content_id = '142482b4b06a376b2eb4c91d38559a15';" + ); + + $db = null; + } +} diff --git a/db/migrations/1.206_alter_columns_weekoffset_to_int.php b/db/migrations/1.206_alter_columns_weekoffset_to_int.php new file mode 100644 index 0000000..ad4e312 --- /dev/null +++ b/db/migrations/1.206_alter_columns_weekoffset_to_int.php @@ -0,0 +1,32 @@ + + * @license GPL2 or any later version + * Date: 19.10.16 + */ +class AlterColumnsWeekoffsetToInt extends Migration +{ + + function description() + { + return 'Alter the two columns week_offset and end_offset in table seminar_cycle_dates .'; + } + + function up() + { + DBManager::get()->exec( + "ALTER table `seminar_cycle_dates` + CHANGE column `week_offset` `week_offset` INT NOT NULL DEFAULT '0', CHANGE column `end_offset` `end_offset` INT DEFAULT NULL"); + } + + function down() + { + DBManager::get()->exec( + "ALTER table `seminar_cycle_dates` + CHANGE column `week_offset` `week_offset` TINYINT NOT NULL DEFAULT '0', CHANGE column `end_offset` `end_offset` TINYINT DEFAULT NULL"); + } + +} diff --git a/db/migrations/1.207_add_etask_tables.php b/db/migrations/1.207_add_etask_tables.php new file mode 100644 index 0000000..abe2313 --- /dev/null +++ b/db/migrations/1.207_add_etask_tables.php @@ -0,0 +1,138 @@ + + */ +class AddEtaskTables extends Migration +{ + + public function description() + { + return 'Adds the eAufgaben tables.'; + } + + public function up() + { + $db = DBManager::get(); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_tasks` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `type` VARCHAR(64) NOT NULL, + `title` VARCHAR(255) NOT NULL, + `description` TEXT NOT NULL, + `task` TEXT NOT NULL, + `user_id` CHAR(32) NOT NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_task_tags` ( + `task_id` INT(11) NOT NULL, + `user_id` CHAR(32) NOT NULL, + `tag` VARCHAR(64) NOT NULL, + PRIMARY KEY (`task_id`, `user_id`, `tag`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_tests` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `title` VARCHAR(255) NOT NULL, + `description` TEXT NOT NULL, + `user_id` CHAR(32) NOT NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_test_tags` ( + `test_id` INT(11) NOT NULL, + `user_id` CHAR(32) NOT NULL, + `tag` VARCHAR(64) NOT NULL, + PRIMARY KEY (`test_id`, `user_id`, `tag`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_test_tasks` ( + `test_id` INT(11) NOT NULL, + `task_id` INT(11) NOT NULL, + `position` INT(11) NOT NULL, + `points` FLOAT NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`test_id`, `task_id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_assignments` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `test_id` INT(11) NOT NULL, + `range_type` ENUM('course', 'global', 'group', 'institute', 'user') NULL, + `range_id` CHAR(32) NULL, + `type` VARCHAR(64) NOT NULL, + `start` INT(11) NULL, + `end` INT(11) NULL, + `active` TINYINT(1) NOT NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_assignment_ranges` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `assignment_id` INT(11) NOT NULL, + `range_type` ENUM('course', 'global', 'group', 'institute', 'user') NOT NULL, + `range_id` CHAR(32) NOT NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `assignment_id` (`assignment_id`,`range_type`,`range_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_assignment_attempts` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `assignment_id` INT(11) NOT NULL, + `user_id` CHAR(32) NOT NULL, + `start` INT(11) NULL, + `end` INT(11) NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + + $db->exec(" + CREATE TABLE IF NOT EXISTS `etask_responses` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `assignment_id` INT(11) NOT NULL, + `task_id` INT(11) NOT NULL, + `user_id` CHAR(32) NOT NULL, + `response` TEXT NOT NULL, + `state` TINYINT(1) NULL, + `points` FLOAT NULL, + `feedback` TEXT NULL, + `grader_id` CHAR(32) NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + `options` TEXT NOT NULL, + PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC + "); + } + + public function down() + { + foreach ([ + 'etask_tasks', 'etask_task_tags', + 'etask_tests', 'etask_test_tags', + 'etask_test_tasks', 'etask_assignments', + 'etask_assignment_attempts', 'etask_responses' + ] as $table) { + # $db->exec('DROP TABLE IF EXISTS `' . $table . '`'); + } + } +} diff --git a/db/migrations/1.208_migrate_questionnaire_questions.php b/db/migrations/1.208_migrate_questionnaire_questions.php new file mode 100644 index 0000000..87dee2c --- /dev/null +++ b/db/migrations/1.208_migrate_questionnaire_questions.php @@ -0,0 +1,294 @@ + + */ +class MigrateQuestionnaireQuestions extends Migration +{ + + public function description() + { + return 'Migrates questions of the questionnaires to eTask compatible tasks.'; + } + + public function up() + { + $this->db = DBManager::get(); + $this->addEtaskIDToQuestionsTable(); + + foreach ($this->fetchQuestions() as $question) { + $this->migrateQuestion($question); + } + + $this->migrateMCAnswers(); + + $this->removeQuestionTypeAndDataFromQuestionsTable(); + } + + public function down() + { + $this->db = DBManager::get(); + $this->addQuestionTypeAndDataFromQuestionsTable(); + + foreach ($this->fetchQuestions() as $question) { + $this->unmigrateQuestion($question); + } + + $this->removeEtaskIDToQuestionsTable(); + } + + // ***** PRIVATES ***** + + private function addEtaskIDToQuestionsTable() + { + $this->db->exec(" + ALTER TABLE `questionnaire_questions` + ADD `etask_task_id` INT NOT NULL + AFTER `questionnaire_id` + "); + } + + private function addQuestionTypeAndDataFromQuestionsTable() + { + $this->db->exec(" + ALTER TABLE `questionnaire_questions` + ADD `questiondata` text NOT NULL AFTER `questionnaire_id`, + ADD `questiontype` varchar(64) NOT NULL AFTER `questionnaire_id` + "); + } + + private function connectTaskToQuestion($taskID, $questionID) + { + $stmt = $this->db->prepare(" + UPDATE questionnaire_questions + SET etask_task_id = ? + WHERE question_id = ? + "); + + $stmt->execute([ $taskID, $questionID ]); + } + + private function fetchTask($id) + { + $stmt = $this->db->prepare(" + SELECT * FROM `etask_tasks` WHERE id = ? + "); + $stmt->execute([$id]); + + return $stmt->fetch(PDO::FETCH_ASSOC); + } + + private function fetchQuestions() + { + $stmt = $this->db->prepare('SELECT * FROM `questionnaire_questions`'); + $stmt->execute(); + $stmt->setFetchMode(PDO::FETCH_ASSOC); + + return $stmt; + } + + private function findOwner($questionID) + { + $stmt = $this->db->prepare(" + SELECT user_id + FROM `questionnaire_questions` + INNER JOIN questionnaires + USING ( questionnaire_id ) + WHERE question_id = ? LIMIT 1 + "); + + $stmt->execute([ $questionID ]); + + return $stmt->fetchColumn(); + } + + private function fetchMCAnswers() + { + $stmt = $this->db->prepare(" + SELECT answer_id, answerdata + FROM `questionnaire_answers` + WHERE answerdata LIKE '%{\"answers\":%' + "); + $stmt->execute([]); + $stmt->setFetchMode(PDO::FETCH_NUM); + + return $stmt; + } + + private function migrateMCAnswers() + { + $updateStmt = $this->db->prepare(" + UPDATE questionnaire_answers SET answerdata = ? WHERE answer_id = ? + "); + + $decr = function ($item) { + return intval($item) - 1; + }; + + foreach ($this->fetchMCAnswers() as $answer) { + list($answerID, $answerData) = $answer; + + $data = (array)json_decode($answerData, true); + if (is_array($data['answers'])) { + $dataAnswers = array_map($decr, $data['answers']); + } else { + $dataAnswers = $decr($data['answers']); + } + + $data['answers'] = $dataAnswers; + + $updateStmt->execute( + [ + json_encode($data), + $answerID + ] + ); + } + } + + private function migrateQuestion($questionAry) + { + $task = null; + + switch ($type = $questionAry['questiontype']) { + case 'Test': + case 'Vote': + $task = $this->migrateTypeVoteOrTest($questionAry); + break; + + case 'Datefinder': + $task = $this->migrateTypeDatefinder($questionAry); + break; + + default: + throw new RuntimeException("Unknown Type: " . $type); + } + + $this->connectTaskToQuestion($task->id, $questionAry['question_id']); + } + + private function migrateTypeDatefinder($questionAry) + { + $oldData = (array)json_decode($questionAry['questiondata'], true); + + $description = $oldData['question'] ?: ''; + $userID = $this->findOwner($questionAry['question_id']); + + $task = [ + 'automatic' => $oldData['automatic'] ? true : false, + 'dates' => $oldData['dates'] ?: [], + 'duration' => (int) $oldData['duration'], + 'founddate' => $oldData['founddate'], + 'status' => $oldData['status'] + ]; + + $options = [ + 'questionnaire_question_id' => $questionAry['question_id'], + 'questionnaire_questiontype' => $questionAry['questiontype'], + 'questionnaire_questiondata' => $questionAry['questiondata'] + ]; + + return Task::create( + [ + 'type' => 'datefinder', + 'title' => '', + 'description' => $description, + 'task' => $task, + 'user_id' => $userID, + 'mkdate' => $questionAry['mkdate'], + 'chdate' => $questionAry['chdate'], + 'options' => $options + ] + ); + } + + private function migrateTypeVoteOrTest($questionAry) + { + $oldData = (array)json_decode($questionAry['questiondata'], true); + + $description = $oldData['question'] ?: ''; + $userID = $this->findOwner($questionAry['question_id']); + + $correctAnswer = array_key_exists('correctanswer', $oldData) && is_array($oldData['correctanswer']) + ? $oldData['correctanswer'] + : []; + $answers = []; + foreach ($oldData['options'] as $index => $answer) { + $isCorrect = in_array((string)($index + 1), $correctAnswer); + $answers[] = [ + 'text' => $answer, + 'score' => $isCorrect ? 1 : 0, + 'feedback' => '' + ]; + } + + $task = [ + 'type' => $oldData['multiplechoice'] ? 'multiple' : 'single', + 'answers' => $answers + ]; + + $options = [ + 'randomize' => $oldData['randomize'] ? true : false, + 'questionnaire_question_id' => $questionAry['question_id'], + 'questionnaire_questiontype' => $questionAry['questiontype'], + 'questionnaire_questiondata' => $questionAry['questiondata'] + ]; + + return Task::create( + [ + 'type' => 'multiple-choice', + 'title' => '', + 'description' => $description, + 'task' => $task, + 'user_id' => $userID, + 'mkdate' => $questionAry['mkdate'], + 'chdate' => $questionAry['chdate'], + 'options' => $options + ] + ); + } + + private function removeEtaskIDToQuestionsTable() + { + $this->db->exec(" + ALTER TABLE `questionnaire_questions` + DROP `etask_task_id` + "); + } + + private function removeQuestionTypeAndDataFromQuestionsTable() + { + $this->db->exec(" + ALTER TABLE `questionnaire_questions` + DROP `questiontype`, + DROP `questiondata` + "); + } + + private function unmigrateQuestion($questionAry) + { + $taskID = $questionAry['etask_task_id']; + $task = $this->fetchTask($taskID); + + $options = (array)json_decode($task['options'], true); + $questiontype = $options['questionnaire_questiontype']; + $questiondata = $options['questionnaire_questiondata']; + + if (!strlen($questiontype) || !strlen($questiondata)) { + return; + } + + $stmt = $this->db->prepare(" + UPDATE questionnaire_questions + SET questiontype = ?, + questiondata = ? + WHERE question_id = ? + "); + + $stmt->execute([$questiontype, $questiondata, $questionAry['question_id']]); + } +} diff --git a/db/migrations/1.209_convert_cronjob_logs.php b/db/migrations/1.209_convert_cronjob_logs.php new file mode 100644 index 0000000..51c5804 --- /dev/null +++ b/db/migrations/1.209_convert_cronjob_logs.php @@ -0,0 +1,44 @@ +exec($query); + + // Quickly convert serialized NULL entries for exception column + $query = "UPDATE `cronjobs_logs` + SET `exception` = NULL + WHERE `exception` = 'N;'"; + DBManager::get()->exec($query); + + // Convert all remaining logs + do { + $converted = CronjobLog::findEachBySQL(function ($entry) { + $entry->exception = unserialize($entry->exception) ?: null; + $entry->store(); + unset($entry); + }, "exception RLIKE '^(N;|O:)' LIMIT {$LIMIT}"); + } while ($converted > 0); + } + + public function down() + { + // Not neccessary + } +} diff --git a/db/migrations/1.20_calendar_events_class_default.php b/db/migrations/1.20_calendar_events_class_default.php new file mode 100644 index 0000000..a82b46c --- /dev/null +++ b/db/migrations/1.20_calendar_events_class_default.php @@ -0,0 +1,23 @@ +exec("ALTER TABLE `calendar_events` CHANGE `class` `class` ". + "ENUM( 'PUBLIC', 'PRIVATE', 'CONFIDENTIAL' ) ". + "NOT NULL DEFAULT 'PRIVATE'"); + } + + function down() { + $db = DBManager::get(); + $db->exec("ALTER TABLE `calendar_events` CHANGE `class` `class` ". + "ENUM( 'PUBLIC', 'PRIVATE', 'CONFIDENTIAL' ) ". + "NOT NULL DEFAULT 'PUBLIC'"); + } +} diff --git a/db/migrations/1.210_tic_7206.php b/db/migrations/1.210_tic_7206.php new file mode 100644 index 0000000..ff54acd --- /dev/null +++ b/db/migrations/1.210_tic_7206.php @@ -0,0 +1,13 @@ +exec("ALTER TABLE `questionnaires` ADD `copyable` TINYINT NOT NULL DEFAULT '0' AFTER `editanswers`"); + } + + public function down() + { + DBManager::get()->exec("ALTER TABLE `questionnaires` DROP `copyable`"); + } +} diff --git a/db/migrations/1.211_tic7307_admission_rule_path.php b/db/migrations/1.211_tic7307_admission_rule_path.php new file mode 100644 index 0000000..7892a2d --- /dev/null +++ b/db/migrations/1.211_tic7307_admission_rule_path.php @@ -0,0 +1,23 @@ +exec("ALTER TABLE `admissionrules` ADD `path` VARCHAR(255) NOT NULL"); + + $stmt = DBManager::get()->prepare("UPDATE `admissionrules` SET `path` = :path WHERE `id` = :id"); + + foreach (DBManager::get()->fetchAll("SELECT `id`, `ruletype` FROM `admissionrules` ORDER BY `id`") as $rule) { + $stmt->execute([ + 'path' => 'lib/admissionrules/' . strtolower($rule['ruletype']), + 'id' => $rule['id'] + ]); + } + + } + + public function down() + { + DBManager::get()->exec("ALTER TABLE `questionnaires` DROP `path`"); + } +} diff --git a/db/migrations/1.212_refactor_config_local.php b/db/migrations/1.212_refactor_config_local.php new file mode 100644 index 0000000..81eb682 --- /dev/null +++ b/db/migrations/1.212_refactor_config_local.php @@ -0,0 +1,193 @@ + [ + 'description' => "Name der Stud.IP-Installation bzw. Hochschule.", + 'type' => "string", + 'default' => "Stud.IP" + ], + "STUDIP_INSTALLATION_ID" => [ + 'description' => "Unique identifier for installation", + 'type' => "string", + 'default' => "demo-installation" + ], + "MEDIA_CACHE_MAX_LENGTH" => [ + 'description' => "Maximale Größe von Dateien, die im Media-Cache gecached werden (in Bytes)?", + 'type' => "integer", + 'default' => 1000000 + ], + "MEDIA_CACHE_LIFETIME" => [ + 'description' => "Wieviele Sekunden soll gecached werden?", + 'type' => "integer", + 'default' => 86400 + ], + "MEDIA_CACHE_MAX_FILES" => [ + 'description' => "Wieviele Dateien sollen maximal gecached werden?", + 'type' => "integer", + 'default' => 3000 + ], + "XSLT_ENABLE" => [ + 'description' => "Soll Export mit XSLT angeschaltet sein?", + 'type' => "boolean", + 'default' => 1 + ], + "FOP_ENABLE" => [ + 'description' => "Soll Export mit FOP erlaubt sein?", + 'type' => "boolean", + 'default' => 1 + ], + "EXTERN_SRI_ENABLE" => [ + 'description' => "Allow the usage of SRI-interface (Stud.IP Remote Include)", + 'type' => "boolean", + 'default' => 1 + ], + "EXTERN_SRI_ENABLE_BY_ROOT" => [ + 'description' => "Only root allows the usage of SRI-interface for specific institutes", + 'type' => "boolean", + 'default' => 0 + ], + "EXTERN_ALLOW_ACCESS_WITHOUT_CONFIG" => [ + 'description' => "Free access to external pages (without the need of a configuration), independent of SRI settings above", + 'type' => "boolean", + 'default' => 0 + ], + "SOAP_ENABLE" => [ + 'description' => "Schaltet die SOAP-Schnittstelle an.", + 'type' => "boolean", + 'default' => 0 + ], + "SOAP_USE_PHP5" => [ + 'description' => "Sollen PHP-Bibliotheken für SOAP verwendet werden?", + 'type' => "boolean", + 'default' => 0 + ], + "ALLOW_SELFASSIGN_STUDYCOURSE" => [ + 'description' => "If true, students are allowed to set or change their studycourse (studiengang)", + 'type' => "boolean", + 'default' => 1 + ], + "SHOW_TERMS_ON_FIRST_LOGIN" => [ + 'description' => "If true, the user has to accept the terms on his first login (this feature makes only sense, if you use disable ENABLE_SELF_REGISTRATION).", + 'type' => "boolean", + 'default' => 0 + ], + "CONVERT_IDNA_URL" => [ + 'description' => "If true, urls with german \"umlauts\" are converted", + 'type' => "boolean", + 'default' => 1 + ], + "USER_VISIBILITY_CHECK" => [ + 'description' => "Enable presentation of visibility decision texts for users after first login. see lib/include/header.php and lib/user_visible.inc.php for further info", + 'type' => "boolean", + 'default' => 0 + ], + "USERNAME_REGULAR_EXPRESSION" => [ + 'description' => "Regex for allowed characters in usernames", + 'type' => "string", + 'default' => '/^([a-zA-Z0-9_@.-]{4,})$/' + ], + "DEFAULT_TIMEZONE" => [ + 'description' => "What timezone should be used (default: Europe/Berlin)?", + 'type' => "string", + 'default' => 'Europe/Berlin' + ], + "DEFAULT_LANGUAGE" => [ + 'description' => "Which language should we use if we can gather no information from user?", + 'type' => "string", + 'default' => 'de_DE' + ], + "ALLOW_CHANGE_USERNAME" => [ + 'description' => "If true, users are allowed to change their username", + 'type' => "boolean", + 'section' => "permissions", + 'default' => 1 + ], + "ALLOW_CHANGE_EMAIL" => [ + 'description' => "If true, users are allowed to change their email", + 'type' => "boolean", + 'section' => "permissions", + 'default' => 1 + ], + "ALLOW_CHANGE_NAME" => [ + 'description' => "If true, users are allowed to change their name", + 'type' => "boolean", + 'section' => "permissions", + 'default' => 1 + ], + "ALLOW_CHANGE_TITLE" => [ + 'description' => "If true, users are allowed to change their titles", + 'type' => "boolean", + 'section' => "permissions", + 'default' => 1 + ], + "ENABLE_SELF_REGISTRATION" => [ + 'description' => "Should it be possible for an user to register himself", + 'type' => "boolean", + 'section' => "permissions", + 'default' => 1 + ], + "ENABLE_REQUEST_NEW_PASSWORD_BY_USER" => [ + 'description' => "If true, users are able to request a new password themselves", + 'type' => "boolean", + 'section' => "permissions", + 'default' => 1 + ], + "PHPASS_USE_PORTABLE_HASH" => [ + 'description' => "PHPASS_USE_PORTABLE_HASH", + 'type' => "boolean", + 'default' => 0 + ], + "WEBSERVICES_ENABLE" => [ + 'description' => "Schaltet die Webservice-Schnittstelle an.", + 'type' => "boolean", + 'default' => 0 + ], + "ENABLE_FREE_ACCESS" => [ + 'description' => "If true, courses with public access are available", + 'type' => "boolean", + 'default' => 1 + ], + ]; + + $stmt_value = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (:config_id, :name, :value, '0', :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + $stmt_default = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (:config_id, :name, :value, '1', :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($global_boolean_parameter as $name => $data) { + $option = [ + 'config_id' => md5($name), + 'name' => $name, + 'type' => $data['type'], + 'value' => $data['default'], + 'range' => 'global', + 'section' => $data['section'] ?: 'global', + 'description' => $data['description'] + ]; + $stmt_default->execute($option); + if (isset($GLOBALS[$name]) && $GLOBALS[$name] != $option['value']) { + $option['config_id'] = md5($name . '___VALUE'); + $option['value'] = $GLOBALS[$name]; + $stmt_value->execute($option); + } + } + } +} diff --git a/db/migrations/1.213_log_action_statusgroups.php b/db/migrations/1.213_log_action_statusgroups.php new file mode 100644 index 0000000..be633a2 --- /dev/null +++ b/db/migrations/1.213_log_action_statusgroups.php @@ -0,0 +1,35 @@ +exec(" + INSERT IGNORE INTO log_actions + SET action_id = MD5('STATUSGROUP_ADD_USER'), + name = 'STATUSGROUP_ADD_USER', + description = 'Nutzer wird zu einer Statusgruppe hinzugefügt', + info_template = '%user fügt %user(%affected) zur %group(%coaffected) hinzu.', + active = '1', + expires = '0' + "); + DBManager::get()->exec(" + INSERT IGNORE INTO log_actions + SET action_id = MD5('STATUSGROUP_REMOVE_USER'), + name = 'STATUSGROUP_REMOVE_USER', + description = 'Nutzer wird aus einer Statusgruppe gelöscht', + info_template = '%user entfernt %user(%affected) aus %group(%coaffected).', + active = '1', + expires = '0' + "); + } + + public function down() + { + DBManager::get()->exec(" + DELETE FROM log_actions WHERE action_id = MD5('STATUSGROUP_ADD_USER') + "); + DBManager::get()->exec(" + DELETE FROM log_actions WHERE action_id = MD5('STATUSGROUP_REMOVE_USER') + "); + } +} \ No newline at end of file diff --git a/db/migrations/1.214_textmarkup_datafield.php b/db/migrations/1.214_textmarkup_datafield.php new file mode 100644 index 0000000..a248ba4 --- /dev/null +++ b/db/migrations/1.214_textmarkup_datafield.php @@ -0,0 +1,22 @@ +exec("ALTER TABLE datafields CHANGE type + type ENUM('bool','textline','textarea','textmarkup','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') + NOT NULL DEFAULT 'textline'"); + } + + public function down() + { + DBManager::get()->exec("ALTER TABLE datafields CHANGE type + type ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') + NOT NULL DEFAULT 'textline'"); + } +} diff --git a/db/migrations/1.215_default_data_field_values.php b/db/migrations/1.215_default_data_field_values.php new file mode 100644 index 0000000..1b72867 --- /dev/null +++ b/db/migrations/1.215_default_data_field_values.php @@ -0,0 +1,29 @@ +exec("ALTER TABLE datafields ADD default_value TEXT NULL AFTER is_required"); + DBManager::get()->exec("DELETE FROM datafields_entries WHERE content IS NULL OR content = ''"); + } + + /** + * revert this migration + */ + public function down() + { + DBManager::get()->exec("ALTER TABLE datafields DROP default_value"); + } +} diff --git a/db/migrations/1.216_add_evaldate.php b/db/migrations/1.216_add_evaldate.php new file mode 100644 index 0000000..e2ac38b --- /dev/null +++ b/db/migrations/1.216_add_evaldate.php @@ -0,0 +1,22 @@ +exec('ALTER TABLE evalanswer_user ADD evaldate int(11) NOT NULL default 0'); + } + + public function down() + { + $db = DBManager::get(); + + $db->exec('ALTER TABLE evalanswer_user DROP evaldate'); + } +} diff --git a/db/migrations/1.217_course_number_format_config.php b/db/migrations/1.217_course_number_format_config.php new file mode 100644 index 0000000..da26600 --- /dev/null +++ b/db/migrations/1.217_course_number_format_config.php @@ -0,0 +1,59 @@ + + */ +class CourseNumberFormatConfig extends Migration +{ + /** + * new config options to install + */ + private $options = [ + [ + 'name' => 'COURSE_NUMBER_FORMAT', + 'description' => 'Erlaubt das Eintragen eines regulären Ausdrucks zur Validierung einer Veranstaltungsnummer. Im Kommentarfeld kann ein entsprechender Hilfetext hinterlegt werden.', + 'section' => 'global', + 'type' => 'string', + 'value' => '' + ] + ]; + + /** + * short description of this migration + */ + public function description() + { + return 'Adds the config entry "COURSE_NUMBER_FORMAT". This allows ' + . 'restricting newly entered course numbers to a fixed format.'; + } + + /** + * perform this migration + */ + public function up() + { + $db = DBManager::get(); + $stmt = $db->prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($this->options as $option) { + $stmt->execute($option); + } + } + + /** + * revert this migration + */ + public function down() + { + $db = DBManager::get(); + $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); + + foreach ($this->options as $option) { + $stmt->execute(['name' => $option['name']]); + } + } +} diff --git a/db/migrations/1.218_extend_phone_fax_size.php b/db/migrations/1.218_extend_phone_fax_size.php new file mode 100644 index 0000000..bd50f2b --- /dev/null +++ b/db/migrations/1.218_extend_phone_fax_size.php @@ -0,0 +1,32 @@ +exec("ALTER TABLE Institute CHANGE telefon telefon varchar(255) NOT NULL DEFAULT '', + CHANGE fax fax varchar(255) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE user_info CHANGE privatnr privatnr varchar(255) NOT NULL DEFAULT '', + CHANGE privatcell privatcell varchar(255) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE user_inst CHANGE Telefon Telefon varchar(255) NOT NULL DEFAULT '', + CHANGE Fax Fax varchar(255) NOT NULL DEFAULT ''"); + } + + public function down() + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE Institute CHANGE telefon telefon varchar(32) NOT NULL DEFAULT '', + CHANGE fax fax varchar(32) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE user_info CHANGE privatnr privatnr varchar(32) NOT NULL DEFAULT '', + CHANGE privatcell privatcell varchar(32) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE user_inst CHANGE Telefon Telefon varchar(32) NOT NULL DEFAULT '', + CHANGE Fax Fax varchar(32) NOT NULL DEFAULT ''"); + } +} diff --git a/db/migrations/1.219_loginbackgrounds.php b/db/migrations/1.219_loginbackgrounds.php new file mode 100644 index 0000000..feb455c --- /dev/null +++ b/db/migrations/1.219_loginbackgrounds.php @@ -0,0 +1,36 @@ +exec("CREATE TABLE IF NOT EXISTS `loginbackgrounds` ( + `background_id` INT NOT NULL AUTO_INCREMENT, + `filename` VARCHAR(255) NOT NULL, + `mobile` TINYINT(1) NOT NULL DEFAULT 1, + `desktop` TINYINT(1) NOT NULL DEFAULT 1, + `in_release` TINYINT(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`background_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + DBManager::get()->exec( + "INSERT INTO `loginbackgrounds` SET `filename` = 'Login-Hintergrund.jpg', ". + "`mobile` = 0, `desktop` = 1, `in_release` = 1"); + + DBManager::get()->exec( + "INSERT INTO `loginbackgrounds` SET `filename` = 'Login-Hintergrund-mobil.jpg', ". + "`mobile` = 1, `desktop` = 0, `in_release` = 1"); + + mkdir($GLOBALS['STUDIP_BASE_PATH'] . '/public/pictures/loginbackgrounds'); + } + + public function down() + { + DBManager::get()->exec('DROP TABLE IF EXISTS `loginbackgrounds`'); + } +} diff --git a/db/migrations/1.21_more_indexing.php b/db/migrations/1.21_more_indexing.php new file mode 100644 index 0000000..4dce2a4 --- /dev/null +++ b/db/migrations/1.21_more_indexing.php @@ -0,0 +1,32 @@ +getAttribute(PDO::ATTR_ERRMODE); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + + $db->exec("ALTER TABLE `contact` ADD INDEX `user_id` ( `user_id` )"); + $db->exec("ALTER TABLE `datafields_entries` ADD INDEX `datafields_contents` (`datafield_id`,`content`(32) )"); + + $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); + } + + function down() { + $db = DBManager::get(); + + $mode = $db->getAttribute(PDO::ATTR_ERRMODE); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + + $db->exec("ALTER TABLE `datafields_entries` DROP INDEX `datafields_contents`"); + $db->exec("ALTER TABLE `auth_user_md5` DROP INDEX `user_id`"); + + $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); + } +} diff --git a/db/migrations/1.220_step_00313_coursegroups.php b/db/migrations/1.220_step_00313_coursegroups.php new file mode 100644 index 0000000..70c5b8d --- /dev/null +++ b/db/migrations/1.220_step_00313_coursegroups.php @@ -0,0 +1,26 @@ +exec( + "ALTER TABLE `sem_classes` ADD `is_group` TINYINT(1) NOT NULL DEFAULT '0' AFTER `show_raumzeit`"); + DBManager::get()->exec( + "ALTER TABLE `seminare` ADD `parent_course` VARCHAR(32) NULL DEFAULT NULL AFTER `public_topics`"); + DBManager::get()->exec( + "ALTER TABLE `seminare` ADD INDEX(`parent_course`)"); + StudipLog::registerAction('SEM_ADD_TO_GROUP', 'Veranstaltung zu Gruppe hinzufügen', + '%user ordnet Veranstaltung %sem(%affected) der Gruppe %sem(%coaffected) zu.', null); + StudipLog::registerAction('SEM_DEL_FROM_GROUP', 'Veranstaltung aus Gruppe entfernen', + '%user entfernt Veranstaltung %sem(%affected) aus der Gruppe %sem(%coaffected).', null); + } + + public function down() + { + DBManager::get()->exec("ALTER TABLE `sem_classes` DROP `is_group`"); + DBManager::get()->exec("ALTER TABLE `seminare` DROP `parent_course`"); + + StudipLog::unregisterAction('SEM_ADD_TO_GROUP'); + StudipLog::unregisterAction('SEM_DEL_FROM_GROUP'); + } +} diff --git a/db/migrations/1.221_moadb.php b/db/migrations/1.221_moadb.php new file mode 100644 index 0000000..334c09a --- /dev/null +++ b/db/migrations/1.221_moadb.php @@ -0,0 +1,516 @@ + + * @license GPL2 or any later version + * +*/ + +class Moadb extends Migration +{ + public function description() + { + return 'migrates documents to moadb'; + } + + private function insert52aTermsOfUse($db) + { + // Copied and modified from cli script add_52a_tables from Stud.IP 3.5: + $db->exec("INSERT INTO `content_terms_of_use_entries` (`id`, `name`, `position`, `description`, `student_description`, `download_condition`, `icon`, `is_default`, `mkdate`, `chdate`) VALUES +('3RD_PARTY_FALSE', 'Dokument ist frei von Rechten Dritter', 6, '', '', 0, 'check-circle', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), +('3RD_PARTY_TRUE', 'Dokument ist nicht frei von Rechten Dritter', 7, '', '', 0, 'decline-circle', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), +('FREE_LICENSE', 'Werk mit freier Lizenz', 3, 'Werke, die unter einer freien Lizenz veröffentlich wurden, d.h. deren Weitergabe und zumeist auch Veränderung ohne Lizenzkosten gestattet ist, dürfen Sie ohne Einschränkungen für den Unterricht zugänglich machen. \n\nTypische Beispiele sind:\n- Open-Access-Publikationen \n- Open Educational Ressources (OER) \n- Werke unter Creative-Commons-Lizenzen (z.B. Wikipedia-Inhalte) \n\nAchtung: Vergewissern Sie sich im Einzelfall, welche Einschränkungen für die Verbreitung und Veränderung die jeweilige Lizenz ggf. enthält.', 'Das Dokument unterliegt einer freien Lizenz. Sie dürfen es weitergeben und unter Beachtung der Details der Lizenz (s. Angaben im Dokument) verändern und in eigene Werke übernehmen.', 0, 'cc', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), +('SELFMADE_NONPUB', 'Selbst verfasstes, nicht publiziertes Werk', 2, 'Selbst verfasste Werke dürfen Sie ohne Einschränkungen zugänglich machen, wenn Sie die Verwertungsrechte nicht an einen Verlag abgetreten haben. \nTypische Beispiele sind selbst verfasste:\n - Präsentationsfolien, auch mit Text- und Bildzitaten aus fremden Quellen \n- Übungsaufgaben, Musterlösungen \n- Computer-Programme \n- Literaturlisten, Seminarpläne\n - Vorlesungsskripte \n\nWichtig ist die Beachtung des Zitatrechtes: \nWenn Sie Teile fremder Quellen übernehmen, ist das zulässig, solange diese Teile mit Quelle gekennzeicht werden und Gegenstand einer wissenschaftlichen Auseinandersetzung sind.', 'Das Dokument wird von den Autor/-innen zur Nutzung im Rahmen dieser Veranstaltung bereitgestellt. Sie dürfen es für private Zwecke herunterladen und archivieren, nicht jedoch ohne Erlaubnis weitergeben. Für darüber hinaus gehende Erlaubnisse (Weitergabe, Veränderung) wenden Sie sich an die Autor/-innen oder beachten Sie die Hinweise im Dokument.', 0, 'own-license', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), +('NO_LICENSE', 'Veröffentlichte Werke ohne erworbene Lizenz oder gesonderte Erlaubnis', 5, 'Veröffentlichte Werke, für die keine Lizenz erworben wurde und für die keine gesonderte Erlaubnis vorliegt, dürfen unter den Erlaubnissen des § 60a UrhG für Unterrichtsteilnehmende zugänglich gemacht werden.\n\nEs muss sich dabei um kleine Teile des Gesamtwerkes handeln (z.B. max. 15% eines Buches oder Bildbandes, 5 Minuten bei Musikstücken oder Filmen, Kinofilme erst nach 2 Jahren). Einzelne Abbildungen, Photos oder Artikel aus wissenschaftlichen Zeitschriften dürfen ganz zugänglich gemacht werden, Artikel aus Zeitungen und anderen Zeitschriften allerdings ebenfalls nur zu 10%.\n\nZum Hintergrund: Diese Regelung gilt wegen der Befristung des § 60a UrhG zunächst bis März 2023, eine Einzelmeldung oder Abrechnung über die Hochschule o.ä. ist nicht erforderlich.', 'Das Dokument wird zur Nutzung im Rahmen dieser Veranstaltung bereitgestellt. Sie dürfen es für private Zwecke herunterladen und archivieren, nicht jedoch ohne Erlaubnis weitergeben.', 0, '60a', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), +('UNDEF_LICENSE', 'Ungeklärte Lizenz', 1, 'Bitte geben Sie an, welcher Lizenz das hochgeladene Material unterliegt bzw. auf welcher Grundlage Sie es zugänglich machen. Unterbleibt diese Angabe, wird beim Herunterladen auf den ungeklärten Lizenzstatus hingewiesen.', 'Diese Datei enthält Material mit einer ungeklärten Lizenz. Zu Fragen der Nutzung und Weitergabe wenden Sie sich an die Person, die diese Datei hochgeladen hat.', 2, 'question-circle', 1, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), +('WITH_LICENSE', 'Nutzungserlaubnis oder Lizenz liegt vor', 4, 'Wenn Sie urheberrechtlich geschützte Werke zugänglich machen wollen und keine der anderen Kategorien passt, benötigen Sie eine Erlaubnis oder kostenpflichtige Lizenz des Inhabers der Verwertungsrechte. Das ist bei publizierten Werken der Verlag, bei nicht publizierten Werken der Autor. \n\nTypische Beispiele sind: \n- Zustimmung von Kollegen oder Studierenden zur Weitergabe von Skripten, Seminararbeiten, Referatsfolien \n- Zustimmung eines Verlages zur Nutzung von Werkteilen für die Lehre \n- Verlags-Erlaubnis zur Nutzung eigener publizierter Werke für die Lehre \n- Erworbene Lizenz für die Weitergabe in Lehrveranstaltung (eine einzelne erworbene Kopie reicht nicht aus!) \n\nAchtung: Campus- oder Nationallizenzen erlauben es nicht, dass Sie ein Werk erneut hochladen und somit selbst verbreiten. Verlinken Sie in diesem Fall direkt auf das Angebot Ihrer Bibliothek o.ä.', 'Das Dokument wird zur Nutzung im Rahmen dieser Veranstaltung bereitgestellt. Sie dürfen es für private Zwecke herunterladen und archivieren, nicht jedoch ohne Erlaubnis weitergeben.', 0, 'license', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); + + } + + private function updateLicenseIds($db) + { + //We must convert the old IDs from the document_licenses table + //to the new IDs from the content_terms_of_use_entries table: + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = '3RD_PARTY_FALSE' WHERE content_terms_of_use_id = '0'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = '3RD_PARTY_TRUE' WHERE content_terms_of_use_id = '1'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'UNDEF_LICENSE' WHERE content_terms_of_use_id = '2'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'SELFMADE_NONPUB' WHERE content_terms_of_use_id = '3'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'FREE_LICENSE' WHERE content_terms_of_use_id = '4'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'WITH_LICENSE' WHERE content_terms_of_use_id = '5'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'NO_LICENSE' WHERE content_terms_of_use_id = '6'"); + $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'NO_LICENSE' WHERE content_terms_of_use_id = '7'"); + } + + private function insertFilesTour($db) + { + $db->exec("INSERT INTO `help_tours` (`global_tour_id`, `tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `author_email`, `mkdate`, `chdate`) VALUES +('e9959c638e0c2578cccee24702e886f4', '0b542c6c891af499763356f2c7218f7f', 'Was ist neu in Stud.IP 4.0?', 'Was ist neu in Stud.IP 4.0?', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '4.0', '', '', 1514883131, 0)"); + + $db->exec("INSERT INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES +('0b542c6c891af499763356f2c7218f7f', 1, 'autostart_once')"); + + $db->exec("INSERT INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `action_prev`, `action_next`, `author_email`, `mkdate`, `chdate`) VALUES +('0b542c6c891af499763356f2c7218f7f', 1, 'Willkommen in Stud.IP 4!', 'Unter der Haube ist alles neu, auch an der Oberfläche hat sich einiges getan.', 'B', 0, '', 'dispatch.php/start', '', '', 'root@localhost', 1514883131, 1514883295), +('0b542c6c891af499763356f2c7218f7f', 2, '', 'Die wichtigsten Neuigkeiten im Schnelldurchlauf:', 'B', 0, '', 'dispatch.php/start', '', '', 'root@localhost', 1514883334, 1514883383), +('0b542c6c891af499763356f2c7218f7f', 3, '', 'Die Startseite lässt sich anpassen. Sie können selbst bestimmen, was angezeigt werden soll. Per Drag & Drop können sie die Position der Elemente auf der Startseite verändern.', 'R', 0, '.sidebar-widget:eq(1) A:eq(0)', 'dispatch.php/start', '', '', 'root@localhost', 1514883313, 1516748869), +('0b542c6c891af499763356f2c7218f7f', 4, '', 'Alle persönlichen Funktionen sind in diesem Menü zusammengefasst. Der persönliche Dateibereich ist nun immer standardmäßig eingeschaltet.', 'B', 0, '#avatar-arrow', 'dispatch.php/start', '', '', 'root@localhost', 1514883360, 1516749166), +('0b542c6c891af499763356f2c7218f7f', 5, '', 'Alle Dateibereiche wurden in Stud.IP 4 komplett überarbeitet. Im persönlichen Dateibereich finden sich u.a. Nachrichtenanhänge. Sie können aber auch eigene Ordner erstellen und diese auf ihrer Profilseite anderen zugänglich machen. In Veranstaltungen gibt es weitere Typen von Dateiordnern, wie den Hausaufgabenordner.', 'B', 0, '', 'dispatch.php/files', '', '', 'root@localhost', 1514883588, 1514883588), +('0b542c6c891af499763356f2c7218f7f', 6, '', 'Falls von der Hochschule gestattet, können Sie hier Owncloud/Nextcloud oder Powerfolder für die Dateiverwaltung koppeln.', 'R', 0, '.sidebar-widget:eq(0) A:eq(0)', 'dispatch.php/files', '', '', 'root@localhost', 1514883641, 1516749255), +('0b542c6c891af499763356f2c7218f7f', 7, '', 'Weniger häufig benötigte Funktionen sind in Stud.IP 4 hinter dem Aktionsmenü mit den drei Punkten zu finden.', 'LT', 0, 'table.documents nav.action-menu', 'dispatch.php/files', '', '', 'root@localhost', 1514883706, 1516749543), +('0b542c6c891af499763356f2c7218f7f', 8, '', 'Ebenfalls neu ist die dezente Navigationszeile. Der gerade aktive Bereich wird durch eine Linie angezeigt.', 'B', 0, '#tabs', 'dispatch.php/files', '', '', 'root@localhost', 1514883773, 1514883781), +('0b542c6c891af499763356f2c7218f7f', 9, '', 'Das waren die allerwichtigsten Dinge im Überblick. In Stud.IP 4 hat sich aber noch viel mehr getan. Jedes Detail wurde durchdacht und verbessert . Damit ist Stud.IP 4 das modernste Open-Source-LMS auf dem Markt.', 'B', 0, '', 'dispatch.php/files', '', '', 'root@localhost', 1514883871, 1514883871), +('0b542c6c891af499763356f2c7218f7f', 10, 'Das Stud.IP-Team wünscht viel Erfolg bei der Arbeit mit Stud.IP 4!', '', 'B', 0, '', 'dispatch.php/start', '', '', 'root@localhost', 1514883886, 1514883946)"); + } + + public function up() + { + $db = DBManager::get(); + + try { + $db->exec("RENAME TABLE files TO _files"); + $db->exec("RENAME TABLE file_refs TO _file_refs"); + } catch (PDOException $e) + { + + } + + $db->exec("CREATE TABLE IF NOT EXISTS `files` ( + `id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `mime_type` varchar(255) NOT NULL DEFAULT '', + `name` varchar(255) NOT NULL, + `size` int(10) unsigned NOT NULL, + `storage` enum('disk','url') NOT NULL DEFAULT 'disk', + `author_name` varchar(100) NOT NULL DEFAULT '', + `mkdate` int(10) unsigned NOT NULL, + `chdate` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + $db->exec("CREATE TABLE IF NOT EXISTS `file_refs` ( + `id` VARCHAR(32) NOT NULL, + `file_id` VARCHAR(32) NOT NULL, + `folder_id` VARCHAR(32) NOT NULL, + `downloads` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `description` TEXT NOT NULL, + `content_terms_of_use_id` VARCHAR(32) NOT NULL, + `user_id` VARCHAR(32) NOT NULL DEFAULT '', + `name` VARCHAR(255) NOT NULL DEFAULT '', + `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `chdate` INT(10) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + $db->exec("CREATE TABLE IF NOT EXISTS `file_urls` ( + `file_id` varchar(32) NOT NULL, + `url` varchar(4096) NOT NULL, + `access_type` enum('proxy','redirect') NOT NULL DEFAULT 'proxy', + PRIMARY KEY (`file_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + $db->exec("CREATE TABLE IF NOT EXISTS `folders` ( + `id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `parent_id` varchar(32) NOT NULL, + `range_id` varchar(32) NOT NULL, + `range_type` varchar(32) NOT NULL, + `folder_type` varchar(255) NOT NULL, + `name` varchar(255) NOT NULL, + `data_content` text NOT NULL, + `description` text NOT NULL, + `mkdate` int(10) unsigned NOT NULL, + `chdate` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + //table for SORM class ContentTermsOfUse: + $db->exec( + "CREATE TABLE IF NOT EXISTS `content_terms_of_use_entries` ( + `id` VARCHAR(32) NOT NULL, + `name` VARCHAR(255) NOT NULL, + `position` int(10) unsigned NOT NULL, + `description` TEXT NOT NULL, + `student_description` TEXT NOT NULL, + `download_condition` TINYINT(2) NOT NULL, + `icon` VARCHAR(128) NOT NULL DEFAULT '', + `is_default` tinyint(2) unsigned NOT NULL DEFAULT 0, + `mkdate` int(10) unsigned NOT NULL, + `chdate` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC" + ); + + + //default terms of use entries: + $this->insert52aTermsOfUse($db); + + + $db->exec("SET autocommit=0"); + //top folder courses + $institute_folders = []; + foreach ($db->query("SELECT DISTINCT i.institut_id as new_range_id,i.name FROM `folder` f INNER JOIN `Institute` i ON i.institut_id = f.seminar_id") as $folder) { + $folder['folder_id'] = md5(uniqid('folders', true)); + $folder['range_id'] = ''; + $folder['user_id'] = $GLOBALS['user']->id; + $folder['description'] = ''; + $folder['mkdate'] = $folder['chdate'] = time(); + $this->migrateFolder($folder, $folder['new_range_id'], 'institute', 'RootFolder'); + $institute_folders[$folder['new_range_id']] = $folder['folder_id']; + } + $db->exec("COMMIT"); + //aka Allgemeiner Dateiordner + foreach ($db->query("SELECT f.*, i.institut_id as seminar_id FROM `folder` f INNER JOIN `Institute` i ON i.institut_id = f.range_id") as $folder) { + $folder['range_id'] = $institute_folders[$folder['seminar_id']]; + $this->migrateFolder($folder, $folder['seminar_id'], 'institute', 'StandardFolder'); + } + //other top folders + foreach ($db->query("SELECT f.*, i.institut_id as seminar_id FROM `folder` f INNER JOIN `Institute` i ON BINARY MD5(CONCAT(i.institut_id, _latin1'top_folder')) = f.range_id") as $folder) { + $folder['range_id'] = $institute_folders[$folder['seminar_id']]; + $this->migrateFolder($folder, $folder['seminar_id'], 'institute', 'StandardFolder'); + } + unset($institute_folders); + $db->exec("COMMIT"); + + + $seminar_folders = []; + foreach ($db->query("SELECT DISTINCT s.seminar_id as new_range_id,s.name FROM `seminare` s INNER JOIN `folder` f ON s.Seminar_id = f.seminar_id") as $folder) { + $folder['folder_id'] = md5(uniqid('folders', true)); + $folder['range_id'] = ''; + $folder['user_id'] = $GLOBALS['user']->id; + $folder['description'] = ''; + $folder['mkdate'] = $folder['chdate'] = time(); + $this->migrateFolder($folder, $folder['new_range_id'], 'course', 'RootFolder'); + $seminar_folders[$folder['new_range_id']] = $folder['folder_id']; + } + $db->exec("COMMIT"); + + //aka Allgemeiner Dateiordner + foreach ($db->query("SELECT f.*, s.Seminar_id as seminar_id FROM `folder` f INNER JOIN `seminare` s ON s.Seminar_id = f.range_id") as $folder) { + $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; + $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'StandardFolder'); + } + $db->exec("COMMIT"); + + //other top folders + foreach ($db->query("SELECT f.*, s.Seminar_id as seminar_id FROM `folder` f INNER JOIN `seminare` s ON BINARY MD5(CONCAT(s.Seminar_id, 'top_folder')) = f.range_id") as $folder) { + $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; + $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'StandardFolder'); + } + $db->exec("COMMIT"); + + //group folder + foreach ($db->query("SELECT f.*, s.range_id AS seminar_id FROM `folder` f INNER JOIN `statusgruppen` s ON s.statusgruppe_id = f.range_id") as $folder) { + $data_content = json_encode(['group' => $folder['range_id']]); + $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; + $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'CourseGroupFolder', $data_content); + } + //issue folder + foreach ($db->query("SELECT f.*, t.seminar_id AS seminar_id FROM `folder` f INNER JOIN `themen` t ON t.issue_id = f.range_id") as $folder) { + $data_content = json_encode(['topic_id' => $folder['range_id']]); + $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; + $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'CourseTopicFolder', $data_content); + } + $db->exec("COMMIT"); + + //personal documents + $insert_personal_folder = $db->prepare("INSERT IGNORE INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, 'user', ?, ?, ?, ?, ?, ?)"); + foreach ($db->fetchFirst("SELECT distinct parent_id FROM `_file_refs` inner join auth_user_md5 where parent_id=user_id") as $user_id) { + $top_folder_id = $db->fetchColumn("SELECT id FROM folders WHERE range_type = 'user' AND parent_id='' AND range_id=?", [$user_id]); + if (!$top_folder_id) { + $top_folder_id = md5(uniqid($user_id)); + $insert_personal_folder->execute([ + $top_folder_id, + $user_id, + '', + $user_id, + 'RootFolder', + '', + '', + '', + time(), + time() + ]); + } + $personal_folder_id = md5($top_folder_id . 'personal_top_folder_id'); + $insert_personal_folder->execute([ + $personal_folder_id, + $user_id, + $top_folder_id, + $user_id, + 'PublicFolder', + 'öffentliche Dateien', + Config::get()->PERSONALDOCUMENT_OPEN_ACCESS ? '{"viewable":1}' : '', + '', + time(), + time() + ]); + $this->migratePersonalFiles($db->fetchAll("SELECT file_id,id,storage_id,mime_type,user_id,filename,description,mkdate,chdate,downloads,size FROM `_files` inner join _file_refs using(file_id) WHERE parent_id = ? and storage_id<>''", [$user_id]), $personal_folder_id); + $subfolders = $db->fetchAll("SELECT file_id as folder_id,user_id,'{$personal_folder_id}' as range_id,name,description,mkdate,chdate FROM _file_refs INNER JOIN _files USING(file_id) WHERE storage_id='' AND parent_id = ?", [$user_id]); + foreach ($subfolders as $one) { + $this->migratePersonalFolder($one, $user_id); + } + } + $db->exec("COMMIT"); + + //Blubber folders + foreach ($db->query("SELECT f.*, a.user_id AS seminar_id, CONCAT_WS(' ', vorname,nachname) as name + FROM `folder` f + INNER JOIN `auth_user_md5` a ON a.user_id = f.range_id") as $folder) { + $user_id = $folder['seminar_id']; + $top_folder_id = $db->fetchColumn("SELECT id FROM folders WHERE range_type = 'user' AND parent_id='' AND range_id=?", [$user_id]); + if (!$top_folder_id) { + $top_folder_id = md5(uniqid($user_id)); + $insert_personal_folder->execute([ + $top_folder_id, + $user_id, + '', + $user_id, + 'RootFolder', + '', + '', + '', + time(), + time() + ]); + } + $personal_folder_id = md5($top_folder_id . 'personal_top_folder_id'); + $insert_personal_folder->execute([ + $personal_folder_id, + $user_id, + $top_folder_id, + $user_id, + 'PublicFolder', + 'öffentliche Dateien', + Config::get()->PERSONALDOCUMENT_OPEN_ACCESS ? '{"viewable":1}' : '', + '', + time(), + time() + ]); + + $folder['range_id'] = $personal_folder_id; + $folder['description'] = ''; + $this->migrateFolder($folder, $user_id, 'user', 'PublicFolder'); + } + + $db->exec("COMMIT"); + + //migrate message attachments: + $this->migrateMessageAttachments(); + + + //map old 52 license IDs to new terms of use entries: + $this->updateLicenseIds($db); + $db->exec("COMMIT"); + $db->exec("SET autocommit=1"); + + $db->exec("ALTER TABLE `file_refs` + ADD KEY `file_id` (`file_id`), + ADD KEY `folder_id` (`folder_id`)"); + $db->exec("ALTER TABLE `folders` + ADD KEY `range_id` (`range_id`), + ADD KEY `parent_id` (`parent_id`)"); + + //delete configuration variables designed for the old file area: + + $db->exec( + "DELETE FROM `config` + WHERE + `field` IN + ('PERSONALDOCUMENT_OPEN_ACCESS', + 'PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED', + 'PERSONALDOCUMENT_ENABLE', + 'FILESYSTEM_MULTICOPY_ENABLE', + 'DOCUMENTS_EMBEDD_FLASH_MOVIES', + 'ALLOW_DOWNLOAD_FOR_UNKNOWN_LICENSE', + 'COPYRIGHT_DIALOG_ON_UPLOAD', + 'LICENSE_PREAMBLE', + 'DEFAULT_LICENSE_ON_UPLOAD' + )" + ); + $db->exec("DROP TABLE IF EXISTS `doc_filetype`, `doc_filetype_forbidden`, `doc_usergroup_config`, `dokumente`, `files_backend_studip`, `files_backend_url`, `files_share`, `folder`, `_files`, `_file_refs`, `document_licenses`"); + + //add help tour + $this->insertFilesTour($db); + } + + + + + public function migrateMessageAttachments() + { + //First we wipe out all documents with range-ID = 'provisional'. + //Such documents were meant to be attached to mails but were left + //unattached... to remain lonely in the database... + //So it's time to end this misery and delete them! + /* + $unattached_documents = StudipDocument::deleteBySql( + "range_id = 'provisional'" + ); + */ + + $db = DBManager::get(); + + //then we retrieve all message-IDs: + $message_rows = $db->query("SELECT DISTINCT message_id,autor_id,subject,message.mkdate FROM message INNER JOIN dokumente ON range_id = message_id"); + $insert_folder = $db->prepare("INSERT INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + + foreach($message_rows as $message_row) { + //now we loop through each message ID and check if there are + //files in the dokumente table with that range-ID: + $message_id = $message_row['message_id']; + + //we found at least one attachment: create a top folder for this message: + + + $folder_id = md5($message_id . '_attachments'); + + $insert_folder->execute([ + $folder_id, + $message_row['autor_id'], + '', + $message_id, + 'message', + 'MessageFolder', + $message_row['subject'], + '', + '', + $message_row['mkdate'], + $message_row['mkdate'] + ]); + + $this->migrateFiles($db->fetchAll( + "SELECT * FROM dokumente WHERE range_id = :range_id", + [ + 'range_id' => $message_id + ] + ), $folder_id); + + } + } + + + public function migrateFolder($folder, $range_id, $range_type, $folder_type, $data_content = '') + { + $db = DBManager::get(); + $insert_folder = $db->prepare("INSERT INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + + $folder_type = $folder_type == 'StandardFolder' && isset($folder['permission']) && $folder['permission'] != 7 ? 'PermissionEnabledFolder' : $folder_type; + $data_content = $data_content == '' && isset($folder['permission']) && $folder['permission'] != 7 ? json_encode(['permission' => $folder['permission']]): $data_content; + if (isset($folder['range_id'])) { + $insert_folder->execute([$folder['folder_id'], $folder['user_id'], $folder['range_id'], $range_id, $range_type, $folder_type, $folder['name'], $data_content, (string)$folder['description'], $folder['mkdate'], $folder['chdate']]); + } + $subfolders = $db->fetchAll("SELECT * FROM folder WHERE range_id = ?", [$folder['folder_id']]); + foreach ($subfolders as $one) { + $this->migrateFolder($one, $range_id, $range_type, 'StandardFolder'); + } + $this->migrateFiles($db->fetchAll("SELECT * FROM dokumente WHERE range_id = ?", [$folder['folder_id']]), $folder['folder_id']); + + + + } + + public function migrateFiles($files, $folder_id) + { + $db = DBManager::get(); + $insert_file_ref = $db->prepare("INSERT INTO `file_refs` (`id`, `file_id`, `folder_id`, `downloads`, `description`, `content_terms_of_use_id`, `user_id`, `name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $insert_file = $db->prepare("INSERT INTO `files` (`id`, `user_id`, `mime_type`, `name`, `size`, `storage`, `author_name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $insert_file_url = $db->prepare("INSERT INTO `file_urls` (`file_id`, `url`) VALUES (?, ?)"); + $filenames = []; + foreach ($files as $one) { + $c = 0; + $filename = $one['filename']; + $ext = pathinfo($filename, PATHINFO_EXTENSION); + if ($ext) { + $name = substr($filename, 0, strrpos($filename, $ext) - 1); + } else { + $name = $filename; + } + while (in_array($filename, $filenames)) { + $filename = $name . '['.++$c.']' . ($ext ? '.' . $ext : ''); + } + $filenames[] = $filename; + $insert_file_ref->execute([ + $one['dokument_id'], + $one['dokument_id'], + $folder_id, + $one['downloads'], + $one['name'] != $one['filename'] ? trim($one['name'] . "\n" . $one['description']) : (string) $one['description'], + $one['protected'], + $one['user_id'], + $filename, + $one['mkdate'], + $one['chdate'] + ]); + $insert_file->execute([$one['dokument_id'], $one['user_id'], get_mime_type($one['filename']), $filename, $one['filesize'], $one['url'] ? 'url' : 'disk', $one['author_name'], $one['mkdate'], $one['chdate']]); + if ($one['url']) { + $insert_file_url->execute([$one['dokument_id'], $one['url']]); + } + } + } + + public function migratePersonalFolder($folder, $range_id) + { + $db = DBManager::get(); + $insert_folder = $db->prepare("INSERT INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, 'user', 'PublicFolder', ?, ?, ?, ?, ?)"); + + $insert_folder->execute([ + $folder['folder_id'], + $folder['user_id'], + $folder['range_id'], + $range_id, + $folder['name'], + Config::get()->PERSONALDOCUMENT_OPEN_ACCESS ? '{"viewable":1}' : '', + (string)$folder['description'], + $folder['mkdate'], + $folder['chdate'] + ]); + $subfolders = $db->fetchAll("SELECT file_id as folder_id,user_id,parent_id as range_id,name,description,mkdate,chdate FROM _file_refs INNER JOIN _files USING(file_id) WHERE storage_id='' AND parent_id = ?", [$folder['folder_id']]); + foreach ($subfolders as $one) { + $this->migratePersonalFolder($one, $range_id); + } + $this->migratePersonalFiles($db->fetchAll("SELECT file_id,id,storage_id,mime_type,user_id,filename,description,mkdate,chdate,downloads,size FROM `_files` inner join _file_refs using(file_id) WHERE parent_id = ? and storage_id<>''", [$folder['folder_id']]), $folder['folder_id']); + + + } + + public function migratePersonalFiles($files, $folder_id) + { + $db = DBManager::get(); + $insert_file_ref = $db->prepare("INSERT INTO `file_refs` (`id`, `file_id`, `folder_id`, `downloads`, `description`, `content_terms_of_use_id`, `user_id`, `name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $insert_file = $db->prepare("INSERT INTO `files` (`id`, `user_id`, `mime_type`, `name`, `size`, `storage`, `author_name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $filenames = []; + foreach ($files as $one) { + $c = 0; + $filename = $one['filename']; + $ext = pathinfo($filename, PATHINFO_EXTENSION); + if ($ext) { + $name = substr($filename, 0, strrpos($filename, $ext) - 1); + } else { + $name = $filename; + } + while (in_array($filename, $filenames)) { + $filename = $name . '['.++$c.']' . ($ext ? '.' . $ext : ''); + } + $filenames[] = $filename; + $insert_file_ref->execute([ + $one['id'], + $one['storage_id'], + $folder_id, + $one['downloads'], + $one['name'] != $one['filename'] ? trim($one['name'] . "\n" . $one['description']) : (string) $one['description'], + 0, + $one['user_id'], + $filename, + $one['mkdate'], + $one['chdate'] + ]); + $insert_file->execute([$one['storage_id'], $one['user_id'], $one['mime_type'], $filename, $one['size'], 'disk', '', $one['mkdate'], $one['chdate']]); + $new_path = $GLOBALS['UPLOAD_PATH'] . '/' . substr($one['storage_id'], 0, 2) . '/' . $one['storage_id']; + $old_path = $GLOBALS['USER_DOC_PATH'] . '/' . $one['user_id'] . '/' . $one['storage_id']; + @rename($old_path, $new_path); + } + } + + public function down() + { + /* + * I'M SORRY DAVE, I'M AFRAID I CAN'T DO THAT + */ + } +} diff --git a/db/migrations/1.222_utf8_conversion.php b/db/migrations/1.222_utf8_conversion.php new file mode 100644 index 0000000..29be28f --- /dev/null +++ b/db/migrations/1.222_utf8_conversion.php @@ -0,0 +1,242 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // check if the necessary MySQL-settings are present + // MariaDB deprecated these settings and removed them in v10.3 + if (!$this->checkMariaDB($pdo, '10.3')) { + $result = $pdo->query("SHOW VARIABLES LIKE 'innodb_file_format'"); + $var = $result->fetch(PDO::FETCH_KEY_PAIR); + if ($var && $var['innodb_file_format'] !== '' && mb_strtolower($var['innodb_file_format']) !== 'barracuda') { + throw new Exception('Could not convert Database: You need to set \'innodb_file_format\' = \'Barracuda\''); + } + + $result = $pdo->query("SHOW VARIABLES LIKE 'innodb_large_prefix'"); + $var = $result->fetch(PDO::FETCH_KEY_PAIR); + if ($var && $var['innodb_large_prefix'] !== '' && mb_strtolower($var['innodb_large_prefix']) !== 'on') { + throw new Exception('Could not convert Database: You need to set \'innodb_large_prefix\' = 1'); + } + } + + // create a helper-function in MySQL + $pdo->exec("DROP FUNCTION IF EXISTS entity_decode"); + $pdo->exec(" + CREATE FUNCTION entity_decode(txt MEDIUMTEXT CHARSET utf8mb4) RETURNS MEDIUMTEXT + CHARSET utf8mb4 + NO SQL + DETERMINISTIC + BEGIN + + DECLARE tmp MEDIUMTEXT CHARSET utf8mb4 DEFAULT txt; + DECLARE entity TEXT CHARSET utf8mb4; + DECLARE pos1 INT DEFAULT 1; + DECLARE pos2 INT; + DECLARE codepoint INT; + + IF txt IS NULL THEN + RETURN NULL; + END IF; + LOOP + SET pos1 = LOCATE('&#', tmp, pos1); + IF pos1 = 0 THEN + RETURN tmp; + END IF; + SET pos2 = LOCATE(';', tmp, pos1 + 2); + IF pos2 > pos1 THEN + SET entity = SUBSTRING(tmp, pos1, pos2 - pos1 + 1); + IF entity REGEXP '^&#[[:digit:]]+;$' THEN + SET codepoint = CAST(SUBSTRING(entity, 3, pos2 - pos1 - + 2) AS UNSIGNED); + IF codepoint > 31 THEN + SET tmp = CONCAT(LEFT(tmp, pos1 - 1), CONVERT(CONVERT(UNHEX(HEX(codepoint)) USING utf32) USING utf8mb4), SUBSTRING(tmp, pos2 + 1)); + END IF; + END IF; + END IF; + SET pos1 = pos1 + 1; + END LOOP; + END + "); + + // close connection again + $pdo = null; + + $db = DBManager::get(); + + // convert selected columns from serialized data to JSON data + $this->convert_to_json('extern_config', 'config'); + $this->convert_to_json('aux_lock_rules', 'attributes'); + $this->convert_to_json('aux_lock_rules', 'sorting'); + $this->convert_to_json('user_config', 'value', "field = 'MY_COURSES_ADMIN_VIEW_FILTER_ARGS'"); + $this->convert_to_json('mail_queue_entries', 'mail'); + + // convert database to utf-8 + $db->exec("ALTER DATABASE `{$GLOBALS['DB_STUDIP_DATABASE']}` + CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); + + // convert tables and columns to utf-8 + foreach($db->query("SHOW TABLES")->fetchAll() as $data) { + try { + // TODO: check EVERY column for the current collation and keep the correct type (bin, etc.) + // $this->write('Converting table: ' . $data[0]); + + $query = 'ALTER TABLE `'. $data[0] .'` '; + $change_query = []; + $update_query = []; + $table_data = $db->query("SHOW FULL COLUMNS FROM `{$data[0]}`")->fetchAll(); + + foreach ($table_data as $column) { + $collation = false; + + // convert index columns to latin1_bin to save space and speed things up + if (mb_strpos($column['Type'], 'char') !== false) { + $matches = []; + preg_match('/char\((.*)\)/', $column['Type'], $matches); + + if ((int)$matches[1] <= 32) { + $charset = 'latin1'; + $collation = 'latin1_bin'; + } + } + + if (mb_strpos($column['Type'], 'enum') !== false) { + $charset = 'latin1'; + $collation = 'latin1_bin'; + } elseif ($data[0] === 'plugins_activated' && $column['Field'] === 'poiid') { + $charset = 'latin1'; + $collation = 'latin1_bin'; + } + + if (!$collation) { + if (mb_strpos($column['Collation'], '_bin') !== false) { // if we hav a bin column, preserve it + $charset = 'utf8mb4'; + $collation = 'utf8mb4_bin'; + } else if ($column['Collation']) { // only convert if there is a collation at all (int f.e. has no collation!) + $charset = 'utf8mb4'; + $collation = 'utf8mb4_unicode_ci'; + } + } + + if ($collation) { + $null = $column['Null'] === 'YES' ? ' NULL' : ' NOT NULL'; + $default = isset($column['Default']) ? ' DEFAULT ' . $db->quote($column['Default']) : ''; + $extra = $column['Extra'] != '' ? ' ' . $column['Extra'] : ''; + $comment = $column['Comment'] != '' ? ' COMMENT ' . $db->quote($column['Comment']) : ''; + $change_query[] = ' CHANGE `'. $column[0] .'` `'. $column[0] .'` ' + . $column[1] . ' CHARACTER SET '. $charset .' COLLATE ' . $collation . $null . $default . $extra . $comment; + } + + if ($collation && $collation !== 'latin1_bin') { + $update_query[] = '`' . $column['Field'] . '` = entity_decode(`' . $column['Field'] . '`)'; + } + } + + // do all changes at once, or multi-column-indexes will prevent conversion + $db->exec($query . implode(',', $change_query)); + + if ($update_query) { + $db->exec("UPDATE `{$data[0]}` SET " . implode(',', $update_query)); + } + + // change default encoding of table itself + $db->exec($query = "ALTER TABLE `{$data[0]}` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); + + } catch (PDOException $e) { + $this->write($query); + $this->write($e->getMessage()); + } + } + + $db->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); + + // drop helper-function + $db->exec("DROP FUNCTION IF EXISTS entity_decode"); + } + + private function legacy_studip_utf8encode($data) + { + if (is_array($data)) { + $new_data = []; + foreach ($data as $key => $value) { + $key = $this->legacy_studip_utf8encode($key); + $new_data[$key] = $this->legacy_studip_utf8encode($value); + } + return $new_data; + } + + if (!preg_match('/[\200-\377]/', $data) && !preg_match("'&#[0-9]+;'", $data)) { + return $data; + } else { + return mb_decode_numericentity( + mb_convert_encoding($data,'UTF-8', 'WINDOWS-1252'), + [0x100, 0xffff, 0, 0xffff], + 'UTF-8' + ); + } + } + + private function convert_to_json($table, $column, $where = null) + { + $db = DBManager::get(); + + // get primary keys + $result = $db->query("SHOW KEYS FROM $table WHERE Key_name = 'PRIMARY'"); + $keys = []; + + while ($data = $result->fetch(PDO::FETCH_ASSOC)) { + $keys[] = $data['Column_name']; + } + + // retrieve and convert data + $result = $db->query("SELECT `". implode('`,`', $keys) ."`, `$column` FROM `$table` WHERE ". ($where ?: '1')); + + while ($data = $result->fetch(PDO::FETCH_ASSOC)) { + $content = unserialize(legacy_studip_utf8decode($data[$column])); + + if ($content !== false) { + // encode all data + $json = json_encode($this->legacy_studip_utf8encode($content), true); + + $query = "UPDATE `$table` SET `$column` = ". $db->quote($json) ."\n WHERE "; + + $where_query = []; + foreach ($keys as $key) { + $where_query[] = "`$key` = ". $db->quote($data[$key]); + } + + $db->exec($query . implode(' AND ', $where_query)); + } + } + } + + public function down() + { + } + + private function checkMariaDB(PDO $connection, $check_version = null, $check_operator = '>=') + { + $version = $connection->query("SELECT VERSION()")->fetchColumn(); + if (!preg_match('/MariaDB$/', $version)) { + return false; + } + if ($version === null) { + return true; + } + return version_compare($version, $check_version, $check_operator); + } +} diff --git a/db/migrations/1.223_course_mailing_for_students.php b/db/migrations/1.223_course_mailing_for_students.php new file mode 100644 index 0000000..60bf430 --- /dev/null +++ b/db/migrations/1.223_course_mailing_for_students.php @@ -0,0 +1,19 @@ +exec($query); + + DBManager::get()->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); //see #9106 + } + + public function down() + { + $query = "ALTER TABLE `seminare` + DROP COLUMN `student_mailing`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.224_db_cache_table.php b/db/migrations/1.224_db_cache_table.php new file mode 100644 index 0000000..66227d0 --- /dev/null +++ b/db/migrations/1.224_db_cache_table.php @@ -0,0 +1,29 @@ +exec('CREATE TABLE cache ( + cache_key VARCHAR(255) COLLATE latin1_bin NOT NULL, + content MEDIUMBLOB NOT NULL, + expires INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (cache_key) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC'); + + StudipCacheFactory::getCache()->flush(); + } + + public function down() + { + $db = DBManager::get(); + + $db->exec('DROP TABLE cache'); + } +} diff --git a/db/migrations/1.225_extend_course_completion.php b/db/migrations/1.225_extend_course_completion.php new file mode 100644 index 0000000..05f3332 --- /dev/null +++ b/db/migrations/1.225_extend_course_completion.php @@ -0,0 +1,27 @@ +exec($query); + + $query = "UPDATE `seminare` + SET `completion` = `completion` + 1 + WHERE `completion` > 0"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "UPDATE `seminare` + SET `completion` = `completion` - 1 + WHERE `completion` > 0"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminare` + CHANGE COLUMN `completion` `is_complete` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.226_config_values.php b/db/migrations/1.226_config_values.php new file mode 100644 index 0000000..04014a3 --- /dev/null +++ b/db/migrations/1.226_config_values.php @@ -0,0 +1,134 @@ +exec('UPDATE config LEFT JOIN config c ON config.field = c.field AND c.is_default = 1 + SET config.is_default = 1 WHERE config.is_default = 0 AND c.config_id IS NULL'); + + // fix up missing user_config entries in config + $db->exec("INSERT IGNORE INTO config (config_id, field, value, is_default, type, `range`) + SELECT DISTINCT MD5(user_config.field), user_config.field, '', 1, 'string', 'user' + FROM user_config LEFT JOIN config ON user_config.field = config.field AND is_default = 1 + WHERE config_id IS NULL"); + + // abort migration on duplicate entries in config + $result = $db->query('SELECT field FROM config c1 JOIN config c2 USING(field, is_default) WHERE c1.config_id > c2.config_id'); + $errors = $result->fetchAll(PDO::FETCH_COLUMN); + + if (count($errors)) { + echo "Duplicate field names in config table, aborting migration:\n", implode(', ', $errors), "\n"; + die; + } + + // delete duplicate config values in user_config + $db->exec('DELETE c1 FROM user_config c1 JOIN user_config c2 USING(field, user_id) WHERE c1.userconfig_id > c2.userconfig_id'); + + // drop unused fields and update range + $db->exec("ALTER TABLE config DROP parent_id, DROP position, DROP message_template, + CHANGE field field varchar(255) COLLATE latin1_bin NOT NULL, + CHANGE type type enum('boolean', 'integer', 'string', 'array') COLLATE latin1_bin NOT NULL DEFAULT 'string', + CHANGE `range` `range` enum('global', 'user', 'course') COLLATE latin1_bin NOT NULL DEFAULT 'global'"); + + // create new table and migrate all settings + $db->exec("ALTER TABLE user_config + RENAME TO config_values, + DROP userconfig_id, + DROP parent_id, + CHANGE field field varchar(255) COLLATE latin1_bin NOT NULL, + CHANGE user_id range_id varchar(32) COLLATE latin1_bin NOT NULL AFTER field, + ADD PRIMARY KEY (field, range_id), + ADD KEY range_id (range_id), + DROP KEY user_id"); + + $db->exec("INSERT INTO config_values (field, range_id, value, comment, mkdate, chdate) + SELECT field, 'studip', value, comment, mkdate, chdate + FROM config WHERE is_default = 0"); + + $db->exec('DELETE FROM config WHERE is_default = 0'); + + // drop more obsolete fields + $db->exec('ALTER TABLE config DROP config_id, DROP is_default, DROP comment, DROP KEY field, ADD PRIMARY KEY (field)'); + + // migrate setting from seminare.student_mailing + $stmt = $db->prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'COURSE_STUDENT_MAILING', + 'description' => 'Über diese Option können Sie Studierenden das Schreiben von Nachrichten an alle anderen Teilnehmer der Veranstaltung erlauben.', + 'range' => 'course', + 'type' => 'boolean', + 'value' => '0' + ]); + + $db->exec("INSERT INTO config_values (field, range_id, value, mkdate, chdate, comment) + SELECT 'COURSE_STUDENT_MAILING', Seminar_id, student_mailing, mkdate, chdate, '' + FROM seminare WHERE student_mailing = 1"); + + $db->exec('ALTER TABLE seminare DROP student_mailing'); + } + + public function down() + { + $db = DBManager::get(); + + // migrate setting to seminare.student_mailing + $db->exec('ALTER TABLE seminare ADD student_mailing tinyint(1) unsigned NOT NULL DEFAULT 0'); + + $db->exec("UPDATE config_values JOIN seminare ON range_id = Seminar_id + SET student_mailing = value WHERE field = 'COURSE_STUDENT_MAILING'"); + + // delete no longer supported values + $db->exec("DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE `range` = 'course'"); + + // restore old primary key + $db->exec("ALTER TABLE config + ADD config_id varchar(32) COLLATE latin1_bin NOT NULL DEFAULT '' FIRST, + ADD is_default tinyint(4) NOT NULL DEFAULT 0 AFTER value, + ADD comment text NOT NULL, + DROP PRIMARY KEY"); + + $db->exec('UPDATE config SET config_id = MD5(field), is_default = 1'); + $db->exec('ALTER TABLE config ADD PRIMARY KEY (config_id), ADD KEY field (field, `range`)'); + + // restore user_config and old settings + $db->exec("ALTER TABLE config_values + RENAME TO user_config, + ADD userconfig_id varchar(32) COLLATE latin1_bin NOT NULL DEFAULT '' FIRST, + ADD parent_id varchar(32) COLLATE latin1_bin DEFAULT NULL AFTER userconfig_id, + CHANGE range_id user_id varchar(32) COLLATE latin1_bin NOT NULL AFTER parent_id, + CHANGE field field varchar(255) NOT NULL DEFAULT ''"); + + $db->exec('UPDATE user_config SET userconfig_id = MD5(CONCAT(field, user_id))'); + + $db->exec("ALTER TABLE user_config + DROP PRIMARY KEY, + DROP KEY range_id, + ADD PRIMARY KEY (userconfig_id), + ADD KEY user_id (user_id, field, value(5))"); + + $db->exec("INSERT INTO config (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description, comment) + SELECT userconfig_id, field, user_config.value, 0, type, `range`, section, + user_config.mkdate, user_config.chdate, description, user_config.comment + FROM user_config JOIN config USING(field) WHERE user_id = 'studip'"); + + $db->exec("DELETE FROM user_config WHERE user_id = 'studip'"); + + // restore unused fields and update range + $db->exec("ALTER TABLE config + CHANGE field field varchar(255) NOT NULL DEFAULT '', + CHANGE type type enum('boolean', 'integer', 'string', 'array') COLLATE latin1_bin NOT NULL DEFAULT 'boolean', + CHANGE `range` `range` enum('global', 'user') COLLATE latin1_bin NOT NULL DEFAULT 'global', + ADD parent_id varchar(32) COLLATE latin1_bin NOT NULL DEFAULT '' AFTER config_id, + ADD position int(11) NOT NULL DEFAULT 0 AFTER section, + ADD message_template varchar(255) NOT NULL DEFAULT '' AFTER comment"); + } +} diff --git a/db/migrations/1.227_biest_8034_config_switch_for_child_insts.php b/db/migrations/1.227_biest_8034_config_switch_for_child_insts.php new file mode 100644 index 0000000..ce97c0b --- /dev/null +++ b/db/migrations/1.227_biest_8034_config_switch_for_child_insts.php @@ -0,0 +1,33 @@ +'MY_INSTITUTES_INCLUDE_CHILDREN', + 'range' => 'user', + 'type' => 'boolean', + 'description' => 'Sollen untergeordnete Institute mit angezeigt werden in der Veranstaltungsübersicht für Admins?', + 'value'=> 0 + ]; + + $stmt = DBManager::get()->prepare(" + REPLACE INTO config + (field, value, `type`, `range`, mkdate, chdate, description) + VALUES + (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + $stmt->execute($config_data); + } + + public function down() + { + DBManager::get()->exec("DELETE FROM config WHERE field = 'MY_INSTITUTES_INCLUDE_CHILDREN'"); + DBManager::get()->exec("DELETE FROM config_values WHERE field = 'MY_INSTITUTES_INCLUDE_CHILDREN'"); + } +} diff --git a/db/migrations/1.228_show_adressees.php b/db/migrations/1.228_show_adressees.php new file mode 100644 index 0000000..abcbb53 --- /dev/null +++ b/db/migrations/1.228_show_adressees.php @@ -0,0 +1,47 @@ + 'SHOW_ADRESSEES_LIMIT', + 'description' => 'Ab wievielen Adressaten dürfen diese aus datenschutzgründen nicht mehr angezeigt werden in einer empfangenen Nachricht?', + 'section' => 'global', + 'range' => 'global', + 'type' => 'integer', + 'value' => '20' + ] + ]; + + public function description() + { + return 'Lets Stud.IP display the adressees of a Stud.IP-message.'; + } + + public function up() + { + foreach ($this->options as $option) { + DBManager::get()->execute("INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)", + $option); + } + + DBManager::get()->exec(" + ALTER TABLE message + ADD COLUMN `show_adressees` tinyint(4) NOT NULL DEFAULT '0' AFTER `message` + "); + } + + public function down() + { + $db = DBManager::get(); + $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); + + foreach ($this->options as $option) { + $stmt->execute(['name' => $option['name']]); + } + DBManager::get()->exec(" + ALTER TABLE message + DROP COLUMN `show_adressees` + "); + } +} diff --git a/db/migrations/1.229_step_00278_global_search.php b/db/migrations/1.229_step_00278_global_search.php new file mode 100644 index 0000000..8b05624 --- /dev/null +++ b/db/migrations/1.229_step_00278_global_search.php @@ -0,0 +1,120 @@ + [ + 'order' => 1, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchMyCourses' => [ + 'order' => 2, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchCourses' => [ + 'order' => 3, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchUsers' => [ + 'order' => 4, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchInstitutes' => [ + 'order' => 5, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchFiles' => [ + 'order' => 6, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchCalendar' => [ + 'order' => 7, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchMessages' => [ + 'order' => 8, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchForum' => [ + 'order' => 9, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchResources' => [ + 'order' => 10, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchRoomAssignments' => [ + 'order' => 11, + 'active' => true, + 'fulltext' => false + ], + 'GlobalSearchModules' => [ + 'order' => 12, + 'active' => true, + 'fulltext' => false + ] + ]; + + $stmt = DBManager::get()->prepare("INSERT INTO `config` + (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (:name, :value, :type, 'global', 'globalsearch', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc) + ON DUPLICATE KEY UPDATE `chdate`=VALUES(`chdate`)"); + + $stmt->execute([ + 'name' => 'GLOBALSEARCH_MODULES', + 'value' => json_encode($modules), + 'type' => 'array', + 'desc' => 'Aktivierung und Reihenfolge der Module in der globalen Suche' + ]); + $stmt->execute([ + 'name' => 'GLOBALSEARCH_MAX_RESULT_OF_TYPE', + 'value' => 3, + 'type' => 'integer', + 'desc' => 'Wie viele Ergebnisse sollen in der globalen Schnellsuche pro Kategorie angezeigt werden?' + ]); + $stmt->execute([ + 'name' => 'GLOBALSEARCH_ASYNC_QUERIES', + 'value' => true, + 'type' => 'boolean', + 'desc' => 'Sollen die Suchanfragen asynchron über mysqli gestellt werden? Andernfalls wird PDO verwendet.' + ]); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `globalsearch_buzzwords` ( + `id` VARCHAR(32) NOT NULL, + `rights` ENUM('user','autor','tutor','dozent','admin','root') NOT NULL DEFAULT 'user', + `name` varchar(255) NOT NULL DEFAULT '', + `buzzwords` varchar(2048) NOT NULL DEFAULT '', + `subtitle` varchar(255) DEFAULT NULL, + `url` varchar(2048) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + } + + function down() { + DBManager::get()->exec("DELETE FROM `config` WHERE `field` IN ( + 'GLOBALSEARCH_MODULES', + 'GLOBALSEARCH_MAX_RESULT_OF_TYPE', + 'GLOBALSEARCH_ASYNC_QUERIES')" + ); + + DBManager::get()->exec("DROP TABLE IF EXISTS `globalsearch_buzzwords`"); + } + +} diff --git a/db/migrations/1.22_lit_list_content_note_from_varchar_to_text.php b/db/migrations/1.22_lit_list_content_note_from_varchar_to_text.php new file mode 100644 index 0000000..e6ba782 --- /dev/null +++ b/db/migrations/1.22_lit_list_content_note_from_varchar_to_text.php @@ -0,0 +1,19 @@ +exec("ALTER TABLE `lit_list_content` CHANGE `note` `note` TEXT NULL DEFAULT NULL"); + } + + function down() { + $db = DBManager::get(); + $db->exec("ALTER TABLE `lit_list_content` CHANGE `note` `note` VARCHAR( 255 ) NULL DEFAULT NULL"); + } +} diff --git a/db/migrations/1.230_widgets.php b/db/migrations/1.230_widgets.php new file mode 100644 index 0000000..05b2a00 --- /dev/null +++ b/db/migrations/1.230_widgets.php @@ -0,0 +1,441 @@ + + * @license GPL2 or any later version + * + * @todo Migrate the old widget system + */ +class Widgets extends Migration +{ + public function description() + { + return 'Sets up the database tables for the new widget system'; + } + + public function up() + { + $this->createTables(); + $this->registerDefaultWidgets(); + + // $plugin_ids = $this->getValidPortalPluginIds(); + // $mapping = $this->registerLegacyWidgets($plugin_ids); + // + // $this->migrateOldDefaults($plugin_ids, $mapping); + // $this->migrateOldWidgets($plugin_ids, $mapping); + // $this->migrateOldSettings(); + // + // $this->setDefaultsForCourseDetails(); + // $this->setDefaultsForCourseOverview(); + // $this->setDefaultsForInstituteDetails(); + // $this->setDefaultsForUserProfile(); + // + // $this->unregisterOldPlugins($plugin_ids); + // + // $this->dropOldTables(); + + $this->activateRoutes(); + + // $this->updateHelpContent(); + } + + private function createTables() + { + $query = "CREATE TABLE IF NOT EXISTS `widget_containers` ( + `container_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, + `range_type` ENUM('course','institute','user','plugin','other') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'course', + `scope` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'default', + `parent_id` INT(11) UNSIGNED NULL DEFAULT NULL, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`container_id`), + UNIQUE KEY `range` (`range_id`, `range_type`, `scope`), + KEY `parent_id` (`parent_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `widget_elements` ( + `element_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `container_id` INT(11) UNSIGNED NOT NULL, + `widget_id` INT(11) UNSIGNED NOT NULL, + `x` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + `y` TINYINT(3) UNSIGNED NOT NULL, + `width` TINYINT(1) UNSIGNED NOT NULL, + `height` TINYINT(1) UNSIGNED NOT NULL, + `locked` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + `removable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, + `options` VARCHAR(8192) NOT NULL DEFAULT '[]', + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`element_id`), + KEY `container_id` (`container_id`), + KEY `widget_id` (`widget_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `widgets` ( + `widget_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `class` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `filename` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, + `enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`widget_id`), + UNIQUE KEY `class` (`class`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + } + + private function registerDefaultWidgets() + { + $files = array_merge( + glob(__DIR__ . '/../../app/widgets/*.php'), + glob(__DIR__ . '/../../app/widgets/course/*.php') + ); + + // Register default widgets + foreach ($files as $file) { + require_once $file; + + $class = basename($file, '.php'); + Widgets\Widget::registerWidget(new $class); + } + } + + private function dropOldTables() + { + // Drop old tables + $query = "DROP TABLE IF EXISTS `widget_default`, `widget_user`"; + DBManager::get()->exec($query); + } + + private function getValidPortalPluginIds() + { + // Load and validate plugins + $query = "SELECT `pluginid`, CONCAT(`pluginpath`, '/', `pluginclassname`) + FROM `plugins` + WHERE FIND_IN_SET('PortalPlugin', `plugintype`) > 0"; + $statement = DBManager::get()->query($query); + $plugin_paths = $statement->fetchGrouped(PDO::FETCH_COLUMN); + + $base_path = Config::get()->PLUGINS_PATH; + foreach ($plugin_paths as $plugin_id => $path) { + if (strpos($path, 'core/') === 0) { + continue; + } + + $files = glob($base_path . '/' . $path . '{,.class}.php', GLOB_BRACE); + if (count($files) === 0) { + unset($plugin_paths[$plugin_id]); + } + } + return array_keys($plugin_paths); + } + + private function registerLegacyWidgets(array $plugin_ids) + { + // Register legacy widgets + $query = "INSERT IGNORE INTO `widgets` (`class`, `filename`, `enabled`, `mkdate`, `chdate`) + SELECT `pluginid`, NULL, `enabled` = 'yes', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + FROM `plugins` + WHERE `pluginid` IN (:ids) + AND `pluginpath` NOT LIKE 'core/%'"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':ids', $plugin_ids, StudipPDO::PARAM_ARRAY); + $statement->execute(); + + // Get plugin -> widget mapping + $query = "SELECT `class`, `widget_id` + FROM `widgets` + WHERE `filename` IS NULL"; + $statement = DBManager::get()->query($query); + $mapping0 = $statement->fetchGrouped(PDO::FETCH_COLUMN); + + // Add already converted core plugins + $plugins_to_widgets = [ + 'QuickSelection|QuickSelectionWidget', + 'ScheduleWidget|ScheduleWidget', + 'TerminWidget|CalendarWidget', + 'ActivityFeed|ActivityFeedWidget', + 'NewsWidget|NewsWidget', + 'EvaluationsWidget|EvaluationsWidget', + ]; + $query = "SELECT `pluginid`, `widget_id` + FROM `plugins`, `widgets` + WHERE CONCAT(`pluginclassname`, '|', `class`) + IN (:mapping)"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':mapping', $plugins_to_widgets); + $statement->execute(); + $mapping1 = $statement->fetchGrouped(PDO::FETCH_COLUMN); + + return $mapping0 + $mapping1; + } + + private function migrateOldDefaults(array $plugin_ids, array $mapping) + { + $query = "SELECT `perm`, `pluginid`, `col`, `position` + FROM `widget_default` + JOIN `plugins` USING (`pluginid`) + WHERE `enabled` = 'yes' + AND `pluginid` IN (:ids) + ORDER BY `perm`, `position` ASC, `col` ASC"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':ids', $plugin_ids, StudipPDO::PARAM_ARRAY); + $statement->execute(); + $defaults = $statement->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); + + $this->migrateWidgetsAndContainers($defaults, $mapping); + } + + private function migrateOldWidgets(array $plugin_ids, array $mapping) + { + $query = "SELECT `range_id`, `pluginid`, `col`, `position` + FROM `widget_user` + JOIN `plugins` USING (`pluginid`) + WHERE `enabled` = 'yes' + AND `pluginid` IN (:ids) + ORDER BY `range_id`, `position` ASC, `col` ASC"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':ids', $plugin_ids, StudipPDO::PARAM_ARRAY); + $statement->execute(); + $widgets = $statement->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); + + $this->migrateWidgetsAndContainers($widgets, $mapping); + } + + private function migrateWidgetsAndContainers(array $data, array $mapping) + { + foreach ($data as $id => $rows) { + $container_id = $this->createNewContainer('user', $id, 'start'); + + foreach ($rows as $row) { + $this->addWidgetToContainerById($container_id, $mapping[$row['pluginid']], [ + 'x' => $row['col'] * 2, + 'y' => $row['position'], + 'width' => $row['col'] == 0 ? 4 : 2, + 'height' => 1, + ]); + } + } + } + + private function migrateOldSettings() + { + // Quick selection widget + $query = "UPDATE `widget_elements` AS `we` + -- Get correct widget + JOIN `widgets` AS `w` USING (`widget_id`) + -- Get correct configuration + JOIN `widget_containers` AS `wc` USING (`container_id`) + JOIN `user_config` AS `uc` + ON (`uc`.`user_id` = `wc`.`range_id` + AND `wc`.`range_type` = 'user' + AND `uc`.`field` = 'QUICK_SELECTION') + SET `we`.`options` = `uc`.`value` + WHERE `w`.`class` = 'QuickSelectionWidget'"; + DBManager::get()->exec($query); + + $query = "DELETE FROM `user_config` WHERE `field` = 'QUICK_SELECTION'"; + DBManager::get()->exec($query); + } + + private function unregisterOldPlugins(array $plugin_ids) + { + // Remove old core widgets + $query = "DELETE FROM `plugins` + WHERE `pluginid` IN (:ids) + AND `pluginpath` LIKE 'core/%'"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':ids', $plugin_ids); + $statement->execute(); + + // Deactivate other plugins + $query = "UPDATE `plugins` + SET `enabled` = 'no' + WHERE `pluginid` IN (:ids)"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':ids', $plugin_ids); + $statement->execute(); + } + + private function setDefaultsForCourseDetails() + { + // Define widgets + $widgets = [ + 'CourseDetailsWidget' => ['height' => 3], + 'CourseTeachersWidget' => ['height' => 2], + 'CourseEventsWidget' => ['height' => 2], + 'CourseTopicsWidget' => ['height' => 2], + 'CourseRoomsWidget' => ['height' => 2], + 'CourseModulesWidget' => ['height' => 3], + 'CourseStudyareasWidget' => ['height' => 3], + 'CourseAdmissionWidget' => ['height' => 3], + 'CourseDomainsWidget' => [], + ]; + + // Check whether mvv is activated, remove widget if not + $query = "SELECT `enabled` = 'yes' + FROM `plugins` + WHERE `pluginclassname` = 'MVVPlugin'"; + $mvv_enabled = DBManager::get()->fetchColumn($query); + if (!$mvv_enabled) { + unset($widgets['CourseModulesWidget']); + } + + $this->createDefaultContainer('course', null, 'details', $widgets); + } + + private function setDefaultsForCourseOverview() + { + $this->createDefaultContainer('course', null, 'overview', [ + 'CourseDetailsWidget' => ['height' => 3], + 'NewsWidget' => ['height' => 2], + 'CalendarWidget' => ['height' => 2], + 'EvaluationsWidget' => [], + 'QuestionnaireWidget' => [], + ]); + } + + private function setDefaultsForInstituteDetails() + { + $this->createDefaultContainer('institute', null, 'default', [ + 'InstituteDetailsWidget' => ['height' => 3], + 'NewsWidget' => ['height' => 2], + 'EvaluationsWidget' => [], + 'QuestionnaireWidget' => [], + ]); + } + + private function setDefaultsForUserProfile() + { + $widgets = [ + 'ProfileDetailsWidget' => ['height' => 5], + 'NewsWidget' => ['height' => 2], + 'CalendarWidget' => ['height' => 2, 'perms' => ['user', 'autor', 'tutor', 'dozent']], + 'EvaluationsWidget' => [], + 'QuestionnaireWidget' => [], + 'ProfileFilesWidget' => ['height' => 2], + 'ProfileCoursesWidget' => ['height' => 2, 'perms' => ['dozent']], + 'LiteratureWidget' => [], + 'ProfileCategoriesWidget' => ['height' => 2], + + ]; + + foreach (['user', 'autor', 'tutor', 'dozent', 'admin', 'root'] as $perm) { + $perm_widgets = array_filter($widgets, function ($row) use ($perm) { + return !isset($row['perms']) + || in_array($perm, $row['perms']); + }); + + $this->createDefaultContainer('user', $perm, 'profile', $perm_widgets); + } + } + + private function createDefaultContainer($type, $id, $scope, array $widgets) + { + // Create default container and add widgets + $container_id = $this->createNewContainer($type, $id, $scope); + + $y = 0; + foreach ($widgets as $class => $additional) { + $this->addWidgetToContainerByClass($container_id, $class, array_merge([ + 'y' => $y, + ], $additional)); + + $y += $additional['height'] ?: 1; + } + } + + private function createNewContainer($type, $id, $scope) + { + $query = "INSERT INTO `widget_containers` ( + `range_id`, `range_type`, `scope`, + `mkdate`, `chdate` + ) VALUES ( + :id, :type, :scope, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':id', $id); + $statement->bindValue(':type', $type); + $statement->bindValue(':scope', $scope); + $statement->execute(); + + return DBManager::get()->lastInsertId(); + } + + private function addWidgetToContainerByClass($container_id, $widget_class, array $data = []) + { + $query = "INSERT INTO `widget_elements` ( + `container_id`, `widget_id`, + `x`, `y`, `width`, `height`, + `locked`, `removable`, `options`, + `mkdate`, `chdate` + ) + SELECT :container_id, `widget_id`, + :x, :y, :width, :height, + 0, 1, '[]', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + FROM `widgets` + WHERE `class` = :class"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':container_id', $container_id); + $statement->bindValue(':x', $data['x'] ?: 0); + $statement->bindValue(':y', $data['y'] ?: 0); + $statement->bindValue(':width', $data['width'] ?: 1); + $statement->bindValue(':height', $data['height'] ?: 1); + $statement->bindValue(':class', $widget_class); + $statement->execute(); + } + + private function addWidgetToContainerById($container_id, $widget_id, array $data = []) + { + $query = "INSERT INTO `widget_elements` ( + `container_id`, `widget_id`, + `x`, `y`, `width`, `height`, + `locked`, `removable`, `options`, + `mkdate`, `chdate` + ) VALUES ( + :container_id, :widget_id, + :x, :y, :width, :height, + 0, 1, '[]', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':container_id', $container_id); + $statement->bindValue(':widget_id', $widget_id); + $statement->bindValue(':x', $data['x'] ?: 0); + $statement->bindValue(':y', $data['y'] ?: 0); + $statement->bindValue(':width', $data['width'] ?: 1); + $statement->bindValue(':height', $data['height'] ?: 1); + $statement->execute(); + } + + private function activateRoutes() + { + $permissions = RESTAPI\ConsumerPermissions::get('global'); + $permissions->set('/widgets/:container_id', 'put', true, true); + $permissions->set('/widgets/:container_id/:widget_id', 'post', true, true); + $permissions->set('/widgets/:container_id/:action/:element_id', 'get', true, true); + $permissions->set('/widgets/:container_id/:action/:element_id', 'post', true, true); + $permissions->set('/widgets/:container_id/:action/:element_id/:admin', 'get', true, true); + $permissions->set('/widgets/:container_id/:action/:element_id/:admin', 'post', true, true); + $permissions->store(); + } + + private function updateHelpContent() + { + $query = "UPDATE `help_content` + SET `route` = 'dispatch.php/course/info' + WHERE `route` = 'dispatch.php/course/details'"; + DBManager::get()->exec($query); + } + + public function down() + { + // Naaaah, don't do that... + } +} diff --git a/db/migrations/1.231_add_files_search_index.php b/db/migrations/1.231_add_files_search_index.php new file mode 100644 index 0000000..aa25348 --- /dev/null +++ b/db/migrations/1.231_add_files_search_index.php @@ -0,0 +1,190 @@ + + * @license GPL2 or any later version + */ +class AddFilesSearchIndex extends Migration +{ + public function description() + { + return 'Sets up the database tables for the files search index'; + } + + /** + * @SuppressWarnings(PHPMD.ShortMethodName) + */ + public function up() + { + $this->createTables(); + + if ($this->registerWidgets()) { + $this->setupDefaultWidgets(); + } + + $this->installCronjob(); + } + + public function down() + { + $dbm = \DBManager::get(); + $dbm->execute('DROP TABLE `files_search_index`, `files_search_attributes`'); + } + + // Get version of database system (MySQL/MariaDB/Percona) + private static function isMySQL55() + { + $data = \DBManager::get()->fetchFirst("SELECT VERSION() AS version"); + $version = $data[0]; + return version_compare($version, '5.6', '<'); + } + + // The primary key is named FTS_DOC_ID according to + // https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html + private function createTables() + { + $engine = self::isMySQL55() ? 'MyISAM' : 'InnoDB'; + $dbm = \DBManager::get(); + $dbm->execute( + 'CREATE TABLE IF NOT EXISTS `files_search_index` ( + `file_ref_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `text` text COLLATE utf8mb4_unicode_ci NOT NULL, + `relevance` float NOT NULL, + KEY `file_ref_id` (`file_ref_id`), + FULLTEXT KEY `text` (`text`) + ) ENGINE=' . $engine . ' DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC' + ); + $dbm->execute(' + CREATE TABLE IF NOT EXISTS `files_search_attributes` ( + `id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `file_ref_user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `file_ref_mkdate` int(10) unsigned NOT NULL, + `file_ref_chdate` int(10) unsigned NOT NULL, + `folder_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `folder_range_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `folder_range_type` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `folder_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `course_status` tinyint(4) unsigned DEFAULT NULL, + `semester_start` int(20) unsigned DEFAULT NULL, + `semester_end` int(20) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `folder_range_id` (`folder_range_id`), + KEY `folder_range_type` (`folder_range_type`), + KEY `semester_start` (`semester_start`), + KEY `semester_end` (`semester_end`) + ) ENGINE=' . $engine . ' DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC + '); + } + + private function registerWidgets() + { + $widgets = [ + 'app/widgets/files_dashboard/MyPublicFilesWidget.php' => 'Widgets\\FilesDashboard\\MyPublicFilesWidget', + + 'app/widgets/files_dashboard/LatestFilesWidget.php' => 'Widgets\\FilesDashboard\\LatestFilesWidget' + ]; + + foreach ($widgets as $path => $class) { + if (!file_exists($path)) { + return false; + } + + require $path; + \Widgets\Widget::registerWidget(new $class()); + } + + return true; + } + + private function setupDefaultWidgets() + { + $widgets = [ + 'Widgets\\FilesDashboard\\LatestFilesWidget' => ['width' => 3, 'height' => 3], + 'Widgets\\FilesDashboard\\MyPublicFilesWidget' => ['width' => 3, 'height' => 3], + ]; + + foreach (['user', 'autor', 'tutor', 'dozent', 'admin', 'root'] as $perm) { + $this->createDefaultContainer('user', $perm, 'dashboard', $widgets); + } + } + + private function createDefaultContainer($rangeType, $rangeId, $scope, array $widgets) + { + $containerId = $this->createNewContainer($rangeType, $rangeId, $scope); + + $xCoord = 0; + $yCoord = 0; + $yMax = 0; + foreach ($widgets as $class => $additional) { + $this->addWidgetToContainerByClass($containerId, $class, array_merge([ + 'x' => $xCoord, + 'y' => $yCoord, + ], $additional)); + + $yMax = max($yMax, $additional['height'] ?: 1); + + $xCoord += $additional['width']; + if ($xCoord >= 6) { + $xCoord = 0; + + $yCoord += $yMax; + $yMax = 0; + } + } + } + + private function createNewContainer($rangeType, $rangeId, $scope) + { + $query = 'INSERT INTO `widget_containers` ( + `range_id`, `range_type`, `scope`, + `mkdate`, `chdate` + ) VALUES ( + :id, :type, :scope, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )'; + $statement = \DBManager::get()->prepare($query); + $statement->bindValue(':id', $rangeId); + $statement->bindValue(':type', $rangeType); + $statement->bindValue(':scope', $scope); + $statement->execute(); + + return \DBManager::get()->lastInsertId(); + } + + /** + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + private function addWidgetToContainerByClass($containerId, $widgetClass, array $data = []) + { + $query = "INSERT INTO `widget_elements` ( + `container_id`, `widget_id`, + `x`, `y`, `width`, `height`, + `locked`, `removable`, `options`, + `mkdate`, `chdate` + ) + SELECT :container_id, `widget_id`, + :x, :y, :width, :height, + 1, 0, '[]', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + FROM `widgets` + WHERE `class` = :class"; + $statement = \DBManager::get()->prepare($query); + $statement->bindValue(':container_id', $containerId); + $statement->bindValue(':x', $data['x'] ?: 0); + $statement->bindValue(':y', $data['y'] ?: 0); + $statement->bindValue(':width', $data['width'] ?: 1); + $statement->bindValue(':height', $data['height'] ?: 1); + $statement->bindValue(':class', $widgetClass); + $statement->execute(); + } + + private function installCronjob() + { + require_once 'lib/classes/FilesSearch/Cronjob.php'; + $task = new \FilesSearch\Cronjob(); + $taskId = CronjobScheduler::getInstance()->registerTask($task); + CronjobScheduler::scheduleOnce($taskId, strtotime('+1 minute'))->activate(); + CronjobScheduler::schedulePeriodic($taskId, 55, 0)->activate(); + } +} diff --git a/db/migrations/1.232_step_00315_mvv_i18n.php b/db/migrations/1.232_step_00315_mvv_i18n.php new file mode 100644 index 0000000..6ecc715 --- /dev/null +++ b/db/migrations/1.232_step_00315_mvv_i18n.php @@ -0,0 +1,644 @@ + + * @license GPL2 or any later version + * +*/ + +class Step00315MvvI18n extends Migration +{ + public function description() + { + return 'migrates mvv localized fields to i18n api'; + } + + public function up() + { + $db = DBManager::get(); + + // fach + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `fach_id`, 'fach', 'name', 'en_GB', `name_en` " + . "FROM `fach` WHERE IFNULL(`name_en`, '') != ''" + ); + + // name_kurz + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `fach_id`, 'fach', 'name_kurz', 'en_GB', `name_kurz_en` " + . "FROM `fach` WHERE IFNULL(`name_kurz_en`, '') != ''" + ); + + // beschreibung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `fach_id`, 'fach', 'beschreibung', 'en_GB', `beschreibung_en` " + . "FROM `fach` WHERE IFNULL(`beschreibung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `fach` DROP `name_en`, DROP `name_kurz_en`, DROP `beschreibung_en`"); + + // abschluss + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschluss_id`, 'abschluss', 'name', 'en_GB', `name_en` " + . "FROM `abschluss` WHERE IFNULL(`name_en`, '') != ''" + ); + + // name_kurz + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschluss_id`, 'abschluss', 'name_kurz', 'en_GB', `name_kurz_en` " + . "FROM `abschluss` WHERE IFNULL(`name_kurz_en`, '') != ''" + ); + + // beschreibung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschluss_id`, 'abschluss', 'beschreibung', 'en_GB', `beschreibung_en` " + . "FROM `abschluss` WHERE IFNULL(`beschreibung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `abschluss` DROP `name_en`, DROP `name_kurz_en`, DROP `beschreibung_en`"); + + + // mvv_abschl_kategorie + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `kategorie_id`, 'mvv_abschl_kategorie', 'name', 'en_GB', `name_en` " + . "FROM `mvv_abschl_kategorie` WHERE IFNULL(`name_en`, '') != ''" + ); + + // name_kurz + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `kategorie_id`, 'mvv_abschl_kategorie', 'name_kurz', 'en_GB', `name_kurz_en` " + . "FROM `mvv_abschl_kategorie` WHERE IFNULL(`name_kurz_en`, '') != ''" + ); + + // beschreibung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `kategorie_id`, 'mvv_abschl_kategorie', 'beschreibung', 'en_GB', `beschreibung_en` " + . "FROM `mvv_abschl_kategorie` WHERE IFNULL(`beschreibung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_abschl_kategorie` DROP `name_en`, DROP `name_kurz_en`, DROP `beschreibung_en`"); + + + // mvv_dokument + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `dokument_id`, 'mvv_dokument', 'name', 'en_GB', `name_en` " + . "FROM `mvv_dokument` WHERE IFNULL(`name_en`, '') != ''" + ); + + // linktext + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `dokument_id`, 'mvv_dokument', 'linktext', 'en_GB', `linktext_en` " + . "FROM `mvv_dokument` WHERE IFNULL(`linktext_en`, '') != ''" + ); + + // beschreibung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `dokument_id`, 'mvv_dokument', 'beschreibung', 'en_GB', `beschreibung_en` " + . "FROM `mvv_dokument` WHERE IFNULL(`beschreibung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_dokument` DROP `name_en`, DROP `linktext_en`, DROP `beschreibung_en`"); + + + // mvv_dokument_zuord + + // add an own primary key to simplify i18n (used as foreign key in i18n) + $db->execute("ALTER TABLE `mvv_dokument_zuord` ADD `dokument_zuord_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL FIRST"); + $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP PRIMARY KEY, ADD UNIQUE (`dokument_id`, `range_id`, `object_type`) USING BTREE"); + $dokument_zuordnungen = $db->query("SELECT * FROM `mvv_dokument_zuord` WHERE 1"); + $is_unique = $db->prepare("SELECT `dokument_zuord_id` FROM `mvv_dokument_zuord` WHERE `dokument_zuord_id` = ?"); + foreach ($dokument_zuordnungen->fetchAll() as $dokument_zuordnung) { + do { + $id = md5(uniqid('mvv_dokument_zuord', 1)); + $is_unique->execute([$id]); + } while ($is_unique->fetch()); + $db->execute("UPDATE `mvv_dokument_zuord` SET `dokument_zuord_id` = ? " + . "WHERE `dokument_id` = ? AND `range_id` = ? AND `object_type` = ?", + [$id, $dokument_zuordnung['dokument_id'], $dokument_zuordnung['range_id'], + $dokument_zuordnung['object_type']]); + } + $db->execute("ALTER TABLE `mvv_dokument_zuord` ADD PRIMARY KEY(`dokument_zuord_id`)"); + + // kommentar + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `dokument_zuord_id`, 'mvv_dokument_zuord', 'kommentar', 'en_GB', `kommentar_en` " + . "FROM `mvv_dokument_zuord` WHERE IFNULL(`kommentar_en`, '') != ''" + ); + $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP `kommentar_en`"); + + + // mvv_lvgruppe + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `lvgruppe_id`, 'mvv_lvgruppe', 'name', 'en_GB', `name_en` " + . "FROM `mvv_lvgruppe` WHERE IFNULL(`name_en`, '') != ''" + ); + + // alttext + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `lvgruppe_id`, 'mvv_lvgruppe', 'alttext', 'en_GB', `alttext_en` " + . "FROM `mvv_lvgruppe` WHERE IFNULL(`alttext_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_lvgruppe` DROP `name_en`, DROP `alttext_en`"); + + + // mvv_modulteil_deskriptor + + $deskriptoren = $db->query("SELECT `mmd1`.*, `mmd2`.`deskriptor_id` AS `base_id` " + . "FROM `mvv_modulteil_deskriptor` `mmd1` " + . "LEFT JOIN `mvv_modulteil_deskriptor` `mmd2` " + . "ON `mmd1`.`modulteil_id` = `mmd2`.`modulteil_id` AND `mmd2`.`sprache` = 'DE' " + . "WHERE `mmd1`.`sprache` != 'DE'"); + $stmt = $db->prepare("INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "VALUES(?, 'mvv_modulteil_deskriptor', ?, 'en_GB', ?)"); + foreach ($deskriptoren->fetchAll() as $deskriptor) { + $fields = ['bezeichnung', 'voraussetzung', 'kommentar', 'kommentar_kapazitaet', + 'kommentar_wl_praesenz', 'kommentar_wl_bereitung', 'kommentar_wl_selbst', + 'kommentar_wl_pruef', 'pruef_vorleistung', 'pruef_leistung', 'kommentar_pflicht']; + foreach ($fields as $field) { + if (trim($deskriptor[$field])) { + $stmt->execute([$deskriptor['base_id'], $field, $deskriptor[$field]]); + } + } + } + + $db->execute("DELETE FROM `mvv_modulteil_deskriptor` WHERE sprache != 'DE'"); + + $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` DROP INDEX `modulteil_id`"); + $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` DROP `sprache`"); + $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` ADD INDEX `modulteil_id` (`modulteil_id`)"); + + + // mvv_modul_deskriptor + + $deskriptoren = $db->query("SELECT `mmd1`.*, `mmd2`.`deskriptor_id` AS `base_id` " + . "FROM `mvv_modul_deskriptor` `mmd1` " + . "LEFT JOIN `mvv_modul_deskriptor` `mmd2` " + . "ON `mmd1`.`modul_id` = `mmd2`.`modul_id` AND `mmd2`.`sprache` = 'DE' " + . "WHERE `mmd1`.`sprache` != 'DE'"); + $stmt = $db->prepare("INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "VALUES(?, 'mvv_modul_deskriptor', ?, 'en_GB', ?)"); + foreach ($deskriptoren->fetchAll(PDO::FETCH_ASSOC) as $deskriptor) { + $fields = ['verantwortlich', 'bezeichnung', 'voraussetzung', 'kompetenzziele', + 'inhalte', 'literatur', 'links', 'kommentar', 'turnus', 'kommentar_kapazitaet', + 'kommentar_sws', 'kommentar_wl_selbst', 'kommentar_wl_pruef', 'kommentar_note', + 'pruef_vorleistung', 'pruef_leistung', 'pruef_wiederholung', 'ersatztext']; + foreach ($fields as $field) { + if (trim($deskriptor[$field])) { + $stmt->execute([$deskriptor['base_id'], $field, $deskriptor[$field]]); + } + } + } + + $db->execute("DELETE FROM `mvv_modul_deskriptor` WHERE `sprache` != 'DE'"); + $db->execute("ALTER TABLE `mvv_modul_deskriptor` DROP INDEX `modul_id`"); + $db->execute("ALTER TABLE `mvv_modul_deskriptor` DROP `sprache`"); + $db->execute("ALTER TABLE `mvv_modul_deskriptor` ADD INDEX `modul_id` (`modul_id`)"); + + + // mvv_stgteil + + // zusatz + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `stgteil_id`, 'mvv_stgteil', 'zusatz', 'en_GB', `zusatz_en` " + . "FROM `mvv_stgteil` WHERE IFNULL(`zusatz_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_stgteil` DROP `zusatz_en`"); + + + // mvv_stgteilabschnitt + + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschnitt_id`, 'mvv_stgteilabschnitt', 'name', 'en_GB', `name_en` " + . "FROM `mvv_stgteilabschnitt` WHERE IFNULL(`name_en`, '') != ''" + ); + + // kommentar + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschnitt_id`, 'mvv_stgteilabschnitt', 'kommentar', 'en_GB', `kommentar_en` " + . "FROM `mvv_stgteilabschnitt` WHERE IFNULL(`kommentar_en`, '') != ''" + ); + + // ueberschrift + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschnitt_id`, 'mvv_stgteilabschnitt', 'ueberschrift', 'en_GB', `ueberschrift_en` " + . "FROM `mvv_stgteilabschnitt` WHERE IFNULL(`ueberschrift_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_stgteilabschnitt` DROP `name_en`, DROP `kommentar_en`, DROP `ueberschrift_en`"); + + + // mvv_stgteilabschnitt_modul + + // add an own primary key to simplify i18n (used as foreign key in i18n) + $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` ADD `abschnitt_modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL FIRST"); + $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` DROP PRIMARY KEY, ADD UNIQUE (`abschnitt_id`, `modul_id`) USING BTREE"); + $abschnitt_modul = $db->query("SELECT * FROM `mvv_stgteilabschnitt_modul` WHERE 1"); + $is_unique = $db->prepare("SELECT `abschnitt_modul_id` FROM `mvv_stgteilabschnitt_modul` WHERE `abschnitt_modul_id` = ?"); + foreach ($abschnitt_modul->fetchAll() as $abs_mod) { + do { + $id = md5(uniqid('mvv_stgteilabschnitt_modul', 1)); + $is_unique->execute([$id]); + } while ($is_unique->fetch()); + $db->execute("UPDATE `mvv_stgteilabschnitt_modul` SET `abschnitt_modul_id` = ? WHERE `abschnitt_id` = ? AND `modul_id` = ?", + [$id, $abs_mod['abschnitt_id'], $abs_mod['modul_id']]); + } + $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` ADD PRIMARY KEY(`abschnitt_modul_id`)"); + + // bezeichnung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `abschnitt_modul_id`, 'mvv_stgteilabschnitt_modul', 'bezeichnung', 'en_GB', `bezeichnung_en` " + . "FROM `mvv_stgteilabschnitt_modul` WHERE IFNULL(`bezeichnung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` DROP `bezeichnung_en`"); + + + // mvv_stgteilversion + + // beschreibung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `version_id`, 'mvv_stgteilversion', 'beschreibung', 'en_GB', `beschreibung_en` " + . "FROM `mvv_stgteilversion` WHERE IFNULL(`beschreibung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_stgteilversion` DROP `beschreibung_en`"); + + + // mvv_stgteil_bez + + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `stgteil_bez_id`, 'mvv_stgteil_bez', 'name', 'en_GB', `name_en` " + . "FROM `mvv_stgteil_bez` WHERE IFNULL(`name_en`, '') != ''" + ); + + // name_kurz + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `stgteil_bez_id`, 'mvv_stgteil_bez', 'name_kurz', 'en_GB', `name_kurz_en` " + . "FROM `mvv_stgteil_bez` WHERE IFNULL(`name_kurz_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_stgteil_bez` DROP `name_en`, DROP `name_kurz_en`"); + + // mvv_studiengang + + // name + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `studiengang_id`, 'mvv_studiengang', 'name', 'en_GB', `name_en` " + . "FROM `mvv_studiengang` WHERE IFNULL(`name_en`, '') != ''" + ); + + // name_kurz + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `studiengang_id`, 'mvv_studiengang', 'name_kurz', 'en_GB', `name_kurz_en` " + . "FROM `mvv_studiengang` WHERE IFNULL(`name_kurz_en`, '') != ''" + ); + + // beschreibung + $db->execute( + "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " + . "SELECT `studiengang_id`, 'mvv_studiengang', 'beschreibung', 'en_GB', `beschreibung_en` " + . "FROM `mvv_studiengang` WHERE IFNULL(`beschreibung_en`, '') != ''" + ); + + $db->execute("ALTER TABLE `mvv_studiengang` DROP `name_kurz_en`, DROP `name_en`, DROP `beschreibung_en`"); + + + // make datafields i18ed + $db->exec("ALTER TABLE datafields + CHANGE `type` `type` ENUM('bool','textline','textlinei18n','textarea', + 'textareai18n','textmarkup','textmarkupi18n','selectbox', + 'date','time','email','phone','radio','combo','link','selectboxmultiple') + CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'textline'"); + $db->execute("ALTER TABLE `datafields_entries` + ADD `lang` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `sec_range_id`"); + $db->execute('ALTER TABLE `datafields_entries` ' + . 'DROP PRIMARY KEY, ADD PRIMARY KEY (`datafield_id`, `range_id`, `sec_range_id`, `lang`)'); + } + + public function down() + { + $db = DBManager::get(); + + // fach + // name_en + $db->execute('ALTER TABLE `fach` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `fach` + LEFT JOIN `i18n` ON (`fach`.`fach_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'fach' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // name_kurz + $db->execute('ALTER TABLE `fach` ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`'); + $db->execute("UPDATE `fach` + LEFT JOIN `i18n` ON (`fach`.`fach_id` = `i18n`.`object_id`) + SET `name_kurz_en` = `value` + WHERE `table` = 'fach' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); + + // beschreibung + $db->execute('ALTER TABLE `fach` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); + $db->execute("UPDATE `fach` + LEFT JOIN `i18n` ON (`fach`.`fach_id` = `i18n`.`object_id`) + SET `beschreibung_en` = `value` + WHERE `table` = 'fach' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'fach'"); + + + // abschluss + // name + $db->execute('ALTER TABLE `abschluss` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `abschluss` + LEFT JOIN `i18n` ON (`abschluss`.`abschluss_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'abschluss' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // name_kurz + $db->execute('ALTER TABLE `abschluss` ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`'); + $db->execute("UPDATE `abschluss` + LEFT JOIN `i18n` ON (`abschluss`.`abschluss_id` = `i18n`.`object_id`) + SET `name_kurz_en` = `value` + WHERE `table` = 'abschluss' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); + + // beschreibung + $db->execute('ALTER TABLE `abschluss` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); + $db->execute("UPDATE `abschluss` + LEFT JOIN `i18n` ON (`abschluss`.`abschluss_id` = `i18n`.`object_id`) + SET `beschreibung_en` = `value` + WHERE `table` = 'abschluss' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'abschluss'"); + + + // mvv_abschl_kategorie + // name + $db->execute('ALTER TABLE `mvv_abschl_kategorie` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `mvv_abschl_kategorie` + LEFT JOIN `i18n` ON (`mvv_abschl_kategorie`.`kategorie_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'mvv_abschl_kategorie' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // name_kurz + $db->execute('ALTER TABLE `mvv_abschl_kategorie` ADD `name_kurz_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name_kurz`'); + $db->execute("UPDATE `mvv_abschl_kategorie` + LEFT JOIN `i18n` ON (`mvv_abschl_kategorie`.`kategorie_id` = `i18n`.`object_id`) + SET `name_kurz_en` = `value` + WHERE `table` = 'mvv_abschl_kategorie' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); + + // beschreibung + $db->execute('ALTER TABLE `mvv_abschl_kategorie` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); + $db->execute("UPDATE `mvv_abschl_kategorie` + LEFT JOIN `i18n` ON (`mvv_abschl_kategorie`.`kategorie_id` = `i18n`.`object_id`) + SET `beschreibung_en` = `value` + WHERE `table` = 'mvv_abschl_kategorie' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_abschl_kategorie'"); + + + // mvv_dokument + // name + $db->execute('ALTER TABLE `mvv_dokument` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `mvv_dokument` + LEFT JOIN `i18n` ON (`mvv_dokument`.`dokument_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'mvv_dokument' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // linktext + $db->execute('ALTER TABLE `mvv_dokument` ADD `linktext_en` VARCHAR(255) NULL DEFAULT NULL AFTER `linktext`'); + $db->execute("UPDATE `mvv_dokument` + LEFT JOIN `i18n` ON (`mvv_dokument`.`dokument_id` = `i18n`.`object_id`) + SET `linktext_en` = `value` + WHERE `table` = 'mvv_dokument' AND `field` = 'linktext' AND `lang` = 'en_GB'"); + + // beschreibung + $db->execute('ALTER TABLE `mvv_dokument` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); + $db->execute("UPDATE `mvv_dokument` + LEFT JOIN `i18n` ON (`mvv_dokument`.`dokument_id` = `i18n`.`object_id`) + SET `beschreibung_en` = `value` + WHERE `table` = 'mvv_dokument' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_dokument'"); + + + // mvv_dokument_zuord + // kommentar + $db->execute('ALTER TABLE `mvv_dokument_zuord` ADD `kommentar_en` TEXT NULL DEFAULT NULL AFTER `kommentar`'); + $db->execute("UPDATE `mvv_dokument_zuord` + LEFT JOIN `i18n` ON (`mvv_dokument_zuord`.`dokument_zuord_id` = `i18n`.`object_id`) + SET `kommentar_en` = `value` + WHERE `table` = 'mvv_dokument_zuord' AND `field` = 'kommentar' AND `lang` = 'en_GB'"); + + $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP PRIMARY KEY, ADD PRIMARY KEY (`dokument_id`, `range_id`, `object_type`) USING BTREE"); + $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP `dokument_zuord_id`"); + + + // mvv_lvgruppe + // name + $db->execute('ALTER TABLE `mvv_lvgruppe` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `mvv_lvgruppe` + LEFT JOIN `i18n` ON (`mvv_lvgruppe`.`lvgruppe_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'mvv_lvgruppe' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // alttext + $db->execute('ALTER TABLE `mvv_lvgruppe` ADD `alttext_en` TEXT NULL DEFAULT NULL AFTER `alttext`'); + $db->execute("UPDATE `mvv_lvgruppe` + LEFT JOIN `i18n` ON (`mvv_lvgruppe`.`lvgruppe_id` = `i18n`.`object_id`) + SET `alttext_en` = `value` + WHERE `table` = 'mvv_lvgruppe' AND `field` = 'alttext' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_lvgruppe'"); + + + // mvv_modulteil_deskriptor + $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` ADD `sprache` VARCHAR(32) NULL DEFAULT NULL AFTER `modulteil_id`"); + + $languages = $db->fetchFirst("SELECT distinct `lang` FROM `i18n`"); + $stmt = $db->prepare("SELECT DISTINCT(`object_id`) FROM `i18n` WHERE `table` = 'mvv_modulteil_deskriptor' AND `lang` = ?"); + foreach ($languages as $language) { + $stmt->execute([$language]); + foreach ($stmt->fetchAll() as $deskriptor_id) { + $base_deskriptor = new ModulteilDeskriptor($deskriptor_id); + $i18n_deskriptor = new ModulteilDeskriptor(); + $i18n_deskriptor->modulteil_id = $base_deskriptor->modulteil_id; + $i18n_deskriptor->sprache = $language; + $i18n_entries = I18NString::fetchDataForRow($base_deskriptor->id, 'mvv_modulteil_deskriptor'); + foreach ($i18n_entries as $field => $data) { + $i18n_deskriptor->$field = $data['value']; + } + $i18n_deskriptor->store(); + } + } + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_modulteil_deskriptor'"); + + + // mvv_modul_deskriptor + $db->execute("ALTER TABLE `mvv_modul_deskriptor` ADD `sprache` VARCHAR(32) NULL DEFAULT NULL AFTER `modul_id`"); + + $stmt = $db->prepare("SELECT DISTINCT(`object_id`) FROM `i18n` WHERE `table` = 'mvv_modul_deskriptor' AND `lang` = ?"); + foreach ($languages as $language) { + $stmt->execute([$language]); + foreach ($stmt->fetchAll() as $deskriptor_id) { + $base_deskriptor = new ModulDeskriptor($deskriptor_id); + $i18n_deskriptor = new ModulDeskriptor(); + $i18n_deskriptor->modul_id = $base_deskriptor->modul_id; + $i18n_deskriptor->sprache = $language; + $i18n_entries = I18NString::fetchDataForRow($base_deskriptor->id, 'mvv_modul_deskriptor'); + foreach ($i18n_entries as $field => $data) { + $i18n_deskriptor->$field = $data['value']; + } + $i18n_deskriptor->store(); + } + } + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_modul_deskriptor'"); + + + // mvv_stgteil + // zusatz + $db->execute('ALTER TABLE `mvv_stgteil` ADD `zusatz_en` TEXT NULL DEFAULT NULL AFTER `zusatz`'); + $db->execute("UPDATE `mvv_stgteil` + LEFT JOIN `i18n` ON (`mvv_stgteil`.`stgteil_id` = `i18n`.`object_id`) + SET `zusatz_en` = `value` + WHERE `table` = 'mvv_stgteil' AND `field` = 'zusatz' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteil'"); + + + // mvv_stgteilabschnitt + // name + $db->execute('ALTER TABLE `mvv_stgteilabschnitt` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `mvv_stgteilabschnitt` + LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt`.`abschnitt_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'mvv_stgteilabschnitt' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // kommentar + $db->execute('ALTER TABLE `mvv_stgteilabschnitt` ADD `kommentar_en` TEXT NULL DEFAULT NULL AFTER `kommentar`'); + $db->execute("UPDATE `mvv_stgteilabschnitt` + LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt`.`abschnitt_id` = `i18n`.`object_id`) + SET `kommentar_en` = `value` + WHERE `table` = 'mvv_stgteilabschnitt' AND `field` = 'kommentar' AND `lang` = 'en_GB'"); + + // ueberschrift + $db->execute('ALTER TABLE `mvv_stgteilabschnitt` ADD `ueberschrift_en` TEXT NULL DEFAULT NULL AFTER `ueberschrift`'); + $db->execute("UPDATE `mvv_stgteilabschnitt` + LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt`.`abschnitt_id` = `i18n`.`object_id`) + SET `ueberschrift_en` = `value` + WHERE `table` = 'mvv_stgteilabschnitt' AND `field` = 'ueberschrift' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteilabschnitt'"); + + + // mvv_stgteilabschnitt_modul + // bezeichnung + $db->execute('ALTER TABLE `mvv_stgteilabschnitt_modul` ADD `bezeichnung_en` TEXT NULL DEFAULT NULL AFTER `bezeichnung`'); + $db->execute("UPDATE `mvv_stgteilabschnitt_modul` + LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt_modul`.`abschnitt_modul_id` = `i18n`.`object_id`) + SET `bezeichnung_en` = `value` + WHERE `table` = 'mvv_stgteilabschnitt_modul' AND `field` = 'bezeichnung' AND `lang` = 'en_GB'"); + + $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` DROP PRIMARY KEY, ADD PRIMARY KEY (`abschnitt_id`, `modul_id`) USING BTREE"); + $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP `abschnitt_modul_id`"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteilabschnitt_modul'"); + + + // mvv_stgteilversion + // beschreibung + $db->execute('ALTER TABLE `mvv_stgteilversion` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); + $db->execute("UPDATE `mvv_stgtteilversion` + LEFT JOIN `i18n` ON (`mvv_stgteilversion`.`version_id` = `i18n`.`object_id`) + SET `beschreibung_en` = `value` + WHERE `table` = 'mvv_stgteilversion' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteilversion'"); + + + // mvv_stgteil_bez + // name + $db->execute('ALTER TABLE `mvv_stgteil_bez` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `mvv_stgtteil_bez` + LEFT JOIN `i18n` ON (`mvv_stgteil_bez`.`stgteil_bez_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'mvv_stgteil_bez' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // name_kurz + $db->execute('ALTER TABLE `mvv_stgteil_bez` ADD `name_kurz_en` TEXT NULL DEFAULT NULL AFTER `name_kurz`'); + $db->execute("UPDATE `mvv_stgtteil_bez` + LEFT JOIN `i18n` ON (`mvv_stgteil_bez`.`stgteil_bez_id` = `i18n`.`object_id`) + SET `name_kurz_en` = `value` + WHERE `table` = 'mvv_stgteil_bez' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteil_bez'"); + + + // mvv_studiengang + // name + $db->execute('ALTER TABLE `mvv_studiengang` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); + $db->execute("UPDATE `mvv_studiengang` + LEFT JOIN `i18n` ON (`mvv_studiengang`.`studiengang_id` = `i18n`.`object_id`) + SET `name_en` = `value` + WHERE `table` = 'mvv_studiengang' AND `field` = 'name' AND `lang` = 'en_GB'"); + + // name_kurz + $db->execute('ALTER TABLE `mvv_studiengang` ADD `name_kurz_en` TEXT NULL DEFAULT NULL AFTER `name_kurz`'); + $db->execute("UPDATE `mvv_studiengang` + LEFT JOIN `i18n` ON (`mvv_studiengang`.`studiengang_id` = `i18n`.`object_id`) + SET `name_kurz_en` = `value` + WHERE `table` = 'mvv_studiengang' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); + + // beschreibung + $db->execute('ALTER TABLE `mvv_studiengang` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); + $db->execute("UPDATE `mvv_studiengang` + LEFT JOIN `i18n` ON (`mvv_studiengang`.`studiengang_id` = `i18n`.`object_id`) + SET `beschreibung_en` = `value` + WHERE `table` = 'mvv_studiengang' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); + + $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_studiengang'"); + + + // datafields + $db->exec("ALTER TABLE datafields + CHANGE type type ENUM('bool','textline','textarea','selectbox', + 'date','time','email','phone','radio','combo','link','selectboxmultiple') + NOT NULL DEFAULT 'textline'"); + $db->execute('ALTER TABLE `datafields_entries` ' + . 'DROP PRIMARY KEY, ADD PRIMARY KEY (`datafield_id`, `range_id`, `sec_range_id`) USING BTREE'); + $db->exec('ALTER TABLE `datafields_entries` DROP `lang`'); + } + +} diff --git a/db/migrations/1.233_step_00316_mvvkernintegration.php b/db/migrations/1.233_step_00316_mvvkernintegration.php new file mode 100644 index 0000000..8db1111 --- /dev/null +++ b/db/migrations/1.233_step_00316_mvvkernintegration.php @@ -0,0 +1,36 @@ +exec("UPDATE `log_actions` SET `class` = 'MVV', `type` = 'core' WHERE `class` LIKE 'MVVPlugin' AND `type` = 'plugin'"); + + // remove dependencies on old core plugin + $db->execute("DELETE FROM `plugin_assets` " + . "WHERE `plugin_id` IN (" + . " SELECT `pluginid` " + . " FROM `plugins` " + . " WHERE `pluginpath` = 'core/Modulverwaltung')"); + + $db->execute("DELETE FROM `roles_plugins` " + . "WHERE `pluginid` IN (" + . " SELECT `pluginid` " + . " FROM `plugins` " + . " WHERE `pluginpath` = 'core/Modulverwaltung')"); + + $db->execute("DELETE FROM `plugins` " + . "WHERE `pluginpath` = 'core/Modulverwaltung'"); + } + + public function down() { + } + +} diff --git a/db/migrations/1.234_add_mkdate_to_statusgruppe_user.php b/db/migrations/1.234_add_mkdate_to_statusgruppe_user.php new file mode 100644 index 0000000..92d73cc --- /dev/null +++ b/db/migrations/1.234_add_mkdate_to_statusgruppe_user.php @@ -0,0 +1,17 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `statusgruppe_user` + DROP COLUMN `mkdate`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.235_tic8335_paper_related_topics.php b/db/migrations/1.235_tic8335_paper_related_topics.php new file mode 100644 index 0000000..086f6d3 --- /dev/null +++ b/db/migrations/1.235_tic8335_paper_related_topics.php @@ -0,0 +1,41 @@ + + * @license GPL2 or any later version + * @since Stud.IP 4.2 + */ +class Tic8335PaperRelatedTopics extends Migration +{ + public function up() + { + if ($this->hasColumn()) { + return; + } + + $query = "ALTER TABLE `themen` + ADD COLUMN `paper_related` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `priority`"; + DBManager::get()->exec($query); + } + + public function down() + { + if (!$this->hasColumn()) { + return; + } + + $query = "ALTER TABLE `themen` DROP COLUMN `paper_related`"; + DBManager::get()->exec($query); + } + + private function hasColumn() + { + $query = "SHOW COLUMNS FROM `themen`"; + $columns = DBManager::get()->fetchFirst($query); + + return in_array('paper_related', $columns); + } +} diff --git a/db/migrations/1.236_config_public_topics.php b/db/migrations/1.236_config_public_topics.php new file mode 100644 index 0000000..fdfd94c --- /dev/null +++ b/db/migrations/1.236_config_public_topics.php @@ -0,0 +1,44 @@ +prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'COURSE_PUBLIC_TOPICS', + 'description' => 'Über diese Option können Sie die Themen einer Veranstaltung öffentlich einsehbar machen.', + 'range' => 'course', + 'type' => 'boolean', + 'value' => '0' + ]); + + $db->exec("INSERT INTO config_values (field, range_id, value, mkdate, chdate, comment) + SELECT 'COURSE_PUBLIC_TOPICS', Seminar_id, public_topics, mkdate, chdate, '' + FROM seminare WHERE public_topics = 1"); + + $db->exec('ALTER TABLE seminare DROP public_topics'); + } + + public function down() + { + $db = DBManager::get(); + + // migrate setting to seminare.public_topics + $db->exec('ALTER TABLE seminare ADD public_topics tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER completion'); + + $db->exec("UPDATE config_values JOIN seminare ON range_id = Seminar_id + SET public_topics = value WHERE field = 'COURSE_PUBLIC_TOPICS'"); + + $db->exec("DELETE config, config_values FROM config LEFT JOIN config_values USING(field) + WHERE field = 'COURSE_PUBLIC_TOPICS'"); + } +} diff --git a/db/migrations/1.237_config_mail_subject.php b/db/migrations/1.237_config_mail_subject.php new file mode 100644 index 0000000..e02af5a --- /dev/null +++ b/db/migrations/1.237_config_mail_subject.php @@ -0,0 +1,39 @@ +prepare('INSERT INTO config (field, value, type, section, mkdate, chdate, description) + VALUES (:name, :value, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'MAIL_USE_SUBJECT_PREFIX', + 'description' => 'Stellt dem Titel von per Mail versandten Nachrichten den Wert von UNI_NAME_CLEAN voran.', + 'section' => 'global', + 'type' => 'boolean', + 'value' => '1' + ]); + $stmt->execute([ + 'name' => 'NOTIFY_ON_WAITLIST_ADVANCE', + 'description' => 'Versendet Nachrichten an Teilnehmer bei jeder Änderung der Position auf der Warteliste', + 'section' => 'global', + 'type' => 'boolean', + 'value' => '1' + ]); + } + + public function down() + { + $db = DBManager::get(); + + $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?'); + $stmt->execute(['MAIL_USE_SUBJECT_PREFIX']); + $stmt->execute(['NOTIFY_ON_WAITLIST_ADVANCE']); + } +} diff --git a/db/migrations/1.238_db_updates_for_42.php b/db/migrations/1.238_db_updates_for_42.php new file mode 100644 index 0000000..45c86fc --- /dev/null +++ b/db/migrations/1.238_db_updates_for_42.php @@ -0,0 +1,76 @@ +exec('ALTER TABLE sem_classes DROP compact_mode, DROP workgroup_mode, DROP turnus_default'); + + $db->exec('ALTER TABLE personal_notifications_user CHANGE user_id user_id char(32) COLLATE latin1_bin NOT NULL'); + + $db->exec("ALTER TABLE plugins_activated + ADD range_type enum('sem','inst','user') COLLATE latin1_bin NOT NULL default 'sem' AFTER pluginid, + ADD range_id char(32) COLLATE latin1_bin NOT NULL AFTER range_type, + CHANGE state state tinyint(1) NOT NULL DEFAULT 1"); + + $db->exec("UPDATE plugins_activated SET range_type = 'sem', range_id = SUBSTRING(poiid, 4) WHERE poiid LIKE 'sem%'"); + $db->exec("UPDATE plugins_activated SET range_type = 'inst', range_id = SUBSTRING(poiid, 5) WHERE poiid LIKE 'inst%'"); + $db->exec("UPDATE plugins_activated SET range_type = 'user', range_id = SUBSTRING(poiid, 5) WHERE poiid LIKE 'user%'"); + $db->exec('UPDATE plugins_activated SET state = 0 WHERE state = 2'); + + // delete invalid entries + $db->exec("DELETE FROM plugins_activated WHERE range_id = ''"); + + $db->exec('ALTER TABLE plugins_activated + DROP PRIMARY KEY, DROP KEY poiid, + ADD PRIMARY KEY (pluginid, range_type, range_id), + DROP poiid'); + //alter default for studygroups, see #9002 + $db->exec("UPDATE `sem_classes` SET `course_creation_forbidden` = 0 WHERE `studygroup_mode` = 1"); + + $db->exec("DELETE FROM `config` WHERE `field` IN ( + 'ALLOW_METADATE_SORTING', + 'ALLOW_DOWNLOAD_FOR_UNKNOWN_LICENSE', + 'ADMISSION_ALLOW_DISABLE_WAITLIST', + 'ASSI_SEMESTER_PRESELECT', + 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION' + )"); + $db->exec("DELETE FROM `config_values` WHERE `field` IN ( + 'ALLOW_METADATE_SORTING', + 'ALLOW_DOWNLOAD_FOR_UNKNOWN_LICENSE', + 'ADMISSION_ALLOW_DISABLE_WAITLIST', + 'ASSI_SEMESTER_PRESELECT', + 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION' + )"); + $db->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); //see #9106 + + } + + public function down() + { + $db = DBManager::get(); + + $db->exec('ALTER TABLE sem_classes + ADD compact_mode tinyint(4) NOT NULL AFTER name, + ADD workgroup_mode tinyint(4) NOT NULL AFTER compact_mode, + ADD turnus_default int(11) NOT NULL AFTER only_inst_user'); + + $db->exec("ALTER TABLE plugins_activated ADD poiid varchar(36) COLLATE latin1_bin NOT NULL DEFAULT '' AFTER pluginid"); + + $db->exec('UPDATE plugins_activated SET poiid = CONCAT(range_type, range_id)'); + $db->exec('UPDATE plugins_activated SET state = 2 WHERE state = 0'); + + $db->exec("ALTER TABLE plugins_activated + CHANGE state state enum('on','off') COLLATE latin1_bin NOT NULL DEFAULT 'on', + DROP PRIMARY KEY, + ADD PRIMARY KEY (pluginid, poiid), + ADD UNIQUE KEY poiid (poiid, pluginid, state), + DROP range_type, DROP range_id"); + } +} diff --git a/db/migrations/1.239_step_00327.php b/db/migrations/1.239_step_00327.php new file mode 100644 index 0000000..00db6bf --- /dev/null +++ b/db/migrations/1.239_step_00327.php @@ -0,0 +1,139 @@ +exec("UPDATE `config` SET `field` = 'PRIVACY_PERM', `section` = 'privacy' WHERE `field` = 'DATENSCHUTZ_PERM'"); + if (!$r) { + DBManager::Get()->exec("INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('PRIVACY_PERM', 'root', 'string', 'global', 'privacy', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Rechtestufe zum Datenzugriff')"); + } else { + // plugin now obsolete + DBManager::Get()->exec("UPDATE `plugins` SET `enabled` = 'no' WHERE `plugins`.`pluginclassname` LIKE 'DatenschutzPlugin';"); + } + + $r = DBManager::Get()->exec("UPDATE `config` SET `field` = 'PRIVACY_CONTACT', `section` = 'privacy' WHERE `config`.`field` = 'DATENSCHUTZ_CONTACT'"); + if (!$r) { + DBManager::Get()->exec("INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('PRIVACY_CONTACT', 'root@studip', 'string', 'global', 'privacy', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Username der Kontaktperson zum Datenschutz')"); + } + + // Datenschutzerklärung + $r = DBManager::Get()->exec("UPDATE `config` SET `field` = 'PRIVACY_URL', `section` = 'privacy' WHERE `config`.`field` = 'DATENSCHUTZ_URL';"); + DBManager::Get()->exec("UPDATE `config_values` SET `field` = 'PRIVACY_URL' WHERE `config_values`.`field` = 'DATENSCHUTZ_URL';"); + + if (!$r) { + DBManager::Get()->exec("INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('PRIVACY_URL', '', 'string', 'global', 'privacy', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'URL zur Datenschutzerklärung')"); + + DBManager::Get()->exec("INSERT INTO `siteinfo_details` (`detail_id`, `rubric_id`, `position`, `name`, `content`) VALUES (NULL, '1', NULL, 'Datenschutzerklärung', + '++**Datenschutzerklärung**++ + +Sie erhalten als Nutzer/-in unserer Internetseite in dieser Datenschutzerklärung notwendige Informationen darüber, wie und in welchem Umfang sowie zu welchem Zweck die **[Betreibereinrichtung]** Daten von Ihnen erhebt und wie diese verwendet werden. Die Daten werden nur innerhalb der **[Betreibereinrichtung]** verarbeitet und verwendet und nicht an Dritte weitergegeben. + + +++**Rechtsgrundlagen**++ + +Die Erhebung und Nutzung Ihrer Daten erfolgt streng nach den gesetzlichen Vorgaben. Regelungen dazu finden sich in: +Europäische Datenschutzgrundverordnung (EU DSGVO) +Bundesdatenschutzgesetz (BDSG) +Niedersächsisches Datenschutzgesetz (NDSG) +Teledienstegesetz (TDG) +Mediendienste-Staatsvertrag (MDStV) +Teledienstedatenschutzgesetz (TDDSG). + + +++**Personenbezogene Daten**++ + +Personenbezogene Daten werden zum Zwecke der administrativen Nutzerverwaltung, zur Kontaktaufnahme und Interaktion mit Ihnen sowie zur Bereitstellung personalisierter Dienste [zur Durchführung Ihres Studium bzw. Ihrer Arbeit an **[Betreibereinrichtung]**] von uns gespeichert. +Für die Nutzung von Stud.IP werden folgende Daten abgefragt und gespeichert: +- Nutzername +- Vorname, Nachname +- Mailadresse +- [ggf. weitere Daten] + + +Weitere Daten, die evtl. Ihnen gespeichert werden, sind Inhalte, die Sie selbst im Rahmen Ihrer Arbeit oder Ihres Studiums in Stud.IP einstellen. Dazu gehören: +- Freiwillige Angaben zur Person +- Beiträge in Foren +- hochgeladene Dateien +- Chatverläufe in Blubber +- interne Nachrichten +- Kalendereinträge und Stundenpläne +- Teilnahme an Lehrveranstaltungen, Studiengruppen, Orgagremien +- Persönliche Einstellungen und Konfigurationen +- [ggf. Plugindaten] + + +Diese Inhalte werden mit Ihrem Klarnamen gespeichert und angezeigt. Sie haben die Möglichkeit über die Privatsphäreeinstellungen selbst zu bestimmen, ob und ggf. welche Personengruppen diese Daten sehen dürfen. Diese Daten werden von Stud.IP intern verschlüsselt abgelegt. + + +++**Aufbewahrungsfristen **++ + +Ihre personenbezogenen Daten werden für die Dauer Ihres Studiums/Ihrer Arbeit bei [Beitreibereinrichtung] gespeichert. Nach Beendigung ihrer Tätigkeit und Ablauf der gesetzlichen Aufbewahrungsfristen werden Ihre Daten gelöscht. + + +++**Auskunft, Löschung, Sperrung**++ + +Sie erhalten jederzeit auf Anfrage Auskunft über die von uns über Sie gespeicherten personenbezogenen Daten sowie dem Zweck von Datenerhebung sowie Datenverarbeitung. Bitte wenden Sie sich hierzu an o.g. Kontaktadresse. + +Außerdem haben Sie das Recht, die Berichtigung, die Sperrung oder Löschung Ihrer Daten zu verlangen. Sie können Ihre Einwilligung ohne Angabe von Gründen durch Schreiben an die o.g. Kontakadresse widerrufen. Ihre Daten werden dann umgehend gelöscht. Eine weitere Nutzung der Lernplattform Stud.IP ist dann aber nicht mehr möglich. + +Ausgenommen von der Löschung sind Daten, die aufgrund gesetzlicher Vorschriften aufbewahrt oder zur ordnungsgemäßen Geschäftsabwicklung benötigt werden. Damit eine Datensperre jederzeit realisiert werden kann, werden Daten zu Kontrollzwecken in einer Sperrdatei vorgehalten. + +Werden Daten nicht von einer gesetzlichen Archivierungspflicht erfasst, löschen wir Ihre Daten auf Ihren Wunsch. Greift die Archivierungspflicht, sperren wir Ihre Daten. Für alle Fragen und Anliegen zur Berichtigung, Sperrung oder Löschung von personenbezogenen Daten wenden Sie sich bitte an unsere Datenschutzbeauftragten unter den Kontaktdaten in dieser Datenschutzerklärung bzw. an die im Impressum genannte Adresse. + + +++**Datenübertragbarkeit**++ + +Sie haben das Recht, jederzeit Ihre Daten ausgehändigt zu bekommen. Auf Anfrage stellen wir Ihnen Ihre Daten in menschenlesbaren, gängigen und bearbeitbaren Formaten zur Verfügung. + + +++**Cookies**++ + +Stud.IP verwendet ein Session-Cookie. Diese kleine Textdatei beinhaltet lediglich eine verschlüsselte Zeichenfolge, die bei der Navigation im System hilft. Das Cookie wird bei der Abmeldung aus Stud.IP oder beim Schließen des Browsers gelöscht. + + +++**Server Logfiles**++ + +Mit dem Zugriff auf Stud.IP werden IP-Adresse, Datum, Uhrzeit und Browserversion zum Zeitpunkt des Zugriffs registriert und anonymisiert gespeichert. Die Erhebung und Nutzung dieser Log-File-Daten dient lediglich der Auswertung zu rein statistischen Forschungs- und Evaluationszwecken der Lernplattform, werden also nicht in Verbindung mit Namen oder Mailadresse gespeichert oder ausgewertet. Diese Daten werden für die Zeit von [X] Monaten auf gesicherten Systemen der **[Betreibereinrichtung]** gespeichert und ebenfalls nicht an Dritte weitergegeben. + + +++**SSL-Verschlüsselung**++ + +Die Verbindung zu Stud.IP erfolgt mit einer SSL-Verschlüsselung. Über SSL verschlüsselte Daten sind nicht von Dritten lesbar. Übermitteln Sie Ihre vertraulichen Informationen nur bei aktivierter SSL-Verschlüsselung und wenden Sie sich im Zweifel an uns. + + +++Kontaktdaten:++ +**Name:** +**Telefonnummer:** +**E-Mail-Adresse:** +**Unternehmensbezeichnung:** + +++Datenschutzbeauftragte/-r:++ +**Name:** +**Telefonnummer:** +**E-Mail-Adresse:** +**Unternehmensbezeichnung:** + + +')"); + + $query = "SELECT `rubric_id`, `detail_id` + FROM `siteinfo_details` + WHERE `name` = 'Datenschutzerklärung' + ORDER BY `detail_id` DESC"; + $result = DBManager::get()->fetchOne($query); + $datenschutzinfo_url = "dispatch.php/siteinfo/show/{$result['rubric_id']}/{$result['detail_id']}"; + DBManager::Get()->execute("INSERT INTO `config_values` (`field`, `range_id`, `value`, `mkdate`, `chdate`, `comment`) VALUES ('PRIVACY_URL', 'studip', ?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'URL zur Datenschutzerklärung')", [$datenschutzinfo_url]); + + } + + } + + public function down() + { + $query = "DELETE FROM `config` + WHERE `field` IN ('PRIVACY_PERM', 'PRIVACY_URL', 'PRIVACY_CONTACT')"; + DBManager::get()->exec($query); + } + +} diff --git a/db/migrations/1.23_enlarge_object_contentmodules_module_id.php b/db/migrations/1.23_enlarge_object_contentmodules_module_id.php new file mode 100644 index 0000000..5a44db1 --- /dev/null +++ b/db/migrations/1.23_enlarge_object_contentmodules_module_id.php @@ -0,0 +1,18 @@ +exec("ALTER TABLE `object_contentmodules` CHANGE `module_id` `module_id` VARCHAR( 255 ) NOT NULL DEFAULT ''"); + } + + function down() { + $db = DBManager::get(); + $db->exec("ALTER TABLE `object_contentmodules` CHANGE `module_id` `module_id` VARCHAR( 255 ) NULL DEFAULT NULL"); + } +} diff --git a/db/migrations/1.240_tic8538.php b/db/migrations/1.240_tic8538.php new file mode 100644 index 0000000..f83d3e8 --- /dev/null +++ b/db/migrations/1.240_tic8538.php @@ -0,0 +1,23 @@ +exec("UPDATE `config` SET `field` = 'ALLOW_DOZENT_DELETE', `description` = 'Schaltet ein oder aus, ob ein Dozent eigene Veranstaltungen selbst löschen darf oder nicht' WHERE `config`.`field` = 'ALLOW_DOZENT_ARCHIV';"); + $db->exec("UPDATE `config_values` SET `field` = 'ALLOW_DOZENT_DELETE' WHERE `config_values`.`field` = 'ALLOW_DOZENT_ARCHIV' AND `config_values`.`range_id` = 'studip';"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("UPDATE `config` SET `field` = 'ALLOW_DOZENT_ARCHIV', `description` = 'Schaltet ein oder aus, ob ein Dozent eigene Veranstaltungen selbst archivieren darf oder nicht' WHERE `config`.`field` = 'ALLOW_DOZENT_DELETE';"); + $db->exec("UPDATE `config_values` SET `field` = 'ALLOW_DOZENT_ARCHIV' WHERE `config_values`.`field` = 'ALLOW_DOZENT_DELETE' AND `config_values`.`range_id` = 'studip';"); + } +} diff --git a/db/migrations/1.241_step_00320_config_search_navigation.php b/db/migrations/1.241_step_00320_config_search_navigation.php new file mode 100644 index 0000000..fde26ce --- /dev/null +++ b/db/migrations/1.241_step_00320_config_search_navigation.php @@ -0,0 +1,62 @@ + [ + 'visible' => true, + 'target' => 'sidebar' + ], + 'semtree' => [ + 'visible' => true, + 'target' => 'sidebar' + ], + 'rangetree' => [ + 'visible' => true, + 'target' => 'sidebar' + ], + 'module' => [ + 'visible' => true, + 'target' => 'sidebar' + ] + ]; + + $stmt = DBManager::get()->prepare("INSERT INTO `config` + (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (:name, :value, :type, 'global', 'coursesearch', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc) + ON DUPLICATE KEY UPDATE `chdate`=VALUES(`chdate`)"); + + $stmt->execute([ + 'name' => 'COURSE_SEARCH_NAVIGATION_OPTIONS', + 'value' => json_encode($standard_navigation_options), + 'type' => 'array', + 'desc' => 'Aktivierung und Reihenfolge der Navigationsoptionen in der Veranstaltungssuche' + ]); + $stmt->execute([ + 'name' => 'COURSE_SEARCH_IS_VISIBLE_NOBODY', + 'value' => false, + 'type' => 'boolean', + 'desc' => 'Soll die Veranstaltungssuche auch für nobody (ohne Anmeldung) sichtbar sein?' + ]); + + } + + function down() + { + DBManager::get()->exec("DELETE FROM `config` WHERE `field` IN ( + 'COURSE_SEARCH_NAVIGATION_OPTIONS', + 'COURSE_SEARCH_IS_VISIBLE_NOBODY')" + ); + } + +} diff --git a/db/migrations/1.242_tic_8546_search_show_admission_state.php b/db/migrations/1.242_tic_8546_search_show_admission_state.php new file mode 100644 index 0000000..9d0ecdb --- /dev/null +++ b/db/migrations/1.242_tic_8546_search_show_admission_state.php @@ -0,0 +1,36 @@ +prepare("INSERT INTO `config` + (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + (:name, :value, :type, 'global', 'coursesearch', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc) + ON DUPLICATE KEY UPDATE `chdate`=VALUES(`chdate`)"); + + $stmt->execute([ + 'name' => 'COURSE_SEARCH_SHOW_ADMISSION_STATE', + 'value' => false, + 'type' => 'boolean', + 'desc' => 'Anzeige des Zugangsstatus in der Veranstaltungssuche als Icon.' + ]); + + } + + function down() + { + DBManager::get()->exec("DELETE FROM `config` WHERE `field` = + 'COURSE_SEARCH_SHOW_ADMISSION_STATE'" + ); + } + +} diff --git a/db/migrations/1.243_tic8773_sort_news_by_chdate.php b/db/migrations/1.243_tic8773_sort_news_by_chdate.php new file mode 100644 index 0000000..d9f95c2 --- /dev/null +++ b/db/migrations/1.243_tic8773_sort_news_by_chdate.php @@ -0,0 +1,26 @@ + + */ +class Tic8773SortNewsByChdate extends Migration +{ + public function up() + { + $query = "INSERT INTO `config` ( + `field`, `value`, `type`, `range`, `section`, + `mkdate`, `chdate`, + `description` + ) VALUES ( + 'SORT_NEWS_BY_CHDATE', 'false', 'boolean', 'global', 'view', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Wenn diese Einstellung gesetzt ist werden Ankündigungen nach ihrem letzten Änderungsdatum statt ihrem Erstellungsdatum sortiert angezeigt.' + )"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "DELETE FROM config WHERE field = 'SORT_NEWS_BY_CHDATE'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.244_config_default_seats.php b/db/migrations/1.244_config_default_seats.php new file mode 100644 index 0000000..8d71185 --- /dev/null +++ b/db/migrations/1.244_config_default_seats.php @@ -0,0 +1,32 @@ +prepare('INSERT INTO config (field, value, type, section, mkdate, chdate, description) + VALUES (:name, :value, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'RESOURCES_ROOM_REQUEST_DEFAULT_SEATS', + 'description' => 'Vorbelegung der Sitzplatzanzahl einer Raumanfrage, falls der Kurs keine max. Teilnehmerzahl hat', + 'section' => 'resources', + 'type' => 'integer', + 'value' => '0' + ]); + } + + public function down() + { + $db = DBManager::get(); + + $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?'); + $stmt->execute(['RESOURCES_ROOM_REQUEST_DEFAULT_SEATS']); + } +} diff --git a/db/migrations/1.245_tic7804_wiki_permissions.php b/db/migrations/1.245_tic7804_wiki_permissions.php new file mode 100644 index 0000000..2f3ce32 --- /dev/null +++ b/db/migrations/1.245_tic7804_wiki_permissions.php @@ -0,0 +1,44 @@ +prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'WIKI_COURSE_EDIT_RESTRICTED', + 'description' => 'Legt fest, dass nur Teilnehmende ab Rechtestufe "tutor" das Wiki bearbeiten dürfen.', + 'range' => 'course', + 'type' => 'boolean', + 'value' => '0' + ]); + + // table for wiki page permissions settings + $db->exec("CREATE TABLE wiki_page_config ( + range_id CHAR(32) COLLATE latin1_bin NOT NULL, + keyword VARCHAR(255) COLLATE utf8mb4_bin NOT NULL, + read_restricted TINYINT(1) NOT NULL DEFAULT 0, + edit_restricted TINYINT(1) NOT NULL DEFAULT 0, + PRIMARY KEY (range_id, keyword) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + } + + public function down() + { + $db = DBManager::get(); + + $db->exec('DROP TABLE wiki_page_config'); + + $db->exec("DELETE config, config_values + FROM config + LEFT JOIN config_values USING (field) + WHERE field = 'WIKI_COURSE_EDIT_RESTRICTED'"); + } +} diff --git a/db/migrations/1.246_consultations.php b/db/migrations/1.246_consultations.php new file mode 100644 index 0000000..1d9fa89 --- /dev/null +++ b/db/migrations/1.246_consultations.php @@ -0,0 +1,315 @@ +exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `consultation_slots` ( + `slot_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `block_id` INT(11) UNSIGNED NOT NULL, + `start_time` INT(11) UNSIGNED NOT NULL, + `end_time` INT(11) UNSIGNED NOT NULL, + `note` TEXT NOT NULL, + `teacher_event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`slot_id`), + KEY `block_id` (`block_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `consultation_bookings` ( + `booking_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `slot_id` INT(11) UNSIGNED NOT NULL, + `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `reason` TEXT NOT NULL, + `student_event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`booking_id`), + KEY `block_id` (`slot_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + + // Add config entries (global and user) + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'CONSULTATION_ENABLED', '0', 'boolean', 'global', + 'Sprechstunden', 'Schaltet die Sprechstunden global ein', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'CONSULTATION_REQUIRED_PERMISSION', 'dozent', 'string', 'global', + 'Sprechstunden', 'Ab welcher Rechtestufe dürfen Nutzer Sprechstunden anlegen (user, autor, tutor, dozent, admin, root)', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'CONSULTATION_ALLOW_DOCENTS_RESERVING', '0', 'boolean', 'global', + 'Sprechstunden', 'Dozenten können sich bei anderen Dozenten anmelden', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'CONSULTATION_SEND_MESSAGES', '1', 'boolean', 'user', + 'Sprechstunden', 'Nachrichten empfangen über Buchungen/Stornierungen', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + + $this->migratePlugin(); + } + + public function down() + { + // Remove tables + $query = "DROP TABLE IF EXISTS `consultation_blocks`, + `consultation_slots`, + `consultation_bookings`"; + DBManager::get()->exec($query); + + // Remove config entries + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` IN ( + 'CONSULTATION_ENABLED', + 'CONSULTATION_REQUIRED_PERMISSION' + )"; + DBManager::get()->exec($query); + } + + protected function migratePlugin() + { + // Detect plugin by tables + $query = "SHOW TABLES LIKE 'SprechstundenAnmeldung'"; + $statement = DBManager::get()->query($query); + + if ($statement->rowCount() === 0) { + // No plugin data + return; + } + + // Check database format + $query = "SHOW COLUMNS FROM `SprechstundenTerminDesc` + WHERE `Field` IN ('note_on_schedule', 'in_calendar')"; + $statement = DBManager::get()->query($query); + + if ($statement->rowCount() !== 2) { + $this->announce('Unable to migrate SprechstundenPlugin data due to incompatible database format'); + return false; + } + + + // Detect which plugin version was used + $query = "SHOW COLUMNS FROM SprechstundenTerminDesc LIKE 'size'"; + $has_size = (bool) DBManager::get()->query($query)->fetchColumn(); + $size_col = $has_size ? '`size`' : 1; + + // Migrate blocks + $query = "INSERT INTO `consultation_blocks` ( + `block_id`, `teacher_id`, `start`, `end`, + `room`, `calendar_events`, `note`, `size`, + `mkdate`, `chdate` + ) VALUES ( + NULL, :teacher_id, :start, :end, + :room, :calendar, :note, :size, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + $insert = DBManager::get()->prepare($query); + + $blocks = []; + + $query = "SELECT `id`, `dozent_id`, + `ort`, `in_calendar`, `note_on_schedule`, {$size_col} AS `size`, + `am`, `intervall`, + FROM_UNIXTIME(`start_date`) AS start_date, + FROM_UNIXTIME(`end_date`) AS end_date + FROM `SprechstundenTerminDesc`"; + $statement = DBManager::get()->query($query); + $statement->setFetchMode(PDO::FETCH_ASSOC); + foreach ($statement as $row) { + extract($row); + + $start_date = strtotime($start_date); + $end_date = strtotime($end_date); + + $insert->bindValue(':teacher_id', $dozent_id); + $insert->bindValue(':room', $ort); + $insert->bindValue(':calendar', $in_calendar); + $insert->bindValue(':note', $note_on_schedule); + $insert->bindValue(':size', $size); + + $current = $start_date; + while (date('w', $current) != $am) { + $current = strtotime('+1 day', $current); + } + + $blocks[$id] = []; + while ($current <= $end_date) { + $start = $this->adjustTimestamp($current, $start_date); + $end = $this->adjustTimestamp($current, $end_date); + + $insert->bindValue(':start', $start); + $insert->bindValue(':end', $end); + $insert->execute(); + + $blocks[$id][] = [ + 'start' => $start, + 'end' => $end, + 'id' => DBManager::get()->lastInsertId(), + ]; + + $current = strtotime("+{$intervall} weeks", $current); + } + } + + // Migrate slots + $query = "INSERT INTO `consultation_slots` ( + `slot_id`, `block_id`, + `start_time`, + `end_time`, + `note`, `teacher_event_id`, + `mkdate`, `chdate` + ) VALUES ( + :slot_id, :block_id, :start, :end, :note, :teacher_event_id, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + $insert = DBManager::get()->prepare($query); + + $query = "SELECT szs.`id`, st.`desc_id`, + szs.`position`, std.`dauer`, + FROM_UNIXTIME(st.`start_time`) AS start_time, + FROM_UNIXTIME(st.`end_time`) AS end_time, + IFNULL(szs.`note_on_schedule`, '') AS `note`, + sa.`event_id_dozent` + FROM `SprechstundenTermin` AS st + JOIN `SprechstundenZeitSlot` AS szs ON szs.`termin_id` = st.`id` + JOIN `SprechstundenTerminDesc` AS std ON st.`desc_id` = std.`id` + LEFT JOIN `SprechstundenAnmeldung` AS sa ON sa.`zeitslot_id` = szs.`id` + GROUP BY szs.`id`"; + $statement = DBManager::get()->query($query); + $statement->setFetchMode(PDO::FETCH_ASSOC); + + + $used = []; + foreach ($statement as $row) { + extract($row); + + // get block id + if (!isset($blocks[$desc_id])) { + continue; + } + + $duration = $dauer * ($position - 1); + $start = strtotime("+{$duration} minutes", strtotime($start_time)); + $end = strtotime("+{$dauer} minutes", $start); + + $block_id = false; + foreach ($blocks[$desc_id] as $block) { + if ($start <= $block['end'] && $end >= $block['start']) { + $block_id = $block['id']; + break; + } + } + + if (!in_array($block_id, $used)) { + $used[] = $block_id; + } + + $insert->bindValue(':slot_id', $id); + $insert->bindValue(':block_id', $block_id); + $insert->bindValue(':start', $start); + $insert->bindValue(':end', $end); + $insert->bindValue(':note', $note); + $insert->bindValue(':teacher_event_id', $event_id_dozent); + $insert->execute(); + } + + // Remove empty blocks + $query = "DELETE FROM `consultation_blocks` + WHERE `block_id` NOT IN (?)"; + DBManager::get()->execute($query, [$used ?: '']); + + // Migrate bookings + $query = "INSERT INTO `consultation_bookings` ( + `booking_id`, `slot_id`, `user_id`, + `reason`, `student_event_id`, + `mkdate`, `chdate` + ) + SELECT `id`, `zeitslot_id`, `user_id`, + `grund`, `event_id_student`, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + FROM `SprechstundenAnmeldung`"; + DBManager::get()->exec($query); + + // Activate consultations if plugin was enabled + $query = "SELECT `enabled` = 'yes' + FROM `plugins` + WHERE `pluginclassname` = 'SprechstundenPlugin'"; + $enabled = (bool) DBManager::get()->query($query)->fetchColumn(); + + if (!$enabled) { + return; + } + + $query = "INSERT INTO `config_values` ( + `field`, `range_id`, `value`, + `mkdate`, `chdate`, `comment` + ) VALUES ( + 'CONSULTATION_ENABLED', 'studip', '1', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '' + )"; + DBManager::get()->exec($query); + + // Deactivate plugin + $query = "UPDATE `plugins` + SET `enabled` = 'no' + WHERE `pluginclassname` = 'SprechstundenPlugin'"; + DBManager::get()->exec($query); + } + + private function adjustTimestamp($current, $other) + { + $time = date('H:i', $other); + $current = strtotime("today {$time}", $current); + return $current; + } +} diff --git a/db/migrations/1.247_step_00330.php b/db/migrations/1.247_step_00330.php new file mode 100644 index 0000000..e80d7f7 --- /dev/null +++ b/db/migrations/1.247_step_00330.php @@ -0,0 +1,24 @@ + + */ +class StEP00330 extends Migration +{ + + function description() + { + return 'Adds a visibility flag to lock semesters'; + } + + public function up() + { + $query = "ALTER TABLE `semester_data` + ADD `visible` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1' AFTER `vorles_ende`"; + DBManager::get()->exec($query); + } + + public function down() + { + DBManager::get()->exec("ALTER TABLE `semester_data` DROP `visible`"); + } +} diff --git a/db/migrations/1.248_step_00331_ilias_interface.php b/db/migrations/1.248_step_00331_ilias_interface.php new file mode 100644 index 0000000..7fb335e --- /dev/null +++ b/db/migrations/1.248_step_00331_ilias_interface.php @@ -0,0 +1,56 @@ + _('ILIAS'), + 'edit_moduletitle' => false, + 'search_active' => true, + 'show_offline' => false, + 'cache' => true + ]; + $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_BASIC_SETTINGS', ?, 'array', 'global', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; + $db->execute($sql, [json_encode($ilias_interface_config)]); + $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_SETTINGS', '[]', 'array', 'global', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; + $db->exec($sql); + $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_ENABLE', '0', 'boolean', 'global', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; + $db->exec($sql); + $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_MODULETITLE', 'ILIAS', 'string', 'course', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; + $db->exec($sql); + $db->exec("ALTER TABLE `auth_extern` DROP PRIMARY KEY"); + $db->exec("ALTER TABLE `auth_extern` ADD PRIMARY KEY (`studip_user_id`, `external_user_system_type`, `external_user_type`)"); + + $db->exec("ALTER TABLE `auth_extern` ADD `external_user_token` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `external_user_password`"); + $db->exec("ALTER TABLE `auth_extern` ADD `external_user_token_valid_until` INT(11) NOT NULL DEFAULT '0' AFTER `external_user_token`"); + + $db->exec("ALTER TABLE `object_user_visits` CHANGE `type` `type` ENUM('vote','documents','forum','literature','schedule','scm','sem','wiki','news','eval','inst','elearning_interface','ilias_interface','participants') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'vote'"); + + // install as core plugin + $sql = "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) + VALUES ('IliasInterfaceModule', 'Ilias-Interface', 'StandardPlugin,SystemPlugin', 'yes', 1)"; + $db->exec($sql); + $sql = "INSERT INTO roles_plugins (roleid, pluginid) SELECT roleid, ? FROM roles WHERE `system` = 'y' AND roleid < 7"; + $db->execute($sql, [$db->lastInsertId()]); + + } + + function down() + { + $db = DBManager::get(); + $db->exec("ALTER TABLE `auth_extern` DROP PRIMARY KEY"); + $db->exec("ALTER TABLE `auth_extern` ADD PRIMARY KEY (`studip_user_id`, `external_user_system_type`)"); + $db->exec("ALTER TABLE `auth_extern` DROP `external_user_token`"); + $db->exec("ALTER TABLE `auth_extern` DROP `external_user_token_valid_until` "); + $db->exec("DELETE FROM `config` WHERE `field` LIKE 'ILIAS_INTERFACE%'"); + $db->exec("DELETE FROM `config_values` WHERE `field` LIKE 'ILIAS_INTERFACE%'"); + $db->exec("DELETE FROM `plugins` WHERE `pluginclassname` = 'IliasInterfaceModule'"); + } +} \ No newline at end of file diff --git a/db/migrations/1.249_lti_consumer.php b/db/migrations/1.249_lti_consumer.php new file mode 100644 index 0000000..2b17fad --- /dev/null +++ b/db/migrations/1.249_lti_consumer.php @@ -0,0 +1,113 @@ +exec($sql); + + $sql = "CREATE TABLE lti_tool ( + id INT(11) NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL DEFAULT '', + launch_url VARCHAR(255) NOT NULL DEFAULT '', + consumer_key VARCHAR(255) NOT NULL DEFAULT '', + consumer_secret VARCHAR(255) NOT NULL DEFAULT '', + custom_parameters TEXT NOT NULL, + allow_custom_url TINYINT(1) NOT NULL DEFAULT 0, + deep_linking TINYINT(1) NOT NULL DEFAULT 0, + send_lis_person TINYINT(1) NOT NULL DEFAULT 0, + mkdate INT(11) NOT NULL DEFAULT 0, + chdate INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (id) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + $db->exec($sql); + + $sql = "CREATE TABLE lti_grade ( + link_id INT(11) NOT NULL DEFAULT 0, + user_id CHAR(32) COLLATE latin1_bin NOT NULL, + score FLOAT NOT NULL DEFAULT 0, + mkdate INT(11) NOT NULL DEFAULT 0, + chdate INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (link_id, user_id) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + $db->exec($sql); + + // install as core plugin + $sql = "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) + VALUES ('LtiToolModule', 'LTI-Tool', 'StandardPlugin,SystemPlugin,PrivacyPlugin', 'yes', 1)"; + $db->exec($sql); + + $sql = "INSERT INTO roles_plugins (roleid, pluginid) + SELECT roleid, ? FROM roles WHERE `system` = 'y'"; + $db->execute($sql, [$db->lastInsertId()]); + + // install config settings + $stmt = $db->prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'LTI_TOOL_TITLE', + 'description' => 'Voreinstellung für den Titel des Reiters "LTI-Tool" im Kurs.', + 'range' => 'course', + 'type' => 'string', + 'value' => 'LTI-Tool' + ]); + + // migrate data from alija plugin + $result = $db->query("SHOW TABLES LIKE 'alija_grade'"); + + if ($result->rowCount() > 0) { + $db->exec("INSERT INTO lti_data + SELECT id, position, course_id, title, description, tool_id, + launch_url, mkdate, chdate, options FROM alija_data"); + $db->exec('INSERT INTO lti_tool SELECT * FROM alija_tool'); + $db->exec('INSERT INTO lti_grade SELECT * FROM alija_grade'); + } + } + + public function down() + { + $db = DBManager::get(); + + $db->exec("DELETE config, config_values FROM config + LEFT JOIN config_values USING (field) + WHERE field = 'LTI_TOOL_TITLE'"); + + $db->exec("DELETE plugins, roles_plugins FROM plugins + LEFT JOIN roles_plugins USING (pluginid) + WHERE pluginclassname = 'LtiToolModule'"); + + $db->exec('DROP table lti_grade, lti_tool, lti_data'); + } +} diff --git a/db/migrations/1.24_another_index_for_ex_termine.php b/db/migrations/1.24_another_index_for_ex_termine.php new file mode 100644 index 0000000..d97f102 --- /dev/null +++ b/db/migrations/1.24_another_index_for_ex_termine.php @@ -0,0 +1,30 @@ +getAttribute(PDO::ATTR_ERRMODE); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + + $db->exec("ALTER TABLE `ex_termine` ADD INDEX `autor_id` ( `autor_id` )"); + + $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); + } + + function down() { + $db = DBManager::get(); + + $mode = $db->getAttribute(PDO::ATTR_ERRMODE); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); + + $db->exec("ALTER TABLE `ex_termine` DROP INDEX `autor_id`"); + + $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); + } +} diff --git a/db/migrations/1.250_disable_archive_search.php b/db/migrations/1.250_disable_archive_search.php new file mode 100644 index 0000000..8d4aed1 --- /dev/null +++ b/db/migrations/1.250_disable_archive_search.php @@ -0,0 +1,34 @@ +prepare('INSERT INTO config (field, value, section, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :section, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'ENABLE_ARCHIVE_SEARCH', + 'section' => 'global', + 'description' => 'Soll es eine Suche in dem alten Archiv geben?', + 'range' => 'global', + 'type' => 'boolean', + 'value' => '0' + ]); + $db->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); //see #9106 + + } + + public function down() + { + DBManager::get()->exec("DELETE config, config_values + FROM config + LEFT JOIN config_values USING (field) + WHERE field = 'ENABLE_ARCHIVE_SEARCH'"); + } +} diff --git a/db/migrations/1.251_log_event_autoincrement.php b/db/migrations/1.251_log_event_autoincrement.php new file mode 100644 index 0000000..a067dac --- /dev/null +++ b/db/migrations/1.251_log_event_autoincrement.php @@ -0,0 +1,36 @@ +execute($query); + + $query = "ALTER TABLE `log_events` + ADD COLUMN `event_id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST"; + DBManager::get()->execute($query); + + $query = "ALTER TABLE `log_events` + MODIFY COLUMN `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->execute($query); + } + + public function down() + { + $query = "ALTER TABLE `log_events` ADD COLUMN `new_id` VARCHAR(32) FIRST"; + DBManager::get()->execute($query); + + $query = "UPDATE `log_events` SET `new_id` = MD5(`event_id`)"; + DBManager::get()->execute($query); + + $query = "ALTER TABLE `log_events` + DROP COLUMN `event_id`, + CHANGE COLUMN `new_id` `event_id` VARCHAR(32) PRIMARY KEY"; + DBManager::get()->execute($query); + } +} diff --git a/db/migrations/1.252_js_assets.php b/db/migrations/1.252_js_assets.php new file mode 100644 index 0000000..bb29cb6 --- /dev/null +++ b/db/migrations/1.252_js_assets.php @@ -0,0 +1,26 @@ +execute($query); + } + + public function down() + { + $query = "DELETE FROM `plugin_assets` + WHERE `type` = 'js'"; + DBManager::get()->execute($query); + + $query = "ALTER TABLE `plugin_assets` + MODIFY COLUMN `type` ENUM('css') CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL"; + DBManager::get()->execute($query); + } +} diff --git a/db/migrations/1.253_adjust_token_table.php b/db/migrations/1.253_adjust_token_table.php new file mode 100644 index 0000000..53b5374 --- /dev/null +++ b/db/migrations/1.253_adjust_token_table.php @@ -0,0 +1,34 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `user_token` + DROP PRIMARY KEY, + ADD INDEX `index_token` (`token`), + ADD INDEX `index_user_id` (`user_id`), + MODIFY COLUMN `token` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL AFTER `user_id`, + MODIFY COLUMN `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + MODIFY COLUMN `expiration` INT(11) NOT NULL, + ADD PRIMARY KEY (`user_id`, `token`, `expiration`)"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.254_hash_opengraph_table.php b/db/migrations/1.254_hash_opengraph_table.php new file mode 100644 index 0000000..8862146 --- /dev/null +++ b/db/migrations/1.254_hash_opengraph_table.php @@ -0,0 +1,26 @@ +exec($query); + + $query = "UPDATE `opengraphdata` SET `hash` = MD5(`url`)"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `opengraphdata` + DROP INDEX `url`, + ADD UNIQUE KEY `hash` (`hash`)"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `opengraphdata` + DROP COLUMN `hash`, + ADD UNIQUE INDEX `url` (`url`(512))"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.255_tic9368_datafield_for_institution.php b/db/migrations/1.255_tic9368_datafield_for_institution.php new file mode 100644 index 0000000..ca54e75 --- /dev/null +++ b/db/migrations/1.255_tic9368_datafield_for_institution.php @@ -0,0 +1,21 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `datafields` DROP COLUMN `institut_id`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.256_tic9543_update_help_content.php b/db/migrations/1.256_tic9543_update_help_content.php new file mode 100644 index 0000000..8184c72 --- /dev/null +++ b/db/migrations/1.256_tic9543_update_help_content.php @@ -0,0 +1,102 @@ +exec("UPDATE `help_content` SET `content` = 'You can find university ressources like rooms, buildings etc. with the ressource search engine.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'e206a4257e31a0f32ac516cefb8e8331'"); + $db->exec("UPDATE `help_content` SET `content` = 'In the default substitution settings, lecturers can specify a default substitution that can manage and change all of the lecturer''s courses.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '85c000e33732c5596d198776cb884860'"); + $db->exec("UPDATE `help_content` SET `content` = 'The overview contains course-related short and detailed information, announcements, dates and surveys.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'd97eff1196f6aed8e94f7c5096ebd2a9'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can add further features to the course.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '852991dc733639dd2df05fb627abf3db'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here, individual content can be activated or deactivated. Active contents add new features to your profile or settings. These will usually appear as new tabs in the menu. If features are not required, they can be deactivated here. The corresponding menu items will then be hidden.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b5fabb1e5aed7ff8520314e9a86c5c87'"); + $db->exec("UPDATE `help_content` SET `content` = 'With the user search, users can be found as long as their privacy settings do not prevent this. The search can be limited to certain courses or institutions.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'ebcc460880b8a63af3f6e7eade97db78'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can find an overview of the dates that have been booked by students.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0ad754cc62d1e86e97c1a28dd68ac40c'"); + $db->exec("UPDATE `help_content` SET `content` = 'The forum is a text-based, time- and location-independent platform for the exchange of questions, opinions and experiences. Contributions can be subscribed to, exported, marked as favourites and edited. The navigation on the left allows you to select different views (e.g. New posts since last login).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '80286432bf17df20e5f11f86b421b0a7'"); + $db->exec("UPDATE `help_content` SET `content` = 'You can use the fields of study-feature to assign a course to a field of study. Editing can be locked if data is transferred from other systems (for example, LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'eec46c5d8ea5523d959a8c334455c2ef'"); + $db->exec("UPDATE `help_content` SET `content` = 'With access authorisation (enrolment procedure), access to a course can be regulated e.g. by means of passwords, time control and participant restrictions.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '4e14c94cda99e2ef6462f7fef06d9c91'"); + $db->exec("UPDATE `help_content` SET `content` = 'The start page opens after logging in and can be adjusted to your personal needs by using widgets.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b05b27450e363c38c6b4620b902b3496'"); + $db->exec("UPDATE `help_content` SET `content` = 'Detailed information about the course, e.g. the course number, assignments, lecturers, tutors, etc. is displayed. In the detail information, you can enter a course under Actions.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '357bbf06015b2738aae15837f581a07d'"); + $db->exec("UPDATE `help_content` SET `content` = 'In the notification settings you can select which changes within a course you want to be notified for.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '43df8e33145c25eb6d941e4e845ada24'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can add members to a study group and send messages to them.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b3bd33cb0babbb0cc51a4f429d15d438'"); + $db->exec("UPDATE `help_content` SET `content` = 'This page shows the institutions that the user is assigned to.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '438c4456f85afec29fd9f47c111136c1'"); + $db->exec("UPDATE `help_content` SET `content` = 'View of the institutions assigned to the Stud.IP user.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'd04ca1f9e867ee295a3025dac7ce9c7b'"); + $db->exec("UPDATE `help_content` SET `content` = 'This page offers the possibility to enter Stud.IP users in your own address book and to list all contacts already in the address book.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '27c4d9837cfb1a9a40c079e16daac902'"); + $db->exec("UPDATE `help_content` SET `content` = 'Individual user data e.g. email address, can be changed on this page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'fe23b56f4d691c0f5e2f872e37ce38b5'"); + $db->exec("UPDATE `help_content` SET `content` = 'The evaluation function can be used to create surveys with multiple-choice, and free text questions for courses, study groups, your own profile or institutions. Other people''s public templates can also be used. All future, current and completed evaluations are displayed.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '5475d65b07fdaf5f234bf6eed3d5e4a9'"); + $db->exec("UPDATE `help_content` SET `content` = 'The schedule shows dates, topics and rooms of the course. Individual dates can be edited, for example, topics can be added to dates.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8c3067596811d3c6857d253299e01f6f'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can edit reference lists and make them visible in a course (click on the \"eye\").', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'fa4bf491690645a5f12556f77e51233c'"); + $db->exec("UPDATE `help_content` SET `content` = 'Possibility of providing lecture recordings and podcasts for students of the course (by linking to the files on the media server).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7465a4aeedb6a320d3455cf9ad0bebd0'"); + $db->exec("UPDATE `help_content` SET `content` = 'The timetable consists of courses you have subscribed to, which can be shown and hidden as well as adjusted in display size and form.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '440e50f7fcc825368aa9026273d2cd0d'"); + $db->exec("UPDATE `help_content` SET `content` = 'On this page you can see which contacts are currently online. A message can be sent to these people. Clicking on a person''s name will take you to their profile.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '2f1602394a4e31c2e30706f0a0b3112f'"); + $db->exec("UPDATE `help_content` SET `content` = 'Date allocation can be used to create appointments for consultation hours, exams, etc. in which students can enter themselves.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '5ae72abc0822570bfe839e3ee24f0c81'"); + $db->exec("UPDATE `help_content` SET `content` = 'Archived courses to which the user is assigned appear here. Content can no longer be changed, but stored files can be downloaded as zip files.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0237ea35a203be81e44c979d82ef5ee6'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here the affiliation to user domains can be viewed, but not changed.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0e816d9428a3bc8a73fb0042fb2da540'"); + $db->exec("UPDATE `help_content` SET `content` = 'Titles, descriptions, lecturers, etc. can be changed in the basic data. Editing can be partially blocked if data is transferred from other systems (for example, LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '615c1887f0ee080043f133681ebf0def'"); + $db->exec("UPDATE `help_content` SET `content` = 'Under \"Study details\", additional study programmes and institutions can be added manually if they have not been transferred automatically from an external system (e.g. LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '970ebdf39ad5ca89083a52723c5c35f5'"); + $db->exec("UPDATE `help_content` SET `content` = 'With the institute search, institutions can be found via a free search field or the facility tree.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8a32ca4e602a68307d4ae6ae51fa667e'"); + $db->exec("UPDATE `help_content` SET `content` = 'On this page you can make sure before archiving that the right course(s) have been selected for archiving.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'a2a649de15c8d8473b11fccc731dc80f'"); + $db->exec("UPDATE `help_content` SET `content` = 'Select the desired system and then the learning module/test. Writing permissions determine who can edit the learning module in the future. In the sidebar you will find the option \"Update assignments\" in order to transfer changed contents e.g. in the ILIAS course to Stud.IP.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8b690f942bf0cc0322e5bea0f1b9abed'"); + $db->exec("UPDATE `help_content` SET `content` = 'Various display and notification options can be selected and changed in the general settings.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'c8e789a0efb73f00f00dacf565524c73'"); + $db->exec("UPDATE `help_content` SET `content` = 'With the image uploading feature, the image of a course can be changed, which can help students differentiate between courses on the My Courses page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'abfb5d03de288d02df436f9a8bb96d9d'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here, lecturers can create and display announcements for their courses, institutions, and profile page, with the ability to filter the display.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3318ee99a062079b463e902348ad520e'"); + $db->exec("UPDATE `help_content` SET `content` = 'The group calendar provides an overview of course dates and personalized additional dates for that course.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '38d1a86517eb6cc195b2e921270c3035'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can add and edit dates.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '76195b21d485823fd7ca2fd499131c12'"); + $db->exec("UPDATE `help_content` SET `content` = 'In DoIT!, lecturers have the ability to set different types of tasks, including file uploads, multiple-choice questions, and peer reviewing. The task processing can be limited in time and can be done in groups.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0838a96b5678e2fc26be0ee38ae67619'"); + $db->exec("UPDATE `help_content` SET `content` = 'Blubber is the Stud.IP real-time forum, a mixture of forum and chat. Others can be informed about a post by mentioning them by @username or @''firstname surname'' in the post. Texts can be formatted and supplemented with smileys.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b9586c280a0092f86f9392fe5b5ff2a0'"); + $db->exec("UPDATE `help_content` SET `content` = 'An overview of sent, internal system messages, which can be provided with self-selected keywords (\"tags\") in order to be able to find them more easily later.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'ceb21257092b11dcf6897d5bb3085642'"); + $db->exec("UPDATE `help_content` SET `content` = 'The time/room feature can be used to change the semester, date and room details of the course. Editing can be blocked if data is transferred from other systems (e.g. LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '85c709de75085bd56a739e4e8ac6fcad'"); + $db->exec("UPDATE `help_content` SET `content` = 'The reference page offers teachers the possibility to create reference lists or to import them from reference management programs. These lists can be copied into courses and made visible. Depending on the connection, the actual book inventory of the university can be searched.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '44edb997707d1458cbf8a3f8f316b908'"); + $db->exec("UPDATE `help_content` SET `content` = 'Configuration of the study diary for students and creation of a study diary for lecturers.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '2075fe42f56207fbd153a810188f1beb'"); + $db->exec("UPDATE `help_content` SET `content` = 'With the archive search you can search for courses that have already been archived.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7d40379f54250b550065e062d71e8fd8'"); + $db->exec("UPDATE `help_content` SET `content` = 'The courses page shows all subscribed courses (by default only those of the last two semesters), all subscribed study groups and all institutions to which you have been assigned. The display can be adjusted via colour codes, semester filters, etc.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '91d6f451c3ef8d8352a076773b0a19ee'"); + $db->exec("UPDATE `help_content` SET `content` = 'On this page you can sort contacts into self-defined groups.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '6b331f5cc2176daba82a0cc71aaa576f'"); + $db->exec("UPDATE `help_content` SET `content` = 'The score list sorts the Stud.IP users in descending order according to their score. The number of points increases with the activities in Stud.IP and thus represents the experience of the users with the system. By ticking the box on the left, the own value is made visible to other users in the ranking. By default, your own value is not visible to the public.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '90ffbd715843b02b3961907f81caf208'"); + $db->exec("UPDATE `help_content` SET `content` = 'You can use the administration features to change the properties of the course at a later date. Under Actions a simulation of the student''s view is possible.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0c055cc6ae418a96ff3afa9db13098df'"); + $db->exec("UPDATE `help_content` SET `content` = 'The profile page allows you to change your own user data including profile picture and categories. Similar to Facebook, comments can be left. The lecturer''s profile contains office hours and room details. In addition, the page offers the management of own files.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'e5bff29f7adee43202a2aa8f3f0a6ec7'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can create a new study group. Each Stud.IP user can create study groups and configure them according to their own needs.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'af7573cce1e898054db89a96284866f9'"); + $db->exec("UPDATE `help_content` SET `content` = 'The settings of the messaging system offer the possibility to forward the messages received in Stud.IP to your email address.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3b7a4c04017fef2984ee029610194f26'"); + $db->exec("UPDATE `help_content` SET `content` = 'The schedule settings offer the possibility to be adapted to your own needs.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '260ee12fdc7dccb30eca2cc075ef0096'"); + $db->exec("UPDATE `help_content` SET `content` = 'With the course search you can find courses, study groups etc. in different semesters and according to different search criteria (see \"Show advanced search\" in the sidebar). The current semester is preselected.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'a1e3da35edc9b605f670e9c7f5019888'"); + $db->exec("UPDATE `help_content` SET `content` = 'The study diary supports the autonomous studying process of the students and is managed independently by them. Inquiries to the lecturers regarding work steps are possible, certain data can be released individually.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1ea099717ceb1b401aedcedc89814d9c'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can edit reference lists and make them visible in the course (by clicking on the \"eye\").', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1cb8fd77427ebc092d751eea95454b0a'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here, contact groups or the entire address book can be exported in order to import them into an external program.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '57f1b29d3c1a558f5cc799c1aade7f14'"); + $db->exec("UPDATE `help_content` SET `content` = 'Blubber is a mixed version of forum and chat where participants'' posts are displayed in real time. Others can be informed about a post by mentioning them in the post by @username or @''first name last name''.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1804e526c2f6794b877a4b2096eaa67a'"); + $db->exec("UPDATE `help_content` SET `content` = 'The learning module interface makes it possible to provide study units or tests from external programs such as ILIAS and LON-CAPA in Stud.IP.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0d83ce036f2870f873446230c0118bb7'"); + $db->exec("UPDATE `help_content` SET `content` = 'The list of participants shows a list of the participants of the course. Additional participants can be added, removed, downgraded, promoted or assigned to self-defined groups by lecturers.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3607d6daea679dcd7003e076fdd1660a'"); + $db->exec("UPDATE `help_content` SET `content` = 'In the privacy settings you can set the visibility and discoverability of your own profile.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'f5e59c4fc98e1df7fe29b8e9320853e7'"); + $db->exec("UPDATE `help_content` SET `content` = 'Before archiving you can check on this page that the right course(s) have been selected for archiving.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'a2a649de15c8d8473b11fccc731dc80f'"); + $db->exec("UPDATE `help_content` SET `content` = 'The attendance list shows all course appointments (meeting, lecture, exercise, internship) of the schedule and allows students to be entered by the lecturers in Stud.IP as well as exporting the list to an overview or as a basis for handwritten entries.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8c2fc90bd8175e6d598f895944a8ddc2'"); + $db->exec("UPDATE `help_content` SET `content` = 'Blubber is a mixture of forum and chat. Messages are displayed in the public stream. Other users can be informed about a post by mentioning them by @username or @''firstname surname'' in the post.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '51a0399250de6365619c961ec3669ad3'"); + $db->exec("UPDATE `help_content` SET `content` = 'File management offers the possibility to upload, link to, manage and download files.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'ee91ec0f9085221ada06d171a27d2405'"); + $db->exec("UPDATE `help_content` SET `content` = 'File management provides the ability to upload, manage, and download personal files that are not visible to others.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '51b98d659590e1e37dae5e5e5cc028bb'"); + $db->exec("UPDATE `help_content` SET `content` = 'The learning module interface makes it possible to provide study units from external programs such as ILIAS and LON-CAPA in Stud.IP. A separate user account is created or assigned for each external system. With the appropriate rights, own learning modules can be created.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'bfb70d5f036769d740fb2342b0b58183'"); + $db->exec("UPDATE `help_content` SET `content` = 'This page shows the study groups to which the user is assigned. Study groups are an easy way to collaborate with fellow students, colleagues and others. Each user can create study groups or search for them. The colour coding can be adjusted individually.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '02b4e3ce7b8fe6b3e6a3586d410a51a1'"); + $db->exec("UPDATE `help_content` SET `content` = 'The Wiki enables a common, asynchronous creation and editing of texts. Texts can be formatted and linked so that a branched reference guide is created.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7edc08f2f7b0786ca036f8c448441e07'"); + $db->exec("UPDATE `help_content` SET `content` = 'The message page provides an overview of received, internal system messages, which can be assigned self-selected keywords (\"tags\") to make them easier to find later.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'f966e348174927565b94e606bbcf064f'"); + $db->exec("UPDATE `help_content` SET `content` = 'This page allows the storing of free information, links etc.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'abaa7b076e6923ac43120f3326322af0'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here, appointments can be assigned topics or previously entered topics can be taken over and edited.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1f216fe42d879c3fcbb582d67e9ad5a2'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can enter predefined information about yourself, that should appear on your profile page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '83fd70727605c485a0d8f2c5ef94289b'"); + $db->exec("UPDATE `help_content` SET `content` = 'A custom Blubber stream can be created here. It always consists of a collection of posts from selected courses, contact groups and keywords, which can be further restricted by filtering. The new user-defined stream can be found after clicking on the Save button in the navigation under Global Stream.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7cb7026818c4b90935009d0548300674'"); + $db->exec("UPDATE `help_content` SET `content` = 'By exporting, data about courses and co-workers can be exported into the following formats: RTF, TXT, CSV, PDF, HTML and XML.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7bf322a6c5f13db67e047b7afae83e58'"); + $db->exec("UPDATE `help_content` SET `content` = 'The password of the Stud.IP account can be changed here.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b32cb2c4ec56e925b07a5cb0105a6888'"); + $db->exec("UPDATE `help_content` SET `content` = 'The self-defined groups are displayed here. Messages can be sent to these groups. A click on the orange arrows in front of the group name assigns you to the group.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'f529bca4d1626b43cbb8149feea41a84'"); + $db->exec("UPDATE `help_content` SET `content` = 'The appointment calendar consists of subscribed courses and your own appointments. It can be edited, changed in the display and compared with external programs (e.g. Outlook).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'dddf5fd4406da0d91c9f121fcae607ad'"); + $db->exec("UPDATE `help_content` SET `content` = 'This page shows all study groups that exist in Stud.IP. Study groups are an easy way to collaborate with fellow students, colleagues and others. Each user can create study groups or search for them.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '960d7bafb618853eced1b1b42a7dd412'"); + $db->exec("UPDATE `help_content` SET `content` = 'Groups can be created and managed here. If the self-entry is activated, participants can register themselves and sign themselves out.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'bd5df4fb7b84da79149c96c5f43de46c'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can search for references in catalogues and add them to your list.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b283b58820db358284f4451dfb691678'"); + $db->exec("UPDATE `help_content` SET `content` = 'On this page you can enter self-defined information about yourself, which should appear on the profile page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8ad364363acd415631226d5574d5592a'"); + $db->exec("UPDATE `help_content` SET `content` = 'With the Surveys and Tests function, you can create (time-controlled) surveys or individual multiple/single-choice questions for courses, study groups or the profile.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '42060187921376807f90e52fad5f9822'"); + $db->exec("UPDATE `help_content` SET `content` = 'Here you can upload a profile picture.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '2a389c2472656121a76ca4f3b0e137d4'"); + $db->exec("UPDATE `help_content` SET `content` = 'RSS feeds, i.e. news streams from external websites, can be integrated on the start page. The more feeds you include, the longer it takes to load the start page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'bcdedaf1b4bd3b96ef574e8230095b28'"); + $db->exec("UPDATE `help_content` SET `content` = 'The name, function and access restriction of the study group can be edited here.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3d040e95a8c29e733a8d5439ee9f5b59'"); + } + + public function down() + { + } +} diff --git a/db/migrations/1.257_tic9544_add_external_id_semester.php b/db/migrations/1.257_tic9544_add_external_id_semester.php new file mode 100644 index 0000000..e20d03a --- /dev/null +++ b/db/migrations/1.257_tic9544_add_external_id_semester.php @@ -0,0 +1,22 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `semester_data` DROP `external_id`"; + DBManager::get()->exec($query); + } +} \ No newline at end of file diff --git a/db/migrations/1.258_tic7443_create_lvgruppen_independently.php b/db/migrations/1.258_tic7443_create_lvgruppen_independently.php new file mode 100644 index 0000000..434a68b --- /dev/null +++ b/db/migrations/1.258_tic7443_create_lvgruppen_independently.php @@ -0,0 +1,34 @@ + 'MVV_ALLOW_CREATE_LVGRUPPEN_INDEPENDENTLY', + 'range' => 'global', + 'type' => 'boolean', + 'description' => 'Soll das Anlegen von LV-Gruppen unabhängig von bestehenden Modulteilen auf der Verwaltungsseite für LV-Gruppen möglich sein?', + 'value' => 0 + ]; + + $stmt = DBManager::get()->prepare(" + REPLACE INTO config + (field, value, `type`, `range`, mkdate, chdate, description) + VALUES + (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + $stmt->execute($config_data); + } + + public function down() + { + DBManager::get()->exec("DELETE FROM config WHERE field = 'MVV_ALLOW_CREATE_LVGRUPPEN_INDEPENDENTLY'"); + DBManager::get()->exec("DELETE FROM config_values WHERE field = 'MVV_ALLOW_CREATE_LVGRUPPEN_INDEPENDENTLY'"); + } +} diff --git a/db/migrations/1.259_migrations_reloaded.php b/db/migrations/1.259_migrations_reloaded.php new file mode 100644 index 0000000..b73de5c --- /dev/null +++ b/db/migrations/1.259_migrations_reloaded.php @@ -0,0 +1,35 @@ +exec($sql); + } + + public function down() + { + $db = DBManager::get(); + + $sql = "DELETE FROM schema_version WHERE branch != '0'"; + $db->exec($sql); + + $sql = 'ALTER TABLE schema_version + DROP PRIMARY KEY, + ADD PRIMARY KEY (domain), + DROP branch'; + $db->exec($sql); + } +} diff --git a/db/migrations/1.25_step_00098_user_domains.php b/db/migrations/1.25_step_00098_user_domains.php new file mode 100644 index 0000000..d02b9e0 --- /dev/null +++ b/db/migrations/1.25_step_00098_user_domains.php @@ -0,0 +1,41 @@ +exec("CREATE TABLE seminar_userdomains ( + seminar_id varchar(32) NOT NULL default '', + userdomain_id varchar(32) NOT NULL default '', + PRIMARY KEY (seminar_id, userdomain_id)) ENGINE=MyISAM"); + $db->exec("CREATE TABLE user_userdomains ( + user_id varchar(32) NOT NULL default '', + userdomain_id varchar(32) NOT NULL default '', + PRIMARY KEY (user_id, userdomain_id)) ENGINE=MyISAM"); + $db->exec("CREATE TABLE userdomains ( + userdomain_id varchar(32) NOT NULL default '', + name varchar(255) NOT NULL default '', + PRIMARY KEY (userdomain_id)) ENGINE=MyISAM"); + + $db->exec("ALTER TABLE auth_user_md5 CHANGE visible + visible enum('global','always','yes','unknown','no','never') + NOT NULL default 'unknown'"); + } + + function down () { + $db = DBManager::get(); + + $db->exec("DROP TABLE seminar_userdomains"); + $db->exec("DROP TABLE user_userdomains"); + $db->exec("DROP TABLE userdomains"); + + $db->exec("ALTER TABLE auth_user_md5 CHANGE visible + visible enum('always','yes','unknown','no','never') + NOT NULL default 'unknown'"); + } +} +?> diff --git a/db/migrations/1.260_tfa.php b/db/migrations/1.260_tfa.php new file mode 100644 index 0000000..fce2713 --- /dev/null +++ b/db/migrations/1.260_tfa.php @@ -0,0 +1,81 @@ +exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `users_tfa_tokens` ( + `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `token` CHAR(6) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`user_id`, `token`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + + // Add config entries (global and user) + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'TFA_MAX_TRIES', '3', 'integer', 'global', + 'Zwei-Faktor-Authentifizierung', 'Maximale Anzahl fehlerhafter Versuche innerhalb eines Zeitraums', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'TFA_MAX_TRIES_TIMESPAN', '300', 'integer', 'global', + 'Zwei-Faktor-Authentifizierung', 'Zeitraum in Sekunden, nach dem fehlerhafte Versuche vergessen werden', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'TFA_PERMS', 'root', 'string', 'global', + 'Zwei-Faktor-Authentifizierung', 'Systemrollen für die die Zwei-Faktor-Authentifizierung aktiviert ist (kommaseparierte Liste, mögliche Werte: autor, tutor, dozent, admin, root)', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "DROP TABLE IF EXISTS `users_tfa`, `users_tfa_tokens`"; + DBManager::get()->exec($query); + + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` IN ( + 'TFA_MAX_TRIES', + 'TFA_MAX_TRIES_TIMESPAN', + 'TFA_PERMS' + )"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.261_gradebook.php b/db/migrations/1.261_gradebook.php new file mode 100644 index 0000000..59c33eb --- /dev/null +++ b/db/migrations/1.261_gradebook.php @@ -0,0 +1,74 @@ + + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + */ +class Gradebook extends Migration +{ + public function description() + { + return 'initial database setup for Gradebook API'; + } + + public function up() + { + $db = DBManager::get(); + + $sql = + "CREATE TABLE `grading_definitions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `course_id` char(32) COLLATE latin1_bin NOT NULL, + `item` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `tool` varchar(64) COLLATE latin1_bin NOT NULL, + `category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `position` int(11) NOT NULL DEFAULT '0', + `weight` float UNSIGNED NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `course_id` (`course_id`), + KEY `tool` (`tool`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + $db->exec($sql); + + $sql = + 'CREATE TABLE `grading_instances` ( + `definition_id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` char(32) COLLATE latin1_bin NOT NULL, + `rawgrade` decimal(6,5) UNSIGNED NOT NULL, + `feedback` varchar(255) COLLATE utf8mb4_unicode_ci, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`definition_id`,`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC'; + $db->exec($sql); + + // install as core plugin + $sql = "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) + VALUES ('GradebookModule', 'Gradebook', 'StandardPlugin,SystemPlugin', 'yes', 1)"; + $db->exec($sql); + + $sql = "INSERT INTO roles_plugins (roleid, pluginid) SELECT roleid, ? FROM roles WHERE `system` = 'y'"; + $db->execute($sql, [$db->lastInsertId()]); + } + + public function down() + { + $db = DBManager::get(); + + $db->exec("DELETE plugins, roles_plugins FROM plugins LEFT JOIN roles_plugins USING(pluginid) + WHERE pluginclassname = 'GradebookModule'"); + + $db->exec('DROP TABLE grading_definitions, grading_instances'); + + SimpleORMap::expireTableScheme(); + } +} diff --git a/db/migrations/1.262_blubbermessenger.php b/db/migrations/1.262_blubbermessenger.php new file mode 100644 index 0000000..24acb5c --- /dev/null +++ b/db/migrations/1.262_blubbermessenger.php @@ -0,0 +1,171 @@ +exec($query); + + $query = "INSERT INTO `blubber_threads` ( + `thread_id`, `context_type`, `context_id`, `user_id`, `external_contact`, `content`, `display_class`, `visible_in_stream`, `chdate`, `mkdate` + ) + SELECT `topic_id`, `context_type`, `Seminar_id`, `user_id`, `external_contact`, `description`, NULL, '1', `chdate`, `mkdate` + FROM blubber + WHERE parent_id = '0'"; + DBManager::get()->exec($query); + + $query = "CREATE TABLE `blubber_comments` ( + `comment_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `thread_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `user_id` CHAR(32) COLLATE latin1_bin NOT NULL DEFAULT '', + `external_contact` TINYINT(1) NOT NULL DEFAULT 0, + `content` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `network` VARCHAR(64) COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `chdate` INT(11) DEFAULT NULL, + `mkdate` INT(11) DEFAULT NULL, + PRIMARY KEY (`comment_id`), + KEY `thread_id` (`thread_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + DBManager::get()->exec($query); + + $query = "INSERT INTO `blubber_comments` ( + `comment_id`, `thread_id`, `user_id`, `external_contact`, `content`, `chdate`, `mkdate` + ) + SELECT `topic_id`, `root_id`, `user_id`, `external_contact`, `description`, `chdate`, `mkdate` + FROM blubber + WHERE parent_id != '0'"; + DBManager::get()->exec($query); + + DBManager::get()->exec("DROP TABLE `blubber`"); + + $query = "ALTER TABLE blubber_mentions + CHANGE `topic_id` `thread_id` CHAR(32) COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + DBManager::get()->exec("DROP TABLE blubber_reshares"); + DBManager::get()->exec("DROP TABLE blubber_streams"); + + // Create config entries + $query = "INSERT INTO `config` + SET `field` = :field, + `value` = :value, + `type` = :type, + `range` = :range, + `section` = :section, + `mkdate` = UNIX_TIMESTAMP(), + `chdate` = UNIX_TIMESTAMP(), + `description` = :description"; + $config_statement = DBManager::get()->prepare($query); + + $config_statement->execute([ + ':field' => 'BLUBBER_GLOBAL_MESSENGER_ACTIVATE', + ':value' => '1', + ':type' => 'boolean', + ':range' => 'global', + ':section' => 'global', + ':description' => 'Ist Blubber unter Community global aktiv? Blubber in Veranstaltungen wird über das Plugin Blubber aktiviert oder deaktiviert.', + ]); + $config_statement->execute([ + ':field' => 'BLUBBER_DEFAULT_THREAD', + ':value' => '1', + ':type' => 'string', + ':range' => 'user', + ':section' => '', + ':description' => 'Dieses ist bei dem globalen Blubber-Messenger der vorausgewählte Blubber.', + ]); + + // activate routes: + require_once $GLOBALS['STUDIP_BASE_PATH'] . '/app/routes/Blubber.php'; + RESTAPI\ConsumerPermissions::get()->activateRouteMap(new RESTAPI\Routes\Blubber()); + + // Blubber to be the primary messenger in courses + $query = "SELECT pluginid + FROM plugins + WHERE pluginclassname = 'CoreForum'"; + $forum_id = DBManager::get()->fetchColumn($query); + + $query = "SELECT id, modules + FROM sem_classes + WHERE forum = 'CoreForum'"; + $select_sem_class = DBManager::get()->query($query); + $sem_classes = $select_sem_class->fetchAll(PDO::FETCH_ASSOC); + + $query = "INSERT IGNORE INTO plugins_activated (pluginid, range_type, range_id, state) + SELECT :forum_id, 'sem', seminare.Seminar_id, '1' + FROM seminare + JOIN sem_types ON seminare.status = sem_types.id + JOIN sem_classes ON sem_types.class = sem_classes.id + JOIN forum_entries ON forum_entries.seminar_id = seminare.Seminar_id + WHERE sem_classes.id = :sem_class + GROUP BY seminare.Seminar_id + HAVING COUNT(*) > 1"; + $activate_forum_for_courses = DBManager::get()->prepare($query); + + $query = "UPDATE sem_classes + SET modules = :modules, + forum = 'Blubber' + WHERE id = :id"; + $update = DBManager::get()->prepare($query); + + foreach ($sem_classes as $sem_class) { + $modules = json_decode($sem_class['modules'], true); + $forum_was_activated = $modules['CoreForum']['activated']; + + $modules['CoreForum']['activated'] = 0; + $modules['Blubber']['activated'] = 1; + + $update->execute([ + 'id' => $sem_class['id'], + 'modules' => json_encode($modules), + ]); + if ($forum_was_activated) { + // activate old forum in old courses that have more than one posting: + $activate_forum_for_courses->execute([ + 'forum_id' => $forum_id, + 'sem_class' => $sem_class['id'], + ]); + } + } + + // delete old blubber-stream avatars + $blubberstreams_folder = "{$GLOBALS['DYNAMIC_CONTENT_PATH']}/blubberstream"; + foreach (glob("{$blubberstreams_folder}/*") as $file) { + @unlink($blubberstreams_folder . "/" . $file); + } + @rmdir($blubberstreams_folder); + + DBManager::get()->exec(" + DELETE FROM activities + WHERE object_type = 'blubber' + "); + } + + public function down() + { + DBManager::get()->exec("DROP TABLE `blubber_comments`, `blubber_threads`"); + } +} diff --git a/db/migrations/1.263_blubbermessenger_keys.php b/db/migrations/1.263_blubbermessenger_keys.php new file mode 100644 index 0000000..c79e979 --- /dev/null +++ b/db/migrations/1.263_blubbermessenger_keys.php @@ -0,0 +1,22 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `blubber_mentions` + DROP COLUMN `mention_id`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.264_blubbermessenger_search.php b/db/migrations/1.264_blubbermessenger_search.php new file mode 100644 index 0000000..81c78ff --- /dev/null +++ b/db/migrations/1.264_blubbermessenger_search.php @@ -0,0 +1,101 @@ +prepare(" + SELECT * + FROM config + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute(); + $config = $statement->fetch(PDO::FETCH_ASSOC); + $config['value'] = json_decode($config['value'], true); + $config['value']['GlobalSearchBlubber'] = [ + 'order' => 13, + 'active' => true, + 'fulltext' => true + ]; + + $statement = DBManager::get()->prepare(" + UPDATE config + SET `value` = :json + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute([ + 'json' => json_encode($config['value']) + ]); + + $statement = DBManager::get()->prepare(" + SELECT * + FROM config_values + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute(); + $config = $statement->fetch(PDO::FETCH_ASSOC); + if ($config) { + $config['value'] = json_decode($config['value'], true); + $config['value']['GlobalSearchBlubber'] = [ + 'order' => 13, + 'active' => true, + 'fulltext' => true + ]; + + $statement = DBManager::get()->prepare(" + UPDATE config_values + SET `value` = :json + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute([ + 'json' => json_encode($config['value']) + ]); + } + } + + public function down() + { + $statement = DBManager::get()->prepare(" + SELECT * + FROM config_values + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute(); + $config = $statement->fetch(PDO::FETCH_ASSOC); + if ($config) { + $config['value'] = json_decode($config['value'], true); + unset($config['value']['GlobalSearchBlubber']); + $statement = DBManager::get()->prepare(" + UPDATE config_values + SET `value` = :json + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute([ + 'json' => json_encode($config['value']) + ]); + } + + $statement = DBManager::get()->prepare(" + SELECT * + FROM config + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute(); + $config = $statement->fetch(PDO::FETCH_ASSOC); + $config['value'] = json_decode($config['value'], true); + unset($config['value']['GlobalSearchBlubber']); + $statement = DBManager::get()->prepare(" + UPDATE config + SET `value` = :json + WHERE field = 'GLOBALSEARCH_MODULES' + "); + $statement->execute([ + 'json' => json_encode($config['value']) + ]); + + } +} diff --git a/db/migrations/1.265_blubbermessenger_flat.php b/db/migrations/1.265_blubbermessenger_flat.php new file mode 100644 index 0000000..3b4dfeb --- /dev/null +++ b/db/migrations/1.265_blubbermessenger_flat.php @@ -0,0 +1,212 @@ +exec(" + DELETE FROM blubber_comments + WHERE mkdate < 1364601600 + "); //30th March 2013 + + DBManager::get()->exec(" + INSERT IGNORE INTO blubber_threads + SET thread_id = 'global', + context_type = 'public', + context_id = '', + user_id = '', + external_contact = '0', + `content` = NULL, + display_class = 'BlubberGlobalThread', + visible_in_stream = '1', + commentable = '1', + metadata = NULL, + chdate = UNIX_TIMESTAMP(), + mkdate = UNIX_TIMESTAMP() + "); + DBManager::get()->exec(" + UPDATE blubber_comments, blubber_threads + SET blubber_comments.thread_id = 'global' + WHERE blubber_comments.thread_id = blubber_threads.thread_id + AND blubber_threads.context_type = 'public' + "); + DBManager::get()->exec(" + INSERT IGNORE INTO blubber_comments (comment_id, thread_id, user_id, external_contact, `content`, network, chdate, mkdate) + SELECT thread_id, 'global', user_id, external_contact, `content`, null, chdate, mkdate + FROM blubber_threads + WHERE context_type = 'public' + AND thread_id != 'global' + "); + DBManager::get()->exec(" + DELETE FROM blubber_threads + WHERE context_type = 'public' + AND thread_id != 'global' + "); + + $select_threads = DBManager::get()->prepare(" + SELECT * + FROM blubber_threads + WHERE context_type = 'course' + AND `content` IS NOT NULL AND `content` != '' + AND display_class IS NULL + "); + $select_threads->execute(); + $insert_comments = DBManager::get()->prepare(" + UPDATE blubber_comments + SET thread_id = :thread_id + WHERE thread_id = :old_thread + "); + $insert_comment = DBManager::get()->prepare(" + INSERT INTO blubber_comments + SET thread_id = :thread_id, + comment_id = :comment_id, + user_id = :user_id, + external_contact = :external_contact, + `content` = :content, + network = NULL, + chdate = :chdate, + mkdate = :mkdate + "); + $delete_thread = DBManager::get()->prepare(" + DELETE FROM blubber_threads + WHERE thread_id = ? + "); + $select_course_main_thread = DBManager::get()->prepare(" + SELECT * + FROM blubber_threads + WHERE (content IS NULL OR content = '') + AND thread_id != :main_thread_id + AND context_id = :course_id + AND context_type = 'course' + AND display_class IS NULL + "); + while ($row = $select_threads->fetch(PDO::FETCH_ASSOC)) { + $course_thread_id = $this->getCourseThreadId($row['context_id']); + + //Alle anderen mit !content löschen + $select_course_main_thread->execute([ + 'main_thread_id' => $course_thread_id, + 'course_id' => $row['context_id'] + ]); + foreach ($select_course_main_thread->fetchAll(PDO::FETCH_ASSOC) as $row2) { + $insert_comments->execute([ + 'thread_id' => $course_thread_id, + 'old_thread' => $row2['thread_id'] + ]); + $delete_thread->execute([ + $row2['thread_id'] + ]); + } + + if ($row['thread_id'] !== $course_thread_id) { + //Alle Kommentare aus diesem Thread in den Main-Thread verschieben: + $insert_comments->execute([ + 'thread_id' => $course_thread_id, + 'old_thread' => $row['thread_id'] + ]); + + if ($row['content']) { + //Und noch einen Startkommentar in den Haupthread packen, wenn der zu löschende Thread noch einen Hauptinhalt hatte: + $insert_comment->execute([ + 'comment_id' => $row['thread_id'], + 'thread_id' => $course_thread_id, + 'user_id' => $row['user_id'], + 'external_contact' => $row['external_contact'], + 'content' => $row['content'], + 'chdate' => $row['chdate'], + 'mkdate' => $row['mkdate'] + ]); + } + + $delete_thread->execute([ + $row['thread_id'] + ]); + } + } + + $select_private_threads = DBManager::get()->prepare(" + SELECT * + FROM blubber_threads + WHERE context_type = 'private' + AND `content` IS NOT NULL AND content != '' + "); + $select_private_threads->execute(); + $clean_thread = DBManager::get()->prepare(" + UPDATE blubber_threads + SET `content` = NULL + WHERE thread_id = ? + "); + while ($row3 = $select_private_threads->fetch(PDO::FETCH_ASSOC)) { + $insert_comment->execute([ + 'comment_id' => md5($row3['thread_id']."_ersterkommentar"), + 'thread_id' => $row3['thread_id'], + 'user_id' => $row3['user_id'], + 'external_contact' => $row3['external_contact'], + 'content' => $row3['content'], + 'chdate' => $row3['chdate'], + 'mkdate' => $row3['mkdate'] + ]); + $clean_thread->execute([$row3['thread_id']]); + } + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `blubber_threads_unfollow` ( + `thread_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` int(11) DEFAULT NULL, + PRIMARY KEY (`thread_id`,`user_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + "); + + // activate routes: + require_once $GLOBALS['STUDIP_BASE_PATH'] . '/app/routes/Blubber.php'; + RESTAPI\ConsumerPermissions::get()->activateRouteMap(new RESTAPI\Routes\Blubber()); + } + + protected function getCourseThreadId($course_id) + { + $select = DBManager::get()->prepare(" + SELECT * + FROM blubber_threads + WHERE context_type = 'course' + AND context_id = ? + AND display_class IS NULL + AND (`content` IS NULL OR `content` = '') + "); + $select->execute([$course_id]); + $thread_id = $select->fetch(PDO::FETCH_COLUMN, 0); + if (!$thread_id) { + $thread_id = md5(uniqid($course_id)); + $insert = DBManager::get()->prepare(" + INSERT IGNORE INTO blubber_threads + SET thread_id = :thread_id, + context_type = 'course', + context_id = :course_id, + user_id = '', + external_contact = '0', + `content` = NULL, + display_class = NULL, + visible_in_stream = '1', + commentable = '1', + chdate = UNIX_TIMESTAMP(), + mkdate = UNIX_TIMESTAMP() + "); + $insert->execute([ + 'thread_id' => $thread_id, + 'course_id' => $course_id + ]); + } + return $thread_id; + } + + public function down() + { + DBManager::exec(" + DROP TABLE `blubber_threads_unfollow`; + "); + } +} diff --git a/db/migrations/1.266_consultations_option_exclude_expired.php b/db/migrations/1.266_consultations_option_exclude_expired.php new file mode 100644 index 0000000..35bd57e --- /dev/null +++ b/db/migrations/1.266_consultations_option_exclude_expired.php @@ -0,0 +1,31 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'CONSULTATION_EXCLUDE_EXPIRED'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.267_jsonapi_dangerous_routes_config.php b/db/migrations/1.267_jsonapi_dangerous_routes_config.php new file mode 100644 index 0000000..87c23f9 --- /dev/null +++ b/db/migrations/1.267_jsonapi_dangerous_routes_config.php @@ -0,0 +1,36 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'JSONAPI_DANGEROUS_ROUTES_ALLOWED'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.268_unrestricted_userdomains.php b/db/migrations/1.268_unrestricted_userdomains.php new file mode 100644 index 0000000..eb95503 --- /dev/null +++ b/db/migrations/1.268_unrestricted_userdomains.php @@ -0,0 +1,21 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `userdomains` + DROP COLUMN `restricted_access`, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.269_fix_missing_consultation_events.php b/db/migrations/1.269_fix_missing_consultation_events.php new file mode 100644 index 0000000..1432458 --- /dev/null +++ b/db/migrations/1.269_fix_missing_consultation_events.php @@ -0,0 +1,95 @@ +fetchFirst($query); + + LegacyConsultationSlot::findAndMapMany( + function ($slot) { + // This is wrapped in a try/catch block since we can only assure + // that the LegacyConsultationSlot is used for updating the event itself. + // In the subsequent procedure, the related bookings are stored as well + // which will trigger another update of the event - this time on the + // ConsultationSlot object itself, not on the legacy one. Since this + // has code changes for Stud.IP 5.0 this will fail but we can neglect + // that since the event is already updated. + try { + $slot->updateEvent(); + } catch (Exception $e) { + } + }, + $ids + ); + } +} + +class LegacyConsultationSlot extends ConsultationSlot +{ + /** + * Updates the teacher event that belongs to the slot. This will either be + * set to be unoccupied, occupied by only one user or by a group of user. + */ + public function updateEvent() + { + if (count($this->bookings) === 0 && !$this->block->calendar_events) { + return $this->removeEvent(); + } + + $teacher = User::find($this->block->teacher_id); + if (!$teacher) { + return; + } + + $event = $this->event; + if (!$event) { + $event = $this->createEvent($teacher); + + $this->teacher_event_id = $event->id; + $this->store(); + } + + setTempLanguage($teacher->id); + + if (count($this->bookings) > 0) { + $event->category_intern = 1; + + if (count($this->bookings) === 1) { + $booking = $this->bookings->first(); + + $event->summary = sprintf( + _('Sprechstundentermin mit %s'), + $booking->user->getFullName() + ); + $event->description = $booking->reason; + } else { + $event->summary = sprintf( + _('Sprechstundentermin mit %u Personen'), + count($this->bookings) + ); + $event->description = implode("\n\n----\n\n", $this->bookings->map(function ($booking) { + return "- {$booking->user->getFullName()}:\n{$booking->reason}"; + })); + } + } else { + $event->category_intern = 9; + $event->summary = _('Freier Sprechstundentermin'); + $event->description = _('Dieser Sprechstundentermin ist noch nicht belegt.'); + } + + restoreLanguage(); + + $event->store(); + } +} diff --git a/db/migrations/1.26_step_00146_lock_rules2.php b/db/migrations/1.26_step_00146_lock_rules2.php new file mode 100644 index 0000000..d44f4f7 --- /dev/null +++ b/db/migrations/1.26_step_00146_lock_rules2.php @@ -0,0 +1,45 @@ +exec("ALTER TABLE `lock_rules` ADD `permission` + ENUM( 'tutor', 'dozent', 'admin', 'root' ) + NOT NULL DEFAULT 'dozent' AFTER `lock_id` ;"); + $db->exec(" INSERT IGNORE INTO `config` + ( `config_id` , `parent_id` , `field` , `value` , + `is_default` , `type` , `range` , `section` , + `position` , `mkdate` , `chdate` , `description` , + `comment` , `message_template` ) + VALUES ( + MD5( 'RANGE_TREE_ADMIN_PERM' ) , '', 'RANGE_TREE_ADMIN_PERM', + 'admin', '1', 'string', 'global', '', '0', + UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , + 'mit welchem Status darf die Einrichtungshierarchie bearbeitet werden (admin oder root)', '', '' + ), ( + MD5( 'SEM_TREE_ADMIN_PERM' ) , '', 'SEM_TREE_ADMIN_PERM', + 'admin', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , + UNIX_TIMESTAMP( ) , 'mit welchem Status darf die Veranstaltungshierarchie bearbeitet werden (admin oder root)', '', '' + ), ( + MD5( 'SEMESTER_ADMINISTRATION_ENABLE' ) , '', 'SEMESTER_ADMINISTRATION_ENABLE', + '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , + UNIX_TIMESTAMP( ) , 'schaltet die Semesterverwaltung ein oder aus', '', '' + ) "); + + } + + function down () { + $db = DBManager::get(); + + $db->exec("ALTER TABLE `lock_rules` DROP `permission`"); + + $db->exec("DELETE FROM config WHERE field = 'RANGE_TREE_ADMIN_PERM'"); + $db->exec("DELETE FROM config WHERE field = 'SEM_TREE_ADMIN_PERM'"); + } +} +?> \ No newline at end of file diff --git a/db/migrations/1.270_step_00332_mvv_overlapping_courses.php b/db/migrations/1.270_step_00332_mvv_overlapping_courses.php new file mode 100644 index 0000000..67cfa79 --- /dev/null +++ b/db/migrations/1.270_step_00332_mvv_overlapping_courses.php @@ -0,0 +1,86 @@ +exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `mvv_ovl_conflicts` ( + `conflict_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `selection_id` int(11) NOT NULL, + `base_abschnitt_id` varchar(32) COLLATE latin1_bin NOT NULL, + `base_modulteil_id` varchar(32) COLLATE latin1_bin NOT NULL, + `base_course_id` varchar(32) COLLATE latin1_bin NOT NULL, + `base_metadate_id` varchar(32) COLLATE latin1_bin NOT NULL, + `comp_abschnitt_id` varchar(32) COLLATE latin1_bin NOT NULL, + `comp_modulteil_id` varchar(32) COLLATE latin1_bin NOT NULL, + `comp_course_id` varchar(32) COLLATE latin1_bin NOT NULL, + `comp_metadate_id` varchar(32) COLLATE latin1_bin NOT NULL, + PRIMARY KEY (`conflict_id`), + KEY `selection_id` (`selection_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + + DBManager::get()->exec($query); + + $query = "CREATE TABLE IF NOT EXISTS `mvv_ovl_excludes` ( + `selection_id` varchar(32) COLLATE latin1_bin NOT NULL, + `course_id` varchar(32) COLLATE latin1_bin NOT NULL, + PRIMARY KEY (`selection_id`,`course_id`), + KEY `course_id` (`course_id`) USING BTREE + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; + + DBManager::get()->exec($query); + + // Add config (2nd select shows only versions inside a multiple course of study) + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'MVV_OVERLAPPING_SHOW_VERSIONS_INSIDE_MULTIPLE_STUDY_COURSES', + '0', 'boolean', 'global', + 'global', 'Zeigt als zweite Auswahl bei Mehrfachstudiengängen nur Versionen der dazugehörigen Teilstudiengänge an.', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + + DBManager::get()->exec($query); + + SimpleORMap::expireTableScheme(); + } + + public function down() + { + $query = "DROP TABLE `mvv_ovl_selections`"; + DBManager::get()->exec($query); + $query = "DROP TABLE `mvv_ovl_conflicts`"; + DBManager::get()->exec($query); + $query = "DROP TABLE `mvv_ovl_excludes`"; + DBManager::get()->exec($query); + $query = "DELETE FROM `config` + WHERE `field` = 'MVV_OVERLAPPING_SHOW_VERSIONS_INSIDE_MULTIPLE_STUDY_COURSES'"; + DBManager::get()->exec($query); + + SimpleORMap::expireTableScheme(); + } +} diff --git a/db/migrations/1.271_jsonapi_cors_origin_config.php b/db/migrations/1.271_jsonapi_cors_origin_config.php new file mode 100644 index 0000000..58a8fe7 --- /dev/null +++ b/db/migrations/1.271_jsonapi_cors_origin_config.php @@ -0,0 +1,35 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'JSONAPI_CORS_ORIGIN'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.272_step_00338_instituteplaning.php b/db/migrations/1.272_step_00338_instituteplaning.php new file mode 100644 index 0000000..b19709a --- /dev/null +++ b/db/migrations/1.272_step_00338_instituteplaning.php @@ -0,0 +1,79 @@ +exec($query); + + $query = "INSERT INTO `datafields` ( + `datafield_id`, `name`, `object_type`, `edit_perms`, `view_perms`, + `priority`, `type`, `typeparam`, `is_required`, `is_userfilter`, + `description`, `system` + ) VALUES ( + '69f6485f3c937766866a03d9d642ecbb', 'zugeordnete Planungsspalte', 'sem', 'admin', 'root', + 0, 'textline', '', 0, 0, + 'Gibt die zugeordnete Planungsspalte im Veranstaltungsplan an.', 0 + ), ( + '41cda2be71fe9efd6e28b853fc0681f3', 'zugeordnete Planungsfarbe', 'sem', 'admin', 'root', + 0, 'textline', '', 0, 0, + 'Zugewiesene Farbe im Veranstaltungsplaner', 0 + )"; + DBManager::get()->exec($query); + + $query = "INSERT IGNORE INTO config ( + `field`, `value`, `type`, `range`, `section`, + `mkdate`, `chdate`, `description` + ) VALUES ( + :field, :value, 'string', 'global', 'modules', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description + )"; + $statement = DBManager::get()->prepare($query); + + $statement->execute([ + ':field' => 'INSTITUTE_COURSE_PLAN_START_HOUR', + ':value' => '08:00', + 'description' => 'The start hour for the default view of the institute course plan.', + ]); + + $statement->execute([ + ':field' => 'INSTITUTE_COURSE_PLAN_END_HOUR', + ':value' => '20:00', + 'description' => 'The end hour for the default view of the institute course plan.', + ]); + } + + public function down() + { + DBManager::get()->exec('DROP TABLE `institute_plan_columns`'); + + $query = "DELETE FROM `datafields` + WHERE `datafield_id` IN ( + '69f6485f3c937766866a03d9d642ecbb', + '41cda2be71fe9efd6e28b853fc0681f3' + )"; + DBManager::get()->exec($query); + + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` IN ( + 'INSTITUTE_COURSE_PLAN_START_HOUR', + 'INSTITUTE_COURSE_PLAN_END_HOUR' + )"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.273_config_for_download_counter_display.php b/db/migrations/1.273_config_for_download_counter_display.php new file mode 100644 index 0000000..f4df9e5 --- /dev/null +++ b/db/migrations/1.273_config_for_download_counter_display.php @@ -0,0 +1,31 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'DISPLAY_DOWNLOAD_COUNTER'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.274_add_enable_free_access_for_courses_only.php b/db/migrations/1.274_add_enable_free_access_for_courses_only.php new file mode 100644 index 0000000..63fe853 --- /dev/null +++ b/db/migrations/1.274_add_enable_free_access_for_courses_only.php @@ -0,0 +1,34 @@ +exec( + "UPDATE `config` SET `type` = 'string', + `description` = '1: courses and institutes with public access are visible without login. courses_only: only courses with public access are visible without login. 0: disable this feature.' + WHERE `field` = 'ENABLE_FREE_ACCESS'" + ); + } + + + public function down() + { + $db = DBManager::get(); + + $db->exec( + "UPDATE `config` SET `type` = 'boolean', + `description` = 'If true, courses with public access are available' + WHERE `field` = 'ENABLE_FREE_ACCESS'" + ); + } + + + public function description() + { + return 'Adds the "courses_only" option for ENABLE_FREE_ACCESS in the configuration.'; + } +} diff --git a/db/migrations/1.275_additional_mvv_tables.php b/db/migrations/1.275_additional_mvv_tables.php new file mode 100644 index 0000000..4175a58 --- /dev/null +++ b/db/migrations/1.275_additional_mvv_tables.php @@ -0,0 +1,295 @@ +exec("CREATE TABLE IF NOT EXISTS `mvv_files` ( + `mvvfile_id` varchar(32) COLLATE latin1_bin NOT NULL, + `year` int(10) DEFAULT NULL, + `type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `category` text COLLATE utf8mb4_unicode_ci, + `tags` text COLLATE utf8mb4_unicode_ci, + `extern_visible` tinyint(1) DEFAULT NULL, + `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`mvvfile_id`) + ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + $db->exec("CREATE TABLE IF NOT EXISTS `mvv_files_filerefs` ( + `mvvfile_id` varchar(32) COLLATE latin1_bin NOT NULL, + `file_language` varchar(32) COLLATE latin1_bin NOT NULL, + `name` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL, + `fileref_id` varchar(32) COLLATE latin1_bin NOT NULL, + `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`mvvfile_id`,`file_language`) + ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + $db->exec("CREATE TABLE IF NOT EXISTS `mvv_files_ranges` ( + `mvvfile_id` VARCHAR(32) COLLATE latin1_bin NOT NULL , + `range_id` VARCHAR(32) COLLATE latin1_bin NOT NULL , + `range_type` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL , + `position` INT(10) NULL DEFAULT NULL , + `author_id` VARCHAR(32) COLLATE latin1_bin NULL DEFAULT NULL , + `editor_id` VARCHAR(32) COLLATE latin1_bin NULL DEFAULT NULL , + `mkdate` INT(11) NOT NULL , + `chdate` INT(11) NOT NULL , + PRIMARY KEY (`mvvfile_id`, `range_id`)) + ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + $db->exec("CREATE TABLE IF NOT EXISTS `mvv_contacts` ( + `contact_id` varchar(32) COLLATE latin1_bin NOT NULL, + `contact_status` enum('intern','extern','institution') COLLATE latin1_bin NOT NULL, + `alt_mail` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`contact_id`), + KEY `contact_status` (`contact_status`)) + ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + $db->exec("CREATE TABLE IF NOT EXISTS `mvv_extern_contacts` ( + `extern_contact_id` VARCHAR(32) COLLATE latin1_bin NOT NULL, + `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `vorname` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `homepage` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `mail` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `tel` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `author_id` VARCHAR(32) COLLATE latin1_bin DEFAULT NULL, + `editor_id` VARCHAR(32) COLLATE latin1_bin DEFAULT NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + PRIMARY KEY (`extern_contact_id`)) + ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + $db->exec("CREATE TABLE IF NOT EXISTS `mvv_contacts_ranges` ( + `contact_range_id` varchar(32) COLLATE latin1_bin NOT NULL, + `contact_id` varchar(32) COLLATE latin1_bin NOT NULL, + `range_id` varchar(32) COLLATE latin1_bin NOT NULL, + `range_type` enum('Modul','Studiengang','StudiengangTeil') COLLATE latin1_bin NOT NULL, + `type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `category` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `position` int(10) DEFAULT NULL, + `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`contact_range_id`), + KEY `range_id` (`range_id`), + KEY `range_type` (`range_type`), + KEY `type` (`type`), + KEY `category_range` (`category`,`range_id`), + KEY `contact_id` (`contact_id`,`range_id`,`category`) USING BTREE + ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + + //Merge old mvv_dokument + foreach ($db->query("SELECT * FROM `mvv_dokument`") as $old_doc) { + $fileref_id = md5('FileRef'. $old_doc['dokument_id']); + $folder_id = md5('Folder'. $old_doc['dokument_id']); + $file_id = md5('File'. $old_doc['dokument_id']); + $mvvfile_id = md5('MvvFile'. $old_doc['dokument_id']); + $db->execute("INSERT IGNORE INTO `mvv_files` (`mvvfile_id`, `year`, `type`, `category`, `tags`, `extern_visible`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, NULL, NULL, NULL, NULL , 1, ?, ?, ?, ?)", + [$mvvfile_id, $old_doc['author_id'], $old_doc['editor_id'], $old_doc['mkdate'], $old_doc['chdate']]); + $db->execute("INSERT IGNORE INTO `mvv_files_filerefs` (`mvvfile_id`, `file_language`, `name`, `fileref_id`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", + [$mvvfile_id, 'DE', $old_doc['linktext'], $fileref_id, $old_doc['author_id'], $old_doc['editor_id'], $old_doc['mkdate'], $old_doc['chdate']]); + $db->execute("INSERT IGNORE INTO `file_urls` (`file_id`, `url`, `access_type`) VALUES (?, ?, 'proxy')", [$file_id, $old_doc['url']]); + $db->execute("INSERT IGNORE INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) + VALUES (?, ?, NULL, ?, ?, 'MVVFolder', ?, NULL, ?, ?, ?)", + [$folder_id, $old_doc['author_id'], $mvvfile_id, 'mvv', $old_doc['name'], $old_doc['linktext'], $old_doc['mkdate'], $old_doc['chdate']]); + $db->execute("INSERT IGNORE INTO `file_refs` (`id`, `file_id`, `folder_id`, `description`, `user_id`, `name`, `mkdate`, `chdate`) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)", + [$fileref_id, $file_id, $folder_id, $old_doc['beschreibung'], $old_doc['author_id'], $old_doc['name'], $old_doc['mkdate'], $old_doc['chdate']]); + } + + //Merge old mvv_dokument_zuord + foreach ($db->query("SELECT * FROM `mvv_dokument_zuord`") as $old_docrange) { + $mvvfile_id = md5('MvvFile'. $old_docrange['dokument_id']); + $db->execute("INSERT IGNORE INTO `mvv_files_ranges` (`mvvfile_id`, `range_id`, `range_type`, `position`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", + [$mvvfile_id, $old_docrange['range_id'], $old_docrange['object_type'], $old_docrange['position'], $old_docrange['author_id'], $old_docrange['editor_id'], $old_docrange['mkdate'], $old_docrange['chdate']]); + } + $db->exec('DROP TABLE `mvv_dokument`'); + $db->exec('DROP TABLE `mvv_dokument_zuord`'); + + //Merge old mvv_modul_user + foreach ($db->query("SELECT * FROM `mvv_modul_user`") as $old_modul_user) { + $contact_range_id = md5('MvvContactRange' . $old_modul_user['user_id'] . $old_modul_user['modul_id']); + $db->execute("INSERT IGNORE INTO `mvv_contacts` (`contact_id`, `contact_status`, `alt_mail`, + `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ? ,?)", + [ + $old_modul_user['user_id'], 'intern', '', $old_modul_user['author_id'], + $old_modul_user['editor_id'], $old_modul_user['mkdate'], $old_modul_user['chdate'] + ]); + $db->execute("INSERT IGNORE INTO `mvv_contacts_ranges` (`contact_range_id`, `range_id`, `contact_id`, `range_type`, `type`, `category`, `position`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + [$contact_range_id, $old_modul_user['modul_id'], $old_modul_user['user_id'], 'Modul', '', + $old_modul_user['gruppe'], $old_modul_user['position'], $old_modul_user['author_id'], + $old_modul_user['editor_id'], $old_modul_user['mkdate'], $old_modul_user['chdate']]); + } + $db->exec('DROP TABLE `mvv_modul_user`'); + + // Merge old Fachberater + foreach ($db->query("SELECT * FROM `mvv_fachberater`") as $old_fachberater) { + $contact_range_id = md5('MvvContactRange' . $old_fachberater['user_id'] . $old_fachberater['stgteil_id']); + $db->execute("INSERT IGNORE INTO `mvv_contacts` (`contact_id`, `contact_status`, `alt_mail`, + `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ? ,?)", + [ + $old_fachberater['user_id'], 'intern', '', $old_fachberater['author_id'], + $old_fachberater['editor_id'], $old_fachberater['mkdate'], $old_fachberater['chdate'] + ]); + $db->execute("INSERT IGNORE INTO `mvv_contacts_ranges` (`contact_range_id`, `range_id`, `contact_id`, `range_type`, `type`, `category`, `position`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + [$contact_range_id, $old_fachberater['stgteil_id'], $old_fachberater['user_id'], 'StudiengangTeil', '', + 'fachberater', $old_fachberater['position'], $old_fachberater['author_id'], + $old_fachberater['editor_id'], $old_fachberater['mkdate'], $old_fachberater['chdate']]); + } + $db->exec('DROP TABLE `mvv_fachberater`'); + + // datafields for study courses + $db->exec("ALTER TABLE `datafields` + CHANGE `object_type` `object_type` + ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata', + 'moduldeskriptor','modulteildeskriptor','studycourse') NULL DEFAULT NULL"); + + // switch to enable/disable studycourse info page + $db->exec( + "INSERT INTO `config` (`field`, `value`, `type`, `range`, + `section`, `mkdate`, `chdate`, `description`) + VALUES + ('ENABLE_STUDYCOURSE_INFO_PAGE', '0', 'boolean', 'global', + 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Shows an icon to open a dialog with studycourse informations in module search if true.')" + ); + + // new fields for study courses + $db->exec("ALTER TABLE `mvv_studiengang` + ADD `enroll` VARCHAR(50) NULL DEFAULT NULL AFTER `schlagworte`"); + $db->exec("ALTER TABLE `mvv_studiengang` + ADD `abschlussgrad` VARCHAR(32) NULL DEFAULT NULL AFTER `schlagworte`"); + $db->exec("ALTER TABLE `mvv_studiengang` + ADD `studienplaetze` INT UNSIGNED NULL DEFAULT NULL AFTER `schlagworte`"); + $db->exec("ALTER TABLE `mvv_studiengang` + ADD `studienzeit` TINYINT UNSIGNED NULL DEFAULT NULL AFTER `schlagworte`"); + + // postgraduate study courses (Aufbaustudiengänge) + $db->exec("CREATE TABLE `mvv_aufbaustudiengang` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `grund_stg_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `aufbau_stg_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `typ` VARCHAR(32) COLLATE latin1_bin NOT NULL, + `kommentar` TEXT NULL, + `author_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `editor_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `grund_stg_id` (`grund_stg_id`,`aufbau_stg_id`) + ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + // types of study courses + $db->exec("CREATE TABLE `mvv_studycourse_type` ( + `studiengang_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `type` VARCHAR(32) COLLATE latin1_bin NOT NULL, + `author_id` CHAR(32) COLLATE latin1_bin NULL, + `editor_id` CHAR(32) COLLATE latin1_bin NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + PRIMARY KEY (`studiengang_id`, `type`) + ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + // assigned languages to study course + $db->execute("CREATE TABLE `mvv_studycourse_language` ( + `studiengang_id` char(32) COLLATE latin1_bin NOT NULL, + `lang` varchar(32) COLLATE latin1_bin NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `author_id` char(32) COLLATE latin1_bin DEFAULT NULL, + `editor_id` char(32) COLLATE latin1_bin DEFAULT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`studiengang_id`, `lang`) + ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); + + // add index to speed up filters + $db->execute("ALTER TABLE `mvv_modul_inst` ADD INDEX (`institut_id`)"); + } + + public function down() + { + DBManager::get()->exec("DROP TABLE `mvv_files`, `mvv_files_filerefs`, `mvv_files_ranges`, `mvv_contacts`, `mvv_extern_contacts`"); + DBManager::get()->exec("DROP TABLE `mvv_aufbaustudiengang`, `mvv_studycourse_type`, `mvv_studycourse_language`"); + DBManager::get()->exec("ALTER TABLE `mvv_studiengang` + DROP `studienzeit`, + DROP `studienplaetze`, + DROP `abschlussgrad`, + DROP `enroll`;"); + DBManager::get()->exec("ALTER TABLE `datafields` + CHANGE `object_type` `object_type` + ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata', + 'moduldeskriptor','modulteildeskriptor') NULL DEFAULT NULL"); + DBManager::get()->exec( + "DELETE FROM config WHERE field = 'ENABLE_STUDYCOURSE_INFO_PAGE'" + ); + DBManager::get()->exec( + "CREATE TABLE `mvv_fachberater` ( + `stgteil_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `position` int(11) NOT NULL, + `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`stgteil_id`,`user_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC"); + DBManager::get()->exec( + "CREATE TABLE `mvv_modul_user` ( + `modul_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `gruppe` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `position` int(11) NOT NULL DEFAULT '9999', + `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`modul_id`,`user_id`,`gruppe`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;"); + DBManager::get()->exec( + "CREATE TABLE `mvv_dokument` ( + `dokument_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `url` tinytext COLLATE utf8mb4_unicode_ci NOT NULL, + `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `linktext` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `beschreibung` text COLLATE utf8mb4_unicode_ci, + `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`dokument_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC"); + DBManager::get()->exec( + "CREATE TABLE `mvv_dokument_zuord` ( + `dokument_zuord_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `dokument_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `range_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `object_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `position` int(3) NOT NULL DEFAULT '999', + `kommentar` tinytext COLLATE utf8mb4_unicode_ci, + `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`dokument_zuord_id`), + UNIQUE KEY `dokument_id` (`dokument_id`,`range_id`,`object_type`) USING BTREE, + KEY `range_id_object_type` (`range_id`,`object_type`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC"); + } +} diff --git a/db/migrations/1.276_tic8458_add_upload_description.php b/db/migrations/1.276_tic8458_add_upload_description.php new file mode 100644 index 0000000..5b26b24 --- /dev/null +++ b/db/migrations/1.276_tic8458_add_upload_description.php @@ -0,0 +1,36 @@ +exec( + "INSERT INTO `config` + (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, + `description`) + VALUES + ('ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD', '1', 'boolean', 'global', 'files', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Whether to allow adding a description directly after file upload (true) or not (false). Defaults to true.')" + ); + } + + + public function down() + { + $db = DBManager::get(); + + $db->exec( + "DELETE FROM `config` + WHERE `field` = 'ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD'" + ); + } + + + public function description() + { + return 'Adds the configuration entry ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD to make it possible to enter a file description directly after uploading the file(s).'; + } +} diff --git a/db/migrations/1.277_room_management_migration.php b/db/migrations/1.277_room_management_migration.php new file mode 100644 index 0000000..8fd748b --- /dev/null +++ b/db/migrations/1.277_room_management_migration.php @@ -0,0 +1,2390 @@ + 'Building', + 'Hörsaal' => 'Room', + 'Übungsraum' => 'Room', + 'Gerät' => 'Resource', + ]; + $GLOBALS['RESOURCE_ADMINISTRATION_PERSON_URL'] = 'https://example.org/person/%s'; + $GLOBALS['RESOURCE_MIGRATION_RESOURCE_TREES_TO_BE_DELETED'] = []; + $GLOBALS['RESOURCE_MIGRATION_MIGRATE_COURSE_PERMISSIONS'] = true; + $GLOBALS['RESOURCE_PROPERTIES_TO_BE_DELETED'] = []; + $GLOBALS['RESOURCE_MIGRATION_SPECIALRESOURCESPLUGIN'] = false; + $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MODIFIED'] = [ + 'Adresse' => [ + 'name' => 'address', + 'old_type' => 'text' + ], + 'Audio-Anlage' => [ + 'name' => 'has_loudspeakers', + 'old_type' => 'bool', + 'requestable' => true, + 'searchable' => true + ], + 'Beamer' => [ + 'name' => 'has_projector', + 'old_type' => 'bool', + 'requestable' => true, + 'searchable' => true + ], + 'behindertengerecht' => [ + 'name' => 'accessible', + 'old_type' => 'bool', + 'requestable' => true, + 'searchable' => true + ], + 'Dozentenrechner' => [ + 'name' => 'has_computer', + 'old_type' => 'bool', + 'requestable' => true, + 'searchable' => true + ], + 'Hersteller' => [ + 'name' => 'manufacturer', + 'old_type' => 'select', + 'requestable' => true, + 'searchable' => true + ], + 'Inventarnummer' => [ + 'name' => 'inventory_number', + 'old_type' => 'num', + 'requestable' => false, + 'searchable' => true + ], + 'Seriennummer' => [ + 'name' => 'serial_number', + 'old_type' => 'num', + 'requestable' => false, + 'searchable' => true + ], + 'Sitzplätze' => [ + 'name' => 'seats', + 'old_type' => 'num', + 'requestable' => true, + 'searchable' => true + ], + 'Tageslichtprojektor' => [ + 'name' => 'has_overhead_projector', + 'old_type' => 'bool', + 'requestable' => true, + 'searchable' => true + ], + 'Verdunklung' => [ + 'name' => 'is_dimmable', + 'old_type' => 'bool', + 'requestable' => true, + 'searchable' => true + ], + 'Raumverantwortung' => [ + 'name' => 'responsible_person', + 'display_name' => 'Raumverantwortung', + 'old_type' => 'text', + 'new_type' => 'user', + 'requestable' => false, + 'searchable' => false, + 'info_label' => true + ] + ]; + $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MERGED'] = []; + } + + + //Assign orphaned resources (resources without category_id) + //to a new category: + public function assignOrphanedResources(PDO $db) + { + $orphaned_resources = $db->query( + "SELECT id FROM resources + WHERE (category_id IS NULL) OR (category_id = '') + OR category_id NOT IN (SELECT id from resource_categories);" + )->fetchAll(PDO::FETCH_COLUMN, 0); + + if ($orphaned_resources) { + //Create a resource category for those resources: + + $md5 = md5('OrphanedResourcesCategory' . rand()); + + $db->execute( + "INSERT INTO resource_categories + (id, name, class_name, description, mkdate, chdate) + VALUES + (?, 'Verwaiste Ressourcen', 'Resource', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", + [$md5] + ); + + //Now we assign all orphaned resources to that category: + $db->execute( + "UPDATE resources SET category_id = ? + WHERE (category_id IS NULL) OR (category_id = '')", + [$md5] + ); + } + } + + + public function deleteUnfinishedResources(PDO $db) + { + $db->exec( + "DELETE from resources + WHERE name = 'Neues Objekt';" + ); + } + + + public function migrateBookingRepeatIntervals(PDO $db) + { + //Buchungen unbekannter Räume entfernen + $db->exec("DELETE resource_bookings FROM resource_bookings LEFT JOIN resources ON resources.id=resource_id WHERE resources.id IS NULL"); + + //mehrtägige korrigieren + $db->exec("UPDATE `resource_bookings` SET end=repeat_end WHERE repeat_end > end AND IFNULL(old_rep_interval,0) = 0"); + + + //Get all resource_bookings rows that have repetition intervals set: + $booking_rows = $db->query( + "SELECT * + FROM resource_bookings + WHERE repeat_end > end AND IFNULL(old_rep_interval,0) > 0" + )->fetchAll(); + + $update_stmt = $db->prepare( + "UPDATE resource_bookings + SET repetition_interval = :repetition_interval + WHERE id = :id;" + ); + + foreach ($booking_rows as $row) + { + $date_interval = ''; + if ($row['old_rep_week_of_month']) { + $date_interval = 'P' . $row['old_rep_interval'] . 'M'; + } elseif ($row['old_rep_interval']) { + if ($row['old_rep_month_of_year']) { + $date_interval = 'P' . $row['old_rep_interval'] . 'Y'; + } elseif ($row['old_rep_day_of_month']) { + $date_interval = 'P' . $row['old_rep_interval'] . 'M'; + } elseif ($row['old_rep_day_of_week']) { + $date_interval = 'P' . ($row['old_rep_interval'] * 7) . 'D'; + } else { + $date_interval = 'P' . $row['old_rep_interval'] . 'D'; + } + } + + $update_stmt->execute( + [ + 'id' => $row['id'], + 'repetition_interval' => $date_interval + ] + ); + } + + //Delete the old columns: + $db->exec( + "ALTER TABLE resource_bookings + DROP COLUMN old_rep_interval, + DROP COLUMN old_rep_month_of_year, + DROP COLUMN old_rep_day_of_month, + DROP COLUMN old_rep_week_of_month, + DROP COLUMN old_rep_day_of_week;" + ); + + //set booking_user_id for all bookings made by 'autor' + $db->exec("UPDATE resource_bookings rb INNER JOIN auth_user_md5 aum ON range_id=user_id INNER JOIN resource_permissions rp ON rp.user_id=aum.user_id AND rb.resource_id = rp.resource_id SET booking_user_id = range_id WHERE booking_user_id='' AND rp.perms='autor'"); + } + + + public function migrateCourseBoundPermissions(PDO $db) + { + if ($GLOBALS['RESOURCE_MIGRATION_MIGRATE_COURSE_PERMISSIONS']) { + //Get all permissions where the range_id + //represents a course-ID or an institute-ID: + + $permissions = $db->query( + "SELECT user_id, resource_id, perms, 'course' AS 'range' + FROM resource_permissions + WHERE + user_id IN ( + SELECT seminar_id FROM seminare + ) + UNION + SELECT user_id, resource_id, perms, 'institute' AS 'range' + FROM resource_permissions + WHERE + user_id IN ( + SELECT Institut_id FROM Institute + )" + )->fetchAll(); + + $course_participant_stmt = $db->prepare( + "SELECT user_id + FROM seminar_user + WHERE + Seminar_id = :course_id" + ); + + $institute_participant_stmt = $db->prepare( + "SELECT user_id, inst_perms + FROM user_inst + WHERE + Institut_id = :institute_id" + ); + + $get_user_permission_stmt = $db->prepare( + "SELECT perms + FROM resource_permissions + WHERE user_id = :user_id AND resource_id = :resource_id" + ); + + $update_user_permission_stmt = $db->prepare( + "UPDATE resource_permissions + SET perms = :perms + WHERE user_id = :user_id AND resource_id = :resource_id" + ); + + $create_user_permission_stmt = $db->prepare( + "INSERT INTO resource_permissions + (user_id, resource_id, perms, mkdate, chdate) + VALUES + (:user_id, :resource_id, :perms, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" + ); + $create_specialresources_entry = $db->prepare( + "INSERT INTO specialresourcesplugin_course_resources + (course_id, resource_id, mkdate, chdate) + VALUES + (:course_id, :resource_id, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" + ); + + foreach ($permissions as $permission) { + //Get all participants of the course/institute: + $participants = []; + if ($permission['range'] == 'course') { + $course_participant_stmt->execute( + [ + 'course_id' => $permission['user_id'] + ] + ); + $participants = $course_participant_stmt->fetchAll(); + } elseif ($permission['range'] == 'institute') { + $institute_participant_stmt->execute( + [ + 'institute_id' => $permission['user_id'] + ] + ); + $participants = $institute_participant_stmt->fetchAll(); + } + + foreach ($participants as $participant) { + if (($permission['range'] == 'institute') && + !in_array($participant['inst_perms'], ['autor', 'tutor', 'dozent', 'admin'])) { + //The permission level in the institute is too low. + continue; + } + //Check if a permission exists for that participant: + $get_user_permission_stmt->execute( + [ + 'user_id' => $participant['user_id'], + 'resource_id' => $permission['resource_id'] + ] + ); + $existing_perm = $get_user_permission_stmt->fetch(PDO::FETCH_COLUMN); + + if ($existing_perm) { + if (!in_array($existing_perm, ['autor', 'tutor', 'admin'])) { + //Update the permission and set it to "autor": + $update_user_permission_stmt->execute( + [ + 'user_id' => $participant['user_id'], + 'resource_id' => $permission['resource_id'], + 'perms' => 'autor' + ] + ); + } + } else { + //Create a new permission: Give every participant + //'autor' permissions for the resource + //that was specified in the course permission: + $create_user_permission_stmt->execute( + [ + 'user_id' => $participant['user_id'], + 'resource_id' => $permission['resource_id'], + 'perms' => 'autor' + ] + ); + } + } + + if ($GLOBALS['RESOURCE_MIGRATION_SPECIALRESOURCESPLUGIN']) { + $create_specialresources_entry->execute( + [ + 'course_id' => $permission['user_id'], + 'resource_id' => $permission['resource_id'] + ] + ); + } + } + } + } + + public function migrateOwner() + { + $db = DBManager::get(); + $db->exec("INSERT IGNORE INTO resource_permissions + (user_id, resource_id, perms, mkdate, chdate) + SELECT r.owner_id, r.id, 'admin', r.mkdate, r.chdate + FROM resources r INNER JOIN resource_categories rc + ON r.category_id = rc.id AND class_name='Room' + WHERE EXISTS + (SELECT * FROM auth_user_md5 WHERE owner_id = user_id)"); + $responsible_property_id = + $db->fetchColumn("SELECT property_id FROM resource_property_definitions WHERE name = 'responsible_person'"); + if ($responsible_property_id) { + $db->exec("INSERT IGNORE INTO resource_properties + (resource_id, property_id,state,mkdate,chdate) + SELECT r.id, '$responsible_property_id', r.owner_id, r.mkdate, r.chdate + FROM resources r INNER JOIN resource_categories rc + ON r.category_id = rc.id AND class_name='Room' + WHERE EXISTS + (SELECT * FROM auth_user_md5 WHERE owner_id = user_id)"); + } + $db->exec("ALTER TABLE resources DROP COLUMN owner_id"); + } + + public function deleteOldPermissions(PDO $db) { + //Delete all permissions that aren't permissions of existing users: + $db->exec( + "DELETE FROM resource_permissions + WHERE user_id NOT IN ( + SELECT user_id FROM auth_user_md5 + );" + ); + } + + + public function deleteResources() + { + $resource_trees_to_be_deleted = + $GLOBALS['RESOURCE_MIGRATION_RESOURCE_TREES_TO_BE_DELETED']; + if (count($resource_trees_to_be_deleted)) { + foreach ($resource_trees_to_be_deleted as $resource_id) { + $resource = Resource::find($resource_id); + if ($resource instanceof Resource) { + $resource->delete(); + } + } + } + } + + + public function migrateLocations(PDO $db, $location_cat_id = null) + { + if (!$location_cat_id) { + //This should not happen! + throw new Exception('Internal error!'); + } + + //First we create one Location data set for orphaned buildings: + $orphan_location_stmt = $db->prepare( + "INSERT INTO resources + (id, category_id, name) + VALUES (:id, :category_id, :name);" + ); + + $orphan_location_id = md5('SonstigeGebäudeResourceLocation' . rand()); + + $orphan_location_stmt->execute( + [ + 'id' => $orphan_location_id, + 'category_id' => $location_cat_id, + 'name' => 'Sonstige Gebäude' + ] + ); + + //We must get all IDs of resources which are parents + //of building resources. Such resources and their categories + //are Locations. + //Buildings without a parent are attached to a new location + //which is built for this case. + + $building_resources = $db->query( + "SELECT resources.id as id, parent_id FROM resources + INNER JOIN resource_categories + ON resources.category_id = resource_categories.id + WHERE + resource_categories.class_name = 'Building';" + )->fetchAll(); + + //We have the ID and the parent-ID of all building resources. + //Now we get all categories of the building's parents + //and set their class_name to 'Location'. + //Furthermore we remove the parent's parents since Location + //resources must not have parent resources. + + $get_parent_stmt = $db->prepare( + "SELECT id, category_id FROM resources + WHERE id = :parent_id" + ); + + $update_location_category_stmt = $db->prepare( + "UPDATE resource_categories SET class_name = 'Location' + WHERE id = :category_id;" + ); + + $update_parent_stmt = $db->prepare( + "UPDATE resources SET parent_id = :parent_id + WHERE id = :id;" + ); + + $update_category_stmt = $db->prepare( + "UPDATE resources SET category_id = :category_id + WHERE id = :id;" + ); + + //Ok, now we can look for all buildings and give them a parent_id + //if they don't have one and we can remove their parent's parent_id, + //if they have one. + + foreach ($building_resources as $building) { + if ($building['parent_id']) { + //parent_id is set: get the parent: + $get_parent_stmt->execute( + ['parent_id' => $building['parent_id']] + ); + + $parents = $get_parent_stmt->fetchAll(); + + foreach ($parents as $parent) { + if ($parent['category_id']) { + //Update the parent's category since it is a location: + $update_location_category_stmt->execute( + [ + 'category_id' => $parent['category_id'] + ] + ); + } else { + //Parent does not belong to a category: + //set the category to our orphaned location category: + $update_category_stmt->execute( + [ + 'category_id' => $location_cat_id, + 'id' => $parent['id'] + ] + ); + } + + if ($parent['parent_id']) { + //If the parent's parent_id is set we must delete it: + $update_parent_stmt->execute( + [ + 'parent_id' => '', + 'id' => $parent['id'] + ] + ); + } + } + } else { + //The building has no parent_id: We must add it to our + //orphan building location: + $update_parent_stmt->execute( + [ + 'parent_id' => $orphan_location_id, + 'id' => $building['id'] + ] + ); + } + } + + //Now all buildings should be connected to locations and all locations + //should be without a parent. + } + + + public function migrateBuildings(PDO $db) + { + //We must set the class name to 'Building' for all + //resource categories whose name is like 'gebäude'. + + $db->exec( + "UPDATE resource_categories SET class_name = 'Building' + WHERE name LIKE '%gebäude%';" + ); + + } + + + public function migrateRooms(PDO $db) + { + //Set the category's class name to 'Room' for all categories + //which have a name similar to 'Raum' or 'Saal': + + $db->exec( + "UPDATE resource_categories + SET class_name = 'Room' + WHERE name LIKE '%raum%' OR name LIKE '%saal%';" + ); + + + } + + + public function deleteExistingProperties(PDO $db) + { + $properties_to_be_deleted = $GLOBALS['RESOURCE_PROPERTIES_TO_BE_DELETED']; + if (!count($properties_to_be_deleted)) { + //Nothing to do. + return; + } + + $delete_definition_stmt = $db->prepare( + 'DELETE FROM resource_property_definitions + WHERE property_id IN ( :property_ids )' + ); + $delete_resource_property_stmt = $db->prepare( + 'DELETE FROM resource_properties + WHERE property_id IN ( :property_ids )' + ); + $delete_resource_request_property_stmt = $db->prepare( + 'DELETE FROM resource_request_properties + WHERE property_id IN ( :property_ids )' + ); + + $delete_resource_request_property_stmt->execute( + ['property_ids' => $properties_to_be_deleted] + ); + $delete_resource_property_stmt->execute( + ['property_ids' => $properties_to_be_deleted] + ); + $delete_definition_stmt->execute( + ['property_ids' => $properties_to_be_deleted] + ); + } + + + public function migrateExistingProperties(PDO $db) + { + $this->write( + '# Migrating existing properties.' + ); + + //rename resource properties: + $get_property_stmt = $db->prepare( + "SELECT property_id + FROM resource_property_definitions + WHERE + name = :name AND type = :type;" + ); + + $update_property_stmt = $db->prepare( + "UPDATE resource_property_definitions + SET name = :name, + `system` = 1, + searchable = :searchable, + range_search = :range_search + WHERE property_id = :property_id;" + ); + + $insert_new_prop_stmt = $db->prepare( + "INSERT INTO resource_property_definitions + (`property_id`, `name`, `description`, `type`, `options`, + `info_label`, `display_name`, `searchable`, `range_search`, + `write_permission_level`, `system`, `mkdate`, `chdate`) + VALUES + (:property_id, :name, :description, :type, :options, + :info_label, :display_name, :searchable, :range_search, + :write_permission_level, :system, :mkdate, :chdate);" + ); + + $delete_duplicates_stmt = $db->prepare( + 'DELETE FROM resource_property_definitions + WHERE property_id IN ( :duplicate_ids );' + ); + + $requestable_attr_stmt = $db->prepare( + "UPDATE resource_category_properties + SET requestable = :requestable + WHERE property_id = :property_id;" + ); + + $properties_to_be_modified = $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MODIFIED']; + foreach ($properties_to_be_modified as $old_name => $data) { + //Check if the old property exists: + $get_property_stmt->execute( + [ + 'name' => $old_name, + 'type' => $data['old_type'] + ] + ); + $old_property_ids = $get_property_stmt->fetchAll( + PDO::FETCH_COLUMN, + 0 + ); + if ($data['name'] === 'seats' && !count($old_property_ids)) { + $old_property_ids = $db->fetchFirst( + "SELECT `property_id` + FROM `resource_property_definitions` + WHERE `system` = 2"); + } + + //Check if the new property already exists: + $get_property_stmt->execute( + [ + 'name' => $data['name'], + 'type' => $data['old_type'] + ] + ); + + $final_property_id = null; + $duplicate_ids = []; + + $new_property_id = $get_property_stmt->fetchColumn(); + if ($new_property_id) { + //The new property already exists. We must set all values + //from the old property to the new property. + $final_property_id = $new_property_id; + $duplicate_ids = $old_property_ids; + } + + if (!$final_property_id) { + //The new property doesn't exist yet. We must either + //take one of the old properties and rename it + //or we must create a new property with that name. + if ((count($old_property_ids) > 0) && !$final_property_id) { + $this->write( + sprintf( + 'Property-IDs for "%1$s" = [%2$s]', + $old_name, + implode(', ', $old_property_ids) + ) + ); + if (count($old_property_ids) > 1) { + //Remove the first item of the $old_property_list array, + //store it in $final_property and use the other IDs + //in the duplicates array. + $final_property_id = array_shift($old_property_ids); + $duplicate_ids[] = $old_property_ids; + } else { + //The only property ID is the first item in the + //$old_property_ids array. + $final_property_id = $old_property_ids[0]; + } + $this->write( + sprintf( + 'Renaming property "%1$s" to "%2$s".', + $old_name, + $data['name'] + ) + ); + //Update the property: + $update_property_stmt->execute( + [ + 'name' => $data['name'], + 'searchable' => ($data['searchable'] ? '1' : '0'), + 'range_search' => ($data['range_search'] ? '1' : '0'), + 'property_id' => $final_property_id + ] + ); + } else { + $this->write( + sprintf( + 'No property with the name "%1$s" and the type "%2$s" could be found! Creating a new property.', + $old_name, + $data['old_type'] + ) + ); + //There is no old property defined. We must define one. + $now = time(); + $property_id = md5('RRV2NewProperty' . $data['name'] . rand()); + $this->write( + 'INFO: The property-ID of the new property "' + . $data['name'] . '" is: ' . $property_id + ); + $insert_new_prop_stmt->execute( + [ + 'property_id' => $property_id, + 'name' => $data['name'], + 'description' => ( + $data['description'] + ? $data['description'] + : '' + ), + 'system' => 1, + 'type' => $data['new_type'] ? $data['new_type'] : $data['old_type'], + 'options' => ($data['options'] ? $data['options'] : ''), + 'info_label' => $data['info_label'] ? '1' : '0', + 'display_name' => ( + $data['display_name'] + ? $data['display_name'] + : $data['name'] + ), + 'searchable' => ($data['searchable'] ? '1' : '0'), + 'range_search' => ($data['range_search'] ? '1' : '0'), + 'write_permission_level' => 'admin-global', + 'mkdate' => $now, + 'chdate' => $now + ] + ); + $final_property_id = $property_id; + } + } + + if ($duplicate_ids) { + $this->write( + sprintf( + 'Moving old property values to the new property "%s".', + $data['name'] + ) + ); + //Now we must "redirect" all links to the duplicates + //to the property that is left + //and then remove the duplicates. + + $tables = [ + 'resource_category_properties', + 'resource_properties', + 'resource_request_properties' + ]; + foreach ($tables as $table) { + $update_tables_stmt = $db->prepare( + sprintf( + "UPDATE IGNORE %s + SET property_id = :property_id + WHERE property_id IN ( :duplicate_ids );", + $table + ) + ); + $update_tables_stmt->execute( + [ + 'property_id' => $final_property_id, + 'duplicate_ids' => $duplicate_ids + ] + ); + } + + $this->write( + sprintf( + 'Deleting property values for property-IDs [%s].', + implode(', ', $duplicate_ids) + ) + ); + + //Now we delete the duplicates: + $delete_duplicates_stmt->execute( + [ + 'duplicate_ids' => $duplicate_ids + ] + ); + + //After that we have to delete those property relations + //whose property_id couldn't be set above + //to avoid duplicate primary keys. + $delete_relations_stmt = $db->prepare( + sprintf( + "DELETE FROM %s + WHERE property_id IN ( :duplicate_ids );", + $table + ) + ); + foreach ($tables as $table) { + $delete_relations_stmt->execute( + [ + 'duplicate_ids' => $duplicate_ids + ] + ); + } + } + + //Finally we make the property requestable, if configured: + $requestable_attr_stmt->execute( + [ + 'property_id' => $final_property_id, + 'requestable' => ($data['requestable'] ? '1' : '0') + ] + ); + } + + $this->write( + 'Finished migrating existing properties.' + ); + } + + + public function mergeProperties(PDO $db) + { + $this->write( + '# Merging properties.' + ); + + $get_prop_stmt = $db->prepare( + "SELECT property_id, name FROM resource_property_definitions + WHERE name = :name AND type = :type" + ); + + $insert_prop_stmt = $db->prepare( + "INSERT INTO resource_property_definitions + (`property_id`, `name`, `description`, `type`, `options`, + `info_label`, `display_name`, `searchable`, `range_search`, + `write_permission_level`, `system`, `mkdate`, `chdate`) + VALUES + (:property_id, :name, :description, :type, :options, + :info_label, :display_name, :searchable, :range_search, + :write_permission_level, :system, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" + ); + + $get_property_values_stmt = $db->prepare( + "SELECT property_id, resource_id, state FROM resource_properties + WHERE property_id = :property_id;" + ); + + $insert_new_value_stmt = $db->prepare( + "INSERT IGNORE INTO resource_properties + (property_id, resource_id, state) + VALUES + (:property_id, :resource_id, :state);" + ); + + $get_category_id_stmt = $db->prepare( + "SELECT DISTINCT category_id FROM resource_category_properties + WHERE property_id IN ( :property_ids );" + ); + + $prop_cat_assign_stmt = $db->prepare( + "INSERT INTO resource_category_properties + (`category_id`, `property_id`, `requestable`, `protected`, + `system`, `form_text`, `mkdate`, `chdate`) + VALUES + (:category_id, :property_id, :requestable, :protected, + :system, :form_text, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()) + ON DUPLICATE KEY UPDATE + `requestable` = :requestable, + `protected` = :protected, + `system` = :system, + `form_text` = :form_text;" + ); + + $delete_old_prop_stmt = $db->prepare( + "DELETE FROM resource_property_definitions + WHERE property_id IN ( :property_ids );" + ); + + $delete_resource_request_property_values_stmt = $db->prepare( + "DELETE FROM resource_request_properties + WHERE property_id IN ( :property_ids );" + ); + + $delete_resource_property_values_stmt = $db->prepare( + "DELETE FROM resource_properties + WHERE property_id IN ( :property_ids );" + ); + + $properties_to_be_merged = $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MERGED']; + foreach ($properties_to_be_merged as $merged_prop) { + $get_prop_stmt->execute( + [ + 'name' => $merged_prop['name'], + 'type' => $merged_prop['type'] + ] + ); + + $merged_property_id = $get_prop_stmt->fetchColumn(); + + if (!$merged_property_id) { + $this->write( + sprintf( + 'Creating new property from the type "%1$s", named "%2$s"!', + $merged_prop['type'], + $merged_prop['name'] + ) + ); + + //Create a new property: + $merged_property_id = md5( + 'RRV2NewMergedProperty' + . $merged_prop['name'] . rand() + ); + + $this->write( + 'INFO: The property-ID of the new property "' + . $merged_prop['name'] . '" is: ' . $merged_property_id + ); + $insert_prop_stmt->execute( + [ + 'property_id' => $merged_property_id, + 'name' => $merged_prop['name'], + 'description' => ( + $merged_prop['description'] + ? $merged_prop['description'] + : '' + ), + 'type' => $merged_prop['type'], + 'options' => ( + $merged_prop['options'] + ? $merged_prop['options'] + : '' + ), + 'info_label' => 0, + 'display_name' => ( + $merged_prop['display_name'] + ? $merged_prop['display_name'] + : $merged_prop['name'] + ), + 'searchable' => ($merged_prop['searchable'] ? '1' : '0'), + 'range_search' => ($merged_prop['range_search'] ? '1' : '0'), + 'write_permission_level' => 'admin-global', + 'system' => 1 + ] + ); + } + + //Get the old properties and collect their values: + $old_values = []; + $old_property_ids = []; + foreach ($merged_prop['sources'] as $source_prop) { + //Get the property whose values shall be merged: + $get_prop_stmt->execute( + [ + 'name' => $source_prop['name'], + 'type' => $source_prop['type'] + ] + ); + $old_prop = $get_prop_stmt->fetch(); + if (!$old_prop) { + $this->write( + sprintf( + 'The old property with the name "%1$s" and the type "%2$s" doesn\'t exist!', + $source_prop['name'], + $source_prop['type'] + ) + ); + //The old property doesn't exist. + continue; + } + + $old_property_ids[] = $old_prop['property_id']; + + //Get all property values and convert them: + $get_property_values_stmt->execute( + [ + 'property_id' => $old_prop['property_id'] + ] + ); + + $all_values = $get_property_values_stmt->fetchAll(); + + foreach ($all_values as $value) { + if (!is_array($old_values[$value['resource_id']])) { + $old_values[$value['resource_id']] = []; + } + $old_values[$value['resource_id']][$source_prop['name']] = + $value['state']; + } + } + + //Merge the old property values for each resource: + foreach ($old_values as $resource_id => $o_values) { + $new_value = ''; + if ($merged_prop['value_conversion'] instanceof Closure) { + //Use a closure for the value conversion: + $new_value = $merged_prop['value_conversion']($o_values); + } else { + //Just append the old values: + foreach ($o_values as $old_value) { + $new_value .= $old_value; + } + } + + $this->write( + sprintf( + 'Merged property value(s) [%1$s] to new value "%2$s."', + implode(', ', $o_values), + $new_value + ) + ); + + //Insert the property value for the new property: + $insert_new_value_stmt->execute( + [ + 'property_id' => $merged_property_id, + 'resource_id' => $resource_id, + 'state' => $new_value + ] + ); + } + + //Assign the new property to all categories, + //resources and resource requests where the old properties + //are assigned to: + $get_category_id_stmt->execute( + ['property_ids' => $old_property_ids] + ); + $relevant_category_ids = $get_category_id_stmt->fetchAll( + PDO::FETCH_COLUMN, + 0 + ); + + if (!$relevant_category_ids) { + //The old properties aren't used anywhere. + //We can just delete them. + $delete_old_prop_stmt->execute( + ['property_ids' => $old_property_ids] + ); + return; + } + + foreach ($relevant_category_ids as $category_id) { + $prop_cat_assign_stmt->execute( + [ + 'category_id' => $category_id, + 'property_id' => $merged_property_id, + 'requestable' => $merged_prop['requestable'] ? '1' : '0', + 'protected' => '0', + 'system' => '1', + 'form_text' => '' + ] + ); + } + + $this->write('Deleting old merged properties!'); + + //We can delete the old properties here: + $delete_old_prop_stmt->execute( + [ + 'property_ids' => $old_property_ids + ] + ); + + //Delete entries from resource requests: + //Since the values have changed, the converted property values + //may be inadequate for the resource request and thereby + //the request property value for the property is deleted. + $delete_resource_request_property_values_stmt->execute( + [ + 'property_ids' => $old_property_ids + ] + ); + + //Delete all resource property values from the old property: + $delete_resource_property_values_stmt->execute( + [ + 'property_ids' => $old_property_ids + ] + ); + } + + $this->write( + 'Finished merging properties.' + ); + } + + + public function removeObsoleteConfigEntries(PDO $db) + { + $entries = [ + 'RESOURCES_ALLOW_CREATE_ROOMS', + 'RESOURCES_ALLOW_CREATE_TOP_LEVEL', + 'RESOURCES_ALLOW_DELETE_REQUESTS', + 'RESOURCES_ALLOW_REQUESTABLE_ROOM_REQUESTS', + 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS', + 'RESOURCES_ENABLE_GROUPING', + 'RESOURCES_ENABLE_ORGA_CLASSIFY', + 'RESOURCES_ENABLE_SEM_SCHEDULE', + 'RESOURCES_ENABLE_VIRTUAL_ROOM_GROUPS', + 'RESOURCES_HIDE_PAST_SINGLE_DATES', + 'RESOURCES_INHERITANCE_PERMS', + 'RESOURCES_INHERITANCE_PERMS_ROOMS', + 'RESOURCES_LOCKING_ACTIVE', + 'RESOURCES_ROOM_REQUEST_DEFAULT_ACTION', + 'RESOURCES_SCHEDULE_EXPLAIN_USER_NAME', + 'RESOURCES_SEARCH_ONLY_REQUESTABLE_PROPERTY', + 'RESOURCES_SHOW_ROOM_NOT_BOOKED_HINT', + 'RESOURCES_ENABLE_ORGA_ADMIN_NOTICE' + ]; + + $stmt = $db->prepare( + 'DELETE FROM config WHERE field IN ( :entries );' + ); + + $stmt->execute(['entries' => $entries]); + } + + + public function createPropertyGroups(PDO $db) + { + $get_group_id_stmt = $db->prepare( + "SELECT id FROM resource_property_groups WHERE name = :name" + ); + $create_group_stmt = $db->prepare( + "INSERT INTO resource_property_groups + (`name`, `mkdate`, `chdate`) + VALUES + (:name, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())" + ); + + $property_groups = []; + + if ($GLOBALS['RESOURCE_MIGRATION_PROPERTY_GROUP_PROPERTY_NAME_REGEX']) { + //A regular expression is set to split property names + //into a group part and a proprty name part. + + $group_name_regex = $GLOBALS['RESOURCE_MIGRATION_PROPERTY_GROUP_PROPERTY_NAME_REGEX']; + + $all_properties = $db->query( + "SELECT property_id, name FROM resource_property_definitions + ORDER BY name ASC" + )->fetchAll(); + + foreach ($all_properties as $property) { + $splitted_name = preg_split($group_name_regex, $property['name'], 2); + $group_name = trim($splitted_name[0]); + $new_property_name = trim($splitted_name[1]); + + if ($group_name && $new_property_name) { + //A group name could be extracted. + //Check if a group with that name already exists: + $get_group_id_stmt->execute( + [ + 'name' => $group_name + ] + ); + $group_id = $get_group_id_stmt->fetchColumn(); + if (!$group_id) { + //Create a new group: + $create_group_stmt->execute( + [ + 'name' => $group_name + ] + ); + //Get the ID of the group: + $get_group_id_stmt->execute(['name' => $group_name]); + $group_id = $get_group_id_stmt->fetchColumn(); + + if (!$group_id) { + //No such group. We can only move to the next property. + echo "no group-id!\n"; + continue; + } + } + + //Add the property to the list of properties + //to be added to the group. + if (!is_array($property_groups[$group_id])) { + $property_groups[$group_id] = []; + } + $property_groups[$group_id][] = [ + 'property_id' => $property['property_id'], + 'new_property_name' => $new_property_name + ]; + } + } + + $update_property_stmt = $db->prepare( + "UPDATE resource_property_definitions + SET property_group_id = :group_id + WHERE property_id = :property_id" + ); + + $update_property_with_name_stmt = $db->prepare( + "UPDATE resource_property_definitions + SET property_group_id = :group_id, + name = :new_name, + display_name = :new_name + WHERE property_id = :property_id" + ); + + foreach ($property_groups as $group_id => $property_list) { + foreach ($property_list as $property_data) { + if ($property_data['new_property_name']) { + $update_property_with_name_stmt->execute( + [ + 'group_id' => $group_id, + 'new_name' => $property_data['new_property_name'], + 'property_id' => $property_data['property_id'] + ] + ); + } else { + $update_property_stmt->execute( + [ + 'group_id' => $group_id, + 'property_id' => $property_data['property_id'] + ] + ); + } + } + } + } + + //At this point, some property groups may already have been created + //using the property group regex. But they can also be created + //by explicitly defining a name and the properties that are included + //in the group. + if (count($GLOBALS['RESOURCE_MIGRATION_NEW_PROPERTY_GROUP_LIST'])) { + $property_group_list = $GLOBALS['RESOURCE_MIGRATION_NEW_PROPERTY_GROUP_LIST']; + + $add_properties_stmt = $db->prepare( + "UPDATE resource_property_definitions + SET property_group_id = :group_id + WHERE name IN ( :names )" + ); + + foreach ($property_group_list as $group_name => $property_names) { + $get_group_id_stmt->execute(['name' => $group_name]); + $group_id = $get_group_id_stmt->fetchColumn(); + + if ($group_id) { + $add_properties_stmt->execute( + [ + 'group_id' => $group_id, + 'names' => $property_names + ] + ); + } else { + //Create a group with the specified group name first: + $create_group_stmt->execute(['name' => $group_name]); + + $get_group_id_stmt->execute(['name' => $group_name]); + $group_id = $get_group_id_stmt->fetchColumn(); + + if (!$group_id) { + //There is nothing we can do about it here. + continue; + } + + $add_properties_stmt->execute( + [ + 'group_id' => $group_id, + 'names' => $property_names + ] + ); + } + } + } + } + + + public function createMissingLocation(PDO $db) + { + //Check if there is a location category: + $location_category_id = $db->query( + "SELECT id FROM resource_categories + WHERE class_name = 'Location' + ORDER BY name LIMIT 1" + )->fetchAll(PDO::FETCH_COLUMN, 0); + + $location_resource_id = null; + if (!$location_category_id) { + //Create a location category: + $location_category_id = md5('LocationCategory_' . uniqid()); + + $create_category_stmt = $db->prepare( + "INSERT INTO resource_categories + (`id`, `name`, `system`, `class_name`, `mkdate`, `chdate`) + VALUES + (:id, :name, '1', 'Location', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" + ); + + $create_category_stmt->execute( + [ + 'id' => $location_category_id, + 'name' => _('Standort') + ] + ); + } + + //Check if all buildings have a location resource + //in their "parent chain": + $building_ids = []; + $get_buildings_stmt = $db->prepare( + "SELECT resources.id FROM resources + INNER JOIN resource_categories rc + ON resources.category_id = rc.id + WHERE rc.class_name = 'Building'" + ); + $get_buildings_stmt->execute(); + $building_ids = $get_buildings_stmt->fetchAll(PDO::FETCH_COLUMN, 0); + + $get_parent_stmt = $db->prepare( + "SELECT r1.parent_id as parent_id, rc.class_name as class_name + FROM resources r1 + LEFT JOIN resources r2 ON r2.id=r1.parent_id + INNER JOIN resource_categories rc ON r2.category_id = rc.id + WHERE r1.id = :resource_id" + ); + + $orphaned_top_level_resource_ids = []; + foreach ($building_ids as $building_id) { + //Traverse the resource tree upwards until + //a location resource is found or a resource + //with no parent is reached. + $building_location_id = null; + + $last_id = null; + $current_id = $building_id; + while($current_id && !$building_location_id) { + $get_parent_stmt->execute( + [ + 'resource_id' => $current_id + ] + ); + + $data = $get_parent_stmt->fetchOne(); + if ($data['class_name'] == 'Location') { + //We have found the location. + $building_location_id = $data['parent_id']; + $last_id = null; + } else { + //No location found. Go one layer up: + $last_id = $current_id; + $current_id = $data['parent_id']; + } + } + + //At this point, we have either found a location resource + //or a top level resource that is not a location but a + //parent resource of a building. + if (!$building_location_id && $last_id) { + $orphaned_top_level_resource_ids[] = $last_id; + } + } + + $location_id = $db->query( + "SELECT resources.id FROM resources + INNER JOIN resource_categories rc + ON resources.category_id = rc.id + WHERE rc.class_name = 'Location' + ORDER BY resources.name LIMIT 1" + )->fetchAll(PDO::FETCH_COLUMN, 0); + + if (!$location_id) { + //No location exists. In that case, we have to + //create a location resource. + + $location_name = Config::get()->UNI_NAME_CLEAN; + if (!$location_name) { + $location_name = _('Standort'); + } + + $create_location_stmt = $db->prepare( + "INSERT INTO resources + (`id`, `parent_id`, `category_id`, `name`, `requestable`, + `mkdate`, `chdate`) + VALUES + (:id, '', :category_id, :name, '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" + ); + + $location_id = md5('Location_' . $location_name . uniqid()); + $create_location_stmt->execute( + [ + 'id' => $location_id, + 'category_id' => $location_category_id, + 'name' => $location_name + ] + ); + } + + $assign_to_location_stmt = $db->prepare( + "UPDATE resources SET parent_id = :parent_id WHERE id = :id;" + ); + + foreach ($orphaned_top_level_resource_ids as $resource_id) { + $assign_to_location_stmt->execute( + [ + 'parent_id' => $location_id, + 'id' => $resource_id + ] + ); + } + } + + + public function fillResourceBookingIntervals(PDO $db) + { + $chunk_size = 100; + + //Delete everything from resource booking intervals first: + $db->exec('DELETE FROM resource_booking_intervals;'); + + $query = "SELECT COUNT(*) + FROM resource_bookings"; + $booking_count = $db->query($query)->fetchColumn(); + + for ($loop = 0; $loop < $booking_count; $loop += $chunk_size) { + $query = "SELECT id, resource_id, range_id, begin, end, booking_type + preparation_time, repeat_end, repeat_quantity, repetition_interval + FROM resource_bookings + LIMIT {$loop}, {$chunk_size}"; + $bookings = $db->query($query); + + $add_interval_stmt = $db->prepare( + "INSERT INTO resource_booking_intervals + (interval_id, booking_id, resource_id, begin, end, takes_place, + mkdate, chdate) + VALUES + (:interval_id, :booking_id, :resource_id, :begin, :end, 1, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" + ); + + $bookings->setFetchMode(PDO::FETCH_ASSOC); + foreach ($bookings as $booking) { + //Calculate the time intervals the same way as in + //ResourceBooking::calculateTimeIntervals: + $add_interval = function ($begin, $end) use ($booking, $add_interval_stmt) { + $interval_id = md5( + 'ResourceBookingInterval' . + $booking['booking_id'] . + $booking['begin'] . + $booking['end'] . + uniqid() + ); + $add_interval_stmt->execute([ + ':interval_id' => $interval_id, + ':booking_id' => $booking['id'], + ':resource_id' => $booking['resource_id'], + ':begin' => $begin, + ':end' => $end, + ]); + }; + + $booking_begin = new DateTime(); + $booking_begin->setTimestamp($booking['begin']); + if ($booking['preparation_time']) { + $booking_begin->setTimestamp( + $booking['begin'] - $booking['preparation_time'] + ); + } + $booking_end = new DateTime(); + $booking_end->setTimestamp($booking['end']); + + //use begin and end to create the first interval: + $add_interval( + $booking_begin->getTimestamp(), + $booking_end->getTimestamp() + ); + + if (($booking['repeat_quantity'] > 0) || $booking['repeat_end']) { + //Repetition: we must check which repetition interval has been + //selected and then create entries for each repetition. + //Repetition starts with the begin date and ends with the + //"repeat_end" date. + + $repetition_end = new DateTime(); + $repetition_end->setTimestamp($booking['repeat_end']); + //The DateInterval constructor will throw an exception, + //if it cannot parse the string stored in $this->repetition_interval. + $repetition_interval = null; + if ($booking['repetition_interval']) { + try { + $repetition_interval = new DateInterval($booking['repetition_interval']); + } catch (Exception $e) { + //Invalid repetition interval string. + //Skip this booking since its repetition interval is invalid. + continue; + } + } + + if ($repetition_interval instanceof DateInterval) { + $duration = $booking_begin->diff($booking_end); + + //Check if end is later than begin to avoid + //infinite loops. + if ($repetition_end > $booking_begin) { + $current_begin = clone $booking_begin; + $current_begin->add($repetition_interval); + while ($current_begin < $repetition_end) { + $current_end = clone $current_begin; + $current_end->add($duration); + + $add_interval( + $current_begin->getTimestamp(), + $current_end->getTimestamp() + ); + + $current_begin->add($repetition_interval); + } + } + } + } + } + } + } + + + public function up() + { + //Load the special configuration first: + if (file_exists(__DIR__ . '/../../config/resource_migration.php')) { + require(__DIR__ . '/../../config/resource_migration.php'); + } else { + //The special configuration doesn't exist so that we have to load + //the default configuration for the demo data. + $this->loadDefaultConfiguration(); + } + $db = DBManager::get(); + + //add new configuration variables: + + $db->exec( + "INSERT IGNORE INTO config + ( + `field`, + `value`, + `type`, + `range`, + `section`, + `mkdate`, + `chdate`, + `description` + ) + VALUES + ( + 'RESOURCES_DIRECT_ROOM_REQUESTS_ONLY', + '0', + 'boolean', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'Restricts room requests so that only specific rooms can be requested.' + ), + ( + 'RESOURCES_MAP_SERVICE_URL', + 'https://www.openstreetmap.org/#map=19/LATITUDE/LONGITUDE', + 'string', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The URL for a map service if you wish to use another service instead of OpenStreetMap. The default is: https://www.openstreetmap.org/#map=17/LATITUDE/LONGITUDE (LATITUDE and LONGITUDE are placeholders!)' + ), + ( + 'RESOURCES_MAX_PREPARATION_TIME', + '120', + 'integer', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The maximum amount of time that can be used for preparation before the actual booking begins. The value represents minutes, not hours!' + ), + ( + 'RESOURCES_MIN_BOOKING_TIME', + '15', + 'integer', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The minimum amount of minutes for the booking of a resource.' + ), + ( + 'RESOURCES_BOOKING_PLAN_START_HOUR', + '08:00', + 'string', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The start hour for the default view of the booking plan.' + ), + ( + 'RESOURCES_BOOKING_PLAN_END_HOUR', + '20:00', + 'string', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The start hour for the default view of the booking plan.' + ), + ( + 'RESOURCES_MIN_BOOKING_PERMS', + 'autor', + 'string', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The minimum permission level for global booking rights on a resource.' + ), + ( + 'RESOURCES_MIN_REQUEST_PERMISSION', + '', + 'string', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'The minimum permission level for creating \"free\" requests that are not bound to a course.' + ), + ( + 'RESOURCES_DISPLAY_CURRENT_REQUESTS_IN_OVERVIEW', + '1', + 'boolean', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'Whether to display the list with current requests in the room management overview (true) or not (false).' + ), + ( + 'RESOURCES_SHOW_PUBLIC_ROOM_PLANS', + '0', + 'boolean', + 'global', + 'resources', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'Whether to display the list of available public room plans.' + );" + ); + + //Convert configuration options that may already exist so that + //the format is identical: + + $db->exec( + "UPDATE config SET type = 'boolean', section = 'resources' + WHERE field = 'RESOURCES_DIRECT_ROOM_REQUESTS_ONLY';" + ); + + //Enable API routes (and the API itself). + //The new room and resource management system requires a few routes + //to be activated to work properly. + + $db->exec( + "UPDATE config SET value = '1' + WHERE field = 'API_ENABLED';" + ); + + $enable_api_route_stmt = $db->prepare( + "INSERT INTO api_consumer_permissions + (route_id, consumer_id, method, granted) + VALUES + (:route, 'global', :method, '1') + ON DUPLICATE KEY UPDATE + granted = '1';" + ); + $api_routes_to_enable = [ + '/user/:user_id' => 'get', + '/resources/booking_interval/:interval_id/toggle_takes_place' => 'post', + '/resources/booking/:booking_id/move' => 'post', + '/resources/booking/:booking_id/intervals' => 'get', + '/resources/resource/:resource_id/booking_plan' => 'get', + '/resources/resource/:resource_id/semester_plan' => 'get', + '/resources/request/:request_id/move' => 'post', + '/resources/request/:request_id/edit_reply_comment' => 'post', + '/resources/request/:request_id/toggle_marked' => 'post', + '/room_clipboard/:clipboard_id/booking_plan' => 'get', + '/room_clipboard/:clipboard_id/semester_plan' => 'get', + '/clipboard/:clipboard_id' => ['delete', 'put'], + '/clipboard/:clipboard_id/item' => 'post', + '/clipboard/:clipboard_id/item/:range_id' => 'delete', + '/clipboard/add' => 'post', + '/course/:course_id/members' => 'get', + '/semesters' => 'get' + ]; + + foreach ($api_routes_to_enable as $route => $methods) { + if (is_array($methods)) { + foreach ($methods as $method) { + $enable_api_route_stmt->execute( + [ + 'route' => md5($route), + 'method' => $method + ] + ); + } + } else { + $enable_api_route_stmt->execute( + [ + 'route' => md5($route), + 'method' => $methods + ] + ); + } + } + + + //add new tables: + + $db->exec( + "CREATE TABLE IF NOT EXISTS `resource_temporary_permissions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `resource_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `begin` int(11) unsigned NOT NULL DEFAULT '0', + `end` int(11) unsigned NOT NULL DEFAULT '0', + `perms` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `resource_request_appointments` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `request_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `appointment_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `colour_values` ( + `colour_id` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `description` varchar(256) NOT NULL DEFAULT '', + `value` varchar(8) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'ffffffff', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`colour_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `separable_rooms` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `building_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(256) NOT NULL DEFAULT '', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `separable_room_parts` ( + `separable_room_id` int(10) NOT NULL, + `room_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`separable_room_id`,`room_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `clipboards` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `name` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `handler` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'Clipboard', + `allowed_item_class` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'StudipItem', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + //The range_id in clipboard_items is extra large + //so that primary keys consisting of three other + //keys can also be used. + $db->exec( + "CREATE TABLE IF NOT EXISTS `clipboard_items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `clipboard_id` int(11) NOT NULL, + `range_id` varchar(98) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `range_type` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'SimpleORMap', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + `chdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + //The property group table defines groups of resource properties + //that shall be displayed together. + $db->exec( + "CREATE TABLE IF NOT EXISTS `resource_property_groups` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `position` TINYINT(4) NOT NULL DEFAULT '0', + `mkdate` INT(11) NOT NULL DEFAULT '0', + `chdate` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + if ($GLOBALS['RESOURCE_MIGRATION_SPECIALRESOURCESPLUGIN']) { + $db->exec( + "CREATE TABLE IF NOT EXISTS specialresourcesplugin_course_resources( + course_id VARCHAR(32) NOT NULL, + resource_id VARCHAR(32) NOT NULL, + mkdate INT(10) NOT NULL DEFAULT '0', + chdate INT(10) NOT NULL DEFAULT '0', + PRIMARY KEY (course_id, resource_id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" + ); + + } + + //Add colors: + $colours = [ + 'Resources.BookingPlan.Booking.Fg' => [ + 'ffffffff', + 'Die Textfarbe im Belegungsplan für gewöhnliche Buchungen.' + ], + 'Resources.BookingPlan.Booking.Bg' => [ + '129c94ff', + 'Die Farbe im Belegungsplan für gewöhnliche Buchungen.' + ], + 'Resources.BookingPlan.CourseBooking.Fg' => [ + 'ffffffff', + 'Die Textfarbe im Belegungsplan für veranstaltungsbezogene Buchungen.' + ], + 'Resources.BookingPlan.CourseBooking.Bg' => [ + '682c8bff', + 'Die Farbe im Belegungsplan für veranstaltungsbezogene Buchungen.' + ], + 'Resources.BookingPlan.CourseBookingWithExceptions.Fg' => [ + 'ffffffff', + 'Die Textfarbe im Belegungsplan für veranstaltungsbezogene Buchungen mit Ausfallterminen.' + ], + 'Resources.BookingPlan.CourseBookingWithExceptions.Bg' => [ + 'a480b9ff', + 'Die Farbe im Belegungsplan für veranstaltungsbezogene Buchungen mit Ausfallterminen.' + ], + 'Resources.BookingPlan.SimpleBookingWithExceptions.Fg' => [ + 'ffffffff', + 'Die Textfarbe im Belegungsplan für einfache Buchungen mit Wiederholungen, bei denen es Ausfalltermine gibt.' + ], + 'Resources.BookingPlan.SimpleBookingWithExceptions.Bg' => [ + '70c3bfff', + 'Die Farbe im Belegungsplan für einfache Buchungen mit Wiederholungen, bei denen es Ausfalltermine gibt.' + ], + 'Resources.BookingPlan.Reservation.Fg' => [ + 'ffffffff', + 'Die Textfarbe im Belegungsplan für Reservierungen.' + ], + 'Resources.BookingPlan.Reservation.Bg' => [ + '6ead10ff', + 'Die Farbe im Belegungsplan für Reservierungen.' + ], + 'Resources.BookingPlan.Lock.Fg' => [ + 'ffffffff', + 'Die Textfarbe im Belegungsplan für Sperrbuchungen.' + ], + 'Resources.BookingPlan.Lock.Bg' => [ + 'd60000ff', + 'Die Farbe im Belegungsplan für Sperrbuchungen.' + ], + 'Resources.BookingPlan.PlannedBooking.Fg' => [ + '000000ff', + 'Die Textfarbe im Belegungsplan für geplante Buchungen.' + ], + 'Resources.BookingPlan.PlannedBooking.Bg' => [ + 'f26e00ff', + 'Die Farbe im Belegungsplan für geplante Buchungen.' + ], + 'Resources.BookingPlan.PreparationTime.Fg' => [ + '000000ff', + 'Die Textfarbe im Belegungsplan für Rüstzeiten.' + ], + 'Resources.BookingPlan.PreparationTime.Bg' => [ + 'cf81b0ff', + 'Die Farbe im Belegungsplan für Rüstzeiten.' + ], + 'Resources.BookingPlan.Request.Fg' => [ + '000000ff', + 'Die Textfarbe im Belegungsplan für Anfragen.' + ], + 'Resources.BookingPlan.Request.Bg' => [ + 'ffbd33ff', + 'Die Farbe im Belegungsplan für Anfragen.' + ] + ]; + + $colour_stmt = $db->prepare( + 'INSERT IGNORE INTO colour_values + (colour_id, value, description, mkdate, chdate) + VALUES + (:colour_id, :value, :description, UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + );' + ); + + foreach ($colours as $colour_id => $data) { + $colour_stmt->execute( + [ + 'colour_id' => $colour_id, + 'value' => $data[0], + 'description' => $data[1] + ] + ); + } + + //alter tables: + + $db->exec("RENAME TABLE resources_objects TO resources;"); + $db->exec("ALTER TABLE resources + CHANGE COLUMN resource_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN parent_id parent_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN category_id category_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN description description text NULL DEFAULT NULL, + CHANGE COLUMN requestable requestable TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN sort_position TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + DROP COLUMN institut_id, + DROP COLUMN lockable, + DROP COLUMN multiple_assign, + DROP COLUMN root_id"); + + $db->exec("RENAME TABLE resources_categories TO resource_categories;"); + $db->exec("ALTER TABLE resource_categories + CHANGE COLUMN category_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `system` `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN class_name VARCHAR(60) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'Resource', + ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + DROP COLUMN is_room"); + + $db->exec("RENAME TABLE resources_categories_properties + TO resource_category_properties;"); + $db->exec("ALTER TABLE resource_category_properties + CHANGE COLUMN requestable requestable TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN protected protected TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `system` `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN form_text text NULL, + ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); + + $db->exec("RENAME TABLE resources_properties + TO resource_property_definitions;"); + $db->exec("ALTER TABLE resource_property_definitions + CHANGE COLUMN type type SET ( + 'bool', 'text', 'num', 'select', 'user', 'institute', + 'position', 'fileref', 'url', 'resource_ref_list' + ) CHARACTER SET latin1 COLLATE latin1_bin, + CHANGE COLUMN description description text NULL DEFAULT NULL, + CHANGE COLUMN `system` `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN display_name VARCHAR(512) NOT NULL DEFAULT '', + ADD COLUMN searchable TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN range_search TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN write_permission_level VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'admin-global', + ADD COLUMN property_group_id INT(11) NULL, + ADD COLUMN property_group_pos TINYINT(4) NULL, + ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); + + //Set the display_name to the property name as default: + + $db->exec( + "UPDATE resource_property_definitions + SET display_name = name;" + ); + + $db->exec("RENAME TABLE resources_objects_properties + TO resource_properties;"); + $db->exec("ALTER TABLE resource_properties + ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); + + $db->exec("RENAME TABLE resources_requests + TO resource_requests;"); + $db->exec("ALTER TABLE resource_requests + CHANGE COLUMN request_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN seminar_id course_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN closed closed TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN category_id category_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT '', + ADD COLUMN begin INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN end INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN preparation_time INT(4) NOT NULL DEFAULT 0, + ADD COLUMN marked TINYINT(1) UNSIGNED NOT NULL DEFAULT 0" + ); + + $db->exec("RENAME TABLE resources_requests_properties + TO resource_request_properties;"); + + $db->exec("RENAME TABLE resources_assign TO resource_bookings;"); + $db->exec("ALTER TABLE resource_bookings + CHANGE COLUMN assign_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN user_free_name description TEXT NULL, + CHANGE COLUMN assign_user_id range_id CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN repeat_interval old_rep_interval INT(2) NULL DEFAULT NULL, + CHANGE COLUMN repeat_month_of_year old_rep_month_of_year INT(2) NULL DEFAULT NULL, + CHANGE COLUMN repeat_day_of_month old_rep_day_of_month INT(2) NULL DEFAULT NULL, + CHANGE COLUMN repeat_week_of_month old_rep_week_of_month INT(2) NULL DEFAULT NULL, + CHANGE COLUMN repeat_day_of_week old_rep_day_of_week INT(2) NULL DEFAULT NULL, + CHANGE COLUMN comment_internal internal_comment text NULL DEFAULT NULL, + ADD COLUMN preparation_time INT(4) NOT NULL DEFAULT 0, + ADD COLUMN booking_type TINYINT(2) NOT NULL DEFAULT 0, + ADD COLUMN booking_user_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + ADD COLUMN repetition_interval VARCHAR(24) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '';" + ); + $db->exec("ALTER TABLE `resource_bookings` DROP INDEX `resource_id`, ADD INDEX `resource_id` (`resource_id`, `booking_type`)"); + + $db->exec("RENAME TABLE resources_locks + TO global_resource_locks;"); + $db->exec("ALTER TABLE global_resource_locks + CHANGE COLUMN lock_begin begin INT(11) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN lock_end end INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN user_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); + + $db->exec("RENAME TABLE resources_user_resources TO resource_permissions;"); + $db->exec("ALTER TABLE resource_permissions + ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); + $db->exec("ALTER TABLE resource_permissions ADD INDEX (resource_id)"); + $db->exec("UPDATE resource_permissions SET resource_id = 'global' + WHERE resource_id = 'all';"); + + $db->exec("DROP TABLE resources_temporary_events;"); + $db->exec( + "CREATE TABLE `resource_booking_intervals` ( + `interval_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `resource_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `booking_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `begin` int(20) NOT NULL DEFAULT 0, + `end` int(20) NOT NULL DEFAULT 0, + `mkdate` int(11) unsigned NOT NULL DEFAULT 0, + `chdate` int(11) unsigned NOT NULL DEFAULT 0, + `takes_place` tinyint(1) unsigned NOT NULL DEFAULT 1, + PRIMARY KEY (`interval_id`), + INDEX `resource_id` (`resource_id`,`takes_place`,`end`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"); + + //Delete old tables: + + $db->exec("DROP TABLE resources_requests_user_status;"); + + //Add other nice things and modify stuff: + + $new_log_action_stmt = $db->prepare( + "INSERT IGNORE INTO log_actions (action_id, name, description) + VALUES + (:action_id, :name, :description);" + ); + + $action_id = md5(uniqid('RES_PERM_CHANGE')); + $new_log_action_stmt->execute( + [ + 'action_id' => $action_id, + 'name' => 'RES_PERM_CHANGE', + 'description' => 'Änderung der Berechtigungsstufe an einer Ressource.' + ] + ); + + //Set parent_id = '' where parent_id = 'root' or '0' in + //resources so that root resources always + //have an empty parent_id field: + $db->exec("UPDATE resources + SET parent_id = '' + WHERE parent_id = 'root' OR parent_id = '0';" + ); + + //We can delete resources now that are not needed anymore: + $this->deleteResources(); + + //First we remove those properties that are not needed anymore: + $this->deleteExistingProperties($db); + + //Now we have to migrate existing properties + //that are system properties with a different name: + $this->migrateExistingProperties($db); + //And we have to merge some properties, too: + $this->mergeProperties($db); + + //Now we convert all boolean property values to '0' and '1' + //instead of '' and 'on': + $db->exec( + "UPDATE resource_properties + INNER JOIN resource_property_definitions rpd + USING (property_id) + SET state = '1' + WHERE state = 'on' AND rpd.type = 'bool';" + ); + $db->exec( + "UPDATE resource_properties + INNER JOIN resource_property_definitions rpd + USING (property_id) + SET state = '0' + WHERE state = '' AND rpd.type = 'bool';" + ); + + //Repeat the same for resource request properties: + + $db->exec( + "UPDATE resource_request_properties + INNER JOIN resource_property_definitions rpd + USING (property_id) + SET state = '1' + WHERE state = 'on' AND rpd.type = 'bool';" + ); + $db->exec( + "UPDATE resource_request_properties + INNER JOIN resource_property_definitions rpd + USING (property_id) + SET state = '0' + WHERE state = '' AND rpd.type = 'bool';" + ); + + //rename and update resource categories: + + $db->exec("UPDATE resource_categories + SET class_name = 'Room', `system` = 1 + WHERE + name LIKE '%raum%' OR name LIKE '%Raum%' + OR name LIKE '%saal%' OR name LIKE '%Saal%';"); + + $db->exec("UPDATE resource_categories + SET class_name = 'Building', `system` = 1 + WHERE + name LIKE '%gebäude%' OR name LIKE '%Gebäude%';"); + + //add new resource categories and new properties: + + $add_category_statement = $db->prepare( + "INSERT INTO `resource_categories` + (`id`,`name`, `class_name`, `description`, `system`, `iconnr`) + VALUES + (:id, :name, :class_name, '', 1, 0);" + ); + + $location_cat_id = md5('StandortLocationResourceCategory100'); + + $building_cat_id_rows = $db->query("SELECT id + FROM resource_categories + WHERE name LIKE '%gebäude%';")->fetchAll(); + + $room_cat_id_rows = $db->query("SELECT id + FROM resource_categories + WHERE name LIKE '%raum%' OR name LIKE '%saal%';")->fetchAll(); + + $building_cat_ids = []; + foreach ($building_cat_id_rows as $row) { + $building_cat_ids[] = $row[0]; + } + + $room_cat_ids = []; + foreach ($room_cat_id_rows as $row) { + $room_cat_ids[] = $row[0]; + } + + $add_category_statement->execute( + [ + 'id' => $location_cat_id, + 'name' => 'Standort', + 'class_name' => 'Location' + ] + ); + + //Assign orphaned resources (resources without category-id): + $this->assignOrphanedResources($db); + $this->deleteUnfinishedResources($db); + + if (is_array($GLOBALS['RESOURCE_CATEGORY_CLASS_MAPPING'])) { + //Use the class mapping rules from that configuration setting: + $mapping_stmt = $db->prepare( + 'UPDATE resource_categories + SET class_name = :class_name + WHERE name = :name' + ); + foreach ($GLOBALS['RESOURCE_CATEGORY_CLASS_MAPPING'] as $name => $class_name) { + $mapping_stmt->execute( + [ + 'class_name' => $class_name, + 'name' => $name + ] + ); + } + } else { + //Migrate rooms, buildings and locations, based on best guess. + $this->migrateRooms($db); + $this->migrateBuildings($db); + $this->migrateLocations($db, $location_cat_id); + } + + if (count($GLOBALS['RESOURCE_CATEGORY_RENAME'])) { + $rename_stmt = $db->prepare( + 'UPDATE resource_categories SET name = :name + WHERE name = :old_name' + ); + + foreach ($GLOBALS['RESOURCE_CATEGORY_RENAME'] as $old_name => $name) { + $rename_stmt->execute( + [ + 'old_name' => $old_name, + 'name' => $name + ] + ); + } + } + + //Get all location categories. + //migrateLocations has set the Location class name + //for all location categories. + $location_cat_id_rows = $db->query( + "SELECT id + FROM resource_categories + WHERE class_name = 'Location';" + )->fetchAll(); + $location_cat_ids = []; + foreach ($location_cat_id_rows as $row) { + $location_cat_ids[] = $row[0]; + } + + //Add or create missing default properties: + + $property_exists_statement = $db->prepare( + "SELECT property_id + FROM resource_property_definitions + WHERE + name = :name AND type = :type;" + ); + + $add_property_statement = $db->prepare( + "INSERT INTO `resource_property_definitions` + (`property_id`, `name`, `type`, `options`, `system`) + VALUES + (:id, :name, :type, '', 1);" + ); + + $property_link_exists_statement = $db->prepare( + "SELECT 1 + FROM resource_category_properties + WHERE + category_id = :category_id AND property_id = :property_id;" + ); + + $update_property_link_statement = $db->prepare( + "UPDATE resource_category_properties + SET `system` = 1 + WHERE + category_id = :category_id AND property_id = :property_id;" + ); + + $link_property_statement = $db->prepare( + "INSERT INTO resource_category_properties + (`category_id`, `property_id`, `system`) + VALUES + (:category_id, :property_id, 1);" + ); + + $all_mandatory_properties = [ + 'location' => [ + //location properties: + 'geo_coordinates' => 'position' + ], + + 'building' => [ + //building properties: + 'geo_coordinates' => 'position', + 'number' => 'text', + 'address' => 'text' + ], + + 'room' => [ + //room properties: + 'booking_plan_is_public' => 'bool', + 'room_type' => 'select', + 'seats' => 'num', + 'responsible_person' => 'user' + ] + ]; + + foreach ($all_mandatory_properties as $area_name => $area) { + $area_ids = ['']; + if ($area_name == 'location') { + $area_ids = $location_cat_ids; + } elseif ($area_name == 'building') { + $area_ids = $building_cat_ids; + } elseif ($area_name == 'room') { + $area_ids = $room_cat_ids; + } + foreach ($area as $name => $type) { + //Check if the property exists. If so, link it only. + //Otherwise create it. + $property_exists_statement->execute( + [ + 'name' => $name, + 'type' => $type + ] + ); + + $property_id = $property_exists_statement->fetchColumn(0); + if (!$property_id) { + //property doesn't exist: create it + $property_id = md5($name . $type . rand()); + $add_property_statement->execute( + [ + 'id' => $property_id, + 'name' => $name, + 'type' => $type + ] + ); + } + + foreach ($area_ids as $area_id) { + //Check if the property is linked to the category. + //If so, we must make sure the system attribute + //is set. Otherwise we must create the link. + $property_link_exists_statement->execute( + [ + 'category_id' => $area_id, + 'property_id' => $property_id + ] + ); + + $link_exists = $property_link_exists_statement->fetchColumn(0); + + if ($link_exists) { + $update_property_link_statement->execute( + [ + 'category_id' => $area_id, + 'property_id' => $property_id + ] + ); + } else { + $link_property_statement->execute( + [ + 'category_id' => $area_id, + 'property_id' => $property_id + ] + ); + } + //make plans visible + if ($area_name === 'room' && $name === 'booking_plan_is_public') { + $db->execute("INSERT IGNORE INTO `resource_properties` (`resource_id`, `property_id`, `state`, `mkdate`, `chdate`) SELECT `id` , ?, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() FROM `resources` WHERE `category_id` = ?", [$property_id, $area_id]); + } + } + } + } + + //At this point, we can create the property groups (if any): + $this->createPropertyGroups($db); + + //Migrate resource booking interval data: + $this->migrateBookingRepeatIntervals($db); + + $this->migrateOwner(); + //Migrate course permissions on resources: + $this->migrateCourseBoundPermissions($db); + $this->deleteOldPermissions($db); + + //In case no location resource is in the database, + //one such resource will be created along with the + //corresponding category. + $this->createMissingLocation($db); + + //Create entries in resource_booking_intervals for each booking: + $this->fillResourceBookingIntervals($db); + + SimpleORMap::expireTableScheme(); + } + + + public function down() + { + //I see nothing! I hear nothing! Nothing!! + } +} diff --git a/db/migrations/1.278_resize_auth_user_md5_email_field.php b/db/migrations/1.278_resize_auth_user_md5_email_field.php new file mode 100644 index 0000000..c0efe40 --- /dev/null +++ b/db/migrations/1.278_resize_auth_user_md5_email_field.php @@ -0,0 +1,25 @@ +exec( + "ALTER TABLE `auth_user_md5` + CHANGE COLUMN `Email` `Email` VARCHAR(256) NULL DEFAULT NULL" + ); + } + + + public function down() + { + DBManager::get()->exec( + "ALTER TABLE `auth_user_md5` + CHANGE COLUMN `Email` `Email` VARCHAR(256) NULL DEFAULT NULL" + ); + } +} diff --git a/db/migrations/1.279_config_wiki_comments_enable.php b/db/migrations/1.279_config_wiki_comments_enable.php new file mode 100644 index 0000000..ce52b35 --- /dev/null +++ b/db/migrations/1.279_config_wiki_comments_enable.php @@ -0,0 +1,31 @@ +prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'WIKI_COMMENTS_ENABLE', + 'description' => 'Einstellung für die Anzeige von Kommentaren in Wiki als Icon', + 'range' => 'user', + 'type' => 'boolean', + 'value' => '0' + ]); + } + + public function down() + { + $db = DBManager::get(); + + $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?'); + $stmt->execute(['WIKI_COMMENTS_ENABLE']); + } +} diff --git a/db/migrations/1.27_step_147_mail_activationlink.php b/db/migrations/1.27_step_147_mail_activationlink.php new file mode 100644 index 0000000..0f514ed --- /dev/null +++ b/db/migrations/1.27_step_147_mail_activationlink.php @@ -0,0 +1,31 @@ +exec("ALTER TABLE `auth_user_md5` ADD `validation_key` VARCHAR(10) NOT NULL AFTER `Email`"); + } + + public function down() + { + DBManager::get()->exec("ALTER TABLE `auth_user_md5` DROP `validation_key`"); + } +} diff --git a/db/migrations/1.280_step_00338_institutecolors.php b/db/migrations/1.280_step_00338_institutecolors.php new file mode 100644 index 0000000..ffac530 --- /dev/null +++ b/db/migrations/1.280_step_00338_institutecolors.php @@ -0,0 +1,25 @@ +exec("DELETE FROM `datafields_entries` WHERE `datafields_entries`.`datafield_id` = '41cda2be71fe9efd6e28b853fc0681f3';"); + $db->exec("INSERT INTO `datafields` (`datafield_id`, `name`, `object_type`, `edit_perms`, `view_perms`, `priority`, `type`, `typeparam`, `is_required`, `is_userfilter`, `description`, `system`) VALUES + ('0c63321a8e93b3ccc927611709248e07', 'default Planungsfarbe', 'inst', 'admin', 'root', 0, 'textline', '', 0, 0, 'Default Farben im Veranstaltungsplaner', 0);"); + + } + + public function down() + { + $db = DBManager::get(); + $db->exec("DELETE FROM `datafields` WHERE `datafields`.`datafield_id` IN('0c63321a8e93b3ccc927611709248e07');"); + + } +} diff --git a/db/migrations/1.281_step_00333_feedback.php b/db/migrations/1.281_step_00333_feedback.php new file mode 100644 index 0000000..cfa2fac --- /dev/null +++ b/db/migrations/1.281_step_00333_feedback.php @@ -0,0 +1,108 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL version 3 + */ + +class Step00333Feedback extends Migration +{ + public function description() + { + return 'initial database setup for feedback elements'; + } + + public function up() + { + $db = DBManager::get(); + + $db->exec("CREATE TABLE IF NOT EXISTS `feedback` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` varchar(32) COLLATE latin1_bin NOT NULL, + `range_id` varchar(32) COLLATE latin1_bin NOT NULL, + `range_type` varchar(32) COLLATE latin1_bin NOT NULL, + `course_id` varchar(32) COLLATE latin1_bin NOT NULL, + `question` text COLLATE utf8mb4_unicode_ci NOT NULL, + `description` text COLLATE utf8mb4_unicode_ci NOT NULL, + `mode` int(11) UNSIGNED NOT NULL, + `results_visible` tinyint(4) UNSIGNED NOT NULL, + `commentable` tinyint(4) UNSIGNED NOT NULL, + `mkdate` int(11) UNSIGNED NOT NULL, + `chdate` int(11) UNSIGNED NOT NULL, + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`), + INDEX `idx_range` (`range_id`,`range_type`), + KEY `course_id` (`course_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec("CREATE TABLE IF NOT EXISTS `feedback_entries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `feedback_id` int(11) UNSIGNED NOT NULL, + `user_id` varchar(32) COLLATE latin1_bin NOT NULL, + `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, + `rating` tinyint(3) UNSIGNED NOT NULL, + `mkdate` int(10) UNSIGNED NOT NULL, + `chdate` int(10) UNSIGNED NOT NULL, + PRIMARY KEY (`id`), + KEY `feedback_id` (`feedback_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + // install as core plugin + $db->exec( + "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) + VALUES ('FeedbackModule', 'Feedback','StandardPlugin,SystemPlugin','yes', 1)" + ); + + $db->execute( + "INSERT INTO roles_plugins (roleid, pluginid) + SELECT roleid, ? + FROM roles + WHERE `system` = 'y'", + [$db->lastInsertId()] + ); + + // install config settings + $stmt = $db->prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + + $stmt->execute([ + 'name' => 'FEEDBACK_ADMIN_PERM', + 'description' => 'Voreinstellung für Berechtigungslevel, um Einstellung zu Feedback-Elementen zu verwalten', + 'range' => 'course', + 'type' => 'string', + 'value' => 'tutor' + ]); + + $stmt->execute([ + 'name' => 'FEEDBACK_CREATE_PERM', + 'description' => 'Voreinstellung für Berechtigungslevel, um Feedback-Elemente anzulegen.', + 'range' => 'course', + 'type' => 'string', + 'value' => 'tutor' + ]); + + SimpleORMap::expireTableScheme(); + } + + public function down() + { + $db = DBManager::get(); + $db->exec('DROP TABLE feedback_entries'); + $db->exec('DROP TABLE feedback'); + + $db->exec( + "DELETE plugins, roles_plugins + FROM plugins LEFT JOIN roles_plugins USING(pluginid) + WHERE pluginclassname = 'FeedbackModule'" + ); + + SimpleORMap::expireTableScheme(); + } +} diff --git a/db/migrations/1.282_config_for_stgteilversion_userfilter.php b/db/migrations/1.282_config_for_stgteilversion_userfilter.php new file mode 100644 index 0000000..646838a --- /dev/null +++ b/db/migrations/1.282_config_for_stgteilversion_userfilter.php @@ -0,0 +1,31 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'DISPLAY_STGTEILVERSION_USERFILTER'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.283_add_filetypes.php b/db/migrations/1.283_add_filetypes.php new file mode 100644 index 0000000..cade7b0 --- /dev/null +++ b/db/migrations/1.283_add_filetypes.php @@ -0,0 +1,48 @@ +exec(" + ALTER TABLE files + ADD COLUMN `filetype` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT 'StandardFile' AFTER `name`, + ADD COLUMN `metadata` TEXT NULL AFTER `size` + "); + DBManager::get()->exec(' + UPDATE files + INNER JOIN file_urls ON (file_urls.file_id = files.id) + SET files.metadata = JSON_OBJECT("url", file_urls.url, "access_type", file_urls.access_type), + files.filetype = "URLFile" + '); + DBManager::get()->exec(" + DROP TABLE file_urls + "); + DBManager::get()->exec(" + ALTER TABLE files + DROP COLUMN `storage` + "); + } + + + public function down() + { + DBManager::get()->exec(" + CREATE TABLE `file_urls` ( + `file_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `url` varchar(4096) COLLATE utf8mb4_unicode_ci NOT NULL, + `access_type` enum('proxy','redirect') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'proxy', + PRIMARY KEY (`file_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + ALTER TABLE files + DROP COLUMN `filetype`, + DROP COLUMN `metadata` + "); + } +} diff --git a/db/migrations/1.284_change_schedule_color_with_category_index.php b/db/migrations/1.284_change_schedule_color_with_category_index.php new file mode 100644 index 0000000..40a7f5c --- /dev/null +++ b/db/migrations/1.284_change_schedule_color_with_category_index.php @@ -0,0 +1,61 @@ +exec("ALTER TABLE `schedule` CHANGE `color` `color` varchar(255) COMMENT 'category index'"); + DBManager::get()->exec("ALTER TABLE `schedule_seminare` CHANGE `color` `color` varchar(255) COMMENT 'category index'"); + + foreach ($PERS_TERMIN_KAT as $index => $cat) { + $query = "UPDATE `schedule` + SET `color` = :index + WHERE `color` = :color"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + + $query = "UPDATE `schedule_seminare` + SET `color` = :index + WHERE `color` = :color"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + } + } + + public function down() + { + global $PERS_TERMIN_KAT; + + DBManager::get()->exec("ALTER TABLE `schedule` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); + DBManager::get()->exec("ALTER TABLE `schedule_seminare` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); + + foreach ($PERS_TERMIN_KAT as $index => $cat) { + $query = "UPDATE `schedule` + SET `color` = :color + WHERE `color` = :index"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + + $query = "UPDATE `schedule_seminare` + SET `color` = :color + WHERE `color` = :index"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + } + } +} diff --git a/db/migrations/1.285_fixes_on_schedule_coloring.php b/db/migrations/1.285_fixes_on_schedule_coloring.php new file mode 100644 index 0000000..73c6883 --- /dev/null +++ b/db/migrations/1.285_fixes_on_schedule_coloring.php @@ -0,0 +1,79 @@ + $cat) { + $query = "UPDATE `schedule` + SET `color` = :index + WHERE `color` = :color"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + + $query = "UPDATE `schedule_seminare` + SET `color` = :index + WHERE `color` = :color"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + } + + $default = 1; + $indexes = array_keys($PERS_TERMIN_KAT); + + $query = "UPDATE `schedule` + SET `color` = :default + WHERE `color` NOT IN ( :indexes )"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':default', $default); + $st->bindValue(':indexes', $indexes); + $st->execute(); + + $query = "UPDATE `schedule_seminare` + SET `color` = :default + WHERE `color` NOT IN ( :indexes )"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':default', $default); + $st->bindValue(':indexes', $indexes); + $st->execute(); + + DBManager::get()->exec("ALTER TABLE `schedule` MODIFY `color` tinyint"); + DBManager::get()->exec("ALTER TABLE `schedule_seminare` MODIFY `color` tinyint"); + } + + public function down() + { + global $PERS_TERMIN_KAT; + + DBManager::get()->exec("ALTER TABLE `schedule` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); + DBManager::get()->exec("ALTER TABLE `schedule_seminare` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); + + foreach ($PERS_TERMIN_KAT as $index => $cat) { + $query = "UPDATE `schedule` + SET `color` = :color + WHERE `color` = :index"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + + $query = "UPDATE `schedule_seminare` + SET `color` = :color + WHERE `color` = :index"; + $st = DBManager::get()->prepare($query); + $st->bindValue(':index', $index); + $st->bindValue(':color', $cat['color']); + $st->execute(); + } + } +} diff --git a/db/migrations/1.286_remove_new_widget_system.php b/db/migrations/1.286_remove_new_widget_system.php new file mode 100644 index 0000000..b603cd7 --- /dev/null +++ b/db/migrations/1.286_remove_new_widget_system.php @@ -0,0 +1,66 @@ +exec('DROP TABLE widgets'); + $db->exec('DROP TABLE widget_containers'); + $db->exec('DROP TABLE widget_elements'); + } + + + public function down() + { + $db = DBManager::get(); + $db->exec( + "CREATE TABLE IF NOT EXISTS `widget_containers` ( + `container_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, + `range_type` ENUM('course','institute','user','plugin','other') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'course', + `scope` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'default', + `parent_id` INT(11) UNSIGNED NULL DEFAULT NULL, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`container_id`), + UNIQUE KEY `range` (`range_id`, `range_type`, `scope`), + KEY `parent_id` (`parent_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `widget_elements` ( + `element_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `container_id` INT(11) UNSIGNED NOT NULL, + `widget_id` INT(11) UNSIGNED NOT NULL, + `x` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + `y` TINYINT(3) UNSIGNED NOT NULL, + `width` TINYINT(1) UNSIGNED NOT NULL, + `height` TINYINT(1) UNSIGNED NOT NULL, + `locked` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + `removable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, + `options` VARCHAR(8192) NOT NULL DEFAULT '[]', + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`element_id`), + KEY `container_id` (`container_id`), + KEY `widget_id` (`widget_id`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $db->exec( + "CREATE TABLE IF NOT EXISTS `widgets` ( + `widget_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `class` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `filename` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, + `enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, + `mkdate` INT(11) UNSIGNED NOT NULL, + `chdate` INT(11) UNSIGNED NOT NULL, + PRIMARY KEY (`widget_id`), + UNIQUE KEY `class` (`class`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + } +} diff --git a/db/migrations/1.287_replace_library_system.php b/db/migrations/1.287_replace_library_system.php new file mode 100644 index 0000000..2f672b6 --- /dev/null +++ b/db/migrations/1.287_replace_library_system.php @@ -0,0 +1,144 @@ +exec( + "INSERT IGNORE INTO config + ( + `field`, + `value`, + `type`, + `range`, + `section`, + `mkdate`, + `chdate`, + `description` + ) + VALUES + ( + 'LIBRARY_ADD_ITEM_ACTION_DESCRIPTION', + 'Sie können digitale Originaldokumente direkt aus der Bibliothek (ggf. Name) beziehen. Sie erhalten Materialien mit geklärten Rechten und in hochwertiger Qualität. Bei Bedarf kann die Bibliothek zur Bereitstellung eingebunden werden.', + 'string', + 'global', + 'Library', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'Der Beschreibungstext für die Aktion zum Hinzufügen eines Bibliothekseintrags in den Dateibereich.' + ), + ( + 'COURSE_LIBRARY_CITATION_STYLE', + '', + 'string', + 'course', + 'Library', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'Der standardmäßig genutzte Zitationsstil innerhalb der Veranstaltung.' + ), + ( + 'USER_LIBRARY_CITATION_STYLE', + '', + 'string', + 'user', + 'Library', + UNIX_TIMESTAMP(), + UNIX_TIMESTAMP(), + 'Der präferierte Zitationsstil einer Person.' + )" + ); + + $db->exec('DROP TABLE `lit_catalog`'); + $db->exec('DROP TABLE `lit_list`'); + $db->exec('DROP TABLE `lit_list_content`'); + } + + + public function down() + { + $db = DBManager::get(); + + $db->exec( + "DELETE FROM `config` WHERE `field` IN ( + 'LIBRARY_ADD_ITEM_ACTION_DESCRIPTION', + 'COURSE_LIBRARY_CITATION_STYLE', + 'USER_LIBRARY_CITATION_STYLE' + )" + ); + $db->exec( + "DELETE FROM `config_values` WHERE `field` IN ( + 'LIBRARY_ADD_ITEM_ACTION_DESCRIPTION', + 'COURSE_LIBRARY_CITATION_STYLE', + 'USER_LIBRARY_CITATION_STYLE' + )" + ); + + $db->exec( + "CREATE TABLE `lit_catalog` ( + `catalog_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `mkdate` int(11) NOT NULL DEFAULT '0', + `chdate` int(11) NOT NULL DEFAULT '0', + `lit_plugin` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Studip', + `accession_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `dc_creator` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `dc_subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_description` text COLLATE utf8mb4_unicode_ci, + `dc_publisher` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_contributor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_date` date DEFAULT NULL, + `dc_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_format` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_identifier` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_language` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `dc_relation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_coverage` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `dc_rights` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`catalog_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC" + ); + + $db->exec( + "CREATE TABLE `lit_list` ( + `list_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `range_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `format` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `mkdate` int(11) NOT NULL DEFAULT '0', + `chdate` int(11) NOT NULL DEFAULT '0', + `priority` smallint(6) NOT NULL DEFAULT '0', + `visibility` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`list_id`), + KEY `range_id` (`range_id`), + KEY `priority` (`priority`), + KEY `visibility` (`visibility`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;" + ); + + $db->exec( + "CREATE TABLE `lit_list_content` ( + `list_element_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `list_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `catalog_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `mkdate` int(11) NOT NULL DEFAULT '0', + `chdate` int(11) NOT NULL DEFAULT '0', + `note` text COLLATE utf8mb4_unicode_ci, + `priority` smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (`list_element_id`), + KEY `list_id` (`list_id`), + KEY `catalog_id` (`catalog_id`), + KEY `priority` (`priority`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;" + ); + } +} diff --git a/db/migrations/1.288_tic9898_add_course_wizard_step.php b/db/migrations/1.288_tic9898_add_course_wizard_step.php new file mode 100644 index 0000000..cf3e956 --- /dev/null +++ b/db/migrations/1.288_tic9898_add_course_wizard_step.php @@ -0,0 +1,34 @@ +exec( + "INSERT IGNORE INTO `coursewizardsteps` + (`id`, `name`, `classname`, `number`, `enabled`, `mkdate`, `chdate`) + VALUES + (MD5('StudyAreasLVGroupsCombinedWizardStep'), 'Studienbereich oder LV-Gruppe', 'StudyAreasLVGroupsCombinedWizardStep', '3', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())" + ); + } + + + public function down() + { + $db = DBManager::get(); + + $db->exec( + "DELETE FROM `StudyAreasLVGroupsCombinedWizardStep` + WHERE `id` = MD5('')" + ); + } + + + public function description() + { + return 'Adds a new course wizard step to assign at least a study area or a LV group.'; + } +} diff --git a/db/migrations/1.289_tic10318_http_proxy.php b/db/migrations/1.289_tic10318_http_proxy.php new file mode 100644 index 0000000..9f84f41 --- /dev/null +++ b/db/migrations/1.289_tic10318_http_proxy.php @@ -0,0 +1,40 @@ +prepare('INSERT IGNORE INTO config (field, value, type, `range`, section, mkdate, chdate, description) + VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); + $stmt->execute([ + 'name' => 'HTTP_PROXY', + 'description' => 'externe http Anfragen über proxy', + 'range' => 'global', + 'type' => 'string', + 'value' => '', + 'section' => 'global' + ]); + $stmt->execute([ + 'name' => 'HTTP_PROXY_IGNORE', + 'description' => 'Kommaseparierte Liste mit Hostnamen, die nicht über Proxy aufgerufen werden sollen', + 'range' => 'global', + 'type' => 'string', + 'value' => '', + 'section' => 'global' + ]); + } + + public function down() + { + $db = DBManager::get(); + + $db->execute('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?', ['HTTP_PROXY']); + $db->execute('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?', ['HTTP_PROXY_IGNORE']); + } +} diff --git a/db/migrations/1.28_delete_wiki_links.php b/db/migrations/1.28_delete_wiki_links.php new file mode 100644 index 0000000..9397264 --- /dev/null +++ b/db/migrations/1.28_delete_wiki_links.php @@ -0,0 +1,29 @@ +exec("DELETE FROM wiki_links + USING wiki_links + LEFT JOIN wiki ON ( wiki_links.range_id = wiki.range_id + AND wiki_links.from_keyword = wiki.keyword ) + WHERE wiki.keyword IS NULL"); + } +} diff --git a/db/migrations/1.290_termsconfig.php b/db/migrations/1.290_termsconfig.php new file mode 100644 index 0000000..a8b2ad2 --- /dev/null +++ b/db/migrations/1.290_termsconfig.php @@ -0,0 +1,35 @@ +prepare($query); + $statement->bindValue(':field', 'TERMS_CONFIG'); + $statement->bindValue(':value', json_encode(['compulsory' => false, 'denial_message' => ''])); + $statement->bindValue(':description', 'In case the terms are not compulsory, user can deny them.' . + 'if denial_message is not set, a default text is displayed.'); + $statement->execute(); + } + + public function down() + { + $query = "DELETE FROM `config` WHERE `field` = :field"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':field', 'TERMS_CONFIG'); + $statement->execute(); + } +} diff --git a/db/migrations/1.291_step345_wiki_ancestor.php b/db/migrations/1.291_step345_wiki_ancestor.php new file mode 100644 index 0000000..889e17f --- /dev/null +++ b/db/migrations/1.291_step345_wiki_ancestor.php @@ -0,0 +1,21 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `wiki` DROP COLUMN `ancestor`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.292_add_admin_courses_sidebar_active_elements.php b/db/migrations/1.292_add_admin_courses_sidebar_active_elements.php new file mode 100644 index 0000000..c58e47e --- /dev/null +++ b/db/migrations/1.292_add_admin_courses_sidebar_active_elements.php @@ -0,0 +1,36 @@ +exec( + "INSERT IGNORE INTO `config` + (`field`, `value`, `type`, `range`, `description`) + VALUES + ( + 'ADMIN_COURSES_SIDEBAR_ACTIVE_ELEMENTS', + '', + 'string', + 'user', + 'Diese Einstellung legt fest, welche Elemente in der Seitenleiste der Veranstaltungsübersicht für Admins sichtbar sind.' + )" + ); + } + + + Public function down() + { + $c = DBManager::get(); + + $c->exec( + "DELETE FROM `config` WHERE `field` = 'ADMIN_COURSES_SIDEBAR_ACTIVE_ELEMENTS'" + ); + $c->exec( + "DELETE FROM `config_values` where `field` = 'ADMIN_COURSES_SIDEBAR_ACTIVE_ELEMENTS'" + ); + } +} diff --git a/db/migrations/1.293_adjust_i18n_tables.php b/db/migrations/1.293_adjust_i18n_tables.php new file mode 100644 index 0000000..488d617 --- /dev/null +++ b/db/migrations/1.293_adjust_i18n_tables.php @@ -0,0 +1,21 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `i18n` + CHANGE COLUMN `table` `table` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + CHANGE COLUMN `field` `field` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + CHANGE COLUMN `lang` `lang` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.294_mvv_bugs.php b/db/migrations/1.294_mvv_bugs.php new file mode 100644 index 0000000..baf5ceb --- /dev/null +++ b/db/migrations/1.294_mvv_bugs.php @@ -0,0 +1,66 @@ +exec($query); + + // Allow decimal credit point specifications + $query = "ALTER TABLE `mvv_modul` + MODIFY COLUMN `kp` DOUBLE(5,2) DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil` + MODIFY COLUMN `kp` DOUBLE(5,2) DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilabschnitt` + MODIFY COLUMN `kp` DOUBLE(5,2) DEFAULT NULL"; + DBManager::get()->exec($query); + + // Adjust config sections for mvv + $query = "UPDATE `config` + SET `section` = 'mvv' + WHERE `field` LIKE 'MVV%'"; + DBManager::get()->exec($query); + } + + public function down() + { + // Remove table mvv_extern_contacts + $query = "DROP TABLE IF EXISTS `mvv_extern_contacts`"; + DBManager::get()->exec($query); + + // Disallow decimal credit point specifications + $query = "ALTER TABLE `mvv_modul` + MODIFY COLUMN `kp` INT(11) DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil` + MODIFY COLUMN `kp` INT(11) DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilabschnitt` + MODIFY COLUMN `kp` INT(11) DEFAULT NULL"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.295_remove_invalid_modul_user_assignments.php b/db/migrations/1.295_remove_invalid_modul_user_assignments.php new file mode 100644 index 0000000..26074cc --- /dev/null +++ b/db/migrations/1.295_remove_invalid_modul_user_assignments.php @@ -0,0 +1,22 @@ +exec($query); + } +} diff --git a/db/migrations/1.296_biest_10803_fix.php b/db/migrations/1.296_biest_10803_fix.php new file mode 100755 index 0000000..0c25127 --- /dev/null +++ b/db/migrations/1.296_biest_10803_fix.php @@ -0,0 +1,132 @@ + + * @see https://develop.studip.de/trac/ticket/10803 + */ +class Biest10803Fix extends Migration +{ + public function description() + { + return 'This migration will cleanup mvv_modul_deskriptor and add ' + . 'a unique key on column modul_id'; + } + + public function up() + { + // Select neccessary modul ids + $query = "SELECT `modul_id` + FROM `mvv_modul_deskriptor` + GROUP BY `modul_id` + HAVING COUNT(*) > 1"; + $statement = DBManager::get()->query($query); + $modul_ids = $statement->fetchAll(PDO::FETCH_COLUMN); + + // Prepare statement that reads all deskriptor info + $query = "SELECT * + FROM `mvv_modul_deskriptor` + WHERE `modul_id` = :id + ORDER BY `chdate` ASC"; + $data_statement = DBManager::get()->prepare($query); + + // Prepare query that updates a module deskriptor + $query = "UPDATE `mvv_modul_deskriptor` + SET `verantwortlich` = :verantwortlich, + `bezeichnung` = :bezeichnung, + `voraussetzung` = :voraussetzung, + `kompetenzziele` = :kompetenzziele, + `inhalte` = :inhalte, + `literatur` = :literatur, + `links` = :links, + `kommentar` = :kommentar, + `turnus` = :turnus, + `kommentar_kapazitaet` = :kommentar_kapazitaet, + `kommentar_sws` = :kommentar_sws, + `kommentar_wl_selbst` = :kommentar_wl_selbst, + `kommentar_wl_pruef` = :kommentar_wl_pruef, + `kommentar_note` = :kommentar_note, + `pruef_vorleistung` = :pruef_vorleistung, + `pruef_leistung` = :pruef_leistung, + `pruef_wiederholung` = :pruef_wiederholung, + `ersatztext` = :ersatztext + WHERE `deskriptor_id` = :id"; + $update_statement = DBManager::get()->prepare($query); + + // Prepare statements that removes all unneccessary deskriptors + $query = "DELETE FROM `mvv_modul_deskriptor` + WHERE `deskriptor_id` IN (:ids)"; + $remove_statement = DBManager::get()->prepare($query); + + // For each module id, gather all info chronologically and combine + // them. This way, hopefully no valid information will be lost. + foreach ($modul_ids as $modul_id) { + $data_statement->bindValue(':id', $modul_id); + $data_statement->execute(); + $data_statement->setFetchMode(PDO::FETCH_ASSOC); + + $remove_desk_ids = []; + + $data = []; + foreach ($data_statement as $row) { + if (!$data) { + $data = $row; + continue; + } + + foreach ($row as $key => $value) { + if (in_array($key, ['deskriptor_id', 'mkdate', 'chdate'])) { + continue; + } + if ($value || $row['author_id'] || $row['editor_id']) { + $data[$key] = $value; + } + } + + $remove_desk_ids[] = $row['deskriptor_id']; + } + + $update_statement->bindValue(':verantwortlich', $data['verantwortlich']); + $update_statement->bindValue(':bezeichnung', $data['bezeichnung']); + $update_statement->bindValue(':voraussetzung', $data['voraussetzung']); + $update_statement->bindValue(':kompetenzziele', $data['kompetenzziele']); + $update_statement->bindValue(':inhalte', $data['inhalte']); + $update_statement->bindValue(':literatur', $data['literatur']); + $update_statement->bindValue(':links', $data['links']); + $update_statement->bindValue(':kommentar', $data['kommentar']); + $update_statement->bindValue(':turnus', $data['turnus']); + $update_statement->bindValue(':kommentar_kapazitaet', $data['kommentar_kapazitaet']); + $update_statement->bindValue(':kommentar_sws', $data['kommentar_sws']); + $update_statement->bindValue(':kommentar_wl_selbst', $data['kommentar_wl_selbst']); + $update_statement->bindValue(':kommentar_wl_pruef', $data['kommentar_wl_pruef']); + $update_statement->bindValue(':kommentar_note', $data['kommentar_note']); + $update_statement->bindValue(':pruef_vorleistung', $data['pruef_vorleistung']); + $update_statement->bindValue(':pruef_leistung', $data['pruef_leistung']); + $update_statement->bindValue(':pruef_wiederholung', $data['pruef_wiederholung']); + $update_statement->bindValue(':ersatztext', $data['ersatztext']); + $update_statement->bindValue(':id', $data['deskriptor_id']); + $update_statement->execute(); + + if ($remove_desk_ids) { + $remove_statement->bindValue(':ids', $remove_desk_ids); + $remove_statement->execute(); + } + } + + // Add unique key on column modul_id + $query = "ALTER TABLE `mvv_modul_deskriptor` + DROP KEY `modul_id`, + ADD UNIQUE KEY `modul_id` (`modul_id`)"; + DBManager::get()->exec($query); + } + + public function down() + { + // Drop unique key on column modul_id + $query = "ALTER TABLE `mvv_modul_deskriptor` + DROP KEY `modul_id`, + ADD KEY `modul_id` (`modul_id`)"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.297_database_changes_tic_9218.php b/db/migrations/1.297_database_changes_tic_9218.php new file mode 100644 index 0000000..cdab698 --- /dev/null +++ b/db/migrations/1.297_database_changes_tic_9218.php @@ -0,0 +1,3112 @@ +exec($query); + + $query = "ALTER TABLE `activities` + CHANGE COLUMN `context_id` `context_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionfactor` + CHANGE COLUMN `list_id` `list_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `owner_id` `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionrules` + CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionrule_compat` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionrule_inst` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institute_id` `institute_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admission_condition` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `filter_id` `filter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admission_conditiongroup` + CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admission_seminar_user` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `mkdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `archiv` + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `heimat_inst_id` `heimat_inst_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `archiv_file_id` `archiv_file_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `archiv_protected_file_id` `archiv_protected_file_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `archiv_user` + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `auth_extern` + CHANGE COLUMN `studip_user_id` `studip_user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `auth_user_md5` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `auto_insert_user` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `aux_lock_rules` + CHANGE COLUMN `lock_id` `lock_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `banner_ads` + CHANGE COLUMN `ad_id` `ad_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `startdate` `startdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `enddate` `enddate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `priority` `priority` INT(11) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `views` `views` INT(11) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `clicks` `clicks` INT(11) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_comments` + CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_events_queue` + CHANGE COLUMN `item_id` `item_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_external_contact` + CHANGE COLUMN `external_contact_id` `external_contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_follower` + CHANGE COLUMN `studip_user_id` `studip_user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `external_contact_id` `external_contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `left_follows_right` `left_follows_right` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_mentions` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_tags` + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_threads` + CHANGE COLUMN `context_id` `context_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `visible_in_stream` `visible_in_stream` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `commentable` `commentable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + try { + $query = "ALTER TABLE `blubber_threads_unfollow` + CHANGE COLUMN `thread_id` `thread_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + } catch (Exception $e) { + $query = "ALTER TABLE `blubber_threads_followstates` + CHANGE COLUMN `thread_id` `thread_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + } + + $query = "ALTER TABLE `calendar_event` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `event_id` `event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `group_status` `group_status` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `calendar_user` + CHANGE COLUMN `owner_id` `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `comments` + CHANGE COLUMN `comment_id` `comment_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `conditionaladmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `conditions_stopped` `conditions_stopped` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `config` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `config_values` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `contact` + CHANGE COLUMN `owner_id` `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `content_terms_of_use_entries` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `is_default` `is_default` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `coursememberadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `coursesets` + CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `algorithm_run` `algorithm_run` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `private` `private` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `courseset_factorlist` + CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `factorlist_id` `factorlist_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `courseset_institute` + CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institute_id` `institute_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `courseset_rule` + CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `coursewizardsteps` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `enabled` `enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `cronjobs_schedules` + CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `cronjobs_tasks` + CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `datafields` + CHANGE COLUMN `datafield_id` `datafield_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `is_required` `is_required` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `is_userfilter` `is_userfilter` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `datafields_entries` + CHANGE COLUMN `datafield_id` `datafield_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `sec_range_id` `sec_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `deputies` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `edit_about` `edit_about` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_assignments` + CHANGE COLUMN `start` `start` INT(11) UNSIGNED NULL, + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NULL, + CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_assignment_attempts` + CHANGE COLUMN `start` `start` INT(11) UNSIGNED NULL, + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_assignment_ranges` + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_responses` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_tasks` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_tests` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_test_tasks` + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval` + CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `startdate` `startdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `stopdate` `stopdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `timespan` `timespan` INT(11) UNSIGNED NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `shared` `shared` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalanswer` + CHANGE COLUMN `evalanswer_id` `evalanswer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `rows` `rows` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `counter` `counter` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `residual` `residual` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalanswer_user` + CHANGE COLUMN `evalanswer_id` `evalanswer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `evaldate` `evaldate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalgroup` + CHANGE COLUMN `evalgroup_id` `evalgroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mandatory` `mandatory` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalquestion` + CHANGE COLUMN `evalquestion_id` `evalquestion_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `multiplechoice` `multiplechoice` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_group_template` + CHANGE COLUMN `evalgroup_id` `evalgroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_range` + CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_templates` + CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `institution_id` `institution_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `show_questions` `show_questions` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `show_total_stats` `show_total_stats` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `show_graphics` `show_graphics` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `show_questionblock_headline` `show_questionblock_headline` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `show_group_headline` `show_group_headline` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_templates_eval` + CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_templates_user` + CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_user` + CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `event_data` + CHANGE COLUMN `event_id` `event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `start` `start` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `ts` `ts` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `expire` `expire` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `importdate` `importdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `extern_config` + CHANGE COLUMN `config_id` `config_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `is_standard` `is_standard` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `ex_termine` + CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `autor_id` `autor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `date` `date` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `fach` + CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `feedback` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `results_visible` `results_visible` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `commentable` `commentable` TINYINT(1) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `feedback_entries` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `files` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `files_search_attributes` + CHANGE COLUMN `file_ref_mkdate` `file_ref_mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `file_ref_chdate` `file_ref_chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `semester_start` `semester_start` INT(11) UNSIGNED NULL, + CHANGE COLUMN `semester_end` `semester_end` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `files_search_index` + CHANGE COLUMN `file_ref_id` `file_ref_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `file_refs` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `file_id` `file_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `folder_id` `folder_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `content_terms_of_use_id` `content_terms_of_use_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `folders` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_abo_users` + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_categories` + CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_categories_entries` + CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_entries` + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `latest_chdate` `latest_chdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `closed` `closed` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `sticky` `sticky` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_entries_issues` + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `issue_id` `issue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_favorites` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_likes` + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_visits` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `visitdate` `visitdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `last_visitdate` `last_visitdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `globalsearch_buzzwords` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `global_resource_locks` + CHANGE COLUMN `lock_id` `lock_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `grading_definitions` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `grading_instances` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_content` + CHANGE COLUMN `global_content_id` `global_content_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `custom` `custom` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tours` + CHANGE COLUMN `global_tour_id` `global_tour_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_audiences` + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_settings` + CHANGE COLUMN `tour_id` `tour_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_steps` + CHANGE COLUMN `interactive` `interactive` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_user` + CHANGE COLUMN `tour_id` `tour_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `completed` `completed` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `i18n` + CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `Institute` + CHANGE COLUMN `Institut_id` `Institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `fakultaets_id` `fakultaets_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `srienabled` `srienabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `institute_plan_columns` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `kategorien` + CHANGE COLUMN `kategorie_id` `kategorie_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `limitedadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lockedadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lock_rules` + CHANGE COLUMN `lock_id` `lock_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `loginbackgrounds` + CHANGE COLUMN `mobile` `mobile` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `desktop` `desktop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `in_release` `in_release` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `log_actions` + CHANGE COLUMN `action_id` `action_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `expires` `expires` INT(11) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `log_events` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `action_id` `action_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `affected_range_id` `affected_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `coaffected_range_id` `coaffected_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lti_data` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lti_grade` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lti_tool` + CHANGE COLUMN `allow_custom_url` `allow_custom_url` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `deep_linking` `deep_linking` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `send_lis_person` `send_lis_person` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mail_queue_entries` + CHANGE COLUMN `mail_queue_id` `mail_queue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `message_id` `message_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `tries` `tries` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `last_try` `last_try` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `media_cache` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `message` + CHANGE COLUMN `message_id` `message_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `autor_id` `autor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `show_adressees` `show_adressees` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `message_tags` + CHANGE COLUMN `message_id` `message_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `message_user` + CHANGE COLUMN `readed` `readed` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `deleted` `deleted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `answered` `answered` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_abschl_kategorie` + CHANGE COLUMN `kategorie_id` `kategorie_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_abschl_zuord` + CHANGE COLUMN `abschluss_id` `abschluss_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `kategorie_id` `kategorie_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_aufbaustudiengang` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_contacts` + CHANGE COLUMN `contact_id` `contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_contacts_ranges` + CHANGE COLUMN `contact_range_id` `contact_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `contact_id` `contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_extern_contacts` + CHANGE COLUMN `extern_contact_id` `extern_contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_fach_inst` + CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_files` + CHANGE COLUMN `mvvfile_id` `mvvfile_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `extern_visible` `extern_visible` TINYINT(1) UNSIGNED NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_files_filerefs` + CHANGE COLUMN `mvvfile_id` `mvvfile_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `fileref_id` `fileref_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_files_ranges` + CHANGE COLUMN `mvvfile_id` `mvvfile_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_lvgruppe` + CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_lvgruppe_modulteil` + CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `fn_id` `fn_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_lvgruppe_seminar` + CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul` + CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) UNSIGNED NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil` + CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `ausgleichbar` `ausgleichbar` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `pflicht` `pflicht` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil_deskriptor` + CHANGE COLUMN `deskriptor_id` `deskriptor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil_language` + CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil_stgteilabschnitt` + CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `abschnitt_id` `abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul_deskriptor` + CHANGE COLUMN `deskriptor_id` `deskriptor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul_inst` + CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul_language` + CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_ovl_conflicts` + CHANGE COLUMN `base_abschnitt_id` `base_abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_modulteil_id` `base_modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_course_id` `base_course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_metadate_id` `base_metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_abschnitt_id` `comp_abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_modulteil_id` `comp_modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_course_id` `comp_course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_metadate_id` `comp_metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_ovl_excludes` + CHANGE COLUMN `selection_id` `selection_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_ovl_selections` + CHANGE COLUMN `selection_id` `selection_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `semester_id` `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_version_id` `base_version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_version_id` `comp_version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `show_excluded` `show_excluded` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteil` + CHANGE COLUMN `stgteil_id` `stgteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilabschnitt` + CHANGE COLUMN `abschnitt_id` `abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `version_id` `version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilabschnitt_modul` + CHANGE COLUMN `abschnitt_modul_id` `abschnitt_modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `abschnitt_id` `abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilversion` + CHANGE COLUMN `version_id` `version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `stgteil_id` `stgteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_sem` `start_sem` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `end_sem` `end_sem` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) UNSIGNED NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteil_bez` + CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stg_stgteil` + CHANGE COLUMN `studiengang_id` `studiengang_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `stgteil_id` `stgteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_studiengang` + CHANGE COLUMN `studiengang_id` `studiengang_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `abschluss_id` `abschluss_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `start` `start` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `end` `end` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) UNSIGNED NULL, + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_studycourse_language` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_studycourse_type` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `news` + CHANGE COLUMN `news_id` `news_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `date` `date` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `expire` `expire` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `allow_comments` `allow_comments` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate_uid` `chdate_uid` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `news_range` + CHANGE COLUMN `news_id` `news_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `object_contentmodules` + CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `object_user_visits` + CHANGE COLUMN `visitdate` `visitdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `last_visitdate` `last_visitdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `object_views` + CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `views` `views` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `opengraphdata` + CHANGE COLUMN `is_opengraph` `is_opengraph` TINYINT(1) UNSIGNED NULL, + CHANGE COLUMN `last_update` `last_update` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `participantrestrictedadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `distribution_time` `distribution_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `passwordadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `personal_notifications_user` + CHANGE COLUMN `seen` `seen` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `plugins_activated` + CHANGE COLUMN `state` `state` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `plugins_default_activations` + CHANGE COLUMN `institutid` `institutid` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `prefadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `favor_semester` `favor_semester` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `prefadmission_condition` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `condition_id` `condition_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `priorities` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaires` + CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `startdate` `startdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `stopdate` `stopdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `editanswers` `editanswers` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `copyable` `copyable` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_anonymous_answers` + CHANGE COLUMN `anonymous_answer_id` `anonymous_answer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_answers` + CHANGE COLUMN `answer_id` `answer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `question_id` `question_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_assignments` + CHANGE COLUMN `assignment_id` `assignment_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_questions` + CHANGE COLUMN `question_id` `question_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `range_tree` + CHANGE COLUMN `item_id` `item_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `studip_object_id` `studip_object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resources` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_bookings` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `repeat_end` `repeat_end` INT(11) UNSIGNED NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `booking_user_id` `booking_user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_booking_intervals` + CHANGE COLUMN `interval_id` `interval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `booking_id` `booking_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_categories` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_category_properties` + CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_permissions` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_properties` + CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_property_definitions` + CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_property_groups` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_requests` + CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `last_modified_by` `last_modified_by` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_request_appointments` + CHANGE COLUMN `request_id` `request_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `appointment_id` `appointment_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_request_properties` + CHANGE COLUMN `request_id` `request_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_temporary_permissions` + CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `schedule` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `schedule_seminare` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `scm` + CHANGE COLUMN `scm_id` `scm_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `semester_data` + CHANGE COLUMN `semester_id` `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `beginn` `beginn` INT(11) UNSIGNED NULL, + CHANGE COLUMN `ende` `ende` INT(11) UNSIGNED NULL, + CHANGE COLUMN `vorles_beginn` `vorles_beginn` INT(11) UNSIGNED NULL, + CHANGE COLUMN `vorles_ende` `vorles_ende` INT(11) UNSIGNED NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `semester_holiday` + CHANGE COLUMN `holiday_id` `holiday_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `semester_id` `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `beginn` `beginn` INT(11) UNSIGNED NULL, + CHANGE COLUMN `ende` `ende` INT(11) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminare` + CHANGE COLUMN `Seminar_id` `Seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `Institut_id` `Institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `status` `status` INT(11) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NULL DEFAULT '0', + CHANGE COLUMN `duration_time` `duration_time` INT(11) NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `parent_course` `parent_course` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_courseset` + CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_cycle_dates` + CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_inst` + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_sem_tree` + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `sem_tree_id` `sem_tree_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_user` + CHANGE COLUMN `Seminar_id` `Seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `bind_calendar` `bind_calendar` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_userdomains` + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `userdomain_id` `userdomain_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `sem_classes` + CHANGE COLUMN `only_inst_user` `only_inst_user` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `bereiche` `bereiche` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `module` `module` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `show_browse` `show_browse` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `write_access_nobody` `write_access_nobody` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `topic_create_autor` `topic_create_autor` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `course_creation_forbidden` `course_creation_forbidden` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `studygroup_mode` `studygroup_mode` TINYINT(1) UNSIGNED NOT NULL, + CHANGE COLUMN `show_raumzeit` `show_raumzeit` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `is_group` `is_group` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `sem_tree` + CHANGE COLUMN `sem_tree_id` `sem_tree_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `studip_object_id` `studip_object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `sem_types` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `separable_rooms` + CHANGE COLUMN `building_id` `building_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `separable_room_parts` + CHANGE COLUMN `room_id` `room_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `smiley` + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `statusgruppen` + CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `selfassign` `selfassign` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `selfassign_start` `selfassign_start` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `selfassign_end` `selfassign_end` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `statusgruppe_user` + CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `inherit` `inherit` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `studygroup_invitations` + CHANGE COLUMN `sem_id` `sem_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `termine` + CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `autor_id` `autor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `date` `date` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `termin_related_groups` + CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `termin_related_persons` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `themen` + CHANGE COLUMN `issue_id` `issue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `themen_termine` + CHANGE COLUMN `issue_id` `issue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `timedadmissions` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userdomains` + CHANGE COLUMN `userdomain_id` `userdomain_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `restricted_access` `restricted_access` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userfilter` + CHANGE COLUMN `filter_id` `filter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userfilter_fields` + CHANGE COLUMN `field_id` `field_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `filter_id` `filter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userlimits` + CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_factorlist` + CHANGE COLUMN `list_id` `list_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_info` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `smsforward_copy` `smsforward_copy` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `smsforward_rec` `smsforward_rec` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `email_forward` `email_forward` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_inst` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `Institut_id` `Institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `externdefault` `externdefault` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_online` + CHANGE COLUMN `last_lifesign` `last_lifesign` INT(11) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_studiengang` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `version_id` `version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_token` + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_userdomains` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `userdomain_id` `userdomain_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_visibility` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `online` `online` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `search` `search` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `email` `email` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_visibility_settings` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `webservice_access_rules` + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `widget_user` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `wiki` + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `wiki_locks` + CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `wiki_page_config` + CHANGE COLUMN `read_restricted` `read_restricted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `edit_restricted` `edit_restricted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, + ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `abschluss` + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NULL, + CHANGE COLUMN `chdate` `chdate` INT(20) NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `activities` + CHANGE COLUMN `context_id` `context_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionfactor` + CHANGE COLUMN `list_id` `list_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `owner_id` `owner_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionrules` + CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionrule_compat` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admissionrule_inst` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institute_id` `institute_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admission_condition` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `filter_id` `filter_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admission_conditiongroup` + CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `admission_seminar_user` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `archiv` + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `start_time` `start_time` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `heimat_inst_id` `heimat_inst_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `archiv_file_id` `archiv_file_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `archiv_protected_file_id` `archiv_protected_file_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `archiv_user` + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `auth_extern` + CHANGE COLUMN `studip_user_id` `studip_user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `auth_user_md5` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `auto_insert_user` + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `aux_lock_rules` + CHANGE COLUMN `lock_id` `lock_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `banner_ads` + CHANGE COLUMN `ad_id` `ad_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `startdate` `startdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `enddate` `enddate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `priority` `priority` INT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `views` `views` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `clicks` `clicks` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_comments` + CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_events_queue` + CHANGE COLUMN `item_id` `item_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_external_contact` + CHANGE COLUMN `external_contact_id` `external_contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_follower` + CHANGE COLUMN `studip_user_id` `studip_user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `external_contact_id` `external_contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `left_follows_right` `left_follows_right` TINYINT(1) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_mentions` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `external_contact` `external_contact` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_tags` + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_threads` + CHANGE COLUMN `context_id` `context_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `visible_in_stream` `visible_in_stream` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `commentable` `commentable` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `chdate` `chdate` INT(11) NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; + DBManager::get()->exec($query); + + try { + $query = "ALTER TABLE `blubber_threads_unfollow` + CHANGE COLUMN `thread_id` `thread_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; + DBManager::get()->exec($query); + } catch (Exception $e) { + $query = "ALTER TABLE `blubber_threads_followstates` + CHANGE COLUMN `thread_id` `thread_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; + DBManager::get()->exec($query); + } + + $query = "ALTER TABLE `calendar_event` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `event_id` `event_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `group_status` `group_status` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `calendar_user` + CHANGE COLUMN `owner_id` `owner_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `comments` + CHANGE COLUMN `comment_id` `comment_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `conditionaladmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `conditions_stopped` `conditions_stopped` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `config` + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `config_values` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `contact` + CHANGE COLUMN `owner_id` `owner_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + DROP COLUMN `mkdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `content_terms_of_use_entries` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `is_default` `is_default` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `coursememberadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `coursesets` + CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `algorithm_run` `algorithm_run` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `private` `private` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `courseset_factorlist` + CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `factorlist_id` `factorlist_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `courseset_institute` + CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institute_id` `institute_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `courseset_rule` + CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `coursewizardsteps` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `enabled` `enabled` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `cronjobs_schedules` + CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `cronjobs_tasks` + CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `datafields` + CHANGE COLUMN `datafield_id` `datafield_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL, + CHANGE COLUMN `is_required` `is_required` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `is_userfilter` `is_userfilter` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `datafields_entries` + CHANGE COLUMN `datafield_id` `datafield_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL, + CHANGE COLUMN `sec_range_id` `sec_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `deputies` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `edit_about` `edit_about` TINYINT(1) NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_assignments` + CHANGE COLUMN `start` `start` INT(11) NULL, + CHANGE COLUMN `end` `end` INT(11) NULL, + CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_assignment_attempts` + CHANGE COLUMN `start` `start` INT(11) NULL, + CHANGE COLUMN `end` `end` INT(11) NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_assignment_ranges` + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_responses` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_tasks` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_tests` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `etask_test_tasks` + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval` + CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `startdate` `startdate` INT(20) NULL, + CHANGE COLUMN `stopdate` `stopdate` INT(20) NULL, + CHANGE COLUMN `timespan` `timespan` INT(20) NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `shared` `shared` TINYINT(1) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalanswer` + CHANGE COLUMN `evalanswer_id` `evalanswer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `rows` `rows` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `counter` `counter` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `residual` `residual` TINYINT(1) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalanswer_user` + CHANGE COLUMN `evalanswer_id` `evalanswer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `evaldate` `evaldate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalgroup` + CHANGE COLUMN `evalgroup_id` `evalgroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mandatory` `mandatory` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `evalquestion` + CHANGE COLUMN `evalquestion_id` `evalquestion_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `multiplechoice` `multiplechoice` TINYINT(1) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_group_template` + CHANGE COLUMN `evalgroup_id` `evalgroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_range` + CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_templates` + CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `institution_id` `institution_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `show_questions` `show_questions` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `show_total_stats` `show_total_stats` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `show_graphics` `show_graphics` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `show_questionblock_headline` `show_questionblock_headline` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `show_group_headline` `show_group_headline` TINYINT(1) NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_templates_eval` + CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_templates_user` + CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `eval_user` + CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `event_data` + CHANGE COLUMN `event_id` `event_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `start` `start` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `ts` `ts` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `expire` `expire` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `importdate` `importdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `extern_config` + CHANGE COLUMN `config_id` `config_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `is_standard` `is_standard` INT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `ex_termine` + CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `autor_id` `autor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `date` `date` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `fach` + CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `feedback` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `results_visible` `results_visible` TINYINT(4) UNSIGNED NOT NULL, + CHANGE COLUMN `commentable` `commentable` TINYINT(4) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `feedback_entries` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `files` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `files_search_attributes` + CHANGE COLUMN `file_ref_mkdate` `file_ref_mkdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `file_ref_chdate` `file_ref_chdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `semester_start` `semester_start` INT(20) UNSIGNED NULL, + CHANGE COLUMN `semester_end` `semester_end` INT(20) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `files_search_index` + CHANGE COLUMN `file_ref_id` `file_ref_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `file_refs` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `file_id` `file_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `folder_id` `folder_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `content_terms_of_use_id` `content_terms_of_use_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `folders` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_abo_users` + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_categories` + CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_categories_entries` + CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_entries` + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL, + CHANGE COLUMN `latest_chdate` `latest_chdate` INT(11) NULL, + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL, + CHANGE COLUMN `closed` `closed` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `sticky` `sticky` INT(1) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_entries_issues` + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `issue_id` `issue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_favorites` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_likes` + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `forum_visits` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `visitdate` `visitdate` INT(11) NOT NULL, + CHANGE COLUMN `last_visitdate` `last_visitdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `globalsearch_buzzwords` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `global_resource_locks` + CHANGE COLUMN `lock_id` `lock_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `grading_definitions` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `grading_instances` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_content` + CHANGE COLUMN `global_content_id` `global_content_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `custom` `custom` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `visible` `visible` TINYINT(4) NOT NULL DEFAULT '1', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tours` + CHANGE COLUMN `global_tour_id` `global_tour_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_audiences` + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_settings` + CHANGE COLUMN `tour_id` `tour_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `active` `active` TINYINT(4) NOT NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_steps` + CHANGE COLUMN `interactive` `interactive` TINYINT(4) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `help_tour_user` + CHANGE COLUMN `tour_id` `tour_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `completed` `completed` TINYINT(4) NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `i18n` + CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `Institute` + CHANGE COLUMN `Institut_id` `Institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `fakultaets_id` `fakultaets_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `srienabled` `srienabled` TINYINT(4) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `institute_plan_columns` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `kategorien` + CHANGE COLUMN `kategorie_id` `kategorie_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `limitedadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lockedadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lock_rules` + CHANGE COLUMN `lock_id` `lock_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `loginbackgrounds` + CHANGE COLUMN `mobile` `mobile` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `desktop` `desktop` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `in_release` `in_release` TINYINT(1) NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `log_actions` + CHANGE COLUMN `action_id` `action_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `expires` `expires` INT(20) NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `log_events` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `action_id` `action_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `affected_range_id` `affected_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `coaffected_range_id` `coaffected_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lti_data` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lti_grade` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `lti_tool` + CHANGE COLUMN `allow_custom_url` `allow_custom_url` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `deep_linking` `deep_linking` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `send_lis_person` `send_lis_person` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mail_queue_entries` + CHANGE COLUMN `mail_queue_id` `mail_queue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `message_id` `message_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `tries` `tries` INT(11) NOT NULL, + CHANGE COLUMN `last_try` `last_try` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `media_cache` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `message` + CHANGE COLUMN `message_id` `message_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `autor_id` `autor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `show_adressees` `show_adressees` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `message_tags` + CHANGE COLUMN `message_id` `message_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `message_user` + CHANGE COLUMN `readed` `readed` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `deleted` `deleted` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `answered` `answered` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_abschl_kategorie` + CHANGE COLUMN `kategorie_id` `kategorie_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_abschl_zuord` + CHANGE COLUMN `abschluss_id` `abschluss_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `kategorie_id` `kategorie_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_aufbaustudiengang` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_contacts` + CHANGE COLUMN `contact_id` `contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_contacts_ranges` + CHANGE COLUMN `contact_range_id` `contact_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `contact_id` `contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_extern_contacts` + CHANGE COLUMN `extern_contact_id` `extern_contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_fach_inst` + CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_files` + CHANGE COLUMN `mvvfile_id` `mvvfile_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `extern_visible` `extern_visible` TINYINT(1) NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_files_filerefs` + CHANGE COLUMN `mvvfile_id` `mvvfile_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `fileref_id` `fileref_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_files_ranges` + CHANGE COLUMN `mvvfile_id` `mvvfile_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_lvgruppe` + CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_lvgruppe_modulteil` + CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `fn_id` `fn_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_lvgruppe_seminar` + CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul` + CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil` + CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `ausgleichbar` `ausgleichbar` INT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `pflicht` `pflicht` INT(2) NOT NULL DEFAULT '0', + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil_deskriptor` + CHANGE COLUMN `deskriptor_id` `deskriptor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil_language` + CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modulteil_stgteilabschnitt` + CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `abschnitt_id` `abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul_deskriptor` + CHANGE COLUMN `deskriptor_id` `deskriptor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul_inst` + CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_modul_language` + CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_ovl_conflicts` + CHANGE COLUMN `base_abschnitt_id` `base_abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_modulteil_id` `base_modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_course_id` `base_course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_metadate_id` `base_metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_abschnitt_id` `comp_abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_modulteil_id` `comp_modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_course_id` `comp_course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_metadate_id` `comp_metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_ovl_excludes` + CHANGE COLUMN `selection_id` `selection_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_ovl_selections` + CHANGE COLUMN `selection_id` `selection_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `semester_id` `semester_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `base_version_id` `base_version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `comp_version_id` `comp_version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `show_excluded` `show_excluded` INT(1) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteil` + CHANGE COLUMN `stgteil_id` `stgteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilabschnitt` + CHANGE COLUMN `abschnitt_id` `abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `version_id` `version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilabschnitt_modul` + CHANGE COLUMN `abschnitt_modul_id` `abschnitt_modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `abschnitt_id` `abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteilversion` + CHANGE COLUMN `version_id` `version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `stgteil_id` `stgteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_sem` `start_sem` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `end_sem` `end_sem` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stgteil_bez` + CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_stg_stgteil` + CHANGE COLUMN `studiengang_id` `studiengang_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `stgteil_id` `stgteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_studiengang` + CHANGE COLUMN `studiengang_id` `studiengang_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `abschluss_id` `abschluss_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `start` `start` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `end` `end` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) NULL, + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_studycourse_language` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `mvv_studycourse_type` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `news` + CHANGE COLUMN `news_id` `news_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `date` `date` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `expire` `expire` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `allow_comments` `allow_comments` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate_uid` `chdate_uid` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `news_range` + CHANGE COLUMN `news_id` `news_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `object_contentmodules` + CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `object_user_visits` + CHANGE COLUMN `visitdate` `visitdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `last_visitdate` `last_visitdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `object_views` + CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `views` `views` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `opengraphdata` + CHANGE COLUMN `is_opengraph` `is_opengraph` TINYINT(2) NULL, + CHANGE COLUMN `last_update` `last_update` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `participantrestrictedadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `distribution_time` `distribution_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `passwordadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `personal_notifications_user` + CHANGE COLUMN `seen` `seen` TINYINT(1) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `plugins_activated` + CHANGE COLUMN `state` `state` TINYINT(1) NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `plugins_default_activations` + CHANGE COLUMN `institutid` `institutid` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `prefadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `favor_semester` `favor_semester` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `prefadmission_condition` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `condition_id` `condition_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `priorities` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaires` + CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `startdate` `startdate` BIGINT(20) NULL, + CHANGE COLUMN `stopdate` `stopdate` BIGINT(20) NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `editanswers` `editanswers` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `copyable` `copyable` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_anonymous_answers` + CHANGE COLUMN `anonymous_answer_id` `anonymous_answer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_answers` + CHANGE COLUMN `answer_id` `answer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `question_id` `question_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_assignments` + CHANGE COLUMN `assignment_id` `assignment_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `questionnaire_questions` + CHANGE COLUMN `question_id` `question_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `range_tree` + CHANGE COLUMN `item_id` `item_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `studip_object_id` `studip_object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resources` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_bookings` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `begin` `begin` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `repeat_end` `repeat_end` INT(20) NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `booking_user_id` `booking_user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_booking_intervals` + CHANGE COLUMN `interval_id` `interval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `booking_id` `booking_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `begin` `begin` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `end` `end` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_categories` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_category_properties` + CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_permissions` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_properties` + CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_property_definitions` + CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_property_groups` + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_requests` + CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `last_modified_by` `last_modified_by` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_request_appointments` + CHANGE COLUMN `request_id` `request_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `appointment_id` `appointment_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_request_properties` + CHANGE COLUMN `request_id` `request_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_temporary_permissions` + CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `schedule` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `schedule_seminare` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `scm` + CHANGE COLUMN `scm_id` `scm_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `semester_data` + CHANGE COLUMN `semester_id` `semester_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `beginn` `beginn` INT(20) UNSIGNED NULL, + CHANGE COLUMN `ende` `ende` INT(20) UNSIGNED NULL, + CHANGE COLUMN `vorles_beginn` `vorles_beginn` INT(20) UNSIGNED NULL, + CHANGE COLUMN `vorles_ende` `vorles_ende` INT(20) UNSIGNED NULL, + CHANGE COLUMN `visible` `visible` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `semester_holiday` + CHANGE COLUMN `holiday_id` `holiday_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `semester_id` `semester_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `beginn` `beginn` INT(20) UNSIGNED NULL, + CHANGE COLUMN `ende` `ende` INT(20) UNSIGNED NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminare` + CHANGE COLUMN `Seminar_id` `Seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `Institut_id` `Institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `status` `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `start_time` `start_time` INT(20) NULL DEFAULT '0', + CHANGE COLUMN `duration_time` `duration_time` INT(20) NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `visible` `visible` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1', + CHANGE COLUMN `parent_course` `parent_course` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_courseset` + CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_cycle_dates` + CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_inst` + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_sem_tree` + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `sem_tree_id` `sem_tree_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_user` + CHANGE COLUMN `Seminar_id` `Seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `bind_calendar` `bind_calendar` TINYINT(1) NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `seminar_userdomains` + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `userdomain_id` `userdomain_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `sem_classes` + CHANGE COLUMN `only_inst_user` `only_inst_user` TINYINT(4) NOT NULL, + CHANGE COLUMN `bereiche` `bereiche` TINYINT(4) NOT NULL, + CHANGE COLUMN `module` `module` TINYINT(4) NOT NULL, + CHANGE COLUMN `show_browse` `show_browse` TINYINT(4) NOT NULL, + CHANGE COLUMN `write_access_nobody` `write_access_nobody` TINYINT(4) NOT NULL, + CHANGE COLUMN `topic_create_autor` `topic_create_autor` TINYINT(4) NOT NULL, + CHANGE COLUMN `visible` `visible` TINYINT(4) NOT NULL, + CHANGE COLUMN `course_creation_forbidden` `course_creation_forbidden` TINYINT(4) NOT NULL, + CHANGE COLUMN `studygroup_mode` `studygroup_mode` TINYINT(4) NOT NULL, + CHANGE COLUMN `show_raumzeit` `show_raumzeit` TINYINT(4) NOT NULL DEFAULT '1', + CHANGE COLUMN `is_group` `is_group` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `sem_tree` + CHANGE COLUMN `sem_tree_id` `sem_tree_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `studip_object_id` `studip_object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `sem_types` + CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, + CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `separable_rooms` + CHANGE COLUMN `building_id` `building_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `separable_room_parts` + CHANGE COLUMN `room_id` `room_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `smiley` + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NULL, + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `statusgruppen` + CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `selfassign` `selfassign` TINYINT(4) NOT NULL DEFAULT '0', + CHANGE COLUMN `selfassign_start` `selfassign_start` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `selfassign_end` `selfassign_end` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `statusgruppe_user` + CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `visible` `visible` TINYINT(4) NOT NULL DEFAULT '1', + CHANGE COLUMN `inherit` `inherit` TINYINT(4) NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `studygroup_invitations` + CHANGE COLUMN `sem_id` `sem_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `termine` + CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `autor_id` `autor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `date` `date` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `termin_related_groups` + CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `termin_related_persons` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `themen` + CHANGE COLUMN `issue_id` `issue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `themen_termine` + CHANGE COLUMN `issue_id` `issue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `timedadmissions` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userdomains` + CHANGE COLUMN `userdomain_id` `userdomain_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `restricted_access` `restricted_access` TINYINT(1) NOT NULL DEFAULT '1'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userfilter` + CHANGE COLUMN `filter_id` `filter_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userfilter_fields` + CHANGE COLUMN `field_id` `field_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `filter_id` `filter_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `userlimits` + CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_factorlist` + CHANGE COLUMN `list_id` `list_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_info` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', + CHANGE COLUMN `smsforward_copy` `smsforward_copy` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `smsforward_rec` `smsforward_rec` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `email_forward` `email_forward` TINYINT(4) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_inst` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `Institut_id` `Institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', + CHANGE COLUMN `externdefault` `externdefault` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + CHANGE COLUMN `visible` `visible` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_online` + CHANGE COLUMN `last_lifesign` `last_lifesign` INT(10) UNSIGNED NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_studiengang` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `version_id` `version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_token` + DROP COLUMN `mkdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_userdomains` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `userdomain_id` `userdomain_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_visibility` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + CHANGE COLUMN `online` `online` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `search` `search` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `email` `email` TINYINT(1) NOT NULL DEFAULT '1', + CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `user_visibility_settings` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `webservice_access_rules` + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `widget_user` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `wiki` + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + CHANGE COLUMN `chdate` `chdate` INT(11) NULL, + DROP COLUMN `mkdate`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `wiki_locks` + CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `wiki_page_config` + CHANGE COLUMN `read_restricted` `read_restricted` TINYINT(1) NOT NULL DEFAULT '0', + CHANGE COLUMN `edit_restricted` `edit_restricted` TINYINT(1) NOT NULL DEFAULT '0', + DROP COLUMN `mkdate`, + DROP COLUMN `chdate`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.298_hide_studygroups_from_profile.php b/db/migrations/1.298_hide_studygroups_from_profile.php new file mode 100644 index 0000000..ebcf8f8 --- /dev/null +++ b/db/migrations/1.298_hide_studygroups_from_profile.php @@ -0,0 +1,31 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'HIDE_STUDYGROUPS_FROM_PROFILE'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.299_tiled_courses.php b/db/migrations/1.299_tiled_courses.php new file mode 100644 index 0000000..b6be586 --- /dev/null +++ b/db/migrations/1.299_tiled_courses.php @@ -0,0 +1,53 @@ +exec($query); + + // Add UserConfig + $query = "INSERT IGNORE INTO `config` ( + `field`, `value`, `type`, `range`, + `section`, `description`, + `mkdate`, `chdate` + ) VALUES ( + 'MY_COURSES_TILED_DISPLAY', '0', 'boolean', 'user', + 'MeineVeranstaltungen', 'Hat die Kachelansicht unter \"Meine Veranstaltungen\" aktiviert', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + ), ( + 'MY_COURSES_SHOW_NEW_ICONS_ONLY', '0', 'boolean', 'user', + 'MeineVeranstaltungen', 'Nur Icons für neue Inhalte sollen angezeigt werden', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + )"; + DBManager::get()->exec($query); + } + + public function down() + { + // Remove Config and UserConfig + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` IN ( + 'MY_COURSES_ALLOW_TILED_DISPLAY', + 'MY_COURSES_TILED_DISPLAY', + 'MY_COURSES_SHOW_NEW_ICONS_ONLY' + )"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.29_step_00138_studienbereichszuordnung.php b/db/migrations/1.29_step_00138_studienbereichszuordnung.php new file mode 100644 index 0000000..d6b4b1d --- /dev/null +++ b/db/migrations/1.29_step_00138_studienbereichszuordnung.php @@ -0,0 +1,43 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + */ + +class Step00138Studienbereichszuordnung extends Migration +{ + public function description() { + return 'Adds the new Value SEM_TREE_ALLOW_BRANCH_ASSIGN to table config.'; + } + + public function up() + { + $this->announce("add new value SEM_TREE_ALLOW_BRANCH_ASSIGN to table config"); + + $db = DBManager::get(); + $db->exec("INSERT IGNORE INTO `config` ". + "VALUES ('34f348c06bbd5d9fc7bb36a8d829e12e', '', ". + "'SEM_TREE_ALLOW_BRANCH_ASSIGN', '1', 1, 'boolean', 'global', ". + "'', 0, 1222947575, 1222947575, ". + "'Diese Option beeinflusst die Möglichkeit, Veranstaltungen ". + "entweder nur an die Blätter oder überall in der ". + "Veranstaltungshierarchie einhängen zu dürfen.', '', '')"); + + $this->announce("done."); + } + + + public function down() + { + $this->announce("remove value SEM_TREE_ALLOW_BRANCH_ASSIGN from table config"); + + DBManager::get()->exec("DELETE FROM `config` WHERE `field` = 'SEM_TREE_ALLOW_BRANCH_ASSIGN'"); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.2_step_102_datenfeldtypen.php b/db/migrations/1.2_step_102_datenfeldtypen.php new file mode 100644 index 0000000..1e7b552 --- /dev/null +++ b/db/migrations/1.2_step_102_datenfeldtypen.php @@ -0,0 +1,116 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + */ + + +class Step102Datenfeldtypen extends Migration { + + function description() { + return 'modify db schema for StEP00102 to provide typed datafields'; + } + + function up() { + DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `object_type` `object_type` enum('sem','inst','user','userinstrole','usersemdata','roleinstdata') default NULL;"); + DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `view_perms` `view_perms` enum('all','user','autor','tutor','dozent','admin','root') default NULL;"); + DBManager::get()->exec("ALTER TABLE `datafields` ADD `type` enum('bool','textline','textarea','selectbox','date','time','email','url','phone', 'radio', 'combo') NOT NULL default 'textline';"); + DBManager::get()->exec("ALTER TABLE `datafields` ADD `typeparam` text NOT NULL;"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` ADD `sec_range_id` varchar(32) NOT NULL default '';"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP PRIMARY KEY , ADD PRIMARY KEY ( `datafield_id` , `range_id` , `sec_range_id` );"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` ADD INDEX `range_id` ( `range_id` , `datafield_id` );"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` ADD INDEX `datafield_id_2` (`datafield_id`,`sec_range_id`);"); + DBManager::get()->exec("ALTER TABLE `statusgruppe_user` ADD `visible` tinyint(4) NOT NULL default '1';"); + DBManager::get()->exec("ALTER TABLE `statusgruppe_user` ADD `inherit` tinyint(4) NOT NULL default '1';"); + DBManager::get()->exec("CREATE TABLE `aux_lock_rules` (`lock_id` varchar( 32 ) NOT NULL default '', `name` varchar( 255 ) NOT NULL default '', `description` text NOT NULL , `attributes` text NOT NULL , `sorting` text NOT NULL , PRIMARY KEY ( `lock_id` )) ENGINE=MyISAM;"); + DBManager::get()->exec("ALTER TABLE `seminare` ADD `aux_lock_rule` varchar(32) default NULL;"); + + $this->migrate_datafields(); + } + + function down() { + DBManager::get()->exec("ALTER TABLE `seminare` DROP `aux_lock_rule`;"); + DBManager::get()->exec("DROP TABLE `aux_lock_rules`;"); + DBManager::get()->exec("ALTER TABLE `statusgruppe_user` DROP `inherit`;"); + DBManager::get()->exec("ALTER TABLE `statusgruppe_user` DROP `visible`;"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP INDEX `datafield_id_2`;"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP INDEX `range_id`;"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP PRIMARY KEY , ADD PRIMARY KEY ( `datafield_id` , `range_id` );"); + DBManager::get()->exec("ALTER TABLE `datafields_entries` DROP `sec_range_id`;"); + DBManager::get()->exec("ALTER TABLE `datafields` DROP `type`;"); + DBManager::get()->exec("ALTER TABLE `datafields` DROP `typeparam`;"); + DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `view_perms` `view_perms` enum('all','user','autor','tutor','dozent','admin','root') NOT NULL default 'all';"); + DBManager::get()->exec("ALTER TABLE `datafields` CHANGE `object_type` `object_type` ENUM('sem','inst','user') default NULL;"); + } + + function migrate_datafields() { + + # only require, if exists + if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] + . '/config/config_datafields.inc.php')) { + return; + } + require_once 'config/config_datafields.inc.php'; + + if (!isset($DATAFIELDS)) { + return; + } + + require_once 'lib/classes/DataFieldStructure.class.php'; + + $ids = array_keys(DataFieldStructure::getDataFieldStructures()); + + foreach ($DATAFIELDS as $id => $field) { + + if (!in_array($id, $ids)) { + $this->write('Not existent: ' . $id); + continue; + } + + $struct = new DataFieldStructure(['datafield_id' => $id]); + + $mapping = ['text' => 'textline', + 'textarea' => 'textarea', + 'checkbox' => 'bool', + 'select' => 'selectbox', + 'combo' => 'combo', + 'radio' => 'radio', + 'date' => 'date']; + + if (!isset($mapping[$field['type']])) { + # TODO (mlunzena) what to do? + } + + $type = $mapping[$field['type']]; + $type_param = ''; + + if (in_array($type, ['selectbox', 'combo', 'radio'])) { + $type_param = $this->get_type_param($field['options']); + } + + $struct->setType($type); + $struct->setTypeParam($type_param); + $struct->store(); + } + } + + function get_type_param($options) { + $new_options = []; + foreach ((array)$options as $key => $value) { + if (is_string($value)) { + $new_options[] = $value; + } + else { + $new_options[] = $value['name']; + } + } + return join("\n", $new_options); + } +} diff --git a/db/migrations/1.300_tiled_courses_2.php b/db/migrations/1.300_tiled_courses_2.php new file mode 100644 index 0000000..5d9b038 --- /dev/null +++ b/db/migrations/1.300_tiled_courses_2.php @@ -0,0 +1,34 @@ +value, true); + $open_groups = array_keys($open_groups); + $value->value = json_encode($open_groups); + $value->store(); + }, + 'MY_COURSES_OPEN_GROUPS' + ); + } + + public function down() + { + ConfigValue::findEachByField( + function ($value) { + $open_groups = json_decode($value->value, true); + $open_groups = array_fill_keys($open_groups, true); + $value->value = json_encode($open_groups); + $value->store(); + }, + 'MY_COURSES_OPEN_GROUPS' + ); + } +} diff --git a/db/migrations/1.301_tiled_courses_3.php b/db/migrations/1.301_tiled_courses_3.php new file mode 100644 index 0000000..79b6f7e --- /dev/null +++ b/db/migrations/1.301_tiled_courses_3.php @@ -0,0 +1,31 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'MY_COURSES_TILED_DISPLAY_RESPONSIVE'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.302_add_missing_indices_resources.php b/db/migrations/1.302_add_missing_indices_resources.php new file mode 100644 index 0000000..a3da2c2 --- /dev/null +++ b/db/migrations/1.302_add_missing_indices_resources.php @@ -0,0 +1,40 @@ +query($query); + + if ($result && $result->rowCount() > 0) { + return; + } + + $query = "ALTER TABLE `resource_temporary_permissions` ADD INDEX (`user_id`)"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_temporary_permissions` ADD INDEX (`resource_id`)"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `resource_temporary_permissions` + DROP INDEX `user_id`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `resource_temporary_permissions` + DROP INDEX `resource_id`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.303_add_missing_indices.php b/db/migrations/1.303_add_missing_indices.php new file mode 100644 index 0000000..b1b652b --- /dev/null +++ b/db/migrations/1.303_add_missing_indices.php @@ -0,0 +1,43 @@ + + * @license GPL2 or any later version + * @see https://develop.studip.de/trac/ticket/10882 + */ +class AddMissingIndices extends Migration +{ + public function description() + { + return 'Adds missing indices for tables `activities` and `plugins_activated`'; + } + + public function up() + { + // avoid running this migration twice + $query = "SHOW INDEX FROM activities WHERE Key_name = 'object_id'"; + $result = DBManager::get()->query($query); + + if ($result && $result->rowCount() > 0) { + return; + } + + $query = "ALTER TABLE `activities` + ADD INDEX `object_id` (`object_id`(32))"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `plugins_activated` + ADD INDEX `range` (`range_id`, `range_type`)"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `activities` + DROP INDEX `object_id`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `plugins_activated` + DROP INDEX `range`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.304_config_i18n.php b/db/migrations/1.304_config_i18n.php new file mode 100644 index 0000000..4d4c291 --- /dev/null +++ b/db/migrations/1.304_config_i18n.php @@ -0,0 +1,36 @@ +exec($query); + } + + public function down() + { + $query = "DELETE `i18n` + FROM `config` + JOIN `i18n` + ON `i18n`.`object_id` = CAST(MD5(`config`.`field`) AS CHAR CHARACTER SET latin1) + AND `i18n`.`table` = 'config' + AND `i18n`.`field` = 'value' + WHERE `config`.`type` = 'i18n'"; + DBManager::get()->exec($query); + + $query = "UPDATE `config` + SET `type` = 'string' + WHERE `type` = 'i18n'"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `config` + CHANGE COLUMN `type` `type` ENUM('boolean','integer','string','array') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'string'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.305_course_members_hide.php b/db/migrations/1.305_course_members_hide.php new file mode 100644 index 0000000..0043f67 --- /dev/null +++ b/db/migrations/1.305_course_members_hide.php @@ -0,0 +1,32 @@ +prepare($query); + $statement->execute([ + ':name' => 'COURSE_MEMBERS_HIDE', + ':description' => 'Über diese Option können Sie die Teilnehmendenliste für Studierende der Veranstaltung unsichtbar machen', + ':range' => 'course', + ':type' => 'boolean', + ':value' => '0' + ]); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'COURSE_MEMBERS_HIDE'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.306_tic_9101.php b/db/migrations/1.306_tic_9101.php new file mode 100644 index 0000000..02e1b44 --- /dev/null +++ b/db/migrations/1.306_tic_9101.php @@ -0,0 +1,54 @@ + 7, + 2 => 1, + 3 => 2, + 4 => 8, + 5 => 4, + 6 => 9, + 7 => 6, + 8 => 3, + 9 => 5, + 10 => 14, + 11 => 10, + 12 => 11, + 13 => 14, + 14 => 13, + 15 => 12, + ]; + + public function description() + { + return 'Align colors in schedule with color mapping in my courses'; + } + + public function up() + { + $query = "UPDATE `schedule_seminare` + SET `color` = :new + WHERE `color` = :old"; + $statement = DBManager::get()->prepare($query); + + foreach (self::MAPPING as $old => $new) { + $statement->bindValue(':new', $new); + $statement->bindValue(':old', $old); + $statement->execute(); + } + } + + public function down() + { + $query = "UPDATE `schedule_seminare` + SET `color` = :new + WHERE `color` = :old"; + $statement = DBManager::get()->prepare($query); + + foreach (self::MAPPING as $old => $new) { + $statement->bindValue(':new', $old); + $statement->bindValue(':old', $new); + $statement->execute(); + } + } +} diff --git a/db/migrations/1.307_introduce_range_config.php b/db/migrations/1.307_introduce_range_config.php new file mode 100644 index 0000000..0fada12 --- /dev/null +++ b/db/migrations/1.307_introduce_range_config.php @@ -0,0 +1,28 @@ +exec($query); + } + + public function down() + { + $quey = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING(`field`) + WHERE `range` IN ('range', 'institute')"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `config` + CHANGE COLUMN `range` `range` ENUM('global', 'user', 'course') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'global'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.308_consultation_extension.php b/db/migrations/1.308_consultation_extension.php new file mode 100644 index 0000000..749211f --- /dev/null +++ b/db/migrations/1.308_consultation_extension.php @@ -0,0 +1,171 @@ +exec($query); + + $query = "UPDATE `config` + SET `section` = 'Terminvergabe' + WHERE `section` = 'Sprechstunden'"; + DBManager::get()->exec($query); + + // Allow participants to be visible to other participants + $query = "ALTER TABLE `consultation_blocks` + ADD COLUMN `show_participants` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `calendar_events`, + ADD COLUMN `require_reason` ENUM('no', 'optional', 'yes') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'optional' AFTER `show_participants`, + ADD COLUMN `confirmation_text` TEXT NULL DEFAULT NULL AFTER `require_reason`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `consultation_bookings` + CHANGE COLUMN `reason` `reason` TEXT NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + // Allow more ranges + $query = "ALTER TABLE `consultation_blocks` + DROP INDEX `teacher_id`, + CHANGE COLUMN `teacher_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + ADD COLUMN `range_type` ENUM('user', 'course', 'institute') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL AFTER `range_id`, + ADD COLUMN `teacher_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL AFTER `range_type`, + ADD INDEX `range` (`range_id`, `range_type`), + ADD INDEX `teacher_id` (`teacher_id`)"; + DBManager::get()->exec($query); + + $query = "UPDATE `consultation_blocks` + SET `range_type` = 'user'"; + DBManager::get()->exec($query); + + $query = "UPDATE `consultation_blocks` AS cb0 + JOIN `consultation_blocks` AS cb1 USING (`block_id`) + SET cb0.`range_id` = cb1.`course_id`, + cb0.`range_type` = 'course', + cb0.`teacher_id` = cb1.`range_id` + WHERE cb0.`course_id` IS NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `consultation_blocks` + DROP COLUMN `course_id`"; + DBManager::get()->exec($query); + + // install as core plugin + $query = "INSERT IGNORE INTO `plugins` ( + `pluginclassname`, `pluginname`, `plugintype`, `enabled`, `navigationpos` + ) VALUES ( + 'ConsultationModule', 'Terminvergabe', 'StandardPlugin,SystemPlugin,PrivacyPlugin,HomepagePlugin', 'yes', 1 + )"; + DBManager::get()->exec($query); + + $plugin_id = DBManager::get()->lastInsertId(); + + $sql = "INSERT IGNORE INTO `roles_plugins` (`roleid`, `pluginid`) + SELECT `roleid`, ? + FROM `roles` + WHERE `system` = 'y'"; + DBManager::get()->execute($sql, [$plugin_id]); + + $sql = "INSERT IGNORE INTO `plugins_activated` + SELECT DISTINCT ?, 'user', `range_id`, 1 + FROM `consultation_blocks` + WHERE range_type = 'user'"; + DBManager::get()->execute($sql, [$plugin_id]); + + $sql = "INSERT IGNORE INTO `plugins_activated` + SELECT DISTINCT ?, 'sem', `range_id`, 1 + FROM `consultation_blocks` + WHERE range_type = 'course'"; + DBManager::get()->execute($sql, [$plugin_id]); + + RESTAPI\ConsumerPermissions::get('global')->activateRouteMap( + new RESTAPI\Routes\Consultations() + ); + } + + public function down() + { + $query = "DELETE FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` IN ( + 'CONSULTATION_GARBAGE_COLLECT', + 'CONSULTATION_SHOW_GROUPED', + 'CONSULTATION_TAB_TITLE' + )"; + DBManager::get()->exec($query); + + // Allow participants to be visible to other participants + $query = "ALTER TABLE `consultation_blocks` + DROP COLUMN `show_participants`, + DROP COLUMN `require_reason`, + DROP COLUMN `confirmation_text`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `consultation_bookings` + CHANGE COLUMN `reason` `reason` TEXT NOT NULL"; + DBManager::get()->exec($query); + + // Disallow more ranges + $query = "ALTER TABLE `consultation_blocks` + ADD COLUMN `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL"; + DBManager::get()->exec($query); + + $query = "DELETE FROM `consultation_blocks` + WHERE `range_type` = 'institute'"; + DBManager::get()->exec($query); + + $query = "UPDATE `consultation_blocks` AS cb0 + JOIN `consultation_blocks` AS cb1 USING (`block_id`) + SET cb0.`course_id` = cb1.`range_id`, + cb0.`range_id` = cb1.`teacher_id` + WHERE cb0.`course_id` IS NOT NULL"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `consultation_blocks` + DROP INDEX `teacher_id`, + DROP INDEX `range`, + DROP COLUMN `teacher_id`, + DROP COLUMN `range_type`, + CHANGE COLUMN `range_id` `teacher_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + ADD INDEX `teacher_id` (`teacher_id`)"; + DBManager::get()->exec($query); + + // Delete core plugin + $query = "DELETE `plugins`, `roles_plugins` + FROM `plugins` + LEFT JOIN `roles_plugins` USING (`pluginid`) + WHERE `pluginclassname` = 'ConsultationModule'"; + DBManager::get()->exec($query); + + // Deactivate routemap + RESTAPI\ConsumerPermissions::get('global')->deactivateRouteMap( + new RESTAPI\Routes\Consultations() + ); + } +} diff --git a/db/migrations/1.309_course_groups_hide.php b/db/migrations/1.309_course_groups_hide.php new file mode 100644 index 0000000..cebb403 --- /dev/null +++ b/db/migrations/1.309_course_groups_hide.php @@ -0,0 +1,32 @@ +prepare($query); + $statement->execute([ + ':name' => 'COURSE_MEMBERGROUPS_HIDE', + ':description' => 'Über diese Option können Sie die Teilnehmendengruppenliste für Studierende der Veranstaltung unsichtbar machen', + ':range' => 'course', + ':type' => 'boolean', + ':value' => '0' + ]); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'COURSE_MEMBERGROUPS_HIDE'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.30_auth_user_md5_perms.php b/db/migrations/1.30_auth_user_md5_perms.php new file mode 100644 index 0000000..96d8115 --- /dev/null +++ b/db/migrations/1.30_auth_user_md5_perms.php @@ -0,0 +1,23 @@ +exec("ALTER TABLE auth_user_md5 ADD KEY perms (perms)"); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE auth_user_md5 DROP KEY perms"); + } +} +?> diff --git a/db/migrations/1.310_add_seminare_semester_table.php b/db/migrations/1.310_add_seminare_semester_table.php new file mode 100644 index 0000000..f38e936 --- /dev/null +++ b/db/migrations/1.310_add_seminare_semester_table.php @@ -0,0 +1,43 @@ +exec( + "CREATE TABLE IF NOT EXISTS `semester_courses` ( + `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `mkdate` INT(10) NOT NULL DEFAULT '0', + `chdate` INT(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`semester_id`, `course_id`) + );" + ); + + //This select looks unorthodox but I am trying to catch even broken + //database entries for when start_time and duration_time don't exactly + //match the begin or end of the semester. + DBManager::get()->exec(" + INSERT IGNORE INTO `semester_courses` + (`semester_id`, `course_id`, `mkdate`, `chdate`) + SELECT `semester_data`.`semester_id`, `seminare`.`Seminar_id`, `seminare`.`mkdate`, `seminare`.`chdate` + FROM `seminare` + INNER JOIN `semester_data` ON (`seminare`.`start_time` < `semester_data`.`ende` + AND ( + (`seminare`.`start_time` >= `semester_data`.`beginn` AND `seminare`.`duration_time` = '0') + OR (`seminare`.`duration_time` > 0 AND `seminare`.`start_time` + `seminare`.`duration_time` > `semester_data`.`beginn`) + ) + )" + ); + } + + public function down() + { + DBManager::get()->exec("DROP TABLE IF EXISTS `semester_courses`;"); + } +} diff --git a/db/migrations/1.311_add_seminare_semester_course_index.php b/db/migrations/1.311_add_seminare_semester_course_index.php new file mode 100644 index 0000000..f81e008 --- /dev/null +++ b/db/migrations/1.311_add_seminare_semester_course_index.php @@ -0,0 +1,24 @@ +exec(" + ALTER TABLE `semester_courses` + ADD KEY `course_id` (`course_id`) + "); + } + + public function down() + { + DBManager::get()->exec(" + ALTER TABLE `semester_courses` + DROP KEY `course_id` + "); + } +} diff --git a/db/migrations/1.312_tic_11041.php b/db/migrations/1.312_tic_11041.php new file mode 100644 index 0000000..3c517a2 --- /dev/null +++ b/db/migrations/1.312_tic_11041.php @@ -0,0 +1,23 @@ +exec($query); + } + + public function down() + { + $query = "ALTER TABLE `lti_tool` + DROP COLUMN `oauth_signature_method`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.313_tic11044_admin_course_notices.php b/db/migrations/1.313_tic11044_admin_course_notices.php new file mode 100644 index 0000000..c5c1a2f --- /dev/null +++ b/db/migrations/1.313_tic11044_admin_course_notices.php @@ -0,0 +1,49 @@ +fetchColumn($query) ?: 0; + + $query = "INSERT IGNORE INTO `datafields` ( + `datafield_id`, `name`, + `object_type`, `object_class`, + `edit_perms`, `view_perms`, + `system`, `priority`, + `mkdate`, `chdate`, + `type`, `typeparam`, + `is_required`, `is_userfilter`, + `description` + ) VALUES ( + :id, 'Notiz zu einer Veranstaltung', + 'sem', NULL, + 'admin', 'admin', + 1, :priority, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'textarea', '', + 0, 0, + 'Enthält etwaige Notizen von Admins zu Veranstaltungen' + )"; + DBManager::get()->execute($query, [ + ':id' => md5(uniqid(__CLASS__, true)), + ':priority' => $priority, + ]); + } + + public function down() + { + $query = "DELETE `datafields`, `datafields_entries` + FROM `datafields` + LEFT JOIN `datafields_entries` USING (`datafield_id`) + WHERE `datafields`.`name` = 'Notiz zu einer Veranstaltung'"; + DBManager::get()->execute($query); + } +} diff --git a/db/migrations/1.314_step_00349.php b/db/migrations/1.314_step_00349.php new file mode 100644 index 0000000..d124622 --- /dev/null +++ b/db/migrations/1.314_step_00349.php @@ -0,0 +1,650 @@ + ['id' => 20, 'const' => '', 'sem' => true, 'inst' => false], + 'admin' => ['id' => 17, 'const' => '', 'sem' => true, 'inst' => false], + 'forum' => ['id' => 0, 'const' => '', 'sem' => true, 'inst' => true], + 'documents' => ['id' => 1, 'const' => '', 'sem' => true, 'inst' => true], + 'schedule' => ['id' => 2, 'const' => '', 'sem' => true, 'inst' => false], + 'participants' => ['id' => 3, 'const' => '', 'sem' => true, 'inst' => false], + 'personal' => ['id' => 4, 'const' => '', 'sem' => false, 'inst' => true], + 'wiki' => ['id' => 8, 'const' => 'WIKI_ENABLE', 'sem' => true, 'inst' => true], + 'scm' => ['id' => 12, 'const' => 'SCM_ENABLE', 'sem' => true, 'inst' => true], + 'elearning_interface' => ['id' => 13, 'const' => 'ELEARNING_INTERFACE_ENABLE', 'sem' => true, 'inst' => true], + 'calendar' => ['id' => 16, 'const' => 'COURSE_CALENDAR_ENABLE', 'sem' => true, 'inst' => true], + ]; + private $notification_modules = [ + 'basicdata' => 27, + 'votes' => 26, + 'news' => 25, + 'forum' => 0, + 'documents' => 1, + 'schedule' => 2, + 'participants' => 3, + 'wiki' => 8, + 'scm' => 12, + 'elearning_interface' => 13 + ]; + + public function description() + { + return 'add table `tools_activated`; migrate data from plugins_activated and seminare.modules; add CorePlugins'; + } + + public function up() + { + $db = DBManager::get(); + $db->execute("CREATE TABLE IF NOT EXISTS `tools_activated` ( + `range_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `range_type` enum('course','institute') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `plugin_id` int(10) UNSIGNED NOT NULL, + `position` tinyint(3) UNSIGNED NOT NULL, + `metadata` json DEFAULT NULL, + `mkdate` int(10) UNSIGNED NOT NULL, + `chdate` int(10) UNSIGNED NOT NULL, + PRIMARY KEY (`range_id`,`plugin_id`), + KEY (`plugin_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); + + $db->execute("CREATE TABLE IF NOT EXISTS `seminar_user_notifications` ( + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `seminar_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `notification_data` json DEFAULT NULL, + `chdate` int(10) UNSIGNED NOT NULL, + `mkdate` int(10) UNSIGNED NOT NULL, + PRIMARY KEY (`user_id`,`seminar_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); + + $core_plugins = [ + 'IliasInterfaceModule', + 'LtiToolModule', + 'GradebookModule', + 'FeedbackModule', + 'ConsultationModule', + 'CoreForum', + 'Blubber', + 'CoursewareModule' + ]; + $studip_modules = [ + 'CoreOverview', + 'CoreAdmin', + 'CoreStudygroupAdmin', + //??? 'CoreStudygroupOverview', + 'CoreDocuments', + 'CoreParticipants', + 'CoreStudygroupParticipants', + 'CoreSchedule', + 'CoreScm', + 'CoreWiki', + 'CoreCalendar', + 'CoreElearningInterface', + 'CorePersonal' + ]; + $ouv_mapping = [ + 'sem' => 0, + 'inst'=> 0, + 'basicdata' => 0, + 'vote' => -1, + 'eval' => -2, + 'news' => 'CoreOverview', + 'documents' => 'CoreDocuments', + 'schedule' => 'CoreSchedule', + 'scm' => 'CoreScm', + 'wiki' => 'CoreWiki', + 'elearning_interface' => 'CoreElearningInterface', + 'ilias_interface' => 'IliasInterfaceModule', + 'participants' => 'CoreParticipants', + 'courseware' => 'CoursewareModule' + ]; + PluginManager::getInstance()->getPlugin('CoreForum'); + PluginManager::getInstance()->getPlugin('Blubber'); + + foreach ($core_plugins as $plugin) { + try { + $info = new ReflectionClass($plugin); + } catch (ReflectionException $e) { + continue; + } + $ifaces = array_merge(['CorePlugin'], $info->getInterfaceNames()); + $db->execute("UPDATE plugins SET plugintype=? WHERE pluginclassname=?", [join(',', $ifaces), $plugin]); + } + foreach ($studip_modules as $module) { + $info = new ReflectionClass($module); + $ifaces = array_merge(['CorePlugin'], $info->getInterfaceNames()); + $db->execute("INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) + VALUES (?, ?, ?, 'yes', 1)", [$module, $module, join(',', $ifaces)]); + $db->execute("INSERT INTO roles_plugins (roleid, pluginid) SELECT roleid, ? FROM roles WHERE `system` = 'y'", [$db->lastInsertId()]); + } + + $all_plugins = $db->fetchPairs("SELECT pluginclassname, pluginid FROM plugins"); + + foreach ($db->query("SELECT seminar_id, status, modules FROM seminare") as $row) { + $activated_plugins = $db->fetchPairs("SELECT plugins_activated.pluginid, state FROM `plugins_activated` INNER JOIN `plugins` USING(pluginid) WHERE range_id=? AND range_type='sem' ORDER BY navigationpos", [$row['seminar_id']]); + $modules = $this->getLocalModules('sem', $row['modules'], $row['status']); + $pos = 0; + foreach ($modules as $pos => $module) { + if (isset($all_plugins[$module]) && !(isset($activated_plugins[$all_plugins[$module]]) && $activated_plugins[$all_plugins[$module]] === '0')) { + $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'course', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", + [ + $row['seminar_id'], + $all_plugins[$module], + $pos + ]); + } + } + foreach ($activated_plugins as $plugin_id => $state) { + if (!$state) { + continue; + } + $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'course', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", + [ + $row['seminar_id'], + $plugin_id, + ++$pos + ]); + } + } + + foreach ($db->query("SELECT institut_id, type, modules FROM Institute") as $row) { + $activated_plugins = $db->fetchPairs("SELECT plugins_activated.pluginid, state FROM `plugins_activated` INNER JOIN `plugins` USING(pluginid) WHERE range_id=? AND range_type='inst' ORDER BY navigationpos", [$row['institut_id']]); + $modules = $this->getLocalModules('inst', $row['modules'], $row['type']); + $pos = 0; + foreach ($modules as $pos => $module) { + if (isset($all_plugins[$module]) && !(isset($activated_plugins[$all_plugins[$module]]) && $activated_plugins[$all_plugins[$module]] === '0')) { + $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'institute', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", + [ + $row['institut_id'], + $all_plugins[$module], + $pos + ]); + } + } + foreach ($activated_plugins as $plugin_id => $state) { + if (!$state) { + continue; + } + $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'institute', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", + [ + $row['institut_id'], + $plugin_id, + ++$pos + ]); + } + } + + foreach ($db->query("SELECT seminar_id, user_id, notification FROM seminar_user WHERE notification > 0") as $row) { + $notifications = []; + foreach ($this->notification_modules as $module => $id) { + if ($row['notification'] & pow(2, $id)) { + $plugin_id = $ouv_mapping[$module]; + if (is_string($plugin_id)) { + $plugin_id = $all_plugins[$plugin_id]; + } + if ($plugin_id !== null) { + $notifications[] = $plugin_id; + } + } + } + if (count($notifications)) { + $db->execute("INSERT INTO seminar_user_notifications (user_id, seminar_id, notification_data, chdate, mkdate) VALUES (?,?,?,UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", [$row['user_id'], $row['seminar_id'], json_encode($notifications)]); + } + } + + foreach ($db->query("SELECT range_id, user_id, notification FROM deputies WHERE notification > 0") as $row) { + $notifications = []; + foreach ($this->notification_modules as $module => $id) { + if ($row['notification'] & pow(2, $id)) { + $plugin_id = $ouv_mapping[$module]; + if (!is_int($plugin_id)) { + $plugin_id = $all_plugins[$module]; + } + if ($plugin_id !== null) { + $notifications[] = $plugin_id; + } + } + } + if (count($notifications)) { + $db->execute("INSERT IGNORE INTO seminar_user_notifications (user_id, seminar_id, notification_data, chdate, mkdate) VALUES (?,?,?,UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", [$row['user_id'], $row['range_id'], json_encode($notifications)]); + } + } + + $db->exec("DELETE FROM `object_user_visits` WHERE `type` IN ('literature', 'forum', '')"); + $db->exec("ALTER TABLE `object_user_visits` ADD `plugin_id` INT NOT NULL AFTER `type`"); + foreach ($ouv_mapping as $type => $plugin_id) { + if (is_string($plugin_id)) { + $plugin_id = $all_plugins[$plugin_id]; + } + $db->execute("UPDATE `object_user_visits` SET `plugin_id` = ? WHERE `type` = ?", [$plugin_id, $type]); + } + + $db->exec("ALTER TABLE `object_user_visits` DROP PRIMARY KEY, ADD PRIMARY KEY (`object_id`, `user_id`, `plugin_id`)"); + $db->exec("ALTER TABLE `object_user_visits` DROP `type`"); + $db->exec("ALTER TABLE `seminar_user` DROP `notification`"); + $db->exec("ALTER TABLE `seminare` DROP `modules`"); + $db->exec("ALTER TABLE `Institute` DROP `modules`"); + $db->exec("ALTER TABLE `sem_classes` + DROP `overview`, + DROP `forum`, + DROP `admin`, + DROP `documents`, + DROP `schedule`, + DROP `participants`, + DROP `literature`, + DROP `scm`, + DROP `wiki`, + DROP `resources`, + DROP `calendar`, + DROP `elearning_interface`"); + + } + + private function getLocalModules($range_type, $modules, $type) + { + $old_sem_class = OldSemClass::getClasses(); + if ($range_type === 'sem') { + $class = DBManager::get()->fetchColumn("SELECT class FROM sem_types WHERE id=?", [$type]); + $sem_class = $old_sem_class[$class] ?: OldSemClass::getDefaultSemClass(); + } else { + $sem_class = OldSemClass::getDefaultInstituteClass($type); + } + if (!$modules) { + $modules = 0; + foreach ($this->registered_modules as $slot => $val) { + if ($val[$range_type === 'sem' ? 'sem' : 'inst']) { + $const = $val['const']; + if ($sem_class->isModuleActivated($sem_class->getSlotModule($slot)) && (!$const || Config::get()->$const)) { + $modules += pow(2, $val['id']); + } + } + } + } + $modules_list = []; + $pos = 0; + foreach ($this->registered_modules as $key => $val) { + $module = $sem_class->getSlotModule($key); + if ($sem_class->isModuleAllowed($module)) { + if (($modules & pow(2, $val['id'])) || $sem_class->isSlotMandatory($key)) { + $modules_list[$pos] = $module; + $pos++; + } + } + } + return $modules_list; + } + + public function down() + { + + } +} + + +class OldSemClass implements ArrayAccess +{ + protected $data = []; + protected static $slots = [ + "overview", + "forum", + "admin", + "documents", + "schedule", + "participants", + "scm", + "wiki", + "calendar", + "elearning_interface" + ]; + protected static $core_modules = [ + "CoreOverview", + "CoreAdmin", + "CoreStudygroupAdmin", + "CoreStudygroupOverview", + "CoreDocuments", + "CoreParticipants", + "CoreStudygroupParticipants", + "CoreSchedule", + "CoreScm", + "CoreWiki", + "CoreCalendar", + "CoreElearningInterface" + ]; + protected static $sem_classes = null; + + public static function getDefaultSemClass() + { + $data = [ + 'name' => "Fehlerhafte Seminarklasse!", + 'overview' => "CoreOverview", + 'forum' => "Blubber", + 'admin' => "CoreAdmin", + 'documents' => "CoreDocuments", + 'schedule' => "CoreSchedule", + 'participants' => "CoreParticipants", + 'scm' => "CoreScm", + 'wiki' => "CoreWiki", + 'calendar' => "CoreCalendar", + 'elearning_interface' => "CoreElearningInterface", + 'modules' => '{"CoreOverview":{"activated":1,"sticky":1},"CoreAdmin":{"activated":1,"sticky":1}, "CoreResources":{"activated":1,"sticky":0}}', + 'visible' => 1, + 'is_group' => false + ]; + return new self($data); + } + + /** + * Generates a dummy SemClass for institutes of this type (as defined in config.inc.php). + * @param integer $type institute type + * @return SemClass + */ + public static function getDefaultInstituteClass($type) + { + global $INST_MODULES; + + // fall back to 'default' if modules are not defined + $type = isset($INST_MODULES[$type]) ? $type : 'default'; + + $data = [ + 'name' => 'Generierte Standardinstitutsklasse', + 'visible' => 1, + 'overview' => 'CoreOverview', // always available + 'admin' => 'CoreAdmin' // always available + ]; + $slots = [ + 'forum' => 'Blubber', + 'documents' => 'CoreDocuments', + 'scm' => 'CoreScm', + 'wiki' => 'CoreWiki', + 'calendar' => 'CoreCalendar', + 'elearning_interface' => 'CoreElearningInterface', + 'personal' => 'CorePersonal' + ]; + $modules = [ + 'CoreOverview' => ['activated' => 1, 'sticky' => 1], + 'CoreAdmin' => ['activated' => 1, 'sticky' => 1] + ]; + + foreach ($slots as $slot => $module) { + $data[$slot] = $module; + $modules[$module] = ['activated' => (int)$INST_MODULES[$type][$slot], 'sticky' => 0]; + } + $data['modules'] = json_encode($modules); + + return new self($data); + } + + /** + * Constructor can be set with integer of sem_class_id or an array of + * the old $SEM_CLASS style. + * @param integer | array $data + */ + public function __construct($data) + { + $db = DBManager::get(); + if (is_int($data)) { + $statement = $db->prepare("SELECT * FROM sem_classes WHERE id = :id "); + $statement->execute(['id' => $data]); + $this->data = $statement->fetch(PDO::FETCH_ASSOC); + } else { + $this->data = $data; + } + if ($this->data['modules']) { + $this->data['modules'] = self::object2array(json_decode($this->data['modules'])); + } else { + $this->data['modules'] = []; + } + } + + /** + * Returns the name of the module of the slot or the module itself, if it + * is a plugin. + * @param string $slot + * @return string + */ + public function getSlotModule($slot) + { + if (in_array($slot, self::$slots)) { + return $this->data[$slot]; + } else { + return $slot; + } + } + + + /** + * Returns all metadata of the modules at once. + * @return array: array($module_name => array('sticky' => (bool), 'activated' => (bool)), ...) + */ + public function getModules() + { + return $this->data['modules']; + } + + /** + * Returns true if a module is activated on default for this sem_class. + * @param string $modulename + * @return boolean + */ + public function isModuleActivated($modulename) + { + return !$this->data['modules'][$modulename] + || $this->data['modules'][$modulename]['activated']; + } + + /** + * Returns if a module is allowed to be displayed for this sem_class. + * @param string $modulename + * @return boolean + */ + public function isModuleAllowed($modulename) + { + return !$this->data['modules'][$modulename] + || !$this->data['modules'][$modulename]['sticky'] + || $this->data['modules'][$modulename]['activated']; + } + + /** + * Returns if a module is mandatory for this sem_class. + * @param string $module + * @return boolean + */ + public function isModuleMandatory($module) + { + return $this->data['modules'][$module]['sticky'] + && $this->data['modules'][$module]['activated']; + } + + /** + * Returns if the slot is mandatory, which it is if the module in this + * slot is mandatory. + * @param string $slot + * @return boolean + */ + public function isSlotMandatory($slot) + { + $module = $this->getSlotModule($slot); + return $module && $this->isModuleMandatory($module); + } + + /** + * Returns if a module is a slot module. Good for plugins that should be + * displayed on a specific place only if they are no slot modules. + * @param string $module + * @return boolean + */ + public function isSlotModule($module) + { + foreach (self::$slots as $slot) { + if ($module === $this->getSlotModule($slot)) { + return true; + } + } + return false; + } + + /** + * Returns the slot name of a module. + * @param string $module + * @return string|null + */ + public function getModuleSlot($module) + { + foreach (self::$slots as $slot) { + if ($module === $this->getSlotModule($slot)) { + return $slot; + } + } + return null; + } + + /** + * returns an instance of the module of a given slotname or pluginclassname + * @param string $slot_or_plugin + * @return StudipModule | null + */ + public function getModule($slot_or_plugin) + { + $module = $this->getSlotModule($slot_or_plugin); + if ($module && $this->isModuleAllowed($module)) { + if (in_array($module, self::$core_modules)) { + return new $module(); + } + if ($module) { + return PluginEngine::getPlugin($module); + } + } + } + + + /** + * Sets an attribute of sem_class->data + * @param string $offset + * @param mixed $value + */ + public function set($offset, $value) + { + $this->data[$offset] = $value; + } + + /*************************************************************************** + * ArrayAccess methods * + ***************************************************************************/ + + /** + * deprecated, does nothing, should not be used + * @param string $offset + * @param mixed $value + */ + public function offsetSet($offset, $value) + { + } + + /** + * Compatibility function with old $SEM_CLASS variable for plugins. Maps the + * new array-structure to the old boolean values. + * @param integer $offset : name of attribute + * @return boolean|(localized)string + */ + public function offsetGet($offset) + { + switch ($offset) { + case "name": + return gettext($this->data['name']); + case "only_inst_user": + return (bool)$this->data['only_inst_user']; + case "bereiche": + return (bool)$this->data['bereiche']; + case "show_browse": + return (bool)$this->data['show_browse']; + case "write_access_nobody": + return (bool)$this->data['write_access_nobody']; + case "topic_create_autor": + return (bool)$this->data['topic_create_autor']; + case "visible": + return (bool)$this->data['visible']; + case "forum": + return $this->data['forum'] !== null; + case "documents": + return $this->data['documents'] !== null; + case "schedule": + return $this->data['schedule'] !== null; + case "participants": + return $this->data['participants'] !== null; + case "scm": + return $this->data['scm'] !== null; + case "studygroup_mode": + return (bool)$this->data['studygroup_mode']; + case "admission_prelim_default": + return (int)$this->data['admission_prelim_default']; + case "admission_type_default": + return (int)$this->data['admission_type_default']; + case "is_group": + return (bool)$this->data['is_group']; + } + //ansonsten + return $this->data[$offset]; + } + + /** + * ArrayAccess method to check if an attribute exists. + * @param type $offset + * @return type + */ + public function offsetExists($offset) + { + return isset($this->data[$offset]); + } + + /** + * deprecated, does nothing, should not be used + * @param string $offset + */ + public function offsetUnset($offset) + { + } + + /*************************************************************************** + * static methods * + ***************************************************************************/ + + /** + * Returns an array of all SemClasses in Stud.IP. Equivalent to global + * $SEM_CLASS variable. This variable is statically stored in this class. + * @return array of SemClass + */ + public static function getClasses() + { + if (!is_array(self::$sem_classes)) { + $db = DBManager::get(); + self::$sem_classes = []; + + $statement = $db->prepare( + "SELECT * FROM sem_classes ORDER BY id ASC " + ); + $statement->execute(); + $class_array = $statement->fetchAll(PDO::FETCH_ASSOC); + foreach ($class_array as $sem_class) { + self::$sem_classes[$sem_class['id']] = new self($sem_class); + } + } + return self::$sem_classes; + } + + + /** + * Static method to recursively transform an object into an associative array. + * @param mixed $obj : should be of class StdClass + * @return array + */ + public static function object2array($obj) + { + $arr_raw = is_object($obj) ? get_object_vars($obj) : $obj; + foreach ($arr_raw as $key => $val) { + $val = (is_array($val) || is_object($val)) ? self::object2array($val) : $val; + $arr[$key] = $val; + } + return $arr; + } +} + diff --git a/db/migrations/1.315_tic_8183_terms_admission.php b/db/migrations/1.315_tic_8183_terms_admission.php new file mode 100644 index 0000000..4f619d9 --- /dev/null +++ b/db/migrations/1.315_tic_8183_terms_admission.php @@ -0,0 +1,67 @@ + + * @license GPL2 or any later version + * @since Stud.IP 5.0 + * + * @see https://develop.studip.de/trac/ticket/8183 + */ +class TIC8183TermsAdmission extends Migration +{ + public function description() + { + return 'introduces an admission rule that requires accepting terms of admission'; + } + + public function up() + { + $db = DBManager::get(); + + // table for rule definitions + $db->exec("CREATE TABLE IF NOT EXISTS termsadmissions ( + rule_id varchar(32) COLLATE latin1_bin NOT NULL, + terms text NOT NULL, + mkdate int(11) NOT NULL DEFAULT 0, + chdate int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (rule_id) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + // install rule to database + $db->exec("INSERT IGNORE INTO admissionrules (id, ruletype, active, mkdate, path) + VALUES (0, 'TermsAdmission', 1, UNIX_TIMESTAMP(), 'lib/admissionrules/termsadmission')"); + + // install allowed combinations + $rules = [ + 'ConditionalAdmission', + 'CourseMemberAdmission', + 'LimitedAdmission', + 'ParticipantRestrictedAdmission', + 'PreferentialAdmission', + 'TimedAdmission' + ]; + + $stmt = DBManager::get()->prepare('INSERT IGNORE INTO admissionrule_compat + VALUES (:ruletype, :compat, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())'); + + foreach ($rules as $rule) { + $stmt->execute(['ruletype' => 'TermsAdmission', 'compat' => $rule]); + $stmt->execute(['ruletype' => $rule, 'compat' => 'TermsAdmission']); + } + } + + public function down() + { + $db = DBManager::get(); + + // remove allowed combinations + $db->exec("DELETE FROM admissionrule_compat WHERE rule_type = 'TermsAdmission' OR compat_rule_type = 'TermsAdmission'"); + + // remove entry in admission rule registry + $db->exec("DELETE FROM admissionrules WHERE ruletype = 'TermsAdmission'"); + + // remove rule data table + $db->exec("DROP TABLE termsadmissions"); + } +} diff --git a/db/migrations/1.316_admin_related_inst.php b/db/migrations/1.316_admin_related_inst.php new file mode 100644 index 0000000..f9e5a62 --- /dev/null +++ b/db/migrations/1.316_admin_related_inst.php @@ -0,0 +1,34 @@ +prepare($query); + $statement->execute([ + ':name' => 'ALLOW_ADMIN_RELATED_INST', + ':description' => 'Admins beteiligter Einrichtungen haben die gleiche Rechte an Veranstaltungen wie die Heimateinrichtung', + ':section' => 'global', + ':range' => 'global', + ':type' => 'boolean', + ':value' => '0' + ]); + } + + public function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'ALLOW_ADMIN_RELATED_INST'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.317_oercampus_integration.php b/db/migrations/1.317_oercampus_integration.php new file mode 100644 index 0000000..cc28ee9 --- /dev/null +++ b/db/migrations/1.317_oercampus_integration.php @@ -0,0 +1,436 @@ +prepare(" + SELECT COUNT(*) + FROM `lernmarktplatz_material` + "); + $statement->execute(); + $already_installed_plugin = $statement->fetch(PDO::FETCH_COLUMN, 0) > 0; + } catch (Exception $e) { + $already_installed_plugin = false; + } + + if ($already_installed_plugin) { + //test if all plugin tables are in place + $oldtables = [ + 'lernmarktplatz_abo', + 'lernmarktplatz_comments', + 'lernmarktplatz_downloadcounter', + 'lernmarktplatz_hosts', + 'lernmarktplatz_material_users', + 'lernmarktplatz_reviews', + 'lernmarktplatz_tags', + 'lernmarktplatz_tags_material', + 'lernmarktplatz_user' + ]; + foreach ($oldtables as $tablename) { + $query = "SHOW TABLES LIKE ? "; + $statement = DBManager::get()->prepare($query); + $statement->execute([$tablename]); + if ($statement->rowCount() === 0) { + throw new Exception("Your OER Campus / Lernmarktplatz plugin is not in a current state. Uninstall or update it first, before you restart this migration."); + } + } + } + + + DBManager::get()->exec(" + ALTER TABLE `user_info` + ADD COLUMN `oercampus_description` TEXT DEFAULT NULL + "); + + DBManager::get()->exec(" + UPDATE `user_info` + SET `oercampus_description` = ( + SELECT `content` + FROM `datafields_entries` + WHERE `datafield_id` = MD5('Lernmarktplatz-Beschreibung') + AND `datafields_entries`.`range_id` = `user_info`.`user_id` + LIMIT 1 + ) + "); + + DBManager::get()->exec(" + ALTER TABLE blubber_external_contact + CHANGE COLUMN `mail_identifier` `foreign_id` varchar(256) DEFAULT NULL, + ADD COLUMN `host_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL AFTER `foreign_id`, + ADD COLUMN `avatar_url` varchar(256) DEFAULT NULL AFTER `name` + "); + + DBManager::get()->exec(" + RENAME TABLE `blubber_external_contact` TO `external_users`; + "); + + if ($already_installed_plugin) { + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_abo` TO `oer_abo`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_comments` TO `oer_comments`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_downloadcounter` TO `oer_downloadcounter`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_hosts` TO `oer_hosts`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_material` TO `oer_material`; + "); + DBManager::get()->exec(" + ALTER TABLE `oer_material` + CHANGE license license_identifier varchar(64) NOT NULL DEFAULT 'CC BY SA 3.0' + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_material_users` TO `oer_material_users`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_reviews` TO `oer_reviews`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_tags` TO `oer_tags`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_tags_material` TO `oer_tags_material`; + "); + DBManager::get()->exec(" + RENAME TABLE `lernmarktplatz_user` TO `oer_user`; + "); + + $rename_config = DBManager::get()->prepare(" + UPDATE `config` + SET `field` = :new + WHERE `field` = :old + "); + $rename_config_values = DBManager::get()->prepare(" + UPDATE `config_values` + SET `field` = :new + WHERE `field` = :old + "); + + $rename_config->execute([ + 'old' => "LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD", + 'new' => "OER_USER_DESCRIPTION_DATAFIELD" + ]); + $rename_config_values->execute([ + 'old' => "LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD", + 'new' => "OER_USER_DESCRIPTION_DATAFIELD" + ]); + $rename_config->execute([ + 'old' => "LERNMARKTPLATZ_PUBLIC_STATUS", + 'new' => "OER_PUBLIC_STATUS" + ]); + $rename_config_values->execute([ + 'old' => "LERNMARKTPLATZ_PUBLIC_STATUS", + 'new' => "OER_PUBLIC_STATUS" + ]); + $rename_config->execute([ + 'old' => "LERNMARKTPLATZ_DISABLE_LICENSE", + 'new' => "OER_DISABLE_LICENSE" + ]); + $rename_config_values->execute([ + 'old' => "LERNMARKTPLATZ_DISABLE_LICENSE", + 'new' => "OER_DISABLE_LICENSE" + ]); + + $rename_config->execute([ + 'old' => "LERNMARKTPLATZ_TITLE", + 'new' => "OER_TITLE" + ]); + $rename_config_values->execute([ + 'old' => "LERNMARKTPLATZ_TITLE", + 'new' => "OER_TITLE" + ]); + + $query = "INSERT INTO `config` + SET `field` = :field, + `value` = :value, + `type` = :type, + `range` = :range, + `section` = :section, + `mkdate` = UNIX_TIMESTAMP(), + `chdate` = UNIX_TIMESTAMP(), + `description` = :description"; + $config_statement = DBManager::get()->prepare($query); + + $config_statement->execute([ + ':field' => 'OERCAMPUS_ENABLED', + ':value' => '1', + ':type' => 'boolean', + ':range' => 'global', + ':section' => 'OERCampus', + ':description' => 'Ist der OER Campus aktiviert?', + ]); + + //Alte Dateien des Lernmarktplatzes umziehen: + if (is_dir($GLOBALS['STUDIP_BASE_PATH'].'/data/lehrmarktplatz')) { + foreach (scandir($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz") as $file) { + if ($file[0] !== ".") { + @rename( + $GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz/".$file, + $GLOBALS['OER_PATH']."/".$file + ); + } + } + @unlink($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz"); + } + if (is_dir($GLOBALS['STUDIP_BASE_PATH'].'/data/lehrmarktplatz_images')) { + foreach (scandir($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz_images") as $file) { + if ($file[0] !== ".") { + @rename( + $GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz_images/".$file, + $GLOBALS['OER_LOGOS_PATH']."/".$file + ); + } + } + @unlink($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz_images"); + } + + } else { + DBManager::get()->exec(" + CREATE TABLE `oer_abo` ( + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + UNIQUE KEY `user_id` (`user_id`,`material_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_comments` ( + `comment_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `review_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `foreign_comment_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `comment` text NOT NULL, + `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`comment_id`), + KEY `review_id` (`review_id`), + KEY `foreign_comment_id` (`foreign_comment_id`), + KEY `host_id` (`host_id`), + KEY `user_id` (`user_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_downloadcounter` ( + `counter_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `longitude` double DEFAULT NULL, + `latitude` double DEFAULT NULL, + `mkdate` int(11) DEFAULT NULL, + PRIMARY KEY (`counter_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_hosts` ( + `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(64) NOT NULL, + `url` varchar(200) NOT NULL, + `public_key` text NOT NULL, + `private_key` text DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT 1, + `index_server` tinyint(4) NOT NULL DEFAULT 0, + `allowed_as_index_server` tinyint(4) NOT NULL DEFAULT 1, + `last_updated` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + `mkdate` bigint(20) NOT NULL, + PRIMARY KEY (`host_id`), + UNIQUE KEY `url` (`url`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_material` ( + `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `foreign_material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `name` varchar(64) NOT NULL, + `category` varchar(64) NOT NULL DEFAULT '', + `draft` tinyint(1) NOT NULL DEFAULT 0, + `filename` varchar(64) NOT NULL, + `short_description` varchar(100) DEFAULT NULL, + `description` text NOT NULL, + `difficulty_start` tinyint(12) NOT NULL DEFAULT 1, + `difficulty_end` tinyint(12) NOT NULL DEFAULT 12, + `player_url` varchar(256) DEFAULT NULL, + `tool` varchar(128) DEFAULT NULL, + `content_type` varchar(64) NOT NULL, + `front_image_content_type` varchar(64) DEFAULT NULL, + `structure` text DEFAULT NULL, + `rating` double DEFAULT NULL, + `license_identifier` varchar(64) NOT NULL DEFAULT 'CC BY SA 3.0', + `chdate` bigint(20) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`material_id`), + KEY `host_id` (`host_id`), + KEY `category` (`category`), + KEY `foreign_material_id` (`foreign_material_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_material_users` ( + `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `external_contact` int(11) NOT NULL DEFAULT 0, + `position` int(11) NOT NULL DEFAULT 1, + `chdate` int(11) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`material_id`,`user_id`,`external_contact`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_reviews` ( + `review_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `foreign_review_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `rating` int(11) NOT NULL, + `review` text NOT NULL, + `chdate` int(11) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`review_id`), + UNIQUE KEY `unique_users` (`user_id`,`host_id`,`material_id`), + KEY `material_id` (`material_id`), + KEY `foreign_review_id` (`foreign_review_id`), + KEY `user_id` (`user_id`), + KEY `host_id` (`host_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_tags` ( + `tag_hash` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(64) NOT NULL, + PRIMARY KEY (`tag_hash`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_tags_material` ( + `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `tag_hash` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + UNIQUE KEY `unique_tags` (`material_id`,`tag_hash`), + KEY `tag_hash` (`tag_hash`), + KEY `material_id` (`material_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + DBManager::get()->exec(" + CREATE TABLE `oer_user` ( + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `foreign_user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(100) NOT NULL, + `avatar` varchar(256) DEFAULT NULL, + `description` text DEFAULT NULL, + `chdate` int(11) NOT NULL, + `mkdate` int(11) NOT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `unique_users` (`foreign_user_id`,`host_id`), + KEY `foreign_user_id` (`foreign_user_id`), + KEY `host_id` (`host_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + + $query = "INSERT INTO `config` + SET `field` = :field, + `value` = :value, + `type` = :type, + `range` = :range, + `section` = :section, + `mkdate` = UNIX_TIMESTAMP(), + `chdate` = UNIX_TIMESTAMP(), + `description` = :description"; + $config_statement = DBManager::get()->prepare($query); + + $config_statement->execute([ + ':field' => 'OERCAMPUS_ENABLED', + ':value' => '1', + ':type' => 'boolean', + ':range' => 'global', + ':section' => 'OERCampus', + ':description' => 'Ist der OER Campus aktiviert?', + ]); + $config_statement->execute([ + ':field' => 'OER_PUBLIC_STATUS', + ':value' => 'autor', + ':type' => 'string', + ':range' => 'global', + ':section' => 'OERCampus', + ':description' => 'Ab welchem Nutzerstatus (nobody, user, autor, tutor, dozent) darf man den Marktplatz sehen?', + ]); + $config_statement->execute([ + ':field' => 'OER_DISABLE_LICENSE', + ':value' => '0', + ':type' => 'boolean', + ':range' => 'global', + ':section' => 'OERCampus', + ':description' => 'Sollen die Lizenzen deaktiviert / nicht angezeigt werden?', + ]); + $config_statement->execute([ + ':field' => 'OER_TITLE', + ':value' => 'OER Campus', + ':type' => 'string', + ':range' => 'global', + ':section' => 'OERCampus', + ':description' => 'Name des OER Campus in Stud.IP', + ]); + } + + //Adding licenses to Stud.IP: + DBManager::get()->exec(" + CREATE TABLE `licenses` ( + `identifier` varchar(64) NOT NULL COMMENT 'According to SPDX standard if able.', + `name` varchar(128) DEFAULT NULL, + `link` varchar(256) DEFAULT NULL, + `default` tinyint(1) DEFAULT 0, + `description` text DEFAULT NULL, + `chdate` int(11) DEFAULT NULL, + `mkdate` int(11) DEFAULT NULL, + PRIMARY KEY (`identifier`), + KEY `default` (`default`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + "); + + DBManager::get()->exec(" + ALTER TABLE `oer_material` ADD INDEX ( `license_identifier` ) + "); + DBManager::get()->exec(" + UPDATE `oer_material` + SET license_identifier = 'CC-BY-SA-3.0' + "); + + + DBManager::get()->exec(" + INSERT INTO `licenses` (`identifier`, `name`, `link`, `default`, `description`, `chdate`, `mkdate`) + VALUES + ('CC-BY-1.0','Creative Commons Attribution 1.0 Generic','https://creativecommons.org/licenses/by/1.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-2.0','Creative Commons Attribution 2.0 Generic','https://creativecommons.org/licenses/by/2.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-2.5','Creative Commons Attribution 2.5 Generic','https://creativecommons.org/licenses/by/2.5/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-3.0','Creative Commons Attribution 3.0 Unported','https://creativecommons.org/licenses/by/3.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-4.0','Creative Commons Attribution 4.0 International','https://creativecommons.org/licenses/by/4.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-SA-1.0','Creative Commons Attribution Share Alike 1.0 Generic','https://creativecommons.org/licenses/by-sa/1.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-SA-2.0','Creative Commons Attribution Share Alike 2.0 Generic','https://creativecommons.org/licenses/by-sa/2.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-SA-2.5','Creative Commons Attribution Share Alike 2.5 Generic','https://creativecommons.org/licenses/by-sa/2.5/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-SA-3.0','Creative Commons Attribution Share Alike 3.0 Unported','https://creativecommons.org/licenses/by-sa/3.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-BY-SA-4.0','Creative Commons Attribution Share Alike 4.0 International','https://creativecommons.org/licenses/by-sa/4.0/legalcode',1,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC-PDDC','Creative Commons Public Domain Dedication and Certification','https://creativecommons.org/licenses/publicdomain/',0,'Diese Lizenz ist nur sinnvoll, wenn Sie Material eintragen, das gemeinfrei ist. Gemeinfreie Materialien stammen von Autoren, die mindetens 80 Jahre tot sind, oder von Autoren, die im Ausland leben und ihre Werke unter die sogenannte Public Domain gestellt haben. Diese Lizenz ist nicht sinnvoll für Werke, bei denen ein Copyright besteht.',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), + ('CC0-1.0','Creative Commons Zero v1.0 Universal','https://creativecommons.org/publicdomain/zero/1.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()); + "); + + + } + + + public function down() + { + + } + +} diff --git a/db/migrations/1.318_step_00353_cache.php b/db/migrations/1.318_step_00353_cache.php new file mode 100644 index 0000000..901db60 --- /dev/null +++ b/db/migrations/1.318_step_00353_cache.php @@ -0,0 +1,62 @@ +execute("CREATE TABLE IF NOT EXISTS `cache_types` ( + `cache_id` INT NOT NULL AUTO_INCREMENT, + `class_name` VARCHAR(255) NOT NULL, + `chdate` INT(11) DEFAULT NULL, + `mkdate` INT(11) DEFAULT NULL, + PRIMARY KEY (`cache_id`), + UNIQUE KEY (`class_name`) + ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); + + $types = [ + 'StudipDbCache', + 'StudipFileCache', + 'StudipMemcachedCache', + 'StudipRedisCache' + ]; + + // Insert pre-defined cache types in to database + foreach ($types as $type) { + DBManager::get()->execute( + "INSERT IGNORE INTO `cache_types` (`class_name`, `mkdate`, `chdate`) + VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", [$type]); + } + + // Remove other set cache config entries. + $fields = ['cache_class', 'cache_class_file', 'cache_init_args']; + DBManager::get()->execute("DELETE FROM `config_values` WHERE `field` IN (:fields)", ['fields' => $fields]); + DBManager::get()->execute("DELETE FROM `config` WHERE `field` IN (:fields)", ['fields' => $fields]); + + // Set StudipDbCache as (possibly new) default + $cache = [ + 'type' => 'StudipDbCache', + 'config' => [] + ]; + DBManager::get()->execute("INSERT IGNORE INTO `config` VALUES + (:field, :value, 'array', 'global', 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc)", + [ + 'field' => 'SYSTEMCACHE', + 'value' => json_encode($cache), + 'desc' => 'Typ und Konfiguration des zu verwendenden Systemcaches' + ] + ); + } + + public function down() + { + DBManager::get()->execute("DROP TABLE IF EXISTS `cache_types`"); + DBManager::get()->execute("DELETE FROM `config_values` WHERE `field` = :field", ['field' => 'SYSTEMCACHE']); + DBManager::get()->execute("DELETE FROM `config` WHERE `field` = :field", ['field' => 'SYSTEMCACHE']); + } +} diff --git a/db/migrations/1.319_change_blubber_thread_following.php b/db/migrations/1.319_change_blubber_thread_following.php new file mode 100644 index 0000000..dadd953 --- /dev/null +++ b/db/migrations/1.319_change_blubber_thread_following.php @@ -0,0 +1,81 @@ +query($query); + + if ($result && $result->rowCount() > 0) { + return; + } + + // Alter table to reflect new state + $query = "RENAME TABLE `blubber_threads_unfollow` TO `blubber_threads_followstates`"; + DBManager::get()->exec($query); + + $query = "ALTER TABLE `blubber_threads_followstates` + ADD COLUMN `state` ENUM('followed', 'unfollowed') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'unfollowed' AFTER `user_id`"; + DBManager::get()->exec($query); + + // Insert commented users from global stream + $query = "INSERT IGNORE INTO `blubber_threads_followstates` + SELECT DISTINCT 'global', `user_id`, 'followed', UNIX_TIMESTAMP() + FROM `blubber_comments` + WHERE `thread_id` = 'global' + AND NOT EXISTS ( + SELECT 1 + FROM `blubber_threads_followstates` + WHERE `blubber_comments`.`user_id` = `blubber_threads_followstates`.`user_id` + AND `blubber_threads_followstates`.`thread_id` = 'global' + AND `blubber_threads_followstates`.`state` = 'unfollowed' + )"; + + // Create config entries + $query = "INSERT 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' => 'BLUBBER_GLOBAL_THREAD_OPTOUT', + ':description' => 'Gibt an, ob beim globalen Blubber Thread ein Opt-Out-Verfahren genutzt werden soll', + ':section' => 'global', + ':range' => 'global', + ':type' => 'boolean', + ':value' => '1' + ]); + + // Activate added routes + require_once $GLOBALS['STUDIP_BASE_PATH'] . '/app/routes/Blubber.php'; + RESTAPI\ConsumerPermissions::get()->activateRouteMap(new RESTAPI\Routes\Blubber()); + } + + public function down() + { + // Remove config entry + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'BLUBBER_GLOBAL_THREAD_OPTOUT'"; + DBManager::get()->exec($query); + + // Clean follow states table + $query = "DELETE FROM `blubber_threads_followstates` + WHERE `state` = 'followed'"; + DBManager::get()->exec($query); + + // Drop state + $query = "ALTER TABLE `blubber_threads_followstates` + DROP COLUMN `state`"; + DBManager::get()->exec($query); + + // Rename table + $query = "RENAME TABLE `blubber_threads_followstates` TO `blubber_threads_unfollow`"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.31_high_priority_messages.php b/db/migrations/1.31_high_priority_messages.php new file mode 100644 index 0000000..1d1307f --- /dev/null +++ b/db/migrations/1.31_high_priority_messages.php @@ -0,0 +1,31 @@ +exec("INSERT INTO `config` (". + "`config_id`,`parent_id`,`field`,`value`,`is_default`,`type`,`range`,`section`,". + " `position`,`mkdate`,`chdate`,`description`,`comment`,`message_template`)". + "VALUES (MD5( 'MESSAGE_PRIORITY' ) , '', 'MESSAGE_PRIORITY', '0', '1', 'boolean',". + " 'global', '', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'If enabled, messages of high priority are displayed reddish','', '')"); + $db->exec("ALTER TABLE `message` ADD `priority` ENUM( 'normal', 'high' ) NOT NULL DEFAULT 'normal'"); + $this->announce("done."); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE config_id = MD5('MESSAGE_PRIORITY')"); + $db->exec("ALTER TABLE `message` DROP `priority`"); + $this->announce("done."); + } +} +?> diff --git a/db/migrations/1.320_migration_history_reworked.php b/db/migrations/1.320_migration_history_reworked.php new file mode 100644 index 0000000..4809b8d --- /dev/null +++ b/db/migrations/1.320_migration_history_reworked.php @@ -0,0 +1,44 @@ +prepare($query); + + $statement->execute([ + ':name' => 'MIGRATE_UP', + ':description' => 'Migration wird durchgeführt', + ':template' => '%user hat Migration %affected ausgeführt (Domain: %coaffected)', + ':active' => 1, + ]); + $statement->execute([ + ':name' => 'MIGRATE_DOWN', + ':description' => 'Migration wird zurückgenommen', + ':template' => '%user hat Migration %affected zurückgenommen (Domain: %coaffected)', + ':active' => 1, + ]); + } + + public function down() + { + // Remove log actions + $query = "DELETE `log_actions`, `log_events` + FROM `log_actions` + LEFT JOIN `log_events` USING (`action_id`) + WHERE MD5(:name) = `action_id`"; + $statement = DBManager::get()->prepare($query); + $statement->execute([':name' => 'MIGRATE_UP']); + $statement->execute([':name' => 'MIGRATE_DOWN']); + } +} diff --git a/db/migrations/1.321_add_terms_accepted_config.php b/db/migrations/1.321_add_terms_accepted_config.php new file mode 100644 index 0000000..62c1ae1 --- /dev/null +++ b/db/migrations/1.321_add_terms_accepted_config.php @@ -0,0 +1,26 @@ +exec($query); + } + + protected function down() + { + $query = "DELETE FROM `config` + WHERE `field` = 'TERMS_ACCEPTED'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.322_add_missing_evaluation_configuration.php b/db/migrations/1.322_add_missing_evaluation_configuration.php new file mode 100644 index 0000000..aca5e69 --- /dev/null +++ b/db/migrations/1.322_add_missing_evaluation_configuration.php @@ -0,0 +1,31 @@ +exec($query); + } + + protected function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'EVAL_AUSWERTUNG_GRAPH_FORMAT'"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.323_biest_11462_change_column_types.php b/db/migrations/1.323_biest_11462_change_column_types.php new file mode 100644 index 0000000..9706313 --- /dev/null +++ b/db/migrations/1.323_biest_11462_change_column_types.php @@ -0,0 +1,29 @@ +exec($query); + } + + protected function down() + { + $query = "ALTER TABLE `userfilter_fields` + MODIFY COLUMN `type` VARCHAR(255) DEFAULT NULL, + MODIFY COLUMN `value` VARCHAR(255) DEFAULT NULL, + MODIFY COLUMN `compare_op` VARCHAR(255) DEFAULT NULL"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.324_drop_citation_style.php b/db/migrations/1.324_drop_citation_style.php new file mode 100644 index 0000000..e708e5a --- /dev/null +++ b/db/migrations/1.324_drop_citation_style.php @@ -0,0 +1,43 @@ +exec($query); + } + + public function down() + { + // create config entries + $query = "INSERT 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' => 'COURSE_LIBRARY_CITATION_STYLE', + ':description' => 'Der standardmäßig genutzte Zitationsstil innerhalb der Veranstaltung.', + ':section' => 'Library', + ':range' => 'course', + ':type' => 'string', + ':value' => '' + ]); + $statement->execute([ + ':name' => 'USER_LIBRARY_CITATION_STYLE', + ':description' => 'Der präferierte Zitationsstil einer Person.', + ':section' => 'Library', + ':range' => 'user', + ':type' => 'string', + ':value' => '' + ]); + } +} diff --git a/db/migrations/1.325_tic11044_admin_course_notices_2.php b/db/migrations/1.325_tic11044_admin_course_notices_2.php new file mode 100644 index 0000000..b5b1eca --- /dev/null +++ b/db/migrations/1.325_tic11044_admin_course_notices_2.php @@ -0,0 +1,88 @@ +exec($query); + + // Migrate contents + $query = "INSERT IGNORE INTO `config_values` (`field`, `range_id`, `value`, `mkdate`, `chdate`, `comment`) + SELECT 'COURSE_ADMIN_NOTICE', dfe.`range_id`, dfe.`content`, dfe.`mkdate`, dfe.`chdate`, '' + FROM `datafields_entries` AS dfe + JOIN `datafields` AS df USING (`datafield_id`) + WHERE df.`name` = 'Notiz zu einer Veranstaltung' + AND df.`object_type` = 'sem'"; + DBManager::get()->exec($query); + + // Delete datafield and values + $query = "DELETE `datafields`, `datafields_entries` + FROM `datafields` + LEFT JOIN `datafields_entries` USING (`datafield_id`) + WHERE `datafields`.`name` = 'Notiz zu einer Veranstaltung'"; + DBManager::get()->execute($query); + } + + public function down() + { + $id = md5(uniqid(__CLASS__, true)); + + // Create datafield + $query = "SELECT 1 + MAX(`priority`) + FROM `datafields` + WHERE `object_type` = 'sem'"; + $priority = DBManager::get()->fetchColumn($query) ?: 0; + + $query = "INSERT IGNORE INTO `datafields` ( + `datafield_id`, `name`, + `object_type`, `object_class`, + `edit_perms`, `view_perms`, + `system`, `priority`, + `mkdate`, `chdate`, + `type`, `typeparam`, + `is_required`, `is_userfilter`, + `description` + ) VALUES ( + :id, 'Notiz zu einer Veranstaltung', + 'sem', NULL, + 'admin', 'admin', + 1, :priority, + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'textarea', '', + 0, 0, + 'Enthält etwaige Notizen von Admins zu Veranstaltungen' + )"; + DBManager::get()->execute($query, [ + ':id' => $id, + ':priority' => $priority, + ]); + + // Migrate contents + $query = "INSERT IGNORE INTO `datafields_entries` (`datafield_id`, `range_id`, `content`, `mkdate`, `chdate`) + SELECT :id, `range_id`, `value`, `mkdate`, `chdate` + FROM `config_values` + WHERE `field` = 'COURSE_ADMIN_NOTICE'"; + DBManager::get()->exec($query); + + // Remove course config + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `config`.`field` = 'ADMIN_COURSE_NOTICE'"; + DBManager::get()->execute($query); + } +} diff --git a/db/migrations/1.326_courseware_integration.php b/db/migrations/1.326_courseware_integration.php new file mode 100755 index 0000000..281a2b4 --- /dev/null +++ b/db/migrations/1.326_courseware_integration.php @@ -0,0 +1,199 @@ +exec("CREATE TABLE `cw_blocks` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `container_id` int(11) NOT NULL, + `owner_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `edit_blocker_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + `position` int(11) NOT NULL, + `block_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NULL, + `visible` tinyint(1) NOT NULL, + `payload` MEDIUMTEXT NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + INDEX index_container_id (`container_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_block_comments` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `block_id` int(11) NOT NULL, + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `comment` MEDIUMTEXT NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + INDEX index_block_id (`block_id`), + INDEX index_user_id (`user_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_bookmarks` ( + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `element_id` int(11) NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`user_id`,`element_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_containers` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `structural_element_id` int(11) NOT NULL, + `owner_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `edit_blocker_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + `position` int(11) NOT NULL, + `site` int(11) NOT NULL, + `container_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `visible` tinyint(1) NOT NULL, + `payload` MEDIUMTEXT NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + INDEX index_structural_element_id (`structural_element_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_structural_elements` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `parent_id` int(11) NULL DEFAULT NULL, + `range_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `range_type` ENUM('course', 'user') COLLATE latin1_bin, + `owner_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `editor_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `edit_blocker_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + `position` int(11) NOT NULL, + `title` varchar(255) NOT NULL, + `image_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, + `purpose` ENUM('content', 'template', 'oer', 'portfolio', 'draft', 'other') COLLATE latin1_bin, + `payload` MEDIUMTEXT NOT NULL, + `public` tinyint(1) NOT NULL, + `release_date` int(11) NOT NULL, + `withdraw_date` int(11) NOT NULL, + `read_approval` TEXT NOT NULL, + `write_approval` TEXT NOT NULL, + `copy_approval` TEXT NOT NULL, + `external_relations` TEXT NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + INDEX index_parent_id (`parent_id`), + INDEX index_range_id (`range_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_user_data_fields` ( + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `block_id` int(11) NOT NULL, + `payload` TEXT NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`user_id`,`block_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_user_progresses` ( + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `block_id` int(11) NOT NULL, + `grade` float NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`user_id`,`block_id`) + ) + "); + + $db->exec("CREATE TABLE `cw_block_feedbacks` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `block_id` int(11) NOT NULL, + `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `feedback` MEDIUMTEXT NOT NULL, + `mkdate` int(11) NOT NULL, + `chdate` int(11) NOT NULL, + PRIMARY KEY (`id`), + INDEX index_block_id (`block_id`), + INDEX index_user_id (`user_id`) + ) + "); + + $query = 'INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'; + $statement = $db->prepare($query); + + $statement->execute([ + ':name' => 'COURSEWARE_FAVORITE_BLOCK_TYPES', + ':description' => 'In dieser Konfigurationseinstellung können Nutzende ihre Lieblingsblocktypen speichern.', + ':range' => 'user', + ':type' => 'array', + ':value' => '[]' + ]); + $statement->execute([ + ':name' => 'COURSEWARE_SEQUENTIAL_PROGRESSION', + ':description' => 'Mit dieser Konfigurationseinstellung wird für eine Courseware festgelegt, ob Lernende sequentiell durch die Inhalte gehen müssen.', + ':range' => 'range', + ':type' => 'boolean', + ':value' => '0' + ]); + $statement->execute([ + ':name' => 'COURSEWARE_EDITING_PERMISSION', + ':description' => 'Mit dieser Konfigurationseinstellung wird für eine Courseware festgelegt, welche Rechtestufe Inhalte editieren dürfen.', + ':range' => 'range', + ':type' => 'string', + ':value' => 'dozent' + ]); + $statement->execute([ + ':name' => 'COURSEWARE_LAST_ELEMENT', + ':description' => 'In dieser Konfigurationseinstellung werden die zuletzt besuchten Elemente in allen Coursewares abgelegt.', + ':range' => 'user', + ':type' => 'array', + ':value' => '[]' + ]); + + $db->exec("INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) + VALUES ('CoursewareModule', 'Courseware', 'CorePlugin,StudipModule,SystemPlugin', 'yes', 1) + "); + + $sql = "INSERT INTO roles_plugins (roleid, pluginid) + SELECT roleid, ? + FROM roles + WHERE `system` = 'y' + "; + $db->execute($sql, [$db->lastInsertId()]); + } + + public function down() + { + $db = \DBManager::get(); + + $db->exec("DROP TABLE IF EXISTS `cw_blocks`, `cw_block_comments`, `cw_bookmarks`, `cw_containers`, `cw_structural_elements`, `cw_user_data_fields`, `cw_user_progresses`, `cw_block_feedbacks`"); + + + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = :field"; + $statement = $db->prepare($query); + + $statement->execute( [ ':field' => 'COURSEWARE_FAVORITE_BLOCK_TYPES' ] ); + $statement->execute( [ ':field' => 'COURSEWARE_SEQUENTIAL_PROGRESSION' ] ); + $statement->execute( [ ':field' => 'COURSEWARE_EDITING_PERMISSION' ] ); + $statement->execute( [ ':field' => 'COURSEWARE_LAST_ELEMENT' ] ); + + $db->exec("DELETE plugins, roles_plugins FROM plugins LEFT JOIN roles_plugins USING(pluginid) + WHERE pluginclassname = 'CoursewareModule' + "); + } +} diff --git a/db/migrations/1.328_add_content_widget.php b/db/migrations/1.328_add_content_widget.php new file mode 100644 index 0000000..bed585f --- /dev/null +++ b/db/migrations/1.328_add_content_widget.php @@ -0,0 +1,46 @@ +fetchColumn("SELECT navigationpos FROM plugins ORDER BY navigationpos DESC") + 1; + + // insert plugin into db + $db->execute("INSERT INTO plugins + (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) + VALUES (?, ?, ?, 'PortalPlugin', 'yes', ?)", + [$classname, 'core/' . $classname, $classname, $navpos]); + + // get id of newly created plugin (we purposely do not use PDO::lastInserId()) + $plugin_id = $db->fetchColumn("SELECT pluginid FROM plugins WHERE pluginclassname = ?", [$classname]); + + // set all default roles for the plugin + $stmt = $db->prepare("INSERT INTO roles_plugins + (roleid, pluginid) VALUES (?, ?)"); + foreach (range(1, 6) as $role_id) { + $stmt->execute([$role_id, $plugin_id]); + } + } + + public function down() + { + $db = DBManager::get(); + $classname = 'ContentsWidget'; + // get id of widget + $widget_id = $db->fetchColumn("SELECT pluginid FROM plugins WHERE pluginclassname = ?", [$classname]); + $db->execute("DELETE FROM plugins WHERE pluginid = ?", [$widget_id]); + $db->execute("DELETE FROM widget_default WHERE pluginid = ?", [$widget_id]); + $db->execute("DELETE FROM widget_user WHERE pluginid = ?", [$widget_id]); + $db->execute("DELETE FROM roles_plugins WHERE pluginid = ?", [$widget_id]); + } +} + diff --git a/db/migrations/1.32_restricted_user_management.php b/db/migrations/1.32_restricted_user_management.php new file mode 100644 index 0000000..c7a2ef6 --- /dev/null +++ b/db/migrations/1.32_restricted_user_management.php @@ -0,0 +1,32 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', '0', 1, 'boolean', $time, $time, '$description') + "); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE field = 'RESTRICTED_USER_MANAGEMENT'"); + } +} +?> diff --git a/db/migrations/1.33_lock_rule_admin_perm.php b/db/migrations/1.33_lock_rule_admin_perm.php new file mode 100644 index 0000000..00525e9 --- /dev/null +++ b/db/migrations/1.33_lock_rule_admin_perm.php @@ -0,0 +1,43 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', 'admin', 1, 'string', $time, $time, '$description') + "); + + $name = 'LOCK_RULE_ADMIN_PERM'; + $description = 'mit welchem Status dürfen Sperrebenen angepasst werden (admin, root)'; + + $db->exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', 'admin', 1, 'string', $time, $time, '$description') + "); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE field = 'AUX_RULE_ADMIN_PERM'"); + $db->exec("DELETE FROM config WHERE field = 'LOCK_RULE_ADMIN_PERM'"); + } +} +?> diff --git a/db/migrations/1.34_add_allow_selfassign_institute.php b/db/migrations/1.34_add_allow_selfassign_institute.php new file mode 100644 index 0000000..d5a5b60 --- /dev/null +++ b/db/migrations/1.34_add_allow_selfassign_institute.php @@ -0,0 +1,32 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', '1', 1, 'boolean', $time, $time, '$description') + "); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE field = 'ALLOW_SELFASSIGN_INSTITUTE'"); + } +} +?> diff --git a/db/migrations/1.35_add_additional_log_actions.php b/db/migrations/1.35_add_additional_log_actions.php new file mode 100644 index 0000000..db83487 --- /dev/null +++ b/db/migrations/1.35_add_additional_log_actions.php @@ -0,0 +1,127 @@ +'CHANGE_BASIC_DATA', + 'description'=>'Basisdaten geändert', + 'info_template'=>'%user hat in Veranstaltung %sem(%affected) die Daten %info geändert.', + 'active'=>0], + [ + 'name'=>'CHANGE_INSTITUTE_DATA', + 'description'=>'Institutdaten geändert', + 'info_template'=>'%user hat in Veranstaltung %sem(%affected) die Daten %info geändert.', + 'active'=>0], + [ + 'name'=>'PLUGIN_ENABLE', + 'description'=>'Plugin einschalten', + 'info_template'=>'%user hat in Veranstaltung %sem(%affected) das Plugin %plugin(%coaffected) aktiviert.', + 'active'=>1], + [ + 'name'=>'PLUGIN_DISABLE', + 'description'=>'Plugin ausschalten', + 'info_template'=>'%user hat in Veranstaltung %sem(%affected) das Plugin %plugin(%coaffected) deaktiviert.', + 'active'=>1], + [ + 'name'=>'SEM_CHANGED_ACCESS', + 'description'=>'Zugangsberechtigungen geändert', + 'info_template'=>'%user ändert die Zugangsberechtigungen für %sem(%affected) auf %access(%info).', + 'active'=>0], + [ + 'name'=>'SEM_USER_ADD', + 'description'=>'In Veranstaltung eingetragen', + 'info_template'=>'%user hat %user(%coaffected) für %sem(%affected) mit dem status %info eingetragen. (%dbg_info)', + 'active'=>0], + [ + 'name'=>'SEM_USER_DEL', + 'description'=>'Aus Veranstaltung ausgetragen', + 'info_template'=>'%user hat %user(%coaffected) aus %sem(%affected) ausgetragen. (%info)', + 'active'=>0], + [ + 'name'=>'SEM_CHANGED_RIGHTS', + 'description'=>'Veranstaltungsrechte geändert', + 'info_template'=>'%user hat %user(%coaffected) in %sem(%affected) als %info eingetragen. (%dbg_info)', + 'active'=>0], + [ + 'name'=>'SEM_ADD_STUDYAREA', + 'description'=>'Studienbereich zu Veranst. hinzufügen', + 'info_template'=>'%user fügt Studienbereich \"%studyarea(%coaffected)\" zu %sem(%affected) hinzu.', + 'active'=>0], + [ + 'name'=>'SEM_DELETE_STUDYAREA', + 'description'=>'Studienbereich aus Veranst. löschen', + 'info_template'=>'%user entfernt Studienbereich \"%studyarea(%coaffected)\" aus %sem(%affected).', + 'active'=>0], + [ + 'name'=>'RES_ASSIGN_SEM', + 'description'=>'Buchen einer Ressource (VA)', + 'info_template'=>'%user bucht %res(%affected) für %sem(%coaffected) (%info).', + 'active'=>0], + [ + 'name'=>'RES_ASSIGN_SINGLE', + 'description'=>'Buchen einer Ressource (Einzel)', + 'info_template'=>'%user bucht %res(%affected) direkt (%info).', + 'active'=>0], + [ + 'name'=>'RES_REQUEST_NEW', + 'description'=>'Neue Raumanfrage', + 'info_template'=>'%user stellt neue Raumanfrage für %sem(%affected), gewünschter Raum: %res(%coaffected), %info', + 'active'=>0], + [ + 'name'=>'RES_REQUEST_UPDATE', + 'description'=>'Geänderte Raumanfrage', + 'info_template'=>'%user ändert Raumanfrage für %sem(%affected), gewünschter Raum: %res(%coaffected), %info', + 'active'=>0], + [ + 'name'=>'RES_REQUEST_DEL', + 'description'=>'Raumanfrage löschen', + 'info_template'=>'%user löscht Raumanfrage für %sem(%affected).', + 'active'=>0], + [ + 'name'=>'RES_ASSIGN_DEL_SEM', + 'description'=>'VA-Buchung löschen', + 'info_template'=>'%user löscht Ressourcenbelegung für %res(%affected) in Veranstaltung %sem(%coaffected), %info.', + 'active'=>0], + [ + 'name'=>'RES_ASSIGN_DEL_SINGLE', + 'description'=>'Direktbuchung löschen', + 'info_template'=>'%user löscht Direktbuchung für %res(%affected) (%info).', + 'active'=>0], + [ + 'name'=>'RES_REQUEST_DENY', + 'description'=>'Abgelehnte Raumanfrage', + 'info_template'=>'%user lehnt Raumanfrage für %sem(%coaffected), Raum %sem(%affected) ab.', + 'active'=>0], + [ + 'name'=>'RES_REQUEST_RESOLVE', + 'description'=>'Aufgelöste Raumanfrage', + 'info_template'=>'%user löst Raumanfrage für %sem(%affected), Raum %res(%coaffected) auf.', + 'active'=>0] + ]; + + + function description () { + return 'adds new log actions for changing basic data within lectures and enabling and disabling plugins'; + } + + function up () { + + $insert = "INSERT IGNORE INTO `log_actions` (`action_id`, `name`, `description`, `info_template`, `active`, `expires`) VALUES( MD5('%s'), '%s', '%s', '%s', %s, NULL)"; + + foreach ($this->logactions as $a) + { + DBManager::get()->query(sprintf($insert,$a['name'],$a['name'],$a['description'],$a['info_template'],$a['active'])); + } + } + + function down () { + + $delete = "DELETE FROM log_actions WHERE action_id = MD5('%s')"; + + foreach ($this->logactions as $a) + { + DBManager::get()->query(sprintf($delete,$a['name'])); + } + } +} diff --git a/db/migrations/1.36_step_00156_editierbares_impressum.php b/db/migrations/1.36_step_00156_editierbares_impressum.php new file mode 100644 index 0000000..7373c2b --- /dev/null +++ b/db/migrations/1.36_step_00156_editierbares_impressum.php @@ -0,0 +1,161 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + */ + +class Step00156EditierbaresImpressum extends Migration { + + + function description() { + return 'Adds two new tables and fills them with default content.'; + } + + + function up() { + $db = DBManager::get(); + + $this->announce("add new table siteinfo_rubrics"); + $db->exec("CREATE TABLE IF NOT EXISTS `siteinfo_rubrics` ( + `rubric_id` smallint(5) unsigned NOT NULL auto_increment, + `position` tinyint(3) unsigned default NULL, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`rubric_id`)) ENGINE=MyISAM"); + + $this->announce("fill siteinfo_rubrics with default content"); + $db->exec("INSERT INTO `siteinfo_rubrics` (`rubric_id`, `name`) + VALUES + (1, '[lang=de]Kontakt[/lang][lang=en]Contact[/lang]'), + (2, '[lang=de]Über Stud.IP[/lang][lang=en]About Stud.IP[/lang]')"); + + $this->announce("add new table siteinfo_details"); + $db->exec("CREATE TABLE IF NOT EXISTS `siteinfo_details` ( + `detail_id` smallint(5) unsigned NOT NULL auto_increment, + `rubric_id` smallint(5) unsigned NOT NULL, + `position` tinyint(3) unsigned default NULL, + `name` varchar(255) NOT NULL, + `content` text NOT NULL, + PRIMARY KEY (`detail_id`)) ENGINE=MyISAM"); + + $this->announce("fill siteinfo_details with default content"); + $db->exec("INSERT INTO `siteinfo_details` (`rubric_id`, `name`, `content`) + VALUES + (1, + '[lang=de]Ansprechpartner[/lang][lang=en]Contact[/lang]', + '[style=float: right]".'\n'. + "[img]http://www.studip.de/images/studipanim.gif".'\n'. + "**Version:** (:version:)".'\n'. + "[/style]".'\n'. + "[lang=de]Für diese Stud.IP-Installation ((:uniname:)) sind folgende Administratoren zuständig:[/lang]".'\n'. + "[lang=en]The following administrators are responsible for this Stud.IP installation ((:uniname:)):[/lang]".'\n'. + "(:rootlist:)".'\n'. + "[lang=de]allgemeine Anfragen wie Passwort-Anforderungen u.a. richten Sie bitte an:[/lang]".'\n'. + "[lang=en]General queries e.g., password queries, please contact:[/lang]".'\n'. + "(:unicontact:)".'\n'. + "[lang=de]Folgende Einrichtungen sind beteiligt:".'\n'. + "(Genannt werden die jeweiligen Administratoren der Einrichtungen für entsprechende Anfragen)[/lang]".'\n'. + "[lang=en]The following institutes participate:".'\n'. + "(Named are the institutes administrators responsible for the corresponding query areas)[/lang]".'\n'. + "(:adminlist:)'), + (1, + '[lang=de]Entwickler[/lang][lang=en]Developer[/lang]', + '[style=float: right]".'\n'. + "[img]http://www.studip.de/images/studipanim.gif".'\n'. + "**Version:** (:version:)".'\n'. + "[/style]".'\n'. + "[lang=de]Stud.IP ist ein Open Source Projekt zur Unterstützung von Präsenzlehre an Universitäten, Hochschulen und anderen Bildungseinrichtungen. Das System entstand am Zentrum für interdisziplinäre Medienwissenschaft (ZiM) der Georg-August-Universität Göttingen unter Mitwirkung der Suchi & Berg GmbH (data-quest) , Göttingen. Heute erfolgt die Weiterentwicklung von Stud.IP verteilt an vielen Standorten (Göttingen, Osnabrück, Oldenburg, Bremen, Hannover, Jena und weiteren). Die Koordination der Entwicklung erfolgt durch die Stud.IP-CoreGroup.".'\n'. + "Stud.IP steht unter der GNU General Public License, Version 2.".'\n\n'. + "Weitere Informationen finden Sie auf [**www.studip.de**]http://www.studip.de , [**develop.studip.de**]http://develop.studip.de und [**blog.studip.de**]http://blog.studip.de.[/lang]".'\n\n'. + "[lang=en]Stud.IP is an opensource project for supporting attendance courses offered by universities, institutions of higher education and other educational institutions. The system was established at the Zentrum für interdisziplinäre Medienwissenschaft (ZiM) in the Georg-August-Universität Göttingen in cooperation with Suchi & Berg GmbH (data-quest) , Göttingen. At the present further developing takes place at various locations (among others Göttingen, Osnabrück, Oldenburg, Bremen, Hannover, Jena) under coordination through the Stud.IP-CoreGroup.".'\n\n'. + "Stud.IP is covered by the GNU General Public Licence, version 2.".'\n\n'. + "Further information can be found under [**www.studip.de**]http://www.studip.de , [**develop.studip.de**]http://develop.studip.de and [**blog.studip.de**]http://blog.studip.de.[/lang]".'\n\n'. + "(:coregroup:)".'\n'. + "[lang=de]Sie erreichen uns auch über folgende **Mailinglisten**:".'\n\n'. + "**Nutzer-Anfragen**, E-Mail: studip-users@lists.sourceforge.net: Fragen, Anregungen und Vorschläge an die Entwickler - bitte __keine__ Passwort Anfragen!".'\n'. + "**News-Mailingsliste**, E-Mail: studip-news@lists.sourceforge.net: News rund um Stud.IP (Eintragung notwendig)".'\n\n'. + "Wir laden alle Entwickler, Betreiber und Nutzer von Stud.IP ein, sich auf dem Developer-Server http://develop.studip.de an den Diskussionen rund um die Weiterentwicklung und Nutzung der Plattform zu beteiligen.[/lang]".'\n'. + "[lang=en]You can contact us via the following **mailing lists**:".'\n\n'. + "**User enquiries**, E-Mail: studip-users@lists.sourceforge.net: Questions, suggestions and recommendations to the developers - __please no password queries__!".'\n\n'. + "**News mailing list**, E-Mail: studip-news@lists.sourceforge.net: News about Stud.IP (registration necessary)".'\n\n'. + "We invite all developers, administrators and users of Stud.IP to join the discussions on further developing and using the platform available at the developer server http://develop.studip.de[/lang]'), + (2, + '[lang=de]Technik[/lang][lang=en]Technology[/lang]', + '[style=float: right]".'\n'. + "[img]http://www.studip.de/images/studipanim.gif".'\n'. + "**Version:** (:version:)".'\n'. + "[/style]".'\n'. + "[lang=de]Stud IP ist ein Open-Source Projekt und steht unter der GNU General Public License. Sämtliche zum Betrieb notwendigen Dateien können unter http://sourceforge.net/projects/studip/ heruntergeladen werden.".'\n'. + "Die technische Grundlage bietet ein LINUX-System mit Apache Webserver sowie eine MySQL Datenbank, die über PHP gesteuert wird.".'\n'. + "Im System findet ein 6-stufiges Rechtesystem Verwendung, das individuell auf verschiedenen Ebenen wirkt - etwa in Veranstaltungen, Einrichtungen, Fakultäten oder systemweit.".'\n'. + "Seminare oder Arbeitsgruppen können mit Passwörtern geschützt werden - die Verschlüsselung erfolgt mit einem MD5 one-way-hash.".'\n'. + "Das System ist zu 100% über das Internet administrierbar, es sind keine zusätzlichen Werkzeuge nötig. Ein Webbrowser der 5. Generation wird empfohlen.".'\n'. + "Das System wird ständig weiterentwickelt und an die Wünsche unserer Nutzer angepasst - [sagen Sie uns Ihre Meinung!]studip-users@lists.sourceforge.net[/lang]".'\n'. + "[lang=en]Stud.IP is an Open Source Project and is covered by the Gnu General Public License (GPL). All files necessary for operation can be downloaded from http://sourceforge.net/projects/studip/ .".'\n'. + "The technical basis can be provided by a LINUX system with Apache Webserver and a MySQL database, which is then controlled by PHP.".'\n'. + "The system features a authorisation system with six ranks, that affects individually different levels - in courses, institutes,faculties or system wide.".'\n'. + "Seminars or work groups can be secured with passwords - the encryption of which uses a MD5 one-way-hash.".'\n'. + "The system is capable of being administrated 100% over the internet - no additional tools are necessary. A 5th generation web browser is recommended.".'\n'. + "The system is continually being developed and customised to the wishes of our users - [Tell us your opinion!]studip-users@lists.sourceforge.net[/lang]'), + (2, + '[lang=de]Statistik[/lang][lang=en]Statistics[/lang]', + '[lang=de]!!Top-Listen aller Veranstaltungen[/lang]". + "[lang=en]!!Top list of all courses[/lang]".'\n'. + "[style=float: right]".'\n'. + "[lang=de]!!Statistik[/lang][lang=en]!!statistics[/lang]".'\n'. + "(:indicator seminar_all:)".'\n'. + "(:indicator seminar_archived:)".'\n'. + "(:indicator institute_firstlevel_all:)".'\n'. + "(:indicator institute_secondlevel_all:)".'\n'. + "(:indicator user_admin:)".'\n'. + "(:indicator user_dozent:)".'\n'. + "(:indicator user_tutor:)".'\n'. + "(:indicator user_autor:)".'\n'. + "(:indicator posting:)".'\n'. + "(:indicator document:)".'\n'. + "(:indicator link:)".'\n'. + "(:indicator litlist:)".'\n'. + "(:indicator termin:)".'\n'. + "(:indicator news:)".'\n'. + "(:indicator guestbook:)".'\n'. + "(:indicator vote:)".'\n'. + "(:indicator test:)".'\n'. + "(:indicator evaluation:)".'\n'. + "(:indicator wiki_pages:)".'\n'. + "(:indicator lernmodul:)".'\n'. + "(:indicator resource:)".'\n'. + "[/style]".'\n'. + "(:toplist mostparticipants:)".'\n'. + "(:toplist recentlycreated:)".'\n'. + "(:toplist mostdocuments:)".'\n'. + "(:toplist mostpostings:)".'\n'. + "(:toplist mostvisitedhomepages:)'), + (2, + 'History', + '(:history:)'), + (2, + 'Stud.IP-Blog', + '[lang=de]Das Blog der Stud.IP-Entwickler finden Sie auf:[/lang]".'\n'. + "[lang=en]The Stud.IP-Developer-Blog can be found under:[/lang]".'\n'. + "http://blog.studip.de')"); + + $this->announce("done."); + } + + + function down() { + $db = DBManager::get(); + + $this->announce("remove siteinfo_details"); + $db->exec("DROP table `siteinfo_details`"); + + $this->announce("remove siteinfo_rubrics"); + $db->exec("DROP table `siteinfo_rubrics`"); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.37_log_actions_expires.php b/db/migrations/1.37_log_actions_expires.php new file mode 100644 index 0000000..8af3e79 --- /dev/null +++ b/db/migrations/1.37_log_actions_expires.php @@ -0,0 +1,25 @@ +exec("ALTER TABLE log_actions CHANGE expires + expires int(20) NOT NULL default 0"); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE log_actions CHANGE expires + expires int(20) default NULL"); + } +} +?> diff --git a/db/migrations/1.38_allow_admin_useraccess.php b/db/migrations/1.38_allow_admin_useraccess.php new file mode 100644 index 0000000..51f5c80 --- /dev/null +++ b/db/migrations/1.38_allow_admin_useraccess.php @@ -0,0 +1,32 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', '1', 1, 'boolean', $time, $time, '$description') + "); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE field = 'ALLOW_ADMIN_USERACCESS'"); + } +} +?> diff --git a/db/migrations/1.39_step_00153_studienmodulmanagement.php b/db/migrations/1.39_step_00153_studienmodulmanagement.php new file mode 100644 index 0000000..d638b00 --- /dev/null +++ b/db/migrations/1.39_step_00153_studienmodulmanagement.php @@ -0,0 +1,32 @@ +exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', 'user', 1, 'string', $time, $time, '$description') + "); + $db->exec("ALTER TABLE `sem_tree` ADD `type` TINYINT UNSIGNED NOT NULL"); + } + + function down () + { + $db = DBManager::get(); + $db->exec("DELETE FROM config WHERE field = 'SEM_TREE_SHOW_EMPTY_AREAS_PERM'"); + $db->exec("ALTER TABLE `sem_tree` DROP `type`"); + } +} +?> diff --git a/db/migrations/1.3_step_87_extern_configurations.php b/db/migrations/1.3_step_87_extern_configurations.php new file mode 100644 index 0000000..5b7b1f9 --- /dev/null +++ b/db/migrations/1.3_step_87_extern_configurations.php @@ -0,0 +1,46 @@ +exec("ALTER TABLE `extern_config` ADD `config` MEDIUMTEXT NOT NULL AFTER `is_standard`"); + + $configs = DBManager::get()->query("SELECT `range_id`, `config_id` FROM `extern_config`")->fetchAll(PDO::FETCH_ASSOC); + + $this->announce(" KONVERTIERUNG START "); + + $i = 0; + foreach ($configs as $config) { + $old_config = new ExternConfigIni($config['range_id'], '', $config['config_id']); + $new_config = new ExternConfigDb($config['range_id'], '', $config['config_id']); + + $new_config->setConfiguration($old_config->getConfiguration()); + + if ($new_config->store()) { + $this->write(sprintf("Konfiguration mit der id %s konvertiert!", $new_config->getId())); + $i++; + } else { + $this->write(sprintf("FEHLER! Die Konfiguration mit der id %s konnte nicht konvertiert werden!", $config['config_id'])); + } + } + + if (count($configs) == $i) { + $this->write("Alle Konfigurationsdateien vermutlich fehlerfrei in die Datenbank uebertragen!"); + $this->write(sprintf("Es wurden %s Konfigurationsdateien uebertragen.", $i)); + } else { + $this->write("Es wurden nicht alle Konfigurationsdateien uebertragen!"); + $this->write(sprintf("Es wurden %s Konfigurationsdateien von %s Konfigurationsdateien uebertragen!", $i, count($configs))); + $this->write("Bitte die fehlerhaften Konfigurationen manuell ueberpruefen."); + } + + $this->announce(" KONVERTIERUNG ENDE "); + + } +} diff --git a/db/migrations/1.40_add_index_to_log_events.php b/db/migrations/1.40_add_index_to_log_events.php new file mode 100644 index 0000000..b6c61d9 --- /dev/null +++ b/db/migrations/1.40_add_index_to_log_events.php @@ -0,0 +1,15 @@ +query("ALTER TABLE `log_events` ADD INDEX `action_id` ( `action_id` )"); + } + + function down() { + DBManager::get()->query("ALTER TABLE `log_events` DROP INDEX `action_id`"); + } +} diff --git a/db/migrations/1.41_step_00157_rolemanagment.php b/db/migrations/1.41_step_00157_rolemanagment.php new file mode 100644 index 0000000..c596990 --- /dev/null +++ b/db/migrations/1.41_step_00157_rolemanagment.php @@ -0,0 +1,22 @@ +exec("UPDATE plugins SET pluginclassname = 'RoleManagementPlugin' WHERE pluginclassname = 'de_studip_core_RoleManagementPlugin'"); + DBManager::get()->exec("DELETE FROM plugins WHERE pluginclassname = 'de_studip_core_UserManagementPlugin'"); + DBManager::get()->exec("DELETE FROM plugins_activated WHERE pluginid = 2"); + DBManager::get()->exec("DELETE FROM roles_plugins WHERE pluginid = 2"); + } + + function down () + { + DBManager::get()->exec("UPDATE plugins SET pluginclassname = 'de_studip_core_RoleManagementPlugin' WHERE pluginclassname = 'RoleManagementPlugin'"); + } +} +?> diff --git a/db/migrations/1.42_change_action_id_inst_create.php b/db/migrations/1.42_change_action_id_inst_create.php new file mode 100644 index 0000000..7740f0d --- /dev/null +++ b/db/migrations/1.42_change_action_id_inst_create.php @@ -0,0 +1,21 @@ +exec("UPDATE log_actions SET action_id=MD5('INST_CREATE') + WHERE action_id=MD5('INST_NEW')"); + $db->exec("UPDATE log_events SET action_id=MD5('INST_CREATE') + WHERE action_id=MD5('INST_NEW')"); + } + +} +?> diff --git a/db/migrations/1.43_step_00159_datafieldentry.php b/db/migrations/1.43_step_00159_datafieldentry.php new file mode 100644 index 0000000..3e71a30 --- /dev/null +++ b/db/migrations/1.43_step_00159_datafieldentry.php @@ -0,0 +1,20 @@ +exec("ALTER TABLE `datafields` MODIFY COLUMN `type` ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link') NOT NULL DEFAULT 'textline'"); + } + + function down() + { + DBManager::get()->exec("ALTER TABLE `datafields` MODIFY COLUMN `type` ENUM('bool','textline','textarea','selectbox','date','time','email','url','phone','radio','combo') NOT NULL DEFAULT 'textline'"); + } +} +?> diff --git a/db/migrations/1.44_add_switch_to_preselect_semester.php b/db/migrations/1.44_add_switch_to_preselect_semester.php new file mode 100644 index 0000000..16aceb4 --- /dev/null +++ b/db/migrations/1.44_add_switch_to_preselect_semester.php @@ -0,0 +1,23 @@ +exec("INSERT INTO config (`config_id`, `parent_id`, `field`, " . + "`value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`," . + "`description`, `comment`, `message_template`) VALUES " . + "('06d703c3de37cdae942c66e18f7dcd02', '', 'ASSI_SEMESTER_PRESELECT', " . + "'TRUE', 0, 'boolean', 'global', '', 0, ".time().",". time(). + ", 'Wenn ausgeschaltet wird im admin_seminare_assi beim" . + "Erstellen einer Veranstaltung als Semester bitte auswählen " . + "angezeigt und nicht das voreingestellte Semester.', '', '')"); + } + + function down() { + DBManager::get()->exec("DELETE FROM `config` WHERE `config_id`='06d703c3de37cdae942c66e18f7dcd02' LIMIT 1 "); + } +} + +?> diff --git a/db/migrations/1.45_refine_logevents.php b/db/migrations/1.45_refine_logevents.php new file mode 100644 index 0000000..482ccaf --- /dev/null +++ b/db/migrations/1.45_refine_logevents.php @@ -0,0 +1,62 @@ +query("SELECT action_id FROM log_actions WHERE name = 'SEM_CHANGED_ACCESS'")->fetch(); + $action_id = $data['action_id']; + + // (2) Update the format string + DBManager::get()->query("UPDATE log_actions + SET info_template = '%user ändert die Zugangsberechtigungen der Veranstaltung %sem(%affected).' + WHERE action_id = '$action_id'"); + + // (3) Get all corresponding logevents and update the info text + $stmt = DBManager::get()->query("SELECT event_id, info FROM log_events WHERE action_id = '$action_id'"); + while ($data = $stmt->fetch()) { + if($info=unserialize($data['info'])) { + $anmeldeverfahren=$info["admission_type"]; + $startzeit=$info["start_time"]; + $endzeit=$info["end_time"]; + $lesezugriff=$info["read_level"]; + $schreibzugriff=$info["write_level"]; + $admission_prelim=$info["admission_prelim"]; + $passwort=$info["passwort"]; + $disable_waiting_list=$info["admission_disable_waitlist"]; + $maxteilnehmerzahl=$info["admission_turnout"]; + $verbindlich = $info["admission_binding"]; + $enable_quota=$info["admission_enable_quota"]; + + $inf_txt=": \nAnmeldeverfahren auf ".get_admission_description('admission_type', $anmeldeverfahren)." geändert.". + " Startzeit auf ".date("d.m.Y H:i",$startzeit)." geändert.". + " Endzeit auf ".date("d.m.Y H:i",$endzeit)." geändert.\n". + "Lesezugriff auf ".get_admission_description('read_level', $lesezugriff)." geändert.". + " Schreibzugriff auf ".get_admission_description('write_level', $schreibzugriff)." geändert.". + " Vorläufigen Zugang auf ".get_admission_description('admission_prelim',$admission_prelim)." geändert.\n". + "Passwort auf ".$passwort." geändert.". + "Warteliste auf ".$disable_waiting_list." geändert.". + " Teilnehmerzahl auf ".$maxteilnehmerzahl." geändert.". + " Verbindlich auf ".$verbindlich." geändert.". + " Enable_Quotas ".$enable_quota." geändert."; + + DBManager::get()->query("UPDATE log_events SET info = '$inf_txt' WHERE event_id = '{$data['event_id']}'"); + } + + } + } + + function down () + { + + } +} +?> diff --git a/db/migrations/1.46_step00172_remove_ilias_connect.php b/db/migrations/1.46_step00172_remove_ilias_connect.php new file mode 100644 index 0000000..87672ab --- /dev/null +++ b/db/migrations/1.46_step00172_remove_ilias_connect.php @@ -0,0 +1,22 @@ +exec("DROP TABLE IF EXISTS `seminar_lernmodul`"); + $db->exec("DROP TABLE IF EXISTS `studip_ilias`"); + } + + function down () + { + + } +} +?> \ No newline at end of file diff --git a/db/migrations/1.47_add_option_resources_hide_past_single_dates.php b/db/migrations/1.47_add_option_resources_hide_past_single_dates.php new file mode 100644 index 0000000..1e442f8 --- /dev/null +++ b/db/migrations/1.47_add_option_resources_hide_past_single_dates.php @@ -0,0 +1,62 @@ +exec(" + INSERT IGNORE INTO `config` ( + `config_id` , + `parent_id` , + `field` , + `value` , + `is_default` , + `type` , + `range` , + `section` , + `position` , + `mkdate` , + `chdate` , + `description` , + `comment` , + `message_template` + ) + VALUES ( + MD5( 'RESOURCES_HIDE_PAST_SINGLE_DATES' ) , '', 'RESOURCES_HIDE_PAST_SINGLE_DATES', '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Schaltet in der Ressourcenverwaltung ein,ob bereits vergangene Terminen bei der Buchung und Planung brücksichtigt werden sollen', '', '' + ) + "); + $db->exec("INSERT IGNORE INTO `config` ( + `config_id` , + `parent_id` , + `field` , + `value` , + `is_default` , + `type` , + `range` , + `section` , + `position` , + `mkdate` , + `chdate` , + `description` , + `comment` , + `message_template` + ) + VALUES ( + MD5( 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS' ) , '', 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS', '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Schaltet in der Ressourcenverwaltung ein,ob alle Räume gewünscht werden können, oder nur eigene und ''Global'' gesetzte', '', '' + ) + "); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE field IN('RESOURCES_HIDE_PAST_SINGLE_DATES','RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS')"); + } +} +?> diff --git a/db/migrations/1.48_step_00174_plugin_interfaces.php b/db/migrations/1.48_step_00174_plugin_interfaces.php new file mode 100644 index 0000000..6478aa6 --- /dev/null +++ b/db/migrations/1.48_step_00174_plugin_interfaces.php @@ -0,0 +1,31 @@ +exec("ALTER TABLE plugins CHANGE plugintype + plugintype TEXT NOT NULL default ''"); + + $db->exec("UPDATE plugins SET plugintype = + CONCAT(plugintype, 'Plugin')"); + } + + function down () + { + $db = DBManager::get(); + + $db->exec("UPDATE plugins SET plugintype = + TRIM(TRAILING 'Plugin' FROM plugintype)"); + + $db->exec("ALTER TABLE plugins CHANGE plugintype + plugintype varchar(255) NOT NULL default 'Standard'"); + } +} +?> diff --git a/db/migrations/1.49_step_00150_studygroups.php b/db/migrations/1.49_step_00150_studygroups.php new file mode 100644 index 0000000..e5f512a --- /dev/null +++ b/db/migrations/1.49_step_00150_studygroups.php @@ -0,0 +1,74 @@ +query("INSERT IGNORE INTO auth_user_md5 (user_id, username, password, perms, Vorname, Nachname, Email, locked) VALUES (MD5('studygroup_dozent'),'studygroup_dozent','0c6fe1b07e3aca7ee6387f87dc8370eb','dozent','','','',1)"); + DBManager::get()->query("INSERT IGNORE INTO user_info SET user_id =MD5('studygroup_dozent')"); + + // (2) Allocate some space in the config-table + DBManager::get()->query("ALTER TABLE `config` CHANGE `value` `value` TEXT NOT NULL"); + + // (3) Add some default-terms + DBManager::get()->query("INSERT IGNORE INTO `config` ( + `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, + `range`, `section`, `position`, `mkdate`, `chdate`, `description`, + `comment`, `message_template` ) + VALUES ( MD5( 'STUDYGROUPS_ENABLE' ) , '', 'STUDYGROUPS_ENABLE', + '0', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , + 'Studiengruppen', '', '')"); + + $terms = "Mir ist bekannt, dass ich die Gruppe nicht zu rechtswidrigen Zwecken nutzen darf. Dazu zählen u.a. Urheberrechtsverletzungen, Beleidigungen und andere Persönlichkeitsdelikte. + +Ich erkläre mich damit einverstanden, dass Admins die Inhalte der Gruppe zu Kontrollzwecken einsehen dürfen."; + + DBManager::get()->query("INSERT IGNORE INTO `config` ( + `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, + `range`, `section`, `position`, `mkdate`, `chdate`, `description`, + `comment`, `message_template` ) + VALUES ( MD5( 'STUDYGROUP_TERMS' ) , '', 'STUDYGROUP_TERMS', + '$terms', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , + 'Studiengruppen', '', '')"); + + // (4) Add default for allowed modules + DBManager::get()->query("INSERT IGNORE INTO `config` ( + `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, + `range`, `section`, `position`, `mkdate`, `chdate`, `description`, + `comment`, `message_template` ) + VALUES ( MD5( 'STUDYGROUP_SETTINGS' ) , '', 'STUDYGROUP_SETTINGS', + 'forum:1|documents:0|schedule:0|participants:1', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , + 'Studiengruppen', '', '')"); + + DBManager::get()->query("INSERT IGNORE INTO `config` ( + `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, + `range`, `section`, `position`, `mkdate`, `chdate`, `description`, + `comment`, `message_template` ) + VALUES ( MD5( 'STUDYGROUP_DEFAULT_INST' ) , '', 'STUDYGROUP_DEFAULT_INST', + '', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , + 'Studiengruppen', '', '')"); + + } + + function down () + { + // (1) Remove studygroup_dozent + DBManager::get()->query("DELETE FROM auth_user_md5 WHERE user_id = MD5('studygroup_dozent')"); + DBManager::get()->query("DELETE FROM user_info WHERE user_id = MD5('studygroup_dozent')"); + // (2) remove config entries + DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUPS_ENABLE')"); + DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUP_DEFAULT_INST')"); + DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUP_SETTINGS')"); + DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUP_TERMS')"); + // (3) restore config-table schema + DBManager::get()->query("ALTER TABLE config CHANGE value value varchar(255) NOT NULL"); + } +} +?> diff --git a/db/migrations/1.4_step_116_participant_view.php b/db/migrations/1.4_step_116_participant_view.php new file mode 100644 index 0000000..b419613 --- /dev/null +++ b/db/migrations/1.4_step_116_participant_view.php @@ -0,0 +1,32 @@ +announce(" creating table..."); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `teilnehmer_view` ( + `datafield_id` varchar(40) NOT NULL default '', + `seminar_id` varchar(40) NOT NULL default '', + `active` tinyint(4) default NULL, + PRIMARY KEY (`datafield_id`, `seminar_id`) + )"); + + $this->announce("done."); + + } + + public function down () + { + $this->announce(" removing table..."); + + DBManager::get()->exec("DROP TABLE `teilnehmer_view`"); + + $this->announce("done."); + } +} diff --git a/db/migrations/1.50_add_option_step_152.php b/db/migrations/1.50_add_option_step_152.php new file mode 100644 index 0000000..a4f49df --- /dev/null +++ b/db/migrations/1.50_add_option_step_152.php @@ -0,0 +1,46 @@ +exec(" + INSERT IGNORE INTO `config` ( + `config_id` , + `parent_id` , + `field` , + `value` , + `is_default` , + `type` , + `range` , + `section` , + `position` , + `mkdate` , + `chdate` , + `description` , + `comment` , + `message_template` + ) + VALUES ( + MD5( 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION' ) , '', 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION', + '0', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , + 'Schaltet die Überprüfung (fester Teilnehmerkreis) bei Download von als geschützt markierten Dateien ein', + '', '' + ) + "); + + } + + function down () + { + $db = DBManager::get(); + + $db->exec("DELETE FROM config WHERE field = 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION'"); + } +} +?> diff --git a/db/migrations/1.51_unhide_dozents.php b/db/migrations/1.51_unhide_dozents.php new file mode 100644 index 0000000..c25e7b3 --- /dev/null +++ b/db/migrations/1.51_unhide_dozents.php @@ -0,0 +1,20 @@ +exec("UPDATE seminar_user SET visible = 'yes' WHERE status = 'dozent'"); + } + + function down () + { + + } +} +?> diff --git a/db/migrations/1.52_additional_semtree_log_actions.php b/db/migrations/1.52_additional_semtree_log_actions.php new file mode 100644 index 0000000..23e81fa --- /dev/null +++ b/db/migrations/1.52_additional_semtree_log_actions.php @@ -0,0 +1,46 @@ +'STUDYAREA_ADD', + 'description'=>'Studienbereich hinzufügen', + 'info_template'=>'%user legt Studienbereich %studyarea(%affected) an.', + 'active'=>0], + [ + 'name'=>'STUDYAREA_DELETE', + 'description'=>'Studienbereich löschen', + 'info_template'=>'%user entfernt Studienbereich %studyarea(%affected).', + 'active'=>0] + ]; + + + function description () { + return 'adds two new log actions for adding and deleting SemTree Items'; + } + + function up () { + + $insert = "INSERT IGNORE INTO `log_actions` (`action_id`, `name`, `description`, `info_template`, `active`, `expires`) VALUES( MD5('%s'), '%s', '%s', '%s', %s, NULL)"; + + foreach ($this->logactions as $a) + { + DBManager::get()->query(sprintf($insert,$a['name'],$a['name'],$a['description'],$a['info_template'],$a['active'])); + } + } + + function down () { + + $delete = "DELETE FROM log_actions WHERE action_id = MD5('%s')"; + + foreach ($this->logactions as $a) + { + DBManager::get()->query(sprintf($delete,$a['name'])); + } + } +} + + + +?> diff --git a/db/migrations/1.53_file_and_folder_priority.php b/db/migrations/1.53_file_and_folder_priority.php new file mode 100644 index 0000000..c9daaa5 --- /dev/null +++ b/db/migrations/1.53_file_and_folder_priority.php @@ -0,0 +1,19 @@ +exec("ALTER TABLE `dokumente` ADD `priority` SMALLINT UNSIGNED NOT NULL DEFAULT 0"); + $db->exec("ALTER TABLE `folder` ADD `priority` SMALLINT UNSIGNED NOT NULL DEFAULT 0"); + } + + function down() { + $db = DBManager::get(); + $db->exec("ALTER TABLE `dokumente` DROP `priority`"); + $db->exec("ALTER TABLE `folder` DROP `priority`"); + } +} +?> \ No newline at end of file diff --git a/db/migrations/1.54_step_00161_plugin_admin.php b/db/migrations/1.54_step_00161_plugin_admin.php new file mode 100644 index 0000000..d6b0145 --- /dev/null +++ b/db/migrations/1.54_step_00161_plugin_admin.php @@ -0,0 +1,35 @@ +exec("DELETE FROM plugins WHERE pluginid IN (1, 3)"); + $db->exec("DELETE FROM plugins_activated WHERE pluginid IN (1, 3)"); + $db->exec("DELETE FROM roles_plugins WHERE pluginid IN (1, 3)"); + + $db->exec("ALTER TABLE plugins DROP plugindesc"); + } + + function down() + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE plugins ADD plugindesc varchar(45) NOT NULL default '' AFTER pluginname"); + + $db->exec("INSERT INTO plugins + (pluginid, pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos, dependentonid) + VALUES + (1, 'PluginAdministrationPlugin', 'core', 'Plugin-Administration', 'AdministrationPlugin', 'yes', 0, NULL), + (3, 'RoleManagementPlugin', 'core', 'RollenManagement', 'AdministrationPlugin', 'yes', 1, 1)"); + + $db->exec("INSERT INTO roles_plugins (roleid, pluginid) VALUES (1, 1), (1, 3)"); + } +} +?> diff --git a/db/migrations/1.55_add_missing_log_actions.php b/db/migrations/1.55_add_missing_log_actions.php new file mode 100644 index 0000000..6176dca --- /dev/null +++ b/db/migrations/1.55_add_missing_log_actions.php @@ -0,0 +1,57 @@ + 'USER_CHANGE_PASSWORD', + 'description' => 'Nutzerpasswort geändert', + 'template' => '%user ändert/setzt das Passwort für %user(%affected)', + 'active' => 0 + ], [ + 'name' => 'SEM_CHANGE_CYCLE', + 'description' => 'Regelmäßige Zeit geändert', + 'template' => '%user hat in %sem(%affected) die regelmäßige Zeit %info geändert', + 'active' => 1 + ] + ]; + + function description() + { + return 'adds two missing log actions to the database'; + } + + function up() + { + $db = DBManager::get(); + $query = $db->prepare("INSERT INTO log_actions (action_id, name, description, info_template, active) VALUES (?, ?, ?, ?, ?)"); + + foreach (self::$log_actions as $action) { + $query->execute([md5($action['name']), $action['name'], $action['description'], $action['template'], $action['active']]); + } + + // fix misuse of %coaffected in SEM_ADD_CYCLE and SEM_DELETE_CYCLE + $db->exec("UPDATE log_actions SET info_template = REPLACE(info_template, '%coaffected', '%info') + WHERE name IN ('SEM_ADD_CYCLE', 'SEM_DELETE_CYCLE')"); + + $db->exec("UPDATE log_events SET info = coaffected_range_id WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); + $db->exec("UPDATE log_events SET coaffected_range_id = NULL WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); + } + + function down() + { + $db = DBManager::get(); + $query = $db->prepare("DELETE FROM log_actions WHERE action_id = ?"); + + foreach (self::$log_actions as $action) { + $query->execute([md5($action['name'])]); + } + + // restore misuse of %coaffected in SEM_ADD_CYCLE and SEM_DELETE_CYCLE + $db->exec("UPDATE log_actions SET info_template = REPLACE(info_template, '%info', '%coaffected') + WHERE name IN ('SEM_ADD_CYCLE', 'SEM_DELETE_CYCLE')"); + + $db->exec("UPDATE log_events SET coaffected_range_id = info WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); + $db->exec("UPDATE log_events SET info = NULL WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); + } +} +?> diff --git a/db/migrations/1.56_step_00176_wap.php b/db/migrations/1.56_step_00176_wap.php new file mode 100644 index 0000000..7828f58 --- /dev/null +++ b/db/migrations/1.56_step_00176_wap.php @@ -0,0 +1,24 @@ +exec("DROP TABLE IF EXISTS wap_sessions"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("CREATE TABLE wap_sessions ( " + ."`user_id` char(32) NOT NULL default '', " + ."`session_id` char(32) NOT NULL default '', " + ."`creation_time` datetime default NULL, " + ."PRIMARY KEY (`session_id`)) ENGINE=MyISAM"); + } +} diff --git a/db/migrations/1.57_step_00158_privacy.php b/db/migrations/1.57_step_00158_privacy.php new file mode 100644 index 0000000..d58469e --- /dev/null +++ b/db/migrations/1.57_step_00158_privacy.php @@ -0,0 +1,107 @@ + 'DOZENT_ALWAYS_VISIBLE', + 'type' => 'boolean', + 'value' => 1, + 'description' => 'Legt fest, ob Personen mit Dozentenrechten immer global sichtbar sind und das auch nicht selbst ändern können.' + // What is the default visibility for unconfigured homepage elements? + ], [ + 'name' => 'HOMEPAGE_VISIBILITY_DEFAULT', + 'type' => 'string', + 'value' => 'VISIBILITY_STUDIP', + 'description' => 'Standardsichtbarkeit für Homepageelemente, falls der Benutzer nichts anderes eingestellt hat. Gültige Werte sind: VISIBILITY_ME, VISIBILITY_BUDDIES, VISIBILITY_DOMAIN, VISIBILITY_STUDIP, VISIBILITY_EXTERN' + ], [ + 'name' => 'FORUM_ANONYMOUS_POSTINGS', + 'type' => 'boolean', + 'value' => 0, + 'description' => 'Legt fest, ob Forenbeiträge anonym verfasst werden dürfen (Root sieht aber immer den Urheber).' + ] + ]; + + function description() + { + return 'add configuration entries and database table for enhanced privacy settings'; + } + + function up() + { + $db = DBManager::get(); + $query = $db->prepare("INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); + + // insert new configuration entries + foreach (self::$config_entries as $entry) { + $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); + } + + // create database table for privacy settings + $db->exec("CREATE TABLE `user_visibility` ( + `user_id` VARCHAR(32) NOT NULL PRIMARY KEY, + `online` TINYINT(1) NOT NULL DEFAULT 1, + `chat` TINYINT(1) NOT NULL DEFAULT 1, + `search` TINYINT(1) NOT NULL DEFAULT 1, + `email` TINYINT(1) NOT NULL DEFAULT 1, + `homepage` TEXT NOT NULL DEFAULT '', + `default_homepage_visibility` INT NOT NULL DEFAULT 0 , + `mkdate` INT(20) NOT NULL DEFAULT 0) ENGINE=MyISAM"); + + // insert default values + $db->exec("INSERT INTO `user_visibility` VALUES ('studip', 1, 1, 1, 1, '', 0, ".time().")"); + + // transfer hidden categories to privacy settings + $data = $db->query("SELECT * FROM `kategorien` WHERE hidden=1"); + $categories = []; + // aggregate all categories by their owner... + while ($category = $data->fetch()) { + $categories[$category['range_id']]['kat_'.$category['kategorie_id']] = VISIBILITY_ME; + } + // ... and write settings to user privacy table + foreach ($categories as $owner_id => $settings) { + $db->exec("INSERT IGNORE INTO `user_visibility` (`homepage`,`user_id`) VALUES (".$db->quote(json_encode($settings)).",".$db->quote($owner_id).")"); + } + + // remove hidden attribute of custom categories (is configured in privacy settings now) + $db->exec("ALTER TABLE `kategorien` DROP `hidden`"); + + // add field for anonymous postings in forum + $db->exec("ALTER TABLE `px_topics` ADD `anonymous` TINYINT(4) NOT NULL DEFAULT 0"); + } + + function down() + { + $db = DBManager::get(); + $query = $db->prepare("DELETE FROM `config` WHERE `field` = ?"); + + foreach (self::$config_entries as $entry) { + $query->execute([$entry['name']]); + } + + // add "hidden" field to user categories... + $db->exec("ALTER TABLE `kategorien` ADD `hidden` TINYINT(4) NOT NULL DEFAULT 0 AFTER `content`"); + // ... and set it there according to privacy settings + $result = $db->query("SELECT `user_id`, `homepage` FROM `user_visibility` WHERE `homepage` LIKE '%kat_%'"); + while ($current = $result->fetch()) { + $data = json_decode($current['homepage'], true); + foreach ($data as $key => $visibility) { + if (substr($key, 0, 4) == 'kat_' && $visibility == VISIBILITY_ME) { + $category_id = substr($key, 4); + DBManager::get()->exec("UPDATE `kategorien` SET `hidden`=1 WHERE `user_id`='".$current['user_id']."'"); + } + } + } + + // delete privacy settings from database + $db->exec("DROP TABLE `user_visibility`"); + + // delete anonymous flag from forum posts + $db->exec("ALTER TABLE `px_topics` DROP `anonymous`"); + } +} +?> diff --git a/db/migrations/1.58_add_config_allow_fakadmin.php b/db/migrations/1.58_add_config_allow_fakadmin.php new file mode 100644 index 0000000..675f9ed --- /dev/null +++ b/db/migrations/1.58_add_config_allow_fakadmin.php @@ -0,0 +1,38 @@ + '"none" Fakultätsadmin darf Einrichtungen weder anlegen noch löschen, "create" Fakultätsadmin darf Einrichtungen anlegen, aber nicht löschen, "all" Fakultätsadmin darf Einrichtungen anlegen und löschen.']; + + function description () + { + return 'adds switch to config to controll fak_admin perms'; + } + + function up () + { + $db = DBManager::get(); + $time = time(); + + foreach ($this->options as $name => $description) + { + $db->exec(" + INSERT INTO config + (config_id, field, value, is_default, type, mkdate, chdate, description) + VALUES + (MD5('$name'), '$name', 'all', 1, 'string', $time, $time, '$description') + "); + } + + } + + function down () + { + $db = DBManager::get(); + foreach ($this->options as $name => $descrition) + { + $db->exec("DELETE FROM config WHERE field = '$name'"); + } + + } +} +?> diff --git a/db/migrations/1.59_step_00194_studycourse.php b/db/migrations/1.59_step_00194_studycourse.php new file mode 100644 index 0000000..a8e028e --- /dev/null +++ b/db/migrations/1.59_step_00194_studycourse.php @@ -0,0 +1,33 @@ +exec("CREATE TABLE IF NOT EXISTS `abschluss` ( + `abschluss_id` char(32) NOT NULL default '', + `name` varchar(255) NOT NULL default '', + `beschreibung` text, + `mkdate` int(20) default NULL, + `chdate` int(20) default NULL, + PRIMARY KEY (`abschluss_id`) + ) ENGINE=MyISAM"); + $db->exec("ALTER TABLE `user_studiengang` ADD `semester` TINYINT(2) DEFAULT 0"); + $db->exec("ALTER TABLE `user_studiengang` ADD `abschluss_id` CHAR(32) DEFAULT 0"); + $db->exec("ALTER TABLE `user_studiengang` ADD INDEX ( `studiengang_id` )"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("DROP TABLE IF EXISTS `abschluss`"); + $db->exec("ALTER TABLE `user_studiengang` DROP `semester`"); + $db->exec("ALTER TABLE `user_studiengang` DROP `abschluss_id`"); + } +} diff --git a/db/migrations/1.5_step_25_raumzeit_migrations.php b/db/migrations/1.5_step_25_raumzeit_migrations.php new file mode 100644 index 0000000..14b9252 --- /dev/null +++ b/db/migrations/1.5_step_25_raumzeit_migrations.php @@ -0,0 +1,169 @@ +write( get_class($this)." - Creating db schema..."); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `themen` ( + `issue_id` varchar(32) NOT NULL default '', + `seminar_id` varchar(32) NOT NULL default '', + `author_id` varchar(32) NOT NULL default '', + `title` varchar(255) NOT NULL default '', + `description` text NOT NULL, + `priority` smallint(5) unsigned NOT NULL default '0', + `mkdate` int(10) unsigned NOT NULL default '0', + `chdate` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`issue_id`), + KEY `seminar_id` (`seminar_id`,`priority`) + ) ENGINE=MyISAM; + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `ex_termine` ( + `termin_id` varchar(32) NOT NULL default '', + `range_id` varchar(32) NOT NULL default '', + `autor_id` varchar(32) NOT NULL default '', + `content` varchar(255) NOT NULL default '', + `description` text, + `date` int(20) NOT NULL default '0', + `end_time` int(20) NOT NULL default '0', + `mkdate` int(20) NOT NULL default '0', + `chdate` int(20) NOT NULL default '0', + `date_typ` tinyint(4) NOT NULL default '0', + `topic_id` varchar(32) default NULL, + `expire` int(20) default NULL, + `repeat` varchar(128) default NULL, + `color` varchar(20) default NULL, + `priority` tinyint(4) default NULL, + `raum` varchar(255) default NULL, + `metadate_id` varchar(32) default NULL, + `resource_id` varchar(32) NOT NULL default '', + PRIMARY KEY (`termin_id`), + KEY `range_id` (`range_id`,`date`), + KEY `metadate_id` (`metadate_id`,`date`) + ) ENGINE=MyISAM PACK_KEYS=1; + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `themen_termine` ( + `issue_id` varchar(32) NOT NULL default '', + `termin_id` varchar(32) NOT NULL default '', + PRIMARY KEY (`issue_id`,`termin_id`), + KEY `termin_id` (`termin_id`,`issue_id`) + ) ENGINE=MyISAM; + "); + DBManager::get()->exec(" + ALTER TABLE `termine` DROP INDEX `autor_id` + "); + DBManager::get()->exec(" + ALTER TABLE `termine` DROP INDEX `range_id` + "); + DBManager::get()->exec(" + ALTER TABLE `termine` ADD `metadate_id` VARCHAR( 32 ); + "); + + DBManager::get()->exec(" + ALTER TABLE `termine` ADD INDEX ( `metadate_id` , `date` ) + "); + + DBManager::get()->exec(" + ALTER TABLE `termine` ADD INDEX ( `range_id` , `date` ); + "); + + DBManager::get()->exec(" + ALTER TABLE `resources_requests` ADD `reply_comment` TEXT AFTER `comment`; + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_UNDELETE_SINGLEDATE'), 'SEM_UNDELETE_SINGLEDATE', 'Einzeltermin wiederherstellen', '%user stellt Einzeltermin %singledate(%affected) in %sem(%coaffected) wieder her.', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_SINGLEDATE'), 'SEM_DELETE_SINGLEDATE', 'Einzeltermin löschen', '%user löscht Einzeltermin %singledate(%affected) in %sem(%coaffected).', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_SET_STARTSEMESTER'), 'SEM_SET_STARTSEMESTER', 'Startsemester ändern', '%user hat in %sem(%affected) das Startsemester auf %semester(%coaffected) geändert.', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_SET_ENDSEMESTER'), 'SEM_SET_ENDSEMESTER', 'Semesterlaufzeit ändern', '%user hat in %sem(%affected) die Laufzeit auf %semester(%coaffected) geändert', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_ADD_CYCLE'), 'SEM_ADD_CYCLE', 'Regelmäßige Zeit hinzugefügt', '%user hat in %sem(%affected) die regelmäßige Zeit %coaffected hinzugefügt.', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_CYCLE'), 'SEM_DELETE_CYCLE', 'Regelmäßige Zeit gelöscht', '%user hat in %sem(%affected) die regelmäßige Zeit %coaffected gelöscht.', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_ADD_SINGLEDATE'), 'SEM_ADD_SINGLEDATE', 'Einzeltermin hinzufügen', '%user hat in %sem(%affected) den Einzeltermin %coaffected hinzugefügt', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_REQUEST'), 'SEM_DELETE_REQUEST', 'Raumanfrage gelöscht', '%user hat in %sem(%affected) die Raumanfrage für die gesamte Veranstaltung gelöscht.', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SEM_DELETE_SINGLEDATE_REQUEST'), 'SEM_DELETE_SINGLEDATE_REQUEST', 'Einzeltermin, Raumanfrage gelöscht', '%user hat in %sem(%affected) die Raumanfrage für den Termin %coaffected gelöscht.', 1, NULL); + "); + + DBManager::get()->exec(" + INSERT INTO `log_actions` VALUES (MD5('SINGLEDATE_CHANGE_TIME'), 'SINGLEDATE_CHANGE_TIME', 'Einzeltermin bearbeiten', '%user hat in %sem(%affected) den Einzeltermin %coaffected geändert.', 1, NULL); + "); + + // move "RESOURCES_ENABLE" from config_local.inc.php to config table: + if( $GLOBALS["RESOURCES_ENABLE"] ){ + // if "true", insert this as a local customization + DBManager::get()->exec(" + INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES ( 'dade8ea9ac4ec346e796ab9449d35b0e' , '', 'RESOURCES_ENABLE', '1', '0', 'boolean', 'global', '', '0', '0', '0', 'Enable the Stud.IP resource management module', '', ''); + "); + } + + // RESOURCES_ENABLE default value (=false) + DBManager::get()->exec(" + INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES ( '06cdb765fb8f0853e3ebe08f51c3596e' , '', 'RESOURCES_ENABLE', '0', '1', 'boolean', 'global', '', '0', '0', '0', 'Enable the Stud.IP resource management module', '', ''); + "); + + DBManager::get()->exec(" + INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES ( '93da66ca9e2d17df5bc61bd56406add7' , '', 'RESOURCES_ROOM_REQUEST_DEFAULT_ACTION', 'NO_ROOM_INFO_ACTION', '1', 'string', 'global', '', '0', '0', '0', 'Designates the pre-selected action for the room request dialog', 'Valid values are: NO_ROOM_INFO_ACTION, ROOM_REQUEST_ACTION, BOOKING_OF_ROOM_ACTION, FREETEXT_ROOM_ACTION', ''); + "); + + DBManager::get()->exec(" + INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) + VALUES ('0d3f84ed4dd6b7147b504ffb5b6fbc2c', '', 'RESOURCES_ENABLE_EXPERT_SCHEDULE_VIEW', '0', 1, 'boolean', 'global', '', 0, 12, 12, 'Enables the expert view of the course schedules', '', ''); + "); + + DBManager::get()->exec(" + INSERT INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES ( 'bc3004618b17b29dc65e10e89be9a7a0', '', 'RESOURCES_ENABLE_BOOKINGSTATUS_COLORING', '1', '1', 'boolean', 'global', '', '0', '0', '0', 'Enable the colored presentation of the room booking status of a date', '', ''); + "); + + $this->write( get_class($this).": Finished with creating db schema."); + + // close logfile + fclose($logfile_handle); + } +} + diff --git a/db/migrations/1.60_step_00191_modulesenable.php b/db/migrations/1.60_step_00191_modulesenable.php new file mode 100644 index 0000000..ba75320 --- /dev/null +++ b/db/migrations/1.60_step_00191_modulesenable.php @@ -0,0 +1,107 @@ + 'CHAT_ENABLE', + 'value' => $this->getValue('CHAT_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob der Chat global verfügbar ist.', + ], + ['field' => 'CALENDAR_ENABLE', + 'value' => $this->getValue('CALENDAR_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob der Kalender global verfügbar ist.', + ], + ['field' => 'EXPORT_ENABLE', + 'value' => $this->getValue('EXPORT_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob der Export global verfügbar ist.', + ], + ['field' => 'EXTERN_ENABLE', + 'value' => $this->getValue('EXTERN_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob die externen Seiten global verfügbar sind.', + ], + ['field' => 'VOTE_ENABLE', + 'value' => $this->getValue('VOTE_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob die Umfragen global verfügbar sind.', + ], + ['field' => 'ELEARNING_INTERFACE_ENABLE', + 'value' => $this->getValue('ELEARNING_INTERFACE_ENABLE', 0), + 'comment' => 'Schaltet ein oder aus, ob die Lernmodule global verfügbar sind.', + ], + ['field' => 'STM_ENABLE', + 'value' => $this->getValue('STM_ENABLE', 0), + 'comment' => 'Schaltet ein oder aus, ob die Studienmodule global verfügbar sind.', + ], + ['field' => 'WIKI_ENABLE', + 'value' => $this->getValue('WIKI_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob das Wiki global verfügbar ist.', + ], + ['field' => 'SMILEYADMIN_ENABLE', + 'value' => $this->getValue('SMILEYADMIN_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob die Administration der Smileys verfügbar ist.', + ], + ['field' => 'LOG_ENABLE', + 'value' => $this->getValue('LOG_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob das Log global verfügbar ist.', + ], + ['field' => 'SCM_ENABLE', + 'value' => $this->getValue('SCM_ENABLE'), + 'comment' => 'Schaltet ein oder aus, ob freie Informationsseiten global verfügbar sind.', + ], + ['field' => 'BANNER_ADS_ENABLE', + 'value' => $this->getValue('BANNER_ADS_ENABLE', 0), + 'comment' => 'Schaltet ein oder aus, ob die Bannerwerbung global verfügbar ist.', + ] + ]; + } + + function up() + { + $db = DBManager::get(); + + // existing + $db->exec("UPDATE `config` SET `section` = 'modules', `chdate` = '".time()."' WHERE `field` = 'RESOURCES_ENABLE'"); + $db->exec("UPDATE `config` SET `section` = 'studygroups', `type` = 'boolean', `range` = 'global', `chdate` = '".time()."' WHERE `field` = 'STUDYGROUPS_ENABLE'"); + + //moving + foreach ($this->getModules() as $module) { + $db->exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) VALUES ( MD5('". $module['field'] . "'), '', '". $module['field'] . "', '". $module['value'] . "', '1', 'boolean', 'global', 'modules', '0', '".time()."', '".time()."', '". $module['comment'] . "', '', '')"); + } + + // new + $db->exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) VALUES ( MD5('LITERATURE_ENABLE'), '', 'LITERATURE_ENABLE', '1', '1', 'boolean', 'global', 'modules', '0', '".time()."', '".time()."', 'Schaltet ein oder aus, ob die Literaturverwaltung global verfügbar ist.', '', '')"); + + //changing studygroup config + $db->exec("UPDATE config SET value = REPLACE (value, '|', ' ') WHERE field = 'STUDYGROUP_SETTINGS'"); + } + + function down() + { + $db = DBManager::get(); + + //existing + $db->exec("UPDATE `config` SET `section` = '', `chdate` = '".time()."' WHERE `field` = 'RESOURCES_ENABLE'"); + $db->exec("UPDATE `config` SET `section` = '', `chdate` = '".time()."' WHERE `field` = 'STUDYGROUPS_ENABLE'"); + + //moving + foreach ($this->modules as $module) { + $db->exec("DELETE FROM `config` WHERE `field` = '" . $module['field'] . "'"); + } + + //new + $db->exec("DELETE FROM `config` WHERE `field` = 'LITERATURE_ENABLE'"); + + //changing studygroup config + $db->exec("UPDATE config SET value = REPLACE (value, ' ', '|') WHERE field = 'STUDYGROUP_SETTINGS'"); + } +} diff --git a/db/migrations/1.61_remove_studygroupdozent.php b/db/migrations/1.61_remove_studygroupdozent.php new file mode 100644 index 0000000..1b5ef43 --- /dev/null +++ b/db/migrations/1.61_remove_studygroupdozent.php @@ -0,0 +1,18 @@ +exec("DELETE FROM seminar_user WHERE status = 'dozent' AND user_id = MD5('studygroup_dozent')"); + $db->exec("DELETE FROM auth_user_md5 WHERE user_id = MD5('studygroup_dozent')"); + + } +} +?> diff --git a/db/migrations/1.62_gender_iso_5218.php b/db/migrations/1.62_gender_iso_5218.php new file mode 100644 index 0000000..8a49eed --- /dev/null +++ b/db/migrations/1.62_gender_iso_5218.php @@ -0,0 +1,24 @@ +exec("UPDATE user_info SET geschlecht = 2 WHERE geschlecht = 1"); + } + + function down() + { + $db = DBManager::get(); + + $db->exec("UPDATE user_info SET geschlecht = 0 WHERE geschlecht = 1"); + $db->exec("UPDATE user_info SET geschlecht = 1 WHERE geschlecht = 2"); + } +} diff --git a/db/migrations/1.63_tic1207_config.php b/db/migrations/1.63_tic1207_config.php new file mode 100644 index 0000000..02199fc --- /dev/null +++ b/db/migrations/1.63_tic1207_config.php @@ -0,0 +1,52 @@ +exec("UPDATE config SET section = 'resources' WHERE field LIKE 'RESOURCES%'"); + $db->exec("UPDATE config SET section = 'studygroups' WHERE field LIKE 'STUDYGROUP%'"); + $db->exec("UPDATE config SET section = 'elearning_interface' WHERE field LIKE 'ELEARNING\_INTERFACE%' AND field != 'ELEARNING_INTERFACE_ENABLE'"); + $db->exec("UPDATE config SET section = 'permissions' WHERE field IN (" + ."'ALLOW_ADMIN_USERACCESS','ALLOW_DOZENT_ARCHIV','ALLOW_DOZENT_VISIBILITY'," + ."'ALLOW_SELFASSIGN_INSTITUTE','AUX_RULE_ADMIN_PERM','LOCK_RULE_ADMIN_PERM'," + ."'INST_FAK_ADMIN_PERMS','RANGE_TREE_ADMIN_PERM','RESTRICTED_USER_MANAGEMENT'," + ."'SEM_CREATE_PERM','SEM_TREE_ADMIN_PERM','SEM_TREE_SHOW_EMPTY_AREAS_PERM'," + ."'SEM_VISIBILITY_PERM')"); + $db->exec("UPDATE config SET section = 'privacy' WHERE field IN (" + ."'DOZENT_ALWAYS_VISIBLE','ENABLE_SKYPE_INFO','FOAF_SHOW_IDENTITY'," + ."'FORUM_ANONYMOUS_POSTINGS','HOMEPAGE_VISIBILITY_DEFAULT'," + ."'USER_VISIBILITY_UNKNOWN')"); + $db->exec("UPDATE config SET section = 'files' WHERE field LIKE 'ZIP_%' OR " + ."field IN ('ENABLE_PROTECTED_DOWNLOAD_RESTRICTION', 'DOCUMENTS_EMBEDD_FLASH_MOVIES', " + ."'SENDFILE_LINK_MODE')"); + $db->exec("UPDATE config SET section = 'evaluation' WHERE field LIKE 'EVAL\_%'"); + $db->exec("UPDATE config SET section = 'archiv' WHERE field LIKE 'AUTO\_ARCHIV%'"); + + //adding descriptions + $db->exec("UPDATE config SET description = 'Schaltet ein oder aus, ob die Studiengruppen global verfügbar sind.' WHERE field = 'STUDYGROUPS_ENABLE'"); + $db->exec("UPDATE config SET description = 'Die Standardeinrichtung für Studiengruppen kann hier gesetzt werden.' WHERE field = 'STUDYGROUP_DEFAULT_INST'"); + $db->exec("UPDATE config SET description = 'Hier werden die globalen Einstellungen aller Studiengruppen hinterlegt.' WHERE field = 'STUDYGROUP_SETTINGS'"); + $db->exec("UPDATE config SET description = 'Hier werden die Nutzungsbedinungen der Studiengruppen hinterlegt.' WHERE field = 'STUDYGROUP_TERMS'"); + + //adding missing types, if not existing, use default "string" + $db->exec("UPDATE config SET type = 'string' WHERE type = ''"); + $db->exec("UPDATE config SET type = 'string' " + ."WHERE field LIKE 'ELEARNING\_INTERFACE%' " + ."AND field != 'ELEARNING_INTERFACE_ENABLE' " + ."AND field NOT LIKE '%ACTIVE' " + ."AND type = 'boolean'"); + } + + function down() + { + } +} diff --git a/db/migrations/1.64_step_00199_forced_course_grouping.php b/db/migrations/1.64_step_00199_forced_course_grouping.php new file mode 100644 index 0000000..4fad4ef --- /dev/null +++ b/db/migrations/1.64_step_00199_forced_course_grouping.php @@ -0,0 +1,40 @@ + 'MY_COURSES_FORCE_GROUPING', + 'type' => 'string', + 'value' => 'sem_number', + 'description' => 'Legt fest, ob die persönliche Veranstaltungsübersicht systemweit zwangsgruppiert werden soll, wenn keine eigene Gruppierung eingestellt ist. Werte: not_grouped, sem_number, sem_tree_id, sem_status, gruppe, dozent_id.' + ] + ]; + + function description() + { + return 'add configuration entry for forced grouping of My courses for all users who haven\'t grouped for themselves'; + } + + function up() + { + $db = DBManager::get(); + $query = $db->prepare("INSERT IGNORE INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', '', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); + + // insert new configuration entries + foreach (self::$config_entries as $entry) { + $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); + } + } + + function down() + { + $db = DBManager::get(); + $query = $db->prepare("DELETE FROM `config` WHERE `config_id` = MD5(?)"); + + foreach (self::$config_entries as $entry) { + $query->execute([md5($entry['name'])]); + } + } +} +?> diff --git a/db/migrations/1.65_step_00198_deputies.php b/db/migrations/1.65_step_00198_deputies.php new file mode 100644 index 0000000..1cc9f16 --- /dev/null +++ b/db/migrations/1.65_step_00198_deputies.php @@ -0,0 +1,62 @@ + 'DEPUTIES_ENABLE', + 'type' => 'boolean', + 'value' => 0, + 'description' => 'Legt fest, ob die Funktion Vertretung aktiviert ist.' + ], + [ + 'name' => 'DEPUTIES_DEFAULTENTRY_ENABLE', + 'type' => 'boolean', + 'value' => 0, + 'description' => 'Dürfen Lehrende Standardvertretungen festlegen? Diese werden automatisch bei Hinzufügen der Lehrenden als Vertretung in Veranstaltungen eingetragen.' + ], + [ + 'name' => 'DEPUTIES_EDIT_ABOUT_ENABLE', + 'type' => 'boolean', + 'value' => 1, + 'description' => 'Dürfen Lehrende ihren Standardvertretungen erlauben, ihr Profil zu bearbeiten?' + ] + ]; + + function description() + { + return 'deputies'; + } + + function up() + { + $db = DBManager::get(); + + $query = $db->prepare("INSERT IGNORE INTO `config` ". + "(`config_id`, `parent_id`, `field`, `value`, `is_default`, ". + "`type`, `range`, `section`, `position`, `mkdate`, `chdate`, ". + "`description`, `comment`, `message_template`) + VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'deputies', '0', ". + "UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); + + // insert new configuration entries + foreach (self::$config_entries as $entry) { + $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); + } + + $db->exec("CREATE TABLE `deputies` ( ". + "`range_id` VARCHAR(32) NOT NULL, ". + "`user_id` VARCHAR(32) NOT NULL, ". + "`gruppe` TINYINT(4) NOT NULL DEFAULT 0, ". + "`notification` INT(10) NOT NULL DEFAULT 0, ". + "`edit_about` TINYINT(1) NOT NULL DEFAULT 0, ". + "PRIMARY KEY (`range_id`, `user_id`)) ENGINE=MyISAM"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("DROP TABLE `deputies`"); + } +} diff --git a/db/migrations/1.66_config_filesystem_multicopy_enable.php b/db/migrations/1.66_config_filesystem_multicopy_enable.php new file mode 100644 index 0000000..e721fb5 --- /dev/null +++ b/db/migrations/1.66_config_filesystem_multicopy_enable.php @@ -0,0 +1,34 @@ + 'FILESYSTEM_MULTICOPY_ENABLE', + 'type' => 'boolean', + 'value' => 1, + 'section' => '', + 'description' => 'Soll es erlaubt sein, das Dozenten Ordner oder Dateien in mehrere Veranstaltungen bzw. Institute verschieben oder kopieren dürfen?' + ]; + + $stmt = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + function down() { + $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'FILESYSTEM_MULTICOPY_ENABLE'"); + } +} diff --git a/db/migrations/1.67_step_00204_no_document_deletion.php b/db/migrations/1.67_step_00204_no_document_deletion.php new file mode 100644 index 0000000..9648ce8 --- /dev/null +++ b/db/migrations/1.67_step_00204_no_document_deletion.php @@ -0,0 +1,26 @@ +exec("ALTER TABLE `dokumente` ADD `author_name` VARCHAR( 255 ) NOT NULL DEFAULT ''"); + $db->exec(" UPDATE dokumente + LEFT JOIN auth_user_md5 USING ( user_id ) + LEFT JOIN user_info USING ( user_id ) + SET author_name = TRIM( CONCAT( title_front, ' ', Vorname, ' ', Nachname, IF( title_rear != '', CONCAT( ', ', title_rear ) , '' ) ) )"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("ALTER TABLE `dokumente` DROP `author_name`"); + } +} +?> diff --git a/db/migrations/1.68_add_schedule_table.php b/db/migrations/1.68_add_schedule_table.php new file mode 100644 index 0000000..b68efa9 --- /dev/null +++ b/db/migrations/1.68_add_schedule_table.php @@ -0,0 +1,63 @@ +exec(" + CREATE TABLE `schedule` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `start` smallint(6) NOT NULL COMMENT 'start hour and minutes', + `end` smallint(6) NOT NULL COMMENT 'end hour and minutes', + `day` tinyint(4) NOT NULL COMMENT 'day of week, 0-6', + `title` varchar(255) NOT NULL, + `content` varchar(255) NOT NULL, + `color` varchar(7) NOT NULL COMMENT 'color, rgb in hex', + `user_id` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`) + ) ENGINE=MyISAM; + "); + + DBManager::get()->exec(" + CREATE TABLE `schedule_seminare` ( + `user_id` VARCHAR( 32 ) NOT NULL , + `seminar_id` VARCHAR( 32 ) NOT NULL , + `metadate_id` VARCHAR( 32 ) NOT NULL , + `visible` BOOLEAN NOT NULL DEFAULT '1' , + `color` VARCHAR( 7 ) NULL COMMENT 'color, rgb in hex', + PRIMARY KEY ( `user_id` , `seminar_id`, `metadate_id` ) + ) ENGINE=MyISAM; + "); + + // move old "virtual" entries to new table + $db = DBManager::get()->query("SELECT sus.*, metadata_dates FROM seminar_user_schedule as sus + LEFT JOIN seminare as s ON (s.Seminar_id = sus.range_id) + WHERE s.Seminar_id IS NOT NULL"); + + $stmt = DBManager::get()->prepare("INSERT IGNORE INTO schedule_seminare + (user_id, seminar_id, metadate_id) VALUES(?, ?, ?)"); + + while ($data = $db->fetch()) { + $md = @unserialize($data['metadata_dates']); + if (is_array($md['turnus_data'])) { + foreach ($md['turnus_data'] as $cycle) { + $stmt->execute([$data['user_id'], $data['range_id'], $cycle['metadate_id']]); + } + } + } + + } + + function down () + { + DBManager::get()->query("DROP TABLE schedule"); + DBManager::get()->query("DROP TABLE schedule_seminare"); + } +} diff --git a/db/migrations/1.69_step_00202_enhanced_seminar_cycle.php b/db/migrations/1.69_step_00202_enhanced_seminar_cycle.php new file mode 100644 index 0000000..709b15f --- /dev/null +++ b/db/migrations/1.69_step_00202_enhanced_seminar_cycle.php @@ -0,0 +1,88 @@ + 'ALLOW_METADATE_SORTING', + 'type' => 'boolean', + 'value' => 0, + 'section' => 'permissions', + 'description' => 'Soll es erlaubt sein, dass regelmäßige Zeiten einer Veranstaltung frei sortiert werden können?' + ]; + + $stmt = $db->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + + $db->exec("CREATE TABLE IF NOT EXISTS `seminar_cycle_dates` ( + `metadate_id` varchar(32) NOT NULL, + `seminar_id` varchar(32) NOT NULL, + `start_time` time NOT NULL, + `end_time` time NOT NULL, + `weekday` tinyint(3) unsigned NOT NULL, + `description` varchar(255) NOT NULL DEFAULT '', + `sws` decimal(2,1) NOT NULL DEFAULT '0.0', + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `week_offset` tinyint(3) unsigned NOT NULL DEFAULT '0', + `sorter` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mkdate` int(10) unsigned NOT NULL, + `chdate` int(10) unsigned NOT NULL, + PRIMARY KEY (`metadate_id`), + KEY `seminar_id` (`seminar_id`) + ) ENGINE=MyISAM;"); + + $stmt = $db->prepare("INSERT INTO `seminar_cycle_dates` + (`metadate_id`, `seminar_id`, `start_time`, `end_time`, `weekday`, + `description`, `cycle`, `week_offset`, `mkdate`, `chdate`) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + foreach ($db->query("SELECT Seminar_id, metadata_dates, mkdate, chdate FROM seminare") as $row) { + $md = @unserialize($row['metadata_dates']); + if (is_array($md['turnus_data'])) { + foreach ($md['turnus_data'] as $c) { + if ($c['metadate_id']) { + $stmt->execute([$c['metadate_id'], + $row['Seminar_id'], + sprintf('%02s:%02s', (int)$c['start_stunde'], (int)$c['start_minute']), + sprintf('%02s:%02s', (int)$c['end_stunde'], (int)$c['end_minute']), + (int)$c['day'], + (string)$c['desc'], + (int)$md['turnus'], + (int)$md['start_woche'], + $row['mkdate'], + $row['chdate'] + ] + ); + } + } + } + } + //So Long, and Thanks for All the Fish + $db->exec("ALTER TABLE `seminare` DROP `metadata_dates`"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("DROP TABLE `seminar_cycle_dates`"); + $db->exec("ALTER TABLE `seminare` ADD `metadata_dates` TEXT NOT NULL DEFAULT ''"); + $db->exec("DELETE FROM config WHERE field LIKE 'ALLOW_METADATE_SORTING'"); + } +} +?> diff --git a/db/migrations/1.6_step_25_raumzeit_db_conversion.php b/db/migrations/1.6_step_25_raumzeit_db_conversion.php new file mode 100644 index 0000000..1dd8edf --- /dev/null +++ b/db/migrations/1.6_step_25_raumzeit_db_conversion.php @@ -0,0 +1,241 @@ +write( get_class($this).": Starting data conversion... - this may take a very long time"); + + // create secret password for subroutine authentication + $secret_password = md5(uniqid("ditnuc6532ktn")); + + // signal start of conversion and set 'secret' + DBManager::get()->exec(" + REPLACE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) + VALUES ( + 'migration5' , '', 'MIGRATION_5_TEMPORARY_SECRET', '".$secret_password."', '0', 'string', 'global', '', '0', '0', '0', 'Temporary secret string for migragtion 5', 'Temporary entry of migration 5', '' + ); + "); + + $this->convert_data( $logfile_handle, $secret_password); + + // remove signal + DBManager::get()->exec("DELETE FROM `config` WHERE config_id = 'migration5'"); + + $this->write( get_class($this).": Finished with data conversion..."); + + // close logfile + fclose($logfile_handle); + } + + + public function convert_data($logfile_handle, $secret_password) + { + // data conversion code: + + // we need enough memory + ini_set( "memory_limit", "256M"); + + // set URL of subroutine file + // (needed because of PHP memory problems, if the conversion would be done in one step) + $CONVERSION_SUBROUTINE_URL = $GLOBALS["ABSOLUTE_URI_STUDIP"] ."raumzeit_conversion_subroutine.php"; + + // define step size (number of rows) for subroutine proccessing + $STEP_SIZE= 300; + + + // include business logic + require_once('lib/classes/Seminar.class.php'); + require_once('lib/resources/lib/VeranstaltungResourcesAssign.class.php'); + + + + // lets go... + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Starting conversion of imported seminar dates.\n"); + + + // STEP 1: + // convert the title of dates (="content") to real themes + // converts all dates, that don't have content=='' + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Step 1: Converting the title of dates to real themes:\n"); + + // get all dates (=termine) with content!='' + $query = "SELECT termine.* + FROM seminare + LEFT JOIN termine ON (seminare.Seminar_id = termine.range_id) + WHERE content != '' OR description != ''"; + $data = DBManager::get()->fetchAll($query); + + // create new theme for each date + foreach ($data as $row) { + $new_issue_id = md5(uniqid('Issue', true)); + + $query = "INSERT INTO `themen_termine` (`issue_id`, `termin_id`) + VALUES (:issue_id, :termin_id)"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':issue_id', $new_issue_id); + $statement->bindValue(':termin_id', $row['termin_id']); + $statement->execute(); + + $query = "INSERT INTO themen + (issue_id, seminar_id, author_id, title, description, mkdate, chdate) + VALUES + (:issue_id, :seminar_id, :author_id, :title, :description, :mkdate, :chdate)"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':issue_id', $new_issue_id); + $statement->bindValue(':seminar_id', $row['range_id']); + $statement->bindValue(':author_id', $row['author_id']); + $statement->bindValue(':title', $row['content']); + $statement->bindValue(':description', $row['description']); + $statement->bindValue(':mkdate', $row['mkdate']); + $statement->bindValue(':chdate', $row['chdate']); + $statement->execute(); + + $query = "UPDATE termine + SET content = '', description = '' + WHERE termin_id = :termin_id"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':termin_id', $row['termin_id']); + $statement->execute(); + + $query = "UPDATE folder + SET range_id = :range_id + WHERE range_id = :termin_id"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':range_id', $new_issue_id); + $statement->bindValue(':termin_id', $row['termin_id']); + $statement->execute(); + + if ($row['topic_id']) { + $query = "UPDATE px_topics + SET topic_id = :issue_id + WHERE topic_id = :topic_id"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':issue_id', $new_issue_id); + $statement->bindValue(':topic_id', $row['topic_id']); + $statement->execute(); + + $query = "UPDATE px_topics + SET root_id = :issue_id + WHERE root_id = :topic_id"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':issue_id', $new_issue_id); + $statement->bindValue(':topic_id', $row['topic_id']); + $statement->execute(); + + $query = "UPDATE px_topics + SET parent_id = :issue_id + WHERE parent_id = :topic_id"; + $statement = DBManager::get()->prepare($query); + $statement->bindValue(':issue_id', $new_issue_id); + $statement->bindValue(':topic_id', $row['topic_id']); + $statement->execute(); + } + + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") converting termin_id='".$row['termin_id']."', added theme_id='".$new_issue_id."'\n"); + flush(); + } + + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Finished Step 1. Converted " . count($data) . " dates.\n"); + + // END OF STEP 1 + + + // STEP 2: + // create single dates for all regular dates (turnus_data in metadata_dates) + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Step 2: Creating single dates for all regular dates:\n"); + + // reset counter + $counter = 0; + + // set number of record to start with + $start_at = 0; + + do { + // call the conversion subroutine with number of rows that should get processed + + $subroutine_url = $CONVERSION_SUBROUTINE_URL ."?step_size=".$STEP_SIZE."&start_at=".$start_at."&secret=".$secret_password; + +// curl: + // create cURL-Handle + $ch = curl_init(); + + // set url and other option + curl_setopt($ch, CURLOPT_URL, $subroutine_url); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); + + // make the call to the url + $response = curl_exec ($ch); + + // close cURL-Handle und gebe die Systemresourcen frei + curl_close($ch); + +// file_get_contents (fopen wrappers) +// removed file_get_contents access, in favor of curl because file_get_contents could not access the desired URL with +// every data we had for testing; it was not possible to reproduce this error e.g. by calling file_get_contents +// directly from the shell +// // open URL via fopen = "call" subroutine +// $response = file_get_contents( $subroutine_url ); + + // success ? + if( $response == FALSE ){ + $this->write( get_class($this)." - Error while executing subroutine. Can't open URL. Stopping.\n"); + fwrite($logfile_handle, "Error while executing subroutine. Can't open URL '$subroutine_url'. Stopping.\n"); + throw new Exception("Error while executing subroutine."); + } + + + // some not quite nice error handling: + if( substr($response,0,5) == "ERROR" ){ + // write output to logfile + $this->write( get_class($this)." - Error while executing subroutine. Please see logfile for details. Stopping.\n"); + fwrite( $logfile_handle, $response); + fwrite($logfile_handle, "Error while executing subroutine. Stopping.\n"); + throw new Exception("Error while executing subroutine.". $response); + } + + // get last line (holds the number of converted rows) + $begin_of_last_line = strrpos( $response, "\n")+1; + $numberOfConvertedRows = substr($response, $begin_of_last_line, strlen($response)-$begin_of_last_line); + + // check, if $numberOfConvertedRows is really a number + if( !is_numeric($numberOfConvertedRows) ){ + $this->write( get_class($this)." - Error while executing subroutine. Please see logfile for details. Stopping.\n"); + // write output to logfile + fwrite( $logfile_handle, $response."\n"); + fwrite($logfile_handle, "Error while executing subroutine. Invalid number of converted lines found. Stopping.\n"); + throw new Exception("Error while executing subroutine.\n ". $response); + } + + // cutoff last line + $response = substr($response, 0, $begin_of_last_line); + + // write output to logfile + fwrite( $logfile_handle, $response); + + // count total amount of converted seminars + $counter += $numberOfConvertedRows; + + // step to next record package + $start_at += $STEP_SIZE; + + } while( $numberOfConvertedRows != 0); + + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Finished Step 2. Converted $counter seminars.\n"); + + fwrite($logfile_handle, "(". date("Y-m-d H:i:s T") .") Conversion finished."); + + $this->write( get_class($this).": Converted $counter seminars."); + } +} diff --git a/db/migrations/1.70_step_00184_html5_video.php b/db/migrations/1.70_step_00184_html5_video.php new file mode 100644 index 0000000..a7ca83c --- /dev/null +++ b/db/migrations/1.70_step_00184_html5_video.php @@ -0,0 +1,120 @@ + 'LOAD_EXTERNAL_MEDIA', + 'description' => 'Sollen externe Medien über [img/flash/audio/video] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=proxy benutzen.', + 'section' => '', + 'type' => 'string', + 'value' => 'deny' + ] + ]; + + /** + * old config options to remove + */ + private $options_old = [ + [ + 'name' => 'EXTERNAL_IMAGE_EMBEDDING', + 'description' => 'Sollen externe Bilder über [img] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', + 'section' => '', + 'type' => 'string', + 'value' => 'deny' + ], [ + 'name' => 'EXTERNAL_FLASH_MOVIE_EMBEDDING', + 'description' => 'Sollen externe Flash-Filme mit Hilfe des [flash]-Tags der Schnellformatierung eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', + 'section' => '', + 'type' => 'string', + 'value' => 'deny' + ] + ]; + + /** + * short description of this migration + */ + function description() + { + return 'add database table for generic media proxy'; + } + + /** + * insert list of options into config table + */ + function insertConfig($options) + { + $db = DBManager::get(); + $time = time(); + + $stmt = $db->prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + /** + * remove list of options from config table + */ + function deleteConfig($options) + { + $db = DBManager::get(); + + $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); + + foreach ($options as $option) { + $stmt->execute(['name' => $option['name']]); + } + } + + /** + * perform this migration + */ + function up() + { + $db = DBManager::get(); + + $db->exec("CREATE TABLE media_cache ( + id varchar(32) NOT NULL, + type varchar(64) NOT NULL, + chdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + expires timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (id)) ENGINE=MyISAM"); + + $db->exec("DROP TABLE image_proxy_cache"); + + $this->insertConfig($this->options_new); + $this->deleteConfig($this->options_old); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + + $db->exec("CREATE TABLE image_proxy_cache ( + id char(32) NOT NULL, + type char(10) NOT NULL, + length int(10) unsigned NOT NULL, + error char(15) NOT NULL, + chdate timestamp NOT NULL, + PRIMARY KEY (id), + KEY chdate (chdate, id)) ENGINE=MyISAM"); + + $db->exec("DROP TABLE media_cache"); + + $this->insertConfig($this->options_old); + $this->deleteConfig($this->options_new); + } +} diff --git a/db/migrations/1.71_step_00192_page_layout.php b/db/migrations/1.71_step_00192_page_layout.php new file mode 100644 index 0000000..6f105e2 --- /dev/null +++ b/db/migrations/1.71_step_00192_page_layout.php @@ -0,0 +1,45 @@ +exec("DELETE FROM config WHERE field = 'HTML_HEAD_TITLE'"); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + $time = time(); + + $stmt = $db->prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) + "); + + $stmt->execute([ + 'name' => 'HTML_HEAD_TITLE', + 'description' => 'Angezeigter Titel in der Kopfzeile des Browsers', + 'section' => 'global', + 'type' => 'string', + 'value' => 'Stud.IP' + ]); + } +} diff --git a/db/migrations/1.72_config_ajax_autocomplete_disabled.php b/db/migrations/1.72_config_ajax_autocomplete_disabled.php new file mode 100644 index 0000000..a23fa92 --- /dev/null +++ b/db/migrations/1.72_config_ajax_autocomplete_disabled.php @@ -0,0 +1,34 @@ + 'AJAX_AUTOCOMPLETE_DISABLED', + 'type' => 'boolean', + 'value' => 0, + 'section' => '', + 'description' => 'Sollen alle QuickSearches deaktiviertes Autocomplete haben? Wenn es zu Performanceproblemen kommt, kann es sich lohnen, diese Variable auf true zu stellen.' + ]; + + $stmt = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + function down() { + $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'AJAX_AUTOCOMPLETE_DISABLED'"); + } +} diff --git a/db/migrations/1.73_step_00193_html_email.php b/db/migrations/1.73_step_00193_html_email.php new file mode 100644 index 0000000..77578ac --- /dev/null +++ b/db/migrations/1.73_step_00193_html_email.php @@ -0,0 +1,46 @@ +prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description) + "); + + $stmt->execute([ + 'name' => 'MAIL_AS_HTML', + 'description' => 'Benachrichtigungen werden im HTML-Format versandt', + 'section' => '', + 'range' => 'user', + 'type' => 'boolean', + 'value' => 0 + ]); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + $db->exec("DELETE FROM config WHERE field = 'MAIL_AS_HTML'"); + } +} diff --git a/db/migrations/1.74_tic1422_pagination.php b/db/migrations/1.74_tic1422_pagination.php new file mode 100644 index 0000000..c00ac9c --- /dev/null +++ b/db/migrations/1.74_tic1422_pagination.php @@ -0,0 +1,46 @@ +prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description) + "); + + $stmt->execute([ + 'name' => 'ENTRIES_PER_PAGE', + 'description' => 'Anzahl von Einträgen pro Seite', + 'section' => 'global', + 'range' => 'global', + 'type' => 'integer', + 'value' => 20 + ]); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + $db->exec("DELETE FROM config WHERE field = 'ENTRIES_PER_PAGE'"); + } +} diff --git a/db/migrations/1.75_pdf_logo_configuration.php b/db/migrations/1.75_pdf_logo_configuration.php new file mode 100644 index 0000000..85e1d92 --- /dev/null +++ b/db/migrations/1.75_pdf_logo_configuration.php @@ -0,0 +1,46 @@ + 'PDF_LOGO', + 'type' => 'string', + 'value' => '', + 'section' => 'global', + 'description' => 'Geben Sie hier den absoluten Pfad auf Ihrem Server (also ohne http) zu einem Logo an, das bei PDF-Exporten im Kopfbereich verwendet wird.' + ]; + + $stmt = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'PDF_LOGO'"); + } +} diff --git a/db/migrations/1.76_termin_related_persons.php b/db/migrations/1.76_termin_related_persons.php new file mode 100644 index 0000000..8b113de --- /dev/null +++ b/db/migrations/1.76_termin_related_persons.php @@ -0,0 +1,36 @@ +exec( + "CREATE TABLE IF NOT EXISTS `termin_related_persons` ( " . + "`range_id` varchar(32) NOT NULL, " . + "`user_id` varchar(32) NOT NULL, " . + "PRIMARY KEY (`range_id`,`user_id`) " . + ") ENGINE=MyISAM" + ); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + $db->exec("DROP TABLE `termin_related_persons` "); + } +} diff --git a/db/migrations/1.77_step_00223_lockrules.php b/db/migrations/1.77_step_00223_lockrules.php new file mode 100644 index 0000000..97bee5c --- /dev/null +++ b/db/migrations/1.77_step_00223_lockrules.php @@ -0,0 +1,28 @@ +exec("ALTER TABLE `lock_rules` CHANGE `permission` `permission` ENUM( 'autor', 'tutor', 'dozent', 'admin', 'root' ) NOT NULL DEFAULT 'dozent'"); + $db->exec("ALTER TABLE `lock_rules` ADD `object_type` ENUM( 'sem', 'inst', 'user' ) NOT NULL DEFAULT 'sem'"); + $db->exec("ALTER TABLE `lock_rules` ADD `user_id` VARCHAR( 32 ) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE `user_info` ADD `lock_rule` VARCHAR( 32 ) NOT NULL DEFAULT ''"); + $db->exec("ALTER TABLE `Institute` ADD `lock_rule` VARCHAR( 32 ) NOT NULL DEFAULT ''"); + } + + public function down() + { + $db = DBManager::get(); + $db->exec("ALTER TABLE `lock_rules` CHANGE `permission` `permission` ENUM( 'tutor', 'dozent', 'admin', 'root' ) NOT NULL DEFAULT 'dozent'"); + $db->exec("ALTER TABLE `lock_rules` DROP `object_type`"); + $db->exec("ALTER TABLE `lock_rules` DROP `user_id`"); + $db->exec("ALTER TABLE `user_info` DROP `lock_rule`"); + $db->exec("ALTER TABLE `Institute` DROP `lock_rule`"); + } +} diff --git a/db/migrations/1.78_step00219_webservice_access.php b/db/migrations/1.78_step00219_webservice_access.php new file mode 100644 index 0000000..e4d3f4b --- /dev/null +++ b/db/migrations/1.78_step00219_webservice_access.php @@ -0,0 +1,30 @@ +exec("CREATE TABLE `webservice_access_rules` ( + `api_key` VARCHAR( 100 ) NOT NULL DEFAULT '', + `method` VARCHAR( 100 ) NOT NULL DEFAULT '', + `ip_range` VARCHAR( 200 ) NOT NULL DEFAULT '', + `type` ENUM( 'allow', 'deny' ) NOT NULL DEFAULT 'allow', + `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY + ) ENGINE=MyISAM;"); + + if ($GLOBALS['STUDIP_API_KEY'] && $GLOBALS['WEBSERVICES_ENABLE']) { + $db->exec("INSERT INTO `webservice_access_rules` (`api_key`, `method`, `ip_range`, `type`) VALUES (".$db->quote($GLOBALS['STUDIP_API_KEY']).", '', '', 'allow')"); + } + } + + public function down() + { + $db = DBManager::get(); + $db->exec("DROP TABLE `webservice_access_rules` "); + } +} diff --git a/db/migrations/1.79_step_216_automatisiertes_eintragen.php b/db/migrations/1.79_step_216_automatisiertes_eintragen.php new file mode 100644 index 0000000..1e35718 --- /dev/null +++ b/db/migrations/1.79_step_216_automatisiertes_eintragen.php @@ -0,0 +1,72 @@ +exec(" + CREATE TABLE IF NOT EXISTS `auto_insert_sem` ( + `seminar_id` char(32) NOT NULL, + `status` enum('autor','tutor','dozent') NOT NULL DEFAULT 'autor', + PRIMARY KEY (`seminar_id`,`status`) + ) ENGINE=MyISAM; + "); + + DBManager::get()->exec(" + CREATE TABLE IF NOT EXISTS `auto_insert_user` ( + `seminar_id` char(32) NOT NULL, + `user_id` char(32) NOT NULL, + `mkdate` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`seminar_id`,`user_id`) + ) ENGINE=MyISAM; + "); + + $options[] = + [ + 'name' => 'AUTO_INSERT_SEM_PARTICIPANTS_VIEW_PERM', + 'type' => 'string', + 'value' => 'tutor', + 'section' => 'global', + 'description' => 'Ab welchem Status soll in Veranstaltungen mit automatisch eingetragenen Nutzern der Teilnehmerreiter zu sehen sein?' + ]; + + $stmt = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + + if (is_array($GLOBALS['AUTO_INSERT_SEM'])) { + $stmt = DBManager::get()->prepare(" + INSERT INTO `auto_insert_sem` ( + `seminar_id` , `status` ) VALUES + (:seminar_id, 'autor') , + (:seminar_id, 'tutor') , + (:seminar_id, 'dozent') + "); + foreach ($GLOBALS['AUTO_INSERT_SEM'] as $seminar_id) { + $stmt->execute(['seminar_id' => $seminar_id]); + } + } + } + + function down () + { + DBManager::get()->exec("DROP TABLE auto_insert_sem"); + DBManager::get()->exec("DROP TABLE auto_insert_user"); + DBManager::get()->exec("DELETE FROM config WHERE field = 'AUTO_INSERT_SEM_PARTICIPANTS_VIEW_PERM'"); + } +} diff --git a/db/migrations/1.7_table_token_class.php b/db/migrations/1.7_table_token_class.php new file mode 100644 index 0000000..7f3a715 --- /dev/null +++ b/db/migrations/1.7_table_token_class.php @@ -0,0 +1,35 @@ +announce(" creating table..."); + + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `user_token` ( + `user_id` VARCHAR( 32 ) NOT NULL , + `token` VARCHAR( 32 ) NOT NULL , + `expiration` INT NOT NULL , + PRIMARY KEY ( `user_id` , `token` , `expiration` ), + INDEX index_expiration (`expiration`), + INDEX index_token (`token`), + INDEX index_user_id (`user_id`) + ) ENGINE=MyISAM;"); + + $this->announce("done."); + + } + + public function down () + { + $this->announce(" removing table..."); + DBManager::get()->exec("DROP TABLE `user_token`"); + + $this->announce("done."); + + } +} diff --git a/db/migrations/1.80_skiplinks_enable_configuration.php b/db/migrations/1.80_skiplinks_enable_configuration.php new file mode 100644 index 0000000..5d022e5 --- /dev/null +++ b/db/migrations/1.80_skiplinks_enable_configuration.php @@ -0,0 +1,47 @@ + 'SKIPLINKS_ENABLE', + 'type' => 'boolean', + 'value' => '', + 'range' => 'user', + 'section' => 'privacy', + 'description' => 'Wählen Sie diese Option, um Skiplinks beim ersten Drücken der Tab-Taste anzuzeigen (Systemdefault).' + ]; + + $stmt = DBManager::get()->prepare(" + INSERT IGNORE INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'SKIPLINKS_ENABLE'"); + } +} diff --git a/db/migrations/1.81_step_209_teilnehmericon.php b/db/migrations/1.81_step_209_teilnehmericon.php new file mode 100644 index 0000000..13aa69b --- /dev/null +++ b/db/migrations/1.81_step_209_teilnehmericon.php @@ -0,0 +1,37 @@ +exec("ALTER TABLE `object_user_visits` + CHANGE `type` `type` + ENUM( 'vote', 'documents', 'forum', 'literature', 'schedule', 'scm', + 'sem', 'wiki', 'news', 'eval', 'inst', 'ilias_connect', + 'elearning_interface', 'participants' ) NOT NULL DEFAULT 'vote'"); + + // copy timestamps from sem to participants to reduce red participant-icons + DBManager::get()->exec("INSERT INTO object_user_visits + (object_id, user_id, type, visitdate, last_visitdate) + (SELECT object_id, ouv.user_id, 'participants' as type, visitdate, last_visitdate + FROM object_user_visits AS ouv + LEFT JOIN seminar_user AS su ON (su.user_id = ouv.user_id AND su.Seminar_id = ouv.object_id) + WHERE type='sem' AND status IN ('tutor', 'dozent'))"); + } + + function down () + { + DBManager::get()->exec("DELETE FROM object_user_visits WHERE type = 'participants'"); + DBManager::get()->exec("ALTER TABLE `object_user_visits` + CHANGE `type` `type` + ENUM( 'vote', 'documents', 'forum', 'literature', 'schedule', 'scm', + 'sem', 'wiki', 'news', 'eval', 'inst', 'ilias_connect', + 'elearning_interface') NOT NULL DEFAULT 'vote'"); + } +} diff --git a/db/migrations/1.83_tic1992_privacydefaults.php b/db/migrations/1.83_tic1992_privacydefaults.php new file mode 100644 index 0000000..6cf7b0e --- /dev/null +++ b/db/migrations/1.83_tic1992_privacydefaults.php @@ -0,0 +1,71 @@ + 'CHAT_VISIBILITY_DEFAULT', + 'type' => 'boolean', + 'value' => 1, + 'description' => 'Ist der private Chatraum sichtbar, falls der Nutzer nichts anderes eingestellt hat?' + ], + // E-Mail address visible per default? + [ + 'name' => 'EMAIL_VISIBILITY_DEFAULT', + 'type' => 'boolean', + 'value' => 1, + 'description' => 'Ist die eigene Emailadresse sichtbar, falls der Nutzer nichts anderes eingestellt hat?' + ], + // Private chat room visible per default? + [ + 'name' => 'ONLINE_VISIBILITY_DEFAULT', + 'type' => 'boolean', + 'value' => 1, + 'description' => 'Sind Nutzer sichtbar in der Wer ist online-Liste, falls sie nichts anderes eingestellt haben?' + ], + // Private chat room visible per default? + [ + 'name' => 'SEARCH_VISIBILITY_DEFAULT', + 'type' => 'boolean', + 'value' => 1, + 'description' => 'Sind Nutzer auffindbar in der Personensuche, falls sie nichts anderes eingestellt haben?' + ] + ]; + + function description() + { + return 'add default privacy settings'; + } + + function up() + { + $db = DBManager::get(); + $query = $db->prepare("INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); + + // insert new configuration entries + foreach (self::$config_entries as $entry) { + $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); + } + + // remove old default entry with user id 'studip' + $db->exec("DELETE FROM `user_visibility` WHERE `user_id`='studip'"); + + } + + function down() + { + $db = DBManager::get(); + $query = $db->prepare("DELETE FROM `config` WHERE `field` = ?"); + + foreach (self::$config_entries as $entry) { + $query->execute([$entry['name']]); + } + + // insert default values + $db->exec("INSERT INTO `user_visibility` VALUES ('studip', 1, 1, 1, 1, '', 0, ".time().")"); + + } +} +?> diff --git a/db/migrations/1.84_step_226_dozenten_labels.php b/db/migrations/1.84_step_226_dozenten_labels.php new file mode 100644 index 0000000..aec6389 --- /dev/null +++ b/db/migrations/1.84_step_226_dozenten_labels.php @@ -0,0 +1,41 @@ +exec( + "ALTER TABLE seminar_user " . + "ADD COLUMN label VARCHAR(128) NOT NULL DEFAULT ''" . + ""); + + $name = "PROPOSED_TEACHER_LABELS"; + $time = time(); + $description = "Write a list of comma separated possible labels for teachers and tutor here."; + $db->exec( + "INSERT IGNORE INTO config " . + "(config_id, field, value, is_default, type, mkdate, chdate, description, section) " . + "VALUES " . + "(MD5(".$db->quote($name)."), ".$db->quote($name).", '', 1, 'string', $time, $time, ".$db->quote($description).", 'global') " . + ""); + } + + function down () + { + $db = DBManager::get(); + $db->exec( + "ALTER TABLE seminar_user " . + "DROP COLUMN label " . + ""); + $db->exec( + "DELETE FROM config " . + "WHERE field = 'PROPOSED_TEACHER_LABELS' " . + ""); + } +} diff --git a/db/migrations/1.85_tic2007_schedule_enable.php b/db/migrations/1.85_tic2007_schedule_enable.php new file mode 100644 index 0000000..7654be3 --- /dev/null +++ b/db/migrations/1.85_tic2007_schedule_enable.php @@ -0,0 +1,46 @@ +prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description) + "); + + $stmt->execute([ + 'name' => 'SCHEDULE_ENABLE', + 'description' => 'Schaltet ein oder aus, ob der Stundenplan global verfügbar ist.', + 'section' => 'modules', + 'range' => 'global', + 'type' => 'boolean', + 'value' => '1' + ]); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + $db->exec("DELETE FROM config WHERE field = 'SCHEDULE_ENABLE'"); + } +} \ No newline at end of file diff --git a/db/migrations/1.86_step_228_raumanfragen.php b/db/migrations/1.86_step_228_raumanfragen.php new file mode 100644 index 0000000..1acac28 --- /dev/null +++ b/db/migrations/1.86_step_228_raumanfragen.php @@ -0,0 +1,27 @@ +exec( + "ALTER TABLE `resources_requests` ADD `metadate_id` VARCHAR(32) NOT NULL DEFAULT '' AFTER `termin_id`"); + $db->exec( + "ALTER TABLE `resources_requests` DROP INDEX `closed` , ADD INDEX `closed` (`closed` , `request_id`, `resource_id`)"); + $db->exec( + "ALTER TABLE `resources_requests` ADD INDEX (`metadate_id`)"); + } + + public function down() + { + $db = DBManager::get(); + $db->exec( + "ALTER TABLE `resources_requests` " . + "DROP COLUMN `metadate_id`"); + } +} diff --git a/db/migrations/1.87_tic1091_chat.php b/db/migrations/1.87_tic1091_chat.php new file mode 100644 index 0000000..629433b --- /dev/null +++ b/db/migrations/1.87_tic1091_chat.php @@ -0,0 +1,19 @@ +exec("DELETE FROM `user_config` WHERE `field` = 'CHAT_USE_AJAX_CLIENT'"); + } + + function down () + { + } +} \ No newline at end of file diff --git a/db/migrations/1.88_biest2055_terms.php b/db/migrations/1.88_biest2055_terms.php new file mode 100644 index 0000000..713cc59 --- /dev/null +++ b/db/migrations/1.88_biest2055_terms.php @@ -0,0 +1,23 @@ +exec($sql); + } + + function down () + { + $sql = 'DELETE FROM `user_config` WHERE `field` = "TERMS_ACCEPTED"'; + DBManager::get()->exec($sql); + } +} \ No newline at end of file diff --git a/db/migrations/1.89_step_00205_group_calendar.php b/db/migrations/1.89_step_00205_group_calendar.php new file mode 100644 index 0000000..919f110 --- /dev/null +++ b/db/migrations/1.89_step_00205_group_calendar.php @@ -0,0 +1,103 @@ + 'CALENDAR_GROUP_ENABLE', + 'description' => 'Schaltet die Gruppenterminkalender-Funktionen ein.', + 'section' => 'modules', + 'type' => 'boolean', + 'value' => '0' + ], + [ + 'name' => 'COURSE_CALENDAR_ENABLE', + 'description' => 'Kalender als Inhaltselement in Veranstaltungen.', + 'section' => 'modules', + 'type' => 'boolean', + 'value' => '0' + ] + ]; + + /** + * short description of this migration + */ + function description() + { + return 'extends the calendar by group calendar functions'; + } + + /** + * insert list of options into config table + */ + function insertConfig($options) + { + $db = DBManager::get(); + $time = time(); + + $stmt = $db->prepare(" + INSERT INTO config + (config_id, field, value, is_default, type, section, mkdate, chdate, description) + VALUES + (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) + "); + + foreach ($options as $option) { + $stmt->execute($option); + } + } + + /** + * remove list of options from config table + */ + function deleteConfig($options) + { + $db = DBManager::get(); + + $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); + + foreach ($options as $option) { + $stmt->execute(['name' => $option['name']]); + } + } + + /** + * perform this migration + */ + function up() + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE `seminar_user` ADD `bind_calendar` TINYINT( 1 ) NOT NULL DEFAULT '1'"); + $db->exec("ALTER TABLE `calendar_events` ADD `editor_id` VARCHAR( 32 ) NOT NULL AFTER `autor_id`"); + $db->exec("ALTER TABLE `calendar_events` ADD `importdate` INT( 11 ) NOT NULL DEFAULT '0'"); + $db->exec("ALTER TABLE `contact` ADD `calpermission` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '1'"); + $db->exec("ALTER TABLE `statusgruppen` ADD `calendar_group` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0'"); + $db->exec("CREATE TABLE IF NOT EXISTS `calendar_sync` ( + `range_id` varchar(32) NOT NULL default '', + `client_identifier` varchar(255) NOT NULL default '', + `last_sync` int(11) NOT NULL default '0', + PRIMARY KEY (`range_id`,`client_identifier`) + ) ENGINE=MyISAM"); + $this->insertConfig($this->options_new); + } + + /** + * revert this migration + */ + function down() + { + $db = DBManager::get(); + + $db->exec("ALTER TABLE `seminar_user` DROP `bind_calendar`"); + $db->exec("ALTER TABLE `calendar_events` DROP `editor_id`"); + $db->exec("ALTER TABLE `calendar_events` DROP `importdate`"); + $db->exec("ALTER TABLE `contact` DROP `calpermission`"); + $db->exec("ALTER TABLE `statusgruppen` DROP `calendar_group`"); + $db->exec("DROP TABLE `calendar_sync`"); + $this->deleteConfig($this->options_new); + } +} diff --git a/db/migrations/1.8_step_117_studienmodule.php b/db/migrations/1.8_step_117_studienmodule.php new file mode 100644 index 0000000..e124873 --- /dev/null +++ b/db/migrations/1.8_step_117_studienmodule.php @@ -0,0 +1,261 @@ + Studienprogramme'; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_abstract_elements` +-- + +CREATE TABLE `stm_abstract_elements` ( + `element_id` varchar(32) NOT NULL default '' COMMENT 'ID eines abstrakten Modulbestandzeiles', + `stm_abstr_id` varchar(32) NOT NULL default '' COMMENT 'ID eines abstrakten Studienmodules', + `element_type_id` varchar(32) NOT NULL default '' COMMENT 'um welche Art von Element handelt es sich', + `custom_name` varchar(50) default NULL COMMENT 'selbstgewählter Name', + `sws` tinyint(4) NOT NULL default '0' COMMENT 'Semesterwochenstunden für den Bestandteil', + `workload` int(4) NOT NULL default '0', + `semester` tinyint(1) default NULL COMMENT 'Sommer od. Winter (Sommer = 1; Winter = 2)', + `elementgroup` tinyint(4) NOT NULL default '0' COMMENT 'Kombinationsvariante', + `position` tinyint(4) NOT NULL default '0' COMMENT 'Reihenfolge ', + PRIMARY KEY (`element_id`), + UNIQUE KEY `elem_integr` (`stm_abstr_id`,`elementgroup`,`position`) +) ENGINE=MyISAM COMMENT='Bestandteile eines Abstrakten Moduls (Elemente)'; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_abstract_text` +-- + +CREATE TABLE `stm_abstract_text` ( + `stm_abstr_id` varchar(32) NOT NULL default '' COMMENT 'ID des abstrakten Studienmodules', + `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', + `title` varchar(155) NOT NULL default '' COMMENT 'Allgemeiner Modultitel (Name des Moduls)', + `subtitle` varchar(155) default NULL COMMENT 'optionaler Untertitel', + `topics` text NOT NULL COMMENT 'Inhalte (behandelte Themen etc.)', + `aims` text NOT NULL COMMENT 'Lernziele', + `hints` text, + PRIMARY KEY (`stm_abstr_id`,`lang_id`) +) ENGINE=MyISAM COMMENT='(mehrsprachige) Texte der abstrakten Module'; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_abstract_types` +-- + +CREATE TABLE `stm_abstract_types` ( + `stm_type_id` varchar(32) NOT NULL default '' COMMENT 'ID eines Modultyps', + `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', + `abbrev` varchar(5) NOT NULL default '' COMMENT 'Abkuerzung', + `name` varchar(25) NOT NULL default '' COMMENT 'vollstaendige Bezeichnung', + PRIMARY KEY (`stm_type_id`,`lang_id`) +) ENGINE=MyISAM COMMENT='Typen abstrakter Module'; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_element_types` +-- + +CREATE TABLE `stm_element_types` ( + `element_type_id` varchar(32) NOT NULL default '' COMMENT 'ID des Modulbestandteils', + `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', + `abbrev` varchar(5) default NULL COMMENT 'Kurzname', + `name` varchar(50) NOT NULL default '' COMMENT 'Name', + PRIMARY KEY (`element_type_id`,`lang_id`) +) ENGINE=MyISAM COMMENT='Typen von möglichen Bestandteilen eines abstrakten Moduls'; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_instances` +-- + +CREATE TABLE `stm_instances` ( + `stm_instance_id` varchar(32) NOT NULL default '' COMMENT 'ID eines konkreten Studienmodules', + `stm_abstr_id` varchar(32) NOT NULL default '' COMMENT 'ID eines abstrakten Studienmodules', + `semester_id` varchar(32) NOT NULL default '' COMMENT 'ID des ersten Semesters in dem die Instanz stattfindet', + `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der Sprache in der das Modul angeboten wird', + `homeinst` varchar(32) default NULL COMMENT 'ID des anbietenden Institutes', + `creator` varchar(32) NOT NULL, + `responsible` varchar(32) default NULL COMMENT 'ID des Modulverantwortlichen Dozenten', + `complete` tinyint(1) NOT NULL default '0' COMMENT 'Erfassung komplett (0=FALSE)', + PRIMARY KEY (`stm_instance_id`) +) ENGINE=MyISAM COMMENT='Instanzen der abstrakten Module'; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_instances_elements` +-- + +CREATE TABLE `stm_instances_elements` ( + `stm_instance_id` varchar(32) NOT NULL default '' COMMENT 'ID eines konkreten Studienmodules', + `element_id` varchar(32) NOT NULL default '' COMMENT 'ID des abstrakten Modulbestandteils', + `sem_id` varchar(32) NOT NULL default '' COMMENT 'ID der konkreten Veranstaltung', + PRIMARY KEY (`stm_instance_id`,`element_id`,`sem_id`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `stm_instances_text` +-- + +CREATE TABLE `stm_instances_text` ( + `stm_instance_id` varchar(32) NOT NULL default '' COMMENT 'ID eines konkreten Studienmodules', + `lang_id` varchar(32) NOT NULL default '' COMMENT 'ID der verwendeten Sprache', + `title` varchar(155) NOT NULL default '' COMMENT 'Allgemeiner Modultitel', + `subtitle` varchar(155) default NULL COMMENT 'optionaler Untertitel', + `topics` text NOT NULL COMMENT 'Inhalte', + `hints` text, + PRIMARY KEY (`stm_instance_id`,`lang_id`) +) ENGINE=MyISAM COMMENT='(mehrsprachige) Texte der instanziierten abstrakten Module'; +"; + + private $sql_down = "DROP TABLE IF EXISTS `his_abschl`, `his_abstgv`, `his_pvers`, `his_stg`, `stm_abstract`, `stm_abstract_assign`, `stm_abstract_elements`, `stm_abstract_text`, `stm_abstract_types`, `stm_element_types`, `stm_instances`, `stm_instances_elements`, `stm_instances_text`;"; + + public function description () + { + return 'modify db schema StEP00117 Studienmodulstrukturen; '; + } + + public function up () + { + $this->announce(get_class($this) . ": Creating db schema..."); + $statements = preg_split("/;[[:space:]]*\n/", $this->sql_up); + foreach($statements as $sqlstatement) { + DBManager::get()->exec($sqlstatement); + } + } + + public function down () + { + $this->announce(get_class($this) . ": Deleting db schema..."); + $statements = preg_split("/;[[:space:]]*\n/", $this->sql_down); + foreach($statements as $sqlstatement) { + DBManager::get()->exec($sqlstatement); + } + } + +} diff --git a/db/migrations/1.90_tic2395_smileys.php b/db/migrations/1.90_tic2395_smileys.php new file mode 100644 index 0000000..8d96117 --- /dev/null +++ b/db/migrations/1.90_tic2395_smileys.php @@ -0,0 +1,28 @@ +exec("ALTER TABLE `user_info` DROP COLUMN `smiley_favorite_publish`"); + } + + /** + * revert this migration + */ + function down() + { + DBManager::get()->exec("ALTER TABLE `user_info` ADD COLUMN `smiley_favorite_publish` VARCHAR(255) NOT NULL DEFAULT ''"); + } +} diff --git a/db/migrations/1.91_tic2568_comment_internal.php b/db/migrations/1.91_tic2568_comment_internal.php new file mode 100644 index 0000000..a46fb69 --- /dev/null +++ b/db/migrations/1.91_tic2568_comment_internal.php @@ -0,0 +1,28 @@ +exec("ALTER TABLE `resources_assign` ADD `comment_internal` TEXT NULL DEFAULT NULL"); + } + + /** + * revert this migration + */ + function down() + { + DBManager::get()->exec("ALTER TABLE `resources_assign` DROP COLUMN `comment_internal`"); + } +} diff --git a/db/migrations/1.92_remove_schedule_user_table.php b/db/migrations/1.92_remove_schedule_user_table.php new file mode 100644 index 0000000..c4e341e --- /dev/null +++ b/db/migrations/1.92_remove_schedule_user_table.php @@ -0,0 +1,15 @@ +exec("DROP TABLE IF EXISTS seminar_user_schedule"); + } +} diff --git a/db/migrations/1.93_sem_classes_convert_into_db.php b/db/migrations/1.93_sem_classes_convert_into_db.php new file mode 100644 index 0000000..f31504a --- /dev/null +++ b/db/migrations/1.93_sem_classes_convert_into_db.php @@ -0,0 +1,286 @@ +exec(" + CREATE TABLE IF NOT EXISTS `sem_classes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `compact_mode` tinyint(4) NOT NULL, + `workgroup_mode` tinyint(4) NOT NULL, + `only_inst_user` tinyint(4) NOT NULL, + `turnus_default` int(11) NOT NULL, + `default_read_level` int(11) NOT NULL, + `default_write_level` int(11) NOT NULL, + `bereiche` tinyint(4) NOT NULL, + `show_browse` tinyint(4) NOT NULL, + `write_access_nobody` tinyint(4) NOT NULL, + `topic_create_autor` tinyint(4) NOT NULL, + `visible` tinyint(4) NOT NULL, + `course_creation_forbidden` tinyint(4) NOT NULL, + `overview` varchar(64) DEFAULT NULL, + `forum` varchar(64) DEFAULT NULL, + `admin` varchar(64) DEFAULT NULL, + `documents` varchar(64) DEFAULT NULL, + `schedule` varchar(64) DEFAULT NULL, + `participants` varchar(64) DEFAULT NULL, + `literature` varchar(64) DEFAULT NULL, + `scm` varchar(64) DEFAULT NULL, + `wiki` varchar(64) DEFAULT NULL, + `resources` varchar(64) DEFAULT NULL, + `calendar` varchar(64) DEFAULT NULL, + `elearning_interface` varchar(64) DEFAULT NULL, + `modules` text NOT NULL, + `description` text NOT NULL, + `create_description` text NOT NULL, + `studygroup_mode` tinyint(4) NOT NULL, + `admission_prelim_default` tinyint(4) NOT NULL DEFAULT 0, + `admission_type_default` tinyint(4) NOT NULL DEFAULT 0, + `title_dozent` VARCHAR(64) NULL, + `title_dozent_plural` VARCHAR(64) NULL, + `title_tutor` VARCHAR(64) NULL, + `title_tutor_plural` VARCHAR(64) NULL, + `title_autor` VARCHAR(64) NULL, + `title_autor_plural` VARCHAR(64) NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) + ) ENGINE=MyISAM + "); + $db->exec(" + CREATE TABLE IF NOT EXISTS `sem_types` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `class` int(11) NOT NULL, + `mkdate` bigint(20) NOT NULL, + `chdate` bigint(20) NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=MyISAM + "); + + $statement = $db->prepare( + "INSERT IGNORE INTO sem_classes " . + "SET id = :id, " . + "name = :name, " . + "compact_mode = :compact_mode, " . + "workgroup_mode = :workgroup_mode, " . + "only_inst_user = :only_inst_user, " . + "turnus_default = :turnus_default, " . + "default_read_level = :default_read_level, " . + "default_write_level = :default_write_level, " . + "bereiche = :bereiche, " . + "show_browse = :show_browse, " . + "write_access_nobody = :write_access_nobody, " . + "topic_create_autor = :topic_create_autor, " . + "visible = :visible, " . + "course_creation_forbidden = :course_creation_forbidden, " . + "studygroup_mode = :studygroup_mode, " . + "admission_prelim_default = :admission_prelim_default, " . + "admission_type_default = :admission_type_default, " . + "overview = :overview, " . + "admin = :admin, " . + "forum = :forum, " . + "documents = :documents, " . + "schedule = :schedule, " . + "participants = :participants, " . + "literature = :literature, " . + "scm = :scm, " . + "calendar = :calendar, " . + "wiki = :wiki, " . + "resources = :resources, " . + "elearning_interface = :elearning_interface, " . + "modules = :modules, " . + "description = :description, " . + "create_description = :create_description, " . + "title_dozent = :title_dozent, " . + "title_dozent_plural = :title_dozent_plural, " . + "title_tutor = :title_tutor, " . + "title_tutor_plural = :title_tutor_plural, " . + "title_autor = :title_autor, " . + "title_autor_plural = :title_autor_plural, " . + "mkdate = UNIX_TIMESTAMP(), " . + "chdate = UNIX_TIMESTAMP() " . + ""); + + $SEM_CLASS = $GLOBALS['SEM_CLASS_OLD_VAR']; + $SEM_TYPE = $GLOBALS['SEM_TYPE_OLD_VAR']; + + if (!(is_array($SEM_CLASS) && count($SEM_CLASS))) { + throw new Exception('Migration 93 kann nicht durchgeführt werden, + da die vorhandenen Einstellungen für $SEM_CLASS und $SEM_TYPE + nicht aus der Datei config.inc.php ausgelesen werden können. Entfernen + Sie diese Einstellungen erst, nachdem diese Migration durchgeführt wurde!'); + } + + $slots = [ + 'forum' => ['module' => 'CoreForum'], + 'documents' => ['module' => 'CoreDocuments'], + 'schedule' => ['module' => 'CoreSchedule'], + 'participants' => ['module' => 'CoreParticipants'], + 'scm' => ['module' => 'CoreScm', 'config' => 'SCM_ENABLE'], + 'literature' => ['module' => 'CoreLiterature', 'config' => 'LITERATURE_ENABLE'], + 'wiki' => ['module' => 'CoreWiki', 'config' => 'WIKI_ENABLE'], + 'resources' => ['module' => 'CoreResources', 'config' => 'RESOURCES_ENABLE'], + 'calendar' => ['module' => 'CoreCalendar', 'config' => 'COURSE_CALENDAR_ENABLE'], + 'elearning_interface' => ['module' => 'CoreElearningInterface', 'config' => 'ELEARNING_INTERFACE_ENABLE'] + ]; + + $studygroup_settings = $this->getStudygroupSettings(); + + foreach ($SEM_CLASS as $id => $sem_class) { + $modules = $settings = []; + $modules['overview'] = 'CoreOverview'; + $settings['CoreOverview'] = ['activated' => 1, 'sticky' => 1]; + + if ($sem_class['studygroup_mode']) { + $modules['admin'] = 'CoreStudygroupAdmin'; + $settings['CoreStudygroupAdmin'] = ['activated' => 1, 'sticky' => 1]; + $modules['participants'] = 'CoreStudygroupParticipants'; + $settings['CoreStudygroupParticipants'] = ['activated' => 1, 'sticky' => 1]; + + foreach ($studygroup_settings as $slot => $activated) { + if (isset($slots[$slot])) { + $core_module_name = $slots[$slot]['module']; + $core_module_config = $slots[$slot]['config']; + + if ($activated && (!isset($core_module_config) || $GLOBALS[$core_module_config])) { + $modules[$slot] = $core_module_name; + $settings[$core_module_name] = [ + 'activated' => 0, + 'sticky' => 0 + ]; + } + } else if ($slot !== 'chat') { + $settings[$slot] = [ + 'activated' => 0, + 'sticky' => $activated ? 0 : 1 + ]; + } + } + } else { + $modules['admin'] = 'CoreAdmin'; + $settings['CoreAdmin'] = ['activated' => 1, 'sticky' => 1]; + + foreach ($slots as $slot => $core_module) { + $core_module_name = $core_module['module']; + $core_module_config = $core_module['config']; + + if (!isset($core_module_config) || $GLOBALS[$core_module_config]) { + $modules[$slot] = $core_module_name; + $settings[$core_module_name] = [ + 'activated' => $sem_class[$slot] ? 1 : 0, + 'sticky' => 0 + ]; + } + } + } + + $title_dozent = $title_tutor = $title_autor = null; + $title_dozent_plural = $title_tutor_plural = $title_autor_plural = null; + foreach ($SEM_TYPE as $sem_type_id => $sem_type) { + if ($sem_type['class'] == $id) { + $title_dozent || list($title_dozent, $title_dozent_plural) = $sem_type['title_dozent']; + $title_tutor || list($title_tutor, $title_tutor_plural) = $sem_type['title_tutor']; + $title_autor || list($title_autor, $title_autor_plural) = $sem_type['title_autor']; + } + } + + $success = $statement->execute([ + 'id' => $id, + 'name' => $sem_class['name'], + 'compact_mode' => $sem_class['compact_mode'], + 'workgroup_mode' => $sem_class['workgroup_mode'], + 'only_inst_user' => $sem_class['only_inst_user'], + 'turnus_default' => $sem_class['turnus_default'], + 'default_read_level' => $sem_class['default_read_level'], + 'default_write_level' => $sem_class['default_write_level'], + 'bereiche' => $sem_class['bereiche'], + 'show_browse' => $sem_class['show_browse'], + 'write_access_nobody' => $sem_class['write_access_nobody'], + 'topic_create_autor' => $sem_class['topic_create_autor'], + 'visible' => $sem_class['visible'], + 'course_creation_forbidden' => $sem_class['course_creation_forbidden'], + 'overview' => $modules['overview'], + 'admin' => $modules['admin'], + 'forum' => $modules['forum'], + 'documents' => $modules['documents'], + 'schedule' => $modules['schedule'], + 'participants' => $modules['participants'], + 'literature' => $modules['literature'], + 'scm' => $modules['scm'], + 'wiki' => $modules['wiki'], + 'resources' => $modules['resources'], + 'calendar' => $modules['calendar'], + 'elearning_interface' => $modules['elearning_interface'], + 'modules' => json_encode($settings), + 'description' => $sem_class['description'], + 'create_description' => $sem_class['create_description'], + 'studygroup_mode' => $sem_class['studygroup_mode'], + 'admission_prelim_default' => (int)$sem_class['admission_prelim_default'], + 'admission_type_default' => (int)$sem_class['admission_type_default'], + 'title_dozent' => $title_dozent ? $title_dozent : null, + 'title_dozent_plural' => $title_dozent_plural ? $title_dozent_plural : null, + 'title_tutor' => $title_tutor ? $title_tutor : null, + 'title_tutor_plural' => $title_tutor_plural ? $title_tutor_plural : null, + 'title_autor' => $title_autor ? $title_autor : null, + 'title_autor_plural' => $title_autor_plural ? $title_autor_plural : null + ]); + } + + $statement = $db->prepare( + "INSERT IGNORE INTO `sem_types` " . + "SET id = :id, " . + "name = :name, " . + "class = :class, " . + "chdate = UNIX_TIMESTAMP(), " . + "mkdate = UNIX_TIMESTAMP()" + ); + foreach ($SEM_TYPE as $id => $sem_type) { + $success = $statement->execute([ + 'id' => $id, + 'name' => $sem_type['name'], + 'class' => $sem_type['class'] + ]); + } + + $statement = $db->prepare("DELETE FROM config WHERE field = 'STUDYGROUP_SETTINGS'"); + $statement->execute(); + } + + protected function getStudygroupSettings() { + $studygroup_settings = []; + foreach (words($GLOBALS['STUDYGROUP_SETTINGS']) as $key => $value) { + $value = explode(':', $value); + if ($value[0] != 'participants') { + $studygroup_settings[$value[0]] = $value[1]; + } + } + return $studygroup_settings; + } + + /** + * revert this migration + */ + function down() + { + DBManager::get()->exec("DROP TABLE `sem_classes` "); + DBManager::get()->exec("DROP TABLE `sem_types` "); + } + +} \ No newline at end of file diff --git a/db/migrations/1.94_step237_datafields_mandatory.php b/db/migrations/1.94_step237_datafields_mandatory.php new file mode 100644 index 0000000..80c350f --- /dev/null +++ b/db/migrations/1.94_step237_datafields_mandatory.php @@ -0,0 +1,28 @@ +exec("ALTER TABLE `datafields` ADD `is_required` TINYINT NOT NULL DEFAULT '0', ADD `description` TEXT NOT NULL DEFAULT ''"); + } + + /** + * revert this migration + */ + function down() + { + DBManager::get()->exec("ALTER TABLE `datafields` DROP `is_required`, DROP `description`;"); + } +} diff --git a/db/migrations/1.95_extend_userstudiengang_primarykey.php b/db/migrations/1.95_extend_userstudiengang_primarykey.php new file mode 100644 index 0000000..6552331 --- /dev/null +++ b/db/migrations/1.95_extend_userstudiengang_primarykey.php @@ -0,0 +1,34 @@ +exec($query); + } + + /** + * revert this migration + */ + function down() + { + $query = "ALTER TABLE `user_studiengang` + DROP PRIMARY KEY, + ADD PRIMARY KEY (`user_id`, `studiengang_id`)"; + DBManager::get()->exec($query); + } +} diff --git a/db/migrations/1.96_step00234_homepageplugin_activation.php b/db/migrations/1.96_step00234_homepageplugin_activation.php new file mode 100644 index 0000000..33a9e5a --- /dev/null +++ b/db/migrations/1.96_step00234_homepageplugin_activation.php @@ -0,0 +1,38 @@ +prepare("INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); + + $query->execute(['HOMEPAGEPLUGIN_DEFAULT_ACTIVATION', 'HOMEPAGEPLUGIN_DEFAULT_ACTIVATION', 1, 'boolean', 'Sollen neu installierte Homepageplugins automatisch für Benutzer aktiviert sein?']); + + } + + function down() + { + $db = DBManager::get(); + /* + * Removes global configuration value for default homepage plugin + * activation status. + */ + $query = $db->prepare("DELETE FROM `config` WHERE `field` = ?"); + + $query->execute(['HOMEPAGEPLUGIN_DEFAULT_ACTIVATION']); + + } +} +?> diff --git a/db/migrations/1.97_init_personal_notifications.php b/db/migrations/1.97_init_personal_notifications.php new file mode 100644 index 0000000..251fd42 --- /dev/null +++ b/db/migrations/1.97_init_personal_notifications.php @@ -0,0 +1,51 @@ +exec(" + CREATE TABLE IF NOT EXISTS `personal_notifications` ( + `personal_notification_id` int(11) NOT NULL AUTO_INCREMENT, + `url` varchar(512) NOT NULL DEFAULT '', + `text` text NOT NULL, + `avatar` varchar(256) NOT NULL DEFAULT '', + `html_id` varchar(64) NOT NULL DEFAULT '', + `mkdate` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`personal_notification_id`) + ) ENGINE=MyISAM;"); + $db->exec(" + CREATE TABLE IF NOT EXISTS `personal_notifications_user` ( + `personal_notification_id` int(10) unsigned NOT NULL, + `user_id` binary(32) NOT NULL, + `seen` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`personal_notification_id`,`user_id`), + KEY `user_id` (`user_id`,`seen`) + ) ENGINE=MyISAM"); + + $db->exec(" + INSERT IGNORE INTO `config` + (`config_id`, `parent_id`, `field`, `value`, `is_default`, + `type`, `range`, `section`, `position`, `mkdate`, `chdate`, + `description`, `comment`, `message_template`) + VALUES + (MD5('PERSONAL_NOTIFICATIONS_ACTIVATED'), '', 'PERSONAL_NOTIFICATIONS_ACTIVATED', 1, '1', 'boolean', 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Sollen persönliche Benachrichtigungen aktiviert sein?', '', '') + "); + } + + function down() + { + $db = DBManager::get(); + $db->exec("DROP TABLE IF EXISTS `personal_notifications` "); + $db->exec("DROP TABLE IF EXISTS `personal_notifications_user` "); + + $db->exec("DELETE FROM `config` WHERE `field` = 'PERSONAL_NOTIFICATIONS_ACTIVATED'"); + } +} diff --git a/db/migrations/1.98_user_data_to_config.php b/db/migrations/1.98_user_data_to_config.php new file mode 100644 index 0000000..687c229 --- /dev/null +++ b/db/migrations/1.98_user_data_to_config.php @@ -0,0 +1,201 @@ +new_configs = [ + 'calendar_user_control_data' => ['name'=>'CALENDAR_SETTINGS', + 'range'=>'user', + 'type'=>'array', + 'description'=>'persönliche Einstellungen des Kalenders', + 'value'=> json_encode( + [ + "view" => "showweek", + "start" => 9, + "end" => 20, + "step_day" => 900, + "step_week" => 3600, + "type_week" => "LONG", + "holidays" => TRUE, + "sem_data" => TRUE, + "delete" => 0 + ]) + ], + + 'my_messaging_settings' => ['name'=>'MESSAGING_SETTINGS', + 'range'=>'user', + 'type'=>'array', + 'description'=>'persönliche Einstellungen Nachrichtenbereich', + 'value'=> json_encode( + [ + "show_only_buddys" => FALSE, + "delete_messages_after_logout" => FALSE, + "timefilter" => '30d', + "opennew" => 1, + "logout_markreaded" => FALSE, + "openall" => FALSE, + "addsignature" => FALSE, + "save_snd" => TRUE, + "sms_sig" => '', + "send_view" => FALSE, + "confirm_reading" => 3, + "send_as_email" => FALSE, + "folder" => ['in' => ['dummy'], 'out' => ['dummy']] + ]) + ], + 'forum' => ['name'=>'FORUM_SETTINGS', + 'range'=>'user', + 'type'=>'array', + 'description'=>'persönliche Einstellungen Forum', + 'value'=> json_encode( + [ + 'neuauf' => false, + 'rateallopen' => true, + 'showimages' => true, + 'sortthemes' => 'last', + 'themeview' => 'mixed', + 'presetview' => 'mixed', + 'shrink' => 7 * 24 * 60 * 60, // = 1 Woche + ]) + ], + + 'my_schedule_settings' => ['name'=>'SCHEDULE_SETTINGS', + 'range'=>'user', + 'type'=>'array', + 'description'=>'persönliche Einstellungen Stundenplan', + 'value'=> json_encode( + [ + "glb_start_time"=> 8, + "glb_end_time" => 19, + "glb_days" => [ 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 0 => 0, ], + "glb_sem" => null, + "converted" => true]) + ], + + 'homepage_cache_own' => ['name'=>'PROFILE_LAST_VISIT', + 'range'=>'user', + 'type'=>'integer', + 'description'=>'Zeitstempel des letzten Besuchs der Profilseite', + 'value'=> 0], + 'CurrentLogin' => ['name'=>'CURRENT_LOGIN_TIMESTAMP', + 'range'=>'user', + 'type'=>'integer', + 'description'=>'Zeitstempel des Logins', + 'value'=> 0], + 'LastLogin' => ['name'=>'LAST_LOGIN_TIMESTAMP', + 'range'=>'user', + 'type'=>'integer', + 'description'=>'Zeitstempel des vorherigen Logins', + 'value'=> 0], + 'my_studip_settings' => ['name' =>'PERSONAL_STARTPAGE', + 'range' => 'user', + 'type' => 'integer', + 'description' => 'Persönliche Startseite', + 'value'=> 0], + '_my_sem_group_field' => ['name' =>'MY_COURSES_GROUPING', + 'range' => 'user', + 'type' => 'string', + 'description' => 'Gruppierung der Veranstaltungsübersicht', + 'value'=> ''], + '_my_sem_open' => ['name' =>'MY_COURSES_OPEN_GROUPS', + 'range' => 'user', + 'type' => 'array', + 'description' => 'geöffnete Gruppen der Veranstaltungsübersicht', + 'value'=> '[]'], + '_my_admin_inst_id' => ['name' =>'MY_INSTITUTES_DEFAULT', + 'range' => 'user', + 'type' => 'string', + 'description' => 'Standard Einrichtung in der Veranstaltungsübersicht für Admins', + 'value'=> ''], + ]; + } + function description() + { + return 'migrates user forum settings from user_data table to user_config table; adds array type to config table'; + } + + function up() + { + DBManager::get()->exec("ALTER TABLE `config` MODIFY `type` enum('boolean','integer','string','array') NOT NULL DEFAULT 'boolean'"); + DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `user_online` ( + `user_id` char(32) NOT NULL, + `last_lifesign` int(10) unsigned NOT NULL, + PRIMARY KEY (`user_id`), + KEY `last_lifesign` (`last_lifesign`) + ) ENGINE=MyISAM"); + DBManager::get()->exec("INSERT INTO user_online (user_id,last_lifesign) SELECT sid,UNIX_TIMESTAMP(changed) FROM user_data INNER JOIN auth_user_md5 ON sid = user_id"); + + $stmt = DBManager::get()->prepare(" + REPLACE INTO config + (config_id, field, value, is_default, `type`, `range`, mkdate, chdate, description, comment) + VALUES + (MD5(:name), :name, :value, 1, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description, '') + "); + + foreach ($this->new_configs as $values) { + $stmt->execute($values); + } + $check = DBManager::get()->prepare("DELETE FROM user_config WHERE field=? AND user_id=?"); + $stmt = DBManager::get()->prepare(" + REPLACE INTO user_config (userconfig_id, user_id, field, value, mkdate, chdate, comment) + VALUES (?,?,?,?,UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),'')"); + + //for all users: + $db = DBManager::get()->query("SELECT sid,val FROM user_data INNER JOIN auth_user_md5 ON sid = user_id"); + while ($rs = $db->fetch(PDO::FETCH_ASSOC)) { + $user_id = $rs['sid']; + $vars = @unserialize($rs['val']); + if (is_array($vars)) { + foreach(['my_messaging_settings','forum','my_schedule_settings','calendar_user_control_data'] as $key) { + $option = $this->new_configs[$key]; + $defaults = json_decode($option['value'], true); + if (is_array($vars[$key])) { + $old_values = array_intersect_key((array)$vars[$key], $defaults); + $new_values = array_merge($defaults, $old_values); + $check->execute([$option['name'], $user_id]); + $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], json_encode($new_values)]); + } + } + foreach(['homepage_cache_own','CurrentLogin','LastLogin','_my_sem_group_field','_my_admin_inst_id'] as $key) { + $option = $this->new_configs[$key]; + if (isset($vars[$key])) { + $check->execute([$option['name'], $user_id]); + $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], (string)$vars[$key]]); + } + } + if (isset($vars['my_studip_settings']['startpage_redirect'])) { + $option = $this->new_configs['my_studip_settings']; + $check->execute([$option['name'], $user_id]); + $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], (int)$vars['my_studip_settings']['startpage_redirect']]); + } + if (isset($vars['_my_sem_open'])) { + $option = $this->new_configs['_my_sem_open']; + $check->execute([$option['name'], $user_id]); + $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], json_encode($vars['_my_sem_open'])]); + } + } + } + DBManager::get()->exec("DROP TABLE `user_data`"); + } + + function down() + { + $db = DBManager::get(); + $db->exec("ALTER TABLE `config` MODIFY `type` enum('boolean','integer','string') NOT NULL DEFAULT 'boolean'"); + $db->exec("DROP TABLE IF EXISTS `user_online`"); + $db->exec("CREATE TABLE IF NOT EXISTS `user_data` ( + `sid` varchar(32) NOT NULL DEFAULT '', + `val` mediumtext NOT NULL, + `changed` timestamp NOT NULL, + PRIMARY KEY (`sid`), + KEY `changed` (`changed`) + ) ENGINE=MyISAM"); + foreach ($this->new_configs as $config) { + $db->exec("DELETE FROM config WHERE field = " . $db->quote($config['name'])); + $db->exec("DELETE FROM user_config WHERE field = " . $db->quote($config['name'])); + } + } +} diff --git a/db/migrations/1.99_step00245_simpleormap.php b/db/migrations/1.99_step00245_simpleormap.php new file mode 100644 index 0000000..508b528 --- /dev/null +++ b/db/migrations/1.99_step00245_simpleormap.php @@ -0,0 +1,13 @@ +announce(" creating table `admission_group`..."); + + DBManager::get()->exec( "CREATE TABLE IF NOT EXISTS `admission_group` ( + `group_id` varchar(32) NOT NULL, + `name` varchar(255) NOT NULL, + `status` tinyint(3) unsigned NOT NULL, + `chdate` int(10) unsigned NOT NULL, + `mkdate` int(10) unsigned NOT NULL, + PRIMARY KEY (`group_id`) + ) ENGINE=MyISAM"); + $this->announce(" fill table with existing groups..."); + DBManager::get()->exec("INSERT IGNORE INTO admission_group + (group_id, status, chdate,mkdate) + SELECT DISTINCT admission_group,0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP() FROM seminare WHERE admission_group <> ''"); + $this->announce("done."); + } + + public function down () + { + $this->announce(" removing table `admission_group`..."); + DBManager::get()->exec("DROP TABLE IF EXISTS `admission_group` "); + $this->announce("done."); + } +} diff --git a/db/migrations/100_step00248_chat_extinction.php b/db/migrations/100_step00248_chat_extinction.php deleted file mode 100644 index 3ff3d31..0000000 --- a/db/migrations/100_step00248_chat_extinction.php +++ /dev/null @@ -1,26 +0,0 @@ -exec("DROP TABLE IF EXISTS chat_data"); - $db->exec("ALTER TABLE user_visibility DROP COLUMN chat"); - $db->exec("DELETE FROM config WHERE field = 'CHAT_USE_AJAX_CLIENT'"); - $db->exec("DELETE FROM config WHERE field = 'CHAT_ENABLE'"); - $db->exec("DELETE FROM config WHERE field = 'CHAT_VISIBILITY_DEFAULT'"); - $db->exec("DELETE FROM user_config WHERE field = 'CHAT_USE_AJAX_CLIENT'"); - } - - function down() - { - } -} diff --git a/db/migrations/101_step00246_blubber.php b/db/migrations/101_step00246_blubber.php deleted file mode 100644 index 2cb9161..0000000 --- a/db/migrations/101_step00246_blubber.php +++ /dev/null @@ -1,124 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `blubber` ( - `topic_id` varchar(32) NOT NULL DEFAULT '', - `parent_id` varchar(32) NOT NULL DEFAULT '', - `root_id` varchar(32) NOT NULL DEFAULT '', - `context_type` enum('public','private','course') NOT NULL DEFAULT 'public', - `name` varchar(255) DEFAULT NULL, - `description` text, - `mkdate` int(20) NOT NULL DEFAULT '0', - `chdate` int(20) NOT NULL DEFAULT '0', - `author_host` varchar(255) DEFAULT NULL, - `Seminar_id` varchar(32) NOT NULL DEFAULT '', - `user_id` varchar(32) NOT NULL DEFAULT '', - `external_contact` tinyint(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`topic_id`), - KEY `root_id` (`root_id`), - KEY `Seminar_id` (`Seminar_id`), - KEY `parent_id` (`parent_id`), - KEY `chdate` (`chdate`), - KEY `mkdate` (`mkdate`), - KEY `user_id` (`user_id`,`Seminar_id`) - ) ENGINE=MyISAM; - "); - //Spezialevents, bisher nur für Löschen von Beiträgen verwendet - $db->exec(" - CREATE TABLE IF NOT EXISTS `blubber_events_queue` ( - `event_type` varchar(32) NOT NULL, - `item_id` varchar(32) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`event_type`,`item_id`,`mkdate`), - KEY `item_id` (`item_id`) - ) ENGINE=MyISAM - "); - //Blubberautoren, die nicht in Stud.IP angemeldet sind wie anonyme - $db->exec(" - CREATE TABLE IF NOT EXISTS `blubber_external_contact` ( - `external_contact_id` varchar(32) NOT NULL, - `mail_identifier` varchar(256) DEFAULT NULL, - `contact_type` varchar(16) NOT NULL DEFAULT 'anonymous', - `name` varchar(256) NOT NULL, - `data` text, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`external_contact_id`), - KEY `mail_identifier` (`mail_identifier`), - KEY `contact_type` (`contact_type`) - ) ENGINE=MyISAM - "); - $db->exec(" - CREATE TABLE IF NOT EXISTS `blubber_follower` ( - `studip_user_id` varchar(32) NOT NULL, - `external_contact_id` varchar(32) NOT NULL, - `left_follows_right` tinyint(1) NOT NULL, - KEY `studip_user_id` (`studip_user_id`), - KEY `external_contact_id` (`external_contact_id`) - ) ENGINE=MyISAM - "); - //Rechte für private Blubber - $db->exec(" - CREATE TABLE IF NOT EXISTS `blubber_mentions` ( - `topic_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `external_contact` tinyint(4) NOT NULL DEFAULT '0', - `mkdate` int(11) NOT NULL, - UNIQUE KEY `unique_users_per_topic` (`topic_id`,`user_id`,`external_contact`), - KEY `topic_id` (`topic_id`), - KEY `user_id` (`user_id`) - ) ENGINE=MyISAM - "); - - $old_blubber = $db->query( - "SELECT * FROM plugins WHERE pluginclassname = 'Blubber' " . - "")->fetch(PDO::FETCH_ASSOC); - - if ($old_blubber) { - //Umschreiben des Ortes von Blubber - $db->exec(" - UPDATE plugins SET pluginpath = 'core/Blubber' WHERE pluginclassname = 'Blubber' - "); - if ($old_blubber['pluginpath'] !== "core/Blubber") { - @rmdirr($GLOBALS['PLUGINS_PATH']."/".$old_blubber['pluginpath']); - } - $db->exec(" - INSERT IGNORE INTO blubber (`topic_id`,`parent_id`,`root_id`,`context_type`,`name`,`description`,`mkdate`,`chdate`,`author_host`,`Seminar_id`,`user_id`,`external_contact`) - SELECT `topic_id`,`parent_id`,`root_id`,'course',`name`,`description`,`mkdate`,`chdate`,`author_host`,`Seminar_id`,`user_id`,0 - FROM px_topics - "); - } else { - //Installieren des Plugins - $db->exec(" - INSERT INTO plugins - SET pluginclassname = 'Blubber', - pluginpath = 'core/Blubber', - pluginname = 'Blubber', - plugintype = 'StandardPlugin,SystemPlugin', - enabled = 'yes', - navigationpos = '1' - "); - $plugin_id = $db->lastInsertId(); - $db->exec(" - INSERT IGNORE INTO roles_plugins (roleid, pluginid) - SELECT roleid, ".$db->quote($plugin_id)." FROM roles WHERE `system` = 'y' - "); - } - } - - function down() - { - } -} diff --git a/db/migrations/102_remove_guestbook_migration.php b/db/migrations/102_remove_guestbook_migration.php deleted file mode 100644 index f384ac2..0000000 --- a/db/migrations/102_remove_guestbook_migration.php +++ /dev/null @@ -1,36 +0,0 @@ -exec(" - INSERT IGNORE INTO blubber (topic_id, parent_id, root_id, context_type, name, description, mkdate, chdate, Seminar_id, user_id, external_contact) - SELECT MD5(CONCAT('guestbook_', user_info.user_id)), '0', MD5(CONCAT('guestbook_', user_info.user_id)), 'public', ".$db->quote($guestbook_text).", ".$db->quote($guestbook_text).", user_info.mkdate, user_info.mkdate, user_info.user_id, user_info.user_id, '0' - FROM user_info - WHERE user_info.guestbook = '1' - "); - $db->exec(" - INSERT IGNORE INTO blubber (topic_id, parent_id, root_id, context_type, name, description, mkdate, chdate, Seminar_id, user_id, external_contact) - SELECT guestbook.post_id, MD5(CONCAT('guestbook_', guestbook.range_id)), MD5(CONCAT('guestbook_', guestbook.range_id)), 'public', ".$db->quote($guestbook_text).", guestbook.content, guestbook.mkdate, guestbook.mkdate, guestbook.range_id, guestbook.user_id, '0' - FROM guestbook - INNER JOIN user_info ON (guestbook.range_id = user_info.user_id) - WHERE user_info.guestbook = '1' - "); - $db->exec(" - DROP TABLE guestbook - "); - } - - function down() - { - } -} diff --git a/db/migrations/104_setup_cronjobs.php b/db/migrations/104_setup_cronjobs.php deleted file mode 100644 index c25b6a6..0000000 --- a/db/migrations/104_setup_cronjobs.php +++ /dev/null @@ -1,165 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS `cronjobs_tasks` ( - `task_id` CHAR(32) NOT NULL DEFAULT '', - `filename` VARCHAR(255) NOT NULL, - `class` VARCHAR(255) NOT NULL, - `active` TINYINT(1) NOT NULL DEFAULT 0, - `execution_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, - `assigned_count` INT(11) UNSIGNED NOT NULL DEFAULT 0, - PRIMARY KEY (`task_id`) - ) ENGINE=MyISAM"); - - DBManager::get()->query("CREATE TABLE IF NOT EXISTS `cronjobs_schedules` ( - `schedule_id` CHAR(32) NOT NULL DEFAULT '', - `task_id` CHAR(32) NOT NULL DEFAULT '', - `active` TINYINT(1) NOT NULL DEFAULT 0, - `title` VARCHAR(255) NULL DEFAULT NULL, - `description` VARCHAR(4096) DEFAULT NULL, - `parameters` TEXT, - `priority` ENUM('low','normal','high') NOT NULL DEFAULT 'normal', - `type` ENUM('periodic','once') NOT NULL DEFAULT 'periodic', - `minute` TINYINT(2) DEFAULT NULL, - `hour` TINYINT(2) DEFAULT NULL, - `day` TINYINT(2) DEFAULT NULL, - `month` TINYINT(2) DEFAULT NULL, - `day_of_week` TINYINT(1) UNSIGNED DEFAULT NULL, - `next_execution` INT(11) UNSIGNED NOT NULL DEFAULT 0, - `last_execution` INT(11) UNSIGNED DEFAULT NULL, - `last_result` TEXT, - `execution_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`schedule_id`), - KEY `task_id` (`task_id`) - ) ENGINE=MyISAM"); - - DBManager::get()->query("CREATE TABLE IF NOT EXISTS `cronjobs_logs` ( - `log_id` CHAR(32) NOT NULL DEFAULT '', - `schedule_id` CHAR(32) NOT NULL DEFAULT '', - `scheduled` INT(11) UNSIGNED NOT NULL, - `executed` INT(11) UNSIGNED NOT NULL, - `exception` TEXT DEFAULT NULL, - `output` TEXT, - `duration` FLOAT NOT NULL, - PRIMARY KEY (`log_id`), - KEY `schedule_id` (`schedule_id`) - ) ENGINE=MyISAM"); - - // Add config entries - $query = "INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description`) - VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'global', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; - $statement = DBManager::get()->prepare($query); - - $statement->execute([ - ':field' => 'CRONJOBS_ENABLE', - ':value' => (int)false, - ':type' => 'boolean', - ':description' => 'Schaltet die Cronjobs an', - ]); - - $statement->execute([ - ':field' => 'CRONJOBS_ESCALATION', - ':value' => 300, - ':type' => 'integer', - ':description' => 'Gibt an, nach wievielen Sekunden ein Cronjob als steckengeblieben angesehen wird', - ]); - - // Add default cron tasks and schedules - $default_data = [ - [ - 'filename' => 'lib/cronjobs/cleanup_log.class.php', - 'class' => 'CleanupLogJob', - 'priority' => 'normal', - 'hour' => 2, - 'minute' => 13, - ], - [ - 'filename' => 'lib/cronjobs/purge_cache.class.php', - 'class' => 'PurgeCacheJob', - 'priority' => 'low', - 'hour' => null, - 'minute' => -30, - ], - [ - 'filename' => 'lib/cronjobs/send_mail_notifications.class.php', - 'class' => 'SendMailNotificationsJob', - 'priority' => 'high', - 'hour' => 1, - 'minute' => 7, - ], - [ - 'filename' => 'lib/cronjobs/check_admission.class.php', - 'class' => 'CheckAdmissionJob', - 'priority' => 'normal', - 'hour' => null, - 'minute' => -30, - ], - [ - 'filename' => 'lib/cronjobs/garbage_collector.class.php', - 'class' => 'GarbageCollectorJob', - 'priority' => 'normal', - 'hour' => 2, - 'minute' => 33, - ], - [ - 'filename' => 'lib/cronjobs/session_gc.class.php', - 'class' => 'SessionGcJob', - 'priority' => 'normal', - 'hour' => 3, - 'minute' => 13, - ], - ]; - - $query = "INSERT IGNORE INTO `cronjobs_tasks` - (`task_id`, `filename`, `class`, `active`) - VALUES (:task_id, :filename, :class, 1)"; - $task_statement = DBManager::get()->prepare($query); - - $query = "INSERT IGNORE INTO `cronjobs_schedules` - (`schedule_id`, `task_id`, `parameters`, `priority`, - `type`, `minute`, `hour`, `mkdate`, `chdate`, - `last_result`) - VALUES (:schedule_id, :task_id, '[]', :priority, 'periodic', - :minute, :hour, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - NULL)"; - $schedule_statement = DBManager::get()->prepare($query); - - foreach ($default_data as $row) { - $task_id = md5(uniqid('task', true)); - - $task_statement->execute([ - ':task_id' => $task_id, - ':filename' => $row['filename'], - ':class' => $row['class'], - ]); - - $schedule_id = md5(uniqid('schedule', true)); - $schedule_statement->execute([ - ':schedule_id' => $schedule_id, - ':task_id' => $task_id, - ':priority' => $row['priority'], - ':hour' => $row['hour'], - ':minute' => $row['minute'], - ]); - } - } - - function down() - { - DBManager::get()->query("DROP TABLE IF EXISTS `cronjobs_tasks`, `cronjobs_schedules`, `cronjobs_logs`"); - - DBManager::get()->query("DELETE FROM config WHERE field IN ('CRONJOB_ENABLE', 'CRONJOBS_ESCALATION')"); - } -} diff --git a/db/migrations/105_step_00247_forum.php b/db/migrations/105_step_00247_forum.php deleted file mode 100644 index cdcf74c..0000000 --- a/db/migrations/105_step_00247_forum.php +++ /dev/null @@ -1,167 +0,0 @@ -query("SELECT version FROM schema_version - WHERE domain = 'ForumPP'")->fetchColumn(); - - if ($forumpp_version !== false && $forumpp_version != 6) { // version 6 is the DB-Version of the latest ForumPP-Plugin - throw new Exception(_('Sie verwenden das ForumPP-Plugin in einer alten Version. ' - . 'Bitte aktualisieren Sie es zuerst auf die neueste Version, sonst kann ' - . 'Die Stud.IP-Migration nicht ausgeführt werden')); - - } else if ($forumpp_version == 6) { // prepare the tables for the rest of the migration - // rename the forum-tables - DBManager::get()->exec("RENAME TABLE - forumpp_abo_users TO forum_abo_users, - forumpp_categories TO forum_categories, - forumpp_categories_entries TO forum_categories_entries, - forumpp_entries TO forum_entries, - forumpp_favorites TO forum_favorites, - forumpp_likes TO forum_likes, - forumpp_visits TO forum_visits"); - - } else { // create the necessary tables for the forum from scratch - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_categories` ( - `category_id` varchar(32) NOT NULL, - `seminar_id` varchar(32) NOT NULL, - `entry_name` varchar(255) NOT NULL, - `pos` INT NOT NULL DEFAULT '0', - PRIMARY KEY ( `category_id` ) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_categories_entries` ( - `category_id` varchar(32) NOT NULL, - `topic_id` varchar(32) NOT NULL, - `pos` INT NOT NULL DEFAULT '0', - PRIMARY KEY ( `category_id` , `topic_id` ) - ) ENGINE=MyISAM - "); - - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_entries` ( - `topic_id` varchar(32) NOT NULL, - `seminar_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `name` varchar(255) NOT NULL, - `content` text NOT NULL, - `area` TINYINT NOT NULL DEFAULT '0', - `mkdate` int(20) NOT NULL, - `chdate` int(20) NOT NULL, - `author` varchar(255) NOT NULL, - `author_host` varchar(255) NOT NULL, - `lft` int(11) NOT NULL, - `rgt` int(11) NOT NULL, - `depth` int(11) NOT NULL, - `anonymous` tinyint(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`topic_id`) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_likes` ( - `topic_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - PRIMARY KEY (`topic_id`,`user_id`) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_visits` ( - user_id varchar(32) NOT NULL, - seminar_id varchar(32) NOT NULL, - visitdate int(11) NOT NULL, - last_visitdate int(11) NOT NULL, - PRIMARY KEY ( `user_id` , `seminar_id` ) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_favorites` ( - user_id varchar(32) NOT NULL, - topic_id varchar(32) NOT NULL, - PRIMARY KEY ( `user_id` , `topic_id` ) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `forum_abo_users` ( - `topic_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - PRIMARY KEY (`topic_id`,`user_id`) - ) ENGINE=MyISAM - "); - } - - // add new table for the issue-connection - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `forum_entries_issues` ( - `topic_id` varchar(32) NOT NULL, - `issue_id` varchar(32) NOT NULL, - PRIMARY KEY (`topic_id`,`issue_id`) - ) ENGINE=MyISAM"); - - // add some highly needed indices - DBManager::get()->exec("ALTER TABLE `forum_entries` ADD INDEX ( `seminar_id` , `lft` )"); - DBManager::get()->exec("ALTER TABLE `forum_entries` ADD INDEX ( `seminar_id` , `rgt` )"); - DBManager::get()->exec("ALTER TABLE `forum_entries` ADD INDEX ( `user_id` )"); - DBManager::get()->exec("ALTER TABLE `forum_categories` ADD INDEX ( `seminar_id` )"); - - // get highest position - $navpos = DBManager::get()->query("SELECT navigationpos FROM plugins - ORDER BY navigationpos DESC")->fetchColumn() + 1; - - // insert plugin into db - $stmt = DBManager::get()->prepare("INSERT INTO plugins - (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) - VALUES ('CoreForum', 'core/Forum', 'Forum', 'ForumModule,StandardPlugin,StudipModule', 'yes', ?)"); - $stmt->execute([$navpos]); - - // get id of newly created plugin (we purposely do not use PDO::lastInserId()) - $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins - WHERE pluginpath = 'core/Forum'")->fetchColumn(); - - // set all default roles for the plugin (including nobody) - $stmt = DBManager::get()->prepare("INSERT INTO roles_plugins - (roleid, pluginid) VALUES (?, ?)"); - foreach (range(1,7) as $role_id) { - $stmt->execute([$role_id, $plugin_id]); - } - - - // remove old ForumPP-plugin - $old_forum = DBManager::get()->query("SELECT * FROM plugins - WHERE pluginclassname = 'ForumPP'")->fetch(PDO::FETCH_ASSOC); - - if ($old_forum) { - DBManager::get()->exec("DELETE FROM plugins - WHERE pluginclassname = 'ForumPP'"); - DBManager::get()->exec("DELETE FROM plugins_activated - WHERE pluginid = " . $old_forum['pluginid']); - DBManager::get()->exec("DELETE FROM plugins_default_activations - WHERE pluginid = " . $old_forum['pluginid']); - DBManager::get()->exec("DELETE FROM roles_plugins - WHERE pluginid = " . $old_forum['pluginid']); - DBManager::get()->exec("DELETE FROM schema_version - WHERE domain = 'ForumPP'"); - } - - // remove user-settings for the old forum - DBManager::get()->exec("DELETE FROM user_config WHERE `field` = 'FORUM_SETTINGS'"); - } - - function down() - { - } -} diff --git a/db/migrations/106_step_00247_forum_data_migration.php b/db/migrations/106_step_00247_forum_data_migration.php deleted file mode 100644 index 44fcc18..0000000 --- a/db/migrations/106_step_00247_forum_data_migration.php +++ /dev/null @@ -1,310 +0,0 @@ -query("SELECT * FROM px_topics WHERE topic_id = parent_id")->fetchAll(); - if (sizeof($problems) > 0) { - echo _('Sie haben fehlerhafte Einträge in ihrer px_topics-Tabelle. Folgende Einträge zeigen auf sich selbst (parent_id = topic_id)'); - echo "\n"; - foreach ($problems as $prob) { - echo implode(', ', $prob) ."\n"; - } - - echo "\n"; - echo _('Beheben Sie zuerst die fehlerhaften Einträge und führen Sie danach diese Migration erneut aus!'); - echo "\n\n"; - die; - } - - // get all seminars that need to be migrated - $stmt = DBManager::get()->prepare("SELECT DISTINCT Seminar_id FROM px_topics - WHERE topic_id = root_id - ORDER BY mkdate ASC"); - $stmt->execute(); - - // get plugin-id - $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins WHERE pluginclassname = 'CoreForum'")->fetchColumn(); - - // first, fetch all seminar_ids (When used inline at foreach, this does not work, must be a strange php-bug) - $seminar_ids = $stmt->fetchAll(PDO::FETCH_COLUMN); - - // then migrate the data for each seminar_id - foreach ($seminar_ids as $seminar_id) { - // prepare seminar for new forum - self::checkRootEntry($seminar_id); - - // migrate content form old forum to the new one - self::migrateEntries($seminar_id); - - // migrate visit-timestamps to the new forum - self::migrateUserVisits($seminar_id); - - // migrate the connections with issues - self::migrateIssues($seminar_id); - - self::activatePlugin($seminar_id, $plugin_id); - } - } - - static function activatePlugin($seminar_id, $plugin_id) { - $stmt = DBManager::get()->prepare("INSERT IGNORE INTO plugins_activated - (`pluginid`, `poiid`, `state`) VALUES (?, ?, 'on')"); - $stmt->execute([$plugin_id, 'sem' . $seminar_id]); - } - - static function migrateIssues($seminar_id) - { - $stmt = DBManager::get()->prepare("SELECT p.topic_id FROM themen_termine t - LEFT JOIN px_topics p ON (p.topic_id = t.issue_id) - WHERE p.topic_id IS NOT NULL - AND p.Seminar_id = ?"); - $stmt->execute([$seminar_id]); - - $stmt_insert = DBManager::get()->prepare("INSERT IGNORE INTO forum_entries_issues - (topic_id, issue_id) - VALUES (?, ?)"); - - while ($topic_id = $stmt->fetchColumn()) { - $stmt_insert->execute([$topic_id, $topic_id]); - } - } - - static function migrateUserVisits($seminar_id) - { - $stmt = DBManager::get()->prepare("SELECT * FROM object_user_visits - WHERE object_id = ? AND type = 'forum'"); - $stmt->execute([$seminar_id]); - - // do not overwrite any existing visit-timestamps, they are more - // accuarate than the one from object_user_visits - $stmt_insert = DBManager::get()->prepare("INSERT IGNORE INTO forum_visits - (user_id, seminar_id, visitdate, last_visitdate) - VALUES (?, ?, ?, ?)"); - - while ($data = $stmt->fetch()) { - $stmt_insert->execute([$data['user_id'], $data['object_id'], - $data['visitdate'], $data['last_visitdate']]); - } - } - - static function getList($seminar_id, $get_childs = true) - { - $ret = []; - - $stmt = DBManager::get()->prepare("SELECT * FROM px_topics - WHERE Seminar_id = ? AND topic_id = root_id - ORDER BY mkdate ASC"); - $stmt->execute([$seminar_id, $parent_id]); - - while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) { - // set depth-level - $data['level'] = 0; - $ret[] = $data; - - if ($get_childs) { - // get childs - $childs = self::getChilds($seminar_id, $data['topic_id']); - - if (!empty($childs)) { - $ret = array_merge($ret, $childs); - } - } - } - - return $ret; - } - - static function getEntries($seminar_id, $parent_id) - { - $stmt = DBManager::get()->prepare("SELECT * FROM px_topics - WHERE Seminar_id = ? AND parent_id = ? - ORDER BY mkdate ASC"); - $stmt->execute([$seminar_id, $parent_id]); - - return $stmt->fetchAll(); - } - - static function getChilds($seminar_id, $parent_id, $level = 1) - { - $ret = []; - - $stmt = DBManager::get()->prepare("SELECT * FROM px_topics - WHERE Seminar_id = ? AND parent_id = ? - ORDER BY mkdate ASC"); - $stmt->execute([$seminar_id, $parent_id]); - $entries = $stmt->fetchAll(PDO::FETCH_ASSOC); - - foreach ($entries as $data) { - // use a queue to prevent max-nesting problems - $queue = []; - $queue[] = $data; - $ret[] = $data; - - while (!empty($queue)) { - // get first element of queue - $checkfor = array_shift($queue); - - // get childs (if any) - $stmt->execute([$seminar_id, $checkfor['topic_id']]); - $childs = $stmt->fetchAll(); - - if (!empty($childs)) { - $ret = array_merge($ret, $childs); - $queue = array_merge($queue, $childs); // append childs to queue to check them for childs as well - } - } - } - - // sort the entries by mkdate - usort($ret, function($a, $b) { - if ($a['mkdate'] == $b['mkdate']) return 0; - return ($a['mkdate'] < $b['mkdate']) ? -1 : 1; - }); - - return $ret; - } - - static function migrateEntries($seminar_id) - { - foreach (self::getList($seminar_id, false) as $element) { - self::insert([ - 'topic_id' => $element['topic_id'], - 'seminar_id' => $seminar_id, - 'user_id' => $element['user_id'], - 'name' => $element['name'], - 'content' => $element['description'], - 'author' => $element['author'], - 'author_host' => $element['author_host'], - 'mkdate' => $element['mkdate'], - 'chdate' => $element['chdate'] - ], $seminar_id); - - //echo $element['name'] . '
'; - - foreach (self::getEntries($seminar_id, $element['topic_id']) as $child1) { - self::insert([ - 'topic_id' => $child1['topic_id'], - 'seminar_id' => $seminar_id, - 'user_id' => $child1['user_id'], - 'name' => $child1['name'], - 'content' => $child1['description'], - 'author' => $child1['author'], - 'author_host' => $child1['author_host'], - 'mkdate' => $child1['mkdate'], - 'chdate' => $child1['chdate'] - ], $element['topic_id']); - - //echo '• ' . $child1['name'] . '
'; - foreach(self::getChilds($seminar_id, $child1['topic_id']) as $child2) { - self::insert([ - 'topic_id' => $child2['topic_id'], - 'seminar_id' => $seminar_id, - 'user_id' => $child2['user_id'], - 'name' => $child2['name'], - 'content' => $child2['description'], - 'author' => $child2['author'], - 'author_host' => $child2['author_host'], - 'mkdate' => $child2['mkdate'], - 'chdate' => $child2['chdate'] - ], $child1['topic_id']); - - //echo '• •' . $child2['name'] . '
'; - } - } - } - } - - - static function flattenList($list) - { - $new_list = []; - $zw = []; - - foreach ($list as $element) { - if ($element['level'] == 0) { - if (!empty($zw)) { - $new_list[] = $zw; - $zw = []; - } - - $zw = $element; - } else { - $zw['childs'][] = $element; - } - } - - if (!empty($zw)) { - $new_list[] = $zw; - } - - return $new_list; - } - - static function insert($data, $parent_id) { - $constraint = self::getConstraints($parent_id); - - DBManager::get()->exec('UPDATE forum_entries SET lft = lft + 2 - WHERE lft > '. $constraint['rgt'] ." AND seminar_id = '". $constraint['seminar_id'] ."'"); - DBManager::get()->exec('UPDATE forum_entries SET rgt = rgt + 2 - WHERE rgt >= '. $constraint['rgt'] ." AND seminar_id = '". $constraint['seminar_id'] ."'"); - - $stmt = DBManager::get()->prepare("INSERT IGNORE INTO forum_entries - (topic_id, seminar_id, user_id, name, content, mkdate, chdate, author, - author_host, lft, rgt, depth, anonymous) - VALUES (? ,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - $stmt->execute([$data['topic_id'], $data['seminar_id'], $data['user_id'], - $data['name'], $data['content'], $data['mkdate'], $data['chdate'], $data['author'], $data['author_host'] ?: '', - $constraint['rgt'], $constraint['rgt'] + 1, $constraint['depth'] + 1, 0]); - } - - static function getConstraints($topic_id) - { - // look up the range of postings - $range_stmt = DBManager::get()->prepare("SELECT * - FROM forum_entries WHERE topic_id = ?"); - $range_stmt->execute([$topic_id]); - if (!$data = $range_stmt->fetch(PDO::FETCH_ASSOC)) { - return false; - } - - if ($data['depth'] == 1) { - $data['area'] = 1; - } - - return $data; - } - - static function checkRootEntry($seminar_id) { - // check, if the root entry in the topic tree exists - $stmt = DBManager::get()->prepare("SELECT COUNT(*) FROM forum_entries - WHERE topic_id = ?"); - $stmt->execute([$seminar_id]); - if ($stmt->fetchColumn() == 0) { - $stmt = DBManager::get()->prepare("INSERT INTO forum_entries - (topic_id, seminar_id, name, mkdate, chdate, lft, rgt, depth) - VALUES (?, ?, 'Übersicht', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 1, 0)"); - $stmt->execute([$seminar_id, $seminar_id]); - } - - // make sure, that the category "Allgemein" exists - $stmt = DBManager::get()->prepare("REPLACE INTO forum_categories - (category_id, seminar_id, entry_name) VALUES (?, ?, 'Allgemein')"); - $stmt->execute([$seminar_id, $seminar_id]); - } - - function down() - { - // empty - } - -} diff --git a/db/migrations/107_step00247_forum_performance.php b/db/migrations/107_step00247_forum_performance.php deleted file mode 100644 index 99d5031..0000000 --- a/db/migrations/107_step00247_forum_performance.php +++ /dev/null @@ -1,37 +0,0 @@ -exec("ALTER TABLE forum_entries ADD latest_chdate INT(11) AFTER mkdate"); - - $db = DBManager::get()->query("SELECT * FROM forum_entries"); - $stmt = DBManager::get()->prepare("SELECT chdate FROM forum_entries - WHERE lft > ? AND rgt < ? AND seminar_id = ? - ORDER BY chdate DESC LIMIT 1"); - $stmt_update = DBManager::get()->prepare("UPDATE forum_entries - SET latest_chdate = ? WHERE topic_id = ?"); - - while ($data = $db->fetch(PDO::FETCH_ASSOC)) { - $stmt->execute([$data['lft'], $data['rgt'], $data['seminar_id']]); - $chdate = $stmt->fetchColumn(); - - if ($chdate) { - $stmt_update->execute([$chdate, $data['topic_id']]); - } else { - $stmt_update->execute([$data['chdate'], $data['topic_id']]); - } - } - } - - function down() - { - DBManager::get()->exec("ALTER TABLE forum_entries DROP latest_chdate"); - } -} diff --git a/db/migrations/108_visibilityapi.php b/db/migrations/108_visibilityapi.php deleted file mode 100644 index 712a3b4..0000000 --- a/db/migrations/108_visibilityapi.php +++ /dev/null @@ -1,56 +0,0 @@ -prepare($sql); - $stmt->execute(); - - $result = $db->query("SELECT value FROM config WHERE field = 'HOMEPAGE_VISIBILITY_DEFAULT' ORDER BY is_default LIMIT 1"); - $default_visibility = constant($result->fetchColumn()); - - $sql = "SELECT `user_id` FROM `auth_user_md5`"; - $stmt = $db->prepare($sql); - $stmt->execute(); - while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) { - $user = User::find($result['user_id']); - Visibility::createDefaultCategories($user->user_id); - - //copy all homepage visibility - $elements = $user->getHomepageElements(); - if (is_array($elements)) { - foreach ($elements as $key => $state) { - if ($state['visibility'] != $default_visibility) { - Visibility::addPrivacySetting($state['name'], $key, $state['identifier'], 1, $about->auth_user['user_id'], $state['visibility']); - } - } - } - } - } - - function down() { - - } - -} - -?> diff --git a/db/migrations/109_init_custom_blubber_streams.php b/db/migrations/109_init_custom_blubber_streams.php deleted file mode 100644 index c1f06f7..0000000 --- a/db/migrations/109_init_custom_blubber_streams.php +++ /dev/null @@ -1,80 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `blubber_tags` ( - `topic_id` varchar(32) NOT NULL, - `tag` varchar(128) NOT NULL, - PRIMARY KEY `unique_tags` (`topic_id`,`tag`), - KEY `tag` (`tag`) - ) ENGINE=MyISAM - "); - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `blubber_streams` ( - `stream_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `name` varchar(32) NOT NULL, - `sort` enum('activity','age') NOT NULL DEFAULT 'age', - `defaultstream` tinyint(2) NOT NULL DEFAULT '0', - `pool_courses` text, - `pool_groups` text, - `pool_hashtags` text, - `filter_type` text, - `filter_courses` text, - `filter_groups` text, - `filter_users` text, - `filter_hashtags` text, - `filter_nohashtags` text, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`stream_id`), - KEY `user_id` (`user_id`) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec("ALTER TABLE `blubber` DROP INDEX `root_id` , - ADD INDEX `root_id` ( `root_id` , `mkdate` )"); - - DBManager::get()->exec("ALTER TABLE `blubber` DROP INDEX `Seminar_id` , - ADD INDEX `Seminar_id` ( `Seminar_id` , `context_type` )"); - - //noch Hashtags/Tags in eigene Tabelle packen: - $statement = DBManager::get()->prepare( - "SELECT blubber.* " . - "FROM blubber " . - "WHERE LOCATE('#', blubber.description) > 0 " . - ""); - $statement->execute(); - $hashtag_regexp = "(?:^|\s)#([\w\d_\.\-\?!\+=%]*[\w\d])"; - $insert_statement = DBManager::get()->prepare( - "INSERT IGNORE INTO blubber_tags " . - "SET topic_id = :topic_id, " . - "tag = :tag " . - ""); - - while($blubber = $statement->fetch(PDO::FETCH_ASSOC)) { - preg_match_all("/".$hashtag_regexp."/", $blubber['description'], $matches); - foreach ($matches as $match) { - $match = trim($match[0]); - $tag = $match[0] === "#" ? substr($match, 1) : $match; - if ($tag) { - $insert_statement->execute([ - 'topic_id' => $blubber['root_id'], - 'tag' => strtolower($tag) - ]); - } - } - } - } - - function down() { - - } - -} diff --git a/db/migrations/10_image_proxy.php b/db/migrations/10_image_proxy.php deleted file mode 100644 index 102460e..0000000 --- a/db/migrations/10_image_proxy.php +++ /dev/null @@ -1,35 +0,0 @@ -announce(" creating table `image_proxy_cache`..."); - - DBManager::get()->exec( "CREATE TABLE `image_proxy_cache` ( - `id` char(32) NOT NULL, - `type` char(10) NOT NULL, - `length` int(10) unsigned NOT NULL, - `error` char(15) NOT NULL, - `chdate` timestamp NOT NULL, - PRIMARY KEY (`id`), - KEY `chdate` (`chdate`,`id`) - ) ENGINE=MyISAM;"); - $this->announce(" config entry EXTERNAL_IMAGE_EMBEDDING ..."); - DBManager::get()->exec("INSERT IGNORE INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES - ('0c81083086adc66714864b1abcff650a', '', 'EXTERNAL_IMAGE_EMBEDDING', 'deny', 1, 'string', 'global', '', 0, 0, 0, 'Sollen externe Bilder über [img] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', '', ''); - "); - $this->announce("done."); - } - - public function down () - { - $this->announce(" removing table `admission_group`..."); - DBManager::get()->exec("DROP TABLE IF EXISTS `image_proxy_cache` "); - $this->announce("done."); - } -} diff --git a/db/migrations/110_scm_add_position.php b/db/migrations/110_scm_add_position.php deleted file mode 100644 index 53847d4..0000000 --- a/db/migrations/110_scm_add_position.php +++ /dev/null @@ -1,46 +0,0 @@ -exec($query); - - $query = "UPDATE scm - SET position = :position - WHERE range_id = :range_id AND scm_id = :scm_id"; - $update_statement = DBManager::get()->prepare($query); - - $query = "SELECT range_id, scm_id FROM scm ORDER BY range_id ASC, mkdate ASC"; - $statement = DBManager::get()->query($query); - - $last_range = null; - foreach ($statement as $row) { - if ($row['range_id'] != $last_range) { - $position = 0; - $last_range = $row['range_id']; - } else { - $position += 1; - } - - $update_statement->bindValue(':position', $position, PDO::PARAM_INT); - $update_statement->bindValue(':range_id', $row['range_id']); - $update_statement->bindValue(':scm_id', $row['scm_id']); - $update_statement->execute(); - } - } - - public function down() - { - $query = "ALTER TABLE `scm` - DROP COLUMN `position`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/111_step_3574_domain.php b/db/migrations/111_step_3574_domain.php deleted file mode 100644 index 738bca7..0000000 --- a/db/migrations/111_step_3574_domain.php +++ /dev/null @@ -1,25 +0,0 @@ -exec($query); - $query = "ALTER TABLE `auto_insert_sem` DROP PRIMARY KEY , - ADD PRIMARY KEY ( `seminar_id` , `status` , `domain_id` )"; - DBManager::get()->exec($query); - $query = "INSERT IGNORE INTO `auto_insert_sem` - SELECT `seminar_id`, `status` , `userdomain_id` FROM `auto_insert_sem` JOIN `userdomains`"; - DBManager::get()->exec($query); - } - - function down() { - $query = "ALTER TABLE `auto_insert_sem` DROP `domain_id`"; - DBManager::get()->exec($query); - } - -} \ No newline at end of file diff --git a/db/migrations/113_init_mailqueue.php b/db/migrations/113_init_mailqueue.php deleted file mode 100644 index 10708fa..0000000 --- a/db/migrations/113_init_mailqueue.php +++ /dev/null @@ -1,89 +0,0 @@ -prepare($query); - $statement->execute(); - - // Add config entries - $query = "INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description`) - VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'global', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; - $statement = DBManager::get()->prepare($query); - - $statement->execute([ - ':field' => 'MAILQUEUE_ENABLE', - ':value' => "0", - ':type' => 'boolean', - ':description' => 'Aktiviert bzw. deaktiviert die Mailqueue', - ]); - - // Add default cron tasks and schedules - $new_job = [ - 'filename' => 'lib/cronjobs/send_mail_queue.class.php', - 'class' => 'SendMailQueueJob', - 'priority' => 'normal' - ]; - - $query = "INSERT IGNORE INTO `cronjobs_tasks` - (`task_id`, `filename`, `class`, `active`) - VALUES (:task_id, :filename, :class, 1)"; - $task_statement = DBManager::get()->prepare($query); - - $query = "INSERT IGNORE INTO `cronjobs_schedules` - (`schedule_id`, `task_id`, `parameters`, `priority`, - `type`, `minute`, `hour`, `mkdate`, `chdate`, - `last_result`) - VALUES (:schedule_id, :task_id, '[]', :priority, 'periodic', - :minute, :hour, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - NULL)"; - $schedule_statement = DBManager::get()->prepare($query); - - - $task_id = md5(uniqid('task', true)); - - $task_statement->execute([ - ':task_id' => $task_id, - ':filename' => $new_job['filename'], - ':class' => $new_job['class'], - ]); - - $schedule_id = md5(uniqid('schedule', true)); - $schedule_statement->execute([ - ':schedule_id' => $schedule_id, - ':task_id' => $task_id, - ':priority' => $new_job['priority'], - ':hour' => $new_job['hour'], - ':minute' => $new_job['minute'], - ]); - } - - function down() - { - DBManager::get()->query("DROP TABLE IF EXISTS `cronjobs_tasks`, `cronjobs_schedules`, `cronjobs_logs`"); - - DBManager::get()->query("DELETE FROM config WHERE field IN ('CRONJOB_ENABLE', 'CRONJOBS_ESCALATION')"); - } -} diff --git a/db/migrations/114_create_table_blubber_reshares.php b/db/migrations/114_create_table_blubber_reshares.php deleted file mode 100644 index 0a0f5ae..0000000 --- a/db/migrations/114_create_table_blubber_reshares.php +++ /dev/null @@ -1,28 +0,0 @@ -prepare($query); - $statement->execute(); - } - - function down() - { - } -} diff --git a/db/migrations/115_performance_tic_3759.php b/db/migrations/115_performance_tic_3759.php deleted file mode 100644 index dd3cc02..0000000 --- a/db/migrations/115_performance_tic_3759.php +++ /dev/null @@ -1,19 +0,0 @@ -exec("ALTER TABLE `plugins_activated` CHANGE `poiid` `poiid` VARCHAR( 36 ) NOT NULL DEFAULT ''"); - DBManager::get()->exec("ALTER TABLE `plugins_activated` ADD UNIQUE ( `poiid` , `pluginid` , `state` )"); - DBManager::get()->exec("ALTER TABLE `deputies` ADD INDEX ( `user_id` , `range_id` , `edit_about` )"); - } - - function down() - { - } -} diff --git a/db/migrations/116_step_00263_inst_gendering.php b/db/migrations/116_step_00263_inst_gendering.php deleted file mode 100644 index 6f843f6..0000000 --- a/db/migrations/116_step_00263_inst_gendering.php +++ /dev/null @@ -1,15 +0,0 @@ -exec("ALTER TABLE statusgruppen - ADD (name_w varchar(255), - name_m varchar(255));"); - } -} diff --git a/db/migrations/117_forum_add_close.php b/db/migrations/117_forum_add_close.php deleted file mode 100644 index dfc0ccd..0000000 --- a/db/migrations/117_forum_add_close.php +++ /dev/null @@ -1,21 +0,0 @@ -exec("ALTER TABLE forum_entries - ADD `closed` TINYINT( 1 ) NOT NULL DEFAULT '0';"); - } - - function down() { - DBManager::get()->exec("ALTER TABLE `forum_entries` - DROP `closed`;"); - } - -} - -?> diff --git a/db/migrations/118_forum_sticky_posts.php b/db/migrations/118_forum_sticky_posts.php deleted file mode 100644 index b54833d..0000000 --- a/db/migrations/118_forum_sticky_posts.php +++ /dev/null @@ -1,21 +0,0 @@ -exec("ALTER TABLE forum_entries - ADD `sticky` INT(1) NOT NULL DEFAULT '0';"); - } - - function down() { - DBManager::get()->exec("ALTER TABLE `forum_entries` - DROP `sticky`;"); - } - -} - -?> diff --git a/db/migrations/119_init_termin_related_groups_table.php b/db/migrations/119_init_termin_related_groups_table.php deleted file mode 100644 index 3ac24b5..0000000 --- a/db/migrations/119_init_termin_related_groups_table.php +++ /dev/null @@ -1,25 +0,0 @@ -exec( - "CREATE TABLE IF NOT EXISTS `termin_related_groups` ( - `termin_id` VARCHAR(32) NOT NULL , - `statusgruppe_id` VARCHAR(45) NOT NULL , - UNIQUE KEY `unique` (`termin_id`,`statusgruppe_id`), - INDEX `termin_id` (`termin_id` ASC) , - INDEX `statusgruppe_id` (`statusgruppe_id` ASC) - ) ENGINE=MyISAM;"); - } - - function down() { - DBManager::get()->exec("DROP TABLE `termin_related_groups`;"); - } - -} - diff --git a/db/migrations/11_lock_rulez.php b/db/migrations/11_lock_rulez.php deleted file mode 100644 index d16f34b..0000000 --- a/db/migrations/11_lock_rulez.php +++ /dev/null @@ -1,38 +0,0 @@ -announce(" creating table..."); - - DBManager::get()->exec( " - CREATE TABLE `lock_rules` ( - `lock_id` varchar(32) NOT NULL default '', - `name` varchar(255) NOT NULL default '', - `description` text NOT NULL, - `attributes` text NOT NULL, - PRIMARY KEY (`lock_id`) - ) ENGINE=MyISAM"); - - DBManager::get()->exec("ALTER TABLE `seminare` ADD `lock_rule` VARCHAR( 32 ) NULL"); - - $this->announce("done."); - - } - - public function down () - { - $this->announce(" removing table..."); - DBManager::get()->exec("DROP TABLE `lock_rules`"); - DBManager::get()->exec("ALTER TABLE `seminare` DROP `lock_rule`"); - - $this->announce("done."); - - } -} diff --git a/db/migrations/120_create_open_graph_data_table.php b/db/migrations/120_create_open_graph_data_table.php deleted file mode 100644 index 3dce2c5..0000000 --- a/db/migrations/120_create_open_graph_data_table.php +++ /dev/null @@ -1,48 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `opengraphdata` ( - `url` varchar(1000) NOT NULL, - `is_opengraph` tinyint(2) DEFAULT NULL, - `title` text, - `image` varchar(1024) DEFAULT NULL, - `description` text, - `type` varchar(64) DEFAULT NULL, - `data` text NOT NULL, - `last_update` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`url`) - ) ENGINE=MyISAM - "); - $options[] = - [ - 'name' => 'OPENGRAPH_ENABLE', - 'type' => 'boolean', - 'value' => '1', - 'range' => 'global', - 'section' => 'global', - 'description' => 'De-/Aktiviert OpenGraph-Informationen und deren Abrufen.' - ]; - - $stmt = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - public function down() - { - DBManager::get()->exec("DROP TABLE TABLE IF EXISTS `opengraph`"); - DBManager::get()->exec("DELETE FROM config WHERE field = 'OPENGRAPH_ENABLE'"); - } -} \ No newline at end of file diff --git a/db/migrations/121_step_00266_forced_lock_rules.php b/db/migrations/121_step_00266_forced_lock_rules.php deleted file mode 100644 index 750e65d..0000000 --- a/db/migrations/121_step_00266_forced_lock_rules.php +++ /dev/null @@ -1,20 +0,0 @@ -exec("ALTER TABLE `seminare` ADD `aux_lock_rule_forced` TINYINT NOT NULL DEFAULT '0' AFTER `aux_lock_rule`;"); - - } - - function down() { - DBManager::get()->exec("ALTER TABLE `seminare` DROP `aux_lock_rule_forced`;"); - } - -} - -?> diff --git a/db/migrations/122_add_seminar_id_to_folder.php b/db/migrations/122_add_seminar_id_to_folder.php deleted file mode 100644 index 88f50e4..0000000 --- a/db/migrations/122_add_seminar_id_to_folder.php +++ /dev/null @@ -1,103 +0,0 @@ -addSeminarIdField(); - $this->updateHeads(); - $this->updateTails(); - } - - function addSeminarIdField() - { - DBManager::get()->exec('ALTER TABLE `folder` ADD `seminar_id` VARCHAR(32) NOT NULL AFTER `range_id`'); - } - - function updateHeads() - { - $this->updateFirstLevelFolders(); - $this->updateSpecialFolders(); - } - - function updateTails() - { - do { - $updated = $this->updateSeminarIds("SELECT f1.folder_id, f2.seminar_id FROM `folder` f1 INNER JOIN folder f2 ON f1.range_id = f2.folder_id WHERE f1.seminar_id = ''"); - } while ($updated > 0); - } - - function updateFirstLevelFolders() - { - $this->updateSeminarIds("SELECT f.folder_id, s.Seminar_id AS seminar_id ". - "FROM `folder` f ". - "INNER JOIN `seminare` s ON s.Seminar_id = f.range_id"); - $this->updateSeminarIds("SELECT f.folder_id, s.Seminar_id AS seminar_id ". - "FROM `folder` f ". - "INNER JOIN `seminare` s ON MD5(CONCAT(s.Seminar_id, 'top_folder')) = f.range_id"); - - $this->updateSeminarIds("SELECT f.folder_id, i.Institut_id AS seminar_id ". - "FROM `folder` f ". - "INNER JOIN `Institute` i ON i.Institut_id = f.range_id"); - $this->updateSeminarIds("SELECT f.folder_id, i.Institut_id AS seminar_id ". - "FROM `folder` f ". - "INNER JOIN `Institute` i ON MD5(CONCAT(i.Institut_id, 'top_folder')) = f.range_id"); - } - - - function updateSpecialFolders() - { - $this->updateSeminarIds("SELECT f.folder_id, s.range_id AS seminar_id ". - "FROM `folder` f ". - "INNER JOIN `statusgruppen` s ON s.statusgruppe_id = f.range_id"); - - $this->updateSeminarIds("SELECT f.folder_id, t.seminar_id AS seminar_id ". - "FROM `folder` f ". - "INNER JOIN `themen` t ON t.issue_id = f.range_id"); - - $this->updateSeminarIds("SELECT f.folder_id, a.user_id AS seminar_id - FROM `folder` f - INNER JOIN `auth_user_md5` a ON a.user_id = f.range_id"); - } - - function updateSeminarIds($sql) - { - $db = DBManager::get(); - - $stmt = $db->prepare($sql); - $stmt->execute([]); - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - $updated = 0; - $stmt = $db->prepare("UPDATE folder SET seminar_id = ? WHERE folder_id = ?"); - foreach ($rows as $row) { - $stmt->execute([$row['seminar_id'], $row['folder_id']]); - $updated += $stmt->rowCount(); - } - - return $updated; - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - - try { - $db->exec("ALTER TABLE `folder` DROP COLUMN `seminar_id`"); - } catch (Exception $e) { } - } -} diff --git a/db/migrations/123_tic_3993_remove_dont_delete.php b/db/migrations/123_tic_3993_remove_dont_delete.php deleted file mode 100644 index 3d7da57..0000000 --- a/db/migrations/123_tic_3993_remove_dont_delete.php +++ /dev/null @@ -1,33 +0,0 @@ -exec("ALTER TABLE `message` DROP COLUMN `dont_delete`"); - } catch (Exception $e) { } - } - - - /** - * revert this migration - */ - function down() - { - DBManager::get()->exec('ALTER TABLE `message` ADD `dont_delete` tinyint(1) NOT NULL DEFAULT \'0\' AFTER `snd_rec`'); - } -} diff --git a/db/migrations/124_step_00255_important_semnumber.php b/db/migrations/124_step_00255_important_semnumber.php deleted file mode 100644 index c21030a..0000000 --- a/db/migrations/124_step_00255_important_semnumber.php +++ /dev/null @@ -1,34 +0,0 @@ -create('IMPORTANT_SEMNUMBER', [ - 'value' => 0, - 'is_default' => 0, - 'type' => 'boolean', - 'range' => 'global', - 'section' => 'global', - 'description' => _('Zeigt die Veranstaltungsnummer prominenter in der Suche und auf der Meine Veranstaltungen Seite an') - ]); - } - - /** - * revert this migration - */ - function down() { - Config::get()->delete('IMPORTANT_SEMNUMBER'); - } - -} -?> \ No newline at end of file diff --git a/db/migrations/125_repair_statusgroup_user_numberation.php b/db/migrations/125_repair_statusgroup_user_numberation.php deleted file mode 100644 index d88b5c4..0000000 --- a/db/migrations/125_repair_statusgroup_user_numberation.php +++ /dev/null @@ -1,46 +0,0 @@ -query('DELETE FROM statusgruppe_user WHERE statusgruppe_id = ""'); - - $sql = "SELECT DISTINCT statusgruppe_id FROM statusgruppe_user"; - $user_sql = "SELECT user_id, position FROM statusgruppe_user WHERE statusgruppe_id = ? ORDER BY position ASC"; - $update_sql = "UPDATE statusgruppe_user SET position = ? WHERE statusgruppe_id = ? AND user_id = ?"; - $userStmt = DBManager::get()->prepare($user_sql); - $result = DBManager::get()->query($sql); - $update = DBManager::get()->prepare($update_sql); - while ($group = $result->fetch(PDO::FETCH_COLUMN)) { - $userStmt->execute([$group]); - $realPosition = 0; - while ($user = $userStmt->fetch(PDO::FETCH_ASSOC)) { - if ($user['position'] != $realPosition++) { - $update->execute([$realPosition - 1, $group, $user['user_id']]); - } - } - } - } - - /** - * revert this migration - */ - function down() { - // we could randomly assign new position ids here to screw things up like - // it was before the migration - } - -} -?> \ No newline at end of file diff --git a/db/migrations/126_tic_4044_invisible_studygroups.php b/db/migrations/126_tic_4044_invisible_studygroups.php deleted file mode 100644 index 6f050cc..0000000 --- a/db/migrations/126_tic_4044_invisible_studygroups.php +++ /dev/null @@ -1,32 +0,0 @@ -create('STUDYGROUPS_INVISIBLE_ALLOWED', [ - 'value' => 0, - 'is_default' => 0, - 'type' => 'boolean', - 'range' => 'global', - 'section' => 'studygroups', - 'description' => _('Ermöglicht unsichtbare Studiengruppen') - ]); - } - - /** - * revert this migration - */ - function down() { - Config::get()->delete('STUDYGROUPS_INVISIBLE_ALLOWED'); - } - -} \ No newline at end of file diff --git a/db/migrations/127_setup_api.php b/db/migrations/127_setup_api.php deleted file mode 100644 index 7cae3f9..0000000 --- a/db/migrations/127_setup_api.php +++ /dev/null @@ -1,217 +0,0 @@ -exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `oauth_consumer_token` ( - `oct_id` int(11) NOT NULL AUTO_INCREMENT, - `oct_ocr_id_ref` int(11) NOT NULL, - `oct_usa_id_ref` int(11) NOT NULL, - `oct_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `oct_token` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `oct_token_secret` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `oct_token_type` enum('request','authorized','access') DEFAULT NULL, - `oct_token_ttl` datetime NOT NULL DEFAULT '9999-12-31 00:00:00', - `oct_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`oct_id`), - UNIQUE KEY `oct_ocr_id_ref` (`oct_ocr_id_ref`,`oct_token`), - UNIQUE KEY `oct_usa_id_ref` (`oct_usa_id_ref`,`oct_ocr_id_ref`,`oct_token_type`,`oct_name`), - KEY `oct_token_ttl` (`oct_token_ttl`), - CONSTRAINT `oauth_consumer_token_ibfk_1` FOREIGN KEY (`oct_ocr_id_ref`) REFERENCES `oauth_consumer_registry` (`ocr_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `oauth_log` ( - `olg_id` int(11) NOT NULL AUTO_INCREMENT, - `olg_osr_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `olg_ost_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `olg_ocr_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `olg_oct_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `olg_usa_id_ref` int(11) DEFAULT NULL, - `olg_received` text NOT NULL, - `olg_sent` text NOT NULL, - `olg_base_string` text NOT NULL, - `olg_notes` text NOT NULL, - `olg_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `olg_remote_ip` bigint(20) NOT NULL, - PRIMARY KEY (`olg_id`), - KEY `olg_osr_consumer_key` (`olg_osr_consumer_key`,`olg_id`), - KEY `olg_ost_token` (`olg_ost_token`,`olg_id`), - KEY `olg_ocr_consumer_key` (`olg_ocr_consumer_key`,`olg_id`), - KEY `olg_oct_token` (`olg_oct_token`,`olg_id`), - KEY `olg_usa_id_ref` (`olg_usa_id_ref`,`olg_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `oauth_server_nonce` ( - `osn_id` int(11) NOT NULL AUTO_INCREMENT, - `osn_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `osn_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `osn_timestamp` bigint(20) NOT NULL, - `osn_nonce` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - PRIMARY KEY (`osn_id`), - UNIQUE KEY `osn_consumer_key` (`osn_consumer_key`,`osn_token`,`osn_timestamp`,`osn_nonce`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `oauth_server_registry` ( - `osr_id` int(11) NOT NULL AUTO_INCREMENT, - `osr_usa_id_ref` int(11) DEFAULT NULL, - `osr_consumer_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `osr_consumer_secret` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `osr_enabled` tinyint(1) NOT NULL DEFAULT '1', - `osr_status` varchar(16) NOT NULL, - `osr_requester_name` varchar(64) NOT NULL, - `osr_requester_email` varchar(64) NOT NULL, - `osr_callback_uri` varchar(255) NOT NULL, - `osr_application_uri` varchar(255) NOT NULL, - `osr_application_title` varchar(80) NOT NULL, - `osr_application_descr` text NOT NULL, - `osr_application_notes` text NOT NULL, - `osr_application_type` varchar(20) NOT NULL, - `osr_application_commercial` tinyint(1) NOT NULL DEFAULT '0', - `osr_issue_date` datetime NOT NULL, - `osr_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`osr_id`), - UNIQUE KEY `osr_consumer_key` (`osr_consumer_key`), - KEY `osr_usa_id_ref` (`osr_usa_id_ref`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `oauth_server_token` ( - `ost_id` int(11) NOT NULL AUTO_INCREMENT, - `ost_osr_id_ref` int(11) NOT NULL, - `ost_usa_id_ref` int(11) NOT NULL, - `ost_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `ost_token_secret` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `ost_token_type` enum('request','access') DEFAULT NULL, - `ost_authorized` tinyint(1) NOT NULL DEFAULT '0', - `ost_referrer_host` varchar(128) NOT NULL DEFAULT '', - `ost_token_ttl` datetime NOT NULL DEFAULT '9999-12-31 00:00:00', - `ost_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `ost_verifier` char(10) DEFAULT NULL, - `ost_callback_url` varchar(512) DEFAULT NULL, - PRIMARY KEY (`ost_id`), - UNIQUE KEY `ost_token` (`ost_token`), - KEY `ost_osr_id_ref` (`ost_osr_id_ref`), - KEY `ost_token_ttl` (`ost_token_ttl`), - CONSTRAINT `oauth_server_token_ibfk_1` FOREIGN KEY (`ost_osr_id_ref`) REFERENCES `oauth_server_registry` (`osr_id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; - DBManager::get()->exec($query); - - // Add api tables - $query = "CREATE TABLE IF NOT EXISTS `api_consumer_permissions` ( - `route_id` char(32) NOT NULL, - `consumer_id` char(32) NOT NULL DEFAULT '', - `method` char(6) NOT NULL, - `granted` tinyint(1) unsigned NOT NULL DEFAULT '0', - UNIQUE KEY `route_id` (`route_id`,`consumer_id`,`method`) - ) ENGINE=MyISAM"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `api_consumers` ( - `consumer_id` char(32) NOT NULL DEFAULT '', - `consumer_type` enum('http','studip','oauth') NOT NULL DEFAULT 'studip', - `auth_key` varchar(64) DEFAULT NULL, - `auth_secret` varchar(64) DEFAULT NULL, - `active` tinyint(1) unsigned NOT NULL DEFAULT '0', - `system` tinyint(1) unsigned NOT NULL DEFAULT '0', - `type` enum('website','mobile','desktop') DEFAULT 'website', - `title` varchar(128) DEFAULT NULL, - `contact` varchar(255) DEFAULT NULL, - `email` varchar(255) DEFAULT NULL, - `url` varchar(255) DEFAULT NULL, - `callback` varchar(255) DEFAULT NULL, - `commercial` tinyint(1) DEFAULT NULL, - `description` text, - `priority` int(11) unsigned NOT NULL DEFAULT '0', - `notes` text, - `mkdate` int(11) unsigned NOT NULL, - `chdate` int(11) unsigned NOT NULL, - PRIMARY KEY (`consumer_id`) - ) ENGINE=MyISAM"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `api_oauth_user_mapping` ( - `oauth_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user_id` char(32) NOT NULL DEFAULT '', - `mkdate` int(11) unsigned NOT NULL, - PRIMARY KEY (`oauth_id`) - ) ENGINE=MyISAM"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `api_user_permissions` ( - `user_id` char(32) NOT NULL DEFAULT '', - `consumer_id` char(32) NOT NULL DEFAULT '', - `granted` tinyint(1) unsigned NOT NULL DEFAULT '0', - `mkdate` int(11) unsigned NOT NULL, - `chdate` int(11) unsigned NOT NULL, - PRIMARY KEY (`user_id`,`consumer_id`) - ) ENGINE=MyISAM"; - DBManager::get()->exec($query); - - // Add config entries - $query = "INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description`) - VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'global', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; - $statement = DBManager::get()->prepare($query); - - $statement->execute([ - ':field' => 'API_ENABLED', - ':value' => (int)false, - ':type' => 'boolean', - ':description' => 'Schaltet die REST-API an', - ]); - - $statement->execute([ - ':field' => 'API_OAUTH_AUTH_PLUGIN', - ':value' => 'Standard', - ':type' => 'string', - ':description' => 'Definiert das für OAuth verwendete Authentifizierungsverfahren', - ]); - } - - function down() - { - DBManager::get()->exec("DELETE FROM config WHERE field IN ('API_ENABLED', 'API_OAUTH_AUTH_PLUGIN')"); - DBManager::get()->exec("DROP TABLE IF EXISTS `oauth_consumer_registry`, - `oauth_consumer_token`, - `oauth_log`, - `oauth_server_nonce`, - `oauth_server_registry`, - `oauth_server_token` - `api_consumer_permissions`, - `api_consumers`, - `api_oauth_user_mapping`, - `api_user_permissions`"); - } -} diff --git a/db/migrations/128_step00240_coursesets.php b/db/migrations/128_step00240_coursesets.php deleted file mode 100644 index b767ae3..0000000 --- a/db/migrations/128_step00240_coursesets.php +++ /dev/null @@ -1,500 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS `admission_condition` ( - `rule_id` VARCHAR(32) NOT NULL , - `filter_id` VARCHAR(32) NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`, `filter_id`) ) - ENGINE = MyISAM"); - - // "chance adjustment" in seat distribution - $db->exec("CREATE TABLE IF NOT EXISTS `admissionfactor` ( - `list_id` VARCHAR(32) NOT NULL , - `name` VARCHAR(255) NOT NULL , - `factor` DECIMAL(5,2) NOT NULL DEFAULT 1, - `owner_id` VARCHAR(32) NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`list_id`) ) - ENGINE = MyISAM"); - - // available admission rules. - $db->exec("CREATE TABLE IF NOT EXISTS `admissionrules` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `ruletype` VARCHAR(255) UNIQUE NOT NULL, - `active` TINYINT(1) NOT NULL DEFAULT 0, - `mkdate` INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`) - ) ENGINE = MyISAM"); - // Create entries for default admission rule types. - $db->exec("INSERT IGNORE INTO `admissionrules` - (`ruletype`, `active`, `mkdate`) VALUES - ('ConditionalAdmission', 1, UNIX_TIMESTAMP()), - ('LimitedAdmission', 1, UNIX_TIMESTAMP()), - ('LockedAdmission', 1, UNIX_TIMESTAMP()), - ('PasswordAdmission', 1, UNIX_TIMESTAMP()), - ('TimedAdmission', 1, UNIX_TIMESTAMP()), - ('ParticipantRestrictedAdmission', 1, UNIX_TIMESTAMP());"); - - // Admission rules can be available globally or only at selected institutes. - $db->exec("CREATE TABLE IF NOT EXISTS `admissionrule_inst` ( - `rule_id` VARCHAR(32) NOT NULL, - `institute_id` VARCHAR(32) NOT NULL, - `mkdate` INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`, `institute_id`) - ) ENGINE = MyISAM"); - - // admission rules specifying conditions for access - $db->exec("CREATE TABLE IF NOT EXISTS `conditionaladmissions` ( - `rule_id` VARCHAR(32) NOT NULL , - `message` TEXT NULL , - `start_time` INT NOT NULL DEFAULT 0, - `end_time` INT NOT NULL DEFAULT 0, - `mkdate` INT NOT NULL DEFAULT 0, - `conditions_stopped` TINYINT(1) NOT NULL DEFAULT 0 , - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) ) - ENGINE = MyISAM"); - - // assign course sets to factor lists - $db->exec("CREATE TABLE IF NOT EXISTS `courseset_factorlist` ( - `set_id` VARCHAR(32) NOT NULL , - `factorlist_id` VARCHAR(32) NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0 , - PRIMARY KEY (`set_id`, `factorlist_id`) ) - ENGINE = MyISAM"); - - // assign course sets to institutes - $db->exec("CREATE TABLE IF NOT EXISTS `courseset_institute` ( - `set_id` VARCHAR(32) NOT NULL , - `institute_id` VARCHAR(32) NOT NULL , - `mkdate` INT NULL , - `chdate` INT NULL , - PRIMARY KEY (`set_id`, `institute_id`), - INDEX `institute_id` (`institute_id`,`set_id`)) - ENGINE = MyISAM"); - - // assign admission rules to course sets - $db->exec("CREATE TABLE IF NOT EXISTS `courseset_rule` ( - `set_id` VARCHAR(32) NOT NULL , - `rule_id` VARCHAR(32) NOT NULL , - `type` VARCHAR(255) NULL , - `mkdate` INT NULL , - PRIMARY KEY (`set_id`, `rule_id`), - INDEX `type` (`type`,`set_id`)) - ENGINE = MyISAM"); - - // sets of courses with common admission rules - $db->exec("CREATE TABLE IF NOT EXISTS `coursesets` ( - `set_id` VARCHAR(32) NOT NULL , - `user_id` VARCHAR(32) NOT NULL , - `name` VARCHAR(255) NOT NULL , - `infotext` TEXT NOT NULL , - `algorithm` VARCHAR(255) NOT NULL , - `algorithm_run` TINYINT(1) NOT NULL DEFAULT 0 , - `private` TINYINT(1) NOT NULL DEFAULT 0, - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`set_id`) , - INDEX `set_user` (`user_id`, `set_id`) ) - ENGINE = MyISAM"); - - // admission rules with max number of courses to register for - $db->exec("CREATE TABLE IF NOT EXISTS `limitedadmissions` ( - `rule_id` VARCHAR(32) NOT NULL , - `message` TEXT NOT NULL , - `start_time` INT NOT NULL DEFAULT 0, - `end_time` INT NOT NULL DEFAULT 0, - `maxnumber` INT NOT NULL DEFAULT 0, - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) ) - ENGINE = MyISAM"); - - // admission rules that completely lock access to courses - $db->exec("CREATE TABLE IF NOT EXISTS `lockedadmissions` ( - `rule_id` VARCHAR(32) NOT NULL , - `message` TEXT NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) ) - ENGINE = MyISAM"); - - // admission rules that specify a password for course access - $db->exec("CREATE TABLE IF NOT EXISTS `passwordadmissions` ( - `rule_id` VARCHAR(32) NOT NULL , - `message` TEXT NULL , - `start_time` INT NOT NULL DEFAULT 0, - `end_time` INT NOT NULL DEFAULT 0, - `password` VARCHAR(255) NULL , - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) ) - ENGINE = MyISAM"); - - // priorities for course assignment - $db->exec("CREATE TABLE IF NOT EXISTS `priorities` ( - `user_id` VARCHAR(32) NOT NULL , - `set_id` VARCHAR(32) NOT NULL , - `seminar_id` VARCHAR(32) NOT NULL , - `priority` INT NOT NULL DEFAULT 0, - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`user_id`, `set_id`, `seminar_id`) , - INDEX `user_rule_priority` (`user_id` ASC, `priority` ASC, `set_id` ASC) ) - ENGINE = MyISAM"); - - // assign courses to course sets - $db->exec("CREATE TABLE IF NOT EXISTS `seminar_courseset` ( - `set_id` VARCHAR(32) NOT NULL , - `seminar_id` VARCHAR(32) NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0 , - PRIMARY KEY (`set_id`, `seminar_id`), - INDEX `seminar_id` (`seminar_id`, `set_id` ) ) - ENGINE = MyISAM"); - - // admission rules concerning time - $db->exec("CREATE TABLE IF NOT EXISTS `timedadmissions` ( - `rule_id` VARCHAR(32) NOT NULL , - `message` TEXT NOT NULL , - `start_time` INT NOT NULL DEFAULT 0, - `end_time` INT NOT NULL DEFAULT 0, - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) , - INDEX `start_time` (`start_time` ASC) , - INDEX `end_time` (`end_time` ASC) , - INDEX `start_end` (`start_time` ASC, `end_time` ASC) ) - ENGINE = MyISAM"); - - $db->exec("CREATE TABLE IF NOT EXISTS `participantrestrictedadmissions` ( - `rule_id` varchar(32), - `message` text NOT NULL, - `distribution_time` int(11) NOT NULL DEFAULT 0, - `mkdate` int(11) NOT NULL DEFAULT 0, - `chdate` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) - ) ENGINE=MyISAM"); - - // assign users to lists with different factor in seat distribution - $db->exec("CREATE TABLE IF NOT EXISTS `user_factorlist` ( - `list_id` VARCHAR(32) NULL , - `user_id` VARCHAR(32) NULL , - `mkdate` INT NULL , - PRIMARY KEY (`list_id`, `user_id`) ) - ENGINE = MyISAM"); - - // filters for users - $db->exec("CREATE TABLE IF NOT EXISTS `userfilter` ( - `filter_id` VARCHAR(32) NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`filter_id`) ) - ENGINE = MyISAM"); - - // several fields form a user filter - $db->exec("CREATE TABLE IF NOT EXISTS `userfilter_fields` ( - `field_id` VARCHAR(32) NOT NULL , - `filter_id` VARCHAR(32) NOT NULL , - `type` VARCHAR(255) NOT NULL , - `value` VARCHAR(255) NOT NULL , - `compare_op` VARCHAR(255) NOT NULL , - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`field_id`) ) - ENGINE = MyISAM"); - - // user defined max number of courses to register for - $db->exec("CREATE TABLE IF NOT EXISTS `userlimits` ( - `rule_id` VARCHAR(32) NOT NULL , - `user_id` VARCHAR(32) NOT NULL , - `maxnumber` INT NULL , - `mkdate` INT NULL , - `chdate` INT NULL , - PRIMARY KEY (`rule_id`, `user_id`) ) - ENGINE = MyISAM"); - - $cs_insert = $db->prepare("INSERT INTO coursesets (set_id,user_id,name,infotext,algorithm,private,mkdate,chdate) - VALUES (?,?,?,?,'',?,?,?)"); - $cs_i_insert = $db->prepare("INSERT INTO courseset_institute (set_id,institute_id,mkdate,chdate) VALUES (?,?,UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); - $cs_r_insert = $db->prepare("INSERT INTO courseset_rule (set_id,rule_id,type,mkdate) VALUES (?,?,?,UNIX_TIMESTAMP())"); - $s_cs_insert = $db->prepare("INSERT INTO seminar_courseset (set_id,seminar_id,mkdate) VALUES (?,?,UNIX_TIMESTAMP())"); - $password_insert = $db->prepare("INSERT INTO passwordadmissions (rule_id,message,password,mkdate,chdate) VALUES (?,'Das Passwort ist falsch',?,UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); - $locked_insert = $db->prepare("INSERT INTO lockedadmissions (rule_id,message,mkdate,chdate) VALUES (?,'Die Anmeldung ist gesperrt',UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); - $hasher = new PasswordHash(8, false); - $user_id = $GLOBALS['user']->id; - - //mit pw wandeln - $pw_admission = $db->fetchAll("SELECT seminar_id, name, passwort, institut_id, chdate FROM seminare WHERE admission_type = 0 AND Lesezugriff = 2"); - foreach ($pw_admission as $course) { - $new_pwd = $hasher->HashPassword($course['passwort']); - $rule_id = md5(uniqid('passwordadmissions',1)); - $password_insert->execute([$rule_id, $new_pwd]); - $set_id = md5(uniqid('coursesets',1)); - $name = 'Anmeldung mit Passwort: ' . $course['name']; - $info = 'Erzeugt durch Migration 128 ' . strftime('%X %x'); - $cs_insert->execute([$set_id,$user_id,$name,$info,1,$course['chdate'],$course['chdate']]); - $cs_r_insert->execute([$set_id, $rule_id, 'PasswordAdmission']); - $s_cs_insert->execute([$set_id, $course['seminar_id']]); - } - //ein globales set für alle gesperrten - $locked_set_id = md5(uniqid('coursesets',1)); - $name = 'Anmeldung gesperrt (global)'; - $info = ''; - $cs_insert->execute([$locked_set_id,'',$name,$info,1,time(),time()]); - $locked_rule_id = md5(uniqid('lockedadmissions',1)); - $locked_insert->execute([$locked_rule_id]); - $cs_r_insert->execute([$locked_set_id,$locked_rule_id,'LockedAdmission']); - - //locked wandeln - $locked_admission = $db->fetchAll("SELECT seminar_id, name, institut_id FROM seminare WHERE admission_type = 3"); - foreach ($locked_admission as $course) { - $s_cs_insert->execute([$locked_set_id, $course['seminar_id']]); - } - - // Lade Daten des aktuellen Semesters. - $semester = Semester::findCurrent(); - $now = time(); - $preserve_waitlists = []; - - //gruppierte wandeln - $grouped_admission = $db->fetchAll("SELECT seminar_id, seminare.name, start_time, duration_time, institut_id, admission_type, admission_starttime, - admission_endtime, admission_endtime_sem, admission_group.name as a_name, admission_group, admission_group.chdate - FROM seminare INNER JOIN admission_group ON group_id = admission_group - WHERE admission_type IN (1, 2) ORDER BY admission_group, admission_starttime, VeranstaltungsNummer"); - foreach ($grouped_admission as $course) { - if ($group_id != $course['admission_group']) { - $group_id = $course['admission_group']; - $group_type = $course['admission_type']; - $group_inst = [$course['institut_id']]; - $group_name = $course['a_name'] ?: ++$g; - - /* - * Check, ob Anmeldeverfahren in der Vergangenheit schon - * abgeschlossen wurde. Hier extra ausführlich, damit es - * verständlich bleibt. - */ - // Veranstaltungen, die (auch implizit) im aktuellen oder kommenden Semestern liegen. - if (($course['start_time'] + $course['duration_time'] >= $semester->beginn || $course['duration_time'] == -1) && - // Checke, ob Warteliste aktiviert, Anmeldezeitraum oder Loszeitpunkt in der Zukunft oder Anmeldezeitraum komplett offen. - ($course['admission_disable_waitlist'] == 0 || $course['admission_starttime'] > $now || $course['admission_endtime'] > $now || - $course['admission_endtime_sem'] > $now || $course['admission_endtime_sem'] == -1)) { - // Erzeuge ein Anmeldeset mit den vorhandenen Einstellungen der Veranstaltung. - $cs = $this->buildCourseset($course, true); - $cs->setName('Beschränkte Teilnehmeranzahl: Gruppe ' . $group_name) - ->setInfoText('Erzeugt durch Migration 128 ' . strftime('%X %x')) - ->addInstitute($course['institut_id'])->setPrivate(true)->setUserId($user_id)->store(); - $set_id = $cs->getId(); - // Losen oder Anmeldezeitraum vorbei => sperren. - // Veranstaltungen in vergangenen Semestern werden einfach gesperrt. - } else { - $group_type = 3; - $rule_id = md5(uniqid('lockedadmissions',1)); - $locked_insert->execute([$rule_id]); - $set_id = md5(uniqid('coursesets',1)); - $name = 'Anmeldung gesperrt: Gruppe ' . $group_name; - $info = 'Erzeugt durch Migration 128 ' . strftime('%X %x'); - $cs_insert->execute([$set_id,$user_id,$name,$info,1,$course['chdate'],$course['chdate']]); - $cs_i_insert->execute([$set_id,$course['institut_id']]); - $cs_r_insert->execute([$set_id,$rule_id,'LockedAdmission']); - } - } - // Veranstaltung mit Losverfahren - if ($group_type == 1) { - // Losliste übernehmen - $db->execute("INSERT INTO priorities (user_id, set_id, seminar_id, priority, mkdate, chdate) - SELECT user_id, ?, seminar_id, 1, mkdate, UNIX_TIMESTAMP() - FROM admission_seminar_user WHERE status = 'claiming' AND seminar_id = ?", [$set_id, $course['seminar_id']]); - // Chronologische Anmeldung - } else if ($group_type == 2) { - $preserve_waitlists[] = $course['seminar_id']; - } - // weitere Einrichtungen zuordnen - if ($group_type != 3 && !in_array($course['institut_id'], $group_inst)) { - $cs_i_insert->execute([$set_id, $course['institut_id']]); - $group_inst[] = $course['institut_id']; - } - $s_cs_insert->execute([$set_id, $course['seminar_id']]); - } - - $admission = $db->fetchAll("SELECT seminar_id, seminare.name, start_time, duration_time, institut_id, admission_type, admission_starttime, admission_endtime, admission_endtime_sem - FROM seminare left join admission_group on(group_id=admission_group) WHERE admission_type in (1, 2) AND group_id is null"); - foreach ($admission as $course) { - /* - * Check, ob Anmeldeverfahren in der Vergangenheit schon - * abgeschlossen wurde. Hier extra ausführlich, damit es - * verständlich bleibt. - */ - // Veranstaltungen, die (auch implizit) im aktuellen oder kommenden Semestern liegen. - if (($course['start_time'] + $course['duration_time'] >= $semester->beginn || $course['duration_time'] == -1) && - // Checke, ob Warteliste aktiviert, Anmeldezeitraum oder Loszeitpunkt in der Zukunft oder Anmeldezeitraum komplett offen. - ($course['admission_disable_waitlist'] == 0 || $course['admission_starttime'] > $now || $course['admission_endtime'] > $now || - $course['admission_endtime_sem'] > $now || $course['admission_endtime_sem'] == -1)) { - // Erzeuge ein Anmeldeset mit den vorhandenen Einstellungen der Veranstaltung. - $cs = $this->buildCourseset($course, false); - $cs->setName('Beschränkte Teilnehmeranzahl: '.$course['name']) - ->setInfoText('Erzeugt durch Migration 128 ' . strftime('%X %x')) - ->setPrivate(true)->setUserId($user_id)->store(); - $set_id = $cs->getId(); - // Veranstaltung mit Losverfahren - if ($course['admission_type'] == 1) { - // Losliste übernehmen - $db->execute("INSERT INTO priorities (user_id, set_id, seminar_id, priority, mkdate, chdate) - SELECT user_id, ?, seminar_id, 1, mkdate, UNIX_TIMESTAMP() - FROM admission_seminar_user WHERE status = 'claiming' AND seminar_id = ?", [$set_id, $course['seminar_id']]); - // Chronologische Anmeldung - } else { - $preserve_waitlists[] = $course['seminar_id']; - } - // Losen oder Anmeldezeitraum vorbei => sperren. - // Veranstaltungen in vergangenen Semestern werden einfach gesperrt. - } else { - $set_id = $locked_set_id; - } - $s_cs_insert->execute([$set_id, $course['seminar_id']]); - } - - $db->exec("UPDATE seminare SET Lesezugriff=1,Schreibzugriff=1 WHERE Lesezugriff=3"); - $db->exec("UPDATE seminare SET Lesezugriff=1,Schreibzugriff=1 WHERE Lesezugriff=2"); - - // Übernehme Veranstaltungen ohne Anmeldeverfahren, aber mit Anmeldezeitraum in der Zukunft. - $now = time(); - $admission = $db->fetchAll("SELECT `seminar_id`,`seminare`.`name`,`institut_id`,`admission_starttime`,`admission_endtime_sem` - FROM `seminare` WHERE `admission_type`=0 AND (`admission_starttime`>:now OR `admission_endtime_sem`>:now)", ['now' => $now]); - foreach ($admission as $course) { - // Erzeuge ein Anmeldeset mit den vorhandenen Einstellungen der Veranstaltung. - $cs = new CourseSet(); - $rule = new TimedAdmission(); - if ($course['admission_starttime'] != -1) { - $rule->setStartTime($course['admission_starttime']); - } - if ($course['admission_endtime_sem'] != -1) { - $rule->setEndTime($course['admission_endtime_sem']); - } - $cs->setName('Anmeldezeitraum: '.$course['name']) - ->setInfoText('Erzeugt durch Migration 128 ' . strftime('%X %x')) - ->addCourse($course['seminar_id'])->addAdmissionRule($rule)->setPrivate(true)->setUserId($user_id)->store(); - } - - //Warte und Anmeldelisten löschen - $db->exec("DELETE FROM admission_seminar_user WHERE status = 'claiming'"); - $db->execute("DELETE FROM admission_seminar_user WHERE status = 'awaiting' AND seminar_id NOT IN(?)", [$preserve_waitlists]); - - $db->exec("DROP TABLE admission_seminar_studiengang"); - $db->exec("DROP TABLE admission_group"); - $db->exec("ALTER TABLE `seminare` DROP `Passwort`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_endtime`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_type`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_selection_take_place`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_group`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_starttime`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_endtime_sem`"); - $db->exec("ALTER TABLE `seminare` DROP `admission_enable_quota`"); - - $db->exec("ALTER TABLE `seminare` ADD `admission_waitlist_max` INT UNSIGNED NOT NULL DEFAULT '0'"); - $db->exec("ALTER TABLE `seminare` ADD `admission_disable_waitlist_move` TINYINT UNSIGNED NOT NULL DEFAULT '0'"); - - $db->exec("ALTER TABLE `seminar_user` DROP `admission_studiengang_id`"); - $db->exec("ALTER TABLE `admission_seminar_user` DROP `studiengang_id`"); - try { - $db->exec("ALTER TABLE `seminar_user` DROP INDEX `Seminar_id`"); - $db->exec("ALTER TABLE `seminar_user` DROP INDEX `user_id`"); - } catch (PDOException $e) { - } - $db->exec("ALTER TABLE `seminar_user` ADD INDEX (`user_id`, `Seminar_id`, `status`)"); - - // Insert global configuration: who may edit course sets? - $db->exec("INSERT IGNORE INTO `config` - (`config_id`, `parent_id`, `field`, `value`, `is_default`, - `type`, `range`, `section`, `position`, `mkdate`, `chdate`, - `description`, `comment`, `message_template`) - VALUES - (MD5('ALLOW_DOZENT_COURSESET_ADMIN'), '', - 'ALLOW_DOZENT_COURSESET_ADMIN', '0', '1', 'boolean', 'global', - 'coursesets', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'Sollen Lehrende einrichtungsweite Anmeldesets anlegen und bearbeiten dürfen?', - '', '')"); - // Insert global configuration: who may edit course sets? - $db->exec("INSERT IGNORE INTO `config` - (`config_id`, `parent_id`, `field`, `value`, `is_default`, - `type`, `range`, `section`, `position`, `mkdate`, `chdate`, - `description`, `comment`, `message_template`) - VALUES - (MD5('ENABLE_COURSESET_FCFS'), '', - 'ENABLE_COURSESET_FCFS', '0', '1', 'boolean', 'global', - 'coursesets', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'Soll first-come-first-served (Windhundverfahren) bei der Anmeldung erlaubt sein?', - '', '')"); - } - - public function down() - { - $db = DBManager::get(); - // delete all tables related with new admission structure - $db->exec("DROP TABLE `admission_condition`, `admissionfactor`, - `admissionrules`, `conditionaladmissions`, `courseset_factorlist`, - `courseset_rule`, `coursesets`, `limitedadmissions`, - `lockedadmissions`, `priorities`, `seminar_courseset`, - `timedadmissions`, `userfilter_fields`, `userfilter`, - `user_factorlist`, `userlimits`"); - } - - function buildCourseset($course, $grouped) - { - $db = DBManager::get(); - - $cs = new CourseSet(); - $rule = new ParticipantRestrictedAdmission(); - // Loszeitpunkt übernehmen. - $rule->setDistributionTime($course['admission_type'] == 1 ? $course['admission_endtime'] : 0); - $cs->addAdmissionRule($rule); - // Beschränkung 1 aus n, falls erforderlich - if ($grouped) { - $rule = new LimitedAdmission(); - $rule->setMaxNumber(1); - $cs->addAdmissionRule($rule); - } - // Falls Anmeldezeitraum eingestellt, diesen übernehmen. - if ($course['admission_starttime'] != -1 || $course['admission_endtime_sem'] != -1) { - $rule = new TimedAdmission(); - if ($course['admission_starttime'] != -1) { - $rule->setStartTime($course['admission_starttime']); - } - if ($course['admission_endtime_sem'] != -1) { - $rule->setEndTime($course['admission_endtime_sem']); - } - $cs->addAdmissionRule($rule); - } - // Studiengänge eintragen - $stmt = $db->prepare('SELECT studiengang_id FROM admission_seminar_studiengang WHERE seminar_id = ?'); - $stmt->execute([$course['seminar_id']]); - $subjects = $stmt->fetchAll(PDO::FETCH_COLUMN); - if (!in_array('all', $subjects) && $subjects) { - $rule = new ConditionalAdmission(); - foreach ($subjects as $subject) { - $condition = new UserFilter(); - $subject_field = new SubjectCondition(); - $subject_field->setCompareOperator('='); - $subject_field->setValue($subject); - $condition->addField($subject_field); - $rule->addCondition($condition); - } - $cs->addAdmissionRule($rule); - } - return $cs; - } -} diff --git a/db/migrations/129_wysiwyg_config_option.php b/db/migrations/129_wysiwyg_config_option.php deleted file mode 100644 index f7b933a..0000000 --- a/db/migrations/129_wysiwyg_config_option.php +++ /dev/null @@ -1,24 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) - VALUES - ('e8cd96580149cde65ad69b6cf18d5c4A', 'WYSIWYG', '0', 1, 'boolean', 'global', 'global', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Aktiviert den WYSIWYG Editor im JavaScript.', '') - "); - } - - function down() - { - } -} diff --git a/db/migrations/12_step_120_userpic.php b/db/migrations/12_step_120_userpic.php deleted file mode 100644 index f907b9f..0000000 --- a/db/migrations/12_step_120_userpic.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Copyright (C) 2008 - Marcus Lunzenauer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - */ - -require_once 'lib/classes/Avatar.class.php'; - -class Step120Userpic extends Migration { - - function description() { - return 'modify existing user pictures according to Step00120'; - } - - function up() { - foreach (glob($GLOBALS['DYNAMIC_CONTENT_PATH'].'/user/*.jpg') as $value) { - if (preg_match('/\/([0-9a-f]+).jpg$/', $value, $matches)) { - try { - Avatar::getAvatar($matches[1])->createFrom($value); - } catch (Exception $e) { - $this->announce('Exception while converting avatar "%s"', $value); - $this->write($e->getMessage()."\n"); - } - @unlink($value); - } - } - } - - function down() { - } -} diff --git a/db/migrations/130_step_00267_preliminary_accounts.php b/db/migrations/130_step_00267_preliminary_accounts.php deleted file mode 100644 index 13b2af9..0000000 --- a/db/migrations/130_step_00267_preliminary_accounts.php +++ /dev/null @@ -1,15 +0,0 @@ -exec("UPDATE auth_user_md5 SET auth_plugin='standard' WHERE auth_plugin IS NULL"); - DBManager::get()->exec("ALTER TABLE `auth_user_md5` CHANGE `auth_plugin` `auth_plugin` VARCHAR(64) NULL DEFAULT 'standard'"); - } -} diff --git a/db/migrations/131_score_config_option.php b/db/migrations/131_score_config_option.php deleted file mode 100644 index 9da9fab..0000000 --- a/db/migrations/131_score_config_option.php +++ /dev/null @@ -1,21 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) - VALUES - ('e6b6b8be6caf8abf0904c29e30e9b129', 'SCORE_ENABLE', '1', 1, 'boolean', 'global', 'modules', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Schaltet ein oder aus, ob die Rangliste und die Score-Funktion global verfügbar sind.', '') - "); - } - -} diff --git a/db/migrations/132_step_00268_event_log.php b/db/migrations/132_step_00268_event_log.php deleted file mode 100644 index 99b2ec6..0000000 --- a/db/migrations/132_step_00268_event_log.php +++ /dev/null @@ -1,30 +0,0 @@ -exec("ALTER TABLE `log_actions` ADD `filename` - VARCHAR( 255 ) NULL DEFAULT NULL , - ADD `class` VARCHAR( 255 ) NULL DEFAULT NULL"); - DBManager::get()->exec("ALTER TABLE `log_actions` ADD `type` - ENUM( 'core', 'plugin', 'file' ) NULL DEFAULT NULL"); - } - - /** - * revert this migration - */ - function down() { - DBManager::get()->exec("ALTER TABLE `log_actions` - DROP `filename`, DROP `class`, DROP `type`"); - } - -} \ No newline at end of file diff --git a/db/migrations/133_tic_4072_new_password_hashing.php b/db/migrations/133_tic_4072_new_password_hashing.php deleted file mode 100644 index cc29b8c..0000000 --- a/db/migrations/133_tic_4072_new_password_hashing.php +++ /dev/null @@ -1,26 +0,0 @@ -exec("ALTER TABLE `auth_user_md5` CHANGE `password` `password` VARBINARY( 64 ) NOT NULL DEFAULT ''"); - $hasher = UserManagement::getPwdHasher(); - $pwd_up = $db->prepare("UPDATE auth_user_md5 SET password=? WHERE user_id=?"); - foreach($db->query("SELECT user_id,password FROM auth_user_md5 WHERE auth_plugin='standard' AND password <> ''") as $row) { - $new_pwd = $hasher->HashPassword($row['password']); - $pwd_up->execute([$new_pwd, $row['user_id']]); - } - } - - public function down() - { - $db = DBManager::get(); - $db->exec("ALTER TABLE `auth_user_md5` CHANGE `password` `password` VARCHAR( 32 ) NOT NULL DEFAULT ''"); - } -} diff --git a/db/migrations/134_step_00269_plugin_roles.php b/db/migrations/134_step_00269_plugin_roles.php deleted file mode 100644 index 1fc1c40..0000000 --- a/db/migrations/134_step_00269_plugin_roles.php +++ /dev/null @@ -1,21 +0,0 @@ -exec("ALTER TABLE `roles_user` ADD `institut_id` CHAR(32) NOT NULL DEFAULT ''"); - DBManager::get()->exec("ALTER TABLE `roles_user` DROP PRIMARY KEY"); - DBManager::get()->exec("ALTER TABLE `roles_user` ADD PRIMARY KEY( `roleid`, `userid`, `institut_id`)"); - } - - function down() - { - DBManager::get()->exec("ALTER TABLE `roles_user` DROP `institut_id`"); - } -} diff --git a/db/migrations/135_tic_4011_remove_teilnehmer_view.php b/db/migrations/135_tic_4011_remove_teilnehmer_view.php deleted file mode 100644 index bbf6b29..0000000 --- a/db/migrations/135_tic_4011_remove_teilnehmer_view.php +++ /dev/null @@ -1,19 +0,0 @@ -exec("DROP TABLE `teilnehmer_view`"); - } - - function down() - { - ; - } -} diff --git a/db/migrations/136_wiki_remove_camel_case.php b/db/migrations/136_wiki_remove_camel_case.php deleted file mode 100644 index 6ea75c0..0000000 --- a/db/migrations/136_wiki_remove_camel_case.php +++ /dev/null @@ -1,67 +0,0 @@ - - */ - -class WikiRemoveCamelCase extends Migration -{ - function description() { - return 'Enclose camel-case wiki links in double square brackets.'; - } - - function fixWikiLinks($body) { - // $camel_case = wiki-links-short in WikiFormat.php before migration - $camel_case = '\b(' - . '(?:[A-ZÄÖÜ]|&[AOU]uml;)' // upper-case letter - . '(?:[a-z\däöüß]|&[aou]uml;|ß)+' // lower-case letter, or digit - . '(?:[A-ZÄÖÜ]|&[AOU]uml;)' - . '(?:[\w\däöüß]|&[aou]uml;|ß)*' // underscore, digit, lower-case letter - . ')'; - $open_tag = '(?:\[\[)'; - $close_tag = '(?:(?:\|(?:.*?))?\]\])'; // with optional |text]] - $wiki_link = "/($open_tag)?$camel_case($close_tag)?/"; - return preg_replace_callback($wiki_link, function($m) use ($open_tag, $close_tag) { - $has_open = preg_match('/' . $open_tag . '/', $m[1]); - $has_close = preg_match('/' . $close_tag . '/', $m[3]); - $is_enclosed = $has_open && $has_close; - return $is_enclosed ? $m[0] : $m[1] . '[[' . $m[2] . ']]' . $m[3]; - }, $body); - } - - function up() { - // fetch all wiki versions - $stmt = DBManager::get()->prepare('SELECT * FROM wiki'); - $stmt->execute(); - while ($wiki_page = $stmt->fetch(PDO::FETCH_ASSOC)) { - DBManager::get()->prepare( - 'UPDATE wiki SET body=?' - . ' WHERE range_id=? AND keyword=? AND version=?' - )->execute([ - $this->fixWikiLinks($wiki_page['body']), - $wiki_page['range_id'], - $wiki_page['keyword'], - $wiki_page['version'] - ]); - } - } - - function down() { - } -} diff --git a/db/migrations/137_studygroup_invitations.php b/db/migrations/137_studygroup_invitations.php deleted file mode 100644 index 5d66d3f..0000000 --- a/db/migrations/137_studygroup_invitations.php +++ /dev/null @@ -1,24 +0,0 @@ -exec($query); - } - - function down() - { - DBManager::get()->exec("DROP TABLE IF EXISTS `studygroup_invitations`"); - } -} diff --git a/db/migrations/138_create_tags_for_messaging.php b/db/migrations/138_create_tags_for_messaging.php deleted file mode 100644 index ca51636..0000000 --- a/db/migrations/138_create_tags_for_messaging.php +++ /dev/null @@ -1,73 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `message_tags` ( - `message_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `tag` varchar(64) NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`message_id`,`user_id`,`tag`) - ) ENGINE=MyISAM - "); - - $old_config = DBManager::get()->prepare(" - SELECT user_id, value FROM user_config WHERE field = 'MESSAGING_SETTINGS' - "); - $old_config->execute(); - while ($result = $old_config->fetch(PDO::FETCH_ASSOC)) { - $config = json_decode($result['value'], true); - - //Erstelle alle Tags und verknüpfe sie mit den Nachrichten: - $statement = DBManager::get()->prepare(" - INSERT IGNORE INTO message_tags (message_id, user_id, tag) - SELECT message_user.message_id, message_user.user_id, :tag - FROM message_user - WHERE message_user.user_id = :user_id - AND message_user.folder = :folder_id - AND message_user.snd_rec = :snd_rec - "); - foreach ((array) $config['folder']['in'] as $folder_id => $tag) { - if ($tag !== "dummy") { - $statement->execute([ - 'tag' => $tag, - 'user_id' => $result['user_id'], - 'folder_id' => $folder_id + 1, - 'snd_rec' => "rec" - ]); - } - } - foreach ((array) $config['folder']['out'] as $folder_id => $tag) { - if ($tag !== "dummy") { - $statement->execute([ - 'tag' => $tag, - 'user_id' => $result['user_id'], - 'folder_id' => $folder_id + 1, - 'snd_rec' => "snd" - ]); - } - } - } - - DBManager::get()->exec(" - ALTER TABLE `message_user` DROP `folder` - "); - DBManager::get()->exec(" - ALTER TABLE `message` DROP `reading_confirmation`; - "); - } - - public function down() - { - $query = "DROP TABLE `message_tags`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/139_step00272_tours.php b/db/migrations/139_step00272_tours.php deleted file mode 100644 index f6c82bb..0000000 --- a/db/migrations/139_step00272_tours.php +++ /dev/null @@ -1,80 +0,0 @@ -create('TOURS_ENABLE', [ - 'value' => 1, - 'is_default' => 1, - 'type' => 'boolean', - 'range' => 'global', - 'section' => 'global', - 'description' => _('Aktiviert die Funktionen zum Anbieten von Touren in Stud.IP') - ]); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tours` ( - `tour_id` char(32) NOT NULL, - `name` varchar(255) NOT NULL, - `description` text NOT NULL, - `type` enum('tour','wizard') NOT NULL, - `roles` varchar(255) NOT NULL, - `version` int(11) unsigned NOT NULL DEFAULT '1', - `language` char(2) NOT NULL DEFAULT 'de', - `studip_version` varchar(32) NOT NULL DEFAULT '', - `installation_id` varchar(255) NOT NULL DEFAULT 'demo-installation', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`tour_id`) - ) ENGINE=MyISAM;"); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_audiences` ( - `tour_id` char(32) NOT NULL, - `range_id` char(32) NOT NULL, - `type` enum('inst','sem','studiengang','abschluss','userdomain','tour') NOT NULL, - PRIMARY KEY (`tour_id`,`range_id`,`type`) - ) ENGINE=MyISAM;"); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_settings` ( - `tour_id` varchar(32) NOT NULL, - `active` tinyint(4) NOT NULL, - `access` enum('standard','link','autostart','autostart_once') DEFAULT NULL, - PRIMARY KEY (`tour_id`) - ) ENGINE=MyISAM;"); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_steps` ( - `tour_id` char(32) NOT NULL DEFAULT '', - `step` tinyint(4) NOT NULL DEFAULT '1', - `title` varchar(255) NOT NULL DEFAULT '', - `tip` text NOT NULL, - `orientation` enum('T','TL','TR','L','LT','LB','B','BL','BR','R','RT','RB') NOT NULL DEFAULT 'B', - `interactive` tinyint(4) NOT NULL, - `css_selector` varchar(255) NOT NULL, - `route` varchar(255) NOT NULL DEFAULT '', - `author_id` char(32) NOT NULL DEFAULT '', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`tour_id`,`step`) - ) ENGINE=MyISAM;"); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_tour_user` ( - `tour_id` varchar(32) COLLATE latin1_german1_ci NOT NULL, - `user_id` varchar(32) COLLATE latin1_german1_ci NOT NULL, - `step_nr` int(11) NOT NULL, - `completed` tinyint(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`tour_id`,`user_id`) - ) ENGINE=MyISAM;"); - } - - /** - * revert this migration - */ - function down() - { - Config::get()->delete('TOURS_ENABLE'); - } -} diff --git a/db/migrations/13_remove_fields_from_extermine.php b/db/migrations/13_remove_fields_from_extermine.php deleted file mode 100644 index b357498..0000000 --- a/db/migrations/13_remove_fields_from_extermine.php +++ /dev/null @@ -1,23 +0,0 @@ -announce(" removing fields..."); - - DBManager::get()->exec("ALTER TABLE `ex_termine` DROP `expire`, DROP `repeat`, DROP `color`, DROP `priority`"); - - $this->announce("done."); - - } - - public function down () - { - $this->announce("done."); - } -} diff --git a/db/migrations/140_tic4450_archiv_protected_files.php b/db/migrations/140_tic4450_archiv_protected_files.php deleted file mode 100644 index 47fc905..0000000 --- a/db/migrations/140_tic4450_archiv_protected_files.php +++ /dev/null @@ -1,20 +0,0 @@ -exec($query); - } - - function down() - { - DBManager::get()->exec("ALTER TABLE `archiv` DROP `archiv_protected_file_id`"); - } -} diff --git a/db/migrations/141_tic4454_roomrequest_options.php b/db/migrations/141_tic4454_roomrequest_options.php deleted file mode 100644 index 7c56916..0000000 --- a/db/migrations/141_tic4454_roomrequest_options.php +++ /dev/null @@ -1,28 +0,0 @@ -exec("ALTER TABLE `resources_requests` ADD `last_modified_by` VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `user_id`"); - $db->exec("ALTER TABLE `resources_requests` ADD `reply_recipients` ENUM( 'requester', 'lecturer' ) NOT NULL DEFAULT 'requester' AFTER `reply_comment`"); - $db->exec("CREATE TABLE IF NOT EXISTS `resources_requests_user_status` ( - `request_id` char(32) NOT NULL DEFAULT '', - `user_id` char(32) NOT NULL DEFAULT '', - `mkdate` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`request_id`,`user_id`) - ) ENGINE=MyISAM"); - } - - function down() - { - DBManager::get()->exec("ALTER TABLE `resources_requests` DROP `last_modified_by`"); - DBManager::get()->exec("ALTER TABLE `resources_requests` DROP `reply_recipients`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `resources_requests_user_status`"); - } -} diff --git a/db/migrations/142_tic4463_remove_stm.php b/db/migrations/142_tic4463_remove_stm.php deleted file mode 100644 index 1241988..0000000 --- a/db/migrations/142_tic4463_remove_stm.php +++ /dev/null @@ -1,30 +0,0 @@ -exec("DROP TABLE IF EXISTS `his_abschl`, `his_abstgv`, `his_pvers`, `his_stg`, - `stm_abstract`, `stm_abstract_assign`, `stm_abstract_elements`, - `stm_abstract_text`, `stm_abstract_types`, `stm_element_types`, - `stm_instances`, `stm_instances_elements`, `stm_instances_text`"); - $db->exec("DELETE FROM config WHERE field = 'STM_ENABLE'"); - } - - function down() - { - /* - Pleased to meet you, take my hand - There is no way back from hell - Pleased to meet you, say your prayers - There is no way back from hell - But I don't care - No way back from hell ... YEAH! - */ - } -} diff --git a/db/migrations/143_step00249_my_courses_config.php b/db/migrations/143_step00249_my_courses_config.php deleted file mode 100644 index 00eb30f..0000000 --- a/db/migrations/143_step00249_my_courses_config.php +++ /dev/null @@ -1,34 +0,0 @@ -exec(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) - VALUES - (md5('MY_COURSES_ENABLE_STUDYGROUPS'), 'MY_COURSES_ENABLE_STUDYGROUPS', 0, 0, 'boolean', 'global', 'MeineVeranstaltungen', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Sollen Studiengruppen in einem eigenen Bereich angezeigt werden (Neues Navigationelement in Meine Veranstaltungen)?.', '') - "); - - DBManager::get()->exec(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) - VALUES - (md5('MY_COURSES_ENABLE_ALL_SEMESTERS'), 'MY_COURSES_ENABLE_ALL_SEMESTERS', 0, 0, 'boolean', 'global', 'MeineVeranstaltungen', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Ermöglicht die Anzeige von allen Semestern unter meine Veranstaltungen.', '') - "); - - DBManager::get()->exec("UPDATE config SET value = 'sem_number' WHERE field = 'MY_COURSES_FORCE_GROUPING'"); - } - - function down() - { - } -} diff --git a/db/migrations/144_files.php b/db/migrations/144_files.php deleted file mode 100644 index 4ef726f..0000000 --- a/db/migrations/144_files.php +++ /dev/null @@ -1,213 +0,0 @@ - - * @author Stefan Osterloh - * @author Gerd Hoffmann - * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 or later - */ - - -class files extends Migration -{ - public function description() - { - return 'Setup db for personal file space'; - } - - public function up() - { - // Create directory - if (empty($GLOBALS['USER_DOC_PATH'])) { - throw new Exception('Config variable "USER_DOC_PATH" has not been set in file "config/config_local.inc.php". ' - .'If you are upgrading to a newer release, please refer to the file "config/config_local.inc.php.dist" ' - .'or just set it to default value of "$USER_DOC_PATH = $STUDIP_BASE_PATH . \'/data/user_doc\';".'); - } - - if (!file_exists($GLOBALS['USER_DOC_PATH'])) { - $result = mkdir($GLOBALS['USER_DOC_PATH'], 0755, true); - if ($result === false) { - throw new Exception('Could not create user file path. Please check the config variable "USER_DOC_PATH" ' - .'in file "config/config_local.inc.php".'); - } - } - - /* - * Migration for API in lib/files - */ - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files - (file_id CHAR(32) NOT NULL, - user_id CHAR(32) NOT NULL, - filename VARCHAR(255) NOT NULL, - mime_type VARCHAR(64) NOT NULL, - size BIGINT UNSIGNED NOT NULL, - restricted TINYINT(1) NOT NULL DEFAULT 0, - storage VARCHAR(32) NOT NULL DEFAULT 'DiskFileStorage', - storage_id VARCHAR(32) NOT NULL, - mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - chdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - PRIMARY KEY (file_id)) ENGINE=MyISAM"); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS file_refs - (id CHAR(32) NOT NULL, - file_id CHAR(32) NOT NULL, - parent_id CHAR(32) NOT NULL, - name VARCHAR(255) NOT NULL, - description TEXT NOT NULL, - downloads INT NOT NULL DEFAULT 0, - PRIMARY KEY (id)) ENGINE=MyISAM"); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files_backend_studip - (id INT UNSIGNED NOT NULL, - files_id VARCHAR(64) NOT NULL, - path VARCHAR(256) NOT NULL, - PRIMARY KEY (id)) ENGINE=MyISAM"); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files_backend_url - (id INT UNSIGNED NOT NULL, - files_id VARCHAR(64) NOT NULL, - url VARCHAR(256) NOT NULL, - PRIMARY KEY (id)) ENGINE=MyISAM"); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS files_share - (files_id VARCHAR(64) NOT NULL, - entity_id VARCHAR(32) NOT NULL, - description MEDIUMTEXT NULL, - read_perm BOOLEAN DEFAULT FALSE, - write_perm BOOLEAN DEFAULT FALSE, - start_date INT UNSIGNED NOT NULL, - end_date INT UNSIGNED NOT NULL, - PRIMARY KEY (files_id, entity_id)) ENGINE=MyISAM"); - - /* - * Migration for the Admin-Area - */ - DBManager::get()->query("CREATE TABLE IF NOT EXISTS `doc_filetype` - (`id` INT NOT NULL AUTO_INCREMENT , - `type` VARCHAR(45) NOT NULL , - `description` TEXT NULL , - PRIMARY KEY (`id`)) ENGINE=MyISAM" - ); - - DBManager::get()->query("CREATE TABLE IF NOT EXISTS `doc_usergroup_config` - (`id` INT NOT NULL AUTO_INCREMENT , - `usergroup` VARCHAR(45) NOT NULL , - `upload_quota` TEXT NOT NULL , - `upload_unit` VARCHAR(45) NULL , - `quota` TEXT NULL , - `quota_unit` VARCHAR(45) NULL , - `upload_forbidden` INT NOT NULL DEFAULT 0 , - `area_close` INT NOT NULL DEFAULT 0 , - `area_close_text` TEXT NULL , - `is_group_config` INT NOT NULL DEFAULT 0 , - PRIMARY KEY (`id`, `usergroup`)) ENGINE=MyISAM" - ); - - DBManager::get()->query("CREATE TABLE IF NOT EXISTS `doc_filetype_forbidden` - (`id` INT NOT NULL AUTO_INCREMENT , - `usergroup` VARCHAR(45) NOT NULL , - `dateityp_id` INT NOT NULL , - PRIMARY KEY (`id`) , - INDEX `fk_dateityp_verbot_nutzerbereich_2_idx` (`dateityp_id` ASC) , - INDEX `fk_dateityp_verbot_nutzerbereich_1_idx` (`usergroup` ASC)) ENGINE=MyISAM" - ); - - /* - * Set the entry into the table "config" to enable or disable the Personal Document Area - */ - $query = "INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description`) - VALUES (:id, :field, :value, 1, :type, 'global', 'files', UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), :description)"; - $statement = DBManager::get()->prepare($query); - $statement->execute([ - ':id' => md5(uniqid('PERSONALDOCUMENT_ENABLE')), - ':field' => 'PERSONALDOCUMENT_ENABLE', - ':value' => (int) false, - ':type' => 'boolean', - ':description' => 'Aktiviert den persoenlichen Dateibereich', - ]); - - $query = "INSERT IGNORE INTO `doc_usergroup_config` - (`id`, `usergroup`, `upload_quota`, `upload_unit`, - `quota`, `quota_unit`, `is_group_config`) - VALUES (:id, :group, :uploadQuota, :uploadUnit, :quota, - :quotaUnit, :isGroupConfig)"; - - $statement = DBManager::get()->prepare($query); - $statement->execute([ - ':id' => '1', - ':group' => 'default', - ':uploadQuota' => '5242880', - ':uploadUnit' => 'MB', - ':quota' => '52428800', - ':quotaUnit' => 'MB', - ':isGroupConfig' => '1' - ]); - - $query = "INSERT IGNORE INTO `doc_filetype` (`type`) VALUES (:type)"; - - $statement = DBManager::get()->prepare($query); - foreach (words('exe com pif bat scr') as $value) { - $statement->execute([ - ':type' => $value - ]); - } - } - - public function down() - { - // Remove user directories - $this->rm_rf($GLOBALS['USER_DOC_PATH']); - - // Remove db tables - DBManager::get()->exec("DROP TABLE IF EXISTS - `files`, - `files_layout`, - `files_backend_studip`, - `files_backend_url`, - `files_share`, - `doc_usergroup_config`, - `doc_filetype`, - `doc_filetype_forbidden` - "); - - // Remove config entry - DBManager::get()->query("DELETE FROM config WHERE field IN ('PERSONALDOCUMENT_ENABLE')"); - } - - protected function rm_rf($path) - { - $files = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); - foreach ($files as $file) { - if (is_dir($file)) { - $this->rm_rf($file); - } else { - unlink($file); - } - } - rmdir($path); - } - } diff --git a/db/migrations/145_tic4491_help_content.php b/db/migrations/145_tic4491_help_content.php deleted file mode 100644 index 0ffcab6..0000000 --- a/db/migrations/145_tic4491_help_content.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 or later - */ - - -class Tic4491HelpContent extends Migration -{ - public function description() - { - return 'Setup db table for helpbar texts'; - } - - public function up() - { - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `help_content` ( - `content_id` char(32) NOT NULL, - `language` char(2) NOT NULL DEFAULT 'de', - `label` varchar(255) NOT NULL, - `icon` varchar(255) NOT NULL, - `content` text NOT NULL, - `route` varchar(255) NOT NULL, - `studip_version` varchar(32) NOT NULL, - `position` tinyint(4) NOT NULL DEFAULT '1', - `custom` tinyint(4) NOT NULL DEFAULT '0', - `visible` tinyint(4) NOT NULL DEFAULT '1', - `author_id` char(32) NOT NULL DEFAULT '', - `installation_id` varchar(255) NOT NULL, - `mkdate` int(11) unsigned NOT NULL, - PRIMARY KEY (`route`,`studip_version`,`language`,`position`,`custom`) - ) ENGINE=MyISAM;"); - } - - public function down() - { - // Remove db tables - DBManager::get()->exec("DROP TABLE IF EXISTS `help_content`;"); - } - } diff --git a/db/migrations/146_step_00253_startseite.php b/db/migrations/146_step_00253_startseite.php deleted file mode 100644 index f02f5c6..0000000 --- a/db/migrations/146_step_00253_startseite.php +++ /dev/null @@ -1,107 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `widget_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `pluginid` int(11) NOT NULL, - `position` int(11) NOT NULL DEFAULT 0, - `range_id` varchar(32) NOT NULL, - `col` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY (`range_id`) - ) ENGINE=MyISAM - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `widget_default` ( - `pluginid` int(11) NOT NULL, - `col` tinyint(1) NOT NULL DEFAULT 0, - `position` tinyint(1) NOT NULL DEFAULT 0, - `perm` enum('user', 'autor', 'tutor', 'dozent', 'admin', 'root') NOT NULL DEFAULT 'autor', - PRIMARY KEY (`perm`,`pluginid`) - ) ENGINE=MyISAM - "); - - // take care of the widgets - foreach (words('EvaluationsWidget NewsWidget QuickSelection ScheduleWidget TerminWidget') as $classname) { - self::addWidget($classname); - } - - // add a default configuration for each - self::addWidgetDefaulConfiguration(words('QuickSelection NewsWidget TerminWidget EvaluationsWidget')); - - - } - - function down() - { - // take care of the widgets - foreach (words('EvaluationsWidget NewsWidget QuickSelection ScheduleWidget TerminWidget') as $classname) { - self::removeWidget($classname); - } - - DBManager::get()->exec("DROP TABLE IF EXISTS `widget_user`,`widget_default`"); - } - - private function addWidget($classname) { - // get highest position - $navpos = DBManager::get()->query("SELECT navigationpos FROM plugins - ORDER BY navigationpos DESC")->fetchColumn() + 1; - - // insert plugin into db - $stmt = DBManager::get()->prepare("INSERT INTO plugins - (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) - VALUES (?, ?, ?, 'PortalPlugin', 'yes', ?)"); - $stmt->execute([$classname, 'core/'.$classname, $classname, $navpos]); - - // get id of newly created plugin (we purposely do not use PDO::lastInserId()) - $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins - WHERE pluginclassname = '$classname'")->fetchColumn(); - - // set all default roles for the plugin - $stmt = DBManager::get()->prepare("INSERT INTO roles_plugins - (roleid, pluginid) VALUES (?, ?)"); - foreach (range(1, 6) as $role_id) { - $stmt->execute([$role_id, $plugin_id]); - } - } - - private function addWidgetDefaulConfiguration($classnames) { - foreach($classnames as $key => $classname) { - $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins - WHERE pluginclassname = '$classname'")->fetchColumn(); - $stmt = DBManager::get()->prepare("INSERT INTO widget_default - (`pluginid`, `col`, `position`, `perm`) VALUES (?, ?, ?, ?)"); - foreach (words("user autor tutor dozent admin root") as $perm) { - $stmt->execute([$plugin_id, 0, $key, $perm]); - } - } - } - - private function removeWidget($classname) { - // get id of widget - $widget_id = DBManager::get()->query("SELECT pluginid FROM plugins - WHERE pluginclassname = '$classname'")->fetchColumn(); - - $stmt = DBManager::get()->prepare("DELETE FROM plugins WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $stmt = DBManager::get()->prepare("DELETE FROM widget_default WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $stmt = DBManager::get()->prepare("DELETE FROM widget_user WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $stmt = DBManager::get()->prepare("DELETE FROM roles_plugins WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - } -} diff --git a/db/migrations/148_tic_4520_sem_tree_display.php b/db/migrations/148_tic_4520_sem_tree_display.php deleted file mode 100644 index 1468f30..0000000 --- a/db/migrations/148_tic_4520_sem_tree_display.php +++ /dev/null @@ -1,44 +0,0 @@ -create('COURSE_SEM_TREE_DISPLAY', [ - 'value' => 0, - 'is_default' => 0, - 'type' => 'boolean', - 'range' => 'global', - 'section' => 'global', - 'description' => _('Zeigt den Studienbereichsbaum als Baum an') - ]); - Config::get()->create('COURSE_SEM_TREE_CLOSED_LEVELS', [ - 'value' => '[1]', - 'is_default' => '[1]', - 'type' => 'array', - 'range' => 'global', - 'section' => 'global', - 'description' => _('Gibt an, welche Ebenen der Studienbereichszuordnung geschlossen bleiben sollen') - ]); - } - - function down() { - Config::get()->delete('COURSE_SEM_TREE_DISPLAY'); - Config::get()->delete('COURSE_SEM_TREE_CLOSED_LEVELS'); - } - -} diff --git a/db/migrations/14_step_00123_admission2.php b/db/migrations/14_step_00123_admission2.php deleted file mode 100644 index c7410b4..0000000 --- a/db/migrations/14_step_00123_admission2.php +++ /dev/null @@ -1,30 +0,0 @@ -announce(" modifying table `seminare` adding field `admission_enable_quota`..."); - - DBManager::get()->exec( "ALTER TABLE `seminare` ADD `admission_enable_quota` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `admission_disable_waitlist`"); - - $this->announce(" update old entries..."); - - DBManager::get()->exec("UPDATE `seminare` SET `admission_enable_quota` =1 WHERE admission_type IN ( 1, 2 )"); - - $this->announce("done."); - } - - public function down () - { - $this->announce(" removing field `admission_enable_quota` from `seminare`..."); - - DBManager::get()->exec("ALTER TABLE `seminare` DROP `admission_enable_quota` "); - - $this->announce("done."); - } -} diff --git a/db/migrations/150_help_tours_and_content.php b/db/migrations/150_help_tours_and_content.php deleted file mode 100644 index bb33622..0000000 --- a/db/migrations/150_help_tours_and_content.php +++ /dev/null @@ -1,385 +0,0 @@ -addHelpTours(); - $this->addHelpContent(); - $this->addHelpContentEN(); - - // set version in config - $version = '3.1'; - // see migrate_help_content.php - if (!Config::get()->getValue('HELP_CONTENT_CURRENT_VERSION')) { - Config::get()->create('HELP_CONTENT_CURRENT_VERSION', [ - 'value' => $version, - 'is_default' => 0, - 'type' => 'string', - 'range' => 'global', - 'section' => 'global', - 'description' => _('Aktuelle Version der Helpbar-Einträge in Stud.IP') - ]); - } else { - Config::get()->store('HELP_CONTENT_CURRENT_VERSION', $version); - } - } - - function down() - { - DBManager::get()->exec("TRUNCATE TABLE `help_content`"); - DBManager::get()->exec("TRUNCATE TABLE `help_tours`"); - DBManager::get()->exec("TRUNCATE TABLE `help_tour_settings`"); - DBManager::get()->exec("TRUNCATE TABLE `help_tour_steps`"); - } - - function addHelpTours() { - // add tour data - $query = "INSERT IGNORE INTO `help_tours` (`tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `mkdate`) VALUES -('96ea422f286fb5bbf9e41beadb484a9a', 'Profilseite', 'In dieser Tour werden die Grundfunktionen und Bereiche der Profilseite vorgestellt.', 'tour', 'autor,dozent,root', 1, 'de', '3.1', '', 1406722657), -('25e7421f286fc5bdf9e41beadb484ffa', 'Eigenes Bild hochladen', 'In der Tour wird erklärt, wie Nutzende ein eigenes Profilbild hochladen können.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406722657), -('3629493a16bf2680de64361f07cab096', 'Blubber', 'In der Tour wird die Nutzung von Blubber erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406709759), -('21f487fa74e3bfc7789886f40fe4131a', 'Forum nutzen', 'Die Inhalte dieser Tour stammen aus der alten Tour des Forums (Sidebar > Aktionen > Tour starten).', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405415746), -('44f859c50648d3410c39207048ddd833', 'Forum verwalten', 'Die Inhalte dieser Tour stammen aus der alten Tour des Forums (Sidebar > Aktionen > Tour starten).', 'tour', 'tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405417901), -('3a717a468afb0822cb1455e0ae6b6fce', 'Blubber', 'In der Tour wird die Nutzung von Blubber erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406709041), -('ef5092ba722c81c37a5a6bd703890bd9', 'Blubber', 'In der Tour wird die Nutzung von Blubber erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405507317), -('6849293baa05be5bef8ff438dc7c438b', 'Suche', 'In dieser Feature-Tour werden die wichtigsten Funktionen der Suche vorgestellt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405519609), -('b74f8459dce2437463096d56db7c73b9', 'Meine Veranstaltungen (Studierende)', 'In dieser Tour werden die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\" vorgestellt.', 'tour', 'autor,admin,root', 1, 'de', '3.1', '', 1405521073), -('154e711257d4d32d865fb8f5fb70ad72', 'Meine Dateien', 'In dieser Tour wird der persönliche Dateibereich vorgestellt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405592618), -('19ac063e8319310d059d28379139b1cf', 'Studiengruppe anlegen', 'In dieser Tour wird das Anlegen von Studiengruppen erklärt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405684299), -('edfcf78c614869724f93488c4ed09582', 'Teilnehmerverwaltung', 'In dieser Tour werden die Verwaltungsoptionen der Teilnehmerverwaltung erklärt.', 'tour', 'tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405688156), -('977f41c5c5239c4e86f04c3df27fae38', 'Was ist neu in Stud.IP 3.1?', 'In dieser Tour werden die Neuerungen in Stud.IP 3.1 überblicksartig vorgestellt.', 'tour', 'autor,tutor,dozent,admin', 1, 'de', '3.1', '', 1405932260), -('49604a77654617a745e29ad6b253e491', 'Gestaltung der Startseite', 'In dieser Tour werden die Funktionen und Gestaltungsmöglichkeiten der Startseite vorgestellt.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1405934780), -('7cccbe3b22dfa745c17cb776fb04537c', 'Meine Veranstaltungen (Lehrende)', 'In dieser Tour werden die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\" vorgestellt.', 'tour', 'tutor,dozent,admin,root', 1, 'de', '3.1', '', 1406125685); -"; - DBManager::get()->exec($query); - - // add steps - $query = "INSERT IGNORE INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `author_id`, `mkdate`) VALUES -('96ea422f286fb5bbf9e41beadb484a9a', 3, 'Stud.IP-Score', 'Der Stud.IP-Score wächst mit den Aktivitäten in Stud.IP und repräsentiert so die Erfahrung mit Stud.IP.', 'BL', 0, '#layout_content TABLE:eq(0) TBODY:eq(0) TR:eq(0) TD:eq(0) A:eq(0)', 'dispatch.php/profile', '', 1406722657), -('96ea422f286fb5bbf9e41beadb484a9a', 5, 'Neue Ankündigung', 'Klicken Sie auf das Plus-Zeichen, wenn Sie eine Ankündigung erstellen möchten.', 'BR', 0, '.contentbox:eq(0) header img:eq(1)', 'dispatch.php/profile', '', 1406722657), -('96ea422f286fb5bbf9e41beadb484a9a', 1, 'Profil-Tour', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen des \"Profils\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'dispatch.php/profile', '', 1406722657), -('96ea422f286fb5bbf9e41beadb484a9a', 6, 'Persönliche Daten', 'Das Bild sowie weitere persönliche Angaben können über diese Seiten geändert werden.', 'BL', 0, '#tabs li:eq(2)', 'dispatch.php/profile', '', 1406722657), -('96ea422f286fb5bbf9e41beadb484a9a', 2, 'Persönliches Bild', 'Wenn ein Bild hochgeladen wurde, wird es hier angezeigt. Dieses kann jederzeit geändert werden.', 'RT', 0, '.avatar-normal', 'dispatch.php/profile', '', 1406722657), -('25e7421f286fc5bdf9e41beadb484ffa', 1, 'Profil', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen des \"Profils\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'B', 0, '', 'dispatch.php/profile', '', 1406722657), -('25e7421f286fc5bdf9e41beadb484ffa', 2, 'Bild hochladen', 'Auf dieser Seite lässt sich ein Profilbild hochladen.', 'BL', 0, '#nav_profile_avatar A SPAN', 'dispatch.php/settings/avatar', '', 1406722657), -('25e7421f286fc5bdf9e41beadb484ffa', 3, 'Bild auswählen', 'Dafür kann eine beliebige Bilddatei hochgeladen werden.', 'L', 0, 'input[name=imgfile]', 'dispatch.php/settings/avatar', '', 1406722657), -('96ea422f286fb5bbf9e41beadb484a9a', 4, 'Ankündigungen', 'Sie können auf dieser Seite persönliche Ankündigungen veröffentlichen.', 'B', 0, '#layout_content SECTION HEADER H1 :eq(0)', 'dispatch.php/profile', '', 1406722657), -('3629493a16bf2680de64361f07cab096', 3, 'Text gestalten', 'Der Text kann formatiert und mit Smileys versehen werden.\r\nEs können die üblichen Formatierungen verwendet werden, wie z. B. **fett** oder %%kursiv%%.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508371), -('6849293baa05be5bef8ff438dc7c438b', 4, 'Navigation', 'Falls nur in einem bestimmten Bereich (wie z.B. Lehre) gesucht werden soll, kann dieser hier ausgewählt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/search/courses', '', 1406121826), -('3a717a468afb0822cb1455e0ae6b6fce', 3, 'Text gestalten', 'Der Text kann formatiert und mit Smileys versehen werden.\r\nEs können die üblichen Formatierungen verwendet werden, wie z. B. **fett** oder %%kursiv%%.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508371), -('3629493a16bf2680de64361f07cab096', 9, 'Beitrag verlinken', 'Wird der Mauszeiger auf dem ersten Diskussionsbeitrag positioniert, erscheint links neben dem Datum ein Link-Icon. Wenn dieses mit der rechten Maustaste angeklickt wird, kann der Link auf diesen Beitrag kopiert werden, um ihn an anderer Stelle einfügen zu können.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/forum', '', 1405508281), -('3629493a16bf2680de64361f07cab096', 8, 'Beitrag ändern', 'Wird der Mauszeiger auf einem beliebigen Beitrag positioniert, erscheint dessen Datum. Bei eigenen Beiträgen erscheint außerdem rechts neben dem Datum ein Icon, mit dem der Beitrag nachträglich geändert werden kann.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/forum', '', 1405507901), -('21f487fa74e3bfc7789886f40fe4131a', 1, 'Forum', 'Diese Tour gibt einen Überblick über die Elemente und Interaktionsmöglichkeiten des Forums.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'BL', 0, '', 'plugins.php/coreforum', '', 1405415772), -('21f487fa74e3bfc7789886f40fe4131a', 2, 'Sie befinden sich hier:...', 'An dieser Stelle wird angezeigt, welcher Bereich des Forums gerade betrachtet wird.', 'BL', 0, 'DIV#tutorBreadcrumb', 'plugins.php/coreforum', '', 1405415875), -('44f859c50648d3410c39207048ddd833', 1, 'Forum verwalten', 'Sie haben die Möglichkeit sich eine Tour zur Verwaltung des Forums anzuschauen.\r\n\r\nUm die Tour zu beginnen, klicken Sie bitte unten rechts auf \"Weiter\".', 'TL', 0, '', 'plugins.php/coreforum', '', 1405418008), -('21f487fa74e3bfc7789886f40fe4131a', 3, 'Kategorie', 'Das Forum ist unterteilt in Kategorien, Themen und Beiträge. Eine Kategorie fasst Forumsbereiche in größere Sinneinheiten zusammen.', 'BL', 0, '#layout_content #forum #sortable_areas TABLE CAPTION .category_name :eq(0)', 'plugins.php/coreforum', '', 1405416611), -('21f487fa74e3bfc7789886f40fe4131a', 4, 'Bereich', 'Das ist ein Bereich innerhalb einer Kategorie. Bereiche beinhalten die Diskussionstränge. Bereiche können mit per drag & drop in ihrer Reihenfolge verschoben werden.', 'BL', 0, '#layout_content #forum TABLE THEAD TR TH :eq(0)', 'plugins.php/coreforum', '', 1405416664), -('21f487fa74e3bfc7789886f40fe4131a', 5, 'Info-Icon', 'Dieses Icon färbt sich rot, sobald es etwas neues in diesem Bereich gibt.', 'B', 0, 'IMG#tutorNotificationIcon', 'plugins.php/coreforum', '', 1405416705), -('21f487fa74e3bfc7789886f40fe4131a', 7, 'Forum abonnieren', 'Das gesamte Forum, oder einzelne Themen können abonniert werden. Dann wird bei jedem neuen Beitrag in diesem Forum eine Benachrichtigung angezeigt und eine Nachricht versendet.', 'B', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(5)', 'plugins.php/coreforum', '', 1405416795), -('21f487fa74e3bfc7789886f40fe4131a', 6, 'Suchen', 'Hier können sämtliche Inhalte dieses Forums durchsucht werden.\r\nUnterstützt werden auch Mehrwortsuchen. Außerdem kann die Suche auf eine beliebige Kombination aus Titel, Inhalt und Autor eingeschränkt werden.', 'BL', 0, '#layout-sidebar SECTION #tutorSearchInfobox DIV #tutorSearchInfobox UL LI INPUT :eq(1)', 'plugins.php/coreforum', '', 1405417134), -('44f859c50648d3410c39207048ddd833', 2, 'Kategorie bearbeiten', 'Mit diesen Icons kann der Name der Kategorie geändert oder aber die gesamte Kategorie gelöscht werden. Die Bereiche werden in diesem Fall in die Kategorie \"Allgemein\" verschoben und bleiben somit erhalten.\r\n\r\nDie Kategorie \"Allgemein\" kann nicht gelöscht werden und ist daher in jedem Forum enthalten.', 'BR', 0, '#forum #sortable_areas TABLE CAPTION #tutorCategoryIcons', 'plugins.php/coreforum', '', 1405424216), -('44f859c50648d3410c39207048ddd833', 3, 'Bereich bearbeiten', 'Wird der Mauszeiger auf einem Bereich positioniert, erscheinen Aktions-Icons.\r\nMit diesen Icons kann der Name und die Beschreibung eines Bereiches geändert oder auch der gesamte Bereich gelöscht werden.\r\nDas Löschen eines Bereichs, führt dazu, dass alle enthaltenen Themen gelöscht werden.', 'B', 0, 'IMG.edit-area', 'plugins.php/coreforum', '', 1405424346), -('44f859c50648d3410c39207048ddd833', 4, 'Bereiche sortieren', 'Mit dieser schraffierten Fläche können Bereiche an einer beliebigen Stelle durch Klicken-und-Ziehen einsortiert werden. Dies kann einerseits dazu verwendet werden, um Bereiche innerhalb einer Kategorie zu sortieren, andererseits können Bereiche in andere Kategorien verschoben werden.', 'BR', 0, 'HTML #plugins #layout_wrapper #layout_page #layout_container #layout_content #forum #sortable_areas TABLE TBODY #tutorArea TD IMG#tutorMoveArea.handle.js :eq(1)', 'plugins.php/coreforum', '', 1405424379), -('44f859c50648d3410c39207048ddd833', 5, 'Neuen Bereich hinzufügen', 'Hier können neue Bereiche zu einer Kategorie hinzugefügt werden.', 'BR', 0, 'TFOOT TR TD A SPAN', 'plugins.php/coreforum', '', 1405424421), -('44f859c50648d3410c39207048ddd833', 6, 'Neue Kategorie erstellen', 'Hier kann eine neue Kategorie im Forum erstellt werden. Geben Sie hierfür den Titel der neuen Kategorie ein.', 'TL', 0, '#tutorAddCategory H2', 'plugins.php/coreforum', '', 1405424458), -('ef5092ba722c81c37a5a6bd703890bd9', 1, 'Was ist Blubbern?', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen von \"Blubber\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'plugins.php/blubber/streams/global', '', 1405507364), -('ef5092ba722c81c37a5a6bd703890bd9', 2, 'Beitrag erstellen', 'Hier kann eine Diskussion durch Schreiben von Text begonnen werden. Absätze lassen sich durch Drücken von Umschalt+Eingabe erzeugen. Der Text wird durch Drücken von Eingabe abgeschickt.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405507478), -('ef5092ba722c81c37a5a6bd703890bd9', 8, 'Beitrag ändern', 'Wird der Mauszeiger auf einem beliebigen Beitrag positioniert, erscheint dessen Datum. Bei eigenen Beiträgen erscheint außerdem rechts neben dem Datum ein Icon, mit dem der Beitrag nachträglich geändert werden kann.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/global', '', 1405507901), -('ef5092ba722c81c37a5a6bd703890bd9', 9, 'Beitrag verlinken', 'Wird der Mauszeiger auf dem ersten Diskussionsbeitrag positioniert, erscheint links neben dem Datum ein Link-Icon. Wenn dieses mit der rechten Maustaste angeklickt wird, kann der Link auf diesen Beitrag kopiert werden, um ihn an anderer Stelle einfügen zu können.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/global', '', 1405508281), -('ef5092ba722c81c37a5a6bd703890bd9', 3, 'Text gestalten', 'Der Text kann formatiert und mit Smileys versehen werden.\r\nEs können die üblichen Formatierungen verwendet werden, wie z. B. **fett** oder %%kursiv%%.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508371), -('ef5092ba722c81c37a5a6bd703890bd9', 5, 'Datei hinzufügen', 'Dateien können in einen Beitrag eingefügt werden, indem sie per Drag&Drop in ein Eingabefeld gezogen werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508401), -('ef5092ba722c81c37a5a6bd703890bd9', 6, 'Schlagworte', 'Beiträge können mit Schlagworten (engl. \"Hashtags\") versehen werden, indem einem beliebigen Wort des Beitrags ein # vorangestellt wird.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508442), -('ef5092ba722c81c37a5a6bd703890bd9', 7, 'Schlagwortwolke', 'Durch Anklicken eines Schlagwortes werden alle Beiträge aufgelistet, die dieses Schlagwort enthalten.', 'RT', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'plugins.php/blubber/streams/global', '', 1405508505), -('3a717a468afb0822cb1455e0ae6b6fce', 9, 'Beitrag verlinken', 'Wird der Mauszeiger auf dem ersten Diskussionsbeitrag positioniert, erscheint links neben dem Datum ein Link-Icon. Wenn dieses mit der rechten Maustaste angeklickt wird, kann der Link auf diesen Beitrag kopiert werden, um ihn an anderer Stelle einfügen zu können.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/profile', '', 1405508281), -('6849293baa05be5bef8ff438dc7c438b', 1, 'Suche', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen der \"Suche\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/search/courses', '', 1405519865), -('6849293baa05be5bef8ff438dc7c438b', 2, 'Suchbegriff eingeben', 'In dieses Eingabefeld kann ein Suchbegriff (wie z.B. der Veranstaltungsname, Dozent) eingegeben werden.', 'B', 0, 'INPUT#search_sem_quick_search_1.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520106), -('6849293baa05be5bef8ff438dc7c438b', 3, 'Semesterauswahl', 'Durch einen Klick auf das Drop-Down Menü kann bestimmt werden, auf welches Semester sich der Suchbegriff beziehen soll. \r\n\r\nStandardgemäß ist das aktuelle Semester eingestellt.', 'TL', 0, 'SELECT#search_sem_sem', 'dispatch.php/search/courses', '', 1405520208), -('6849293baa05be5bef8ff438dc7c438b', 5, 'Erweiterte Suche', 'Mit der Erweiterten Suche kann die Suche um weitere Optionen erweitert werden.', 'R', 0, 'A.options-checkbox.options-unchecked', 'dispatch.php/search/courses', '', 1405520436), -('6849293baa05be5bef8ff438dc7c438b', 6, 'Schnellsuche', 'Die Schnellsuche ist auch auf anderen Seiten von Stud.IP jederzeit verfügbar. Nach der Eingabe eines Stichwortes, wird mit \"Enter\" bestätigt, oder auf die Lupe rechts neben dem Feld geklickt.', 'B', 0, 'INPUT#search_sem_quick_search_2.quicksearchbox.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520634), -('6849293baa05be5bef8ff438dc7c438b', 7, 'Weitere Suchmöglichkeiten', 'Neben Veranstaltungen besteht auch die Möglichkeit, im Archiv, nach Personen, nach Einrichtungen oder nach Ressourcen zu suchen.', 'R', 0, '#nav_search_resources A SPAN', 'dispatch.php/search/courses', '', 1405520751), -('b74f8459dce2437463096d56db7c73b9', 1, 'Hilfe-Tour \"Meine Veranstaltungen\"', 'Diese Tour gibt einen Überblick über die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/my_courses', '', 1405521184), -('b74f8459dce2437463096d56db7c73b9', 2, 'Veranstaltungsüberblick', 'Hier werden die Veranstaltungen des aktuellen und vergangenen Semesters angezeigt. Neue Veranstaltungen erscheinen zunächst in rot.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1405521244), -('154e711257d4d32d865fb8f5fb70ad72', 1, 'Meine Dateien', 'Meine Dateien ist der persönliche Dateibereich. Hier können Dateien auf Stud.IP gespeichert werden, um sie von dort auf andere Rechner herunterladen zu können.\r\n\r\nAndere Studierende oder Lehrende erhalten keinen Zugriff auf Dateien, die in den persönlichen Dateibereich hochgeladen werden.\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/document/files', '', 1405592884), -('154e711257d4d32d865fb8f5fb70ad72', 4, 'Dateiübersicht', 'Alle Dateien und Verzeichnisse werden tabellarisch aufgelistet. Neben dem Namen werden noch weitere Informationen wie der Dateityp oder die Dateigröße angezeigt.', 'TL', 0, '#layout_content FORM TABLE THEAD TR TH :eq(3)', 'dispatch.php/document/files', '', 1405593089), -('154e711257d4d32d865fb8f5fb70ad72', 3, 'Neue Dateien und Verzeichnisse', 'Hier können neue Dateien von dem Computer in den persönlichen Dateibereich hochgeladen und neue Verzeichnisse erstellt werden.', 'TL', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(0)', 'dispatch.php/document/files', '', 1405593409), -('ef5092ba722c81c37a5a6bd703890bd9', 4, 'Personen erwähnen', 'Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405672301), -('154e711257d4d32d865fb8f5fb70ad72', 6, 'Export', 'Hier besteht die Möglichkeit einzelne Ordner oder den vollständigen Dateibereich als ZIP-Datei herunterzuladen. Darin sind alle Dateien und Verzeichnisse enthalten.', 'TL', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/document/files', '', 1405593708), -('154e711257d4d32d865fb8f5fb70ad72', 5, 'Aktionen', 'Bereits hochgeladene Dateien und Ordner können hier bearbeitet, heruntergeladen, verschoben, kopiert und gelöscht werden.', 'TR', 0, '#layout_content FORM TABLE THEAD TR TH :eq(7)', 'dispatch.php/document/files', '', 1405594079), -('154e711257d4d32d865fb8f5fb70ad72', 2, 'Verfügbarer Speicherplatz', 'Der Speicherplatz des persönlichen Dateibereichs ist begrenzt. Es wird angezeigt, wie viel Speicherplatz noch verfügbar ist.', 'BR', 0, 'DIV.caption-actions', 'dispatch.php/document/files', '', 1405594184), -('edfcf78c614869724f93488c4ed09582', 5, 'Rundmail an Nutzergruppe versenden', 'Weiterhin besteht die Möglichkeit eine Rundmail an einzelne Nutzergruppen zu versenden.', 'BR', 0, '#layout_container #layout_content TABLE CAPTION SPAN A IMG :eq(0)', 'dispatch.php/course/members', '', 1406637123), -('25e7421f286fc5bdf9e41beadb484ffa', 4, 'Voraussetzungen', 'Eine Bilddatei muss im **.jpg**, **.png** oder **.gif** Format vorliegen.\r\nDie Dateigröße darf 700 KB nicht überschreiten.', 'L', 0, '#layout_content #edit_avatar TBODY TR TD FORM B :eq(2)', 'dispatch.php/settings/avatar', '', 1406722657), -('19ac063e8319310d059d28379139b1cf', 1, 'Studiengruppe anlegen', 'Studiengruppen ermöglichen die Zusammenarbeit mit anderen. Diese Tour gibt Ihnen einen Überblick darüber wie Sie Studiengruppen anlegen können.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'R', 0, '', 'dispatch.php/my_studygroups', '', 1405684423), -('19ac063e8319310d059d28379139b1cf', 2, 'Studiengruppe anlegen', 'Mit Klick auf \"Neue Studiengruppe anlegen\" kann eine neue Studiengruppe angelegt werden.', 'R', 0, 'A#nav_browse_new', 'dispatch.php/my_studygroups', '', 1406017730), -('19ac063e8319310d059d28379139b1cf', 3, 'Studiengruppe benennen', 'Der Name einer Studiengruppe sollte aussagekräftig sein und einmalig im gesamten Stud.IP.', 'R', 0, 'INPUT#groupname', 'dispatch.php/course/studygroup/new', '', 1405684720), -('19ac063e8319310d059d28379139b1cf', 4, 'Beschreibung hinzufügen', 'Die Beschreibung ermöglicht es weitere Informationen anzuzeigen und somit das Auffinden der Gruppe zu erleichtern.', 'R', 0, 'TEXTAREA#groupdescription', 'dispatch.php/course/studygroup/new', '', 1405684806), -('19ac063e8319310d059d28379139b1cf', 8, 'Studiengruppe speichern', 'Nach dem Speichern einer Studiengruppe erscheint diese unter \"Veranstaltungen > Meine Studiengruppen\".', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(14)', 'dispatch.php/course/studygroup/new', '', 1405686068), -('19ac063e8319310d059d28379139b1cf', 5, 'Inhaltselemente zuordnen', 'Hier können Inhaltselemente aktiviert werden, welche innerhalb der Studiengruppe zur Verfügung stehen sollen. Das Fragezeichen gibt nähere Informationen zur Bedeutung der einzelnen Inhaltselemente.', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(5)', 'dispatch.php/course/studygroup/new', '', 1405685093), -('19ac063e8319310d059d28379139b1cf', 6, 'Zugang festlegen', 'Mit diesem Drop-down-Menü kann der Zugang zur Studiengruppe eingeschränkt werden.\r\n\r\nBeim Zugang \"offen für alle\" können sich alle Studierenden frei eintragen und an der Gruppe beteiligen.\r\n\r\nBeim Zugang \"Auf Anfrage\" müssen Teilnehmer durch den Gruppengründer hinzugefügt werden.', 'R', 0, 'SELECT#groupaccess', 'dispatch.php/course/studygroup/new', '', 1405685334), -('19ac063e8319310d059d28379139b1cf', 7, 'Nutzungsbedingungen akzeptieren', 'Bei der Erstellung einer Studiengruppe müssen die Nutzungsbedingungen akzeptiert werden.', 'R', 0, 'P LABEL', 'dispatch.php/course/studygroup/new', '', 1405685652), -('edfcf78c614869724f93488c4ed09582', 6, 'Gruppen erstellen', 'Hier können die Teilnehmenden der Veranstaltung in Gruppen eingeteilt werden.', 'R', 0, 'A#nav_course_edit_groups', 'dispatch.php/course/members', '', 1405689311), -('b74f8459dce2437463096d56db7c73b9', 3, 'Veranstaltungsdetails', 'Mit Klick auf das \"i\" erscheint ein Fenster mit den wichtigsten Eckdaten der Veranstaltung.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1405931069), -('edfcf78c614869724f93488c4ed09582', 7, 'Gruppe benennen', 'Sie können in den Vorlagen nach einem passenden Gruppennamen suchen und ihn mit dem gelben Doppelpfeil auswählen. Alternativ haben Sie auch die Möglichkeit, einen neuen Gruppennamen zu bestimmen, indem Sie im rechten Feld den Namen direkt eintragen.', 'B', 0, 'SELECT', 'admin_statusgruppe.php', '', 1405689541), -('edfcf78c614869724f93488c4ed09582', 1, 'Teilnehmerverwaltung', 'Diese Tour gibt einen Überblick über die Teilnehmerverwaltung einer Veranstaltung.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'B', 0, '', 'dispatch.php/course/members', '', 1405688399), -('edfcf78c614869724f93488c4ed09582', 2, 'Personen eintragen', 'Mit diesen Funktionen können entweder einzelne Personen in Stud.IP gesucht und direkt als Lehrende, Tutor/-in oder Studierende eintragen werden. Es ist auch möglich eine Teilnehmerliste einzugeben, um viele Personen auf einmal als Tutor/-in der Veranstaltung zuzuordnen.', 'R', 0, '#layout-sidebar SECTION DIV.sidebar-widget :eq(1)', 'dispatch.php/course/members', '', 1405688707), -('edfcf78c614869724f93488c4ed09582', 4, 'Rundmail verschicken', 'Hier kann eine Rundmail an alle Teilnehmende der Veranstaltung verschickt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(3)', 'dispatch.php/course/members', '', 1406636964), -('edfcf78c614869724f93488c4ed09582', 8, 'Gruppengröße', 'Mit dem Feld \"Gruppengröße\" können Sie die maximale Anzahl der Teilnehmer einer Gruppe festlegen. Wenn Sie dies nicht benötigen, lassen Sie das Feld einfach leer.', 'B', 0, 'INPUT#role_size', 'admin_statusgruppe.php', '', 1405689763), -('edfcf78c614869724f93488c4ed09582', 9, 'Selbsteintrag', 'Wenn Sie die Funktion \"Selbsteintrag\" aktivieren, können sich die Teilnehmenden der Veranstaltung selbst in die Gruppen eintragen.', 'B', 0, 'INPUT#self_assign', 'admin_statusgruppe.php', '', 1405689852), -('edfcf78c614869724f93488c4ed09582', 10, 'Dateiordner', 'Wenn Sie die Funktion \"Dateiordner\" aktivieren, wird zusätzlich ein Dateiordner pro Gruppe neu angelegt. In diesen Ordner können gruppenspezifische Dateien hochgeladen werden.', 'B', 0, 'INPUT#group_folder', 'admin_statusgruppe.php', '', 1405689936), -('edfcf78c614869724f93488c4ed09582', 3, 'Hochstufen / Herabstufen', 'Um eine bereits eingetragene Person zum/zur Tutor/-in hochzustufen oder zum/zur LeserIn herabzustufen, wählen Sie diese Person in der Liste aus und führen Sie mit Hilfe des Dropdown-Menü die gewünschte Aktion aus.', 'T', 0, '#autor CAPTION', 'dispatch.php/course/members', '', 1405690324), -('3a717a468afb0822cb1455e0ae6b6fce', 7, 'Schlagwortwolke', 'Durch Anklicken eines Schlagwortes werden alle Beiträge aufgelistet, die dieses Schlagwort enthalten.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/profile', '', 1405508505), -('b74f8459dce2437463096d56db7c73b9', 4, 'Veranstaltungsinhalte', 'Hier werden alle Inhalte (wie z.B. ein Forum) durch entsprechende Symbole angezeigt.\r\nFalls es seit dem letzten Login Neuigkeiten gab, erscheinen diese in rot.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1405931225), -('b74f8459dce2437463096d56db7c73b9', 5, 'Verlassen der Veranstaltung', 'Ein Klick auf das Tür-Icon ermöglicht eine direkte Austragung aus der Veranstaltung.', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1405931272), -('b74f8459dce2437463096d56db7c73b9', 6, 'Zugriff auf archivierte Veranstaltungen', 'Falls Veranstaltungen archiviert sind, kann hier auf diese zugegriffen werden.', 'RT', 0, 'A#nav_browse_archive', 'dispatch.php/my_courses', '', 1405931431), -('3a717a468afb0822cb1455e0ae6b6fce', 2, 'Beitrag erstellen', 'Hier kann eine Diskussion durch Schreiben von Text begonnen werden. Absätze lassen sich durch Drücken von Umschalt+Eingabe erzeugen. Der Text wird durch Drücken von Eingabe abgeschickt.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405507478), -('b74f8459dce2437463096d56db7c73b9', 7, 'Anpassung der Veranstaltungsansicht', 'Zur Anpassung der Veranstaltungsübersicht, kann man die Veranstaltungen nach bestimmten Kriterien (wie z.B. Studienbereiche, Dozenten oder Farben) gliedern.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1405932131), -('b74f8459dce2437463096d56db7c73b9', 8, 'Zugriff auf Veranstaltung vergangener und zukünftiger Semester', 'Durch Klick auf das Drop-Down Menü können beispielsweise Veranstaltung aus vergangenen Semestern angezeigt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1405932230), -('b74f8459dce2437463096d56db7c73b9', 9, 'Weitere mögliche Aktionen', 'Hier können Sie alle Neuigkeiten als gelesen markieren, Farbgruppierungen nach Belieben ändern oder\r\nauch die Benachrichtigungen über Aktivitäten in den einzelnen Veranstaltungen anpassen.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1405932320), -('977f41c5c5239c4e86f04c3df27fae38', 1, 'Willkommen im neuen Stud.IP 3.1', 'Dies ist eine Hilfe-Tour, die die wichtigsten Neuerungen in Stud.IP vorstellt. \r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\". Eine Hilfe-Tour kann jederzeit durch einen Klick auf \"Beenden\" beendet werden.', 'TL', 0, '', 'dispatch.php/start', '', 1405932373), -('977f41c5c5239c4e86f04c3df27fae38', 2, 'Hilfelasche', 'Auf jeder Seite findet sich die Hilfe von nun an in der sogenannten Hilfelasche. Diese öffnet sich mit einem Klick auf das Fragezeichen. \r\n\r\nHier findet sich kurz und knapp zu jeder Seite die wichtigsten Informationen, Links zur ausführlichen Hilfeseite mit Anleitungsvideos und gegebenenfalls Hilfe-Touren.', 'BR', 0, 'DIV.helpbar-container .helpbar-title', 'dispatch.php/start', '', 1405932475), -('977f41c5c5239c4e86f04c3df27fae38', 3, 'Gliederung der Startseite', 'Die Startseite im neuen Stud.IP ist standardmäßig so gegliedert wie die alte Version. Neu ist, dass jedes Element (\"Widget\") individuell entfernt und verschoben werden kann. Darüber hinaus können noch weitere Widgets hinzugefügt werden. Hierzu gibt es eine separate Hilfe-Tour und die Hinweise in der Hilfe.', 'TL', 0, '', 'dispatch.php/start', '', 1405932516), -('b74f8459dce2437463096d56db7c73b9', 10, 'Studiengruppen und Einrichtungen', 'Es besteht zudem die Möglichkeit auf persönliche Studiengruppen oder Einrichtungen zuzugreifen.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1405932519), -('977f41c5c5239c4e86f04c3df27fae38', 4, 'Sidebar', 'Auf allen Seiten ist nun links die Sidebar positioniert. Sie enthält Funktionen für die aktuelle Seite.\r\nIm alten Stud.IP gab es mit der Infobox auf der rechten Seite etwas Ähnliches.', 'R', 0, 'SECTION.sidebar', 'dispatch.php/start', '', 1405932633), -('977f41c5c5239c4e86f04c3df27fae38', 5, 'Änderung der Navigation', 'Häufig ist die Reiternavigation vom alten Stud.IP nun in der Sidebar zu finden. Auf dieser Seite sind das zum Beispiel die Punkte \"Neue Nachricht schreiben\" und der Gesendet-Ordner.', 'R', 0, 'SECTION.sidebar ', 'dispatch.php/messages/overview', '', 1405932671), -('977f41c5c5239c4e86f04c3df27fae38', 6, 'Studiengruppen und Einrichtungen', 'Die Einrichtungen, die früher unter den Veranstaltungen standen und die Studiengruppen, die früher zwischen den Veranstaltungen standen, finden sich nun in eigenen Reitern wieder.', 'R', 0, '#nav_browse_my_institutes A SPAN', 'dispatch.php/my_courses', '', 1405932830), -('977f41c5c5239c4e86f04c3df27fae38', 7, 'Hinweise zu den Anmeldeverfahren', 'Im neuen Stud.IP haben sich die Zugangsberechtigungen und Anmeldeverfahren geändert. Das betrifft sowohl Studierende als auch Lehrende. Hierzu gibt es separate Feature-Touren und die Hinweise in der Hilfe.', 'TL', 0, '', 'dispatch.php/my_courses', '', 1405932890), -('3a717a468afb0822cb1455e0ae6b6fce', 1, 'Was ist Blubbern?', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen von \"Blubber\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'plugins.php/blubber/streams/profile', '', 1405507364), -('3a717a468afb0822cb1455e0ae6b6fce', 6, 'Schlagworte', 'Beiträge können mit Schlagworten (engl. \"Hashtags\") versehen werden, indem einem beliebigen Wort des Beitrags ein # vorangestellt wird.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508442), -('49604a77654617a745e29ad6b253e491', 1, 'Funktionen und Gestaltungs-möglichkeiten der Startseite', '\r\nDiese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen der \"Startseite\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/start', '', 1405934926), -('49604a77654617a745e29ad6b253e491', 2, 'Individuelle Gestaltung der Startseite', 'Die Startseite ist standardmäßig so konfiguriert, dass die Elemente \"Schnellzugriff\", \"Ankündigungen\", \"Meine aktuellen Termine\" und \"Umfragen\" angezeigt werden. Die Elemente werden Widgets genannt und können entfernt, hinzugefügt und verschoben werde.n Jedes Widget kann individuell hinzugefügt, entfernt und verschoben werden.', 'TL', 0, '', 'dispatch.php/start', '', 1405934970), -('49604a77654617a745e29ad6b253e491', 3, 'Widget hinzufügen', 'Hier können Widgets hinzugefügt werden. Zusätzlich zu den Standard-Widgets kann beispielsweise der persönliche Stundenplan auf der Startseite anzeigt werden. Neu hinzugefügte Widgets erscheinen ganz unten auf der Startseite. Darüber hinaus kann in der Sidebar direkt zu jedem Widget gesprungen werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI :eq(4)', 'dispatch.php/start', '', 1405935192), -('49604a77654617a745e29ad6b253e491', 5, 'Widget positionieren', 'Ein Widget kann per Drag&Drop an die gewünschte Position verschoben werden: Dazu wird in die Titelzeile eines Widgets geklickt, die Maustaste gedrückt gehalten und das Widget an die gewünschte Position gezogen.', 'B', 0, '.widget-header', 'dispatch.php/start', '', 1405935687), -('49604a77654617a745e29ad6b253e491', 7, 'Widget entfernen', 'Jedes Widget kann durch Klicken auf das X in der rechten oberen Ecke entfernt werden. Bei Bedarf kann es jederzeit wieder hinzugefügt werden.', 'R', 0, '.widget-header', 'dispatch.php/start', '', 1405935376), -('49604a77654617a745e29ad6b253e491', 6, 'Widget bearbeiten', 'Bei einigen Widgets wird neben dem X zum Schließen noch ein weiteres Symbol angezeigt. Der Schnellzugriff bspw. kann durch Klick auf diesen Button individuell angepasst, die Ankündigungen können abonniert und bei den aktuellen Terminen bzw. Stundenplan können Termine hinzugefügt werden.', 'L', 0, '#layout_content DIV UL DIV SPAN A IMG :eq(0)', 'dispatch.php/start', '', 1405935792), -('3629493a16bf2680de64361f07cab096', 1, 'Was ist Blubbern?', 'Diese Tour gibt Ihnen einen Überblick über die wichtigsten Funktionen von \"Blubber\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'plugins.php/blubber/streams/forum', '', 1405507364), -('3a717a468afb0822cb1455e0ae6b6fce', 4, 'Personen erwähnen', 'Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405672301), -('3629493a16bf2680de64361f07cab096', 2, 'Beitrag erstellen', 'Hier kann eine Diskussion durch Schreiben von Text begonnen werden. Absätze lassen sich durch Drücken von Umschalt+Eingabe erzeugen. Der Text wird durch Drücken von Eingabe abgeschickt.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405507478), -('7cccbe3b22dfa745c17cb776fb04537c', 1, 'Hilfe-Tour \"Meine Veranstaltung\"', 'Diese Tour gibt einen Überblick über die wichtigsten Funktionen der Seite \"Meine Veranstaltungen\".\r\n\r\nUm auf den nächsten Schritt zu kommen, klicken Sie bitte rechts unten auf \"Weiter\".', 'TL', 0, '', 'dispatch.php/my_courses', '', 1406125847), -('7cccbe3b22dfa745c17cb776fb04537c', 2, 'Veranstaltungsüberblick', 'Hier werden die Veranstaltungen des aktuellen und vergangenen Semesters angezeigt. Neue Veranstaltungen erscheinen zunächst in rot.', 'TL', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1406125908), -('7cccbe3b22dfa745c17cb776fb04537c', 3, 'Veranstaltungsdetails', 'Mit Klick auf das \"i\" erscheint ein Fenster mit den wichtigsten Eckdaten der Veranstaltung.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1406125992), -('7cccbe3b22dfa745c17cb776fb04537c', 4, 'Veranstaltungsinhalte', 'Hier werden alle Inhalte (wie z.B. ein Forum) durch entsprechende Symbole angezeigt.\r\nFalls es seit dem letzten Login Neuigkeiten gab, erscheinen diese in rot.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1406126049), -('7cccbe3b22dfa745c17cb776fb04537c', 5, 'Bearbeitung oder Löschung einer Veranstaltung', 'Der Klick auf das Zahnrad ermöglicht die Bearbeitung einer Veranstaltung.\r\nFalls bei einer Veranstaltung Teilnehmerstatus besteht, kann hier eine Austragung, durch Klick auf dasTür-Icon, vorgenommen werden.', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1406126134), -('3a717a468afb0822cb1455e0ae6b6fce', 8, 'Beitrag ändern', 'Wird der Mauszeiger auf einem beliebigen Beitrag positioniert, erscheint dessen Datum. Bei eigenen Beiträgen erscheint außerdem rechts neben dem Datum ein Icon, mit dem der Beitrag nachträglich geändert werden kann.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/profile', '', 1405507901), -('7cccbe3b22dfa745c17cb776fb04537c', 6, 'Anpassung der Veranstaltungsansicht', 'Zur Anpassung der Veranstaltungsübersicht, kann man die Veranstaltungen nach bestimmten Kriterien (wie z.B. Studienbereiche, Dozenten oder Farben) gliedern.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1406126281), -('7cccbe3b22dfa745c17cb776fb04537c', 7, 'Zugriff auf Veranstaltung vergangener und zukünftiger Semester', 'Durch Klick auf das Drop-Down Menü können beispielsweise Veranstaltung aus vergangenen Semestern angezeigt werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1406126316), -('7cccbe3b22dfa745c17cb776fb04537c', 8, 'Weitere mögliche Aktionen', 'Hier können Sie alle Neuigkeiten als gelesen markieren, Farbgruppierungen nach Belieben ändern oder\r\nauch die Benachrichtigungen über Aktivitäten in den einzelnen Veranstaltungen anpassen.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1406126374), -('7cccbe3b22dfa745c17cb776fb04537c', 9, 'Studiengruppen und Einrichtungen', 'Es besteht zudem die Möglichkeit auf persönliche Studiengruppen oder Einrichtungen zuzugreifen.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1406126415), -('3a717a468afb0822cb1455e0ae6b6fce', 5, 'Datei hinzufügen', 'Dateien können in einen Beitrag eingefügt werden, indem sie per Drag&Drop in ein Eingabefeld gezogen werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508401), -('977f41c5c5239c4e86f04c3df27fae38', 8, 'Ende der Feature-Tour', 'Durch Klick auf \"Beenden\" in der Box rechts unten wird diese Tour beendet. Über die Hilfelasche lässt sich diese Tour jederzeit wieder starten.', 'TL', 0, '', 'dispatch.php/start', '', 1406539532), -('49604a77654617a745e29ad6b253e491', 4, 'Sprungmarken', 'Darüber hinaus kann mit Sprungmarken direkt zu jedem Widget gesprungen werden.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/start', '', 1406623464), -('3629493a16bf2680de64361f07cab096', 5, 'Datei hinzufügen', 'Dateien können in einen Beitrag eingefügt werden, indem sie per Drag&Drop in ein Eingabefeld gezogen werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508401), -('3629493a16bf2680de64361f07cab096', 6, 'Schlagworte', 'Beiträge können mit Schlagworten (engl. \"Hashtags\") versehen werden, indem einem beliebigen Wort des Beitrags ein # vorangestellt wird.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508442), -('3629493a16bf2680de64361f07cab096', 7, 'Schlagwortwolke', 'Durch Anklicken eines Schlagwortes werden alle Beiträge aufgelistet, die dieses Schlagwort enthalten.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/forum', '', 1405508505), -('3629493a16bf2680de64361f07cab096', 4, 'Personen erwähnen', 'Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405672301); -"; - DBManager::get()->exec($query); - - // add settings - $query = "INSERT IGNORE INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES -('96ea422f286fb5bbf9e41beadb484a9a', 1, 'standard'), -('25e7421f286fc5bdf9e41beadb484ffa', 1, 'standard'), -('3a717a468afb0822cb1455e0ae6b6fce', 1, 'standard'), -('21f487fa74e3bfc7789886f40fe4131a', 1, 'standard'), -('44f859c50648d3410c39207048ddd833', 1, 'standard'), -('ef5092ba722c81c37a5a6bd703890bd9', 1, 'standard'), -('6849293baa05be5bef8ff438dc7c438b', 1, 'standard'), -('b74f8459dce2437463096d56db7c73b9', 1, 'standard'), -('154e711257d4d32d865fb8f5fb70ad72', 1, 'standard'), -('19ac063e8319310d059d28379139b1cf', 1, 'standard'), -('edfcf78c614869724f93488c4ed09582', 1, 'standard'), -('977f41c5c5239c4e86f04c3df27fae38', 0, 'autostart_once'), -('49604a77654617a745e29ad6b253e491', 1, 'standard'), -('3629493a16bf2680de64361f07cab096', 1, 'standard'), -('7cccbe3b22dfa745c17cb776fb04537c', 1, 'standard'); -"; - DBManager::get()->exec($query); - } - - function addHelpContent() { - $query = "INSERT IGNORE INTO `help_content` (`content_id`, `language`, `label`, `icon`, `content`, `route`, `studip_version`, `position`, `custom`, `visible`, `author_id`, `installation_id`, `mkdate`) VALUES -('5a90d1219dbeb07c124156592fb5d877', 'de', '', '', 'In den allgemeinen Einstellungen können verschiedene Anzeigeoptionen und Benachrichtigungsfunktionen ausgewählt und verändert werden.', 'dispatch.php/settings/general', '3.1', 0, 0, 1, '', '', 1406641688), -('a202eb75df0a1da2a309ad7a4abfac59', 'de', '', '', 'In den Privatsphäre-Einstellungen kann die Sichtbarkeit und Auffindbarkeit des eigenen Profils eingestellt werden.', 'dispatch.php/settings/privacy', '3.1', 0, 0, 1, '', '', 1406641688), -('845d1ce67a62d376ec26c8ffbb22d492', 'de', '', '', 'Die Einstellungen des Nachrichtensystems bieten die Möglichkeit z.B. eine Weiterleitung der in Stud.IP empfangenen Nachrichten an die E-Mail-Adresse zu veranlassen.', 'dispatch.php/settings/messaging', '3.1', 0, 0, 1, '', '', 1406641688), -('85cbaa1648af330cc4420b57df4be29c', 'de', '', '', 'Die Einstellungen des Terminkalenders bieten die Möglichkeit, diesen an eigene Bedürfnisse anzupassen.', 'dispatch.php/settings/calendar', '3.1', 0, 0, 1, '', '', 1406641688), -('1da144f3c6f52af0566c343151a6a6ff', 'de', '', '', 'In den Benachrichtigungseinstellungen kann ausgewählt werden, bei welchen Änderungen innerhalb einer Veranstaltung eine Benachrichtigung erfolgen soll.', 'dispatch.php/settings/notification', '3.1', 0, 0, 1, '', '', 1406641688), -('01ad8998268101ad186babf43dac30a4', 'de', '', '', 'In den Standard-Vertretungseinstellungen können Lehrende eine Standard-Vertretung festlegen, die alle Veranstaltungen des Lehrenden verwalten und ändern kann.', 'dispatch.php/settings/deputies', '3.1', 0, 0, 1, '', '', 1406641688), -('1c61657979ce22a9af023248a617f6b2', 'de', '', '', 'Die Startseite wird nach dem Einloggen angezeigt und kann an persönliche Bedürfnisse mit Hilfe von Widgets angepasst werden.', 'dispatch.php/start', '3.1', 0, 0, 1, '', '', 1406641688), -('74c1da86f33f5adfb43e10220bfad238', 'de', '', '', 'Die Veranstaltungsseite zeigt alle belegten Veranstaltungen (standardmäßig nur die der letzten beiden Semester), alle belegten Studiengruppen sowie alle Einrichtungen, denen man zugeordnet wurde. Die Anzeige lässt sich über Farbgruppierungen, Semesterfilter usw. anpassen.', 'dispatch.php/my_courses', '3.1', 0, 0, 1, '', '', 1406641688), -('437c83a27473ef8139b47198101067fb', 'de', '', '', 'Hier erscheinen archivierte Veranstaltungen, denen der Nutzer zugeordnet ist. Inhalte können nicht mehr verändert, jedoch hinterlegte Dateien als zip-Datei heruntergeladen werden.', 'dispatch.php/my_courses/archive', '3.1', 0, 0, 1, '', '', 1406641688), -('04457f9a66eab07618fe502d470a9711', 'de', '', '', 'In der Übersicht finden sich veranstaltungsbezogene Kurz- und Detail-Informationen, Ankündigungen, Termine und Umfragen.', 'dispatch.php/course/overview', '3.1', 0, 0, 1, '', '', 1406641688), -('1d1323471cf21637f51284f4e6f2d135', 'de', '', '', 'Detaillierte Informationen über die Veranstaltung werden angezeigt, wie z.B. die Veranstaltungsnummer, Zuordnungen, Lehrende, Tutor/-innen etc. In den Detail-Informationen ist unter Aktionen das Eintragen in eine Veranstaltung möglich.', 'dispatch.php/course/details', '3.1', 0, 0, 1, '', '', 1406641688), -('7f4a1f5e3dfe2a459cf0eb357667d91c', 'de', '', '', 'Mit den Verwaltungsfunktionen lassen sich die Eigenschaften der Veranstaltung nachträglich ändern. Unter Aktionen ist die Simulation der Studierendenansicht möglich.', 'dispatch.php/course/management', '3.1', 0, 0, 1, '', '', 1406641688), -('4698cafeb9823735c50fd3a1745950ba', 'de', '', '', 'In den Grunddaten können Titel, Beschreibung, Lehrende etc. geändert werden. Die Bearbeitung kann teilweise gesperrt sein, wenn Daten aus anderen Systemen (z.B. LSF/ UniVZ) übernommen werden.', 'dispatch.php/course/basicdata/view', '3.1', 0, 0, 1, '', '', 1406641688), -('5fab81bbd1e19949f304df08ea21ca1b', 'de', '', '', 'Mit der Bild-Hochladen-Funktion lässt sich das Bild der Veranstaltung ändern, was Studierenden bei der Unterscheidung von Veranstaltungen auf der Meine-Veranstaltungen-Seite helfen kann.', 'dispatch.php/course/avatar/update', '3.1', 0, 0, 1, '', '', 1406641688), -('19c2bc232075602bd39efd4b6623d576', 'de', '', '', 'Mit der Studienbereiche-Funktion kann die Veranstaltung einem Studienbereich zugeordnet werden. Die Bearbeitung kann gesperrt sein, wenn Daten aus anderen Systemen (z.B. LSF/ UniVZ) übernommen werden.', 'dispatch.php/course/study_areas/show', '3.1', 0, 0, 1, '', '', 1406641688), -('70274c459a69e34bbf520e690a8e472b', 'de', '', '', 'Mit der Zeiten/Räume-Funktion können die Semester-, Termin- und Raumangaben der Veranstaltung geändert werden. Die Bearbeitung kann gesperrt sein, wenn Daten aus anderen Systemen (z.B. LSF/ UniVZ) übernommen werden.', 'raumzeit.php', '3.1', 0, 0, 1, '', '', 1406641688), -('19d47b782ac5c8b8b21bd1f94858a0fa', 'de', '', '', 'Mit Zugangsberechtigungen (Anmeldeverfahren) lässt sich z.B. durch Passwörter, Zeitsteuerung und Personenbeschränkung der Zugang zu einer Veranstaltung regulieren.', 'dispatch.php/course/admission', '3.1', 0, 0, 1, '', '', 1406641688), -('e939ac70210674f49a36ac428167a9b8', 'de', '', '', 'Mit der Umfragen-und-Tests-Funktion lassen sich (zeitgesteuerte) Umfragen oder einzelne Multiple-/Single-Choice-Fragen für Veranstaltungen, Studiengruppen oder das Profil erstellen.', 'admin_vote.php', '3.1', 0, 0, 1, '', '', 1406641688), -('2689cecba24e021f05fcece5e4c96057', 'de', '', '', 'Mit der Evaluationen-Funktion lassen sich Befragungen mit Multiple-Choice, Likert- und Freitextfragen für Veranstaltungen, Studiengruppen, das eigene Profil oder Einrichtungen erstellen. Dabei können auch öffentliche Vorlagen anderer Personen verwendet werden. Es werden alle zukünftigen, laufenden und beendeten Evaluationen angezeigt.', 'admin_evaluation.php', '3.1', 0, 0, 1, '', '', 1406641688), -('194874212676ced8d45e1883da1ad456', 'de', '', '', 'Das Forum ist eine textbasierte, zeit- und ortsunabhängige Möglichkeit zum Austausch von Fragen, Meinungen und Erfahrungen. Beiträge können abonniert, exportiert, als Favoriten gekennzeichnet und editiert werden. Über die Navigation links können unterschieldiche Ansichten (z.B. Neue Beiträge seit letztem LogIn) gewählt werden.', 'plugins.php/coreforum', '3.1', 0, 0, 1, '', '', 1406641688), -('a20036992a06e97a984832626121d99a', 'de', '', '', 'Die Personenliste zeigt eine Liste der Teilnehmenden dieser Veranstaltung. Weitere Teilnehmende können von Lehrenden hinzugefügt, entfernt, herabgestuft, heraufgestuft oder selbstdefinierten Gruppen zugeordnet werden.', 'dispatch.php/course/members', '3.1', 0, 0, 1, '', '', 1406641688), -('d79ca3bc4a8251862339b1c934504a54', 'de', '', '', 'Hier werden die selbstdefinierten Gruppen angezeigt. An diese können Nachrichten versendet werden. Ein Klick auf die orangenen Pfeile vor dem Gruppenname ordnet Sie der Gruppe zu.', 'statusgruppen.php', '3.1', 0, 0, 1, '', '', 1406641688), -('e22701c71b4425fb5a95adf725866097', 'de', '', '', 'Hier können Gruppen erstellt und verwaltet werden. Wenn der Selbsteintrag aktiviert ist, können sich Personen selbst ein- und austragen.', 'admin_statusgruppe.php', '3.1', 0, 0, 1, '', '', 1406641688), -('aa77d5ee6e0f9a9e6f4a1bbabeaf4a7e', 'de', '', '', 'Die Anwesenheitsliste zeigt alle Sitzungstermine (Sitzung, Vorlesung, Übung, Praktikum) des Ablaufplans und ermöglicht das Eintragen von Studierenden durch die Lehrenden in Stud.IP sowie einen Export der Liste zur Übersicht oder als Grundlage handschriftlicher Eintragungen.', 'participantsattendanceplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), -('ac7326260fd5ca4fa83c1154f2ffc7b9', 'de', '', '', 'Die Dateiverwaltung bietet die Möglichkeit zum Hochladen, Verlinken, Verwalten und Herunterladen von Dateien. ', 'folder.php', '3.1', 0, 0, 1, '', '', 1406641688), -('29c3bfa01ddbaaa998094d3ee975a06a', 'de', '', '', 'Der Ablaufplan zeigt Termine, Themen und Räume der Veranstaltung an. Einzelne Termine können bearbeitet werden, z.B. können Themen zu Terminen hinzugefügt werden.', 'dispatch.php/course/dates', '3.1', 0, 0, 1, '', '', 1406641688), -('c4dee277f741cfa7d5a65fa0c6bead4c', 'de', '', '', 'Hier können Termine mit Themen versehen werden oder bereits eingegebene Themen übernommen und bearbeitet werden.', 'dispatch.php/course/topics', '3.1', 0, 0, 1, '', '', 1406641688), -('c01725d6a3da568e1b07aee4e68a7e1f', 'de', '', '', 'Diese Seite ermöglicht das Hinterlegen von freien Informationen, Links etc.', 'dispatch.php/course/scm', '3.1', 0, 0, 1, '', '', 1406641688), -('be204bdd0fce91702f51597bf8428fba', 'de', '', '', 'Das Wiki ermöglicht ein gemeinsames, asynchrones Erstellen und Bearbeiten von Texten. Texte lassen sich formatieren und miteinander verknüpfen, so dass ein verzweigtes Nachschlagewerk entsteht. ', 'wiki.php', '3.1', 0, 0, 1, '', '', 1406641688), -('707b0db0e45fc3bab04be7eff38c1d32', 'de', '', '', 'Die Literaturseite bietet Lehrenden die Möglichkeit, Literaturlisten zu erstellen oder aus Literaturverwaltungsprogrammen zu importieren. Diese Listen können in Lehrveranstaltungen kopiert und sichtbar geschaltet werden. Je nach Anbindung kann im tatsächlichen Buchbestand der Hochschule recherchiert werden. ', 'dispatch.php/course/literature', '3.1', 0, 0, 1, '', '', 1406641688), -('8dd3b80d9f95218d67edc3cb570559ff', 'de', '', '', 'Hier lassen sich Literaturlisten bearbeiten und in der Veranstaltung sichtbar schalten (mit Klick auf das \"Auge\").', 'dispatch.php/literature/edit_list', '3.1', 0, 0, 1, '', '', 1406641688), -('e29098d188ae25c298d78978de50bf09', 'de', '', '', 'Hier kann in Katalogen nach Literatur gesucht und diese zur Merkliste hinzugefügt werden.', 'dispatch.php/literature/search', '3.1', 0, 0, 1, '', '', 1406641688), -('a1ea37130799a59f7774473f1a681141', 'de', '', '', 'Die Lernmodulschnittstelle ermöglicht es, Selbstlerneinheiten oder Tests aus externen Programmen wie ILIAS und LON-CAPA in Stud.IP zur Verfügung zu stellen.', 'dispatch.php/course/elearning/show', '3.1', 0, 0, 1, '', '', 1406641688), -('595c46d86f681f7da4bd2fae780db618', 'de', '', '', 'Wählen Sie das gewünschte System und anschließend das Lernmodul/ den Test aus. Schreibrechte bestimmen, wer zukünftig das Lernmodul bearbeiten darf. In der Sidebar befindet sich die Option \"Zuordnungen aktualisieren\", um geänderte Inhalte z.B. im ILIAS Kurs zu Stud.IP zu übertragen.', 'dispatch.php/course/elearning/edit', '3.1', 0, 0, 1, '', '', 1406641688), -('6529fd70b461fa4a9242e874fbf2a5d3', 'de', '', '', 'In DoIT! haben Lehrende die Möglichkeit, verschiedene Arten von Aufgaben zu stellen, inklusive Hochladen von Dateien, Multiple-Choice-Fragen und Peer Reviewing. Die Aufgabenbearbeitung kann zeitlich befristet werden und wahlweise in Gruppen erfolgen.', 'plugins.php/reloadedplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), -('95ff3a2a68dae73bcb14a4a538a8e4b5', 'de', '', '', 'Blubbern ist eine Mischform aus Forum und Chat, bei dem Beiträge der Teilnehmenden in Echtzeit angezeigt werden. Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'plugins.php/blubber/streams/forum', '3.1', 0, 0, 1, '', '', 1406641688), -('633dab120ce3969c42f33aeb3a59fcc1', 'de', '', '', 'Der Gruppenkalender bietet eine Übersicht über Veranstaltungstermine und personalisierte Zusatztermine für diese Veranstaltung. ', 'plugins.php/gruppenkalenderplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), -('1058f03da5b6fc6a5ff3a08c9c1fa5f7', 'de', '', '', 'Hier können der Veranstaltung weitere Funktionen hinzugefügt werden.', 'dispatch.php/course/plus', '3.1', 0, 0, 1, '', '', 1406641688), -('8a1d7d04c70d93be44e8fe6a8e8c3443', 'de', '', '', 'Das Lerntagebuch unterstützt den selbstgesteuerten Lernprozess der Studierenden und wird von ihnen selbstständig geführt. Anfragen zu Arbeitsschritten an die Lehrenden sind möglich, bestimmte Daten können individualisiert freigegeben werden.', 'plugins.php/lerntagebuchplugin/overview', '3.1', 0, 0, 1, '', '', 1406641688), -('72cec29d985f3e6d7df2b5fabb7fe666', 'de', '', '', 'Konfiguation des Lerntagebuchs für Studierende und Anlegen eines Lerntagebuchs für die Lehrenden.', 'plugins.php/lerntagebuchplugin/admin_settings', '3.1', 0, 0, 1, '', '', 1406641688), -('2fcc672d91f2627ab5ca48499e8b1617', 'de', '', '', 'Möglichkeit zur Bereitstellung von Vorlesungsaufzeichnungen und Podcasts für Studierende der Veranstaltung (durch Verlinkung auf die Dateien auf dem Medienserver). ', 'plugins.php/mediacastsplugin/show', '3.1', 0, 0, 1, '', '', 1406641688), -('bd0770f9eef5c10fc211114ac35fbe9b', 'de', '', '', 'Diese Seite zeigt die Studiengruppen an, denen die/der NutzerIn zugeordnet ist. Studiengruppen sind eine einfache Möglichkeit, mit Mitstudierenden, KollegInnen und anderen zusammenzuarbeiten. Jede/r NutzerIn kann Studiengruppen anlegen oder nach ihnen suchen. Die Farbgruppierung kann individuell angepasst werden.', 'dispatch.php/my_studygroups', '3.1', 0, 0, 1, '', '', 1406641688), -('82a17a5f19d211268b1fa90a1ebe0894', 'de', '', '', 'Hier kann eine neue Studiengruppe angelegt werden. Jede/r Stud.IP-NutzerIn kann Studiengruppen anlegen und nach eigenen Bedürfnissen konfigurieren.', 'dispatch.php/course/studygroup/new', '3.1', 0, 0, 1, '', '', 1406641688), -('e03cec310c0a884aee80c2d1eea3a53e', 'de', '', '', 'Diese Seite zeigt alle Studiengruppen an, die in Stud.IP existieren. Studiengruppen sind eine einfache Möglichkeit, mit Mitstudierenden, KollegInnen und anderen zusammenzuarbeiten. Jede/r NutzerIn kann Studiengruppen anlegen oder nach ihnen suchen.', 'dispatch.php/studygroup/browse', '3.1', 0, 0, 1, '', '', 1406641688), -('f92b5422246f585f051de1a81602dd56', 'de', '', '', 'Hier können Name, Funktionen und Zugangsbeschränkung der Studiengruppe bearbeitet werden.', 'dispatch.php/course/studygroup/edit', '3.1', 0, 0, 1, '', '', 1406641688), -('1dca5b0b83f7bca92ec4add50d34b8c5', 'de', '', '', 'Hier können der Studiengruppe Mitglieder hinzugefügt und Nachrichten an diese versendet werden.', 'dispatch.php/course/studygroup/members', '3.1', 0, 0, 1, '', '', 1406641688), -('1f6e2f98affbffb1d12904355e9313e5', 'de', '', '', 'Diese Seite zeigt die Einrichtungen an, denen die/der NutzerIn zugeordnet ist.', 'dispatch.php/my_institutes', '3.1', 0, 0, 1, '', '', 1406641688), -('bf9eb8f2c3842865009342b89fd35476', 'de', '', '', 'Die Nachrichtenseite bietet einen Überblick über erhaltene, systeminterne Nachrichten, welche mit selbstgewählten Schlüsselwörtern (sog. Tags) versehen werden können, um sie später leichter wieder auffinden zu können.', 'dispatch.php/messages/overview', '3.1', 0, 0, 1, '', '', 1406641688), -('6acc653cfabd3a0d4433ff0ab417bf6a', 'de', '', '', 'Übersicht über gesendete, systeminterne Nachrichten, welche mit selbstgewählten Schlüsselwörtern (sog. Tags) versehen werden können, um sie später leichter wieder auffinden zu können. ', 'dispatch.php/messages/sent', '3.1', 0, 0, 1, '', '', 1406641688), -('690e6eff3e83a5f372ec99fc49cafeb2', 'de', '', '', 'Blubbern ist das Stud.IP Echtzeitforum, eine Mischform aus Forum und Chat. Andere können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden. Texte lassen sich formatieren und durch Smileys ergänzen.', 'plugins.php/blubber/streams/global', '3.1', 0, 0, 1, '', '', 1406641688), -('cd69b74cd46172785bf2147fb0582e3c', 'de', '', '', 'Hier kann ein benutzerdefinierter Blubber-Stream erstellt werden. Er besteht immer aus einer Sammlung von Beiträgen aus ausgewählten Veranstaltungen, Kontaktgruppen und Schlagwörten, die auf Basis einer Filterung noch weiter eingeschränkt werden können. Der neue benutzerdefinierte Stream findet sich nach dem Klick auf den Speichern-Button in der Navigation unter Globaler Stream.', 'plugins.php/blubber/streams/edit', '3.1', 0, 0, 1, '', '', 1406641688), -('394a45f94e1d84d3744027a5a69d9e3e', 'de', '', '', 'Auf dieser Seite lässt sich einsehen, welche Kontakte gerade online sind. Diesen Personen kann eine Nachricht geschickt werden. Das Klicken auf den Namen einer Person leitet zu deren Profil weiter.', 'dispatch.php/online', '3.1', 0, 0, 1, '', '', 1406641688), -('245ce01d7a0175ab0b977ae822821e9e', 'de', '', '', 'Diese Seite bietet die Möglichkeit Stud.IP-Nutzende in das eigene Adressbuch einzutragen und alle bereits im Adressbuch befindlichen Kontakte aufzulisten.', 'contact.php', '3.1', 0, 0, 1, '', '', 1406641688), -('752d441cd321b05c55c8a5d9aa48ddce', 'de', '', '', 'Auf dieser Seite können Kontakte aus dem Adressbuch in selbstdefinierte Gruppen sortiert werden.', 'contact_statusgruppen.php', '3.1', 0, 0, 1, '', '', 1406641688), -('94a193baa212abbc9004280a1498e724', 'de', '', '', 'Hier können Kontaktgruppen oder das gesamte Adressbuch exportiert werden, um sie in einem externen Programm importieren zu können.', 'contact_export.php', '3.1', 0, 0, 1, '', '', 1406641688), -('7ebdd278d06f9fc1d2659a54bb3171c1', 'de', '', '', 'Die Rangliste sortiert die Stud.IP-Nutzenden absteigend anhand ihrer Punktzahl. Die Punktzahl wächst mit den Aktivitäten in Stud.IP und repräsentiert so die Erfahrung der Nutzenden mit dem System. Indem das Kästchen links mit einem Haken versehen wird, wird der eigene Wert für andere NutzerInnen in der Rangliste sichtbar gemacht. In der Grundeinstellung ist der eigene Wert nicht öffentlich sichtbar.', 'dispatch.php/score', '3.1', 0, 0, 1, '', '', 1406641688), -('82537b14dd3714ec9636124ed5af3272', 'de', '', '', 'Die Profilseite ermöglicht die Änderung der eigenen perönlichen Angaben inkl. Profilbild und Kategorien. Ähnlich wie in Facebook können Kommentare hinterlassen werden. Das Profil von Lehrenden enthält Sprechstunden und Raumangaben. Daneben bietet die Seite die Verwaltung eigener Dateien.', 'dispatch.php/profile', '3.1', 0, 0, 1, '', '', 1406641688), -('ebb5bc1d831d460c06e3c6662236c159', 'de', '', '', 'Hier kann ein Profilbild hochgeladen werden.', 'dispatch.php/settings/avatar', '3.1', 0, 0, 1, '', '', 1406641688), -('25255dc15fd0d6260bc1abd1f10aecc5', 'de', '', '', 'Individuelle persönliche Angaben, wie bspw. E-Mail-Adresse, können auf dieser Seite verändert und angepasst werden. ', 'dispatch.php/settings/account', '3.1', 0, 0, 1, '', '', 1406641688), -('d704267767d4c559aa9e552be60c49b5', 'de', '', '', 'Hier kann das Passwort für den Stud.IP-Account geändert werden.', 'dispatch.php/settings/password', '3.1', 0, 0, 1, '', '', 1406641688), -('cbd9b2b22fc00bc92df3589018644b70', 'de', '', '', 'Hier können vordefinierte Informationen über die eigene Person eingegeben werden, die auf der Profilseite erscheinen sollen. ', 'dispatch.php/settings/details', '3.1', 0, 0, 1, '', '', 1406641688), -('4e60dd9635f3d3fddecc78e0d1f646c7', 'de', '', '', 'Unter \"Studiendaten\" können manuell zusätzliche Studiengänge und Einrichtungen hinzugefügt werden, wenn sie nicht automatisch aus einem externen System (z.B. LSF/ UniVZ) übernommen wurden.', 'dispatch.php/settings/studies', '3.1', 0, 0, 1, '', '', 1406641688), -('462f1447b1a8a93ab7bdb2524f968b1a', 'de', '', '', 'Hier kann die Zugehörigkeit zu Nutzerdomänen eingesehen, aber nicht geändert werden.', 'dispatch.php/settings/userdomains', '3.1', 0, 0, 1, '', '', 1406641688), -('233564d01b8301ebec7ef2fe918d1290', 'de', '', '', 'Ansicht über die der/ dem Stud.IP-NutzerIn zugeordneten Einrichtungen.', 'dispatch.php/settings/statusgruppen', '3.1', 0, 0, 1, '', '', 1406641688), -('e315a4c547be7f17d427b227f0f9d982', 'de', '', '', 'Auf dieser Seite können selbstdefinierte Informationen über die eigene Person eingegeben werden, die auf der Profilseite erscheinen sollen. ', 'dispatch.php/settings/categories', '3.1', 0, 0, 1, '', '', 1406641688), -('ac5df1de9c75fc92af7718b2103d3037', 'de', '', '', 'Blubbern ist eine Mischform aus Forum und Chat. Nachrichten werden im öffentlichen Stream dargestellt. Andere Nutzer können über einen Beitrag informiert werden, indem sie per @benutzername oder @\"Vorname Nachname\" im Beitrag erwähnt werden.', 'plugins.php/blubber/streams/profile', '3.1', 0, 0, 1, '', '', 1406641688), -('4151003175042b71bea3529e5adc5a9e', 'de', '', '', 'Mit der Terminvergabe können Termine für Sprechstunden, Prüfungen usw. angelegt werden, in die sich Studierende selbst eintragen können.', 'plugins.php/homepageterminvergabeplugin/showadmin', '3.1', 0, 0, 1, '', '', 1406641688), -('63c2ecb12f30816aef0fb203eab4f40a', 'de', '', '', 'Hier können Termine angelegt und bearbeitet werden.', 'plugins.php/homepageterminvergabeplugin/show_category', '3.1', 0, 0, 1, '', '', 1406641688), -('164f77ab2cb7d38fd1ea20ed725834fd', 'de', '', '', 'Hier findet sich eine Übersicht über die Termine, die von Studierenden gebucht wurden.', 'plugins.php/homepageterminvergabeplugin/show_bookings', '3.1', 0, 0, 1, '', '', 1406641688), -('1289e991a93dce5a0b4edd678514325e', 'de', '', '', 'Hier können einzelne Inhaltselemente nachträglich aktiviert oder deaktiviert werden. Aktivierte Inhaltselemente fügen neue Funktionen zu Ihrem Profil oder Ihren Einstellungen hinzu. Diese werden meist als neuer Reiter im Menü erscheinen. Wenn Funktionalitäten nicht benötigt werden, können diese hier deaktiviert werden. Die entsprechenden Menüpunkte werden dann ausgeblendet.', 'dispatch.php/profilemodules', '3.1', 0, 0, 1, '', '', 1406641688), -('b677e8b5f1bd7e8acbe474177449c4e1', 'de', '', '', 'Die Dateiverwaltung bietet die Möglichkeit zum Hochladen, Verwalten und Herunterladen persönlicher Dateien, die nicht für andere einsehbar sind. ', 'dispatch.php/document/files', '3.1', 0, 0, 1, '', '', 1406641688), -('35b1860b95854a2533b6ecfbbf04ab71', 'de', '', '', 'Der Stundenplan besteht aus belegten Veranstaltungen, die ein- und ausgeblendet sowie in Darstellungsgröße und -form angepasst werden können.', 'dispatch.php/calendar/schedule', '3.1', 0, 0, 1, '', '', 1406641688), -('db5a995bd12ba8e2ae96adcabeb8c8f7', 'de', '', '', 'Der Terminkalender besteht aus belegten Veranstaltungen und eigenen Terminen. Er kann bearbeitet, in der Anzeige verändert und mit externen Programmen (z.B. Outlook) abgeglichen werden. ', 'calendar.php', '3.1', 0, 0, 1, '', '', 1406641688), -('87489a40097e5c26f1d1349c072610de', 'de', '', '', 'Mit der Veranstaltungssuche können Veranstaltungen, Studiengruppen usw. in verschiedenen Semestern und nach verschiedenen Suchkriterien (siehe \"Erweiterte Suche anzeigen\"in der Sidebar) gefunden werden. Das aktuelle Semester ist vorgewählt.', 'dispatch.php/search/courses', '3.1', 0, 0, 1, '', '', 1406641688), -('74863847eec53a3d4c8264d8de526be8', 'de', '', '', 'Mit der Archivsuche können Veranstaltungen gefunden werden, die bereits archiviert wurden.', 'archiv.php', '3.1', 0, 0, 1, '', '', 1406641688), -('14b77e9e0b7773c92db9e7344a23fcfc', 'de', '', '', 'Mit der Personensuche können NutzerInnen gefunden werden, solange deren Privatsphäre-Einstellung dies nicht verhindert. Die Suche kann auf bestimmte Veranstaltungen oder Einrichtungen begrenzt werden.', 'browse.php', '3.1', 0, 0, 1, '', '', 1406641688), -('4f9d79fe88e81486b8c1f192d70232d5', 'de', '', '', 'Mit der Einrichtungssuche können Einrichtungen über ein freies Suchfeld oder den Einrichtungsbaum gefunden werden.', 'institut_browse.php', '3.1', 0, 0, 1, '', '', 1406641688), -('014a2106d384c0ca55d9311597029ca0', 'de', '', '', 'Mit der Ressourcensuche können universitäre Ressourcen wie Räume, Gebäude etc. gefunden werden.', 'resources.php', '3.1', 0, 0, 1, '', '', 1406641688), -('60b6caf75d0004dfdb0a1adfd66027ed', 'de', '', '', 'Hier können Lehrende Ankündigungen für ihre Veranstaltungen, Einrichtungen und ihre Profilseite erstellen und anzeigen, wobei die Anzeige gefiltert werden kann.', 'dispatch.php/news/admin_news', '3.1', 0, 0, 1, '', '', 1406641688), -('f3deb7a01205637d71a66e2b90b24cba', 'de', '', '', 'Hier können RSS-Feeds, d.h. Nachrichtenströme von externen Internetseiten, auf der Startseite eingebunden werden. Je mehr Feeds eingebunden werden, desto länger dauert das Laden der Startseite.', 'dispatch.php/admin/rss_feeds', '3.1', 0, 0, 1, '', '', 1406641688), -('bc1d6ecab9364cfe2c549d262bfda437', 'de', '', '', 'Die Lernmodulschnittstelle ermöglicht es, Selbstlerneinheiten aus externen Programmen wie ILIAS und LON-CAPA in Stud.IP zur Verfügung zu stellen. Für jedes externe System wird ein eigener Benutzer-Account erstellt oder zugeordnet. Mit den entsprechenden Rechten können eigene Lernmodule erstellt werden.', 'dispatch.php/elearning/my_accounts', '3.1', 0, 0, 1, '', '', 1406641688), -('d1de152db139d8c12552610d2f7999c2', 'de', '', '', 'Mit dem Export können Daten über Veranstaltungen und MitarbeiterInnen in folgende Formate exportiert werden: RTF, TXT, CSV, PDF, HTML und XML.', 'export.php', '3.1', 0, 0, 1, '', '', 1406641688), -('2c55eab1f52d6f7d1021880836906f5b', 'de', '', '', 'Hier lassen sich Literaturlisten bearbeiten und in der Veranstaltung sichtbar schalten (mit Klick auf das \"Auge\").', 'dispatch.php/literature/edit_list.php', '3.1', 0, 0, 1, '', '', 1406641688); -"; - DBManager::get()->exec($query); - } - - function addHelpContentEN() { - $query = " -INSERT INTO `help_content` (`content_id`, `language`, `label`, `icon`, `content`, `route`, `studip_version`, `position`, `custom`, `visible`, `author_id`, `installation_id`, `mkdate`) VALUES -('c8e789a0efb73f00f00dacf565524c73', 'en', '', '', 'Various display options and notification features can be selected and changed in the general settings.', 'dispatch.php/settings/general', '3.1', 0, 0, 1, '', '', 1412942388), -('f5e59c4fc98e1df7fe29b8e9320853e7', 'en', '', '', 'The visibility and searchability for the own profile can be set in the privacy settings.', 'dispatch.php/settings/privacy', '3.1', 0, 0, 1, '', '', 1412942388), -('3b7a4c04017fef2984ee029610194f26', 'en', '', '', 'The settings of the message system offer the possibility e.g. to arrange for a forwarding of the messages received in Stud.IP to your e-mail address.', 'dispatch.php/settings/messaging', '3.1', 0, 0, 1, '', '', 1412942388), -('260ee12fdc7dccb30eca2cc075ef0096', 'en', '', '', 'The settings of the diary offer the possibility to adjust these to own needs .', 'dispatch.php/settings/calendar', '3.1', 0, 0, 1, '', '', 1412942388), -('43df8e33145c25eb6d941e4e845ada24', 'en', '', '', 'In the notification settings it is possible to select with which changes within a course notification is to be given.', 'dispatch.php/settings/notification', '3.1', 0, 0, 1, '', '', 1412942388), -('85c000e33732c5596d198776cb884860', 'en', '', '', 'In the standard substitution settings lecturers can stipulate a standard substitution, which can manage and change all courses of the lecturer.', 'dispatch.php/settings/deputies', '3.1', 0, 0, 1, '', '', 1412942388), -('b05b27450e363c38c6b4620b902b3496', 'en', '', '', 'The start page will be displayed after the log-in and can be customised to personal needs by using widgets.', 'dispatch.php/start', '3.1', 0, 0, 1, '', '', 1412942388), -('91d6f451c3ef8d8352a076773b0a19ee', 'en', '', '', 'The course page shows all subscribed courses (as a standard only those of the last two semesters), all subscribed study groups as well as all institutions, to which one was allocated. You can customise the display through colour groupings, semester filters, etc. ', 'dispatch.php/my_courses', '3.1', 0, 0, 1, '', '', 1412942388), -('0237ea35a203be81e44c979d82ef5ee6', 'en', '', '', 'Archived courses to which the user is allocated appear here. Contents can no longer be changed, however deposited documents can be downloaded as a zip file.', 'dispatch.php/my_courses/archive', '3.1', 0, 0, 1, '', '', 1412942388), -('d97eff1196f6aed8e94f7c5096ebd2a9', 'en', '', '', 'Course-related brief and detailed information, announcements, dates and surveys can be found in the overview.', 'dispatch.php/course/overview', '3.1', 0, 0, 1, '', '', 1412942388), -('357bbf06015b2738aae15837f581a07d', 'en', '', '', 'More detailed information about the course is displayed, such as e.g. the course number, allocations, lecturers, tutors, etc. In the detailed information it is possible to register for a course under actions.', 'dispatch.php/course/details', '3.1', 0, 0, 1, '', '', 1412942388), -('0c055cc6ae418a96ff3afa9db13098df', 'en', '', '', 'The properties of the course can be subsequently changed with the management functions. The simulation of the students view is possible under actions.', 'dispatch.php/course/management', '3.1', 0, 0, 1, '', '', 1412942388), -('615c1887f0ee080043f133681ebf0def', 'en', '', '', 'Title, description, lecturer, etc. can be changed in the basic data. The processing can partly be blocked if data are taken over from other systems (e.g. LSF/ UniVZ).', 'dispatch.php/course/basicdata/view', '3.1', 0, 0, 1, '', '', 1412942388), -('abfb5d03de288d02df436f9a8bb96d9d', 'en', '', '', 'The photo of the course, which can help students to distinguish between courses on the \"my courses\" page, can be changed with the photo-upload-function.', 'dispatch.php/course/avatar/update', '3.1', 0, 0, 1, '', '', 1412942388), -('eec46c5d8ea5523d959a8c334455c2ef', 'en', '', '', 'The course can be allocated to a field of study by using the field of study function. The processing can be blocked if data are taken over from other systems (e.g. LSF/ UniVZ).', 'dispatch.php/course/study_areas/show', '3.1', 0, 0, 1, '', '', 1412942388), -('85c709de75085bd56a739e4e8ac6fcad', 'en', '', '', 'The semester, date and room details of the course can be changed by using the time/room function. The processing can be blocked if data are taken over from other systems (e.g. LSF/ UniVZ).', 'raumzeit.php', '3.1', 0, 0, 1, '', '', 1412942388), -('4e14c94cda99e2ef6462f7fef06d9c91', 'en', '', '', 'The access to a course can be regulated with access authorisations (enrolment procedure) e.g. by passwords, time control and restriction to participants.', 'dispatch.php/course/admission', '3.1', 0, 0, 1, '', '', 1412942388), -('42060187921376807f90e52fad5f9822', 'en', '', '', '(Time-controlled) surveys or individual Multiple-/Single-Choice questions can be set up for courses, study groups or the profile by using the survey and test function.', 'admin_vote.php', '3.1', 0, 0, 1, '', '', 1412942388), -('5475d65b07fdaf5f234bf6eed3d5e4a9', 'en', '', '', 'With the evaluation function surveys can be set up with Multiple-Choice, Likert and free text questions for courses, study groups, the own profile or institutions. Public templates of other persons can be used hereby. All future, ongoing and ended evaluations are displayed.', 'admin_evaluation.php', '3.1', 0, 0, 1, '', '', 1412942388), -('80286432bf17df20e5f11f86b421b0a7', 'en', '', '', 'The forum is a text-based possibility, which is irrespective of time and place, to exchange questions, opinions and experience. Contributions can be subscribed to, exported, marked as favourites and edited. Various views (e.g. new contributions since the last login) can be chosen via the navigation links.', 'plugins.php/coreforum', '3.1', 0, 0, 1, '', '', 1412942388), -('3607d6daea679dcd7003e076fdd1660a', 'en', '', '', 'The list of participants shows a list of the participants of this course. Further participants can be added, removed, downgraded, upgraded or allocated to self-defined groups by lecturers.', 'dispatch.php/course/members', '3.1', 0, 0, 1, '', '', 1412942388), -('f529bca4d1626b43cbb8149feea41a84', 'en', '', '', 'The self-defined groups are displayed here. Messages can be sent to these. A click on the orange arrows before the group name will allocate you to the group.', 'statusgruppen.php', '3.1', 0, 0, 1, '', '', 1412942388), -('bd5df4fb7b84da79149c96c5f43de46c', 'en', '', '', 'Groups can be set up and managed here. If the self-entry is activated participants can enter and remove themselves.', 'admin_statusgruppe.php', '3.1', 0, 0, 1, '', '', 1412942388), -('8c2fc90bd8175e6d598f895944a8ddc2', 'en', '', '', 'The attendance list shows all meetings (meeting, lecture, exercise, internship) of the schedule and enables the entry of students in Stud.IP by the lecturers as well as an export of the list for the overview or as a basis for handwritten entries.', 'participantsattendanceplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), -('ee91ec0f9085221ada06d171a27d2405', 'en', '', '', 'The document administration offers the possibility to upload, link, administer and download documents. ', 'folder.php', '3.1', 0, 0, 1, '', '', 1412942388), -('8c3067596811d3c6857d253299e01f6f', 'en', '', '', 'The schedule displays dates, topics and rooms of the course. Individual dates can be edited, e.g. topics can be added to dates.', 'dispatch.php/course/dates', '3.1', 0, 0, 1, '', '', 1412942388), -('1f216fe42d879c3fcbb582d67e9ad5a2', 'en', '', '', 'Dates can be allocated topics here or already entered topics can be taken over and edited.', 'dispatch.php/course/topics', '3.1', 0, 0, 1, '', '', 1412942388), -('abaa7b076e6923ac43120f3326322af0', 'en', '', '', 'This page enables the deposit of free information, links, etc.', 'dispatch.php/course/scm', '3.1', 0, 0, 1, '', '', 1412942388), -('7edc08f2f7b0786ca036f8c448441e07', 'en', '', '', 'The Wiki enables a joint, asynchronous creation and editing of texts. Texts can be formatted and linked with each other so that a branched reference work is produced. ', 'wiki.php', '3.1', 0, 0, 1, '', '', 1412942388), -('44edb997707d1458cbf8a3f8f316b908', 'en', '', '', 'The bibliography page offers lecturers the possibility to create bibliographies or to import these from bibliography management programmes. These lists can be copied and placed visibly in courses. Research can be conducted in the actual book stocks of the university depending on the connection. ', 'dispatch.php/course/literature', '3.1', 0, 0, 1, '', '', 1412942388), -('1cb8fd77427ebc092d751eea95454b0a', 'en', '', '', 'Bibliographies can be edited here and placed visibly in the course (with a click on the \"eye\").', 'dispatch.php/literature/edit_list', '3.1', 0, 0, 1, '', '', 1412942388), -('b283b58820db358284f4451dfb691678', 'en', '', '', 'A search can be conducted for literature in catalogues here and these added to the clipboard.', 'dispatch.php/literature/search', '3.1', 0, 0, 1, '', '', 1412942388), -('0d83ce036f2870f873446230c0118bb7', 'en', '', '', 'The learning module interface makes it possible for self-learning units or tests to be made available from external programmes such as ILIAS and LON-CAPA in Stud.IP.', 'dispatch.php/course/elearning/show', '3.1', 0, 0, 1, '', '', 1412942388), -('8b690f942bf0cc0322e5bea0f1b9abed', 'en', '', '', 'Select the requested system and subsequently the learning module/ the test. Writing rights determine who may edit the learning module in future. The option \"update allocations\" is located in the sidebar in order to transfer changed contents e.g. in the ILIAS course to Stud.IP.', 'dispatch.php/course/elearning/edit', '3.1', 0, 0, 1, '', '', 1412942388), -('0838a96b5678e2fc26be0ee38ae67619', 'en', '', '', 'In DoIT! lecturers have the possibility to set various types of tasks, including the uploading of files, Multiple-Choice questions and Peer Reviewing. The processing of tasks can be time limited and alternatively carried out in groups.', 'plugins.php/reloadedplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), -('1804e526c2f6794b877a4b2096eaa67a', 'en', '', '', 'Blubbering is a mixed form of forum and chat, with which contributions of the participants are displayed in real time. Others can be informed about a contribution by the fact that they are mentioned in the contribution by @user name or @''first name''.', 'plugins.php/blubber/streams/forum', '3.1', 0, 0, 1, '', '', 1412942388), -('38d1a86517eb6cc195b2e921270c3035', 'en', '', '', 'The group calendar offers an overview of course dates and personalised additional dates for this course. ', 'plugins.php/gruppenkalenderplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), -('852991dc733639dd2df05fb627abf3db', 'en', '', '', 'Further features can be added to the course here.', 'dispatch.php/course/plus', '3.1', 0, 0, 1, '', '', 1412942388), -('1ea099717ceb1b401aedcedc89814d9c', 'en', '', '', 'The learning diary supports the self-controlled learning process of the students and is kept independently by them. Enquiries for work steps to the lecturers are possible, certain data can be released individualised.', 'plugins.php/lerntagebuchplugin/overview', '3.1', 0, 0, 1, '', '', 1412942388), -('2075fe42f56207fbd153a810188f1beb', 'en', '', '', 'Configuration of the learning diary for students and creation of a learning diary for the lecturers.', 'plugins.php/lerntagebuchplugin/admin_settings', '3.1', 0, 0, 1, '', '', 1412942388), -('7465a4aeedb6a320d3455cf9ad0bebd0', 'en', '', '', 'Possibility for providing lecture recordings and pod casts for students of the course (by linking to the documents on the media server). ', 'plugins.php/mediacastsplugin/show', '3.1', 0, 0, 1, '', '', 1412942388), -('02b4e3ce7b8fe6b3e6a3586d410a51a1', 'en', '', '', 'This page displays the study groups to which the user is allocated. Study groups are a simple possibility to cooperate with fellow students, colleagues and others. Each user can create study groups or search for them. The colour grouping can be adjusted individually.', 'dispatch.php/my_studygroups', '3.1', 0, 0, 1, '', '', 1412942388), -('af7573cce1e898054db89a96284866f9', 'en', '', '', 'A new study group can be created here. Each Stud.IP user can create study groups and configure these according to own needs.', 'dispatch.php/course/studygroup/new', '3.1', 0, 0, 1, '', '', 1412942388), -('960d7bafb618853eced1b1b42a7dd412', 'en', '', '', 'This page displays all study groups, which exist in Stud.IP. Study groups are a simple possibility to cooperate with fellow students, colleagues and others. Each user can create study groups or search for them.', 'dispatch.php/studygroup/browse', '3.1', 0, 0, 1, '', '', 1412942388), -('3d040e95a8c29e733a8d5439ee9f5b59', 'en', '', '', 'The name, functions and access restriction of the study group can be edited here.', 'dispatch.php/course/studygroup/edit', '3.1', 0, 0, 1, '', '', 1412942388), -('b3bd33cb0babbb0cc51a4f429d15d438', 'en', '', '', 'Here you can add new memebers to the study group und send them messages.', 'dispatch.php/course/studygroup/members', '3.1', 0, 0, 1, '', '', 1412942388), -('438c4456f85afec29fd9f47c111136c1', 'en', '', '', 'This page displays the institutions to which the user is allocated.', 'dispatch.php/my_institutes', '3.1', 0, 0, 1, '', '', 1412942388), -('f966e348174927565b94e606bbcf064f', 'en', '', '', 'The message page offers an overview on received, system-internal messages, which can be issued with self-chosen key words (so-called tags) in order to subsequently be able to find them easier.', 'dispatch.php/messages/overview', '3.1', 0, 0, 1, '', '', 1412942388), -('ceb21257092b11dcf6897d5bb3085642', 'en', '', '', 'Overview on sent, system-internal messages, which can be issued with self-chosen key words (so-called \"tags\") in order to subsequently be able to find them easier. ', 'dispatch.php/messages/sent', '3.1', 0, 0, 1, '', '', 1412942388), -('b9586c280a0092f86f9392fe5b5ff2a0', 'en', '', '', 'Blubbering is the Stud.IP real time forum, a mixed form of forum and chat. Others can be informed about a contribution by the fact that they are mentioned in the contribution by @user name or @''first name''. Texts can be formatted and supplemented by Smileys.', 'plugins.php/blubber/streams/global', '3.1', 0, 0, 1, '', '', 1412942388), -('7cb7026818c4b90935009d0548300674', 'en', '', '', 'A user-defined blubber stream can be created here. It always consists of a collection of contributions from selected courses, contact groups and key words, which can be restricted even further based on a filtering. The new user-defined stream can be found after clicking on the save button in the navigation under global stream.', 'plugins.php/blubber/streams/edit', '3.1', 0, 0, 1, '', '', 1412942388), -('2f1602394a4e31c2e30706f0a0b3112f', 'en', '', '', 'On this page it can be viewed which contacts are online at the moment. A message can be sent to these persons. The clicking on the name of one person forwards to their profile.', 'dispatch.php/online', '3.1', 0, 0, 1, '', '', 1412942388), -('27c4d9837cfb1a9a40c079e16daac902', 'en', '', '', 'This page offers the possibility to enter Stud.IP users in the address book and to list all contacts who can already be found in the address book.', 'contact.php', '3.1', 0, 0, 1, '', '', 1412942388), -('362a67fff2ef7af8cca9f8e20583c9f2', 'en', '', '', 'Contacts from the address book can be displayed sorted according to the groups here.', '???', '3.1', 0, 0, 1, '', '', 1412942388), -('6b331f5cc2176daba82a0cc71aaa576f', 'en', '', '', 'Contacts from the address book can be sorted in self-defined groups on this page.', 'contact_statusgruppen.php', '3.1', 0, 0, 1, '', '', 1412942388), -('57f1b29d3c1a558f5cc799c1aade7f14', 'en', '', '', 'Contact groups or the whole address book can be exported here in order to be able to import them in an external programme.', 'contact_export.php', '3.1', 0, 0, 1, '', '', 1412942388), -('90ffbd715843b02b3961907f81caf208', 'en', '', '', 'The ranking sorts the Stud.IP users in descending order based on their number of points. The number of points will grow with the activities in Stud.IP and thus represents the experience of the users with the system. By entering a check mark in the little box on the left the own value will be made visible in the ranking for other users. The own value is not visible to the public in the basic settings.', 'dispatch.php/score', '3.1', 0, 0, 1, '', '', 1412942388), -('e5bff29f7adee43202a2aa8f3f0a6ec7', 'en', '', '', 'You can change your own user data incl. profile photo and categories here. Comments can be left similar to Facebook. The profile of lecturers includes consulting hours and room details. In addition the page offers the administration of own documents.', 'dispatch.php/profile', '3.1', 0, 0, 1, '', '', 1412942388), -('2a389c2472656121a76ca4f3b0e137d4', 'en', '', '', 'A profile photo can be uploaded here.', 'dispatch.php/settings/avatar', '3.1', 0, 0, 1, '', '', 1412942388), -('fe23b56f4d691c0f5e2f872e37ce38b5', 'en', '', '', 'You can change and customise your individual user data, such as for example mail address, on this page. ', 'dispatch.php/settings/account', '3.1', 0, 0, 1, '', '', 1412942388), -('b32cb2c4ec56e925b07a5cb0105a6888', 'en', '', '', 'The password for the Stud.IP-Account can be changed here.', 'dispatch.php/settings/password', '3.1', 0, 0, 1, '', '', 1412942388), -('83fd70727605c485a0d8f2c5ef94289b', 'en', '', '', 'Pre-defined information about the own person can be entered here, which is to appear on the profile page. ', 'dispatch.php/settings/details', '3.1', 0, 0, 1, '', '', 1412942388), -('970ebdf39ad5ca89083a52723c5c35f5', 'en', '', '', 'Additional courses of study and institutions can be added manually under \"study details\", if they are not automatically taken over from an external system (e.g. LSF/UniVZ).', 'dispatch.php/settings/studies', '3.1', 0, 0, 1, '', '', 1412942388), -('0e816d9428a3bc8a73fb0042fb2da540', 'en', '', '', 'The affiliation to user domains can be viewed, however not changed, here.', 'dispatch.php/settings/userdomains', '3.1', 0, 0, 1, '', '', 1412942388), -('d04ca1f9e867ee295a3025dac7ce9c7b', 'en', '', '', 'View of the institutions allocated to the Stud.IP user.', 'dispatch.php/settings/statusgruppen', '3.1', 0, 0, 1, '', '', 1412942388), -('8ad364363acd415631226d5574d5592a', 'en', '', '', 'Self-defined information about the own person can be entered on this page, which is to appear on the profile page. ', 'dispatch.php/settings/categories', '3.1', 0, 0, 1, '', '', 1412942388), -('51a0399250de6365619c961ec3669ad3', 'en', '', '', 'Blubbering is a mixed form of forum and chat. Messages are presented in the public stream. Other users can be informed about a contribution by the fact that they are mentioned in the contribution by @user name or @''first name last name''.', 'plugins.php/blubber/streams/profile', '3.1', 0, 0, 1, '', '', 1412942388), -('5ae72abc0822570bfe839e3ee24f0c81', 'en', '', '', 'With the allocation of dates, dates can be created for consulting hours, examinations, etc., in which students can enter themselves.', 'plugins.php/homepageterminvergabeplugin/showadmin', '3.1', 0, 0, 1, '', '', 1412942388), -('76195b21d485823fd7ca2fd499131c12', 'en', '', '', 'Dates can be created and edited here.', 'plugins.php/homepageterminvergabeplugin/show_category', '3.1', 0, 0, 1, '', '', 1412942388), -('0ad754cc62d1e86e97c1a28dd68ac40c', 'en', '', '', 'An overview on the dates, which were booked by students can be found here.', 'plugins.php/homepageterminvergabeplugin/show_bookings', '3.1', 0, 0, 1, '', '', 1412942388), -('b5fabb1e5aed7ff8520314e9a86c5c87', 'en', '', '', 'Individual content elements can be subsequently activated or deactivated here. Activated content elements add new functions to your profile or your settings. These will mostly appear as a new tab in the menu. If functionalities are not required these can be deactivated here. The corresponding menu tabs are then faded out.', 'dispatch.php/profilemodules/index', '3.1', 0, 0, 1, '', '', 1412942388), -('51b98d659590e1e37dae5e5e5cc028bb', 'en', '', '', 'The document administration offers the possibility to upload, manage and download personal documents,which cannot be viewed by others. ', 'dispatch.php/document/files', '3.1', 0, 0, 1, '', '', 1412942388), -('440e50f7fcc825368aa9026273d2cd0d', 'en', '', '', 'The schedule of studies consists of subscribed courses, which can be faded in and out as well as customised in the size and form of the presentation.', 'dispatch.php/calendar/schedule', '3.1', 0, 0, 1, '', '', 1412942388), -('dddf5fd4406da0d91c9f121fcae607ad', 'en', '', '', 'The diary consists of subscribed courses and own dates. It can be edited, change in the display and compared with external programmes (e.g. Outlook). ', 'calendar.php', '3.1', 0, 0, 1, '', '', 1412942388), -('a1e3da35edc9b605f670e9c7f5019888', 'en', '', '', 'With the course search courses, study groups, etc. can be found in various semesters and according to various search criteria (see \"display extended search\" in the sidebar). The current semester is pre-selected.', 'dispatch.php/search/courses', '3.1', 0, 0, 1, '', '', 1412942388), -('7d40379f54250b550065e062d71e8fd8', 'en', '', '', 'Various courses can be found with the archive search, which have already been archived.', 'archiv.php', '3.1', 0, 0, 1, '', '', 1412942388), -('ebcc460880b8a63af3f6e7eade97db78', 'en', '', '', 'Users can be found with the search for persons as long as their privacy setting does not prevent this. The search can be limited to certain courses or institutions.', 'browse.php', '3.1', 0, 0, 1, '', '', 1412942388), -('8a32ca4e602a68307d4ae6ae51fa667e', 'en', '', '', 'With the institution search institutions can be found via a free search field or the institution tree', 'institut_browse.php', '3.1', 0, 0, 1, '', '', 1412942388), -('e206a4257e31a0f32ac516cefb8e8331', 'en', '', '', 'University resources such as rooms, buildings, etc. can be found using the resource search.', 'resources.php', '3.1', 0, 0, 1, '', '', 1412942388), -('3318ee99a062079b463e902348ad520e', 'en', '', '', 'Lecturers can create and display announcements for their courses, institutions and their profile page here, whereby the display can be filtered.', 'dispatch.php/news/admin_news', '3.1', 0, 0, 1, '', '', 1412942388), -('bcdedaf1b4bd3b96ef574e8230095b28', 'en', '', '', 'RSS-Feeds, i.e. message streams of external websites, can be integrated onto the start page here. The more feeds are integrated, the longer the loading of the start page will take.', 'dispatch.php/admin/rss_feeds', '3.1', 0, 0, 1, '', '', 1412942388), -('bfb70d5f036769d740fb2342b0b58183', 'en', '', '', 'The learning module interface makes it possible for self-learning units to be made available from external programmes such as ILIAS and LON-CAPA in Stud.IP. An own user account will be created or allocated for each external system. Own learning modules can be created with the corresponding rights.', 'dispatch.php/elearning/my_accounts', '3.1', 0, 0, 1, '', '', 1412942388), -('7bf322a6c5f13db67e047b7afae83e58', 'en', '', '', 'With the export data about courses and employees can be exported in the following formats: RTF, TXT, CSV, PDF, HTML and XML.', 'export.php', '3.1', 0, 0, 1, '', '', 1412942388), -('fa4bf491690645a5f12556f77e51233c', 'en', '', '', 'Bibliographies can be edited here and placed visibly in the course (with a click on the \"eye\").', 'dispatch.php/literature/edit_list.php', '3.1', 0, 0, 1, '', '', 1412942388); - - "; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/151_add_automatic_updates_to_plugins.php b/db/migrations/151_add_automatic_updates_to_plugins.php deleted file mode 100644 index 6b4cbb3..0000000 --- a/db/migrations/151_add_automatic_updates_to_plugins.php +++ /dev/null @@ -1,25 +0,0 @@ -exec(" - ALTER TABLE `plugins` ADD `automatic_update_url` VARCHAR( 256 ) NULL DEFAULT NULL AFTER `dependentonid` , - ADD `automatic_update_secret` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `automatic_update_url` - "); - } - - function down() - { - DBManager::get()->exec("ALTER TABLE `plugins` DROP COLUMN `automatic_update_secret` "); - DBManager::get()->exec("ALTER TABLE `plugins` DROP COLUMN `automatic_update_url` "); - } -} diff --git a/db/migrations/152_tic_5117_course_member_admission.php b/db/migrations/152_tic_5117_course_member_admission.php deleted file mode 100644 index e729135..0000000 --- a/db/migrations/152_tic_5117_course_member_admission.php +++ /dev/null @@ -1,36 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `coursememberadmissions` ( - `rule_id` varchar(32), - `message` text NOT NULL, - `start_time` int(11) NOT NULL DEFAULT 0, - `end_time` int(11) NOT NULL DEFAULT 0, - `course_id` varchar(32) NOT NULL DEFAULT '', - `modus` tinyint(1) NOT NULL DEFAULT 0, - `mkdate` int(11) NOT NULL DEFAULT 0, - `chdate` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) - ) ENGINE=MyISAM - "); - DBManager::get()->exec("INSERT IGNORE INTO `admissionrules` (`id`, `ruletype`, `active`, `mkdate`) - VALUES (NULL, 'CourseMemberAdmission', '1', UNIX_TIMESTAMP())"); - } - - function down() - { - DBManager::get()->exec("DROP TABLE `coursememberadmissions`"); - DBManager::get()->exec("DELETE FROM `admissionrules` WHERE `ruletype` = 'CourseMemberAdmission'"); - } -} diff --git a/db/migrations/153_tic_4163_add_studip_shortname.php b/db/migrations/153_tic_4163_add_studip_shortname.php deleted file mode 100644 index 793def6..0000000 --- a/db/migrations/153_tic_4163_add_studip_shortname.php +++ /dev/null @@ -1,35 +0,0 @@ -create('STUDIP_SHORT_NAME', [ - 'value' => 'Stud.IP', - 'is_default' => 'Stud.IP', - 'type' => 'string', - 'range' => 'global', - 'section' => 'global', - 'description' => _('Studip Kurzname') - ]); - } - - function down() { - Config::get()->delete('STUDIP_SHORT_NAME'); - } - -} diff --git a/db/migrations/154_recalculate_score.php b/db/migrations/154_recalculate_score.php deleted file mode 100644 index 158582e..0000000 --- a/db/migrations/154_recalculate_score.php +++ /dev/null @@ -1,145 +0,0 @@ -prepare(" - ALTER TABLE message ADD INDEX autor_id (autor_id) - "); - $statement->execute(); - } catch (PDOException $e) {} - - $statement = DBManager::get()->prepare(" - SELECT user_id FROM user_info WHERE score > 0 - "); - $statement->execute(); - while ($user_id = $statement->fetch(PDO::FETCH_COLUMN, 0)) { - self::getScore($user_id); - } - } - - function down() { - - } - - /** - * Retrieves a user's score by aggregating activities from database - * and writes the result to database and cache. - * - * @param string $user_id the user to calculate the score for - * @return int The given user's score. - */ - private static function getScore($user_id) - { - $user_id || $user_id = $GLOBALS['user']->id; - $cache = StudipCacheFactory::getCache(); - if ($cache->read("user_score_of_".$user_id)) { - return $cache->read("user_score_of_".$user_id); - } - //Behold! The all new mighty score algorithm! - //Step 1: Select all activities as mkdate-timestamps. - //Step 2: Group these activities to timeslots of halfhours - // with COUNT(*) as a weigh of the timeslot. - //Step 3: Calculate the measurement of the timeslot from the weigh of it. - // This makes the first activity count fully, the second - // almost half and so on. We use log_n to make huge amounts of - // activities to not count so much. - //Step 4: Calculate a single score for each timeslot depending on the - // measurement and the mkdate-timestamp. Use arctan as the function - // here so that older activities tend to zero. - //Step 5: Sum all scores from all timeslots together. - $sql = "SELECT ROUND(SUM((-atan(measurement / " . round(31556926 / 1800) . ") / PI() + 0.5) * 200)) AS score - FROM ( - SELECT ((UNIX_TIMESTAMP() / 1800) - timeslot) / (LN(weigh) + 1) AS measurement - FROM ( - SELECT (round(mkdate / 1800)) as timeslot, COUNT(*) AS weigh - FROM (" . self::createTimestampQuery() . ") AS mkdates - GROUP BY timeslot - ) AS measurements - ) AS dates"; - $stmt = DBManager::get()->prepare($sql); - $stmt->execute([':user' => $user_id]); - $score = $stmt->fetchColumn(); - - $query = "UPDATE user_info SET score = ? WHERE user_id = ? AND score > 0"; - $statement = DBManager::get()->prepare($query); - $statement->execute([$score, $user_id]); - - $cache->write("user_score_of_".$user_id, $score, 60 * 5); - - return $score; - } - - private static function createTimestampQuery() - { - $statements = []; - foreach (self::getActivityTables() as $table) { - $statements[] = "SELECT " - . ($table['date_column'] ? : 'mkdate') - . " AS mkdate FROM " - . $table['table'] - . " WHERE " - . ($table['user_id_column'] ? : 'user_id') - . " = :user " - . ($table['where'] ? (' AND ' . $table['where']) : ''); - } - return join(' UNION ', $statements); - } - - private static function getActivityTables() - { - $tables = []; - $tables[] = ['table' => "user_info"]; - $tables[] = ['table' => "comments"]; - $tables[] = ['table' => "dokumente"]; - $tables[] = ['table' => "forum_entries"]; - $tables[] = ['table' => "news"]; - $tables[] = ['table' => "seminar_user"]; - $tables[] = [ - 'table' => "blubber", - 'where' => "context_type != 'private'" - ]; - $tables[] = [ - 'table' => "kategorien", - 'user_id_column' => "range_id" - ]; - $tables[] = [ - 'table' => "message", - 'user_id_column' => "autor_id" - ]; - $tables[] = [ - 'table' => "vote", - 'user_id_column' => "range_id" - ]; - $tables[] = [ - 'table' => "voteanswers_user", - 'date_column' => "votedate" - ]; - $tables[] = [ - 'table' => "vote_user", - 'date_column' => "votedate" - ]; - $tables[] = [ - 'table' => "wiki", - 'date_column' => "chdate" - ]; - - foreach (PluginManager::getInstance()->getPlugins("ScorePlugin") as $plugin) { - foreach ((array) $plugin->getPluginActivityTables() as $table) { - if ($table['table']) { - $tables[] = $table; - } - } - } - - return $tables; - } - -} - diff --git a/db/migrations/155_tic_5170_clean_up.php b/db/migrations/155_tic_5170_clean_up.php deleted file mode 100644 index 7030ead..0000000 --- a/db/migrations/155_tic_5170_clean_up.php +++ /dev/null @@ -1,25 +0,0 @@ -exec("ALTER TABLE `message` DROP `chat_id`, DROP `readed`"); - $db->exec("ALTER TABLE `message_user` DROP `confirmed_read`"); - try { - $db->exec("ALTER TABLE `message_user` DROP COLUMN `dont_delete`"); - } catch (Exception $e) { } - $db->exec("ALTER TABLE `user_info` DROP `guestbook`"); - $db->exec("DROP TABLE object_rate"); - $db->exec("DROP TABLE object_user"); - $db->exec("DROP TABLE px_topics"); - $db->exec("DROP TABLE rss_feeds"); - $db->exec("DELETE FROM user_visibility_settings WHERE plugin IS NOT NULL"); - $db->exec("DELETE FROM user_visibility_settings WHERE identifier = 'plugins'"); - } -} diff --git a/db/migrations/156_tic_5204_add_datafield_type.php b/db/migrations/156_tic_5204_add_datafield_type.php deleted file mode 100644 index 951288a..0000000 --- a/db/migrations/156_tic_5204_add_datafield_type.php +++ /dev/null @@ -1,15 +0,0 @@ -exec("ALTER TABLE `datafields` CHANGE `type` `type` ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') NOT NULL DEFAULT 'textline'"); - $db->exec("ALTER TABLE `datafields` ADD `is_userfilter` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `is_required`"); - } -} diff --git a/db/migrations/157_contact_rework.php b/db/migrations/157_contact_rework.php deleted file mode 100644 index 178847b..0000000 --- a/db/migrations/157_contact_rework.php +++ /dev/null @@ -1,48 +0,0 @@ -exec("DROP TABLE IF EXISTS contact_userinfo"); - DBManager::get()->exec("CREATE TABLE `contact_new` ( - `owner_id` varchar(32) NOT NULL DEFAULT '', - `user_id` varchar(32) NOT NULL DEFAULT '', - `calpermission` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (`owner_id`,`user_id`), - KEY `user_id` (`user_id`) - ) ENGINE=MyISAM"); - DBManager::get()->exec("INSERT INTO `contact_new` SELECT `owner_id`,`user_id`, MAX(`calpermission`) FROM `contact` GROUP BY `owner_id`,`user_id`"); - DBManager::get()->exec("DROP TABLE `contact`"); - DBManager::get()->exec("RENAME TABLE `contact_new` TO `contact`"); - - Config::get()->delete("FOAF_ENABLE"); - Config::get()->delete("FOAF_SHOW_IDENTITY"); - } - - public function down() - { - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `contact_userinfo` ( - `userinfo_id` varchar(32) NOT NULL DEFAULT '', - `contact_id` varchar(32) NOT NULL DEFAULT '', - `name` varchar(255) NOT NULL DEFAULT '', - `content` text NOT NULL, - `priority` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`userinfo_id`), - KEY `contact_id` (`contact_id`), - KEY `priority` (`priority`) - ) ENGINE=MyISAM;"); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `contact` ( - `contact_id` varchar(32) NOT NULL DEFAULT '', - `owner_id` varchar(32) NOT NULL DEFAULT '', - `user_id` varchar(32) NOT NULL DEFAULT '', - `buddy` tinyint(4) NOT NULL DEFAULT '1', - `calpermission` tinyint(2) unsigned NOT NULL DEFAULT '1' - ) ENGINE=MyISAM;"); - DBManager::get()->exec("ALTER TABLE contact ADD COLUMN buddy tinyint(4) NOT NULL DEFAULT '1'"); - } -} diff --git a/db/migrations/158_step_00283_calendar_sorm.php b/db/migrations/158_step_00283_calendar_sorm.php deleted file mode 100644 index 3b9bdca..0000000 --- a/db/migrations/158_step_00283_calendar_sorm.php +++ /dev/null @@ -1,139 +0,0 @@ -exec( - "CREATE TABLE IF NOT EXISTS `event_data` ( - `event_id` varchar(32) NOT NULL, - `autor_id` varchar(32) NOT NULL, - `editor_id` varchar(32) DEFAULT NULL, - `uid` varchar(255) NOT NULL, - `start` int(10) unsigned NOT NULL DEFAULT '0', - `end` int(10) unsigned NOT NULL DEFAULT '0', - `summary` varchar(255) NOT NULL DEFAULT '', - `description` text, - `class` enum('PUBLIC','PRIVATE','CONFIDENTIAL') NOT NULL DEFAULT 'PRIVATE', - `categories` tinytext, - `category_intern` tinyint(3) unsigned NOT NULL DEFAULT '0', - `priority` tinyint(3) unsigned NOT NULL DEFAULT '0', - `location` tinytext, - `ts` int(10) unsigned NOT NULL DEFAULT '0', - `linterval` smallint(5) unsigned DEFAULT NULL, - `sinterval` smallint(5) unsigned DEFAULT NULL, - `wdays` varchar(7) DEFAULT NULL, - `month` tinyint(3) unsigned DEFAULT NULL, - `day` tinyint(3) unsigned DEFAULT NULL, - `rtype` enum('SINGLE','DAILY','WEEKLY','MONTHLY','YEARLY') NOT NULL DEFAULT 'SINGLE', - `duration` smallint(5) unsigned NOT NULL DEFAULT '0', - `count` smallint(5) DEFAULT '0', - `expire` int(10) unsigned NOT NULL DEFAULT '0', - `exceptions` text, - `mkdate` int(10) unsigned NOT NULL DEFAULT '0', - `chdate` int(10) unsigned NOT NULL DEFAULT '0', - `importdate` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`event_id`), - UNIQUE KEY `uid` (`uid`), - KEY `autor_id` (`autor_id`) - ) ENGINE=MyISAM"); - DBManager::get()->execute( - "CREATE TABLE IF NOT EXISTS `calendar_event` ( - `range_id` varchar(32) NOT NULL, - `event_id` varchar(32) NOT NULL, - `group_status` tinyint(4) unsigned NOT NULL DEFAULT '0', - `chdate` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`range_id`, `event_id`) - ) ENGINE=MYISAM"); - DBManager::get()->execute( - "INSERT IGNORE INTO `event_data` - (`event_id`, `autor_id`, `editor_id`, `uid`, `start`, `end`, - `summary`, `description`, `class`, `categories`, `category_intern`, - `priority`, `location`, `ts`, `linterval`, `sinterval`, `wdays`, - `month`, `day`, `rtype`, `duration`, `count`, `expire`, `exceptions`, - `mkdate`, `chdate`, `importdate`) - SELECT `event_id`, `autor_id`, NULLIF(`editor_id`, ''), - `uid`, `start`, `end`, - `summary`, `description`, `class`, `categories`, `category_intern`, - `priority`, `location`, `ts`, `linterval`, `sinterval`, `wdays`, - `month`, `day`, `rtype`, `duration`, `count`, `expire`, `exceptions`, - `mkdate`, `chdate`, `importdate` - FROM calendar_events WHERE 1 GROUP BY `event_id`"); - DBManager::get()->execute( - "INSERT IGNORE INTO `calendar_event` - (`range_id`, `event_id`, `chdate`) - SELECT `range_id`, `event_id`, `chdate` - FROM `calendar_events` WHERE 1"); - DBManager::get()->exec('DROP TABLE IF EXISTS calendar_events'); - - DBManager::get()->exec('ALTER TABLE contact CHANGE ' - . "`calpermission` `calpermission` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"); - DBManager::get()->exec("UPDATE IGNORE contact SET calpermission = '0' " - . "WHERE calpermission = '1'"); - } - - public function down() - { - DBManager::get()->execute( - "CREATE TABLE IF NOT EXISTS `calendar_events` ( - `event_id` varchar(32) NOT NULL DEFAULT '', - `range_id` varchar(32) NOT NULL DEFAULT '', - `autor_id` varchar(32) NOT NULL DEFAULT '', - `editor_id` varchar(32) NOT NULL, - `uid` varchar(255) NOT NULL DEFAULT '', - `start` int(10) unsigned NOT NULL DEFAULT '0', - `end` int(10) unsigned NOT NULL DEFAULT '0', - `summary` varchar(255) NOT NULL DEFAULT '', - `description` text, - `class` enum('PUBLIC','PRIVATE','CONFIDENTIAL') NOT NULL DEFAULT 'PRIVATE', - `categories` tinytext, - `category_intern` tinyint(3) unsigned NOT NULL DEFAULT '0', - `priority` tinyint(3) unsigned NOT NULL DEFAULT '0', - `location` tinytext, - `ts` int(10) unsigned NOT NULL DEFAULT '0', - `linterval` smallint(5) unsigned DEFAULT NULL, - `sinterval` smallint(5) unsigned DEFAULT NULL, - `wdays` varchar(7) DEFAULT NULL, - `month` tinyint(3) unsigned DEFAULT NULL, - `day` tinyint(3) unsigned DEFAULT NULL, - `rtype` enum('SINGLE','DAILY','WEEKLY','MONTHLY','YEARLY') NOT NULL DEFAULT 'SINGLE', - `duration` smallint(5) unsigned NOT NULL DEFAULT '0', - `count` smallint(5) DEFAULT '0', - `expire` int(10) unsigned NOT NULL DEFAULT '0', - `exceptions` text, - `mkdate` int(10) unsigned NOT NULL DEFAULT '0', - `chdate` int(10) unsigned NOT NULL DEFAULT '0', - `importdate` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`event_id`), - UNIQUE KEY `uid_range` (`uid`,`range_id`), - KEY `range_id` (`range_id`), - KEY `autor_id` (`autor_id`) - ) ENGINE=MyISAM;"); - DBManager::get()->execute( - "INSERT INTO `calendar_events` - (`event_id`, `range_id`, `autor_id`, `editor_id`, `uid`, `start`, `end`, - `summary`, `description`, `class`, `categories`, `category_intern`, - `priority`, `location`, `ts`, `linterval`, `sinterval`, `wdays`, - `month`, `day`, `rtype`, `duration`, `count`, `expire`, `exceptions`, - `mkdate`, `chdate`, `importdate`) - SELECT e.`event_id`, ce.`range_id`, e.`autor_id`, IFNULL(e.`editor_id`, ''), - e.`uid`, e.`start`, e.`end`, - e.`summary`, e.`description`, e.`class`, e.`categories`, e.`category_intern`, - e.`priority`, e.`location`, e.`ts`, e.`linterval`, e.`sinterval`, e.`wdays`, - e.`month`, e.`day`, e.`rtype`, e.`duration`, e.`count`, e.`expire`, e.`exceptions`, - e.`mkdate`, e.`chdate`, e.`importdate` - FROM `calendar_event` INNER JOIN `event` USING(`event_id`) - WHERE 1"); - DBManager::get()->exec('DROP TABLE IF EXISTS calendar_event'); - DBManager::get()->exec('DROP TABLE IF EXISTS event_data'); - - DBManager::get()->exec('ALTER TABLE contact CHANGE ' - . "`calpermission` `calpermission` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1'"); - DBManager::get()->exec("UPDATE IGNORE contact SET calpermission = '1' " - . "WHERE calpermission = '0'"); - } -} diff --git a/db/migrations/159_step_00275_plus.php b/db/migrations/159_step_00275_plus.php deleted file mode 100644 index 512a36c..0000000 --- a/db/migrations/159_step_00275_plus.php +++ /dev/null @@ -1,26 +0,0 @@ -execute(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, `type`, `range`, mkdate, chdate, description, comment) - VALUES - (MD5(:name), :name, :value, 1, 'array', 'user', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description, '') - ", ['name' => 'PLUS_SETTINGS', - 'value' => '[]', - 'description' => 'Nutzer Konfiguration für Plusseite']); - } - - function down() { - DBManager::get()->exec("DELETE FROM config WHERE field = 'PLUS_SETTINGS'"); - DBManager::get()->exec("DELETE FROM user_config WHERE field = 'PLUS_SETTINGS'"); - } - -} - diff --git a/db/migrations/15_step_00129_email_restriction.php b/db/migrations/15_step_00129_email_restriction.php deleted file mode 100644 index f0816b1..0000000 --- a/db/migrations/15_step_00129_email_restriction.php +++ /dev/null @@ -1,27 +0,0 @@ -announce("add new value EMAIL_DOMAIN_RESTRICTION to table config"); - - DBManager::get()->exec("INSERT INTO `config` VALUES ('cb92d5bb08f346567dbd394d0d553454', '', 'EMAIL_DOMAIN_RESTRICTION', '', 1, 'string', 'global', '', 0, 1157107088, 1157107088, 'Beschränkt die gültigkeit von Email-Adressen bei freier Registrierung auf die angegebenen Domains. Komma-separierte Liste von Domains ohne vorangestelltes @.', '', '')"); - - $this->announce("done."); - - } - - public function down () - { - $this->announce("remove value EMAIL_DOMAIN_RESTRICTION from table config"); - - DBManager::get()->exec("DELETE FROM `config` WHERE `field` = 'EMAIL_DOMAIN_RESTRICTION'"); - - $this->announce("done."); - } -} diff --git a/db/migrations/160_step_00283_update_calendar_settings.php b/db/migrations/160_step_00283_update_calendar_settings.php deleted file mode 100644 index f54956b..0000000 --- a/db/migrations/160_step_00283_update_calendar_settings.php +++ /dev/null @@ -1,66 +0,0 @@ -exec("ALTER TABLE `event_data` CHANGE `autor_id` `author_id` VARCHAR(32) NOT NULL"); - DBManager::get()->exec("ALTER TABLE `calendar_event` ADD `mkdate` INT NOT NULL AFTER `group_status`"); - DBManager::get()->exec("UPDATE calendar_event ce LEFT JOIN event_data ed USING(event_id) SET ce.mkdate = ed.mkdate"); - - $replace = [ - 'showlist' => 'list', - 'showday' => 'day', - 'showweek' => 'week', - 'showmonth' => 'month', - 'showyear' => 'year']; - $res = DBManager::get()->query("SELECT user_id FROM `user_config` WHERE field = 'CALENDAR_SETTINGS'"); - $default_settings = Calendar::getDefaultUserSettings(); - Config::get()->store('CALENDAR_SETTINGS', $default_settings); - foreach ($res as $row) { - $config = new UserConfig($row['user_id']); - $settings = $config->getValue('CALENDAR_SETTINGS'); - if (isset($settings['view'])) { - $default_settings['view'] = $replace[$settings['view']]; - $config->store('CALENDAR_SETTINGS', $default_settings); - } - - } - } - - function down() { - DBManager::get()->execute("ALTER TABLE `event_data` CHANGE `author_id` `autor_id` VARCHAR(32) NOT NULL"); - DBManager::get()->execute("ALTER TABLE `calendar_event` DROP `mkdate`"); - - $replace = [ - 'list' => 'showlist', - 'day' => 'showday', - 'week' => 'showweek', - 'month' => 'showmonth', - 'year' => 'showyear']; - $default_settings = [ - 'view' => 'week', - 'start' => '9', - 'end' => '20', - 'step_day' => '900', - 'step_week' => '1800', - 'type_week' => 'LONG', - 'delete' => '0', - 'step_week_group' => '3600', - 'step_day_group' => '3600' - ]; - $res = DBManager::get()->query("SELECT user_id FROM `user_config` WHERE field = 'CALENDAR_SETTINGS'"); - foreach ($res as $row) { - $config = UserConfig::get($row['user_id']); - $settings = $config->getValue('CALENDAR_SETTINGS'); - if (isset($settings['view'])) { - $default_settings['view'] = $replace[$settings['view']]; - $config->store('CALENDAR_SETTINGS', $default_settings); - } - - } - } - -} diff --git a/db/migrations/161_step_00284_help_editor.php b/db/migrations/161_step_00284_help_editor.php deleted file mode 100644 index 0650318..0000000 --- a/db/migrations/161_step_00284_help_editor.php +++ /dev/null @@ -1,60 +0,0 @@ -announce("add new fields to table help_content"); - - DBManager::get()->exec("ALTER TABLE `help_content` ADD `global_content_id` varchar(32) NOT NULL FIRST"); - DBManager::get()->exec("UPDATE `help_content` SET `global_content_id` = `content_id`"); - DBManager::get()->exec("ALTER TABLE `help_content` DROP PRIMARY KEY , ADD PRIMARY KEY ( `content_id` )"); - DBManager::get()->exec("ALTER TABLE `help_content` ADD `author_email` varchar(255) NOT NULL AFTER `author_id`"); - DBManager::get()->exec("ALTER TABLE `help_content` ADD `chdate` int(11) NOT NULL AFTER `mkdate`"); - DBManager::get()->exec("ALTER TABLE `help_content` DROP COLUMN `author_id`, DROP COLUMN `label`, DROP COLUMN `icon`"); - - $this->announce("add new fields to table help_tours"); - - DBManager::get()->exec("ALTER TABLE `help_tours` ADD `global_tour_id` varchar(32) NOT NULL FIRST"); - DBManager::get()->exec("UPDATE `help_tours` SET `global_tour_id` = `tour_id`"); - DBManager::get()->exec("ALTER TABLE `help_tours` ADD `author_email` varchar(255) NOT NULL AFTER `installation_id`"); - DBManager::get()->exec("ALTER TABLE `help_tours` ADD `chdate` int(11) NOT NULL AFTER `mkdate`"); - - $this->announce("add new fields to table help_tour_steps"); - - DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `chdate` int(11) NOT NULL AFTER `mkdate`"); - DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `author_email` varchar(255) NOT NULL AFTER `route`"); - DBManager::get()->exec("ALTER TABLE `help_tour_steps` DROP COLUMN `author_id`"); - DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `action_next` varchar(255) NOT NULL AFTER `route`"); - DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `action_prev` varchar(255) NOT NULL AFTER `route`"); - - DBManager::get()->exec("INSERT INTO `roles` (`rolename`, `system`) VALUES ('Hilfe-Administrator(in)', 'n')"); - - $this->announce("done."); - } - - public function down () - { - DBManager::get()->exec("DELETE `roles_user`.*, `roles`.* FROM `roles_user` LEFT JOIN `roles` USING (`roleid`) WHERE `roles`.`rolename` = 'Hilfe-Administrator(in)'"); - - $this->announce("remove fields from table help_content"); - DBManager::get()->exec("ALTER TABLE `help_content` ADD `author_id` varchar(255) NOT NULL AFTER `author_email`"); - DBManager::get()->exec("ALTER TABLE `help_content` ADD `label` varchar(255) NOT NULL AFTER `language`"); - DBManager::get()->exec("ALTER TABLE `help_content` ADD `icon` varchar(255) NOT NULL AFTER `language`"); - DBManager::get()->exec("ALTER TABLE `help_content` DROP COLUMN `author_email`, DROP COLUMN `global_content_id`"); - DBManager::get()->exec("ALTER TABLE `help_content` DROP PRIMARY KEY , ADD PRIMARY KEY ( `content_id`, `language`, `studip_version`, `installation_id` )"); - - $this->announce("remove fields from table help_tours"); - DBManager::get()->exec("ALTER TABLE `help_tours` DROP COLUMN `author_email`, DROP COLUMN `chdate`, DROP COLUMN `global_tour_id`"); - - $this->announce("remove fields from table help_tour_steps"); - DBManager::get()->exec("ALTER TABLE `help_tour_steps` ADD `author_id` varchar(255) NOT NULL AFTER `author_email`"); - DBManager::get()->exec("ALTER TABLE `help_tour_steps` DROP COLUMN `author_email`, DROP COLUMN `chdate`, DROP COLUMN `action_prev`, DROP COLUMN `action_next`"); - - $this->announce("done."); - } -} diff --git a/db/migrations/162_step_00283_calendar_user.php b/db/migrations/162_step_00283_calendar_user.php deleted file mode 100644 index 4ec8e6c..0000000 --- a/db/migrations/162_step_00283_calendar_user.php +++ /dev/null @@ -1,23 +0,0 @@ -execute("CREATE TABLE IF NOT EXISTS `calendar_user` ( - `owner_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `permission` int(2) NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`owner_id`,`user_id`) - ) ENGINE=MyISAM"); - } - - function down() { - DBManager::get()->execute('DROP TABLE IF EXISTS calendar_user'); - } - -} diff --git a/db/migrations/163_transfer_calpermission.php b/db/migrations/163_transfer_calpermission.php deleted file mode 100644 index a919c44..0000000 --- a/db/migrations/163_transfer_calpermission.php +++ /dev/null @@ -1,18 +0,0 @@ -execute("INSERT INTO calendar_user SELECT owner_id, user_id, calpermission as permission, unix_timestamp() as mkdate, unix_timestamp() as chdate FROM contact WHERE calpermission > 0;"); - DBManager::get()->execute('ALTER TABLE contact DROP COLUMN calpermission'); - } - - function down() { - DBManager::get()->execute("ALTER TABLE contact ADD COLUMN `calpermission` tinyint(1) unsigned NOT NULL DEFAULT '0'"); - DBManager::get()->execute("UPDATE contact JOIN calendar_user USING (owner_id, user_id) SET calpermission = permission"); - } - -} diff --git a/db/migrations/164_help_tours_en.php b/db/migrations/164_help_tours_en.php deleted file mode 100644 index 51e3c7d..0000000 --- a/db/migrations/164_help_tours_en.php +++ /dev/null @@ -1,175 +0,0 @@ -addHelpToursEN(); - } - - function down() - { - DBManager::get()->exec("DELETE FROM `help_tours` WHERE `tour_id` = '7af1e1fb7f53c910ba9f42f43a71c723' OR `tour_id` = 'c89ce8e097f212e75686f73cc5008711' OR `tour_id` = 'de1fbce508d01cbd257f9904ff8c3b43' OR `tour_id` = '1badcf28ab5b206d9150b2b9683b4cb6' OR `tour_id` = 'fa963d2ca827b28e0082e98aafc88765' OR `tour_id` = 'f0aeb0f6c4da3bd61f48b445d9b30dc1' OR `tour_id` = '3dbe7099f82dcdbba4580acb1105a0d6' OR `tour_id` = '9e9dca9b1214294b9605824bfe90fba1' OR `tour_id` = '89786eac42f52ac316790825b4f5c0b2' OR `tour_id` = 'e41611616675b218845fe9f55bc11cf6' OR `tour_id` = '83dc1d25e924f2748ee3293aaf0ede8e' OR `tour_id` = '588effa83da976a889a68c152bcabc90' OR `tour_id` = 'd9913517f9c81d2c0fa8362592ce5d0e' OR `tour_id` = '05434e40601a9a2a7f5fa8208ae148c1'"); - DBManager::get()->exec("DELETE FROM `help_tour_steps` WHERE `tour_id` = '7af1e1fb7f53c910ba9f42f43a71c723' OR `tour_id` = 'c89ce8e097f212e75686f73cc5008711' OR `tour_id` = 'de1fbce508d01cbd257f9904ff8c3b43' OR `tour_id` = '1badcf28ab5b206d9150b2b9683b4cb6' OR `tour_id` = 'fa963d2ca827b28e0082e98aafc88765' OR `tour_id` = 'f0aeb0f6c4da3bd61f48b445d9b30dc1' OR `tour_id` = '3dbe7099f82dcdbba4580acb1105a0d6' OR `tour_id` = '9e9dca9b1214294b9605824bfe90fba1' OR `tour_id` = '89786eac42f52ac316790825b4f5c0b2' OR `tour_id` = 'e41611616675b218845fe9f55bc11cf6' OR `tour_id` = '83dc1d25e924f2748ee3293aaf0ede8e' OR `tour_id` = '588effa83da976a889a68c152bcabc90' OR `tour_id` = 'd9913517f9c81d2c0fa8362592ce5d0e' OR `tour_id` = '05434e40601a9a2a7f5fa8208ae148c1'"); - DBManager::get()->exec("DELETE FROM `help_tour_settings` WHERE `tour_id` = '7af1e1fb7f53c910ba9f42f43a71c723' OR `tour_id` = 'c89ce8e097f212e75686f73cc5008711' OR `tour_id` = 'de1fbce508d01cbd257f9904ff8c3b43' OR `tour_id` = '1badcf28ab5b206d9150b2b9683b4cb6' OR `tour_id` = 'fa963d2ca827b28e0082e98aafc88765' OR `tour_id` = 'f0aeb0f6c4da3bd61f48b445d9b30dc1' OR `tour_id` = '3dbe7099f82dcdbba4580acb1105a0d6' OR `tour_id` = '9e9dca9b1214294b9605824bfe90fba1' OR `tour_id` = '89786eac42f52ac316790825b4f5c0b2' OR `tour_id` = 'e41611616675b218845fe9f55bc11cf6' OR `tour_id` = '83dc1d25e924f2748ee3293aaf0ede8e' OR `tour_id` = '588effa83da976a889a68c152bcabc90' OR `tour_id` = 'd9913517f9c81d2c0fa8362592ce5d0e' OR `tour_id` = '05434e40601a9a2a7f5fa8208ae148c1'"); - } - - function addHelpToursEN() { - // add tour data - $query = "INSERT IGNORE INTO `help_tours` (`tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `mkdate`) VALUES -('7af1e1fb7f53c910ba9f42f43a71c723', 'Search', 'In this feature tour the most important search functions are explained', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427720631), -('c89ce8e097f212e75686f73cc5008711', 'Participant administration', 'The administration options of the participant administration are explained in this tour.', 'tour', 'tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427721030), -('de1fbce508d01cbd257f9904ff8c3b43', 'Profile page', 'The basic functions and areas of the profile page are presented in this tour.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427722058), -('1badcf28ab5b206d9150b2b9683b4cb6', 'My courses (lecturers)', 'The most important functions of the site \"My courses\" are presented in this tour.', 'tour', 'tutor,dozent,admin,root', 1, 'en', '', '', 1427722642), -('fa963d2ca827b28e0082e98aafc88765', 'My courses (students)', 'The most important functions of the site \"My courses\" are presented in this tour.', 'tour', 'autor', 1, 'en', '3.1', '', 1427723231), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 'Design of the start page', 'The functions and design possibilities of the start page are presented in this feature tour.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427723894), -('3dbe7099f82dcdbba4580acb1105a0d6', 'Administering the forum', 'The administration of the forum is explained in this tour.', 'tour', 'tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427724314), -('9e9dca9b1214294b9605824bfe90fba1', 'Create study group', 'In this tour the creation of study groups is explained', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427724645), -('89786eac42f52ac316790825b4f5c0b2', 'Use forum', 'The content of this tour is from the old tour of the forum (Sidebar > actions > start tour).', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427783673), -('e41611616675b218845fe9f55bc11cf6', 'Upload own picture', 'This tour explains how users can upload their own profile picture.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784057), -('83dc1d25e924f2748ee3293aaf0ede8e', 'Blubber', 'This tour explains how to use \"Blubber\"', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784655), -('588effa83da976a889a68c152bcabc90', 'Blubber', 'This tour explains how to use \"Blubber\"', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784693), -('d9913517f9c81d2c0fa8362592ce5d0e', 'Blubber', 'This tour explains how to use \"Blubber\"', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427784720), -('05434e40601a9a2a7f5fa8208ae148c1', 'My documents', 'The personal document area will be presented in this tour.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1427786336); -"; - DBManager::get()->exec($query); - - // add steps - $query = "INSERT IGNORE INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `author_email`, `mkdate`) VALUES -('7af1e1fb7f53c910ba9f42f43a71c723', 1, 'Search', 'This tour gives you an overview of the most important \"search\" functions \n\n\nIn order to reach the next step please click \"next\" on the bottom right', 'TL', 0, '', 'dispatch.php/search/courses', '', 1405519865), -('7af1e1fb7f53c910ba9f42f43a71c723', 2, 'Enter search term', 'A search term (such as event name, lecturer) can be entered in this input field.', 'B', 0, 'INPUT#search_sem_quick_search_1.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520106), -('7af1e1fb7f53c910ba9f42f43a71c723', 3, 'Semester selection', 'With a click on the drop-down menu you can choose to which semester the search term should refer. \n\nThe current semester is set as standard.', 'TL', 0, 'SELECT#search_sem_sem', 'dispatch.php/search/courses', '', 1405520208), -('7af1e1fb7f53c910ba9f42f43a71c723', 4, 'Navigation', 'If you want to search only one particular area, you can select one here.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/search/courses', '', 1406121826), -('7af1e1fb7f53c910ba9f42f43a71c723', 5, 'Extended search', 'The search can be extended by further options with the extended search.', 'R', 0, 'A.options-checkbox.options-unchecked', 'dispatch.php/search/courses', '', 1405520436), -('7af1e1fb7f53c910ba9f42f43a71c723', 6, 'Quick search', 'The quick search is also available on other sites of Stud.IP at all times. After entering a key word it is confirmed with \"Enter\" or by clicking the magnifying glass on the right next to the field.', 'B', 0, 'INPUT#search_sem_quick_search_2.quicksearchbox.ui-autocomplete-input', 'dispatch.php/search/courses', '', 1405520634), -('7af1e1fb7f53c910ba9f42f43a71c723', 7, 'Further search possibilities', 'In addition to searching for events there is also the possibility to search the archive for persons, facilities, or resources.', 'R', 0, '#nav_search_resources A SPAN', 'dispatch.php/search/courses', '', 1405520751), -('c89ce8e097f212e75686f73cc5008711', 1, 'Participant administration', 'This tour gives an overview of the participant administration of an event.\r\n\r\nIn order to go to the next step please click \"next\" at the bottom right.', 'B', 0, '', 'dispatch.php/course/members', '', 1405688399), -('c89ce8e097f212e75686f73cc5008711', 2, 'Add persons', 'With these functions you can search for individual persons in Stud.IP and directly select them as lecturer, tutor or author. It is also possible to insert a list of participants in order to allocate several persons as a tutor of the event at the same time.', 'R', 0, '#layout-sidebar SECTION DIV.sidebar-widget :eq(1)', 'dispatch.php/course/members', '', 1405688707), -('c89ce8e097f212e75686f73cc5008711', 3, 'Upgrade/ downgrade', 'In order to upgrade an already enroled person to a tutor, or to downgrade them to a reader select this person in the list and carry out the requested action by using the dropdown menu.', 'T', 0, '#autor CAPTION', 'dispatch.php/course/members', '', 1405690324), -('c89ce8e097f212e75686f73cc5008711', 4, 'Send circular e-mail', 'A circular e-mail can be sent to all participants of the event here.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(3)', 'dispatch.php/course/members', '', 1406636964), -('c89ce8e097f212e75686f73cc5008711', 5, 'Send circular e-mail to user group', 'There is further the possibility to send a circular e-mail to individual user groups.', 'BR', 0, '#layout_container #layout_content TABLE CAPTION SPAN A IMG :eq(0)', 'dispatch.php/course/members', '', 1406637123), -('c89ce8e097f212e75686f73cc5008711', 6, 'Create groups', 'The participants of the event can be divided into groups here.', 'R', 0, 'A#nav_course_edit_groups', 'dispatch.php/course/members', '', 1405689311), -('c89ce8e097f212e75686f73cc5008711', 7, 'Name group', 'You can search for a suitable group name in the templates and select it using the yellow double arrow. As an alternative you also have the possibility to determine a new group name by directly entering the name in the right field.', 'B', 0, 'SELECT', 'admin_statusgruppe.php', '', 1405689541), -('c89ce8e097f212e75686f73cc5008711', 8, 'Group size', 'With the field \"group size\" you can set the maximum number of participants of a group. If you do not require this, simply leave the field empty.', 'B', 0, 'INPUT#role_size', 'admin_statusgruppe.php', '', 1405689763), -('c89ce8e097f212e75686f73cc5008711', 9, 'Self-entry', 'If you activate the function \"self-entry\", the participants of the event can enter themselves in the groups.', 'B', 0, 'INPUT#self_assign', 'admin_statusgruppe.php', '', 1405689852), -('c89ce8e097f212e75686f73cc5008711', 10, 'Document folder', 'If you activate the function \"document folder\", an additional document folder will be created per group. Group-specific documents can be uploaded to this folder.', 'B', 0, 'INPUT#group_folder', 'admin_statusgruppe.php', '', 1405689936), -('de1fbce508d01cbd257f9904ff8c3b43', 1, 'Profile tour', 'This tour gives you an overview of the most important functions of the \"profile\".\r\n\r\nIn order to reach the next step please click \"next\" on the bottom right.', 'T', 0, '', 'dispatch.php/profile', '', 1406722657), -('de1fbce508d01cbd257f9904ff8c3b43', 2, 'Personal picture', 'If you uploaded a picture, it will be displayed here. You can change it at all times.', 'RT', 0, '.avatar-normal', 'dispatch.php/profile', '', 1406722657), -('de1fbce508d01cbd257f9904ff8c3b43', 3, 'Stud.IP-Score', 'The Stud.IP-Score increases with the activities in Stud.IP and thus represents the experience with Stud.IP.', 'BL', 0, '#layout_content TABLE:eq(0) TBODY:eq(0) TR:eq(0) TD:eq(0) A:eq(0)', 'dispatch.php/profile', '', 1406722657), -('de1fbce508d01cbd257f9904ff8c3b43', 4, 'Announcements', 'You can publish personal announcements on this site.', 'B', 0, '#layout_content SECTION HEADER H1 :eq(0)', 'dispatch.php/profile', '', 1406722657), -('de1fbce508d01cbd257f9904ff8c3b43', 5, 'New announcement', 'Click on the plus sign, if you would like to create an announcement.', 'BR', 0, '#layout_content SECTION HEADER NAV A :eq(0)', 'dispatch.php/profile', '', 1406722657), -('de1fbce508d01cbd257f9904ff8c3b43', 6, 'Personal details', 'Your picture and additional user data can be changed on these sites.', 'BL', 0, '#tabs li:eq(2)', 'dispatch.php/profile', '', 1406722657), -('1badcf28ab5b206d9150b2b9683b4cb6', 1, 'Help tour \"My event\"', 'This tour gives you an overview of the most important functions of the page \"My courses\".\r\n\r\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'dispatch.php/my_courses', '', 1406125847), -('1badcf28ab5b206d9150b2b9683b4cb6', 2, 'Overview of events', 'The courses of the current and past semester are displayed here. New courses initially appear in red.', 'TL', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1406125908), -('1badcf28ab5b206d9150b2b9683b4cb6', 3, 'Event details', 'With a click on the \"i\" a window appears with the most important facts of the courses.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1406125992), -('1badcf28ab5b206d9150b2b9683b4cb6', 4, 'Course contents', 'All contents (such as e.g. a forum) are displayed by corresponding symbols here.\n\nIf there were any news since the last login these will appear in red.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1406126049), -('1badcf28ab5b206d9150b2b9683b4cb6', 5, 'Editing or deletion of an event', 'A click on the cog wheel enables you to edit a course.\n\nIf you have participant status in a course, you can sign out by clicking on the door icon.', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1406126134), -('1badcf28ab5b206d9150b2b9683b4cb6', 6, 'Adjustment to the event view', 'In order to adjust the course overview you can order your courses according to certain criteria (such as e.g. fields of study, lecturers, or colours).', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1406126281), -('1badcf28ab5b206d9150b2b9683b4cb6', 7, 'Access to an event of past and future semesters', 'For example, by clicking on the drop-down menu, courses from past semesters can be displayed.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1406126316), -('1badcf28ab5b206d9150b2b9683b4cb6', 8, 'Further possible actions', 'Here you can mark all news as read, change colour groups as you please, and also adjust the notifications about activities in the individual courses.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1406126374), -('1badcf28ab5b206d9150b2b9683b4cb6', 9, 'Study groups and facilities', 'There is moreover the possibility to access personal study groups or facilities.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1406126415), -('fa963d2ca827b28e0082e98aafc88765', 1, 'Help tour \"My courses\"', 'This tour gives you an overview of the most important functions of the site \"My courses\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'dispatch.php/my_courses', '', 1405521184), -('fa963d2ca827b28e0082e98aafc88765', 2, 'Overview of courses', 'The courses of the current and past semester are displayed here. New courses initially appear in red.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(2)', 'dispatch.php/my_courses', '', 1405521244), -('fa963d2ca827b28e0082e98aafc88765', 3, 'Course details', 'With a click on the \"i\" a window appears with the most important benchmark data of the course.', 'T', 0, '#my_seminars TABLE THEAD TR TH :eq(3)', 'dispatch.php/my_courses', '', 1405931069), -('fa963d2ca827b28e0082e98aafc88765', 4, 'Course contents', 'All contents (such as e.g. a forum) are displayed by corresponding symbols here.\n\nIf there were any news since the last login these will appear in red.', 'LT', 0, '#my_seminars TABLE THEAD TR TH :eq(4)', 'dispatch.php/my_courses', '', 1405931225), -('fa963d2ca827b28e0082e98aafc88765', 5, 'Leaving the course', 'A click on the door icon enables a direct removal from the course', 'TR', 0, '#my_seminars TABLE THEAD TR TH :eq(5)', 'dispatch.php/my_courses', '', 1405931272), -('fa963d2ca827b28e0082e98aafc88765', 6, 'Access to archived courses', 'If courses have been archived, they can be accessed here.', 'RT', 0, 'A#nav_browse_archive', 'dispatch.php/my_courses', '', 1405931431), -('fa963d2ca827b28e0082e98aafc88765', 7, 'Adjustment to the course view', 'In order to adjust the course overview you can arrange your courses according to certain criteria (such as e.g. fields of study, lecturers or colours).', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(2)', 'dispatch.php/my_courses', '', 1405932131), -('fa963d2ca827b28e0082e98aafc88765', 8, 'Access to an course of past and future semesters', 'By clicking on the drop-down menu courses from past semesters can be displayed for example.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(3)', 'dispatch.php/my_courses', '', 1405932230), -('fa963d2ca827b28e0082e98aafc88765', 9, 'Further possible actions', 'Here you can mark all news as read, change colour groups as you please, or\n\nalso adjust the notifications about activities in the individual events.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/my_courses', '', 1405932320), -('fa963d2ca827b28e0082e98aafc88765', 10, 'Study groups and institutes', 'There is moreover the possibility to access personal study groups or institutes.', 'R', 0, '#nav_browse_my_institutes A', 'dispatch.php/my_courses', '', 1405932519), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 1, 'Functions and design possibilities of the start page', 'This tour gives you an overview of the most important functions of the start page.\n\nIn order to reach the next step please click \"next\" on the bottom right', 'TL', 0, '', 'dispatch.php/start', '', 1405934926), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 2, 'Individual design of the start page', 'The default configuration of the start page is that the elements \"Quicklinks\", \"announcements\", \"my current appointments\" and \"surveys\" are displayed. The elements are called widgets and can be deleted, added and moved. Each widget can be individually added, deleted and moved.', 'TL', 0, '', 'dispatch.php/start', '', 1405934970), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 3, 'Add widget', 'Widgets can be added here. In addition to the standard widgets the personal timetable can, for example, be displayed on the start page. Newly added widgets appear right at the bottom on the start page. In addition, it is possible to jump directly to each widget in the sidebar.', 'R', 0, '#layout-sidebar SECTION DIV DIV UL LI :eq(4)', 'dispatch.php/start', '', 1405935192), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 4, 'Jump labels', 'In addition, it is possible to jump directly to each widget using jump labels.', 'R', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(0)', 'dispatch.php/start', '', 1406623464), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 5, 'Position widget', 'A widget can be moved to the desired position using drag&drop: For this purpose you click into the headline of a widget, hold down the mouse button, and drag the widget to the desired position.', 'B', 0, '.widget-header', 'dispatch.php/start', '', 1405935687), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 6, 'Edit widget', 'With several widgets a further symbol is displayed in addition to the X for closing. The widget \"Quicklinks\", for example, can be adjusted individually by clicking on this button, the announcements can be subscribed to and appointments can be added with the actual appointments or timetable.', 'L', 0, '#layout_content DIV UL DIV SPAN A IMG :eq(0)', 'dispatch.php/start', '', 1405935792), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 7, 'Remove widget', 'Each widget can be removed by clicking on the X in the right upper corner. If required, it can be added again at all times.', 'R', 0, '.widget-header', 'dispatch.php/start', '', 1405935376), -('3dbe7099f82dcdbba4580acb1105a0d6', 1, 'Administering the forum', 'You have the possibility to look at a tour for the administration of the forum.\n\nIn order to begin the tour please click \"next\" at the bottom right.', 'TL', 0, '', 'plugins.php/coreforum', '', 1405418008), -('3dbe7099f82dcdbba4580acb1105a0d6', 2, 'Edit category', 'The name of the category can be changed or, however, the whole category deleted with these icons. The sectors will in this case be shifted into the category \"General\" and are thus retained.\n\nThe category \"General\" cannot be deleted and is therefore included in each forum.', 'BR', 0, '#forum #sortable_areas TABLE CAPTION #tutorCategoryIcons', 'plugins.php/coreforum', '', 1405424216), -('3dbe7099f82dcdbba4580acb1105a0d6', 3, 'Edit area', 'Action icons will appear, if the cursor is positioned on an area\n\nYou can use the icons to change the name and description of an area, or to delete the whole area.\nThe deletion of an area causes all contained topics to be deleted.', 'B', 0, 'IMG.edit-area', 'plugins.php/coreforum', '', 1405424346), -('3dbe7099f82dcdbba4580acb1105a0d6', 4, 'Sort area', 'With this hatched surface areas can be sorted in at any place by clicking and dragging. This can, on one hand, be used in order to sort areas within a category, and on the other hand, areas can be shifted into other categories.', 'BR', 0, 'HTML #plugins #layout_wrapper #layout_page #layout_container #layout_content #forum #sortable_areas TABLE TBODY #tutorArea TD IMG#tutorMoveArea.handle.js :eq(1)', 'plugins.php/coreforum', '', 1405424379), -('3dbe7099f82dcdbba4580acb1105a0d6', 5, 'Add new area', 'New areas can be added to a category here.', 'BR', 0, 'TFOOT TR TD A SPAN', 'plugins.php/coreforum', '', 1405424421), -('3dbe7099f82dcdbba4580acb1105a0d6', 6, 'Create new category', 'A new category in the forum can be created here. Enter the title of the new category for this purpose.', 'TL', 0, '#tutorAddCategory H2', 'plugins.php/coreforum', '', 1405424458), -('9e9dca9b1214294b9605824bfe90fba1', 1, 'Create study group', 'Study groups enable the cooperation with fellow students or colleagues. This tour gives you an overview of how you can create study groups.\n\nIn order to go to the next step please click \"next\" at the bottom right.', 'R', 0, '', 'dispatch.php/my_studygroups', '', 1405684423), -('9e9dca9b1214294b9605824bfe90fba1', 2, 'Create study group', 'A new study group can be created with a click on \"create new study group\".', 'R', 0, 'A#nav_browse_new', 'dispatch.php/my_studygroups', '', 1406017730), -('9e9dca9b1214294b9605824bfe90fba1', 3, 'Name a study group', 'The name of a study group should be meaningful and unique in the whole Stud.IP.', 'R', 0, 'INPUT#groupname', 'dispatch.php/course/studygroup/new', '', 1405684720), -('9e9dca9b1214294b9605824bfe90fba1', 4, 'Add description', 'The description makes it possible to display additional information that makes it easier to find the group.', 'R', 0, 'TEXTAREA#groupdescription', 'dispatch.php/course/studygroup/new', '', 1405684806), -('9e9dca9b1214294b9605824bfe90fba1', 5, 'Allocate content elements', 'Content elements can be activated here, which are to be available within the study group. The question mark provides more detailed information on the meaning of the individual content elements', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(5)', 'dispatch.php/course/studygroup/new', '', 1405685093), -('9e9dca9b1214294b9605824bfe90fba1', 6, 'Stipulate access', 'The access to the study group can be restricted with this drop down menu.\n\nAll students can register freely and participate in the group with the access \"open for everyone\".\n\nWith the access \"upon request\" participants must be added by the group founder.', 'R', 0, 'SELECT#groupaccess', 'dispatch.php/course/studygroup/new', '', 1405685334), -('9e9dca9b1214294b9605824bfe90fba1', 7, 'Accept terms of use', 'The terms of use have to be accepted before you can create a study group.', 'R', 0, 'P LABEL', 'dispatch.php/course/studygroup/new', '', 1405685652), -('9e9dca9b1214294b9605824bfe90fba1', 8, 'Save study group', 'After you saved a study group it will appear under \"My courses\" > \"My study groups\".', 'L', 0, '#layout_content FORM TABLE TBODY TR TD :eq(14)', 'dispatch.php/course/studygroup/new', '', 1405686068), -('89786eac42f52ac316790825b4f5c0b2', 1, 'Forum', 'This tour provides an overview of the elements and interactional possibilities of the forum.\n\nIn order to go to the next step please click \"next\" on the bottom right.', 'BL', 0, '', 'plugins.php/coreforum', '', 1405415772), -('89786eac42f52ac316790825b4f5c0b2', 2, 'You are here:...', 'Here you can see which sector of the forum you are currently looking at.', 'BL', 0, 'DIV#tutorBreadcrumb', 'plugins.php/coreforum', '', 1405415875), -('89786eac42f52ac316790825b4f5c0b2', 3, 'Category', 'The forum is divided into categories, topics and posts. A category summarises forum areas into larger units of meaning.', 'BL', 0, '#layout_content #forum #sortable_areas TABLE CAPTION .category_name :eq(0)', 'plugins.php/coreforum', '', 1405416611), -('89786eac42f52ac316790825b4f5c0b2', 4, 'Area', 'This is an area within a category. Areas contain threads. The order of areas can be altered using drag&drop', 'BL', 0, '#layout_content #forum TABLE THEAD TR TH :eq(0)', 'plugins.php/coreforum', '', 1405416664), -('89786eac42f52ac316790825b4f5c0b2', 5, 'Info-Icon', 'This icon turns red as soon as there is something new in this sector.', 'B', 0, 'IMG#tutorNotificationIcon', 'plugins.php/coreforum', '', 1405416705), -('89786eac42f52ac316790825b4f5c0b2', 6, 'Search', 'All contents of this forum can be browsed here. Multiple word searches are also supported. In addition, the search can be limited to any combination of title, content and author.', 'BL', 0, '#layout-sidebar SECTION #tutorSearchInfobox DIV #tutorSearchInfobox UL LI INPUT :eq(1)', 'plugins.php/coreforum', '', 1405417134), -('89786eac42f52ac316790825b4f5c0b2', 7, 'Subscribe to forum', 'You can subscribe to the whole forum or individual topics . In this case a notification will be generated and you receive a meassage for each new post in this forum.', 'B', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(5)', 'plugins.php/coreforum', '', 1405416795), -('e41611616675b218845fe9f55bc11cf6', 1, 'Profile', 'This tour gives you an overview of the most important functions of the \"profile\".\n\nIn order to get to the next step please click \"next\" on the bottom right.', 'B', 0, '', 'dispatch.php/profile', '', 1406722657), -('e41611616675b218845fe9f55bc11cf6', 2, 'Upload a picture', 'A profile picture can be uploaded on this site.', 'BL', 0, '#nav_profile_avatar A SPAN', 'dispatch.php/settings/avatar', '', 1406722657), -('e41611616675b218845fe9f55bc11cf6', 3, 'Select picture', 'A image file can be uploaded for this purpose.', 'L', 0, 'input[name=imgfile]', 'dispatch.php/settings/avatar', '', 1406722657), -('e41611616675b218845fe9f55bc11cf6', 4, 'Requirements', 'The image file must be available in **.jpg**, **.png** or **.gif** format.\n\nThe document size must not exceed 700 KB.', 'L', 0, '#layout_content #edit_avatar TBODY TR TD FORM B :eq(2)', 'dispatch.php/settings/avatar', '', 1406722657), -('83dc1d25e924f2748ee3293aaf0ede8e', 1, 'What is Blubber?', 'This tour provides an overview of the most important functions of \"Blubber\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'plugins.php/blubber/streams/forum', '', 1405507364), -('83dc1d25e924f2748ee3293aaf0ede8e', 2, 'Create contribution', 'A discussion can be started here by writing a text. Paragraphs can be created by pressing shift+enter. The text will be sent by pressing enter.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405507478), -('83dc1d25e924f2748ee3293aaf0ede8e', 3, 'Design text', 'The text can be formatted and smileys can be used.\n\nThe customary formatting such as e.g. **bold** or %%italics%% can be used.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508371), -('83dc1d25e924f2748ee3293aaf0ede8e', 4, 'Mention persons', 'Others can be informed about a post by mentioning them in the post, using the format @user name or @''first name last name''.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405672301), -('83dc1d25e924f2748ee3293aaf0ede8e', 5, 'Add document', 'Documents can be inserted into a post by dragging them into an input field using drag&drop.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508401), -('83dc1d25e924f2748ee3293aaf0ede8e', 6, 'Hashtags', 'Posts can be issued with key words (\"hashtags\") by placing a # in front of the chosen word.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/forum', '', 1405508442), -('83dc1d25e924f2748ee3293aaf0ede8e', 7, 'Hashtag cloud', 'By clicking on a hashtag, all posts containing this hashtag will be displayed.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/forum', '', 1405508505), -('83dc1d25e924f2748ee3293aaf0ede8e', 8, 'Change contribution', 'If the cursor is positioned on a post, its date will appear. For your own posts an additional icon will appear on the right next to the date. This icon allow you to subsequently edit your post.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/forum', '', 1405507901), -('83dc1d25e924f2748ee3293aaf0ede8e', 9, 'Link contribution', 'If the cursor is positioned on the first contribution to the discussion a link icon will appear on the left next to the date. If this is clicked using the right mouse button the link can be copied on this contribution in order to be able to insert it in another place.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/forum', '', 1405508281), -('588effa83da976a889a68c152bcabc90', 1, 'What is Blubber?', 'This tour provides an overview of the most important functions of \"Blubber\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'plugins.php/blubber/streams/profile', '', 1405507364), -('588effa83da976a889a68c152bcabc90', 2, 'Create contribution', 'A discussion can be started here by writing a text. Paragraphs can be created by pressing shift+enter. The text will be sent by pressing enter.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405507478), -('588effa83da976a889a68c152bcabc90', 3, 'Design text', 'The text can be formatted and smileys can be used.\n\nThe customary formatting such as e.g. **bold** or %%italics%% can be used.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508371), -('588effa83da976a889a68c152bcabc90', 4, 'Mention persons', 'Others can be informed about a post by mentioning them in the post, using the format @user name or @''first name last name''.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405672301), -('588effa83da976a889a68c152bcabc90', 5, 'Add document', 'Documents can be inserted into a post by dragging them into an input field using drag&drop.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508401), -('588effa83da976a889a68c152bcabc90', 6, 'Hashtags', 'Posts can be issued with key words (\"hashtags\") by placing a # in front of the chosen word.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/profile', '', 1405508442), -('588effa83da976a889a68c152bcabc90', 7, 'Hashtag cloud', 'By clicking on a hashtag, all posts containing this hashtag will be displayed.', 'RT', 0, 'DIV.sidebar-widget-header', 'plugins.php/blubber/streams/profile', '', 1405508505), -('588effa83da976a889a68c152bcabc90', 8, 'Change contribution', 'If the cursor is positioned on a post, its date will appear. For your own posts an additional icon will appear on the right next to the date. This icon allow you to subsequently edit your post.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/profile', '', 1405507901), -('588effa83da976a889a68c152bcabc90', 9, 'Link contribution', 'If the cursor is positioned on the first contribution to the discussion a link icon will appear on the left next to the date. If this is clicked using the right mouse button the link can be copied on this contribution in order to be able to insert it in another place.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/profile', '', 1405508281), -('d9913517f9c81d2c0fa8362592ce5d0e', 1, 'What is Blubber?', 'This tour provides an overview of the most important functions of \"Blubber\".\n\nIn order to reach the next step please click \"next\" on the bottom right.', 'TL', 0, '', 'plugins.php/blubber/streams/global', '', 1405507364), -('d9913517f9c81d2c0fa8362592ce5d0e', 2, 'Create contribution', 'A discussion can be started here by writing a text. Paragraphs can be created by pressing shift+enter. The text will be sent by pressing enter.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405507478), -('d9913517f9c81d2c0fa8362592ce5d0e', 3, 'Design text', 'The text can be formatted and smileys can be used.\n\nThe customary formatting such as e.g. **bold** or %%italics%% can be used.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508371), -('d9913517f9c81d2c0fa8362592ce5d0e', 4, 'Mention persons', 'Others can be informed about a post by mentioning them in the post, using the format @user name or @''first name last name''.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405672301), -('d9913517f9c81d2c0fa8362592ce5d0e', 5, 'Add document', 'Documents can be inserted into a post by dragging them into an input field using drag&drop.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508401), -('d9913517f9c81d2c0fa8362592ce5d0e', 6, 'Hashtags', 'Posts can be issued with key words (\"hashtags\") by placing a # in front of the chosen word.', 'BL', 0, 'TEXTAREA#new_posting.autoresize', 'plugins.php/blubber/streams/global', '', 1405508442), -('d9913517f9c81d2c0fa8362592ce5d0e', 7, 'Hashtag cloud', 'By clicking on a hashtag, all posts containing this hashtag will be displayed.', 'RT', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'plugins.php/blubber/streams/global', '', 1405508505), -('d9913517f9c81d2c0fa8362592ce5d0e', 8, 'Change contribution', 'If the cursor is positioned on a post, its date will appear. For your own posts an additional icon will appear on the right next to the date. This icon allow you to subsequently edit your post.', 'BR', 0, 'DIV DIV A SPAN.time', 'plugins.php/blubber/streams/global', '', 1405507901), -('d9913517f9c81d2c0fa8362592ce5d0e', 9, 'Link contribution', 'If the cursor is positioned on the first contribution to the discussion a link icon will appear on the left next to the date. If this is clicked using the right mouse button the link can be copied on this contribution in order to be able to insert it in another place.', 'BR', 0, 'DIV DIV A.permalink', 'plugins.php/blubber/streams/global', '', 1405508281), -('05434e40601a9a2a7f5fa8208ae148c1', 1, 'My documents', 'My documents is the personal document area. Documents can be stored on Stud.IP here in order to be able to download them from there onto other computers.\n\nOther students or lecturers do not receive any access to documents, which are uploaded into the personal document area.\n\nIn order to reach the next step please click on the right at the bottom on \"next\".', 'TL', 0, '', 'dispatch.php/document/files', '', 1405592884), -('05434e40601a9a2a7f5fa8208ae148c1', 2, 'Available storage space', 'The storage space of the personal document area is limited. It is displayed how much storage space is still available.', 'BR', 0, 'DIV.caption-actions', 'dispatch.php/document/files', '', 1405594184), -('05434e40601a9a2a7f5fa8208ae148c1', 3, 'New documents and indices', 'New documents can be uploaded from the computer into the personal document area and new indices can be created here.', 'TL', 0, '#layout-sidebar SECTION DIV DIV UL LI A :eq(0)', 'dispatch.php/document/files', '', 1405593409), -('05434e40601a9a2a7f5fa8208ae148c1', 4, 'Document overview', 'All documents and indices are listed in a tabular form. In addition to the name even more information is displayed such as the document type or the document size.', 'TL', 0, '#layout_content FORM TABLE THEAD TR TH :eq(3)', 'dispatch.php/document/files', '', 1405593089), -('05434e40601a9a2a7f5fa8208ae148c1', 5, 'Actions', 'Already uploaded documents and folders can be edited, downloaded, shifted, copied and deleted here.', 'TR', 0, '#layout_content FORM TABLE THEAD TR TH :eq(7)', 'dispatch.php/document/files', '', 1405594079), -('05434e40601a9a2a7f5fa8208ae148c1', 6, 'Export', 'Here you have the possibility to download individual folders or the full document area as a ZIP document. All documents and indices are contained therein.', 'TL', 0, '#layout-sidebar SECTION DIV DIV.sidebar-widget-header :eq(1)', 'dispatch.php/document/files', '', 1405593708); -"; - DBManager::get()->exec($query); - - // add settings - $query = "INSERT IGNORE INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES -('7af1e1fb7f53c910ba9f42f43a71c723', 1, 'standard'), -('c89ce8e097f212e75686f73cc5008711', 1, 'standard'), -('de1fbce508d01cbd257f9904ff8c3b43', 1, 'standard'), -('1badcf28ab5b206d9150b2b9683b4cb6', 1, 'standard'), -('fa963d2ca827b28e0082e98aafc88765', 1, 'standard'), -('f0aeb0f6c4da3bd61f48b445d9b30dc1', 1, 'standard'), -('3dbe7099f82dcdbba4580acb1105a0d6', 1, 'standard'), -('9e9dca9b1214294b9605824bfe90fba1', 1, 'standard'), -('89786eac42f52ac316790825b4f5c0b2', 1, 'standard'), -('e41611616675b218845fe9f55bc11cf6', 1, 'standard'), -('83dc1d25e924f2748ee3293aaf0ede8e', 1, 'standard'), -('588effa83da976a889a68c152bcabc90', 1, 'standard'), -('d9913517f9c81d2c0fa8362592ce5d0e', 1, 'standard'), -('05434e40601a9a2a7f5fa8208ae148c1', 1, 'standard'); -"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/166_add_cache_operations_table.php b/db/migrations/166_add_cache_operations_table.php deleted file mode 100644 index 671152f..0000000 --- a/db/migrations/166_add_cache_operations_table.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.3 - */ -class AddCacheOperationsTable extends Migration -{ - public function description() - { - return 'Creates the database table for proxied cache operations'; - } - - public function up() - { - $query = "CREATE TABLE IF NOT EXISTS `cache_operations` ( - `cache_key` VARCHAR(256) NOT NULL DEFAULT '', - `operation` CHAR(6) NOT NULL DEFAULT '', - `parameters` TEXT NOT NULL, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`cache_key`(200), `operation`) - )"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "DROP TABLE `cache_operations`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/167_tic5661_setup_cronjob.php b/db/migrations/167_tic5661_setup_cronjob.php deleted file mode 100644 index 14e3540..0000000 --- a/db/migrations/167_tic5661_setup_cronjob.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.3 - */ - -class Tic5661SetupCronjob extends Migration -{ - public function description() - { - return 'Registers the cronjob for TIC 5661 that removes expired ' - . 'entries from the table "object_user_visits".'; - } - - public function up() - { - CronjobScheduler::registerTask($this->getFilename(), false); - } - - public function down() - { - $task_id = CronjobTask::findOneByFilename($this->getFilename())->task_id; - CronjobScheduler::unregisterTask($task_id); - } - - private function getFilename() - { - return 'lib/cronjobs/clean_object_user_visits.php'; - } -} diff --git a/db/migrations/168_tic5661_add_config.php b/db/migrations/168_tic5661_add_config.php deleted file mode 100644 index 713c30c..0000000 --- a/db/migrations/168_tic5661_add_config.php +++ /dev/null @@ -1,37 +0,0 @@ -execute(" - INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - ", [ - 'name' => 'NEW_INDICATOR_THRESHOLD', - 'value' => '180', - 'type' => 'integer', - 'range' => 'global', - 'section' => 'global', - 'description' => 'Gibt an, nach wieviel Tagen ein Eintrag als alt ' - . 'angesehen und nicht mehr rot markiert werden ' - . 'soll (0 angeben, um nur das tatsächliche Alter) ' - . 'zu betrachten.', - ] - ); - } - - public function down() - { - DBManager::get()->exec("DELETE FROM config WHERE `field` = 'NEW_INDICATOR_THRESHOLD'"); - } -} diff --git a/db/migrations/16_step_00126_embedding_flash_movies.php b/db/migrations/16_step_00126_embedding_flash_movies.php deleted file mode 100644 index 13e8159..0000000 --- a/db/migrations/16_step_00126_embedding_flash_movies.php +++ /dev/null @@ -1,29 +0,0 @@ -announce("add new values EXTERNAL_FLASH_MOVIE_EMBEDDING and to table config"); - - DBManager::get()->exec("INSERT INTO `config` VALUES (MD5('EXTERNAL_FLASH_MOVIE_EMBEDDING'), '', 'EXTERNAL_FLASH_MOVIE_EMBEDDING', 'deny', 1, 'string', 'global', '', 0, 1157107088, 1157107088, 'Sollen externe Flash-Filme mit Hilfe des [flash]-Tags der Schnellformatierung eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', '', '')"); - - DBManager::get()->exec("INSERT INTO `config` VALUES (MD5('DOCUMENTS_EMBEDD_FLASH_MOVIES'), '', 'DOCUMENTS_EMBEDD_FLASH_MOVIES', 'deny', 1, 'string', 'global', '', 0, 1157107088, 1157107088, 'Sollen im Dateibereich Flash-Filme direkt in einem Player angezeigt werden? deny=nicht erlaubt, allow=erlaubt, autoload=Film wird beim aufklappen geladen (incrementiert Downloads), autoplay=Film wird sofort abgespielt', '', '')"); - - $this->announce("done."); - - } - - public function down () - { - $this->announce("remove values EXTERNAL_FLASH_MOVIE_EMBEDDING and DOCUMENTS_EMBEDD_FLASH_MOVIES from table config"); - - DBManager::get()->exec("DELETE FROM `config` WHERE config_id IN(MD5('EXTERNAL_FLASH_MOVIE_EMBEDDING'), MD5('DOCUMENTS_EMBEDD_FLASH_MOVIES'))"); - - $this->announce("done."); - } -} \ No newline at end of file diff --git a/db/migrations/170_step_00286_coursewizard.php b/db/migrations/170_step_00286_coursewizard.php deleted file mode 100644 index 7717d44..0000000 --- a/db/migrations/170_step_00286_coursewizard.php +++ /dev/null @@ -1,63 +0,0 @@ -execute("CREATE TABLE IF NOT EXISTS `coursewizardsteps` ( - `id` VARCHAR(32) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `classname` VARCHAR(255) NOT NULL UNIQUE, - `number` TINYINT(1) NOT NULL, - `enabled` TINYINT(1) NOT NULL DEFAULT 1, - `mkdate` INT NOT NULL DEFAULT 0, - `chdate` INT NOT NULL DEFAULT 0, - PRIMARY KEY (`id`))"); - // Add the default steps: - // Step 1: Basic data. - if (!CourseWizardStepRegistry::findByClassName('BasicDataWizardStep')) { - CourseWizardStepRegistry::registerStep('Grunddaten', 'BasicDataWizardStep', 1, true); - } - // Step 2: Study area assignment (there are course classes requiring this). - if (!CourseWizardStepRegistry::findByClassName('StudyAreasWizardStep')) { - CourseWizardStepRegistry::registerStep('Studienbereiche', 'StudyAreasWizardStep', 2, true); - } - // Add text template for studygroup acceptance to global config. - if (!Config::get()->STUDYGROUP_ACCEPTANCE_TEXT) { - DBManager::get()->execute(" - INSERT IGNORE INTO config - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - ", - [ - 'name' => 'STUDYGROUP_ACCEPTANCE_TEXT', - 'value' => _('Die Moderatorinnen und ' . - 'Moderatoren der Studiengruppe können Ihren ' . - 'Aufnahmewunsch bestätigen oder ablehnen. Erst nach ' . - 'Bestätigung erhalten Sie vollen Zugriff auf die ' . - 'Gruppe.'), - 'type' => 'string', - 'range' => 'global', - 'section' => 'studygroups', - 'description' => _('Text, der angezeigt wird, wenn man sich ' . - 'in eine zugriffsbeschränkte Studiengruppe eintragen möchte') - ] - ); - } - } - - function down() - { - DBManager::get()->exec("DROP TABLE IF EXISTS `coursewizardsteps`"); - } - -} diff --git a/db/migrations/171_open_personal_file_areas.php b/db/migrations/171_open_personal_file_areas.php deleted file mode 100644 index 59a5041..0000000 --- a/db/migrations/171_open_personal_file_areas.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @license GPL2 or any later version - */ - -class OpenPersonalFileAreas extends Migration -{ - public function description() - { - return 'Create config entries for open personal file areas'; - } - - public function up() - { - $query = "INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description`) - VALUES (:id, :field, :value, 1, :type, 'global', 'files', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; - $statement = DBManager::get()->prepare($query); - - $statement->execute([ - ':id' => md5(uniqid('PERSONALDOCUMENT_OPEN_ACCESS')), - ':field' => 'PERSONALDOCUMENT_OPEN_ACCESS', - ':value' => (int) false, - ':type' => 'boolean', - ':description' => 'Schaltet die persönlichen Dateibereiche zur Einsicht für alle Nutzer frei', - ]); - - $statement->execute([ - ':id' => md5(uniqid('PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED')), - ':field' => 'PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED', - ':value' => (int) true, - ':type' => 'boolean', - ':description' => 'Erlaubt Root-Accounts das Verändern von persönlichen Dateibereiche im Namen fremder Nutzer', - ]); - } - - public function down() - { - DBManager::get()->query("DELETE FROM config WHERE field IN ('PERSONALDOCUMENT_OPEN_ACCESS', 'PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED')"); - } - } diff --git a/db/migrations/172_tic_5961_add_config_default_sem.php b/db/migrations/172_tic_5961_add_config_default_sem.php deleted file mode 100644 index 9c32999..0000000 --- a/db/migrations/172_tic_5961_add_config_default_sem.php +++ /dev/null @@ -1,32 +0,0 @@ -execute(" - INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - ", [ - 'name' => 'MY_COURSES_DEFAULT_CYCLE', - 'value' => 'last', - 'type' => 'string', - 'range' => 'global', - 'section' => 'MeineVeranstaltungen', - 'description' => 'Standardeinstellung für den Semester-Filter, falls noch keine Auswahl getätigt wurde. (all, future, current, last)', - ] - ); - } - - function down() - { - DBManager::get()->exec("DELETE FROM config WHERE `field` = 'MY_COURSES_DEFAULT_CYCLE'"); - } -} diff --git a/db/migrations/173_biest5982_fix_resources_objects_level.php b/db/migrations/173_biest5982_fix_resources_objects_level.php deleted file mode 100644 index 1f7a2bc..0000000 --- a/db/migrations/173_biest5982_fix_resources_objects_level.php +++ /dev/null @@ -1,61 +0,0 @@ -prepare($query); - - // Update the level for all children of a set of parent ids. - $query = "UPDATE `resources_objects` - SET `level` = :level - WHERE `parent_id` IN (:ids)"; - $child_statement = DBManager::get()->prepare($query); - - // Loop until the hierarchy has been built. - $level = 0; - do { - // Read parent ids - $parent_statement->bindValue(':level', $level); - $parent_statement->execute(); - $parent_ids = $parent_statement->fetchAll(PDO::FETCH_COLUMN); - - // No parents, no children -> we're done. - if (count($parent_ids) === 0) { - break; - } - - // Increase level - $level = $level + 1; - - // Update level on all children, exit if no children have been - // found/updated. - $child_statement->bindValue(':level', $level); - $child_statement->bindValue(':ids', $parent_ids, StudipPDO::PARAM_ARRAY); - $updated_rows = $child_statement->execute(); - } while ($updated_rows > 0); - } - - public function down() - { - // No, we don't need this. - } -} diff --git a/db/migrations/174_tic_6018_clean_news.php b/db/migrations/174_tic_6018_clean_news.php deleted file mode 100644 index 7683b46..0000000 --- a/db/migrations/174_tic_6018_clean_news.php +++ /dev/null @@ -1,32 +0,0 @@ -execute(" - INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - ", [ - 'name' => 'NEWS_DISPLAY', - 'value' => '2', - 'type' => 'integer', - 'range' => 'global', - 'section' => 'view', - 'description' => 'Legt fest, wie sich News für Anwender präsentieren. (2 zeigt sowohl Autor als auch Zugriffszahlen an. 1 zeigt nur den Autor an. 0 blendet beides für Benutzer aus.', - ] - ); - } - - function down() - { - DBManager::get()->exec("DELETE FROM config WHERE `field` = 'NEWS_DISPLAY'"); - } -} diff --git a/db/migrations/175_biest6024_fix_help_tours_en.php b/db/migrations/175_biest6024_fix_help_tours_en.php deleted file mode 100644 index 91bf78f..0000000 --- a/db/migrations/175_biest6024_fix_help_tours_en.php +++ /dev/null @@ -1,55 +0,0 @@ - "This tour provides an overview of the supplied search options.\r\n\r\To proceed, please click \"Continue\" in the lower-right corner.", - 'c89ce8e097f212e75686f73cc5008711' => "This tour provides an overview of the participant administration\'s options.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - 'de1fbce508d01cbd257f9904ff8c3b43' => "This tour provides a general overview of the profile page\'s structure.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '1badcf28ab5b206d9150b2b9683b4cb6' => "This tour provides an overview of the functionality of \"My courses\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - 'fa963d2ca827b28e0082e98aafc88765' => "This tour provides an overview of the functionality of \"My courses\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - 'f0aeb0f6c4da3bd61f48b445d9b30dc1' => "This tour provides an overview of the start page\'s features and functions.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '3dbe7099f82dcdbba4580acb1105a0d6' => "This tour provides an overview of the forum\'s administration.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '9e9dca9b1214294b9605824bfe90fba1' => "This tour provides an overview of the creation of study groups to cooperate with fellow students.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '89786eac42f52ac316790825b4f5c0b2' => "This tour provides an overview of the forum\'s elements and options of interaction.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - 'e41611616675b218845fe9f55bc11cf6' => "This tour shows how to upload a picture in the profile page.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '83dc1d25e924f2748ee3293aaf0ede8e' => "This tour provides an overview of the functionality of \"Blubber\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '588effa83da976a889a68c152bcabc90' => "This tour provides an overview of the functionality of \"Blubber\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - 'd9913517f9c81d2c0fa8362592ce5d0e' => "This tour provides an overview of the functionality of \"Blubber\".\r\n\rTo proceed, please click \"Continue\" in the lower-right corner.", - '05434e40601a9a2a7f5fa8208ae148c1' => "This tour provides an overview of the personal document manager.\r\n\rTo proceed, please click \"Continue\" in the lower-right corner." - ]; - - foreach($new_first_steps as $key => $value) { - $update = "UPDATE help_tour_steps - SET tip = '$value' - WHERE tour_id = '$key' AND - step = 1 - "; - DBManager::get()->exec($update); - } - } - - /** - * {@inheritdoc} - */ - public function down() { - // processed in 164_help_tours_en.php - } -} \ No newline at end of file diff --git a/db/migrations/176_limit_mailqueue.php b/db/migrations/176_limit_mailqueue.php deleted file mode 100644 index 5fd9b78..0000000 --- a/db/migrations/176_limit_mailqueue.php +++ /dev/null @@ -1,31 +0,0 @@ -prepare($query); - - $statement->execute([ - ':field' => 'MAILQUEUE_SEND_LIMIT', - ':value' => "0", - ':type' => 'integer', - ':description' => 'Wieviele Mails soll die Mailqueue maximal auf einmal an den Mailserver schicken. 0 für unendlich viele.', - ]); - } - - function down() - { - DBManager::get()->query("DELETE FROM config WHERE field IN ('MAILQUEUE_SEND_LIMIT')"); - } -} diff --git a/db/migrations/177_tic5415_plugin_assets.php b/db/migrations/177_tic5415_plugin_assets.php deleted file mode 100644 index 64bf392..0000000 --- a/db/migrations/177_tic5415_plugin_assets.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.4 - * - * @see https://develop.studip.de/trac/ticket/5415 - */ -class Tic5415PluginAssets extends Migration -{ - function description() - { - return 'Creates the database tables that store the plugin assets information'; - } - - public function up() - { - $query = "CREATE TABLE IF NOT EXISTS `plugin_assets` ( - `asset_id` char(32) NOT NULL DEFAULT '', - `plugin_id` int(10) unsigned NOT NULL, - `type` enum('css') NOT NULL DEFAULT 'css', - `filename` varchar(255) NOT NULL DEFAULT '', - `storagename` varchar(255) NOT NULL DEFAULT '', - `size` int(11) unsigned DEFAULT NULL, - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`asset_id`) - )"; - DBManager::get()->exec($query); - } - - public function down() - { - DBManager::get()->exec("DROP TABLE `plugin_assets`"); - } -} diff --git a/db/migrations/178_change_opengraph_data_pk.php b/db/migrations/178_change_opengraph_data_pk.php deleted file mode 100644 index d7154bd..0000000 --- a/db/migrations/178_change_opengraph_data_pk.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @license GPL2 or any later version - */ -class ChangeOpengraphDataPk extends Migration -{ - public function up() - { - $query = "ALTER TABLE `opengraphdata` - DROP PRIMARY KEY, - ADD COLUMN `opengraph_id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST, - ADD UNIQUE KEY `url` (`url`(512))"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "ALTER TABLE `opengraphdata` - DROP PRIMARY KEY, - DROP INDEX `url`, - DROP COLUMN `opengraph_id`, - ADD PRIMARY KEY (`url`)"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/179_tic6188_view_resource_occupation.php b/db/migrations/179_tic6188_view_resource_occupation.php deleted file mode 100644 index 3b2bcb0..0000000 --- a/db/migrations/179_tic6188_view_resource_occupation.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.4 - * - * @see https://develop.studip.de/trac/ticket/6188 - */ -class Tic6188ViewResourceOccupation extends Migration -{ - /** - * Describe migration: add config switch. - * @return string - */ - public function description() - { - return 'Creates a config switch for restricting who may view resource occupation schedules'; - } - - /** - * Adds a config switch for configuring resource occupation access. - */ - public function up() - { - // Add config entry. - $query = "INSERT IGNORE INTO `config` - (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description`) - VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'resources', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; - $statement = DBManager::get()->prepare($query); - - $statement->execute([ - ':field' => 'RESOURCES_ALLOW_VIEW_RESOURCE_OCCUPATION', - ':value' => '1', - ':type' => 'boolean', - ':description' => 'Dürfen alle Nutzer Ressourcenbelegungen einsehen?', - ]); - } - - /** - * Removes config switch for resource occupation access. - */ - public function down() - { - DBManager::get()->exec("DELETE FROM `config` WHERE `field`='RESOURCES_ALLOW_VIEW_RESOURCE_OCCUPATION'"); - } -} diff --git a/db/migrations/17_db_optimierung_kontingentierung.php b/db/migrations/17_db_optimierung_kontingentierung.php deleted file mode 100644 index 3ff923a..0000000 --- a/db/migrations/17_db_optimierung_kontingentierung.php +++ /dev/null @@ -1,38 +0,0 @@ -announce("add keys..."); - - $db = DBManager::get(); - $mode = $db->getAttribute(PDO::ATTR_ERRMODE); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - $db->query("ALTER TABLE `admission_seminar_studiengang` ADD INDEX `studiengang_id` ( `studiengang_id` )"); - $db->query("ALTER TABLE `admission_seminar_user` ADD INDEX `seminar_id` ( `seminar_id`, `studiengang_id`, `status` )"); - $db->query("ALTER TABLE `seminar_user` ADD INDEX `Seminar_id` ( `Seminar_id`, `admission_studiengang_id` )"); - $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); - - $this->announce("done."); - } - - public function down () - { - $this->announce("delete keys..."); - - $db = DBManager::get(); - $mode = $db->getAttribute(PDO::ATTR_ERRMODE); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - $db->query("ALTER TABLE `admission_seminar_studiengang` DROP INDEX `studiengang_id`"); - $db->query("ALTER TABLE `admission_seminar_user` DROP INDEX `seminar_id`"); - $db->query("ALTER TABLE `seminar_user` DROP INDEX `Seminar_id`"); - $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); - - $this->announce("done."); - } -} diff --git a/db/migrations/180_add_seminar_is_complete_status.php b/db/migrations/180_add_seminar_is_complete_status.php deleted file mode 100644 index d1e6ae9..0000000 --- a/db/migrations/180_add_seminar_is_complete_status.php +++ /dev/null @@ -1,37 +0,0 @@ -exec($query); - - $query = "INSERT INTO `config` (`config_id`, `field`, `value`, `type`, - `range`, `section`, `mkdate`, `chdate`, - `description`, `comment`) - VALUES (MD5(CONCAT('CONFIG_', :field)), :field, 0, 'boolean', - 'global', 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'Definiert, ob auf der Admin-Veranstaltunggseite der Komplett-Status für Veranstaltungen aufgeführt sein soll', '')"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':field', 'ADMIN_COURSES_SHOW_COMPLETE'); - $statement->execute(); - } - - public function down() - { - $query = "ALTER TABLE `seminare` - DROP COLUMN `is_complete`"; - DBManager::get()->exec($query); - - $query = "DELETE FROM `config` WHERE `field` = :field"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':field', 'ADMIN_COURSES_SHOW_COMPLETE'); - $statement->execute(); - } -} diff --git a/db/migrations/181_extend_wiki_size.php b/db/migrations/181_extend_wiki_size.php deleted file mode 100644 index 1f64a32..0000000 --- a/db/migrations/181_extend_wiki_size.php +++ /dev/null @@ -1,38 +0,0 @@ -exec("ALTER TABLE scm CHANGE tab_name tab_name varchar(255) NOT NULL DEFAULT '', - CHANGE content content mediumtext NOT NULL"); - $db->exec("ALTER TABLE user_info CHANGE lebenslauf lebenslauf mediumtext NOT NULL, - CHANGE publi publi mediumtext NOT NULL"); - $db->exec("ALTER TABLE wiki CHANGE keyword keyword varchar(255) BINARY NOT NULL DEFAULT '', - CHANGE body body mediumtext NOT NULL"); - $db->exec("ALTER TABLE wiki_links CHANGE from_keyword from_keyword varchar(255) BINARY NOT NULL DEFAULT '', - CHANGE to_keyword to_keyword varchar(255) BINARY NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE wiki_locks CHANGE keyword keyword varchar(255) BINARY NOT NULL DEFAULT ''"); - } - - public function down() - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE scm CHANGE tab_name tab_name varchar(20) NOT NULL DEFAULT 'Info', - CHANGE content content text"); - $db->exec("ALTER TABLE user_info CHANGE lebenslauf lebenslauf text, - CHANGE publi publi text NOT NULL"); - $db->exec("ALTER TABLE wiki CHANGE keyword keyword varchar(128) BINARY NOT NULL DEFAULT '', - CHANGE body body text"); - $db->exec("ALTER TABLE wiki_links CHANGE from_keyword from_keyword char(128) BINARY NOT NULL DEFAULT '', - CHANGE to_keyword to_keyword char(128) BINARY NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE wiki_locks CHANGE keyword keyword varchar(128) BINARY NOT NULL DEFAULT ''"); - } -} diff --git a/db/migrations/182_step_raum_zeit_end_offset.php b/db/migrations/182_step_raum_zeit_end_offset.php deleted file mode 100644 index 71eb020..0000000 --- a/db/migrations/182_step_raum_zeit_end_offset.php +++ /dev/null @@ -1,28 +0,0 @@ -exec('ALTER TABLE `seminar_cycle_dates` ADD COLUMN `end_offset` TINYINT(3) NULL AFTER `week_offset`'); - - //CHANGE route entry in help_content from raumzeit.php to new dispatch.php/course/timesrooms - $query = 'UPDATE `help_content` SET route = :new WHERE route = :old'; - $stm = DBManager::get()->prepare($query); - $stm->execute([':new' => 'dispatch.php/course/timesrooms', ':old' => 'raumzeit.php']); - } - - public function down() - { - DBManager::get()->exec('ALTER TABLE `seminar_cycle_dates` DROP COLUMN `end_offset`'); - - //CHANGE route entry in help_content from dispatch.php/course/timesrooms back to raumzeit.php - $query = 'UPDATE `help_content` SET route = :old WHERE route = :new'; - $stm = DBManager::get()->prepare($query); - $stm->execute([':new' => 'dispatch.php/course/timesrooms', ':old' => 'raumzeit.php']); - } -} diff --git a/db/migrations/183_tic6000_datafields_visibility.php b/db/migrations/183_tic6000_datafields_visibility.php deleted file mode 100644 index a14f5ff..0000000 --- a/db/migrations/183_tic6000_datafields_visibility.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @license GPL2 or any later version - */ -class Tic6000DatafieldsVisibility extends Migration -{ - public function description() - { - return 'Adds another visibility setting to datafields'; - } - - public function up() - { - $query = "ALTER TABLE `datafields` - ADD COLUMN `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "ALTER TABLE `datafields` DROP COLUMN `system`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/184_add_wiki_help_tours.php b/db/migrations/184_add_wiki_help_tours.php deleted file mode 100644 index 6ffe59d..0000000 --- a/db/migrations/184_add_wiki_help_tours.php +++ /dev/null @@ -1,149 +0,0 @@ - - * @license GPL2 or any later version - */ - -class AddWikiHelpTours extends Migration -{ - /** - * Returns the description of the migration. - */ - public function description() - { - return "Adds the wiki's help tours."; - } - - /** - * Adds the wiki's help tours in to the database. - */ - public function up() - { - // add tour data - $insert = "INSERT IGNORE INTO `help_tours` (`tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `mkdate`) VALUES - ('4d41c9760a3248313236af202275107a', 'Allgemeines zum Wiki', 'Die Tour gibt einen allgemeinen Überblick über das Wiki.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1441276241), - ('4d41c9760a3248313236af202275107b', 'Schreiben im Wiki', 'Die Tour erklärt, wie das Wiki bearbeitet werden kann.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1441276241), - ('4d41c9760a3248313236af202275107c', 'Lesen im Wiki', 'Die Tour erklärt die verschiedenen Anzeige-Modalitäten zum Lesen des Wikis.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '3.1', '', 1441276241), - ('5d41c9760a3248313236af202275107a', 'General information on the Wiki', 'This tour provides general information about the Wiki.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1441276241), - ('5d41c9760a3248313236af202275107b', 'Editing the Wiki', 'This tour provides help for editing Wiki pages.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1441276241), - ('5d41c9760a3248313236af202275107c', 'Reading the Wiki', 'This tour provides help for reading Wiki pages.', 'tour', 'autor,tutor,dozent,admin,root', 1, 'en', '3.1', '', 1441276241); - "; - - DBManager::get()->exec($insert); - - // add steps - $insert = "INSERT IGNORE INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `mkdate`) VALUES - ('4d41c9760a3248313236af202275107a', 1, 'Allgemeines zum Wiki', 'Diese Tour gibt einen allgemeinen Überblick über das Wiki.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107a', 2, 'Kooperative Textarbeit', 'Das Wiki ist ein Tool für kooperative Textarbeit. Alle Teilnehmenden einer Veranstaltung haben das Recht, Texte zu erstellen, zu ändern und zu löschen.', 'B', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107a', 3, 'Textänderungen schaden nicht', 'Weil das Wiki alle Textänderungen einer Seite protokolliert, können vorhergehende Versionen der Seite wiederhergestellt werden.', 'B', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107a', 4, 'Textänderungen zurücknehmen', 'Textänderungen in einer Wiki-Seite lassen sich rückgängig machen, indem eine vorhergehende Version der Seite wiederhergestellt wird.', 'B', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107a', 5, 'Neue Version einer Wiki-Seite', 'Wird eine Wiki-Seite bearbeitet, so erfolgt die Übernahme der Textänderungen sofort beim Speichern. Eine neue Version der Seite wird dreißig Minuten nach der Speicherung erstellt.', 'B', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107a', 6, 'Kein synchrones Schreiben', 'Das Wiki ist nicht zum synchronen Schreiben geeignet. Es kann immer nur eine Person an einer Seite gleichzeitig arbeiten. Sobald eine zweite Person die Seite im Editor öffnet, erscheint eine Warnmeldung.', 'B', 0, '', 'wiki.php', 1441276241), - - ('4d41c9760a3248313236af202275107b', 1, 'Schreiben im Wiki', 'Diese Tour gibt einen Überblick über die Erstellung und Bearbeitung von Wiki-Seiten.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 2, 'WikiWikiWeb', 'Zeigt die Basis-Seite des Wikis an. Sie bildet die strukturelle Grundlage des gesamten Wikis.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 3, 'Neue Seiten', 'Zeigt eine tabellarische Übersicht neu erstellter und neu bearbeiteter Wiki-Seiten an.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 4, 'Alle Seiten', 'Zeigt eine tabellarische Übersicht aller Wiki-Seiten an.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 5, 'Wiki-Seite bearbeiten', 'Durch einen Klick auf die Schaltfläche \"Bearbeiten\" öffnet sich ein Editor, über den eine Wiki-Seite mit Inhalt gefüllt werden kann.\r\n\r\nDie Eingabe eines Namens in doppelten eckigen Klammern erzeugt eine neue Wiki-Seite und vernetzt sie mit der angezeigten Seite.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 6, 'Inhalt einer Wiki-Seite löschen', 'Der Inhalt einer Wiki-Seite lässt sich mit Hilfe eines Klicks auf die Schaltfläche \"Löschen\" entfernen. Die Wiki-Seite bleibt dabei erhalten.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(1)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 7, 'QuickLinks', 'Dieser Bildschirmbereich zeigt eine Liste von QuickLinks (Verweisen) auf Wiki-Seiten. Ein Klick auf einen QuickLink öffnet die korrelierende Wiki-Seite. Deren Inhalt lässt sich mit Hilfe der Schaltflächen \"Bearbeiten\" und \"Löschen\" gestalten.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107b', 8, 'QuickLinks bearbeiten', 'Ein Klick auf dieses Icon öffnet einen Editor, der zur Bearbeitung der QuickLinks dient.\r\n\r\nNeue QuickLinks lassen sich mit doppelten eckigen Klammern erstellen: [[Name]]. Das Löschen eines QuickLinks entfernt die korrelierende Seite aus der Liste.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0) DIV:eq(0) A:eq(0) IMG:eq(0)', 'wiki.php', 1441276241), - - ('4d41c9760a3248313236af202275107c', 1, 'Lesen im Wiki', 'Diese Tour gibt einen Überblick über die Anzeige von Wiki-Seiten.\r\n\r\nUm zum nächsten Schritt zu gelangen, klicken Sie bitte rechts unten auf \"Weiter\".', 'T', 0, '', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 2, 'WikiWikiWeb', 'Zeigt die Basis-Seite des Wikis an.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 3, 'Neue Seiten', 'Zeigt eine tabellarische Übersicht neu erstellter und neu bearbeiteter Wiki-Seiten an.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 4, 'Alle Seiten', 'Zeigt eine tabellarische Übersicht aller Wiki-Seiten an.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 5, 'Ansichten', 'Wenn eine Textänderung in einer Wiki-Seite vorgenommen wurde, stehen drei Anzeigemodi zur Auswahl:\r\n- Standard: Ohne Zusatzinformation\r\n- Textänderungen anzeigen: Welche Textpassagen wurden geändert?\r\n- Text mit AutorInnenzuordnung anzeigen: Wer hat hat etwas geändert?', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(11) DIV:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 6, 'Suche', 'Zeigt die Wiki-Seiten an, in denen der eingegebene Suchbegriff vorkommt. Die Suche steht nur in der Standard-Ansicht zur Verfügung.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(14) DIV:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 7, 'Kommentare', 'Stellt verschiedene Modalitäten zur Anzeige von Kommentaren bereit, die in einer Wiki-Seite eingetragen wurden.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 8, 'Kommentare einblenden', 'Alle Kommentare werden als Textblock an der Textposition angezeigt, an der sie in die Wiki-Seite eingefügt wurden.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(0) A:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 9, 'Kommentare als Icon einblenden', 'Für jeden Kommentar wird an der Stelle, wo er in die Wiki-Seite eingefügt wurde, ein Icon angezeigt. Ein Klick auf das Icon öffnet den Kommentar.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(1) A:eq(0)', 'wiki.php', 1441276241), - ('4d41c9760a3248313236af202275107c', 10, 'Kommentare ausblenden', 'Die in einer Wiki-Seite eingefügten Kommentare werden nicht angezeigt.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(2) A:eq(0)', 'wiki.php', 1441276241), - - ('5d41c9760a3248313236af202275107a', 1, 'General information on the Wiki', 'This tour provides general information about the Wiki.\r\n\r\nTo proceed, please click \"Continue\" on the lower-right button.', 'T', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107a', 2, 'Tool for collaborative use', 'The Wiki is a collaborative tool. Every user may create, edit and delete content.', 'B', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107a', 3, 'Changes in a Wiki page', 'Since all changes in a Wiki page are saved in a protocol, previous versions of its content can be restored.', 'B', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107a', 4, 'New version of a Wiki page', 'While editing text in a Wiki page, clicking the Save-Button will save its content immediately. A new version of a Wiki page is displayed thirty minutes after saving at the latest.', 'B', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107a', 5, 'Undo changes', 'All changes can be undone by restoring a previous version of text.', 'B', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107a', 6, 'No support of synchronous editing', 'The editor is not designed for synchronous writing. Only one person may edit a page at the same time. If a second person links up to edit the same page, a warning message appears.', 'B', 0, '', 'wiki.php', 1441276241), - - ('5d41c9760a3248313236af202275107b', 1, 'Editing the Wiki', 'This tour provides a general overview of how to create and edit Wiki pages.\r\n\r\nTo proceed, please click \"Continue\" on the lower-right button.', 'T', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 2, 'WikiWikiWeb', 'Displays the basic Wiki page, which is the foundation of all further Wiki pages.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 3, 'New pages', 'Displays a survey of all recently created or edited Wiki pages in table form.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 4, 'All pages', 'Displays a survey of all Wiki pages in table form.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 5, 'Editing the a Wiki page', 'Clicking here will open an editor, allowing to fill a Wiki page with content.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 6, 'Deleting the content of a Wiki page', 'Clicking here will delete all content and links of a Wiki page leaving it blank.', 'B', 0, '#main_content TABLE:eq(1) TBODY:eq(0) TR:eq(0) TD:eq(0) DIV:eq(0) A:eq(1)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 7, 'QuickLinks', 'This box displays links, leading to other Wiki pages. Selecting a link will forward to the related page. The content there may be edited the same way as described in step 5 and six.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107b', 8, 'Editing QuickLinks', 'A click on this icon will open an editor to edit the QuickLinks.\r\n\r\nEntering a name within double square brackets like [[name]] in the editor will create a new QuickLink leading to a correlating page. Deleting a QuickLink will cause its deletion in the QuickLink box.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(5) DIV:eq(0) DIV:eq(0) A:eq(0) IMG:eq(0)', 'wiki.php', 1441276241), - - ('5d41c9760a3248313236af202275107c', 1, 'Reading the Wiki', 'This tour gives a general overview of the different modes to read Wiki pages.\r\n\r\nTo proceed, please click \"Continue\" on the lower-right button.', 'T', 0, '', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 2, 'WikiWikiWeb', 'Displays the basic Wiki page, which is the foundation of all further Wiki pages.', 'R', 0, '#nav_wiki_show', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 3, 'New pages', 'Displays a survey of all recently created or edited Wiki pages in table form.', 'R', 0, '#nav_wiki_listnew', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 4, 'All pages', 'Displays a survey of all Wiki pages in table form.', 'R', 0, '#nav_wiki_listall', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 5, 'Views', 'If a Wiki page has been edited, the user may choose between three modes of viewing content:\r\n- Standard: Without extra information\r\n- Show text changes: Which parts of text have been edited?\r\n- Show text changes and associated author: Who was editing a part of text?', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(11) DIV:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 6, 'Search', 'Shows all Wiki pages which contain the entered search term. The search is supported in Standard-View only.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(14) DIV:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 7, 'Comments', 'Supports three modes of showing comments added to a Wiki page.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 8, 'Show comments', 'All comments are shown as a block of text exactly in that position, in which they were added.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(0) A:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 9, 'Show comments as icon', 'All comments are represented by an icon exactly in that position, in which a comment was added. A click on an icon shows the correlating comment.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(1) A:eq(0)', 'wiki.php', 1441276241), - ('5d41c9760a3248313236af202275107c', 10, 'Hide comments', 'All added comments are hidden while displaying a page.', 'R', 0, '#layout-sidebar SECTION:eq(0) DIV:eq(20) DIV:eq(1) UL:eq(0) LI:eq(2) A:eq(0)', 'wiki.php', 1441276241); - "; - - DBManager::get()->exec($insert); - - // add settings - $insert = "INSERT IGNORE INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES - ('4d41c9760a3248313236af202275107a', 1, 'standard'), - ('4d41c9760a3248313236af202275107b', 1, 'standard'), - ('4d41c9760a3248313236af202275107c', 1, 'standard'), - ('5d41c9760a3248313236af202275107a', 1, 'standard'), - ('5d41c9760a3248313236af202275107b', 1, 'standard'), - ('5d41c9760a3248313236af202275107c', 1, 'standard'); - "; - - DBManager::get()->exec($insert); - } - - /** - * Removes the wiki's help tours from the database. - */ - public function down() { - - // delete settings - $delete = "DELETE FROM help_tour_settings WHERE - tour_id = '4d41c9760a3248313236af202275107a' OR - tour_id = '4d41c9760a3248313236af202275107b' OR - tour_id = '4d41c9760a3248313236af202275107c' OR - tour_id = '5d41c9760a3248313236af202275107a' OR - tour_id = '5d41c9760a3248313236af202275107b' OR - tour_id = '5d41c9760a3248313236af202275107c' - "; - - DBManager::get()->exec($delete); - - // delete steps - $delete = "DELETE FROM help_tour_steps WHERE - tour_id = '4d41c9760a3248313236af202275107a' OR - tour_id = '4d41c9760a3248313236af202275107b' OR - tour_id = '4d41c9760a3248313236af202275107c' OR - tour_id = '5d41c9760a3248313236af202275107a' OR - tour_id = '5d41c9760a3248313236af202275107b' OR - tour_id = '5d41c9760a3248313236af202275107c' - "; - - DBManager::get()->exec($delete); - - // delete tour data - $delete = "DELETE FROM help_tours WHERE - tour_id = '4d41c9760a3248313236af202275107a' OR - tour_id = '4d41c9760a3248313236af202275107b' OR - tour_id = '4d41c9760a3248313236af202275107c' OR - tour_id = '5d41c9760a3248313236af202275107a' OR - tour_id = '5d41c9760a3248313236af202275107b' OR - tour_id = '5d41c9760a3248313236af202275107c' - "; - - DBManager::get()->exec($delete); - } -} \ No newline at end of file diff --git a/db/migrations/185_tic6025_performance.php b/db/migrations/185_tic6025_performance.php deleted file mode 100644 index 0407024..0000000 --- a/db/migrations/185_tic6025_performance.php +++ /dev/null @@ -1,46 +0,0 @@ - -* @license GPL2 or any later version -*/ - -class Tic6025Performance extends Migration -{ - public function description() - { - return _('Performance Tweaks'); - } - - public function up() - { - $this->tryExecute("ALTER TABLE personal_notifications ADD INDEX (html_id)"); - $this->tryExecute("ALTER TABLE personal_notifications ADD INDEX (url(256))"); - - $this->tryExecute("ALTER TABLE admission_seminar_user CHANGE status status ENUM('awaiting','accepted') NOT NULL"); - - $this->tryExecute("ALTER TABLE ex_termine DROP INDEX autor_id"); - $this->tryExecute("ALTER TABLE ex_termine ADD INDEX (date)"); - - $this->tryExecute("ALTER TABLE termine ADD INDEX (date)"); - - $this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX `unique`"); - $this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX termin_id"); - $this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX statusgruppe_id"); - $this->tryExecute("ALTER TABLE termin_related_groups CHANGE statusgruppe_id statusgruppe_id VARCHAR(32) NOT NULL"); - $this->tryExecute("ALTER TABLE termin_related_groups ADD PRIMARY KEY( termin_id, statusgruppe_id)"); - - $this->tryExecute("ALTER TABLE `user_config` ADD INDEX (`field`, `value`(10))"); - - } - - private function tryExecute($sql) - { - try { - DBManager::get()->exec($sql); - } catch (PDOException $e) { - $this->announce("sql failed: %s", $sql); - } - } -} diff --git a/db/migrations/186_step_00294_innodb.php b/db/migrations/186_step_00294_innodb.php deleted file mode 100644 index 1a3ecdc..0000000 --- a/db/migrations/186_step_00294_innodb.php +++ /dev/null @@ -1,179 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.4 - * - * @see https://develop.studip.de/trac/ticket/6180 - */ -class StEP00294InnoDB extends Migration -{ - - /** - * Describe what the migration does: convert tables to InnoDB. - * @return string - */ - public function description() - { - return 'Converts the Stud.IP database tables to InnoDB engine'; - } - - /** - * Convert all tables to InnoDB engine, using Barracuda format if supported. - */ - public function up() - { - global $DB_STUDIP_DATABASE; - - // Check if InnoDB is enabled in database server. - $engines = DBManager::get()->fetchAll("SHOW ENGINES"); - $innodb = false; - foreach ($engines as $e) { - // InnoDB is found and enabled. - if ($e['Engine'] == 'InnoDB' && in_array(strtolower($e['Support']), ['default', 'yes'])) { - $innodb = true; - break; - } - } - - if ($innodb) { - $start = microtime(true); - - // Tables to ignore on engine conversion. - $ignore_tables = []; - - // Get version of database system (MySQL/MariaDB/Percona) - $data = DBManager::get()->fetchFirst("SELECT VERSION() AS version"); - $version = $data[0]; - - - - // Fetch all tables that need to be converted. - $tables = DBManager::get()->fetchFirst("SELECT TABLE_NAME - FROM `information_schema`.TABLES - WHERE TABLE_SCHEMA=:database AND ENGINE=:oldengine - ORDER BY TABLE_NAME", - [ - ':database' => $DB_STUDIP_DATABASE, - ':oldengine' => 'MyISAM', - ]); - - /* - * lit_catalog needs fulltext indices which InnoDB doesn't support - * in older versions. - */ - if (version_compare($version, '5.6', '<')) { - $stmt_fulltext = DBManager::get()->prepare("SHOW INDEX FROM `:table` WHERE Index_type = 'FULLTEXT'"); - foreach ($tables as $k => $t) { - $stmt_fulltext->bindParam(':table', $t, StudipPDO::PARAM_COLUMN); - $stmt_fulltext->execute(); - if ($stmt_fulltext->fetch()) { - $ignore_tables[] = $t; - unset($tables[$k]); - } - } - if (count($ignore_tables)) { - $this->announce('The following tables needs fulltext indices '. - 'which are not supported for InnoDB in your database '. - 'version, so the tables will be left untouched: ' . join(',', $ignore_tables)); - } - } - - - // Use Barracuda format if database supports it (5.5 upwards). - if (version_compare($version, '5.5', '>=')) { - // Get innodb_file_per_table setting - $data = DBManager::get()->fetchOne("SHOW VARIABLES LIKE 'innodb_file_per_table'"); - $file_per_table = $data['Value'] ?: 'on'; - - // Check if Barracuda file format is enabled - $data = DBManager::get()->fetchOne("SHOW VARIABLES LIKE 'innodb_file_format'"); - $file_format = $data['Value'] ?: 'barracuda'; - - // All settings ok, use Barracuda. - if (strtolower($file_per_table) == 'on' && strtolower($file_format) == 'barracuda') { - $rowformat = 'DYNAMIC'; - // Barracuda cannot be enabled, use Antelope format. - } else { - $this->announce('Barracuda row format cannot be used for '. - 'the following reason(s), falling back to Antelope.'); - if (strtolower($file_per_table) != 'on') { - $this->announce('- file_per_table is not enabled'); - } - if (strtolower($file_format) != 'barracuda') { - $this->announce('- file_format is not set to "Barracuda"'); - } - $rowformat = 'COMPACT'; - } - } else { - $this->announce('Barracuda row format is supported only in '. - 'MySQL 5.5 and up, falling back to Antelope.'); - $rowformat = 'COMPACT'; - } - - // Prepare query for table conversion. - $stmt = DBManager::get()->prepare("ALTER TABLE `:table` ROW_FORMAT=:rowformat ENGINE=:newengine"); - $stmt->bindParam(':rowformat', $rowformat, StudipPDO::PARAM_COLUMN); - $newengine = 'InnoDB'; - $stmt->bindParam(':newengine', $newengine, StudipPDO::PARAM_COLUMN); - - // Now convert the found tables. - foreach ($tables as $t) { - try { - $stmt->bindParam(':table', $t, StudipPDO::PARAM_COLUMN); - $stmt->execute(); - } catch (Exception $e) { - throw new Exception('Error while migrating table "' . $t . '", error: ' . $e->getMessage()); - } - } - - - $end = microtime(true); - - $duration = $end - $start; - $human_duration = sprintf("%02d:%02d:%02d", - ($duration / 60 / 60) % 24, ($duration / 60) % 60, $duration % 60); - - $this->announce('Migration finished, duration ' . $human_duration); - - // InnoDB not enabled, do nothing but show a message. - } else { - throw new Exception('Migration 186: The storage engine InnoDB is not enabled in your '. - 'database installation, tables cannot be converted.'); - } - - } - - /** - * Convert all database tables back to MyISAM engine. - */ - public function down() - { - global $DB_STUDIP_DATABASE; - - // Fetch all tables that need to be converted. - $tables = DBManager::get()->fetchFirst("SELECT TABLE_NAME - FROM `information_schema`.TABLES - WHERE TABLE_SCHEMA=:database AND ENGINE=:oldengine - ORDER BY TABLE_NAME", - [ - ':database' => $DB_STUDIP_DATABASE, - ':oldengine' => 'InnoDB' - ]); - - // Prepare query for table conversion. - $stmt = DBManager::get()->prepare("ALTER TABLE `:table` ENGINE=:newengine"); - $newengine = 'MyISAM'; - $stmt->bindParam(':newengine', $newengine, StudipPDO::PARAM_COLUMN); - - // Now convert the found tables. - foreach ($tables as $t) { - $stmt->bindParam(':table', $t, StudipPDO::PARAM_COLUMN); - $stmt->execute(); - } - - } - -} diff --git a/db/migrations/187_step_291_questionnaires.php b/db/migrations/187_step_291_questionnaires.php deleted file mode 100644 index c2c896c..0000000 --- a/db/migrations/187_step_291_questionnaires.php +++ /dev/null @@ -1,275 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `questionnaires` ( - `questionnaire_id` varchar(32) NOT NULL, - `title` varchar(128) NOT NULL, - `description` text NULL, - `user_id` varchar(32) NOT NULL, - `startdate` BIGINT(20) NULL, - `stopdate` BIGINT(20) NULL, - `visible` TINYINT(1) DEFAULT '0' NOT NULL, - `anonymous` TINYINT(1) DEFAULT '0' NOT NULL, - `resultvisibility` ENUM('always', 'never', 'afterending') DEFAULT 'always' NOT NULL, - `editanswers` TINYINT(1) DEFAULT '1' NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`questionnaire_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `questionnaire_questions` ( - `question_id` varchar(32) NOT NULL, - `questionnaire_id` varchar(32) NOT NULL, - `questiontype` varchar(64) NOT NULL, - `questiondata` text NOT NULL, - `position` INT NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`question_id`), - KEY `questionnaire_id` (`questionnaire_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `questionnaire_assignments` ( - `assignment_id` varchar(32) NOT NULL, - `questionnaire_id` varchar(32) NOT NULL, - `range_id` varchar(32) NOT NULL, - `range_type` varchar(64) NOT NULL, - `user_id` varchar(32) NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`assignment_id`), - KEY `questionnaire_id` (`questionnaire_id`), - KEY `range_id_range_type` (`range_id`,`range_type`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `questionnaire_answers` ( - `answer_id` varchar(32) NOT NULL, - `question_id` varchar(32) NOT NULL, - `user_id` varchar(32) NULL, - `answerdata` text NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`answer_id`), - KEY `question_id` (`question_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `questionnaire_anonymous_answers` ( - `anonymous_answer_id` varchar(32) NOT NULL, - `questionnaire_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`anonymous_answer_id`), - KEY `questionnaire_id` (`questionnaire_id`), - UNIQUE KEY `questionnaire_id_user_id` (`questionnaire_id`,`user_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - //now import old data into new tables: - $resultvisibility_mapping = [ - 'ever' => 'always', - 'delivery' => 'always', - 'end' => 'afterending', - 'never' => 'never' - ]; - $all_votes = DBManager::get()->prepare(" - SELECT vote.* FROM vote INNER JOIN auth_user_md5 ON user_id = author_id - "); - $all_votes->execute(); - while ($vote = $all_votes->fetch(PDO::FETCH_ASSOC)) { - //Fragebogen erstellen - $questionnaire = new Questionnaire($vote['vote_id']); - $questionnaire['title'] = $vote['title']; - $questionnaire->setId($vote['vote_id']); - $questionnaire['user_id'] = $vote['author_id']; - $questionnaire['startdate'] = $vote['startdate']; - $questionnaire['stopdate'] = $vote['stopdate'] ?: (in_array($vote['state'], ["stopvis", "stopinvis"]) ? time() : null); - $questionnaire['visible'] = in_array($vote['state'], ["active", "stopvis"]) ? 1 : 0; // stopvis new active stopinvis - $questionnaire['anonymous'] = $vote['anonymous']; - $questionnaire['resultvisibility'] = $resultvisibility_mapping[$vote['resultvisibility']]; - $questionnaire['editanswers'] = $vote['changeable']; - $questionnaire['chdate'] = $vote['chdate']; - $questionnaire['mkdate'] = $vote['mkdate']; - - $questionnaire->store(); - - $question = $this->createQuestion($questionnaire->id, $vote); - - //Bestehende Antworten migrieren - if ($questionnaire['anonymous']) { - foreach ($question['counter'] as $answer_id => $count) { - for ($i = 0; $i < $count; $i++) { - $answer = new QuestionnaireAnswer(); - $answer['user_id'] = null; - $answer['chdate'] = 1; //damit man nicht aus dem chdate auf die user_id schließen kann - $answer['mkdate'] = 1; //mkdate genauso - $answer['question_id'] = $question['id']; - $answerdata = []; - $answers = [$answer_id]; - foreach ($answers as $key => $answer_data) { - $answers[$key] = $question['mapping'][$answer_data]; - } - sort($answers); - $answerdata['answers'] = $answers; - if (!$question['multiplechoice']) { - $answerdata['answers'] = $answerdata['answers'][0]; - } - $answer['answerdata'] = $answerdata; - $answer->store(); - } - } - - $statement = DBManager::get()->prepare(" - SELECT * - FROM vote_user - WHERE vote_id = :vote_id - "); - $statement->execute([ - 'vote_id' => $vote['vote_id'] - ]); - foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $anonymous_vote) { - $anonymous_answer = new QuestionnaireAnonymousAnswer(); - $anonymous_answer['questionnaire_id'] = $questionnaire->getId(); - $anonymous_answer['user_id'] = $anonymous_vote['user_id']; - $anonymous_answer['chdate'] = $anonymous_vote['votedate']; - $anonymous_answer['mkdate'] = $anonymous_vote['votedate']; - $anonymous_answer->store(); - } - - } else { - $statement = DBManager::get()->prepare(" - SELECT GROUP_CONCAT(answer_id SEPARATOR ' ') AS answers, user_id, MAX(votedate) AS votedate - FROM voteanswers_user - WHERE answer_id IN (?) - GROUP BY user_id - "); - $statement->execute([array_keys($question['mapping'])]); - foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $answer_data) { - $answer = new QuestionnaireAnswer(); - $answer['user_id'] = $answer_data['user_id']; - $answer['chdate'] = $answer_data['votedate']; - $answer['mkdate'] = $answer_data['votedate']; - $answer['question_id'] = $question['id']; - $answerdata = []; - $answers = explode(" ", $answer_data['answers']); - foreach ($answers as $key => $answer_data) { - $answers[$key] = $question['mapping'][$answer_data]; - } - sort($answers); - $answerdata['answers'] = $answers; - if (!$question['multiplechoice']) { - $answerdata['answers'] = $answerdata['answers'][0]; - } - $answer['answerdata'] = $answerdata; - $answer->store(); - } - } - - - //Und noch einhängen das ganze: - $binding = new QuestionnaireAssignment(); - $binding['questionnaire_id'] = $questionnaire->getId(); - $binding['range_id'] = $vote['range_id'] !== "studip" ? $vote['range_id'] : "start"; - $binding['range_type'] = $vote['range_id'] === "studip" - ? "static" - : ($vote['range_id'] === $vote['author_id'] - ? "user" - : (Institute::find($vote['range_id']) ? "institute" : "course") - ); - $binding['user_id'] = $vote['author_id']; - $binding['chdate'] = $questionnaire['chdate']; - $binding['mkdate'] = $questionnaire['mkdate']; - - $binding->store(); - } - - //and finally clean up: - - DBManager::get()->exec("DROP TABLE IF EXISTS `vote`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `voteanswers`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `voteanswers_user`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `vote_user`"); - } - - function down() - { - DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_anonymous_answers`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_assignments`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_questions`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaire_answers`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `questionnaires`"); - } - - - private function createQuestion($questionnaireId, $vote) - { - $database = DBManager::get(); - - $data = [ - 'question_id' => md5(uniqid('questionnaire_questions', 1)), - 'questionnaire_id' => $questionnaireId, - 'questiontype' => $vote['type'] === "vote" ? "Vote" : "Test", - 'position' => 1, - 'chdate' => $vote['chdate'], - 'mkdate' => $vote['mkdate'] - ]; - - $questiondata = [ - 'multiplechoice' => $vote['multiplechoice'], - 'question' => $vote['question'], - ]; - - //Antwortmöglichkeiten vorsehen: - $optionsStatement = $database->prepare(" - SELECT * - FROM voteanswers - WHERE vote_id = ? - ORDER BY position ASC - "); - $optionsStatement->execute([$vote['vote_id']]); - $options = $optionsStatement->fetchAll(PDO::FETCH_ASSOC); - $mapping = []; - $counter = []; - foreach ($options as $key => $option) { - $questiondata['options'][] = $option['answer']; - $mapping[$option['answer_id']] = $key + 1; - $counter[$option['answer_id']] = $option['counter']; - if (($vote['type'] === "test") && $option['correct']) { - $questiondata['correctanswer'][] = $key + 1; - } - } - - $data['questiondata'] = json_encode(studip_utf8encode($questiondata)); - - $insertStmt = $database->prepare(" - INSERT INTO questionnaire_questions - (question_id, questionnaire_id, questiontype, questiondata, position, chdate, mkdate) - VALUES (:question_id, :questionnaire_id, :questiontype, :questiondata, :position, :chdate, :mkdate) - "); - $insertStmt->execute($data); - - return [ - 'id' => $data['question_id'], - 'multiplechoice' => $questiondata['multiplechoice'], - 'mapping' => $mapping, - 'counter' => $counter - ]; - } -} diff --git a/db/migrations/188_step_00296_appointment_requests.php b/db/migrations/188_step_00296_appointment_requests.php deleted file mode 100644 index c671bc3..0000000 --- a/db/migrations/188_step_00296_appointment_requests.php +++ /dev/null @@ -1,78 +0,0 @@ - 'CALENDAR_GRANT_ALL_INSERT', - 'description' => 'Ermöglicht das Eintragen von Terminen in alle Nutzerkalender, ohne Beachtung des Rechtesystems.', - 'section' => 'modules', - 'type' => 'boolean', - 'value' => '0' - ] - ]; - - /** - * short description of this migration - */ - function description() - { - return "Extends the calendar by the possibility to state an appointment in" - . "another user's calendar as a requested appointment. " - . "Displaying of course appointments is now optional."; - } - - /** - * insert list of options into config table - */ - function insertConfig($options) - { - $db = DBManager::get(); - $time = time(); - - $stmt = $db->prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - /** - * remove list of options from config table - */ - function deleteConfig($options) - { - $db = DBManager::get(); - - $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); - - foreach ($options as $option) { - $stmt->execute(['name' => $option['name']]); - } - } - - /** - * perform this migration - */ - public function up() - { - $this->insertConfig($this->options_new); - } - - /** - * revert this migration - */ - public function down() - { - $this->deleteConfig($this->options_new); - } -} diff --git a/db/migrations/189_step_00288_sem_class_raumzeit.php b/db/migrations/189_step_00288_sem_class_raumzeit.php deleted file mode 100644 index 457a7e5..0000000 --- a/db/migrations/189_step_00288_sem_class_raumzeit.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.4 - * - * @see https://develop.studip.de/trac/ticket/5797 - */ -class Step00288SemClassRaumzeit extends Migration -{ - - /** - * short description of this migration - */ - public function description() - { - return 'Registers new sem_class settings for display of raumzeit.'; - } - - /** - * perform this migration - */ - public function up() - { - DBManager::get()->exec('ALTER TABLE `sem_classes` ADD `show_raumzeit` TINYINT( 4 ) NOT NULL DEFAULT "1" AFTER `title_autor_plural`'); - - try { - $sem_class = new SemClass(99); - $sem_class->set('show_raumzeit', '0'); - $sem_class->set('schedule', 'CoreSchedule'); - $modules = $sem_class->getModules(); - $modules['CoreSchedule'] = ['activated' => '1', 'sticky' => '0']; - $sem_class->setModules($modules); - $sem_class->store(); - } catch (Exception $e) { } - - } - - /** - * revert this migration - */ - public function down() - { - DBManager::get()->execute('ALTER TABLE `sem_classes` DROP `show_raumzeit`'); - } - -} diff --git a/db/migrations/18_step_00139_upload_file_reorg.php b/db/migrations/18_step_00139_upload_file_reorg.php deleted file mode 100644 index 51201e2..0000000 --- a/db/migrations/18_step_00139_upload_file_reorg.php +++ /dev/null @@ -1,52 +0,0 @@ -query('SELECT dokument_id FROM dokumente'); - - foreach ($result as $row) { - $document = $row['dokument_id']; - $file_path = $UPLOAD_PATH.'/'.$document; - - if (is_file($file_path)) { - rename($file_path, get_upload_file_path($document)); - } - } - } - - function down () - { - global $UPLOAD_PATH; - - $db = DBManager::get(); - $result = $db->query('SELECT dokument_id FROM dokumente'); - - foreach ($result as $row) { - $document = $row['dokument_id']; - $file_path = get_upload_file_path($document); - - if (is_file($file_path)) { - rename($file_path, $UPLOAD_PATH.'/'.$document); - } - } - - for ($i = 0; $i <= 0xff; ++$i) { - $directory = sprintf('%s/%02x', $UPLOAD_PATH, $i); - - if (is_dir($directory)) { - rmdir($directory); - } - } - } -} -?> diff --git a/db/migrations/190_allow_topics_to_be_public.php b/db/migrations/190_allow_topics_to_be_public.php deleted file mode 100644 index b406d25..0000000 --- a/db/migrations/190_allow_topics_to_be_public.php +++ /dev/null @@ -1,25 +0,0 @@ -exec(" - ALTER TABLE `seminare` ADD `public_topics` TINYINT( 2 ) NOT NULL DEFAULT '1' - "); - DBManager::get()->exec(" - UPDATE `seminare` SET `public_topics` = '0' - "); - } - - public function down() - { - DBManager::get()->execute(' - ALTER TABLE `seminare` DROP `public_topics` - '); - } -} diff --git a/db/migrations/191_add_dedicated_admins_role.php b/db/migrations/191_add_dedicated_admins_role.php deleted file mode 100644 index 3e637a8..0000000 --- a/db/migrations/191_add_dedicated_admins_role.php +++ /dev/null @@ -1,28 +0,0 @@ -exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('DedicatedAdmin', 'n'); - "); - RolePersistence::expireCaches(); - } - - public function down() - { - DBManager::get()->execute(" - DELETE FROM `roles` WHERE `rolename` = 'DedicatedAdmin' AND `system` = 'n' - "); - RolePersistence::expireCaches(); - } - -} diff --git a/db/migrations/192_add_user_config_for_admin_display_settings.php b/db/migrations/192_add_user_config_for_admin_display_settings.php deleted file mode 100644 index 0ea0c3e..0000000 --- a/db/migrations/192_add_user_config_for_admin_display_settings.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @license GPL2 or any later version - */ -class AddUserConfigForAdminDisplaySettings extends Migration -{ - public function description() - { - return 'Adds user config entry for "PLUGINADMIN_DISPLAY_SETTINGS"'; - } - - public function up() - { - $query = "INSERT INTO `config` ( - `config_id`, `parent_id`, `field`, `value`, `is_default`, - `type`, `range`, `section`, `mkdate`, `chdate`, `description` - ) VALUES ( - MD5(:field), '', :field, :value, 1, 'array', 'user', '', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description - )"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':field', 'PLUGINADMIN_DISPLAY_SETTINGS'); - $statement->bindValue(':value', json_encode(['plugin_filter' => null, 'core_filter' => 'yes'])); - $statement->bindValue(':description', 'Speichert die Darstellungseinstellungen der Pluginadministration'); - $statement->execute(); - } - - public function down() - { - $query = "DELETE FROM `config` WHERE `field` = 'PLUGINADMIN_DISPLAY_SETTINGS'"; - DBManager::get()->exec($query); - - $query = "DELETE FROM `user_config` WHERE `field` = 'PLUGINADMIN_DISPLAY_SETTINGS'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/193_tic6653_add_advanced_coursewizardstep.php b/db/migrations/193_tic6653_add_advanced_coursewizardstep.php deleted file mode 100644 index 9d3924f..0000000 --- a/db/migrations/193_tic6653_add_advanced_coursewizardstep.php +++ /dev/null @@ -1,23 +0,0 @@ - 'AdvancedBasicDataWizardStep']); - } -} \ No newline at end of file diff --git a/db/migrations/194_tic_6576_preferential_admission.php b/db/migrations/194_tic_6576_preferential_admission.php deleted file mode 100644 index 3547d24..0000000 --- a/db/migrations/194_tic_6576_preferential_admission.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.5 - * - * @see https://develop.studip.de/trac/ticket/6576 - */ -class TIC6576PreferentialAdmission extends Migration -{ - public function description() - { - return 'Introduces an admission rule for favoring selected courses '. - 'of study/degrees/semesters or higher semesters of study in seat '. - 'distribution.'; - } - - public function up() - { - // Table for rule definitions. - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `prefadmissions` ( - `rule_id` VARCHAR(32), - `favor_semester` TINYINT(1) NOT NULL DEFAULT 0, - `mkdate` int(11) NOT NULL DEFAULT 0, - `chdate` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - // Table for storing rule - condition relations. - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `prefadmission_condition` ( - `rule_id` VARCHAR(32) NOT NULL, - `condition_id` VARCHAR(32) NOT NULL, - `chance` INT(4) NOT NULL DEFAULT 1, - `mkdate` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_id`,`condition_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - // Install rule to database. - DBManager::get()->exec("INSERT IGNORE INTO `admissionrules` (`id`, `ruletype`, `active`, `mkdate`) - VALUES (0, 'PreferentialAdmission', '1', UNIX_TIMESTAMP())"); - - // Allow higher bonus factors for users (as generated by PreferentialAdmission) - DBManager::get()->exec("ALTER TABLE `admissionfactor` CHANGE `factor` `factor` FLOAT NOT NULL DEFAULT '1.00';"); - - } - - public function down() - { - // Remove entry in admission rule registry. - DBManager::get()->exec("DELETE FROM `admissionrules` WHERE `ruletype` = 'PreferentialAdmission'"); - - // Remove rule data tables. - DBManager::get()->exec("DROP TABLE IF EXISTS `prefadmission`"); - DBManager::get()->exec("DROP TABLE IF EXISTS `prefadmission_condition`"); - } -} diff --git a/db/migrations/195_tic_6655_admissionrule_compatibility.php b/db/migrations/195_tic_6655_admissionrule_compatibility.php deleted file mode 100644 index f613620..0000000 --- a/db/migrations/195_tic_6655_admissionrule_compatibility.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.5 - * - * @see https://develop.studip.de/trac/ticket/6655 - */ -class TIC6655AdmissionRuleCompatibility extends Migration -{ - public function description() - { - return 'Compatibility between admission rules is now stored in database and can be configured via GUI.'; - } - - public function up() - { - // Table for rule definitions. - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `admissionrule_compat` ( - `rule_type` VARCHAR(32) NOT NULL, - `compat_rule_type` VARCHAR(32) NOT NULL, - `mkdate` int(11) NOT NULL DEFAULT 0, - `chdate` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rule_type`, `compat_rule_type`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - // Initial DB entries, taken from former class variables ($allowed_combinations). - $compat = [ - 'ConditionalAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'LimitedAdmission', - 'ParticipantRestrictedAdmission', - 'PasswordAdmission', - 'PreferentialAdmission', - 'TimedAdmission' - ], - 'CourseMemberAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'LimitedAdmission', - 'ParticipantRestrictedAdmission', - 'PasswordAdmission', - 'PreferentialAdmission', - 'TimedAdmission' - ], - 'LimitedAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'ParticipantRestrictedAdmission', - 'PasswordAdmission', - 'PreferentialAdmission', - 'TimedAdmission' - ], - 'ParticipantRestrictedAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'LimitedAdmission', - 'PreferentialAdmission', - 'TimedAdmission' - ], - 'PasswordAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'PreferentialAdmission', - 'TimedAdmission', - ], - 'PreferentialAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'LimitedAdmission', - 'ParticipantRestrictedAdmission', - 'PasswordAdmission', - 'TimedAdmission' - ], - 'TimedAdmission' => [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'LimitedAdmission', - 'ParticipantRestrictedAdmission', - 'PasswordAdmission', - 'PreferentialAdmission' - ] - ]; - - $stmt = DBManager::get()->prepare("INSERT IGNORE INTO `admissionrule_compat` - (`rule_type`, `compat_rule_type`, `mkdate`, `chdate`) - VALUES (:ruletype, :compat, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())"); - - foreach ($compat as $type => $compat_types) { - foreach ($compat_types as $c) { - $stmt->execute(['ruletype' => $type, 'compat' => $c]); - } - } - } - - public function down() - { - // Remove rule data tables. - DBManager::get()->exec("DROP TABLE IF EXISTS `admissionrule_compat`"); - } -} diff --git a/db/migrations/196_extend_ressources.php b/db/migrations/196_extend_ressources.php deleted file mode 100644 index 3bd06ad..0000000 --- a/db/migrations/196_extend_ressources.php +++ /dev/null @@ -1,22 +0,0 @@ -execute("ALTER TABLE `resources_objects` ADD `requestable` TINYINT( 4 ) NOT NULL DEFAULT '1' AFTER `multiple_assign`"); - DBManager::get()->execute("ALTER TABLE `resources_categories_properties` ADD `protected` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `requestable`"); - DBManager::get()->execute("ALTER TABLE `resources_properties` ADD `info_label` TINYINT( 4 ) NOT NULL DEFAULT '0'"); - } - - public function down() - { - DBManager::get()->execute("ALTER TABLE `resources_objects` DROP `requestable`"); - DBManager::get()->execute("ALTER TABLE `resources_categories_properties` DROP `protected`"); - DBManager::get()->execute("ALTER TABLE `resources_properties` DROP `info_label`"); - } -} diff --git a/db/migrations/197_step_00301_admission_conditiongroups.php b/db/migrations/197_step_00301_admission_conditiongroups.php deleted file mode 100644 index 678186b..0000000 --- a/db/migrations/197_step_00301_admission_conditiongroups.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.5 - * - * @see https://develop.studip.de/trac/ticket/6574 - */ -class Step00301AdmissionConditiongroups extends Migration -{ - - /** - * short description of this migration - */ - public function description() - { - return 'Adds table admission_conditiongroup.'; - } - - /** - * perform this migration - */ - public function up() - { - DBManager::get()->exec('CREATE TABLE IF NOT EXISTS `admission_conditiongroup` ( - `conditiongroup_id` varchar(32) NOT NULL, - `quota` int(11) NOT NULL, - PRIMARY KEY (`conditiongroup_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC'); - - DBManager::get()->exec("ALTER TABLE `admission_condition` ADD `conditiongroup_id` VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `filter_id`"); - } - - /** - * revert this migration - */ - public function down() - { - DBManager::get()->exec('DROP TABLE `admission_conditiongroup`'); - DBManager::get()->exec('ALTER TABLE `admission_condition` DROP `conditiongroup_id`;'); - } - -} diff --git a/db/migrations/198_add_activities.php b/db/migrations/198_add_activities.php deleted file mode 100644 index e9ca7ca..0000000 --- a/db/migrations/198_add_activities.php +++ /dev/null @@ -1,114 +0,0 @@ -exec("CREATE TABLE `activities` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `object_id` varchar(255) NOT NULL, - `context` enum('system','course','institute','user') NOT NULL, - `context_id` varchar(32) NOT NULL, - `provider` varchar(255) NOT NULL, - `actor_type` varchar(255) NOT NULL, - `actor_id` varchar(255) NOT NULL, - `verb` enum('answered','attempted','attended','completed','created','deleted','edited','experienced','failed','imported','interacted','passed','shared','sent','voided') NOT NULL DEFAULT 'experienced', - `content` text NULL, - `object_type` varchar(255) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `context_id` (`context_id`), - KEY `mkdate` (`mkdate`) - ) ENGINE = InnoDB ROW_FORMAT=DYNAMIC"); - - - //CHECK IF API IS ENABLED - if (!Config::get()->API_ENABLED) { - $db->exec("UPDATE `config` SET `value` = '1' WHERE `field` = 'API_ENABLED'"); - } - //SET PERMISSION FOR ROUTE - $permissions = RESTAPI\ConsumerPermissions::get('global'); - $permissions->set('/user/:user_id/activitystream','get', true, true); - $permissions->store(); - - //CHECK IF OLD ACTIVITY-FEED-PLUGIN IS ACTIVE - $old_id = $db->query("SELECT pluginid FROM plugins - WHERE pluginclassname = 'ActivityFeed' - AND pluginpath NOT LIKE '%core%'")->fetchColumn(); - - if ($old_id !== false) { - $stmt = $db->prepare("DELETE FROM plugins WHERE pluginid = ?"); - $stmt->execute([$old_id]); - - $stmt = $db->prepare("DELETE FROM plugins_activated WHERE pluginid = ?"); - $stmt->execute([$old_id]); - - $stmt = $db->prepare("DELETE FROM plugins_default_activations WHERE pluginid = ?"); - $stmt->execute([$old_id]); - - $stmt = $db->prepare("DELETE FROM roles_plugins WHERE pluginid = ?"); - $stmt->execute([$old_id]); - } - - // Activate Widget - $classname = "ActivityFeed"; - $navpos = $db->query("SELECT navigationpos FROM plugins - ORDER BY navigationpos DESC")->fetchColumn() + 1; - - // insert plugin into db - $stmt = $db->prepare("INSERT INTO plugins - (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) - VALUES (?, ?, ?, 'PortalPlugin', 'yes', ?)"); - $stmt->execute([$classname, 'core/'.$classname, $classname, $navpos]); - - // get id of newly created plugin ( - $plugin_id = $db->query("SELECT pluginid FROM plugins - WHERE pluginclassname = '$classname'")->fetchColumn(); - - // set all default roles for the plugin - $stmt = $db->prepare("INSERT INTO roles_plugins - (roleid, pluginid) VALUES (?, ?)"); - foreach (range(1, 6) as $role_id) { - $stmt->execute([$role_id, $plugin_id]); - } - } - - public function down() - { - //DEACTIVATE ROUTE - $permissions = RESTAPI\ConsumerPermissions::get('global'); - $permissions->set('/user/:user_id/activitystream','get', false, true); - $permissions->store(); - - $db = DBManager::get(); - - //REMOVE WIDGET - $widget_id = $db->query("SELECT pluginid FROM plugins - WHERE pluginclassname = 'ActivityFeed'")->fetchColumn(); - - $stmt = $db->prepare("DELETE FROM plugins WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $stmt = $db->prepare("DELETE FROM widget_default WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $stmt = $db->prepare("DELETE FROM widget_user WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $stmt = $db->prepare("DELETE FROM roles_plugins WHERE pluginid = ?"); - $stmt->execute([$widget_id]); - - $db->exec("DROP TABLE `activities`"); - - } -} diff --git a/db/migrations/199_step_00302_modulverwaltung.php b/db/migrations/199_step_00302_modulverwaltung.php deleted file mode 100644 index f6c453e..0000000 --- a/db/migrations/199_step_00302_modulverwaltung.php +++ /dev/null @@ -1,896 +0,0 @@ -query("SELECT * FROM plugins WHERE pluginclassname = 'MVVPlugin'") - ->fetch(PDO::FETCH_ASSOC); - - if ($old_mvv) { - $db->exec("UPDATE plugins SET pluginpath = 'core/Modulverwaltung' WHERE pluginclassname = 'MVVPlugin'"); - if ($old_mvv['pluginpath'] !== 'core/Modulverwaltung') { - @rmdirr($GLOBALS['PLUGINS_PATH'] . '/' . $old_mvv['pluginpath']); - } - } else { - //Installieren des Plugins - $db->exec("INSERT INTO plugins - SET pluginclassname = 'MVVPlugin', - pluginpath = 'core/Modulverwaltung', - pluginname = 'Modulverwaltung', - plugintype = 'SystemPlugin', - enabled = 'yes', - navigationpos = '1'"); - $plugin_id = $db->lastInsertId(); - $db->exec("INSERT IGNORE INTO roles_plugins (roleid, pluginid) - SELECT roleid, " . $db->quote($plugin_id) . " FROM roles WHERE `system` = 'y'"); - } - - - $db->exec(" - ALTER TABLE `datafields` - CHANGE `object_type` `object_type` - ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata', - 'moduldeskriptor','modulteildeskriptor') NULL DEFAULT NULL - "); - - $db->exec(" - ALTER TABLE `datafields` CHANGE `object_class` `object_class` VARCHAR(255) NULL DEFAULT NULL - "); - - if (!$db->fetchOne("SHOW COLUMNS FROM sem_classes WHERE Field = 'module'")) { - $db->exec(" - ALTER TABLE `sem_classes` ADD `module` TINYINT(4) NOT NULL AFTER `bereiche` - "); - } - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_abschl_kategorie` ( - `kategorie_id` varchar(32) NOT NULL, - `name` varchar(255) NOT NULL, - `name_en` varchar(255) DEFAULT NULL, - `name_kurz` varchar(50) DEFAULT NULL, - `name_kurz_en` varchar(50) DEFAULT NULL, - `beschreibung` text, - `beschreibung_en` text, - `position` int(11) DEFAULT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`kategorie_id`), - UNIQUE KEY `name` (`name`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_abschl_zuord` ( - `abschluss_id` varchar(32) NOT NULL, - `kategorie_id` varchar(32) NOT NULL, - `position` int(4) NOT NULL DEFAULT '9999', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`abschluss_id`), - KEY `kategorie_id` (`kategorie_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_dokument` ( - `dokument_id` varchar(32) NOT NULL, - `url` tinytext NOT NULL, - `name` varchar(255) NOT NULL, - `name_en` varchar(255) DEFAULT NULL, - `linktext` varchar(255) NOT NULL, - `linktext_en` varchar(255) DEFAULT NULL, - `beschreibung` text, - `beschreibung_en` text, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`dokument_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_dokument_zuord` ( - `dokument_id` varchar(32) NOT NULL, - `range_id` varchar(32) NOT NULL, - `object_type` varchar(50) NOT NULL, - `position` int(3) NOT NULL DEFAULT '999', - `kommentar` tinytext, - `kommentar_en` tinytext, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`dokument_id`,`range_id`,`object_type`), - KEY `range_id_object_type`(`range_id`,`object_type`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_fach_inst` ( - `fach_id` varchar(32) NOT NULL, - `institut_id` varchar(32) NOT NULL, - `position` int(11) NOT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`fach_id`,`institut_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_fachberater` ( - `stgteil_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `position` int(11) NOT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`stgteil_id`,`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_lvgruppe` ( - `lvgruppe_id` varchar(32) NOT NULL, - `name` varchar(250) NOT NULL, - `name_en` varchar(250) DEFAULT NULL, - `alttext` tinytext, - `alttext_en` tinytext, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`lvgruppe_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_lvgruppe_modulteil` ( - `lvgruppe_id` varchar(32) NOT NULL, - `modulteil_id` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `fn_id` varchar(32) DEFAULT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`lvgruppe_id`,`modulteil_id`), - KEY `fn_id` (`fn_id`), - KEY `modulteil_id` (`modulteil_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_lvgruppe_seminar` ( - `lvgruppe_id` varchar(32) NOT NULL, - `seminar_id` varchar(32) NOT NULL, - `author_id` varchar(32) DEFAULT NULL, - `editor_id` varchar(32) DEFAULT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`lvgruppe_id`,`seminar_id`), - KEY `seminar_id` (`seminar_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modul` ( - `modul_id` varchar(32) NOT NULL, - `quelle` varchar(120) DEFAULT NULL, - `variante` varchar(32) DEFAULT NULL, - `flexnow_modul` varchar(250) DEFAULT NULL, - `code` varchar(250) DEFAULT NULL, - `start` varchar(32) DEFAULT NULL, - `end` varchar(32) DEFAULT NULL, - `beschlussdatum` int(11) DEFAULT NULL, - `fassung_nr` int(2) DEFAULT NULL, - `fassung_typ` varchar(32) DEFAULT NULL, - `version` varchar(120) NOT NULL DEFAULT '1', - `dauer` varchar(50) DEFAULT NULL, - `kapazitaet` varchar(50) NOT NULL DEFAULT '', - `kp` int(11) DEFAULT NULL, - `wl_selbst` int(11) DEFAULT NULL, - `wl_pruef` int(11) DEFAULT NULL, - `pruef_ebene` varchar(32) DEFAULT NULL, - `faktor_note` varchar(10) NOT NULL DEFAULT '1', - `stat` varchar(32) DEFAULT NULL, - `kommentar_status` text, - `verantwortlich` tinytext, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modul_id`), - KEY `stat` (`stat`), - KEY `flexnow_modul` (`flexnow_modul`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modul_deskriptor` ( - `deskriptor_id` varchar(32) NOT NULL, - `modul_id` varchar(32) NOT NULL, - `sprache` varchar(32) NOT NULL, - `verantwortlich` tinytext, - `bezeichnung` tinytext, - `voraussetzung` text, - `kompetenzziele` text, - `inhalte` text, - `literatur` text, - `links` text, - `kommentar` text, - `turnus` tinytext, - `kommentar_kapazitaet` text, - `kommentar_sws` text, - `kommentar_wl_selbst` text, - `kommentar_wl_pruef` text, - `kommentar_note` text, - `pruef_vorleistung` text, - `pruef_leistung` text, - `pruef_wiederholung` text, - `ersatztext` text, - `author_id` varchar(32) DEFAULT NULL, - `editor_id` varchar(32) DEFAULT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`deskriptor_id`), - UNIQUE KEY `modul_id` (`modul_id`,`sprache`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modul_inst` ( - `modul_id` varchar(32) NOT NULL, - `institut_id` varchar(32) NOT NULL, - `gruppe` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modul_id`,`institut_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modul_language` ( - `modul_id` varchar(32) NOT NULL, - `lang` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modul_id`,`lang`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modul_user` ( - `modul_id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `gruppe` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modul_id`,`user_id`,`gruppe`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modulteil` ( - `modulteil_id` varchar(32) NOT NULL, - `modul_id` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `flexnow_modul` varchar(250) DEFAULT NULL, - `nummer` varchar(20) DEFAULT NULL, - `num_bezeichnung` varchar(32) DEFAULT NULL, - `lernlehrform` varchar(32) DEFAULT NULL, - `semester` varchar(32) DEFAULT NULL, - `kapazitaet` varchar(50) DEFAULT NULL, - `kp` int(11) DEFAULT NULL, - `sws` int(11) DEFAULT NULL, - `wl_praesenz` int(11) DEFAULT NULL, - `wl_bereitung` int(11) DEFAULT NULL, - `wl_selbst` int(11) DEFAULT NULL, - `wl_pruef` int(11) DEFAULT NULL, - `anteil_note` int(11) DEFAULT NULL, - `ausgleichbar` int(1) NOT NULL DEFAULT '0', - `pflicht` int(2) NOT NULL DEFAULT '0', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modulteil_id`), - KEY `modul_id` (`modul_id`), - KEY `flexnow_modul` (`flexnow_modul`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modulteil_deskriptor` ( - `deskriptor_id` varchar(32) NOT NULL, - `modulteil_id` varchar(32) NOT NULL, - `bezeichnung` tinytext NOT NULL, - `sprache` varchar(32) NOT NULL, - `voraussetzung` text, - `kommentar` text, - `kommentar_kapazitaet` text, - `kommentar_wl_praesenz` text, - `kommentar_wl_bereitung` text, - `kommentar_wl_selbst` text, - `kommentar_wl_pruef` text, - `pruef_vorleistung` text, - `pruef_leistung` text, - `kommentar_pflicht` text, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`deskriptor_id`), - UNIQUE KEY `modulteil_id` (`modulteil_id`,`sprache`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modulteil_language` ( - `modulteil_id` varchar(32) NOT NULL, - `lang` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modulteil_id`,`lang`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_modulteil_stgteilabschnitt` ( - `modulteil_id` varchar(32) NOT NULL, - `abschnitt_id` varchar(32) NOT NULL, - `fachsemester` int(2) NOT NULL, - `differenzierung` varchar(100) NOT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modulteil_id`,`abschnitt_id`,`fachsemester`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_stg_stgteil` ( - `studiengang_id` varchar(32) NOT NULL, - `stgteil_id` varchar(32) NOT NULL, - `stgteil_bez_id` varchar(32) NOT NULL DEFAULT '', - `position` int(11) NOT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`studiengang_id`,`stgteil_id`,`stgteil_bez_id`), - KEY `stgteil_id` (`stgteil_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_stgteil` ( - `stgteil_id` varchar(32) NOT NULL, - `fach_id` varchar(32) DEFAULT NULL, - `kp` varchar(50) DEFAULT NULL, - `semester` int(2) DEFAULT NULL, - `zusatz` varchar(200) NOT NULL, - `zusatz_en` varchar(200) DEFAULT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`stgteil_id`), - KEY `fach_id` (`fach_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_stgteil_bez` ( - `stgteil_bez_id` varchar(32) NOT NULL, - `name` varchar(100) NOT NULL, - `name_en` varchar(100) NOT NULL, - `name_kurz` varchar(20) NOT NULL, - `name_kurz_en` varchar(20) NOT NULL, - `position` int(4) NOT NULL DEFAULT '9999', - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`stgteil_bez_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_stgteilabschnitt` ( - `abschnitt_id` varchar(32) NOT NULL, - `version_id` varchar(32) NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `name` varchar(200) NOT NULL, - `name_en` varchar(200) DEFAULT NULL, - `kommentar` varchar(200) DEFAULT NULL, - `kommentar_en` varchar(200) DEFAULT NULL, - `kp` int(11) DEFAULT NULL, - `ueberschrift` tinytext, - `ueberschrift_en` tinytext, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`abschnitt_id`), - KEY `version_id` (`version_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_stgteilabschnitt_modul` ( - `abschnitt_id` varchar(32) NOT NULL, - `modul_id` varchar(32) NOT NULL, - `flexnow_modul` varchar(250) DEFAULT NULL, - `modulcode` varchar(250) DEFAULT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `bezeichnung` varchar(250) DEFAULT NULL, - `bezeichnung_en` varchar(250) DEFAULT NULL, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`abschnitt_id`,`modul_id`), - KEY `flexnow_modul` (`flexnow_modul`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_stgteilversion` ( - `version_id` varchar(32) NOT NULL, - `stgteil_id` varchar(32) NOT NULL, - `start_sem` varchar(32) DEFAULT NULL, - `end_sem` varchar(32) DEFAULT NULL, - `code` varchar(100) DEFAULT NULL, - `beschlussdatum` int(11) DEFAULT NULL, - `fassung_nr` int(2) DEFAULT NULL, - `fassung_typ` varchar(32) DEFAULT NULL, - `beschreibung` text, - `beschreibung_en` text, - `stat` varchar(32) DEFAULT NULL, - `kommentar_status` text, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`version_id`), - KEY `stgteil_id` (`stgteil_id`), - KEY `stat` (`stat`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `mvv_studiengang` ( - `studiengang_id` varchar(32) NOT NULL, - `abschluss_id` varchar(32) DEFAULT NULL, - `typ` enum('einfach','mehrfach') NOT NULL, - `name` varchar(255) NOT NULL, - `name_kurz` varchar(50) DEFAULT NULL, - `name_kurz_en` varchar(50) DEFAULT NULL, - `name_en` varchar(255) DEFAULT NULL, - `beschreibung` text, - `beschreibung_en` text, - `institut_id` varchar(32) DEFAULT NULL, - `start` varchar(32) DEFAULT NULL, - `end` varchar(32) DEFAULT NULL, - `beschlussdatum` int(11) DEFAULT NULL, - `fassung_nr` int(2) DEFAULT NULL, - `fassung_typ` varchar(32) DEFAULT NULL, - `stat` varchar(32) DEFAULT NULL, - `kommentar_status` text, - `schlagworte` text, - `author_id` varchar(32) NOT NULL, - `editor_id` varchar(32) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`studiengang_id`), - KEY `abschluss_id` (`abschluss_id`), - KEY `institut_id` (`institut_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, `type`, `range`, section, mkdate, chdate, description, comment) - VALUES - (MD5('MVV_ACCESS_ASSIGN_LVGRUPPEN'), 'MVV_ACCESS_ASSIGN_LVGRUPPEN', 'admin', 1, 'string', 'global', 'modules', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Ab welchem Rechtestatus können Veranstaltungen Modulen (LV-Gruppen) zugeordnet werden. Bei Angabe von fakadmin darf nur dieser Zuordnungen vornehmen.', '') - "); - - /** - * New roles for the plug-in - */ - $stmt = DBManager::get()->query("SELECT pluginid FROM plugins WHERE " - . "pluginname = 'Modulverwaltung'"); - $plugin_id = $stmt->fetchColumn(); - $role_ids = []; - - if ($plugin_id !== false) { - - $db->exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('MVVAdmin', 'n'); - "); - - $db->exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('MVVFreigabe', 'n'); - "); - - $db->exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('MVVEntwickler', 'n'); - "); - - $db->exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('MVVRedakteur', 'n'); - "); - - $db->exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('MVVTranslator', 'n'); - "); - - $db->exec(" - INSERT INTO `roles` (`rolename`, `system`) - VALUES ('MVVLvGruppenAdmin', 'n'); - "); - - $roles = RolePersistence::getAllRoles(); - $role_ids = []; - foreach ($roles as $r) { - if (in_array($r->getRolename(), words('MVVAdmin MVVFreigabe MVVEntwickler MVVRedakteur MVVTranslator MVVLvGruppenAdmin'))) { - $role_ids[] = $r->getRoleid(); - } - } - - RolePersistence::assignPluginRoles($plugin_id, $role_ids); - } - - RolePersistence::expireCaches(); - - /** - * Logging - */ - StudipLog::registerActionPlugin('MVV_MODUL_NEW', 'MVV: Modul erstellen', '%user erstellt neues Modul %modul(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_UPDATE', 'MVV: Modul ändern', '%user ändert Modul %modul(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_DEL', 'MVV: Modul löschen', '%user löscht Modul %modul(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STUDIENGANG_NEW', 'MVV: Studiengang erstellen', '%user erstellt neuen Studiengang %stg(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STUDIENGANG_UPDATE', 'MVV: Studiengang ändern', '%user ändert Studiengang %stg(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STUDIENGANG_DEL', 'MVV: Studiengang löschen', '%user löscht Studiengang %stg(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STGTEIL_NEW', 'MVV: Studiengangteil erstellen', '%user erstellt neuen Studiengangteil %stgteil(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEIL_UPDATE', 'MVV: Studiengangteil ändern', '%user ändert Studiengangteil %stgteil(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEIL_DEL', 'MVV: Studiengangteil löschen', '%user löscht Studiengangteil %stgteil(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STGTEILVERSION_NEW', 'MVV: Studiengangteilversion erstellen', '%user erstellt neue Studiengangteilversion %version(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILVERSION_UPDATE', 'MVV: Studiengangteilversion ändern', '%user ändert Studiengangteilversion %version(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILVERSION_DEL', 'MVV: Studiengangteilversion löschen', '%user löscht Studiengangteilversion %version(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STGTEILBEZ_NEW', 'MVV: Studiengangteil-Bezeichnung erstellen', '%user erstellt neue Studiengangteil-Bezeichnung %stgteilbez(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILBEZ_UPDATE', 'MVV: Studiengangteil-Bezeichnung ändern', '%user ändert Studiengangteil-Bezeichnung %stgteilbez(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILBEZ_DEL', 'MVV: Studiengangteil-Bezeichnung löschen', '%user löscht Studiengangteil-Bezeichnung %stgteilbez(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_LVGRUPPE_NEW', 'MVV: LV-Gruppe erstellen', '%user erstellt neue LV-Gruppe %lvgruppe(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_LVGRUPPE_UPDATE', 'MVV: LV-Gruppe ändern', '%user ändert LV-Gruppe %lvgruppe(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_LVGRUPPE_DEL', 'MVV: LV-Gruppe löschen', '%user löscht LV-Gruppe %lvgruppe(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_FACH_NEW', 'MVV: Fach erstellen', '%user erstellt neues Fach %fach(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_FACH_UPDATE', 'MVV: Fach ändern', '%user ändert Fach %fach(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_FACH_DEL', 'MVV: Fach löschen', '%user löscht Fach %fach(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_ABSCHLUSS_NEW', 'MVV: Abschluss erstellen', '%user erstellt neuen Abschluss %abschluss(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_ABSCHLUSS_UPDATE', 'MVV: Abschluss ändern', '%user ändert Abschluss %abschluss(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_ABSCHLUSS_DEL', 'MVV: Abschluss löschen', '%user löscht Abschluss %abschluss(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_KATEGORIE_NEW', 'MVV: Abschluss-Kategorie erstellen', '%user erstellt neue Abschluss-Kategorie %abskategorie(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_KATEGORIE_UPDATE', 'MVV: Abschluss-Kategorie ändern', '%user ändert Abschluss-Kategorie %abskategorie(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_KATEGORIE_DEL', 'MVV: Abschluss-Kategorie löschen', '%user löscht Abschluss-Kategorie %abskategorie(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_DOKUMENT_NEW', 'MVV: Dokument erstellen', '%user erstellt neues Dokument %dokument(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_DOKUMENT_UPDATE', 'MVV: Dokument ändern', '%user ändert Dokument %dokument(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_DOKUMENT_DEL', 'MVV: Dokument löschen', '%user löscht Dokument %dokument(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STGTEILABS_NEW', 'MVV: Studiengangteilabschnitt erstellen', '%user erstellt neuen Studiengangteilabschnitt %stgteilabs(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILABS_UPDATE', 'MVV: Studiengangteilabschnitt ändern', '%user ändert Studiengangteilabschnitt %stgteilabs(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILABS_DEL', 'MVV: Studiengangteilabschnitt löschen', '%user löscht Studiengangteilabschnitt %stgteilabs(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_MODULTEIL_NEW', 'MVV: Modulteil erstellen', '%user erstellt neuen Modulteil %modulteil(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_UPDATE', 'MVV: Modulteil ändern', '%user ändert Modulteil %modulteil(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_DEL', 'MVV: Modulteil löschen', '%user löscht Modulteil %modulteil(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_MODULTEIL_DESK_NEW', 'MVV: Modulteil Deskriptor erstellen', '%user erstellt neuen Modulteil Deskriptor %modulteildesk(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_DESK_UPDATE', 'MVV: Modulteil Deskriptor ändern', '%user ändert Modulteil Deskriptor %modulteildesk(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_DESK_DEL', 'MVV: Modulteil Deskriptor löschen', '%user löscht Modulteil Deskriptor %modulteildesk(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_MODUL_DESK_NEW', 'MVV: Modul Deskriptor erstellen', '%user erstellt neuen Modul Deskriptor %moduldesk(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_DESK_UPDATE', 'MVV: Modul Deskriptor ändern', '%user ändert Modul Deskriptor %moduldesk(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_DESK_DEL', 'MVV: Modul Deskriptor löschen', '%user löscht Modul Deskriptor %moduldesk(%affected).', 'MVVPlugin'); - - //Zuweisungstabellen - StudipLog::registerActionPlugin('MVV_MODULINST_NEW', 'MVV: Modul-Einrichtung Beziehung erstellen', '%user weist dem Modul %modul(%affected) die Einrichtungen %inst(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULINST_DEL', 'MVV: Modul-Einrichtung Beziehung löschen', '%user löscht die Zuweisung der Einrichtungen %inst(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULINST_UPDATE', 'MVV: Modul-Einrichtung Beziehung ändern', '%user ändert die Zuweisung der Einrichtungen %inst(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_ABS_ZUORD_NEW', 'MVV: Abschluss-Kategorien Zuweisung erstellen', '%user weist den Abschluss %abschluss(%affected) der Kategorie %abskategorie(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_ABS_ZUORD_DEL', 'MVV: Abschluss-Kategorien Zuweisung löschen', '%user löscht die Zuweisung des Abschlusses %abschluss(%affected) zur Kategorie %abskategorie(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_ABS_ZUORD_UPDATE', 'MVV: Abschluss-Kategorien Zuweisung ändern', '%user ändert die Zuweisung des Abschlusses %abschluss(%affected) zur Kategorie %abskategorie(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_DOK_ZUORD_NEW', 'MVV: Dokumentzuordnung erstellen', '%user weist das Dokument %dokument(%affected) %object_type(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_DOK_ZUORD_DEL', 'MVV: Dokumentzuordnung löschen', '%user löscht die Zuweisung des Dokumentes %dokument(%affected) zu %object_type(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_DOK_ZUORD_UPDATE', 'MVV: Dokumentzuordnung ändern', '%user ändert die Zuweisung des Dokumentes %dokument(%affected) zu %object_type(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_FACHINST_NEW', 'MVV: Fach-Einrichtung Zuweisung erstellen', '%user weist das Fach %fach(%affected) der Einrichtung %inst(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_FACHINST_DEL', 'MVV: Fach-Einrichtung Zuweisung löschen', '%user löscht die Zuweisung des Faches %fach(%affected) zur Einrichtung %inst(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_FACHINST_UPDATE', 'MVV: Fach-Einrichtung Zuweisung ändern', '%user ändert die Zuweisung des Faches %fach(%affected) zur Einrichtung %inst(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_LVMODULTEIL_NEW', 'MVV: LV-Gruppe zu Modulteil Zuweisung erstellen', '%user weist der LV-Gruppe %lv(%affected) den Modulteil %modulteil(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_LVMODULTEIL_DEL', 'MVV: LV-Gruppe zu Modulteil Zuweisung löschen', '%user löscht die Zuweisung der LV-Gruppe %lv(%affected) zum Modulteil %modulteil(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_LVMODULTEIL_UPDATE', 'MVV: LV-Gruppe zu Modulteil Zuweisung ändern', '%user ändert die Zuweisung der LV-Gruppe %lv(%affected) zum Modulteil %modulteil(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_LVSEMINAR_NEW', 'MVV: LV-Gruppe zu Veranstaltung Zuweisung erstellen', '%user weist der LV-Gruppe %lvgruppe(%affected) der Veranstaltung %sem(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_LVSEMINAR_DEL', 'MVV: LV-Gruppe zu Veranstaltung Zuweisung löschen', '%user löscht die Zuweisung der LV-Gruppe %lvgruppe(%affected) zur Veranstaltung %sem(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_LVSEMINAR_UPDATE', 'MVV: LV-Gruppe zu Veranstaltung Zuweisung ändern', '%user ändert die Zuweisung der LV-Gruppe %lvgruppe(%affected) zur Veranstaltung %sem(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STGTEILABS_MODUL_NEW', 'MVV: Stgteilabschnitt-Modul Zuweisung erstellen', '%user weist dem Studiengangteilabschnitt %stgteilabs(%affected) dem Modul %Modul(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILABS_MODUL_DEL', 'MVV: Stgteilabschnitt-Modul Zuweisung löschen', '%user löscht die Zuweisung des Studiengangteilabschnitts %stgteilabs(%affected) zum Modul %modul(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STGTEILABS_MODUL_UPDATE', 'MVV: Stgteilabschnitt-Modul Zuweisung ändern', '%user ändert die Zuweisung des Studiengangteilabschnitts %stgteilabs(%affected) zum Modul %modul(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_MODULTEIL_LANG_NEW', 'MVV: Sprache zu Modulteil Zuweisung erstellen', '%user weist dem Modulteil %modulteil(%affected) die Unterrichtssprache %language(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_LANG_DEL', 'MVV: Sprache zu Modulteil Zuweisung löschen', '%user löscht die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modulteil %modulteil(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_LANG_UPDATE', 'MVV: Sprache zu Modulteil Zuweisung ändern', '%user ändert die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modulteil %modulteil(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_MODUL_LANG_NEW', 'MVV: Sprache zu Modul Zuweisung erstellen', '%user weist dem Modul %modul(%affected) die Unterrichtssprache %language(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_LANG_DEL', 'MVV: Sprache zu Modul Zuweisung löschen', '%user löscht die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_LANG_UPDATE', 'MVV: Sprache zu Modul Zuweisung ändern', '%user ändert die Zuweisung der Unterrichtssprache %language(%coaffected) zum Modul %modul(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_FACHBERATER_NEW', 'MVV: Person zu Fach Zuweisung erstellen', '%user weist dem Studiengangteil %stgteil(%affected) %user(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_FACHBERATER_DEL', 'MVV: Person zu Fach Zuweisung löschen', '%user löscht die Zuweisung von %user(%coaffected) zum Studiengangteil %stgteil(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_FACHBERATER_UPDATE', 'MVV: Person zu Fach Zuweisung ändern', '%user ändert die Zuweisung von %user(%coaffected) zum Studiengangteil %stgteil(%affected).', 'MVVPlugin'); - - //3er Index - StudipLog::registerActionPlugin('MVV_MODUL_USER_NEW', 'MVV: Person zu Modul Zuweisung erstellen', '%user weist dem Modul %modul(%affected) %user(%coaffected) als %gruppe zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_USER_DEL', 'MVV: Person zu Modul Zuweisung löschen', '%user löscht die Zuweisung von %user(%coaffected) als %gruppe zum Modul %modul(%affected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODUL_USER_UPDATE', 'MVV: Person zu Modul Zuweisung ändern', '%user ändert die Zuweisung von %user(%coaffected) als %gruppe zum Modul %modul(%affected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_MODULTEIL_STGTEILABS_NEW', 'MVV: Studiengangteilabschnitt zu Modulteil Zuweisung erstellen', '%user weist den Modulteil %modulteil(%affected) dem Studiengangteilabschnitt %stgteilabs(%coaffected) im %fachsem. Fachsemester zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_STGTEILABS_DEL', 'MVV: Studiengangteilabschnitt zu Modulteil Zuweisung löschen', '%user löscht die Zuweisung des Modulteils %modulteil(%affected) im %fachsem. des Studiengangteilabschnitt %stgteilabs(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_MODULTEIL_STGTEILABS_UPDATE', 'MVV: Studiengangteilabschnitt zu Modulteil Zuweisung ändern', '%user ändert die Zuweisung des Modulteils %modulteil(%affected) im %fachsem. des Studiengangteilabschnitt %stgteilabs(%coaffected).', 'MVVPlugin'); - - StudipLog::registerActionPlugin('MVV_STG_STGTEIL_NEW', 'MVV: Studiengang zu Studiengangteil Zuweisung erstellen', '%user weist den Studiengang %stg(%affected) dem Studiengangteil %stgteil(%coaffected) zu.', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STG_STGTEIL_DEL', 'MVV: Studiengang zu Studiengangteil Zuweisung löschen', '%user löscht die Zuweisung des Studienganges %stg(%affected) zum Studiengangteil %stgteil(%coaffected).', 'MVVPlugin'); - StudipLog::registerActionPlugin('MVV_STG_STGTEIL_UPDATE', 'MVV: Studiengang zu Studiengangteil Zuweisung ändern', '%user ändert die Zuweisung des Studienganges %stg(%affected) zum Studiengangteil %stgteil(%coaffected).', 'MVVPlugin'); - - // migrate table studiengaenge to fach - $db->exec("RENAME TABLE `studiengaenge` TO `fach`"); - $db->exec("ALTER TABLE `fach` CHANGE `studiengang_id` `fach_id` " - . "VARCHAR(32) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE `fach` CHANGE `name` `name` VARCHAR(255) NOT NULL"); - $db->exec("ALTER TABLE `fach` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`, " - . "ADD `name_kurz` VARCHAR(50) NULL DEFAULT NULL AFTER `name_en`, " - . "ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`"); - $db->exec("ALTER TABLE `fach` ADD `beschreibung_en` TINYTEXT NULL DEFAULT NULL AFTER `beschreibung`, " - . "ADD `schlagworte` TEXT NULL DEFAULT NULL AFTER `beschreibung_en`, " - . "ADD `author_id` VARCHAR(32) NOT NULL AFTER `schlagworte`, " - . "ADD `editor_id` VARCHAR(32) NOT NULL AFTER `author_id`"); - - // extend table abschluss - $db->exec("ALTER TABLE `abschluss` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`, " - . "ADD `name_kurz` VARCHAR(50) NULL DEFAULT NULL AFTER `name_en`, " - . "ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`"); - $db->exec("ALTER TABLE `abschluss` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`, " - . "ADD `author_id` VARCHAR(32) NOT NULL AFTER `beschreibung_en`, " - . "ADD `editor_id` VARCHAR(32) NOT NULL AFTER `author_id`"); - - // erweitert Tabelle user_studiengang um die optionale Angabe einer - // Version des Studiengangs (genauer: Studiengangteils), Fremdschlüssel - // aus Tabelle mvv_stgteilversion - $db->exec("ALTER TABLE `user_studiengang` CHANGE `studiengang_id` `fach_id` " - . "VARCHAR(32) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE `user_studiengang` ADD `version_id` VARCHAR(32) " - . "NULL DEFAULT NULL AFTER `abschluss_id`"); - - // Step 3: LVGroup Assign - if (!CourseWizardStepRegistry::findByClassName('LVGroupsWizardStep')) { - CourseWizardStepRegistry::registerStep('LVGruppen', 'LVGroupsWizardStep', 3, true); - } - } - - public function down() { - - $db = DBManager::get(); - - // remove plug-in - $db->exec("DELETE FROM plugins WHERE pluginpath = 'core/Modulverwaltung'"); - - // delete datafiled entries - $db->exec("DELETE FROM datafield_entrie INNER JOIN datafields " - . "USING(datafields_id) WHERE object_type " - . "IN('moduldeskriptor','modulteildeskriptor"); - - // delete datafields for descriptors - $db->exec("DELETE FROM datafields WHERE object_type " - . "IN('moduldeskriptor','modulteildekriptor"); - - // undo changes for datafields - $db->exec(" - ALTER TABLE `datafields` - CHANGE `object_type` `object_type` - ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata') NULL DEFAULT NULL - "); - - $db->exec(" - ALTER TABLE `datafields` CHANGE `object_class` `object_class` VARCHAR(255) NULL DEFAULT NULL - "); - - // undo changes for sem classes - $db->execute(" - ALTER TABLE `sem_classes` DROP `module` - "); - - $db->exec("DROP TABLE IF EXISTS `mvv_abschl_kategorie`"); - $db->exec("DROP TABLE IF EXISTS `mvv_abschl_zuord`"); - $db->exec("DROP TABLE IF EXISTS `mvv_dokument`"); - $db->exec("DROP TABLE IF EXISTS `mvv_dokument_zuord`"); - $db->exec("DROP TABLE IF EXISTS `mvv_fachberater`"); - $db->exec("DROP TABLE IF EXISTS `mvv_fach_inst`"); - $db->exec("DROP TABLE IF EXISTS `mvv_lvgruppe`"); - $db->exec("DROP TABLE IF EXISTS `mvv_lvgruppe_modulteil`"); - $db->exec("DROP TABLE IF EXISTS `mvv_lvgruppe_seminar`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modul`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modulteil`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modulteil_deskriptor`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modulteil_language`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modulteil_stgteilabschnitt`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modul_deskriptor`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modul_inst`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modul_language`"); - $db->exec("DROP TABLE IF EXISTS `mvv_modul_user`"); - $db->exec("DROP TABLE IF EXISTS `mvv_stgteil`"); - $db->exec("DROP TABLE IF EXISTS `mvv_stgteilabschnitt`"); - $db->exec("DROP TABLE IF EXISTS `mvv_stgteilabschnitt_modul`"); - $db->exec("DROP TABLE IF EXISTS `mvv_stgteilversion`"); - $db->exec("DROP TABLE IF EXISTS `mvv_stgteil_bez`"); - $db->exec("DROP TABLE IF EXISTS `mvv_stg_stgteil`"); - $db->exec("DROP TABLE IF EXISTS `mvv_studiengang`"); - - $db->exec("ALTER TABLE `fach` DROP `name_en`, DROP `name_kurz`, " - . "DROP `name_kurz_en`, DROP `beschreibung_en`, " - . "DROP `schlagworte`, DROP `author_id`, DROP `editor_id`"); - - $db->exec("RENAME TABLE `fach` TO `studiengaenge`"); - - $db->exec("ALTER TABLE `abschluss` DROP `name_en`, DROP `name_kurz`, " - . "DROP `name_kurz_en`, DROP `beschreibung_en`, " - . "DROP `author_id`, DROP `editor_id`"); - - $db->exec("ALTER TABLE `user_studiengang` CHANGE `fach_id``studiengang_id` " - . "VARCHAR(32) NOT NULL DEFAULT ''"); - - $db->exec("ALTER TABLE `user_studiengang` DROP `version_id`"); - - // remove course wizard step - CourseWizardStepRegistry::deleteBySQL('classname = ?', ['LVGroupsWizardStep']); - - /** - * Logging - */ - StudipLog::unregisterAction('MVV_MODUL_NEW'); - StudipLog::unregisterAction('MVV_MODUL_UPDATE'); - StudipLog::unregisterAction('MVV_MODUL_DEL'); - - StudipLog::unregisterAction('MVV_STUDIENGANG_NEW'); - StudipLog::unregisterAction('MVV_STUDIENGANG_UPDATE'); - StudipLog::unregisterAction('MVV_STUDIENGANG_DEL'); - - StudipLog::unregisterAction('MVV_STGTEIL_NEW'); - StudipLog::unregisterAction('MVV_STGTEIL_UPDATE'); - StudipLog::unregisterAction('MVV_STGTEIL_DEL'); - - StudipLog::unregisterAction('MVV_STGTEILVERSION_NEW'); - StudipLog::unregisterAction('MVV_STGTEILVERSION_UPDATE'); - StudipLog::unregisterAction('MVV_STGTEILVERSION_DEL'); - - StudipLog::unregisterAction('MVV_STGTEILBEZ_NEW'); - StudipLog::unregisterAction('MVV_STGTEILBEZ_UPDATE'); - StudipLog::unregisterAction('MVV_STGTEILBEZ_DEL'); - - StudipLog::unregisterAction('MVV_LVGRUPPE_NEW'); - StudipLog::unregisterAction('MVV_LVGRUPPE_UPDATE'); - StudipLog::unregisterAction('MVV_LVGRUPPE_DEL'); - - StudipLog::unregisterAction('MVV_FACH_NEW'); - StudipLog::unregisterAction('MVV_FACH_UPDATE'); - StudipLog::unregisterAction('MVV_FACH_DEL'); - - StudipLog::unregisterAction('MVV_ABSCHLUSS_NEW'); - StudipLog::unregisterAction('MVV_ABSCHLUSS_UPDATE'); - StudipLog::unregisterAction('MVV_ABSCHLUSS_DEL'); - - StudipLog::unregisterAction('MVV_KATEGORIE_NEW'); - StudipLog::unregisterAction('MVV_KATEGORIE_UPDATE'); - StudipLog::unregisterAction('MVV_KATEGORIE_DEL'); - - StudipLog::unregisterAction('MVV_DOKUMENT_NEW'); - StudipLog::unregisterAction('MVV_DOKUMENT_UPDATE'); - StudipLog::unregisterAction('MVV_DOKUMENT_DEL'); - - StudipLog::unregisterAction('MVV_STGTEILABS_NEW'); - StudipLog::unregisterAction('MVV_STGTEILABS_UPDATE'); - StudipLog::unregisterAction('MVV_STGTEILABS_DEL'); - - StudipLog::unregisterAction('MVV_MODULTEIL_NEW'); - StudipLog::unregisterAction('MVV_MODULTEIL_UPDATE'); - StudipLog::unregisterAction('MVV_MODULTEIL_DEL'); - - StudipLog::unregisterAction('MVV_MODULTEIL_DESK_NEW'); - StudipLog::unregisterAction('MVV_MODULTEIL_DESK_UPDATE'); - StudipLog::unregisterAction('MVV_MODULTEIL_DESK_DEL'); - - StudipLog::unregisterAction('MVV_MODUL_DESK_NEW'); - StudipLog::unregisterAction('MVV_MODUL_DESK_UPDATE'); - StudipLog::unregisterAction('MVV_MODUL_DESK_DEL'); - - //Zuweisungstabellen - StudipLog::unregisterAction('MVV_MODULINST_NEW'); - StudipLog::unregisterAction('MVV_MODULINST_UPDATE'); - StudipLog::unregisterAction('MVV_MODULINST_DEL'); - - StudipLog::unregisterAction('MVV_ABS_ZUORD_NEW'); - StudipLog::unregisterAction('MVV_ABS_ZUORD_UPDATE'); - StudipLog::unregisterAction('MVV_ABS_ZUORD_DEL'); - - StudipLog::unregisterAction('MVV_DOK_ZUORD_NEW'); - StudipLog::unregisterAction('MVV_DOK_ZUORD_UPDATE'); - StudipLog::unregisterAction('MVV_DOK_ZUORD_DEL'); - - StudipLog::unregisterAction('MVV_FACHINST_NEW'); - StudipLog::unregisterAction('MVV_FACHINST_UPDATE'); - StudipLog::unregisterAction('MVV_FACHINST_DEL'); - - StudipLog::unregisterAction('MVV_LVMODULTEIL_NEW'); - StudipLog::unregisterAction('MVV_LVMODULTEIL_UPDATE'); - StudipLog::unregisterAction('MVV_LVMODULTEIL_DEL'); - - StudipLog::unregisterAction('MVV_LVSEMINAR_NEW'); - StudipLog::unregisterAction('MVV_LVSEMINAR_UPDATE'); - StudipLog::unregisterAction('MVV_LVSEMINAR_DEL'); - - StudipLog::unregisterAction('MVV_STGTEILABS_MODUL_NEW'); - StudipLog::unregisterAction('MVV_STGTEILABS_MODUL_UPDATE'); - StudipLog::unregisterAction('MVV_STGTEILABS_MODUL_DEL'); - - StudipLog::unregisterAction('MVV_MODULTEIL_LANG_NEW'); - StudipLog::unregisterAction('MVV_MODULTEIL_LANG_UPDATE'); - StudipLog::unregisterAction('MVV_MODULTEIL_LANG_DEL'); - - StudipLog::unregisterAction('MVV_MODUL_LANG_NEW'); - StudipLog::unregisterAction('MVV_MODUL_LANG_UPDATE'); - StudipLog::unregisterAction('MVV_MODUL_LANG_DEL'); - - StudipLog::unregisterAction('MVV_FACHBERATER_NEW'); - StudipLog::unregisterAction('MVV_FACHBERATER_UPDATE'); - StudipLog::unregisterAction('MVV_FACHBERATER_DEL'); - - //3er Index - StudipLog::unregisterAction('MVV_MODUL_USER_NEW'); - StudipLog::unregisterAction('MVV_MODUL_USER_UPDATE'); - StudipLog::unregisterAction('MVV_MODUL_USER_DEL'); - - StudipLog::unregisterAction('MVV_MODULTEIL_STGTEILABS_NEW'); - StudipLog::unregisterAction('MVV_MODULTEIL_STGTEILABS_UPDATE'); - StudipLog::unregisterAction('MVV_MODULTEIL_STGTEILABS_DEL'); - - StudipLog::unregisterAction('MVV_STG_STGTEIL_NEW'); - StudipLog::unregisterAction('MVV_STG_STGTEIL_UPDATE'); - StudipLog::unregisterAction('MVV_STG_STGTEIL_DEL'); - } - -} diff --git a/db/migrations/19_step_00141_zip_download_restrictions.php b/db/migrations/19_step_00141_zip_download_restrictions.php deleted file mode 100644 index 622fa1c..0000000 --- a/db/migrations/19_step_00141_zip_download_restrictions.php +++ /dev/null @@ -1,24 +0,0 @@ -exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES (MD5( 'ZIP_DOWNLOAD_MAX_FILES' ) , '', 'ZIP_DOWNLOAD_MAX_FILES', '100', '1', 'integer', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Die maximale Anzahl an Dateien, die gezippt heruntergeladen werden kann', '', '' - )"); - $db->exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) - VALUES (MD5( 'ZIP_DOWNLOAD_MAX_SIZE' ) , '', 'ZIP_DOWNLOAD_MAX_SIZE', '100', '1', 'integer', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Die maximale Größe aller Dateien, die zusammen in einem Zip heruntergeladen werden kann (in Megabytes).', '', '' - )"); - } - - function down() { - $db = DBManager::get(); - $db->exec("DELETE FROM config WHERE config_id IN (MD5('ZIP_DOWNLOAD_MAX_FILES'),MD5('ZIP_DOWNLOAD_MAX_SIZE'))"); - } -} -?> diff --git a/db/migrations/200_step_00299_statusgroups.php b/db/migrations/200_step_00299_statusgroups.php deleted file mode 100644 index 7544ef9..0000000 --- a/db/migrations/200_step_00299_statusgroups.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 3.5 - * - * @see https://develop.studip.de/trac/ticket/6590 - */ -class StEP00299Statusgroups extends Migration -{ - - /** - * Describe what the migration does. - * @return string - */ - public function description() - { - return 'Adds columns for selfassign start and end time to table statusgruppen'; - } - - /** - * Add a new database column to table statusgruppen: optional start time for self assignment. - */ - public function up() - { - DBManager::get()->execute("ALTER TABLE `statusgruppen` - ADD `selfassign_start` INT NOT NULL DEFAULT 0 AFTER `selfassign`, - ADD `selfassign_end` INT NOT NULL DEFAULT 0 AFTER `selfassign_start`"); - } - - /** - * Drops database column for start time of self assignment. - */ - public function down() - { - DBManager::get()->execute("ALTER TABLE `statusgruppen` DROP `selfassign_start`"); - } - -} diff --git a/db/migrations/20190702_tfa.php b/db/migrations/20190702_tfa.php deleted file mode 100644 index fce2713..0000000 --- a/db/migrations/20190702_tfa.php +++ /dev/null @@ -1,81 +0,0 @@ -exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `users_tfa_tokens` ( - `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `token` CHAR(6) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`user_id`, `token`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - - // Add config entries (global and user) - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'TFA_MAX_TRIES', '3', 'integer', 'global', - 'Zwei-Faktor-Authentifizierung', 'Maximale Anzahl fehlerhafter Versuche innerhalb eines Zeitraums', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'TFA_MAX_TRIES_TIMESPAN', '300', 'integer', 'global', - 'Zwei-Faktor-Authentifizierung', 'Zeitraum in Sekunden, nach dem fehlerhafte Versuche vergessen werden', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'TFA_PERMS', 'root', 'string', 'global', - 'Zwei-Faktor-Authentifizierung', 'Systemrollen für die die Zwei-Faktor-Authentifizierung aktiviert ist (kommaseparierte Liste, mögliche Werte: autor, tutor, dozent, admin, root)', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "DROP TABLE IF EXISTS `users_tfa`, `users_tfa_tokens`"; - DBManager::get()->exec($query); - - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` IN ( - 'TFA_MAX_TRIES', - 'TFA_MAX_TRIES_TIMESPAN', - 'TFA_PERMS' - )"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20190705_gradebook.php b/db/migrations/20190705_gradebook.php deleted file mode 100644 index 59c33eb..0000000 --- a/db/migrations/20190705_gradebook.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 - */ -class Gradebook extends Migration -{ - public function description() - { - return 'initial database setup for Gradebook API'; - } - - public function up() - { - $db = DBManager::get(); - - $sql = - "CREATE TABLE `grading_definitions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` char(32) COLLATE latin1_bin NOT NULL, - `item` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `tool` varchar(64) COLLATE latin1_bin NOT NULL, - `category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `position` int(11) NOT NULL DEFAULT '0', - `weight` float UNSIGNED NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `course_id` (`course_id`), - KEY `tool` (`tool`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - $db->exec($sql); - - $sql = - 'CREATE TABLE `grading_instances` ( - `definition_id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` char(32) COLLATE latin1_bin NOT NULL, - `rawgrade` decimal(6,5) UNSIGNED NOT NULL, - `feedback` varchar(255) COLLATE utf8mb4_unicode_ci, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`definition_id`,`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC'; - $db->exec($sql); - - // install as core plugin - $sql = "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) - VALUES ('GradebookModule', 'Gradebook', 'StandardPlugin,SystemPlugin', 'yes', 1)"; - $db->exec($sql); - - $sql = "INSERT INTO roles_plugins (roleid, pluginid) SELECT roleid, ? FROM roles WHERE `system` = 'y'"; - $db->execute($sql, [$db->lastInsertId()]); - } - - public function down() - { - $db = DBManager::get(); - - $db->exec("DELETE plugins, roles_plugins FROM plugins LEFT JOIN roles_plugins USING(pluginid) - WHERE pluginclassname = 'GradebookModule'"); - - $db->exec('DROP TABLE grading_definitions, grading_instances'); - - SimpleORMap::expireTableScheme(); - } -} diff --git a/db/migrations/201908014_blubbermessenger.php b/db/migrations/201908014_blubbermessenger.php deleted file mode 100644 index 24acb5c..0000000 --- a/db/migrations/201908014_blubbermessenger.php +++ /dev/null @@ -1,171 +0,0 @@ -exec($query); - - $query = "INSERT INTO `blubber_threads` ( - `thread_id`, `context_type`, `context_id`, `user_id`, `external_contact`, `content`, `display_class`, `visible_in_stream`, `chdate`, `mkdate` - ) - SELECT `topic_id`, `context_type`, `Seminar_id`, `user_id`, `external_contact`, `description`, NULL, '1', `chdate`, `mkdate` - FROM blubber - WHERE parent_id = '0'"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE `blubber_comments` ( - `comment_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `thread_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `user_id` CHAR(32) COLLATE latin1_bin NOT NULL DEFAULT '', - `external_contact` TINYINT(1) NOT NULL DEFAULT 0, - `content` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `network` VARCHAR(64) COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, - `chdate` INT(11) DEFAULT NULL, - `mkdate` INT(11) DEFAULT NULL, - PRIMARY KEY (`comment_id`), - KEY `thread_id` (`thread_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - - $query = "INSERT INTO `blubber_comments` ( - `comment_id`, `thread_id`, `user_id`, `external_contact`, `content`, `chdate`, `mkdate` - ) - SELECT `topic_id`, `root_id`, `user_id`, `external_contact`, `description`, `chdate`, `mkdate` - FROM blubber - WHERE parent_id != '0'"; - DBManager::get()->exec($query); - - DBManager::get()->exec("DROP TABLE `blubber`"); - - $query = "ALTER TABLE blubber_mentions - CHANGE `topic_id` `thread_id` CHAR(32) COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - DBManager::get()->exec("DROP TABLE blubber_reshares"); - DBManager::get()->exec("DROP TABLE blubber_streams"); - - // Create config entries - $query = "INSERT INTO `config` - SET `field` = :field, - `value` = :value, - `type` = :type, - `range` = :range, - `section` = :section, - `mkdate` = UNIX_TIMESTAMP(), - `chdate` = UNIX_TIMESTAMP(), - `description` = :description"; - $config_statement = DBManager::get()->prepare($query); - - $config_statement->execute([ - ':field' => 'BLUBBER_GLOBAL_MESSENGER_ACTIVATE', - ':value' => '1', - ':type' => 'boolean', - ':range' => 'global', - ':section' => 'global', - ':description' => 'Ist Blubber unter Community global aktiv? Blubber in Veranstaltungen wird über das Plugin Blubber aktiviert oder deaktiviert.', - ]); - $config_statement->execute([ - ':field' => 'BLUBBER_DEFAULT_THREAD', - ':value' => '1', - ':type' => 'string', - ':range' => 'user', - ':section' => '', - ':description' => 'Dieses ist bei dem globalen Blubber-Messenger der vorausgewählte Blubber.', - ]); - - // activate routes: - require_once $GLOBALS['STUDIP_BASE_PATH'] . '/app/routes/Blubber.php'; - RESTAPI\ConsumerPermissions::get()->activateRouteMap(new RESTAPI\Routes\Blubber()); - - // Blubber to be the primary messenger in courses - $query = "SELECT pluginid - FROM plugins - WHERE pluginclassname = 'CoreForum'"; - $forum_id = DBManager::get()->fetchColumn($query); - - $query = "SELECT id, modules - FROM sem_classes - WHERE forum = 'CoreForum'"; - $select_sem_class = DBManager::get()->query($query); - $sem_classes = $select_sem_class->fetchAll(PDO::FETCH_ASSOC); - - $query = "INSERT IGNORE INTO plugins_activated (pluginid, range_type, range_id, state) - SELECT :forum_id, 'sem', seminare.Seminar_id, '1' - FROM seminare - JOIN sem_types ON seminare.status = sem_types.id - JOIN sem_classes ON sem_types.class = sem_classes.id - JOIN forum_entries ON forum_entries.seminar_id = seminare.Seminar_id - WHERE sem_classes.id = :sem_class - GROUP BY seminare.Seminar_id - HAVING COUNT(*) > 1"; - $activate_forum_for_courses = DBManager::get()->prepare($query); - - $query = "UPDATE sem_classes - SET modules = :modules, - forum = 'Blubber' - WHERE id = :id"; - $update = DBManager::get()->prepare($query); - - foreach ($sem_classes as $sem_class) { - $modules = json_decode($sem_class['modules'], true); - $forum_was_activated = $modules['CoreForum']['activated']; - - $modules['CoreForum']['activated'] = 0; - $modules['Blubber']['activated'] = 1; - - $update->execute([ - 'id' => $sem_class['id'], - 'modules' => json_encode($modules), - ]); - if ($forum_was_activated) { - // activate old forum in old courses that have more than one posting: - $activate_forum_for_courses->execute([ - 'forum_id' => $forum_id, - 'sem_class' => $sem_class['id'], - ]); - } - } - - // delete old blubber-stream avatars - $blubberstreams_folder = "{$GLOBALS['DYNAMIC_CONTENT_PATH']}/blubberstream"; - foreach (glob("{$blubberstreams_folder}/*") as $file) { - @unlink($blubberstreams_folder . "/" . $file); - } - @rmdir($blubberstreams_folder); - - DBManager::get()->exec(" - DELETE FROM activities - WHERE object_type = 'blubber' - "); - } - - public function down() - { - DBManager::get()->exec("DROP TABLE `blubber_comments`, `blubber_threads`"); - } -} diff --git a/db/migrations/201908015_blubbermessenger_keys.php b/db/migrations/201908015_blubbermessenger_keys.php deleted file mode 100644 index c79e979..0000000 --- a/db/migrations/201908015_blubbermessenger_keys.php +++ /dev/null @@ -1,22 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `blubber_mentions` - DROP COLUMN `mention_id`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/201908016_blubbermessenger_search.php b/db/migrations/201908016_blubbermessenger_search.php deleted file mode 100644 index 81c78ff..0000000 --- a/db/migrations/201908016_blubbermessenger_search.php +++ /dev/null @@ -1,101 +0,0 @@ -prepare(" - SELECT * - FROM config - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute(); - $config = $statement->fetch(PDO::FETCH_ASSOC); - $config['value'] = json_decode($config['value'], true); - $config['value']['GlobalSearchBlubber'] = [ - 'order' => 13, - 'active' => true, - 'fulltext' => true - ]; - - $statement = DBManager::get()->prepare(" - UPDATE config - SET `value` = :json - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute([ - 'json' => json_encode($config['value']) - ]); - - $statement = DBManager::get()->prepare(" - SELECT * - FROM config_values - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute(); - $config = $statement->fetch(PDO::FETCH_ASSOC); - if ($config) { - $config['value'] = json_decode($config['value'], true); - $config['value']['GlobalSearchBlubber'] = [ - 'order' => 13, - 'active' => true, - 'fulltext' => true - ]; - - $statement = DBManager::get()->prepare(" - UPDATE config_values - SET `value` = :json - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute([ - 'json' => json_encode($config['value']) - ]); - } - } - - public function down() - { - $statement = DBManager::get()->prepare(" - SELECT * - FROM config_values - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute(); - $config = $statement->fetch(PDO::FETCH_ASSOC); - if ($config) { - $config['value'] = json_decode($config['value'], true); - unset($config['value']['GlobalSearchBlubber']); - $statement = DBManager::get()->prepare(" - UPDATE config_values - SET `value` = :json - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute([ - 'json' => json_encode($config['value']) - ]); - } - - $statement = DBManager::get()->prepare(" - SELECT * - FROM config - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute(); - $config = $statement->fetch(PDO::FETCH_ASSOC); - $config['value'] = json_decode($config['value'], true); - unset($config['value']['GlobalSearchBlubber']); - $statement = DBManager::get()->prepare(" - UPDATE config - SET `value` = :json - WHERE field = 'GLOBALSEARCH_MODULES' - "); - $statement->execute([ - 'json' => json_encode($config['value']) - ]); - - } -} diff --git a/db/migrations/201908017_blubbermessenger_flat.php b/db/migrations/201908017_blubbermessenger_flat.php deleted file mode 100644 index 3b4dfeb..0000000 --- a/db/migrations/201908017_blubbermessenger_flat.php +++ /dev/null @@ -1,212 +0,0 @@ -exec(" - DELETE FROM blubber_comments - WHERE mkdate < 1364601600 - "); //30th March 2013 - - DBManager::get()->exec(" - INSERT IGNORE INTO blubber_threads - SET thread_id = 'global', - context_type = 'public', - context_id = '', - user_id = '', - external_contact = '0', - `content` = NULL, - display_class = 'BlubberGlobalThread', - visible_in_stream = '1', - commentable = '1', - metadata = NULL, - chdate = UNIX_TIMESTAMP(), - mkdate = UNIX_TIMESTAMP() - "); - DBManager::get()->exec(" - UPDATE blubber_comments, blubber_threads - SET blubber_comments.thread_id = 'global' - WHERE blubber_comments.thread_id = blubber_threads.thread_id - AND blubber_threads.context_type = 'public' - "); - DBManager::get()->exec(" - INSERT IGNORE INTO blubber_comments (comment_id, thread_id, user_id, external_contact, `content`, network, chdate, mkdate) - SELECT thread_id, 'global', user_id, external_contact, `content`, null, chdate, mkdate - FROM blubber_threads - WHERE context_type = 'public' - AND thread_id != 'global' - "); - DBManager::get()->exec(" - DELETE FROM blubber_threads - WHERE context_type = 'public' - AND thread_id != 'global' - "); - - $select_threads = DBManager::get()->prepare(" - SELECT * - FROM blubber_threads - WHERE context_type = 'course' - AND `content` IS NOT NULL AND `content` != '' - AND display_class IS NULL - "); - $select_threads->execute(); - $insert_comments = DBManager::get()->prepare(" - UPDATE blubber_comments - SET thread_id = :thread_id - WHERE thread_id = :old_thread - "); - $insert_comment = DBManager::get()->prepare(" - INSERT INTO blubber_comments - SET thread_id = :thread_id, - comment_id = :comment_id, - user_id = :user_id, - external_contact = :external_contact, - `content` = :content, - network = NULL, - chdate = :chdate, - mkdate = :mkdate - "); - $delete_thread = DBManager::get()->prepare(" - DELETE FROM blubber_threads - WHERE thread_id = ? - "); - $select_course_main_thread = DBManager::get()->prepare(" - SELECT * - FROM blubber_threads - WHERE (content IS NULL OR content = '') - AND thread_id != :main_thread_id - AND context_id = :course_id - AND context_type = 'course' - AND display_class IS NULL - "); - while ($row = $select_threads->fetch(PDO::FETCH_ASSOC)) { - $course_thread_id = $this->getCourseThreadId($row['context_id']); - - //Alle anderen mit !content löschen - $select_course_main_thread->execute([ - 'main_thread_id' => $course_thread_id, - 'course_id' => $row['context_id'] - ]); - foreach ($select_course_main_thread->fetchAll(PDO::FETCH_ASSOC) as $row2) { - $insert_comments->execute([ - 'thread_id' => $course_thread_id, - 'old_thread' => $row2['thread_id'] - ]); - $delete_thread->execute([ - $row2['thread_id'] - ]); - } - - if ($row['thread_id'] !== $course_thread_id) { - //Alle Kommentare aus diesem Thread in den Main-Thread verschieben: - $insert_comments->execute([ - 'thread_id' => $course_thread_id, - 'old_thread' => $row['thread_id'] - ]); - - if ($row['content']) { - //Und noch einen Startkommentar in den Haupthread packen, wenn der zu löschende Thread noch einen Hauptinhalt hatte: - $insert_comment->execute([ - 'comment_id' => $row['thread_id'], - 'thread_id' => $course_thread_id, - 'user_id' => $row['user_id'], - 'external_contact' => $row['external_contact'], - 'content' => $row['content'], - 'chdate' => $row['chdate'], - 'mkdate' => $row['mkdate'] - ]); - } - - $delete_thread->execute([ - $row['thread_id'] - ]); - } - } - - $select_private_threads = DBManager::get()->prepare(" - SELECT * - FROM blubber_threads - WHERE context_type = 'private' - AND `content` IS NOT NULL AND content != '' - "); - $select_private_threads->execute(); - $clean_thread = DBManager::get()->prepare(" - UPDATE blubber_threads - SET `content` = NULL - WHERE thread_id = ? - "); - while ($row3 = $select_private_threads->fetch(PDO::FETCH_ASSOC)) { - $insert_comment->execute([ - 'comment_id' => md5($row3['thread_id']."_ersterkommentar"), - 'thread_id' => $row3['thread_id'], - 'user_id' => $row3['user_id'], - 'external_contact' => $row3['external_contact'], - 'content' => $row3['content'], - 'chdate' => $row3['chdate'], - 'mkdate' => $row3['mkdate'] - ]); - $clean_thread->execute([$row3['thread_id']]); - } - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `blubber_threads_unfollow` ( - `thread_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` int(11) DEFAULT NULL, - PRIMARY KEY (`thread_id`,`user_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - "); - - // activate routes: - require_once $GLOBALS['STUDIP_BASE_PATH'] . '/app/routes/Blubber.php'; - RESTAPI\ConsumerPermissions::get()->activateRouteMap(new RESTAPI\Routes\Blubber()); - } - - protected function getCourseThreadId($course_id) - { - $select = DBManager::get()->prepare(" - SELECT * - FROM blubber_threads - WHERE context_type = 'course' - AND context_id = ? - AND display_class IS NULL - AND (`content` IS NULL OR `content` = '') - "); - $select->execute([$course_id]); - $thread_id = $select->fetch(PDO::FETCH_COLUMN, 0); - if (!$thread_id) { - $thread_id = md5(uniqid($course_id)); - $insert = DBManager::get()->prepare(" - INSERT IGNORE INTO blubber_threads - SET thread_id = :thread_id, - context_type = 'course', - context_id = :course_id, - user_id = '', - external_contact = '0', - `content` = NULL, - display_class = NULL, - visible_in_stream = '1', - commentable = '1', - chdate = UNIX_TIMESTAMP(), - mkdate = UNIX_TIMESTAMP() - "); - $insert->execute([ - 'thread_id' => $thread_id, - 'course_id' => $course_id - ]); - } - return $thread_id; - } - - public function down() - { - DBManager::exec(" - DROP TABLE `blubber_threads_unfollow`; - "); - } -} diff --git a/db/migrations/20190823_consultations_option_exclude_expired.php b/db/migrations/20190823_consultations_option_exclude_expired.php deleted file mode 100644 index 35bd57e..0000000 --- a/db/migrations/20190823_consultations_option_exclude_expired.php +++ /dev/null @@ -1,31 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'CONSULTATION_EXCLUDE_EXPIRED'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20190903_jsonapi_dangerous_routes_config.php b/db/migrations/20190903_jsonapi_dangerous_routes_config.php deleted file mode 100644 index 87c23f9..0000000 --- a/db/migrations/20190903_jsonapi_dangerous_routes_config.php +++ /dev/null @@ -1,36 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'JSONAPI_DANGEROUS_ROUTES_ALLOWED'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20190904_unrestricted_userdomains.php b/db/migrations/20190904_unrestricted_userdomains.php deleted file mode 100644 index eb95503..0000000 --- a/db/migrations/20190904_unrestricted_userdomains.php +++ /dev/null @@ -1,21 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `userdomains` - DROP COLUMN `restricted_access`, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20190917_fix_missing_consultation_events.php b/db/migrations/20190917_fix_missing_consultation_events.php deleted file mode 100644 index 1432458..0000000 --- a/db/migrations/20190917_fix_missing_consultation_events.php +++ /dev/null @@ -1,95 +0,0 @@ -fetchFirst($query); - - LegacyConsultationSlot::findAndMapMany( - function ($slot) { - // This is wrapped in a try/catch block since we can only assure - // that the LegacyConsultationSlot is used for updating the event itself. - // In the subsequent procedure, the related bookings are stored as well - // which will trigger another update of the event - this time on the - // ConsultationSlot object itself, not on the legacy one. Since this - // has code changes for Stud.IP 5.0 this will fail but we can neglect - // that since the event is already updated. - try { - $slot->updateEvent(); - } catch (Exception $e) { - } - }, - $ids - ); - } -} - -class LegacyConsultationSlot extends ConsultationSlot -{ - /** - * Updates the teacher event that belongs to the slot. This will either be - * set to be unoccupied, occupied by only one user or by a group of user. - */ - public function updateEvent() - { - if (count($this->bookings) === 0 && !$this->block->calendar_events) { - return $this->removeEvent(); - } - - $teacher = User::find($this->block->teacher_id); - if (!$teacher) { - return; - } - - $event = $this->event; - if (!$event) { - $event = $this->createEvent($teacher); - - $this->teacher_event_id = $event->id; - $this->store(); - } - - setTempLanguage($teacher->id); - - if (count($this->bookings) > 0) { - $event->category_intern = 1; - - if (count($this->bookings) === 1) { - $booking = $this->bookings->first(); - - $event->summary = sprintf( - _('Sprechstundentermin mit %s'), - $booking->user->getFullName() - ); - $event->description = $booking->reason; - } else { - $event->summary = sprintf( - _('Sprechstundentermin mit %u Personen'), - count($this->bookings) - ); - $event->description = implode("\n\n----\n\n", $this->bookings->map(function ($booking) { - return "- {$booking->user->getFullName()}:\n{$booking->reason}"; - })); - } - } else { - $event->category_intern = 9; - $event->summary = _('Freier Sprechstundentermin'); - $event->description = _('Dieser Sprechstundentermin ist noch nicht belegt.'); - } - - restoreLanguage(); - - $event->store(); - } -} diff --git a/db/migrations/20190919_step_00332_mvv_overlapping_courses.php b/db/migrations/20190919_step_00332_mvv_overlapping_courses.php deleted file mode 100644 index 67cfa79..0000000 --- a/db/migrations/20190919_step_00332_mvv_overlapping_courses.php +++ /dev/null @@ -1,86 +0,0 @@ -exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `mvv_ovl_conflicts` ( - `conflict_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `selection_id` int(11) NOT NULL, - `base_abschnitt_id` varchar(32) COLLATE latin1_bin NOT NULL, - `base_modulteil_id` varchar(32) COLLATE latin1_bin NOT NULL, - `base_course_id` varchar(32) COLLATE latin1_bin NOT NULL, - `base_metadate_id` varchar(32) COLLATE latin1_bin NOT NULL, - `comp_abschnitt_id` varchar(32) COLLATE latin1_bin NOT NULL, - `comp_modulteil_id` varchar(32) COLLATE latin1_bin NOT NULL, - `comp_course_id` varchar(32) COLLATE latin1_bin NOT NULL, - `comp_metadate_id` varchar(32) COLLATE latin1_bin NOT NULL, - PRIMARY KEY (`conflict_id`), - KEY `selection_id` (`selection_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `mvv_ovl_excludes` ( - `selection_id` varchar(32) COLLATE latin1_bin NOT NULL, - `course_id` varchar(32) COLLATE latin1_bin NOT NULL, - PRIMARY KEY (`selection_id`,`course_id`), - KEY `course_id` (`course_id`) USING BTREE - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - - DBManager::get()->exec($query); - - // Add config (2nd select shows only versions inside a multiple course of study) - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'MVV_OVERLAPPING_SHOW_VERSIONS_INSIDE_MULTIPLE_STUDY_COURSES', - '0', 'boolean', 'global', - 'global', 'Zeigt als zweite Auswahl bei Mehrfachstudiengängen nur Versionen der dazugehörigen Teilstudiengänge an.', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - - DBManager::get()->exec($query); - - SimpleORMap::expireTableScheme(); - } - - public function down() - { - $query = "DROP TABLE `mvv_ovl_selections`"; - DBManager::get()->exec($query); - $query = "DROP TABLE `mvv_ovl_conflicts`"; - DBManager::get()->exec($query); - $query = "DROP TABLE `mvv_ovl_excludes`"; - DBManager::get()->exec($query); - $query = "DELETE FROM `config` - WHERE `field` = 'MVV_OVERLAPPING_SHOW_VERSIONS_INSIDE_MULTIPLE_STUDY_COURSES'"; - DBManager::get()->exec($query); - - SimpleORMap::expireTableScheme(); - } -} diff --git a/db/migrations/20191002_jsonapi_cors_origin_config.php b/db/migrations/20191002_jsonapi_cors_origin_config.php deleted file mode 100644 index 58a8fe7..0000000 --- a/db/migrations/20191002_jsonapi_cors_origin_config.php +++ /dev/null @@ -1,35 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'JSONAPI_CORS_ORIGIN'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20191014_step_00338_instituteplaning.php b/db/migrations/20191014_step_00338_instituteplaning.php deleted file mode 100644 index b19709a..0000000 --- a/db/migrations/20191014_step_00338_instituteplaning.php +++ /dev/null @@ -1,79 +0,0 @@ -exec($query); - - $query = "INSERT INTO `datafields` ( - `datafield_id`, `name`, `object_type`, `edit_perms`, `view_perms`, - `priority`, `type`, `typeparam`, `is_required`, `is_userfilter`, - `description`, `system` - ) VALUES ( - '69f6485f3c937766866a03d9d642ecbb', 'zugeordnete Planungsspalte', 'sem', 'admin', 'root', - 0, 'textline', '', 0, 0, - 'Gibt die zugeordnete Planungsspalte im Veranstaltungsplan an.', 0 - ), ( - '41cda2be71fe9efd6e28b853fc0681f3', 'zugeordnete Planungsfarbe', 'sem', 'admin', 'root', - 0, 'textline', '', 0, 0, - 'Zugewiesene Farbe im Veranstaltungsplaner', 0 - )"; - DBManager::get()->exec($query); - - $query = "INSERT IGNORE INTO config ( - `field`, `value`, `type`, `range`, `section`, - `mkdate`, `chdate`, `description` - ) VALUES ( - :field, :value, 'string', 'global', 'modules', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description - )"; - $statement = DBManager::get()->prepare($query); - - $statement->execute([ - ':field' => 'INSTITUTE_COURSE_PLAN_START_HOUR', - ':value' => '08:00', - 'description' => 'The start hour for the default view of the institute course plan.', - ]); - - $statement->execute([ - ':field' => 'INSTITUTE_COURSE_PLAN_END_HOUR', - ':value' => '20:00', - 'description' => 'The end hour for the default view of the institute course plan.', - ]); - } - - public function down() - { - DBManager::get()->exec('DROP TABLE `institute_plan_columns`'); - - $query = "DELETE FROM `datafields` - WHERE `datafield_id` IN ( - '69f6485f3c937766866a03d9d642ecbb', - '41cda2be71fe9efd6e28b853fc0681f3' - )"; - DBManager::get()->exec($query); - - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` IN ( - 'INSTITUTE_COURSE_PLAN_START_HOUR', - 'INSTITUTE_COURSE_PLAN_END_HOUR' - )"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20191018_config_for_download_counter_display.php b/db/migrations/20191018_config_for_download_counter_display.php deleted file mode 100644 index f4df9e5..0000000 --- a/db/migrations/20191018_config_for_download_counter_display.php +++ /dev/null @@ -1,31 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'DISPLAY_DOWNLOAD_COUNTER'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20191105_add_enable_free_access_for_courses_only.php b/db/migrations/20191105_add_enable_free_access_for_courses_only.php deleted file mode 100644 index 63fe853..0000000 --- a/db/migrations/20191105_add_enable_free_access_for_courses_only.php +++ /dev/null @@ -1,34 +0,0 @@ -exec( - "UPDATE `config` SET `type` = 'string', - `description` = '1: courses and institutes with public access are visible without login. courses_only: only courses with public access are visible without login. 0: disable this feature.' - WHERE `field` = 'ENABLE_FREE_ACCESS'" - ); - } - - - public function down() - { - $db = DBManager::get(); - - $db->exec( - "UPDATE `config` SET `type` = 'boolean', - `description` = 'If true, courses with public access are available' - WHERE `field` = 'ENABLE_FREE_ACCESS'" - ); - } - - - public function description() - { - return 'Adds the "courses_only" option for ENABLE_FREE_ACCESS in the configuration.'; - } -} diff --git a/db/migrations/20191112_additional_mvv_tables.php b/db/migrations/20191112_additional_mvv_tables.php deleted file mode 100644 index 4175a58..0000000 --- a/db/migrations/20191112_additional_mvv_tables.php +++ /dev/null @@ -1,295 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS `mvv_files` ( - `mvvfile_id` varchar(32) COLLATE latin1_bin NOT NULL, - `year` int(10) DEFAULT NULL, - `type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `category` text COLLATE utf8mb4_unicode_ci, - `tags` text COLLATE utf8mb4_unicode_ci, - `extern_visible` tinyint(1) DEFAULT NULL, - `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`mvvfile_id`) - ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - $db->exec("CREATE TABLE IF NOT EXISTS `mvv_files_filerefs` ( - `mvvfile_id` varchar(32) COLLATE latin1_bin NOT NULL, - `file_language` varchar(32) COLLATE latin1_bin NOT NULL, - `name` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL, - `fileref_id` varchar(32) COLLATE latin1_bin NOT NULL, - `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`mvvfile_id`,`file_language`) - ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - $db->exec("CREATE TABLE IF NOT EXISTS `mvv_files_ranges` ( - `mvvfile_id` VARCHAR(32) COLLATE latin1_bin NOT NULL , - `range_id` VARCHAR(32) COLLATE latin1_bin NOT NULL , - `range_type` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL , - `position` INT(10) NULL DEFAULT NULL , - `author_id` VARCHAR(32) COLLATE latin1_bin NULL DEFAULT NULL , - `editor_id` VARCHAR(32) COLLATE latin1_bin NULL DEFAULT NULL , - `mkdate` INT(11) NOT NULL , - `chdate` INT(11) NOT NULL , - PRIMARY KEY (`mvvfile_id`, `range_id`)) - ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - $db->exec("CREATE TABLE IF NOT EXISTS `mvv_contacts` ( - `contact_id` varchar(32) COLLATE latin1_bin NOT NULL, - `contact_status` enum('intern','extern','institution') COLLATE latin1_bin NOT NULL, - `alt_mail` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`contact_id`), - KEY `contact_status` (`contact_status`)) - ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - $db->exec("CREATE TABLE IF NOT EXISTS `mvv_extern_contacts` ( - `extern_contact_id` VARCHAR(32) COLLATE latin1_bin NOT NULL, - `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `vorname` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `homepage` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `mail` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `tel` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `author_id` VARCHAR(32) COLLATE latin1_bin DEFAULT NULL, - `editor_id` VARCHAR(32) COLLATE latin1_bin DEFAULT NULL, - `mkdate` INT(11) NOT NULL, - `chdate` INT(11) NOT NULL, - PRIMARY KEY (`extern_contact_id`)) - ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - $db->exec("CREATE TABLE IF NOT EXISTS `mvv_contacts_ranges` ( - `contact_range_id` varchar(32) COLLATE latin1_bin NOT NULL, - `contact_id` varchar(32) COLLATE latin1_bin NOT NULL, - `range_id` varchar(32) COLLATE latin1_bin NOT NULL, - `range_type` enum('Modul','Studiengang','StudiengangTeil') COLLATE latin1_bin NOT NULL, - `type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, - `category` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, - `position` int(10) DEFAULT NULL, - `author_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `editor_id` varchar(32) COLLATE latin1_bin DEFAULT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`contact_range_id`), - KEY `range_id` (`range_id`), - KEY `range_type` (`range_type`), - KEY `type` (`type`), - KEY `category_range` (`category`,`range_id`), - KEY `contact_id` (`contact_id`,`range_id`,`category`) USING BTREE - ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - - //Merge old mvv_dokument - foreach ($db->query("SELECT * FROM `mvv_dokument`") as $old_doc) { - $fileref_id = md5('FileRef'. $old_doc['dokument_id']); - $folder_id = md5('Folder'. $old_doc['dokument_id']); - $file_id = md5('File'. $old_doc['dokument_id']); - $mvvfile_id = md5('MvvFile'. $old_doc['dokument_id']); - $db->execute("INSERT IGNORE INTO `mvv_files` (`mvvfile_id`, `year`, `type`, `category`, `tags`, `extern_visible`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, NULL, NULL, NULL, NULL , 1, ?, ?, ?, ?)", - [$mvvfile_id, $old_doc['author_id'], $old_doc['editor_id'], $old_doc['mkdate'], $old_doc['chdate']]); - $db->execute("INSERT IGNORE INTO `mvv_files_filerefs` (`mvvfile_id`, `file_language`, `name`, `fileref_id`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", - [$mvvfile_id, 'DE', $old_doc['linktext'], $fileref_id, $old_doc['author_id'], $old_doc['editor_id'], $old_doc['mkdate'], $old_doc['chdate']]); - $db->execute("INSERT IGNORE INTO `file_urls` (`file_id`, `url`, `access_type`) VALUES (?, ?, 'proxy')", [$file_id, $old_doc['url']]); - $db->execute("INSERT IGNORE INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) - VALUES (?, ?, NULL, ?, ?, 'MVVFolder', ?, NULL, ?, ?, ?)", - [$folder_id, $old_doc['author_id'], $mvvfile_id, 'mvv', $old_doc['name'], $old_doc['linktext'], $old_doc['mkdate'], $old_doc['chdate']]); - $db->execute("INSERT IGNORE INTO `file_refs` (`id`, `file_id`, `folder_id`, `description`, `user_id`, `name`, `mkdate`, `chdate`) - VALUES (?, ?, ?, ?, ?, ?, ?, ?)", - [$fileref_id, $file_id, $folder_id, $old_doc['beschreibung'], $old_doc['author_id'], $old_doc['name'], $old_doc['mkdate'], $old_doc['chdate']]); - } - - //Merge old mvv_dokument_zuord - foreach ($db->query("SELECT * FROM `mvv_dokument_zuord`") as $old_docrange) { - $mvvfile_id = md5('MvvFile'. $old_docrange['dokument_id']); - $db->execute("INSERT IGNORE INTO `mvv_files_ranges` (`mvvfile_id`, `range_id`, `range_type`, `position`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", - [$mvvfile_id, $old_docrange['range_id'], $old_docrange['object_type'], $old_docrange['position'], $old_docrange['author_id'], $old_docrange['editor_id'], $old_docrange['mkdate'], $old_docrange['chdate']]); - } - $db->exec('DROP TABLE `mvv_dokument`'); - $db->exec('DROP TABLE `mvv_dokument_zuord`'); - - //Merge old mvv_modul_user - foreach ($db->query("SELECT * FROM `mvv_modul_user`") as $old_modul_user) { - $contact_range_id = md5('MvvContactRange' . $old_modul_user['user_id'] . $old_modul_user['modul_id']); - $db->execute("INSERT IGNORE INTO `mvv_contacts` (`contact_id`, `contact_status`, `alt_mail`, - `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ? ,?)", - [ - $old_modul_user['user_id'], 'intern', '', $old_modul_user['author_id'], - $old_modul_user['editor_id'], $old_modul_user['mkdate'], $old_modul_user['chdate'] - ]); - $db->execute("INSERT IGNORE INTO `mvv_contacts_ranges` (`contact_range_id`, `range_id`, `contact_id`, `range_type`, `type`, `category`, `position`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", - [$contact_range_id, $old_modul_user['modul_id'], $old_modul_user['user_id'], 'Modul', '', - $old_modul_user['gruppe'], $old_modul_user['position'], $old_modul_user['author_id'], - $old_modul_user['editor_id'], $old_modul_user['mkdate'], $old_modul_user['chdate']]); - } - $db->exec('DROP TABLE `mvv_modul_user`'); - - // Merge old Fachberater - foreach ($db->query("SELECT * FROM `mvv_fachberater`") as $old_fachberater) { - $contact_range_id = md5('MvvContactRange' . $old_fachberater['user_id'] . $old_fachberater['stgteil_id']); - $db->execute("INSERT IGNORE INTO `mvv_contacts` (`contact_id`, `contact_status`, `alt_mail`, - `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ? ,?)", - [ - $old_fachberater['user_id'], 'intern', '', $old_fachberater['author_id'], - $old_fachberater['editor_id'], $old_fachberater['mkdate'], $old_fachberater['chdate'] - ]); - $db->execute("INSERT IGNORE INTO `mvv_contacts_ranges` (`contact_range_id`, `range_id`, `contact_id`, `range_type`, `type`, `category`, `position`, `author_id`, `editor_id`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", - [$contact_range_id, $old_fachberater['stgteil_id'], $old_fachberater['user_id'], 'StudiengangTeil', '', - 'fachberater', $old_fachberater['position'], $old_fachberater['author_id'], - $old_fachberater['editor_id'], $old_fachberater['mkdate'], $old_fachberater['chdate']]); - } - $db->exec('DROP TABLE `mvv_fachberater`'); - - // datafields for study courses - $db->exec("ALTER TABLE `datafields` - CHANGE `object_type` `object_type` - ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata', - 'moduldeskriptor','modulteildeskriptor','studycourse') NULL DEFAULT NULL"); - - // switch to enable/disable studycourse info page - $db->exec( - "INSERT INTO `config` (`field`, `value`, `type`, `range`, - `section`, `mkdate`, `chdate`, `description`) - VALUES - ('ENABLE_STUDYCOURSE_INFO_PAGE', '0', 'boolean', 'global', - 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'Shows an icon to open a dialog with studycourse informations in module search if true.')" - ); - - // new fields for study courses - $db->exec("ALTER TABLE `mvv_studiengang` - ADD `enroll` VARCHAR(50) NULL DEFAULT NULL AFTER `schlagworte`"); - $db->exec("ALTER TABLE `mvv_studiengang` - ADD `abschlussgrad` VARCHAR(32) NULL DEFAULT NULL AFTER `schlagworte`"); - $db->exec("ALTER TABLE `mvv_studiengang` - ADD `studienplaetze` INT UNSIGNED NULL DEFAULT NULL AFTER `schlagworte`"); - $db->exec("ALTER TABLE `mvv_studiengang` - ADD `studienzeit` TINYINT UNSIGNED NULL DEFAULT NULL AFTER `schlagworte`"); - - // postgraduate study courses (Aufbaustudiengänge) - $db->exec("CREATE TABLE `mvv_aufbaustudiengang` ( - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `grund_stg_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `aufbau_stg_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `typ` VARCHAR(32) COLLATE latin1_bin NOT NULL, - `kommentar` TEXT NULL, - `author_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `editor_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `mkdate` INT(11) NOT NULL, - `chdate` INT(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `grund_stg_id` (`grund_stg_id`,`aufbau_stg_id`) - ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - // types of study courses - $db->exec("CREATE TABLE `mvv_studycourse_type` ( - `studiengang_id` CHAR(32) COLLATE latin1_bin NOT NULL, - `type` VARCHAR(32) COLLATE latin1_bin NOT NULL, - `author_id` CHAR(32) COLLATE latin1_bin NULL, - `editor_id` CHAR(32) COLLATE latin1_bin NULL, - `mkdate` INT(11) NOT NULL, - `chdate` INT(11) NOT NULL, - PRIMARY KEY (`studiengang_id`, `type`) - ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - // assigned languages to study course - $db->execute("CREATE TABLE `mvv_studycourse_language` ( - `studiengang_id` char(32) COLLATE latin1_bin NOT NULL, - `lang` varchar(32) COLLATE latin1_bin NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `author_id` char(32) COLLATE latin1_bin DEFAULT NULL, - `editor_id` char(32) COLLATE latin1_bin DEFAULT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`studiengang_id`, `lang`) - ) ENGINE = InnoDB ROW_FORMAT = DYNAMIC"); - - // add index to speed up filters - $db->execute("ALTER TABLE `mvv_modul_inst` ADD INDEX (`institut_id`)"); - } - - public function down() - { - DBManager::get()->exec("DROP TABLE `mvv_files`, `mvv_files_filerefs`, `mvv_files_ranges`, `mvv_contacts`, `mvv_extern_contacts`"); - DBManager::get()->exec("DROP TABLE `mvv_aufbaustudiengang`, `mvv_studycourse_type`, `mvv_studycourse_language`"); - DBManager::get()->exec("ALTER TABLE `mvv_studiengang` - DROP `studienzeit`, - DROP `studienplaetze`, - DROP `abschlussgrad`, - DROP `enroll`;"); - DBManager::get()->exec("ALTER TABLE `datafields` - CHANGE `object_type` `object_type` - ENUM('sem','inst','user','userinstrole','usersemdata','roleinstdata', - 'moduldeskriptor','modulteildeskriptor') NULL DEFAULT NULL"); - DBManager::get()->exec( - "DELETE FROM config WHERE field = 'ENABLE_STUDYCOURSE_INFO_PAGE'" - ); - DBManager::get()->exec( - "CREATE TABLE `mvv_fachberater` ( - `stgteil_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `position` int(11) NOT NULL, - `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`stgteil_id`,`user_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC"); - DBManager::get()->exec( - "CREATE TABLE `mvv_modul_user` ( - `modul_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `gruppe` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `position` int(11) NOT NULL DEFAULT '9999', - `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`modul_id`,`user_id`,`gruppe`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;"); - DBManager::get()->exec( - "CREATE TABLE `mvv_dokument` ( - `dokument_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `url` tinytext COLLATE utf8mb4_unicode_ci NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `linktext` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `beschreibung` text COLLATE utf8mb4_unicode_ci, - `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`dokument_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC"); - DBManager::get()->exec( - "CREATE TABLE `mvv_dokument_zuord` ( - `dokument_zuord_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `dokument_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `range_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `object_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, - `position` int(3) NOT NULL DEFAULT '999', - `kommentar` tinytext COLLATE utf8mb4_unicode_ci, - `author_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`dokument_zuord_id`), - UNIQUE KEY `dokument_id` (`dokument_id`,`range_id`,`object_type`) USING BTREE, - KEY `range_id_object_type` (`range_id`,`object_type`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC"); - } -} diff --git a/db/migrations/20191115_tic8458_add_upload_description.php b/db/migrations/20191115_tic8458_add_upload_description.php deleted file mode 100644 index 5b26b24..0000000 --- a/db/migrations/20191115_tic8458_add_upload_description.php +++ /dev/null @@ -1,36 +0,0 @@ -exec( - "INSERT INTO `config` - (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, - `description`) - VALUES - ('ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD', '1', 'boolean', 'global', 'files', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'Whether to allow adding a description directly after file upload (true) or not (false). Defaults to true.')" - ); - } - - - public function down() - { - $db = DBManager::get(); - - $db->exec( - "DELETE FROM `config` - WHERE `field` = 'ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD'" - ); - } - - - public function description() - { - return 'Adds the configuration entry ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD to make it possible to enter a file description directly after uploading the file(s).'; - } -} diff --git a/db/migrations/20191120_room_management_migration.php b/db/migrations/20191120_room_management_migration.php deleted file mode 100644 index 8fd748b..0000000 --- a/db/migrations/20191120_room_management_migration.php +++ /dev/null @@ -1,2390 +0,0 @@ - 'Building', - 'Hörsaal' => 'Room', - 'Übungsraum' => 'Room', - 'Gerät' => 'Resource', - ]; - $GLOBALS['RESOURCE_ADMINISTRATION_PERSON_URL'] = 'https://example.org/person/%s'; - $GLOBALS['RESOURCE_MIGRATION_RESOURCE_TREES_TO_BE_DELETED'] = []; - $GLOBALS['RESOURCE_MIGRATION_MIGRATE_COURSE_PERMISSIONS'] = true; - $GLOBALS['RESOURCE_PROPERTIES_TO_BE_DELETED'] = []; - $GLOBALS['RESOURCE_MIGRATION_SPECIALRESOURCESPLUGIN'] = false; - $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MODIFIED'] = [ - 'Adresse' => [ - 'name' => 'address', - 'old_type' => 'text' - ], - 'Audio-Anlage' => [ - 'name' => 'has_loudspeakers', - 'old_type' => 'bool', - 'requestable' => true, - 'searchable' => true - ], - 'Beamer' => [ - 'name' => 'has_projector', - 'old_type' => 'bool', - 'requestable' => true, - 'searchable' => true - ], - 'behindertengerecht' => [ - 'name' => 'accessible', - 'old_type' => 'bool', - 'requestable' => true, - 'searchable' => true - ], - 'Dozentenrechner' => [ - 'name' => 'has_computer', - 'old_type' => 'bool', - 'requestable' => true, - 'searchable' => true - ], - 'Hersteller' => [ - 'name' => 'manufacturer', - 'old_type' => 'select', - 'requestable' => true, - 'searchable' => true - ], - 'Inventarnummer' => [ - 'name' => 'inventory_number', - 'old_type' => 'num', - 'requestable' => false, - 'searchable' => true - ], - 'Seriennummer' => [ - 'name' => 'serial_number', - 'old_type' => 'num', - 'requestable' => false, - 'searchable' => true - ], - 'Sitzplätze' => [ - 'name' => 'seats', - 'old_type' => 'num', - 'requestable' => true, - 'searchable' => true - ], - 'Tageslichtprojektor' => [ - 'name' => 'has_overhead_projector', - 'old_type' => 'bool', - 'requestable' => true, - 'searchable' => true - ], - 'Verdunklung' => [ - 'name' => 'is_dimmable', - 'old_type' => 'bool', - 'requestable' => true, - 'searchable' => true - ], - 'Raumverantwortung' => [ - 'name' => 'responsible_person', - 'display_name' => 'Raumverantwortung', - 'old_type' => 'text', - 'new_type' => 'user', - 'requestable' => false, - 'searchable' => false, - 'info_label' => true - ] - ]; - $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MERGED'] = []; - } - - - //Assign orphaned resources (resources without category_id) - //to a new category: - public function assignOrphanedResources(PDO $db) - { - $orphaned_resources = $db->query( - "SELECT id FROM resources - WHERE (category_id IS NULL) OR (category_id = '') - OR category_id NOT IN (SELECT id from resource_categories);" - )->fetchAll(PDO::FETCH_COLUMN, 0); - - if ($orphaned_resources) { - //Create a resource category for those resources: - - $md5 = md5('OrphanedResourcesCategory' . rand()); - - $db->execute( - "INSERT INTO resource_categories - (id, name, class_name, description, mkdate, chdate) - VALUES - (?, 'Verwaiste Ressourcen', 'Resource', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", - [$md5] - ); - - //Now we assign all orphaned resources to that category: - $db->execute( - "UPDATE resources SET category_id = ? - WHERE (category_id IS NULL) OR (category_id = '')", - [$md5] - ); - } - } - - - public function deleteUnfinishedResources(PDO $db) - { - $db->exec( - "DELETE from resources - WHERE name = 'Neues Objekt';" - ); - } - - - public function migrateBookingRepeatIntervals(PDO $db) - { - //Buchungen unbekannter Räume entfernen - $db->exec("DELETE resource_bookings FROM resource_bookings LEFT JOIN resources ON resources.id=resource_id WHERE resources.id IS NULL"); - - //mehrtägige korrigieren - $db->exec("UPDATE `resource_bookings` SET end=repeat_end WHERE repeat_end > end AND IFNULL(old_rep_interval,0) = 0"); - - - //Get all resource_bookings rows that have repetition intervals set: - $booking_rows = $db->query( - "SELECT * - FROM resource_bookings - WHERE repeat_end > end AND IFNULL(old_rep_interval,0) > 0" - )->fetchAll(); - - $update_stmt = $db->prepare( - "UPDATE resource_bookings - SET repetition_interval = :repetition_interval - WHERE id = :id;" - ); - - foreach ($booking_rows as $row) - { - $date_interval = ''; - if ($row['old_rep_week_of_month']) { - $date_interval = 'P' . $row['old_rep_interval'] . 'M'; - } elseif ($row['old_rep_interval']) { - if ($row['old_rep_month_of_year']) { - $date_interval = 'P' . $row['old_rep_interval'] . 'Y'; - } elseif ($row['old_rep_day_of_month']) { - $date_interval = 'P' . $row['old_rep_interval'] . 'M'; - } elseif ($row['old_rep_day_of_week']) { - $date_interval = 'P' . ($row['old_rep_interval'] * 7) . 'D'; - } else { - $date_interval = 'P' . $row['old_rep_interval'] . 'D'; - } - } - - $update_stmt->execute( - [ - 'id' => $row['id'], - 'repetition_interval' => $date_interval - ] - ); - } - - //Delete the old columns: - $db->exec( - "ALTER TABLE resource_bookings - DROP COLUMN old_rep_interval, - DROP COLUMN old_rep_month_of_year, - DROP COLUMN old_rep_day_of_month, - DROP COLUMN old_rep_week_of_month, - DROP COLUMN old_rep_day_of_week;" - ); - - //set booking_user_id for all bookings made by 'autor' - $db->exec("UPDATE resource_bookings rb INNER JOIN auth_user_md5 aum ON range_id=user_id INNER JOIN resource_permissions rp ON rp.user_id=aum.user_id AND rb.resource_id = rp.resource_id SET booking_user_id = range_id WHERE booking_user_id='' AND rp.perms='autor'"); - } - - - public function migrateCourseBoundPermissions(PDO $db) - { - if ($GLOBALS['RESOURCE_MIGRATION_MIGRATE_COURSE_PERMISSIONS']) { - //Get all permissions where the range_id - //represents a course-ID or an institute-ID: - - $permissions = $db->query( - "SELECT user_id, resource_id, perms, 'course' AS 'range' - FROM resource_permissions - WHERE - user_id IN ( - SELECT seminar_id FROM seminare - ) - UNION - SELECT user_id, resource_id, perms, 'institute' AS 'range' - FROM resource_permissions - WHERE - user_id IN ( - SELECT Institut_id FROM Institute - )" - )->fetchAll(); - - $course_participant_stmt = $db->prepare( - "SELECT user_id - FROM seminar_user - WHERE - Seminar_id = :course_id" - ); - - $institute_participant_stmt = $db->prepare( - "SELECT user_id, inst_perms - FROM user_inst - WHERE - Institut_id = :institute_id" - ); - - $get_user_permission_stmt = $db->prepare( - "SELECT perms - FROM resource_permissions - WHERE user_id = :user_id AND resource_id = :resource_id" - ); - - $update_user_permission_stmt = $db->prepare( - "UPDATE resource_permissions - SET perms = :perms - WHERE user_id = :user_id AND resource_id = :resource_id" - ); - - $create_user_permission_stmt = $db->prepare( - "INSERT INTO resource_permissions - (user_id, resource_id, perms, mkdate, chdate) - VALUES - (:user_id, :resource_id, :perms, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" - ); - $create_specialresources_entry = $db->prepare( - "INSERT INTO specialresourcesplugin_course_resources - (course_id, resource_id, mkdate, chdate) - VALUES - (:course_id, :resource_id, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" - ); - - foreach ($permissions as $permission) { - //Get all participants of the course/institute: - $participants = []; - if ($permission['range'] == 'course') { - $course_participant_stmt->execute( - [ - 'course_id' => $permission['user_id'] - ] - ); - $participants = $course_participant_stmt->fetchAll(); - } elseif ($permission['range'] == 'institute') { - $institute_participant_stmt->execute( - [ - 'institute_id' => $permission['user_id'] - ] - ); - $participants = $institute_participant_stmt->fetchAll(); - } - - foreach ($participants as $participant) { - if (($permission['range'] == 'institute') && - !in_array($participant['inst_perms'], ['autor', 'tutor', 'dozent', 'admin'])) { - //The permission level in the institute is too low. - continue; - } - //Check if a permission exists for that participant: - $get_user_permission_stmt->execute( - [ - 'user_id' => $participant['user_id'], - 'resource_id' => $permission['resource_id'] - ] - ); - $existing_perm = $get_user_permission_stmt->fetch(PDO::FETCH_COLUMN); - - if ($existing_perm) { - if (!in_array($existing_perm, ['autor', 'tutor', 'admin'])) { - //Update the permission and set it to "autor": - $update_user_permission_stmt->execute( - [ - 'user_id' => $participant['user_id'], - 'resource_id' => $permission['resource_id'], - 'perms' => 'autor' - ] - ); - } - } else { - //Create a new permission: Give every participant - //'autor' permissions for the resource - //that was specified in the course permission: - $create_user_permission_stmt->execute( - [ - 'user_id' => $participant['user_id'], - 'resource_id' => $permission['resource_id'], - 'perms' => 'autor' - ] - ); - } - } - - if ($GLOBALS['RESOURCE_MIGRATION_SPECIALRESOURCESPLUGIN']) { - $create_specialresources_entry->execute( - [ - 'course_id' => $permission['user_id'], - 'resource_id' => $permission['resource_id'] - ] - ); - } - } - } - } - - public function migrateOwner() - { - $db = DBManager::get(); - $db->exec("INSERT IGNORE INTO resource_permissions - (user_id, resource_id, perms, mkdate, chdate) - SELECT r.owner_id, r.id, 'admin', r.mkdate, r.chdate - FROM resources r INNER JOIN resource_categories rc - ON r.category_id = rc.id AND class_name='Room' - WHERE EXISTS - (SELECT * FROM auth_user_md5 WHERE owner_id = user_id)"); - $responsible_property_id = - $db->fetchColumn("SELECT property_id FROM resource_property_definitions WHERE name = 'responsible_person'"); - if ($responsible_property_id) { - $db->exec("INSERT IGNORE INTO resource_properties - (resource_id, property_id,state,mkdate,chdate) - SELECT r.id, '$responsible_property_id', r.owner_id, r.mkdate, r.chdate - FROM resources r INNER JOIN resource_categories rc - ON r.category_id = rc.id AND class_name='Room' - WHERE EXISTS - (SELECT * FROM auth_user_md5 WHERE owner_id = user_id)"); - } - $db->exec("ALTER TABLE resources DROP COLUMN owner_id"); - } - - public function deleteOldPermissions(PDO $db) { - //Delete all permissions that aren't permissions of existing users: - $db->exec( - "DELETE FROM resource_permissions - WHERE user_id NOT IN ( - SELECT user_id FROM auth_user_md5 - );" - ); - } - - - public function deleteResources() - { - $resource_trees_to_be_deleted = - $GLOBALS['RESOURCE_MIGRATION_RESOURCE_TREES_TO_BE_DELETED']; - if (count($resource_trees_to_be_deleted)) { - foreach ($resource_trees_to_be_deleted as $resource_id) { - $resource = Resource::find($resource_id); - if ($resource instanceof Resource) { - $resource->delete(); - } - } - } - } - - - public function migrateLocations(PDO $db, $location_cat_id = null) - { - if (!$location_cat_id) { - //This should not happen! - throw new Exception('Internal error!'); - } - - //First we create one Location data set for orphaned buildings: - $orphan_location_stmt = $db->prepare( - "INSERT INTO resources - (id, category_id, name) - VALUES (:id, :category_id, :name);" - ); - - $orphan_location_id = md5('SonstigeGebäudeResourceLocation' . rand()); - - $orphan_location_stmt->execute( - [ - 'id' => $orphan_location_id, - 'category_id' => $location_cat_id, - 'name' => 'Sonstige Gebäude' - ] - ); - - //We must get all IDs of resources which are parents - //of building resources. Such resources and their categories - //are Locations. - //Buildings without a parent are attached to a new location - //which is built for this case. - - $building_resources = $db->query( - "SELECT resources.id as id, parent_id FROM resources - INNER JOIN resource_categories - ON resources.category_id = resource_categories.id - WHERE - resource_categories.class_name = 'Building';" - )->fetchAll(); - - //We have the ID and the parent-ID of all building resources. - //Now we get all categories of the building's parents - //and set their class_name to 'Location'. - //Furthermore we remove the parent's parents since Location - //resources must not have parent resources. - - $get_parent_stmt = $db->prepare( - "SELECT id, category_id FROM resources - WHERE id = :parent_id" - ); - - $update_location_category_stmt = $db->prepare( - "UPDATE resource_categories SET class_name = 'Location' - WHERE id = :category_id;" - ); - - $update_parent_stmt = $db->prepare( - "UPDATE resources SET parent_id = :parent_id - WHERE id = :id;" - ); - - $update_category_stmt = $db->prepare( - "UPDATE resources SET category_id = :category_id - WHERE id = :id;" - ); - - //Ok, now we can look for all buildings and give them a parent_id - //if they don't have one and we can remove their parent's parent_id, - //if they have one. - - foreach ($building_resources as $building) { - if ($building['parent_id']) { - //parent_id is set: get the parent: - $get_parent_stmt->execute( - ['parent_id' => $building['parent_id']] - ); - - $parents = $get_parent_stmt->fetchAll(); - - foreach ($parents as $parent) { - if ($parent['category_id']) { - //Update the parent's category since it is a location: - $update_location_category_stmt->execute( - [ - 'category_id' => $parent['category_id'] - ] - ); - } else { - //Parent does not belong to a category: - //set the category to our orphaned location category: - $update_category_stmt->execute( - [ - 'category_id' => $location_cat_id, - 'id' => $parent['id'] - ] - ); - } - - if ($parent['parent_id']) { - //If the parent's parent_id is set we must delete it: - $update_parent_stmt->execute( - [ - 'parent_id' => '', - 'id' => $parent['id'] - ] - ); - } - } - } else { - //The building has no parent_id: We must add it to our - //orphan building location: - $update_parent_stmt->execute( - [ - 'parent_id' => $orphan_location_id, - 'id' => $building['id'] - ] - ); - } - } - - //Now all buildings should be connected to locations and all locations - //should be without a parent. - } - - - public function migrateBuildings(PDO $db) - { - //We must set the class name to 'Building' for all - //resource categories whose name is like 'gebäude'. - - $db->exec( - "UPDATE resource_categories SET class_name = 'Building' - WHERE name LIKE '%gebäude%';" - ); - - } - - - public function migrateRooms(PDO $db) - { - //Set the category's class name to 'Room' for all categories - //which have a name similar to 'Raum' or 'Saal': - - $db->exec( - "UPDATE resource_categories - SET class_name = 'Room' - WHERE name LIKE '%raum%' OR name LIKE '%saal%';" - ); - - - } - - - public function deleteExistingProperties(PDO $db) - { - $properties_to_be_deleted = $GLOBALS['RESOURCE_PROPERTIES_TO_BE_DELETED']; - if (!count($properties_to_be_deleted)) { - //Nothing to do. - return; - } - - $delete_definition_stmt = $db->prepare( - 'DELETE FROM resource_property_definitions - WHERE property_id IN ( :property_ids )' - ); - $delete_resource_property_stmt = $db->prepare( - 'DELETE FROM resource_properties - WHERE property_id IN ( :property_ids )' - ); - $delete_resource_request_property_stmt = $db->prepare( - 'DELETE FROM resource_request_properties - WHERE property_id IN ( :property_ids )' - ); - - $delete_resource_request_property_stmt->execute( - ['property_ids' => $properties_to_be_deleted] - ); - $delete_resource_property_stmt->execute( - ['property_ids' => $properties_to_be_deleted] - ); - $delete_definition_stmt->execute( - ['property_ids' => $properties_to_be_deleted] - ); - } - - - public function migrateExistingProperties(PDO $db) - { - $this->write( - '# Migrating existing properties.' - ); - - //rename resource properties: - $get_property_stmt = $db->prepare( - "SELECT property_id - FROM resource_property_definitions - WHERE - name = :name AND type = :type;" - ); - - $update_property_stmt = $db->prepare( - "UPDATE resource_property_definitions - SET name = :name, - `system` = 1, - searchable = :searchable, - range_search = :range_search - WHERE property_id = :property_id;" - ); - - $insert_new_prop_stmt = $db->prepare( - "INSERT INTO resource_property_definitions - (`property_id`, `name`, `description`, `type`, `options`, - `info_label`, `display_name`, `searchable`, `range_search`, - `write_permission_level`, `system`, `mkdate`, `chdate`) - VALUES - (:property_id, :name, :description, :type, :options, - :info_label, :display_name, :searchable, :range_search, - :write_permission_level, :system, :mkdate, :chdate);" - ); - - $delete_duplicates_stmt = $db->prepare( - 'DELETE FROM resource_property_definitions - WHERE property_id IN ( :duplicate_ids );' - ); - - $requestable_attr_stmt = $db->prepare( - "UPDATE resource_category_properties - SET requestable = :requestable - WHERE property_id = :property_id;" - ); - - $properties_to_be_modified = $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MODIFIED']; - foreach ($properties_to_be_modified as $old_name => $data) { - //Check if the old property exists: - $get_property_stmt->execute( - [ - 'name' => $old_name, - 'type' => $data['old_type'] - ] - ); - $old_property_ids = $get_property_stmt->fetchAll( - PDO::FETCH_COLUMN, - 0 - ); - if ($data['name'] === 'seats' && !count($old_property_ids)) { - $old_property_ids = $db->fetchFirst( - "SELECT `property_id` - FROM `resource_property_definitions` - WHERE `system` = 2"); - } - - //Check if the new property already exists: - $get_property_stmt->execute( - [ - 'name' => $data['name'], - 'type' => $data['old_type'] - ] - ); - - $final_property_id = null; - $duplicate_ids = []; - - $new_property_id = $get_property_stmt->fetchColumn(); - if ($new_property_id) { - //The new property already exists. We must set all values - //from the old property to the new property. - $final_property_id = $new_property_id; - $duplicate_ids = $old_property_ids; - } - - if (!$final_property_id) { - //The new property doesn't exist yet. We must either - //take one of the old properties and rename it - //or we must create a new property with that name. - if ((count($old_property_ids) > 0) && !$final_property_id) { - $this->write( - sprintf( - 'Property-IDs for "%1$s" = [%2$s]', - $old_name, - implode(', ', $old_property_ids) - ) - ); - if (count($old_property_ids) > 1) { - //Remove the first item of the $old_property_list array, - //store it in $final_property and use the other IDs - //in the duplicates array. - $final_property_id = array_shift($old_property_ids); - $duplicate_ids[] = $old_property_ids; - } else { - //The only property ID is the first item in the - //$old_property_ids array. - $final_property_id = $old_property_ids[0]; - } - $this->write( - sprintf( - 'Renaming property "%1$s" to "%2$s".', - $old_name, - $data['name'] - ) - ); - //Update the property: - $update_property_stmt->execute( - [ - 'name' => $data['name'], - 'searchable' => ($data['searchable'] ? '1' : '0'), - 'range_search' => ($data['range_search'] ? '1' : '0'), - 'property_id' => $final_property_id - ] - ); - } else { - $this->write( - sprintf( - 'No property with the name "%1$s" and the type "%2$s" could be found! Creating a new property.', - $old_name, - $data['old_type'] - ) - ); - //There is no old property defined. We must define one. - $now = time(); - $property_id = md5('RRV2NewProperty' . $data['name'] . rand()); - $this->write( - 'INFO: The property-ID of the new property "' - . $data['name'] . '" is: ' . $property_id - ); - $insert_new_prop_stmt->execute( - [ - 'property_id' => $property_id, - 'name' => $data['name'], - 'description' => ( - $data['description'] - ? $data['description'] - : '' - ), - 'system' => 1, - 'type' => $data['new_type'] ? $data['new_type'] : $data['old_type'], - 'options' => ($data['options'] ? $data['options'] : ''), - 'info_label' => $data['info_label'] ? '1' : '0', - 'display_name' => ( - $data['display_name'] - ? $data['display_name'] - : $data['name'] - ), - 'searchable' => ($data['searchable'] ? '1' : '0'), - 'range_search' => ($data['range_search'] ? '1' : '0'), - 'write_permission_level' => 'admin-global', - 'mkdate' => $now, - 'chdate' => $now - ] - ); - $final_property_id = $property_id; - } - } - - if ($duplicate_ids) { - $this->write( - sprintf( - 'Moving old property values to the new property "%s".', - $data['name'] - ) - ); - //Now we must "redirect" all links to the duplicates - //to the property that is left - //and then remove the duplicates. - - $tables = [ - 'resource_category_properties', - 'resource_properties', - 'resource_request_properties' - ]; - foreach ($tables as $table) { - $update_tables_stmt = $db->prepare( - sprintf( - "UPDATE IGNORE %s - SET property_id = :property_id - WHERE property_id IN ( :duplicate_ids );", - $table - ) - ); - $update_tables_stmt->execute( - [ - 'property_id' => $final_property_id, - 'duplicate_ids' => $duplicate_ids - ] - ); - } - - $this->write( - sprintf( - 'Deleting property values for property-IDs [%s].', - implode(', ', $duplicate_ids) - ) - ); - - //Now we delete the duplicates: - $delete_duplicates_stmt->execute( - [ - 'duplicate_ids' => $duplicate_ids - ] - ); - - //After that we have to delete those property relations - //whose property_id couldn't be set above - //to avoid duplicate primary keys. - $delete_relations_stmt = $db->prepare( - sprintf( - "DELETE FROM %s - WHERE property_id IN ( :duplicate_ids );", - $table - ) - ); - foreach ($tables as $table) { - $delete_relations_stmt->execute( - [ - 'duplicate_ids' => $duplicate_ids - ] - ); - } - } - - //Finally we make the property requestable, if configured: - $requestable_attr_stmt->execute( - [ - 'property_id' => $final_property_id, - 'requestable' => ($data['requestable'] ? '1' : '0') - ] - ); - } - - $this->write( - 'Finished migrating existing properties.' - ); - } - - - public function mergeProperties(PDO $db) - { - $this->write( - '# Merging properties.' - ); - - $get_prop_stmt = $db->prepare( - "SELECT property_id, name FROM resource_property_definitions - WHERE name = :name AND type = :type" - ); - - $insert_prop_stmt = $db->prepare( - "INSERT INTO resource_property_definitions - (`property_id`, `name`, `description`, `type`, `options`, - `info_label`, `display_name`, `searchable`, `range_search`, - `write_permission_level`, `system`, `mkdate`, `chdate`) - VALUES - (:property_id, :name, :description, :type, :options, - :info_label, :display_name, :searchable, :range_search, - :write_permission_level, :system, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" - ); - - $get_property_values_stmt = $db->prepare( - "SELECT property_id, resource_id, state FROM resource_properties - WHERE property_id = :property_id;" - ); - - $insert_new_value_stmt = $db->prepare( - "INSERT IGNORE INTO resource_properties - (property_id, resource_id, state) - VALUES - (:property_id, :resource_id, :state);" - ); - - $get_category_id_stmt = $db->prepare( - "SELECT DISTINCT category_id FROM resource_category_properties - WHERE property_id IN ( :property_ids );" - ); - - $prop_cat_assign_stmt = $db->prepare( - "INSERT INTO resource_category_properties - (`category_id`, `property_id`, `requestable`, `protected`, - `system`, `form_text`, `mkdate`, `chdate`) - VALUES - (:category_id, :property_id, :requestable, :protected, - :system, :form_text, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()) - ON DUPLICATE KEY UPDATE - `requestable` = :requestable, - `protected` = :protected, - `system` = :system, - `form_text` = :form_text;" - ); - - $delete_old_prop_stmt = $db->prepare( - "DELETE FROM resource_property_definitions - WHERE property_id IN ( :property_ids );" - ); - - $delete_resource_request_property_values_stmt = $db->prepare( - "DELETE FROM resource_request_properties - WHERE property_id IN ( :property_ids );" - ); - - $delete_resource_property_values_stmt = $db->prepare( - "DELETE FROM resource_properties - WHERE property_id IN ( :property_ids );" - ); - - $properties_to_be_merged = $GLOBALS['RESOURCE_PROPERTIES_TO_BE_MERGED']; - foreach ($properties_to_be_merged as $merged_prop) { - $get_prop_stmt->execute( - [ - 'name' => $merged_prop['name'], - 'type' => $merged_prop['type'] - ] - ); - - $merged_property_id = $get_prop_stmt->fetchColumn(); - - if (!$merged_property_id) { - $this->write( - sprintf( - 'Creating new property from the type "%1$s", named "%2$s"!', - $merged_prop['type'], - $merged_prop['name'] - ) - ); - - //Create a new property: - $merged_property_id = md5( - 'RRV2NewMergedProperty' - . $merged_prop['name'] . rand() - ); - - $this->write( - 'INFO: The property-ID of the new property "' - . $merged_prop['name'] . '" is: ' . $merged_property_id - ); - $insert_prop_stmt->execute( - [ - 'property_id' => $merged_property_id, - 'name' => $merged_prop['name'], - 'description' => ( - $merged_prop['description'] - ? $merged_prop['description'] - : '' - ), - 'type' => $merged_prop['type'], - 'options' => ( - $merged_prop['options'] - ? $merged_prop['options'] - : '' - ), - 'info_label' => 0, - 'display_name' => ( - $merged_prop['display_name'] - ? $merged_prop['display_name'] - : $merged_prop['name'] - ), - 'searchable' => ($merged_prop['searchable'] ? '1' : '0'), - 'range_search' => ($merged_prop['range_search'] ? '1' : '0'), - 'write_permission_level' => 'admin-global', - 'system' => 1 - ] - ); - } - - //Get the old properties and collect their values: - $old_values = []; - $old_property_ids = []; - foreach ($merged_prop['sources'] as $source_prop) { - //Get the property whose values shall be merged: - $get_prop_stmt->execute( - [ - 'name' => $source_prop['name'], - 'type' => $source_prop['type'] - ] - ); - $old_prop = $get_prop_stmt->fetch(); - if (!$old_prop) { - $this->write( - sprintf( - 'The old property with the name "%1$s" and the type "%2$s" doesn\'t exist!', - $source_prop['name'], - $source_prop['type'] - ) - ); - //The old property doesn't exist. - continue; - } - - $old_property_ids[] = $old_prop['property_id']; - - //Get all property values and convert them: - $get_property_values_stmt->execute( - [ - 'property_id' => $old_prop['property_id'] - ] - ); - - $all_values = $get_property_values_stmt->fetchAll(); - - foreach ($all_values as $value) { - if (!is_array($old_values[$value['resource_id']])) { - $old_values[$value['resource_id']] = []; - } - $old_values[$value['resource_id']][$source_prop['name']] = - $value['state']; - } - } - - //Merge the old property values for each resource: - foreach ($old_values as $resource_id => $o_values) { - $new_value = ''; - if ($merged_prop['value_conversion'] instanceof Closure) { - //Use a closure for the value conversion: - $new_value = $merged_prop['value_conversion']($o_values); - } else { - //Just append the old values: - foreach ($o_values as $old_value) { - $new_value .= $old_value; - } - } - - $this->write( - sprintf( - 'Merged property value(s) [%1$s] to new value "%2$s."', - implode(', ', $o_values), - $new_value - ) - ); - - //Insert the property value for the new property: - $insert_new_value_stmt->execute( - [ - 'property_id' => $merged_property_id, - 'resource_id' => $resource_id, - 'state' => $new_value - ] - ); - } - - //Assign the new property to all categories, - //resources and resource requests where the old properties - //are assigned to: - $get_category_id_stmt->execute( - ['property_ids' => $old_property_ids] - ); - $relevant_category_ids = $get_category_id_stmt->fetchAll( - PDO::FETCH_COLUMN, - 0 - ); - - if (!$relevant_category_ids) { - //The old properties aren't used anywhere. - //We can just delete them. - $delete_old_prop_stmt->execute( - ['property_ids' => $old_property_ids] - ); - return; - } - - foreach ($relevant_category_ids as $category_id) { - $prop_cat_assign_stmt->execute( - [ - 'category_id' => $category_id, - 'property_id' => $merged_property_id, - 'requestable' => $merged_prop['requestable'] ? '1' : '0', - 'protected' => '0', - 'system' => '1', - 'form_text' => '' - ] - ); - } - - $this->write('Deleting old merged properties!'); - - //We can delete the old properties here: - $delete_old_prop_stmt->execute( - [ - 'property_ids' => $old_property_ids - ] - ); - - //Delete entries from resource requests: - //Since the values have changed, the converted property values - //may be inadequate for the resource request and thereby - //the request property value for the property is deleted. - $delete_resource_request_property_values_stmt->execute( - [ - 'property_ids' => $old_property_ids - ] - ); - - //Delete all resource property values from the old property: - $delete_resource_property_values_stmt->execute( - [ - 'property_ids' => $old_property_ids - ] - ); - } - - $this->write( - 'Finished merging properties.' - ); - } - - - public function removeObsoleteConfigEntries(PDO $db) - { - $entries = [ - 'RESOURCES_ALLOW_CREATE_ROOMS', - 'RESOURCES_ALLOW_CREATE_TOP_LEVEL', - 'RESOURCES_ALLOW_DELETE_REQUESTS', - 'RESOURCES_ALLOW_REQUESTABLE_ROOM_REQUESTS', - 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS', - 'RESOURCES_ENABLE_GROUPING', - 'RESOURCES_ENABLE_ORGA_CLASSIFY', - 'RESOURCES_ENABLE_SEM_SCHEDULE', - 'RESOURCES_ENABLE_VIRTUAL_ROOM_GROUPS', - 'RESOURCES_HIDE_PAST_SINGLE_DATES', - 'RESOURCES_INHERITANCE_PERMS', - 'RESOURCES_INHERITANCE_PERMS_ROOMS', - 'RESOURCES_LOCKING_ACTIVE', - 'RESOURCES_ROOM_REQUEST_DEFAULT_ACTION', - 'RESOURCES_SCHEDULE_EXPLAIN_USER_NAME', - 'RESOURCES_SEARCH_ONLY_REQUESTABLE_PROPERTY', - 'RESOURCES_SHOW_ROOM_NOT_BOOKED_HINT', - 'RESOURCES_ENABLE_ORGA_ADMIN_NOTICE' - ]; - - $stmt = $db->prepare( - 'DELETE FROM config WHERE field IN ( :entries );' - ); - - $stmt->execute(['entries' => $entries]); - } - - - public function createPropertyGroups(PDO $db) - { - $get_group_id_stmt = $db->prepare( - "SELECT id FROM resource_property_groups WHERE name = :name" - ); - $create_group_stmt = $db->prepare( - "INSERT INTO resource_property_groups - (`name`, `mkdate`, `chdate`) - VALUES - (:name, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())" - ); - - $property_groups = []; - - if ($GLOBALS['RESOURCE_MIGRATION_PROPERTY_GROUP_PROPERTY_NAME_REGEX']) { - //A regular expression is set to split property names - //into a group part and a proprty name part. - - $group_name_regex = $GLOBALS['RESOURCE_MIGRATION_PROPERTY_GROUP_PROPERTY_NAME_REGEX']; - - $all_properties = $db->query( - "SELECT property_id, name FROM resource_property_definitions - ORDER BY name ASC" - )->fetchAll(); - - foreach ($all_properties as $property) { - $splitted_name = preg_split($group_name_regex, $property['name'], 2); - $group_name = trim($splitted_name[0]); - $new_property_name = trim($splitted_name[1]); - - if ($group_name && $new_property_name) { - //A group name could be extracted. - //Check if a group with that name already exists: - $get_group_id_stmt->execute( - [ - 'name' => $group_name - ] - ); - $group_id = $get_group_id_stmt->fetchColumn(); - if (!$group_id) { - //Create a new group: - $create_group_stmt->execute( - [ - 'name' => $group_name - ] - ); - //Get the ID of the group: - $get_group_id_stmt->execute(['name' => $group_name]); - $group_id = $get_group_id_stmt->fetchColumn(); - - if (!$group_id) { - //No such group. We can only move to the next property. - echo "no group-id!\n"; - continue; - } - } - - //Add the property to the list of properties - //to be added to the group. - if (!is_array($property_groups[$group_id])) { - $property_groups[$group_id] = []; - } - $property_groups[$group_id][] = [ - 'property_id' => $property['property_id'], - 'new_property_name' => $new_property_name - ]; - } - } - - $update_property_stmt = $db->prepare( - "UPDATE resource_property_definitions - SET property_group_id = :group_id - WHERE property_id = :property_id" - ); - - $update_property_with_name_stmt = $db->prepare( - "UPDATE resource_property_definitions - SET property_group_id = :group_id, - name = :new_name, - display_name = :new_name - WHERE property_id = :property_id" - ); - - foreach ($property_groups as $group_id => $property_list) { - foreach ($property_list as $property_data) { - if ($property_data['new_property_name']) { - $update_property_with_name_stmt->execute( - [ - 'group_id' => $group_id, - 'new_name' => $property_data['new_property_name'], - 'property_id' => $property_data['property_id'] - ] - ); - } else { - $update_property_stmt->execute( - [ - 'group_id' => $group_id, - 'property_id' => $property_data['property_id'] - ] - ); - } - } - } - } - - //At this point, some property groups may already have been created - //using the property group regex. But they can also be created - //by explicitly defining a name and the properties that are included - //in the group. - if (count($GLOBALS['RESOURCE_MIGRATION_NEW_PROPERTY_GROUP_LIST'])) { - $property_group_list = $GLOBALS['RESOURCE_MIGRATION_NEW_PROPERTY_GROUP_LIST']; - - $add_properties_stmt = $db->prepare( - "UPDATE resource_property_definitions - SET property_group_id = :group_id - WHERE name IN ( :names )" - ); - - foreach ($property_group_list as $group_name => $property_names) { - $get_group_id_stmt->execute(['name' => $group_name]); - $group_id = $get_group_id_stmt->fetchColumn(); - - if ($group_id) { - $add_properties_stmt->execute( - [ - 'group_id' => $group_id, - 'names' => $property_names - ] - ); - } else { - //Create a group with the specified group name first: - $create_group_stmt->execute(['name' => $group_name]); - - $get_group_id_stmt->execute(['name' => $group_name]); - $group_id = $get_group_id_stmt->fetchColumn(); - - if (!$group_id) { - //There is nothing we can do about it here. - continue; - } - - $add_properties_stmt->execute( - [ - 'group_id' => $group_id, - 'names' => $property_names - ] - ); - } - } - } - } - - - public function createMissingLocation(PDO $db) - { - //Check if there is a location category: - $location_category_id = $db->query( - "SELECT id FROM resource_categories - WHERE class_name = 'Location' - ORDER BY name LIMIT 1" - )->fetchAll(PDO::FETCH_COLUMN, 0); - - $location_resource_id = null; - if (!$location_category_id) { - //Create a location category: - $location_category_id = md5('LocationCategory_' . uniqid()); - - $create_category_stmt = $db->prepare( - "INSERT INTO resource_categories - (`id`, `name`, `system`, `class_name`, `mkdate`, `chdate`) - VALUES - (:id, :name, '1', 'Location', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" - ); - - $create_category_stmt->execute( - [ - 'id' => $location_category_id, - 'name' => _('Standort') - ] - ); - } - - //Check if all buildings have a location resource - //in their "parent chain": - $building_ids = []; - $get_buildings_stmt = $db->prepare( - "SELECT resources.id FROM resources - INNER JOIN resource_categories rc - ON resources.category_id = rc.id - WHERE rc.class_name = 'Building'" - ); - $get_buildings_stmt->execute(); - $building_ids = $get_buildings_stmt->fetchAll(PDO::FETCH_COLUMN, 0); - - $get_parent_stmt = $db->prepare( - "SELECT r1.parent_id as parent_id, rc.class_name as class_name - FROM resources r1 - LEFT JOIN resources r2 ON r2.id=r1.parent_id - INNER JOIN resource_categories rc ON r2.category_id = rc.id - WHERE r1.id = :resource_id" - ); - - $orphaned_top_level_resource_ids = []; - foreach ($building_ids as $building_id) { - //Traverse the resource tree upwards until - //a location resource is found or a resource - //with no parent is reached. - $building_location_id = null; - - $last_id = null; - $current_id = $building_id; - while($current_id && !$building_location_id) { - $get_parent_stmt->execute( - [ - 'resource_id' => $current_id - ] - ); - - $data = $get_parent_stmt->fetchOne(); - if ($data['class_name'] == 'Location') { - //We have found the location. - $building_location_id = $data['parent_id']; - $last_id = null; - } else { - //No location found. Go one layer up: - $last_id = $current_id; - $current_id = $data['parent_id']; - } - } - - //At this point, we have either found a location resource - //or a top level resource that is not a location but a - //parent resource of a building. - if (!$building_location_id && $last_id) { - $orphaned_top_level_resource_ids[] = $last_id; - } - } - - $location_id = $db->query( - "SELECT resources.id FROM resources - INNER JOIN resource_categories rc - ON resources.category_id = rc.id - WHERE rc.class_name = 'Location' - ORDER BY resources.name LIMIT 1" - )->fetchAll(PDO::FETCH_COLUMN, 0); - - if (!$location_id) { - //No location exists. In that case, we have to - //create a location resource. - - $location_name = Config::get()->UNI_NAME_CLEAN; - if (!$location_name) { - $location_name = _('Standort'); - } - - $create_location_stmt = $db->prepare( - "INSERT INTO resources - (`id`, `parent_id`, `category_id`, `name`, `requestable`, - `mkdate`, `chdate`) - VALUES - (:id, '', :category_id, :name, '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" - ); - - $location_id = md5('Location_' . $location_name . uniqid()); - $create_location_stmt->execute( - [ - 'id' => $location_id, - 'category_id' => $location_category_id, - 'name' => $location_name - ] - ); - } - - $assign_to_location_stmt = $db->prepare( - "UPDATE resources SET parent_id = :parent_id WHERE id = :id;" - ); - - foreach ($orphaned_top_level_resource_ids as $resource_id) { - $assign_to_location_stmt->execute( - [ - 'parent_id' => $location_id, - 'id' => $resource_id - ] - ); - } - } - - - public function fillResourceBookingIntervals(PDO $db) - { - $chunk_size = 100; - - //Delete everything from resource booking intervals first: - $db->exec('DELETE FROM resource_booking_intervals;'); - - $query = "SELECT COUNT(*) - FROM resource_bookings"; - $booking_count = $db->query($query)->fetchColumn(); - - for ($loop = 0; $loop < $booking_count; $loop += $chunk_size) { - $query = "SELECT id, resource_id, range_id, begin, end, booking_type - preparation_time, repeat_end, repeat_quantity, repetition_interval - FROM resource_bookings - LIMIT {$loop}, {$chunk_size}"; - $bookings = $db->query($query); - - $add_interval_stmt = $db->prepare( - "INSERT INTO resource_booking_intervals - (interval_id, booking_id, resource_id, begin, end, takes_place, - mkdate, chdate) - VALUES - (:interval_id, :booking_id, :resource_id, :begin, :end, 1, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP());" - ); - - $bookings->setFetchMode(PDO::FETCH_ASSOC); - foreach ($bookings as $booking) { - //Calculate the time intervals the same way as in - //ResourceBooking::calculateTimeIntervals: - $add_interval = function ($begin, $end) use ($booking, $add_interval_stmt) { - $interval_id = md5( - 'ResourceBookingInterval' . - $booking['booking_id'] . - $booking['begin'] . - $booking['end'] . - uniqid() - ); - $add_interval_stmt->execute([ - ':interval_id' => $interval_id, - ':booking_id' => $booking['id'], - ':resource_id' => $booking['resource_id'], - ':begin' => $begin, - ':end' => $end, - ]); - }; - - $booking_begin = new DateTime(); - $booking_begin->setTimestamp($booking['begin']); - if ($booking['preparation_time']) { - $booking_begin->setTimestamp( - $booking['begin'] - $booking['preparation_time'] - ); - } - $booking_end = new DateTime(); - $booking_end->setTimestamp($booking['end']); - - //use begin and end to create the first interval: - $add_interval( - $booking_begin->getTimestamp(), - $booking_end->getTimestamp() - ); - - if (($booking['repeat_quantity'] > 0) || $booking['repeat_end']) { - //Repetition: we must check which repetition interval has been - //selected and then create entries for each repetition. - //Repetition starts with the begin date and ends with the - //"repeat_end" date. - - $repetition_end = new DateTime(); - $repetition_end->setTimestamp($booking['repeat_end']); - //The DateInterval constructor will throw an exception, - //if it cannot parse the string stored in $this->repetition_interval. - $repetition_interval = null; - if ($booking['repetition_interval']) { - try { - $repetition_interval = new DateInterval($booking['repetition_interval']); - } catch (Exception $e) { - //Invalid repetition interval string. - //Skip this booking since its repetition interval is invalid. - continue; - } - } - - if ($repetition_interval instanceof DateInterval) { - $duration = $booking_begin->diff($booking_end); - - //Check if end is later than begin to avoid - //infinite loops. - if ($repetition_end > $booking_begin) { - $current_begin = clone $booking_begin; - $current_begin->add($repetition_interval); - while ($current_begin < $repetition_end) { - $current_end = clone $current_begin; - $current_end->add($duration); - - $add_interval( - $current_begin->getTimestamp(), - $current_end->getTimestamp() - ); - - $current_begin->add($repetition_interval); - } - } - } - } - } - } - } - - - public function up() - { - //Load the special configuration first: - if (file_exists(__DIR__ . '/../../config/resource_migration.php')) { - require(__DIR__ . '/../../config/resource_migration.php'); - } else { - //The special configuration doesn't exist so that we have to load - //the default configuration for the demo data. - $this->loadDefaultConfiguration(); - } - $db = DBManager::get(); - - //add new configuration variables: - - $db->exec( - "INSERT IGNORE INTO config - ( - `field`, - `value`, - `type`, - `range`, - `section`, - `mkdate`, - `chdate`, - `description` - ) - VALUES - ( - 'RESOURCES_DIRECT_ROOM_REQUESTS_ONLY', - '0', - 'boolean', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'Restricts room requests so that only specific rooms can be requested.' - ), - ( - 'RESOURCES_MAP_SERVICE_URL', - 'https://www.openstreetmap.org/#map=19/LATITUDE/LONGITUDE', - 'string', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The URL for a map service if you wish to use another service instead of OpenStreetMap. The default is: https://www.openstreetmap.org/#map=17/LATITUDE/LONGITUDE (LATITUDE and LONGITUDE are placeholders!)' - ), - ( - 'RESOURCES_MAX_PREPARATION_TIME', - '120', - 'integer', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The maximum amount of time that can be used for preparation before the actual booking begins. The value represents minutes, not hours!' - ), - ( - 'RESOURCES_MIN_BOOKING_TIME', - '15', - 'integer', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The minimum amount of minutes for the booking of a resource.' - ), - ( - 'RESOURCES_BOOKING_PLAN_START_HOUR', - '08:00', - 'string', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The start hour for the default view of the booking plan.' - ), - ( - 'RESOURCES_BOOKING_PLAN_END_HOUR', - '20:00', - 'string', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The start hour for the default view of the booking plan.' - ), - ( - 'RESOURCES_MIN_BOOKING_PERMS', - 'autor', - 'string', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The minimum permission level for global booking rights on a resource.' - ), - ( - 'RESOURCES_MIN_REQUEST_PERMISSION', - '', - 'string', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'The minimum permission level for creating \"free\" requests that are not bound to a course.' - ), - ( - 'RESOURCES_DISPLAY_CURRENT_REQUESTS_IN_OVERVIEW', - '1', - 'boolean', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'Whether to display the list with current requests in the room management overview (true) or not (false).' - ), - ( - 'RESOURCES_SHOW_PUBLIC_ROOM_PLANS', - '0', - 'boolean', - 'global', - 'resources', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'Whether to display the list of available public room plans.' - );" - ); - - //Convert configuration options that may already exist so that - //the format is identical: - - $db->exec( - "UPDATE config SET type = 'boolean', section = 'resources' - WHERE field = 'RESOURCES_DIRECT_ROOM_REQUESTS_ONLY';" - ); - - //Enable API routes (and the API itself). - //The new room and resource management system requires a few routes - //to be activated to work properly. - - $db->exec( - "UPDATE config SET value = '1' - WHERE field = 'API_ENABLED';" - ); - - $enable_api_route_stmt = $db->prepare( - "INSERT INTO api_consumer_permissions - (route_id, consumer_id, method, granted) - VALUES - (:route, 'global', :method, '1') - ON DUPLICATE KEY UPDATE - granted = '1';" - ); - $api_routes_to_enable = [ - '/user/:user_id' => 'get', - '/resources/booking_interval/:interval_id/toggle_takes_place' => 'post', - '/resources/booking/:booking_id/move' => 'post', - '/resources/booking/:booking_id/intervals' => 'get', - '/resources/resource/:resource_id/booking_plan' => 'get', - '/resources/resource/:resource_id/semester_plan' => 'get', - '/resources/request/:request_id/move' => 'post', - '/resources/request/:request_id/edit_reply_comment' => 'post', - '/resources/request/:request_id/toggle_marked' => 'post', - '/room_clipboard/:clipboard_id/booking_plan' => 'get', - '/room_clipboard/:clipboard_id/semester_plan' => 'get', - '/clipboard/:clipboard_id' => ['delete', 'put'], - '/clipboard/:clipboard_id/item' => 'post', - '/clipboard/:clipboard_id/item/:range_id' => 'delete', - '/clipboard/add' => 'post', - '/course/:course_id/members' => 'get', - '/semesters' => 'get' - ]; - - foreach ($api_routes_to_enable as $route => $methods) { - if (is_array($methods)) { - foreach ($methods as $method) { - $enable_api_route_stmt->execute( - [ - 'route' => md5($route), - 'method' => $method - ] - ); - } - } else { - $enable_api_route_stmt->execute( - [ - 'route' => md5($route), - 'method' => $methods - ] - ); - } - } - - - //add new tables: - - $db->exec( - "CREATE TABLE IF NOT EXISTS `resource_temporary_permissions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `resource_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `begin` int(11) unsigned NOT NULL DEFAULT '0', - `end` int(11) unsigned NOT NULL DEFAULT '0', - `perms` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `resource_request_appointments` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `appointment_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `colour_values` ( - `colour_id` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `description` varchar(256) NOT NULL DEFAULT '', - `value` varchar(8) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'ffffffff', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`colour_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `separable_rooms` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `building_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(256) NOT NULL DEFAULT '', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `separable_room_parts` ( - `separable_room_id` int(10) NOT NULL, - `room_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`separable_room_id`,`room_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `clipboards` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `name` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `handler` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'Clipboard', - `allowed_item_class` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'StudipItem', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - //The range_id in clipboard_items is extra large - //so that primary keys consisting of three other - //keys can also be used. - $db->exec( - "CREATE TABLE IF NOT EXISTS `clipboard_items` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `clipboard_id` int(11) NOT NULL, - `range_id` varchar(98) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `range_type` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'SimpleORMap', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - `chdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - //The property group table defines groups of resource properties - //that shall be displayed together. - $db->exec( - "CREATE TABLE IF NOT EXISTS `resource_property_groups` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `name` VARCHAR(255) NOT NULL DEFAULT '', - `position` TINYINT(4) NOT NULL DEFAULT '0', - `mkdate` INT(11) NOT NULL DEFAULT '0', - `chdate` INT(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - if ($GLOBALS['RESOURCE_MIGRATION_SPECIALRESOURCESPLUGIN']) { - $db->exec( - "CREATE TABLE IF NOT EXISTS specialresourcesplugin_course_resources( - course_id VARCHAR(32) NOT NULL, - resource_id VARCHAR(32) NOT NULL, - mkdate INT(10) NOT NULL DEFAULT '0', - chdate INT(10) NOT NULL DEFAULT '0', - PRIMARY KEY (course_id, resource_id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC" - ); - - } - - //Add colors: - $colours = [ - 'Resources.BookingPlan.Booking.Fg' => [ - 'ffffffff', - 'Die Textfarbe im Belegungsplan für gewöhnliche Buchungen.' - ], - 'Resources.BookingPlan.Booking.Bg' => [ - '129c94ff', - 'Die Farbe im Belegungsplan für gewöhnliche Buchungen.' - ], - 'Resources.BookingPlan.CourseBooking.Fg' => [ - 'ffffffff', - 'Die Textfarbe im Belegungsplan für veranstaltungsbezogene Buchungen.' - ], - 'Resources.BookingPlan.CourseBooking.Bg' => [ - '682c8bff', - 'Die Farbe im Belegungsplan für veranstaltungsbezogene Buchungen.' - ], - 'Resources.BookingPlan.CourseBookingWithExceptions.Fg' => [ - 'ffffffff', - 'Die Textfarbe im Belegungsplan für veranstaltungsbezogene Buchungen mit Ausfallterminen.' - ], - 'Resources.BookingPlan.CourseBookingWithExceptions.Bg' => [ - 'a480b9ff', - 'Die Farbe im Belegungsplan für veranstaltungsbezogene Buchungen mit Ausfallterminen.' - ], - 'Resources.BookingPlan.SimpleBookingWithExceptions.Fg' => [ - 'ffffffff', - 'Die Textfarbe im Belegungsplan für einfache Buchungen mit Wiederholungen, bei denen es Ausfalltermine gibt.' - ], - 'Resources.BookingPlan.SimpleBookingWithExceptions.Bg' => [ - '70c3bfff', - 'Die Farbe im Belegungsplan für einfache Buchungen mit Wiederholungen, bei denen es Ausfalltermine gibt.' - ], - 'Resources.BookingPlan.Reservation.Fg' => [ - 'ffffffff', - 'Die Textfarbe im Belegungsplan für Reservierungen.' - ], - 'Resources.BookingPlan.Reservation.Bg' => [ - '6ead10ff', - 'Die Farbe im Belegungsplan für Reservierungen.' - ], - 'Resources.BookingPlan.Lock.Fg' => [ - 'ffffffff', - 'Die Textfarbe im Belegungsplan für Sperrbuchungen.' - ], - 'Resources.BookingPlan.Lock.Bg' => [ - 'd60000ff', - 'Die Farbe im Belegungsplan für Sperrbuchungen.' - ], - 'Resources.BookingPlan.PlannedBooking.Fg' => [ - '000000ff', - 'Die Textfarbe im Belegungsplan für geplante Buchungen.' - ], - 'Resources.BookingPlan.PlannedBooking.Bg' => [ - 'f26e00ff', - 'Die Farbe im Belegungsplan für geplante Buchungen.' - ], - 'Resources.BookingPlan.PreparationTime.Fg' => [ - '000000ff', - 'Die Textfarbe im Belegungsplan für Rüstzeiten.' - ], - 'Resources.BookingPlan.PreparationTime.Bg' => [ - 'cf81b0ff', - 'Die Farbe im Belegungsplan für Rüstzeiten.' - ], - 'Resources.BookingPlan.Request.Fg' => [ - '000000ff', - 'Die Textfarbe im Belegungsplan für Anfragen.' - ], - 'Resources.BookingPlan.Request.Bg' => [ - 'ffbd33ff', - 'Die Farbe im Belegungsplan für Anfragen.' - ] - ]; - - $colour_stmt = $db->prepare( - 'INSERT IGNORE INTO colour_values - (colour_id, value, description, mkdate, chdate) - VALUES - (:colour_id, :value, :description, UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - );' - ); - - foreach ($colours as $colour_id => $data) { - $colour_stmt->execute( - [ - 'colour_id' => $colour_id, - 'value' => $data[0], - 'description' => $data[1] - ] - ); - } - - //alter tables: - - $db->exec("RENAME TABLE resources_objects TO resources;"); - $db->exec("ALTER TABLE resources - CHANGE COLUMN resource_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN parent_id parent_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN category_id category_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN description description text NULL DEFAULT NULL, - CHANGE COLUMN requestable requestable TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN sort_position TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - DROP COLUMN institut_id, - DROP COLUMN lockable, - DROP COLUMN multiple_assign, - DROP COLUMN root_id"); - - $db->exec("RENAME TABLE resources_categories TO resource_categories;"); - $db->exec("ALTER TABLE resource_categories - CHANGE COLUMN category_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `system` `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN class_name VARCHAR(60) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'Resource', - ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - DROP COLUMN is_room"); - - $db->exec("RENAME TABLE resources_categories_properties - TO resource_category_properties;"); - $db->exec("ALTER TABLE resource_category_properties - CHANGE COLUMN requestable requestable TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN protected protected TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `system` `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN form_text text NULL, - ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); - - $db->exec("RENAME TABLE resources_properties - TO resource_property_definitions;"); - $db->exec("ALTER TABLE resource_property_definitions - CHANGE COLUMN type type SET ( - 'bool', 'text', 'num', 'select', 'user', 'institute', - 'position', 'fileref', 'url', 'resource_ref_list' - ) CHARACTER SET latin1 COLLATE latin1_bin, - CHANGE COLUMN description description text NULL DEFAULT NULL, - CHANGE COLUMN `system` `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN display_name VARCHAR(512) NOT NULL DEFAULT '', - ADD COLUMN searchable TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN range_search TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN write_permission_level VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'admin-global', - ADD COLUMN property_group_id INT(11) NULL, - ADD COLUMN property_group_pos TINYINT(4) NULL, - ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); - - //Set the display_name to the property name as default: - - $db->exec( - "UPDATE resource_property_definitions - SET display_name = name;" - ); - - $db->exec("RENAME TABLE resources_objects_properties - TO resource_properties;"); - $db->exec("ALTER TABLE resource_properties - ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); - - $db->exec("RENAME TABLE resources_requests - TO resource_requests;"); - $db->exec("ALTER TABLE resource_requests - CHANGE COLUMN request_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN seminar_id course_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN closed closed TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN category_id category_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT '', - ADD COLUMN begin INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN end INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN preparation_time INT(4) NOT NULL DEFAULT 0, - ADD COLUMN marked TINYINT(1) UNSIGNED NOT NULL DEFAULT 0" - ); - - $db->exec("RENAME TABLE resources_requests_properties - TO resource_request_properties;"); - - $db->exec("RENAME TABLE resources_assign TO resource_bookings;"); - $db->exec("ALTER TABLE resource_bookings - CHANGE COLUMN assign_id id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN user_free_name description TEXT NULL, - CHANGE COLUMN assign_user_id range_id CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN repeat_interval old_rep_interval INT(2) NULL DEFAULT NULL, - CHANGE COLUMN repeat_month_of_year old_rep_month_of_year INT(2) NULL DEFAULT NULL, - CHANGE COLUMN repeat_day_of_month old_rep_day_of_month INT(2) NULL DEFAULT NULL, - CHANGE COLUMN repeat_week_of_month old_rep_week_of_month INT(2) NULL DEFAULT NULL, - CHANGE COLUMN repeat_day_of_week old_rep_day_of_week INT(2) NULL DEFAULT NULL, - CHANGE COLUMN comment_internal internal_comment text NULL DEFAULT NULL, - ADD COLUMN preparation_time INT(4) NOT NULL DEFAULT 0, - ADD COLUMN booking_type TINYINT(2) NOT NULL DEFAULT 0, - ADD COLUMN booking_user_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - ADD COLUMN repetition_interval VARCHAR(24) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '';" - ); - $db->exec("ALTER TABLE `resource_bookings` DROP INDEX `resource_id`, ADD INDEX `resource_id` (`resource_id`, `booking_type`)"); - - $db->exec("RENAME TABLE resources_locks - TO global_resource_locks;"); - $db->exec("ALTER TABLE global_resource_locks - CHANGE COLUMN lock_begin begin INT(11) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN lock_end end INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN user_id VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); - - $db->exec("RENAME TABLE resources_user_resources TO resource_permissions;"); - $db->exec("ALTER TABLE resource_permissions - ADD COLUMN mkdate INT(11) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN chdate INT(11) UNSIGNED NOT NULL DEFAULT 0"); - $db->exec("ALTER TABLE resource_permissions ADD INDEX (resource_id)"); - $db->exec("UPDATE resource_permissions SET resource_id = 'global' - WHERE resource_id = 'all';"); - - $db->exec("DROP TABLE resources_temporary_events;"); - $db->exec( - "CREATE TABLE `resource_booking_intervals` ( - `interval_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `resource_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `booking_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `begin` int(20) NOT NULL DEFAULT 0, - `end` int(20) NOT NULL DEFAULT 0, - `mkdate` int(11) unsigned NOT NULL DEFAULT 0, - `chdate` int(11) unsigned NOT NULL DEFAULT 0, - `takes_place` tinyint(1) unsigned NOT NULL DEFAULT 1, - PRIMARY KEY (`interval_id`), - INDEX `resource_id` (`resource_id`,`takes_place`,`end`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"); - - //Delete old tables: - - $db->exec("DROP TABLE resources_requests_user_status;"); - - //Add other nice things and modify stuff: - - $new_log_action_stmt = $db->prepare( - "INSERT IGNORE INTO log_actions (action_id, name, description) - VALUES - (:action_id, :name, :description);" - ); - - $action_id = md5(uniqid('RES_PERM_CHANGE')); - $new_log_action_stmt->execute( - [ - 'action_id' => $action_id, - 'name' => 'RES_PERM_CHANGE', - 'description' => 'Änderung der Berechtigungsstufe an einer Ressource.' - ] - ); - - //Set parent_id = '' where parent_id = 'root' or '0' in - //resources so that root resources always - //have an empty parent_id field: - $db->exec("UPDATE resources - SET parent_id = '' - WHERE parent_id = 'root' OR parent_id = '0';" - ); - - //We can delete resources now that are not needed anymore: - $this->deleteResources(); - - //First we remove those properties that are not needed anymore: - $this->deleteExistingProperties($db); - - //Now we have to migrate existing properties - //that are system properties with a different name: - $this->migrateExistingProperties($db); - //And we have to merge some properties, too: - $this->mergeProperties($db); - - //Now we convert all boolean property values to '0' and '1' - //instead of '' and 'on': - $db->exec( - "UPDATE resource_properties - INNER JOIN resource_property_definitions rpd - USING (property_id) - SET state = '1' - WHERE state = 'on' AND rpd.type = 'bool';" - ); - $db->exec( - "UPDATE resource_properties - INNER JOIN resource_property_definitions rpd - USING (property_id) - SET state = '0' - WHERE state = '' AND rpd.type = 'bool';" - ); - - //Repeat the same for resource request properties: - - $db->exec( - "UPDATE resource_request_properties - INNER JOIN resource_property_definitions rpd - USING (property_id) - SET state = '1' - WHERE state = 'on' AND rpd.type = 'bool';" - ); - $db->exec( - "UPDATE resource_request_properties - INNER JOIN resource_property_definitions rpd - USING (property_id) - SET state = '0' - WHERE state = '' AND rpd.type = 'bool';" - ); - - //rename and update resource categories: - - $db->exec("UPDATE resource_categories - SET class_name = 'Room', `system` = 1 - WHERE - name LIKE '%raum%' OR name LIKE '%Raum%' - OR name LIKE '%saal%' OR name LIKE '%Saal%';"); - - $db->exec("UPDATE resource_categories - SET class_name = 'Building', `system` = 1 - WHERE - name LIKE '%gebäude%' OR name LIKE '%Gebäude%';"); - - //add new resource categories and new properties: - - $add_category_statement = $db->prepare( - "INSERT INTO `resource_categories` - (`id`,`name`, `class_name`, `description`, `system`, `iconnr`) - VALUES - (:id, :name, :class_name, '', 1, 0);" - ); - - $location_cat_id = md5('StandortLocationResourceCategory100'); - - $building_cat_id_rows = $db->query("SELECT id - FROM resource_categories - WHERE name LIKE '%gebäude%';")->fetchAll(); - - $room_cat_id_rows = $db->query("SELECT id - FROM resource_categories - WHERE name LIKE '%raum%' OR name LIKE '%saal%';")->fetchAll(); - - $building_cat_ids = []; - foreach ($building_cat_id_rows as $row) { - $building_cat_ids[] = $row[0]; - } - - $room_cat_ids = []; - foreach ($room_cat_id_rows as $row) { - $room_cat_ids[] = $row[0]; - } - - $add_category_statement->execute( - [ - 'id' => $location_cat_id, - 'name' => 'Standort', - 'class_name' => 'Location' - ] - ); - - //Assign orphaned resources (resources without category-id): - $this->assignOrphanedResources($db); - $this->deleteUnfinishedResources($db); - - if (is_array($GLOBALS['RESOURCE_CATEGORY_CLASS_MAPPING'])) { - //Use the class mapping rules from that configuration setting: - $mapping_stmt = $db->prepare( - 'UPDATE resource_categories - SET class_name = :class_name - WHERE name = :name' - ); - foreach ($GLOBALS['RESOURCE_CATEGORY_CLASS_MAPPING'] as $name => $class_name) { - $mapping_stmt->execute( - [ - 'class_name' => $class_name, - 'name' => $name - ] - ); - } - } else { - //Migrate rooms, buildings and locations, based on best guess. - $this->migrateRooms($db); - $this->migrateBuildings($db); - $this->migrateLocations($db, $location_cat_id); - } - - if (count($GLOBALS['RESOURCE_CATEGORY_RENAME'])) { - $rename_stmt = $db->prepare( - 'UPDATE resource_categories SET name = :name - WHERE name = :old_name' - ); - - foreach ($GLOBALS['RESOURCE_CATEGORY_RENAME'] as $old_name => $name) { - $rename_stmt->execute( - [ - 'old_name' => $old_name, - 'name' => $name - ] - ); - } - } - - //Get all location categories. - //migrateLocations has set the Location class name - //for all location categories. - $location_cat_id_rows = $db->query( - "SELECT id - FROM resource_categories - WHERE class_name = 'Location';" - )->fetchAll(); - $location_cat_ids = []; - foreach ($location_cat_id_rows as $row) { - $location_cat_ids[] = $row[0]; - } - - //Add or create missing default properties: - - $property_exists_statement = $db->prepare( - "SELECT property_id - FROM resource_property_definitions - WHERE - name = :name AND type = :type;" - ); - - $add_property_statement = $db->prepare( - "INSERT INTO `resource_property_definitions` - (`property_id`, `name`, `type`, `options`, `system`) - VALUES - (:id, :name, :type, '', 1);" - ); - - $property_link_exists_statement = $db->prepare( - "SELECT 1 - FROM resource_category_properties - WHERE - category_id = :category_id AND property_id = :property_id;" - ); - - $update_property_link_statement = $db->prepare( - "UPDATE resource_category_properties - SET `system` = 1 - WHERE - category_id = :category_id AND property_id = :property_id;" - ); - - $link_property_statement = $db->prepare( - "INSERT INTO resource_category_properties - (`category_id`, `property_id`, `system`) - VALUES - (:category_id, :property_id, 1);" - ); - - $all_mandatory_properties = [ - 'location' => [ - //location properties: - 'geo_coordinates' => 'position' - ], - - 'building' => [ - //building properties: - 'geo_coordinates' => 'position', - 'number' => 'text', - 'address' => 'text' - ], - - 'room' => [ - //room properties: - 'booking_plan_is_public' => 'bool', - 'room_type' => 'select', - 'seats' => 'num', - 'responsible_person' => 'user' - ] - ]; - - foreach ($all_mandatory_properties as $area_name => $area) { - $area_ids = ['']; - if ($area_name == 'location') { - $area_ids = $location_cat_ids; - } elseif ($area_name == 'building') { - $area_ids = $building_cat_ids; - } elseif ($area_name == 'room') { - $area_ids = $room_cat_ids; - } - foreach ($area as $name => $type) { - //Check if the property exists. If so, link it only. - //Otherwise create it. - $property_exists_statement->execute( - [ - 'name' => $name, - 'type' => $type - ] - ); - - $property_id = $property_exists_statement->fetchColumn(0); - if (!$property_id) { - //property doesn't exist: create it - $property_id = md5($name . $type . rand()); - $add_property_statement->execute( - [ - 'id' => $property_id, - 'name' => $name, - 'type' => $type - ] - ); - } - - foreach ($area_ids as $area_id) { - //Check if the property is linked to the category. - //If so, we must make sure the system attribute - //is set. Otherwise we must create the link. - $property_link_exists_statement->execute( - [ - 'category_id' => $area_id, - 'property_id' => $property_id - ] - ); - - $link_exists = $property_link_exists_statement->fetchColumn(0); - - if ($link_exists) { - $update_property_link_statement->execute( - [ - 'category_id' => $area_id, - 'property_id' => $property_id - ] - ); - } else { - $link_property_statement->execute( - [ - 'category_id' => $area_id, - 'property_id' => $property_id - ] - ); - } - //make plans visible - if ($area_name === 'room' && $name === 'booking_plan_is_public') { - $db->execute("INSERT IGNORE INTO `resource_properties` (`resource_id`, `property_id`, `state`, `mkdate`, `chdate`) SELECT `id` , ?, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() FROM `resources` WHERE `category_id` = ?", [$property_id, $area_id]); - } - } - } - } - - //At this point, we can create the property groups (if any): - $this->createPropertyGroups($db); - - //Migrate resource booking interval data: - $this->migrateBookingRepeatIntervals($db); - - $this->migrateOwner(); - //Migrate course permissions on resources: - $this->migrateCourseBoundPermissions($db); - $this->deleteOldPermissions($db); - - //In case no location resource is in the database, - //one such resource will be created along with the - //corresponding category. - $this->createMissingLocation($db); - - //Create entries in resource_booking_intervals for each booking: - $this->fillResourceBookingIntervals($db); - - SimpleORMap::expireTableScheme(); - } - - - public function down() - { - //I see nothing! I hear nothing! Nothing!! - } -} diff --git a/db/migrations/20191122_resize_auth_user_md5_email_field.php b/db/migrations/20191122_resize_auth_user_md5_email_field.php deleted file mode 100644 index c0efe40..0000000 --- a/db/migrations/20191122_resize_auth_user_md5_email_field.php +++ /dev/null @@ -1,25 +0,0 @@ -exec( - "ALTER TABLE `auth_user_md5` - CHANGE COLUMN `Email` `Email` VARCHAR(256) NULL DEFAULT NULL" - ); - } - - - public function down() - { - DBManager::get()->exec( - "ALTER TABLE `auth_user_md5` - CHANGE COLUMN `Email` `Email` VARCHAR(256) NULL DEFAULT NULL" - ); - } -} diff --git a/db/migrations/20191210_config_wiki_comments_enable.php b/db/migrations/20191210_config_wiki_comments_enable.php deleted file mode 100644 index ce52b35..0000000 --- a/db/migrations/20191210_config_wiki_comments_enable.php +++ /dev/null @@ -1,31 +0,0 @@ -prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'WIKI_COMMENTS_ENABLE', - 'description' => 'Einstellung für die Anzeige von Kommentaren in Wiki als Icon', - 'range' => 'user', - 'type' => 'boolean', - 'value' => '0' - ]); - } - - public function down() - { - $db = DBManager::get(); - - $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?'); - $stmt->execute(['WIKI_COMMENTS_ENABLE']); - } -} diff --git a/db/migrations/20191211_step_00338_institutecolors.php b/db/migrations/20191211_step_00338_institutecolors.php deleted file mode 100644 index ffac530..0000000 --- a/db/migrations/20191211_step_00338_institutecolors.php +++ /dev/null @@ -1,25 +0,0 @@ -exec("DELETE FROM `datafields_entries` WHERE `datafields_entries`.`datafield_id` = '41cda2be71fe9efd6e28b853fc0681f3';"); - $db->exec("INSERT INTO `datafields` (`datafield_id`, `name`, `object_type`, `edit_perms`, `view_perms`, `priority`, `type`, `typeparam`, `is_required`, `is_userfilter`, `description`, `system`) VALUES - ('0c63321a8e93b3ccc927611709248e07', 'default Planungsfarbe', 'inst', 'admin', 'root', 0, 'textline', '', 0, 0, 'Default Farben im Veranstaltungsplaner', 0);"); - - } - - public function down() - { - $db = DBManager::get(); - $db->exec("DELETE FROM `datafields` WHERE `datafields`.`datafield_id` IN('0c63321a8e93b3ccc927611709248e07');"); - - } -} diff --git a/db/migrations/20192208_step_00333_feedback.php b/db/migrations/20192208_step_00333_feedback.php deleted file mode 100644 index cfa2fac..0000000 --- a/db/migrations/20192208_step_00333_feedback.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL version 3 - */ - -class Step00333Feedback extends Migration -{ - public function description() - { - return 'initial database setup for feedback elements'; - } - - public function up() - { - $db = DBManager::get(); - - $db->exec("CREATE TABLE IF NOT EXISTS `feedback` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` varchar(32) COLLATE latin1_bin NOT NULL, - `range_id` varchar(32) COLLATE latin1_bin NOT NULL, - `range_type` varchar(32) COLLATE latin1_bin NOT NULL, - `course_id` varchar(32) COLLATE latin1_bin NOT NULL, - `question` text COLLATE utf8mb4_unicode_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_ci NOT NULL, - `mode` int(11) UNSIGNED NOT NULL, - `results_visible` tinyint(4) UNSIGNED NOT NULL, - `commentable` tinyint(4) UNSIGNED NOT NULL, - `mkdate` int(11) UNSIGNED NOT NULL, - `chdate` int(11) UNSIGNED NOT NULL, - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - INDEX `idx_range` (`range_id`,`range_type`), - KEY `course_id` (`course_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec("CREATE TABLE IF NOT EXISTS `feedback_entries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `feedback_id` int(11) UNSIGNED NOT NULL, - `user_id` varchar(32) COLLATE latin1_bin NOT NULL, - `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, - `rating` tinyint(3) UNSIGNED NOT NULL, - `mkdate` int(10) UNSIGNED NOT NULL, - `chdate` int(10) UNSIGNED NOT NULL, - PRIMARY KEY (`id`), - KEY `feedback_id` (`feedback_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - // install as core plugin - $db->exec( - "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) - VALUES ('FeedbackModule', 'Feedback','StandardPlugin,SystemPlugin','yes', 1)" - ); - - $db->execute( - "INSERT INTO roles_plugins (roleid, pluginid) - SELECT roleid, ? - FROM roles - WHERE `system` = 'y'", - [$db->lastInsertId()] - ); - - // install config settings - $stmt = $db->prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - - $stmt->execute([ - 'name' => 'FEEDBACK_ADMIN_PERM', - 'description' => 'Voreinstellung für Berechtigungslevel, um Einstellung zu Feedback-Elementen zu verwalten', - 'range' => 'course', - 'type' => 'string', - 'value' => 'tutor' - ]); - - $stmt->execute([ - 'name' => 'FEEDBACK_CREATE_PERM', - 'description' => 'Voreinstellung für Berechtigungslevel, um Feedback-Elemente anzulegen.', - 'range' => 'course', - 'type' => 'string', - 'value' => 'tutor' - ]); - - SimpleORMap::expireTableScheme(); - } - - public function down() - { - $db = DBManager::get(); - $db->exec('DROP TABLE feedback_entries'); - $db->exec('DROP TABLE feedback'); - - $db->exec( - "DELETE plugins, roles_plugins - FROM plugins LEFT JOIN roles_plugins USING(pluginid) - WHERE pluginclassname = 'FeedbackModule'" - ); - - SimpleORMap::expireTableScheme(); - } -} diff --git a/db/migrations/201_i18n_content.php b/db/migrations/201_i18n_content.php deleted file mode 100644 index 41422a2..0000000 --- a/db/migrations/201_i18n_content.php +++ /dev/null @@ -1,31 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS `i18n` ( - `object_id` varchar(32) NOT NULL, - `table` varchar(255) NOT NULL, - `field` varchar(255) NOT NULL, - `lang` varchar(32) NOT NULL, - `value` text, - PRIMARY KEY (`object_id`,`table`,`field`,`lang`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - } - - public function down() - { - $db = DBManager::get(); - - $db->exec('DROP TABLE IF EXISTS i18n'); - } -} diff --git a/db/migrations/20200108_config_for_stgteilversion_userfilter.php b/db/migrations/20200108_config_for_stgteilversion_userfilter.php deleted file mode 100644 index 646838a..0000000 --- a/db/migrations/20200108_config_for_stgteilversion_userfilter.php +++ /dev/null @@ -1,31 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'DISPLAY_STGTEILVERSION_USERFILTER'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/202001291_add_filetypes.php b/db/migrations/202001291_add_filetypes.php deleted file mode 100644 index cade7b0..0000000 --- a/db/migrations/202001291_add_filetypes.php +++ /dev/null @@ -1,48 +0,0 @@ -exec(" - ALTER TABLE files - ADD COLUMN `filetype` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT 'StandardFile' AFTER `name`, - ADD COLUMN `metadata` TEXT NULL AFTER `size` - "); - DBManager::get()->exec(' - UPDATE files - INNER JOIN file_urls ON (file_urls.file_id = files.id) - SET files.metadata = JSON_OBJECT("url", file_urls.url, "access_type", file_urls.access_type), - files.filetype = "URLFile" - '); - DBManager::get()->exec(" - DROP TABLE file_urls - "); - DBManager::get()->exec(" - ALTER TABLE files - DROP COLUMN `storage` - "); - } - - - public function down() - { - DBManager::get()->exec(" - CREATE TABLE `file_urls` ( - `file_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `url` varchar(4096) COLLATE utf8mb4_unicode_ci NOT NULL, - `access_type` enum('proxy','redirect') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'proxy', - PRIMARY KEY (`file_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - ALTER TABLE files - DROP COLUMN `filetype`, - DROP COLUMN `metadata` - "); - } -} diff --git a/db/migrations/20200306_change_schedule_color_with_category_index.php b/db/migrations/20200306_change_schedule_color_with_category_index.php deleted file mode 100644 index 40a7f5c..0000000 --- a/db/migrations/20200306_change_schedule_color_with_category_index.php +++ /dev/null @@ -1,61 +0,0 @@ -exec("ALTER TABLE `schedule` CHANGE `color` `color` varchar(255) COMMENT 'category index'"); - DBManager::get()->exec("ALTER TABLE `schedule_seminare` CHANGE `color` `color` varchar(255) COMMENT 'category index'"); - - foreach ($PERS_TERMIN_KAT as $index => $cat) { - $query = "UPDATE `schedule` - SET `color` = :index - WHERE `color` = :color"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - - $query = "UPDATE `schedule_seminare` - SET `color` = :index - WHERE `color` = :color"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - } - } - - public function down() - { - global $PERS_TERMIN_KAT; - - DBManager::get()->exec("ALTER TABLE `schedule` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); - DBManager::get()->exec("ALTER TABLE `schedule_seminare` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); - - foreach ($PERS_TERMIN_KAT as $index => $cat) { - $query = "UPDATE `schedule` - SET `color` = :color - WHERE `color` = :index"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - - $query = "UPDATE `schedule_seminare` - SET `color` = :color - WHERE `color` = :index"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - } - } -} diff --git a/db/migrations/20200307_fixes_on_schedule_coloring.php b/db/migrations/20200307_fixes_on_schedule_coloring.php deleted file mode 100644 index 73c6883..0000000 --- a/db/migrations/20200307_fixes_on_schedule_coloring.php +++ /dev/null @@ -1,79 +0,0 @@ - $cat) { - $query = "UPDATE `schedule` - SET `color` = :index - WHERE `color` = :color"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - - $query = "UPDATE `schedule_seminare` - SET `color` = :index - WHERE `color` = :color"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - } - - $default = 1; - $indexes = array_keys($PERS_TERMIN_KAT); - - $query = "UPDATE `schedule` - SET `color` = :default - WHERE `color` NOT IN ( :indexes )"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':default', $default); - $st->bindValue(':indexes', $indexes); - $st->execute(); - - $query = "UPDATE `schedule_seminare` - SET `color` = :default - WHERE `color` NOT IN ( :indexes )"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':default', $default); - $st->bindValue(':indexes', $indexes); - $st->execute(); - - DBManager::get()->exec("ALTER TABLE `schedule` MODIFY `color` tinyint"); - DBManager::get()->exec("ALTER TABLE `schedule_seminare` MODIFY `color` tinyint"); - } - - public function down() - { - global $PERS_TERMIN_KAT; - - DBManager::get()->exec("ALTER TABLE `schedule` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); - DBManager::get()->exec("ALTER TABLE `schedule_seminare` CHANGE `color` `color` varchar(7) COMMENT 'color, rgb in hex'"); - - foreach ($PERS_TERMIN_KAT as $index => $cat) { - $query = "UPDATE `schedule` - SET `color` = :color - WHERE `color` = :index"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - - $query = "UPDATE `schedule_seminare` - SET `color` = :color - WHERE `color` = :index"; - $st = DBManager::get()->prepare($query); - $st->bindValue(':index', $index); - $st->bindValue(':color', $cat['color']); - $st->execute(); - } - } -} diff --git a/db/migrations/20200414_remove_new_widget_system.php b/db/migrations/20200414_remove_new_widget_system.php deleted file mode 100644 index b603cd7..0000000 --- a/db/migrations/20200414_remove_new_widget_system.php +++ /dev/null @@ -1,66 +0,0 @@ -exec('DROP TABLE widgets'); - $db->exec('DROP TABLE widget_containers'); - $db->exec('DROP TABLE widget_elements'); - } - - - public function down() - { - $db = DBManager::get(); - $db->exec( - "CREATE TABLE IF NOT EXISTS `widget_containers` ( - `container_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, - `range_type` ENUM('course','institute','user','plugin','other') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'course', - `scope` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'default', - `parent_id` INT(11) UNSIGNED NULL DEFAULT NULL, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`container_id`), - UNIQUE KEY `range` (`range_id`, `range_type`, `scope`), - KEY `parent_id` (`parent_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `widget_elements` ( - `element_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `container_id` INT(11) UNSIGNED NOT NULL, - `widget_id` INT(11) UNSIGNED NOT NULL, - `x` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `y` TINYINT(3) UNSIGNED NOT NULL, - `width` TINYINT(1) UNSIGNED NOT NULL, - `height` TINYINT(1) UNSIGNED NOT NULL, - `locked` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `removable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, - `options` VARCHAR(8192) NOT NULL DEFAULT '[]', - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`element_id`), - KEY `container_id` (`container_id`), - KEY `widget_id` (`widget_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $db->exec( - "CREATE TABLE IF NOT EXISTS `widgets` ( - `widget_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `class` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `filename` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, - `enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`widget_id`), - UNIQUE KEY `class` (`class`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - } -} diff --git a/db/migrations/20200423_replace_library_system.php b/db/migrations/20200423_replace_library_system.php deleted file mode 100644 index 2f672b6..0000000 --- a/db/migrations/20200423_replace_library_system.php +++ /dev/null @@ -1,144 +0,0 @@ -exec( - "INSERT IGNORE INTO config - ( - `field`, - `value`, - `type`, - `range`, - `section`, - `mkdate`, - `chdate`, - `description` - ) - VALUES - ( - 'LIBRARY_ADD_ITEM_ACTION_DESCRIPTION', - 'Sie können digitale Originaldokumente direkt aus der Bibliothek (ggf. Name) beziehen. Sie erhalten Materialien mit geklärten Rechten und in hochwertiger Qualität. Bei Bedarf kann die Bibliothek zur Bereitstellung eingebunden werden.', - 'string', - 'global', - 'Library', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'Der Beschreibungstext für die Aktion zum Hinzufügen eines Bibliothekseintrags in den Dateibereich.' - ), - ( - 'COURSE_LIBRARY_CITATION_STYLE', - '', - 'string', - 'course', - 'Library', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'Der standardmäßig genutzte Zitationsstil innerhalb der Veranstaltung.' - ), - ( - 'USER_LIBRARY_CITATION_STYLE', - '', - 'string', - 'user', - 'Library', - UNIX_TIMESTAMP(), - UNIX_TIMESTAMP(), - 'Der präferierte Zitationsstil einer Person.' - )" - ); - - $db->exec('DROP TABLE `lit_catalog`'); - $db->exec('DROP TABLE `lit_list`'); - $db->exec('DROP TABLE `lit_list_content`'); - } - - - public function down() - { - $db = DBManager::get(); - - $db->exec( - "DELETE FROM `config` WHERE `field` IN ( - 'LIBRARY_ADD_ITEM_ACTION_DESCRIPTION', - 'COURSE_LIBRARY_CITATION_STYLE', - 'USER_LIBRARY_CITATION_STYLE' - )" - ); - $db->exec( - "DELETE FROM `config_values` WHERE `field` IN ( - 'LIBRARY_ADD_ITEM_ACTION_DESCRIPTION', - 'COURSE_LIBRARY_CITATION_STYLE', - 'USER_LIBRARY_CITATION_STYLE' - )" - ); - - $db->exec( - "CREATE TABLE `lit_catalog` ( - `catalog_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `mkdate` int(11) NOT NULL DEFAULT '0', - `chdate` int(11) NOT NULL DEFAULT '0', - `lit_plugin` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Studip', - `accession_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `dc_creator` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `dc_subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_description` text COLLATE utf8mb4_unicode_ci, - `dc_publisher` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_contributor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_date` date DEFAULT NULL, - `dc_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_format` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_identifier` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_language` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dc_relation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_coverage` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `dc_rights` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`catalog_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC" - ); - - $db->exec( - "CREATE TABLE `lit_list` ( - `list_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `range_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `format` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `mkdate` int(11) NOT NULL DEFAULT '0', - `chdate` int(11) NOT NULL DEFAULT '0', - `priority` smallint(6) NOT NULL DEFAULT '0', - `visibility` tinyint(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`list_id`), - KEY `range_id` (`range_id`), - KEY `priority` (`priority`), - KEY `visibility` (`visibility`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;" - ); - - $db->exec( - "CREATE TABLE `lit_list_content` ( - `list_element_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `list_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `catalog_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `user_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `mkdate` int(11) NOT NULL DEFAULT '0', - `chdate` int(11) NOT NULL DEFAULT '0', - `note` text COLLATE utf8mb4_unicode_ci, - `priority` smallint(6) NOT NULL DEFAULT '0', - PRIMARY KEY (`list_element_id`), - KEY `list_id` (`list_id`), - KEY `catalog_id` (`catalog_id`), - KEY `priority` (`priority`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;" - ); - } -} diff --git a/db/migrations/20200514_tic9898_add_course_wizard_step.php b/db/migrations/20200514_tic9898_add_course_wizard_step.php deleted file mode 100644 index cf3e956..0000000 --- a/db/migrations/20200514_tic9898_add_course_wizard_step.php +++ /dev/null @@ -1,34 +0,0 @@ -exec( - "INSERT IGNORE INTO `coursewizardsteps` - (`id`, `name`, `classname`, `number`, `enabled`, `mkdate`, `chdate`) - VALUES - (MD5('StudyAreasLVGroupsCombinedWizardStep'), 'Studienbereich oder LV-Gruppe', 'StudyAreasLVGroupsCombinedWizardStep', '3', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())" - ); - } - - - public function down() - { - $db = DBManager::get(); - - $db->exec( - "DELETE FROM `StudyAreasLVGroupsCombinedWizardStep` - WHERE `id` = MD5('')" - ); - } - - - public function description() - { - return 'Adds a new course wizard step to assign at least a study area or a LV group.'; - } -} diff --git a/db/migrations/20200515_tic10318_http_proxy.php b/db/migrations/20200515_tic10318_http_proxy.php deleted file mode 100644 index 9f84f41..0000000 --- a/db/migrations/20200515_tic10318_http_proxy.php +++ /dev/null @@ -1,40 +0,0 @@ -prepare('INSERT IGNORE INTO config (field, value, type, `range`, section, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'HTTP_PROXY', - 'description' => 'externe http Anfragen über proxy', - 'range' => 'global', - 'type' => 'string', - 'value' => '', - 'section' => 'global' - ]); - $stmt->execute([ - 'name' => 'HTTP_PROXY_IGNORE', - 'description' => 'Kommaseparierte Liste mit Hostnamen, die nicht über Proxy aufgerufen werden sollen', - 'range' => 'global', - 'type' => 'string', - 'value' => '', - 'section' => 'global' - ]); - } - - public function down() - { - $db = DBManager::get(); - - $db->execute('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?', ['HTTP_PROXY']); - $db->execute('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?', ['HTTP_PROXY_IGNORE']); - } -} diff --git a/db/migrations/20200522_termsconfig.php b/db/migrations/20200522_termsconfig.php deleted file mode 100644 index a8b2ad2..0000000 --- a/db/migrations/20200522_termsconfig.php +++ /dev/null @@ -1,35 +0,0 @@ -prepare($query); - $statement->bindValue(':field', 'TERMS_CONFIG'); - $statement->bindValue(':value', json_encode(['compulsory' => false, 'denial_message' => ''])); - $statement->bindValue(':description', 'In case the terms are not compulsory, user can deny them.' . - 'if denial_message is not set, a default text is displayed.'); - $statement->execute(); - } - - public function down() - { - $query = "DELETE FROM `config` WHERE `field` = :field"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':field', 'TERMS_CONFIG'); - $statement->execute(); - } -} diff --git a/db/migrations/20200709_step345_wiki_ancestor.php b/db/migrations/20200709_step345_wiki_ancestor.php deleted file mode 100644 index 889e17f..0000000 --- a/db/migrations/20200709_step345_wiki_ancestor.php +++ /dev/null @@ -1,21 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `wiki` DROP COLUMN `ancestor`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20200713_add_admin_courses_sidebar_active_elements.php b/db/migrations/20200713_add_admin_courses_sidebar_active_elements.php deleted file mode 100644 index c58e47e..0000000 --- a/db/migrations/20200713_add_admin_courses_sidebar_active_elements.php +++ /dev/null @@ -1,36 +0,0 @@ -exec( - "INSERT IGNORE INTO `config` - (`field`, `value`, `type`, `range`, `description`) - VALUES - ( - 'ADMIN_COURSES_SIDEBAR_ACTIVE_ELEMENTS', - '', - 'string', - 'user', - 'Diese Einstellung legt fest, welche Elemente in der Seitenleiste der Veranstaltungsübersicht für Admins sichtbar sind.' - )" - ); - } - - - Public function down() - { - $c = DBManager::get(); - - $c->exec( - "DELETE FROM `config` WHERE `field` = 'ADMIN_COURSES_SIDEBAR_ACTIVE_ELEMENTS'" - ); - $c->exec( - "DELETE FROM `config_values` where `field` = 'ADMIN_COURSES_SIDEBAR_ACTIVE_ELEMENTS'" - ); - } -} diff --git a/db/migrations/20200811_adjust_i18n_tables.php b/db/migrations/20200811_adjust_i18n_tables.php deleted file mode 100644 index 488d617..0000000 --- a/db/migrations/20200811_adjust_i18n_tables.php +++ /dev/null @@ -1,21 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `i18n` - CHANGE COLUMN `table` `table` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, - CHANGE COLUMN `field` `field` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, - CHANGE COLUMN `lang` `lang` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20200909_mvv_bugs.php b/db/migrations/20200909_mvv_bugs.php deleted file mode 100644 index baf5ceb..0000000 --- a/db/migrations/20200909_mvv_bugs.php +++ /dev/null @@ -1,66 +0,0 @@ -exec($query); - - // Allow decimal credit point specifications - $query = "ALTER TABLE `mvv_modul` - MODIFY COLUMN `kp` DOUBLE(5,2) DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil` - MODIFY COLUMN `kp` DOUBLE(5,2) DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilabschnitt` - MODIFY COLUMN `kp` DOUBLE(5,2) DEFAULT NULL"; - DBManager::get()->exec($query); - - // Adjust config sections for mvv - $query = "UPDATE `config` - SET `section` = 'mvv' - WHERE `field` LIKE 'MVV%'"; - DBManager::get()->exec($query); - } - - public function down() - { - // Remove table mvv_extern_contacts - $query = "DROP TABLE IF EXISTS `mvv_extern_contacts`"; - DBManager::get()->exec($query); - - // Disallow decimal credit point specifications - $query = "ALTER TABLE `mvv_modul` - MODIFY COLUMN `kp` INT(11) DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil` - MODIFY COLUMN `kp` INT(11) DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilabschnitt` - MODIFY COLUMN `kp` INT(11) DEFAULT NULL"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20200910_remove_invalid_modul_user_assignments.php b/db/migrations/20200910_remove_invalid_modul_user_assignments.php deleted file mode 100644 index 26074cc..0000000 --- a/db/migrations/20200910_remove_invalid_modul_user_assignments.php +++ /dev/null @@ -1,22 +0,0 @@ -exec($query); - } -} diff --git a/db/migrations/20201002_biest_10803_fix.php b/db/migrations/20201002_biest_10803_fix.php deleted file mode 100755 index 0c25127..0000000 --- a/db/migrations/20201002_biest_10803_fix.php +++ /dev/null @@ -1,132 +0,0 @@ - - * @see https://develop.studip.de/trac/ticket/10803 - */ -class Biest10803Fix extends Migration -{ - public function description() - { - return 'This migration will cleanup mvv_modul_deskriptor and add ' - . 'a unique key on column modul_id'; - } - - public function up() - { - // Select neccessary modul ids - $query = "SELECT `modul_id` - FROM `mvv_modul_deskriptor` - GROUP BY `modul_id` - HAVING COUNT(*) > 1"; - $statement = DBManager::get()->query($query); - $modul_ids = $statement->fetchAll(PDO::FETCH_COLUMN); - - // Prepare statement that reads all deskriptor info - $query = "SELECT * - FROM `mvv_modul_deskriptor` - WHERE `modul_id` = :id - ORDER BY `chdate` ASC"; - $data_statement = DBManager::get()->prepare($query); - - // Prepare query that updates a module deskriptor - $query = "UPDATE `mvv_modul_deskriptor` - SET `verantwortlich` = :verantwortlich, - `bezeichnung` = :bezeichnung, - `voraussetzung` = :voraussetzung, - `kompetenzziele` = :kompetenzziele, - `inhalte` = :inhalte, - `literatur` = :literatur, - `links` = :links, - `kommentar` = :kommentar, - `turnus` = :turnus, - `kommentar_kapazitaet` = :kommentar_kapazitaet, - `kommentar_sws` = :kommentar_sws, - `kommentar_wl_selbst` = :kommentar_wl_selbst, - `kommentar_wl_pruef` = :kommentar_wl_pruef, - `kommentar_note` = :kommentar_note, - `pruef_vorleistung` = :pruef_vorleistung, - `pruef_leistung` = :pruef_leistung, - `pruef_wiederholung` = :pruef_wiederholung, - `ersatztext` = :ersatztext - WHERE `deskriptor_id` = :id"; - $update_statement = DBManager::get()->prepare($query); - - // Prepare statements that removes all unneccessary deskriptors - $query = "DELETE FROM `mvv_modul_deskriptor` - WHERE `deskriptor_id` IN (:ids)"; - $remove_statement = DBManager::get()->prepare($query); - - // For each module id, gather all info chronologically and combine - // them. This way, hopefully no valid information will be lost. - foreach ($modul_ids as $modul_id) { - $data_statement->bindValue(':id', $modul_id); - $data_statement->execute(); - $data_statement->setFetchMode(PDO::FETCH_ASSOC); - - $remove_desk_ids = []; - - $data = []; - foreach ($data_statement as $row) { - if (!$data) { - $data = $row; - continue; - } - - foreach ($row as $key => $value) { - if (in_array($key, ['deskriptor_id', 'mkdate', 'chdate'])) { - continue; - } - if ($value || $row['author_id'] || $row['editor_id']) { - $data[$key] = $value; - } - } - - $remove_desk_ids[] = $row['deskriptor_id']; - } - - $update_statement->bindValue(':verantwortlich', $data['verantwortlich']); - $update_statement->bindValue(':bezeichnung', $data['bezeichnung']); - $update_statement->bindValue(':voraussetzung', $data['voraussetzung']); - $update_statement->bindValue(':kompetenzziele', $data['kompetenzziele']); - $update_statement->bindValue(':inhalte', $data['inhalte']); - $update_statement->bindValue(':literatur', $data['literatur']); - $update_statement->bindValue(':links', $data['links']); - $update_statement->bindValue(':kommentar', $data['kommentar']); - $update_statement->bindValue(':turnus', $data['turnus']); - $update_statement->bindValue(':kommentar_kapazitaet', $data['kommentar_kapazitaet']); - $update_statement->bindValue(':kommentar_sws', $data['kommentar_sws']); - $update_statement->bindValue(':kommentar_wl_selbst', $data['kommentar_wl_selbst']); - $update_statement->bindValue(':kommentar_wl_pruef', $data['kommentar_wl_pruef']); - $update_statement->bindValue(':kommentar_note', $data['kommentar_note']); - $update_statement->bindValue(':pruef_vorleistung', $data['pruef_vorleistung']); - $update_statement->bindValue(':pruef_leistung', $data['pruef_leistung']); - $update_statement->bindValue(':pruef_wiederholung', $data['pruef_wiederholung']); - $update_statement->bindValue(':ersatztext', $data['ersatztext']); - $update_statement->bindValue(':id', $data['deskriptor_id']); - $update_statement->execute(); - - if ($remove_desk_ids) { - $remove_statement->bindValue(':ids', $remove_desk_ids); - $remove_statement->execute(); - } - } - - // Add unique key on column modul_id - $query = "ALTER TABLE `mvv_modul_deskriptor` - DROP KEY `modul_id`, - ADD UNIQUE KEY `modul_id` (`modul_id`)"; - DBManager::get()->exec($query); - } - - public function down() - { - // Drop unique key on column modul_id - $query = "ALTER TABLE `mvv_modul_deskriptor` - DROP KEY `modul_id`, - ADD KEY `modul_id` (`modul_id`)"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201005_database_changes_tic_9218.php b/db/migrations/20201005_database_changes_tic_9218.php deleted file mode 100644 index cdab698..0000000 --- a/db/migrations/20201005_database_changes_tic_9218.php +++ /dev/null @@ -1,3112 +0,0 @@ -exec($query); - - $query = "ALTER TABLE `activities` - CHANGE COLUMN `context_id` `context_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionfactor` - CHANGE COLUMN `list_id` `list_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `owner_id` `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionrules` - CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionrule_compat` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionrule_inst` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institute_id` `institute_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admission_condition` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `filter_id` `filter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admission_conditiongroup` - CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admission_seminar_user` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `mkdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `archiv` - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `heimat_inst_id` `heimat_inst_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `archiv_file_id` `archiv_file_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `archiv_protected_file_id` `archiv_protected_file_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `archiv_user` - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `auth_extern` - CHANGE COLUMN `studip_user_id` `studip_user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `auth_user_md5` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `auto_insert_user` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `aux_lock_rules` - CHANGE COLUMN `lock_id` `lock_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `banner_ads` - CHANGE COLUMN `ad_id` `ad_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `startdate` `startdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `enddate` `enddate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `priority` `priority` INT(11) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `views` `views` INT(11) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `clicks` `clicks` INT(11) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_comments` - CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_events_queue` - CHANGE COLUMN `item_id` `item_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_external_contact` - CHANGE COLUMN `external_contact_id` `external_contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_follower` - CHANGE COLUMN `studip_user_id` `studip_user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `external_contact_id` `external_contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `left_follows_right` `left_follows_right` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_mentions` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_tags` - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_threads` - CHANGE COLUMN `context_id` `context_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `visible_in_stream` `visible_in_stream` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `commentable` `commentable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - try { - $query = "ALTER TABLE `blubber_threads_unfollow` - CHANGE COLUMN `thread_id` `thread_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - } catch (Exception $e) { - $query = "ALTER TABLE `blubber_threads_followstates` - CHANGE COLUMN `thread_id` `thread_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - } - - $query = "ALTER TABLE `calendar_event` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `event_id` `event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `group_status` `group_status` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `calendar_user` - CHANGE COLUMN `owner_id` `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `comments` - CHANGE COLUMN `comment_id` `comment_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `conditionaladmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `conditions_stopped` `conditions_stopped` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `config` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `config_values` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `contact` - CHANGE COLUMN `owner_id` `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `content_terms_of_use_entries` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `is_default` `is_default` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `coursememberadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `coursesets` - CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `algorithm_run` `algorithm_run` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `private` `private` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `courseset_factorlist` - CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `factorlist_id` `factorlist_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `courseset_institute` - CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institute_id` `institute_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `courseset_rule` - CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `coursewizardsteps` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `enabled` `enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `cronjobs_schedules` - CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `cronjobs_tasks` - CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `datafields` - CHANGE COLUMN `datafield_id` `datafield_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `is_required` `is_required` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `is_userfilter` `is_userfilter` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `datafields_entries` - CHANGE COLUMN `datafield_id` `datafield_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `sec_range_id` `sec_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `deputies` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `edit_about` `edit_about` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_assignments` - CHANGE COLUMN `start` `start` INT(11) UNSIGNED NULL, - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NULL, - CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_assignment_attempts` - CHANGE COLUMN `start` `start` INT(11) UNSIGNED NULL, - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_assignment_ranges` - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_responses` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_tasks` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_tests` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_test_tasks` - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval` - CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `startdate` `startdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `stopdate` `stopdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `timespan` `timespan` INT(11) UNSIGNED NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `shared` `shared` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalanswer` - CHANGE COLUMN `evalanswer_id` `evalanswer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `rows` `rows` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `counter` `counter` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `residual` `residual` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalanswer_user` - CHANGE COLUMN `evalanswer_id` `evalanswer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `evaldate` `evaldate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalgroup` - CHANGE COLUMN `evalgroup_id` `evalgroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mandatory` `mandatory` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalquestion` - CHANGE COLUMN `evalquestion_id` `evalquestion_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `multiplechoice` `multiplechoice` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_group_template` - CHANGE COLUMN `evalgroup_id` `evalgroup_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_range` - CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_templates` - CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `institution_id` `institution_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `show_questions` `show_questions` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `show_total_stats` `show_total_stats` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `show_graphics` `show_graphics` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `show_questionblock_headline` `show_questionblock_headline` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `show_group_headline` `show_group_headline` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_templates_eval` - CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_templates_user` - CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `template_id` `template_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_user` - CHANGE COLUMN `eval_id` `eval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `event_data` - CHANGE COLUMN `event_id` `event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `start` `start` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `ts` `ts` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `expire` `expire` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `importdate` `importdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `extern_config` - CHANGE COLUMN `config_id` `config_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `is_standard` `is_standard` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `ex_termine` - CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `autor_id` `autor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `date` `date` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `fach` - CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `feedback` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `results_visible` `results_visible` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `commentable` `commentable` TINYINT(1) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `feedback_entries` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `files` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `files_search_attributes` - CHANGE COLUMN `file_ref_mkdate` `file_ref_mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `file_ref_chdate` `file_ref_chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `semester_start` `semester_start` INT(11) UNSIGNED NULL, - CHANGE COLUMN `semester_end` `semester_end` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `files_search_index` - CHANGE COLUMN `file_ref_id` `file_ref_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `file_refs` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `file_id` `file_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `folder_id` `folder_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `content_terms_of_use_id` `content_terms_of_use_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `folders` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_abo_users` - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_categories` - CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_categories_entries` - CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_entries` - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `latest_chdate` `latest_chdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `closed` `closed` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `sticky` `sticky` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_entries_issues` - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `issue_id` `issue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_favorites` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_likes` - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_visits` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `visitdate` `visitdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `last_visitdate` `last_visitdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `globalsearch_buzzwords` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `global_resource_locks` - CHANGE COLUMN `lock_id` `lock_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `grading_definitions` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `grading_instances` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_content` - CHANGE COLUMN `global_content_id` `global_content_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `custom` `custom` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tours` - CHANGE COLUMN `global_tour_id` `global_tour_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_audiences` - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_settings` - CHANGE COLUMN `tour_id` `tour_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_steps` - CHANGE COLUMN `interactive` `interactive` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_user` - CHANGE COLUMN `tour_id` `tour_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `completed` `completed` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `i18n` - CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `Institute` - CHANGE COLUMN `Institut_id` `Institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `fakultaets_id` `fakultaets_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `srienabled` `srienabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `institute_plan_columns` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `kategorien` - CHANGE COLUMN `kategorie_id` `kategorie_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `limitedadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lockedadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lock_rules` - CHANGE COLUMN `lock_id` `lock_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `loginbackgrounds` - CHANGE COLUMN `mobile` `mobile` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `desktop` `desktop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `in_release` `in_release` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `log_actions` - CHANGE COLUMN `action_id` `action_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `expires` `expires` INT(11) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `log_events` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `action_id` `action_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `affected_range_id` `affected_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `coaffected_range_id` `coaffected_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lti_data` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lti_grade` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lti_tool` - CHANGE COLUMN `allow_custom_url` `allow_custom_url` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `deep_linking` `deep_linking` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `send_lis_person` `send_lis_person` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mail_queue_entries` - CHANGE COLUMN `mail_queue_id` `mail_queue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `message_id` `message_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `tries` `tries` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `last_try` `last_try` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `media_cache` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `message` - CHANGE COLUMN `message_id` `message_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `autor_id` `autor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `show_adressees` `show_adressees` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `message_tags` - CHANGE COLUMN `message_id` `message_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `message_user` - CHANGE COLUMN `readed` `readed` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `deleted` `deleted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `answered` `answered` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_abschl_kategorie` - CHANGE COLUMN `kategorie_id` `kategorie_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_abschl_zuord` - CHANGE COLUMN `abschluss_id` `abschluss_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `kategorie_id` `kategorie_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_aufbaustudiengang` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_contacts` - CHANGE COLUMN `contact_id` `contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_contacts_ranges` - CHANGE COLUMN `contact_range_id` `contact_range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `contact_id` `contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_extern_contacts` - CHANGE COLUMN `extern_contact_id` `extern_contact_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_fach_inst` - CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_files` - CHANGE COLUMN `mvvfile_id` `mvvfile_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `extern_visible` `extern_visible` TINYINT(1) UNSIGNED NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_files_filerefs` - CHANGE COLUMN `mvvfile_id` `mvvfile_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `fileref_id` `fileref_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_files_ranges` - CHANGE COLUMN `mvvfile_id` `mvvfile_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_lvgruppe` - CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_lvgruppe_modulteil` - CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `fn_id` `fn_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_lvgruppe_seminar` - CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul` - CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) UNSIGNED NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil` - CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `ausgleichbar` `ausgleichbar` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `pflicht` `pflicht` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil_deskriptor` - CHANGE COLUMN `deskriptor_id` `deskriptor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil_language` - CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil_stgteilabschnitt` - CHANGE COLUMN `modulteil_id` `modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `abschnitt_id` `abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul_deskriptor` - CHANGE COLUMN `deskriptor_id` `deskriptor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul_inst` - CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul_language` - CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_ovl_conflicts` - CHANGE COLUMN `base_abschnitt_id` `base_abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_modulteil_id` `base_modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_course_id` `base_course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_metadate_id` `base_metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_abschnitt_id` `comp_abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_modulteil_id` `comp_modulteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_course_id` `comp_course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_metadate_id` `comp_metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_ovl_excludes` - CHANGE COLUMN `selection_id` `selection_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_ovl_selections` - CHANGE COLUMN `selection_id` `selection_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `semester_id` `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_version_id` `base_version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_version_id` `comp_version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `show_excluded` `show_excluded` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteil` - CHANGE COLUMN `stgteil_id` `stgteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilabschnitt` - CHANGE COLUMN `abschnitt_id` `abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `version_id` `version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilabschnitt_modul` - CHANGE COLUMN `abschnitt_modul_id` `abschnitt_modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `abschnitt_id` `abschnitt_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modul_id` `modul_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilversion` - CHANGE COLUMN `version_id` `version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `stgteil_id` `stgteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_sem` `start_sem` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `end_sem` `end_sem` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) UNSIGNED NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteil_bez` - CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stg_stgteil` - CHANGE COLUMN `studiengang_id` `studiengang_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `stgteil_id` `stgteil_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_studiengang` - CHANGE COLUMN `studiengang_id` `studiengang_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `abschluss_id` `abschluss_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `start` `start` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `end` `end` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) UNSIGNED NULL, - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_studycourse_language` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_studycourse_type` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `news` - CHANGE COLUMN `news_id` `news_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `date` `date` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `expire` `expire` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `allow_comments` `allow_comments` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate_uid` `chdate_uid` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `news_range` - CHANGE COLUMN `news_id` `news_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `object_contentmodules` - CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `object_user_visits` - CHANGE COLUMN `visitdate` `visitdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `last_visitdate` `last_visitdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `object_views` - CHANGE COLUMN `object_id` `object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `views` `views` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `opengraphdata` - CHANGE COLUMN `is_opengraph` `is_opengraph` TINYINT(1) UNSIGNED NULL, - CHANGE COLUMN `last_update` `last_update` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `participantrestrictedadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `distribution_time` `distribution_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `passwordadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `personal_notifications_user` - CHANGE COLUMN `seen` `seen` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `plugins_activated` - CHANGE COLUMN `state` `state` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `plugins_default_activations` - CHANGE COLUMN `institutid` `institutid` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `prefadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `favor_semester` `favor_semester` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `prefadmission_condition` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `condition_id` `condition_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `priorities` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaires` - CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `startdate` `startdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `stopdate` `stopdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `editanswers` `editanswers` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `copyable` `copyable` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_anonymous_answers` - CHANGE COLUMN `anonymous_answer_id` `anonymous_answer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_answers` - CHANGE COLUMN `answer_id` `answer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `question_id` `question_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_assignments` - CHANGE COLUMN `assignment_id` `assignment_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_questions` - CHANGE COLUMN `question_id` `question_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `questionnaire_id` `questionnaire_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `range_tree` - CHANGE COLUMN `item_id` `item_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `studip_object_id` `studip_object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resources` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_bookings` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `repeat_end` `repeat_end` INT(11) UNSIGNED NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `booking_user_id` `booking_user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_booking_intervals` - CHANGE COLUMN `interval_id` `interval_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `booking_id` `booking_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_categories` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_category_properties` - CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_permissions` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_properties` - CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_property_definitions` - CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_property_groups` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_requests` - CHANGE COLUMN `id` `id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `course_id` `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `last_modified_by` `last_modified_by` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `category_id` `category_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_request_appointments` - CHANGE COLUMN `request_id` `request_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `appointment_id` `appointment_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_request_properties` - CHANGE COLUMN `request_id` `request_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `property_id` `property_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_temporary_permissions` - CHANGE COLUMN `resource_id` `resource_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `schedule` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `schedule_seminare` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `scm` - CHANGE COLUMN `scm_id` `scm_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `semester_data` - CHANGE COLUMN `semester_id` `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `beginn` `beginn` INT(11) UNSIGNED NULL, - CHANGE COLUMN `ende` `ende` INT(11) UNSIGNED NULL, - CHANGE COLUMN `vorles_beginn` `vorles_beginn` INT(11) UNSIGNED NULL, - CHANGE COLUMN `vorles_ende` `vorles_ende` INT(11) UNSIGNED NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `semester_holiday` - CHANGE COLUMN `holiday_id` `holiday_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `semester_id` `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `beginn` `beginn` INT(11) UNSIGNED NULL, - CHANGE COLUMN `ende` `ende` INT(11) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminare` - CHANGE COLUMN `Seminar_id` `Seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `Institut_id` `Institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `status` `status` INT(11) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NULL DEFAULT '0', - CHANGE COLUMN `duration_time` `duration_time` INT(11) NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `parent_course` `parent_course` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_courseset` - CHANGE COLUMN `set_id` `set_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_cycle_dates` - CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_inst` - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `institut_id` `institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_sem_tree` - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `sem_tree_id` `sem_tree_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_user` - CHANGE COLUMN `Seminar_id` `Seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `bind_calendar` `bind_calendar` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_userdomains` - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `userdomain_id` `userdomain_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `sem_classes` - CHANGE COLUMN `only_inst_user` `only_inst_user` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `bereiche` `bereiche` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `module` `module` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `show_browse` `show_browse` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `write_access_nobody` `write_access_nobody` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `topic_create_autor` `topic_create_autor` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `course_creation_forbidden` `course_creation_forbidden` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `studygroup_mode` `studygroup_mode` TINYINT(1) UNSIGNED NOT NULL, - CHANGE COLUMN `show_raumzeit` `show_raumzeit` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `is_group` `is_group` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `sem_tree` - CHANGE COLUMN `sem_tree_id` `sem_tree_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `studip_object_id` `studip_object_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `sem_types` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `separable_rooms` - CHANGE COLUMN `building_id` `building_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `separable_room_parts` - CHANGE COLUMN `room_id` `room_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `smiley` - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `statusgruppen` - CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `selfassign` `selfassign` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `selfassign_start` `selfassign_start` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `selfassign_end` `selfassign_end` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `statusgruppe_user` - CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `inherit` `inherit` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `studygroup_invitations` - CHANGE COLUMN `sem_id` `sem_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `termine` - CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `autor_id` `autor_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `date` `date` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `topic_id` `topic_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `metadate_id` `metadate_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `termin_related_groups` - CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `termin_related_persons` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `themen` - CHANGE COLUMN `issue_id` `issue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `seminar_id` `seminar_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `themen_termine` - CHANGE COLUMN `issue_id` `issue_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `termin_id` `termin_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `timedadmissions` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userdomains` - CHANGE COLUMN `userdomain_id` `userdomain_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `restricted_access` `restricted_access` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userfilter` - CHANGE COLUMN `filter_id` `filter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userfilter_fields` - CHANGE COLUMN `field_id` `field_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `filter_id` `filter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userlimits` - CHANGE COLUMN `rule_id` `rule_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_factorlist` - CHANGE COLUMN `list_id` `list_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_info` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `smsforward_copy` `smsforward_copy` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `smsforward_rec` `smsforward_rec` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `email_forward` `email_forward` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_inst` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `Institut_id` `Institut_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `externdefault` `externdefault` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `visible` `visible` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_online` - CHANGE COLUMN `last_lifesign` `last_lifesign` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_studiengang` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `fach_id` `fach_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `version_id` `version_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_token` - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_userdomains` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `userdomain_id` `userdomain_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_visibility` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `online` `online` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `search` `search` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `email` `email` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `mkdate` `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_visibility_settings` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `webservice_access_rules` - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `widget_user` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `wiki` - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NULL, - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `wiki_locks` - CHANGE COLUMN `user_id` `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `chdate` `chdate` INT(11) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `wiki_page_config` - CHANGE COLUMN `read_restricted` `read_restricted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `edit_restricted` `edit_restricted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - ADD COLUMN `mkdate` INT(11) UNSIGNED NULL DEFAULT NULL, - ADD COLUMN `chdate` INT(11) UNSIGNED NULL DEFAULT NULL"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "ALTER TABLE `abschluss` - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NULL, - CHANGE COLUMN `chdate` `chdate` INT(20) NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `activities` - CHANGE COLUMN `context_id` `context_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionfactor` - CHANGE COLUMN `list_id` `list_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `owner_id` `owner_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionrules` - CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionrule_compat` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admissionrule_inst` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institute_id` `institute_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admission_condition` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `filter_id` `filter_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admission_conditiongroup` - CHANGE COLUMN `conditiongroup_id` `conditiongroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `admission_seminar_user` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `archiv` - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `start_time` `start_time` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `heimat_inst_id` `heimat_inst_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `archiv_file_id` `archiv_file_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `archiv_protected_file_id` `archiv_protected_file_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `archiv_user` - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `auth_extern` - CHANGE COLUMN `studip_user_id` `studip_user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `auth_user_md5` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `auto_insert_user` - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `aux_lock_rules` - CHANGE COLUMN `lock_id` `lock_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `banner_ads` - CHANGE COLUMN `ad_id` `ad_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `startdate` `startdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `enddate` `enddate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `priority` `priority` INT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `views` `views` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `clicks` `clicks` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_comments` - CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_events_queue` - CHANGE COLUMN `item_id` `item_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_external_contact` - CHANGE COLUMN `external_contact_id` `external_contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_follower` - CHANGE COLUMN `studip_user_id` `studip_user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `external_contact_id` `external_contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `left_follows_right` `left_follows_right` TINYINT(1) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_mentions` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `external_contact` `external_contact` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_tags` - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_threads` - CHANGE COLUMN `context_id` `context_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `external_contact` `external_contact` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `visible_in_stream` `visible_in_stream` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `commentable` `commentable` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `chdate` `chdate` INT(11) NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; - DBManager::get()->exec($query); - - try { - $query = "ALTER TABLE `blubber_threads_unfollow` - CHANGE COLUMN `thread_id` `thread_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; - DBManager::get()->exec($query); - } catch (Exception $e) { - $query = "ALTER TABLE `blubber_threads_followstates` - CHANGE COLUMN `thread_id` `thread_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; - DBManager::get()->exec($query); - } - - $query = "ALTER TABLE `calendar_event` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `event_id` `event_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `group_status` `group_status` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `calendar_user` - CHANGE COLUMN `owner_id` `owner_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `comments` - CHANGE COLUMN `comment_id` `comment_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `conditionaladmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `conditions_stopped` `conditions_stopped` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `config` - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `config_values` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `contact` - CHANGE COLUMN `owner_id` `owner_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - DROP COLUMN `mkdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `content_terms_of_use_entries` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `is_default` `is_default` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `coursememberadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `coursesets` - CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `algorithm_run` `algorithm_run` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `private` `private` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `courseset_factorlist` - CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `factorlist_id` `factorlist_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `courseset_institute` - CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institute_id` `institute_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `courseset_rule` - CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `coursewizardsteps` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `enabled` `enabled` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `cronjobs_schedules` - CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `cronjobs_tasks` - CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `datafields` - CHANGE COLUMN `datafield_id` `datafield_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL, - CHANGE COLUMN `is_required` `is_required` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `is_userfilter` `is_userfilter` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `datafields_entries` - CHANGE COLUMN `datafield_id` `datafield_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL, - CHANGE COLUMN `sec_range_id` `sec_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `deputies` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `edit_about` `edit_about` TINYINT(1) NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_assignments` - CHANGE COLUMN `start` `start` INT(11) NULL, - CHANGE COLUMN `end` `end` INT(11) NULL, - CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_assignment_attempts` - CHANGE COLUMN `start` `start` INT(11) NULL, - CHANGE COLUMN `end` `end` INT(11) NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_assignment_ranges` - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_responses` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_tasks` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_tests` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `etask_test_tasks` - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval` - CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `startdate` `startdate` INT(20) NULL, - CHANGE COLUMN `stopdate` `stopdate` INT(20) NULL, - CHANGE COLUMN `timespan` `timespan` INT(20) NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `shared` `shared` TINYINT(1) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalanswer` - CHANGE COLUMN `evalanswer_id` `evalanswer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `rows` `rows` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `counter` `counter` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `residual` `residual` TINYINT(1) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalanswer_user` - CHANGE COLUMN `evalanswer_id` `evalanswer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `evaldate` `evaldate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalgroup` - CHANGE COLUMN `evalgroup_id` `evalgroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mandatory` `mandatory` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `evalquestion` - CHANGE COLUMN `evalquestion_id` `evalquestion_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `multiplechoice` `multiplechoice` TINYINT(1) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_group_template` - CHANGE COLUMN `evalgroup_id` `evalgroup_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_range` - CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_templates` - CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `institution_id` `institution_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `show_questions` `show_questions` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `show_total_stats` `show_total_stats` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `show_graphics` `show_graphics` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `show_questionblock_headline` `show_questionblock_headline` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `show_group_headline` `show_group_headline` TINYINT(1) NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_templates_eval` - CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_templates_user` - CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `template_id` `template_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `eval_user` - CHANGE COLUMN `eval_id` `eval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `event_data` - CHANGE COLUMN `event_id` `event_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `start` `start` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `ts` `ts` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `expire` `expire` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `importdate` `importdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `extern_config` - CHANGE COLUMN `config_id` `config_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `is_standard` `is_standard` INT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `ex_termine` - CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `autor_id` `autor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `date` `date` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `fach` - CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `feedback` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `results_visible` `results_visible` TINYINT(4) UNSIGNED NOT NULL, - CHANGE COLUMN `commentable` `commentable` TINYINT(4) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `feedback_entries` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `files` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `files_search_attributes` - CHANGE COLUMN `file_ref_mkdate` `file_ref_mkdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `file_ref_chdate` `file_ref_chdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `semester_start` `semester_start` INT(20) UNSIGNED NULL, - CHANGE COLUMN `semester_end` `semester_end` INT(20) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `files_search_index` - CHANGE COLUMN `file_ref_id` `file_ref_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `file_refs` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `file_id` `file_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `folder_id` `folder_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `content_terms_of_use_id` `content_terms_of_use_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `folders` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_abo_users` - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_categories` - CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_categories_entries` - CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_entries` - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL, - CHANGE COLUMN `latest_chdate` `latest_chdate` INT(11) NULL, - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL, - CHANGE COLUMN `closed` `closed` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `sticky` `sticky` INT(1) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_entries_issues` - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `issue_id` `issue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_favorites` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_likes` - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `forum_visits` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `visitdate` `visitdate` INT(11) NOT NULL, - CHANGE COLUMN `last_visitdate` `last_visitdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `globalsearch_buzzwords` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `global_resource_locks` - CHANGE COLUMN `lock_id` `lock_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `begin` `begin` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(11) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `grading_definitions` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `grading_instances` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_content` - CHANGE COLUMN `global_content_id` `global_content_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `custom` `custom` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `visible` `visible` TINYINT(4) NOT NULL DEFAULT '1', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tours` - CHANGE COLUMN `global_tour_id` `global_tour_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_audiences` - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_settings` - CHANGE COLUMN `tour_id` `tour_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `active` `active` TINYINT(4) NOT NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_steps` - CHANGE COLUMN `interactive` `interactive` TINYINT(4) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `help_tour_user` - CHANGE COLUMN `tour_id` `tour_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `completed` `completed` TINYINT(4) NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `i18n` - CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `Institute` - CHANGE COLUMN `Institut_id` `Institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `fakultaets_id` `fakultaets_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `srienabled` `srienabled` TINYINT(4) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `institute_plan_columns` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `kategorien` - CHANGE COLUMN `kategorie_id` `kategorie_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `limitedadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lockedadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lock_rules` - CHANGE COLUMN `lock_id` `lock_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `loginbackgrounds` - CHANGE COLUMN `mobile` `mobile` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `desktop` `desktop` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `in_release` `in_release` TINYINT(1) NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `log_actions` - CHANGE COLUMN `action_id` `action_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `active` `active` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `expires` `expires` INT(20) NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `log_events` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `action_id` `action_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `affected_range_id` `affected_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `coaffected_range_id` `coaffected_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lti_data` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lti_grade` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `lti_tool` - CHANGE COLUMN `allow_custom_url` `allow_custom_url` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `deep_linking` `deep_linking` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `send_lis_person` `send_lis_person` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mail_queue_entries` - CHANGE COLUMN `mail_queue_id` `mail_queue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `message_id` `message_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `tries` `tries` INT(11) NOT NULL, - CHANGE COLUMN `last_try` `last_try` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `media_cache` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `message` - CHANGE COLUMN `message_id` `message_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `autor_id` `autor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `show_adressees` `show_adressees` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `message_tags` - CHANGE COLUMN `message_id` `message_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `message_user` - CHANGE COLUMN `readed` `readed` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `deleted` `deleted` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `answered` `answered` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_abschl_kategorie` - CHANGE COLUMN `kategorie_id` `kategorie_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_abschl_zuord` - CHANGE COLUMN `abschluss_id` `abschluss_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `kategorie_id` `kategorie_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_aufbaustudiengang` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_contacts` - CHANGE COLUMN `contact_id` `contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_contacts_ranges` - CHANGE COLUMN `contact_range_id` `contact_range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `contact_id` `contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_extern_contacts` - CHANGE COLUMN `extern_contact_id` `extern_contact_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_fach_inst` - CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_files` - CHANGE COLUMN `mvvfile_id` `mvvfile_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `extern_visible` `extern_visible` TINYINT(1) NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_files_filerefs` - CHANGE COLUMN `mvvfile_id` `mvvfile_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `fileref_id` `fileref_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_files_ranges` - CHANGE COLUMN `mvvfile_id` `mvvfile_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_lvgruppe` - CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_lvgruppe_modulteil` - CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `fn_id` `fn_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_lvgruppe_seminar` - CHANGE COLUMN `lvgruppe_id` `lvgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul` - CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil` - CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `ausgleichbar` `ausgleichbar` INT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `pflicht` `pflicht` INT(2) NOT NULL DEFAULT '0', - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil_deskriptor` - CHANGE COLUMN `deskriptor_id` `deskriptor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil_language` - CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modulteil_stgteilabschnitt` - CHANGE COLUMN `modulteil_id` `modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `abschnitt_id` `abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul_deskriptor` - CHANGE COLUMN `deskriptor_id` `deskriptor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul_inst` - CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_modul_language` - CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_ovl_conflicts` - CHANGE COLUMN `base_abschnitt_id` `base_abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_modulteil_id` `base_modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_course_id` `base_course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_metadate_id` `base_metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_abschnitt_id` `comp_abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_modulteil_id` `comp_modulteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_course_id` `comp_course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_metadate_id` `comp_metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_ovl_excludes` - CHANGE COLUMN `selection_id` `selection_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_ovl_selections` - CHANGE COLUMN `selection_id` `selection_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `semester_id` `semester_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `base_version_id` `base_version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `comp_version_id` `comp_version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `show_excluded` `show_excluded` INT(1) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteil` - CHANGE COLUMN `stgteil_id` `stgteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilabschnitt` - CHANGE COLUMN `abschnitt_id` `abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `version_id` `version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilabschnitt_modul` - CHANGE COLUMN `abschnitt_modul_id` `abschnitt_modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `abschnitt_id` `abschnitt_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `modul_id` `modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteilversion` - CHANGE COLUMN `version_id` `version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `stgteil_id` `stgteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_sem` `start_sem` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `end_sem` `end_sem` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stgteil_bez` - CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_stg_stgteil` - CHANGE COLUMN `studiengang_id` `studiengang_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `stgteil_id` `stgteil_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `stgteil_bez_id` `stgteil_bez_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_studiengang` - CHANGE COLUMN `studiengang_id` `studiengang_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `abschluss_id` `abschluss_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `start` `start` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `end` `end` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `beschlussdatum` `beschlussdatum` INT(11) NULL, - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `editor_id` `editor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_studycourse_language` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `mvv_studycourse_type` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `news` - CHANGE COLUMN `news_id` `news_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `date` `date` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `expire` `expire` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `allow_comments` `allow_comments` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate_uid` `chdate_uid` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `news_range` - CHANGE COLUMN `news_id` `news_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `object_contentmodules` - CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `object_user_visits` - CHANGE COLUMN `visitdate` `visitdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `last_visitdate` `last_visitdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `object_views` - CHANGE COLUMN `object_id` `object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `views` `views` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `opengraphdata` - CHANGE COLUMN `is_opengraph` `is_opengraph` TINYINT(2) NULL, - CHANGE COLUMN `last_update` `last_update` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `participantrestrictedadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `distribution_time` `distribution_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `passwordadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `personal_notifications_user` - CHANGE COLUMN `seen` `seen` TINYINT(1) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `plugins_activated` - CHANGE COLUMN `state` `state` TINYINT(1) NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `plugins_default_activations` - CHANGE COLUMN `institutid` `institutid` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `prefadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `favor_semester` `favor_semester` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `prefadmission_condition` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `condition_id` `condition_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `priorities` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaires` - CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `startdate` `startdate` BIGINT(20) NULL, - CHANGE COLUMN `stopdate` `stopdate` BIGINT(20) NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `anonymous` `anonymous` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `editanswers` `editanswers` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `copyable` `copyable` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_anonymous_answers` - CHANGE COLUMN `anonymous_answer_id` `anonymous_answer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_answers` - CHANGE COLUMN `answer_id` `answer_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `question_id` `question_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_assignments` - CHANGE COLUMN `assignment_id` `assignment_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `questionnaire_questions` - CHANGE COLUMN `question_id` `question_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `questionnaire_id` `questionnaire_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `range_tree` - CHANGE COLUMN `item_id` `item_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `studip_object_id` `studip_object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resources` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_bookings` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `begin` `begin` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `repeat_end` `repeat_end` INT(20) NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `booking_user_id` `booking_user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_booking_intervals` - CHANGE COLUMN `interval_id` `interval_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `booking_id` `booking_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `begin` `begin` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `end` `end` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_categories` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_category_properties` - CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_permissions` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_properties` - CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_property_definitions` - CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_property_groups` - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_requests` - CHANGE COLUMN `id` `id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `course_id` `course_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `last_modified_by` `last_modified_by` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `category_id` `category_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_request_appointments` - CHANGE COLUMN `request_id` `request_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `appointment_id` `appointment_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_request_properties` - CHANGE COLUMN `request_id` `request_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `property_id` `property_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(20) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_temporary_permissions` - CHANGE COLUMN `resource_id` `resource_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `schedule` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `schedule_seminare` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `visible` `visible` TINYINT(1) NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `scm` - CHANGE COLUMN `scm_id` `scm_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `semester_data` - CHANGE COLUMN `semester_id` `semester_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `beginn` `beginn` INT(20) UNSIGNED NULL, - CHANGE COLUMN `ende` `ende` INT(20) UNSIGNED NULL, - CHANGE COLUMN `vorles_beginn` `vorles_beginn` INT(20) UNSIGNED NULL, - CHANGE COLUMN `vorles_ende` `vorles_ende` INT(20) UNSIGNED NULL, - CHANGE COLUMN `visible` `visible` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `semester_holiday` - CHANGE COLUMN `holiday_id` `holiday_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `semester_id` `semester_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `beginn` `beginn` INT(20) UNSIGNED NULL, - CHANGE COLUMN `ende` `ende` INT(20) UNSIGNED NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminare` - CHANGE COLUMN `Seminar_id` `Seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `Institut_id` `Institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `status` `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `start_time` `start_time` INT(20) NULL DEFAULT '0', - CHANGE COLUMN `duration_time` `duration_time` INT(20) NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `visible` `visible` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1', - CHANGE COLUMN `parent_course` `parent_course` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_courseset` - CHANGE COLUMN `set_id` `set_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_cycle_dates` - CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_inst` - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `institut_id` `institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_sem_tree` - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `sem_tree_id` `sem_tree_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_user` - CHANGE COLUMN `Seminar_id` `Seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `bind_calendar` `bind_calendar` TINYINT(1) NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminar_userdomains` - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `userdomain_id` `userdomain_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `sem_classes` - CHANGE COLUMN `only_inst_user` `only_inst_user` TINYINT(4) NOT NULL, - CHANGE COLUMN `bereiche` `bereiche` TINYINT(4) NOT NULL, - CHANGE COLUMN `module` `module` TINYINT(4) NOT NULL, - CHANGE COLUMN `show_browse` `show_browse` TINYINT(4) NOT NULL, - CHANGE COLUMN `write_access_nobody` `write_access_nobody` TINYINT(4) NOT NULL, - CHANGE COLUMN `topic_create_autor` `topic_create_autor` TINYINT(4) NOT NULL, - CHANGE COLUMN `visible` `visible` TINYINT(4) NOT NULL, - CHANGE COLUMN `course_creation_forbidden` `course_creation_forbidden` TINYINT(4) NOT NULL, - CHANGE COLUMN `studygroup_mode` `studygroup_mode` TINYINT(4) NOT NULL, - CHANGE COLUMN `show_raumzeit` `show_raumzeit` TINYINT(4) NOT NULL DEFAULT '1', - CHANGE COLUMN `is_group` `is_group` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `sem_tree` - CHANGE COLUMN `sem_tree_id` `sem_tree_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `parent_id` `parent_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `studip_object_id` `studip_object_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `sem_types` - CHANGE COLUMN `mkdate` `mkdate` BIGINT(20) NOT NULL, - CHANGE COLUMN `chdate` `chdate` BIGINT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `separable_rooms` - CHANGE COLUMN `building_id` `building_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `separable_room_parts` - CHANGE COLUMN `room_id` `room_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `smiley` - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NULL, - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `statusgruppen` - CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `selfassign` `selfassign` TINYINT(4) NOT NULL DEFAULT '0', - CHANGE COLUMN `selfassign_start` `selfassign_start` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `selfassign_end` `selfassign_end` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `statusgruppe_user` - CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `visible` `visible` TINYINT(4) NOT NULL DEFAULT '1', - CHANGE COLUMN `inherit` `inherit` TINYINT(4) NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `studygroup_invitations` - CHANGE COLUMN `sem_id` `sem_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `termine` - CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `autor_id` `autor_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `date` `date` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `topic_id` `topic_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `metadate_id` `metadate_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `termin_related_groups` - CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `statusgruppe_id` `statusgruppe_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `termin_related_persons` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `themen` - CHANGE COLUMN `issue_id` `issue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `seminar_id` `seminar_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `author_id` `author_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(10) UNSIGNED NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `themen_termine` - CHANGE COLUMN `issue_id` `issue_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `termin_id` `termin_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `timedadmissions` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `start_time` `start_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `end_time` `end_time` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userdomains` - CHANGE COLUMN `userdomain_id` `userdomain_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `restricted_access` `restricted_access` TINYINT(1) NOT NULL DEFAULT '1'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userfilter` - CHANGE COLUMN `filter_id` `filter_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userfilter_fields` - CHANGE COLUMN `field_id` `field_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `filter_id` `filter_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `userlimits` - CHANGE COLUMN `rule_id` `rule_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_factorlist` - CHANGE COLUMN `list_id` `list_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(11) NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_info` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `chdate` `chdate` INT(20) NOT NULL DEFAULT '0', - CHANGE COLUMN `smsforward_copy` `smsforward_copy` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `smsforward_rec` `smsforward_rec` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `email_forward` `email_forward` TINYINT(4) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_inst` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `Institut_id` `Institut_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '0', - CHANGE COLUMN `externdefault` `externdefault` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', - CHANGE COLUMN `visible` `visible` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_online` - CHANGE COLUMN `last_lifesign` `last_lifesign` INT(10) UNSIGNED NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_studiengang` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `fach_id` `fach_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `version_id` `version_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_token` - DROP COLUMN `mkdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_userdomains` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `userdomain_id` `userdomain_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_visibility` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - CHANGE COLUMN `online` `online` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `search` `search` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `email` `email` TINYINT(1) NOT NULL DEFAULT '1', - CHANGE COLUMN `mkdate` `mkdate` INT(20) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `user_visibility_settings` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `webservice_access_rules` - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `widget_user` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `wiki` - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - CHANGE COLUMN `chdate` `chdate` INT(11) NULL, - DROP COLUMN `mkdate`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `wiki_locks` - CHANGE COLUMN `user_id` `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `range_id` `range_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - CHANGE COLUMN `chdate` `chdate` INT(11) NOT NULL DEFAULT '0'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `wiki_page_config` - CHANGE COLUMN `read_restricted` `read_restricted` TINYINT(1) NOT NULL DEFAULT '0', - CHANGE COLUMN `edit_restricted` `edit_restricted` TINYINT(1) NOT NULL DEFAULT '0', - DROP COLUMN `mkdate`, - DROP COLUMN `chdate`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201007_hide_studygroups_from_profile.php b/db/migrations/20201007_hide_studygroups_from_profile.php deleted file mode 100644 index ebcf8f8..0000000 --- a/db/migrations/20201007_hide_studygroups_from_profile.php +++ /dev/null @@ -1,31 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'HIDE_STUDYGROUPS_FROM_PROFILE'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201023_tiled_courses.php b/db/migrations/20201023_tiled_courses.php deleted file mode 100644 index b6be586..0000000 --- a/db/migrations/20201023_tiled_courses.php +++ /dev/null @@ -1,53 +0,0 @@ -exec($query); - - // Add UserConfig - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'MY_COURSES_TILED_DISPLAY', '0', 'boolean', 'user', - 'MeineVeranstaltungen', 'Hat die Kachelansicht unter \"Meine Veranstaltungen\" aktiviert', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - ), ( - 'MY_COURSES_SHOW_NEW_ICONS_ONLY', '0', 'boolean', 'user', - 'MeineVeranstaltungen', 'Nur Icons für neue Inhalte sollen angezeigt werden', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - } - - public function down() - { - // Remove Config and UserConfig - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` IN ( - 'MY_COURSES_ALLOW_TILED_DISPLAY', - 'MY_COURSES_TILED_DISPLAY', - 'MY_COURSES_SHOW_NEW_ICONS_ONLY' - )"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201024_tiled_courses_2.php b/db/migrations/20201024_tiled_courses_2.php deleted file mode 100644 index 5d9b038..0000000 --- a/db/migrations/20201024_tiled_courses_2.php +++ /dev/null @@ -1,34 +0,0 @@ -value, true); - $open_groups = array_keys($open_groups); - $value->value = json_encode($open_groups); - $value->store(); - }, - 'MY_COURSES_OPEN_GROUPS' - ); - } - - public function down() - { - ConfigValue::findEachByField( - function ($value) { - $open_groups = json_decode($value->value, true); - $open_groups = array_fill_keys($open_groups, true); - $value->value = json_encode($open_groups); - $value->store(); - }, - 'MY_COURSES_OPEN_GROUPS' - ); - } -} diff --git a/db/migrations/20201025_tiled_courses_3.php b/db/migrations/20201025_tiled_courses_3.php deleted file mode 100644 index 79b6f7e..0000000 --- a/db/migrations/20201025_tiled_courses_3.php +++ /dev/null @@ -1,31 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'MY_COURSES_TILED_DISPLAY_RESPONSIVE'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/202011031_add_missing_indices_resources.php b/db/migrations/202011031_add_missing_indices_resources.php deleted file mode 100644 index a3da2c2..0000000 --- a/db/migrations/202011031_add_missing_indices_resources.php +++ /dev/null @@ -1,40 +0,0 @@ -query($query); - - if ($result && $result->rowCount() > 0) { - return; - } - - $query = "ALTER TABLE `resource_temporary_permissions` ADD INDEX (`user_id`)"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_temporary_permissions` ADD INDEX (`resource_id`)"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "ALTER TABLE `resource_temporary_permissions` - DROP INDEX `user_id`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `resource_temporary_permissions` - DROP INDEX `resource_id`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201103_add_missing_indices.php b/db/migrations/20201103_add_missing_indices.php deleted file mode 100644 index b1b652b..0000000 --- a/db/migrations/20201103_add_missing_indices.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @license GPL2 or any later version - * @see https://develop.studip.de/trac/ticket/10882 - */ -class AddMissingIndices extends Migration -{ - public function description() - { - return 'Adds missing indices for tables `activities` and `plugins_activated`'; - } - - public function up() - { - // avoid running this migration twice - $query = "SHOW INDEX FROM activities WHERE Key_name = 'object_id'"; - $result = DBManager::get()->query($query); - - if ($result && $result->rowCount() > 0) { - return; - } - - $query = "ALTER TABLE `activities` - ADD INDEX `object_id` (`object_id`(32))"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `plugins_activated` - ADD INDEX `range` (`range_id`, `range_type`)"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "ALTER TABLE `activities` - DROP INDEX `object_id`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `plugins_activated` - DROP INDEX `range`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201108_config_i18n.php b/db/migrations/20201108_config_i18n.php deleted file mode 100644 index 4d4c291..0000000 --- a/db/migrations/20201108_config_i18n.php +++ /dev/null @@ -1,36 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "DELETE `i18n` - FROM `config` - JOIN `i18n` - ON `i18n`.`object_id` = CAST(MD5(`config`.`field`) AS CHAR CHARACTER SET latin1) - AND `i18n`.`table` = 'config' - AND `i18n`.`field` = 'value' - WHERE `config`.`type` = 'i18n'"; - DBManager::get()->exec($query); - - $query = "UPDATE `config` - SET `type` = 'string' - WHERE `type` = 'i18n'"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `config` - CHANGE COLUMN `type` `type` ENUM('boolean','integer','string','array') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'string'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201110_course_members_hide.php b/db/migrations/20201110_course_members_hide.php deleted file mode 100644 index 0043f67..0000000 --- a/db/migrations/20201110_course_members_hide.php +++ /dev/null @@ -1,32 +0,0 @@ -prepare($query); - $statement->execute([ - ':name' => 'COURSE_MEMBERS_HIDE', - ':description' => 'Über diese Option können Sie die Teilnehmendenliste für Studierende der Veranstaltung unsichtbar machen', - ':range' => 'course', - ':type' => 'boolean', - ':value' => '0' - ]); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'COURSE_MEMBERS_HIDE'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201113_tic_9101.php b/db/migrations/20201113_tic_9101.php deleted file mode 100644 index 02e1b44..0000000 --- a/db/migrations/20201113_tic_9101.php +++ /dev/null @@ -1,54 +0,0 @@ - 7, - 2 => 1, - 3 => 2, - 4 => 8, - 5 => 4, - 6 => 9, - 7 => 6, - 8 => 3, - 9 => 5, - 10 => 14, - 11 => 10, - 12 => 11, - 13 => 14, - 14 => 13, - 15 => 12, - ]; - - public function description() - { - return 'Align colors in schedule with color mapping in my courses'; - } - - public function up() - { - $query = "UPDATE `schedule_seminare` - SET `color` = :new - WHERE `color` = :old"; - $statement = DBManager::get()->prepare($query); - - foreach (self::MAPPING as $old => $new) { - $statement->bindValue(':new', $new); - $statement->bindValue(':old', $old); - $statement->execute(); - } - } - - public function down() - { - $query = "UPDATE `schedule_seminare` - SET `color` = :new - WHERE `color` = :old"; - $statement = DBManager::get()->prepare($query); - - foreach (self::MAPPING as $old => $new) { - $statement->bindValue(':new', $old); - $statement->bindValue(':old', $new); - $statement->execute(); - } - } -} diff --git a/db/migrations/20201115_introduce_range_config.php b/db/migrations/20201115_introduce_range_config.php deleted file mode 100644 index 0fada12..0000000 --- a/db/migrations/20201115_introduce_range_config.php +++ /dev/null @@ -1,28 +0,0 @@ -exec($query); - } - - public function down() - { - $quey = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING(`field`) - WHERE `range` IN ('range', 'institute')"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `config` - CHANGE COLUMN `range` `range` ENUM('global', 'user', 'course') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'global'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201116_consultation_extension.php b/db/migrations/20201116_consultation_extension.php deleted file mode 100644 index 749211f..0000000 --- a/db/migrations/20201116_consultation_extension.php +++ /dev/null @@ -1,171 +0,0 @@ -exec($query); - - $query = "UPDATE `config` - SET `section` = 'Terminvergabe' - WHERE `section` = 'Sprechstunden'"; - DBManager::get()->exec($query); - - // Allow participants to be visible to other participants - $query = "ALTER TABLE `consultation_blocks` - ADD COLUMN `show_participants` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `calendar_events`, - ADD COLUMN `require_reason` ENUM('no', 'optional', 'yes') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'optional' AFTER `show_participants`, - ADD COLUMN `confirmation_text` TEXT NULL DEFAULT NULL AFTER `require_reason`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `consultation_bookings` - CHANGE COLUMN `reason` `reason` TEXT NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - // Allow more ranges - $query = "ALTER TABLE `consultation_blocks` - DROP INDEX `teacher_id`, - CHANGE COLUMN `teacher_id` `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - ADD COLUMN `range_type` ENUM('user', 'course', 'institute') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL AFTER `range_id`, - ADD COLUMN `teacher_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL AFTER `range_type`, - ADD INDEX `range` (`range_id`, `range_type`), - ADD INDEX `teacher_id` (`teacher_id`)"; - DBManager::get()->exec($query); - - $query = "UPDATE `consultation_blocks` - SET `range_type` = 'user'"; - DBManager::get()->exec($query); - - $query = "UPDATE `consultation_blocks` AS cb0 - JOIN `consultation_blocks` AS cb1 USING (`block_id`) - SET cb0.`range_id` = cb1.`course_id`, - cb0.`range_type` = 'course', - cb0.`teacher_id` = cb1.`range_id` - WHERE cb0.`course_id` IS NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `consultation_blocks` - DROP COLUMN `course_id`"; - DBManager::get()->exec($query); - - // install as core plugin - $query = "INSERT IGNORE INTO `plugins` ( - `pluginclassname`, `pluginname`, `plugintype`, `enabled`, `navigationpos` - ) VALUES ( - 'ConsultationModule', 'Terminvergabe', 'StandardPlugin,SystemPlugin,PrivacyPlugin,HomepagePlugin', 'yes', 1 - )"; - DBManager::get()->exec($query); - - $plugin_id = DBManager::get()->lastInsertId(); - - $sql = "INSERT IGNORE INTO `roles_plugins` (`roleid`, `pluginid`) - SELECT `roleid`, ? - FROM `roles` - WHERE `system` = 'y'"; - DBManager::get()->execute($sql, [$plugin_id]); - - $sql = "INSERT IGNORE INTO `plugins_activated` - SELECT DISTINCT ?, 'user', `range_id`, 1 - FROM `consultation_blocks` - WHERE range_type = 'user'"; - DBManager::get()->execute($sql, [$plugin_id]); - - $sql = "INSERT IGNORE INTO `plugins_activated` - SELECT DISTINCT ?, 'sem', `range_id`, 1 - FROM `consultation_blocks` - WHERE range_type = 'course'"; - DBManager::get()->execute($sql, [$plugin_id]); - - RESTAPI\ConsumerPermissions::get('global')->activateRouteMap( - new RESTAPI\Routes\Consultations() - ); - } - - public function down() - { - $query = "DELETE FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` IN ( - 'CONSULTATION_GARBAGE_COLLECT', - 'CONSULTATION_SHOW_GROUPED', - 'CONSULTATION_TAB_TITLE' - )"; - DBManager::get()->exec($query); - - // Allow participants to be visible to other participants - $query = "ALTER TABLE `consultation_blocks` - DROP COLUMN `show_participants`, - DROP COLUMN `require_reason`, - DROP COLUMN `confirmation_text`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `consultation_bookings` - CHANGE COLUMN `reason` `reason` TEXT NOT NULL"; - DBManager::get()->exec($query); - - // Disallow more ranges - $query = "ALTER TABLE `consultation_blocks` - ADD COLUMN `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL"; - DBManager::get()->exec($query); - - $query = "DELETE FROM `consultation_blocks` - WHERE `range_type` = 'institute'"; - DBManager::get()->exec($query); - - $query = "UPDATE `consultation_blocks` AS cb0 - JOIN `consultation_blocks` AS cb1 USING (`block_id`) - SET cb0.`course_id` = cb1.`range_id`, - cb0.`range_id` = cb1.`teacher_id` - WHERE cb0.`course_id` IS NOT NULL"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `consultation_blocks` - DROP INDEX `teacher_id`, - DROP INDEX `range`, - DROP COLUMN `teacher_id`, - DROP COLUMN `range_type`, - CHANGE COLUMN `range_id` `teacher_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - ADD INDEX `teacher_id` (`teacher_id`)"; - DBManager::get()->exec($query); - - // Delete core plugin - $query = "DELETE `plugins`, `roles_plugins` - FROM `plugins` - LEFT JOIN `roles_plugins` USING (`pluginid`) - WHERE `pluginclassname` = 'ConsultationModule'"; - DBManager::get()->exec($query); - - // Deactivate routemap - RESTAPI\ConsumerPermissions::get('global')->deactivateRouteMap( - new RESTAPI\Routes\Consultations() - ); - } -} diff --git a/db/migrations/20201203_course_groups_hide.php b/db/migrations/20201203_course_groups_hide.php deleted file mode 100644 index cebb403..0000000 --- a/db/migrations/20201203_course_groups_hide.php +++ /dev/null @@ -1,32 +0,0 @@ -prepare($query); - $statement->execute([ - ':name' => 'COURSE_MEMBERGROUPS_HIDE', - ':description' => 'Über diese Option können Sie die Teilnehmendengruppenliste für Studierende der Veranstaltung unsichtbar machen', - ':range' => 'course', - ':type' => 'boolean', - ':value' => '0' - ]); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'COURSE_MEMBERGROUPS_HIDE'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20201211_add_seminare_semester_table.php b/db/migrations/20201211_add_seminare_semester_table.php deleted file mode 100644 index f38e936..0000000 --- a/db/migrations/20201211_add_seminare_semester_table.php +++ /dev/null @@ -1,43 +0,0 @@ -exec( - "CREATE TABLE IF NOT EXISTS `semester_courses` ( - `semester_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `course_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `mkdate` INT(10) NOT NULL DEFAULT '0', - `chdate` INT(10) NOT NULL DEFAULT '0', - PRIMARY KEY (`semester_id`, `course_id`) - );" - ); - - //This select looks unorthodox but I am trying to catch even broken - //database entries for when start_time and duration_time don't exactly - //match the begin or end of the semester. - DBManager::get()->exec(" - INSERT IGNORE INTO `semester_courses` - (`semester_id`, `course_id`, `mkdate`, `chdate`) - SELECT `semester_data`.`semester_id`, `seminare`.`Seminar_id`, `seminare`.`mkdate`, `seminare`.`chdate` - FROM `seminare` - INNER JOIN `semester_data` ON (`seminare`.`start_time` < `semester_data`.`ende` - AND ( - (`seminare`.`start_time` >= `semester_data`.`beginn` AND `seminare`.`duration_time` = '0') - OR (`seminare`.`duration_time` > 0 AND `seminare`.`start_time` + `seminare`.`duration_time` > `semester_data`.`beginn`) - ) - )" - ); - } - - public function down() - { - DBManager::get()->exec("DROP TABLE IF EXISTS `semester_courses`;"); - } -} diff --git a/db/migrations/20201212_add_seminare_semester_course_index.php b/db/migrations/20201212_add_seminare_semester_course_index.php deleted file mode 100644 index f81e008..0000000 --- a/db/migrations/20201212_add_seminare_semester_course_index.php +++ /dev/null @@ -1,24 +0,0 @@ -exec(" - ALTER TABLE `semester_courses` - ADD KEY `course_id` (`course_id`) - "); - } - - public function down() - { - DBManager::get()->exec(" - ALTER TABLE `semester_courses` - DROP KEY `course_id` - "); - } -} diff --git a/db/migrations/20210104_tic_11041.php b/db/migrations/20210104_tic_11041.php deleted file mode 100644 index 3c517a2..0000000 --- a/db/migrations/20210104_tic_11041.php +++ /dev/null @@ -1,23 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `lti_tool` - DROP COLUMN `oauth_signature_method`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20210108_tic11044_admin_course_notices.php b/db/migrations/20210108_tic11044_admin_course_notices.php deleted file mode 100644 index c5c1a2f..0000000 --- a/db/migrations/20210108_tic11044_admin_course_notices.php +++ /dev/null @@ -1,49 +0,0 @@ -fetchColumn($query) ?: 0; - - $query = "INSERT IGNORE INTO `datafields` ( - `datafield_id`, `name`, - `object_type`, `object_class`, - `edit_perms`, `view_perms`, - `system`, `priority`, - `mkdate`, `chdate`, - `type`, `typeparam`, - `is_required`, `is_userfilter`, - `description` - ) VALUES ( - :id, 'Notiz zu einer Veranstaltung', - 'sem', NULL, - 'admin', 'admin', - 1, :priority, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'textarea', '', - 0, 0, - 'Enthält etwaige Notizen von Admins zu Veranstaltungen' - )"; - DBManager::get()->execute($query, [ - ':id' => md5(uniqid(__CLASS__, true)), - ':priority' => $priority, - ]); - } - - public function down() - { - $query = "DELETE `datafields`, `datafields_entries` - FROM `datafields` - LEFT JOIN `datafields_entries` USING (`datafield_id`) - WHERE `datafields`.`name` = 'Notiz zu einer Veranstaltung'"; - DBManager::get()->execute($query); - } -} diff --git a/db/migrations/20210201_step_00349.php b/db/migrations/20210201_step_00349.php deleted file mode 100644 index d124622..0000000 --- a/db/migrations/20210201_step_00349.php +++ /dev/null @@ -1,650 +0,0 @@ - ['id' => 20, 'const' => '', 'sem' => true, 'inst' => false], - 'admin' => ['id' => 17, 'const' => '', 'sem' => true, 'inst' => false], - 'forum' => ['id' => 0, 'const' => '', 'sem' => true, 'inst' => true], - 'documents' => ['id' => 1, 'const' => '', 'sem' => true, 'inst' => true], - 'schedule' => ['id' => 2, 'const' => '', 'sem' => true, 'inst' => false], - 'participants' => ['id' => 3, 'const' => '', 'sem' => true, 'inst' => false], - 'personal' => ['id' => 4, 'const' => '', 'sem' => false, 'inst' => true], - 'wiki' => ['id' => 8, 'const' => 'WIKI_ENABLE', 'sem' => true, 'inst' => true], - 'scm' => ['id' => 12, 'const' => 'SCM_ENABLE', 'sem' => true, 'inst' => true], - 'elearning_interface' => ['id' => 13, 'const' => 'ELEARNING_INTERFACE_ENABLE', 'sem' => true, 'inst' => true], - 'calendar' => ['id' => 16, 'const' => 'COURSE_CALENDAR_ENABLE', 'sem' => true, 'inst' => true], - ]; - private $notification_modules = [ - 'basicdata' => 27, - 'votes' => 26, - 'news' => 25, - 'forum' => 0, - 'documents' => 1, - 'schedule' => 2, - 'participants' => 3, - 'wiki' => 8, - 'scm' => 12, - 'elearning_interface' => 13 - ]; - - public function description() - { - return 'add table `tools_activated`; migrate data from plugins_activated and seminare.modules; add CorePlugins'; - } - - public function up() - { - $db = DBManager::get(); - $db->execute("CREATE TABLE IF NOT EXISTS `tools_activated` ( - `range_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `range_type` enum('course','institute') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `plugin_id` int(10) UNSIGNED NOT NULL, - `position` tinyint(3) UNSIGNED NOT NULL, - `metadata` json DEFAULT NULL, - `mkdate` int(10) UNSIGNED NOT NULL, - `chdate` int(10) UNSIGNED NOT NULL, - PRIMARY KEY (`range_id`,`plugin_id`), - KEY (`plugin_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); - - $db->execute("CREATE TABLE IF NOT EXISTS `seminar_user_notifications` ( - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `seminar_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `notification_data` json DEFAULT NULL, - `chdate` int(10) UNSIGNED NOT NULL, - `mkdate` int(10) UNSIGNED NOT NULL, - PRIMARY KEY (`user_id`,`seminar_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); - - $core_plugins = [ - 'IliasInterfaceModule', - 'LtiToolModule', - 'GradebookModule', - 'FeedbackModule', - 'ConsultationModule', - 'CoreForum', - 'Blubber', - 'CoursewareModule' - ]; - $studip_modules = [ - 'CoreOverview', - 'CoreAdmin', - 'CoreStudygroupAdmin', - //??? 'CoreStudygroupOverview', - 'CoreDocuments', - 'CoreParticipants', - 'CoreStudygroupParticipants', - 'CoreSchedule', - 'CoreScm', - 'CoreWiki', - 'CoreCalendar', - 'CoreElearningInterface', - 'CorePersonal' - ]; - $ouv_mapping = [ - 'sem' => 0, - 'inst'=> 0, - 'basicdata' => 0, - 'vote' => -1, - 'eval' => -2, - 'news' => 'CoreOverview', - 'documents' => 'CoreDocuments', - 'schedule' => 'CoreSchedule', - 'scm' => 'CoreScm', - 'wiki' => 'CoreWiki', - 'elearning_interface' => 'CoreElearningInterface', - 'ilias_interface' => 'IliasInterfaceModule', - 'participants' => 'CoreParticipants', - 'courseware' => 'CoursewareModule' - ]; - PluginManager::getInstance()->getPlugin('CoreForum'); - PluginManager::getInstance()->getPlugin('Blubber'); - - foreach ($core_plugins as $plugin) { - try { - $info = new ReflectionClass($plugin); - } catch (ReflectionException $e) { - continue; - } - $ifaces = array_merge(['CorePlugin'], $info->getInterfaceNames()); - $db->execute("UPDATE plugins SET plugintype=? WHERE pluginclassname=?", [join(',', $ifaces), $plugin]); - } - foreach ($studip_modules as $module) { - $info = new ReflectionClass($module); - $ifaces = array_merge(['CorePlugin'], $info->getInterfaceNames()); - $db->execute("INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) - VALUES (?, ?, ?, 'yes', 1)", [$module, $module, join(',', $ifaces)]); - $db->execute("INSERT INTO roles_plugins (roleid, pluginid) SELECT roleid, ? FROM roles WHERE `system` = 'y'", [$db->lastInsertId()]); - } - - $all_plugins = $db->fetchPairs("SELECT pluginclassname, pluginid FROM plugins"); - - foreach ($db->query("SELECT seminar_id, status, modules FROM seminare") as $row) { - $activated_plugins = $db->fetchPairs("SELECT plugins_activated.pluginid, state FROM `plugins_activated` INNER JOIN `plugins` USING(pluginid) WHERE range_id=? AND range_type='sem' ORDER BY navigationpos", [$row['seminar_id']]); - $modules = $this->getLocalModules('sem', $row['modules'], $row['status']); - $pos = 0; - foreach ($modules as $pos => $module) { - if (isset($all_plugins[$module]) && !(isset($activated_plugins[$all_plugins[$module]]) && $activated_plugins[$all_plugins[$module]] === '0')) { - $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'course', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", - [ - $row['seminar_id'], - $all_plugins[$module], - $pos - ]); - } - } - foreach ($activated_plugins as $plugin_id => $state) { - if (!$state) { - continue; - } - $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'course', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", - [ - $row['seminar_id'], - $plugin_id, - ++$pos - ]); - } - } - - foreach ($db->query("SELECT institut_id, type, modules FROM Institute") as $row) { - $activated_plugins = $db->fetchPairs("SELECT plugins_activated.pluginid, state FROM `plugins_activated` INNER JOIN `plugins` USING(pluginid) WHERE range_id=? AND range_type='inst' ORDER BY navigationpos", [$row['institut_id']]); - $modules = $this->getLocalModules('inst', $row['modules'], $row['type']); - $pos = 0; - foreach ($modules as $pos => $module) { - if (isset($all_plugins[$module]) && !(isset($activated_plugins[$all_plugins[$module]]) && $activated_plugins[$all_plugins[$module]] === '0')) { - $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'institute', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", - [ - $row['institut_id'], - $all_plugins[$module], - $pos - ]); - } - } - foreach ($activated_plugins as $plugin_id => $state) { - if (!$state) { - continue; - } - $db->execute("INSERT IGNORE INTO `tools_activated` (`range_id`, `range_type`, `plugin_id`, `position`, `metadata`, `mkdate`, `chdate`) VALUES (?, 'institute', ?, ?, NULL, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", - [ - $row['institut_id'], - $plugin_id, - ++$pos - ]); - } - } - - foreach ($db->query("SELECT seminar_id, user_id, notification FROM seminar_user WHERE notification > 0") as $row) { - $notifications = []; - foreach ($this->notification_modules as $module => $id) { - if ($row['notification'] & pow(2, $id)) { - $plugin_id = $ouv_mapping[$module]; - if (is_string($plugin_id)) { - $plugin_id = $all_plugins[$plugin_id]; - } - if ($plugin_id !== null) { - $notifications[] = $plugin_id; - } - } - } - if (count($notifications)) { - $db->execute("INSERT INTO seminar_user_notifications (user_id, seminar_id, notification_data, chdate, mkdate) VALUES (?,?,?,UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", [$row['user_id'], $row['seminar_id'], json_encode($notifications)]); - } - } - - foreach ($db->query("SELECT range_id, user_id, notification FROM deputies WHERE notification > 0") as $row) { - $notifications = []; - foreach ($this->notification_modules as $module => $id) { - if ($row['notification'] & pow(2, $id)) { - $plugin_id = $ouv_mapping[$module]; - if (!is_int($plugin_id)) { - $plugin_id = $all_plugins[$module]; - } - if ($plugin_id !== null) { - $notifications[] = $plugin_id; - } - } - } - if (count($notifications)) { - $db->execute("INSERT IGNORE INTO seminar_user_notifications (user_id, seminar_id, notification_data, chdate, mkdate) VALUES (?,?,?,UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", [$row['user_id'], $row['range_id'], json_encode($notifications)]); - } - } - - $db->exec("DELETE FROM `object_user_visits` WHERE `type` IN ('literature', 'forum', '')"); - $db->exec("ALTER TABLE `object_user_visits` ADD `plugin_id` INT NOT NULL AFTER `type`"); - foreach ($ouv_mapping as $type => $plugin_id) { - if (is_string($plugin_id)) { - $plugin_id = $all_plugins[$plugin_id]; - } - $db->execute("UPDATE `object_user_visits` SET `plugin_id` = ? WHERE `type` = ?", [$plugin_id, $type]); - } - - $db->exec("ALTER TABLE `object_user_visits` DROP PRIMARY KEY, ADD PRIMARY KEY (`object_id`, `user_id`, `plugin_id`)"); - $db->exec("ALTER TABLE `object_user_visits` DROP `type`"); - $db->exec("ALTER TABLE `seminar_user` DROP `notification`"); - $db->exec("ALTER TABLE `seminare` DROP `modules`"); - $db->exec("ALTER TABLE `Institute` DROP `modules`"); - $db->exec("ALTER TABLE `sem_classes` - DROP `overview`, - DROP `forum`, - DROP `admin`, - DROP `documents`, - DROP `schedule`, - DROP `participants`, - DROP `literature`, - DROP `scm`, - DROP `wiki`, - DROP `resources`, - DROP `calendar`, - DROP `elearning_interface`"); - - } - - private function getLocalModules($range_type, $modules, $type) - { - $old_sem_class = OldSemClass::getClasses(); - if ($range_type === 'sem') { - $class = DBManager::get()->fetchColumn("SELECT class FROM sem_types WHERE id=?", [$type]); - $sem_class = $old_sem_class[$class] ?: OldSemClass::getDefaultSemClass(); - } else { - $sem_class = OldSemClass::getDefaultInstituteClass($type); - } - if (!$modules) { - $modules = 0; - foreach ($this->registered_modules as $slot => $val) { - if ($val[$range_type === 'sem' ? 'sem' : 'inst']) { - $const = $val['const']; - if ($sem_class->isModuleActivated($sem_class->getSlotModule($slot)) && (!$const || Config::get()->$const)) { - $modules += pow(2, $val['id']); - } - } - } - } - $modules_list = []; - $pos = 0; - foreach ($this->registered_modules as $key => $val) { - $module = $sem_class->getSlotModule($key); - if ($sem_class->isModuleAllowed($module)) { - if (($modules & pow(2, $val['id'])) || $sem_class->isSlotMandatory($key)) { - $modules_list[$pos] = $module; - $pos++; - } - } - } - return $modules_list; - } - - public function down() - { - - } -} - - -class OldSemClass implements ArrayAccess -{ - protected $data = []; - protected static $slots = [ - "overview", - "forum", - "admin", - "documents", - "schedule", - "participants", - "scm", - "wiki", - "calendar", - "elearning_interface" - ]; - protected static $core_modules = [ - "CoreOverview", - "CoreAdmin", - "CoreStudygroupAdmin", - "CoreStudygroupOverview", - "CoreDocuments", - "CoreParticipants", - "CoreStudygroupParticipants", - "CoreSchedule", - "CoreScm", - "CoreWiki", - "CoreCalendar", - "CoreElearningInterface" - ]; - protected static $sem_classes = null; - - public static function getDefaultSemClass() - { - $data = [ - 'name' => "Fehlerhafte Seminarklasse!", - 'overview' => "CoreOverview", - 'forum' => "Blubber", - 'admin' => "CoreAdmin", - 'documents' => "CoreDocuments", - 'schedule' => "CoreSchedule", - 'participants' => "CoreParticipants", - 'scm' => "CoreScm", - 'wiki' => "CoreWiki", - 'calendar' => "CoreCalendar", - 'elearning_interface' => "CoreElearningInterface", - 'modules' => '{"CoreOverview":{"activated":1,"sticky":1},"CoreAdmin":{"activated":1,"sticky":1}, "CoreResources":{"activated":1,"sticky":0}}', - 'visible' => 1, - 'is_group' => false - ]; - return new self($data); - } - - /** - * Generates a dummy SemClass for institutes of this type (as defined in config.inc.php). - * @param integer $type institute type - * @return SemClass - */ - public static function getDefaultInstituteClass($type) - { - global $INST_MODULES; - - // fall back to 'default' if modules are not defined - $type = isset($INST_MODULES[$type]) ? $type : 'default'; - - $data = [ - 'name' => 'Generierte Standardinstitutsklasse', - 'visible' => 1, - 'overview' => 'CoreOverview', // always available - 'admin' => 'CoreAdmin' // always available - ]; - $slots = [ - 'forum' => 'Blubber', - 'documents' => 'CoreDocuments', - 'scm' => 'CoreScm', - 'wiki' => 'CoreWiki', - 'calendar' => 'CoreCalendar', - 'elearning_interface' => 'CoreElearningInterface', - 'personal' => 'CorePersonal' - ]; - $modules = [ - 'CoreOverview' => ['activated' => 1, 'sticky' => 1], - 'CoreAdmin' => ['activated' => 1, 'sticky' => 1] - ]; - - foreach ($slots as $slot => $module) { - $data[$slot] = $module; - $modules[$module] = ['activated' => (int)$INST_MODULES[$type][$slot], 'sticky' => 0]; - } - $data['modules'] = json_encode($modules); - - return new self($data); - } - - /** - * Constructor can be set with integer of sem_class_id or an array of - * the old $SEM_CLASS style. - * @param integer | array $data - */ - public function __construct($data) - { - $db = DBManager::get(); - if (is_int($data)) { - $statement = $db->prepare("SELECT * FROM sem_classes WHERE id = :id "); - $statement->execute(['id' => $data]); - $this->data = $statement->fetch(PDO::FETCH_ASSOC); - } else { - $this->data = $data; - } - if ($this->data['modules']) { - $this->data['modules'] = self::object2array(json_decode($this->data['modules'])); - } else { - $this->data['modules'] = []; - } - } - - /** - * Returns the name of the module of the slot or the module itself, if it - * is a plugin. - * @param string $slot - * @return string - */ - public function getSlotModule($slot) - { - if (in_array($slot, self::$slots)) { - return $this->data[$slot]; - } else { - return $slot; - } - } - - - /** - * Returns all metadata of the modules at once. - * @return array: array($module_name => array('sticky' => (bool), 'activated' => (bool)), ...) - */ - public function getModules() - { - return $this->data['modules']; - } - - /** - * Returns true if a module is activated on default for this sem_class. - * @param string $modulename - * @return boolean - */ - public function isModuleActivated($modulename) - { - return !$this->data['modules'][$modulename] - || $this->data['modules'][$modulename]['activated']; - } - - /** - * Returns if a module is allowed to be displayed for this sem_class. - * @param string $modulename - * @return boolean - */ - public function isModuleAllowed($modulename) - { - return !$this->data['modules'][$modulename] - || !$this->data['modules'][$modulename]['sticky'] - || $this->data['modules'][$modulename]['activated']; - } - - /** - * Returns if a module is mandatory for this sem_class. - * @param string $module - * @return boolean - */ - public function isModuleMandatory($module) - { - return $this->data['modules'][$module]['sticky'] - && $this->data['modules'][$module]['activated']; - } - - /** - * Returns if the slot is mandatory, which it is if the module in this - * slot is mandatory. - * @param string $slot - * @return boolean - */ - public function isSlotMandatory($slot) - { - $module = $this->getSlotModule($slot); - return $module && $this->isModuleMandatory($module); - } - - /** - * Returns if a module is a slot module. Good for plugins that should be - * displayed on a specific place only if they are no slot modules. - * @param string $module - * @return boolean - */ - public function isSlotModule($module) - { - foreach (self::$slots as $slot) { - if ($module === $this->getSlotModule($slot)) { - return true; - } - } - return false; - } - - /** - * Returns the slot name of a module. - * @param string $module - * @return string|null - */ - public function getModuleSlot($module) - { - foreach (self::$slots as $slot) { - if ($module === $this->getSlotModule($slot)) { - return $slot; - } - } - return null; - } - - /** - * returns an instance of the module of a given slotname or pluginclassname - * @param string $slot_or_plugin - * @return StudipModule | null - */ - public function getModule($slot_or_plugin) - { - $module = $this->getSlotModule($slot_or_plugin); - if ($module && $this->isModuleAllowed($module)) { - if (in_array($module, self::$core_modules)) { - return new $module(); - } - if ($module) { - return PluginEngine::getPlugin($module); - } - } - } - - - /** - * Sets an attribute of sem_class->data - * @param string $offset - * @param mixed $value - */ - public function set($offset, $value) - { - $this->data[$offset] = $value; - } - - /*************************************************************************** - * ArrayAccess methods * - ***************************************************************************/ - - /** - * deprecated, does nothing, should not be used - * @param string $offset - * @param mixed $value - */ - public function offsetSet($offset, $value) - { - } - - /** - * Compatibility function with old $SEM_CLASS variable for plugins. Maps the - * new array-structure to the old boolean values. - * @param integer $offset : name of attribute - * @return boolean|(localized)string - */ - public function offsetGet($offset) - { - switch ($offset) { - case "name": - return gettext($this->data['name']); - case "only_inst_user": - return (bool)$this->data['only_inst_user']; - case "bereiche": - return (bool)$this->data['bereiche']; - case "show_browse": - return (bool)$this->data['show_browse']; - case "write_access_nobody": - return (bool)$this->data['write_access_nobody']; - case "topic_create_autor": - return (bool)$this->data['topic_create_autor']; - case "visible": - return (bool)$this->data['visible']; - case "forum": - return $this->data['forum'] !== null; - case "documents": - return $this->data['documents'] !== null; - case "schedule": - return $this->data['schedule'] !== null; - case "participants": - return $this->data['participants'] !== null; - case "scm": - return $this->data['scm'] !== null; - case "studygroup_mode": - return (bool)$this->data['studygroup_mode']; - case "admission_prelim_default": - return (int)$this->data['admission_prelim_default']; - case "admission_type_default": - return (int)$this->data['admission_type_default']; - case "is_group": - return (bool)$this->data['is_group']; - } - //ansonsten - return $this->data[$offset]; - } - - /** - * ArrayAccess method to check if an attribute exists. - * @param type $offset - * @return type - */ - public function offsetExists($offset) - { - return isset($this->data[$offset]); - } - - /** - * deprecated, does nothing, should not be used - * @param string $offset - */ - public function offsetUnset($offset) - { - } - - /*************************************************************************** - * static methods * - ***************************************************************************/ - - /** - * Returns an array of all SemClasses in Stud.IP. Equivalent to global - * $SEM_CLASS variable. This variable is statically stored in this class. - * @return array of SemClass - */ - public static function getClasses() - { - if (!is_array(self::$sem_classes)) { - $db = DBManager::get(); - self::$sem_classes = []; - - $statement = $db->prepare( - "SELECT * FROM sem_classes ORDER BY id ASC " - ); - $statement->execute(); - $class_array = $statement->fetchAll(PDO::FETCH_ASSOC); - foreach ($class_array as $sem_class) { - self::$sem_classes[$sem_class['id']] = new self($sem_class); - } - } - return self::$sem_classes; - } - - - /** - * Static method to recursively transform an object into an associative array. - * @param mixed $obj : should be of class StdClass - * @return array - */ - public static function object2array($obj) - { - $arr_raw = is_object($obj) ? get_object_vars($obj) : $obj; - foreach ($arr_raw as $key => $val) { - $val = (is_array($val) || is_object($val)) ? self::object2array($val) : $val; - $arr[$key] = $val; - } - return $arr; - } -} - diff --git a/db/migrations/20210204_tic_8183_terms_admission.php b/db/migrations/20210204_tic_8183_terms_admission.php deleted file mode 100644 index 4f619d9..0000000 --- a/db/migrations/20210204_tic_8183_terms_admission.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 5.0 - * - * @see https://develop.studip.de/trac/ticket/8183 - */ -class TIC8183TermsAdmission extends Migration -{ - public function description() - { - return 'introduces an admission rule that requires accepting terms of admission'; - } - - public function up() - { - $db = DBManager::get(); - - // table for rule definitions - $db->exec("CREATE TABLE IF NOT EXISTS termsadmissions ( - rule_id varchar(32) COLLATE latin1_bin NOT NULL, - terms text NOT NULL, - mkdate int(11) NOT NULL DEFAULT 0, - chdate int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (rule_id) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - // install rule to database - $db->exec("INSERT IGNORE INTO admissionrules (id, ruletype, active, mkdate, path) - VALUES (0, 'TermsAdmission', 1, UNIX_TIMESTAMP(), 'lib/admissionrules/termsadmission')"); - - // install allowed combinations - $rules = [ - 'ConditionalAdmission', - 'CourseMemberAdmission', - 'LimitedAdmission', - 'ParticipantRestrictedAdmission', - 'PreferentialAdmission', - 'TimedAdmission' - ]; - - $stmt = DBManager::get()->prepare('INSERT IGNORE INTO admissionrule_compat - VALUES (:ruletype, :compat, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())'); - - foreach ($rules as $rule) { - $stmt->execute(['ruletype' => 'TermsAdmission', 'compat' => $rule]); - $stmt->execute(['ruletype' => $rule, 'compat' => 'TermsAdmission']); - } - } - - public function down() - { - $db = DBManager::get(); - - // remove allowed combinations - $db->exec("DELETE FROM admissionrule_compat WHERE rule_type = 'TermsAdmission' OR compat_rule_type = 'TermsAdmission'"); - - // remove entry in admission rule registry - $db->exec("DELETE FROM admissionrules WHERE ruletype = 'TermsAdmission'"); - - // remove rule data table - $db->exec("DROP TABLE termsadmissions"); - } -} diff --git a/db/migrations/20210212_admin_related_inst.php b/db/migrations/20210212_admin_related_inst.php deleted file mode 100644 index f9e5a62..0000000 --- a/db/migrations/20210212_admin_related_inst.php +++ /dev/null @@ -1,34 +0,0 @@ -prepare($query); - $statement->execute([ - ':name' => 'ALLOW_ADMIN_RELATED_INST', - ':description' => 'Admins beteiligter Einrichtungen haben die gleiche Rechte an Veranstaltungen wie die Heimateinrichtung', - ':section' => 'global', - ':range' => 'global', - ':type' => 'boolean', - ':value' => '0' - ]); - } - - public function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'ALLOW_ADMIN_RELATED_INST'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/202102161_oercampus_integration.php b/db/migrations/202102161_oercampus_integration.php deleted file mode 100644 index cc28ee9..0000000 --- a/db/migrations/202102161_oercampus_integration.php +++ /dev/null @@ -1,436 +0,0 @@ -prepare(" - SELECT COUNT(*) - FROM `lernmarktplatz_material` - "); - $statement->execute(); - $already_installed_plugin = $statement->fetch(PDO::FETCH_COLUMN, 0) > 0; - } catch (Exception $e) { - $already_installed_plugin = false; - } - - if ($already_installed_plugin) { - //test if all plugin tables are in place - $oldtables = [ - 'lernmarktplatz_abo', - 'lernmarktplatz_comments', - 'lernmarktplatz_downloadcounter', - 'lernmarktplatz_hosts', - 'lernmarktplatz_material_users', - 'lernmarktplatz_reviews', - 'lernmarktplatz_tags', - 'lernmarktplatz_tags_material', - 'lernmarktplatz_user' - ]; - foreach ($oldtables as $tablename) { - $query = "SHOW TABLES LIKE ? "; - $statement = DBManager::get()->prepare($query); - $statement->execute([$tablename]); - if ($statement->rowCount() === 0) { - throw new Exception("Your OER Campus / Lernmarktplatz plugin is not in a current state. Uninstall or update it first, before you restart this migration."); - } - } - } - - - DBManager::get()->exec(" - ALTER TABLE `user_info` - ADD COLUMN `oercampus_description` TEXT DEFAULT NULL - "); - - DBManager::get()->exec(" - UPDATE `user_info` - SET `oercampus_description` = ( - SELECT `content` - FROM `datafields_entries` - WHERE `datafield_id` = MD5('Lernmarktplatz-Beschreibung') - AND `datafields_entries`.`range_id` = `user_info`.`user_id` - LIMIT 1 - ) - "); - - DBManager::get()->exec(" - ALTER TABLE blubber_external_contact - CHANGE COLUMN `mail_identifier` `foreign_id` varchar(256) DEFAULT NULL, - ADD COLUMN `host_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL AFTER `foreign_id`, - ADD COLUMN `avatar_url` varchar(256) DEFAULT NULL AFTER `name` - "); - - DBManager::get()->exec(" - RENAME TABLE `blubber_external_contact` TO `external_users`; - "); - - if ($already_installed_plugin) { - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_abo` TO `oer_abo`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_comments` TO `oer_comments`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_downloadcounter` TO `oer_downloadcounter`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_hosts` TO `oer_hosts`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_material` TO `oer_material`; - "); - DBManager::get()->exec(" - ALTER TABLE `oer_material` - CHANGE license license_identifier varchar(64) NOT NULL DEFAULT 'CC BY SA 3.0' - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_material_users` TO `oer_material_users`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_reviews` TO `oer_reviews`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_tags` TO `oer_tags`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_tags_material` TO `oer_tags_material`; - "); - DBManager::get()->exec(" - RENAME TABLE `lernmarktplatz_user` TO `oer_user`; - "); - - $rename_config = DBManager::get()->prepare(" - UPDATE `config` - SET `field` = :new - WHERE `field` = :old - "); - $rename_config_values = DBManager::get()->prepare(" - UPDATE `config_values` - SET `field` = :new - WHERE `field` = :old - "); - - $rename_config->execute([ - 'old' => "LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD", - 'new' => "OER_USER_DESCRIPTION_DATAFIELD" - ]); - $rename_config_values->execute([ - 'old' => "LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD", - 'new' => "OER_USER_DESCRIPTION_DATAFIELD" - ]); - $rename_config->execute([ - 'old' => "LERNMARKTPLATZ_PUBLIC_STATUS", - 'new' => "OER_PUBLIC_STATUS" - ]); - $rename_config_values->execute([ - 'old' => "LERNMARKTPLATZ_PUBLIC_STATUS", - 'new' => "OER_PUBLIC_STATUS" - ]); - $rename_config->execute([ - 'old' => "LERNMARKTPLATZ_DISABLE_LICENSE", - 'new' => "OER_DISABLE_LICENSE" - ]); - $rename_config_values->execute([ - 'old' => "LERNMARKTPLATZ_DISABLE_LICENSE", - 'new' => "OER_DISABLE_LICENSE" - ]); - - $rename_config->execute([ - 'old' => "LERNMARKTPLATZ_TITLE", - 'new' => "OER_TITLE" - ]); - $rename_config_values->execute([ - 'old' => "LERNMARKTPLATZ_TITLE", - 'new' => "OER_TITLE" - ]); - - $query = "INSERT INTO `config` - SET `field` = :field, - `value` = :value, - `type` = :type, - `range` = :range, - `section` = :section, - `mkdate` = UNIX_TIMESTAMP(), - `chdate` = UNIX_TIMESTAMP(), - `description` = :description"; - $config_statement = DBManager::get()->prepare($query); - - $config_statement->execute([ - ':field' => 'OERCAMPUS_ENABLED', - ':value' => '1', - ':type' => 'boolean', - ':range' => 'global', - ':section' => 'OERCampus', - ':description' => 'Ist der OER Campus aktiviert?', - ]); - - //Alte Dateien des Lernmarktplatzes umziehen: - if (is_dir($GLOBALS['STUDIP_BASE_PATH'].'/data/lehrmarktplatz')) { - foreach (scandir($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz") as $file) { - if ($file[0] !== ".") { - @rename( - $GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz/".$file, - $GLOBALS['OER_PATH']."/".$file - ); - } - } - @unlink($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz"); - } - if (is_dir($GLOBALS['STUDIP_BASE_PATH'].'/data/lehrmarktplatz_images')) { - foreach (scandir($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz_images") as $file) { - if ($file[0] !== ".") { - @rename( - $GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz_images/".$file, - $GLOBALS['OER_LOGOS_PATH']."/".$file - ); - } - } - @unlink($GLOBALS['STUDIP_BASE_PATH']."/data/lehrmarktplatz_images"); - } - - } else { - DBManager::get()->exec(" - CREATE TABLE `oer_abo` ( - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - UNIQUE KEY `user_id` (`user_id`,`material_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_comments` ( - `comment_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `review_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `foreign_comment_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `comment` text NOT NULL, - `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`comment_id`), - KEY `review_id` (`review_id`), - KEY `foreign_comment_id` (`foreign_comment_id`), - KEY `host_id` (`host_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_downloadcounter` ( - `counter_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `longitude` double DEFAULT NULL, - `latitude` double DEFAULT NULL, - `mkdate` int(11) DEFAULT NULL, - PRIMARY KEY (`counter_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_hosts` ( - `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(64) NOT NULL, - `url` varchar(200) NOT NULL, - `public_key` text NOT NULL, - `private_key` text DEFAULT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - `index_server` tinyint(4) NOT NULL DEFAULT 0, - `allowed_as_index_server` tinyint(4) NOT NULL DEFAULT 1, - `last_updated` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - `mkdate` bigint(20) NOT NULL, - PRIMARY KEY (`host_id`), - UNIQUE KEY `url` (`url`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_material` ( - `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `foreign_material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `name` varchar(64) NOT NULL, - `category` varchar(64) NOT NULL DEFAULT '', - `draft` tinyint(1) NOT NULL DEFAULT 0, - `filename` varchar(64) NOT NULL, - `short_description` varchar(100) DEFAULT NULL, - `description` text NOT NULL, - `difficulty_start` tinyint(12) NOT NULL DEFAULT 1, - `difficulty_end` tinyint(12) NOT NULL DEFAULT 12, - `player_url` varchar(256) DEFAULT NULL, - `tool` varchar(128) DEFAULT NULL, - `content_type` varchar(64) NOT NULL, - `front_image_content_type` varchar(64) DEFAULT NULL, - `structure` text DEFAULT NULL, - `rating` double DEFAULT NULL, - `license_identifier` varchar(64) NOT NULL DEFAULT 'CC BY SA 3.0', - `chdate` bigint(20) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`material_id`), - KEY `host_id` (`host_id`), - KEY `category` (`category`), - KEY `foreign_material_id` (`foreign_material_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_material_users` ( - `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `external_contact` int(11) NOT NULL DEFAULT 0, - `position` int(11) NOT NULL DEFAULT 1, - `chdate` int(11) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`material_id`,`user_id`,`external_contact`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_reviews` ( - `review_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `foreign_review_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `rating` int(11) NOT NULL, - `review` text NOT NULL, - `chdate` int(11) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`review_id`), - UNIQUE KEY `unique_users` (`user_id`,`host_id`,`material_id`), - KEY `material_id` (`material_id`), - KEY `foreign_review_id` (`foreign_review_id`), - KEY `user_id` (`user_id`), - KEY `host_id` (`host_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_tags` ( - `tag_hash` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(64) NOT NULL, - PRIMARY KEY (`tag_hash`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_tags_material` ( - `material_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `tag_hash` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - UNIQUE KEY `unique_tags` (`material_id`,`tag_hash`), - KEY `tag_hash` (`tag_hash`), - KEY `material_id` (`material_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - DBManager::get()->exec(" - CREATE TABLE `oer_user` ( - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `foreign_user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `host_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(100) NOT NULL, - `avatar` varchar(256) DEFAULT NULL, - `description` text DEFAULT NULL, - `chdate` int(11) NOT NULL, - `mkdate` int(11) NOT NULL, - PRIMARY KEY (`user_id`), - UNIQUE KEY `unique_users` (`foreign_user_id`,`host_id`), - KEY `foreign_user_id` (`foreign_user_id`), - KEY `host_id` (`host_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - - $query = "INSERT INTO `config` - SET `field` = :field, - `value` = :value, - `type` = :type, - `range` = :range, - `section` = :section, - `mkdate` = UNIX_TIMESTAMP(), - `chdate` = UNIX_TIMESTAMP(), - `description` = :description"; - $config_statement = DBManager::get()->prepare($query); - - $config_statement->execute([ - ':field' => 'OERCAMPUS_ENABLED', - ':value' => '1', - ':type' => 'boolean', - ':range' => 'global', - ':section' => 'OERCampus', - ':description' => 'Ist der OER Campus aktiviert?', - ]); - $config_statement->execute([ - ':field' => 'OER_PUBLIC_STATUS', - ':value' => 'autor', - ':type' => 'string', - ':range' => 'global', - ':section' => 'OERCampus', - ':description' => 'Ab welchem Nutzerstatus (nobody, user, autor, tutor, dozent) darf man den Marktplatz sehen?', - ]); - $config_statement->execute([ - ':field' => 'OER_DISABLE_LICENSE', - ':value' => '0', - ':type' => 'boolean', - ':range' => 'global', - ':section' => 'OERCampus', - ':description' => 'Sollen die Lizenzen deaktiviert / nicht angezeigt werden?', - ]); - $config_statement->execute([ - ':field' => 'OER_TITLE', - ':value' => 'OER Campus', - ':type' => 'string', - ':range' => 'global', - ':section' => 'OERCampus', - ':description' => 'Name des OER Campus in Stud.IP', - ]); - } - - //Adding licenses to Stud.IP: - DBManager::get()->exec(" - CREATE TABLE `licenses` ( - `identifier` varchar(64) NOT NULL COMMENT 'According to SPDX standard if able.', - `name` varchar(128) DEFAULT NULL, - `link` varchar(256) DEFAULT NULL, - `default` tinyint(1) DEFAULT 0, - `description` text DEFAULT NULL, - `chdate` int(11) DEFAULT NULL, - `mkdate` int(11) DEFAULT NULL, - PRIMARY KEY (`identifier`), - KEY `default` (`default`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; - "); - - DBManager::get()->exec(" - ALTER TABLE `oer_material` ADD INDEX ( `license_identifier` ) - "); - DBManager::get()->exec(" - UPDATE `oer_material` - SET license_identifier = 'CC-BY-SA-3.0' - "); - - - DBManager::get()->exec(" - INSERT INTO `licenses` (`identifier`, `name`, `link`, `default`, `description`, `chdate`, `mkdate`) - VALUES - ('CC-BY-1.0','Creative Commons Attribution 1.0 Generic','https://creativecommons.org/licenses/by/1.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-2.0','Creative Commons Attribution 2.0 Generic','https://creativecommons.org/licenses/by/2.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-2.5','Creative Commons Attribution 2.5 Generic','https://creativecommons.org/licenses/by/2.5/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-3.0','Creative Commons Attribution 3.0 Unported','https://creativecommons.org/licenses/by/3.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-4.0','Creative Commons Attribution 4.0 International','https://creativecommons.org/licenses/by/4.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-SA-1.0','Creative Commons Attribution Share Alike 1.0 Generic','https://creativecommons.org/licenses/by-sa/1.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-SA-2.0','Creative Commons Attribution Share Alike 2.0 Generic','https://creativecommons.org/licenses/by-sa/2.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-SA-2.5','Creative Commons Attribution Share Alike 2.5 Generic','https://creativecommons.org/licenses/by-sa/2.5/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-SA-3.0','Creative Commons Attribution Share Alike 3.0 Unported','https://creativecommons.org/licenses/by-sa/3.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-BY-SA-4.0','Creative Commons Attribution Share Alike 4.0 International','https://creativecommons.org/licenses/by-sa/4.0/legalcode',1,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC-PDDC','Creative Commons Public Domain Dedication and Certification','https://creativecommons.org/licenses/publicdomain/',0,'Diese Lizenz ist nur sinnvoll, wenn Sie Material eintragen, das gemeinfrei ist. Gemeinfreie Materialien stammen von Autoren, die mindetens 80 Jahre tot sind, oder von Autoren, die im Ausland leben und ihre Werke unter die sogenannte Public Domain gestellt haben. Diese Lizenz ist nicht sinnvoll für Werke, bei denen ein Copyright besteht.',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), - ('CC0-1.0','Creative Commons Zero v1.0 Universal','https://creativecommons.org/publicdomain/zero/1.0/legalcode',0,NULL,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()); - "); - - - } - - - public function down() - { - - } - -} diff --git a/db/migrations/20210226_step_00353_cache.php b/db/migrations/20210226_step_00353_cache.php deleted file mode 100644 index 901db60..0000000 --- a/db/migrations/20210226_step_00353_cache.php +++ /dev/null @@ -1,62 +0,0 @@ -execute("CREATE TABLE IF NOT EXISTS `cache_types` ( - `cache_id` INT NOT NULL AUTO_INCREMENT, - `class_name` VARCHAR(255) NOT NULL, - `chdate` INT(11) DEFAULT NULL, - `mkdate` INT(11) DEFAULT NULL, - PRIMARY KEY (`cache_id`), - UNIQUE KEY (`class_name`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - $types = [ - 'StudipDbCache', - 'StudipFileCache', - 'StudipMemcachedCache', - 'StudipRedisCache' - ]; - - // Insert pre-defined cache types in to database - foreach ($types as $type) { - DBManager::get()->execute( - "INSERT IGNORE INTO `cache_types` (`class_name`, `mkdate`, `chdate`) - VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", [$type]); - } - - // Remove other set cache config entries. - $fields = ['cache_class', 'cache_class_file', 'cache_init_args']; - DBManager::get()->execute("DELETE FROM `config_values` WHERE `field` IN (:fields)", ['fields' => $fields]); - DBManager::get()->execute("DELETE FROM `config` WHERE `field` IN (:fields)", ['fields' => $fields]); - - // Set StudipDbCache as (possibly new) default - $cache = [ - 'type' => 'StudipDbCache', - 'config' => [] - ]; - DBManager::get()->execute("INSERT IGNORE INTO `config` VALUES - (:field, :value, 'array', 'global', 'global', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc)", - [ - 'field' => 'SYSTEMCACHE', - 'value' => json_encode($cache), - 'desc' => 'Typ und Konfiguration des zu verwendenden Systemcaches' - ] - ); - } - - public function down() - { - DBManager::get()->execute("DROP TABLE IF EXISTS `cache_types`"); - DBManager::get()->execute("DELETE FROM `config_values` WHERE `field` = :field", ['field' => 'SYSTEMCACHE']); - DBManager::get()->execute("DELETE FROM `config` WHERE `field` = :field", ['field' => 'SYSTEMCACHE']); - } -} diff --git a/db/migrations/20210317_change_blubber_thread_following.php b/db/migrations/20210317_change_blubber_thread_following.php deleted file mode 100644 index dadd953..0000000 --- a/db/migrations/20210317_change_blubber_thread_following.php +++ /dev/null @@ -1,81 +0,0 @@ -query($query); - - if ($result && $result->rowCount() > 0) { - return; - } - - // Alter table to reflect new state - $query = "RENAME TABLE `blubber_threads_unfollow` TO `blubber_threads_followstates`"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `blubber_threads_followstates` - ADD COLUMN `state` ENUM('followed', 'unfollowed') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'unfollowed' AFTER `user_id`"; - DBManager::get()->exec($query); - - // Insert commented users from global stream - $query = "INSERT IGNORE INTO `blubber_threads_followstates` - SELECT DISTINCT 'global', `user_id`, 'followed', UNIX_TIMESTAMP() - FROM `blubber_comments` - WHERE `thread_id` = 'global' - AND NOT EXISTS ( - SELECT 1 - FROM `blubber_threads_followstates` - WHERE `blubber_comments`.`user_id` = `blubber_threads_followstates`.`user_id` - AND `blubber_threads_followstates`.`thread_id` = 'global' - AND `blubber_threads_followstates`.`state` = 'unfollowed' - )"; - - // Create config entries - $query = "INSERT 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' => 'BLUBBER_GLOBAL_THREAD_OPTOUT', - ':description' => 'Gibt an, ob beim globalen Blubber Thread ein Opt-Out-Verfahren genutzt werden soll', - ':section' => 'global', - ':range' => 'global', - ':type' => 'boolean', - ':value' => '1' - ]); - - // Activate added routes - require_once $GLOBALS['STUDIP_BASE_PATH'] . '/app/routes/Blubber.php'; - RESTAPI\ConsumerPermissions::get()->activateRouteMap(new RESTAPI\Routes\Blubber()); - } - - public function down() - { - // Remove config entry - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'BLUBBER_GLOBAL_THREAD_OPTOUT'"; - DBManager::get()->exec($query); - - // Clean follow states table - $query = "DELETE FROM `blubber_threads_followstates` - WHERE `state` = 'followed'"; - DBManager::get()->exec($query); - - // Drop state - $query = "ALTER TABLE `blubber_threads_followstates` - DROP COLUMN `state`"; - DBManager::get()->exec($query); - - // Rename table - $query = "RENAME TABLE `blubber_threads_followstates` TO `blubber_threads_unfollow`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20210322_migration_history_reworked.php b/db/migrations/20210322_migration_history_reworked.php deleted file mode 100644 index 4809b8d..0000000 --- a/db/migrations/20210322_migration_history_reworked.php +++ /dev/null @@ -1,44 +0,0 @@ -prepare($query); - - $statement->execute([ - ':name' => 'MIGRATE_UP', - ':description' => 'Migration wird durchgeführt', - ':template' => '%user hat Migration %affected ausgeführt (Domain: %coaffected)', - ':active' => 1, - ]); - $statement->execute([ - ':name' => 'MIGRATE_DOWN', - ':description' => 'Migration wird zurückgenommen', - ':template' => '%user hat Migration %affected zurückgenommen (Domain: %coaffected)', - ':active' => 1, - ]); - } - - public function down() - { - // Remove log actions - $query = "DELETE `log_actions`, `log_events` - FROM `log_actions` - LEFT JOIN `log_events` USING (`action_id`) - WHERE MD5(:name) = `action_id`"; - $statement = DBManager::get()->prepare($query); - $statement->execute([':name' => 'MIGRATE_UP']); - $statement->execute([':name' => 'MIGRATE_DOWN']); - } -} diff --git a/db/migrations/20210406_add_terms_accepted_config.php b/db/migrations/20210406_add_terms_accepted_config.php deleted file mode 100644 index 62c1ae1..0000000 --- a/db/migrations/20210406_add_terms_accepted_config.php +++ /dev/null @@ -1,26 +0,0 @@ -exec($query); - } - - protected function down() - { - $query = "DELETE FROM `config` - WHERE `field` = 'TERMS_ACCEPTED'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20210422_add_missing_evaluation_configuration.php b/db/migrations/20210422_add_missing_evaluation_configuration.php deleted file mode 100644 index aca5e69..0000000 --- a/db/migrations/20210422_add_missing_evaluation_configuration.php +++ /dev/null @@ -1,31 +0,0 @@ -exec($query); - } - - protected function down() - { - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = 'EVAL_AUSWERTUNG_GRAPH_FORMAT'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20210425_biest_11462_change_column_types.php b/db/migrations/20210425_biest_11462_change_column_types.php deleted file mode 100644 index 9706313..0000000 --- a/db/migrations/20210425_biest_11462_change_column_types.php +++ /dev/null @@ -1,29 +0,0 @@ -exec($query); - } - - protected function down() - { - $query = "ALTER TABLE `userfilter_fields` - MODIFY COLUMN `type` VARCHAR(255) DEFAULT NULL, - MODIFY COLUMN `value` VARCHAR(255) DEFAULT NULL, - MODIFY COLUMN `compare_op` VARCHAR(255) DEFAULT NULL"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/20210503_drop_citation_style.php b/db/migrations/20210503_drop_citation_style.php deleted file mode 100644 index e708e5a..0000000 --- a/db/migrations/20210503_drop_citation_style.php +++ /dev/null @@ -1,43 +0,0 @@ -exec($query); - } - - public function down() - { - // create config entries - $query = "INSERT 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' => 'COURSE_LIBRARY_CITATION_STYLE', - ':description' => 'Der standardmäßig genutzte Zitationsstil innerhalb der Veranstaltung.', - ':section' => 'Library', - ':range' => 'course', - ':type' => 'string', - ':value' => '' - ]); - $statement->execute([ - ':name' => 'USER_LIBRARY_CITATION_STYLE', - ':description' => 'Der präferierte Zitationsstil einer Person.', - ':section' => 'Library', - ':range' => 'user', - ':type' => 'string', - ':value' => '' - ]); - } -} diff --git a/db/migrations/20210505_tic11044_admin_course_notices_2.php b/db/migrations/20210505_tic11044_admin_course_notices_2.php deleted file mode 100644 index b5b1eca..0000000 --- a/db/migrations/20210505_tic11044_admin_course_notices_2.php +++ /dev/null @@ -1,88 +0,0 @@ -exec($query); - - // Migrate contents - $query = "INSERT IGNORE INTO `config_values` (`field`, `range_id`, `value`, `mkdate`, `chdate`, `comment`) - SELECT 'COURSE_ADMIN_NOTICE', dfe.`range_id`, dfe.`content`, dfe.`mkdate`, dfe.`chdate`, '' - FROM `datafields_entries` AS dfe - JOIN `datafields` AS df USING (`datafield_id`) - WHERE df.`name` = 'Notiz zu einer Veranstaltung' - AND df.`object_type` = 'sem'"; - DBManager::get()->exec($query); - - // Delete datafield and values - $query = "DELETE `datafields`, `datafields_entries` - FROM `datafields` - LEFT JOIN `datafields_entries` USING (`datafield_id`) - WHERE `datafields`.`name` = 'Notiz zu einer Veranstaltung'"; - DBManager::get()->execute($query); - } - - public function down() - { - $id = md5(uniqid(__CLASS__, true)); - - // Create datafield - $query = "SELECT 1 + MAX(`priority`) - FROM `datafields` - WHERE `object_type` = 'sem'"; - $priority = DBManager::get()->fetchColumn($query) ?: 0; - - $query = "INSERT IGNORE INTO `datafields` ( - `datafield_id`, `name`, - `object_type`, `object_class`, - `edit_perms`, `view_perms`, - `system`, `priority`, - `mkdate`, `chdate`, - `type`, `typeparam`, - `is_required`, `is_userfilter`, - `description` - ) VALUES ( - :id, 'Notiz zu einer Veranstaltung', - 'sem', NULL, - 'admin', 'admin', - 1, :priority, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'textarea', '', - 0, 0, - 'Enthält etwaige Notizen von Admins zu Veranstaltungen' - )"; - DBManager::get()->execute($query, [ - ':id' => $id, - ':priority' => $priority, - ]); - - // Migrate contents - $query = "INSERT IGNORE INTO `datafields_entries` (`datafield_id`, `range_id`, `content`, `mkdate`, `chdate`) - SELECT :id, `range_id`, `value`, `mkdate`, `chdate` - FROM `config_values` - WHERE `field` = 'COURSE_ADMIN_NOTICE'"; - DBManager::get()->exec($query); - - // Remove course config - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `config`.`field` = 'ADMIN_COURSE_NOTICE'"; - DBManager::get()->execute($query); - } -} diff --git a/db/migrations/20210511_courseware_integration.php b/db/migrations/20210511_courseware_integration.php deleted file mode 100755 index 281a2b4..0000000 --- a/db/migrations/20210511_courseware_integration.php +++ /dev/null @@ -1,199 +0,0 @@ -exec("CREATE TABLE `cw_blocks` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `container_id` int(11) NOT NULL, - `owner_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `edit_blocker_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - `position` int(11) NOT NULL, - `block_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NULL, - `visible` tinyint(1) NOT NULL, - `payload` MEDIUMTEXT NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - INDEX index_container_id (`container_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_block_comments` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `block_id` int(11) NOT NULL, - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `comment` MEDIUMTEXT NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - INDEX index_block_id (`block_id`), - INDEX index_user_id (`user_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_bookmarks` ( - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `element_id` int(11) NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`user_id`,`element_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_containers` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `structural_element_id` int(11) NOT NULL, - `owner_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `edit_blocker_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - `position` int(11) NOT NULL, - `site` int(11) NOT NULL, - `container_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `visible` tinyint(1) NOT NULL, - `payload` MEDIUMTEXT NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - INDEX index_structural_element_id (`structural_element_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_structural_elements` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `parent_id` int(11) NULL DEFAULT NULL, - `range_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `range_type` ENUM('course', 'user') COLLATE latin1_bin, - `owner_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `editor_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `edit_blocker_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - `position` int(11) NOT NULL, - `title` varchar(255) NOT NULL, - `image_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL, - `purpose` ENUM('content', 'template', 'oer', 'portfolio', 'draft', 'other') COLLATE latin1_bin, - `payload` MEDIUMTEXT NOT NULL, - `public` tinyint(1) NOT NULL, - `release_date` int(11) NOT NULL, - `withdraw_date` int(11) NOT NULL, - `read_approval` TEXT NOT NULL, - `write_approval` TEXT NOT NULL, - `copy_approval` TEXT NOT NULL, - `external_relations` TEXT NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - INDEX index_parent_id (`parent_id`), - INDEX index_range_id (`range_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_user_data_fields` ( - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `block_id` int(11) NOT NULL, - `payload` TEXT NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`user_id`,`block_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_user_progresses` ( - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `block_id` int(11) NOT NULL, - `grade` float NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`user_id`,`block_id`) - ) - "); - - $db->exec("CREATE TABLE `cw_block_feedbacks` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `block_id` int(11) NOT NULL, - `user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `feedback` MEDIUMTEXT NOT NULL, - `mkdate` int(11) NOT NULL, - `chdate` int(11) NOT NULL, - PRIMARY KEY (`id`), - INDEX index_block_id (`block_id`), - INDEX index_user_id (`user_id`) - ) - "); - - $query = 'INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'; - $statement = $db->prepare($query); - - $statement->execute([ - ':name' => 'COURSEWARE_FAVORITE_BLOCK_TYPES', - ':description' => 'In dieser Konfigurationseinstellung können Nutzende ihre Lieblingsblocktypen speichern.', - ':range' => 'user', - ':type' => 'array', - ':value' => '[]' - ]); - $statement->execute([ - ':name' => 'COURSEWARE_SEQUENTIAL_PROGRESSION', - ':description' => 'Mit dieser Konfigurationseinstellung wird für eine Courseware festgelegt, ob Lernende sequentiell durch die Inhalte gehen müssen.', - ':range' => 'range', - ':type' => 'boolean', - ':value' => '0' - ]); - $statement->execute([ - ':name' => 'COURSEWARE_EDITING_PERMISSION', - ':description' => 'Mit dieser Konfigurationseinstellung wird für eine Courseware festgelegt, welche Rechtestufe Inhalte editieren dürfen.', - ':range' => 'range', - ':type' => 'string', - ':value' => 'dozent' - ]); - $statement->execute([ - ':name' => 'COURSEWARE_LAST_ELEMENT', - ':description' => 'In dieser Konfigurationseinstellung werden die zuletzt besuchten Elemente in allen Coursewares abgelegt.', - ':range' => 'user', - ':type' => 'array', - ':value' => '[]' - ]); - - $db->exec("INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) - VALUES ('CoursewareModule', 'Courseware', 'CorePlugin,StudipModule,SystemPlugin', 'yes', 1) - "); - - $sql = "INSERT INTO roles_plugins (roleid, pluginid) - SELECT roleid, ? - FROM roles - WHERE `system` = 'y' - "; - $db->execute($sql, [$db->lastInsertId()]); - } - - public function down() - { - $db = \DBManager::get(); - - $db->exec("DROP TABLE IF EXISTS `cw_blocks`, `cw_block_comments`, `cw_bookmarks`, `cw_containers`, `cw_structural_elements`, `cw_user_data_fields`, `cw_user_progresses`, `cw_block_feedbacks`"); - - - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` = :field"; - $statement = $db->prepare($query); - - $statement->execute( [ ':field' => 'COURSEWARE_FAVORITE_BLOCK_TYPES' ] ); - $statement->execute( [ ':field' => 'COURSEWARE_SEQUENTIAL_PROGRESSION' ] ); - $statement->execute( [ ':field' => 'COURSEWARE_EDITING_PERMISSION' ] ); - $statement->execute( [ ':field' => 'COURSEWARE_LAST_ELEMENT' ] ); - - $db->exec("DELETE plugins, roles_plugins FROM plugins LEFT JOIN roles_plugins USING(pluginid) - WHERE pluginclassname = 'CoursewareModule' - "); - } -} diff --git a/db/migrations/202106231_add_content_widget.php b/db/migrations/202106231_add_content_widget.php deleted file mode 100644 index bed585f..0000000 --- a/db/migrations/202106231_add_content_widget.php +++ /dev/null @@ -1,46 +0,0 @@ -fetchColumn("SELECT navigationpos FROM plugins ORDER BY navigationpos DESC") + 1; - - // insert plugin into db - $db->execute("INSERT INTO plugins - (pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos) - VALUES (?, ?, ?, 'PortalPlugin', 'yes', ?)", - [$classname, 'core/' . $classname, $classname, $navpos]); - - // get id of newly created plugin (we purposely do not use PDO::lastInserId()) - $plugin_id = $db->fetchColumn("SELECT pluginid FROM plugins WHERE pluginclassname = ?", [$classname]); - - // set all default roles for the plugin - $stmt = $db->prepare("INSERT INTO roles_plugins - (roleid, pluginid) VALUES (?, ?)"); - foreach (range(1, 6) as $role_id) { - $stmt->execute([$role_id, $plugin_id]); - } - } - - public function down() - { - $db = DBManager::get(); - $classname = 'ContentsWidget'; - // get id of widget - $widget_id = $db->fetchColumn("SELECT pluginid FROM plugins WHERE pluginclassname = ?", [$classname]); - $db->execute("DELETE FROM plugins WHERE pluginid = ?", [$widget_id]); - $db->execute("DELETE FROM widget_default WHERE pluginid = ?", [$widget_id]); - $db->execute("DELETE FROM widget_user WHERE pluginid = ?", [$widget_id]); - $db->execute("DELETE FROM roles_plugins WHERE pluginid = ?", [$widget_id]); - } -} - diff --git a/db/migrations/202_remove_skype_status.php b/db/migrations/202_remove_skype_status.php deleted file mode 100644 index 1a4a298..0000000 --- a/db/migrations/202_remove_skype_status.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license GPL2 or any later version - */ -class RemoveSkypeStatus extends Migration -{ - public function description() - { - return 'Removes user config entries for skype status'; - } - - public function up() - { - $query = "DELETE FROM `user_config` - WHERE `field` = 'SKYPE_ONLINE_STATUS'"; - DBManager::get()->exec($query); - } - - public function down() - { - // Nothing since there was not default entry for SKYPE_ONLINE_STATUS - } -} diff --git a/db/migrations/203_archive_help_texts.php b/db/migrations/203_archive_help_texts.php deleted file mode 100644 index c0415af..0000000 --- a/db/migrations/203_archive_help_texts.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @license GPL2 or any later version - */ -class ArchiveHelpTexts extends Migration -{ - public function description() - { - return 'Adds / updates help texts for the controllers search/archive and course/archive.'; - } - - public function up() - { - $db = DBManager::get(); - - $db->exec(" - INSERT INTO help_content (global_content_id, content_id, language, content, route, studip_version) - VALUES('55499281ce1a4757f17aaf73faa072ea', '55499281ce1a4757f17aaf73faa072ea', 'de', 'Auf dieser Seite können sie sich vor dem Archivieren vergewissern, das die richtige(n) Veranstaltunge(n) zum Archivieren ausgewählt wurden.', 'dispatch.php/course/archive/confirm', '4.0'); - "); - $db->exec(" - INSERT INTO help_content (global_content_id, content_id, language, content, route, studip_version) - VALUES('a2a649de15c8d8473b11fccc731dc80f', 'a2a649de15c8d8473b11fccc731dc80f', 'en', 'Before archiving you can check on this page that the right course(s) have been selected for archiving.', 'dispatch.php/course/archive/confirm', '4.0'); - "); - $db->exec(" - UPDATE help_content SET route = 'dispatch.php/search/archive' WHERE route = 'archiv.php'; - "); - - $db = null; - } - - public function down() - { - $db = DBManager::get(); - - $db->exec(" - DELETE FROM help_content where route = 'dispatch.php/course/archive/confirm'; - "); - $db->exec(" - UPDATE help_content SET route = 'archiv.php' WHERE route = 'dispatch.php/search/archive'; - "); - - $db = null; - } -} diff --git a/db/migrations/204_dialog_from_notification.php b/db/migrations/204_dialog_from_notification.php deleted file mode 100644 index 19e32ae..0000000 --- a/db/migrations/204_dialog_from_notification.php +++ /dev/null @@ -1,24 +0,0 @@ -exec(" - ALTER TABLE personal_notifications - ADD `dialog` TINYINT NOT NULL DEFAULT '0' AFTER `avatar` - "); - } - - public function down() - { - DBManager::get()->exec(" - ALTER TABLE personal_notifications - DROP `dialog` - "); - } -} diff --git a/db/migrations/205_course_scm_helptext.php b/db/migrations/205_course_scm_helptext.php deleted file mode 100644 index 071daa3..0000000 --- a/db/migrations/205_course_scm_helptext.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @license GPL2 or any later version - */ -class CourseScmHelptext extends Migration -{ - public function description() - { - return 'Adds a help text for the free information page in a course.'; - } - - public function up() - { - $db = DBManager::get(); - - $db->exec(" - INSERT INTO help_content (global_content_id, content_id, language, content, route, studip_version) - VALUES - ('142482b4b06a376b2eb4c91d38559a15', '142482b4b06a376b2eb4c91d38559a15', 'de', 'Freie Gestaltung von Reiternamen und Inhalten durch Lehrende. Es gibt Raum für eigene Informationen, der Name des Reiters ist frei definierbar. Es können beliebig viele Einträge (\"neue Einträge\") hinzugefügt werden.', 'dispatch.php/course/scm', '4.0') - ;" - ); - - $db = null; - } - - public function down() - { - $db = DBManager::get(); - - $db->exec( - "DELETE FROM help_content WHERE content_id = '142482b4b06a376b2eb4c91d38559a15';" - ); - - $db = null; - } -} diff --git a/db/migrations/206_alter_columns_weekoffset_to_int.php b/db/migrations/206_alter_columns_weekoffset_to_int.php deleted file mode 100644 index ad4e312..0000000 --- a/db/migrations/206_alter_columns_weekoffset_to_int.php +++ /dev/null @@ -1,32 +0,0 @@ - - * @license GPL2 or any later version - * Date: 19.10.16 - */ -class AlterColumnsWeekoffsetToInt extends Migration -{ - - function description() - { - return 'Alter the two columns week_offset and end_offset in table seminar_cycle_dates .'; - } - - function up() - { - DBManager::get()->exec( - "ALTER table `seminar_cycle_dates` - CHANGE column `week_offset` `week_offset` INT NOT NULL DEFAULT '0', CHANGE column `end_offset` `end_offset` INT DEFAULT NULL"); - } - - function down() - { - DBManager::get()->exec( - "ALTER table `seminar_cycle_dates` - CHANGE column `week_offset` `week_offset` TINYINT NOT NULL DEFAULT '0', CHANGE column `end_offset` `end_offset` TINYINT DEFAULT NULL"); - } - -} diff --git a/db/migrations/207_add_etask_tables.php b/db/migrations/207_add_etask_tables.php deleted file mode 100644 index abe2313..0000000 --- a/db/migrations/207_add_etask_tables.php +++ /dev/null @@ -1,138 +0,0 @@ - - */ -class AddEtaskTables extends Migration -{ - - public function description() - { - return 'Adds the eAufgaben tables.'; - } - - public function up() - { - $db = DBManager::get(); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_tasks` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `type` VARCHAR(64) NOT NULL, - `title` VARCHAR(255) NOT NULL, - `description` TEXT NOT NULL, - `task` TEXT NOT NULL, - `user_id` CHAR(32) NOT NULL, - `mkdate` INT(11) NOT NULL, - `chdate` INT(11) NOT NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_task_tags` ( - `task_id` INT(11) NOT NULL, - `user_id` CHAR(32) NOT NULL, - `tag` VARCHAR(64) NOT NULL, - PRIMARY KEY (`task_id`, `user_id`, `tag`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_tests` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `title` VARCHAR(255) NOT NULL, - `description` TEXT NOT NULL, - `user_id` CHAR(32) NOT NULL, - `mkdate` INT(11) NOT NULL, - `chdate` INT(11) NOT NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_test_tags` ( - `test_id` INT(11) NOT NULL, - `user_id` CHAR(32) NOT NULL, - `tag` VARCHAR(64) NOT NULL, - PRIMARY KEY (`test_id`, `user_id`, `tag`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_test_tasks` ( - `test_id` INT(11) NOT NULL, - `task_id` INT(11) NOT NULL, - `position` INT(11) NOT NULL, - `points` FLOAT NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`test_id`, `task_id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_assignments` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `test_id` INT(11) NOT NULL, - `range_type` ENUM('course', 'global', 'group', 'institute', 'user') NULL, - `range_id` CHAR(32) NULL, - `type` VARCHAR(64) NOT NULL, - `start` INT(11) NULL, - `end` INT(11) NULL, - `active` TINYINT(1) NOT NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_assignment_ranges` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `assignment_id` INT(11) NOT NULL, - `range_type` ENUM('course', 'global', 'group', 'institute', 'user') NOT NULL, - `range_id` CHAR(32) NOT NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assignment_id` (`assignment_id`,`range_type`,`range_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_assignment_attempts` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `assignment_id` INT(11) NOT NULL, - `user_id` CHAR(32) NOT NULL, - `start` INT(11) NULL, - `end` INT(11) NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - - $db->exec(" - CREATE TABLE IF NOT EXISTS `etask_responses` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `assignment_id` INT(11) NOT NULL, - `task_id` INT(11) NOT NULL, - `user_id` CHAR(32) NOT NULL, - `response` TEXT NOT NULL, - `state` TINYINT(1) NULL, - `points` FLOAT NULL, - `feedback` TEXT NULL, - `grader_id` CHAR(32) NULL, - `mkdate` INT(11) NOT NULL, - `chdate` INT(11) NOT NULL, - `options` TEXT NOT NULL, - PRIMARY KEY (`id`)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC - "); - } - - public function down() - { - foreach ([ - 'etask_tasks', 'etask_task_tags', - 'etask_tests', 'etask_test_tags', - 'etask_test_tasks', 'etask_assignments', - 'etask_assignment_attempts', 'etask_responses' - ] as $table) { - # $db->exec('DROP TABLE IF EXISTS `' . $table . '`'); - } - } -} diff --git a/db/migrations/208_migrate_questionnaire_questions.php b/db/migrations/208_migrate_questionnaire_questions.php deleted file mode 100644 index 87dee2c..0000000 --- a/db/migrations/208_migrate_questionnaire_questions.php +++ /dev/null @@ -1,294 +0,0 @@ - - */ -class MigrateQuestionnaireQuestions extends Migration -{ - - public function description() - { - return 'Migrates questions of the questionnaires to eTask compatible tasks.'; - } - - public function up() - { - $this->db = DBManager::get(); - $this->addEtaskIDToQuestionsTable(); - - foreach ($this->fetchQuestions() as $question) { - $this->migrateQuestion($question); - } - - $this->migrateMCAnswers(); - - $this->removeQuestionTypeAndDataFromQuestionsTable(); - } - - public function down() - { - $this->db = DBManager::get(); - $this->addQuestionTypeAndDataFromQuestionsTable(); - - foreach ($this->fetchQuestions() as $question) { - $this->unmigrateQuestion($question); - } - - $this->removeEtaskIDToQuestionsTable(); - } - - // ***** PRIVATES ***** - - private function addEtaskIDToQuestionsTable() - { - $this->db->exec(" - ALTER TABLE `questionnaire_questions` - ADD `etask_task_id` INT NOT NULL - AFTER `questionnaire_id` - "); - } - - private function addQuestionTypeAndDataFromQuestionsTable() - { - $this->db->exec(" - ALTER TABLE `questionnaire_questions` - ADD `questiondata` text NOT NULL AFTER `questionnaire_id`, - ADD `questiontype` varchar(64) NOT NULL AFTER `questionnaire_id` - "); - } - - private function connectTaskToQuestion($taskID, $questionID) - { - $stmt = $this->db->prepare(" - UPDATE questionnaire_questions - SET etask_task_id = ? - WHERE question_id = ? - "); - - $stmt->execute([ $taskID, $questionID ]); - } - - private function fetchTask($id) - { - $stmt = $this->db->prepare(" - SELECT * FROM `etask_tasks` WHERE id = ? - "); - $stmt->execute([$id]); - - return $stmt->fetch(PDO::FETCH_ASSOC); - } - - private function fetchQuestions() - { - $stmt = $this->db->prepare('SELECT * FROM `questionnaire_questions`'); - $stmt->execute(); - $stmt->setFetchMode(PDO::FETCH_ASSOC); - - return $stmt; - } - - private function findOwner($questionID) - { - $stmt = $this->db->prepare(" - SELECT user_id - FROM `questionnaire_questions` - INNER JOIN questionnaires - USING ( questionnaire_id ) - WHERE question_id = ? LIMIT 1 - "); - - $stmt->execute([ $questionID ]); - - return $stmt->fetchColumn(); - } - - private function fetchMCAnswers() - { - $stmt = $this->db->prepare(" - SELECT answer_id, answerdata - FROM `questionnaire_answers` - WHERE answerdata LIKE '%{\"answers\":%' - "); - $stmt->execute([]); - $stmt->setFetchMode(PDO::FETCH_NUM); - - return $stmt; - } - - private function migrateMCAnswers() - { - $updateStmt = $this->db->prepare(" - UPDATE questionnaire_answers SET answerdata = ? WHERE answer_id = ? - "); - - $decr = function ($item) { - return intval($item) - 1; - }; - - foreach ($this->fetchMCAnswers() as $answer) { - list($answerID, $answerData) = $answer; - - $data = (array)json_decode($answerData, true); - if (is_array($data['answers'])) { - $dataAnswers = array_map($decr, $data['answers']); - } else { - $dataAnswers = $decr($data['answers']); - } - - $data['answers'] = $dataAnswers; - - $updateStmt->execute( - [ - json_encode($data), - $answerID - ] - ); - } - } - - private function migrateQuestion($questionAry) - { - $task = null; - - switch ($type = $questionAry['questiontype']) { - case 'Test': - case 'Vote': - $task = $this->migrateTypeVoteOrTest($questionAry); - break; - - case 'Datefinder': - $task = $this->migrateTypeDatefinder($questionAry); - break; - - default: - throw new RuntimeException("Unknown Type: " . $type); - } - - $this->connectTaskToQuestion($task->id, $questionAry['question_id']); - } - - private function migrateTypeDatefinder($questionAry) - { - $oldData = (array)json_decode($questionAry['questiondata'], true); - - $description = $oldData['question'] ?: ''; - $userID = $this->findOwner($questionAry['question_id']); - - $task = [ - 'automatic' => $oldData['automatic'] ? true : false, - 'dates' => $oldData['dates'] ?: [], - 'duration' => (int) $oldData['duration'], - 'founddate' => $oldData['founddate'], - 'status' => $oldData['status'] - ]; - - $options = [ - 'questionnaire_question_id' => $questionAry['question_id'], - 'questionnaire_questiontype' => $questionAry['questiontype'], - 'questionnaire_questiondata' => $questionAry['questiondata'] - ]; - - return Task::create( - [ - 'type' => 'datefinder', - 'title' => '', - 'description' => $description, - 'task' => $task, - 'user_id' => $userID, - 'mkdate' => $questionAry['mkdate'], - 'chdate' => $questionAry['chdate'], - 'options' => $options - ] - ); - } - - private function migrateTypeVoteOrTest($questionAry) - { - $oldData = (array)json_decode($questionAry['questiondata'], true); - - $description = $oldData['question'] ?: ''; - $userID = $this->findOwner($questionAry['question_id']); - - $correctAnswer = array_key_exists('correctanswer', $oldData) && is_array($oldData['correctanswer']) - ? $oldData['correctanswer'] - : []; - $answers = []; - foreach ($oldData['options'] as $index => $answer) { - $isCorrect = in_array((string)($index + 1), $correctAnswer); - $answers[] = [ - 'text' => $answer, - 'score' => $isCorrect ? 1 : 0, - 'feedback' => '' - ]; - } - - $task = [ - 'type' => $oldData['multiplechoice'] ? 'multiple' : 'single', - 'answers' => $answers - ]; - - $options = [ - 'randomize' => $oldData['randomize'] ? true : false, - 'questionnaire_question_id' => $questionAry['question_id'], - 'questionnaire_questiontype' => $questionAry['questiontype'], - 'questionnaire_questiondata' => $questionAry['questiondata'] - ]; - - return Task::create( - [ - 'type' => 'multiple-choice', - 'title' => '', - 'description' => $description, - 'task' => $task, - 'user_id' => $userID, - 'mkdate' => $questionAry['mkdate'], - 'chdate' => $questionAry['chdate'], - 'options' => $options - ] - ); - } - - private function removeEtaskIDToQuestionsTable() - { - $this->db->exec(" - ALTER TABLE `questionnaire_questions` - DROP `etask_task_id` - "); - } - - private function removeQuestionTypeAndDataFromQuestionsTable() - { - $this->db->exec(" - ALTER TABLE `questionnaire_questions` - DROP `questiontype`, - DROP `questiondata` - "); - } - - private function unmigrateQuestion($questionAry) - { - $taskID = $questionAry['etask_task_id']; - $task = $this->fetchTask($taskID); - - $options = (array)json_decode($task['options'], true); - $questiontype = $options['questionnaire_questiontype']; - $questiondata = $options['questionnaire_questiondata']; - - if (!strlen($questiontype) || !strlen($questiondata)) { - return; - } - - $stmt = $this->db->prepare(" - UPDATE questionnaire_questions - SET questiontype = ?, - questiondata = ? - WHERE question_id = ? - "); - - $stmt->execute([$questiontype, $questiondata, $questionAry['question_id']]); - } -} diff --git a/db/migrations/209_convert_cronjob_logs.php b/db/migrations/209_convert_cronjob_logs.php deleted file mode 100644 index 51c5804..0000000 --- a/db/migrations/209_convert_cronjob_logs.php +++ /dev/null @@ -1,44 +0,0 @@ -exec($query); - - // Quickly convert serialized NULL entries for exception column - $query = "UPDATE `cronjobs_logs` - SET `exception` = NULL - WHERE `exception` = 'N;'"; - DBManager::get()->exec($query); - - // Convert all remaining logs - do { - $converted = CronjobLog::findEachBySQL(function ($entry) { - $entry->exception = unserialize($entry->exception) ?: null; - $entry->store(); - unset($entry); - }, "exception RLIKE '^(N;|O:)' LIMIT {$LIMIT}"); - } while ($converted > 0); - } - - public function down() - { - // Not neccessary - } -} diff --git a/db/migrations/20_calendar_events_class_default.php b/db/migrations/20_calendar_events_class_default.php deleted file mode 100644 index a82b46c..0000000 --- a/db/migrations/20_calendar_events_class_default.php +++ /dev/null @@ -1,23 +0,0 @@ -exec("ALTER TABLE `calendar_events` CHANGE `class` `class` ". - "ENUM( 'PUBLIC', 'PRIVATE', 'CONFIDENTIAL' ) ". - "NOT NULL DEFAULT 'PRIVATE'"); - } - - function down() { - $db = DBManager::get(); - $db->exec("ALTER TABLE `calendar_events` CHANGE `class` `class` ". - "ENUM( 'PUBLIC', 'PRIVATE', 'CONFIDENTIAL' ) ". - "NOT NULL DEFAULT 'PUBLIC'"); - } -} diff --git a/db/migrations/210_tic_7206.php b/db/migrations/210_tic_7206.php deleted file mode 100644 index ff54acd..0000000 --- a/db/migrations/210_tic_7206.php +++ /dev/null @@ -1,13 +0,0 @@ -exec("ALTER TABLE `questionnaires` ADD `copyable` TINYINT NOT NULL DEFAULT '0' AFTER `editanswers`"); - } - - public function down() - { - DBManager::get()->exec("ALTER TABLE `questionnaires` DROP `copyable`"); - } -} diff --git a/db/migrations/211_tic7307_admission_rule_path.php b/db/migrations/211_tic7307_admission_rule_path.php deleted file mode 100644 index 7892a2d..0000000 --- a/db/migrations/211_tic7307_admission_rule_path.php +++ /dev/null @@ -1,23 +0,0 @@ -exec("ALTER TABLE `admissionrules` ADD `path` VARCHAR(255) NOT NULL"); - - $stmt = DBManager::get()->prepare("UPDATE `admissionrules` SET `path` = :path WHERE `id` = :id"); - - foreach (DBManager::get()->fetchAll("SELECT `id`, `ruletype` FROM `admissionrules` ORDER BY `id`") as $rule) { - $stmt->execute([ - 'path' => 'lib/admissionrules/' . strtolower($rule['ruletype']), - 'id' => $rule['id'] - ]); - } - - } - - public function down() - { - DBManager::get()->exec("ALTER TABLE `questionnaires` DROP `path`"); - } -} diff --git a/db/migrations/212_refactor_config_local.php b/db/migrations/212_refactor_config_local.php deleted file mode 100644 index 81eb682..0000000 --- a/db/migrations/212_refactor_config_local.php +++ /dev/null @@ -1,193 +0,0 @@ - [ - 'description' => "Name der Stud.IP-Installation bzw. Hochschule.", - 'type' => "string", - 'default' => "Stud.IP" - ], - "STUDIP_INSTALLATION_ID" => [ - 'description' => "Unique identifier for installation", - 'type' => "string", - 'default' => "demo-installation" - ], - "MEDIA_CACHE_MAX_LENGTH" => [ - 'description' => "Maximale Größe von Dateien, die im Media-Cache gecached werden (in Bytes)?", - 'type' => "integer", - 'default' => 1000000 - ], - "MEDIA_CACHE_LIFETIME" => [ - 'description' => "Wieviele Sekunden soll gecached werden?", - 'type' => "integer", - 'default' => 86400 - ], - "MEDIA_CACHE_MAX_FILES" => [ - 'description' => "Wieviele Dateien sollen maximal gecached werden?", - 'type' => "integer", - 'default' => 3000 - ], - "XSLT_ENABLE" => [ - 'description' => "Soll Export mit XSLT angeschaltet sein?", - 'type' => "boolean", - 'default' => 1 - ], - "FOP_ENABLE" => [ - 'description' => "Soll Export mit FOP erlaubt sein?", - 'type' => "boolean", - 'default' => 1 - ], - "EXTERN_SRI_ENABLE" => [ - 'description' => "Allow the usage of SRI-interface (Stud.IP Remote Include)", - 'type' => "boolean", - 'default' => 1 - ], - "EXTERN_SRI_ENABLE_BY_ROOT" => [ - 'description' => "Only root allows the usage of SRI-interface for specific institutes", - 'type' => "boolean", - 'default' => 0 - ], - "EXTERN_ALLOW_ACCESS_WITHOUT_CONFIG" => [ - 'description' => "Free access to external pages (without the need of a configuration), independent of SRI settings above", - 'type' => "boolean", - 'default' => 0 - ], - "SOAP_ENABLE" => [ - 'description' => "Schaltet die SOAP-Schnittstelle an.", - 'type' => "boolean", - 'default' => 0 - ], - "SOAP_USE_PHP5" => [ - 'description' => "Sollen PHP-Bibliotheken für SOAP verwendet werden?", - 'type' => "boolean", - 'default' => 0 - ], - "ALLOW_SELFASSIGN_STUDYCOURSE" => [ - 'description' => "If true, students are allowed to set or change their studycourse (studiengang)", - 'type' => "boolean", - 'default' => 1 - ], - "SHOW_TERMS_ON_FIRST_LOGIN" => [ - 'description' => "If true, the user has to accept the terms on his first login (this feature makes only sense, if you use disable ENABLE_SELF_REGISTRATION).", - 'type' => "boolean", - 'default' => 0 - ], - "CONVERT_IDNA_URL" => [ - 'description' => "If true, urls with german \"umlauts\" are converted", - 'type' => "boolean", - 'default' => 1 - ], - "USER_VISIBILITY_CHECK" => [ - 'description' => "Enable presentation of visibility decision texts for users after first login. see lib/include/header.php and lib/user_visible.inc.php for further info", - 'type' => "boolean", - 'default' => 0 - ], - "USERNAME_REGULAR_EXPRESSION" => [ - 'description' => "Regex for allowed characters in usernames", - 'type' => "string", - 'default' => '/^([a-zA-Z0-9_@.-]{4,})$/' - ], - "DEFAULT_TIMEZONE" => [ - 'description' => "What timezone should be used (default: Europe/Berlin)?", - 'type' => "string", - 'default' => 'Europe/Berlin' - ], - "DEFAULT_LANGUAGE" => [ - 'description' => "Which language should we use if we can gather no information from user?", - 'type' => "string", - 'default' => 'de_DE' - ], - "ALLOW_CHANGE_USERNAME" => [ - 'description' => "If true, users are allowed to change their username", - 'type' => "boolean", - 'section' => "permissions", - 'default' => 1 - ], - "ALLOW_CHANGE_EMAIL" => [ - 'description' => "If true, users are allowed to change their email", - 'type' => "boolean", - 'section' => "permissions", - 'default' => 1 - ], - "ALLOW_CHANGE_NAME" => [ - 'description' => "If true, users are allowed to change their name", - 'type' => "boolean", - 'section' => "permissions", - 'default' => 1 - ], - "ALLOW_CHANGE_TITLE" => [ - 'description' => "If true, users are allowed to change their titles", - 'type' => "boolean", - 'section' => "permissions", - 'default' => 1 - ], - "ENABLE_SELF_REGISTRATION" => [ - 'description' => "Should it be possible for an user to register himself", - 'type' => "boolean", - 'section' => "permissions", - 'default' => 1 - ], - "ENABLE_REQUEST_NEW_PASSWORD_BY_USER" => [ - 'description' => "If true, users are able to request a new password themselves", - 'type' => "boolean", - 'section' => "permissions", - 'default' => 1 - ], - "PHPASS_USE_PORTABLE_HASH" => [ - 'description' => "PHPASS_USE_PORTABLE_HASH", - 'type' => "boolean", - 'default' => 0 - ], - "WEBSERVICES_ENABLE" => [ - 'description' => "Schaltet die Webservice-Schnittstelle an.", - 'type' => "boolean", - 'default' => 0 - ], - "ENABLE_FREE_ACCESS" => [ - 'description' => "If true, courses with public access are available", - 'type' => "boolean", - 'default' => 1 - ], - ]; - - $stmt_value = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (:config_id, :name, :value, '0', :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - $stmt_default = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (:config_id, :name, :value, '1', :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($global_boolean_parameter as $name => $data) { - $option = [ - 'config_id' => md5($name), - 'name' => $name, - 'type' => $data['type'], - 'value' => $data['default'], - 'range' => 'global', - 'section' => $data['section'] ?: 'global', - 'description' => $data['description'] - ]; - $stmt_default->execute($option); - if (isset($GLOBALS[$name]) && $GLOBALS[$name] != $option['value']) { - $option['config_id'] = md5($name . '___VALUE'); - $option['value'] = $GLOBALS[$name]; - $stmt_value->execute($option); - } - } - } -} diff --git a/db/migrations/213_log_action_statusgroups.php b/db/migrations/213_log_action_statusgroups.php deleted file mode 100644 index be633a2..0000000 --- a/db/migrations/213_log_action_statusgroups.php +++ /dev/null @@ -1,35 +0,0 @@ -exec(" - INSERT IGNORE INTO log_actions - SET action_id = MD5('STATUSGROUP_ADD_USER'), - name = 'STATUSGROUP_ADD_USER', - description = 'Nutzer wird zu einer Statusgruppe hinzugefügt', - info_template = '%user fügt %user(%affected) zur %group(%coaffected) hinzu.', - active = '1', - expires = '0' - "); - DBManager::get()->exec(" - INSERT IGNORE INTO log_actions - SET action_id = MD5('STATUSGROUP_REMOVE_USER'), - name = 'STATUSGROUP_REMOVE_USER', - description = 'Nutzer wird aus einer Statusgruppe gelöscht', - info_template = '%user entfernt %user(%affected) aus %group(%coaffected).', - active = '1', - expires = '0' - "); - } - - public function down() - { - DBManager::get()->exec(" - DELETE FROM log_actions WHERE action_id = MD5('STATUSGROUP_ADD_USER') - "); - DBManager::get()->exec(" - DELETE FROM log_actions WHERE action_id = MD5('STATUSGROUP_REMOVE_USER') - "); - } -} \ No newline at end of file diff --git a/db/migrations/214_textmarkup_datafield.php b/db/migrations/214_textmarkup_datafield.php deleted file mode 100644 index a248ba4..0000000 --- a/db/migrations/214_textmarkup_datafield.php +++ /dev/null @@ -1,22 +0,0 @@ -exec("ALTER TABLE datafields CHANGE type - type ENUM('bool','textline','textarea','textmarkup','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') - NOT NULL DEFAULT 'textline'"); - } - - public function down() - { - DBManager::get()->exec("ALTER TABLE datafields CHANGE type - type ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') - NOT NULL DEFAULT 'textline'"); - } -} diff --git a/db/migrations/215_default_data_field_values.php b/db/migrations/215_default_data_field_values.php deleted file mode 100644 index 1b72867..0000000 --- a/db/migrations/215_default_data_field_values.php +++ /dev/null @@ -1,29 +0,0 @@ -exec("ALTER TABLE datafields ADD default_value TEXT NULL AFTER is_required"); - DBManager::get()->exec("DELETE FROM datafields_entries WHERE content IS NULL OR content = ''"); - } - - /** - * revert this migration - */ - public function down() - { - DBManager::get()->exec("ALTER TABLE datafields DROP default_value"); - } -} diff --git a/db/migrations/216_add_evaldate.php b/db/migrations/216_add_evaldate.php deleted file mode 100644 index e2ac38b..0000000 --- a/db/migrations/216_add_evaldate.php +++ /dev/null @@ -1,22 +0,0 @@ -exec('ALTER TABLE evalanswer_user ADD evaldate int(11) NOT NULL default 0'); - } - - public function down() - { - $db = DBManager::get(); - - $db->exec('ALTER TABLE evalanswer_user DROP evaldate'); - } -} diff --git a/db/migrations/217_course_number_format_config.php b/db/migrations/217_course_number_format_config.php deleted file mode 100644 index da26600..0000000 --- a/db/migrations/217_course_number_format_config.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -class CourseNumberFormatConfig extends Migration -{ - /** - * new config options to install - */ - private $options = [ - [ - 'name' => 'COURSE_NUMBER_FORMAT', - 'description' => 'Erlaubt das Eintragen eines regulären Ausdrucks zur Validierung einer Veranstaltungsnummer. Im Kommentarfeld kann ein entsprechender Hilfetext hinterlegt werden.', - 'section' => 'global', - 'type' => 'string', - 'value' => '' - ] - ]; - - /** - * short description of this migration - */ - public function description() - { - return 'Adds the config entry "COURSE_NUMBER_FORMAT". This allows ' - . 'restricting newly entered course numbers to a fixed format.'; - } - - /** - * perform this migration - */ - public function up() - { - $db = DBManager::get(); - $stmt = $db->prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($this->options as $option) { - $stmt->execute($option); - } - } - - /** - * revert this migration - */ - public function down() - { - $db = DBManager::get(); - $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); - - foreach ($this->options as $option) { - $stmt->execute(['name' => $option['name']]); - } - } -} diff --git a/db/migrations/218_extend_phone_fax_size.php b/db/migrations/218_extend_phone_fax_size.php deleted file mode 100644 index bd50f2b..0000000 --- a/db/migrations/218_extend_phone_fax_size.php +++ /dev/null @@ -1,32 +0,0 @@ -exec("ALTER TABLE Institute CHANGE telefon telefon varchar(255) NOT NULL DEFAULT '', - CHANGE fax fax varchar(255) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE user_info CHANGE privatnr privatnr varchar(255) NOT NULL DEFAULT '', - CHANGE privatcell privatcell varchar(255) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE user_inst CHANGE Telefon Telefon varchar(255) NOT NULL DEFAULT '', - CHANGE Fax Fax varchar(255) NOT NULL DEFAULT ''"); - } - - public function down() - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE Institute CHANGE telefon telefon varchar(32) NOT NULL DEFAULT '', - CHANGE fax fax varchar(32) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE user_info CHANGE privatnr privatnr varchar(32) NOT NULL DEFAULT '', - CHANGE privatcell privatcell varchar(32) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE user_inst CHANGE Telefon Telefon varchar(32) NOT NULL DEFAULT '', - CHANGE Fax Fax varchar(32) NOT NULL DEFAULT ''"); - } -} diff --git a/db/migrations/219_loginbackgrounds.php b/db/migrations/219_loginbackgrounds.php deleted file mode 100644 index feb455c..0000000 --- a/db/migrations/219_loginbackgrounds.php +++ /dev/null @@ -1,36 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS `loginbackgrounds` ( - `background_id` INT NOT NULL AUTO_INCREMENT, - `filename` VARCHAR(255) NOT NULL, - `mobile` TINYINT(1) NOT NULL DEFAULT 1, - `desktop` TINYINT(1) NOT NULL DEFAULT 1, - `in_release` TINYINT(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`background_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - DBManager::get()->exec( - "INSERT INTO `loginbackgrounds` SET `filename` = 'Login-Hintergrund.jpg', ". - "`mobile` = 0, `desktop` = 1, `in_release` = 1"); - - DBManager::get()->exec( - "INSERT INTO `loginbackgrounds` SET `filename` = 'Login-Hintergrund-mobil.jpg', ". - "`mobile` = 1, `desktop` = 0, `in_release` = 1"); - - mkdir($GLOBALS['STUDIP_BASE_PATH'] . '/public/pictures/loginbackgrounds'); - } - - public function down() - { - DBManager::get()->exec('DROP TABLE IF EXISTS `loginbackgrounds`'); - } -} diff --git a/db/migrations/21_more_indexing.php b/db/migrations/21_more_indexing.php deleted file mode 100644 index 4dce2a4..0000000 --- a/db/migrations/21_more_indexing.php +++ /dev/null @@ -1,32 +0,0 @@ -getAttribute(PDO::ATTR_ERRMODE); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - - $db->exec("ALTER TABLE `contact` ADD INDEX `user_id` ( `user_id` )"); - $db->exec("ALTER TABLE `datafields_entries` ADD INDEX `datafields_contents` (`datafield_id`,`content`(32) )"); - - $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); - } - - function down() { - $db = DBManager::get(); - - $mode = $db->getAttribute(PDO::ATTR_ERRMODE); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - - $db->exec("ALTER TABLE `datafields_entries` DROP INDEX `datafields_contents`"); - $db->exec("ALTER TABLE `auth_user_md5` DROP INDEX `user_id`"); - - $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); - } -} diff --git a/db/migrations/220_step_00313_coursegroups.php b/db/migrations/220_step_00313_coursegroups.php deleted file mode 100644 index 70c5b8d..0000000 --- a/db/migrations/220_step_00313_coursegroups.php +++ /dev/null @@ -1,26 +0,0 @@ -exec( - "ALTER TABLE `sem_classes` ADD `is_group` TINYINT(1) NOT NULL DEFAULT '0' AFTER `show_raumzeit`"); - DBManager::get()->exec( - "ALTER TABLE `seminare` ADD `parent_course` VARCHAR(32) NULL DEFAULT NULL AFTER `public_topics`"); - DBManager::get()->exec( - "ALTER TABLE `seminare` ADD INDEX(`parent_course`)"); - StudipLog::registerAction('SEM_ADD_TO_GROUP', 'Veranstaltung zu Gruppe hinzufügen', - '%user ordnet Veranstaltung %sem(%affected) der Gruppe %sem(%coaffected) zu.', null); - StudipLog::registerAction('SEM_DEL_FROM_GROUP', 'Veranstaltung aus Gruppe entfernen', - '%user entfernt Veranstaltung %sem(%affected) aus der Gruppe %sem(%coaffected).', null); - } - - public function down() - { - DBManager::get()->exec("ALTER TABLE `sem_classes` DROP `is_group`"); - DBManager::get()->exec("ALTER TABLE `seminare` DROP `parent_course`"); - - StudipLog::unregisterAction('SEM_ADD_TO_GROUP'); - StudipLog::unregisterAction('SEM_DEL_FROM_GROUP'); - } -} diff --git a/db/migrations/221_moadb.php b/db/migrations/221_moadb.php deleted file mode 100644 index 334c09a..0000000 --- a/db/migrations/221_moadb.php +++ /dev/null @@ -1,516 +0,0 @@ - - * @license GPL2 or any later version - * -*/ - -class Moadb extends Migration -{ - public function description() - { - return 'migrates documents to moadb'; - } - - private function insert52aTermsOfUse($db) - { - // Copied and modified from cli script add_52a_tables from Stud.IP 3.5: - $db->exec("INSERT INTO `content_terms_of_use_entries` (`id`, `name`, `position`, `description`, `student_description`, `download_condition`, `icon`, `is_default`, `mkdate`, `chdate`) VALUES -('3RD_PARTY_FALSE', 'Dokument ist frei von Rechten Dritter', 6, '', '', 0, 'check-circle', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), -('3RD_PARTY_TRUE', 'Dokument ist nicht frei von Rechten Dritter', 7, '', '', 0, 'decline-circle', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), -('FREE_LICENSE', 'Werk mit freier Lizenz', 3, 'Werke, die unter einer freien Lizenz veröffentlich wurden, d.h. deren Weitergabe und zumeist auch Veränderung ohne Lizenzkosten gestattet ist, dürfen Sie ohne Einschränkungen für den Unterricht zugänglich machen. \n\nTypische Beispiele sind:\n- Open-Access-Publikationen \n- Open Educational Ressources (OER) \n- Werke unter Creative-Commons-Lizenzen (z.B. Wikipedia-Inhalte) \n\nAchtung: Vergewissern Sie sich im Einzelfall, welche Einschränkungen für die Verbreitung und Veränderung die jeweilige Lizenz ggf. enthält.', 'Das Dokument unterliegt einer freien Lizenz. Sie dürfen es weitergeben und unter Beachtung der Details der Lizenz (s. Angaben im Dokument) verändern und in eigene Werke übernehmen.', 0, 'cc', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), -('SELFMADE_NONPUB', 'Selbst verfasstes, nicht publiziertes Werk', 2, 'Selbst verfasste Werke dürfen Sie ohne Einschränkungen zugänglich machen, wenn Sie die Verwertungsrechte nicht an einen Verlag abgetreten haben. \nTypische Beispiele sind selbst verfasste:\n - Präsentationsfolien, auch mit Text- und Bildzitaten aus fremden Quellen \n- Übungsaufgaben, Musterlösungen \n- Computer-Programme \n- Literaturlisten, Seminarpläne\n - Vorlesungsskripte \n\nWichtig ist die Beachtung des Zitatrechtes: \nWenn Sie Teile fremder Quellen übernehmen, ist das zulässig, solange diese Teile mit Quelle gekennzeicht werden und Gegenstand einer wissenschaftlichen Auseinandersetzung sind.', 'Das Dokument wird von den Autor/-innen zur Nutzung im Rahmen dieser Veranstaltung bereitgestellt. Sie dürfen es für private Zwecke herunterladen und archivieren, nicht jedoch ohne Erlaubnis weitergeben. Für darüber hinaus gehende Erlaubnisse (Weitergabe, Veränderung) wenden Sie sich an die Autor/-innen oder beachten Sie die Hinweise im Dokument.', 0, 'own-license', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), -('NO_LICENSE', 'Veröffentlichte Werke ohne erworbene Lizenz oder gesonderte Erlaubnis', 5, 'Veröffentlichte Werke, für die keine Lizenz erworben wurde und für die keine gesonderte Erlaubnis vorliegt, dürfen unter den Erlaubnissen des § 60a UrhG für Unterrichtsteilnehmende zugänglich gemacht werden.\n\nEs muss sich dabei um kleine Teile des Gesamtwerkes handeln (z.B. max. 15% eines Buches oder Bildbandes, 5 Minuten bei Musikstücken oder Filmen, Kinofilme erst nach 2 Jahren). Einzelne Abbildungen, Photos oder Artikel aus wissenschaftlichen Zeitschriften dürfen ganz zugänglich gemacht werden, Artikel aus Zeitungen und anderen Zeitschriften allerdings ebenfalls nur zu 10%.\n\nZum Hintergrund: Diese Regelung gilt wegen der Befristung des § 60a UrhG zunächst bis März 2023, eine Einzelmeldung oder Abrechnung über die Hochschule o.ä. ist nicht erforderlich.', 'Das Dokument wird zur Nutzung im Rahmen dieser Veranstaltung bereitgestellt. Sie dürfen es für private Zwecke herunterladen und archivieren, nicht jedoch ohne Erlaubnis weitergeben.', 0, '60a', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), -('UNDEF_LICENSE', 'Ungeklärte Lizenz', 1, 'Bitte geben Sie an, welcher Lizenz das hochgeladene Material unterliegt bzw. auf welcher Grundlage Sie es zugänglich machen. Unterbleibt diese Angabe, wird beim Herunterladen auf den ungeklärten Lizenzstatus hingewiesen.', 'Diese Datei enthält Material mit einer ungeklärten Lizenz. Zu Fragen der Nutzung und Weitergabe wenden Sie sich an die Person, die diese Datei hochgeladen hat.', 2, 'question-circle', 1, UNIX_TIMESTAMP(),UNIX_TIMESTAMP()), -('WITH_LICENSE', 'Nutzungserlaubnis oder Lizenz liegt vor', 4, 'Wenn Sie urheberrechtlich geschützte Werke zugänglich machen wollen und keine der anderen Kategorien passt, benötigen Sie eine Erlaubnis oder kostenpflichtige Lizenz des Inhabers der Verwertungsrechte. Das ist bei publizierten Werken der Verlag, bei nicht publizierten Werken der Autor. \n\nTypische Beispiele sind: \n- Zustimmung von Kollegen oder Studierenden zur Weitergabe von Skripten, Seminararbeiten, Referatsfolien \n- Zustimmung eines Verlages zur Nutzung von Werkteilen für die Lehre \n- Verlags-Erlaubnis zur Nutzung eigener publizierter Werke für die Lehre \n- Erworbene Lizenz für die Weitergabe in Lehrveranstaltung (eine einzelne erworbene Kopie reicht nicht aus!) \n\nAchtung: Campus- oder Nationallizenzen erlauben es nicht, dass Sie ein Werk erneut hochladen und somit selbst verbreiten. Verlinken Sie in diesem Fall direkt auf das Angebot Ihrer Bibliothek o.ä.', 'Das Dokument wird zur Nutzung im Rahmen dieser Veranstaltung bereitgestellt. Sie dürfen es für private Zwecke herunterladen und archivieren, nicht jedoch ohne Erlaubnis weitergeben.', 0, 'license', 0, UNIX_TIMESTAMP(),UNIX_TIMESTAMP())"); - - } - - private function updateLicenseIds($db) - { - //We must convert the old IDs from the document_licenses table - //to the new IDs from the content_terms_of_use_entries table: - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = '3RD_PARTY_FALSE' WHERE content_terms_of_use_id = '0'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = '3RD_PARTY_TRUE' WHERE content_terms_of_use_id = '1'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'UNDEF_LICENSE' WHERE content_terms_of_use_id = '2'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'SELFMADE_NONPUB' WHERE content_terms_of_use_id = '3'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'FREE_LICENSE' WHERE content_terms_of_use_id = '4'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'WITH_LICENSE' WHERE content_terms_of_use_id = '5'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'NO_LICENSE' WHERE content_terms_of_use_id = '6'"); - $db->exec("UPDATE `file_refs` SET content_terms_of_use_id = 'NO_LICENSE' WHERE content_terms_of_use_id = '7'"); - } - - private function insertFilesTour($db) - { - $db->exec("INSERT INTO `help_tours` (`global_tour_id`, `tour_id`, `name`, `description`, `type`, `roles`, `version`, `language`, `studip_version`, `installation_id`, `author_email`, `mkdate`, `chdate`) VALUES -('e9959c638e0c2578cccee24702e886f4', '0b542c6c891af499763356f2c7218f7f', 'Was ist neu in Stud.IP 4.0?', 'Was ist neu in Stud.IP 4.0?', 'tour', 'autor,tutor,dozent,admin,root', 1, 'de', '4.0', '', '', 1514883131, 0)"); - - $db->exec("INSERT INTO `help_tour_settings` (`tour_id`, `active`, `access`) VALUES -('0b542c6c891af499763356f2c7218f7f', 1, 'autostart_once')"); - - $db->exec("INSERT INTO `help_tour_steps` (`tour_id`, `step`, `title`, `tip`, `orientation`, `interactive`, `css_selector`, `route`, `action_prev`, `action_next`, `author_email`, `mkdate`, `chdate`) VALUES -('0b542c6c891af499763356f2c7218f7f', 1, 'Willkommen in Stud.IP 4!', 'Unter der Haube ist alles neu, auch an der Oberfläche hat sich einiges getan.', 'B', 0, '', 'dispatch.php/start', '', '', 'root@localhost', 1514883131, 1514883295), -('0b542c6c891af499763356f2c7218f7f', 2, '', 'Die wichtigsten Neuigkeiten im Schnelldurchlauf:', 'B', 0, '', 'dispatch.php/start', '', '', 'root@localhost', 1514883334, 1514883383), -('0b542c6c891af499763356f2c7218f7f', 3, '', 'Die Startseite lässt sich anpassen. Sie können selbst bestimmen, was angezeigt werden soll. Per Drag & Drop können sie die Position der Elemente auf der Startseite verändern.', 'R', 0, '.sidebar-widget:eq(1) A:eq(0)', 'dispatch.php/start', '', '', 'root@localhost', 1514883313, 1516748869), -('0b542c6c891af499763356f2c7218f7f', 4, '', 'Alle persönlichen Funktionen sind in diesem Menü zusammengefasst. Der persönliche Dateibereich ist nun immer standardmäßig eingeschaltet.', 'B', 0, '#avatar-arrow', 'dispatch.php/start', '', '', 'root@localhost', 1514883360, 1516749166), -('0b542c6c891af499763356f2c7218f7f', 5, '', 'Alle Dateibereiche wurden in Stud.IP 4 komplett überarbeitet. Im persönlichen Dateibereich finden sich u.a. Nachrichtenanhänge. Sie können aber auch eigene Ordner erstellen und diese auf ihrer Profilseite anderen zugänglich machen. In Veranstaltungen gibt es weitere Typen von Dateiordnern, wie den Hausaufgabenordner.', 'B', 0, '', 'dispatch.php/files', '', '', 'root@localhost', 1514883588, 1514883588), -('0b542c6c891af499763356f2c7218f7f', 6, '', 'Falls von der Hochschule gestattet, können Sie hier Owncloud/Nextcloud oder Powerfolder für die Dateiverwaltung koppeln.', 'R', 0, '.sidebar-widget:eq(0) A:eq(0)', 'dispatch.php/files', '', '', 'root@localhost', 1514883641, 1516749255), -('0b542c6c891af499763356f2c7218f7f', 7, '', 'Weniger häufig benötigte Funktionen sind in Stud.IP 4 hinter dem Aktionsmenü mit den drei Punkten zu finden.', 'LT', 0, 'table.documents nav.action-menu', 'dispatch.php/files', '', '', 'root@localhost', 1514883706, 1516749543), -('0b542c6c891af499763356f2c7218f7f', 8, '', 'Ebenfalls neu ist die dezente Navigationszeile. Der gerade aktive Bereich wird durch eine Linie angezeigt.', 'B', 0, '#tabs', 'dispatch.php/files', '', '', 'root@localhost', 1514883773, 1514883781), -('0b542c6c891af499763356f2c7218f7f', 9, '', 'Das waren die allerwichtigsten Dinge im Überblick. In Stud.IP 4 hat sich aber noch viel mehr getan. Jedes Detail wurde durchdacht und verbessert . Damit ist Stud.IP 4 das modernste Open-Source-LMS auf dem Markt.', 'B', 0, '', 'dispatch.php/files', '', '', 'root@localhost', 1514883871, 1514883871), -('0b542c6c891af499763356f2c7218f7f', 10, 'Das Stud.IP-Team wünscht viel Erfolg bei der Arbeit mit Stud.IP 4!', '', 'B', 0, '', 'dispatch.php/start', '', '', 'root@localhost', 1514883886, 1514883946)"); - } - - public function up() - { - $db = DBManager::get(); - - try { - $db->exec("RENAME TABLE files TO _files"); - $db->exec("RENAME TABLE file_refs TO _file_refs"); - } catch (PDOException $e) - { - - } - - $db->exec("CREATE TABLE IF NOT EXISTS `files` ( - `id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `mime_type` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) NOT NULL, - `size` int(10) unsigned NOT NULL, - `storage` enum('disk','url') NOT NULL DEFAULT 'disk', - `author_name` varchar(100) NOT NULL DEFAULT '', - `mkdate` int(10) unsigned NOT NULL, - `chdate` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - $db->exec("CREATE TABLE IF NOT EXISTS `file_refs` ( - `id` VARCHAR(32) NOT NULL, - `file_id` VARCHAR(32) NOT NULL, - `folder_id` VARCHAR(32) NOT NULL, - `downloads` INT(10) UNSIGNED NOT NULL DEFAULT 0, - `description` TEXT NOT NULL, - `content_terms_of_use_id` VARCHAR(32) NOT NULL, - `user_id` VARCHAR(32) NOT NULL DEFAULT '', - `name` VARCHAR(255) NOT NULL DEFAULT '', - `mkdate` INT(10) UNSIGNED NOT NULL DEFAULT 0, - `chdate` INT(10) UNSIGNED NOT NULL DEFAULT 0, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - $db->exec("CREATE TABLE IF NOT EXISTS `file_urls` ( - `file_id` varchar(32) NOT NULL, - `url` varchar(4096) NOT NULL, - `access_type` enum('proxy','redirect') NOT NULL DEFAULT 'proxy', - PRIMARY KEY (`file_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - $db->exec("CREATE TABLE IF NOT EXISTS `folders` ( - `id` varchar(32) NOT NULL, - `user_id` varchar(32) NOT NULL, - `parent_id` varchar(32) NOT NULL, - `range_id` varchar(32) NOT NULL, - `range_type` varchar(32) NOT NULL, - `folder_type` varchar(255) NOT NULL, - `name` varchar(255) NOT NULL, - `data_content` text NOT NULL, - `description` text NOT NULL, - `mkdate` int(10) unsigned NOT NULL, - `chdate` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - - //table for SORM class ContentTermsOfUse: - $db->exec( - "CREATE TABLE IF NOT EXISTS `content_terms_of_use_entries` ( - `id` VARCHAR(32) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `position` int(10) unsigned NOT NULL, - `description` TEXT NOT NULL, - `student_description` TEXT NOT NULL, - `download_condition` TINYINT(2) NOT NULL, - `icon` VARCHAR(128) NOT NULL DEFAULT '', - `is_default` tinyint(2) unsigned NOT NULL DEFAULT 0, - `mkdate` int(10) unsigned NOT NULL, - `chdate` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC" - ); - - - //default terms of use entries: - $this->insert52aTermsOfUse($db); - - - $db->exec("SET autocommit=0"); - //top folder courses - $institute_folders = []; - foreach ($db->query("SELECT DISTINCT i.institut_id as new_range_id,i.name FROM `folder` f INNER JOIN `Institute` i ON i.institut_id = f.seminar_id") as $folder) { - $folder['folder_id'] = md5(uniqid('folders', true)); - $folder['range_id'] = ''; - $folder['user_id'] = $GLOBALS['user']->id; - $folder['description'] = ''; - $folder['mkdate'] = $folder['chdate'] = time(); - $this->migrateFolder($folder, $folder['new_range_id'], 'institute', 'RootFolder'); - $institute_folders[$folder['new_range_id']] = $folder['folder_id']; - } - $db->exec("COMMIT"); - //aka Allgemeiner Dateiordner - foreach ($db->query("SELECT f.*, i.institut_id as seminar_id FROM `folder` f INNER JOIN `Institute` i ON i.institut_id = f.range_id") as $folder) { - $folder['range_id'] = $institute_folders[$folder['seminar_id']]; - $this->migrateFolder($folder, $folder['seminar_id'], 'institute', 'StandardFolder'); - } - //other top folders - foreach ($db->query("SELECT f.*, i.institut_id as seminar_id FROM `folder` f INNER JOIN `Institute` i ON BINARY MD5(CONCAT(i.institut_id, _latin1'top_folder')) = f.range_id") as $folder) { - $folder['range_id'] = $institute_folders[$folder['seminar_id']]; - $this->migrateFolder($folder, $folder['seminar_id'], 'institute', 'StandardFolder'); - } - unset($institute_folders); - $db->exec("COMMIT"); - - - $seminar_folders = []; - foreach ($db->query("SELECT DISTINCT s.seminar_id as new_range_id,s.name FROM `seminare` s INNER JOIN `folder` f ON s.Seminar_id = f.seminar_id") as $folder) { - $folder['folder_id'] = md5(uniqid('folders', true)); - $folder['range_id'] = ''; - $folder['user_id'] = $GLOBALS['user']->id; - $folder['description'] = ''; - $folder['mkdate'] = $folder['chdate'] = time(); - $this->migrateFolder($folder, $folder['new_range_id'], 'course', 'RootFolder'); - $seminar_folders[$folder['new_range_id']] = $folder['folder_id']; - } - $db->exec("COMMIT"); - - //aka Allgemeiner Dateiordner - foreach ($db->query("SELECT f.*, s.Seminar_id as seminar_id FROM `folder` f INNER JOIN `seminare` s ON s.Seminar_id = f.range_id") as $folder) { - $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; - $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'StandardFolder'); - } - $db->exec("COMMIT"); - - //other top folders - foreach ($db->query("SELECT f.*, s.Seminar_id as seminar_id FROM `folder` f INNER JOIN `seminare` s ON BINARY MD5(CONCAT(s.Seminar_id, 'top_folder')) = f.range_id") as $folder) { - $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; - $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'StandardFolder'); - } - $db->exec("COMMIT"); - - //group folder - foreach ($db->query("SELECT f.*, s.range_id AS seminar_id FROM `folder` f INNER JOIN `statusgruppen` s ON s.statusgruppe_id = f.range_id") as $folder) { - $data_content = json_encode(['group' => $folder['range_id']]); - $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; - $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'CourseGroupFolder', $data_content); - } - //issue folder - foreach ($db->query("SELECT f.*, t.seminar_id AS seminar_id FROM `folder` f INNER JOIN `themen` t ON t.issue_id = f.range_id") as $folder) { - $data_content = json_encode(['topic_id' => $folder['range_id']]); - $folder['range_id'] = $seminar_folders[$folder['seminar_id']]; - $this->migrateFolder($folder, $folder['seminar_id'], 'course', 'CourseTopicFolder', $data_content); - } - $db->exec("COMMIT"); - - //personal documents - $insert_personal_folder = $db->prepare("INSERT IGNORE INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, 'user', ?, ?, ?, ?, ?, ?)"); - foreach ($db->fetchFirst("SELECT distinct parent_id FROM `_file_refs` inner join auth_user_md5 where parent_id=user_id") as $user_id) { - $top_folder_id = $db->fetchColumn("SELECT id FROM folders WHERE range_type = 'user' AND parent_id='' AND range_id=?", [$user_id]); - if (!$top_folder_id) { - $top_folder_id = md5(uniqid($user_id)); - $insert_personal_folder->execute([ - $top_folder_id, - $user_id, - '', - $user_id, - 'RootFolder', - '', - '', - '', - time(), - time() - ]); - } - $personal_folder_id = md5($top_folder_id . 'personal_top_folder_id'); - $insert_personal_folder->execute([ - $personal_folder_id, - $user_id, - $top_folder_id, - $user_id, - 'PublicFolder', - 'öffentliche Dateien', - Config::get()->PERSONALDOCUMENT_OPEN_ACCESS ? '{"viewable":1}' : '', - '', - time(), - time() - ]); - $this->migratePersonalFiles($db->fetchAll("SELECT file_id,id,storage_id,mime_type,user_id,filename,description,mkdate,chdate,downloads,size FROM `_files` inner join _file_refs using(file_id) WHERE parent_id = ? and storage_id<>''", [$user_id]), $personal_folder_id); - $subfolders = $db->fetchAll("SELECT file_id as folder_id,user_id,'{$personal_folder_id}' as range_id,name,description,mkdate,chdate FROM _file_refs INNER JOIN _files USING(file_id) WHERE storage_id='' AND parent_id = ?", [$user_id]); - foreach ($subfolders as $one) { - $this->migratePersonalFolder($one, $user_id); - } - } - $db->exec("COMMIT"); - - //Blubber folders - foreach ($db->query("SELECT f.*, a.user_id AS seminar_id, CONCAT_WS(' ', vorname,nachname) as name - FROM `folder` f - INNER JOIN `auth_user_md5` a ON a.user_id = f.range_id") as $folder) { - $user_id = $folder['seminar_id']; - $top_folder_id = $db->fetchColumn("SELECT id FROM folders WHERE range_type = 'user' AND parent_id='' AND range_id=?", [$user_id]); - if (!$top_folder_id) { - $top_folder_id = md5(uniqid($user_id)); - $insert_personal_folder->execute([ - $top_folder_id, - $user_id, - '', - $user_id, - 'RootFolder', - '', - '', - '', - time(), - time() - ]); - } - $personal_folder_id = md5($top_folder_id . 'personal_top_folder_id'); - $insert_personal_folder->execute([ - $personal_folder_id, - $user_id, - $top_folder_id, - $user_id, - 'PublicFolder', - 'öffentliche Dateien', - Config::get()->PERSONALDOCUMENT_OPEN_ACCESS ? '{"viewable":1}' : '', - '', - time(), - time() - ]); - - $folder['range_id'] = $personal_folder_id; - $folder['description'] = ''; - $this->migrateFolder($folder, $user_id, 'user', 'PublicFolder'); - } - - $db->exec("COMMIT"); - - //migrate message attachments: - $this->migrateMessageAttachments(); - - - //map old 52 license IDs to new terms of use entries: - $this->updateLicenseIds($db); - $db->exec("COMMIT"); - $db->exec("SET autocommit=1"); - - $db->exec("ALTER TABLE `file_refs` - ADD KEY `file_id` (`file_id`), - ADD KEY `folder_id` (`folder_id`)"); - $db->exec("ALTER TABLE `folders` - ADD KEY `range_id` (`range_id`), - ADD KEY `parent_id` (`parent_id`)"); - - //delete configuration variables designed for the old file area: - - $db->exec( - "DELETE FROM `config` - WHERE - `field` IN - ('PERSONALDOCUMENT_OPEN_ACCESS', - 'PERSONALDOCUMENT_OPEN_ACCESS_ROOT_PRIVILEDGED', - 'PERSONALDOCUMENT_ENABLE', - 'FILESYSTEM_MULTICOPY_ENABLE', - 'DOCUMENTS_EMBEDD_FLASH_MOVIES', - 'ALLOW_DOWNLOAD_FOR_UNKNOWN_LICENSE', - 'COPYRIGHT_DIALOG_ON_UPLOAD', - 'LICENSE_PREAMBLE', - 'DEFAULT_LICENSE_ON_UPLOAD' - )" - ); - $db->exec("DROP TABLE IF EXISTS `doc_filetype`, `doc_filetype_forbidden`, `doc_usergroup_config`, `dokumente`, `files_backend_studip`, `files_backend_url`, `files_share`, `folder`, `_files`, `_file_refs`, `document_licenses`"); - - //add help tour - $this->insertFilesTour($db); - } - - - - - public function migrateMessageAttachments() - { - //First we wipe out all documents with range-ID = 'provisional'. - //Such documents were meant to be attached to mails but were left - //unattached... to remain lonely in the database... - //So it's time to end this misery and delete them! - /* - $unattached_documents = StudipDocument::deleteBySql( - "range_id = 'provisional'" - ); - */ - - $db = DBManager::get(); - - //then we retrieve all message-IDs: - $message_rows = $db->query("SELECT DISTINCT message_id,autor_id,subject,message.mkdate FROM message INNER JOIN dokumente ON range_id = message_id"); - $insert_folder = $db->prepare("INSERT INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - - foreach($message_rows as $message_row) { - //now we loop through each message ID and check if there are - //files in the dokumente table with that range-ID: - $message_id = $message_row['message_id']; - - //we found at least one attachment: create a top folder for this message: - - - $folder_id = md5($message_id . '_attachments'); - - $insert_folder->execute([ - $folder_id, - $message_row['autor_id'], - '', - $message_id, - 'message', - 'MessageFolder', - $message_row['subject'], - '', - '', - $message_row['mkdate'], - $message_row['mkdate'] - ]); - - $this->migrateFiles($db->fetchAll( - "SELECT * FROM dokumente WHERE range_id = :range_id", - [ - 'range_id' => $message_id - ] - ), $folder_id); - - } - } - - - public function migrateFolder($folder, $range_id, $range_type, $folder_type, $data_content = '') - { - $db = DBManager::get(); - $insert_folder = $db->prepare("INSERT INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - - $folder_type = $folder_type == 'StandardFolder' && isset($folder['permission']) && $folder['permission'] != 7 ? 'PermissionEnabledFolder' : $folder_type; - $data_content = $data_content == '' && isset($folder['permission']) && $folder['permission'] != 7 ? json_encode(['permission' => $folder['permission']]): $data_content; - if (isset($folder['range_id'])) { - $insert_folder->execute([$folder['folder_id'], $folder['user_id'], $folder['range_id'], $range_id, $range_type, $folder_type, $folder['name'], $data_content, (string)$folder['description'], $folder['mkdate'], $folder['chdate']]); - } - $subfolders = $db->fetchAll("SELECT * FROM folder WHERE range_id = ?", [$folder['folder_id']]); - foreach ($subfolders as $one) { - $this->migrateFolder($one, $range_id, $range_type, 'StandardFolder'); - } - $this->migrateFiles($db->fetchAll("SELECT * FROM dokumente WHERE range_id = ?", [$folder['folder_id']]), $folder['folder_id']); - - - - } - - public function migrateFiles($files, $folder_id) - { - $db = DBManager::get(); - $insert_file_ref = $db->prepare("INSERT INTO `file_refs` (`id`, `file_id`, `folder_id`, `downloads`, `description`, `content_terms_of_use_id`, `user_id`, `name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - $insert_file = $db->prepare("INSERT INTO `files` (`id`, `user_id`, `mime_type`, `name`, `size`, `storage`, `author_name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"); - $insert_file_url = $db->prepare("INSERT INTO `file_urls` (`file_id`, `url`) VALUES (?, ?)"); - $filenames = []; - foreach ($files as $one) { - $c = 0; - $filename = $one['filename']; - $ext = pathinfo($filename, PATHINFO_EXTENSION); - if ($ext) { - $name = substr($filename, 0, strrpos($filename, $ext) - 1); - } else { - $name = $filename; - } - while (in_array($filename, $filenames)) { - $filename = $name . '['.++$c.']' . ($ext ? '.' . $ext : ''); - } - $filenames[] = $filename; - $insert_file_ref->execute([ - $one['dokument_id'], - $one['dokument_id'], - $folder_id, - $one['downloads'], - $one['name'] != $one['filename'] ? trim($one['name'] . "\n" . $one['description']) : (string) $one['description'], - $one['protected'], - $one['user_id'], - $filename, - $one['mkdate'], - $one['chdate'] - ]); - $insert_file->execute([$one['dokument_id'], $one['user_id'], get_mime_type($one['filename']), $filename, $one['filesize'], $one['url'] ? 'url' : 'disk', $one['author_name'], $one['mkdate'], $one['chdate']]); - if ($one['url']) { - $insert_file_url->execute([$one['dokument_id'], $one['url']]); - } - } - } - - public function migratePersonalFolder($folder, $range_id) - { - $db = DBManager::get(); - $insert_folder = $db->prepare("INSERT INTO `folders` (`id`, `user_id`, `parent_id`, `range_id`, `range_type`, `folder_type`, `name`, `data_content`, `description`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, 'user', 'PublicFolder', ?, ?, ?, ?, ?)"); - - $insert_folder->execute([ - $folder['folder_id'], - $folder['user_id'], - $folder['range_id'], - $range_id, - $folder['name'], - Config::get()->PERSONALDOCUMENT_OPEN_ACCESS ? '{"viewable":1}' : '', - (string)$folder['description'], - $folder['mkdate'], - $folder['chdate'] - ]); - $subfolders = $db->fetchAll("SELECT file_id as folder_id,user_id,parent_id as range_id,name,description,mkdate,chdate FROM _file_refs INNER JOIN _files USING(file_id) WHERE storage_id='' AND parent_id = ?", [$folder['folder_id']]); - foreach ($subfolders as $one) { - $this->migratePersonalFolder($one, $range_id); - } - $this->migratePersonalFiles($db->fetchAll("SELECT file_id,id,storage_id,mime_type,user_id,filename,description,mkdate,chdate,downloads,size FROM `_files` inner join _file_refs using(file_id) WHERE parent_id = ? and storage_id<>''", [$folder['folder_id']]), $folder['folder_id']); - - - } - - public function migratePersonalFiles($files, $folder_id) - { - $db = DBManager::get(); - $insert_file_ref = $db->prepare("INSERT INTO `file_refs` (`id`, `file_id`, `folder_id`, `downloads`, `description`, `content_terms_of_use_id`, `user_id`, `name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - $insert_file = $db->prepare("INSERT INTO `files` (`id`, `user_id`, `mime_type`, `name`, `size`, `storage`, `author_name`, `mkdate`, `chdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"); - $filenames = []; - foreach ($files as $one) { - $c = 0; - $filename = $one['filename']; - $ext = pathinfo($filename, PATHINFO_EXTENSION); - if ($ext) { - $name = substr($filename, 0, strrpos($filename, $ext) - 1); - } else { - $name = $filename; - } - while (in_array($filename, $filenames)) { - $filename = $name . '['.++$c.']' . ($ext ? '.' . $ext : ''); - } - $filenames[] = $filename; - $insert_file_ref->execute([ - $one['id'], - $one['storage_id'], - $folder_id, - $one['downloads'], - $one['name'] != $one['filename'] ? trim($one['name'] . "\n" . $one['description']) : (string) $one['description'], - 0, - $one['user_id'], - $filename, - $one['mkdate'], - $one['chdate'] - ]); - $insert_file->execute([$one['storage_id'], $one['user_id'], $one['mime_type'], $filename, $one['size'], 'disk', '', $one['mkdate'], $one['chdate']]); - $new_path = $GLOBALS['UPLOAD_PATH'] . '/' . substr($one['storage_id'], 0, 2) . '/' . $one['storage_id']; - $old_path = $GLOBALS['USER_DOC_PATH'] . '/' . $one['user_id'] . '/' . $one['storage_id']; - @rename($old_path, $new_path); - } - } - - public function down() - { - /* - * I'M SORRY DAVE, I'M AFRAID I CAN'T DO THAT - */ - } -} diff --git a/db/migrations/222_utf8_conversion.php b/db/migrations/222_utf8_conversion.php deleted file mode 100644 index 29be28f..0000000 --- a/db/migrations/222_utf8_conversion.php +++ /dev/null @@ -1,242 +0,0 @@ -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - - // check if the necessary MySQL-settings are present - // MariaDB deprecated these settings and removed them in v10.3 - if (!$this->checkMariaDB($pdo, '10.3')) { - $result = $pdo->query("SHOW VARIABLES LIKE 'innodb_file_format'"); - $var = $result->fetch(PDO::FETCH_KEY_PAIR); - if ($var && $var['innodb_file_format'] !== '' && mb_strtolower($var['innodb_file_format']) !== 'barracuda') { - throw new Exception('Could not convert Database: You need to set \'innodb_file_format\' = \'Barracuda\''); - } - - $result = $pdo->query("SHOW VARIABLES LIKE 'innodb_large_prefix'"); - $var = $result->fetch(PDO::FETCH_KEY_PAIR); - if ($var && $var['innodb_large_prefix'] !== '' && mb_strtolower($var['innodb_large_prefix']) !== 'on') { - throw new Exception('Could not convert Database: You need to set \'innodb_large_prefix\' = 1'); - } - } - - // create a helper-function in MySQL - $pdo->exec("DROP FUNCTION IF EXISTS entity_decode"); - $pdo->exec(" - CREATE FUNCTION entity_decode(txt MEDIUMTEXT CHARSET utf8mb4) RETURNS MEDIUMTEXT - CHARSET utf8mb4 - NO SQL - DETERMINISTIC - BEGIN - - DECLARE tmp MEDIUMTEXT CHARSET utf8mb4 DEFAULT txt; - DECLARE entity TEXT CHARSET utf8mb4; - DECLARE pos1 INT DEFAULT 1; - DECLARE pos2 INT; - DECLARE codepoint INT; - - IF txt IS NULL THEN - RETURN NULL; - END IF; - LOOP - SET pos1 = LOCATE('&#', tmp, pos1); - IF pos1 = 0 THEN - RETURN tmp; - END IF; - SET pos2 = LOCATE(';', tmp, pos1 + 2); - IF pos2 > pos1 THEN - SET entity = SUBSTRING(tmp, pos1, pos2 - pos1 + 1); - IF entity REGEXP '^&#[[:digit:]]+;$' THEN - SET codepoint = CAST(SUBSTRING(entity, 3, pos2 - pos1 - - 2) AS UNSIGNED); - IF codepoint > 31 THEN - SET tmp = CONCAT(LEFT(tmp, pos1 - 1), CONVERT(CONVERT(UNHEX(HEX(codepoint)) USING utf32) USING utf8mb4), SUBSTRING(tmp, pos2 + 1)); - END IF; - END IF; - END IF; - SET pos1 = pos1 + 1; - END LOOP; - END - "); - - // close connection again - $pdo = null; - - $db = DBManager::get(); - - // convert selected columns from serialized data to JSON data - $this->convert_to_json('extern_config', 'config'); - $this->convert_to_json('aux_lock_rules', 'attributes'); - $this->convert_to_json('aux_lock_rules', 'sorting'); - $this->convert_to_json('user_config', 'value', "field = 'MY_COURSES_ADMIN_VIEW_FILTER_ARGS'"); - $this->convert_to_json('mail_queue_entries', 'mail'); - - // convert database to utf-8 - $db->exec("ALTER DATABASE `{$GLOBALS['DB_STUDIP_DATABASE']}` - CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); - - // convert tables and columns to utf-8 - foreach($db->query("SHOW TABLES")->fetchAll() as $data) { - try { - // TODO: check EVERY column for the current collation and keep the correct type (bin, etc.) - // $this->write('Converting table: ' . $data[0]); - - $query = 'ALTER TABLE `'. $data[0] .'` '; - $change_query = []; - $update_query = []; - $table_data = $db->query("SHOW FULL COLUMNS FROM `{$data[0]}`")->fetchAll(); - - foreach ($table_data as $column) { - $collation = false; - - // convert index columns to latin1_bin to save space and speed things up - if (mb_strpos($column['Type'], 'char') !== false) { - $matches = []; - preg_match('/char\((.*)\)/', $column['Type'], $matches); - - if ((int)$matches[1] <= 32) { - $charset = 'latin1'; - $collation = 'latin1_bin'; - } - } - - if (mb_strpos($column['Type'], 'enum') !== false) { - $charset = 'latin1'; - $collation = 'latin1_bin'; - } elseif ($data[0] === 'plugins_activated' && $column['Field'] === 'poiid') { - $charset = 'latin1'; - $collation = 'latin1_bin'; - } - - if (!$collation) { - if (mb_strpos($column['Collation'], '_bin') !== false) { // if we hav a bin column, preserve it - $charset = 'utf8mb4'; - $collation = 'utf8mb4_bin'; - } else if ($column['Collation']) { // only convert if there is a collation at all (int f.e. has no collation!) - $charset = 'utf8mb4'; - $collation = 'utf8mb4_unicode_ci'; - } - } - - if ($collation) { - $null = $column['Null'] === 'YES' ? ' NULL' : ' NOT NULL'; - $default = isset($column['Default']) ? ' DEFAULT ' . $db->quote($column['Default']) : ''; - $extra = $column['Extra'] != '' ? ' ' . $column['Extra'] : ''; - $comment = $column['Comment'] != '' ? ' COMMENT ' . $db->quote($column['Comment']) : ''; - $change_query[] = ' CHANGE `'. $column[0] .'` `'. $column[0] .'` ' - . $column[1] . ' CHARACTER SET '. $charset .' COLLATE ' . $collation . $null . $default . $extra . $comment; - } - - if ($collation && $collation !== 'latin1_bin') { - $update_query[] = '`' . $column['Field'] . '` = entity_decode(`' . $column['Field'] . '`)'; - } - } - - // do all changes at once, or multi-column-indexes will prevent conversion - $db->exec($query . implode(',', $change_query)); - - if ($update_query) { - $db->exec("UPDATE `{$data[0]}` SET " . implode(',', $update_query)); - } - - // change default encoding of table itself - $db->exec($query = "ALTER TABLE `{$data[0]}` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); - - } catch (PDOException $e) { - $this->write($query); - $this->write($e->getMessage()); - } - } - - $db->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); - - // drop helper-function - $db->exec("DROP FUNCTION IF EXISTS entity_decode"); - } - - private function legacy_studip_utf8encode($data) - { - if (is_array($data)) { - $new_data = []; - foreach ($data as $key => $value) { - $key = $this->legacy_studip_utf8encode($key); - $new_data[$key] = $this->legacy_studip_utf8encode($value); - } - return $new_data; - } - - if (!preg_match('/[\200-\377]/', $data) && !preg_match("'&#[0-9]+;'", $data)) { - return $data; - } else { - return mb_decode_numericentity( - mb_convert_encoding($data,'UTF-8', 'WINDOWS-1252'), - [0x100, 0xffff, 0, 0xffff], - 'UTF-8' - ); - } - } - - private function convert_to_json($table, $column, $where = null) - { - $db = DBManager::get(); - - // get primary keys - $result = $db->query("SHOW KEYS FROM $table WHERE Key_name = 'PRIMARY'"); - $keys = []; - - while ($data = $result->fetch(PDO::FETCH_ASSOC)) { - $keys[] = $data['Column_name']; - } - - // retrieve and convert data - $result = $db->query("SELECT `". implode('`,`', $keys) ."`, `$column` FROM `$table` WHERE ". ($where ?: '1')); - - while ($data = $result->fetch(PDO::FETCH_ASSOC)) { - $content = unserialize(legacy_studip_utf8decode($data[$column])); - - if ($content !== false) { - // encode all data - $json = json_encode($this->legacy_studip_utf8encode($content), true); - - $query = "UPDATE `$table` SET `$column` = ". $db->quote($json) ."\n WHERE "; - - $where_query = []; - foreach ($keys as $key) { - $where_query[] = "`$key` = ". $db->quote($data[$key]); - } - - $db->exec($query . implode(' AND ', $where_query)); - } - } - } - - public function down() - { - } - - private function checkMariaDB(PDO $connection, $check_version = null, $check_operator = '>=') - { - $version = $connection->query("SELECT VERSION()")->fetchColumn(); - if (!preg_match('/MariaDB$/', $version)) { - return false; - } - if ($version === null) { - return true; - } - return version_compare($version, $check_version, $check_operator); - } -} diff --git a/db/migrations/223_course_mailing_for_students.php b/db/migrations/223_course_mailing_for_students.php deleted file mode 100644 index 60bf430..0000000 --- a/db/migrations/223_course_mailing_for_students.php +++ /dev/null @@ -1,19 +0,0 @@ -exec($query); - - DBManager::get()->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); //see #9106 - } - - public function down() - { - $query = "ALTER TABLE `seminare` - DROP COLUMN `student_mailing`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/224_db_cache_table.php b/db/migrations/224_db_cache_table.php deleted file mode 100644 index 66227d0..0000000 --- a/db/migrations/224_db_cache_table.php +++ /dev/null @@ -1,29 +0,0 @@ -exec('CREATE TABLE cache ( - cache_key VARCHAR(255) COLLATE latin1_bin NOT NULL, - content MEDIUMBLOB NOT NULL, - expires INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (cache_key) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC'); - - StudipCacheFactory::getCache()->flush(); - } - - public function down() - { - $db = DBManager::get(); - - $db->exec('DROP TABLE cache'); - } -} diff --git a/db/migrations/225_extend_course_completion.php b/db/migrations/225_extend_course_completion.php deleted file mode 100644 index 05f3332..0000000 --- a/db/migrations/225_extend_course_completion.php +++ /dev/null @@ -1,27 +0,0 @@ -exec($query); - - $query = "UPDATE `seminare` - SET `completion` = `completion` + 1 - WHERE `completion` > 0"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "UPDATE `seminare` - SET `completion` = `completion` - 1 - WHERE `completion` > 0"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `seminare` - CHANGE COLUMN `completion` `is_complete` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/226_config_values.php b/db/migrations/226_config_values.php deleted file mode 100644 index 04014a3..0000000 --- a/db/migrations/226_config_values.php +++ /dev/null @@ -1,134 +0,0 @@ -exec('UPDATE config LEFT JOIN config c ON config.field = c.field AND c.is_default = 1 - SET config.is_default = 1 WHERE config.is_default = 0 AND c.config_id IS NULL'); - - // fix up missing user_config entries in config - $db->exec("INSERT IGNORE INTO config (config_id, field, value, is_default, type, `range`) - SELECT DISTINCT MD5(user_config.field), user_config.field, '', 1, 'string', 'user' - FROM user_config LEFT JOIN config ON user_config.field = config.field AND is_default = 1 - WHERE config_id IS NULL"); - - // abort migration on duplicate entries in config - $result = $db->query('SELECT field FROM config c1 JOIN config c2 USING(field, is_default) WHERE c1.config_id > c2.config_id'); - $errors = $result->fetchAll(PDO::FETCH_COLUMN); - - if (count($errors)) { - echo "Duplicate field names in config table, aborting migration:\n", implode(', ', $errors), "\n"; - die; - } - - // delete duplicate config values in user_config - $db->exec('DELETE c1 FROM user_config c1 JOIN user_config c2 USING(field, user_id) WHERE c1.userconfig_id > c2.userconfig_id'); - - // drop unused fields and update range - $db->exec("ALTER TABLE config DROP parent_id, DROP position, DROP message_template, - CHANGE field field varchar(255) COLLATE latin1_bin NOT NULL, - CHANGE type type enum('boolean', 'integer', 'string', 'array') COLLATE latin1_bin NOT NULL DEFAULT 'string', - CHANGE `range` `range` enum('global', 'user', 'course') COLLATE latin1_bin NOT NULL DEFAULT 'global'"); - - // create new table and migrate all settings - $db->exec("ALTER TABLE user_config - RENAME TO config_values, - DROP userconfig_id, - DROP parent_id, - CHANGE field field varchar(255) COLLATE latin1_bin NOT NULL, - CHANGE user_id range_id varchar(32) COLLATE latin1_bin NOT NULL AFTER field, - ADD PRIMARY KEY (field, range_id), - ADD KEY range_id (range_id), - DROP KEY user_id"); - - $db->exec("INSERT INTO config_values (field, range_id, value, comment, mkdate, chdate) - SELECT field, 'studip', value, comment, mkdate, chdate - FROM config WHERE is_default = 0"); - - $db->exec('DELETE FROM config WHERE is_default = 0'); - - // drop more obsolete fields - $db->exec('ALTER TABLE config DROP config_id, DROP is_default, DROP comment, DROP KEY field, ADD PRIMARY KEY (field)'); - - // migrate setting from seminare.student_mailing - $stmt = $db->prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'COURSE_STUDENT_MAILING', - 'description' => 'Über diese Option können Sie Studierenden das Schreiben von Nachrichten an alle anderen Teilnehmer der Veranstaltung erlauben.', - 'range' => 'course', - 'type' => 'boolean', - 'value' => '0' - ]); - - $db->exec("INSERT INTO config_values (field, range_id, value, mkdate, chdate, comment) - SELECT 'COURSE_STUDENT_MAILING', Seminar_id, student_mailing, mkdate, chdate, '' - FROM seminare WHERE student_mailing = 1"); - - $db->exec('ALTER TABLE seminare DROP student_mailing'); - } - - public function down() - { - $db = DBManager::get(); - - // migrate setting to seminare.student_mailing - $db->exec('ALTER TABLE seminare ADD student_mailing tinyint(1) unsigned NOT NULL DEFAULT 0'); - - $db->exec("UPDATE config_values JOIN seminare ON range_id = Seminar_id - SET student_mailing = value WHERE field = 'COURSE_STUDENT_MAILING'"); - - // delete no longer supported values - $db->exec("DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE `range` = 'course'"); - - // restore old primary key - $db->exec("ALTER TABLE config - ADD config_id varchar(32) COLLATE latin1_bin NOT NULL DEFAULT '' FIRST, - ADD is_default tinyint(4) NOT NULL DEFAULT 0 AFTER value, - ADD comment text NOT NULL, - DROP PRIMARY KEY"); - - $db->exec('UPDATE config SET config_id = MD5(field), is_default = 1'); - $db->exec('ALTER TABLE config ADD PRIMARY KEY (config_id), ADD KEY field (field, `range`)'); - - // restore user_config and old settings - $db->exec("ALTER TABLE config_values - RENAME TO user_config, - ADD userconfig_id varchar(32) COLLATE latin1_bin NOT NULL DEFAULT '' FIRST, - ADD parent_id varchar(32) COLLATE latin1_bin DEFAULT NULL AFTER userconfig_id, - CHANGE range_id user_id varchar(32) COLLATE latin1_bin NOT NULL AFTER parent_id, - CHANGE field field varchar(255) NOT NULL DEFAULT ''"); - - $db->exec('UPDATE user_config SET userconfig_id = MD5(CONCAT(field, user_id))'); - - $db->exec("ALTER TABLE user_config - DROP PRIMARY KEY, - DROP KEY range_id, - ADD PRIMARY KEY (userconfig_id), - ADD KEY user_id (user_id, field, value(5))"); - - $db->exec("INSERT INTO config (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description, comment) - SELECT userconfig_id, field, user_config.value, 0, type, `range`, section, - user_config.mkdate, user_config.chdate, description, user_config.comment - FROM user_config JOIN config USING(field) WHERE user_id = 'studip'"); - - $db->exec("DELETE FROM user_config WHERE user_id = 'studip'"); - - // restore unused fields and update range - $db->exec("ALTER TABLE config - CHANGE field field varchar(255) NOT NULL DEFAULT '', - CHANGE type type enum('boolean', 'integer', 'string', 'array') COLLATE latin1_bin NOT NULL DEFAULT 'boolean', - CHANGE `range` `range` enum('global', 'user') COLLATE latin1_bin NOT NULL DEFAULT 'global', - ADD parent_id varchar(32) COLLATE latin1_bin NOT NULL DEFAULT '' AFTER config_id, - ADD position int(11) NOT NULL DEFAULT 0 AFTER section, - ADD message_template varchar(255) NOT NULL DEFAULT '' AFTER comment"); - } -} diff --git a/db/migrations/227_biest_8034_config_switch_for_child_insts.php b/db/migrations/227_biest_8034_config_switch_for_child_insts.php deleted file mode 100644 index ce97c0b..0000000 --- a/db/migrations/227_biest_8034_config_switch_for_child_insts.php +++ /dev/null @@ -1,33 +0,0 @@ -'MY_INSTITUTES_INCLUDE_CHILDREN', - 'range' => 'user', - 'type' => 'boolean', - 'description' => 'Sollen untergeordnete Institute mit angezeigt werden in der Veranstaltungsübersicht für Admins?', - 'value'=> 0 - ]; - - $stmt = DBManager::get()->prepare(" - REPLACE INTO config - (field, value, `type`, `range`, mkdate, chdate, description) - VALUES - (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - $stmt->execute($config_data); - } - - public function down() - { - DBManager::get()->exec("DELETE FROM config WHERE field = 'MY_INSTITUTES_INCLUDE_CHILDREN'"); - DBManager::get()->exec("DELETE FROM config_values WHERE field = 'MY_INSTITUTES_INCLUDE_CHILDREN'"); - } -} diff --git a/db/migrations/228_show_adressees.php b/db/migrations/228_show_adressees.php deleted file mode 100644 index abcbb53..0000000 --- a/db/migrations/228_show_adressees.php +++ /dev/null @@ -1,47 +0,0 @@ - 'SHOW_ADRESSEES_LIMIT', - 'description' => 'Ab wievielen Adressaten dürfen diese aus datenschutzgründen nicht mehr angezeigt werden in einer empfangenen Nachricht?', - 'section' => 'global', - 'range' => 'global', - 'type' => 'integer', - 'value' => '20' - ] - ]; - - public function description() - { - return 'Lets Stud.IP display the adressees of a Stud.IP-message.'; - } - - public function up() - { - foreach ($this->options as $option) { - DBManager::get()->execute("INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)", - $option); - } - - DBManager::get()->exec(" - ALTER TABLE message - ADD COLUMN `show_adressees` tinyint(4) NOT NULL DEFAULT '0' AFTER `message` - "); - } - - public function down() - { - $db = DBManager::get(); - $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); - - foreach ($this->options as $option) { - $stmt->execute(['name' => $option['name']]); - } - DBManager::get()->exec(" - ALTER TABLE message - DROP COLUMN `show_adressees` - "); - } -} diff --git a/db/migrations/229_step_00278_global_search.php b/db/migrations/229_step_00278_global_search.php deleted file mode 100644 index 8b05624..0000000 --- a/db/migrations/229_step_00278_global_search.php +++ /dev/null @@ -1,120 +0,0 @@ - [ - 'order' => 1, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchMyCourses' => [ - 'order' => 2, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchCourses' => [ - 'order' => 3, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchUsers' => [ - 'order' => 4, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchInstitutes' => [ - 'order' => 5, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchFiles' => [ - 'order' => 6, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchCalendar' => [ - 'order' => 7, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchMessages' => [ - 'order' => 8, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchForum' => [ - 'order' => 9, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchResources' => [ - 'order' => 10, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchRoomAssignments' => [ - 'order' => 11, - 'active' => true, - 'fulltext' => false - ], - 'GlobalSearchModules' => [ - 'order' => 12, - 'active' => true, - 'fulltext' => false - ] - ]; - - $stmt = DBManager::get()->prepare("INSERT INTO `config` - (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (:name, :value, :type, 'global', 'globalsearch', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc) - ON DUPLICATE KEY UPDATE `chdate`=VALUES(`chdate`)"); - - $stmt->execute([ - 'name' => 'GLOBALSEARCH_MODULES', - 'value' => json_encode($modules), - 'type' => 'array', - 'desc' => 'Aktivierung und Reihenfolge der Module in der globalen Suche' - ]); - $stmt->execute([ - 'name' => 'GLOBALSEARCH_MAX_RESULT_OF_TYPE', - 'value' => 3, - 'type' => 'integer', - 'desc' => 'Wie viele Ergebnisse sollen in der globalen Schnellsuche pro Kategorie angezeigt werden?' - ]); - $stmt->execute([ - 'name' => 'GLOBALSEARCH_ASYNC_QUERIES', - 'value' => true, - 'type' => 'boolean', - 'desc' => 'Sollen die Suchanfragen asynchron über mysqli gestellt werden? Andernfalls wird PDO verwendet.' - ]); - - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `globalsearch_buzzwords` ( - `id` VARCHAR(32) NOT NULL, - `rights` ENUM('user','autor','tutor','dozent','admin','root') NOT NULL DEFAULT 'user', - `name` varchar(255) NOT NULL DEFAULT '', - `buzzwords` varchar(2048) NOT NULL DEFAULT '', - `subtitle` varchar(255) DEFAULT NULL, - `url` varchar(2048) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - } - - function down() { - DBManager::get()->exec("DELETE FROM `config` WHERE `field` IN ( - 'GLOBALSEARCH_MODULES', - 'GLOBALSEARCH_MAX_RESULT_OF_TYPE', - 'GLOBALSEARCH_ASYNC_QUERIES')" - ); - - DBManager::get()->exec("DROP TABLE IF EXISTS `globalsearch_buzzwords`"); - } - -} diff --git a/db/migrations/22_lit_list_content_note_from_varchar_to_text.php b/db/migrations/22_lit_list_content_note_from_varchar_to_text.php deleted file mode 100644 index e6ba782..0000000 --- a/db/migrations/22_lit_list_content_note_from_varchar_to_text.php +++ /dev/null @@ -1,19 +0,0 @@ -exec("ALTER TABLE `lit_list_content` CHANGE `note` `note` TEXT NULL DEFAULT NULL"); - } - - function down() { - $db = DBManager::get(); - $db->exec("ALTER TABLE `lit_list_content` CHANGE `note` `note` VARCHAR( 255 ) NULL DEFAULT NULL"); - } -} diff --git a/db/migrations/230_widgets.php b/db/migrations/230_widgets.php deleted file mode 100644 index 05b2a00..0000000 --- a/db/migrations/230_widgets.php +++ /dev/null @@ -1,441 +0,0 @@ - - * @license GPL2 or any later version - * - * @todo Migrate the old widget system - */ -class Widgets extends Migration -{ - public function description() - { - return 'Sets up the database tables for the new widget system'; - } - - public function up() - { - $this->createTables(); - $this->registerDefaultWidgets(); - - // $plugin_ids = $this->getValidPortalPluginIds(); - // $mapping = $this->registerLegacyWidgets($plugin_ids); - // - // $this->migrateOldDefaults($plugin_ids, $mapping); - // $this->migrateOldWidgets($plugin_ids, $mapping); - // $this->migrateOldSettings(); - // - // $this->setDefaultsForCourseDetails(); - // $this->setDefaultsForCourseOverview(); - // $this->setDefaultsForInstituteDetails(); - // $this->setDefaultsForUserProfile(); - // - // $this->unregisterOldPlugins($plugin_ids); - // - // $this->dropOldTables(); - - $this->activateRoutes(); - - // $this->updateHelpContent(); - } - - private function createTables() - { - $query = "CREATE TABLE IF NOT EXISTS `widget_containers` ( - `container_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, - `range_type` ENUM('course','institute','user','plugin','other') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'course', - `scope` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'default', - `parent_id` INT(11) UNSIGNED NULL DEFAULT NULL, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`container_id`), - UNIQUE KEY `range` (`range_id`, `range_type`, `scope`), - KEY `parent_id` (`parent_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `widget_elements` ( - `element_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `container_id` INT(11) UNSIGNED NOT NULL, - `widget_id` INT(11) UNSIGNED NOT NULL, - `x` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `y` TINYINT(3) UNSIGNED NOT NULL, - `width` TINYINT(1) UNSIGNED NOT NULL, - `height` TINYINT(1) UNSIGNED NOT NULL, - `locked` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `removable` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, - `options` VARCHAR(8192) NOT NULL DEFAULT '[]', - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`element_id`), - KEY `container_id` (`container_id`), - KEY `widget_id` (`widget_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `widgets` ( - `widget_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `class` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `filename` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, - `enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`widget_id`), - UNIQUE KEY `class` (`class`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - } - - private function registerDefaultWidgets() - { - $files = array_merge( - glob(__DIR__ . '/../../app/widgets/*.php'), - glob(__DIR__ . '/../../app/widgets/course/*.php') - ); - - // Register default widgets - foreach ($files as $file) { - require_once $file; - - $class = basename($file, '.php'); - Widgets\Widget::registerWidget(new $class); - } - } - - private function dropOldTables() - { - // Drop old tables - $query = "DROP TABLE IF EXISTS `widget_default`, `widget_user`"; - DBManager::get()->exec($query); - } - - private function getValidPortalPluginIds() - { - // Load and validate plugins - $query = "SELECT `pluginid`, CONCAT(`pluginpath`, '/', `pluginclassname`) - FROM `plugins` - WHERE FIND_IN_SET('PortalPlugin', `plugintype`) > 0"; - $statement = DBManager::get()->query($query); - $plugin_paths = $statement->fetchGrouped(PDO::FETCH_COLUMN); - - $base_path = Config::get()->PLUGINS_PATH; - foreach ($plugin_paths as $plugin_id => $path) { - if (strpos($path, 'core/') === 0) { - continue; - } - - $files = glob($base_path . '/' . $path . '{,.class}.php', GLOB_BRACE); - if (count($files) === 0) { - unset($plugin_paths[$plugin_id]); - } - } - return array_keys($plugin_paths); - } - - private function registerLegacyWidgets(array $plugin_ids) - { - // Register legacy widgets - $query = "INSERT IGNORE INTO `widgets` (`class`, `filename`, `enabled`, `mkdate`, `chdate`) - SELECT `pluginid`, NULL, `enabled` = 'yes', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - FROM `plugins` - WHERE `pluginid` IN (:ids) - AND `pluginpath` NOT LIKE 'core/%'"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':ids', $plugin_ids, StudipPDO::PARAM_ARRAY); - $statement->execute(); - - // Get plugin -> widget mapping - $query = "SELECT `class`, `widget_id` - FROM `widgets` - WHERE `filename` IS NULL"; - $statement = DBManager::get()->query($query); - $mapping0 = $statement->fetchGrouped(PDO::FETCH_COLUMN); - - // Add already converted core plugins - $plugins_to_widgets = [ - 'QuickSelection|QuickSelectionWidget', - 'ScheduleWidget|ScheduleWidget', - 'TerminWidget|CalendarWidget', - 'ActivityFeed|ActivityFeedWidget', - 'NewsWidget|NewsWidget', - 'EvaluationsWidget|EvaluationsWidget', - ]; - $query = "SELECT `pluginid`, `widget_id` - FROM `plugins`, `widgets` - WHERE CONCAT(`pluginclassname`, '|', `class`) - IN (:mapping)"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':mapping', $plugins_to_widgets); - $statement->execute(); - $mapping1 = $statement->fetchGrouped(PDO::FETCH_COLUMN); - - return $mapping0 + $mapping1; - } - - private function migrateOldDefaults(array $plugin_ids, array $mapping) - { - $query = "SELECT `perm`, `pluginid`, `col`, `position` - FROM `widget_default` - JOIN `plugins` USING (`pluginid`) - WHERE `enabled` = 'yes' - AND `pluginid` IN (:ids) - ORDER BY `perm`, `position` ASC, `col` ASC"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':ids', $plugin_ids, StudipPDO::PARAM_ARRAY); - $statement->execute(); - $defaults = $statement->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); - - $this->migrateWidgetsAndContainers($defaults, $mapping); - } - - private function migrateOldWidgets(array $plugin_ids, array $mapping) - { - $query = "SELECT `range_id`, `pluginid`, `col`, `position` - FROM `widget_user` - JOIN `plugins` USING (`pluginid`) - WHERE `enabled` = 'yes' - AND `pluginid` IN (:ids) - ORDER BY `range_id`, `position` ASC, `col` ASC"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':ids', $plugin_ids, StudipPDO::PARAM_ARRAY); - $statement->execute(); - $widgets = $statement->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); - - $this->migrateWidgetsAndContainers($widgets, $mapping); - } - - private function migrateWidgetsAndContainers(array $data, array $mapping) - { - foreach ($data as $id => $rows) { - $container_id = $this->createNewContainer('user', $id, 'start'); - - foreach ($rows as $row) { - $this->addWidgetToContainerById($container_id, $mapping[$row['pluginid']], [ - 'x' => $row['col'] * 2, - 'y' => $row['position'], - 'width' => $row['col'] == 0 ? 4 : 2, - 'height' => 1, - ]); - } - } - } - - private function migrateOldSettings() - { - // Quick selection widget - $query = "UPDATE `widget_elements` AS `we` - -- Get correct widget - JOIN `widgets` AS `w` USING (`widget_id`) - -- Get correct configuration - JOIN `widget_containers` AS `wc` USING (`container_id`) - JOIN `user_config` AS `uc` - ON (`uc`.`user_id` = `wc`.`range_id` - AND `wc`.`range_type` = 'user' - AND `uc`.`field` = 'QUICK_SELECTION') - SET `we`.`options` = `uc`.`value` - WHERE `w`.`class` = 'QuickSelectionWidget'"; - DBManager::get()->exec($query); - - $query = "DELETE FROM `user_config` WHERE `field` = 'QUICK_SELECTION'"; - DBManager::get()->exec($query); - } - - private function unregisterOldPlugins(array $plugin_ids) - { - // Remove old core widgets - $query = "DELETE FROM `plugins` - WHERE `pluginid` IN (:ids) - AND `pluginpath` LIKE 'core/%'"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':ids', $plugin_ids); - $statement->execute(); - - // Deactivate other plugins - $query = "UPDATE `plugins` - SET `enabled` = 'no' - WHERE `pluginid` IN (:ids)"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':ids', $plugin_ids); - $statement->execute(); - } - - private function setDefaultsForCourseDetails() - { - // Define widgets - $widgets = [ - 'CourseDetailsWidget' => ['height' => 3], - 'CourseTeachersWidget' => ['height' => 2], - 'CourseEventsWidget' => ['height' => 2], - 'CourseTopicsWidget' => ['height' => 2], - 'CourseRoomsWidget' => ['height' => 2], - 'CourseModulesWidget' => ['height' => 3], - 'CourseStudyareasWidget' => ['height' => 3], - 'CourseAdmissionWidget' => ['height' => 3], - 'CourseDomainsWidget' => [], - ]; - - // Check whether mvv is activated, remove widget if not - $query = "SELECT `enabled` = 'yes' - FROM `plugins` - WHERE `pluginclassname` = 'MVVPlugin'"; - $mvv_enabled = DBManager::get()->fetchColumn($query); - if (!$mvv_enabled) { - unset($widgets['CourseModulesWidget']); - } - - $this->createDefaultContainer('course', null, 'details', $widgets); - } - - private function setDefaultsForCourseOverview() - { - $this->createDefaultContainer('course', null, 'overview', [ - 'CourseDetailsWidget' => ['height' => 3], - 'NewsWidget' => ['height' => 2], - 'CalendarWidget' => ['height' => 2], - 'EvaluationsWidget' => [], - 'QuestionnaireWidget' => [], - ]); - } - - private function setDefaultsForInstituteDetails() - { - $this->createDefaultContainer('institute', null, 'default', [ - 'InstituteDetailsWidget' => ['height' => 3], - 'NewsWidget' => ['height' => 2], - 'EvaluationsWidget' => [], - 'QuestionnaireWidget' => [], - ]); - } - - private function setDefaultsForUserProfile() - { - $widgets = [ - 'ProfileDetailsWidget' => ['height' => 5], - 'NewsWidget' => ['height' => 2], - 'CalendarWidget' => ['height' => 2, 'perms' => ['user', 'autor', 'tutor', 'dozent']], - 'EvaluationsWidget' => [], - 'QuestionnaireWidget' => [], - 'ProfileFilesWidget' => ['height' => 2], - 'ProfileCoursesWidget' => ['height' => 2, 'perms' => ['dozent']], - 'LiteratureWidget' => [], - 'ProfileCategoriesWidget' => ['height' => 2], - - ]; - - foreach (['user', 'autor', 'tutor', 'dozent', 'admin', 'root'] as $perm) { - $perm_widgets = array_filter($widgets, function ($row) use ($perm) { - return !isset($row['perms']) - || in_array($perm, $row['perms']); - }); - - $this->createDefaultContainer('user', $perm, 'profile', $perm_widgets); - } - } - - private function createDefaultContainer($type, $id, $scope, array $widgets) - { - // Create default container and add widgets - $container_id = $this->createNewContainer($type, $id, $scope); - - $y = 0; - foreach ($widgets as $class => $additional) { - $this->addWidgetToContainerByClass($container_id, $class, array_merge([ - 'y' => $y, - ], $additional)); - - $y += $additional['height'] ?: 1; - } - } - - private function createNewContainer($type, $id, $scope) - { - $query = "INSERT INTO `widget_containers` ( - `range_id`, `range_type`, `scope`, - `mkdate`, `chdate` - ) VALUES ( - :id, :type, :scope, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':id', $id); - $statement->bindValue(':type', $type); - $statement->bindValue(':scope', $scope); - $statement->execute(); - - return DBManager::get()->lastInsertId(); - } - - private function addWidgetToContainerByClass($container_id, $widget_class, array $data = []) - { - $query = "INSERT INTO `widget_elements` ( - `container_id`, `widget_id`, - `x`, `y`, `width`, `height`, - `locked`, `removable`, `options`, - `mkdate`, `chdate` - ) - SELECT :container_id, `widget_id`, - :x, :y, :width, :height, - 0, 1, '[]', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - FROM `widgets` - WHERE `class` = :class"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':container_id', $container_id); - $statement->bindValue(':x', $data['x'] ?: 0); - $statement->bindValue(':y', $data['y'] ?: 0); - $statement->bindValue(':width', $data['width'] ?: 1); - $statement->bindValue(':height', $data['height'] ?: 1); - $statement->bindValue(':class', $widget_class); - $statement->execute(); - } - - private function addWidgetToContainerById($container_id, $widget_id, array $data = []) - { - $query = "INSERT INTO `widget_elements` ( - `container_id`, `widget_id`, - `x`, `y`, `width`, `height`, - `locked`, `removable`, `options`, - `mkdate`, `chdate` - ) VALUES ( - :container_id, :widget_id, - :x, :y, :width, :height, - 0, 1, '[]', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':container_id', $container_id); - $statement->bindValue(':widget_id', $widget_id); - $statement->bindValue(':x', $data['x'] ?: 0); - $statement->bindValue(':y', $data['y'] ?: 0); - $statement->bindValue(':width', $data['width'] ?: 1); - $statement->bindValue(':height', $data['height'] ?: 1); - $statement->execute(); - } - - private function activateRoutes() - { - $permissions = RESTAPI\ConsumerPermissions::get('global'); - $permissions->set('/widgets/:container_id', 'put', true, true); - $permissions->set('/widgets/:container_id/:widget_id', 'post', true, true); - $permissions->set('/widgets/:container_id/:action/:element_id', 'get', true, true); - $permissions->set('/widgets/:container_id/:action/:element_id', 'post', true, true); - $permissions->set('/widgets/:container_id/:action/:element_id/:admin', 'get', true, true); - $permissions->set('/widgets/:container_id/:action/:element_id/:admin', 'post', true, true); - $permissions->store(); - } - - private function updateHelpContent() - { - $query = "UPDATE `help_content` - SET `route` = 'dispatch.php/course/info' - WHERE `route` = 'dispatch.php/course/details'"; - DBManager::get()->exec($query); - } - - public function down() - { - // Naaaah, don't do that... - } -} diff --git a/db/migrations/231_add_files_search_index.php b/db/migrations/231_add_files_search_index.php deleted file mode 100644 index aa25348..0000000 --- a/db/migrations/231_add_files_search_index.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @license GPL2 or any later version - */ -class AddFilesSearchIndex extends Migration -{ - public function description() - { - return 'Sets up the database tables for the files search index'; - } - - /** - * @SuppressWarnings(PHPMD.ShortMethodName) - */ - public function up() - { - $this->createTables(); - - if ($this->registerWidgets()) { - $this->setupDefaultWidgets(); - } - - $this->installCronjob(); - } - - public function down() - { - $dbm = \DBManager::get(); - $dbm->execute('DROP TABLE `files_search_index`, `files_search_attributes`'); - } - - // Get version of database system (MySQL/MariaDB/Percona) - private static function isMySQL55() - { - $data = \DBManager::get()->fetchFirst("SELECT VERSION() AS version"); - $version = $data[0]; - return version_compare($version, '5.6', '<'); - } - - // The primary key is named FTS_DOC_ID according to - // https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html - private function createTables() - { - $engine = self::isMySQL55() ? 'MyISAM' : 'InnoDB'; - $dbm = \DBManager::get(); - $dbm->execute( - 'CREATE TABLE IF NOT EXISTS `files_search_index` ( - `file_ref_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `text` text COLLATE utf8mb4_unicode_ci NOT NULL, - `relevance` float NOT NULL, - KEY `file_ref_id` (`file_ref_id`), - FULLTEXT KEY `text` (`text`) - ) ENGINE=' . $engine . ' DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC' - ); - $dbm->execute(' - CREATE TABLE IF NOT EXISTS `files_search_attributes` ( - `id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `file_ref_user_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `file_ref_mkdate` int(10) unsigned NOT NULL, - `file_ref_chdate` int(10) unsigned NOT NULL, - `folder_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `folder_range_id` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `folder_range_type` char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `folder_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `course_status` tinyint(4) unsigned DEFAULT NULL, - `semester_start` int(20) unsigned DEFAULT NULL, - `semester_end` int(20) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `folder_range_id` (`folder_range_id`), - KEY `folder_range_type` (`folder_range_type`), - KEY `semester_start` (`semester_start`), - KEY `semester_end` (`semester_end`) - ) ENGINE=' . $engine . ' DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC - '); - } - - private function registerWidgets() - { - $widgets = [ - 'app/widgets/files_dashboard/MyPublicFilesWidget.php' => 'Widgets\\FilesDashboard\\MyPublicFilesWidget', - - 'app/widgets/files_dashboard/LatestFilesWidget.php' => 'Widgets\\FilesDashboard\\LatestFilesWidget' - ]; - - foreach ($widgets as $path => $class) { - if (!file_exists($path)) { - return false; - } - - require $path; - \Widgets\Widget::registerWidget(new $class()); - } - - return true; - } - - private function setupDefaultWidgets() - { - $widgets = [ - 'Widgets\\FilesDashboard\\LatestFilesWidget' => ['width' => 3, 'height' => 3], - 'Widgets\\FilesDashboard\\MyPublicFilesWidget' => ['width' => 3, 'height' => 3], - ]; - - foreach (['user', 'autor', 'tutor', 'dozent', 'admin', 'root'] as $perm) { - $this->createDefaultContainer('user', $perm, 'dashboard', $widgets); - } - } - - private function createDefaultContainer($rangeType, $rangeId, $scope, array $widgets) - { - $containerId = $this->createNewContainer($rangeType, $rangeId, $scope); - - $xCoord = 0; - $yCoord = 0; - $yMax = 0; - foreach ($widgets as $class => $additional) { - $this->addWidgetToContainerByClass($containerId, $class, array_merge([ - 'x' => $xCoord, - 'y' => $yCoord, - ], $additional)); - - $yMax = max($yMax, $additional['height'] ?: 1); - - $xCoord += $additional['width']; - if ($xCoord >= 6) { - $xCoord = 0; - - $yCoord += $yMax; - $yMax = 0; - } - } - } - - private function createNewContainer($rangeType, $rangeId, $scope) - { - $query = 'INSERT INTO `widget_containers` ( - `range_id`, `range_type`, `scope`, - `mkdate`, `chdate` - ) VALUES ( - :id, :type, :scope, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )'; - $statement = \DBManager::get()->prepare($query); - $statement->bindValue(':id', $rangeId); - $statement->bindValue(':type', $rangeType); - $statement->bindValue(':scope', $scope); - $statement->execute(); - - return \DBManager::get()->lastInsertId(); - } - - /** - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - private function addWidgetToContainerByClass($containerId, $widgetClass, array $data = []) - { - $query = "INSERT INTO `widget_elements` ( - `container_id`, `widget_id`, - `x`, `y`, `width`, `height`, - `locked`, `removable`, `options`, - `mkdate`, `chdate` - ) - SELECT :container_id, `widget_id`, - :x, :y, :width, :height, - 1, 0, '[]', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - FROM `widgets` - WHERE `class` = :class"; - $statement = \DBManager::get()->prepare($query); - $statement->bindValue(':container_id', $containerId); - $statement->bindValue(':x', $data['x'] ?: 0); - $statement->bindValue(':y', $data['y'] ?: 0); - $statement->bindValue(':width', $data['width'] ?: 1); - $statement->bindValue(':height', $data['height'] ?: 1); - $statement->bindValue(':class', $widgetClass); - $statement->execute(); - } - - private function installCronjob() - { - require_once 'lib/classes/FilesSearch/Cronjob.php'; - $task = new \FilesSearch\Cronjob(); - $taskId = CronjobScheduler::getInstance()->registerTask($task); - CronjobScheduler::scheduleOnce($taskId, strtotime('+1 minute'))->activate(); - CronjobScheduler::schedulePeriodic($taskId, 55, 0)->activate(); - } -} diff --git a/db/migrations/232_step_00315_mvv_i18n.php b/db/migrations/232_step_00315_mvv_i18n.php deleted file mode 100644 index 6ecc715..0000000 --- a/db/migrations/232_step_00315_mvv_i18n.php +++ /dev/null @@ -1,644 +0,0 @@ - - * @license GPL2 or any later version - * -*/ - -class Step00315MvvI18n extends Migration -{ - public function description() - { - return 'migrates mvv localized fields to i18n api'; - } - - public function up() - { - $db = DBManager::get(); - - // fach - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `fach_id`, 'fach', 'name', 'en_GB', `name_en` " - . "FROM `fach` WHERE IFNULL(`name_en`, '') != ''" - ); - - // name_kurz - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `fach_id`, 'fach', 'name_kurz', 'en_GB', `name_kurz_en` " - . "FROM `fach` WHERE IFNULL(`name_kurz_en`, '') != ''" - ); - - // beschreibung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `fach_id`, 'fach', 'beschreibung', 'en_GB', `beschreibung_en` " - . "FROM `fach` WHERE IFNULL(`beschreibung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `fach` DROP `name_en`, DROP `name_kurz_en`, DROP `beschreibung_en`"); - - // abschluss - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschluss_id`, 'abschluss', 'name', 'en_GB', `name_en` " - . "FROM `abschluss` WHERE IFNULL(`name_en`, '') != ''" - ); - - // name_kurz - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschluss_id`, 'abschluss', 'name_kurz', 'en_GB', `name_kurz_en` " - . "FROM `abschluss` WHERE IFNULL(`name_kurz_en`, '') != ''" - ); - - // beschreibung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschluss_id`, 'abschluss', 'beschreibung', 'en_GB', `beschreibung_en` " - . "FROM `abschluss` WHERE IFNULL(`beschreibung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `abschluss` DROP `name_en`, DROP `name_kurz_en`, DROP `beschreibung_en`"); - - - // mvv_abschl_kategorie - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `kategorie_id`, 'mvv_abschl_kategorie', 'name', 'en_GB', `name_en` " - . "FROM `mvv_abschl_kategorie` WHERE IFNULL(`name_en`, '') != ''" - ); - - // name_kurz - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `kategorie_id`, 'mvv_abschl_kategorie', 'name_kurz', 'en_GB', `name_kurz_en` " - . "FROM `mvv_abschl_kategorie` WHERE IFNULL(`name_kurz_en`, '') != ''" - ); - - // beschreibung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `kategorie_id`, 'mvv_abschl_kategorie', 'beschreibung', 'en_GB', `beschreibung_en` " - . "FROM `mvv_abschl_kategorie` WHERE IFNULL(`beschreibung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_abschl_kategorie` DROP `name_en`, DROP `name_kurz_en`, DROP `beschreibung_en`"); - - - // mvv_dokument - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `dokument_id`, 'mvv_dokument', 'name', 'en_GB', `name_en` " - . "FROM `mvv_dokument` WHERE IFNULL(`name_en`, '') != ''" - ); - - // linktext - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `dokument_id`, 'mvv_dokument', 'linktext', 'en_GB', `linktext_en` " - . "FROM `mvv_dokument` WHERE IFNULL(`linktext_en`, '') != ''" - ); - - // beschreibung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `dokument_id`, 'mvv_dokument', 'beschreibung', 'en_GB', `beschreibung_en` " - . "FROM `mvv_dokument` WHERE IFNULL(`beschreibung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_dokument` DROP `name_en`, DROP `linktext_en`, DROP `beschreibung_en`"); - - - // mvv_dokument_zuord - - // add an own primary key to simplify i18n (used as foreign key in i18n) - $db->execute("ALTER TABLE `mvv_dokument_zuord` ADD `dokument_zuord_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL FIRST"); - $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP PRIMARY KEY, ADD UNIQUE (`dokument_id`, `range_id`, `object_type`) USING BTREE"); - $dokument_zuordnungen = $db->query("SELECT * FROM `mvv_dokument_zuord` WHERE 1"); - $is_unique = $db->prepare("SELECT `dokument_zuord_id` FROM `mvv_dokument_zuord` WHERE `dokument_zuord_id` = ?"); - foreach ($dokument_zuordnungen->fetchAll() as $dokument_zuordnung) { - do { - $id = md5(uniqid('mvv_dokument_zuord', 1)); - $is_unique->execute([$id]); - } while ($is_unique->fetch()); - $db->execute("UPDATE `mvv_dokument_zuord` SET `dokument_zuord_id` = ? " - . "WHERE `dokument_id` = ? AND `range_id` = ? AND `object_type` = ?", - [$id, $dokument_zuordnung['dokument_id'], $dokument_zuordnung['range_id'], - $dokument_zuordnung['object_type']]); - } - $db->execute("ALTER TABLE `mvv_dokument_zuord` ADD PRIMARY KEY(`dokument_zuord_id`)"); - - // kommentar - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `dokument_zuord_id`, 'mvv_dokument_zuord', 'kommentar', 'en_GB', `kommentar_en` " - . "FROM `mvv_dokument_zuord` WHERE IFNULL(`kommentar_en`, '') != ''" - ); - $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP `kommentar_en`"); - - - // mvv_lvgruppe - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `lvgruppe_id`, 'mvv_lvgruppe', 'name', 'en_GB', `name_en` " - . "FROM `mvv_lvgruppe` WHERE IFNULL(`name_en`, '') != ''" - ); - - // alttext - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `lvgruppe_id`, 'mvv_lvgruppe', 'alttext', 'en_GB', `alttext_en` " - . "FROM `mvv_lvgruppe` WHERE IFNULL(`alttext_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_lvgruppe` DROP `name_en`, DROP `alttext_en`"); - - - // mvv_modulteil_deskriptor - - $deskriptoren = $db->query("SELECT `mmd1`.*, `mmd2`.`deskriptor_id` AS `base_id` " - . "FROM `mvv_modulteil_deskriptor` `mmd1` " - . "LEFT JOIN `mvv_modulteil_deskriptor` `mmd2` " - . "ON `mmd1`.`modulteil_id` = `mmd2`.`modulteil_id` AND `mmd2`.`sprache` = 'DE' " - . "WHERE `mmd1`.`sprache` != 'DE'"); - $stmt = $db->prepare("INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "VALUES(?, 'mvv_modulteil_deskriptor', ?, 'en_GB', ?)"); - foreach ($deskriptoren->fetchAll() as $deskriptor) { - $fields = ['bezeichnung', 'voraussetzung', 'kommentar', 'kommentar_kapazitaet', - 'kommentar_wl_praesenz', 'kommentar_wl_bereitung', 'kommentar_wl_selbst', - 'kommentar_wl_pruef', 'pruef_vorleistung', 'pruef_leistung', 'kommentar_pflicht']; - foreach ($fields as $field) { - if (trim($deskriptor[$field])) { - $stmt->execute([$deskriptor['base_id'], $field, $deskriptor[$field]]); - } - } - } - - $db->execute("DELETE FROM `mvv_modulteil_deskriptor` WHERE sprache != 'DE'"); - - $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` DROP INDEX `modulteil_id`"); - $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` DROP `sprache`"); - $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` ADD INDEX `modulteil_id` (`modulteil_id`)"); - - - // mvv_modul_deskriptor - - $deskriptoren = $db->query("SELECT `mmd1`.*, `mmd2`.`deskriptor_id` AS `base_id` " - . "FROM `mvv_modul_deskriptor` `mmd1` " - . "LEFT JOIN `mvv_modul_deskriptor` `mmd2` " - . "ON `mmd1`.`modul_id` = `mmd2`.`modul_id` AND `mmd2`.`sprache` = 'DE' " - . "WHERE `mmd1`.`sprache` != 'DE'"); - $stmt = $db->prepare("INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "VALUES(?, 'mvv_modul_deskriptor', ?, 'en_GB', ?)"); - foreach ($deskriptoren->fetchAll(PDO::FETCH_ASSOC) as $deskriptor) { - $fields = ['verantwortlich', 'bezeichnung', 'voraussetzung', 'kompetenzziele', - 'inhalte', 'literatur', 'links', 'kommentar', 'turnus', 'kommentar_kapazitaet', - 'kommentar_sws', 'kommentar_wl_selbst', 'kommentar_wl_pruef', 'kommentar_note', - 'pruef_vorleistung', 'pruef_leistung', 'pruef_wiederholung', 'ersatztext']; - foreach ($fields as $field) { - if (trim($deskriptor[$field])) { - $stmt->execute([$deskriptor['base_id'], $field, $deskriptor[$field]]); - } - } - } - - $db->execute("DELETE FROM `mvv_modul_deskriptor` WHERE `sprache` != 'DE'"); - $db->execute("ALTER TABLE `mvv_modul_deskriptor` DROP INDEX `modul_id`"); - $db->execute("ALTER TABLE `mvv_modul_deskriptor` DROP `sprache`"); - $db->execute("ALTER TABLE `mvv_modul_deskriptor` ADD INDEX `modul_id` (`modul_id`)"); - - - // mvv_stgteil - - // zusatz - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `stgteil_id`, 'mvv_stgteil', 'zusatz', 'en_GB', `zusatz_en` " - . "FROM `mvv_stgteil` WHERE IFNULL(`zusatz_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_stgteil` DROP `zusatz_en`"); - - - // mvv_stgteilabschnitt - - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschnitt_id`, 'mvv_stgteilabschnitt', 'name', 'en_GB', `name_en` " - . "FROM `mvv_stgteilabschnitt` WHERE IFNULL(`name_en`, '') != ''" - ); - - // kommentar - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschnitt_id`, 'mvv_stgteilabschnitt', 'kommentar', 'en_GB', `kommentar_en` " - . "FROM `mvv_stgteilabschnitt` WHERE IFNULL(`kommentar_en`, '') != ''" - ); - - // ueberschrift - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschnitt_id`, 'mvv_stgteilabschnitt', 'ueberschrift', 'en_GB', `ueberschrift_en` " - . "FROM `mvv_stgteilabschnitt` WHERE IFNULL(`ueberschrift_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_stgteilabschnitt` DROP `name_en`, DROP `kommentar_en`, DROP `ueberschrift_en`"); - - - // mvv_stgteilabschnitt_modul - - // add an own primary key to simplify i18n (used as foreign key in i18n) - $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` ADD `abschnitt_modul_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL FIRST"); - $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` DROP PRIMARY KEY, ADD UNIQUE (`abschnitt_id`, `modul_id`) USING BTREE"); - $abschnitt_modul = $db->query("SELECT * FROM `mvv_stgteilabschnitt_modul` WHERE 1"); - $is_unique = $db->prepare("SELECT `abschnitt_modul_id` FROM `mvv_stgteilabschnitt_modul` WHERE `abschnitt_modul_id` = ?"); - foreach ($abschnitt_modul->fetchAll() as $abs_mod) { - do { - $id = md5(uniqid('mvv_stgteilabschnitt_modul', 1)); - $is_unique->execute([$id]); - } while ($is_unique->fetch()); - $db->execute("UPDATE `mvv_stgteilabschnitt_modul` SET `abschnitt_modul_id` = ? WHERE `abschnitt_id` = ? AND `modul_id` = ?", - [$id, $abs_mod['abschnitt_id'], $abs_mod['modul_id']]); - } - $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` ADD PRIMARY KEY(`abschnitt_modul_id`)"); - - // bezeichnung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `abschnitt_modul_id`, 'mvv_stgteilabschnitt_modul', 'bezeichnung', 'en_GB', `bezeichnung_en` " - . "FROM `mvv_stgteilabschnitt_modul` WHERE IFNULL(`bezeichnung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` DROP `bezeichnung_en`"); - - - // mvv_stgteilversion - - // beschreibung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `version_id`, 'mvv_stgteilversion', 'beschreibung', 'en_GB', `beschreibung_en` " - . "FROM `mvv_stgteilversion` WHERE IFNULL(`beschreibung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_stgteilversion` DROP `beschreibung_en`"); - - - // mvv_stgteil_bez - - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `stgteil_bez_id`, 'mvv_stgteil_bez', 'name', 'en_GB', `name_en` " - . "FROM `mvv_stgteil_bez` WHERE IFNULL(`name_en`, '') != ''" - ); - - // name_kurz - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `stgteil_bez_id`, 'mvv_stgteil_bez', 'name_kurz', 'en_GB', `name_kurz_en` " - . "FROM `mvv_stgteil_bez` WHERE IFNULL(`name_kurz_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_stgteil_bez` DROP `name_en`, DROP `name_kurz_en`"); - - // mvv_studiengang - - // name - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `studiengang_id`, 'mvv_studiengang', 'name', 'en_GB', `name_en` " - . "FROM `mvv_studiengang` WHERE IFNULL(`name_en`, '') != ''" - ); - - // name_kurz - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `studiengang_id`, 'mvv_studiengang', 'name_kurz', 'en_GB', `name_kurz_en` " - . "FROM `mvv_studiengang` WHERE IFNULL(`name_kurz_en`, '') != ''" - ); - - // beschreibung - $db->execute( - "INSERT INTO `i18n` (`object_id`, `table`, `field`, `lang`, `value`) " - . "SELECT `studiengang_id`, 'mvv_studiengang', 'beschreibung', 'en_GB', `beschreibung_en` " - . "FROM `mvv_studiengang` WHERE IFNULL(`beschreibung_en`, '') != ''" - ); - - $db->execute("ALTER TABLE `mvv_studiengang` DROP `name_kurz_en`, DROP `name_en`, DROP `beschreibung_en`"); - - - // make datafields i18ed - $db->exec("ALTER TABLE datafields - CHANGE `type` `type` ENUM('bool','textline','textlinei18n','textarea', - 'textareai18n','textmarkup','textmarkupi18n','selectbox', - 'date','time','email','phone','radio','combo','link','selectboxmultiple') - CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'textline'"); - $db->execute("ALTER TABLE `datafields_entries` - ADD `lang` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `sec_range_id`"); - $db->execute('ALTER TABLE `datafields_entries` ' - . 'DROP PRIMARY KEY, ADD PRIMARY KEY (`datafield_id`, `range_id`, `sec_range_id`, `lang`)'); - } - - public function down() - { - $db = DBManager::get(); - - // fach - // name_en - $db->execute('ALTER TABLE `fach` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `fach` - LEFT JOIN `i18n` ON (`fach`.`fach_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'fach' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // name_kurz - $db->execute('ALTER TABLE `fach` ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`'); - $db->execute("UPDATE `fach` - LEFT JOIN `i18n` ON (`fach`.`fach_id` = `i18n`.`object_id`) - SET `name_kurz_en` = `value` - WHERE `table` = 'fach' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); - - // beschreibung - $db->execute('ALTER TABLE `fach` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); - $db->execute("UPDATE `fach` - LEFT JOIN `i18n` ON (`fach`.`fach_id` = `i18n`.`object_id`) - SET `beschreibung_en` = `value` - WHERE `table` = 'fach' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'fach'"); - - - // abschluss - // name - $db->execute('ALTER TABLE `abschluss` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `abschluss` - LEFT JOIN `i18n` ON (`abschluss`.`abschluss_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'abschluss' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // name_kurz - $db->execute('ALTER TABLE `abschluss` ADD `name_kurz_en` VARCHAR(50) NULL DEFAULT NULL AFTER `name_kurz`'); - $db->execute("UPDATE `abschluss` - LEFT JOIN `i18n` ON (`abschluss`.`abschluss_id` = `i18n`.`object_id`) - SET `name_kurz_en` = `value` - WHERE `table` = 'abschluss' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); - - // beschreibung - $db->execute('ALTER TABLE `abschluss` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); - $db->execute("UPDATE `abschluss` - LEFT JOIN `i18n` ON (`abschluss`.`abschluss_id` = `i18n`.`object_id`) - SET `beschreibung_en` = `value` - WHERE `table` = 'abschluss' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'abschluss'"); - - - // mvv_abschl_kategorie - // name - $db->execute('ALTER TABLE `mvv_abschl_kategorie` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `mvv_abschl_kategorie` - LEFT JOIN `i18n` ON (`mvv_abschl_kategorie`.`kategorie_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'mvv_abschl_kategorie' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // name_kurz - $db->execute('ALTER TABLE `mvv_abschl_kategorie` ADD `name_kurz_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name_kurz`'); - $db->execute("UPDATE `mvv_abschl_kategorie` - LEFT JOIN `i18n` ON (`mvv_abschl_kategorie`.`kategorie_id` = `i18n`.`object_id`) - SET `name_kurz_en` = `value` - WHERE `table` = 'mvv_abschl_kategorie' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); - - // beschreibung - $db->execute('ALTER TABLE `mvv_abschl_kategorie` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); - $db->execute("UPDATE `mvv_abschl_kategorie` - LEFT JOIN `i18n` ON (`mvv_abschl_kategorie`.`kategorie_id` = `i18n`.`object_id`) - SET `beschreibung_en` = `value` - WHERE `table` = 'mvv_abschl_kategorie' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_abschl_kategorie'"); - - - // mvv_dokument - // name - $db->execute('ALTER TABLE `mvv_dokument` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `mvv_dokument` - LEFT JOIN `i18n` ON (`mvv_dokument`.`dokument_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'mvv_dokument' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // linktext - $db->execute('ALTER TABLE `mvv_dokument` ADD `linktext_en` VARCHAR(255) NULL DEFAULT NULL AFTER `linktext`'); - $db->execute("UPDATE `mvv_dokument` - LEFT JOIN `i18n` ON (`mvv_dokument`.`dokument_id` = `i18n`.`object_id`) - SET `linktext_en` = `value` - WHERE `table` = 'mvv_dokument' AND `field` = 'linktext' AND `lang` = 'en_GB'"); - - // beschreibung - $db->execute('ALTER TABLE `mvv_dokument` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); - $db->execute("UPDATE `mvv_dokument` - LEFT JOIN `i18n` ON (`mvv_dokument`.`dokument_id` = `i18n`.`object_id`) - SET `beschreibung_en` = `value` - WHERE `table` = 'mvv_dokument' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_dokument'"); - - - // mvv_dokument_zuord - // kommentar - $db->execute('ALTER TABLE `mvv_dokument_zuord` ADD `kommentar_en` TEXT NULL DEFAULT NULL AFTER `kommentar`'); - $db->execute("UPDATE `mvv_dokument_zuord` - LEFT JOIN `i18n` ON (`mvv_dokument_zuord`.`dokument_zuord_id` = `i18n`.`object_id`) - SET `kommentar_en` = `value` - WHERE `table` = 'mvv_dokument_zuord' AND `field` = 'kommentar' AND `lang` = 'en_GB'"); - - $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP PRIMARY KEY, ADD PRIMARY KEY (`dokument_id`, `range_id`, `object_type`) USING BTREE"); - $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP `dokument_zuord_id`"); - - - // mvv_lvgruppe - // name - $db->execute('ALTER TABLE `mvv_lvgruppe` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `mvv_lvgruppe` - LEFT JOIN `i18n` ON (`mvv_lvgruppe`.`lvgruppe_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'mvv_lvgruppe' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // alttext - $db->execute('ALTER TABLE `mvv_lvgruppe` ADD `alttext_en` TEXT NULL DEFAULT NULL AFTER `alttext`'); - $db->execute("UPDATE `mvv_lvgruppe` - LEFT JOIN `i18n` ON (`mvv_lvgruppe`.`lvgruppe_id` = `i18n`.`object_id`) - SET `alttext_en` = `value` - WHERE `table` = 'mvv_lvgruppe' AND `field` = 'alttext' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_lvgruppe'"); - - - // mvv_modulteil_deskriptor - $db->execute("ALTER TABLE `mvv_modulteil_deskriptor` ADD `sprache` VARCHAR(32) NULL DEFAULT NULL AFTER `modulteil_id`"); - - $languages = $db->fetchFirst("SELECT distinct `lang` FROM `i18n`"); - $stmt = $db->prepare("SELECT DISTINCT(`object_id`) FROM `i18n` WHERE `table` = 'mvv_modulteil_deskriptor' AND `lang` = ?"); - foreach ($languages as $language) { - $stmt->execute([$language]); - foreach ($stmt->fetchAll() as $deskriptor_id) { - $base_deskriptor = new ModulteilDeskriptor($deskriptor_id); - $i18n_deskriptor = new ModulteilDeskriptor(); - $i18n_deskriptor->modulteil_id = $base_deskriptor->modulteil_id; - $i18n_deskriptor->sprache = $language; - $i18n_entries = I18NString::fetchDataForRow($base_deskriptor->id, 'mvv_modulteil_deskriptor'); - foreach ($i18n_entries as $field => $data) { - $i18n_deskriptor->$field = $data['value']; - } - $i18n_deskriptor->store(); - } - } - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_modulteil_deskriptor'"); - - - // mvv_modul_deskriptor - $db->execute("ALTER TABLE `mvv_modul_deskriptor` ADD `sprache` VARCHAR(32) NULL DEFAULT NULL AFTER `modul_id`"); - - $stmt = $db->prepare("SELECT DISTINCT(`object_id`) FROM `i18n` WHERE `table` = 'mvv_modul_deskriptor' AND `lang` = ?"); - foreach ($languages as $language) { - $stmt->execute([$language]); - foreach ($stmt->fetchAll() as $deskriptor_id) { - $base_deskriptor = new ModulDeskriptor($deskriptor_id); - $i18n_deskriptor = new ModulDeskriptor(); - $i18n_deskriptor->modul_id = $base_deskriptor->modul_id; - $i18n_deskriptor->sprache = $language; - $i18n_entries = I18NString::fetchDataForRow($base_deskriptor->id, 'mvv_modul_deskriptor'); - foreach ($i18n_entries as $field => $data) { - $i18n_deskriptor->$field = $data['value']; - } - $i18n_deskriptor->store(); - } - } - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_modul_deskriptor'"); - - - // mvv_stgteil - // zusatz - $db->execute('ALTER TABLE `mvv_stgteil` ADD `zusatz_en` TEXT NULL DEFAULT NULL AFTER `zusatz`'); - $db->execute("UPDATE `mvv_stgteil` - LEFT JOIN `i18n` ON (`mvv_stgteil`.`stgteil_id` = `i18n`.`object_id`) - SET `zusatz_en` = `value` - WHERE `table` = 'mvv_stgteil' AND `field` = 'zusatz' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteil'"); - - - // mvv_stgteilabschnitt - // name - $db->execute('ALTER TABLE `mvv_stgteilabschnitt` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `mvv_stgteilabschnitt` - LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt`.`abschnitt_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'mvv_stgteilabschnitt' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // kommentar - $db->execute('ALTER TABLE `mvv_stgteilabschnitt` ADD `kommentar_en` TEXT NULL DEFAULT NULL AFTER `kommentar`'); - $db->execute("UPDATE `mvv_stgteilabschnitt` - LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt`.`abschnitt_id` = `i18n`.`object_id`) - SET `kommentar_en` = `value` - WHERE `table` = 'mvv_stgteilabschnitt' AND `field` = 'kommentar' AND `lang` = 'en_GB'"); - - // ueberschrift - $db->execute('ALTER TABLE `mvv_stgteilabschnitt` ADD `ueberschrift_en` TEXT NULL DEFAULT NULL AFTER `ueberschrift`'); - $db->execute("UPDATE `mvv_stgteilabschnitt` - LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt`.`abschnitt_id` = `i18n`.`object_id`) - SET `ueberschrift_en` = `value` - WHERE `table` = 'mvv_stgteilabschnitt' AND `field` = 'ueberschrift' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteilabschnitt'"); - - - // mvv_stgteilabschnitt_modul - // bezeichnung - $db->execute('ALTER TABLE `mvv_stgteilabschnitt_modul` ADD `bezeichnung_en` TEXT NULL DEFAULT NULL AFTER `bezeichnung`'); - $db->execute("UPDATE `mvv_stgteilabschnitt_modul` - LEFT JOIN `i18n` ON (`mvv_stgteilabschnitt_modul`.`abschnitt_modul_id` = `i18n`.`object_id`) - SET `bezeichnung_en` = `value` - WHERE `table` = 'mvv_stgteilabschnitt_modul' AND `field` = 'bezeichnung' AND `lang` = 'en_GB'"); - - $db->execute("ALTER TABLE `mvv_stgteilabschnitt_modul` DROP PRIMARY KEY, ADD PRIMARY KEY (`abschnitt_id`, `modul_id`) USING BTREE"); - $db->execute("ALTER TABLE `mvv_dokument_zuord` DROP `abschnitt_modul_id`"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteilabschnitt_modul'"); - - - // mvv_stgteilversion - // beschreibung - $db->execute('ALTER TABLE `mvv_stgteilversion` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); - $db->execute("UPDATE `mvv_stgtteilversion` - LEFT JOIN `i18n` ON (`mvv_stgteilversion`.`version_id` = `i18n`.`object_id`) - SET `beschreibung_en` = `value` - WHERE `table` = 'mvv_stgteilversion' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteilversion'"); - - - // mvv_stgteil_bez - // name - $db->execute('ALTER TABLE `mvv_stgteil_bez` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `mvv_stgtteil_bez` - LEFT JOIN `i18n` ON (`mvv_stgteil_bez`.`stgteil_bez_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'mvv_stgteil_bez' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // name_kurz - $db->execute('ALTER TABLE `mvv_stgteil_bez` ADD `name_kurz_en` TEXT NULL DEFAULT NULL AFTER `name_kurz`'); - $db->execute("UPDATE `mvv_stgtteil_bez` - LEFT JOIN `i18n` ON (`mvv_stgteil_bez`.`stgteil_bez_id` = `i18n`.`object_id`) - SET `name_kurz_en` = `value` - WHERE `table` = 'mvv_stgteil_bez' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_stgteil_bez'"); - - - // mvv_studiengang - // name - $db->execute('ALTER TABLE `mvv_studiengang` ADD `name_en` TEXT NULL DEFAULT NULL AFTER `name`'); - $db->execute("UPDATE `mvv_studiengang` - LEFT JOIN `i18n` ON (`mvv_studiengang`.`studiengang_id` = `i18n`.`object_id`) - SET `name_en` = `value` - WHERE `table` = 'mvv_studiengang' AND `field` = 'name' AND `lang` = 'en_GB'"); - - // name_kurz - $db->execute('ALTER TABLE `mvv_studiengang` ADD `name_kurz_en` TEXT NULL DEFAULT NULL AFTER `name_kurz`'); - $db->execute("UPDATE `mvv_studiengang` - LEFT JOIN `i18n` ON (`mvv_studiengang`.`studiengang_id` = `i18n`.`object_id`) - SET `name_kurz_en` = `value` - WHERE `table` = 'mvv_studiengang' AND `field` = 'name_kurz' AND `lang` = 'en_GB'"); - - // beschreibung - $db->execute('ALTER TABLE `mvv_studiengang` ADD `beschreibung_en` TEXT NULL DEFAULT NULL AFTER `beschreibung`'); - $db->execute("UPDATE `mvv_studiengang` - LEFT JOIN `i18n` ON (`mvv_studiengang`.`studiengang_id` = `i18n`.`object_id`) - SET `beschreibung_en` = `value` - WHERE `table` = 'mvv_studiengang' AND `field` = 'beschreibung' AND `lang` = 'en_GB'"); - - $db->execute("DELETE FROM `i18n` WHERE `table` = 'mvv_studiengang'"); - - - // datafields - $db->exec("ALTER TABLE datafields - CHANGE type type ENUM('bool','textline','textarea','selectbox', - 'date','time','email','phone','radio','combo','link','selectboxmultiple') - NOT NULL DEFAULT 'textline'"); - $db->execute('ALTER TABLE `datafields_entries` ' - . 'DROP PRIMARY KEY, ADD PRIMARY KEY (`datafield_id`, `range_id`, `sec_range_id`) USING BTREE'); - $db->exec('ALTER TABLE `datafields_entries` DROP `lang`'); - } - -} diff --git a/db/migrations/233_step_00316_mvvkernintegration.php b/db/migrations/233_step_00316_mvvkernintegration.php deleted file mode 100644 index 8db1111..0000000 --- a/db/migrations/233_step_00316_mvvkernintegration.php +++ /dev/null @@ -1,36 +0,0 @@ -exec("UPDATE `log_actions` SET `class` = 'MVV', `type` = 'core' WHERE `class` LIKE 'MVVPlugin' AND `type` = 'plugin'"); - - // remove dependencies on old core plugin - $db->execute("DELETE FROM `plugin_assets` " - . "WHERE `plugin_id` IN (" - . " SELECT `pluginid` " - . " FROM `plugins` " - . " WHERE `pluginpath` = 'core/Modulverwaltung')"); - - $db->execute("DELETE FROM `roles_plugins` " - . "WHERE `pluginid` IN (" - . " SELECT `pluginid` " - . " FROM `plugins` " - . " WHERE `pluginpath` = 'core/Modulverwaltung')"); - - $db->execute("DELETE FROM `plugins` " - . "WHERE `pluginpath` = 'core/Modulverwaltung'"); - } - - public function down() { - } - -} diff --git a/db/migrations/234_add_mkdate_to_statusgruppe_user.php b/db/migrations/234_add_mkdate_to_statusgruppe_user.php deleted file mode 100644 index 92d73cc..0000000 --- a/db/migrations/234_add_mkdate_to_statusgruppe_user.php +++ /dev/null @@ -1,17 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `statusgruppe_user` - DROP COLUMN `mkdate`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/235_tic8335_paper_related_topics.php b/db/migrations/235_tic8335_paper_related_topics.php deleted file mode 100644 index 086f6d3..0000000 --- a/db/migrations/235_tic8335_paper_related_topics.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license GPL2 or any later version - * @since Stud.IP 4.2 - */ -class Tic8335PaperRelatedTopics extends Migration -{ - public function up() - { - if ($this->hasColumn()) { - return; - } - - $query = "ALTER TABLE `themen` - ADD COLUMN `paper_related` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `priority`"; - DBManager::get()->exec($query); - } - - public function down() - { - if (!$this->hasColumn()) { - return; - } - - $query = "ALTER TABLE `themen` DROP COLUMN `paper_related`"; - DBManager::get()->exec($query); - } - - private function hasColumn() - { - $query = "SHOW COLUMNS FROM `themen`"; - $columns = DBManager::get()->fetchFirst($query); - - return in_array('paper_related', $columns); - } -} diff --git a/db/migrations/236_config_public_topics.php b/db/migrations/236_config_public_topics.php deleted file mode 100644 index fdfd94c..0000000 --- a/db/migrations/236_config_public_topics.php +++ /dev/null @@ -1,44 +0,0 @@ -prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'COURSE_PUBLIC_TOPICS', - 'description' => 'Über diese Option können Sie die Themen einer Veranstaltung öffentlich einsehbar machen.', - 'range' => 'course', - 'type' => 'boolean', - 'value' => '0' - ]); - - $db->exec("INSERT INTO config_values (field, range_id, value, mkdate, chdate, comment) - SELECT 'COURSE_PUBLIC_TOPICS', Seminar_id, public_topics, mkdate, chdate, '' - FROM seminare WHERE public_topics = 1"); - - $db->exec('ALTER TABLE seminare DROP public_topics'); - } - - public function down() - { - $db = DBManager::get(); - - // migrate setting to seminare.public_topics - $db->exec('ALTER TABLE seminare ADD public_topics tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER completion'); - - $db->exec("UPDATE config_values JOIN seminare ON range_id = Seminar_id - SET public_topics = value WHERE field = 'COURSE_PUBLIC_TOPICS'"); - - $db->exec("DELETE config, config_values FROM config LEFT JOIN config_values USING(field) - WHERE field = 'COURSE_PUBLIC_TOPICS'"); - } -} diff --git a/db/migrations/237_config_mail_subject.php b/db/migrations/237_config_mail_subject.php deleted file mode 100644 index e02af5a..0000000 --- a/db/migrations/237_config_mail_subject.php +++ /dev/null @@ -1,39 +0,0 @@ -prepare('INSERT INTO config (field, value, type, section, mkdate, chdate, description) - VALUES (:name, :value, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'MAIL_USE_SUBJECT_PREFIX', - 'description' => 'Stellt dem Titel von per Mail versandten Nachrichten den Wert von UNI_NAME_CLEAN voran.', - 'section' => 'global', - 'type' => 'boolean', - 'value' => '1' - ]); - $stmt->execute([ - 'name' => 'NOTIFY_ON_WAITLIST_ADVANCE', - 'description' => 'Versendet Nachrichten an Teilnehmer bei jeder Änderung der Position auf der Warteliste', - 'section' => 'global', - 'type' => 'boolean', - 'value' => '1' - ]); - } - - public function down() - { - $db = DBManager::get(); - - $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?'); - $stmt->execute(['MAIL_USE_SUBJECT_PREFIX']); - $stmt->execute(['NOTIFY_ON_WAITLIST_ADVANCE']); - } -} diff --git a/db/migrations/238_db_updates_for_42.php b/db/migrations/238_db_updates_for_42.php deleted file mode 100644 index 45c86fc..0000000 --- a/db/migrations/238_db_updates_for_42.php +++ /dev/null @@ -1,76 +0,0 @@ -exec('ALTER TABLE sem_classes DROP compact_mode, DROP workgroup_mode, DROP turnus_default'); - - $db->exec('ALTER TABLE personal_notifications_user CHANGE user_id user_id char(32) COLLATE latin1_bin NOT NULL'); - - $db->exec("ALTER TABLE plugins_activated - ADD range_type enum('sem','inst','user') COLLATE latin1_bin NOT NULL default 'sem' AFTER pluginid, - ADD range_id char(32) COLLATE latin1_bin NOT NULL AFTER range_type, - CHANGE state state tinyint(1) NOT NULL DEFAULT 1"); - - $db->exec("UPDATE plugins_activated SET range_type = 'sem', range_id = SUBSTRING(poiid, 4) WHERE poiid LIKE 'sem%'"); - $db->exec("UPDATE plugins_activated SET range_type = 'inst', range_id = SUBSTRING(poiid, 5) WHERE poiid LIKE 'inst%'"); - $db->exec("UPDATE plugins_activated SET range_type = 'user', range_id = SUBSTRING(poiid, 5) WHERE poiid LIKE 'user%'"); - $db->exec('UPDATE plugins_activated SET state = 0 WHERE state = 2'); - - // delete invalid entries - $db->exec("DELETE FROM plugins_activated WHERE range_id = ''"); - - $db->exec('ALTER TABLE plugins_activated - DROP PRIMARY KEY, DROP KEY poiid, - ADD PRIMARY KEY (pluginid, range_type, range_id), - DROP poiid'); - //alter default for studygroups, see #9002 - $db->exec("UPDATE `sem_classes` SET `course_creation_forbidden` = 0 WHERE `studygroup_mode` = 1"); - - $db->exec("DELETE FROM `config` WHERE `field` IN ( - 'ALLOW_METADATE_SORTING', - 'ALLOW_DOWNLOAD_FOR_UNKNOWN_LICENSE', - 'ADMISSION_ALLOW_DISABLE_WAITLIST', - 'ASSI_SEMESTER_PRESELECT', - 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION' - )"); - $db->exec("DELETE FROM `config_values` WHERE `field` IN ( - 'ALLOW_METADATE_SORTING', - 'ALLOW_DOWNLOAD_FOR_UNKNOWN_LICENSE', - 'ADMISSION_ALLOW_DISABLE_WAITLIST', - 'ASSI_SEMESTER_PRESELECT', - 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION' - )"); - $db->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); //see #9106 - - } - - public function down() - { - $db = DBManager::get(); - - $db->exec('ALTER TABLE sem_classes - ADD compact_mode tinyint(4) NOT NULL AFTER name, - ADD workgroup_mode tinyint(4) NOT NULL AFTER compact_mode, - ADD turnus_default int(11) NOT NULL AFTER only_inst_user'); - - $db->exec("ALTER TABLE plugins_activated ADD poiid varchar(36) COLLATE latin1_bin NOT NULL DEFAULT '' AFTER pluginid"); - - $db->exec('UPDATE plugins_activated SET poiid = CONCAT(range_type, range_id)'); - $db->exec('UPDATE plugins_activated SET state = 2 WHERE state = 0'); - - $db->exec("ALTER TABLE plugins_activated - CHANGE state state enum('on','off') COLLATE latin1_bin NOT NULL DEFAULT 'on', - DROP PRIMARY KEY, - ADD PRIMARY KEY (pluginid, poiid), - ADD UNIQUE KEY poiid (poiid, pluginid, state), - DROP range_type, DROP range_id"); - } -} diff --git a/db/migrations/239_step_00327.php b/db/migrations/239_step_00327.php deleted file mode 100644 index 00db6bf..0000000 --- a/db/migrations/239_step_00327.php +++ /dev/null @@ -1,139 +0,0 @@ -exec("UPDATE `config` SET `field` = 'PRIVACY_PERM', `section` = 'privacy' WHERE `field` = 'DATENSCHUTZ_PERM'"); - if (!$r) { - DBManager::Get()->exec("INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('PRIVACY_PERM', 'root', 'string', 'global', 'privacy', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Rechtestufe zum Datenzugriff')"); - } else { - // plugin now obsolete - DBManager::Get()->exec("UPDATE `plugins` SET `enabled` = 'no' WHERE `plugins`.`pluginclassname` LIKE 'DatenschutzPlugin';"); - } - - $r = DBManager::Get()->exec("UPDATE `config` SET `field` = 'PRIVACY_CONTACT', `section` = 'privacy' WHERE `config`.`field` = 'DATENSCHUTZ_CONTACT'"); - if (!$r) { - DBManager::Get()->exec("INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('PRIVACY_CONTACT', 'root@studip', 'string', 'global', 'privacy', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Username der Kontaktperson zum Datenschutz')"); - } - - // Datenschutzerklärung - $r = DBManager::Get()->exec("UPDATE `config` SET `field` = 'PRIVACY_URL', `section` = 'privacy' WHERE `config`.`field` = 'DATENSCHUTZ_URL';"); - DBManager::Get()->exec("UPDATE `config_values` SET `field` = 'PRIVACY_URL' WHERE `config_values`.`field` = 'DATENSCHUTZ_URL';"); - - if (!$r) { - DBManager::Get()->exec("INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('PRIVACY_URL', '', 'string', 'global', 'privacy', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'URL zur Datenschutzerklärung')"); - - DBManager::Get()->exec("INSERT INTO `siteinfo_details` (`detail_id`, `rubric_id`, `position`, `name`, `content`) VALUES (NULL, '1', NULL, 'Datenschutzerklärung', - '++**Datenschutzerklärung**++ - -Sie erhalten als Nutzer/-in unserer Internetseite in dieser Datenschutzerklärung notwendige Informationen darüber, wie und in welchem Umfang sowie zu welchem Zweck die **[Betreibereinrichtung]** Daten von Ihnen erhebt und wie diese verwendet werden. Die Daten werden nur innerhalb der **[Betreibereinrichtung]** verarbeitet und verwendet und nicht an Dritte weitergegeben. - - -++**Rechtsgrundlagen**++ - -Die Erhebung und Nutzung Ihrer Daten erfolgt streng nach den gesetzlichen Vorgaben. Regelungen dazu finden sich in: -Europäische Datenschutzgrundverordnung (EU DSGVO) -Bundesdatenschutzgesetz (BDSG) -Niedersächsisches Datenschutzgesetz (NDSG) -Teledienstegesetz (TDG) -Mediendienste-Staatsvertrag (MDStV) -Teledienstedatenschutzgesetz (TDDSG). - - -++**Personenbezogene Daten**++ - -Personenbezogene Daten werden zum Zwecke der administrativen Nutzerverwaltung, zur Kontaktaufnahme und Interaktion mit Ihnen sowie zur Bereitstellung personalisierter Dienste [zur Durchführung Ihres Studium bzw. Ihrer Arbeit an **[Betreibereinrichtung]**] von uns gespeichert. -Für die Nutzung von Stud.IP werden folgende Daten abgefragt und gespeichert: -- Nutzername -- Vorname, Nachname -- Mailadresse -- [ggf. weitere Daten] - - -Weitere Daten, die evtl. Ihnen gespeichert werden, sind Inhalte, die Sie selbst im Rahmen Ihrer Arbeit oder Ihres Studiums in Stud.IP einstellen. Dazu gehören: -- Freiwillige Angaben zur Person -- Beiträge in Foren -- hochgeladene Dateien -- Chatverläufe in Blubber -- interne Nachrichten -- Kalendereinträge und Stundenpläne -- Teilnahme an Lehrveranstaltungen, Studiengruppen, Orgagremien -- Persönliche Einstellungen und Konfigurationen -- [ggf. Plugindaten] - - -Diese Inhalte werden mit Ihrem Klarnamen gespeichert und angezeigt. Sie haben die Möglichkeit über die Privatsphäreeinstellungen selbst zu bestimmen, ob und ggf. welche Personengruppen diese Daten sehen dürfen. Diese Daten werden von Stud.IP intern verschlüsselt abgelegt. - - -++**Aufbewahrungsfristen **++ - -Ihre personenbezogenen Daten werden für die Dauer Ihres Studiums/Ihrer Arbeit bei [Beitreibereinrichtung] gespeichert. Nach Beendigung ihrer Tätigkeit und Ablauf der gesetzlichen Aufbewahrungsfristen werden Ihre Daten gelöscht. - - -++**Auskunft, Löschung, Sperrung**++ - -Sie erhalten jederzeit auf Anfrage Auskunft über die von uns über Sie gespeicherten personenbezogenen Daten sowie dem Zweck von Datenerhebung sowie Datenverarbeitung. Bitte wenden Sie sich hierzu an o.g. Kontaktadresse. - -Außerdem haben Sie das Recht, die Berichtigung, die Sperrung oder Löschung Ihrer Daten zu verlangen. Sie können Ihre Einwilligung ohne Angabe von Gründen durch Schreiben an die o.g. Kontakadresse widerrufen. Ihre Daten werden dann umgehend gelöscht. Eine weitere Nutzung der Lernplattform Stud.IP ist dann aber nicht mehr möglich. - -Ausgenommen von der Löschung sind Daten, die aufgrund gesetzlicher Vorschriften aufbewahrt oder zur ordnungsgemäßen Geschäftsabwicklung benötigt werden. Damit eine Datensperre jederzeit realisiert werden kann, werden Daten zu Kontrollzwecken in einer Sperrdatei vorgehalten. - -Werden Daten nicht von einer gesetzlichen Archivierungspflicht erfasst, löschen wir Ihre Daten auf Ihren Wunsch. Greift die Archivierungspflicht, sperren wir Ihre Daten. Für alle Fragen und Anliegen zur Berichtigung, Sperrung oder Löschung von personenbezogenen Daten wenden Sie sich bitte an unsere Datenschutzbeauftragten unter den Kontaktdaten in dieser Datenschutzerklärung bzw. an die im Impressum genannte Adresse. - - -++**Datenübertragbarkeit**++ - -Sie haben das Recht, jederzeit Ihre Daten ausgehändigt zu bekommen. Auf Anfrage stellen wir Ihnen Ihre Daten in menschenlesbaren, gängigen und bearbeitbaren Formaten zur Verfügung. - - -++**Cookies**++ - -Stud.IP verwendet ein Session-Cookie. Diese kleine Textdatei beinhaltet lediglich eine verschlüsselte Zeichenfolge, die bei der Navigation im System hilft. Das Cookie wird bei der Abmeldung aus Stud.IP oder beim Schließen des Browsers gelöscht. - - -++**Server Logfiles**++ - -Mit dem Zugriff auf Stud.IP werden IP-Adresse, Datum, Uhrzeit und Browserversion zum Zeitpunkt des Zugriffs registriert und anonymisiert gespeichert. Die Erhebung und Nutzung dieser Log-File-Daten dient lediglich der Auswertung zu rein statistischen Forschungs- und Evaluationszwecken der Lernplattform, werden also nicht in Verbindung mit Namen oder Mailadresse gespeichert oder ausgewertet. Diese Daten werden für die Zeit von [X] Monaten auf gesicherten Systemen der **[Betreibereinrichtung]** gespeichert und ebenfalls nicht an Dritte weitergegeben. - - -++**SSL-Verschlüsselung**++ - -Die Verbindung zu Stud.IP erfolgt mit einer SSL-Verschlüsselung. Über SSL verschlüsselte Daten sind nicht von Dritten lesbar. Übermitteln Sie Ihre vertraulichen Informationen nur bei aktivierter SSL-Verschlüsselung und wenden Sie sich im Zweifel an uns. - - -++Kontaktdaten:++ -**Name:** -**Telefonnummer:** -**E-Mail-Adresse:** -**Unternehmensbezeichnung:** - -++Datenschutzbeauftragte/-r:++ -**Name:** -**Telefonnummer:** -**E-Mail-Adresse:** -**Unternehmensbezeichnung:** - - -')"); - - $query = "SELECT `rubric_id`, `detail_id` - FROM `siteinfo_details` - WHERE `name` = 'Datenschutzerklärung' - ORDER BY `detail_id` DESC"; - $result = DBManager::get()->fetchOne($query); - $datenschutzinfo_url = "dispatch.php/siteinfo/show/{$result['rubric_id']}/{$result['detail_id']}"; - DBManager::Get()->execute("INSERT INTO `config_values` (`field`, `range_id`, `value`, `mkdate`, `chdate`, `comment`) VALUES ('PRIVACY_URL', 'studip', ?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'URL zur Datenschutzerklärung')", [$datenschutzinfo_url]); - - } - - } - - public function down() - { - $query = "DELETE FROM `config` - WHERE `field` IN ('PRIVACY_PERM', 'PRIVACY_URL', 'PRIVACY_CONTACT')"; - DBManager::get()->exec($query); - } - -} diff --git a/db/migrations/23_enlarge_object_contentmodules_module_id.php b/db/migrations/23_enlarge_object_contentmodules_module_id.php deleted file mode 100644 index 5a44db1..0000000 --- a/db/migrations/23_enlarge_object_contentmodules_module_id.php +++ /dev/null @@ -1,18 +0,0 @@ -exec("ALTER TABLE `object_contentmodules` CHANGE `module_id` `module_id` VARCHAR( 255 ) NOT NULL DEFAULT ''"); - } - - function down() { - $db = DBManager::get(); - $db->exec("ALTER TABLE `object_contentmodules` CHANGE `module_id` `module_id` VARCHAR( 255 ) NULL DEFAULT NULL"); - } -} diff --git a/db/migrations/240_tic8538.php b/db/migrations/240_tic8538.php deleted file mode 100644 index f83d3e8..0000000 --- a/db/migrations/240_tic8538.php +++ /dev/null @@ -1,23 +0,0 @@ -exec("UPDATE `config` SET `field` = 'ALLOW_DOZENT_DELETE', `description` = 'Schaltet ein oder aus, ob ein Dozent eigene Veranstaltungen selbst löschen darf oder nicht' WHERE `config`.`field` = 'ALLOW_DOZENT_ARCHIV';"); - $db->exec("UPDATE `config_values` SET `field` = 'ALLOW_DOZENT_DELETE' WHERE `config_values`.`field` = 'ALLOW_DOZENT_ARCHIV' AND `config_values`.`range_id` = 'studip';"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("UPDATE `config` SET `field` = 'ALLOW_DOZENT_ARCHIV', `description` = 'Schaltet ein oder aus, ob ein Dozent eigene Veranstaltungen selbst archivieren darf oder nicht' WHERE `config`.`field` = 'ALLOW_DOZENT_DELETE';"); - $db->exec("UPDATE `config_values` SET `field` = 'ALLOW_DOZENT_ARCHIV' WHERE `config_values`.`field` = 'ALLOW_DOZENT_DELETE' AND `config_values`.`range_id` = 'studip';"); - } -} diff --git a/db/migrations/241_step_00320_config_search_navigation.php b/db/migrations/241_step_00320_config_search_navigation.php deleted file mode 100644 index fde26ce..0000000 --- a/db/migrations/241_step_00320_config_search_navigation.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - 'visible' => true, - 'target' => 'sidebar' - ], - 'semtree' => [ - 'visible' => true, - 'target' => 'sidebar' - ], - 'rangetree' => [ - 'visible' => true, - 'target' => 'sidebar' - ], - 'module' => [ - 'visible' => true, - 'target' => 'sidebar' - ] - ]; - - $stmt = DBManager::get()->prepare("INSERT INTO `config` - (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (:name, :value, :type, 'global', 'coursesearch', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc) - ON DUPLICATE KEY UPDATE `chdate`=VALUES(`chdate`)"); - - $stmt->execute([ - 'name' => 'COURSE_SEARCH_NAVIGATION_OPTIONS', - 'value' => json_encode($standard_navigation_options), - 'type' => 'array', - 'desc' => 'Aktivierung und Reihenfolge der Navigationsoptionen in der Veranstaltungssuche' - ]); - $stmt->execute([ - 'name' => 'COURSE_SEARCH_IS_VISIBLE_NOBODY', - 'value' => false, - 'type' => 'boolean', - 'desc' => 'Soll die Veranstaltungssuche auch für nobody (ohne Anmeldung) sichtbar sein?' - ]); - - } - - function down() - { - DBManager::get()->exec("DELETE FROM `config` WHERE `field` IN ( - 'COURSE_SEARCH_NAVIGATION_OPTIONS', - 'COURSE_SEARCH_IS_VISIBLE_NOBODY')" - ); - } - -} diff --git a/db/migrations/242_tic_8546_search_show_admission_state.php b/db/migrations/242_tic_8546_search_show_admission_state.php deleted file mode 100644 index 9d0ecdb..0000000 --- a/db/migrations/242_tic_8546_search_show_admission_state.php +++ /dev/null @@ -1,36 +0,0 @@ -prepare("INSERT INTO `config` - (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) - VALUES - (:name, :value, :type, 'global', 'coursesearch', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc) - ON DUPLICATE KEY UPDATE `chdate`=VALUES(`chdate`)"); - - $stmt->execute([ - 'name' => 'COURSE_SEARCH_SHOW_ADMISSION_STATE', - 'value' => false, - 'type' => 'boolean', - 'desc' => 'Anzeige des Zugangsstatus in der Veranstaltungssuche als Icon.' - ]); - - } - - function down() - { - DBManager::get()->exec("DELETE FROM `config` WHERE `field` = - 'COURSE_SEARCH_SHOW_ADMISSION_STATE'" - ); - } - -} diff --git a/db/migrations/243_tic8773_sort_news_by_chdate.php b/db/migrations/243_tic8773_sort_news_by_chdate.php deleted file mode 100644 index d9f95c2..0000000 --- a/db/migrations/243_tic8773_sort_news_by_chdate.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class Tic8773SortNewsByChdate extends Migration -{ - public function up() - { - $query = "INSERT INTO `config` ( - `field`, `value`, `type`, `range`, `section`, - `mkdate`, `chdate`, - `description` - ) VALUES ( - 'SORT_NEWS_BY_CHDATE', 'false', 'boolean', 'global', 'view', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), - 'Wenn diese Einstellung gesetzt ist werden Ankündigungen nach ihrem letzten Änderungsdatum statt ihrem Erstellungsdatum sortiert angezeigt.' - )"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "DELETE FROM config WHERE field = 'SORT_NEWS_BY_CHDATE'"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/244_config_default_seats.php b/db/migrations/244_config_default_seats.php deleted file mode 100644 index 8d71185..0000000 --- a/db/migrations/244_config_default_seats.php +++ /dev/null @@ -1,32 +0,0 @@ -prepare('INSERT INTO config (field, value, type, section, mkdate, chdate, description) - VALUES (:name, :value, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'RESOURCES_ROOM_REQUEST_DEFAULT_SEATS', - 'description' => 'Vorbelegung der Sitzplatzanzahl einer Raumanfrage, falls der Kurs keine max. Teilnehmerzahl hat', - 'section' => 'resources', - 'type' => 'integer', - 'value' => '0' - ]); - } - - public function down() - { - $db = DBManager::get(); - - $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?'); - $stmt->execute(['RESOURCES_ROOM_REQUEST_DEFAULT_SEATS']); - } -} diff --git a/db/migrations/245_tic7804_wiki_permissions.php b/db/migrations/245_tic7804_wiki_permissions.php deleted file mode 100644 index 2f3ce32..0000000 --- a/db/migrations/245_tic7804_wiki_permissions.php +++ /dev/null @@ -1,44 +0,0 @@ -prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'WIKI_COURSE_EDIT_RESTRICTED', - 'description' => 'Legt fest, dass nur Teilnehmende ab Rechtestufe "tutor" das Wiki bearbeiten dürfen.', - 'range' => 'course', - 'type' => 'boolean', - 'value' => '0' - ]); - - // table for wiki page permissions settings - $db->exec("CREATE TABLE wiki_page_config ( - range_id CHAR(32) COLLATE latin1_bin NOT NULL, - keyword VARCHAR(255) COLLATE utf8mb4_bin NOT NULL, - read_restricted TINYINT(1) NOT NULL DEFAULT 0, - edit_restricted TINYINT(1) NOT NULL DEFAULT 0, - PRIMARY KEY (range_id, keyword) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"); - } - - public function down() - { - $db = DBManager::get(); - - $db->exec('DROP TABLE wiki_page_config'); - - $db->exec("DELETE config, config_values - FROM config - LEFT JOIN config_values USING (field) - WHERE field = 'WIKI_COURSE_EDIT_RESTRICTED'"); - } -} diff --git a/db/migrations/246_consultations.php b/db/migrations/246_consultations.php deleted file mode 100644 index 1d9fa89..0000000 --- a/db/migrations/246_consultations.php +++ /dev/null @@ -1,315 +0,0 @@ -exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `consultation_slots` ( - `slot_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `block_id` INT(11) UNSIGNED NOT NULL, - `start_time` INT(11) UNSIGNED NOT NULL, - `end_time` INT(11) UNSIGNED NOT NULL, - `note` TEXT NOT NULL, - `teacher_event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`slot_id`), - KEY `block_id` (`block_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - - $query = "CREATE TABLE IF NOT EXISTS `consultation_bookings` ( - `booking_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `slot_id` INT(11) UNSIGNED NOT NULL, - `user_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `reason` TEXT NOT NULL, - `student_event_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL, - `mkdate` INT(11) UNSIGNED NOT NULL, - `chdate` INT(11) UNSIGNED NOT NULL, - PRIMARY KEY (`booking_id`), - KEY `block_id` (`slot_id`), - KEY `user_id` (`user_id`) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - DBManager::get()->exec($query); - - // Add config entries (global and user) - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'CONSULTATION_ENABLED', '0', 'boolean', 'global', - 'Sprechstunden', 'Schaltet die Sprechstunden global ein', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'CONSULTATION_REQUIRED_PERMISSION', 'dozent', 'string', 'global', - 'Sprechstunden', 'Ab welcher Rechtestufe dürfen Nutzer Sprechstunden anlegen (user, autor, tutor, dozent, admin, root)', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'CONSULTATION_ALLOW_DOCENTS_RESERVING', '0', 'boolean', 'global', - 'Sprechstunden', 'Dozenten können sich bei anderen Dozenten anmelden', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - - $query = "INSERT IGNORE INTO `config` ( - `field`, `value`, `type`, `range`, - `section`, `description`, - `mkdate`, `chdate` - ) VALUES ( - 'CONSULTATION_SEND_MESSAGES', '1', 'boolean', 'user', - 'Sprechstunden', 'Nachrichten empfangen über Buchungen/Stornierungen', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - DBManager::get()->exec($query); - - $this->migratePlugin(); - } - - public function down() - { - // Remove tables - $query = "DROP TABLE IF EXISTS `consultation_blocks`, - `consultation_slots`, - `consultation_bookings`"; - DBManager::get()->exec($query); - - // Remove config entries - $query = "DELETE `config`, `config_values` - FROM `config` - LEFT JOIN `config_values` USING (`field`) - WHERE `field` IN ( - 'CONSULTATION_ENABLED', - 'CONSULTATION_REQUIRED_PERMISSION' - )"; - DBManager::get()->exec($query); - } - - protected function migratePlugin() - { - // Detect plugin by tables - $query = "SHOW TABLES LIKE 'SprechstundenAnmeldung'"; - $statement = DBManager::get()->query($query); - - if ($statement->rowCount() === 0) { - // No plugin data - return; - } - - // Check database format - $query = "SHOW COLUMNS FROM `SprechstundenTerminDesc` - WHERE `Field` IN ('note_on_schedule', 'in_calendar')"; - $statement = DBManager::get()->query($query); - - if ($statement->rowCount() !== 2) { - $this->announce('Unable to migrate SprechstundenPlugin data due to incompatible database format'); - return false; - } - - - // Detect which plugin version was used - $query = "SHOW COLUMNS FROM SprechstundenTerminDesc LIKE 'size'"; - $has_size = (bool) DBManager::get()->query($query)->fetchColumn(); - $size_col = $has_size ? '`size`' : 1; - - // Migrate blocks - $query = "INSERT INTO `consultation_blocks` ( - `block_id`, `teacher_id`, `start`, `end`, - `room`, `calendar_events`, `note`, `size`, - `mkdate`, `chdate` - ) VALUES ( - NULL, :teacher_id, :start, :end, - :room, :calendar, :note, :size, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - $insert = DBManager::get()->prepare($query); - - $blocks = []; - - $query = "SELECT `id`, `dozent_id`, - `ort`, `in_calendar`, `note_on_schedule`, {$size_col} AS `size`, - `am`, `intervall`, - FROM_UNIXTIME(`start_date`) AS start_date, - FROM_UNIXTIME(`end_date`) AS end_date - FROM `SprechstundenTerminDesc`"; - $statement = DBManager::get()->query($query); - $statement->setFetchMode(PDO::FETCH_ASSOC); - foreach ($statement as $row) { - extract($row); - - $start_date = strtotime($start_date); - $end_date = strtotime($end_date); - - $insert->bindValue(':teacher_id', $dozent_id); - $insert->bindValue(':room', $ort); - $insert->bindValue(':calendar', $in_calendar); - $insert->bindValue(':note', $note_on_schedule); - $insert->bindValue(':size', $size); - - $current = $start_date; - while (date('w', $current) != $am) { - $current = strtotime('+1 day', $current); - } - - $blocks[$id] = []; - while ($current <= $end_date) { - $start = $this->adjustTimestamp($current, $start_date); - $end = $this->adjustTimestamp($current, $end_date); - - $insert->bindValue(':start', $start); - $insert->bindValue(':end', $end); - $insert->execute(); - - $blocks[$id][] = [ - 'start' => $start, - 'end' => $end, - 'id' => DBManager::get()->lastInsertId(), - ]; - - $current = strtotime("+{$intervall} weeks", $current); - } - } - - // Migrate slots - $query = "INSERT INTO `consultation_slots` ( - `slot_id`, `block_id`, - `start_time`, - `end_time`, - `note`, `teacher_event_id`, - `mkdate`, `chdate` - ) VALUES ( - :slot_id, :block_id, :start, :end, :note, :teacher_event_id, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - )"; - $insert = DBManager::get()->prepare($query); - - $query = "SELECT szs.`id`, st.`desc_id`, - szs.`position`, std.`dauer`, - FROM_UNIXTIME(st.`start_time`) AS start_time, - FROM_UNIXTIME(st.`end_time`) AS end_time, - IFNULL(szs.`note_on_schedule`, '') AS `note`, - sa.`event_id_dozent` - FROM `SprechstundenTermin` AS st - JOIN `SprechstundenZeitSlot` AS szs ON szs.`termin_id` = st.`id` - JOIN `SprechstundenTerminDesc` AS std ON st.`desc_id` = std.`id` - LEFT JOIN `SprechstundenAnmeldung` AS sa ON sa.`zeitslot_id` = szs.`id` - GROUP BY szs.`id`"; - $statement = DBManager::get()->query($query); - $statement->setFetchMode(PDO::FETCH_ASSOC); - - - $used = []; - foreach ($statement as $row) { - extract($row); - - // get block id - if (!isset($blocks[$desc_id])) { - continue; - } - - $duration = $dauer * ($position - 1); - $start = strtotime("+{$duration} minutes", strtotime($start_time)); - $end = strtotime("+{$dauer} minutes", $start); - - $block_id = false; - foreach ($blocks[$desc_id] as $block) { - if ($start <= $block['end'] && $end >= $block['start']) { - $block_id = $block['id']; - break; - } - } - - if (!in_array($block_id, $used)) { - $used[] = $block_id; - } - - $insert->bindValue(':slot_id', $id); - $insert->bindValue(':block_id', $block_id); - $insert->bindValue(':start', $start); - $insert->bindValue(':end', $end); - $insert->bindValue(':note', $note); - $insert->bindValue(':teacher_event_id', $event_id_dozent); - $insert->execute(); - } - - // Remove empty blocks - $query = "DELETE FROM `consultation_blocks` - WHERE `block_id` NOT IN (?)"; - DBManager::get()->execute($query, [$used ?: '']); - - // Migrate bookings - $query = "INSERT INTO `consultation_bookings` ( - `booking_id`, `slot_id`, `user_id`, - `reason`, `student_event_id`, - `mkdate`, `chdate` - ) - SELECT `id`, `zeitslot_id`, `user_id`, - `grund`, `event_id_student`, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - FROM `SprechstundenAnmeldung`"; - DBManager::get()->exec($query); - - // Activate consultations if plugin was enabled - $query = "SELECT `enabled` = 'yes' - FROM `plugins` - WHERE `pluginclassname` = 'SprechstundenPlugin'"; - $enabled = (bool) DBManager::get()->query($query)->fetchColumn(); - - if (!$enabled) { - return; - } - - $query = "INSERT INTO `config_values` ( - `field`, `range_id`, `value`, - `mkdate`, `chdate`, `comment` - ) VALUES ( - 'CONSULTATION_ENABLED', 'studip', '1', - UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '' - )"; - DBManager::get()->exec($query); - - // Deactivate plugin - $query = "UPDATE `plugins` - SET `enabled` = 'no' - WHERE `pluginclassname` = 'SprechstundenPlugin'"; - DBManager::get()->exec($query); - } - - private function adjustTimestamp($current, $other) - { - $time = date('H:i', $other); - $current = strtotime("today {$time}", $current); - return $current; - } -} diff --git a/db/migrations/247_step_00330.php b/db/migrations/247_step_00330.php deleted file mode 100644 index e80d7f7..0000000 --- a/db/migrations/247_step_00330.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -class StEP00330 extends Migration -{ - - function description() - { - return 'Adds a visibility flag to lock semesters'; - } - - public function up() - { - $query = "ALTER TABLE `semester_data` - ADD `visible` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1' AFTER `vorles_ende`"; - DBManager::get()->exec($query); - } - - public function down() - { - DBManager::get()->exec("ALTER TABLE `semester_data` DROP `visible`"); - } -} diff --git a/db/migrations/248_step_00331_ilias_interface.php b/db/migrations/248_step_00331_ilias_interface.php deleted file mode 100644 index 7fb335e..0000000 --- a/db/migrations/248_step_00331_ilias_interface.php +++ /dev/null @@ -1,56 +0,0 @@ - _('ILIAS'), - 'edit_moduletitle' => false, - 'search_active' => true, - 'show_offline' => false, - 'cache' => true - ]; - $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_BASIC_SETTINGS', ?, 'array', 'global', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; - $db->execute($sql, [json_encode($ilias_interface_config)]); - $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_SETTINGS', '[]', 'array', 'global', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; - $db->exec($sql); - $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_ENABLE', '0', 'boolean', 'global', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; - $db->exec($sql); - $sql = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) VALUES ('ILIAS_INTERFACE_MODULETITLE', 'ILIAS', 'string', 'course', 'modules', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '')"; - $db->exec($sql); - $db->exec("ALTER TABLE `auth_extern` DROP PRIMARY KEY"); - $db->exec("ALTER TABLE `auth_extern` ADD PRIMARY KEY (`studip_user_id`, `external_user_system_type`, `external_user_type`)"); - - $db->exec("ALTER TABLE `auth_extern` ADD `external_user_token` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `external_user_password`"); - $db->exec("ALTER TABLE `auth_extern` ADD `external_user_token_valid_until` INT(11) NOT NULL DEFAULT '0' AFTER `external_user_token`"); - - $db->exec("ALTER TABLE `object_user_visits` CHANGE `type` `type` ENUM('vote','documents','forum','literature','schedule','scm','sem','wiki','news','eval','inst','elearning_interface','ilias_interface','participants') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'vote'"); - - // install as core plugin - $sql = "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) - VALUES ('IliasInterfaceModule', 'Ilias-Interface', 'StandardPlugin,SystemPlugin', 'yes', 1)"; - $db->exec($sql); - $sql = "INSERT INTO roles_plugins (roleid, pluginid) SELECT roleid, ? FROM roles WHERE `system` = 'y' AND roleid < 7"; - $db->execute($sql, [$db->lastInsertId()]); - - } - - function down() - { - $db = DBManager::get(); - $db->exec("ALTER TABLE `auth_extern` DROP PRIMARY KEY"); - $db->exec("ALTER TABLE `auth_extern` ADD PRIMARY KEY (`studip_user_id`, `external_user_system_type`)"); - $db->exec("ALTER TABLE `auth_extern` DROP `external_user_token`"); - $db->exec("ALTER TABLE `auth_extern` DROP `external_user_token_valid_until` "); - $db->exec("DELETE FROM `config` WHERE `field` LIKE 'ILIAS_INTERFACE%'"); - $db->exec("DELETE FROM `config_values` WHERE `field` LIKE 'ILIAS_INTERFACE%'"); - $db->exec("DELETE FROM `plugins` WHERE `pluginclassname` = 'IliasInterfaceModule'"); - } -} \ No newline at end of file diff --git a/db/migrations/249_lti_consumer.php b/db/migrations/249_lti_consumer.php deleted file mode 100644 index 2b17fad..0000000 --- a/db/migrations/249_lti_consumer.php +++ /dev/null @@ -1,113 +0,0 @@ -exec($sql); - - $sql = "CREATE TABLE lti_tool ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(255) NOT NULL DEFAULT '', - launch_url VARCHAR(255) NOT NULL DEFAULT '', - consumer_key VARCHAR(255) NOT NULL DEFAULT '', - consumer_secret VARCHAR(255) NOT NULL DEFAULT '', - custom_parameters TEXT NOT NULL, - allow_custom_url TINYINT(1) NOT NULL DEFAULT 0, - deep_linking TINYINT(1) NOT NULL DEFAULT 0, - send_lis_person TINYINT(1) NOT NULL DEFAULT 0, - mkdate INT(11) NOT NULL DEFAULT 0, - chdate INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (id) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - $db->exec($sql); - - $sql = "CREATE TABLE lti_grade ( - link_id INT(11) NOT NULL DEFAULT 0, - user_id CHAR(32) COLLATE latin1_bin NOT NULL, - score FLOAT NOT NULL DEFAULT 0, - mkdate INT(11) NOT NULL DEFAULT 0, - chdate INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (link_id, user_id) - ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; - $db->exec($sql); - - // install as core plugin - $sql = "INSERT INTO plugins (pluginclassname, pluginname, plugintype, enabled, navigationpos) - VALUES ('LtiToolModule', 'LTI-Tool', 'StandardPlugin,SystemPlugin,PrivacyPlugin', 'yes', 1)"; - $db->exec($sql); - - $sql = "INSERT INTO roles_plugins (roleid, pluginid) - SELECT roleid, ? FROM roles WHERE `system` = 'y'"; - $db->execute($sql, [$db->lastInsertId()]); - - // install config settings - $stmt = $db->prepare('INSERT INTO config (field, value, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'LTI_TOOL_TITLE', - 'description' => 'Voreinstellung für den Titel des Reiters "LTI-Tool" im Kurs.', - 'range' => 'course', - 'type' => 'string', - 'value' => 'LTI-Tool' - ]); - - // migrate data from alija plugin - $result = $db->query("SHOW TABLES LIKE 'alija_grade'"); - - if ($result->rowCount() > 0) { - $db->exec("INSERT INTO lti_data - SELECT id, position, course_id, title, description, tool_id, - launch_url, mkdate, chdate, options FROM alija_data"); - $db->exec('INSERT INTO lti_tool SELECT * FROM alija_tool'); - $db->exec('INSERT INTO lti_grade SELECT * FROM alija_grade'); - } - } - - public function down() - { - $db = DBManager::get(); - - $db->exec("DELETE config, config_values FROM config - LEFT JOIN config_values USING (field) - WHERE field = 'LTI_TOOL_TITLE'"); - - $db->exec("DELETE plugins, roles_plugins FROM plugins - LEFT JOIN roles_plugins USING (pluginid) - WHERE pluginclassname = 'LtiToolModule'"); - - $db->exec('DROP table lti_grade, lti_tool, lti_data'); - } -} diff --git a/db/migrations/24_another_index_for_ex_termine.php b/db/migrations/24_another_index_for_ex_termine.php deleted file mode 100644 index d97f102..0000000 --- a/db/migrations/24_another_index_for_ex_termine.php +++ /dev/null @@ -1,30 +0,0 @@ -getAttribute(PDO::ATTR_ERRMODE); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - - $db->exec("ALTER TABLE `ex_termine` ADD INDEX `autor_id` ( `autor_id` )"); - - $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); - } - - function down() { - $db = DBManager::get(); - - $mode = $db->getAttribute(PDO::ATTR_ERRMODE); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - - $db->exec("ALTER TABLE `ex_termine` DROP INDEX `autor_id`"); - - $mode = $db->setAttribute(PDO::ATTR_ERRMODE, $mode); - } -} diff --git a/db/migrations/250_disable_archive_search.php b/db/migrations/250_disable_archive_search.php deleted file mode 100644 index 8d4aed1..0000000 --- a/db/migrations/250_disable_archive_search.php +++ /dev/null @@ -1,34 +0,0 @@ -prepare('INSERT INTO config (field, value, section, type, `range`, mkdate, chdate, description) - VALUES (:name, :value, :section, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'); - $stmt->execute([ - 'name' => 'ENABLE_ARCHIVE_SEARCH', - 'section' => 'global', - 'description' => 'Soll es eine Suche in dem alten Archiv geben?', - 'range' => 'global', - 'type' => 'boolean', - 'value' => '0' - ]); - $db->exec("ALTER TABLE `session_data` CHANGE COLUMN `val` `val` mediumblob NOT NULL"); //see #9106 - - } - - public function down() - { - DBManager::get()->exec("DELETE config, config_values - FROM config - LEFT JOIN config_values USING (field) - WHERE field = 'ENABLE_ARCHIVE_SEARCH'"); - } -} diff --git a/db/migrations/251_log_event_autoincrement.php b/db/migrations/251_log_event_autoincrement.php deleted file mode 100644 index a067dac..0000000 --- a/db/migrations/251_log_event_autoincrement.php +++ /dev/null @@ -1,36 +0,0 @@ -execute($query); - - $query = "ALTER TABLE `log_events` - ADD COLUMN `event_id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST"; - DBManager::get()->execute($query); - - $query = "ALTER TABLE `log_events` - MODIFY COLUMN `mkdate` INT(11) UNSIGNED NOT NULL"; - DBManager::get()->execute($query); - } - - public function down() - { - $query = "ALTER TABLE `log_events` ADD COLUMN `new_id` VARCHAR(32) FIRST"; - DBManager::get()->execute($query); - - $query = "UPDATE `log_events` SET `new_id` = MD5(`event_id`)"; - DBManager::get()->execute($query); - - $query = "ALTER TABLE `log_events` - DROP COLUMN `event_id`, - CHANGE COLUMN `new_id` `event_id` VARCHAR(32) PRIMARY KEY"; - DBManager::get()->execute($query); - } -} diff --git a/db/migrations/252_js_assets.php b/db/migrations/252_js_assets.php deleted file mode 100644 index bb29cb6..0000000 --- a/db/migrations/252_js_assets.php +++ /dev/null @@ -1,26 +0,0 @@ -execute($query); - } - - public function down() - { - $query = "DELETE FROM `plugin_assets` - WHERE `type` = 'js'"; - DBManager::get()->execute($query); - - $query = "ALTER TABLE `plugin_assets` - MODIFY COLUMN `type` ENUM('css') CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL"; - DBManager::get()->execute($query); - } -} diff --git a/db/migrations/253_adjust_token_table.php b/db/migrations/253_adjust_token_table.php deleted file mode 100644 index 53b5374..0000000 --- a/db/migrations/253_adjust_token_table.php +++ /dev/null @@ -1,34 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `user_token` - DROP PRIMARY KEY, - ADD INDEX `index_token` (`token`), - ADD INDEX `index_user_id` (`user_id`), - MODIFY COLUMN `token` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL AFTER `user_id`, - MODIFY COLUMN `user_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - MODIFY COLUMN `expiration` INT(11) NOT NULL, - ADD PRIMARY KEY (`user_id`, `token`, `expiration`)"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/254_hash_opengraph_table.php b/db/migrations/254_hash_opengraph_table.php deleted file mode 100644 index 8862146..0000000 --- a/db/migrations/254_hash_opengraph_table.php +++ /dev/null @@ -1,26 +0,0 @@ -exec($query); - - $query = "UPDATE `opengraphdata` SET `hash` = MD5(`url`)"; - DBManager::get()->exec($query); - - $query = "ALTER TABLE `opengraphdata` - DROP INDEX `url`, - ADD UNIQUE KEY `hash` (`hash`)"; - DBManager::get()->exec($query); - } - - public function down() - { - $query = "ALTER TABLE `opengraphdata` - DROP COLUMN `hash`, - ADD UNIQUE INDEX `url` (`url`(512))"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/255_tic9368_datafield_for_institution.php b/db/migrations/255_tic9368_datafield_for_institution.php deleted file mode 100644 index ca54e75..0000000 --- a/db/migrations/255_tic9368_datafield_for_institution.php +++ /dev/null @@ -1,21 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `datafields` DROP COLUMN `institut_id`"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/256_tic9543_update_help_content.php b/db/migrations/256_tic9543_update_help_content.php deleted file mode 100644 index 8184c72..0000000 --- a/db/migrations/256_tic9543_update_help_content.php +++ /dev/null @@ -1,102 +0,0 @@ -exec("UPDATE `help_content` SET `content` = 'You can find university ressources like rooms, buildings etc. with the ressource search engine.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'e206a4257e31a0f32ac516cefb8e8331'"); - $db->exec("UPDATE `help_content` SET `content` = 'In the default substitution settings, lecturers can specify a default substitution that can manage and change all of the lecturer''s courses.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '85c000e33732c5596d198776cb884860'"); - $db->exec("UPDATE `help_content` SET `content` = 'The overview contains course-related short and detailed information, announcements, dates and surveys.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'd97eff1196f6aed8e94f7c5096ebd2a9'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can add further features to the course.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '852991dc733639dd2df05fb627abf3db'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here, individual content can be activated or deactivated. Active contents add new features to your profile or settings. These will usually appear as new tabs in the menu. If features are not required, they can be deactivated here. The corresponding menu items will then be hidden.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b5fabb1e5aed7ff8520314e9a86c5c87'"); - $db->exec("UPDATE `help_content` SET `content` = 'With the user search, users can be found as long as their privacy settings do not prevent this. The search can be limited to certain courses or institutions.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'ebcc460880b8a63af3f6e7eade97db78'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can find an overview of the dates that have been booked by students.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0ad754cc62d1e86e97c1a28dd68ac40c'"); - $db->exec("UPDATE `help_content` SET `content` = 'The forum is a text-based, time- and location-independent platform for the exchange of questions, opinions and experiences. Contributions can be subscribed to, exported, marked as favourites and edited. The navigation on the left allows you to select different views (e.g. New posts since last login).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '80286432bf17df20e5f11f86b421b0a7'"); - $db->exec("UPDATE `help_content` SET `content` = 'You can use the fields of study-feature to assign a course to a field of study. Editing can be locked if data is transferred from other systems (for example, LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'eec46c5d8ea5523d959a8c334455c2ef'"); - $db->exec("UPDATE `help_content` SET `content` = 'With access authorisation (enrolment procedure), access to a course can be regulated e.g. by means of passwords, time control and participant restrictions.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '4e14c94cda99e2ef6462f7fef06d9c91'"); - $db->exec("UPDATE `help_content` SET `content` = 'The start page opens after logging in and can be adjusted to your personal needs by using widgets.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b05b27450e363c38c6b4620b902b3496'"); - $db->exec("UPDATE `help_content` SET `content` = 'Detailed information about the course, e.g. the course number, assignments, lecturers, tutors, etc. is displayed. In the detail information, you can enter a course under Actions.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '357bbf06015b2738aae15837f581a07d'"); - $db->exec("UPDATE `help_content` SET `content` = 'In the notification settings you can select which changes within a course you want to be notified for.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '43df8e33145c25eb6d941e4e845ada24'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can add members to a study group and send messages to them.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b3bd33cb0babbb0cc51a4f429d15d438'"); - $db->exec("UPDATE `help_content` SET `content` = 'This page shows the institutions that the user is assigned to.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '438c4456f85afec29fd9f47c111136c1'"); - $db->exec("UPDATE `help_content` SET `content` = 'View of the institutions assigned to the Stud.IP user.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'd04ca1f9e867ee295a3025dac7ce9c7b'"); - $db->exec("UPDATE `help_content` SET `content` = 'This page offers the possibility to enter Stud.IP users in your own address book and to list all contacts already in the address book.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '27c4d9837cfb1a9a40c079e16daac902'"); - $db->exec("UPDATE `help_content` SET `content` = 'Individual user data e.g. email address, can be changed on this page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'fe23b56f4d691c0f5e2f872e37ce38b5'"); - $db->exec("UPDATE `help_content` SET `content` = 'The evaluation function can be used to create surveys with multiple-choice, and free text questions for courses, study groups, your own profile or institutions. Other people''s public templates can also be used. All future, current and completed evaluations are displayed.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '5475d65b07fdaf5f234bf6eed3d5e4a9'"); - $db->exec("UPDATE `help_content` SET `content` = 'The schedule shows dates, topics and rooms of the course. Individual dates can be edited, for example, topics can be added to dates.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8c3067596811d3c6857d253299e01f6f'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can edit reference lists and make them visible in a course (click on the \"eye\").', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'fa4bf491690645a5f12556f77e51233c'"); - $db->exec("UPDATE `help_content` SET `content` = 'Possibility of providing lecture recordings and podcasts for students of the course (by linking to the files on the media server).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7465a4aeedb6a320d3455cf9ad0bebd0'"); - $db->exec("UPDATE `help_content` SET `content` = 'The timetable consists of courses you have subscribed to, which can be shown and hidden as well as adjusted in display size and form.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '440e50f7fcc825368aa9026273d2cd0d'"); - $db->exec("UPDATE `help_content` SET `content` = 'On this page you can see which contacts are currently online. A message can be sent to these people. Clicking on a person''s name will take you to their profile.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '2f1602394a4e31c2e30706f0a0b3112f'"); - $db->exec("UPDATE `help_content` SET `content` = 'Date allocation can be used to create appointments for consultation hours, exams, etc. in which students can enter themselves.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '5ae72abc0822570bfe839e3ee24f0c81'"); - $db->exec("UPDATE `help_content` SET `content` = 'Archived courses to which the user is assigned appear here. Content can no longer be changed, but stored files can be downloaded as zip files.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0237ea35a203be81e44c979d82ef5ee6'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here the affiliation to user domains can be viewed, but not changed.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0e816d9428a3bc8a73fb0042fb2da540'"); - $db->exec("UPDATE `help_content` SET `content` = 'Titles, descriptions, lecturers, etc. can be changed in the basic data. Editing can be partially blocked if data is transferred from other systems (for example, LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '615c1887f0ee080043f133681ebf0def'"); - $db->exec("UPDATE `help_content` SET `content` = 'Under \"Study details\", additional study programmes and institutions can be added manually if they have not been transferred automatically from an external system (e.g. LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '970ebdf39ad5ca89083a52723c5c35f5'"); - $db->exec("UPDATE `help_content` SET `content` = 'With the institute search, institutions can be found via a free search field or the facility tree.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8a32ca4e602a68307d4ae6ae51fa667e'"); - $db->exec("UPDATE `help_content` SET `content` = 'On this page you can make sure before archiving that the right course(s) have been selected for archiving.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'a2a649de15c8d8473b11fccc731dc80f'"); - $db->exec("UPDATE `help_content` SET `content` = 'Select the desired system and then the learning module/test. Writing permissions determine who can edit the learning module in the future. In the sidebar you will find the option \"Update assignments\" in order to transfer changed contents e.g. in the ILIAS course to Stud.IP.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8b690f942bf0cc0322e5bea0f1b9abed'"); - $db->exec("UPDATE `help_content` SET `content` = 'Various display and notification options can be selected and changed in the general settings.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'c8e789a0efb73f00f00dacf565524c73'"); - $db->exec("UPDATE `help_content` SET `content` = 'With the image uploading feature, the image of a course can be changed, which can help students differentiate between courses on the My Courses page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'abfb5d03de288d02df436f9a8bb96d9d'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here, lecturers can create and display announcements for their courses, institutions, and profile page, with the ability to filter the display.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3318ee99a062079b463e902348ad520e'"); - $db->exec("UPDATE `help_content` SET `content` = 'The group calendar provides an overview of course dates and personalized additional dates for that course.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '38d1a86517eb6cc195b2e921270c3035'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can add and edit dates.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '76195b21d485823fd7ca2fd499131c12'"); - $db->exec("UPDATE `help_content` SET `content` = 'In DoIT!, lecturers have the ability to set different types of tasks, including file uploads, multiple-choice questions, and peer reviewing. The task processing can be limited in time and can be done in groups.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0838a96b5678e2fc26be0ee38ae67619'"); - $db->exec("UPDATE `help_content` SET `content` = 'Blubber is the Stud.IP real-time forum, a mixture of forum and chat. Others can be informed about a post by mentioning them by @username or @''firstname surname'' in the post. Texts can be formatted and supplemented with smileys.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b9586c280a0092f86f9392fe5b5ff2a0'"); - $db->exec("UPDATE `help_content` SET `content` = 'An overview of sent, internal system messages, which can be provided with self-selected keywords (\"tags\") in order to be able to find them more easily later.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'ceb21257092b11dcf6897d5bb3085642'"); - $db->exec("UPDATE `help_content` SET `content` = 'The time/room feature can be used to change the semester, date and room details of the course. Editing can be blocked if data is transferred from other systems (e.g. LSF/ UniVZ).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '85c709de75085bd56a739e4e8ac6fcad'"); - $db->exec("UPDATE `help_content` SET `content` = 'The reference page offers teachers the possibility to create reference lists or to import them from reference management programs. These lists can be copied into courses and made visible. Depending on the connection, the actual book inventory of the university can be searched.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '44edb997707d1458cbf8a3f8f316b908'"); - $db->exec("UPDATE `help_content` SET `content` = 'Configuration of the study diary for students and creation of a study diary for lecturers.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '2075fe42f56207fbd153a810188f1beb'"); - $db->exec("UPDATE `help_content` SET `content` = 'With the archive search you can search for courses that have already been archived.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7d40379f54250b550065e062d71e8fd8'"); - $db->exec("UPDATE `help_content` SET `content` = 'The courses page shows all subscribed courses (by default only those of the last two semesters), all subscribed study groups and all institutions to which you have been assigned. The display can be adjusted via colour codes, semester filters, etc.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '91d6f451c3ef8d8352a076773b0a19ee'"); - $db->exec("UPDATE `help_content` SET `content` = 'On this page you can sort contacts into self-defined groups.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '6b331f5cc2176daba82a0cc71aaa576f'"); - $db->exec("UPDATE `help_content` SET `content` = 'The score list sorts the Stud.IP users in descending order according to their score. The number of points increases with the activities in Stud.IP and thus represents the experience of the users with the system. By ticking the box on the left, the own value is made visible to other users in the ranking. By default, your own value is not visible to the public.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '90ffbd715843b02b3961907f81caf208'"); - $db->exec("UPDATE `help_content` SET `content` = 'You can use the administration features to change the properties of the course at a later date. Under Actions a simulation of the student''s view is possible.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0c055cc6ae418a96ff3afa9db13098df'"); - $db->exec("UPDATE `help_content` SET `content` = 'The profile page allows you to change your own user data including profile picture and categories. Similar to Facebook, comments can be left. The lecturer''s profile contains office hours and room details. In addition, the page offers the management of own files.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'e5bff29f7adee43202a2aa8f3f0a6ec7'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can create a new study group. Each Stud.IP user can create study groups and configure them according to their own needs.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'af7573cce1e898054db89a96284866f9'"); - $db->exec("UPDATE `help_content` SET `content` = 'The settings of the messaging system offer the possibility to forward the messages received in Stud.IP to your email address.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3b7a4c04017fef2984ee029610194f26'"); - $db->exec("UPDATE `help_content` SET `content` = 'The schedule settings offer the possibility to be adapted to your own needs.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '260ee12fdc7dccb30eca2cc075ef0096'"); - $db->exec("UPDATE `help_content` SET `content` = 'With the course search you can find courses, study groups etc. in different semesters and according to different search criteria (see \"Show advanced search\" in the sidebar). The current semester is preselected.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'a1e3da35edc9b605f670e9c7f5019888'"); - $db->exec("UPDATE `help_content` SET `content` = 'The study diary supports the autonomous studying process of the students and is managed independently by them. Inquiries to the lecturers regarding work steps are possible, certain data can be released individually.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1ea099717ceb1b401aedcedc89814d9c'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can edit reference lists and make them visible in the course (by clicking on the \"eye\").', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1cb8fd77427ebc092d751eea95454b0a'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here, contact groups or the entire address book can be exported in order to import them into an external program.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '57f1b29d3c1a558f5cc799c1aade7f14'"); - $db->exec("UPDATE `help_content` SET `content` = 'Blubber is a mixed version of forum and chat where participants'' posts are displayed in real time. Others can be informed about a post by mentioning them in the post by @username or @''first name last name''.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1804e526c2f6794b877a4b2096eaa67a'"); - $db->exec("UPDATE `help_content` SET `content` = 'The learning module interface makes it possible to provide study units or tests from external programs such as ILIAS and LON-CAPA in Stud.IP.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '0d83ce036f2870f873446230c0118bb7'"); - $db->exec("UPDATE `help_content` SET `content` = 'The list of participants shows a list of the participants of the course. Additional participants can be added, removed, downgraded, promoted or assigned to self-defined groups by lecturers.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3607d6daea679dcd7003e076fdd1660a'"); - $db->exec("UPDATE `help_content` SET `content` = 'In the privacy settings you can set the visibility and discoverability of your own profile.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'f5e59c4fc98e1df7fe29b8e9320853e7'"); - $db->exec("UPDATE `help_content` SET `content` = 'Before archiving you can check on this page that the right course(s) have been selected for archiving.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'a2a649de15c8d8473b11fccc731dc80f'"); - $db->exec("UPDATE `help_content` SET `content` = 'The attendance list shows all course appointments (meeting, lecture, exercise, internship) of the schedule and allows students to be entered by the lecturers in Stud.IP as well as exporting the list to an overview or as a basis for handwritten entries.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8c2fc90bd8175e6d598f895944a8ddc2'"); - $db->exec("UPDATE `help_content` SET `content` = 'Blubber is a mixture of forum and chat. Messages are displayed in the public stream. Other users can be informed about a post by mentioning them by @username or @''firstname surname'' in the post.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '51a0399250de6365619c961ec3669ad3'"); - $db->exec("UPDATE `help_content` SET `content` = 'File management offers the possibility to upload, link to, manage and download files.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'ee91ec0f9085221ada06d171a27d2405'"); - $db->exec("UPDATE `help_content` SET `content` = 'File management provides the ability to upload, manage, and download personal files that are not visible to others.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '51b98d659590e1e37dae5e5e5cc028bb'"); - $db->exec("UPDATE `help_content` SET `content` = 'The learning module interface makes it possible to provide study units from external programs such as ILIAS and LON-CAPA in Stud.IP. A separate user account is created or assigned for each external system. With the appropriate rights, own learning modules can be created.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'bfb70d5f036769d740fb2342b0b58183'"); - $db->exec("UPDATE `help_content` SET `content` = 'This page shows the study groups to which the user is assigned. Study groups are an easy way to collaborate with fellow students, colleagues and others. Each user can create study groups or search for them. The colour coding can be adjusted individually.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '02b4e3ce7b8fe6b3e6a3586d410a51a1'"); - $db->exec("UPDATE `help_content` SET `content` = 'The Wiki enables a common, asynchronous creation and editing of texts. Texts can be formatted and linked so that a branched reference guide is created.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7edc08f2f7b0786ca036f8c448441e07'"); - $db->exec("UPDATE `help_content` SET `content` = 'The message page provides an overview of received, internal system messages, which can be assigned self-selected keywords (\"tags\") to make them easier to find later.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'f966e348174927565b94e606bbcf064f'"); - $db->exec("UPDATE `help_content` SET `content` = 'This page allows the storing of free information, links etc.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'abaa7b076e6923ac43120f3326322af0'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here, appointments can be assigned topics or previously entered topics can be taken over and edited.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '1f216fe42d879c3fcbb582d67e9ad5a2'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can enter predefined information about yourself, that should appear on your profile page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '83fd70727605c485a0d8f2c5ef94289b'"); - $db->exec("UPDATE `help_content` SET `content` = 'A custom Blubber stream can be created here. It always consists of a collection of posts from selected courses, contact groups and keywords, which can be further restricted by filtering. The new user-defined stream can be found after clicking on the Save button in the navigation under Global Stream.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7cb7026818c4b90935009d0548300674'"); - $db->exec("UPDATE `help_content` SET `content` = 'By exporting, data about courses and co-workers can be exported into the following formats: RTF, TXT, CSV, PDF, HTML and XML.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '7bf322a6c5f13db67e047b7afae83e58'"); - $db->exec("UPDATE `help_content` SET `content` = 'The password of the Stud.IP account can be changed here.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b32cb2c4ec56e925b07a5cb0105a6888'"); - $db->exec("UPDATE `help_content` SET `content` = 'The self-defined groups are displayed here. Messages can be sent to these groups. A click on the orange arrows in front of the group name assigns you to the group.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'f529bca4d1626b43cbb8149feea41a84'"); - $db->exec("UPDATE `help_content` SET `content` = 'The appointment calendar consists of subscribed courses and your own appointments. It can be edited, changed in the display and compared with external programs (e.g. Outlook).', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'dddf5fd4406da0d91c9f121fcae607ad'"); - $db->exec("UPDATE `help_content` SET `content` = 'This page shows all study groups that exist in Stud.IP. Study groups are an easy way to collaborate with fellow students, colleagues and others. Each user can create study groups or search for them.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '960d7bafb618853eced1b1b42a7dd412'"); - $db->exec("UPDATE `help_content` SET `content` = 'Groups can be created and managed here. If the self-entry is activated, participants can register themselves and sign themselves out.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'bd5df4fb7b84da79149c96c5f43de46c'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can search for references in catalogues and add them to your list.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'b283b58820db358284f4451dfb691678'"); - $db->exec("UPDATE `help_content` SET `content` = 'On this page you can enter self-defined information about yourself, which should appear on the profile page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '8ad364363acd415631226d5574d5592a'"); - $db->exec("UPDATE `help_content` SET `content` = 'With the Surveys and Tests function, you can create (time-controlled) surveys or individual multiple/single-choice questions for courses, study groups or the profile.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '42060187921376807f90e52fad5f9822'"); - $db->exec("UPDATE `help_content` SET `content` = 'Here you can upload a profile picture.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '2a389c2472656121a76ca4f3b0e137d4'"); - $db->exec("UPDATE `help_content` SET `content` = 'RSS feeds, i.e. news streams from external websites, can be integrated on the start page. The more feeds you include, the longer it takes to load the start page.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = 'bcdedaf1b4bd3b96ef574e8230095b28'"); - $db->exec("UPDATE `help_content` SET `content` = 'The name, function and access restriction of the study group can be edited here.', `studip_version` = '4.4' WHERE `help_content`.`content_id` = '3d040e95a8c29e733a8d5439ee9f5b59'"); - } - - public function down() - { - } -} diff --git a/db/migrations/257_tic9544_add_external_id_semester.php b/db/migrations/257_tic9544_add_external_id_semester.php deleted file mode 100644 index e20d03a..0000000 --- a/db/migrations/257_tic9544_add_external_id_semester.php +++ /dev/null @@ -1,22 +0,0 @@ -exec($query); - } - - public function down() - { - $query = "ALTER TABLE `semester_data` DROP `external_id`"; - DBManager::get()->exec($query); - } -} \ No newline at end of file diff --git a/db/migrations/258_tic7443_create_lvgruppen_independently.php b/db/migrations/258_tic7443_create_lvgruppen_independently.php deleted file mode 100644 index 434a68b..0000000 --- a/db/migrations/258_tic7443_create_lvgruppen_independently.php +++ /dev/null @@ -1,34 +0,0 @@ - 'MVV_ALLOW_CREATE_LVGRUPPEN_INDEPENDENTLY', - 'range' => 'global', - 'type' => 'boolean', - 'description' => 'Soll das Anlegen von LV-Gruppen unabhängig von bestehenden Modulteilen auf der Verwaltungsseite für LV-Gruppen möglich sein?', - 'value' => 0 - ]; - - $stmt = DBManager::get()->prepare(" - REPLACE INTO config - (field, value, `type`, `range`, mkdate, chdate, description) - VALUES - (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - $stmt->execute($config_data); - } - - public function down() - { - DBManager::get()->exec("DELETE FROM config WHERE field = 'MVV_ALLOW_CREATE_LVGRUPPEN_INDEPENDENTLY'"); - DBManager::get()->exec("DELETE FROM config_values WHERE field = 'MVV_ALLOW_CREATE_LVGRUPPEN_INDEPENDENTLY'"); - } -} diff --git a/db/migrations/259_migrations_reloaded.php b/db/migrations/259_migrations_reloaded.php deleted file mode 100644 index b73de5c..0000000 --- a/db/migrations/259_migrations_reloaded.php +++ /dev/null @@ -1,35 +0,0 @@ -exec($sql); - } - - public function down() - { - $db = DBManager::get(); - - $sql = "DELETE FROM schema_version WHERE branch != '0'"; - $db->exec($sql); - - $sql = 'ALTER TABLE schema_version - DROP PRIMARY KEY, - ADD PRIMARY KEY (domain), - DROP branch'; - $db->exec($sql); - } -} diff --git a/db/migrations/25_step_00098_user_domains.php b/db/migrations/25_step_00098_user_domains.php deleted file mode 100644 index d02b9e0..0000000 --- a/db/migrations/25_step_00098_user_domains.php +++ /dev/null @@ -1,41 +0,0 @@ -exec("CREATE TABLE seminar_userdomains ( - seminar_id varchar(32) NOT NULL default '', - userdomain_id varchar(32) NOT NULL default '', - PRIMARY KEY (seminar_id, userdomain_id)) ENGINE=MyISAM"); - $db->exec("CREATE TABLE user_userdomains ( - user_id varchar(32) NOT NULL default '', - userdomain_id varchar(32) NOT NULL default '', - PRIMARY KEY (user_id, userdomain_id)) ENGINE=MyISAM"); - $db->exec("CREATE TABLE userdomains ( - userdomain_id varchar(32) NOT NULL default '', - name varchar(255) NOT NULL default '', - PRIMARY KEY (userdomain_id)) ENGINE=MyISAM"); - - $db->exec("ALTER TABLE auth_user_md5 CHANGE visible - visible enum('global','always','yes','unknown','no','never') - NOT NULL default 'unknown'"); - } - - function down () { - $db = DBManager::get(); - - $db->exec("DROP TABLE seminar_userdomains"); - $db->exec("DROP TABLE user_userdomains"); - $db->exec("DROP TABLE userdomains"); - - $db->exec("ALTER TABLE auth_user_md5 CHANGE visible - visible enum('always','yes','unknown','no','never') - NOT NULL default 'unknown'"); - } -} -?> diff --git a/db/migrations/26_step_00146_lock_rules2.php b/db/migrations/26_step_00146_lock_rules2.php deleted file mode 100644 index d44f4f7..0000000 --- a/db/migrations/26_step_00146_lock_rules2.php +++ /dev/null @@ -1,45 +0,0 @@ -exec("ALTER TABLE `lock_rules` ADD `permission` - ENUM( 'tutor', 'dozent', 'admin', 'root' ) - NOT NULL DEFAULT 'dozent' AFTER `lock_id` ;"); - $db->exec(" INSERT IGNORE INTO `config` - ( `config_id` , `parent_id` , `field` , `value` , - `is_default` , `type` , `range` , `section` , - `position` , `mkdate` , `chdate` , `description` , - `comment` , `message_template` ) - VALUES ( - MD5( 'RANGE_TREE_ADMIN_PERM' ) , '', 'RANGE_TREE_ADMIN_PERM', - 'admin', '1', 'string', 'global', '', '0', - UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , - 'mit welchem Status darf die Einrichtungshierarchie bearbeitet werden (admin oder root)', '', '' - ), ( - MD5( 'SEM_TREE_ADMIN_PERM' ) , '', 'SEM_TREE_ADMIN_PERM', - 'admin', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , - UNIX_TIMESTAMP( ) , 'mit welchem Status darf die Veranstaltungshierarchie bearbeitet werden (admin oder root)', '', '' - ), ( - MD5( 'SEMESTER_ADMINISTRATION_ENABLE' ) , '', 'SEMESTER_ADMINISTRATION_ENABLE', - '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , - UNIX_TIMESTAMP( ) , 'schaltet die Semesterverwaltung ein oder aus', '', '' - ) "); - - } - - function down () { - $db = DBManager::get(); - - $db->exec("ALTER TABLE `lock_rules` DROP `permission`"); - - $db->exec("DELETE FROM config WHERE field = 'RANGE_TREE_ADMIN_PERM'"); - $db->exec("DELETE FROM config WHERE field = 'SEM_TREE_ADMIN_PERM'"); - } -} -?> \ No newline at end of file diff --git a/db/migrations/27_step_147_mail_activationlink.php b/db/migrations/27_step_147_mail_activationlink.php deleted file mode 100644 index 0f514ed..0000000 --- a/db/migrations/27_step_147_mail_activationlink.php +++ /dev/null @@ -1,31 +0,0 @@ -exec("ALTER TABLE `auth_user_md5` ADD `validation_key` VARCHAR(10) NOT NULL AFTER `Email`"); - } - - public function down() - { - DBManager::get()->exec("ALTER TABLE `auth_user_md5` DROP `validation_key`"); - } -} diff --git a/db/migrations/28_delete_wiki_links.php b/db/migrations/28_delete_wiki_links.php deleted file mode 100644 index 9397264..0000000 --- a/db/migrations/28_delete_wiki_links.php +++ /dev/null @@ -1,29 +0,0 @@ -exec("DELETE FROM wiki_links - USING wiki_links - LEFT JOIN wiki ON ( wiki_links.range_id = wiki.range_id - AND wiki_links.from_keyword = wiki.keyword ) - WHERE wiki.keyword IS NULL"); - } -} diff --git a/db/migrations/29_step_00138_studienbereichszuordnung.php b/db/migrations/29_step_00138_studienbereichszuordnung.php deleted file mode 100644 index d6b4b1d..0000000 --- a/db/migrations/29_step_00138_studienbereichszuordnung.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - */ - -class Step00138Studienbereichszuordnung extends Migration -{ - public function description() { - return 'Adds the new Value SEM_TREE_ALLOW_BRANCH_ASSIGN to table config.'; - } - - public function up() - { - $this->announce("add new value SEM_TREE_ALLOW_BRANCH_ASSIGN to table config"); - - $db = DBManager::get(); - $db->exec("INSERT IGNORE INTO `config` ". - "VALUES ('34f348c06bbd5d9fc7bb36a8d829e12e', '', ". - "'SEM_TREE_ALLOW_BRANCH_ASSIGN', '1', 1, 'boolean', 'global', ". - "'', 0, 1222947575, 1222947575, ". - "'Diese Option beeinflusst die Möglichkeit, Veranstaltungen ". - "entweder nur an die Blätter oder überall in der ". - "Veranstaltungshierarchie einhängen zu dürfen.', '', '')"); - - $this->announce("done."); - } - - - public function down() - { - $this->announce("remove value SEM_TREE_ALLOW_BRANCH_ASSIGN from table config"); - - DBManager::get()->exec("DELETE FROM `config` WHERE `field` = 'SEM_TREE_ALLOW_BRANCH_ASSIGN'"); - - $this->announce("done."); - } -} diff --git a/db/migrations/30_auth_user_md5_perms.php b/db/migrations/30_auth_user_md5_perms.php deleted file mode 100644 index 96d8115..0000000 --- a/db/migrations/30_auth_user_md5_perms.php +++ /dev/null @@ -1,23 +0,0 @@ -exec("ALTER TABLE auth_user_md5 ADD KEY perms (perms)"); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE auth_user_md5 DROP KEY perms"); - } -} -?> diff --git a/db/migrations/31_high_priority_messages.php b/db/migrations/31_high_priority_messages.php deleted file mode 100644 index 1d1307f..0000000 --- a/db/migrations/31_high_priority_messages.php +++ /dev/null @@ -1,31 +0,0 @@ -exec("INSERT INTO `config` (". - "`config_id`,`parent_id`,`field`,`value`,`is_default`,`type`,`range`,`section`,". - " `position`,`mkdate`,`chdate`,`description`,`comment`,`message_template`)". - "VALUES (MD5( 'MESSAGE_PRIORITY' ) , '', 'MESSAGE_PRIORITY', '0', '1', 'boolean',". - " 'global', '', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'If enabled, messages of high priority are displayed reddish','', '')"); - $db->exec("ALTER TABLE `message` ADD `priority` ENUM( 'normal', 'high' ) NOT NULL DEFAULT 'normal'"); - $this->announce("done."); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE config_id = MD5('MESSAGE_PRIORITY')"); - $db->exec("ALTER TABLE `message` DROP `priority`"); - $this->announce("done."); - } -} -?> diff --git a/db/migrations/32_restricted_user_management.php b/db/migrations/32_restricted_user_management.php deleted file mode 100644 index c7a2ef6..0000000 --- a/db/migrations/32_restricted_user_management.php +++ /dev/null @@ -1,32 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', '0', 1, 'boolean', $time, $time, '$description') - "); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE field = 'RESTRICTED_USER_MANAGEMENT'"); - } -} -?> diff --git a/db/migrations/33_lock_rule_admin_perm.php b/db/migrations/33_lock_rule_admin_perm.php deleted file mode 100644 index 00525e9..0000000 --- a/db/migrations/33_lock_rule_admin_perm.php +++ /dev/null @@ -1,43 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', 'admin', 1, 'string', $time, $time, '$description') - "); - - $name = 'LOCK_RULE_ADMIN_PERM'; - $description = 'mit welchem Status dürfen Sperrebenen angepasst werden (admin, root)'; - - $db->exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', 'admin', 1, 'string', $time, $time, '$description') - "); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE field = 'AUX_RULE_ADMIN_PERM'"); - $db->exec("DELETE FROM config WHERE field = 'LOCK_RULE_ADMIN_PERM'"); - } -} -?> diff --git a/db/migrations/34_add_allow_selfassign_institute.php b/db/migrations/34_add_allow_selfassign_institute.php deleted file mode 100644 index d5a5b60..0000000 --- a/db/migrations/34_add_allow_selfassign_institute.php +++ /dev/null @@ -1,32 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', '1', 1, 'boolean', $time, $time, '$description') - "); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE field = 'ALLOW_SELFASSIGN_INSTITUTE'"); - } -} -?> diff --git a/db/migrations/35_add_additional_log_actions.php b/db/migrations/35_add_additional_log_actions.php deleted file mode 100644 index db83487..0000000 --- a/db/migrations/35_add_additional_log_actions.php +++ /dev/null @@ -1,127 +0,0 @@ -'CHANGE_BASIC_DATA', - 'description'=>'Basisdaten geändert', - 'info_template'=>'%user hat in Veranstaltung %sem(%affected) die Daten %info geändert.', - 'active'=>0], - [ - 'name'=>'CHANGE_INSTITUTE_DATA', - 'description'=>'Institutdaten geändert', - 'info_template'=>'%user hat in Veranstaltung %sem(%affected) die Daten %info geändert.', - 'active'=>0], - [ - 'name'=>'PLUGIN_ENABLE', - 'description'=>'Plugin einschalten', - 'info_template'=>'%user hat in Veranstaltung %sem(%affected) das Plugin %plugin(%coaffected) aktiviert.', - 'active'=>1], - [ - 'name'=>'PLUGIN_DISABLE', - 'description'=>'Plugin ausschalten', - 'info_template'=>'%user hat in Veranstaltung %sem(%affected) das Plugin %plugin(%coaffected) deaktiviert.', - 'active'=>1], - [ - 'name'=>'SEM_CHANGED_ACCESS', - 'description'=>'Zugangsberechtigungen geändert', - 'info_template'=>'%user ändert die Zugangsberechtigungen für %sem(%affected) auf %access(%info).', - 'active'=>0], - [ - 'name'=>'SEM_USER_ADD', - 'description'=>'In Veranstaltung eingetragen', - 'info_template'=>'%user hat %user(%coaffected) für %sem(%affected) mit dem status %info eingetragen. (%dbg_info)', - 'active'=>0], - [ - 'name'=>'SEM_USER_DEL', - 'description'=>'Aus Veranstaltung ausgetragen', - 'info_template'=>'%user hat %user(%coaffected) aus %sem(%affected) ausgetragen. (%info)', - 'active'=>0], - [ - 'name'=>'SEM_CHANGED_RIGHTS', - 'description'=>'Veranstaltungsrechte geändert', - 'info_template'=>'%user hat %user(%coaffected) in %sem(%affected) als %info eingetragen. (%dbg_info)', - 'active'=>0], - [ - 'name'=>'SEM_ADD_STUDYAREA', - 'description'=>'Studienbereich zu Veranst. hinzufügen', - 'info_template'=>'%user fügt Studienbereich \"%studyarea(%coaffected)\" zu %sem(%affected) hinzu.', - 'active'=>0], - [ - 'name'=>'SEM_DELETE_STUDYAREA', - 'description'=>'Studienbereich aus Veranst. löschen', - 'info_template'=>'%user entfernt Studienbereich \"%studyarea(%coaffected)\" aus %sem(%affected).', - 'active'=>0], - [ - 'name'=>'RES_ASSIGN_SEM', - 'description'=>'Buchen einer Ressource (VA)', - 'info_template'=>'%user bucht %res(%affected) für %sem(%coaffected) (%info).', - 'active'=>0], - [ - 'name'=>'RES_ASSIGN_SINGLE', - 'description'=>'Buchen einer Ressource (Einzel)', - 'info_template'=>'%user bucht %res(%affected) direkt (%info).', - 'active'=>0], - [ - 'name'=>'RES_REQUEST_NEW', - 'description'=>'Neue Raumanfrage', - 'info_template'=>'%user stellt neue Raumanfrage für %sem(%affected), gewünschter Raum: %res(%coaffected), %info', - 'active'=>0], - [ - 'name'=>'RES_REQUEST_UPDATE', - 'description'=>'Geänderte Raumanfrage', - 'info_template'=>'%user ändert Raumanfrage für %sem(%affected), gewünschter Raum: %res(%coaffected), %info', - 'active'=>0], - [ - 'name'=>'RES_REQUEST_DEL', - 'description'=>'Raumanfrage löschen', - 'info_template'=>'%user löscht Raumanfrage für %sem(%affected).', - 'active'=>0], - [ - 'name'=>'RES_ASSIGN_DEL_SEM', - 'description'=>'VA-Buchung löschen', - 'info_template'=>'%user löscht Ressourcenbelegung für %res(%affected) in Veranstaltung %sem(%coaffected), %info.', - 'active'=>0], - [ - 'name'=>'RES_ASSIGN_DEL_SINGLE', - 'description'=>'Direktbuchung löschen', - 'info_template'=>'%user löscht Direktbuchung für %res(%affected) (%info).', - 'active'=>0], - [ - 'name'=>'RES_REQUEST_DENY', - 'description'=>'Abgelehnte Raumanfrage', - 'info_template'=>'%user lehnt Raumanfrage für %sem(%coaffected), Raum %sem(%affected) ab.', - 'active'=>0], - [ - 'name'=>'RES_REQUEST_RESOLVE', - 'description'=>'Aufgelöste Raumanfrage', - 'info_template'=>'%user löst Raumanfrage für %sem(%affected), Raum %res(%coaffected) auf.', - 'active'=>0] - ]; - - - function description () { - return 'adds new log actions for changing basic data within lectures and enabling and disabling plugins'; - } - - function up () { - - $insert = "INSERT IGNORE INTO `log_actions` (`action_id`, `name`, `description`, `info_template`, `active`, `expires`) VALUES( MD5('%s'), '%s', '%s', '%s', %s, NULL)"; - - foreach ($this->logactions as $a) - { - DBManager::get()->query(sprintf($insert,$a['name'],$a['name'],$a['description'],$a['info_template'],$a['active'])); - } - } - - function down () { - - $delete = "DELETE FROM log_actions WHERE action_id = MD5('%s')"; - - foreach ($this->logactions as $a) - { - DBManager::get()->query(sprintf($delete,$a['name'])); - } - } -} diff --git a/db/migrations/36_step_00156_editierbares_impressum.php b/db/migrations/36_step_00156_editierbares_impressum.php deleted file mode 100644 index 7373c2b..0000000 --- a/db/migrations/36_step_00156_editierbares_impressum.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - */ - -class Step00156EditierbaresImpressum extends Migration { - - - function description() { - return 'Adds two new tables and fills them with default content.'; - } - - - function up() { - $db = DBManager::get(); - - $this->announce("add new table siteinfo_rubrics"); - $db->exec("CREATE TABLE IF NOT EXISTS `siteinfo_rubrics` ( - `rubric_id` smallint(5) unsigned NOT NULL auto_increment, - `position` tinyint(3) unsigned default NULL, - `name` varchar(255) NOT NULL, - PRIMARY KEY (`rubric_id`)) ENGINE=MyISAM"); - - $this->announce("fill siteinfo_rubrics with default content"); - $db->exec("INSERT INTO `siteinfo_rubrics` (`rubric_id`, `name`) - VALUES - (1, '[lang=de]Kontakt[/lang][lang=en]Contact[/lang]'), - (2, '[lang=de]Über Stud.IP[/lang][lang=en]About Stud.IP[/lang]')"); - - $this->announce("add new table siteinfo_details"); - $db->exec("CREATE TABLE IF NOT EXISTS `siteinfo_details` ( - `detail_id` smallint(5) unsigned NOT NULL auto_increment, - `rubric_id` smallint(5) unsigned NOT NULL, - `position` tinyint(3) unsigned default NULL, - `name` varchar(255) NOT NULL, - `content` text NOT NULL, - PRIMARY KEY (`detail_id`)) ENGINE=MyISAM"); - - $this->announce("fill siteinfo_details with default content"); - $db->exec("INSERT INTO `siteinfo_details` (`rubric_id`, `name`, `content`) - VALUES - (1, - '[lang=de]Ansprechpartner[/lang][lang=en]Contact[/lang]', - '[style=float: right]".'\n'. - "[img]http://www.studip.de/images/studipanim.gif".'\n'. - "**Version:** (:version:)".'\n'. - "[/style]".'\n'. - "[lang=de]Für diese Stud.IP-Installation ((:uniname:)) sind folgende Administratoren zuständig:[/lang]".'\n'. - "[lang=en]The following administrators are responsible for this Stud.IP installation ((:uniname:)):[/lang]".'\n'. - "(:rootlist:)".'\n'. - "[lang=de]allgemeine Anfragen wie Passwort-Anforderungen u.a. richten Sie bitte an:[/lang]".'\n'. - "[lang=en]General queries e.g., password queries, please contact:[/lang]".'\n'. - "(:unicontact:)".'\n'. - "[lang=de]Folgende Einrichtungen sind beteiligt:".'\n'. - "(Genannt werden die jeweiligen Administratoren der Einrichtungen für entsprechende Anfragen)[/lang]".'\n'. - "[lang=en]The following institutes participate:".'\n'. - "(Named are the institutes administrators responsible for the corresponding query areas)[/lang]".'\n'. - "(:adminlist:)'), - (1, - '[lang=de]Entwickler[/lang][lang=en]Developer[/lang]', - '[style=float: right]".'\n'. - "[img]http://www.studip.de/images/studipanim.gif".'\n'. - "**Version:** (:version:)".'\n'. - "[/style]".'\n'. - "[lang=de]Stud.IP ist ein Open Source Projekt zur Unterstützung von Präsenzlehre an Universitäten, Hochschulen und anderen Bildungseinrichtungen. Das System entstand am Zentrum für interdisziplinäre Medienwissenschaft (ZiM) der Georg-August-Universität Göttingen unter Mitwirkung der Suchi & Berg GmbH (data-quest) , Göttingen. Heute erfolgt die Weiterentwicklung von Stud.IP verteilt an vielen Standorten (Göttingen, Osnabrück, Oldenburg, Bremen, Hannover, Jena und weiteren). Die Koordination der Entwicklung erfolgt durch die Stud.IP-CoreGroup.".'\n'. - "Stud.IP steht unter der GNU General Public License, Version 2.".'\n\n'. - "Weitere Informationen finden Sie auf [**www.studip.de**]http://www.studip.de , [**develop.studip.de**]http://develop.studip.de und [**blog.studip.de**]http://blog.studip.de.[/lang]".'\n\n'. - "[lang=en]Stud.IP is an opensource project for supporting attendance courses offered by universities, institutions of higher education and other educational institutions. The system was established at the Zentrum für interdisziplinäre Medienwissenschaft (ZiM) in the Georg-August-Universität Göttingen in cooperation with Suchi & Berg GmbH (data-quest) , Göttingen. At the present further developing takes place at various locations (among others Göttingen, Osnabrück, Oldenburg, Bremen, Hannover, Jena) under coordination through the Stud.IP-CoreGroup.".'\n\n'. - "Stud.IP is covered by the GNU General Public Licence, version 2.".'\n\n'. - "Further information can be found under [**www.studip.de**]http://www.studip.de , [**develop.studip.de**]http://develop.studip.de and [**blog.studip.de**]http://blog.studip.de.[/lang]".'\n\n'. - "(:coregroup:)".'\n'. - "[lang=de]Sie erreichen uns auch über folgende **Mailinglisten**:".'\n\n'. - "**Nutzer-Anfragen**, E-Mail: studip-users@lists.sourceforge.net: Fragen, Anregungen und Vorschläge an die Entwickler - bitte __keine__ Passwort Anfragen!".'\n'. - "**News-Mailingsliste**, E-Mail: studip-news@lists.sourceforge.net: News rund um Stud.IP (Eintragung notwendig)".'\n\n'. - "Wir laden alle Entwickler, Betreiber und Nutzer von Stud.IP ein, sich auf dem Developer-Server http://develop.studip.de an den Diskussionen rund um die Weiterentwicklung und Nutzung der Plattform zu beteiligen.[/lang]".'\n'. - "[lang=en]You can contact us via the following **mailing lists**:".'\n\n'. - "**User enquiries**, E-Mail: studip-users@lists.sourceforge.net: Questions, suggestions and recommendations to the developers - __please no password queries__!".'\n\n'. - "**News mailing list**, E-Mail: studip-news@lists.sourceforge.net: News about Stud.IP (registration necessary)".'\n\n'. - "We invite all developers, administrators and users of Stud.IP to join the discussions on further developing and using the platform available at the developer server http://develop.studip.de[/lang]'), - (2, - '[lang=de]Technik[/lang][lang=en]Technology[/lang]', - '[style=float: right]".'\n'. - "[img]http://www.studip.de/images/studipanim.gif".'\n'. - "**Version:** (:version:)".'\n'. - "[/style]".'\n'. - "[lang=de]Stud IP ist ein Open-Source Projekt und steht unter der GNU General Public License. Sämtliche zum Betrieb notwendigen Dateien können unter http://sourceforge.net/projects/studip/ heruntergeladen werden.".'\n'. - "Die technische Grundlage bietet ein LINUX-System mit Apache Webserver sowie eine MySQL Datenbank, die über PHP gesteuert wird.".'\n'. - "Im System findet ein 6-stufiges Rechtesystem Verwendung, das individuell auf verschiedenen Ebenen wirkt - etwa in Veranstaltungen, Einrichtungen, Fakultäten oder systemweit.".'\n'. - "Seminare oder Arbeitsgruppen können mit Passwörtern geschützt werden - die Verschlüsselung erfolgt mit einem MD5 one-way-hash.".'\n'. - "Das System ist zu 100% über das Internet administrierbar, es sind keine zusätzlichen Werkzeuge nötig. Ein Webbrowser der 5. Generation wird empfohlen.".'\n'. - "Das System wird ständig weiterentwickelt und an die Wünsche unserer Nutzer angepasst - [sagen Sie uns Ihre Meinung!]studip-users@lists.sourceforge.net[/lang]".'\n'. - "[lang=en]Stud.IP is an Open Source Project and is covered by the Gnu General Public License (GPL). All files necessary for operation can be downloaded from http://sourceforge.net/projects/studip/ .".'\n'. - "The technical basis can be provided by a LINUX system with Apache Webserver and a MySQL database, which is then controlled by PHP.".'\n'. - "The system features a authorisation system with six ranks, that affects individually different levels - in courses, institutes,faculties or system wide.".'\n'. - "Seminars or work groups can be secured with passwords - the encryption of which uses a MD5 one-way-hash.".'\n'. - "The system is capable of being administrated 100% over the internet - no additional tools are necessary. A 5th generation web browser is recommended.".'\n'. - "The system is continually being developed and customised to the wishes of our users - [Tell us your opinion!]studip-users@lists.sourceforge.net[/lang]'), - (2, - '[lang=de]Statistik[/lang][lang=en]Statistics[/lang]', - '[lang=de]!!Top-Listen aller Veranstaltungen[/lang]". - "[lang=en]!!Top list of all courses[/lang]".'\n'. - "[style=float: right]".'\n'. - "[lang=de]!!Statistik[/lang][lang=en]!!statistics[/lang]".'\n'. - "(:indicator seminar_all:)".'\n'. - "(:indicator seminar_archived:)".'\n'. - "(:indicator institute_firstlevel_all:)".'\n'. - "(:indicator institute_secondlevel_all:)".'\n'. - "(:indicator user_admin:)".'\n'. - "(:indicator user_dozent:)".'\n'. - "(:indicator user_tutor:)".'\n'. - "(:indicator user_autor:)".'\n'. - "(:indicator posting:)".'\n'. - "(:indicator document:)".'\n'. - "(:indicator link:)".'\n'. - "(:indicator litlist:)".'\n'. - "(:indicator termin:)".'\n'. - "(:indicator news:)".'\n'. - "(:indicator guestbook:)".'\n'. - "(:indicator vote:)".'\n'. - "(:indicator test:)".'\n'. - "(:indicator evaluation:)".'\n'. - "(:indicator wiki_pages:)".'\n'. - "(:indicator lernmodul:)".'\n'. - "(:indicator resource:)".'\n'. - "[/style]".'\n'. - "(:toplist mostparticipants:)".'\n'. - "(:toplist recentlycreated:)".'\n'. - "(:toplist mostdocuments:)".'\n'. - "(:toplist mostpostings:)".'\n'. - "(:toplist mostvisitedhomepages:)'), - (2, - 'History', - '(:history:)'), - (2, - 'Stud.IP-Blog', - '[lang=de]Das Blog der Stud.IP-Entwickler finden Sie auf:[/lang]".'\n'. - "[lang=en]The Stud.IP-Developer-Blog can be found under:[/lang]".'\n'. - "http://blog.studip.de')"); - - $this->announce("done."); - } - - - function down() { - $db = DBManager::get(); - - $this->announce("remove siteinfo_details"); - $db->exec("DROP table `siteinfo_details`"); - - $this->announce("remove siteinfo_rubrics"); - $db->exec("DROP table `siteinfo_rubrics`"); - - $this->announce("done."); - } -} diff --git a/db/migrations/37_log_actions_expires.php b/db/migrations/37_log_actions_expires.php deleted file mode 100644 index 8af3e79..0000000 --- a/db/migrations/37_log_actions_expires.php +++ /dev/null @@ -1,25 +0,0 @@ -exec("ALTER TABLE log_actions CHANGE expires - expires int(20) NOT NULL default 0"); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE log_actions CHANGE expires - expires int(20) default NULL"); - } -} -?> diff --git a/db/migrations/38_allow_admin_useraccess.php b/db/migrations/38_allow_admin_useraccess.php deleted file mode 100644 index 51f5c80..0000000 --- a/db/migrations/38_allow_admin_useraccess.php +++ /dev/null @@ -1,32 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', '1', 1, 'boolean', $time, $time, '$description') - "); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE field = 'ALLOW_ADMIN_USERACCESS'"); - } -} -?> diff --git a/db/migrations/39_step_00153_studienmodulmanagement.php b/db/migrations/39_step_00153_studienmodulmanagement.php deleted file mode 100644 index d638b00..0000000 --- a/db/migrations/39_step_00153_studienmodulmanagement.php +++ /dev/null @@ -1,32 +0,0 @@ -exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', 'user', 1, 'string', $time, $time, '$description') - "); - $db->exec("ALTER TABLE `sem_tree` ADD `type` TINYINT UNSIGNED NOT NULL"); - } - - function down () - { - $db = DBManager::get(); - $db->exec("DELETE FROM config WHERE field = 'SEM_TREE_SHOW_EMPTY_AREAS_PERM'"); - $db->exec("ALTER TABLE `sem_tree` DROP `type`"); - } -} -?> diff --git a/db/migrations/40_add_index_to_log_events.php b/db/migrations/40_add_index_to_log_events.php deleted file mode 100644 index b6c61d9..0000000 --- a/db/migrations/40_add_index_to_log_events.php +++ /dev/null @@ -1,15 +0,0 @@ -query("ALTER TABLE `log_events` ADD INDEX `action_id` ( `action_id` )"); - } - - function down() { - DBManager::get()->query("ALTER TABLE `log_events` DROP INDEX `action_id`"); - } -} diff --git a/db/migrations/41_step_00157_rolemanagment.php b/db/migrations/41_step_00157_rolemanagment.php deleted file mode 100644 index c596990..0000000 --- a/db/migrations/41_step_00157_rolemanagment.php +++ /dev/null @@ -1,22 +0,0 @@ -exec("UPDATE plugins SET pluginclassname = 'RoleManagementPlugin' WHERE pluginclassname = 'de_studip_core_RoleManagementPlugin'"); - DBManager::get()->exec("DELETE FROM plugins WHERE pluginclassname = 'de_studip_core_UserManagementPlugin'"); - DBManager::get()->exec("DELETE FROM plugins_activated WHERE pluginid = 2"); - DBManager::get()->exec("DELETE FROM roles_plugins WHERE pluginid = 2"); - } - - function down () - { - DBManager::get()->exec("UPDATE plugins SET pluginclassname = 'de_studip_core_RoleManagementPlugin' WHERE pluginclassname = 'RoleManagementPlugin'"); - } -} -?> diff --git a/db/migrations/42_change_action_id_inst_create.php b/db/migrations/42_change_action_id_inst_create.php deleted file mode 100644 index 7740f0d..0000000 --- a/db/migrations/42_change_action_id_inst_create.php +++ /dev/null @@ -1,21 +0,0 @@ -exec("UPDATE log_actions SET action_id=MD5('INST_CREATE') - WHERE action_id=MD5('INST_NEW')"); - $db->exec("UPDATE log_events SET action_id=MD5('INST_CREATE') - WHERE action_id=MD5('INST_NEW')"); - } - -} -?> diff --git a/db/migrations/43_step_00159_datafieldentry.php b/db/migrations/43_step_00159_datafieldentry.php deleted file mode 100644 index 3e71a30..0000000 --- a/db/migrations/43_step_00159_datafieldentry.php +++ /dev/null @@ -1,20 +0,0 @@ -exec("ALTER TABLE `datafields` MODIFY COLUMN `type` ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link') NOT NULL DEFAULT 'textline'"); - } - - function down() - { - DBManager::get()->exec("ALTER TABLE `datafields` MODIFY COLUMN `type` ENUM('bool','textline','textarea','selectbox','date','time','email','url','phone','radio','combo') NOT NULL DEFAULT 'textline'"); - } -} -?> diff --git a/db/migrations/44_add_switch_to_preselect_semester.php b/db/migrations/44_add_switch_to_preselect_semester.php deleted file mode 100644 index 16aceb4..0000000 --- a/db/migrations/44_add_switch_to_preselect_semester.php +++ /dev/null @@ -1,23 +0,0 @@ -exec("INSERT INTO config (`config_id`, `parent_id`, `field`, " . - "`value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`," . - "`description`, `comment`, `message_template`) VALUES " . - "('06d703c3de37cdae942c66e18f7dcd02', '', 'ASSI_SEMESTER_PRESELECT', " . - "'TRUE', 0, 'boolean', 'global', '', 0, ".time().",". time(). - ", 'Wenn ausgeschaltet wird im admin_seminare_assi beim" . - "Erstellen einer Veranstaltung als Semester bitte auswählen " . - "angezeigt und nicht das voreingestellte Semester.', '', '')"); - } - - function down() { - DBManager::get()->exec("DELETE FROM `config` WHERE `config_id`='06d703c3de37cdae942c66e18f7dcd02' LIMIT 1 "); - } -} - -?> diff --git a/db/migrations/45_refine_logevents.php b/db/migrations/45_refine_logevents.php deleted file mode 100644 index 482ccaf..0000000 --- a/db/migrations/45_refine_logevents.php +++ /dev/null @@ -1,62 +0,0 @@ -query("SELECT action_id FROM log_actions WHERE name = 'SEM_CHANGED_ACCESS'")->fetch(); - $action_id = $data['action_id']; - - // (2) Update the format string - DBManager::get()->query("UPDATE log_actions - SET info_template = '%user ändert die Zugangsberechtigungen der Veranstaltung %sem(%affected).' - WHERE action_id = '$action_id'"); - - // (3) Get all corresponding logevents and update the info text - $stmt = DBManager::get()->query("SELECT event_id, info FROM log_events WHERE action_id = '$action_id'"); - while ($data = $stmt->fetch()) { - if($info=unserialize($data['info'])) { - $anmeldeverfahren=$info["admission_type"]; - $startzeit=$info["start_time"]; - $endzeit=$info["end_time"]; - $lesezugriff=$info["read_level"]; - $schreibzugriff=$info["write_level"]; - $admission_prelim=$info["admission_prelim"]; - $passwort=$info["passwort"]; - $disable_waiting_list=$info["admission_disable_waitlist"]; - $maxteilnehmerzahl=$info["admission_turnout"]; - $verbindlich = $info["admission_binding"]; - $enable_quota=$info["admission_enable_quota"]; - - $inf_txt=": \nAnmeldeverfahren auf ".get_admission_description('admission_type', $anmeldeverfahren)." geändert.". - " Startzeit auf ".date("d.m.Y H:i",$startzeit)." geändert.". - " Endzeit auf ".date("d.m.Y H:i",$endzeit)." geändert.\n". - "Lesezugriff auf ".get_admission_description('read_level', $lesezugriff)." geändert.". - " Schreibzugriff auf ".get_admission_description('write_level', $schreibzugriff)." geändert.". - " Vorläufigen Zugang auf ".get_admission_description('admission_prelim',$admission_prelim)." geändert.\n". - "Passwort auf ".$passwort." geändert.". - "Warteliste auf ".$disable_waiting_list." geändert.". - " Teilnehmerzahl auf ".$maxteilnehmerzahl." geändert.". - " Verbindlich auf ".$verbindlich." geändert.". - " Enable_Quotas ".$enable_quota." geändert."; - - DBManager::get()->query("UPDATE log_events SET info = '$inf_txt' WHERE event_id = '{$data['event_id']}'"); - } - - } - } - - function down () - { - - } -} -?> diff --git a/db/migrations/46_step00172_remove_ilias_connect.php b/db/migrations/46_step00172_remove_ilias_connect.php deleted file mode 100644 index 87672ab..0000000 --- a/db/migrations/46_step00172_remove_ilias_connect.php +++ /dev/null @@ -1,22 +0,0 @@ -exec("DROP TABLE IF EXISTS `seminar_lernmodul`"); - $db->exec("DROP TABLE IF EXISTS `studip_ilias`"); - } - - function down () - { - - } -} -?> \ No newline at end of file diff --git a/db/migrations/47_add_option_resources_hide_past_single_dates.php b/db/migrations/47_add_option_resources_hide_past_single_dates.php deleted file mode 100644 index 1e442f8..0000000 --- a/db/migrations/47_add_option_resources_hide_past_single_dates.php +++ /dev/null @@ -1,62 +0,0 @@ -exec(" - INSERT IGNORE INTO `config` ( - `config_id` , - `parent_id` , - `field` , - `value` , - `is_default` , - `type` , - `range` , - `section` , - `position` , - `mkdate` , - `chdate` , - `description` , - `comment` , - `message_template` - ) - VALUES ( - MD5( 'RESOURCES_HIDE_PAST_SINGLE_DATES' ) , '', 'RESOURCES_HIDE_PAST_SINGLE_DATES', '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Schaltet in der Ressourcenverwaltung ein,ob bereits vergangene Terminen bei der Buchung und Planung brücksichtigt werden sollen', '', '' - ) - "); - $db->exec("INSERT IGNORE INTO `config` ( - `config_id` , - `parent_id` , - `field` , - `value` , - `is_default` , - `type` , - `range` , - `section` , - `position` , - `mkdate` , - `chdate` , - `description` , - `comment` , - `message_template` - ) - VALUES ( - MD5( 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS' ) , '', 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS', '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Schaltet in der Ressourcenverwaltung ein,ob alle Räume gewünscht werden können, oder nur eigene und ''Global'' gesetzte', '', '' - ) - "); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE field IN('RESOURCES_HIDE_PAST_SINGLE_DATES','RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS')"); - } -} -?> diff --git a/db/migrations/48_step_00174_plugin_interfaces.php b/db/migrations/48_step_00174_plugin_interfaces.php deleted file mode 100644 index 6478aa6..0000000 --- a/db/migrations/48_step_00174_plugin_interfaces.php +++ /dev/null @@ -1,31 +0,0 @@ -exec("ALTER TABLE plugins CHANGE plugintype - plugintype TEXT NOT NULL default ''"); - - $db->exec("UPDATE plugins SET plugintype = - CONCAT(plugintype, 'Plugin')"); - } - - function down () - { - $db = DBManager::get(); - - $db->exec("UPDATE plugins SET plugintype = - TRIM(TRAILING 'Plugin' FROM plugintype)"); - - $db->exec("ALTER TABLE plugins CHANGE plugintype - plugintype varchar(255) NOT NULL default 'Standard'"); - } -} -?> diff --git a/db/migrations/49_step_00150_studygroups.php b/db/migrations/49_step_00150_studygroups.php deleted file mode 100644 index e5f512a..0000000 --- a/db/migrations/49_step_00150_studygroups.php +++ /dev/null @@ -1,74 +0,0 @@ -query("INSERT IGNORE INTO auth_user_md5 (user_id, username, password, perms, Vorname, Nachname, Email, locked) VALUES (MD5('studygroup_dozent'),'studygroup_dozent','0c6fe1b07e3aca7ee6387f87dc8370eb','dozent','','','',1)"); - DBManager::get()->query("INSERT IGNORE INTO user_info SET user_id =MD5('studygroup_dozent')"); - - // (2) Allocate some space in the config-table - DBManager::get()->query("ALTER TABLE `config` CHANGE `value` `value` TEXT NOT NULL"); - - // (3) Add some default-terms - DBManager::get()->query("INSERT IGNORE INTO `config` ( - `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, - `range`, `section`, `position`, `mkdate`, `chdate`, `description`, - `comment`, `message_template` ) - VALUES ( MD5( 'STUDYGROUPS_ENABLE' ) , '', 'STUDYGROUPS_ENABLE', - '0', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , - 'Studiengruppen', '', '')"); - - $terms = "Mir ist bekannt, dass ich die Gruppe nicht zu rechtswidrigen Zwecken nutzen darf. Dazu zählen u.a. Urheberrechtsverletzungen, Beleidigungen und andere Persönlichkeitsdelikte. - -Ich erkläre mich damit einverstanden, dass Admins die Inhalte der Gruppe zu Kontrollzwecken einsehen dürfen."; - - DBManager::get()->query("INSERT IGNORE INTO `config` ( - `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, - `range`, `section`, `position`, `mkdate`, `chdate`, `description`, - `comment`, `message_template` ) - VALUES ( MD5( 'STUDYGROUP_TERMS' ) , '', 'STUDYGROUP_TERMS', - '$terms', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , - 'Studiengruppen', '', '')"); - - // (4) Add default for allowed modules - DBManager::get()->query("INSERT IGNORE INTO `config` ( - `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, - `range`, `section`, `position`, `mkdate`, `chdate`, `description`, - `comment`, `message_template` ) - VALUES ( MD5( 'STUDYGROUP_SETTINGS' ) , '', 'STUDYGROUP_SETTINGS', - 'forum:1|documents:0|schedule:0|participants:1', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , - 'Studiengruppen', '', '')"); - - DBManager::get()->query("INSERT IGNORE INTO `config` ( - `config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, - `range`, `section`, `position`, `mkdate`, `chdate`, `description`, - `comment`, `message_template` ) - VALUES ( MD5( 'STUDYGROUP_DEFAULT_INST' ) , '', 'STUDYGROUP_DEFAULT_INST', - '', '1', 'string', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , - 'Studiengruppen', '', '')"); - - } - - function down () - { - // (1) Remove studygroup_dozent - DBManager::get()->query("DELETE FROM auth_user_md5 WHERE user_id = MD5('studygroup_dozent')"); - DBManager::get()->query("DELETE FROM user_info WHERE user_id = MD5('studygroup_dozent')"); - // (2) remove config entries - DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUPS_ENABLE')"); - DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUP_DEFAULT_INST')"); - DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUP_SETTINGS')"); - DBManager::get()->query("DELETE FROM config WHERE config_id = MD5('STUDYGROUP_TERMS')"); - // (3) restore config-table schema - DBManager::get()->query("ALTER TABLE config CHANGE value value varchar(255) NOT NULL"); - } -} -?> diff --git a/db/migrations/50_add_option_step_152.php b/db/migrations/50_add_option_step_152.php deleted file mode 100644 index a4f49df..0000000 --- a/db/migrations/50_add_option_step_152.php +++ /dev/null @@ -1,46 +0,0 @@ -exec(" - INSERT IGNORE INTO `config` ( - `config_id` , - `parent_id` , - `field` , - `value` , - `is_default` , - `type` , - `range` , - `section` , - `position` , - `mkdate` , - `chdate` , - `description` , - `comment` , - `message_template` - ) - VALUES ( - MD5( 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION' ) , '', 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION', - '0', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , - 'Schaltet die Überprüfung (fester Teilnehmerkreis) bei Download von als geschützt markierten Dateien ein', - '', '' - ) - "); - - } - - function down () - { - $db = DBManager::get(); - - $db->exec("DELETE FROM config WHERE field = 'ENABLE_PROTECTED_DOWNLOAD_RESTRICTION'"); - } -} -?> diff --git a/db/migrations/51_unhide_dozents.php b/db/migrations/51_unhide_dozents.php deleted file mode 100644 index c25e7b3..0000000 --- a/db/migrations/51_unhide_dozents.php +++ /dev/null @@ -1,20 +0,0 @@ -exec("UPDATE seminar_user SET visible = 'yes' WHERE status = 'dozent'"); - } - - function down () - { - - } -} -?> diff --git a/db/migrations/52_additional_semtree_log_actions.php b/db/migrations/52_additional_semtree_log_actions.php deleted file mode 100644 index 23e81fa..0000000 --- a/db/migrations/52_additional_semtree_log_actions.php +++ /dev/null @@ -1,46 +0,0 @@ -'STUDYAREA_ADD', - 'description'=>'Studienbereich hinzufügen', - 'info_template'=>'%user legt Studienbereich %studyarea(%affected) an.', - 'active'=>0], - [ - 'name'=>'STUDYAREA_DELETE', - 'description'=>'Studienbereich löschen', - 'info_template'=>'%user entfernt Studienbereich %studyarea(%affected).', - 'active'=>0] - ]; - - - function description () { - return 'adds two new log actions for adding and deleting SemTree Items'; - } - - function up () { - - $insert = "INSERT IGNORE INTO `log_actions` (`action_id`, `name`, `description`, `info_template`, `active`, `expires`) VALUES( MD5('%s'), '%s', '%s', '%s', %s, NULL)"; - - foreach ($this->logactions as $a) - { - DBManager::get()->query(sprintf($insert,$a['name'],$a['name'],$a['description'],$a['info_template'],$a['active'])); - } - } - - function down () { - - $delete = "DELETE FROM log_actions WHERE action_id = MD5('%s')"; - - foreach ($this->logactions as $a) - { - DBManager::get()->query(sprintf($delete,$a['name'])); - } - } -} - - - -?> diff --git a/db/migrations/53_file_and_folder_priority.php b/db/migrations/53_file_and_folder_priority.php deleted file mode 100644 index c9daaa5..0000000 --- a/db/migrations/53_file_and_folder_priority.php +++ /dev/null @@ -1,19 +0,0 @@ -exec("ALTER TABLE `dokumente` ADD `priority` SMALLINT UNSIGNED NOT NULL DEFAULT 0"); - $db->exec("ALTER TABLE `folder` ADD `priority` SMALLINT UNSIGNED NOT NULL DEFAULT 0"); - } - - function down() { - $db = DBManager::get(); - $db->exec("ALTER TABLE `dokumente` DROP `priority`"); - $db->exec("ALTER TABLE `folder` DROP `priority`"); - } -} -?> \ No newline at end of file diff --git a/db/migrations/54_step_00161_plugin_admin.php b/db/migrations/54_step_00161_plugin_admin.php deleted file mode 100644 index d6b0145..0000000 --- a/db/migrations/54_step_00161_plugin_admin.php +++ /dev/null @@ -1,35 +0,0 @@ -exec("DELETE FROM plugins WHERE pluginid IN (1, 3)"); - $db->exec("DELETE FROM plugins_activated WHERE pluginid IN (1, 3)"); - $db->exec("DELETE FROM roles_plugins WHERE pluginid IN (1, 3)"); - - $db->exec("ALTER TABLE plugins DROP plugindesc"); - } - - function down() - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE plugins ADD plugindesc varchar(45) NOT NULL default '' AFTER pluginname"); - - $db->exec("INSERT INTO plugins - (pluginid, pluginclassname, pluginpath, pluginname, plugintype, enabled, navigationpos, dependentonid) - VALUES - (1, 'PluginAdministrationPlugin', 'core', 'Plugin-Administration', 'AdministrationPlugin', 'yes', 0, NULL), - (3, 'RoleManagementPlugin', 'core', 'RollenManagement', 'AdministrationPlugin', 'yes', 1, 1)"); - - $db->exec("INSERT INTO roles_plugins (roleid, pluginid) VALUES (1, 1), (1, 3)"); - } -} -?> diff --git a/db/migrations/55_add_missing_log_actions.php b/db/migrations/55_add_missing_log_actions.php deleted file mode 100644 index 6176dca..0000000 --- a/db/migrations/55_add_missing_log_actions.php +++ /dev/null @@ -1,57 +0,0 @@ - 'USER_CHANGE_PASSWORD', - 'description' => 'Nutzerpasswort geändert', - 'template' => '%user ändert/setzt das Passwort für %user(%affected)', - 'active' => 0 - ], [ - 'name' => 'SEM_CHANGE_CYCLE', - 'description' => 'Regelmäßige Zeit geändert', - 'template' => '%user hat in %sem(%affected) die regelmäßige Zeit %info geändert', - 'active' => 1 - ] - ]; - - function description() - { - return 'adds two missing log actions to the database'; - } - - function up() - { - $db = DBManager::get(); - $query = $db->prepare("INSERT INTO log_actions (action_id, name, description, info_template, active) VALUES (?, ?, ?, ?, ?)"); - - foreach (self::$log_actions as $action) { - $query->execute([md5($action['name']), $action['name'], $action['description'], $action['template'], $action['active']]); - } - - // fix misuse of %coaffected in SEM_ADD_CYCLE and SEM_DELETE_CYCLE - $db->exec("UPDATE log_actions SET info_template = REPLACE(info_template, '%coaffected', '%info') - WHERE name IN ('SEM_ADD_CYCLE', 'SEM_DELETE_CYCLE')"); - - $db->exec("UPDATE log_events SET info = coaffected_range_id WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); - $db->exec("UPDATE log_events SET coaffected_range_id = NULL WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); - } - - function down() - { - $db = DBManager::get(); - $query = $db->prepare("DELETE FROM log_actions WHERE action_id = ?"); - - foreach (self::$log_actions as $action) { - $query->execute([md5($action['name'])]); - } - - // restore misuse of %coaffected in SEM_ADD_CYCLE and SEM_DELETE_CYCLE - $db->exec("UPDATE log_actions SET info_template = REPLACE(info_template, '%info', '%coaffected') - WHERE name IN ('SEM_ADD_CYCLE', 'SEM_DELETE_CYCLE')"); - - $db->exec("UPDATE log_events SET coaffected_range_id = info WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); - $db->exec("UPDATE log_events SET info = NULL WHERE action_id IN (MD5('SEM_ADD_CYCLE'), MD5('SEM_DELETE_CYCLE'))"); - } -} -?> diff --git a/db/migrations/56_step_00176_wap.php b/db/migrations/56_step_00176_wap.php deleted file mode 100644 index 7828f58..0000000 --- a/db/migrations/56_step_00176_wap.php +++ /dev/null @@ -1,24 +0,0 @@ -exec("DROP TABLE IF EXISTS wap_sessions"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("CREATE TABLE wap_sessions ( " - ."`user_id` char(32) NOT NULL default '', " - ."`session_id` char(32) NOT NULL default '', " - ."`creation_time` datetime default NULL, " - ."PRIMARY KEY (`session_id`)) ENGINE=MyISAM"); - } -} diff --git a/db/migrations/57_step_00158_privacy.php b/db/migrations/57_step_00158_privacy.php deleted file mode 100644 index d58469e..0000000 --- a/db/migrations/57_step_00158_privacy.php +++ /dev/null @@ -1,107 +0,0 @@ - 'DOZENT_ALWAYS_VISIBLE', - 'type' => 'boolean', - 'value' => 1, - 'description' => 'Legt fest, ob Personen mit Dozentenrechten immer global sichtbar sind und das auch nicht selbst ändern können.' - // What is the default visibility for unconfigured homepage elements? - ], [ - 'name' => 'HOMEPAGE_VISIBILITY_DEFAULT', - 'type' => 'string', - 'value' => 'VISIBILITY_STUDIP', - 'description' => 'Standardsichtbarkeit für Homepageelemente, falls der Benutzer nichts anderes eingestellt hat. Gültige Werte sind: VISIBILITY_ME, VISIBILITY_BUDDIES, VISIBILITY_DOMAIN, VISIBILITY_STUDIP, VISIBILITY_EXTERN' - ], [ - 'name' => 'FORUM_ANONYMOUS_POSTINGS', - 'type' => 'boolean', - 'value' => 0, - 'description' => 'Legt fest, ob Forenbeiträge anonym verfasst werden dürfen (Root sieht aber immer den Urheber).' - ] - ]; - - function description() - { - return 'add configuration entries and database table for enhanced privacy settings'; - } - - function up() - { - $db = DBManager::get(); - $query = $db->prepare("INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); - - // insert new configuration entries - foreach (self::$config_entries as $entry) { - $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); - } - - // create database table for privacy settings - $db->exec("CREATE TABLE `user_visibility` ( - `user_id` VARCHAR(32) NOT NULL PRIMARY KEY, - `online` TINYINT(1) NOT NULL DEFAULT 1, - `chat` TINYINT(1) NOT NULL DEFAULT 1, - `search` TINYINT(1) NOT NULL DEFAULT 1, - `email` TINYINT(1) NOT NULL DEFAULT 1, - `homepage` TEXT NOT NULL DEFAULT '', - `default_homepage_visibility` INT NOT NULL DEFAULT 0 , - `mkdate` INT(20) NOT NULL DEFAULT 0) ENGINE=MyISAM"); - - // insert default values - $db->exec("INSERT INTO `user_visibility` VALUES ('studip', 1, 1, 1, 1, '', 0, ".time().")"); - - // transfer hidden categories to privacy settings - $data = $db->query("SELECT * FROM `kategorien` WHERE hidden=1"); - $categories = []; - // aggregate all categories by their owner... - while ($category = $data->fetch()) { - $categories[$category['range_id']]['kat_'.$category['kategorie_id']] = VISIBILITY_ME; - } - // ... and write settings to user privacy table - foreach ($categories as $owner_id => $settings) { - $db->exec("INSERT IGNORE INTO `user_visibility` (`homepage`,`user_id`) VALUES (".$db->quote(json_encode($settings)).",".$db->quote($owner_id).")"); - } - - // remove hidden attribute of custom categories (is configured in privacy settings now) - $db->exec("ALTER TABLE `kategorien` DROP `hidden`"); - - // add field for anonymous postings in forum - $db->exec("ALTER TABLE `px_topics` ADD `anonymous` TINYINT(4) NOT NULL DEFAULT 0"); - } - - function down() - { - $db = DBManager::get(); - $query = $db->prepare("DELETE FROM `config` WHERE `field` = ?"); - - foreach (self::$config_entries as $entry) { - $query->execute([$entry['name']]); - } - - // add "hidden" field to user categories... - $db->exec("ALTER TABLE `kategorien` ADD `hidden` TINYINT(4) NOT NULL DEFAULT 0 AFTER `content`"); - // ... and set it there according to privacy settings - $result = $db->query("SELECT `user_id`, `homepage` FROM `user_visibility` WHERE `homepage` LIKE '%kat_%'"); - while ($current = $result->fetch()) { - $data = json_decode($current['homepage'], true); - foreach ($data as $key => $visibility) { - if (substr($key, 0, 4) == 'kat_' && $visibility == VISIBILITY_ME) { - $category_id = substr($key, 4); - DBManager::get()->exec("UPDATE `kategorien` SET `hidden`=1 WHERE `user_id`='".$current['user_id']."'"); - } - } - } - - // delete privacy settings from database - $db->exec("DROP TABLE `user_visibility`"); - - // delete anonymous flag from forum posts - $db->exec("ALTER TABLE `px_topics` DROP `anonymous`"); - } -} -?> diff --git a/db/migrations/58_add_config_allow_fakadmin.php b/db/migrations/58_add_config_allow_fakadmin.php deleted file mode 100644 index 675f9ed..0000000 --- a/db/migrations/58_add_config_allow_fakadmin.php +++ /dev/null @@ -1,38 +0,0 @@ - '"none" Fakultätsadmin darf Einrichtungen weder anlegen noch löschen, "create" Fakultätsadmin darf Einrichtungen anlegen, aber nicht löschen, "all" Fakultätsadmin darf Einrichtungen anlegen und löschen.']; - - function description () - { - return 'adds switch to config to controll fak_admin perms'; - } - - function up () - { - $db = DBManager::get(); - $time = time(); - - foreach ($this->options as $name => $description) - { - $db->exec(" - INSERT INTO config - (config_id, field, value, is_default, type, mkdate, chdate, description) - VALUES - (MD5('$name'), '$name', 'all', 1, 'string', $time, $time, '$description') - "); - } - - } - - function down () - { - $db = DBManager::get(); - foreach ($this->options as $name => $descrition) - { - $db->exec("DELETE FROM config WHERE field = '$name'"); - } - - } -} -?> diff --git a/db/migrations/59_step_00194_studycourse.php b/db/migrations/59_step_00194_studycourse.php deleted file mode 100644 index a8e028e..0000000 --- a/db/migrations/59_step_00194_studycourse.php +++ /dev/null @@ -1,33 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS `abschluss` ( - `abschluss_id` char(32) NOT NULL default '', - `name` varchar(255) NOT NULL default '', - `beschreibung` text, - `mkdate` int(20) default NULL, - `chdate` int(20) default NULL, - PRIMARY KEY (`abschluss_id`) - ) ENGINE=MyISAM"); - $db->exec("ALTER TABLE `user_studiengang` ADD `semester` TINYINT(2) DEFAULT 0"); - $db->exec("ALTER TABLE `user_studiengang` ADD `abschluss_id` CHAR(32) DEFAULT 0"); - $db->exec("ALTER TABLE `user_studiengang` ADD INDEX ( `studiengang_id` )"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("DROP TABLE IF EXISTS `abschluss`"); - $db->exec("ALTER TABLE `user_studiengang` DROP `semester`"); - $db->exec("ALTER TABLE `user_studiengang` DROP `abschluss_id`"); - } -} diff --git a/db/migrations/60_step_00191_modulesenable.php b/db/migrations/60_step_00191_modulesenable.php deleted file mode 100644 index ba75320..0000000 --- a/db/migrations/60_step_00191_modulesenable.php +++ /dev/null @@ -1,107 +0,0 @@ - 'CHAT_ENABLE', - 'value' => $this->getValue('CHAT_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob der Chat global verfügbar ist.', - ], - ['field' => 'CALENDAR_ENABLE', - 'value' => $this->getValue('CALENDAR_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob der Kalender global verfügbar ist.', - ], - ['field' => 'EXPORT_ENABLE', - 'value' => $this->getValue('EXPORT_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob der Export global verfügbar ist.', - ], - ['field' => 'EXTERN_ENABLE', - 'value' => $this->getValue('EXTERN_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob die externen Seiten global verfügbar sind.', - ], - ['field' => 'VOTE_ENABLE', - 'value' => $this->getValue('VOTE_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob die Umfragen global verfügbar sind.', - ], - ['field' => 'ELEARNING_INTERFACE_ENABLE', - 'value' => $this->getValue('ELEARNING_INTERFACE_ENABLE', 0), - 'comment' => 'Schaltet ein oder aus, ob die Lernmodule global verfügbar sind.', - ], - ['field' => 'STM_ENABLE', - 'value' => $this->getValue('STM_ENABLE', 0), - 'comment' => 'Schaltet ein oder aus, ob die Studienmodule global verfügbar sind.', - ], - ['field' => 'WIKI_ENABLE', - 'value' => $this->getValue('WIKI_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob das Wiki global verfügbar ist.', - ], - ['field' => 'SMILEYADMIN_ENABLE', - 'value' => $this->getValue('SMILEYADMIN_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob die Administration der Smileys verfügbar ist.', - ], - ['field' => 'LOG_ENABLE', - 'value' => $this->getValue('LOG_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob das Log global verfügbar ist.', - ], - ['field' => 'SCM_ENABLE', - 'value' => $this->getValue('SCM_ENABLE'), - 'comment' => 'Schaltet ein oder aus, ob freie Informationsseiten global verfügbar sind.', - ], - ['field' => 'BANNER_ADS_ENABLE', - 'value' => $this->getValue('BANNER_ADS_ENABLE', 0), - 'comment' => 'Schaltet ein oder aus, ob die Bannerwerbung global verfügbar ist.', - ] - ]; - } - - function up() - { - $db = DBManager::get(); - - // existing - $db->exec("UPDATE `config` SET `section` = 'modules', `chdate` = '".time()."' WHERE `field` = 'RESOURCES_ENABLE'"); - $db->exec("UPDATE `config` SET `section` = 'studygroups', `type` = 'boolean', `range` = 'global', `chdate` = '".time()."' WHERE `field` = 'STUDYGROUPS_ENABLE'"); - - //moving - foreach ($this->getModules() as $module) { - $db->exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) VALUES ( MD5('". $module['field'] . "'), '', '". $module['field'] . "', '". $module['value'] . "', '1', 'boolean', 'global', 'modules', '0', '".time()."', '".time()."', '". $module['comment'] . "', '', '')"); - } - - // new - $db->exec("INSERT IGNORE INTO `config` ( `config_id` , `parent_id` , `field` , `value` , `is_default` , `type` , `range` , `section` , `position` , `mkdate` , `chdate` , `description` , `comment` , `message_template` ) VALUES ( MD5('LITERATURE_ENABLE'), '', 'LITERATURE_ENABLE', '1', '1', 'boolean', 'global', 'modules', '0', '".time()."', '".time()."', 'Schaltet ein oder aus, ob die Literaturverwaltung global verfügbar ist.', '', '')"); - - //changing studygroup config - $db->exec("UPDATE config SET value = REPLACE (value, '|', ' ') WHERE field = 'STUDYGROUP_SETTINGS'"); - } - - function down() - { - $db = DBManager::get(); - - //existing - $db->exec("UPDATE `config` SET `section` = '', `chdate` = '".time()."' WHERE `field` = 'RESOURCES_ENABLE'"); - $db->exec("UPDATE `config` SET `section` = '', `chdate` = '".time()."' WHERE `field` = 'STUDYGROUPS_ENABLE'"); - - //moving - foreach ($this->modules as $module) { - $db->exec("DELETE FROM `config` WHERE `field` = '" . $module['field'] . "'"); - } - - //new - $db->exec("DELETE FROM `config` WHERE `field` = 'LITERATURE_ENABLE'"); - - //changing studygroup config - $db->exec("UPDATE config SET value = REPLACE (value, ' ', '|') WHERE field = 'STUDYGROUP_SETTINGS'"); - } -} diff --git a/db/migrations/61_remove_studygroupdozent.php b/db/migrations/61_remove_studygroupdozent.php deleted file mode 100644 index 1b5ef43..0000000 --- a/db/migrations/61_remove_studygroupdozent.php +++ /dev/null @@ -1,18 +0,0 @@ -exec("DELETE FROM seminar_user WHERE status = 'dozent' AND user_id = MD5('studygroup_dozent')"); - $db->exec("DELETE FROM auth_user_md5 WHERE user_id = MD5('studygroup_dozent')"); - - } -} -?> diff --git a/db/migrations/62_gender_iso_5218.php b/db/migrations/62_gender_iso_5218.php deleted file mode 100644 index 8a49eed..0000000 --- a/db/migrations/62_gender_iso_5218.php +++ /dev/null @@ -1,24 +0,0 @@ -exec("UPDATE user_info SET geschlecht = 2 WHERE geschlecht = 1"); - } - - function down() - { - $db = DBManager::get(); - - $db->exec("UPDATE user_info SET geschlecht = 0 WHERE geschlecht = 1"); - $db->exec("UPDATE user_info SET geschlecht = 1 WHERE geschlecht = 2"); - } -} diff --git a/db/migrations/63_tic1207_config.php b/db/migrations/63_tic1207_config.php deleted file mode 100644 index 02199fc..0000000 --- a/db/migrations/63_tic1207_config.php +++ /dev/null @@ -1,52 +0,0 @@ -exec("UPDATE config SET section = 'resources' WHERE field LIKE 'RESOURCES%'"); - $db->exec("UPDATE config SET section = 'studygroups' WHERE field LIKE 'STUDYGROUP%'"); - $db->exec("UPDATE config SET section = 'elearning_interface' WHERE field LIKE 'ELEARNING\_INTERFACE%' AND field != 'ELEARNING_INTERFACE_ENABLE'"); - $db->exec("UPDATE config SET section = 'permissions' WHERE field IN (" - ."'ALLOW_ADMIN_USERACCESS','ALLOW_DOZENT_ARCHIV','ALLOW_DOZENT_VISIBILITY'," - ."'ALLOW_SELFASSIGN_INSTITUTE','AUX_RULE_ADMIN_PERM','LOCK_RULE_ADMIN_PERM'," - ."'INST_FAK_ADMIN_PERMS','RANGE_TREE_ADMIN_PERM','RESTRICTED_USER_MANAGEMENT'," - ."'SEM_CREATE_PERM','SEM_TREE_ADMIN_PERM','SEM_TREE_SHOW_EMPTY_AREAS_PERM'," - ."'SEM_VISIBILITY_PERM')"); - $db->exec("UPDATE config SET section = 'privacy' WHERE field IN (" - ."'DOZENT_ALWAYS_VISIBLE','ENABLE_SKYPE_INFO','FOAF_SHOW_IDENTITY'," - ."'FORUM_ANONYMOUS_POSTINGS','HOMEPAGE_VISIBILITY_DEFAULT'," - ."'USER_VISIBILITY_UNKNOWN')"); - $db->exec("UPDATE config SET section = 'files' WHERE field LIKE 'ZIP_%' OR " - ."field IN ('ENABLE_PROTECTED_DOWNLOAD_RESTRICTION', 'DOCUMENTS_EMBEDD_FLASH_MOVIES', " - ."'SENDFILE_LINK_MODE')"); - $db->exec("UPDATE config SET section = 'evaluation' WHERE field LIKE 'EVAL\_%'"); - $db->exec("UPDATE config SET section = 'archiv' WHERE field LIKE 'AUTO\_ARCHIV%'"); - - //adding descriptions - $db->exec("UPDATE config SET description = 'Schaltet ein oder aus, ob die Studiengruppen global verfügbar sind.' WHERE field = 'STUDYGROUPS_ENABLE'"); - $db->exec("UPDATE config SET description = 'Die Standardeinrichtung für Studiengruppen kann hier gesetzt werden.' WHERE field = 'STUDYGROUP_DEFAULT_INST'"); - $db->exec("UPDATE config SET description = 'Hier werden die globalen Einstellungen aller Studiengruppen hinterlegt.' WHERE field = 'STUDYGROUP_SETTINGS'"); - $db->exec("UPDATE config SET description = 'Hier werden die Nutzungsbedinungen der Studiengruppen hinterlegt.' WHERE field = 'STUDYGROUP_TERMS'"); - - //adding missing types, if not existing, use default "string" - $db->exec("UPDATE config SET type = 'string' WHERE type = ''"); - $db->exec("UPDATE config SET type = 'string' " - ."WHERE field LIKE 'ELEARNING\_INTERFACE%' " - ."AND field != 'ELEARNING_INTERFACE_ENABLE' " - ."AND field NOT LIKE '%ACTIVE' " - ."AND type = 'boolean'"); - } - - function down() - { - } -} diff --git a/db/migrations/64_step_00199_forced_course_grouping.php b/db/migrations/64_step_00199_forced_course_grouping.php deleted file mode 100644 index 4fad4ef..0000000 --- a/db/migrations/64_step_00199_forced_course_grouping.php +++ /dev/null @@ -1,40 +0,0 @@ - 'MY_COURSES_FORCE_GROUPING', - 'type' => 'string', - 'value' => 'sem_number', - 'description' => 'Legt fest, ob die persönliche Veranstaltungsübersicht systemweit zwangsgruppiert werden soll, wenn keine eigene Gruppierung eingestellt ist. Werte: not_grouped, sem_number, sem_tree_id, sem_status, gruppe, dozent_id.' - ] - ]; - - function description() - { - return 'add configuration entry for forced grouping of My courses for all users who haven\'t grouped for themselves'; - } - - function up() - { - $db = DBManager::get(); - $query = $db->prepare("INSERT IGNORE INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', '', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); - - // insert new configuration entries - foreach (self::$config_entries as $entry) { - $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); - } - } - - function down() - { - $db = DBManager::get(); - $query = $db->prepare("DELETE FROM `config` WHERE `config_id` = MD5(?)"); - - foreach (self::$config_entries as $entry) { - $query->execute([md5($entry['name'])]); - } - } -} -?> diff --git a/db/migrations/65_step_00198_deputies.php b/db/migrations/65_step_00198_deputies.php deleted file mode 100644 index 1cc9f16..0000000 --- a/db/migrations/65_step_00198_deputies.php +++ /dev/null @@ -1,62 +0,0 @@ - 'DEPUTIES_ENABLE', - 'type' => 'boolean', - 'value' => 0, - 'description' => 'Legt fest, ob die Funktion Vertretung aktiviert ist.' - ], - [ - 'name' => 'DEPUTIES_DEFAULTENTRY_ENABLE', - 'type' => 'boolean', - 'value' => 0, - 'description' => 'Dürfen Lehrende Standardvertretungen festlegen? Diese werden automatisch bei Hinzufügen der Lehrenden als Vertretung in Veranstaltungen eingetragen.' - ], - [ - 'name' => 'DEPUTIES_EDIT_ABOUT_ENABLE', - 'type' => 'boolean', - 'value' => 1, - 'description' => 'Dürfen Lehrende ihren Standardvertretungen erlauben, ihr Profil zu bearbeiten?' - ] - ]; - - function description() - { - return 'deputies'; - } - - function up() - { - $db = DBManager::get(); - - $query = $db->prepare("INSERT IGNORE INTO `config` ". - "(`config_id`, `parent_id`, `field`, `value`, `is_default`, ". - "`type`, `range`, `section`, `position`, `mkdate`, `chdate`, ". - "`description`, `comment`, `message_template`) - VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'deputies', '0', ". - "UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); - - // insert new configuration entries - foreach (self::$config_entries as $entry) { - $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); - } - - $db->exec("CREATE TABLE `deputies` ( ". - "`range_id` VARCHAR(32) NOT NULL, ". - "`user_id` VARCHAR(32) NOT NULL, ". - "`gruppe` TINYINT(4) NOT NULL DEFAULT 0, ". - "`notification` INT(10) NOT NULL DEFAULT 0, ". - "`edit_about` TINYINT(1) NOT NULL DEFAULT 0, ". - "PRIMARY KEY (`range_id`, `user_id`)) ENGINE=MyISAM"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("DROP TABLE `deputies`"); - } -} diff --git a/db/migrations/66_config_filesystem_multicopy_enable.php b/db/migrations/66_config_filesystem_multicopy_enable.php deleted file mode 100644 index e721fb5..0000000 --- a/db/migrations/66_config_filesystem_multicopy_enable.php +++ /dev/null @@ -1,34 +0,0 @@ - 'FILESYSTEM_MULTICOPY_ENABLE', - 'type' => 'boolean', - 'value' => 1, - 'section' => '', - 'description' => 'Soll es erlaubt sein, das Dozenten Ordner oder Dateien in mehrere Veranstaltungen bzw. Institute verschieben oder kopieren dürfen?' - ]; - - $stmt = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - function down() { - $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'FILESYSTEM_MULTICOPY_ENABLE'"); - } -} diff --git a/db/migrations/67_step_00204_no_document_deletion.php b/db/migrations/67_step_00204_no_document_deletion.php deleted file mode 100644 index 9648ce8..0000000 --- a/db/migrations/67_step_00204_no_document_deletion.php +++ /dev/null @@ -1,26 +0,0 @@ -exec("ALTER TABLE `dokumente` ADD `author_name` VARCHAR( 255 ) NOT NULL DEFAULT ''"); - $db->exec(" UPDATE dokumente - LEFT JOIN auth_user_md5 USING ( user_id ) - LEFT JOIN user_info USING ( user_id ) - SET author_name = TRIM( CONCAT( title_front, ' ', Vorname, ' ', Nachname, IF( title_rear != '', CONCAT( ', ', title_rear ) , '' ) ) )"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("ALTER TABLE `dokumente` DROP `author_name`"); - } -} -?> diff --git a/db/migrations/68_add_schedule_table.php b/db/migrations/68_add_schedule_table.php deleted file mode 100644 index b68efa9..0000000 --- a/db/migrations/68_add_schedule_table.php +++ /dev/null @@ -1,63 +0,0 @@ -exec(" - CREATE TABLE `schedule` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `start` smallint(6) NOT NULL COMMENT 'start hour and minutes', - `end` smallint(6) NOT NULL COMMENT 'end hour and minutes', - `day` tinyint(4) NOT NULL COMMENT 'day of week, 0-6', - `title` varchar(255) NOT NULL, - `content` varchar(255) NOT NULL, - `color` varchar(7) NOT NULL COMMENT 'color, rgb in hex', - `user_id` varchar(32) NOT NULL, - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`) - ) ENGINE=MyISAM; - "); - - DBManager::get()->exec(" - CREATE TABLE `schedule_seminare` ( - `user_id` VARCHAR( 32 ) NOT NULL , - `seminar_id` VARCHAR( 32 ) NOT NULL , - `metadate_id` VARCHAR( 32 ) NOT NULL , - `visible` BOOLEAN NOT NULL DEFAULT '1' , - `color` VARCHAR( 7 ) NULL COMMENT 'color, rgb in hex', - PRIMARY KEY ( `user_id` , `seminar_id`, `metadate_id` ) - ) ENGINE=MyISAM; - "); - - // move old "virtual" entries to new table - $db = DBManager::get()->query("SELECT sus.*, metadata_dates FROM seminar_user_schedule as sus - LEFT JOIN seminare as s ON (s.Seminar_id = sus.range_id) - WHERE s.Seminar_id IS NOT NULL"); - - $stmt = DBManager::get()->prepare("INSERT IGNORE INTO schedule_seminare - (user_id, seminar_id, metadate_id) VALUES(?, ?, ?)"); - - while ($data = $db->fetch()) { - $md = @unserialize($data['metadata_dates']); - if (is_array($md['turnus_data'])) { - foreach ($md['turnus_data'] as $cycle) { - $stmt->execute([$data['user_id'], $data['range_id'], $cycle['metadate_id']]); - } - } - } - - } - - function down () - { - DBManager::get()->query("DROP TABLE schedule"); - DBManager::get()->query("DROP TABLE schedule_seminare"); - } -} diff --git a/db/migrations/69_step_00202_enhanced_seminar_cycle.php b/db/migrations/69_step_00202_enhanced_seminar_cycle.php deleted file mode 100644 index 709b15f..0000000 --- a/db/migrations/69_step_00202_enhanced_seminar_cycle.php +++ /dev/null @@ -1,88 +0,0 @@ - 'ALLOW_METADATE_SORTING', - 'type' => 'boolean', - 'value' => 0, - 'section' => 'permissions', - 'description' => 'Soll es erlaubt sein, dass regelmäßige Zeiten einer Veranstaltung frei sortiert werden können?' - ]; - - $stmt = $db->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - - $db->exec("CREATE TABLE IF NOT EXISTS `seminar_cycle_dates` ( - `metadate_id` varchar(32) NOT NULL, - `seminar_id` varchar(32) NOT NULL, - `start_time` time NOT NULL, - `end_time` time NOT NULL, - `weekday` tinyint(3) unsigned NOT NULL, - `description` varchar(255) NOT NULL DEFAULT '', - `sws` decimal(2,1) NOT NULL DEFAULT '0.0', - `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', - `week_offset` tinyint(3) unsigned NOT NULL DEFAULT '0', - `sorter` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mkdate` int(10) unsigned NOT NULL, - `chdate` int(10) unsigned NOT NULL, - PRIMARY KEY (`metadate_id`), - KEY `seminar_id` (`seminar_id`) - ) ENGINE=MyISAM;"); - - $stmt = $db->prepare("INSERT INTO `seminar_cycle_dates` - (`metadate_id`, `seminar_id`, `start_time`, `end_time`, `weekday`, - `description`, `cycle`, `week_offset`, `mkdate`, `chdate`) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - foreach ($db->query("SELECT Seminar_id, metadata_dates, mkdate, chdate FROM seminare") as $row) { - $md = @unserialize($row['metadata_dates']); - if (is_array($md['turnus_data'])) { - foreach ($md['turnus_data'] as $c) { - if ($c['metadate_id']) { - $stmt->execute([$c['metadate_id'], - $row['Seminar_id'], - sprintf('%02s:%02s', (int)$c['start_stunde'], (int)$c['start_minute']), - sprintf('%02s:%02s', (int)$c['end_stunde'], (int)$c['end_minute']), - (int)$c['day'], - (string)$c['desc'], - (int)$md['turnus'], - (int)$md['start_woche'], - $row['mkdate'], - $row['chdate'] - ] - ); - } - } - } - } - //So Long, and Thanks for All the Fish - $db->exec("ALTER TABLE `seminare` DROP `metadata_dates`"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("DROP TABLE `seminar_cycle_dates`"); - $db->exec("ALTER TABLE `seminare` ADD `metadata_dates` TEXT NOT NULL DEFAULT ''"); - $db->exec("DELETE FROM config WHERE field LIKE 'ALLOW_METADATE_SORTING'"); - } -} -?> diff --git a/db/migrations/70_step_00184_html5_video.php b/db/migrations/70_step_00184_html5_video.php deleted file mode 100644 index a7ca83c..0000000 --- a/db/migrations/70_step_00184_html5_video.php +++ /dev/null @@ -1,120 +0,0 @@ - 'LOAD_EXTERNAL_MEDIA', - 'description' => 'Sollen externe Medien über [img/flash/audio/video] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=proxy benutzen.', - 'section' => '', - 'type' => 'string', - 'value' => 'deny' - ] - ]; - - /** - * old config options to remove - */ - private $options_old = [ - [ - 'name' => 'EXTERNAL_IMAGE_EMBEDDING', - 'description' => 'Sollen externe Bilder über [img] eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', - 'section' => '', - 'type' => 'string', - 'value' => 'deny' - ], [ - 'name' => 'EXTERNAL_FLASH_MOVIE_EMBEDDING', - 'description' => 'Sollen externe Flash-Filme mit Hilfe des [flash]-Tags der Schnellformatierung eingebunden werden? deny=nicht erlaubt, allow=erlaubt, proxy=image proxy benutzen', - 'section' => '', - 'type' => 'string', - 'value' => 'deny' - ] - ]; - - /** - * short description of this migration - */ - function description() - { - return 'add database table for generic media proxy'; - } - - /** - * insert list of options into config table - */ - function insertConfig($options) - { - $db = DBManager::get(); - $time = time(); - - $stmt = $db->prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - /** - * remove list of options from config table - */ - function deleteConfig($options) - { - $db = DBManager::get(); - - $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); - - foreach ($options as $option) { - $stmt->execute(['name' => $option['name']]); - } - } - - /** - * perform this migration - */ - function up() - { - $db = DBManager::get(); - - $db->exec("CREATE TABLE media_cache ( - id varchar(32) NOT NULL, - type varchar(64) NOT NULL, - chdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - expires timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (id)) ENGINE=MyISAM"); - - $db->exec("DROP TABLE image_proxy_cache"); - - $this->insertConfig($this->options_new); - $this->deleteConfig($this->options_old); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - - $db->exec("CREATE TABLE image_proxy_cache ( - id char(32) NOT NULL, - type char(10) NOT NULL, - length int(10) unsigned NOT NULL, - error char(15) NOT NULL, - chdate timestamp NOT NULL, - PRIMARY KEY (id), - KEY chdate (chdate, id)) ENGINE=MyISAM"); - - $db->exec("DROP TABLE media_cache"); - - $this->insertConfig($this->options_old); - $this->deleteConfig($this->options_new); - } -} diff --git a/db/migrations/71_step_00192_page_layout.php b/db/migrations/71_step_00192_page_layout.php deleted file mode 100644 index 6f105e2..0000000 --- a/db/migrations/71_step_00192_page_layout.php +++ /dev/null @@ -1,45 +0,0 @@ -exec("DELETE FROM config WHERE field = 'HTML_HEAD_TITLE'"); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - $time = time(); - - $stmt = $db->prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) - "); - - $stmt->execute([ - 'name' => 'HTML_HEAD_TITLE', - 'description' => 'Angezeigter Titel in der Kopfzeile des Browsers', - 'section' => 'global', - 'type' => 'string', - 'value' => 'Stud.IP' - ]); - } -} diff --git a/db/migrations/72_config_ajax_autocomplete_disabled.php b/db/migrations/72_config_ajax_autocomplete_disabled.php deleted file mode 100644 index a23fa92..0000000 --- a/db/migrations/72_config_ajax_autocomplete_disabled.php +++ /dev/null @@ -1,34 +0,0 @@ - 'AJAX_AUTOCOMPLETE_DISABLED', - 'type' => 'boolean', - 'value' => 0, - 'section' => '', - 'description' => 'Sollen alle QuickSearches deaktiviertes Autocomplete haben? Wenn es zu Performanceproblemen kommt, kann es sich lohnen, diese Variable auf true zu stellen.' - ]; - - $stmt = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - function down() { - $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'AJAX_AUTOCOMPLETE_DISABLED'"); - } -} diff --git a/db/migrations/73_step_00193_html_email.php b/db/migrations/73_step_00193_html_email.php deleted file mode 100644 index 77578ac..0000000 --- a/db/migrations/73_step_00193_html_email.php +++ /dev/null @@ -1,46 +0,0 @@ -prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description) - "); - - $stmt->execute([ - 'name' => 'MAIL_AS_HTML', - 'description' => 'Benachrichtigungen werden im HTML-Format versandt', - 'section' => '', - 'range' => 'user', - 'type' => 'boolean', - 'value' => 0 - ]); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - $db->exec("DELETE FROM config WHERE field = 'MAIL_AS_HTML'"); - } -} diff --git a/db/migrations/74_tic1422_pagination.php b/db/migrations/74_tic1422_pagination.php deleted file mode 100644 index c00ac9c..0000000 --- a/db/migrations/74_tic1422_pagination.php +++ /dev/null @@ -1,46 +0,0 @@ -prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description) - "); - - $stmt->execute([ - 'name' => 'ENTRIES_PER_PAGE', - 'description' => 'Anzahl von Einträgen pro Seite', - 'section' => 'global', - 'range' => 'global', - 'type' => 'integer', - 'value' => 20 - ]); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - $db->exec("DELETE FROM config WHERE field = 'ENTRIES_PER_PAGE'"); - } -} diff --git a/db/migrations/75_pdf_logo_configuration.php b/db/migrations/75_pdf_logo_configuration.php deleted file mode 100644 index 85e1d92..0000000 --- a/db/migrations/75_pdf_logo_configuration.php +++ /dev/null @@ -1,46 +0,0 @@ - 'PDF_LOGO', - 'type' => 'string', - 'value' => '', - 'section' => 'global', - 'description' => 'Geben Sie hier den absoluten Pfad auf Ihrem Server (also ohne http) zu einem Logo an, das bei PDF-Exporten im Kopfbereich verwendet wird.' - ]; - - $stmt = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'PDF_LOGO'"); - } -} diff --git a/db/migrations/76_termin_related_persons.php b/db/migrations/76_termin_related_persons.php deleted file mode 100644 index 8b113de..0000000 --- a/db/migrations/76_termin_related_persons.php +++ /dev/null @@ -1,36 +0,0 @@ -exec( - "CREATE TABLE IF NOT EXISTS `termin_related_persons` ( " . - "`range_id` varchar(32) NOT NULL, " . - "`user_id` varchar(32) NOT NULL, " . - "PRIMARY KEY (`range_id`,`user_id`) " . - ") ENGINE=MyISAM" - ); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - $db->exec("DROP TABLE `termin_related_persons` "); - } -} diff --git a/db/migrations/77_step_00223_lockrules.php b/db/migrations/77_step_00223_lockrules.php deleted file mode 100644 index 97bee5c..0000000 --- a/db/migrations/77_step_00223_lockrules.php +++ /dev/null @@ -1,28 +0,0 @@ -exec("ALTER TABLE `lock_rules` CHANGE `permission` `permission` ENUM( 'autor', 'tutor', 'dozent', 'admin', 'root' ) NOT NULL DEFAULT 'dozent'"); - $db->exec("ALTER TABLE `lock_rules` ADD `object_type` ENUM( 'sem', 'inst', 'user' ) NOT NULL DEFAULT 'sem'"); - $db->exec("ALTER TABLE `lock_rules` ADD `user_id` VARCHAR( 32 ) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE `user_info` ADD `lock_rule` VARCHAR( 32 ) NOT NULL DEFAULT ''"); - $db->exec("ALTER TABLE `Institute` ADD `lock_rule` VARCHAR( 32 ) NOT NULL DEFAULT ''"); - } - - public function down() - { - $db = DBManager::get(); - $db->exec("ALTER TABLE `lock_rules` CHANGE `permission` `permission` ENUM( 'tutor', 'dozent', 'admin', 'root' ) NOT NULL DEFAULT 'dozent'"); - $db->exec("ALTER TABLE `lock_rules` DROP `object_type`"); - $db->exec("ALTER TABLE `lock_rules` DROP `user_id`"); - $db->exec("ALTER TABLE `user_info` DROP `lock_rule`"); - $db->exec("ALTER TABLE `Institute` DROP `lock_rule`"); - } -} diff --git a/db/migrations/78_step00219_webservice_access.php b/db/migrations/78_step00219_webservice_access.php deleted file mode 100644 index e4d3f4b..0000000 --- a/db/migrations/78_step00219_webservice_access.php +++ /dev/null @@ -1,30 +0,0 @@ -exec("CREATE TABLE `webservice_access_rules` ( - `api_key` VARCHAR( 100 ) NOT NULL DEFAULT '', - `method` VARCHAR( 100 ) NOT NULL DEFAULT '', - `ip_range` VARCHAR( 200 ) NOT NULL DEFAULT '', - `type` ENUM( 'allow', 'deny' ) NOT NULL DEFAULT 'allow', - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY - ) ENGINE=MyISAM;"); - - if ($GLOBALS['STUDIP_API_KEY'] && $GLOBALS['WEBSERVICES_ENABLE']) { - $db->exec("INSERT INTO `webservice_access_rules` (`api_key`, `method`, `ip_range`, `type`) VALUES (".$db->quote($GLOBALS['STUDIP_API_KEY']).", '', '', 'allow')"); - } - } - - public function down() - { - $db = DBManager::get(); - $db->exec("DROP TABLE `webservice_access_rules` "); - } -} diff --git a/db/migrations/79_step_216_automatisiertes_eintragen.php b/db/migrations/79_step_216_automatisiertes_eintragen.php deleted file mode 100644 index 1e35718..0000000 --- a/db/migrations/79_step_216_automatisiertes_eintragen.php +++ /dev/null @@ -1,72 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `auto_insert_sem` ( - `seminar_id` char(32) NOT NULL, - `status` enum('autor','tutor','dozent') NOT NULL DEFAULT 'autor', - PRIMARY KEY (`seminar_id`,`status`) - ) ENGINE=MyISAM; - "); - - DBManager::get()->exec(" - CREATE TABLE IF NOT EXISTS `auto_insert_user` ( - `seminar_id` char(32) NOT NULL, - `user_id` char(32) NOT NULL, - `mkdate` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`seminar_id`,`user_id`) - ) ENGINE=MyISAM; - "); - - $options[] = - [ - 'name' => 'AUTO_INSERT_SEM_PARTICIPANTS_VIEW_PERM', - 'type' => 'string', - 'value' => 'tutor', - 'section' => 'global', - 'description' => 'Ab welchem Status soll in Veranstaltungen mit automatisch eingetragenen Nutzern der Teilnehmerreiter zu sehen sein?' - ]; - - $stmt = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - - if (is_array($GLOBALS['AUTO_INSERT_SEM'])) { - $stmt = DBManager::get()->prepare(" - INSERT INTO `auto_insert_sem` ( - `seminar_id` , `status` ) VALUES - (:seminar_id, 'autor') , - (:seminar_id, 'tutor') , - (:seminar_id, 'dozent') - "); - foreach ($GLOBALS['AUTO_INSERT_SEM'] as $seminar_id) { - $stmt->execute(['seminar_id' => $seminar_id]); - } - } - } - - function down () - { - DBManager::get()->exec("DROP TABLE auto_insert_sem"); - DBManager::get()->exec("DROP TABLE auto_insert_user"); - DBManager::get()->exec("DELETE FROM config WHERE field = 'AUTO_INSERT_SEM_PARTICIPANTS_VIEW_PERM'"); - } -} diff --git a/db/migrations/80_skiplinks_enable_configuration.php b/db/migrations/80_skiplinks_enable_configuration.php deleted file mode 100644 index 5d022e5..0000000 --- a/db/migrations/80_skiplinks_enable_configuration.php +++ /dev/null @@ -1,47 +0,0 @@ - 'SKIPLINKS_ENABLE', - 'type' => 'boolean', - 'value' => '', - 'range' => 'user', - 'section' => 'privacy', - 'description' => 'Wählen Sie diese Option, um Skiplinks beim ersten Drücken der Tab-Taste anzuzeigen (Systemdefault).' - ]; - - $stmt = DBManager::get()->prepare(" - INSERT IGNORE INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get()->exec("DELETE FROM config WHERE field = 'SKIPLINKS_ENABLE'"); - } -} diff --git a/db/migrations/81_step_209_teilnehmericon.php b/db/migrations/81_step_209_teilnehmericon.php deleted file mode 100644 index 13aa69b..0000000 --- a/db/migrations/81_step_209_teilnehmericon.php +++ /dev/null @@ -1,37 +0,0 @@ -exec("ALTER TABLE `object_user_visits` - CHANGE `type` `type` - ENUM( 'vote', 'documents', 'forum', 'literature', 'schedule', 'scm', - 'sem', 'wiki', 'news', 'eval', 'inst', 'ilias_connect', - 'elearning_interface', 'participants' ) NOT NULL DEFAULT 'vote'"); - - // copy timestamps from sem to participants to reduce red participant-icons - DBManager::get()->exec("INSERT INTO object_user_visits - (object_id, user_id, type, visitdate, last_visitdate) - (SELECT object_id, ouv.user_id, 'participants' as type, visitdate, last_visitdate - FROM object_user_visits AS ouv - LEFT JOIN seminar_user AS su ON (su.user_id = ouv.user_id AND su.Seminar_id = ouv.object_id) - WHERE type='sem' AND status IN ('tutor', 'dozent'))"); - } - - function down () - { - DBManager::get()->exec("DELETE FROM object_user_visits WHERE type = 'participants'"); - DBManager::get()->exec("ALTER TABLE `object_user_visits` - CHANGE `type` `type` - ENUM( 'vote', 'documents', 'forum', 'literature', 'schedule', 'scm', - 'sem', 'wiki', 'news', 'eval', 'inst', 'ilias_connect', - 'elearning_interface') NOT NULL DEFAULT 'vote'"); - } -} diff --git a/db/migrations/83_tic1992_privacydefaults.php b/db/migrations/83_tic1992_privacydefaults.php deleted file mode 100644 index 6cf7b0e..0000000 --- a/db/migrations/83_tic1992_privacydefaults.php +++ /dev/null @@ -1,71 +0,0 @@ - 'CHAT_VISIBILITY_DEFAULT', - 'type' => 'boolean', - 'value' => 1, - 'description' => 'Ist der private Chatraum sichtbar, falls der Nutzer nichts anderes eingestellt hat?' - ], - // E-Mail address visible per default? - [ - 'name' => 'EMAIL_VISIBILITY_DEFAULT', - 'type' => 'boolean', - 'value' => 1, - 'description' => 'Ist die eigene Emailadresse sichtbar, falls der Nutzer nichts anderes eingestellt hat?' - ], - // Private chat room visible per default? - [ - 'name' => 'ONLINE_VISIBILITY_DEFAULT', - 'type' => 'boolean', - 'value' => 1, - 'description' => 'Sind Nutzer sichtbar in der Wer ist online-Liste, falls sie nichts anderes eingestellt haben?' - ], - // Private chat room visible per default? - [ - 'name' => 'SEARCH_VISIBILITY_DEFAULT', - 'type' => 'boolean', - 'value' => 1, - 'description' => 'Sind Nutzer auffindbar in der Personensuche, falls sie nichts anderes eingestellt haben?' - ] - ]; - - function description() - { - return 'add default privacy settings'; - } - - function up() - { - $db = DBManager::get(); - $query = $db->prepare("INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); - - // insert new configuration entries - foreach (self::$config_entries as $entry) { - $query->execute([$entry['name'], $entry['name'], $entry['value'], $entry['type'], $entry['description']]); - } - - // remove old default entry with user id 'studip' - $db->exec("DELETE FROM `user_visibility` WHERE `user_id`='studip'"); - - } - - function down() - { - $db = DBManager::get(); - $query = $db->prepare("DELETE FROM `config` WHERE `field` = ?"); - - foreach (self::$config_entries as $entry) { - $query->execute([$entry['name']]); - } - - // insert default values - $db->exec("INSERT INTO `user_visibility` VALUES ('studip', 1, 1, 1, 1, '', 0, ".time().")"); - - } -} -?> diff --git a/db/migrations/84_step_226_dozenten_labels.php b/db/migrations/84_step_226_dozenten_labels.php deleted file mode 100644 index aec6389..0000000 --- a/db/migrations/84_step_226_dozenten_labels.php +++ /dev/null @@ -1,41 +0,0 @@ -exec( - "ALTER TABLE seminar_user " . - "ADD COLUMN label VARCHAR(128) NOT NULL DEFAULT ''" . - ""); - - $name = "PROPOSED_TEACHER_LABELS"; - $time = time(); - $description = "Write a list of comma separated possible labels for teachers and tutor here."; - $db->exec( - "INSERT IGNORE INTO config " . - "(config_id, field, value, is_default, type, mkdate, chdate, description, section) " . - "VALUES " . - "(MD5(".$db->quote($name)."), ".$db->quote($name).", '', 1, 'string', $time, $time, ".$db->quote($description).", 'global') " . - ""); - } - - function down () - { - $db = DBManager::get(); - $db->exec( - "ALTER TABLE seminar_user " . - "DROP COLUMN label " . - ""); - $db->exec( - "DELETE FROM config " . - "WHERE field = 'PROPOSED_TEACHER_LABELS' " . - ""); - } -} diff --git a/db/migrations/85_tic2007_schedule_enable.php b/db/migrations/85_tic2007_schedule_enable.php deleted file mode 100644 index 7654be3..0000000 --- a/db/migrations/85_tic2007_schedule_enable.php +++ /dev/null @@ -1,46 +0,0 @@ -prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description) - "); - - $stmt->execute([ - 'name' => 'SCHEDULE_ENABLE', - 'description' => 'Schaltet ein oder aus, ob der Stundenplan global verfügbar ist.', - 'section' => 'modules', - 'range' => 'global', - 'type' => 'boolean', - 'value' => '1' - ]); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - $db->exec("DELETE FROM config WHERE field = 'SCHEDULE_ENABLE'"); - } -} \ No newline at end of file diff --git a/db/migrations/86_step_228_raumanfragen.php b/db/migrations/86_step_228_raumanfragen.php deleted file mode 100644 index 1acac28..0000000 --- a/db/migrations/86_step_228_raumanfragen.php +++ /dev/null @@ -1,27 +0,0 @@ -exec( - "ALTER TABLE `resources_requests` ADD `metadate_id` VARCHAR(32) NOT NULL DEFAULT '' AFTER `termin_id`"); - $db->exec( - "ALTER TABLE `resources_requests` DROP INDEX `closed` , ADD INDEX `closed` (`closed` , `request_id`, `resource_id`)"); - $db->exec( - "ALTER TABLE `resources_requests` ADD INDEX (`metadate_id`)"); - } - - public function down() - { - $db = DBManager::get(); - $db->exec( - "ALTER TABLE `resources_requests` " . - "DROP COLUMN `metadate_id`"); - } -} diff --git a/db/migrations/87_tic1091_chat.php b/db/migrations/87_tic1091_chat.php deleted file mode 100644 index 629433b..0000000 --- a/db/migrations/87_tic1091_chat.php +++ /dev/null @@ -1,19 +0,0 @@ -exec("DELETE FROM `user_config` WHERE `field` = 'CHAT_USE_AJAX_CLIENT'"); - } - - function down () - { - } -} \ No newline at end of file diff --git a/db/migrations/88_biest2055_terms.php b/db/migrations/88_biest2055_terms.php deleted file mode 100644 index 713cc59..0000000 --- a/db/migrations/88_biest2055_terms.php +++ /dev/null @@ -1,23 +0,0 @@ -exec($sql); - } - - function down () - { - $sql = 'DELETE FROM `user_config` WHERE `field` = "TERMS_ACCEPTED"'; - DBManager::get()->exec($sql); - } -} \ No newline at end of file diff --git a/db/migrations/89_step_00205_group_calendar.php b/db/migrations/89_step_00205_group_calendar.php deleted file mode 100644 index 919f110..0000000 --- a/db/migrations/89_step_00205_group_calendar.php +++ /dev/null @@ -1,103 +0,0 @@ - 'CALENDAR_GROUP_ENABLE', - 'description' => 'Schaltet die Gruppenterminkalender-Funktionen ein.', - 'section' => 'modules', - 'type' => 'boolean', - 'value' => '0' - ], - [ - 'name' => 'COURSE_CALENDAR_ENABLE', - 'description' => 'Kalender als Inhaltselement in Veranstaltungen.', - 'section' => 'modules', - 'type' => 'boolean', - 'value' => '0' - ] - ]; - - /** - * short description of this migration - */ - function description() - { - return 'extends the calendar by group calendar functions'; - } - - /** - * insert list of options into config table - */ - function insertConfig($options) - { - $db = DBManager::get(); - $time = time(); - - $stmt = $db->prepare(" - INSERT INTO config - (config_id, field, value, is_default, type, section, mkdate, chdate, description) - VALUES - (MD5(:name), :name, :value, 1, :type, :section, $time, $time, :description) - "); - - foreach ($options as $option) { - $stmt->execute($option); - } - } - - /** - * remove list of options from config table - */ - function deleteConfig($options) - { - $db = DBManager::get(); - - $stmt = $db->prepare("DELETE FROM config WHERE field = :name"); - - foreach ($options as $option) { - $stmt->execute(['name' => $option['name']]); - } - } - - /** - * perform this migration - */ - function up() - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE `seminar_user` ADD `bind_calendar` TINYINT( 1 ) NOT NULL DEFAULT '1'"); - $db->exec("ALTER TABLE `calendar_events` ADD `editor_id` VARCHAR( 32 ) NOT NULL AFTER `autor_id`"); - $db->exec("ALTER TABLE `calendar_events` ADD `importdate` INT( 11 ) NOT NULL DEFAULT '0'"); - $db->exec("ALTER TABLE `contact` ADD `calpermission` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '1'"); - $db->exec("ALTER TABLE `statusgruppen` ADD `calendar_group` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0'"); - $db->exec("CREATE TABLE IF NOT EXISTS `calendar_sync` ( - `range_id` varchar(32) NOT NULL default '', - `client_identifier` varchar(255) NOT NULL default '', - `last_sync` int(11) NOT NULL default '0', - PRIMARY KEY (`range_id`,`client_identifier`) - ) ENGINE=MyISAM"); - $this->insertConfig($this->options_new); - } - - /** - * revert this migration - */ - function down() - { - $db = DBManager::get(); - - $db->exec("ALTER TABLE `seminar_user` DROP `bind_calendar`"); - $db->exec("ALTER TABLE `calendar_events` DROP `editor_id`"); - $db->exec("ALTER TABLE `calendar_events` DROP `importdate`"); - $db->exec("ALTER TABLE `contact` DROP `calpermission`"); - $db->exec("ALTER TABLE `statusgruppen` DROP `calendar_group`"); - $db->exec("DROP TABLE `calendar_sync`"); - $this->deleteConfig($this->options_new); - } -} diff --git a/db/migrations/90_tic2395_smileys.php b/db/migrations/90_tic2395_smileys.php deleted file mode 100644 index 8d96117..0000000 --- a/db/migrations/90_tic2395_smileys.php +++ /dev/null @@ -1,28 +0,0 @@ -exec("ALTER TABLE `user_info` DROP COLUMN `smiley_favorite_publish`"); - } - - /** - * revert this migration - */ - function down() - { - DBManager::get()->exec("ALTER TABLE `user_info` ADD COLUMN `smiley_favorite_publish` VARCHAR(255) NOT NULL DEFAULT ''"); - } -} diff --git a/db/migrations/91_tic2568_comment_internal.php b/db/migrations/91_tic2568_comment_internal.php deleted file mode 100644 index a46fb69..0000000 --- a/db/migrations/91_tic2568_comment_internal.php +++ /dev/null @@ -1,28 +0,0 @@ -exec("ALTER TABLE `resources_assign` ADD `comment_internal` TEXT NULL DEFAULT NULL"); - } - - /** - * revert this migration - */ - function down() - { - DBManager::get()->exec("ALTER TABLE `resources_assign` DROP COLUMN `comment_internal`"); - } -} diff --git a/db/migrations/92_remove_schedule_user_table.php b/db/migrations/92_remove_schedule_user_table.php deleted file mode 100644 index c4e341e..0000000 --- a/db/migrations/92_remove_schedule_user_table.php +++ /dev/null @@ -1,15 +0,0 @@ -exec("DROP TABLE IF EXISTS seminar_user_schedule"); - } -} diff --git a/db/migrations/93_sem_classes_convert_into_db.php b/db/migrations/93_sem_classes_convert_into_db.php deleted file mode 100644 index f31504a..0000000 --- a/db/migrations/93_sem_classes_convert_into_db.php +++ /dev/null @@ -1,286 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `sem_classes` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(64) NOT NULL, - `compact_mode` tinyint(4) NOT NULL, - `workgroup_mode` tinyint(4) NOT NULL, - `only_inst_user` tinyint(4) NOT NULL, - `turnus_default` int(11) NOT NULL, - `default_read_level` int(11) NOT NULL, - `default_write_level` int(11) NOT NULL, - `bereiche` tinyint(4) NOT NULL, - `show_browse` tinyint(4) NOT NULL, - `write_access_nobody` tinyint(4) NOT NULL, - `topic_create_autor` tinyint(4) NOT NULL, - `visible` tinyint(4) NOT NULL, - `course_creation_forbidden` tinyint(4) NOT NULL, - `overview` varchar(64) DEFAULT NULL, - `forum` varchar(64) DEFAULT NULL, - `admin` varchar(64) DEFAULT NULL, - `documents` varchar(64) DEFAULT NULL, - `schedule` varchar(64) DEFAULT NULL, - `participants` varchar(64) DEFAULT NULL, - `literature` varchar(64) DEFAULT NULL, - `scm` varchar(64) DEFAULT NULL, - `wiki` varchar(64) DEFAULT NULL, - `resources` varchar(64) DEFAULT NULL, - `calendar` varchar(64) DEFAULT NULL, - `elearning_interface` varchar(64) DEFAULT NULL, - `modules` text NOT NULL, - `description` text NOT NULL, - `create_description` text NOT NULL, - `studygroup_mode` tinyint(4) NOT NULL, - `admission_prelim_default` tinyint(4) NOT NULL DEFAULT 0, - `admission_type_default` tinyint(4) NOT NULL DEFAULT 0, - `title_dozent` VARCHAR(64) NULL, - `title_dozent_plural` VARCHAR(64) NULL, - `title_tutor` VARCHAR(64) NULL, - `title_tutor_plural` VARCHAR(64) NULL, - `title_autor` VARCHAR(64) NULL, - `title_autor_plural` VARCHAR(64) NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) - ) ENGINE=MyISAM - "); - $db->exec(" - CREATE TABLE IF NOT EXISTS `sem_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(64) NOT NULL, - `class` int(11) NOT NULL, - `mkdate` bigint(20) NOT NULL, - `chdate` bigint(20) NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=MyISAM - "); - - $statement = $db->prepare( - "INSERT IGNORE INTO sem_classes " . - "SET id = :id, " . - "name = :name, " . - "compact_mode = :compact_mode, " . - "workgroup_mode = :workgroup_mode, " . - "only_inst_user = :only_inst_user, " . - "turnus_default = :turnus_default, " . - "default_read_level = :default_read_level, " . - "default_write_level = :default_write_level, " . - "bereiche = :bereiche, " . - "show_browse = :show_browse, " . - "write_access_nobody = :write_access_nobody, " . - "topic_create_autor = :topic_create_autor, " . - "visible = :visible, " . - "course_creation_forbidden = :course_creation_forbidden, " . - "studygroup_mode = :studygroup_mode, " . - "admission_prelim_default = :admission_prelim_default, " . - "admission_type_default = :admission_type_default, " . - "overview = :overview, " . - "admin = :admin, " . - "forum = :forum, " . - "documents = :documents, " . - "schedule = :schedule, " . - "participants = :participants, " . - "literature = :literature, " . - "scm = :scm, " . - "calendar = :calendar, " . - "wiki = :wiki, " . - "resources = :resources, " . - "elearning_interface = :elearning_interface, " . - "modules = :modules, " . - "description = :description, " . - "create_description = :create_description, " . - "title_dozent = :title_dozent, " . - "title_dozent_plural = :title_dozent_plural, " . - "title_tutor = :title_tutor, " . - "title_tutor_plural = :title_tutor_plural, " . - "title_autor = :title_autor, " . - "title_autor_plural = :title_autor_plural, " . - "mkdate = UNIX_TIMESTAMP(), " . - "chdate = UNIX_TIMESTAMP() " . - ""); - - $SEM_CLASS = $GLOBALS['SEM_CLASS_OLD_VAR']; - $SEM_TYPE = $GLOBALS['SEM_TYPE_OLD_VAR']; - - if (!(is_array($SEM_CLASS) && count($SEM_CLASS))) { - throw new Exception('Migration 93 kann nicht durchgeführt werden, - da die vorhandenen Einstellungen für $SEM_CLASS und $SEM_TYPE - nicht aus der Datei config.inc.php ausgelesen werden können. Entfernen - Sie diese Einstellungen erst, nachdem diese Migration durchgeführt wurde!'); - } - - $slots = [ - 'forum' => ['module' => 'CoreForum'], - 'documents' => ['module' => 'CoreDocuments'], - 'schedule' => ['module' => 'CoreSchedule'], - 'participants' => ['module' => 'CoreParticipants'], - 'scm' => ['module' => 'CoreScm', 'config' => 'SCM_ENABLE'], - 'literature' => ['module' => 'CoreLiterature', 'config' => 'LITERATURE_ENABLE'], - 'wiki' => ['module' => 'CoreWiki', 'config' => 'WIKI_ENABLE'], - 'resources' => ['module' => 'CoreResources', 'config' => 'RESOURCES_ENABLE'], - 'calendar' => ['module' => 'CoreCalendar', 'config' => 'COURSE_CALENDAR_ENABLE'], - 'elearning_interface' => ['module' => 'CoreElearningInterface', 'config' => 'ELEARNING_INTERFACE_ENABLE'] - ]; - - $studygroup_settings = $this->getStudygroupSettings(); - - foreach ($SEM_CLASS as $id => $sem_class) { - $modules = $settings = []; - $modules['overview'] = 'CoreOverview'; - $settings['CoreOverview'] = ['activated' => 1, 'sticky' => 1]; - - if ($sem_class['studygroup_mode']) { - $modules['admin'] = 'CoreStudygroupAdmin'; - $settings['CoreStudygroupAdmin'] = ['activated' => 1, 'sticky' => 1]; - $modules['participants'] = 'CoreStudygroupParticipants'; - $settings['CoreStudygroupParticipants'] = ['activated' => 1, 'sticky' => 1]; - - foreach ($studygroup_settings as $slot => $activated) { - if (isset($slots[$slot])) { - $core_module_name = $slots[$slot]['module']; - $core_module_config = $slots[$slot]['config']; - - if ($activated && (!isset($core_module_config) || $GLOBALS[$core_module_config])) { - $modules[$slot] = $core_module_name; - $settings[$core_module_name] = [ - 'activated' => 0, - 'sticky' => 0 - ]; - } - } else if ($slot !== 'chat') { - $settings[$slot] = [ - 'activated' => 0, - 'sticky' => $activated ? 0 : 1 - ]; - } - } - } else { - $modules['admin'] = 'CoreAdmin'; - $settings['CoreAdmin'] = ['activated' => 1, 'sticky' => 1]; - - foreach ($slots as $slot => $core_module) { - $core_module_name = $core_module['module']; - $core_module_config = $core_module['config']; - - if (!isset($core_module_config) || $GLOBALS[$core_module_config]) { - $modules[$slot] = $core_module_name; - $settings[$core_module_name] = [ - 'activated' => $sem_class[$slot] ? 1 : 0, - 'sticky' => 0 - ]; - } - } - } - - $title_dozent = $title_tutor = $title_autor = null; - $title_dozent_plural = $title_tutor_plural = $title_autor_plural = null; - foreach ($SEM_TYPE as $sem_type_id => $sem_type) { - if ($sem_type['class'] == $id) { - $title_dozent || list($title_dozent, $title_dozent_plural) = $sem_type['title_dozent']; - $title_tutor || list($title_tutor, $title_tutor_plural) = $sem_type['title_tutor']; - $title_autor || list($title_autor, $title_autor_plural) = $sem_type['title_autor']; - } - } - - $success = $statement->execute([ - 'id' => $id, - 'name' => $sem_class['name'], - 'compact_mode' => $sem_class['compact_mode'], - 'workgroup_mode' => $sem_class['workgroup_mode'], - 'only_inst_user' => $sem_class['only_inst_user'], - 'turnus_default' => $sem_class['turnus_default'], - 'default_read_level' => $sem_class['default_read_level'], - 'default_write_level' => $sem_class['default_write_level'], - 'bereiche' => $sem_class['bereiche'], - 'show_browse' => $sem_class['show_browse'], - 'write_access_nobody' => $sem_class['write_access_nobody'], - 'topic_create_autor' => $sem_class['topic_create_autor'], - 'visible' => $sem_class['visible'], - 'course_creation_forbidden' => $sem_class['course_creation_forbidden'], - 'overview' => $modules['overview'], - 'admin' => $modules['admin'], - 'forum' => $modules['forum'], - 'documents' => $modules['documents'], - 'schedule' => $modules['schedule'], - 'participants' => $modules['participants'], - 'literature' => $modules['literature'], - 'scm' => $modules['scm'], - 'wiki' => $modules['wiki'], - 'resources' => $modules['resources'], - 'calendar' => $modules['calendar'], - 'elearning_interface' => $modules['elearning_interface'], - 'modules' => json_encode($settings), - 'description' => $sem_class['description'], - 'create_description' => $sem_class['create_description'], - 'studygroup_mode' => $sem_class['studygroup_mode'], - 'admission_prelim_default' => (int)$sem_class['admission_prelim_default'], - 'admission_type_default' => (int)$sem_class['admission_type_default'], - 'title_dozent' => $title_dozent ? $title_dozent : null, - 'title_dozent_plural' => $title_dozent_plural ? $title_dozent_plural : null, - 'title_tutor' => $title_tutor ? $title_tutor : null, - 'title_tutor_plural' => $title_tutor_plural ? $title_tutor_plural : null, - 'title_autor' => $title_autor ? $title_autor : null, - 'title_autor_plural' => $title_autor_plural ? $title_autor_plural : null - ]); - } - - $statement = $db->prepare( - "INSERT IGNORE INTO `sem_types` " . - "SET id = :id, " . - "name = :name, " . - "class = :class, " . - "chdate = UNIX_TIMESTAMP(), " . - "mkdate = UNIX_TIMESTAMP()" - ); - foreach ($SEM_TYPE as $id => $sem_type) { - $success = $statement->execute([ - 'id' => $id, - 'name' => $sem_type['name'], - 'class' => $sem_type['class'] - ]); - } - - $statement = $db->prepare("DELETE FROM config WHERE field = 'STUDYGROUP_SETTINGS'"); - $statement->execute(); - } - - protected function getStudygroupSettings() { - $studygroup_settings = []; - foreach (words($GLOBALS['STUDYGROUP_SETTINGS']) as $key => $value) { - $value = explode(':', $value); - if ($value[0] != 'participants') { - $studygroup_settings[$value[0]] = $value[1]; - } - } - return $studygroup_settings; - } - - /** - * revert this migration - */ - function down() - { - DBManager::get()->exec("DROP TABLE `sem_classes` "); - DBManager::get()->exec("DROP TABLE `sem_types` "); - } - -} \ No newline at end of file diff --git a/db/migrations/94_step237_datafields_mandatory.php b/db/migrations/94_step237_datafields_mandatory.php deleted file mode 100644 index 80c350f..0000000 --- a/db/migrations/94_step237_datafields_mandatory.php +++ /dev/null @@ -1,28 +0,0 @@ -exec("ALTER TABLE `datafields` ADD `is_required` TINYINT NOT NULL DEFAULT '0', ADD `description` TEXT NOT NULL DEFAULT ''"); - } - - /** - * revert this migration - */ - function down() - { - DBManager::get()->exec("ALTER TABLE `datafields` DROP `is_required`, DROP `description`;"); - } -} diff --git a/db/migrations/95_extend_userstudiengang_primarykey.php b/db/migrations/95_extend_userstudiengang_primarykey.php deleted file mode 100644 index 6552331..0000000 --- a/db/migrations/95_extend_userstudiengang_primarykey.php +++ /dev/null @@ -1,34 +0,0 @@ -exec($query); - } - - /** - * revert this migration - */ - function down() - { - $query = "ALTER TABLE `user_studiengang` - DROP PRIMARY KEY, - ADD PRIMARY KEY (`user_id`, `studiengang_id`)"; - DBManager::get()->exec($query); - } -} diff --git a/db/migrations/96_step00234_homepageplugin_activation.php b/db/migrations/96_step00234_homepageplugin_activation.php deleted file mode 100644 index 33a9e5a..0000000 --- a/db/migrations/96_step00234_homepageplugin_activation.php +++ /dev/null @@ -1,38 +0,0 @@ -prepare("INSERT INTO `config` (`config_id`, `parent_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `position`, `mkdate`, `chdate`, `description`, `comment`, `message_template`) VALUES (MD5(?), '', ?, ?, '1', ?, 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, '', '')"); - - $query->execute(['HOMEPAGEPLUGIN_DEFAULT_ACTIVATION', 'HOMEPAGEPLUGIN_DEFAULT_ACTIVATION', 1, 'boolean', 'Sollen neu installierte Homepageplugins automatisch für Benutzer aktiviert sein?']); - - } - - function down() - { - $db = DBManager::get(); - /* - * Removes global configuration value for default homepage plugin - * activation status. - */ - $query = $db->prepare("DELETE FROM `config` WHERE `field` = ?"); - - $query->execute(['HOMEPAGEPLUGIN_DEFAULT_ACTIVATION']); - - } -} -?> diff --git a/db/migrations/97_init_personal_notifications.php b/db/migrations/97_init_personal_notifications.php deleted file mode 100644 index 251fd42..0000000 --- a/db/migrations/97_init_personal_notifications.php +++ /dev/null @@ -1,51 +0,0 @@ -exec(" - CREATE TABLE IF NOT EXISTS `personal_notifications` ( - `personal_notification_id` int(11) NOT NULL AUTO_INCREMENT, - `url` varchar(512) NOT NULL DEFAULT '', - `text` text NOT NULL, - `avatar` varchar(256) NOT NULL DEFAULT '', - `html_id` varchar(64) NOT NULL DEFAULT '', - `mkdate` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`personal_notification_id`) - ) ENGINE=MyISAM;"); - $db->exec(" - CREATE TABLE IF NOT EXISTS `personal_notifications_user` ( - `personal_notification_id` int(10) unsigned NOT NULL, - `user_id` binary(32) NOT NULL, - `seen` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`personal_notification_id`,`user_id`), - KEY `user_id` (`user_id`,`seen`) - ) ENGINE=MyISAM"); - - $db->exec(" - INSERT IGNORE INTO `config` - (`config_id`, `parent_id`, `field`, `value`, `is_default`, - `type`, `range`, `section`, `position`, `mkdate`, `chdate`, - `description`, `comment`, `message_template`) - VALUES - (MD5('PERSONAL_NOTIFICATIONS_ACTIVATED'), '', 'PERSONAL_NOTIFICATIONS_ACTIVATED', 1, '1', 'boolean', 'global', 'privacy', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 'Sollen persönliche Benachrichtigungen aktiviert sein?', '', '') - "); - } - - function down() - { - $db = DBManager::get(); - $db->exec("DROP TABLE IF EXISTS `personal_notifications` "); - $db->exec("DROP TABLE IF EXISTS `personal_notifications_user` "); - - $db->exec("DELETE FROM `config` WHERE `field` = 'PERSONAL_NOTIFICATIONS_ACTIVATED'"); - } -} diff --git a/db/migrations/98_user_data_to_config.php b/db/migrations/98_user_data_to_config.php deleted file mode 100644 index 687c229..0000000 --- a/db/migrations/98_user_data_to_config.php +++ /dev/null @@ -1,201 +0,0 @@ -new_configs = [ - 'calendar_user_control_data' => ['name'=>'CALENDAR_SETTINGS', - 'range'=>'user', - 'type'=>'array', - 'description'=>'persönliche Einstellungen des Kalenders', - 'value'=> json_encode( - [ - "view" => "showweek", - "start" => 9, - "end" => 20, - "step_day" => 900, - "step_week" => 3600, - "type_week" => "LONG", - "holidays" => TRUE, - "sem_data" => TRUE, - "delete" => 0 - ]) - ], - - 'my_messaging_settings' => ['name'=>'MESSAGING_SETTINGS', - 'range'=>'user', - 'type'=>'array', - 'description'=>'persönliche Einstellungen Nachrichtenbereich', - 'value'=> json_encode( - [ - "show_only_buddys" => FALSE, - "delete_messages_after_logout" => FALSE, - "timefilter" => '30d', - "opennew" => 1, - "logout_markreaded" => FALSE, - "openall" => FALSE, - "addsignature" => FALSE, - "save_snd" => TRUE, - "sms_sig" => '', - "send_view" => FALSE, - "confirm_reading" => 3, - "send_as_email" => FALSE, - "folder" => ['in' => ['dummy'], 'out' => ['dummy']] - ]) - ], - 'forum' => ['name'=>'FORUM_SETTINGS', - 'range'=>'user', - 'type'=>'array', - 'description'=>'persönliche Einstellungen Forum', - 'value'=> json_encode( - [ - 'neuauf' => false, - 'rateallopen' => true, - 'showimages' => true, - 'sortthemes' => 'last', - 'themeview' => 'mixed', - 'presetview' => 'mixed', - 'shrink' => 7 * 24 * 60 * 60, // = 1 Woche - ]) - ], - - 'my_schedule_settings' => ['name'=>'SCHEDULE_SETTINGS', - 'range'=>'user', - 'type'=>'array', - 'description'=>'persönliche Einstellungen Stundenplan', - 'value'=> json_encode( - [ - "glb_start_time"=> 8, - "glb_end_time" => 19, - "glb_days" => [ 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 0 => 0, ], - "glb_sem" => null, - "converted" => true]) - ], - - 'homepage_cache_own' => ['name'=>'PROFILE_LAST_VISIT', - 'range'=>'user', - 'type'=>'integer', - 'description'=>'Zeitstempel des letzten Besuchs der Profilseite', - 'value'=> 0], - 'CurrentLogin' => ['name'=>'CURRENT_LOGIN_TIMESTAMP', - 'range'=>'user', - 'type'=>'integer', - 'description'=>'Zeitstempel des Logins', - 'value'=> 0], - 'LastLogin' => ['name'=>'LAST_LOGIN_TIMESTAMP', - 'range'=>'user', - 'type'=>'integer', - 'description'=>'Zeitstempel des vorherigen Logins', - 'value'=> 0], - 'my_studip_settings' => ['name' =>'PERSONAL_STARTPAGE', - 'range' => 'user', - 'type' => 'integer', - 'description' => 'Persönliche Startseite', - 'value'=> 0], - '_my_sem_group_field' => ['name' =>'MY_COURSES_GROUPING', - 'range' => 'user', - 'type' => 'string', - 'description' => 'Gruppierung der Veranstaltungsübersicht', - 'value'=> ''], - '_my_sem_open' => ['name' =>'MY_COURSES_OPEN_GROUPS', - 'range' => 'user', - 'type' => 'array', - 'description' => 'geöffnete Gruppen der Veranstaltungsübersicht', - 'value'=> '[]'], - '_my_admin_inst_id' => ['name' =>'MY_INSTITUTES_DEFAULT', - 'range' => 'user', - 'type' => 'string', - 'description' => 'Standard Einrichtung in der Veranstaltungsübersicht für Admins', - 'value'=> ''], - ]; - } - function description() - { - return 'migrates user forum settings from user_data table to user_config table; adds array type to config table'; - } - - function up() - { - DBManager::get()->exec("ALTER TABLE `config` MODIFY `type` enum('boolean','integer','string','array') NOT NULL DEFAULT 'boolean'"); - DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `user_online` ( - `user_id` char(32) NOT NULL, - `last_lifesign` int(10) unsigned NOT NULL, - PRIMARY KEY (`user_id`), - KEY `last_lifesign` (`last_lifesign`) - ) ENGINE=MyISAM"); - DBManager::get()->exec("INSERT INTO user_online (user_id,last_lifesign) SELECT sid,UNIX_TIMESTAMP(changed) FROM user_data INNER JOIN auth_user_md5 ON sid = user_id"); - - $stmt = DBManager::get()->prepare(" - REPLACE INTO config - (config_id, field, value, is_default, `type`, `range`, mkdate, chdate, description, comment) - VALUES - (MD5(:name), :name, :value, 1, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description, '') - "); - - foreach ($this->new_configs as $values) { - $stmt->execute($values); - } - $check = DBManager::get()->prepare("DELETE FROM user_config WHERE field=? AND user_id=?"); - $stmt = DBManager::get()->prepare(" - REPLACE INTO user_config (userconfig_id, user_id, field, value, mkdate, chdate, comment) - VALUES (?,?,?,?,UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),'')"); - - //for all users: - $db = DBManager::get()->query("SELECT sid,val FROM user_data INNER JOIN auth_user_md5 ON sid = user_id"); - while ($rs = $db->fetch(PDO::FETCH_ASSOC)) { - $user_id = $rs['sid']; - $vars = @unserialize($rs['val']); - if (is_array($vars)) { - foreach(['my_messaging_settings','forum','my_schedule_settings','calendar_user_control_data'] as $key) { - $option = $this->new_configs[$key]; - $defaults = json_decode($option['value'], true); - if (is_array($vars[$key])) { - $old_values = array_intersect_key((array)$vars[$key], $defaults); - $new_values = array_merge($defaults, $old_values); - $check->execute([$option['name'], $user_id]); - $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], json_encode($new_values)]); - } - } - foreach(['homepage_cache_own','CurrentLogin','LastLogin','_my_sem_group_field','_my_admin_inst_id'] as $key) { - $option = $this->new_configs[$key]; - if (isset($vars[$key])) { - $check->execute([$option['name'], $user_id]); - $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], (string)$vars[$key]]); - } - } - if (isset($vars['my_studip_settings']['startpage_redirect'])) { - $option = $this->new_configs['my_studip_settings']; - $check->execute([$option['name'], $user_id]); - $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], (int)$vars['my_studip_settings']['startpage_redirect']]); - } - if (isset($vars['_my_sem_open'])) { - $option = $this->new_configs['_my_sem_open']; - $check->execute([$option['name'], $user_id]); - $stmt->execute([md5($option['name'].$user_id), $user_id, $option['name'], json_encode($vars['_my_sem_open'])]); - } - } - } - DBManager::get()->exec("DROP TABLE `user_data`"); - } - - function down() - { - $db = DBManager::get(); - $db->exec("ALTER TABLE `config` MODIFY `type` enum('boolean','integer','string') NOT NULL DEFAULT 'boolean'"); - $db->exec("DROP TABLE IF EXISTS `user_online`"); - $db->exec("CREATE TABLE IF NOT EXISTS `user_data` ( - `sid` varchar(32) NOT NULL DEFAULT '', - `val` mediumtext NOT NULL, - `changed` timestamp NOT NULL, - PRIMARY KEY (`sid`), - KEY `changed` (`changed`) - ) ENGINE=MyISAM"); - foreach ($this->new_configs as $config) { - $db->exec("DELETE FROM config WHERE field = " . $db->quote($config['name'])); - $db->exec("DELETE FROM user_config WHERE field = " . $db->quote($config['name'])); - } - } -} diff --git a/db/migrations/99_step00245_simpleormap.php b/db/migrations/99_step00245_simpleormap.php deleted file mode 100644 index 508b528..0000000 --- a/db/migrations/99_step00245_simpleormap.php +++ /dev/null @@ -1,13 +0,0 @@ -get() < 224) { + if ($version->get(1) < 224) { // db cache is not yet available, use StudipMemoryCache return 'StudipMemoryCache'; } diff --git a/lib/migrations/DBSchemaVersion.php b/lib/migrations/DBSchemaVersion.php index 207a804..8217ec0 100644 --- a/lib/migrations/DBSchemaVersion.php +++ b/lib/migrations/DBSchemaVersion.php @@ -93,7 +93,8 @@ class DBSchemaVersion implements SchemaVersion private function initSchemaInfo() { if (!$this->branchSupported()) { - $query = "SELECT 0, version FROM schema_version WHERE domain = ?"; + $branch = $this->domain === 'studip' ? 1 : 0; + $query = "SELECT $branch, version FROM schema_version WHERE domain = ?"; } else { $query = "SELECT branch, version FROM schema_version WHERE domain = ? ORDER BY branch"; } @@ -101,8 +102,8 @@ class DBSchemaVersion implements SchemaVersion $statement->execute([$this->domain]); $versions = $statement->fetchAll(PDO::FETCH_COLUMN | PDO::FETCH_GROUP | PDO::FETCH_UNIQUE); - if ($versions) { - $this->versions = array_map('intval', $versions); + foreach ($versions as $branch => $version) { + $this->versions[$branch] = (int) $version; } } @@ -114,7 +115,7 @@ class DBSchemaVersion implements SchemaVersion */ public function get($branch = 0) { - return $this->versions[$branch ?: $this->branch]; + return $this->versions[$branch]; } /** @@ -125,7 +126,7 @@ class DBSchemaVersion implements SchemaVersion */ public function set($version, $branch = 0) { - $this->versions[$branch ?: $this->branch] = (int) $version; + $this->versions[$branch] = (int) $version; if (!$this->branchSupported()) { $query = "INSERT INTO schema_version (domain, version) @@ -143,7 +144,7 @@ class DBSchemaVersion implements SchemaVersion $statement = DBManager::get()->prepare($query); $statement->execute([ $this->domain, - $branch ?: $this->branch, + $branch, $version ]); } @@ -164,14 +165,18 @@ class DBSchemaVersion implements SchemaVersion if ($result && $result->rowCount() > 0) { $backported_migrations = [ - 20200306, 20200306, 20200713, 20200811, 20200909, - 20200910, 20201002, 20201103, 202011031, 20210317 + 20200306, 20200713, 20200811, 20200909, 20200910, + 20201002, 20201103, 202011031, 20210317 ]; $query = "DELETE FROM schema_versions WHERE domain = 'studip' AND version in (?)"; $db->execute($query, [$backported_migrations]); + $query = "DELETE FROM schema_versions + WHERE domain = 'studip' AND LENGTH(version) > 8"; + $db->exec($query); + $query = "CREATE TABLE schema_version ( domain VARCHAR(255) COLLATE latin1_bin NOT NULL, branch VARCHAR(64) COLLATE latin1_bin NOT NULL DEFAULT '0', @@ -187,6 +192,22 @@ class DBSchemaVersion implements SchemaVersion $query = "DROP TABLE schema_versions"; $db->exec($query); + + $schema_mapping = [ + 20190917 => 269, + 20200307 => 285, + 20200522 => 290, + 20210603 => 328 + ]; + + $query = "UPDATE schema_version SET branch = '1' WHERE domain = 'studip'"; + $db->exec($query); + + foreach ($schema_mapping as $old_version => $new_version) { + $query = "UPDATE schema_version SET version = ? + WHERE domain = 'studip' AND version = ?"; + $db->execute($query, [$new_version, $old_version]); + } } } } diff --git a/lib/migrations/Migrator.php b/lib/migrations/Migrator.php index eb0193a..a959317 100644 --- a/lib/migrations/Migrator.php +++ b/lib/migrations/Migrator.php @@ -194,16 +194,17 @@ class Migrator public function migrateTo($target_version) { $migrations = $this->relevantMigrations($target_version); + $target_branch = $this->schema_version->getBranch(); # you're on the right version if (empty($migrations)) { - $this->log('You are already at %d.', $this->schema_version->get()); + $this->log('You are already at %d.', $this->schema_version->get($target_branch)); return; } $this->log( 'Currently at version %d. Now migrating %s to %d.', - $this->schema_version->get(), + $this->schema_version->get($target_branch), $this->direction, max($this->target_versions) ); -- cgit v1.0