Internal: Clean up duplicated and deprecated settings - refs #5316

pull/5371/head
christianbeeznst 8 months ago
parent 20187ce9a2
commit d5e5be7002
  1. 4
      public/main/admin/update_schema.php
  2. 19
      public/main/admin/user_add.php
  3. 5
      public/main/admin/user_edit.php
  4. 2
      public/main/announcements/announcements.php
  5. 13
      public/main/auth/profile.php
  6. 5
      public/main/cron/hosting_total_size_limit.php
  7. 2
      public/main/cron/import_csv.php
  8. 6
      public/main/cron/update_session_status.php
  9. 4
      public/main/gradebook/gradebook_display_summary.php
  10. 4
      public/main/gradebook/index.php
  11. 4
      public/main/gradebook/lib/GradebookUtils.php
  12. 14
      public/main/gradebook/lib/flatview_data_generator.class.php
  13. 14
      public/main/inc/ajax/model.ajax.php
  14. 5
      public/main/inc/ajax/statistics.ajax.php
  15. 2
      public/main/inc/lib/document.lib.php
  16. 4
      public/main/inc/lib/extra_field.lib.php
  17. 16
      public/main/inc/lib/message.lib.php
  18. 145
      public/main/inc/lib/sessionmanager.lib.php
  19. 9
      public/main/inc/lib/template.lib.php
  20. 8
      public/main/inc/lib/tracking.lib.php
  21. 2
      public/main/lp/learnpath.class.php
  22. 4
      public/main/portfolio/index.php
  23. 22
      public/main/search/load_search.php
  24. 17
      public/main/survey/edit_meeting.php
  25. 6
      public/main/survey/fillsurvey.php
  26. 6
      public/main/survey/preview.php
  27. 77
      public/main/survey/survey.lib.php
  28. 13
      public/main/survey/surveyUtil.class.php
  29. 13
      public/main/survey/survey_question.php
  30. 22
      src/CoreBundle/Controller/Admin/IndexBlocksController.php
  31. 12
      src/CoreBundle/Controller/PlatformConfigurationController.php
  32. 7
      src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php
  33. 3
      src/CoreBundle/Migrations/Schema/V200/Version20170627122900.php
  34. 60
      src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php
  35. 2
      src/CoreBundle/Settings/AdminSettingsSchema.php
  36. 10
      src/CoreBundle/Settings/AgendaSettingsSchema.php
  37. 6
      src/CoreBundle/Settings/AnnouncementSettingsSchema.php
  38. 2
      src/CoreBundle/Settings/CertificateSettingsSchema.php
  39. 17
      src/CoreBundle/Settings/CourseSettingsSchema.php
  40. 2
      src/CoreBundle/Settings/DisplaySettingsSchema.php
  41. 17
      src/CoreBundle/Settings/DocumentSettingsSchema.php
  42. 2
      src/CoreBundle/Settings/EditorSettingsSchema.php
  43. 2
      src/CoreBundle/Settings/ExerciseSettingsSchema.php
  44. 5
      src/CoreBundle/Settings/GradebookSettingsSchema.php
  45. 18
      src/CoreBundle/Settings/LearningPathSettingsSchema.php
  46. 17
      src/CoreBundle/Settings/MailSettingsSchema.php
  47. 2
      src/CoreBundle/Settings/MessageSettingsSchema.php
  48. 77
      src/CoreBundle/Settings/PlatformSettingsSchema.php
  49. 2
      src/CoreBundle/Settings/ProfileSettingsSchema.php
  50. 6
      src/CoreBundle/Settings/SearchSettingsSchema.php
  51. 3
      src/CoreBundle/Settings/SecuritySettingsSchema.php
  52. 6
      src/CoreBundle/Settings/SessionSettingsSchema.php
  53. 6
      src/CoreBundle/Settings/SettingsManager.php
  54. 10
      src/CoreBundle/Settings/SurveySettingsSchema.php
  55. 3
      src/CoreBundle/Settings/WebServiceSettingsSchema.php
  56. 6
      src/CourseBundle/Component/CourseCopy/CourseBuilder.php
  57. 6
      src/CourseBundle/Component/CourseCopy/CourseRestorer.php
  58. 5
      src/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php

@ -8,10 +8,6 @@ require_once __DIR__.'/../inc/global.inc.php';
// Access restrictions
api_protect_admin_script(true);
if ('false' === api_get_setting('platform.sync_db_with_schema')) {
api_not_allowed(true);
}
$em = Database::getManager();
$connection = Database::getManager()->getConnection();
$sm = $connection->createSchemaManager();

@ -296,17 +296,14 @@ $returnParams = $extraField->addElements(
true
);
$allowEmailTemplate = ('true' === api_get_setting('mail.mail_template_system'));
if ($allowEmailTemplate) {
$form->addEmailTemplate(
[
'subject_registration_platform.tpl',
'content_registration_platform.tpl',
'new_user_first_email_confirmation.tpl',
'new_user_second_email_confirmation.tpl',
]
);
}
$form->addEmailTemplate(
[
'subject_registration_platform.tpl',
'content_registration_platform.tpl',
'new_user_first_email_confirmation.tpl',
'new_user_second_email_confirmation.tpl',
]
);
$jquery_ready_content = $returnParams['jquery_ready_content'];

@ -346,10 +346,7 @@ $returnParams = $extraField->addElements(
);
$jqueryReadyContent = $returnParams['jquery_ready_content'];
$allowEmailTemplate = ('true' === api_get_setting('mail.mail_template_system'));
if ($allowEmailTemplate) {
$form->addEmailTemplate(['user_edit_content.tpl']);
}
$form->addEmailTemplate(['user_edit_content.tpl']);
// the $jqueryReadyContent variable collects all functions that will be load in the
$htmlHeadXtra[] = '<script>

