1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Migrations\Schema\V200; |
8
|
|
|
|
9
|
|
|
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; |
10
|
|
|
use Doctrine\DBAL\Schema\Schema; |
11
|
|
|
|
12
|
|
|
use const JSON_UNESCAPED_SLASHES; |
13
|
|
|
use const JSON_UNESCAPED_UNICODE; |
14
|
|
|
|
15
|
|
|
class Version20230216122900 extends AbstractMigrationChamilo |
16
|
|
|
{ |
17
|
|
|
public function getDescription(): string |
18
|
|
|
{ |
19
|
|
|
return 'Migrate configuration values to settings_current'; |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
public function up(Schema $schema): void |
23
|
|
|
{ |
24
|
|
|
$connection = $this->getEntityManager()->getConnection(); |
25
|
|
|
$configurationValues = [ |
26
|
|
|
'Session' => [ |
27
|
|
|
'allow_redirect_to_session_after_inscription_about', |
28
|
|
|
'remove_session_url', |
29
|
|
|
'session_list_show_count_users', |
30
|
|
|
'session_admins_access_all_content', |
31
|
|
|
'session_admins_edit_courses_content', |
32
|
|
|
'limit_session_admin_list_users', |
33
|
|
|
'hide_search_form_in_session_list', |
34
|
|
|
'allow_delete_user_for_session_admin', |
35
|
|
|
'allow_disable_user_for_session_admin', |
36
|
|
|
'session_multiple_subscription_students_list_avoid_emptying', |
37
|
|
|
'hide_reporting_session_list', |
38
|
|
|
'allow_session_admin_read_careers', |
39
|
|
|
'session_list_order', |
40
|
|
|
'allow_user_session_collapsable', |
41
|
|
|
'allow_session_admin_login_as_teacher', |
42
|
|
|
'catalog_course_subscription_in_user_s_session', |
43
|
|
|
'default_session_list_view', |
44
|
|
|
'session_automatic_creation_user_id', |
45
|
|
|
'user_s_session_duration', |
46
|
|
|
'my_courses_session_order', |
47
|
|
|
'session_courses_read_only_mode', |
48
|
|
|
'session_import_settings', |
49
|
|
|
'catalog_settings', |
50
|
|
|
'allow_session_status', |
51
|
|
|
'tracking_columns', |
52
|
|
|
'my_progress_session_show_all_courses', |
53
|
|
|
'assignment_base_course_teacher_access_to_all_session', |
54
|
|
|
'allow_session_admin_extra_access', |
55
|
|
|
'hide_session_graph_in_my_progress', |
56
|
|
|
'show_users_in_active_sessions_in_tracking', |
57
|
|
|
'session_coach_access_after_duration_end', |
58
|
|
|
'session_course_users_subscription_limited_to_session_users', |
59
|
|
|
'session_classes_tab_disable', |
60
|
|
|
'email_template_subscription_to_session_confirmation_username', |
61
|
|
|
'email_template_subscription_to_session_confirmation_lost_password', |
62
|
|
|
'session_creation_user_course_extra_field_relation_to_prefill', |
63
|
|
|
'session_creation_form_set_extra_fields_mandatory', |
64
|
|
|
], |
65
|
|
|
'Security' => [ |
66
|
|
|
'allow_online_users_by_status', |
67
|
|
|
'password_requirements', |
68
|
|
|
'security_strict_transport', |
69
|
|
|
'security_content_policy', |
70
|
|
|
'security_content_policy_report_only', |
71
|
|
|
'security_public_key_pins', |
72
|
|
|
'security_public_key_pins_report_only', |
73
|
|
|
'security_x_frame_options', |
74
|
|
|
'security_xss_protection', |
75
|
|
|
'security_x_content_type_options', |
76
|
|
|
'security_referrer_policy', |
77
|
|
|
'security_block_inactive_users_immediately', |
78
|
|
|
'security_session_cookie_samesite_none', |
79
|
|
|
], |
80
|
|
|
'Course' => [ |
81
|
|
|
'view_grid_courses', |
82
|
|
|
'show_simple_session_info', |
83
|
|
|
'my_courses_show_courses_in_user_language_only', |
84
|
|
|
'allow_public_course_with_no_terms_conditions', |
85
|
|
|
'show_all_sessions_on_my_course_page', |
86
|
|
|
'disabled_edit_session_coaches_course_editing_course', |
87
|
|
|
'allow_base_course_category', |
88
|
|
|
'hide_course_sidebar', |
89
|
|
|
'allow_course_extra_field_in_catalog', |
90
|
|
|
'multiple_access_url_show_shared_course_marker', |
91
|
|
|
'course_category_code_to_use_as_model', |
92
|
|
|
'enable_unsubscribe_button_on_my_course_page', |
93
|
|
|
'course_creation_donate_message_show', |
94
|
|
|
'course_creation_donate_link', |
95
|
|
|
'courses_list_session_title_link', |
96
|
|
|
'hide_course_rating', |
97
|
|
|
'course_log_hide_columns', |
98
|
|
|
'course_student_info', |
99
|
|
|
'course_catalog_settings', |
100
|
|
|
'resource_sequence_show_dependency_in_course_intro', |
101
|
|
|
'block_registered_users_access_to_open_course_contents', |
102
|
|
|
'course_catalog_display_in_home', |
103
|
|
|
'course_creation_form_set_course_category_mandatory', |
104
|
|
|
'course_creation_form_hide_course_code', |
105
|
|
|
'course_about_teacher_name_hide', |
106
|
|
|
'course_visibility_change_only_admin', |
107
|
|
|
'catalog_hide_public_link', |
108
|
|
|
'course_log_default_extra_fields', |
109
|
|
|
'show_courses_in_catalogue', |
110
|
|
|
'courses_catalogue_show_only_category', |
111
|
|
|
'course_creation_by_teacher_extra_fields_to_show', |
112
|
|
|
'course_creation_form_set_extra_fields_mandatory', |
113
|
|
|
'course_configuration_tool_extra_fields_to_show_and_edit', |
114
|
|
|
'course_creation_user_course_extra_field_relation_to_prefill', |
115
|
|
|
], |
116
|
|
|
'Language' => [ |
117
|
|
|
'show_language_selector_in_menu', |
118
|
|
|
'language_flags_by_country', |
119
|
|
|
'allow_course_multiple_languages', |
120
|
|
|
'template_activate_language_filter', |
121
|
|
|
], |
122
|
|
|
'Platform' => [ |
123
|
|
|
'table_row_list', |
124
|
|
|
'video_features', |
125
|
|
|
'proxy_settings', |
126
|
|
|
'theme_fallback', |
127
|
|
|
'unoconv_binaries', |
128
|
|
|
'packager', |
129
|
|
|
'sync_db_with_schema', |
130
|
|
|
'hide_main_navigation_menu', |
131
|
|
|
'pdf_img_dpi', |
132
|
|
|
'tracking_skip_generic_data', |
133
|
|
|
'hide_complete_name_in_whoisonline', |
134
|
|
|
'table_default_row', |
135
|
|
|
'allow_double_validation_in_registration', |
136
|
|
|
'block_my_progress_page', |
137
|
|
|
'generate_random_login', |
138
|
|
|
'timepicker_increment', |
139
|
|
|
'allow_portfolio_tool', |
140
|
|
|
'session_stored_in_db_as_backup', |
141
|
|
|
'memcache_server', |
142
|
|
|
'session_stored_after_n_times', |
143
|
|
|
'default_template', |
144
|
|
|
'aspell_bin', |
145
|
|
|
'aspell_opts', |
146
|
|
|
'aspell_temp_dir', |
147
|
|
|
'webservice_return_user_field', |
148
|
|
|
'multiple_url_hide_disabled_settings', |
149
|
|
|
'login_max_attempt_before_blocking_account', |
150
|
|
|
'force_renew_password_at_first_login', |
151
|
|
|
'hide_breadcrumb_if_not_allowed', |
152
|
|
|
'extldap_config', |
153
|
|
|
'update_student_expiration_x_date', |
154
|
|
|
'user_status_show_options_enabled', |
155
|
|
|
'user_status_show_option', |
156
|
|
|
'user_number_of_days_for_default_expiration_date_per_role', |
157
|
|
|
'user_edition_extra_field_to_check', |
158
|
|
|
'user_hide_never_expire_option', |
159
|
|
|
'platform_logo_url', |
160
|
|
|
'use_career_external_id_as_identifier_in_diagrams', |
161
|
|
|
'disable_webservices', |
162
|
|
|
'webservice_enable_adminonly_api', |
163
|
|
|
'plugin_settings', |
164
|
|
|
'allow_working_time_edition', |
165
|
|
|
'ticket_project_user_roles', |
166
|
|
|
'disable_user_conditions_sender_id', |
167
|
|
|
'portfolio_advanced_sharing', |
168
|
|
|
'redirect_index_to_url_for_logged_users', |
169
|
|
|
], |
170
|
|
|
'Profile' => [ |
171
|
|
|
'linkedin_organization_id', |
172
|
|
|
'career_diagram_disclaimer', |
173
|
|
|
'career_diagram_legend', |
174
|
|
|
'allow_career_diagram', |
175
|
|
|
'hide_username_with_complete_name', |
176
|
|
|
'disable_change_user_visibility_for_public_courses', |
177
|
|
|
'my_space_users_items_per_page', |
178
|
|
|
'add_user_course_information_in_mailto', |
179
|
|
|
'pass_reminder_custom_link', |
180
|
|
|
'registration_add_helptext_for_2_names', |
181
|
|
|
'disable_gdpr', |
182
|
|
|
'data_protection_officer_name', |
183
|
|
|
'data_protection_officer_role', |
184
|
|
|
'data_protection_officer_email', |
185
|
|
|
'hide_user_field_from_list', |
186
|
|
|
'send_notification_when_user_added', |
187
|
|
|
'show_conditions_to_user', |
188
|
|
|
'allow_teachers_to_classes', |
189
|
|
|
'profile_fields_visibility', |
190
|
|
|
'user_import_settings', |
191
|
|
|
'user_search_on_extra_fields', |
192
|
|
|
'allow_career_users', |
193
|
|
|
'community_managers_user_list', |
194
|
|
|
'allow_social_map_fields', |
195
|
|
|
'hide_username_in_course_chat', |
196
|
|
|
], |
197
|
|
|
'Admin' => [ |
198
|
|
|
'user_status_option_only_for_admin_enabled', |
199
|
|
|
'show_link_request_hrm_user', |
200
|
|
|
'max_anonymous_users', |
201
|
|
|
'send_inscription_notification_to_general_admin_only', |
202
|
|
|
'plugin_redirection_enabled', |
203
|
|
|
'usergroup_do_not_unsubscribe_users_from_course_nor_session_on_user_unsubscribe', |
204
|
|
|
'usergroup_do_not_unsubscribe_users_from_course_on_course_unsubscribe', |
205
|
|
|
'usergroup_do_not_unsubscribe_users_from_session_on_session_unsubscribe', |
206
|
|
|
'drh_allow_access_to_all_students', |
207
|
|
|
], |
208
|
|
|
'Agenda' => [ |
209
|
|
|
'personal_agenda_show_all_session_events', |
210
|
|
|
'allow_agenda_edit_for_hrm', |
211
|
|
|
'agenda_legend', |
212
|
|
|
'agenda_colors', |
213
|
|
|
'agenda_on_hover_info', |
214
|
|
|
'personal_calendar_show_sessions_occupation', |
215
|
|
|
'agenda_collective_invitations', |
216
|
|
|
'agenda_event_subscriptions', |
217
|
|
|
'agenda_reminders', |
218
|
|
|
'agenda_reminders_sender_id', |
219
|
|
|
'fullcalendar_settings', |
220
|
|
|
], |
221
|
|
|
'Lp' => [ |
222
|
|
|
'add_all_files_in_lp_export', |
223
|
|
|
'show_prerequisite_as_blocked', |
224
|
|
|
'hide_lp_time', |
225
|
|
|
'lp_category_accordion', |
226
|
|
|
'lp_view_accordion', |
227
|
|
|
'disable_js_in_lp_view', |
228
|
|
|
'allow_teachers_to_access_blocked_lp_by_prerequisite', |
229
|
|
|
'allow_lp_chamilo_export', |
230
|
|
|
'hide_accessibility_label_on_lp_item', |
231
|
|
|
'lp_minimum_time', |
232
|
|
|
'validate_lp_prerequisite_from_other_session', |
233
|
|
|
'show_hidden_exercise_added_to_lp', |
234
|
|
|
'lp_menu_location', |
235
|
|
|
'lp_score_as_progress_enable', |
236
|
|
|
'lp_prevents_beforeunload', |
237
|
|
|
'disable_my_lps_page', |
238
|
|
|
'scorm_api_username_as_student_id', |
239
|
|
|
'scorm_api_extrafield_to_use_as_student_id', |
240
|
|
|
'allow_import_scorm_package_in_course_builder', |
241
|
|
|
'allow_htaccess_import_from_scorm', |
242
|
|
|
'allow_session_lp_category', |
243
|
|
|
'ticket_lp_quiz_info_add', |
244
|
|
|
'lp_subscription_settings', |
245
|
|
|
'lp_view_settings', |
246
|
|
|
'download_files_after_all_lp_finished', |
247
|
|
|
'allow_lp_subscription_to_usergroups', |
248
|
|
|
'lp_fixed_encoding', |
249
|
|
|
'lp_prerequisite_use_last_attempt_only', |
250
|
|
|
'show_invisible_exercise_in_lp_list', |
251
|
|
|
'force_edit_exercise_in_lp', |
252
|
|
|
'student_follow_page_add_LP_subscription_info', |
253
|
|
|
'lp_show_max_progress_instead_of_average', |
254
|
|
|
'lp_show_max_progress_or_average_enable_course_level_redefinition', |
255
|
|
|
'lp_allow_export_to_students', |
256
|
|
|
'show_invisible_lp_in_course_home', |
257
|
|
|
'lp_start_and_end_date_visible_in_student_view', |
258
|
|
|
'scorm_lms_update_sco_status_all_time', |
259
|
|
|
'scorm_upload_from_cache', |
260
|
|
|
'lp_prerequisit_on_quiz_unblock_if_max_attempt_reached', |
261
|
|
|
'student_follow_page_hide_lp_tests_average', |
262
|
|
|
'student_follow_page_add_LP_acquisition_info', |
263
|
|
|
'student_follow_page_add_LP_invisible_checkbox', |
264
|
|
|
'student_follow_page_include_not_subscribed_lp_students', |
265
|
|
|
'my_progress_course_tools_order', |
266
|
|
|
'lp_enable_flow', |
267
|
|
|
'lp_item_prerequisite_dates', |
268
|
|
|
], |
269
|
|
|
'Gradebook' => [ |
270
|
|
|
'gradebook_enable_best_score', |
271
|
|
|
'gradebook_hide_graph', |
272
|
|
|
'gradebook_hide_pdf_report_button', |
273
|
|
|
'hide_gradebook_percentage_user_result', |
274
|
|
|
'gradebook_use_exercise_score_settings_in_categories', |
275
|
|
|
'gradebook_use_apcu_cache', |
276
|
|
|
'gradebook_report_score_style', |
277
|
|
|
'gradebook_score_display_custom_standalone', |
278
|
|
|
'gradebook_use_exercise_score_settings_in_total', |
279
|
|
|
'gradebook_dependency', |
280
|
|
|
'gradebook_dependency_mandatory_courses', |
281
|
|
|
'gradebook_badge_sidebar', |
282
|
|
|
'gradebook_multiple_evaluation_attempts', |
283
|
|
|
'allow_gradebook_stats', |
284
|
|
|
'gradebook_flatview_extrafields_columns', |
285
|
|
|
'gradebook_pdf_export_settings', |
286
|
|
|
'allow_gradebook_comments', |
287
|
|
|
'gradebook_display_extra_stats', |
288
|
|
|
'gradebook_hide_table', |
289
|
|
|
'gradebook_hide_link_to_item_for_student', |
290
|
|
|
'gradebook_enable_subcategory_skills_independant_assignement', |
291
|
|
|
], |
292
|
|
|
'Exercise' => [ |
293
|
|
|
'block_quiz_mail_notification_general_coach', |
294
|
|
|
'allow_quiz_question_feedback', |
295
|
|
|
'allow_quiz_show_previous_button_setting', |
296
|
|
|
'allow_teacher_comment_audio', |
297
|
|
|
'quiz_prevent_copy_paste', |
298
|
|
|
'quiz_show_description_on_results_page', |
299
|
|
|
'quiz_generate_certificate_ending', |
300
|
|
|
'quiz_open_question_decimal_score', |
301
|
|
|
'quiz_check_button_enable', |
302
|
|
|
'allow_notification_setting_per_exercise', |
303
|
|
|
'hide_free_question_score', |
304
|
|
|
'hide_user_info_in_quiz_result', |
305
|
|
|
'exercise_attempts_report_show_username', |
306
|
|
|
'allow_exercise_auto_launch', |
307
|
|
|
'disable_clean_exercise_results_for_teachers', |
308
|
|
|
'show_exercise_question_certainty_ribbon_result', |
309
|
|
|
'quiz_results_answers_report', |
310
|
|
|
'send_score_in_exam_notification_mail_to_manager', |
311
|
|
|
'show_exercise_expected_choice', |
312
|
|
|
'exercise_hide_label', |
313
|
|
|
'exercise_category_round_score_in_export', |
314
|
|
|
'exercises_disable_new_attempts', |
315
|
|
|
'show_question_id', |
316
|
|
|
'show_question_pagination', |
317
|
|
|
'question_pagination_length', |
318
|
|
|
'limit_exercise_teacher_access', |
319
|
|
|
'block_category_questions', |
320
|
|
|
'exercise_score_format', |
321
|
|
|
'exercise_additional_teacher_modify_actions', |
322
|
|
|
'quiz_confirm_saved_answers', |
323
|
|
|
'allow_exercise_categories', |
324
|
|
|
'allow_quiz_results_page_config', |
325
|
|
|
'quiz_image_zoom', |
326
|
|
|
'quiz_answer_extra_recording', |
327
|
|
|
'allow_mandatory_question_in_category', |
328
|
|
|
'add_exercise_best_attempt_in_report', |
329
|
|
|
'exercise_category_report_user_extra_fields', |
330
|
|
|
'score_grade_model', |
331
|
|
|
'allow_time_per_question', |
332
|
|
|
'my_courses_show_pending_exercise_attempts', |
333
|
|
|
'allow_quick_question_description_popup', |
334
|
|
|
'exercise_hide_ip', |
335
|
|
|
'tracking_my_progress_show_deleted_exercises', |
336
|
|
|
'show_exercise_attempts_in_all_user_sessions', |
337
|
|
|
'show_exercise_session_attempts_in_base_course', |
338
|
|
|
'quiz_check_all_answers_before_end_test', |
339
|
|
|
'quiz_discard_orphan_in_course_export', |
340
|
|
|
'exercise_result_end_text_html_strict_filtering', |
341
|
|
|
'question_exercise_html_strict_filtering', |
342
|
|
|
'quiz_question_delete_automatically_when_deleting_exercise', |
343
|
|
|
'quiz_question_allow_inter_course_linking', |
344
|
|
|
'quiz_hide_attempts_table_on_start_page', |
345
|
|
|
'quiz_hide_question_number', |
346
|
|
|
'quiz_keep_alive_ping_interval', |
347
|
|
|
], |
348
|
|
|
'Glossary' => [ |
349
|
|
|
'default_glossary_view', |
350
|
|
|
'allow_remove_tags_in_glossary_export', |
351
|
|
|
], |
352
|
|
|
'Forum' => [ |
353
|
|
|
'global_forums_course_id', |
354
|
|
|
'hide_forum_post_revision_language', |
355
|
|
|
'allow_forum_post_revisions', |
356
|
|
|
'forum_fold_categories', |
357
|
|
|
'allow_forum_category_language_filter', |
358
|
|
|
'subscribe_users_to_forum_notifications_also_in_base_course', |
359
|
|
|
], |
360
|
|
|
'Message' => [ |
361
|
|
|
'private_messages_about_user', |
362
|
|
|
'private_messages_about_user_visible_to_user', |
363
|
|
|
'social_enable_messages_feedback', |
364
|
|
|
'disable_dislike_option', |
365
|
|
|
'enable_message_tags', |
366
|
|
|
'allow_user_message_tracking', |
367
|
|
|
'filter_interactivity_messages', |
368
|
|
|
], |
369
|
|
|
'Display' => [ |
370
|
|
|
'hide_social_media_links', |
371
|
|
|
], |
372
|
|
|
'Social' => [ |
373
|
|
|
'social_show_language_flag_in_profile', |
374
|
|
|
'social_make_teachers_friend_all', |
375
|
|
|
], |
376
|
|
|
'Editor' => [ |
377
|
|
|
'save_titles_as_html', |
378
|
|
|
'full_ckeditor_toolbar_set', |
379
|
|
|
'ck_editor_block_image_copy_paste', |
380
|
|
|
'translate_html', |
381
|
|
|
'editor_driver_list', |
382
|
|
|
'enable_uploadimage_editor', |
383
|
|
|
'editor_settings', |
384
|
|
|
'video_context_menu_hidden', |
385
|
|
|
'video_player_renderers', |
386
|
|
|
], |
387
|
|
|
'Chat' => [ |
388
|
|
|
'hide_chat_video', |
389
|
|
|
'course_chat_restrict_to_coach', |
390
|
|
|
], |
391
|
|
|
'Survey' => [ |
392
|
|
|
'allow_required_survey_questions', |
393
|
|
|
'hide_survey_reporting_button', |
394
|
|
|
'allow_survey_availability_datetime', |
395
|
|
|
'survey_mark_question_as_required', |
396
|
|
|
'survey_anonymous_show_answered', |
397
|
|
|
'survey_question_dependency', |
398
|
|
|
'survey_allow_answered_question_edit', |
399
|
|
|
'survey_duplicate_order_by_name', |
400
|
|
|
'survey_backwards_enable', |
401
|
|
|
'allow_mandatory_survey', |
402
|
|
|
'hide_survey_edition', |
403
|
|
|
'survey_additional_teacher_modify_actions', |
404
|
|
|
'allow_survey_tool_in_lp', |
405
|
|
|
'show_surveys_base_in_sessions', |
406
|
|
|
], |
407
|
|
|
'Document' => [ |
408
|
|
|
'send_notification_when_document_added', |
409
|
|
|
'thematic_pdf_orientation', |
410
|
|
|
'certificate_pdf_orientation', |
411
|
|
|
'allow_general_certificate', |
412
|
|
|
'group_document_access', |
413
|
|
|
'group_category_document_access', |
414
|
|
|
'allow_compilatio_tool', |
415
|
|
|
'compilatio_tool', |
416
|
|
|
'documents_hide_download_icon', |
417
|
|
|
'enable_x_sendfile_headers', |
418
|
|
|
'documents_custom_cloud_link_list', |
419
|
|
|
], |
420
|
|
|
'Announcement' => [ |
421
|
|
|
'disable_delete_all_announcements', |
422
|
|
|
'admin_chamilo_announcements_disable', |
423
|
|
|
'disable_announcement_attachment', |
424
|
|
|
'allow_scheduled_announcements', |
425
|
|
|
'hide_announcement_sent_to_users_info', |
426
|
|
|
'send_all_emails_to', |
427
|
|
|
'allow_careers_in_global_announcements', |
428
|
|
|
'announcements_hide_send_to_hrm_users', |
429
|
|
|
'allow_coach_to_edit_announcements', |
430
|
|
|
'course_announcement_scheduled_by_date', |
431
|
|
|
], |
432
|
|
|
'Skill' => [ |
433
|
|
|
'allow_private_skills', |
434
|
|
|
'allow_teacher_access_student_skills', |
435
|
|
|
'skills_teachers_can_assign_skills', |
436
|
|
|
'hide_skill_levels', |
437
|
|
|
'table_of_hierarchical_skill_presentation', |
438
|
|
|
'skill_levels_names', |
439
|
|
|
'allow_skill_rel_items', |
440
|
|
|
], |
441
|
|
|
'Mail' => [ |
442
|
|
|
'update_users_email_to_dummy_except_admins', |
443
|
|
|
'hosting_total_size_limit', |
444
|
|
|
'mail_header_style', |
445
|
|
|
'mail_content_style', |
446
|
|
|
'allow_email_editor_for_anonymous', |
447
|
|
|
'messages_hide_mail_content', |
448
|
|
|
'send_two_inscription_confirmation_mail', |
449
|
|
|
'show_user_email_in_notification', |
450
|
|
|
'send_notification_score_in_percentage', |
451
|
|
|
'mail_template_system', |
452
|
|
|
'cron_notification_mails', |
453
|
|
|
'cron_notification_help_desk', |
454
|
|
|
'notifications_extended_footer_message', |
455
|
|
|
], |
456
|
|
|
'Work' => [ |
457
|
|
|
'block_student_publication_edition', |
458
|
|
|
'block_student_publication_add_documents', |
459
|
|
|
'block_student_publication_score_edition', |
460
|
|
|
'allow_only_one_student_publication_per_user', |
461
|
|
|
'allow_my_student_publication_page', |
462
|
|
|
'assignment_prevent_duplicate_upload', |
463
|
|
|
'considered_working_time', |
464
|
|
|
'force_download_doc_before_upload_work', |
465
|
|
|
'allow_redirect_to_main_page_after_work_upload', |
466
|
|
|
'my_courses_show_pending_work', |
467
|
|
|
], |
468
|
|
|
'Wiki' => [ |
469
|
|
|
'wiki_categories_enabled', |
470
|
|
|
'wiki_html_strict_filtering', |
471
|
|
|
], |
472
|
|
|
'Certificate' => [ |
473
|
|
|
'hide_my_certificate_link', |
474
|
|
|
'add_certificate_pdf_footer', |
475
|
|
|
], |
476
|
|
|
'Attendance' => [ |
477
|
|
|
'enable_sign_attendance_sheet', |
478
|
|
|
'attendance_calendar_set_duration', |
479
|
|
|
'attendance_allow_comments', |
480
|
|
|
], |
481
|
|
|
'Registration' => [ |
482
|
|
|
'required_extra_fields_in_inscription', |
483
|
|
|
'allow_fields_inscription', |
484
|
|
|
'send_inscription_msg_to_inbox', |
485
|
|
|
], |
486
|
|
|
]; |
487
|
|
|
foreach ($configurationValues as $category => $variables) { |
488
|
|
|
foreach ($variables as $variable) { |
489
|
|
|
$category = strtolower($category); |
490
|
|
|
$result = $connection |
491
|
|
|
->executeQuery( |
492
|
|
|
"SELECT COUNT(1) FROM settings_current WHERE variable = '$variable' AND category = '{$category}'" |
493
|
|
|
) |
494
|
|
|
; |
495
|
|
|
$count = $result->fetchNumeric()[0]; |
496
|
|
|
$selectedValue = $this->getConfigurationSelectedValue($variable); |
497
|
|
|
error_log('Migration: Setting variable '.$variable.' category '.$category.' value '.$selectedValue); |
498
|
|
|
|
499
|
|
|
// To use by default courses page if this option is not empty. |
500
|
|
|
if ('redirect_index_to_url_for_logged_users' === $variable && !empty($selectedValue)) { |
501
|
|
|
$selectedValue = 'courses'; |
502
|
|
|
} |
503
|
|
|
if (empty($count)) { |
504
|
|
|
$this->addSql( |
505
|
|
|
"INSERT INTO settings_current (access_url, variable, category, selected_value, title, access_url_changeable, access_url_locked) VALUES (1, '{$variable}', '{$category}', '{$selectedValue}', '{$variable}', 1, 1)" |
506
|
|
|
); |
507
|
|
|
} else { |
508
|
|
|
$this->addSql( |
509
|
|
|
"UPDATE settings_current SET selected_value = '{$selectedValue}', category = '{$category}' WHERE variable = '$variable' AND category = '{$category}'" |
510
|
|
|
); |
511
|
|
|
} |
512
|
|
|
} |
513
|
|
|
} |
514
|
|
|
|
515
|
|
|
// Rename setting for hierarchical skill presentation. |
516
|
|
|
$this->addSql( |
517
|
|
|
"UPDATE settings_current SET variable = 'skills_hierarchical_view_in_user_tracking', title = 'skills_hierarchical_view_in_user_tracking' WHERE variable = 'table_of_hierarchical_skill_presentation'" |
518
|
|
|
); |
519
|
|
|
|
520
|
|
|
// Insert extra fields required. |
521
|
|
|
$result = $connection |
522
|
|
|
->executeQuery( |
523
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'session_courses_read_only_mode' AND item_type = 2 AND value_type = 13" |
524
|
|
|
) |
525
|
|
|
; |
526
|
|
|
$count = $result->fetchNumeric()[0]; |
527
|
|
|
if (empty($count)) { |
528
|
|
|
$this->addSql( |
529
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1, 1, NOW())" |
530
|
|
|
); |
531
|
|
|
} |
532
|
|
|
|
533
|
|
|
// Insert extra fields required. |
534
|
|
|
$result = $connection |
535
|
|
|
->executeQuery( |
536
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'is_mandatory' AND item_type = 12 AND value_type = 13" |
537
|
|
|
) |
538
|
|
|
; |
539
|
|
|
$count = $result->fetchNumeric()[0]; |
540
|
|
|
if (empty($count)) { |
541
|
|
|
$this->addSql( |
542
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (12, 13, 'is_mandatory', 'IsMandatory', 1, 1, 1, NOW())" |
543
|
|
|
); |
544
|
|
|
} |
545
|
|
|
|
546
|
|
|
$result = $connection |
547
|
|
|
->executeQuery( |
548
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'show_in_catalogue' AND item_type = 2 AND value_type = 3" |
549
|
|
|
) |
550
|
|
|
; |
551
|
|
|
$count = $result->fetchNumeric()[0]; |
552
|
|
|
if (empty($count)) { |
553
|
|
|
$this->addSql( |
554
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (2, 3, 'show_in_catalogue', 'Show in catalogue', 1, 1, 0, NOW())" |
555
|
|
|
); |
556
|
|
|
$this->addSql( |
557
|
|
|
'SET @ef_id = LAST_INSERT_ID()' |
558
|
|
|
); |
559
|
|
|
$this->addSql( |
560
|
|
|
"INSERT INTO extra_field_options (field_id, option_value, display_text, priority, priority_message, option_order) VALUES (@ef_id, '1', 'Yes', NULL, NULL, 1), (@ef_id, '0', 'No', NULL, NULL, 2)" |
561
|
|
|
); |
562
|
|
|
} |
563
|
|
|
|
564
|
|
|
$result = $connection |
565
|
|
|
->executeQuery( |
566
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'multiple_language' AND item_type = 2 AND value_type = 5" |
567
|
|
|
) |
568
|
|
|
; |
569
|
|
|
$count = $result->fetchNumeric()[0]; |
570
|
|
|
if (empty($count)) { |
571
|
|
|
$this->addSql( |
572
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (2, 5, 'multiple_language', 'Multiple Language', 1, 1, 1, NOW())" |
573
|
|
|
); |
574
|
|
|
} |
575
|
|
|
|
576
|
|
|
$result = $connection |
577
|
|
|
->executeQuery( |
578
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'send_notification_at_a_specific_date' AND item_type = 21 AND value_type = 13" |
579
|
|
|
) |
580
|
|
|
; |
581
|
|
|
$count = $result->fetchNumeric()[0]; |
582
|
|
|
if (empty($count)) { |
583
|
|
|
$this->addSql( |
584
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (21, 13, 'send_notification_at_a_specific_date', 'Send notification at a specific date', 1, 1, 1, NOW())" |
585
|
|
|
); |
586
|
|
|
} |
587
|
|
|
|
588
|
|
|
$result = $connection |
589
|
|
|
->executeQuery( |
590
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'date_to_send_notification' AND item_type = 21 AND value_type = 6" |
591
|
|
|
) |
592
|
|
|
; |
593
|
|
|
$count = $result->fetchNumeric()[0]; |
594
|
|
|
if (empty($count)) { |
595
|
|
|
$this->addSql( |
596
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (21, 6, 'date_to_send_notification', 'Date to send notification', 1, 1, 1, NOW())" |
597
|
|
|
); |
598
|
|
|
} |
599
|
|
|
|
600
|
|
|
$result = $connection |
601
|
|
|
->executeQuery( |
602
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'send_to_users_in_session' AND item_type = 21 AND value_type = 13" |
603
|
|
|
) |
604
|
|
|
; |
605
|
|
|
$count = $result->fetchNumeric()[0]; |
606
|
|
|
if (empty($count)) { |
607
|
|
|
$this->addSql( |
608
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (21, 13, 'send_to_users_in_session', 'Send to users in session', 1, 1, 1, NOW())" |
609
|
|
|
); |
610
|
|
|
} |
611
|
|
|
|
612
|
|
|
$result = $connection |
613
|
|
|
->executeQuery( |
614
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'tags' AND item_type = 22 AND value_type = 10" |
615
|
|
|
) |
616
|
|
|
; |
617
|
|
|
$count = $result->fetchNumeric()[0]; |
618
|
|
|
if (empty($count)) { |
619
|
|
|
$this->addSql( |
620
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (22, 10, 'tags', 'Tags', 1, 1, 1, NOW())" |
621
|
|
|
); |
622
|
|
|
} |
623
|
|
|
|
624
|
|
|
$result = $connection |
625
|
|
|
->executeQuery( |
626
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'acquisition' AND item_type = 20 AND value_type = 3" |
627
|
|
|
) |
628
|
|
|
; |
629
|
|
|
$count = $result->fetchNumeric()[0]; |
630
|
|
|
if (empty($count)) { |
631
|
|
|
$this->addSql( |
632
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (20, 3, 'acquisition', 'Acquisition', 1, 1, 0, NOW())" |
633
|
|
|
); |
634
|
|
|
$this->addSql( |
635
|
|
|
'SET @ef_id = LAST_INSERT_ID()' |
636
|
|
|
); |
637
|
|
|
$this->addSql( |
638
|
|
|
"INSERT INTO extra_field_options (field_id, option_value, display_text, priority, priority_message, option_order) VALUES (@ef_id, '1', 'Acquired', NULL, NULL, 1), (@ef_id, '2', 'In the process of acquisition', NULL, NULL, 2), (@ef_id, '3', 'Not acquired', NULL, NULL, 3)" |
639
|
|
|
); |
640
|
|
|
} |
641
|
|
|
|
642
|
|
|
$result = $connection |
643
|
|
|
->executeQuery( |
644
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'invisible' AND item_type = 20 AND value_type = 13" |
645
|
|
|
) |
646
|
|
|
; |
647
|
|
|
$count = $result->fetchNumeric()[0]; |
648
|
|
|
if (empty($count)) { |
649
|
|
|
$this->addSql( |
650
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (20, 13, 'invisible', 'Invisible', 1, 1, 1, NOW())" |
651
|
|
|
); |
652
|
|
|
} |
653
|
|
|
|
654
|
|
|
$result = $connection |
655
|
|
|
->executeQuery( |
656
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'start_date' AND item_type = 7 AND value_type = 7" |
657
|
|
|
) |
658
|
|
|
; |
659
|
|
|
$count = $result->fetchNumeric()[0]; |
660
|
|
|
if (empty($count)) { |
661
|
|
|
$this->addSql( |
662
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (7, 7, 'start_date', 'StartDate', 1, 1, 1, NOW())" |
663
|
|
|
); |
664
|
|
|
} |
665
|
|
|
|
666
|
|
|
$result = $connection |
667
|
|
|
->executeQuery( |
668
|
|
|
"SELECT COUNT(1) FROM extra_field WHERE variable = 'end_date' AND item_type = 7 AND value_type = 7" |
669
|
|
|
) |
670
|
|
|
; |
671
|
|
|
$count = $result->fetchNumeric()[0]; |
672
|
|
|
if (empty($count)) { |
673
|
|
|
$this->addSql( |
674
|
|
|
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (7, 7, 'end_date', 'EndDate', 1, 1, 1, NOW())" |
675
|
|
|
); |
676
|
|
|
} |
677
|
|
|
} |
678
|
|
|
|
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
|
|
|
); |
1269
|
|
|
} |
1270
|
|
|
} |
1271
|
|
|
|
1272
|
|
|
public function getConfigurationSelectedValue(string $variable): string |
1273
|
|
|
{ |
1274
|
|
|
global $_configuration; |
1275
|
|
|
$container = $this->getContainer(); |
1276
|
|
|
$kernel = $container->get('kernel'); |
1277
|
|
|
$rootPath = $kernel->getProjectDir(); |
1278
|
|
|
$oldConfigPath = $rootPath.'/config/configuration.php'; |
1279
|
|
|
$configFileLoaded = \in_array($oldConfigPath, get_included_files(), true); |
1280
|
|
|
if (!$configFileLoaded) { |
1281
|
|
|
include_once $oldConfigPath; |
1282
|
|
|
} |
1283
|
|
|
|
1284
|
|
|
$selectedValue = ''; |
1285
|
|
|
$settingValue = $this->getConfigurationValue($variable, $_configuration); |
1286
|
|
|
if (\is_array($settingValue)) { |
1287
|
|
|
$selectedValue = json_encode($settingValue, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); |
1288
|
|
|
} elseif (\is_bool($settingValue)) { |
1289
|
|
|
$selectedValue = var_export($settingValue, true); |
1290
|
|
|
} else { |
1291
|
|
|
$selectedValue = (string) $settingValue; |
1292
|
|
|
} |
1293
|
|
|
|
1294
|
|
|
return $selectedValue; |
1295
|
|
|
} |
1296
|
|
|
} |
1297
|
|
|
|