| Conditions | 13 |
| Paths | 2048 |
| Total Lines | 589 |
| Code Lines | 507 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 679 | public function down(Schema $schema): void |
||
| 680 | { |
||
| 681 | $connection = $this->getEntityManager()->getConnection(); |
||
| 682 | $configurationValues = [ |
||
| 683 | 'Registration' => [ |
||
| 684 | 'send_inscription_msg_to_inbox', |
||
| 685 | 'allow_fields_inscription', |
||
| 686 | 'required_extra_fields_in_inscription', |
||
| 687 | ], |
||
| 688 | 'Attendance' => [ |
||
| 689 | 'attendance_allow_comments', |
||
| 690 | 'attendance_calendar_set_duration', |
||
| 691 | 'enable_sign_attendance_sheet', |
||
| 692 | ], |
||
| 693 | 'Certificate' => [ |
||
| 694 | 'add_certificate_pdf_footer', |
||
| 695 | 'hide_my_certificate_link', |
||
| 696 | ], |
||
| 697 | 'Wiki' => [ |
||
| 698 | 'wiki_html_strict_filtering', |
||
| 699 | 'wiki_categories_enabled', |
||
| 700 | ], |
||
| 701 | 'Work' => [ |
||
| 702 | 'my_courses_show_pending_work', |
||
| 703 | 'allow_redirect_to_main_page_after_work_upload', |
||
| 704 | 'force_download_doc_before_upload_work', |
||
| 705 | 'considered_working_time', |
||
| 706 | 'assignment_prevent_duplicate_upload', |
||
| 707 | 'allow_my_student_publication_page', |
||
| 708 | 'allow_only_one_student_publication_per_user', |
||
| 709 | 'block_student_publication_score_edition', |
||
| 710 | 'block_student_publication_add_documents', |
||
| 711 | 'block_student_publication_edition', |
||
| 712 | ], |
||
| 713 | 'Mail' => [ |
||
| 714 | 'notifications_extended_footer_message', |
||
| 715 | 'cron_notification_help_desk', |
||
| 716 | 'cron_notification_mails', |
||
| 717 | 'mail_template_system', |
||
| 718 | 'send_notification_score_in_percentage', |
||
| 719 | 'show_user_email_in_notification', |
||
| 720 | 'send_two_inscription_confirmation_mail', |
||
| 721 | 'send_inscription_msg_to_inbox', |
||
| 722 | 'messages_hide_mail_content', |
||
| 723 | 'allow_email_editor_for_anonymous', |
||
| 724 | 'mail_content_style', |
||
| 725 | 'mail_header_style', |
||
| 726 | 'hosting_total_size_limit', |
||
| 727 | 'update_users_email_to_dummy_except_admins', |
||
| 728 | ], |
||
| 729 | 'Skill' => [ |
||
| 730 | 'allow_skill_rel_items', |
||
| 731 | 'skill_levels_names', |
||
| 732 | 'table_of_hierarchical_skill_presentation', |
||
| 733 | 'hide_skill_levels', |
||
| 734 | 'skills_teachers_can_assign_skills', |
||
| 735 | 'allow_teacher_access_student_skills', |
||
| 736 | 'allow_private_skills', |
||
| 737 | ], |
||
| 738 | 'Announcement' => [ |
||
| 739 | 'course_announcement_scheduled_by_date', |
||
| 740 | 'allow_coach_to_edit_announcements', |
||
| 741 | 'announcements_hide_send_to_hrm_users', |
||
| 742 | 'allow_careers_in_global_announcements', |
||
| 743 | 'send_all_emails_to', |
||
| 744 | 'hide_announcement_sent_to_users_info', |
||
| 745 | 'allow_scheduled_announcements', |
||
| 746 | 'disable_announcement_attachment', |
||
| 747 | 'admin_chamilo_announcements_disable', |
||
| 748 | 'disable_delete_all_announcements', |
||
| 749 | ], |
||
| 750 | 'Document' => [ |
||
| 751 | 'documents_custom_cloud_link_list', |
||
| 752 | 'enable_x_sendfile_headers', |
||
| 753 | 'documents_hide_download_icon', |
||
| 754 | 'compilatio_tool', |
||
| 755 | 'allow_compilatio_tool', |
||
| 756 | 'group_category_document_access', |
||
| 757 | 'group_document_access', |
||
| 758 | 'allow_general_certificate', |
||
| 759 | 'certificate_pdf_orientation', |
||
| 760 | 'thematic_pdf_orientation', |
||
| 761 | 'send_notification_when_document_added', |
||
| 762 | ], |
||
| 763 | 'Survey' => [ |
||
| 764 | 'show_surveys_base_in_sessions', |
||
| 765 | 'allow_survey_tool_in_lp', |
||
| 766 | 'survey_additional_teacher_modify_actions', |
||
| 767 | 'hide_survey_edition', |
||
| 768 | 'allow_mandatory_survey', |
||
| 769 | 'survey_backwards_enable', |
||
| 770 | 'survey_duplicate_order_by_name', |
||
| 771 | 'survey_allow_answered_question_edit', |
||
| 772 | 'survey_question_dependency', |
||
| 773 | 'survey_anonymous_show_answered', |
||
| 774 | 'survey_mark_question_as_required', |
||
| 775 | 'allow_survey_availability_datetime', |
||
| 776 | 'hide_survey_reporting_button', |
||
| 777 | 'allow_required_survey_questions', |
||
| 778 | ], |
||
| 779 | 'Chat' => [ |
||
| 780 | 'course_chat_restrict_to_coach', |
||
| 781 | 'hide_chat_video', |
||
| 782 | ], |
||
| 783 | 'Editor' => [ |
||
| 784 | 'video_player_renderers', |
||
| 785 | 'video_context_menu_hidden', |
||
| 786 | 'editor_settings', |
||
| 787 | 'enable_uploadimage_editor', |
||
| 788 | 'editor_driver_list', |
||
| 789 | 'translate_html', |
||
| 790 | 'ck_editor_block_image_copy_paste', |
||
| 791 | 'full_ckeditor_toolbar_set', |
||
| 792 | 'save_titles_as_html', |
||
| 793 | ], |
||
| 794 | 'Social' => [ |
||
| 795 | 'social_make_teachers_friend_all', |
||
| 796 | 'social_show_language_flag_in_profile', |
||
| 797 | ], |
||
| 798 | 'Display' => [ |
||
| 799 | 'hide_social_media_links', |
||
| 800 | ], |
||
| 801 | 'Message' => [ |
||
| 802 | 'filter_interactivity_messages', |
||
| 803 | 'allow_user_message_tracking', |
||
| 804 | 'enable_message_tags', |
||
| 805 | 'disable_dislike_option', |
||
| 806 | 'social_enable_messages_feedback', |
||
| 807 | 'private_messages_about_user_visible_to_user', |
||
| 808 | 'private_messages_about_user', |
||
| 809 | ], |
||
| 810 | 'Forum' => [ |
||
| 811 | 'subscribe_users_to_forum_notifications_also_in_base_course', |
||
| 812 | 'allow_forum_category_language_filter', |
||
| 813 | 'forum_fold_categories', |
||
| 814 | 'allow_forum_post_revisions', |
||
| 815 | 'hide_forum_post_revision_language', |
||
| 816 | 'global_forums_course_id', |
||
| 817 | ], |
||
| 818 | 'Glossary' => [ |
||
| 819 | 'allow_remove_tags_in_glossary_export', |
||
| 820 | 'default_glossary_view', |
||
| 821 | ], |
||
| 822 | 'Exercise' => [ |
||
| 823 | 'quiz_keep_alive_ping_interval', |
||
| 824 | 'quiz_hide_question_number', |
||
| 825 | 'quiz_hide_attempts_table_on_start_page', |
||
| 826 | 'quiz_question_allow_inter_course_linking', |
||
| 827 | 'quiz_question_delete_automatically_when_deleting_exercise', |
||
| 828 | 'question_exercise_html_strict_filtering', |
||
| 829 | 'exercise_result_end_text_html_strict_filtering', |
||
| 830 | 'quiz_discard_orphan_in_course_export', |
||
| 831 | 'quiz_check_all_answers_before_end_test', |
||
| 832 | 'show_exercise_session_attempts_in_base_course', |
||
| 833 | 'show_exercise_attempts_in_all_user_sessions', |
||
| 834 | 'tracking_my_progress_show_deleted_exercises', |
||
| 835 | 'exercise_hide_ip', |
||
| 836 | 'allow_quick_question_description_popup', |
||
| 837 | 'my_courses_show_pending_exercise_attempts', |
||
| 838 | 'allow_time_per_question', |
||
| 839 | 'score_grade_model', |
||
| 840 | 'exercise_category_report_user_extra_fields', |
||
| 841 | 'add_exercise_best_attempt_in_report', |
||
| 842 | 'allow_mandatory_question_in_category', |
||
| 843 | 'quiz_answer_extra_recording', |
||
| 844 | 'quiz_image_zoom', |
||
| 845 | 'allow_quiz_results_page_config', |
||
| 846 | 'allow_exercise_categories', |
||
| 847 | 'quiz_confirm_saved_answers', |
||
| 848 | 'exercise_additional_teacher_modify_actions', |
||
| 849 | 'exercise_score_format', |
||
| 850 | 'block_category_questions', |
||
| 851 | 'limit_exercise_teacher_access', |
||
| 852 | 'question_pagination_length', |
||
| 853 | 'show_question_pagination', |
||
| 854 | 'show_question_id', |
||
| 855 | 'exercises_disable_new_attempts', |
||
| 856 | 'exercise_category_round_score_in_export', |
||
| 857 | 'exercise_hide_label', |
||
| 858 | 'show_exercise_expected_choice', |
||
| 859 | 'send_score_in_exam_notification_mail_to_manager', |
||
| 860 | 'quiz_results_answers_report', |
||
| 861 | 'show_exercise_question_certainty_ribbon_result', |
||
| 862 | 'disable_clean_exercise_results_for_teachers', |
||
| 863 | 'allow_exercise_auto_launch', |
||
| 864 | 'exercise_attempts_report_show_username', |
||
| 865 | 'hide_user_info_in_quiz_result', |
||
| 866 | 'hide_free_question_score', |
||
| 867 | 'allow_notification_setting_per_exercise', |
||
| 868 | 'quiz_check_button_enable', |
||
| 869 | 'quiz_open_question_decimal_score', |
||
| 870 | 'quiz_generate_certificate_ending', |
||
| 871 | 'quiz_show_description_on_results_page', |
||
| 872 | 'quiz_prevent_copy_paste', |
||
| 873 | 'allow_teacher_comment_audio', |
||
| 874 | 'allow_quiz_show_previous_button_setting', |
||
| 875 | 'allow_quiz_question_feedback', |
||
| 876 | 'block_quiz_mail_notification_general_coach', |
||
| 877 | ], |
||
| 878 | 'Gradebook' => [ |
||
| 879 | 'gradebook_enable_subcategory_skills_independant_assignement', |
||
| 880 | 'gradebook_hide_link_to_item_for_student', |
||
| 881 | 'gradebook_hide_table', |
||
| 882 | 'gradebook_display_extra_stats', |
||
| 883 | 'allow_gradebook_comments', |
||
| 884 | 'gradebook_pdf_export_settings', |
||
| 885 | 'gradebook_flatview_extrafields_columns', |
||
| 886 | 'allow_gradebook_stats', |
||
| 887 | 'gradebook_multiple_evaluation_attempts', |
||
| 888 | 'gradebook_badge_sidebar', |
||
| 889 | 'gradebook_dependency_mandatory_courses', |
||
| 890 | 'gradebook_dependency', |
||
| 891 | 'gradebook_use_exercise_score_settings_in_total', |
||
| 892 | 'gradebook_score_display_custom_standalone', |
||
| 893 | 'gradebook_report_score_style', |
||
| 894 | 'gradebook_use_apcu_cache', |
||
| 895 | 'gradebook_use_exercise_score_settings_in_categories', |
||
| 896 | 'hide_gradebook_percentage_user_result', |
||
| 897 | 'gradebook_hide_pdf_report_button', |
||
| 898 | 'gradebook_hide_graph', |
||
| 899 | 'gradebook_enable_best_score', |
||
| 900 | ], |
||
| 901 | 'Lp' => [ |
||
| 902 | 'lp_item_prerequisite_dates', |
||
| 903 | 'lp_enable_flow', |
||
| 904 | 'my_progress_course_tools_order', |
||
| 905 | 'student_follow_page_include_not_subscribed_lp_students', |
||
| 906 | 'student_follow_page_add_LP_invisible_checkbox', |
||
| 907 | 'student_follow_page_add_LP_acquisition_info', |
||
| 908 | 'student_follow_page_hide_lp_tests_average', |
||
| 909 | 'lp_prerequisit_on_quiz_unblock_if_max_attempt_reached', |
||
| 910 | 'scorm_upload_from_cache', |
||
| 911 | 'scorm_lms_update_sco_status_all_time', |
||
| 912 | 'lp_start_and_end_date_visible_in_student_view', |
||
| 913 | 'show_invisible_lp_in_course_home', |
||
| 914 | 'lp_allow_export_to_students', |
||
| 915 | 'lp_show_max_progress_or_average_enable_course_level_redefinition', |
||
| 916 | 'lp_show_max_progress_instead_of_average', |
||
| 917 | 'student_follow_page_add_LP_subscription_info', |
||
| 918 | 'force_edit_exercise_in_lp', |
||
| 919 | 'show_invisible_exercise_in_lp_list', |
||
| 920 | 'lp_prerequisite_use_last_attempt_only', |
||
| 921 | 'lp_fixed_encoding', |
||
| 922 | 'allow_lp_subscription_to_usergroups', |
||
| 923 | 'download_files_after_all_lp_finished', |
||
| 924 | 'lp_view_settings', |
||
| 925 | 'lp_subscription_settings', |
||
| 926 | 'ticket_lp_quiz_info_add', |
||
| 927 | 'allow_session_lp_category', |
||
| 928 | 'allow_htaccess_import_from_scorm', |
||
| 929 | 'allow_import_scorm_package_in_course_builder', |
||
| 930 | 'scorm_api_extrafield_to_use_as_student_id', |
||
| 931 | 'scorm_api_username_as_student_id', |
||
| 932 | 'disable_my_lps_page', |
||
| 933 | 'lp_prevents_beforeunload', |
||
| 934 | 'lp_score_as_progress_enable', |
||
| 935 | 'lp_menu_location', |
||
| 936 | 'show_hidden_exercise_added_to_lp', |
||
| 937 | 'validate_lp_prerequisite_from_other_session', |
||
| 938 | 'lp_minimum_time', |
||
| 939 | 'hide_accessibility_label_on_lp_item', |
||
| 940 | 'allow_lp_chamilo_export', |
||
| 941 | 'allow_teachers_to_access_blocked_lp_by_prerequisite', |
||
| 942 | 'disable_js_in_lp_view', |
||
| 943 | 'lp_view_accordion', |
||
| 944 | 'lp_category_accordion', |
||
| 945 | 'hide_lp_time', |
||
| 946 | 'show_prerequisite_as_blocked', |
||
| 947 | 'add_all_files_in_lp_export', |
||
| 948 | ], |
||
| 949 | 'Agenda' => [ |
||
| 950 | 'fullcalendar_settings', |
||
| 951 | 'agenda_reminders_sender_id', |
||
| 952 | 'agenda_reminders', |
||
| 953 | 'agenda_event_subscriptions', |
||
| 954 | 'agenda_collective_invitations', |
||
| 955 | 'personal_calendar_show_sessions_occupation', |
||
| 956 | 'agenda_on_hover_info', |
||
| 957 | 'agenda_colors', |
||
| 958 | 'agenda_legend', |
||
| 959 | 'allow_agenda_edit_for_hrm', |
||
| 960 | 'personal_agenda_show_all_session_events', |
||
| 961 | ], |
||
| 962 | 'Admin' => [ |
||
| 963 | 'drh_allow_access_to_all_students', |
||
| 964 | 'usergroup_do_not_unsubscribe_users_from_session_on_session_unsubscribe', |
||
| 965 | 'usergroup_do_not_unsubscribe_users_from_course_on_course_unsubscribe', |
||
| 966 | 'usergroup_do_not_unsubscribe_users_from_course_nor_session_on_user_unsubscribe', |
||
| 967 | 'plugin_redirection_enabled', |
||
| 968 | 'send_inscription_notification_to_general_admin_only', |
||
| 969 | 'max_anonymous_users', |
||
| 970 | 'show_link_request_hrm_user', |
||
| 971 | 'user_status_option_only_for_admin_enabled', |
||
| 972 | ], |
||
| 973 | 'Profile' => [ |
||
| 974 | 'hide_username_in_course_chat', |
||
| 975 | 'allow_social_map_fields', |
||
| 976 | 'community_managers_user_list', |
||
| 977 | 'allow_career_users', |
||
| 978 | 'user_search_on_extra_fields', |
||
| 979 | 'user_import_settings', |
||
| 980 | 'profile_fields_visibility', |
||
| 981 | 'allow_teachers_to_classes', |
||
| 982 | 'show_conditions_to_user', |
||
| 983 | 'send_notification_when_user_added', |
||
| 984 | 'hide_user_field_from_list', |
||
| 985 | 'data_protection_officer_email', |
||
| 986 | 'data_protection_officer_role', |
||
| 987 | 'data_protection_officer_name', |
||
| 988 | 'disable_gdpr', |
||
| 989 | 'registration_add_helptext_for_2_names', |
||
| 990 | 'pass_reminder_custom_link', |
||
| 991 | 'add_user_course_information_in_mailto', |
||
| 992 | 'my_space_users_items_per_page', |
||
| 993 | 'disable_change_user_visibility_for_public_courses', |
||
| 994 | 'hide_username_with_complete_name', |
||
| 995 | 'allow_career_diagram', |
||
| 996 | 'career_diagram_legend', |
||
| 997 | 'career_diagram_disclaimer', |
||
| 998 | 'linkedin_organization_id', |
||
| 999 | ], |
||
| 1000 | 'Platform' => [ |
||
| 1001 | 'redirect_index_to_url_for_logged_users', |
||
| 1002 | 'portfolio_advanced_sharing', |
||
| 1003 | 'disable_user_conditions_sender_id', |
||
| 1004 | 'ticket_project_user_roles', |
||
| 1005 | 'allow_working_time_edition', |
||
| 1006 | 'plugin_settings', |
||
| 1007 | 'webservice_enable_adminonly_api', |
||
| 1008 | 'disable_webservices', |
||
| 1009 | 'use_career_external_id_as_identifier_in_diagrams', |
||
| 1010 | 'platform_logo_url', |
||
| 1011 | 'user_hide_never_expire_option', |
||
| 1012 | 'user_edition_extra_field_to_check', |
||
| 1013 | 'user_number_of_days_for_default_expiration_date_per_role', |
||
| 1014 | 'user_status_show_option', |
||
| 1015 | 'user_status_show_options_enabled', |
||
| 1016 | 'update_student_expiration_x_date', |
||
| 1017 | 'extldap_config', |
||
| 1018 | 'hide_breadcrumb_if_not_allowed', |
||
| 1019 | 'force_renew_password_at_first_login', |
||
| 1020 | 'login_max_attempt_before_blocking_account', |
||
| 1021 | 'multiple_url_hide_disabled_settings', |
||
| 1022 | 'webservice_return_user_field', |
||
| 1023 | 'aspell_temp_dir', |
||
| 1024 | 'aspell_opts', |
||
| 1025 | 'aspell_bin', |
||
| 1026 | 'default_template', |
||
| 1027 | 'session_stored_after_n_times', |
||
| 1028 | 'memcache_server', |
||
| 1029 | 'session_stored_in_db_as_backup', |
||
| 1030 | 'allow_portfolio_tool', |
||
| 1031 | 'timepicker_increment', |
||
| 1032 | 'generate_random_login', |
||
| 1033 | 'block_my_progress_page', |
||
| 1034 | 'allow_double_validation_in_registration', |
||
| 1035 | 'table_default_row', |
||
| 1036 | 'hide_complete_name_in_whoisonline', |
||
| 1037 | 'tracking_skip_generic_data', |
||
| 1038 | 'pdf_img_dpi', |
||
| 1039 | 'hide_main_navigation_menu', |
||
| 1040 | 'sync_db_with_schema', |
||
| 1041 | 'packager', |
||
| 1042 | 'unoconv_binaries', |
||
| 1043 | 'theme_fallback', |
||
| 1044 | 'proxy_settings', |
||
| 1045 | 'video_features', |
||
| 1046 | 'table_row_list', |
||
| 1047 | ], |
||
| 1048 | 'Language' => [ |
||
| 1049 | 'template_activate_language_filter', |
||
| 1050 | 'allow_course_multiple_languages', |
||
| 1051 | 'language_flags_by_country', |
||
| 1052 | 'show_language_selector_in_menu', |
||
| 1053 | ], |
||
| 1054 | 'Course' => [ |
||
| 1055 | 'course_creation_user_course_extra_field_relation_to_prefill', |
||
| 1056 | 'course_configuration_tool_extra_fields_to_show_and_edit', |
||
| 1057 | 'course_creation_form_set_extra_fields_mandatory', |
||
| 1058 | 'course_creation_by_teacher_extra_fields_to_show', |
||
| 1059 | 'courses_catalogue_show_only_category', |
||
| 1060 | 'show_courses_in_catalogue', |
||
| 1061 | 'course_log_default_extra_fields', |
||
| 1062 | 'catalog_hide_public_link', |
||
| 1063 | 'course_visibility_change_only_admin', |
||
| 1064 | 'course_about_teacher_name_hide', |
||
| 1065 | 'course_creation_form_hide_course_code', |
||
| 1066 | 'course_creation_form_set_course_category_mandatory', |
||
| 1067 | 'course_catalog_display_in_home', |
||
| 1068 | 'block_registered_users_access_to_open_course_contents', |
||
| 1069 | 'resource_sequence_show_dependency_in_course_intro', |
||
| 1070 | 'course_catalog_settings', |
||
| 1071 | 'course_student_info', |
||
| 1072 | 'course_log_hide_columns', |
||
| 1073 | 'hide_course_rating', |
||
| 1074 | 'courses_list_session_title_link', |
||
| 1075 | 'course_creation_donate_link', |
||
| 1076 | 'course_creation_donate_message_show', |
||
| 1077 | 'enable_unsubscribe_button_on_my_course_page', |
||
| 1078 | 'course_category_code_to_use_as_model', |
||
| 1079 | 'multiple_access_url_show_shared_course_marker', |
||
| 1080 | 'allow_course_extra_field_in_catalog', |
||
| 1081 | 'hide_course_sidebar', |
||
| 1082 | 'allow_base_course_category', |
||
| 1083 | 'disabled_edit_session_coaches_course_editing_course', |
||
| 1084 | 'show_all_sessions_on_my_course_page', |
||
| 1085 | 'allow_public_course_with_no_terms_conditions', |
||
| 1086 | 'my_courses_show_courses_in_user_language_only', |
||
| 1087 | 'show_simple_session_info', |
||
| 1088 | 'view_grid_courses', |
||
| 1089 | ], |
||
| 1090 | 'Security' => [ |
||
| 1091 | 'security_session_cookie_samesite_none', |
||
| 1092 | 'security_block_inactive_users_immediately', |
||
| 1093 | 'security_referrer_policy', |
||
| 1094 | 'security_x_content_type_options', |
||
| 1095 | 'security_xss_protection', |
||
| 1096 | 'security_x_frame_options', |
||
| 1097 | 'security_public_key_pins_report_only', |
||
| 1098 | 'security_public_key_pins', |
||
| 1099 | 'security_content_policy_report_only', |
||
| 1100 | 'security_content_policy', |
||
| 1101 | 'security_strict_transport', |
||
| 1102 | 'password_requirements', |
||
| 1103 | 'allow_online_users_by_status', |
||
| 1104 | ], |
||
| 1105 | 'Session' => [ |
||
| 1106 | 'session_creation_form_set_extra_fields_mandatory', |
||
| 1107 | 'session_creation_user_course_extra_field_relation_to_prefill', |
||
| 1108 | 'email_template_subscription_to_session_confirmation_lost_password', |
||
| 1109 | 'email_template_subscription_to_session_confirmation_username', |
||
| 1110 | 'session_classes_tab_disable', |
||
| 1111 | 'session_course_users_subscription_limited_to_session_users', |
||
| 1112 | 'session_coach_access_after_duration_end', |
||
| 1113 | 'show_users_in_active_sessions_in_tracking', |
||
| 1114 | 'hide_session_graph_in_my_progress', |
||
| 1115 | 'allow_session_admin_extra_access', |
||
| 1116 | 'assignment_base_course_teacher_access_to_all_session', |
||
| 1117 | 'my_progress_session_show_all_courses', |
||
| 1118 | 'tracking_columns', |
||
| 1119 | 'allow_session_status', |
||
| 1120 | 'catalog_settings', |
||
| 1121 | 'session_import_settings', |
||
| 1122 | 'session_courses_read_only_mode', |
||
| 1123 | 'my_courses_session_order', |
||
| 1124 | 'user_s_session_duration', |
||
| 1125 | 'session_automatic_creation_user_id', |
||
| 1126 | 'default_session_list_view', |
||
| 1127 | 'catalog_course_subscription_in_user_s_session', |
||
| 1128 | 'allow_session_admin_login_as_teacher', |
||
| 1129 | 'allow_user_session_collapsable', |
||
| 1130 | 'session_list_order', |
||
| 1131 | 'allow_session_admin_read_careers', |
||
| 1132 | 'hide_reporting_session_list', |
||
| 1133 | 'session_multiple_subscription_students_list_avoid_emptying', |
||
| 1134 | 'allow_disable_user_for_session_admin', |
||
| 1135 | 'allow_delete_user_for_session_admin', |
||
| 1136 | 'hide_search_form_in_session_list', |
||
| 1137 | 'limit_session_admin_list_users', |
||
| 1138 | 'session_admins_edit_courses_content', |
||
| 1139 | 'session_admins_access_all_content', |
||
| 1140 | 'session_list_show_count_users', |
||
| 1141 | 'remove_session_url', |
||
| 1142 | 'allow_redirect_to_session_after_inscription_about', |
||
| 1143 | ], |
||
| 1144 | ]; |
||
| 1145 | foreach ($configurationValues as $category => $variables) { |
||
| 1146 | foreach ($variables as $variable) { |
||
| 1147 | $result = $connection |
||
| 1148 | ->executeQuery( |
||
| 1149 | "SELECT COUNT(1) FROM settings_current WHERE variable = '$variable' AND category = '$category'" |
||
| 1150 | ) |
||
| 1151 | ; |
||
| 1152 | $count = $result->fetchNumeric()[0]; |
||
| 1153 | if (!empty($count)) { |
||
| 1154 | $this->addSql( |
||
| 1155 | "DELETE FROM settings_current WHERE variable = '{$variable}' AND category = '$category'" |
||
| 1156 | ); |
||
| 1157 | } |
||
| 1158 | } |
||
| 1159 | } |
||
| 1160 | |||
| 1161 | // Delete extra fields required. |
||
| 1162 | |||
| 1163 | $result = $connection |
||
| 1164 | ->executeQuery( |
||
| 1165 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'end_date' AND item_type = 7 AND value_type = 7" |
||
| 1166 | ) |
||
| 1167 | ; |
||
| 1168 | $count = $result->fetchNumeric()[0]; |
||
| 1169 | if (!empty($count)) { |
||
| 1170 | $this->addSql( |
||
| 1171 | "DELETE FROM extra_field WHERE variable = 'end_date' AND item_type = 7 AND value_type = 7" |
||
| 1172 | ); |
||
| 1173 | } |
||
| 1174 | |||
| 1175 | $result = $connection |
||
| 1176 | ->executeQuery( |
||
| 1177 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'start_date' AND item_type = 7 AND value_type = 7" |
||
| 1178 | ) |
||
| 1179 | ; |
||
| 1180 | $count = $result->fetchNumeric()[0]; |
||
| 1181 | if (!empty($count)) { |
||
| 1182 | $this->addSql( |
||
| 1183 | "DELETE FROM extra_field WHERE variable = 'start_date' AND item_type = 7 AND value_type = 7" |
||
| 1184 | ); |
||
| 1185 | } |
||
| 1186 | |||
| 1187 | $result = $connection |
||
| 1188 | ->executeQuery( |
||
| 1189 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'invisible' AND item_type = 20 AND value_type = 13" |
||
| 1190 | ) |
||
| 1191 | ; |
||
| 1192 | $count = $result->fetchNumeric()[0]; |
||
| 1193 | if (!empty($count)) { |
||
| 1194 | $this->addSql( |
||
| 1195 | "DELETE FROM extra_field WHERE variable = 'invisible' AND item_type = 20 AND value_type = 13" |
||
| 1196 | ); |
||
| 1197 | } |
||
| 1198 | |||
| 1199 | $result = $connection |
||
| 1200 | ->executeQuery( |
||
| 1201 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'acquisition' AND item_type = 20 AND value_type = 3" |
||
| 1202 | ) |
||
| 1203 | ; |
||
| 1204 | $count = $result->fetchNumeric()[0]; |
||
| 1205 | if (!empty($count)) { |
||
| 1206 | $this->addSql( |
||
| 1207 | "DELETE FROM extra_field WHERE variable = 'acquisition' AND item_type = 20 AND value_type = 3" |
||
| 1208 | ); |
||
| 1209 | } |
||
| 1210 | |||
| 1211 | $result = $connection |
||
| 1212 | ->executeQuery( |
||
| 1213 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'tags' AND item_type = 22 AND value_type = 10" |
||
| 1214 | ) |
||
| 1215 | ; |
||
| 1216 | $count = $result->fetchNumeric()[0]; |
||
| 1217 | if (!empty($count)) { |
||
| 1218 | $this->addSql( |
||
| 1219 | "DELETE FROM extra_field WHERE variable = 'tags' AND item_type = 22 AND value_type = 10" |
||
| 1220 | ); |
||
| 1221 | } |
||
| 1222 | |||
| 1223 | $result = $connection |
||
| 1224 | ->executeQuery( |
||
| 1225 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'multiple_language' AND item_type = 2 AND value_type = 5" |
||
| 1226 | ) |
||
| 1227 | ; |
||
| 1228 | $count = $result->fetchNumeric()[0]; |
||
| 1229 | if (!empty($count)) { |
||
| 1230 | $this->addSql( |
||
| 1231 | "DELETE FROM extra_field WHERE variable = 'multiple_language' AND item_type = 2 AND value_type = 5" |
||
| 1232 | ); |
||
| 1233 | } |
||
| 1234 | |||
| 1235 | $result = $connection |
||
| 1236 | ->executeQuery( |
||
| 1237 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'show_in_catalogue' AND item_type = 2 AND value_type = 3" |
||
| 1238 | ) |
||
| 1239 | ; |
||
| 1240 | $count = $result->fetchNumeric()[0]; |
||
| 1241 | if (!empty($count)) { |
||
| 1242 | $this->addSql( |
||
| 1243 | "DELETE FROM extra_field WHERE variable = 'show_in_catalogue' AND item_type = 2 AND value_type = 3" |
||
| 1244 | ); |
||
| 1245 | } |
||
| 1246 | |||
| 1247 | $result = $connection |
||
| 1248 | ->executeQuery( |
||
| 1249 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'session_courses_read_only_mode' AND item_type = 2 AND value_type = 13" |
||
| 1250 | ) |
||
| 1251 | ; |
||
| 1252 | $count = $result->fetchNumeric()[0]; |
||
| 1253 | if (!empty($count)) { |
||
| 1254 | $this->addSql( |
||
| 1255 | "DELETE FROM extra_field WHERE variable = 'session_courses_read_only_mode' AND item_type = 2 AND value_type = 13" |
||
| 1256 | ); |
||
| 1257 | } |
||
| 1258 | |||
| 1259 | $result = $connection |
||
| 1260 | ->executeQuery( |
||
| 1261 | "SELECT COUNT(1) FROM extra_field WHERE variable = 'is_mandatory' AND item_type = 12 AND value_type = 13" |
||
| 1262 | ) |
||
| 1263 | ; |
||
| 1264 | $count = $result->fetchNumeric()[0]; |
||
| 1265 | if (!empty($count)) { |
||
| 1266 | $this->addSql( |
||
| 1267 | "DELETE FROM extra_field WHERE variable = 'is_mandatory' AND item_type = 12 AND value_type = 13" |
||
| 1268 | ); |
||
| 1297 |