@ -606,7 +606,7 @@ switch ($action) {
);
}
$config = api_get_configuration_value('announcement.hide_send_to_hrm_users');
$config = api_get_setting('announcement.announcements_hide_send_to_hrm_users');
if (false === $config) {
$form->addCheckBox(

@ -81,7 +81,7 @@ if ('true' === api_get_setting('allow_message_tool')) {
EOF;
}
$tool_name = 'true' === api_get_setting('profile.is_editable') ? get_lang('Edit Profile') : get_lang('View my e-portfolio');
$tool_name = get_lang('View my e-portfolio');
$table_user = Database::get_main_table(TABLE_MAIN_USER);
/*
@ -190,7 +190,7 @@ $form->applyFilter('phone', 'trim');
$form->applyFilter('phone', 'html_filter');
// PICTURE
if ('true' === api_get_setting('profile.is_editable') && in_array('picture', $profileList)) {
if (in_array('picture', $profileList)) {
$form->addFile(
'picture',
[
@ -226,7 +226,7 @@ if (!in_array('language', $profileList)) {
}
// THEME
if ('true' === api_get_setting('profile.is_editable') && 'true' === api_get_setting('user_selected_theme')) {
if ('true' === api_get_setting('user_selected_theme')) {
$form->addSelectTheme('theme', get_lang('Graphical theme'));
if (!in_array('theme', $profileList)) {
$form->freeze('theme');
@ -300,7 +300,6 @@ if ('true' === api_get_setting('extended_profile')) {
// PASSWORD, if auth_source is platform
if (PLATFORM_AUTH_SOURCE == $user_data['auth_source'] &&
'true' === api_get_setting('profile.is_editable') &&
in_array('password', $profileList)
) {
$form->addElement('password', 'password0', [get_lang('Pass'), get_lang('Enter2passToChange')], ['size' => 40]);
@ -348,11 +347,7 @@ if (in_array('apikeys', $profileList)) {
);
}
// SUBMIT
if ('true' === api_get_setting('profile.is_editable')) {
$form->addButtonUpdate(get_lang('Save settings'), 'apply_change');
} else {
$form->freeze();
}
$form->addButtonUpdate(get_lang('Save settings'), 'apply_change');
// Student cannot modified their user conditions
$extraConditions = api_get_setting('profile.show_conditions_to_user', true);

@ -12,11 +12,6 @@ require_once __DIR__.'/../inc/global.inc.php';
*/
function isTotalPortalSizeBiggerThanLimit($debug = true)
{
$sizeLimit = (int) api_get_setting('mail.hosting_total_size_limit');
if (empty($sizeLimit)) {
return true;
}
$updateFile = true;
$file = api_get_path(SYS_COURSE_PATH).'hosting_total_size.php';

@ -3201,7 +3201,7 @@ class ImportCsv
}
$logger = new Logger('cron');
$emails = api_get_setting('mail.cron_notification_mails', true);
$emails = api_get_setting('mail.cron_notification_help_desk', true);
$minLevel = Logger::DEBUG;

@ -6,12 +6,6 @@ require_once __DIR__.'/../inc/global.inc.php';
$test = true;
$sessionStatusAllowed = api_get_setting('session.allow_session_status');
if (!$sessionStatusAllowed) {
echo '"allow_session_status" setting is not activated.';
exit;
}
$em = Database::getManager();
$table = Database::get_main_table(TABLE_MAIN_SESSION);
$sql = "SELECT * FROM $table ";

@ -29,10 +29,6 @@ $userList = CourseManager::getUserListFromCourseId(
$loadStats = [];
if ('true' === api_get_setting('gradebook_detailed_admin_view')) {
$loadStats = [1, 2, 3];
} else {
if ('true' === api_get_setting('gradebook.gradebook_enable_best_score')) {
$loadStats = [2];
}
}
/*Session::write('use_gradebook_cache', false);

@ -1004,10 +1004,6 @@ if (isset($first_time) && 1 == $first_time && api_is_allowed_to_edit(null, true)
if (!$isAllow) {
if ('true' === api_get_setting('gradebook_detailed_admin_view')) {
$loadStats = [1, 2, 3];
} else {
if ('true' === api_get_setting('gradebook.gradebook_enable_best_score')) {
$loadStats = [2];
}
}
}

@ -1510,10 +1510,6 @@ class GradebookUtils
$loadStats = [];
if ('true' === api_get_setting('gradebook_detailed_admin_view')) {
$loadStats = [1, 2, 3];
} else {
if ('true' === api_get_setting('gradebook.gradebook_enable_best_score')) {
$loadStats = [2];
}
}
$gradebooktable = new GradebookTable(

@ -488,7 +488,7 @@ class FlatViewDataGenerator
$item_value = $percentage * $item_value;
$item_total += $sub_cat->get_weight();
if ('false' === api_get_setting('gradebook_show_percentage_in_reports')) {
//if ('false' === api_get_setting('gradebook_show_percentage_in_reports')) {
$defaultShowPercentageValue = SCORE_SIMPLE;
if (!empty($style)) {
$defaultShowPercentageValue = $style;
@ -504,7 +504,7 @@ class FlatViewDataGenerator
null
);
$temp_score = Display::tip($real_score, $temp_score);
} else {
/*} else {
$real_score = $scoreDisplay->display_score(
$real_score,
SCORE_DIV_PERCENT,
@ -516,7 +516,7 @@ class FlatViewDataGenerator
null
);
$temp_score = Display::tip($temp_score, $real_score);
}
}*/
if (!isset($this->params['only_total_category']) ||
(isset($this->params['only_total_category']) &&
@ -650,7 +650,7 @@ class FlatViewDataGenerator
if (!empty($style)) {
$defaultStyle = (int) $style;
}
$showPercentage = api_get_setting('gradebook_show_percentage_in_reports');
//$showPercentage = api_get_setting('gradebook_show_percentage_in_reports');
for ($count = 0; $count < $items_count && ($items_start + $count < count($this->evals_links)); $count++) {
/** @var AbstractLink $item */
$item = $this->evals_links[$count + $items_start];
@ -703,7 +703,7 @@ class FlatViewDataGenerator
SCORE_ONLY_SCORE
);
if ('false' === $showPercentage) {
//if ('false' === $showPercentage) {
$defaultShowPercentageValue = SCORE_SIMPLE;
if (!empty($style)) {
$defaultShowPercentageValue = $style;
@ -717,13 +717,13 @@ class FlatViewDataGenerator
SCORE_DIV_SIMPLE_WITH_CUSTOM
);
$temp_score = Display::tip($real_score, $temp_score);
} else {
/*} else {
$temp_score = $scoreDisplay->display_score(
$real_score,
$defaultStyle
);
$temp_score = Display::tip($temp_score, $complete_score);
}
}*/
if (!empty($model)) {
$scoreToShow = '';

@ -822,14 +822,12 @@ switch ($action) {
}
}
if ('true' === api_get_setting('session.allow_session_status')) {
if (isset($filters->filter_status)) {
$sStatus = (int) $filters->filter_status;
$whereCondition .= ' AND s.status = '.$sStatus;
} else {
if ($listType === 'custom') {
$whereCondition .= ' AND (s.status IN ("'.SessionManager::STATUS_PLANNED.'", "'.SessionManager::STATUS_PROGRESS.'") ) ';
}
if (isset($filters->filter_status)) {
$sStatus = (int) $filters->filter_status;
$whereCondition .= ' AND s.status = '.$sStatus;
} else {
if ($listType === 'custom') {
$whereCondition .= ' AND (s.status IN ("'.SessionManager::STATUS_PLANNED.'", "'.SessionManager::STATUS_PROGRESS.'") ) ';
}
}

@ -624,11 +624,6 @@ switch ($action) {
$table = $table['table'];
break;
case 'status':
$sessionStatusAllowed = ('true' === api_get_setting('session.allow_session_status'));
if (!$sessionStatusAllowed) {
exit;
}
$sql = "SELECT count(id) count, status FROM $table
WHERE
(

@ -413,7 +413,7 @@ class DocumentManager
return true;
} else {
// no forced download, just let the browser decide what to do according to the mimetype
$lpFixedEncoding = 'true' === api_get_setting('lp.fixed_encoding');
$lpFixedEncoding = 'true' === api_get_setting('lp.lp_fixed_encoding');
// Commented to let courses content to be cached in order to improve performance:
//header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');

@ -190,9 +190,7 @@ class ExtraField extends Model
if ('true' === api_get_setting('announcement.allow_scheduled_announcements')) {
$result[] = 'scheduled_announcement';
}
if ('true' === api_get_setting('platform.allow_portfolio_tool')) {
$result[] = 'portfolio';
}
$result[] = 'portfolio';
sort($result);
return $result;

@ -1434,15 +1434,13 @@ class MessageManager
);
$layoutContent = '';
$emailbody = '';
if ('true' === api_get_setting('mail.mail_template_system')) {
$mailTemplateManager = new MailTemplateManager();
$templateText = $mailTemplateManager->getTemplateByType('new_user_mail_to_admin_approval.tpl');
if (empty($templateText)) {
} else {
// custom procedure to load a template as a string (doesn't use cache so may slow down)
$template = $tplMailBody->twig->createTemplate($templateText);
$emailbody = $template->render($tplMailBody->params);
}
$mailTemplateManager = new MailTemplateManager();
$templateText = $mailTemplateManager->getTemplateByType('new_user_mail_to_admin_approval.tpl');
if (empty($templateText)) {
} else {
// custom procedure to load a template as a string (doesn't use cache so may slow down)
$template = $tplMailBody->twig->createTemplate($templateText);
$emailbody = $template->render($tplMailBody->params);
}
if (empty($emailbody)) {
$layoutContent = $tplMailBody->get_template('mail/new_user_mail_to_admin_approval.tpl');

@ -258,15 +258,8 @@ class SessionManager
$session->setDisplayEndDate($displayEndDate);
$session->setCoachAccessStartDate($coachStartDate);
$session->setCoachAccessEndDate($coachEndDate);
$session->setStatus($status);
if (!empty($sessionCategoryId)) {
//$session->setCategory($category);
//$values['session_category_id'] = $sessionCategoryId;
}
if ('true' === api_get_setting('session.allow_session_status')) {
$session->setStatus($status);
}
$em = Database::getManager();
$em->persist($session);
@ -528,10 +521,7 @@ class SessionManager
if (!empty($extraFieldsToLoad)) {
$select = "SELECT DISTINCT s.* ";
}
if ('true' === api_get_setting('session.allow_session_status')) {
$select .= ', status';
}
$select .= ', status';
if (isset($options['order'])) {
$isMakingOrder = 0 === strpos($options['order'], 'category_name');
@ -1931,10 +1921,7 @@ class SessionManager
} else {
$sessionEntity->setCategory(null);
}
if ('true' === api_get_setting('session.allow_session_status')) {
$sessionEntity->setStatus($status);
}
$sessionEntity->setStatus($status);
$em->flush();
@ -8048,17 +8035,15 @@ class SessionManager
]
);
if ('true' === api_get_setting('session.allow_session_status')) {
$statusList = self::getStatusList();
$form->addSelect(
'status',
get_lang('SessionStatus'),
$statusList,
[
'id' => 'status',
]
);
}
$statusList = self::getStatusList();
$form->addSelect(
'status',
get_lang('SessionStatus'),
$statusList,
[
'id' => 'status',
]
);
$form->addHtmlEditor(
'description',
@ -8542,27 +8527,26 @@ class SessionManager
];
}
if ('true' === api_get_setting('session.allow_session_status')) {
$columns[] = get_lang('SessionStatus');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
$listToString .= $statusId.':'.$status.';';
}
$columnModel[] = [
'name' => 'status',
'index' => 'status',
'align' => 'left',
'search' => 'true',
'stype' => 'select',
// for the bottom bar
'searchoptions' => [
'defaultValue' => '1',
'value' => $listToString,
],
];
$columns[] = get_lang('SessionStatus');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
$listToString .= $statusId.':'.$status.';';
}
$columnModel[] = [
'name' => 'status',
'index' => 'status',
'align' => 'left',
'search' => 'true',
'stype' => 'select',
// for the bottom bar
'searchoptions' => [
'defaultValue' => '1',
'value' => $listToString,
],
];
break;
case 'simple':
@ -8643,22 +8627,21 @@ class SessionManager
];
}
if ('true' === api_get_setting('session.allow_session_status')) {
$columns[] = get_lang('SessionStatus');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
$listToString .= $statusId.':'.$status.';';
}
$columnModel[] = ['name' => 'status', 'index' => 'status', 'align' => 'left', 'search' => 'true', 'stype' => 'select',
// for the bottom bar
'searchoptions' => [
'defaultValue' => '1',
'value' => $listToString,
],
];
$columns[] = get_lang('SessionStatus');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
$listToString .= $statusId.':'.$status.';';
}
$columnModel[] = ['name' => 'status', 'index' => 'status', 'align' => 'left', 'search' => 'true', 'stype' => 'select',
// for the bottom bar
'searchoptions' => [
'defaultValue' => '1',
'value' => $listToString,
],
];
break;
case 'complete':
$columns = [
@ -8812,28 +8795,26 @@ class SessionManager
];
}
if ('true' === api_get_setting('session.allow_session_status')) {
$columns[] = get_lang('SessionStatus');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
$listToString .= $statusId.':'.$status.';';
}
$columnModel[] = [
'name' => 'status',
'index' => 'status',
'align' => 'left',
'search' => 'true',
'stype' => 'select',
// for the bottom bar
'searchoptions' => [
'defaultValue' => '1',
'value' => $listToString,
],
];
$columns[] = get_lang('SessionStatus');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
$listToString .= $statusId.':'.$status.';';
}
$columnModel[] = [
'name' => 'status',
'index' => 'status',
'align' => 'left',
'search' => 'true',
'stype' => 'select',
// for the bottom bar
'searchoptions' => [
'defaultValue' => '1',
'value' => $listToString,
],
];
break;
}

@ -823,14 +823,9 @@ class Template
*
* @return string
*/
public static function getThemeFallback()
public static function getThemeFallback(): string
{
$theme = api_get_setting('platform.theme_fallback');
if (empty($theme)) {
$theme = 'chamilo';
}
return $theme;
return 'chamilo';
}
/**

@ -7855,11 +7855,11 @@ class Tracking
$columnHeaders['student_follow_page_add_LP_subscription_info'] = get_lang('Unlock');
}
if ('true' === api_get_setting('lp.student_follow_page_add_LP_acquisition_info')) {
$columnHeaders['student_follow_page_add_LP_acquisition_info'] = get_lang('Acquisition');
if ('true' === api_get_setting('lp.student_follow_page_add_lp_acquisition_info')) {
$columnHeaders['student_follow_page_add_lp_acquisition_info'] = get_lang('Acquisition');
}
$addLpInvisibleCheckbox = api_get_configuration_value('student_follow_page_add_LP_invisible_checkbox');
$addLpInvisibleCheckbox = api_get_setting('lp.student_follow_page_add_lp_invisible_checkbox');
$columnHeadersKeys = array_keys($columnHeaders);
@ -8004,7 +8004,7 @@ class Tracking
);
}
if (in_array('student_follow_page_add_LP_acquisition_info', $columnHeadersKeys)) {
if (in_array('student_follow_page_add_lp_acquisition_info', $columnHeadersKeys)) {
$learningpathData[] = StudentFollowPage::getLpAcquisition(
$learnpath,
$userId,

@ -6383,7 +6383,7 @@ class learnpath
];
$form->addGroup($group, null, get_lang('If file exists:'));
$fileExistsOption = api_get_setting('document_if_file_exists_option');
$fileExistsOption = api_get_setting('document.document_if_file_exists_option');
$defaultFileExistsOption = 'rename';
if (!empty($fileExistsOption)) {
$defaultFileExistsOption = $fileExistsOption;

@ -15,10 +15,6 @@ require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
if ('true' !== api_get_setting('platform.allow_portfolio_tool')) {
api_not_allowed(true);
}
$em = Database::getManager();
$currentUserId = api_get_user_id();

@ -511,19 +511,17 @@ $userForm->addEndPanel();
$form->addButtonSave(get_lang('Save Diagnostic Changes'), 'save');
// Get list of session status
if (api_get_configuration_value('allow_session_status')) {
$statusList = SessionManager::getStatusList();
$statusSelectList[0] = ' -- '.get_lang('All').' --';
foreach ($statusList as $nro => $name) {
$statusSelectList[$nro] = $name;
}
$form->addSelect(
'filter_status',
get_lang('SessionStatus'),
$statusSelectList,
['id' => 'filter_status']
);
$statusList = SessionManager::getStatusList();
$statusSelectList[0] = ' -- '.get_lang('All').' --';
foreach ($statusList as $nro => $name) {
$statusSelectList[$nro] = $name;
}
$form->addSelect(
'filter_status',
get_lang('SessionStatus'),
$statusSelectList,
['id' => 'filter_status']
);
$form->addButtonSearch(get_lang('Search Sessions'), 'search');

@ -56,19 +56,10 @@ $form->addHidden('visible_results', '0');
$form->addHidden('survey_type', 3);
$text = $form->addText('survey_title', get_lang('Title'));
$allowSurveyAvailabilityDatetime = ('true' === api_get_setting('survey.allow_survey_availability_datetime'));
if ($allowSurveyAvailabilityDatetime) {
$form->addDateTimePicker('start_date', get_lang('Start Date'));
$form->addDateTimePicker('end_date', get_lang('End Date'));
$form->addRule('start_date', get_lang('Invalid date'), 'datetime');
$form->addRule('end_date', get_lang('Invalid date'), 'datetime');
} else {
$form->addDatePicker('start_date', get_lang('Start Date'));
$form->addDatePicker('end_date', get_lang('End Date'));
$form->addRule('start_date', get_lang('Invalid date'), 'date');
$form->addRule('end_date', get_lang('Invalid date'), 'date');
}
$form->addDateTimePicker('start_date', get_lang('Start Date'));
$form->addDateTimePicker('end_date', get_lang('End Date'));
$form->addRule('start_date', get_lang('Invalid date'), 'datetime');
$form->addRule('end_date', get_lang('Invalid date'), 'datetime');
$form->addRule(
['start_date', 'end_date'],

@ -38,7 +38,7 @@ $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION
$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$allowRequiredSurveyQuestions = ('true' === api_get_setting('survey.allow_required_survey_questions'));
$allowRequiredSurveyQuestions = true;
// Check if user is anonymous or not
$isAnonymous = false;
@ -674,9 +674,7 @@ if ((isset($_GET['show']) && '' != $_GET['show']) ||
$paged_questions = [];
// If non-conditional survey
$select = '';
if ('true' === api_get_setting('survey.survey_question_dependency')) {
$select = ' survey_question.parent_id, survey_question.parent_option_id, ';
}
$select = ' survey_question.parent_id, survey_question.parent_option_id, ';
// If non-conditional survey
if (0 === $survey->getSurveyType()) {

@ -36,7 +36,7 @@ $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION
$course_id = api_get_course_int_id();
$courseInfo = api_get_course_info();
$allowRequiredSurveyQuestions = ('true' === api_get_setting('survey.allow_required_survey_questions'));
$allowRequiredSurveyQuestions = true;
// Breadcrumbs
$interbreadcrumb[] = [
@ -116,9 +116,7 @@ if (isset($_GET['show'])) {
if (array_key_exists($_GET['show'], $paged_questions)) {
$select = '';
if ('true' === api_get_setting('survey.survey_question_dependency')) {
$select = ' survey_question.parent_id, survey_question.parent_option_id, ';
}
$select = ' survey_question.parent_id, survey_question.parent_option_id, ';
$sql = "SELECT
survey_question.iid question_id,
survey_question.survey_id,

@ -688,10 +688,8 @@ class SurveyManager
'survey_group_sec2' => $row['survey_group_sec2'],
];
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
$insertId = Database::insert($table_survey_question, $params);
@ -896,9 +894,7 @@ class SurveyManager
$return['horizontalvertical'] = $row['display'];
$return['shared_question_id'] = $row['shared_question_id'];
$return['maximum_score'] = $row['max_value'];
$return['is_required'] = ('true' === api_get_setting('survey.allow_required_survey_questions'))
? $row['is_required']
: false;
$return['is_required'] = $row['is_required'];
if (0 != $row['survey_group_pri']) {
$return['assigned'] = $row['survey_group_pri'];
@ -1057,21 +1053,17 @@ class SurveyManager
->setSharedQuestionId((int) $form_content['shared_question_id'])
;
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
$question->setIsMandatory(isset($form_content['is_required']));
}
if ('true' === api_get_setting('survey.survey_question_dependency')) {
$params['parent_id'] = 0;
$params['parent_option_id'] = 0;
if (isset($form_content['parent_id']) &&
isset($form_content['parent_option_id']) &&
!empty($form_content['parent_id']) &&
!empty($form_content['parent_option_id'])
) {
$params['parent_id'] = $form_content['parent_id'];
$params['parent_option_id'] = $form_content['parent_option_id'];
}
$question->setIsMandatory(isset($form_content['is_required']));
$params['parent_id'] = 0;
$params['parent_option_id'] = 0;
if (isset($form_content['parent_id']) &&
isset($form_content['parent_option_id']) &&
!empty($form_content['parent_id']) &&
!empty($form_content['parent_option_id'])
) {
$params['parent_id'] = $form_content['parent_id'];
$params['parent_option_id'] = $form_content['parent_option_id'];
}
$em->persist($question);
@ -1113,21 +1105,16 @@ class SurveyManager
->setMaxValue($maxScore)
;
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
$question->isMandatory(isset($form_content['is_required']));
}
if ('true' === api_get_setting('survey.survey_question_dependency')) {
$params['parent_id'] = 0;
$params['parent_option_id'] = 0;
if (isset($form_content['parent_id']) &&
isset($form_content['parent_option_id']) &&
!empty($form_content['parent_id']) &&
!empty($form_content['parent_option_id'])
) {
$question->setParent($repo->find($form_content['parent_id']));
$question->setParentOption($repoOption->find($form_content['parent_option_id']));
}
$question->isMandatory(isset($form_content['is_required']));
$params['parent_id'] = 0;
$params['parent_option_id'] = 0;
if (isset($form_content['parent_id']) &&
isset($form_content['parent_option_id']) &&
!empty($form_content['parent_id']) &&
!empty($form_content['parent_option_id'])
) {
$question->setParent($repo->find($form_content['parent_id']));
$question->setParentOption($repoOption->find($form_content['parent_option_id']));
}
$em->persist($question);
@ -1763,10 +1750,8 @@ class SurveyManager
'survey_group_sec2' => $row['survey_group_sec2'],
];
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
$insertId = Database::insert($surveyQuestionTable, $params);
@ -1845,10 +1830,8 @@ class SurveyManager
'survey_group_sec1' => $row['survey_group_sec1'],
'survey_group_sec2' => $row['survey_group_sec2'],
];
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
// Get question position
$sqlSort = "SELECT max(sort) as sort FROM $questionTable
@ -2074,10 +2057,6 @@ class SurveyManager
public static function hasDependency(CSurvey $survey)
{
if ('false' === api_get_setting('survey.survey_question_dependency')) {
return false;
}
$surveyId = $survey->getIid();
$table = Database::get_course_table(TABLE_SURVEY_QUESTION);

@ -3282,7 +3282,6 @@ class SurveyUtil
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$mandatoryAllowed = ('true' === api_get_setting('survey.allow_mandatory_survey'));
$allowSurveyAvailabilityDatetime = ('true' === api_get_setting('survey.allow_survey_availability_datetime'));
// Searching
$search_restriction = self::survey_search_restriction();
@ -3371,7 +3370,7 @@ class SurveyUtil
if (null !== $from) {
$array[5] = api_convert_and_format_date(
$from,
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
DATE_TIME_FORMAT_LONG
);
}
$till = $survey->getAvailTill() ? $survey->getAvailTill()->format('Y-m-d H:i:s') : null;
@ -3379,7 +3378,7 @@ class SurveyUtil
if (null !== $till) {
$array[6] = api_convert_and_format_date(
$till,
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
DATE_TIME_FORMAT_LONG
);
}
@ -3432,7 +3431,6 @@ class SurveyUtil
public static function get_survey_data_for_coach($from, $number_of_items, $column, $direction)
{
$mandatoryAllowed = ('true' === api_get_setting('survey.allow_mandatory_survey'));
$allowSurveyAvailabilityDatetime = ('true' === api_get_setting('survey.allow_survey_availability_datetime'));
$repo = Container::getSurveyRepository();
$qb = $repo->findAllByCourse(
api_get_course_entity(),
@ -3496,11 +3494,11 @@ class SurveyUtil
while ($survey = Database::fetch_array($res)) {
$survey['col5'] = api_convert_and_format_date(
$survey['col5'],
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
DATE_TIME_FORMAT_LONG
);
$survey['col6'] = api_convert_and_format_date(
$survey['col6'],
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
DATE_TIME_FORMAT_LONG
);
if ($mandatoryAllowed) {
@ -3534,7 +3532,6 @@ class SurveyUtil
$user_id = (int) $user_id;
$sessionId = api_get_session_id();
$mandatoryAllowed = ('true' === api_get_setting('survey.allow_mandatory_survey'));
$allowSurveyAvailabilityDatetime = ('true' === api_get_setting('survey.allow_survey_availability_datetime'));
// Database table definitions
$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
@ -3554,7 +3551,7 @@ class SurveyUtil
/** @var \DateTime $now */
$now = api_get_utc_datetime(null, false, true);
$filterDate = $allowSurveyAvailabilityDatetime ? $now->format('Y-m-d H:i') : $now->format('Y-m-d');
$filterDate = $now->format('Y-m-d H:i');
$sessionCondition = api_get_session_condition($sessionId, true, false, 'survey_invitation.session_id');
$sql = "SELECT

@ -200,10 +200,6 @@ class survey_question
break;
}
if ('false' === api_get_setting('survey.survey_question_dependency')) {
$allowParent = false;
}
$icon = Display::getMdiIcon(
SurveyManager::icon_question($type),
'ch-tool-icon',
@ -240,8 +236,7 @@ class survey_question
$config
);
if (('true' === api_get_setting('survey.allow_required_survey_questions')) &&
in_array($_GET['type'], ['yesno', 'multiplechoice'])) {
if (in_array($_GET['type'], ['yesno', 'multiplechoice'])) {
$form->addCheckBox('is_required', get_lang('Mandatory?'), get_lang('Yes'));
}
@ -577,9 +572,6 @@ class survey_question
*/
public static function getParents($questionId, $list = [])
{
if ('false' === api_get_setting('survey.survey_question_dependency')) {
return $list;
}
$courseId = api_get_course_int_id();
$questionId = (int) $questionId;
@ -692,9 +684,6 @@ class survey_question
*/
public static function getDependency(array $question): ?array
{
if ('false' === api_get_setting('survey.survey_question_dependency')) {
return [];
}
$questionId = $question['question_id'];
$em = Database::getManager();

@ -467,13 +467,11 @@ class IndexBlocksController extends BaseController
];
}
if ('true' === $this->settingsManager->getSetting('mail.mail_template_system')) {
$items[] = [
'class' => 'item-mail-template',
'url' => $this->generateUrl('legacy_main', ['name' => 'mail_template/list.php']),
'label' => $this->translator->trans('Mail templates'),
];
}
$items[] = [
'class' => 'item-mail-template',
'url' => $this->generateUrl('legacy_main', ['name' => 'mail_template/list.php']),
'label' => $this->translator->trans('Mail templates'),
];
if ('true' === api_get_setting('platform.notification_event')) {
$items[] = [
@ -649,12 +647,10 @@ class IndexBlocksController extends BaseController
'label' => $this->translator->trans('Tickets'),
];
if ('true' === $this->settingsManager->getSetting('session.allow_session_status')) {
$items[] = [
'url' => $this->generateUrl('legacy_main', ['name' => 'session/cron_status.php']),
'label' => $this->translator->trans('Update session status'),
];
}
$items[] = [
'url' => $this->generateUrl('legacy_main', ['name' => 'session/cron_status.php']),
'label' => $this->translator->trans('Update session status'),
];
$items[] = [
'class' => 'item-colors',

@ -44,38 +44,26 @@ class PlatformConfigurationController extends AbstractController
'platform.cookie_warning',
'platform.show_tabs',
'platform.catalog_show_courses_sessions',
'admin.admin_chamilo_announcements_disable',
'admin.administrator_name',
'admin.administrator_surname',
'editor.enabled_mathjax',
'editor.translate_html',
'display.show_admin_toolbar',
'registration.allow_terms_conditions',
'agenda.allow_personal_agenda',
'agenda.personal_calendar_show_sessions_occupation',
'social.social_enable_messages_feedback',
'social.disable_dislike_option',
'skill.allow_skills_tool',
'gradebook.gradebook_enable_grade_model',
'gradebook.gradebook_dependency',
'course.course_validation',
'course.student_view_enabled',
'course.allow_edit_tool_visibility_in_session',
'session.limit_session_admin_role',
'session.allow_session_admin_read_careers',
'session.limit_session_admin_list_users',
'platform.redirect_index_to_url_for_logged_users',
'language.platform_language',
'language.language_priority_1',
'language.language_priority_2',

@ -92,11 +92,6 @@ class SettingsCurrentFixtures extends Fixture implements FixtureGroupInterface
'title' => 'Show teacher information in footer',
'comment' => 'Show the teacher reference (name and e-mail if available) in the footer?',
],
[
'name' => 'homepage_view',
'title' => 'Course homepage layout',
'comment' => 'How would you like the homepage of a course to look (icons layout)?',
],
[
'name' => 'show_toolshortcuts',
'title' => 'Tools shortcuts',
@ -1554,7 +1549,7 @@ class SettingsCurrentFixtures extends Fixture implements FixtureGroupInterface
"comment" => "The roles set to 'true' will only appear to administrators. Other users will not be able to see them."
],
[
"name" => "hide_send_to_hrm_users",
"name" => "announcements_hide_send_to_hrm_users",
"title" => "Hide the option to send an announcement copy to HRM",
"comment" => "In the announcements form, an option normally appears to allow teachers to send a copy of the announcement to the user's HRM. Set this to \"Yes\" to remote the option (and *not* send the copy)."
],

@ -105,7 +105,6 @@ class Version20170627122900 extends AbstractMigrationChamilo
'languagePriority3' => 'language_priority_3',
'languagePriority4' => 'language_priority_4',
'gradebook_score_display_coloring' => 'my_display_coloring',
'document_if_file_exists_option' => 'if_file_exists_option',
'ProfilingFilterAddingUsers' => 'profiling_filter_adding_users',
'course_create_active_tools' => 'active_tools_on_create',
'EmailAdministrator' => 'administrator_email',
@ -245,7 +244,6 @@ class Version20170627122900 extends AbstractMigrationChamilo
'extend_rights_for_coach_on_survey' => 'survey',
'hide_course_group_if_no_tools_available' => 'group',
'hide_dltt_markup' => 'language',
'if_file_exists_option' => 'document',
'language_priority_1' => 'language',
'language_priority_2' => 'language',
'language_priority_3' => 'language',
@ -310,7 +308,6 @@ class Version20170627122900 extends AbstractMigrationChamilo
'show_toolshortcuts',
'show_tabs',
'display_mini_month_calendar',
'number_of_upcoming_events',
'facebook_description',
'ldap_description',
'openid_authentication',

@ -50,7 +50,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'session_courses_read_only_mode',
'session_import_settings',
'catalog_settings',
'allow_session_status',
'tracking_columns',
'my_progress_session_show_all_courses',
'assignment_base_course_teacher_access_to_all_session',
@ -127,10 +126,7 @@ class Version20230216122900 extends AbstractMigrationChamilo
'table_row_list',
'video_features',
'proxy_settings',
'theme_fallback',
'unoconv_binaries',
'packager',
'sync_db_with_schema',
'hide_main_navigation_menu',
'pdf_img_dpi',
'tracking_skip_generic_data',
@ -140,14 +136,7 @@ class Version20230216122900 extends AbstractMigrationChamilo
'block_my_progress_page',
'generate_random_login',
'timepicker_increment',
'allow_portfolio_tool',
'session_stored_in_db_as_backup',
'memcache_server',
'session_stored_after_n_times',
'default_template',
'aspell_bin',
'aspell_opts',
'aspell_temp_dir',
'webservice_return_user_field',
'multiple_url_hide_disabled_settings',
'login_max_attempt_before_blocking_account',
@ -164,7 +153,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'use_career_external_id_as_identifier_in_diagrams',
'disable_webservices',
'webservice_enable_adminonly_api',
'plugin_settings',
'allow_working_time_edition',
'disable_user_conditions_sender_id',
'portfolio_advanced_sharing',
@ -208,7 +196,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'usergroup_do_not_unsubscribe_users_from_course_on_course_unsubscribe',
'usergroup_do_not_unsubscribe_users_from_session_on_session_unsubscribe',
'drh_allow_access_to_all_students',
'admin_chamilo_announcements_disable',
],
'Agenda' => [
'personal_agenda_show_all_session_events',
@ -259,17 +246,16 @@ class Version20230216122900 extends AbstractMigrationChamilo
'lp_start_and_end_date_visible_in_student_view',
'scorm_lms_update_sco_status_all_time',
'scorm_upload_from_cache',
'lp_prerequisit_on_quiz_unblock_if_max_attempt_reached',
'lp_prerequisite_on_quiz_unblock_if_max_attempt_reached',
'student_follow_page_hide_lp_tests_average',
'student_follow_page_add_LP_acquisition_info',
'student_follow_page_add_LP_invisible_checkbox',
'student_follow_page_add_lp_acquisition_info',
'student_follow_page_add_lp_invisible_checkbox',
'student_follow_page_include_not_subscribed_lp_students',
'my_progress_course_tools_order',
'lp_enable_flow',
'lp_item_prerequisite_dates',
],
'Gradebook' => [
'gradebook_enable_best_score',
'gradebook_hide_graph',
'gradebook_hide_pdf_report_button',
'hide_gradebook_percentage_user_result',
@ -342,7 +328,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'exercise_result_end_text_html_strict_filtering',
'question_exercise_html_strict_filtering',
'quiz_question_delete_automatically_when_deleting_exercise',
'quiz_question_allow_inter_course_linking',
'quiz_hide_attempts_table_on_start_page',
'quiz_hide_question_number',
'quiz_keep_alive_ping_interval',
@ -364,7 +349,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'private_messages_about_user_visible_to_user',
'social_enable_messages_feedback',
'disable_dislike_option',
'enable_message_tags',
'allow_user_message_tracking',
'filter_interactivity_messages',
],
@ -391,19 +375,14 @@ class Version20230216122900 extends AbstractMigrationChamilo
'course_chat_restrict_to_coach',
],
'Survey' => [
'allow_required_survey_questions',
'hide_survey_reporting_button',
'allow_survey_availability_datetime',
'survey_mark_question_as_required',
'survey_anonymous_show_answered',
'survey_question_dependency',
'survey_allow_answered_question_edit',
'survey_duplicate_order_by_name',
'survey_backwards_enable',
'allow_mandatory_survey',
'hide_survey_edition',
'survey_additional_teacher_modify_actions',
'allow_survey_tool_in_lp',
'show_surveys_base_in_sessions',
],
'Document' => [
@ -441,7 +420,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
],
'Mail' => [
'update_users_email_to_dummy_except_admins',
'hosting_total_size_limit',
'mail_header_style',
'mail_content_style',
'allow_email_editor_for_anonymous',
@ -449,8 +427,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'send_two_inscription_confirmation_mail',
'show_user_email_in_notification',
'send_notification_score_in_percentage',
'mail_template_system',
'cron_notification_mails',
'cron_notification_help_desk',
'notifications_extended_footer_message',
],
@ -728,8 +704,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'Mail' => [
'notifications_extended_footer_message',
'cron_notification_help_desk',
'cron_notification_mails',
'mail_template_system',
'send_notification_score_in_percentage',
'show_user_email_in_notification',
'send_two_inscription_confirmation_mail',
@ -738,7 +712,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'allow_email_editor_for_anonymous',
'mail_content_style',
'mail_header_style',
'hosting_total_size_limit',
'update_users_email_to_dummy_except_admins',
],
'Skill' => [
@ -776,19 +749,14 @@ class Version20230216122900 extends AbstractMigrationChamilo
],
'Survey' => [
'show_surveys_base_in_sessions',
'allow_survey_tool_in_lp',
'survey_additional_teacher_modify_actions',
'hide_survey_edition',
'allow_mandatory_survey',
'survey_backwards_enable',
'survey_duplicate_order_by_name',
'survey_allow_answered_question_edit',
'survey_question_dependency',
'survey_anonymous_show_answered',
'survey_mark_question_as_required',
'allow_survey_availability_datetime',
'hide_survey_reporting_button',
'allow_required_survey_questions',
],
'Chat' => [
'course_chat_restrict_to_coach',
@ -815,7 +783,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'Message' => [
'filter_interactivity_messages',
'allow_user_message_tracking',
'enable_message_tags',
'disable_dislike_option',
'social_enable_messages_feedback',
'private_messages_about_user_visible_to_user',
@ -837,7 +804,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'quiz_keep_alive_ping_interval',
'quiz_hide_question_number',
'quiz_hide_attempts_table_on_start_page',
'quiz_question_allow_inter_course_linking',
'quiz_question_delete_automatically_when_deleting_exercise',
'question_exercise_html_strict_filtering',
'exercise_result_end_text_html_strict_filtering',
@ -910,17 +876,16 @@ class Version20230216122900 extends AbstractMigrationChamilo
'hide_gradebook_percentage_user_result',
'gradebook_hide_pdf_report_button',
'gradebook_hide_graph',
'gradebook_enable_best_score',
],
'Lp' => [
'lp_item_prerequisite_dates',
'lp_enable_flow',
'my_progress_course_tools_order',
'student_follow_page_include_not_subscribed_lp_students',
'student_follow_page_add_LP_invisible_checkbox',
'student_follow_page_add_LP_acquisition_info',
'student_follow_page_add_lp_invisible_checkbox',
'student_follow_page_add_lp_acquisition_info',
'student_follow_page_hide_lp_tests_average',
'lp_prerequisit_on_quiz_unblock_if_max_attempt_reached',
'lp_prerequisite_on_quiz_unblock_if_max_attempt_reached',
'scorm_upload_from_cache',
'scorm_lms_update_sco_status_all_time',
'lp_start_and_end_date_visible_in_student_view',
@ -980,7 +945,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'max_anonymous_users',
'show_link_request_hrm_user',
'user_status_option_only_for_admin_enabled',
'admin_chamilo_announcements_disable',
],
'Profile' => [
'hide_username_in_course_chat',
@ -1015,7 +979,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'portfolio_advanced_sharing',
'disable_user_conditions_sender_id',
'allow_working_time_edition',
'plugin_settings',
'webservice_enable_adminonly_api',
'disable_webservices',
'use_career_external_id_as_identifier_in_diagrams',
@ -1032,14 +995,7 @@ class Version20230216122900 extends AbstractMigrationChamilo
'login_max_attempt_before_blocking_account',
'multiple_url_hide_disabled_settings',
'webservice_return_user_field',
'aspell_temp_dir',
'aspell_opts',
'aspell_bin',
'default_template',
'session_stored_after_n_times',
'memcache_server',
'session_stored_in_db_as_backup',
'allow_portfolio_tool',
'timepicker_increment',
'generate_random_login',
'block_my_progress_page',
@ -1049,10 +1005,7 @@ class Version20230216122900 extends AbstractMigrationChamilo
'tracking_skip_generic_data',
'pdf_img_dpi',
'hide_main_navigation_menu',
'sync_db_with_schema',
'packager',
'unoconv_binaries',
'theme_fallback',
'proxy_settings',
'video_features',
'table_row_list',
@ -1129,7 +1082,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
'assignment_base_course_teacher_access_to_all_session',
'my_progress_session_show_all_courses',
'tracking_columns',
'allow_session_status',
'catalog_settings',
'session_import_settings',
'session_courses_read_only_mode',

@ -35,7 +35,6 @@ class AdminSettingsSchema extends AbstractSettingsSchema
'drh_allow_access_to_all_students' => 'false',
'user_status_option_only_for_admin_enabled' => 'false',
'user_status_option_show_only_for_admin' => '',
'admin_chamilo_announcements_disable' => 'false',
]
)
;
@ -74,7 +73,6 @@ class AdminSettingsSchema extends AbstractSettingsSchema
$this->settingArrayHelpValue('user_status_option_show_only_for_admin'),
]
)
->add('admin_chamilo_announcements_disable', YesNoType::class)
;
$this->updateFormFieldsFromSettingsInfo($builder);

@ -21,10 +21,6 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'allow_personal_agenda' => 'true',
// 'display_mini_month_calendar' => '', ??
'display_upcoming_events' => '',
// ??
// 'number_of_upcoming_events' => '0',
'default_calendar_view' => 'month',
'personal_calendar_show_sessions_occupation' => 'false',
'personal_agenda_show_all_session_events' => 'false',
@ -41,9 +37,6 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
$allowedTypes = [
'allow_personal_agenda' => ['string'],
// 'display_mini_month_calendar' => array('string'),
'display_upcoming_events' => ['string'],
// 'number_of_upcoming_events' => array('string'),
'default_calendar_view' => ['string'],
];
$this->setMultipleAllowedTypes($allowedTypes, $builder);
@ -53,9 +46,6 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
{
$builder
->add('allow_personal_agenda', YesNoType::class)
// ->add('display_mini_month_calendar', YesNoType::class)
->add('display_upcoming_events', YesNoType::class)
// ->add('number_of_upcoming_events')
->add(
'default_calendar_view',
ChoiceType::class,

@ -19,14 +19,13 @@ class AnnouncementSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'hide_global_announcements_when_not_connected' => 'false',
'hide_send_to_hrm_users' => 'true',
'announcements_hide_send_to_hrm_users' => 'true',
'disable_announcement_attachment' => 'false',
'allow_scheduled_announcements' => 'false',
'disable_delete_all_announcements' => 'false',
'hide_announcement_sent_to_users_info' => 'false',
'send_all_emails_to' => '',
'allow_careers_in_global_announcements' => 'false',
'announcements_hide_send_to_hrm_users' => 'false',
'allow_coach_to_edit_announcements' => 'false',
'course_announcement_scheduled_by_date' => 'false',
]
@ -43,7 +42,7 @@ class AnnouncementSettingsSchema extends AbstractSettingsSchema
{
$builder
->add('hide_global_announcements_when_not_connected', YesNoType::class)
->add('hide_send_to_hrm_users', YesNoType::class)
->add('announcements_hide_send_to_hrm_users', YesNoType::class)
->add('disable_announcement_attachment', YesNoType::class)
->add('allow_scheduled_announcements', YesNoType::class)
->add('disable_delete_all_announcements', YesNoType::class)
@ -60,7 +59,6 @@ class AnnouncementSettingsSchema extends AbstractSettingsSchema
]
)
->add('allow_careers_in_global_announcements', YesNoType::class)
->add('announcements_hide_send_to_hrm_users', YesNoType::class)
->add('allow_coach_to_edit_announcements', YesNoType::class)
->add('course_announcement_scheduled_by_date', YesNoType::class)
;

@ -18,7 +18,6 @@ class CertificateSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'hide_my_certificate_link' => 'false',
'hide_header_footer' => 'false',
'add_certificate_pdf_footer' => 'false',
]
)
@ -34,7 +33,6 @@ class CertificateSettingsSchema extends AbstractSettingsSchema
{
$builder
->add('hide_my_certificate_link', YesNoType::class)
->add('hide_header_footer', YesNoType::class)
->add('add_certificate_pdf_footer', YesNoType::class)
;

@ -49,8 +49,6 @@ class CourseSettingsSchema extends AbstractSettingsSchema
$builder
->setDefaults(
[
'homepage_view' => 'activity_big',
'show_tool_shortcuts' => 'false',
// @todo check default value?
'active_tools_on_create' => $tools,
'display_coursecode_in_courselist' => 'false',
@ -138,7 +136,6 @@ class CourseSettingsSchema extends AbstractSettingsSchema
;
$allowedTypes = [
'homepage_view' => ['string'],
'active_tools_on_create' => ['array'],
'course_hide_tools' => ['array'],
'display_coursecode_in_courselist' => ['string'],
@ -154,20 +151,6 @@ class CourseSettingsSchema extends AbstractSettingsSchema
$tools = $this->getProcessedToolChain();
$builder
->add(
'homepage_view',
ChoiceType::class,
[
'choices' => [
// 'HomepageView2column' => '2column',
// 'HomepageView3column' => '3column',
// 'HomepageViewVerticalActivity' => 'vertical_activity',
// 'HomepageViewActivity' => 'activity',
'HomepageViewActivityBig' => 'activity_big',
],
]
)
->add('show_tool_shortcuts', YesNoType::class)
->add(
'active_tools_on_create',
ChoiceType::class,

@ -51,7 +51,6 @@ class DisplaySettingsSchema extends AbstractSettingsSchema
'hide_logout_button' => 'false',
'show_link_ticket_notification' => 'false',
'icons_mode_svg' => 'false',
'default_template' => 'default',
'hide_social_media_links' => 'false',
]
)
@ -114,7 +113,6 @@ class DisplaySettingsSchema extends AbstractSettingsSchema
->add('hide_logout_button', YesNoType::class)
->add('show_link_ticket_notification', YesNoType::class)
->add('icons_mode_svg', YesNoType::class)
->add('default_template')
->add('hide_social_media_links', YesNoType::class)
;

@ -42,7 +42,6 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
'enabled_text2audio' => 'false',
// 'enable_nanogong' => 'false',
'show_documents_preview' => 'false',
'enable_wami_record' => 'false',
'enable_webcam_clip' => 'false',
'tool_visible_by_default_at_creation' => [
'documents',
@ -54,10 +53,6 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
'gradebook',
],
'documents_default_visibility_defined_in_course' => 'false',
// ?
'allow_personal_user_files' => '',
// ?
'if_file_exists_option' => 'rename',
'send_notification_when_document_added' => 'false',
'thematic_pdf_orientation' => 'landscape',
'certificate_pdf_orientation' => 'landscape',
@ -88,7 +83,6 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
public function buildForm(FormBuilderInterface $builder): void
{
$builder
->add('allow_personal_user_files', YesNoType::class)
->add('default_document_quotum')
->add('default_group_quotum')
->add('permanently_remove_deleted_files', YesNoType::class)
@ -130,7 +124,6 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
->add('enabled_text2audio', YesNoType::class)
// ->add('enable_nanogong', YesNoType::class)
->add('show_documents_preview', YesNoType::class)
->add('enable_wami_record', YesNoType::class)
->add('enable_webcam_clip', YesNoType::class)
->add(
'tool_visible_by_default_at_creation',
@ -148,16 +141,6 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
],
]
)
->add(
'if_file_exists_option',
ChoiceType::class,
[
'choices' => [
'Rename' => 'rename',
'Overwrite' => 'overwrite',
],
]
)
->add('send_notification_when_document_added', YesNoType::class)
->add(
'thematic_pdf_orientation',

@ -19,7 +19,6 @@ class EditorSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'allow_email_editor' => '',
'math_mimetex' => '',
'math_asciimathML' => '',
'enabled_asciisvg' => '',
'include_asciimathml_script' => '',
@ -59,7 +58,6 @@ class EditorSettingsSchema extends AbstractSettingsSchema
{
$builder
->add('allow_email_editor', YesNoType::class)
->add('math_mimetex', YesNoType::class)
->add('math_asciimathML', YesNoType::class)
->add('enabled_asciisvg', YesNoType::class)
->add('include_asciimathml_script', YesNoType::class)

@ -80,7 +80,6 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
'exercise_result_end_text_html_strict_filtering' => 'false',
'question_exercise_html_strict_filtering' => 'false',
'quiz_question_delete_automatically_when_deleting_exercise' => 'false',
'quiz_question_allow_inter_course_linking' => 'false',
'quiz_hide_attempts_table_on_start_page' => 'false',
'quiz_hide_question_number' => 'false',
'quiz_keep_alive_ping_interval' => '0',
@ -209,7 +208,6 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
->add('exercise_result_end_text_html_strict_filtering', YesNoType::class)
->add('question_exercise_html_strict_filtering', YesNoType::class)
->add('quiz_question_delete_automatically_when_deleting_exercise', YesNoType::class)
->add('quiz_question_allow_inter_course_linking', YesNoType::class)
->add('quiz_hide_attempts_table_on_start_page', YesNoType::class)
->add('quiz_hide_question_number', YesNoType::class)
->add('quiz_keep_alive_ping_interval', TextType::class)

@ -31,7 +31,6 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
'gradebook_default_weight' => '100',
'gradebook_locking_enabled' => 'false',
'gradebook_default_grade_model_id' => '',
'gradebook_show_percentage_in_reports' => '',
'my_display_coloring' => 'false',
'student_publication_to_take_in_gradebook' => 'first',
'gradebook_detailed_admin_view' => 'false',
@ -40,7 +39,6 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
'add_gradebook_certificates_cron_task_enabled' => 'false',
'certificate_filter_by_official_code' => 'false',
'hide_certificate_export_link_students' => 'false',
'gradebook_enable_best_score' => 'false',
'gradebook_hide_graph' => 'false',
'gradebook_hide_pdf_report_button' => 'false',
'hide_gradebook_percentage_user_result' => 'true',
@ -89,7 +87,6 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
->add('gradebook_default_weight')
->add('gradebook_locking_enabled', YesNoType::class)
->add('gradebook_default_grade_model_id')
->add('gradebook_show_percentage_in_reports')
->add('my_display_coloring', YesNoType::class)
->add(
'student_publication_to_take_in_gradebook',
@ -107,8 +104,6 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
->add('add_gradebook_certificates_cron_task_enabled', YesNoType::class)
->add('certificate_filter_by_official_code', YesNoType::class)
->add('hide_certificate_export_link_students', YesNoType::class)
->add('gradebook_enable_best_score', YesNoType::class)
->add('gradebook_hide_graph', YesNoType::class)
->add('gradebook_hide_pdf_report_button', YesNoType::class)
->add('hide_gradebook_percentage_user_result', YesNoType::class)
->add('gradebook_use_exercise_score_settings_in_categories', YesNoType::class)

@ -20,7 +20,6 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
$builder
->setDefaults(
[
'fixed_encoding' => 'false',
'show_invisible_exercise_in_lp_toc' => 'false',
'add_all_files_in_lp_export' => 'false',
'show_prerequisite_as_blocked' => 'false',
@ -60,10 +59,10 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
'lp_start_and_end_date_visible_in_student_view' => 'false',
'scorm_lms_update_sco_status_all_time' => 'false',
'scorm_upload_from_cache' => 'false',
'lp_prerequisit_on_quiz_unblock_if_max_attempt_reached' => 'false',
'lp_prerequisite_on_quiz_unblock_if_max_attempt_reached' => 'false',
'student_follow_page_hide_lp_tests_average' => 'false',
'student_follow_page_add_LP_acquisition_info' => 'false',
'student_follow_page_add_LP_invisible_checkbox' => 'false',
'student_follow_page_add_lp_acquisition_info' => 'false',
'student_follow_page_add_lp_invisible_checkbox' => 'false',
'student_follow_page_include_not_subscribed_lp_students' => 'false',
'my_progress_course_tools_order' => '',
'lp_enable_flow' => 'false',
@ -72,16 +71,13 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
)
;
$allowedTypes = [
'fixed_encoding' => ['string'],
];
$allowedTypes = [];
$this->setMultipleAllowedTypes($allowedTypes, $builder);
}
public function buildForm(FormBuilderInterface $builder): void
{
$builder
->add('fixed_encoding', YesNoType::class)
->add('show_invisible_exercise_in_lp_toc', YesNoType::class)
->add('add_all_files_in_lp_export', YesNoType::class)
->add('show_prerequisite_as_blocked', YesNoType::class)
@ -161,10 +157,10 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
->add('lp_start_and_end_date_visible_in_student_view', YesNoType::class)
->add('scorm_lms_update_sco_status_all_time', YesNoType::class)
->add('scorm_upload_from_cache', YesNoType::class)
->add('lp_prerequisit_on_quiz_unblock_if_max_attempt_reached', YesNoType::class)
->add('lp_prerequisite_on_quiz_unblock_if_max_attempt_reached', YesNoType::class)
->add('student_follow_page_hide_lp_tests_average', YesNoType::class)
->add('student_follow_page_add_LP_acquisition_info', YesNoType::class)
->add('student_follow_page_add_LP_invisible_checkbox', YesNoType::class)
->add('student_follow_page_add_lp_acquisition_info', YesNoType::class)
->add('student_follow_page_add_lp_invisible_checkbox', YesNoType::class)
->add('student_follow_page_include_not_subscribed_lp_students', YesNoType::class)
->add(
'my_progress_course_tools_order',

@ -22,7 +22,6 @@ class MailSettingsSchema extends AbstractSettingsSchema
[
'noreply_email_address' => 'no_reply@example.com',
'update_users_email_to_dummy_except_admins' => 'false',
'hosting_total_size_limit' => '0',
'mail_header_style' => '',
'mail_content_style' => '',
'allow_email_editor_for_anonymous' => 'true',
@ -30,8 +29,6 @@ class MailSettingsSchema extends AbstractSettingsSchema
'send_two_inscription_confirmation_mail' => 'false',
'show_user_email_in_notification' => 'false',
'send_notification_score_in_percentage' => 'false',
'mail_template_system' => 'false',
'cron_notification_mails' => '',
'cron_notification_help_desk' => '',
'notifications_extended_footer_message' => '',
]
@ -45,7 +42,6 @@ class MailSettingsSchema extends AbstractSettingsSchema
$builder
->add('noreply_email_address', EmailType::class)
->add('update_users_email_to_dummy_except_admins', YesNoType::class)
->add('hosting_total_size_limit', TextType::class)
->add('mail_header_style', TextType::class)
->add('mail_content_style', TextType::class)
->add('allow_email_editor_for_anonymous', YesNoType::class)
@ -53,16 +49,6 @@ class MailSettingsSchema extends AbstractSettingsSchema
->add('send_two_inscription_confirmation_mail', YesNoType::class)
->add('show_user_email_in_notification', YesNoType::class)
->add('send_notification_score_in_percentage', YesNoType::class)
->add('mail_template_system', YesNoType::class)
->add(
'cron_notification_mails',
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('E-mail accounts to send notifications to when executing cronjobs - works for main/cron/import_csv.php').
$this->settingArrayHelpValue('cron_notification_mails'),
]
)
->add(
'cron_notification_help_desk',
TextareaType::class,
@ -89,9 +75,6 @@ class MailSettingsSchema extends AbstractSettingsSchema
private function settingArrayHelpValue(string $variable): string
{
$values = [
'cron_notification_mails' => "<pre>
['email@example.com', 'email2@example.com']
</pre>",
'cron_notification_help_desk' => "<pre>
['email@example.com', 'email2@example.com']
</pre>",

@ -24,7 +24,6 @@ class MessageSettingsSchema extends AbstractSettingsSchema
'private_messages_about_user_visible_to_user' => 'false',
'social_enable_messages_feedback' => 'false',
'disable_dislike_option' => 'false',
'enable_message_tags' => 'false',
'allow_user_message_tracking' => 'false',
'filter_interactivity_messages' => 'false',
]
@ -47,7 +46,6 @@ class MessageSettingsSchema extends AbstractSettingsSchema
->add('private_messages_about_user_visible_to_user', YesNoType::class)
->add('social_enable_messages_feedback', YesNoType::class)
->add('disable_dislike_option', YesNoType::class)
->add('enable_message_tags', YesNoType::class)
->add('allow_user_message_tracking', YesNoType::class)
->add('filter_interactivity_messages', YesNoType::class)
;

@ -53,15 +53,11 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'pdf_logo_header' => '',
'allow_my_files' => 'true',
'registered' => 'false',
'keep_old_images_after_delete' => 'true',
'load_term_conditions_section' => 'login',
'server_type' => 'prod',
'show_tabs' => array_values(self::$tabs),
'chamilo_database_version' => '2.0.0',
'theme_fallback' => 'chamilo',
'unoconv_binaries' => '/usr/bin/unoconv',
'packager' => 'chamilo',
'sync_db_with_schema' => 'false',
'hide_main_navigation_menu' => 'false',
'pdf_img_dpi' => '96',
'tracking_skip_generic_data' => 'false',
@ -74,14 +70,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'proxy_settings' => '',
'video_features' => '',
'table_row_list' => '',
'allow_portfolio_tool' => 'false',
'session_stored_in_db_as_backup' => 'false',
'memcache_server' => '',
'session_stored_after_n_times' => '10',
'default_template' => 'default',
'aspell_bin' => '/usr/bin/hunspell',
'aspell_opts' => '-a -d en_GB -H -i utf-8',
'aspell_temp_dir' => './',
'webservice_return_user_field' => 'oauth2_id',
'multiple_url_hide_disabled_settings' => 'false',
'login_max_attempt_before_blocking_account' => '0',
@ -98,7 +86,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'use_career_external_id_as_identifier_in_diagrams' => 'false',
'disable_webservices' => 'false',
'webservice_enable_adminonly_api' => 'false',
'plugin_settings' => '',
'allow_working_time_edition' => 'false',
'disable_user_conditions_sender_id' => '0',
'portfolio_advanced_sharing' => 'false',
@ -170,7 +157,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
// old settings with no category
->add('chamilo_database_version')
->add('registered', YesNoType::class)
->add('keep_old_images_after_delete', YesNoType::class)
->add(
'load_term_conditions_section',
ChoiceType::class,
@ -191,14 +177,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'help' => 'ShowTabsComment',
],
)
->add(
'theme_fallback',
TextType::class,
[
'label' => 'ThemeFallbackTitle',
'help' => 'ThemeFallbackComment',
]
)
->add(
'unoconv_binaries',
TextType::class,
@ -207,15 +185,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'help' => 'UnoconvBinariesComment',
]
)
->add(
'packager',
TextType::class,
[
'label' => 'PackagerTitle',
'help' => 'PackagerComment',
]
)
->add('sync_db_with_schema', YesNoType::class)
->add('hide_main_navigation_menu', YesNoType::class)
->add('pdf_img_dpi', TextType::class)
->add('tracking_skip_generic_data', YesNoType::class)
@ -259,22 +228,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
$this->settingArrayHelpValue('table_row_list'),
]
)
->add('allow_portfolio_tool', YesNoType::class)
->add('session_stored_in_db_as_backup', YesNoType::class)
->add(
'memcache_server',
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Define the different memcache servers available').
$this->settingArrayHelpValue('memcache_server'),
]
)
->add('session_stored_after_n_times', TextType::class)
->add('default_template', TextType::class)
->add('aspell_bin', TextType::class)
->add('aspell_opts', TextType::class)
->add('aspell_temp_dir', TextType::class)
->add('webservice_return_user_field', TextType::class)
->add('multiple_url_hide_disabled_settings', YesNoType::class)
->add('login_max_attempt_before_blocking_account', TextType::class)
@ -323,15 +276,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
->add('use_career_external_id_as_identifier_in_diagrams', YesNoType::class)
->add('disable_webservices', YesNoType::class)
->add('webservice_enable_adminonly_api', YesNoType::class)
->add(
'plugin_settings',
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Disables the following BBB plugin settings in the plugin form and use them in priority').
$this->settingArrayHelpValue('plugin_settings'),
]
)
->add('allow_working_time_edition', YesNoType::class)
->add('disable_user_conditions_sender_id', TextType::class)
->add('portfolio_advanced_sharing', TextType::class)
@ -375,18 +319,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'table_row_list' => "<pre>
['options' => [50, 100, 200, 500]]
</pre>",
'memcache_server' => "<pre>
[
0 => [
'host' => 'chamilo8',
'port' => '11211',
],
1 => [
'host' => 'chamilo9',
'port' => '11211',
],
]
</pre>",
'extldap_config' => "<pre>
['host' => '', 'port' => '']
</pre>",
@ -416,15 +348,6 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
'INVITEE' => 31
]
</pre>",
'plugin_settings' => "<pre>
[
'bbb' => [
'tool_enable' => 'true', // string value
'host' => 'https://www.example.com',
'salt' => 'abc123'
]
]
</pre>",
];
$returnValue = [];

@ -33,7 +33,6 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
'enable_profile_user_address_geolocalization' => '',
'allow_show_skype_account' => '',
'allow_show_linkedin_url' => '',
'is_editable' => 'true',
'hide_username_with_complete_name' => 'false',
'hide_username_in_course_chat' => 'false',
'show_official_code_whoisonline' => 'false',
@ -117,7 +116,6 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
->add('enable_profile_user_address_geolocalization', YesNoType::class)
->add('allow_show_skype_account', YesNoType::class)
->add('allow_show_linkedin_url', YesNoType::class)
->add('is_editable', YesNoType::class)
->add('hide_username_with_complete_name', YesNoType::class)
->add('hide_username_in_course_chat', YesNoType::class)
->add('show_official_code_whoisonline', YesNoType::class)

@ -21,13 +21,10 @@ class SearchSettingsSchema extends AbstractSettingsSchema
'search_enabled' => 'false',
'search_prefilter_prefix' => '',
'search_show_unlinked_results' => 'true',
'number_of_upcoming_events' => '0',
]
)
;
$allowedTypes = [
'number_of_upcoming_events' => ['string'],
];
$allowedTypes = [];
$this->setMultipleAllowedTypes($allowedTypes, $builder);
}
@ -46,7 +43,6 @@ class SearchSettingsSchema extends AbstractSettingsSchema
],
]
)
->add('number_of_upcoming_events')
;
$this->updateFormFieldsFromSettingsInfo($builder);

@ -19,7 +19,6 @@ class SecuritySettingsSchema extends AbstractSettingsSchema
$builder->setDefaults(
[
'filter_terms' => '',
'allow_browser_sniffer' => 'false',
'admins_can_set_users_pass' => '',
'allow_strength_pass_checker' => 'true',
'allow_captcha' => 'false',
@ -46,7 +45,6 @@ class SecuritySettingsSchema extends AbstractSettingsSchema
]
);
$allowedTypes = [
'allow_browser_sniffer' => ['string'],
'allow_strength_pass_checker' => ['string'],
];
$this->setMultipleAllowedTypes($allowedTypes, $builder);
@ -56,7 +54,6 @@ class SecuritySettingsSchema extends AbstractSettingsSchema
{
$builder
->add('filter_terms', TextareaType::class)
->add('allow_browser_sniffer', YesNoType::class)
->add('admins_can_set_users_pass', YesNoType::class)
->add('allow_strength_pass_checker', YesNoType::class)
->add('allow_captcha', YesNoType::class)

@ -28,8 +28,6 @@ class SessionSettingsSchema extends AbstractSettingsSchema
'show_groups_to_users' => 'false',
'hide_courses_in_sessions' => 'false',
'allow_session_admins_to_manage_all_sessions' => 'false',
'session_tutor_reports_visibility' => 'false',
'session_page_enabled' => 'true',
'allow_teachers_to_create_sessions' => 'false',
'prevent_session_admins_to_manage_all_users' => 'false',
'session_course_ordering' => 'false',
@ -67,7 +65,6 @@ class SessionSettingsSchema extends AbstractSettingsSchema
'session_courses_read_only_mode' => 'false',
'session_import_settings' => '',
'catalog_settings' => '',
'allow_session_status' => 'false',
'tracking_columns' => '',
'my_progress_session_show_all_courses' => 'false',
'assignment_base_course_teacher_access_to_all_session' => 'false',
@ -110,8 +107,6 @@ class SessionSettingsSchema extends AbstractSettingsSchema
->add('show_groups_to_users', YesNoType::class)
->add('hide_courses_in_sessions', YesNoType::class)
->add('allow_session_admins_to_manage_all_sessions', YesNoType::class)
->add('session_tutor_reports_visibility', YesNoType::class)
->add('session_page_enabled', YesNoType::class)
->add('allow_teachers_to_create_sessions', YesNoType::class)
->add('prevent_session_admins_to_manage_all_users', YesNoType::class)
->add(
@ -191,7 +186,6 @@ class SessionSettingsSchema extends AbstractSettingsSchema
$this->settingArrayHelpValue('catalog_settings'),
]
)
->add('allow_session_status', YesNoType::class)
->add(
'tracking_columns',
TextareaType::class,

@ -609,7 +609,6 @@ class SettingsManager implements SettingsManagerInterface
'show_administrator_data' => 'Platform',
'show_tutor_data' => 'Session',
'show_teacher_data' => 'Platform',
'homepage_view' => 'Course',
'show_toolshortcuts' => 'Course',
'allow_group_categories' => 'Course',
'server_type' => 'Platform',
@ -890,7 +889,6 @@ class SettingsManager implements SettingsManagerInterface
'allow_download_documents_by_api_key' => 'Webservices',
'profiling_filter_adding_users' => 'profile',
'donotlistcampus' => 'platform',
'gradebook_show_percentage_in_reports' => 'gradebook',
'course_creation_splash_screen' => 'Course',
'translate_html' => 'Editor',
'enable_bootstrap_in_documents_html' => 'Course',
@ -918,7 +916,6 @@ class SettingsManager implements SettingsManagerInterface
'languagePriority3' => 'language_priority_3',
'languagePriority4' => 'language_priority_4',
'gradebook_score_display_coloring' => 'my_display_coloring',
'document_if_file_exists_option' => 'if_file_exists_option',
'ProfilingFilterAddingUsers' => 'profiling_filter_adding_users',
'course_create_active_tools' => 'active_tools_on_create',
'emailAdministrator' => 'administrator_email',
@ -1061,12 +1058,11 @@ class SettingsManager implements SettingsManagerInterface
'upload_extensions_skip' => 'document',
'changeable_options' => 'profile',
'users_copy_files' => 'document',
'if_file_exists_option' => 'document',
'document_if_file_exists_option' => 'document',
'permissions_for_new_files' => 'document',
'extended_profile' => 'profile',
'split_users_upload_directory' => 'profile',
'show_documents_preview' => 'document',
'decode_utf8' => 'webservice',
'messaging_allow_send_push_notification' => 'webservice',
'messaging_gdc_project_number' => 'webservice',
'messaging_gdc_api_key' => 'webservice',

@ -21,19 +21,14 @@ class SurveySettingsSchema extends AbstractSettingsSchema
[
'survey_email_sender_noreply' => 'coach',
'extend_rights_for_coach_on_survey' => 'true',
'allow_required_survey_questions' => 'false',
'hide_survey_reporting_button' => 'false',
'allow_survey_availability_datetime' => 'false',
'survey_mark_question_as_required' => 'false',
'survey_anonymous_show_answered' => 'false',
'survey_question_dependency' => 'true',
'survey_allow_answered_question_edit' => 'false',
'survey_duplicate_order_by_name' => 'true',
'survey_backwards_enable' => 'false',
'allow_mandatory_survey' => 'false',
'hide_survey_edition' => '',
'survey_additional_teacher_modify_actions' => '',
'allow_survey_tool_in_lp' => 'false',
'show_surveys_base_in_sessions' => 'false',
]
)
@ -59,16 +54,12 @@ class SurveySettingsSchema extends AbstractSettingsSchema
]
)
->add('extend_rights_for_coach_on_survey', YesNoType::class)
->add('allow_required_survey_questions', YesNoType::class)
->add('hide_survey_reporting_button', YesNoType::class)
->add('allow_survey_availability_datetime', YesNoType::class)
->add('survey_mark_question_as_required', YesNoType::class)
->add('survey_anonymous_show_answered', YesNoType::class)
->add('survey_question_dependency', YesNoType::class)
->add('survey_allow_answered_question_edit', YesNoType::class)
->add('survey_duplicate_order_by_name', YesNoType::class)
->add('survey_backwards_enable', YesNoType::class)
->add('allow_mandatory_survey', YesNoType::class)
->add(
'hide_survey_edition',
TextareaType::class,
@ -87,7 +78,6 @@ class SurveySettingsSchema extends AbstractSettingsSchema
$this->settingArrayHelpValue('survey_additional_teacher_modify_actions'),
]
)
->add('allow_survey_tool_in_lp', YesNoType::class)
->add('show_surveys_base_in_sessions', YesNoType::class)
;

@ -17,7 +17,6 @@ class WebServiceSettingsSchema extends AbstractSettingsSchema
$builder
->setDefaults(
[
'decode_utf8' => 'true',
'messaging_allow_send_push_notification' => 'false',
'messaging_gdc_project_number' => '',
'messaging_gdc_api_key' => '',
@ -38,11 +37,9 @@ class WebServiceSettingsSchema extends AbstractSettingsSchema
public function buildForm(FormBuilderInterface $builder): void
{
$builder
->add('decode_utf8', YesNoType::class)
->add('messaging_allow_send_push_notification', YesNoType::class)
->add('messaging_gdc_project_number')
->add('messaging_gdc_api_key')
->add('decode_utf8', YesNoType::class)
->add('allow_download_documents_by_api_key', YesNoType::class)
;

@ -1184,10 +1184,8 @@ class CourseBuilder
$db_result = Database::query($sql);
$is_required = 0;
while ($obj = Database::fetch_object($db_result)) {
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
if (isset($obj->is_required)) {
$is_required = $obj->is_required;
}
if (isset($obj->is_required)) {
$is_required = $obj->is_required;
}
$question = new SurveyQuestion(
$obj->question_id,

@ -2591,10 +2591,8 @@ class CourseRestorer
'shared_question_id' => self::DBUTF8($question->shared_question_id),
'max_value' => self::DBUTF8($question->max_value),
];
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
if (isset($question->is_required)) {
$params['is_required'] = $question->is_required;
}
if (isset($question->is_required)) {
$params['is_required'] = $question->is_required;
}
$new_id = Database::insert($table_que, $params);

@ -87,9 +87,8 @@ class SurveyQuestion extends Resource
$this->shared_question_id = $shared_question_id;
$this->max_value = $max_value;
$this->answers = [];
if ('true' === api_get_setting('survey.allow_required_survey_questions')) {
$this->is_required = $is_required;
}
$this->is_required = $is_required;
}
/**

Loading…
Cancel
Save