Merge branch 'master' of github.com:chamilo/chamilo-lms

pull/5388/head
Yannick Warnier 7 months ago
commit 333910eabc
  1. 18
      assets/css/scss/_admin_index.scss
  2. 16
      assets/vue/components/basecomponents/BaseColorPicker.vue
  3. 7
      assets/vue/components/basecomponents/BaseInputText.vue
  4. 2
      assets/vue/components/basecomponents/BaseRadioButtons.vue
  5. 35
      assets/vue/components/basecomponents/BaseSelect.vue
  6. 8
      assets/vue/components/layout/TopbarLoggedIn.vue
  7. 11
      assets/vue/composables/theme.js
  8. 11
      assets/vue/services/baseService.js
  9. 41
      assets/vue/services/colorThemeService.js
  10. 833
      assets/vue/views/admin/AdminConfigureColors.vue
  11. 2
      config/packages/stof_doctrine_extensions.yaml
  12. 8
      public/main/auth/inscription.php
  13. 8
      public/main/inc/ajax/model.ajax.php
  14. 2
      public/main/inc/ajax/session.ajax.php
  15. 2
      public/main/inc/ajax/social.ajax.php
  16. 15
      public/main/inc/lib/MailTemplateManager.php
  17. 2
      public/main/inc/lib/api.lib.php
  18. 52
      public/main/inc/lib/extra_field.lib.php
  19. 8
      public/main/inc/lib/extra_field_option.lib.php
  20. 6
      public/main/inc/lib/message.lib.php
  21. 160
      public/main/mail_template/list.php
  22. 2
      public/main/my_space/myStudents.php
  23. 2
      public/main/search/load_search.php
  24. 2
      public/main/session/session_course_user_list.php
  25. 674
      src/CoreBundle/DataFixtures/ExtraFieldFixtures.php
  26. 6875
      src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php
  27. 14
      src/CoreBundle/Entity/ColorTheme.php
  28. 12
      src/CoreBundle/Entity/ExtraField.php
  29. 15
      src/CoreBundle/Entity/ExtraFieldOptions.php
  30. 10
      src/CoreBundle/Entity/MailTemplate.php
  31. 5
      src/CoreBundle/Migrations/Schema/V200/Version20.php
  32. 903
      src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php
  33. 22
      src/CoreBundle/Migrations/Schema/V200/Version20240414120300.php
  34. 49
      src/CoreBundle/Migrations/Schema/V200/Version20240416110300.php
  35. 52
      src/CoreBundle/Migrations/Schema/V200/Version20240416132900.php
  36. 15
      src/CoreBundle/Repository/ColorThemeRepository.php
  37. 16
      src/CoreBundle/Settings/AbstractSettingsSchema.php
  38. 3
      src/CoreBundle/Settings/AdminSettingsSchema.php
  39. 12
      src/CoreBundle/Settings/AgendaSettingsSchema.php
  40. 5
      src/CoreBundle/Settings/AnnouncementSettingsSchema.php
  41. 27
      src/CoreBundle/Settings/CourseSettingsSchema.php
  42. 6
      src/CoreBundle/Settings/DocumentSettingsSchema.php
  43. 9
      src/CoreBundle/Settings/EditorSettingsSchema.php
  44. 18
      src/CoreBundle/Settings/ExerciseSettingsSchema.php
  45. 15
      src/CoreBundle/Settings/GradebookSettingsSchema.php
  46. 12
      src/CoreBundle/Settings/LearningPathSettingsSchema.php
  47. 6
      src/CoreBundle/Settings/MailSettingsSchema.php
  48. 4
      src/CoreBundle/Settings/MessageSettingsSchema.php
  49. 21
      src/CoreBundle/Settings/PlatformSettingsSchema.php
  50. 24
      src/CoreBundle/Settings/ProfileSettingsSchema.php
  51. 6
      src/CoreBundle/Settings/RegistrationSettingsSchema.php
  52. 6
      src/CoreBundle/Settings/SecuritySettingsSchema.php
  53. 18
      src/CoreBundle/Settings/SessionSettingsSchema.php
  54. 94
      src/CoreBundle/Settings/SettingsManager.php
  55. 3
      src/CoreBundle/Settings/SkillSettingsSchema.php
  56. 6
      src/CoreBundle/Settings/SurveySettingsSchema.php
  57. 3
      src/CoreBundle/Settings/TicketSettingsSchema.php
  58. 4
      src/CoreBundle/State/ColorThemeProcessor.php
  59. 2
      tests/CoreBundle/Controller/Admin/SettingsControllerTest.php
  60. 53
      tests/CoreBundle/Repository/ExtraFieldOptionsRepositoryTest.php
  61. 70
      tests/CoreBundle/Repository/ExtraFieldRepositoryTest.php
  62. 2
      tests/CoreBundle/Settings/SettingsManagerTest.php

@ -10,3 +10,21 @@
@apply border-none border-0 m-0 p-0 w-full;
}
}
.admin-colors {
&__container {
@apply flex flex-col md:flex-row gap-4 mt-6;
}
&__settings {
@apply space-y-4 flex-1;
.row-group {
@apply flex flex-col gap-4 items-start md:items-end md:grid md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3;
}
}
&__preview {
@apply space-y-4 flex-1;
}
}

@ -1,15 +1,20 @@
<template>
<div class="flex flex-col justify-center gap-0">
<p v-if="label">{{ label }}</p>
<div class="flex flex-row gap-3 h-10">
<p
v-if="label"
class="text-body-2 mb-1.5"
v-text="label"
/>
<div class="flex flex-row gap-2 h-10">
<ColorPicker
format="hex"
:model-value="hexColor"
class="w-11"
@update:model-value="colorPicked"
/>
<BaseInputText
label=""
class="max-w-32"
class="w-32"
input-class="mb-0"
:model-value="hexColor"
:error-text="inputHexError"
@ -24,7 +29,10 @@
>
{{ error }}
</small>
<div v-else class="h-4"></div>
<div
v-else
class="h-4"
></div>
</div>
</template>

@ -6,6 +6,7 @@
:model-value="modelValue"
:class="{ 'p-invalid': isInvalid, [inputClass]: true }"
:aria-label="label"
:disabled="disabled"
type="text"
@update:model-value="updateValue"
/>
@ -34,7 +35,7 @@
<script setup>
import InputText from "primevue/inputtext"
const props = defineProps({
defineProps({
id: {
type: String,
require: true,
@ -74,6 +75,10 @@ const props = defineProps({
type: String,
default: "",
},
disabled: {
type: Boolean,
default: false,
},
})
const emits = defineEmits(["update:modelValue"])

@ -8,7 +8,7 @@
:name="name"
:value="option.value"
/>
<label :for="name + index" class="ml-2 cursor-pointer">{{ option.label }}</label>
<label :for="`${name}-${index}`" class="ml-2 cursor-pointer">{{ option.label }}</label>
</div>
</div>
</template>

@ -7,24 +7,29 @@
:options="realOptions"
:option-label="optionLabel"
:option-value="optionValue"
placeholder="--"
:loading="isLoading"
:show-clear="allowClear"
@update:model-value="emit('update:modelValue', $event)"
>
<template #emptyfilter>--</template>
<template #empty>
<p class="pt-2 px-2">{{ t('No available options') }}</p>
<p class="pt-2 px-2">{{ t("No available options") }}</p>
</template>
</Dropdown>
<label v-t="label" :class="{ 'p-error': isInvalid }" :for="id" />
<label
v-t="label"
:class="{ 'p-error': isInvalid }"
:for="id"
/>
</div>
</div>
</template>
<script setup>
import {useI18n} from "vue-i18n";
import {computed} from "vue";
import { useI18n } from "vue-i18n"
import { computed } from "vue"
const {t} = useI18n()
const { t } = useI18n()
const props = defineProps({
id: {
@ -60,8 +65,16 @@ const props = defineProps({
},
hastEmptyValue: {
type: Boolean,
default: false
}
default: false,
},
isLoading: {
type: Boolean,
default: false,
},
allowClear: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(["update:modelValue"])
@ -72,12 +85,8 @@ const realOptions = computed(() => {
[props.optionLabel]: "--",
[props.optionValue]: "",
}
return [
emptyValue,
...props.options,
]
return [emptyValue, ...props.options]
}
return props.options
})
</script>

@ -94,6 +94,10 @@ const userSubmenuItems = computed(() => [
{
label: props.currentUser.fullName,
items: [
{
label: t("My profile"),
command: async () => await router.push({ name: "AccountHome" }),
},
{
label: t("My General Certificate"),
url: "/main/social/my_skills_report.php?a=generate_custom_skill",
@ -102,10 +106,6 @@ const userSubmenuItems = computed(() => [
label: t("My skills"),
url: "/main/social/my_skills_report.php",
},
{
label: t("Settings"),
command: async () => await router.push({ name: "AccountHome" }),
},
{
separator: true,
},

@ -41,6 +41,16 @@ export const useTheme = () => {
return colorsPlainObject
}
const setColors = (colorsObj) => {
for (const key in colorsObj) {
if (colors[key] === undefined || colors[key] === null) {
console.error(`Color with key ${key} is on color set`)
continue
}
colors[key].value = colorFromCSSVariable(colorsObj[key])
}
}
const colorToCSSVariable = (color) => {
// according to documentation https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb#syntax
// the format "r g b" should work but because how rules in css are defined does not
@ -58,5 +68,6 @@ export const useTheme = () => {
return {
getColorTheme,
getColors,
setColors,
}
}

@ -41,6 +41,17 @@ export default {
return data
},
/**
* @param {string} iri
* @param {Object} params
* @returns {Promise<Object>}
*/
async put(iri, params) {
const { data } = await api.put(iri, params)
return data
},
/**
* @param {string} endpoint
* @param {Object} params

@ -0,0 +1,41 @@
import baseService from "./baseService"
const url = "/api/color_themes"
/**
* Gets the color themes
*
* @returns {Promise<Array>}
*/
async function getThemes() {
const { items } = await baseService.getCollection(url)
return items
}
/**
* Update or create a theme with the title
*
* @param {string|null} iri
* @param {string} title
* @param {Object} colors
* @returns {Promise<Object>}
*/
async function updateTheme({ iri = null, title, colors }) {
if (iri) {
return await baseService.put(iri, {
title,
variables: colors,
})
}
return await baseService.post(url, {
title,
variables: colors,
})
}
export default {
getThemes,
updateTheme,
}

@ -1,378 +1,409 @@
<template class="personal-theme">
<h4 class="mb-4">{{ t("Configure chamilo colors") }}</h4>
<!-- Advanced mode -->
<div v-show="isAdvancedMode">
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorPrimary"
:label="t('Primary color')"
/>
<BaseColorPicker
v-model="colorPrimaryGradient"
:label="t('Primary color hover/background')"
/>
<BaseColorPicker
v-model="colorPrimaryButtonText"
:error="colorPrimaryButtonTextError"
:label="t('Primary color button text')"
/>
<BaseColorPicker
v-model="colorPrimaryButtonAlternativeText"
:error="colorPrimaryButtonAlternativeTextError"
:label="t('Primary color button alternative text')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorSecondary"
:label="t('Secondary color')"
/>
<BaseColorPicker
v-model="colorSecondaryGradient"
:label="t('Secondary color hover/background')"
/>
<BaseColorPicker
v-model="colorSecondaryButtonText"
:error="colorSecondaryButtonTextError"
:label="t('Secondary color button text')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorTertiary"
:label="t('Tertiary color')"
/>
<BaseColorPicker
v-model="colorTertiaryGradient"
:label="t('Tertiary color hover/background')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorSuccess"
:label="t('Success color')"
/>
<BaseColorPicker
v-model="colorSuccessGradient"
:label="t('Success color hover/background')"
/>
<BaseColorPicker
v-model="colorSuccessButtonText"
:error="colorSuccessButtonTextError"
:label="t('Success color button text')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorInfo"
:label="t('Info color')"
/>
<BaseColorPicker
v-model="colorInfoGradient"
:label="t('Info color hover/background')"
/>
<BaseColorPicker
v-model="colorInfoButtonText"
:error="colorInfoButtonTextError"
:label="t('Info color button text')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorWarning"
:label="t('Warning color')"
/>
<BaseColorPicker
v-model="colorWarningGradient"
:label="t('Warning color hover/background')"
/>
<BaseColorPicker
v-model="colorWarningButtonText"
:error="colorWarningButtonTextError"
:label="t('Warning color button text')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorDanger"
:label="t('Danger color')"
/>
<BaseColorPicker
v-model="colorDangerGradient"
:label="t('Danger color hover/background')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="formColor"
:label="t('Form outline color')"
/>
</div>
</div>
<!-- Simple mode -->
<div v-show="!isAdvancedMode">
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorPrimary"
:label="t('Primary color')"
/>
<BaseColorPicker
v-model="colorSecondary"
:label="t('Secondary color')"
/>
<BaseColorPicker
v-model="colorTertiary"
:label="t('Tertiary color')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="colorSuccess"
:label="t('Success color')"
/>
<BaseColorPicker
v-model="colorInfo"
:label="t('Info color')"
/>
<BaseColorPicker
v-model="colorWarning"
:label="t('Warning color')"
/>
<BaseColorPicker
v-model="colorDanger"
:label="t('Danger color')"
/>
</div>
<div class="flex flex-col gap-2 mb-3 md:grid md:grid-cols-2 xl:grid-cols-4">
<BaseColorPicker
v-model="formColor"
:label="t('Form outline color')"
/>
</div>
</div>
<div class="flex flex-wrap mb-4 gap-3">
<BaseButton
:label="t('Save')"
icon="send"
type="primary"
@click="saveColors"
/>
<BaseButton
:label="isAdvancedMode ? t('Hide advanced mode') : t('Show advanced mode')"
icon="cog"
type="black"
@click="isAdvancedMode = !isAdvancedMode"
/>
</div>
<hr />
<h5 class="mb-4">{{ t("You can see examples of how chamilo will look here") }}</h5>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Buttons") }}</p>
<div class="flex flex-row flex-wrap mb-3">
<BaseButton
:label="t('Primary')"
class="mr-2 mb-2"
icon="eye-on"
type="primary"
/>
<BaseButton
:label="t('Primary alternative')"
class="mr-2 mb-2"
icon="eye-on"
type="primary-alternative"
/>
<BaseButton
:label="t('Secondary')"
class="mr-2 mb-2"
icon="eye-on"
type="secondary"
/>
<BaseButton
:label="t('Tertiary')"
class="mr-2 mb-2"
icon="eye-on"
type="black"
/>
</div>
<div class="flex flex-row flex-wrap mb-3">
<BaseButton
:label="t('Success')"
class="mr-2 mb-2"
icon="send"
type="success"
/>
<BaseButton
:label="t('Info')"
class="mr-2 mb-2"
icon="send"
type="info"
/>
<BaseButton
:label="t('Warning')"
class="mr-2 mb-2"
icon="send"
type="warning"
/>
<BaseButton
:label="t('Danger')"
class="mr-2 mb-2"
icon="delete"
type="danger"
/>
</div>
<div class="flex flex-row flex-wrap mb-3">
<BaseButton
:label="t('Disabled')"
class="mr-2 mb-2"
disabled
icon="eye-on"
type="primary"
/>
<BaseButton
class="mr-2 mb-2"
icon="cog"
only-icon
type="primary"
/>
</div>
</div>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Dropdowns") }}</p>
<div class="flex flex-row gap-3">
<BaseButton
class="mr-3 mb-2"
icon="cog"
only-icon
popup-identifier="menu"
type="primary"
@click="toggle"
/>
<BaseMenu
id="menu"
ref="menu"
:model="menuItems"
/>
<BaseDropdown
v-model="dropdown"
:label="t('Dropdown')"
:options="[
{
label: t('Option 1'),
value: 'option_1',
},
{
label: t('Option 2'),
value: 'option_2',
},
{
label: t('Option 3'),
value: 'option_3',
},
]"
class="w-36"
input-id="dropdown"
name="dropdown"
option-label="label"
option-value="value"
/>
</div>
</div>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Checkbox and radio buttons") }}</p>
<BaseCheckbox
id="check1"
v-model="checkbox1"
:label="t('Checkbox 1')"
name="checkbox1"
/>
<BaseCheckbox
id="check2"
v-model="checkbox2"
:label="t('Checkbox 2')"
name="checkbox2"
/>
<div class="mb-2"></div>
<BaseRadioButtons
v-model="radioValue"
:initial-value="radioValue"
:options="radioButtons"
name="radio"
/>
</div>
<template>
<div class="admin-colors">
<SectionHeader :title="t('Configure Chamilo colors')" />
<div class="admin-colors__container">
<div class="admin-colors__settings">
<BaseSelect
v-model="selectedTheme"
:is-loading="isServerThemesLoading"
:label="t('Theme selector')"
:options="serverThemes"
allow-clear
option-label="title"
option-value="@id"
/>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Toggle") }}</p>
<BaseToggleButton
:model-value="toggleState"
:off-label="t('Show all')"
:on-label="t('Hide all')"
off-icon="eye-on"
on-icon="eye-off"
size="normal"
without-borders
@update:model-value="toggleState = !toggleState"
/>
</div>
<BaseInputText
v-model="themeTitle"
:disabled="selectedTheme"
:label="t('Title')"
/>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Forms") }}</p>
<BaseInputText
:label="t('This is the default form')"
:model-value="null"
/>
<BaseInputText
:is-invalid="true"
:label="t('This is a form with an error')"
:model-value="null"
/>
<BaseInputDate
id="date"
:label="t('Date')"
class="w-32"
/>
</div>
<!-- Advanced mode -->
<div v-show="isAdvancedMode">
<div class="row-group">
<BaseColorPicker
v-model="colorPrimary"
:label="t('Primary color')"
/>
<BaseColorPicker
v-model="colorPrimaryGradient"
:label="t('Primary color hover/background')"
/>
<BaseColorPicker
v-model="colorPrimaryButtonText"
:error="colorPrimaryButtonTextError"
:label="t('Primary color button text')"
/>
<BaseColorPicker
v-model="colorPrimaryButtonAlternativeText"
:error="colorPrimaryButtonAlternativeTextError"
:label="t('Primary color button alternative text')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorSecondary"
:label="t('Secondary color')"
/>
<BaseColorPicker
v-model="colorSecondaryGradient"
:label="t('Secondary color hover/background')"
/>
<BaseColorPicker
v-model="colorSecondaryButtonText"
:error="colorSecondaryButtonTextError"
:label="t('Secondary color button text')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorTertiary"
:label="t('Tertiary color')"
/>
<BaseColorPicker
v-model="colorTertiaryGradient"
:label="t('Tertiary color hover/background')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorSuccess"
:label="t('Success color')"
/>
<BaseColorPicker
v-model="colorSuccessGradient"
:label="t('Success color hover/background')"
/>
<BaseColorPicker
v-model="colorSuccessButtonText"
:error="colorSuccessButtonTextError"
:label="t('Success color button text')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorInfo"
:label="t('Info color')"
/>
<BaseColorPicker
v-model="colorInfoGradient"
:label="t('Info color hover/background')"
/>
<BaseColorPicker
v-model="colorInfoButtonText"
:error="colorInfoButtonTextError"
:label="t('Info color button text')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorWarning"
:label="t('Warning color')"
/>
<BaseColorPicker
v-model="colorWarningGradient"
:label="t('Warning color hover/background')"
/>
<BaseColorPicker
v-model="colorWarningButtonText"
:error="colorWarningButtonTextError"
:label="t('Warning color button text')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorDanger"
:label="t('Danger color')"
/>
<BaseColorPicker
v-model="colorDangerGradient"
:label="t('Danger color hover/background')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="formColor"
:label="t('Form outline color')"
/>
</div>
</div>
<!-- Simple mode -->
<div v-show="!isAdvancedMode">
<div class="row-group">
<BaseColorPicker
v-model="colorPrimary"
:label="t('Primary color')"
/>
<BaseColorPicker
v-model="colorSecondary"
:label="t('Secondary color')"
/>
<BaseColorPicker
v-model="colorTertiary"
:label="t('Tertiary color')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="colorSuccess"
:label="t('Success color')"
/>
<BaseColorPicker
v-model="colorInfo"
:label="t('Info color')"
/>
<BaseColorPicker
v-model="colorWarning"
:label="t('Warning color')"
/>
<BaseColorPicker
v-model="colorDanger"
:label="t('Danger color')"
/>
</div>
<div class="row-group">
<BaseColorPicker
v-model="formColor"
:label="t('Form outline color')"
/>
</div>
</div>
<div class="field">
<BaseButton
:label="isAdvancedMode ? t('Hide advanced mode') : t('Show advanced mode')"
icon="cog"
type="black"
@click="isAdvancedMode = !isAdvancedMode"
/>
</div>
<div class="field">
<BaseButton
:label="t('Save')"
icon="send"
type="primary"
@click="saveColors"
/>
</div>
</div>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Dialogs") }}</p>
<BaseButton
:label="t('Show dialog')"
icon="eye-on"
type="black"
@click="isDialogVisible = true"
/>
<BaseDialogConfirmCancel
:is-visible="isDialogVisible"
:title="t('Dialog example')"
@confirm-clicked="isDialogVisible = false"
@cancel-clicked="isDialogVisible = false"
/>
</div>
<div class="mb-4">
<p class="mb-3 text-lg">{{ t("Some more elements") }}</p>
<div class="course-tool cursor-pointer">
<div class="course-tool__link hover:primary-gradient hover:bg-primary-gradient/10">
<span
aria-hidden="true"
class="course-tool__icon mdi mdi-bookshelf"
/>
<BaseDivider layout="vertical" />
<div class="admin-colors__preview">
<h6>{{ t("You can see examples of how chamilo will look here") }}</h6>
<div>
<p class="mb-3 text-lg">{{ t("Buttons") }}</p>
<div class="flex flex-row flex-wrap mb-3">
<BaseButton
:label="t('Primary')"
class="mr-2 mb-2"
icon="eye-on"
type="primary"
/>
<BaseButton
:label="t('Primary alternative')"
class="mr-2 mb-2"
icon="eye-on"
type="primary-alternative"
/>
<BaseButton
:label="t('Secondary')"
class="mr-2 mb-2"
icon="eye-on"
type="secondary"
/>
<BaseButton
:label="t('Tertiary')"
class="mr-2 mb-2"
icon="eye-on"
type="black"
/>
</div>
<div class="flex flex-row flex-wrap mb-3">
<BaseButton
:label="t('Success')"
class="mr-2 mb-2"
icon="send"
type="success"
/>
<BaseButton
:label="t('Info')"
class="mr-2 mb-2"
icon="send"
type="info"
/>
<BaseButton
:label="t('Warning')"
class="mr-2 mb-2"
icon="send"
type="warning"
/>
<BaseButton
:label="t('Danger')"
class="mr-2 mb-2"
icon="delete"
type="danger"
/>
</div>
<div class="flex flex-row flex-wrap mb-3">
<BaseButton
:label="t('Disabled')"
class="mr-2 mb-2"
disabled
icon="eye-on"
type="primary"
/>
<BaseButton
class="mr-2 mb-2"
icon="cog"
only-icon
type="primary"
/>
</div>
</div>
<div>
<p class="mb-3 text-lg">{{ t("Dropdowns") }}</p>
<div class="flex flex-row gap-3">
<BaseButton
class="mr-3 mb-2"
icon="cog"
only-icon
popup-identifier="menu"
type="primary"
@click="toggle"
/>
<BaseMenu
id="menu"
ref="menu"
:model="menuItems"
/>
<BaseDropdown
v-model="dropdown"
:label="t('Dropdown')"
:options="[
{
label: t('Option 1'),
value: 'option_1',
},
{
label: t('Option 2'),
value: 'option_2',
},
{
label: t('Option 3'),
value: 'option_3',
},
]"
class="w-36"
input-id="dropdown"
name="dropdown"
option-label="label"
option-value="value"
/>
</div>
</div>
<div>
<p class="mb-3 text-lg">{{ t("Checkbox and radio buttons") }}</p>
<div class="flex flex-col md:flex-row gap-3 md:gap-5">
<BaseRadioButtons
v-model="radioValue"
:initial-value="radioValue"
:options="radioButtons"
name="radio"
/>
<div>
<BaseCheckbox
id="check1"
v-model="checkbox1"
:label="t('Checkbox 1')"
name="checkbox1"
/>
<BaseCheckbox
id="check2"
v-model="checkbox2"
:label="t('Checkbox 2')"
name="checkbox2"
/>
</div>
</div>
</div>
<div>
<p class="mb-3 text-lg">{{ t("Toggle") }}</p>
<BaseToggleButton
:model-value="toggleState"
:off-label="t('Show all')"
:on-label="t('Hide all')"
off-icon="eye-on"
on-icon="eye-off"
size="normal"
without-borders
@update:model-value="toggleState = !toggleState"
/>
</div>
<div>
<p class="mb-3 text-lg">{{ t("Forms") }}</p>
<BaseInputText
:label="t('This is the default form')"
:model-value="null"
/>
<BaseInputText
:is-invalid="true"
:label="t('This is a form with an error')"
:model-value="null"
/>
<BaseInputDate
id="date"
:label="t('Date')"
class="w-32"
/>
</div>
<div>
<p class="mb-3 text-lg">{{ t("Dialogs") }}</p>
<BaseButton
:label="t('Show dialog')"
icon="eye-on"
type="black"
@click="isDialogVisible = true"
/>
<BaseDialogConfirmCancel
:is-visible="isDialogVisible"
:title="t('Dialog example')"
@confirm-clicked="isDialogVisible = false"
@cancel-clicked="isDialogVisible = false"
/>
</div>
<div>
<p class="mb-3 text-lg">{{ t("Some more elements") }}</p>
<div class="course-tool cursor-pointer">
<div class="course-tool__link hover:primary-gradient hover:bg-primary-gradient/10">
<span
aria-hidden="true"
class="course-tool__icon mdi mdi-bookshelf"
/>
</div>
<p class="course-tool__title">{{ t("Documents") }}</p>
</div>
</div>
</div>
<p class="course-tool__title">{{ t("Documents") }}</p>
</div>
</div>
</template>
@ -381,22 +412,25 @@
import BaseButton from "../../components/basecomponents/BaseButton.vue"
import { useI18n } from "vue-i18n"
import BaseMenu from "../../components/basecomponents/BaseMenu.vue"
import { provide, ref, watch } from "vue"
import { onMounted, provide, ref, watch } from "vue"
import BaseCheckbox from "../../components/basecomponents/BaseCheckbox.vue"
import BaseRadioButtons from "../../components/basecomponents/BaseRadioButtons.vue"
import BaseDialogConfirmCancel from "../../components/basecomponents/BaseDialogConfirmCancel.vue"
import BaseInputText from "../../components/basecomponents/BaseInputText.vue"
import BaseColorPicker from "../../components/basecomponents/BaseColorPicker.vue"
import { useTheme } from "../../composables/theme"
import axios from "axios"
import { useNotification } from "../../composables/notification"
import BaseDropdown from "../../components/basecomponents/BaseDropdown.vue"
import BaseInputDate from "../../components/basecomponents/BaseInputDate.vue"
import BaseToggleButton from "../../components/basecomponents/BaseToggleButton.vue"
import Color from "colorjs.io"
import themeService from "../../services/colorThemeService"
import BaseSelect from "../../components/basecomponents/BaseSelect.vue"
import BaseDivider from "../../components/basecomponents/BaseDivider.vue"
import SectionHeader from "../../components/layout/SectionHeader.vue"
const { t } = useI18n()
const { getColorTheme, getColors } = useTheme()
const { getColorTheme, getColors, setColors } = useTheme()
const { showSuccessNotification, showErrorNotification } = useNotification()
let colorPrimary = getColorTheme("--color-primary-base")
@ -412,8 +446,6 @@ let colorTertiary = getColorTheme("--color-tertiary-base")
let colorTertiaryGradient = getColorTheme("--color-tertiary-gradient")
let colorTertiaryButtonText = getColorTheme("--color-tertiary-button-text")
const themeTitle = ref()
let colorSuccess = getColorTheme("--color-success-base")
let colorSuccessGradient = getColorTheme("--color-success-gradient")
let colorSuccessButtonText = getColorTheme("--color-success-button-text")
@ -432,20 +464,61 @@ let colorDangerButtonText = getColorTheme("--color-danger-button-text")
let formColor = getColorTheme("--color-form-base")
const serverThemes = ref([])
const isServerThemesLoading = ref(true)
const themeTitle = ref()
const selectedTheme = ref()
onMounted(async () => {
await refreshThemes()
})
watch(selectedTheme, (newValue) => {
if (!newValue) {
themeTitle.value = ""
}
const found = serverThemes.value.find((e) => e["@id"] === newValue) ?? null
if (found) {
themeTitle.value = found.title
setColors(found.variables)
}
})
const saveColors = async () => {
let colors = getColors()
try {
await axios.post("/api/color_themes", {
const updatedTheme = await themeService.updateTheme({
iri: selectedTheme.value || undefined,
title: themeTitle.value,
variables: colors,
colors: getColors(),
})
showSuccessNotification(t("Colors updated"))
showSuccessNotification(t("Color updated"))
await refreshThemes()
selectedTheme.value = updatedTheme["@id"]
} catch (error) {
showErrorNotification(error)
console.error(error)
}
}
const refreshThemes = async () => {
try {
serverThemes.value = await themeService.getThemes()
const found = serverThemes.value.find((e) => e.active) ?? null
if (found) {
selectedTheme.value = found["@id"]
}
isServerThemesLoading.value = false
} catch (error) {
showErrorNotification(t("We could not retrieve the themes"))
console.error(error)
}
}
const isAdvancedMode = ref(false)
watch(colorPrimary, (newValue) => {

@ -10,4 +10,4 @@ stof_doctrine_extensions:
sluggable: true
softdeleteable: true
sortable: true
translatable: true
translatable: false

@ -666,7 +666,7 @@ if ('true' === api_get_setting('allow_terms_conditions')) {
if (1 !== (int) $userInfo['profile_completed']) {
$blockButton = true;
$infoMessage .= Display::return_message(
get_lang('You must first fill your profile to enable the terms and conditions validation'),
get_lang('You must first fill your profile to enable the terms and conditions validation.'),
'warning',
true
);
@ -716,8 +716,8 @@ if ('true' === api_get_setting('allow_terms_conditions')) {
'checkbox',
'legal_accept',
null,
get_lang('I have read and agree') . '&nbsp;<a href="inscription.php?legal" target="_blank">' .
get_lang('Terms and conditions') . '</a>'
get_lang('I have read and agree to the') . '&nbsp;<a href="inscription.php?legal" target="_blank">' .
get_lang('Terms and Conditions') . '</a>'
);
$form->addRule(
'legal_accept',
@ -739,7 +739,7 @@ if ('true' === api_get_setting('allow_terms_conditions')) {
'checkbox',
'legal_accept',
null,
get_lang('I have read and agree')
get_lang('I have read and agree to the') . ' ' . get_lang('Terms and Conditions')
);
$form->addRule(
'legal_accept',

@ -2331,13 +2331,13 @@ switch ($action) {
$result = $new_result;
break;
case 'get_mail_template':
$columns = ['name', 'type', 'default_template', 'actions'];
$columns = ['title', 'type', 'default_template', 'actions'];
if (!in_array($sidx, $columns)) {
$sidx = 'name';
$sidx = 'title';
}
if (!in_array($sidx, $columns)) {
$sidx = 'name';
$sidx = 'title';
}
$result = Database::select(
@ -2413,7 +2413,7 @@ switch ($action) {
get_lang('No')
);
foreach ($result as $item) {
$item['display_text'] = $item['displayText'];
$item['display_text'] = ExtraField::translateDisplayName($item['variable'], $item['displayText']);
$item['value_type'] = $obj->get_field_type_by_id($item['valueType']);
$item['changeable'] = $item['changeable'] ? $checkIcon : $timesIcon;
$item['visible_to_self'] = $item['visibleToSelf'] ? $checkIcon : $timesIcon;

@ -449,7 +449,7 @@ switch ($action) {
function ($session) {
return [
'id' => $session['id'],
'text' => strip_tags($session['name']),
'text' => strip_tags($session['title']),
];
},
SessionManager::formatSessionsAdminForGrid($options)

@ -209,7 +209,7 @@ switch ($action) {
if (
api_is_anonymous() ||
!api_get_configuration_value('social_enable_messages_feedback')
!api_get_setting('social.social_enable_messages_feedback')
) {
echo json_encode(false);
exit;

@ -11,7 +11,7 @@ class MailTemplateManager extends Model
{
public $columns = [
'id',
'name',
'title',
'template',
'type',
'system',
@ -83,12 +83,15 @@ class MailTemplateManager extends Model
$id = isset($_GET['id']) ? (int) $_GET['id'] : '';
$form->addElement('header', '', $header);
$form->addElement('hidden', 'id', $id);
if (!empty($id)) {
$form->addElement('hidden', 'id', $id);
}
$form->addElement('hidden', 'default_template', 0);
$form->addElement(
'text',
'name',
get_lang('Name'),
['size' => '70', 'id' => 'name']
'title',
get_lang('Title'),
['size' => '70', 'id' => 'title']
);
/*$form->addHtmlEditor(
@ -146,7 +149,7 @@ class MailTemplateManager extends Model
$form->setDefaults($defaults);
// Setting the rules
$form->addRule('name', get_lang('Required field'), 'required');
$form->addRule('title', get_lang('Required field'), 'required');
return $form;
}

@ -2676,7 +2676,7 @@ function api_get_setting($variable, $isArray = false, $key = null)
break;
default:
$settingValue = $settingsManager->getSetting($variable, true);
if ($isArray && !empty($settingValue)) {
if (is_string($settingValue) && $isArray && !empty($settingValue)) {
// Check if the value is a valid JSON string
$decodedValue = json_decode($settingValue, true);

@ -639,7 +639,7 @@ class ExtraField extends Model
$extraFieldId = $row['id'];
/** @var \Chamilo\CoreBundle\Entity\ExtraField $extraField */
$extraField = $extraFieldRepo->find($extraFieldId);
$row['display_text'] = $extraField->getDisplayText();
$row['display_text'] = ExtraField::translateDisplayName($row['variable'],$row['display_text']);
// All the tags of the field
$sql = "SELECT * FROM $this->table_field_tag
@ -795,6 +795,30 @@ class ExtraField extends Model
return $extra;
}
/**
* Translate the display text for a extra field.
*
* @param string $variable
* @param string $defaultDisplayText
*
* @return string
*/
public static function translateDisplayName($variable, $defaultDisplayText): string
{
// 1st priority variable.
$translatedVariable = get_lang(api_underscore_to_camel_case($variable));
if (api_underscore_to_camel_case($variable) !== $translatedVariable) {
return $translatedVariable;
}
// 2nd priority display text.
$translatedDisplayText = get_lang($defaultDisplayText);
if ($defaultDisplayText !== $translatedDisplayText) {
return $translatedDisplayText;
}
return $defaultDisplayText;
}
/**
* Return an array of all the extra fields available for this item.
*
@ -924,7 +948,7 @@ class ExtraField extends Model
$extraFieldId = $extraField['id'];
/** @var \Chamilo\CoreBundle\Entity\ExtraField $field */
$field = $extraFieldRepo->find($extraFieldId);
$extraField['display_text'] = $field->getDisplayText();
$extraField['display_text'] = self::translateDisplayName($extraField['variable'], $extraField['display_text']);
$extraField['options'] = $option->get_field_options_by_field(
$extraField['id'],
false,
@ -1114,7 +1138,7 @@ class ExtraField extends Model
//$translatedDisplayText = $field_details['display_text'];
/** @var \Chamilo\CoreBundle\Entity\ExtraField $extraField */
$extraField = $extraFieldRepo->find($field_details['id']);
$translatedDisplayText = get_lang($extraField->getDisplayText());
$translatedDisplayText = ExtraField::translateDisplayName($field_details['variable'],$field_details['display_text']);
$translatedDisplayHelpText = '';
if ($help) {
@ -2066,7 +2090,7 @@ class ExtraField extends Model
$extraFieldId = $row['id'];
/** @var \Chamilo\CoreBundle\Entity\ExtraField $extraField */
$field = $extraFieldRepo->find($extraFieldId);
$row['display_text'] = $field->getDisplayText();
$row['display_text'] = $this->translateDisplayName($row['variable'], $row['display_text']);
// All the options of the field
$sql = "SELECT * FROM $this->table_field_options
@ -2337,23 +2361,7 @@ class ExtraField extends Model
}
$form->addElement('header', $header);
if ('edit' === $action) {
$translateUrl = api_get_path(WEB_CODE_PATH).'extrafield/translate.php?'.http_build_query(['id' => $id]);
$translateButton = Display::toolbarButton(
get_lang('Translate this term'),
$translateUrl,
'language',
'link'
);
$form->addText(
'display_text',
[get_lang('Name'), $translateButton]
);
} else {
$form->addElement('text', 'display_text', get_lang('Name'));
}
$form->addElement('text', 'display_text', get_lang('Name'));
$form->addHtmlEditor('description', get_lang('Description'), false);
@ -2495,7 +2503,7 @@ class ExtraField extends Model
$extraFieldRepo = Container::getExtraFieldRepository();
/** @var \Chamilo\CoreBundle\Entity\ExtraField $extraField */
$field = $extraFieldRepo->find($id);
$info['display_text'] = $field->getDisplayText();
$info['display_text'] = ExtraField::translateDisplayName($info['variable'],$info['display_text']);
}
return $info;

@ -549,7 +549,7 @@ class ExtraFieldOption extends Model
'id' => $row->getId(),
'field_id' => $row->getField()->getId(),
'option_value' => $row->getValue(),
'display_text' => $row->getDisplayText(),
'display_text' => \ExtraField::translateDisplayName($row->getValue(), $row->getDisplayText()),
'priority' => $row->getPriority(),
'priority_message' => $row->getPriorityMessage(),
'option_order' => $row->getOptionOrder(),
@ -591,7 +591,7 @@ class ExtraFieldOption extends Model
'id' => $subOption->getId(),
'field_id' => $subOption->getField()->getId(),
'option_value' => $subOption->getValue(),
'display_text' => $subOption->getDisplayText(),
'display_text' => \ExtraField::translateDisplayName($subOption->getValue(), $subOption->getDisplayText()),
'priority' => $subOption->getPriority(),
'priority_message' => $subOption->getPriorityMessage(),
'option_order' => $subOption->getOptionOrder(),
@ -862,7 +862,7 @@ class ExtraFieldOption extends Model
if ($info && $translateDisplayText) {
$extraFieldOptionsRepo = Container::getExtraFieldOptionsRepository();
$option = $extraFieldOptionsRepo->find($id);
$info['display_text'] = $option->getDisplayText();
$info['display_text'] = \ExtraField::translateDisplayName($option->getValue(), $option->getDisplayText());
}
return $info;
@ -875,7 +875,7 @@ class ExtraFieldOption extends Model
foreach ($result as &$row) {
$extraFieldOptionsRepo = Container::getExtraFieldOptionsRepository();
$option = $extraFieldOptionsRepo->find($row['id']);
$row['display_text'] = $option->getDisplayText();
$row['display_text'] = \ExtraField::translateDisplayName($option->getValue(), $option->getDisplayText());
}
return $result;

@ -1674,7 +1674,7 @@ class MessageManager
*/
public static function countLikesAndDislikes($messageId, $userId): array
{
if (!api_get_configuration_value('social_enable_messages_feedback')) {
if ('true' !== api_get_setting('social.social_enable_messages_feedback')) {
return [];
}
@ -1700,7 +1700,7 @@ class MessageManager
*/
public static function getLikesButton($messageId, $userId, $groupId = 0)
{
if (!api_get_configuration_value('social_enable_messages_feedback')) {
if ('true' !== api_get_setting('social.social_enable_messages_feedback')) {
return '';
}
@ -1722,7 +1722,7 @@ class MessageManager
);
$btnDislike = '';
if (false === api_get_configuration_value('disable_dislike_option')) {
if ('true' !== api_get_setting('social.disable_dislike_option')) {
$disabled = $countLikes['user_disliked'] ? 'btn--danger' : 'btn--plain';
$btnDislike = Display::button(

@ -0,0 +1,160 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php';
api_protect_admin_script();
//Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();
$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : 'list';
$check = Security::check_token('request');
$token = Security::get_token();
$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$mailTemplate = new MailTemplateManager();
$content = '';
switch ($action) {
case 'add':
$url = api_get_self().'?action='.Security::remove_XSS($_GET['action']);
$form = $mailTemplate->returnForm($url, 'add');
// The validation or display
if ($form->validate()) {
if ($check) {
$values = $form->exportValues();
$values['template'] = $values['email_template'];
$values['author_id'] = api_get_user_id();
$values['url_id'] = api_get_current_access_url_id();
var_dump($values);
$res = $mailTemplate->save($values);
if ($res) {
Display::addFlash(Display::return_message(get_lang('ItemAdded'), 'confirm'));
}
}
header('Location: '.api_get_self());
exit;
} else {
$content .= '<div class="actions">';
$content .= Display::url(
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM),
api_get_self()
);
$content .= '</div>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(['sec_token' => $token]);
$content .= $form->returnForm();
}
break;
case 'edit':
$url = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.$id;
$form = $mailTemplate->returnForm($url, 'edit');
$content .= '<div class="actions">';
$content .= Display::url(
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM),
api_get_self()
);
$content .= '</div>';
$content .= $form->returnForm();
// The validation or display
if ($form->validate()) {
//if ($check) {
$values = $form->exportValues();
$values['template'] = $values['email_template'];
$res = $mailTemplate->update($values);
if ($res) {
Display::addFlash(
Display::return_message(get_lang('ItemUpdated').': '.$values['title'], 'confirm')
);
}
//}
header('Location: '.api_get_self());
exit;
}
break;
case 'delete':
$mailTemplate->delete($id);
Display::addFlash(
Display::return_message(get_lang('Deleted'), 'confirm')
);
header('Location: '.api_get_self());
exit;
break;
case 'set_default':
$mailTemplate->setDefault($id);
Display::addFlash(
Display::return_message(get_lang('Updated'), 'confirm')
);
header('Location: '.api_get_self());
break;
case 'list':
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_mail_template';
$columns = [
get_lang('Name'),
get_lang('Type'),
get_lang('Default'),
get_lang('Actions'),
];
$column_model = [
[
'name' => 'name',
'index' => 'name',
'width' => '380px',
'align' => 'left',
],
[
'name' => 'type',
'index' => 'type',
'width' => '150px',
'align' => 'left',
],
[
'name' => 'default_template',
'index' => 'default_template',
'width' => '200px',
'align' => 'left',
'hidden' => 'true',
],
[
'name' => 'actions',
'index' => 'actions',
'width' => '300px',
'align' => 'left',
'formatter' => 'action_formatter',
'sortable' => 'false',
],
];
$extra_params['autowidth'] = 'true'; //use the width of the parent
$extra_params['height'] = 'auto'; //use the width of the parent
//With this function we can add actions to the jgrid
$action_links = 'function action_formatter (cellvalue, options, rowObject) {
var defaultIcon = "<i class=\"mdi mdi-circle-outline mdi-24px\"></i>";
if (rowObject[2] == 1) {
defaultIcon = "<i class=\"mdi mdi-check-circle mdi-24px\"></i>";
}
return \'&nbsp;<a href="?action=edit&id=\'+options.rowId+\'"><i class=\"mdi mdi-pencil mdi-24px\"></i></a>'.
'&nbsp;<a href="?action=set_default&id=\'+options.rowId+\'" title=\"'.get_lang('Default').'\">\'+ defaultIcon + \'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'"><i class=\"mdi mdi-delete mdi-24px\"></i></a> \';
}';
$content = $mailTemplate->display();
$content .= '
<script>
$(function() {
'.Display::grid_js('mail_template', $url, $columns, $column_model, $extra_params, [], $action_links, true).'
});
</script>';
break;
}
$template = new Template();
$template->assign('content', $content);
$template->display_one_col_template();

@ -976,7 +976,7 @@ if ('true' === api_get_setting('allow_terms_conditions')) {
$timeLegalAccept = api_get_local_time($legalTime);
} else {
$btn = Display::url(
get_lang('Send message legal agreement'),
get_lang('Send legal agreement'),
api_get_self().'?action=send_legal&student='.$studentId.'&course='.$courseCode,
['class' => 'btn btn--primary']
);

@ -523,7 +523,7 @@ $form->addSelect(
['id' => 'filter_status']
);
$form->addButtonSearch(get_lang('Search Sessions'), 'search');
$form->addButtonSearch(get_lang('Search sessions'), 'search');
$extraFieldsToFilter = $extraField->get_all(['variable = ?' => 'temps_de_travail']);
$extraFieldToSearch = [];

@ -50,7 +50,7 @@ if (is_array($idChecked)) {
$idChecked = $my_temp;
}
$sql = "SELECT s.name, c.title
$sql = "SELECT s.title, c.title
FROM $tbl_session_rel_course src
INNER JOIN $tbl_session s ON s.id = src.session_id
INNER JOIN $tbl_course c ON c.id = src.c_id

@ -9,78 +9,78 @@ namespace Chamilo\CoreBundle\DataFixtures;
use Chamilo\CoreBundle\Entity\ExtraField;
use Chamilo\CoreBundle\Entity\ExtraFieldOptions;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
use Doctrine\Persistence\ObjectManager;
class ExtraFieldFixtures extends Fixture
class ExtraFieldFixtures extends Fixture implements FixtureGroupInterface
{
public function load(ObjectManager $manager): void
public static function getGroups(): array
{
return ['extrafield-update'];
}
public static function getExtraFields(): array
{
$list = [
return [
[
'variable' => 'legal_accept',
'display_text' => 'Legal',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'already_logged_in',
'display_text' => 'Already logged in',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'update_type',
'display_text' => 'Update script type',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'tags',
'display_text' => 'tags',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TAG,
'value_type' => ExtraField::FIELD_TYPE_TAG,
],
[
'variable' => 'rssfeeds',
'display_text' => 'RSS',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'dashboard',
'display_text' => 'Dashboard',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
/*[
'variable' => 'timezone',
'display_text' => 'Timezone',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
],*/
[
'variable' => 'user_chat_status',
'display_text' => 'User chat status',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'google_calendar_url',
'display_text' => 'Google Calendar URL',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'captcha_blocked_until_date',
'display_text' => 'Account locked until',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
],
[
'variable' => 'special_course',
'display_text' => 'Special course',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_CHECKBOX,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
@ -88,7 +88,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'tags',
'display_text' => 'Tags',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TAG,
'value_type' => ExtraField::FIELD_TYPE_TAG,
'visible_to_self' => true,
'changeable' => true,
],
@ -96,7 +96,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'video_url',
'display_text' => 'VideoUrl',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_VIDEO_URL,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
@ -104,7 +104,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'image',
'display_text' => 'Image',
'item_type' => ExtraField::SESSION_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_FILE_IMAGE,
'value_type' => ExtraField::FIELD_TYPE_FILE_IMAGE,
'visible_to_self' => true,
'changeable' => true,
],
@ -113,7 +113,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'mail_notify_invitation',
'display_text' => 'MailNotifyInvitation',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_SELECT,
'value_type' => ExtraField::FIELD_TYPE_SELECT,
'visible_to_self' => true,
'default_value' => 1,
'add_options' => true,
@ -122,7 +122,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'mail_notify_message',
'display_text' => 'MailNotifyMessage',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_SELECT,
'value_type' => ExtraField::FIELD_TYPE_SELECT,
'visible_to_self' => true,
'default_value' => 1,
'add_options' => true,
@ -131,7 +131,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'mail_notify_group_message',
'display_text' => 'MailNotifyGroupMessage',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_SELECT,
'value_type' => ExtraField::FIELD_TYPE_SELECT,
'visible_to_self' => true,
'default_value' => 1,
'add_options' => true,
@ -140,7 +140,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'skype',
'display_text' => 'Skype',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
@ -148,7 +148,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'linkedin_url',
'display_text' => 'LinkedInUrl',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TEXT,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
@ -156,7 +156,7 @@ class ExtraFieldFixtures extends Fixture
'variable' => 'tags',
'display_text' => 'Tags',
'item_type' => ExtraField::SKILL_FIELD_TYPE,
'value_type' => \ExtraField::FIELD_TYPE_TAG,
'value_type' => ExtraField::FIELD_TYPE_TAG,
'visible_to_self' => true,
'changeable' => true,
],
@ -264,39 +264,607 @@ class ExtraFieldFixtures extends Fixture
'visible_to_self' => true,
'changeable' => true,
],
];
[
'variable' => 'work_time',
'display_text' => 'Considered working time',
'item_type' => ExtraField::WORK_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_INTEGER,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'address',
'display_text' => 'User address',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'advancedcourselist',
'display_text' => 'Advanced Course List',
'item_type' => ExtraField::EXERCISE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_SELECT_MULTIPLE,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'ask_for_revision',
'display_text' => 'Ask for Revision',
'item_type' => ExtraField::FORUM_POST_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'ask_new_password',
'display_text' => 'Ask New Password',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'authenticationDate',
'display_text' => 'Authentication Date',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_DATETIME,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'authenticationMethod',
'display_text' => 'Authentication Method',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'azure_id',
'display_text' => 'Azure ID',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'birthday',
'display_text' => 'Birthday',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_DATE,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'block_category',
'display_text' => 'Block Category',
'item_type' => ExtraField::EXERCISE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'buycourses_company',
'display_text' => 'BuyCourses Company',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'buycourses_vat',
'display_text' => 'BuyCourses VAT',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'buycourses_address',
'display_text' => 'BuyCourses Address',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'cas_user',
'display_text' => 'CAS User',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'careerid',
'display_text' => 'Career ID',
'item_type' => ExtraField::CAREER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_INTEGER,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'career_urls',
'display_text' => 'Career URLs',
'item_type' => ExtraField::CAREER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'career_diagram',
'display_text' => 'Career Diagram',
'item_type' => ExtraField::CAREER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'collapsed',
'display_text' => 'Collapsed',
'item_type' => ExtraField::SESSION_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'ConsideredWorkingTime',
'display_text' => 'Considered Working Time',
'item_type' => ExtraField::WORK_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'created_by',
'display_text' => 'Created By',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'credentialType',
'display_text' => 'Credential Type',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'differentiation',
'display_text' => 'Differentiation',
'item_type' => ExtraField::QUESTION_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'disable_emails',
'display_text' => 'Disable Emails',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'disable_import_calendar',
'display_text' => 'Disable Import Calendar',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'downloaded_at',
'display_text' => 'Downloaded At',
'item_type' => ExtraField::USER_CERTIFICATE,
'value_type' => ExtraField::FIELD_TYPE_DATETIME,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'drupal_user_id',
'display_text' => 'Drupal User ID',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'etat',
'display_text' => 'State',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'end_pause_date',
'display_text' => 'End Pause Date',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_DATETIME,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'gdpr',
'display_text' => 'GDPR Compliance',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'isFromNewLogin',
'display_text' => 'Is From New Login',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'language',
'display_text' => 'Language',
'item_type' => ExtraField::FORUM_CATEGORY_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'longTermAuthenticationRequestTokenUsed',
'display_text' => 'Long Term Authentication Request Token Used',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'moodle_password',
'display_text' => 'Moodle Password',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'multilingual',
'display_text' => 'Multilingual',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'my_terms',
'display_text' => 'My Terms',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'new_tracking_system',
'display_text' => 'New Tracking System',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'nif',
'display_text' => 'NIF',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'niveau',
'display_text' => 'Level',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'no_automatic_validation',
'display_text' => 'No Automatic Validation',
'item_type' => ExtraField::LP_ITEM_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'notification_event',
'display_text' => 'Notification Event',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'notifications',
'display_text' => 'Notifications',
'item_type' => ExtraField::EXERCISE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'number_of_days_for_completion',
'display_text' => 'Number of Days for Completion',
'item_type' => ExtraField::LP_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'oauth2_id',
'display_text' => 'OAuth2 ID',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'office_address',
'display_text' => 'Office Address',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'office_phone_extension',
'display_text' => 'Office Phone Extension',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'organisationemail',
'display_text' => 'Organisation Email',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'pause_formation',
'display_text' => 'Pause Formation',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'popular_courses',
'display_text' => 'Popular Courses',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'plugin_bbb_course_users_limit',
'display_text' => 'BigBlueButton Course Users Limit',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_INTEGER,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'plugin_bbb_session_users_limit',
'display_text' => 'BigBlueButton Session Users Limit',
'item_type' => ExtraField::SESSION_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_INTEGER,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'qualite',
'display_text' => 'Quality',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'remedialcourselist',
'display_text' => 'Remedial Course List',
'item_type' => ExtraField::COURSE_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'request_for_delete_account',
'display_text' => 'Request for Delete Account',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'request_for_delete_account_justification',
'display_text' => 'Justification for Account Deletion',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXTAREA,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'request_for_legal_agreement_consent_removal',
'display_text' => 'Request for Legal Agreement Consent Removal',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'request_for_legal_agreement_consent_removal_justification',
'display_text' => 'Justification for Consent Removal',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXTAREA,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'revision_language',
'display_text' => 'Revision Language',
'item_type' => ExtraField::FORUM_POST_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'ruc',
'display_text' => 'RUC (Tax ID)',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'session_career',
'display_text' => 'Session Career Link',
'item_type' => ExtraField::SESSION_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_INTEGER,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'successful_AuthenticationHandlers',
'display_text' => 'Successful Authentication Handlers',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'termactivated',
'display_text' => 'Term Activated',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'terms_villedustage',
'display_text' => 'Terms City of Internship',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
$options = [
'At once',
'Daily',
'No',
[
'variable' => 'timezone',
'display_text' => 'Timezone',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'uid',
'display_text' => 'UID',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'use_score_as_progress',
'display_text' => 'Use Score as Progress',
'item_type' => ExtraField::LP_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'whispeak_auth_uid',
'display_text' => 'Whispeak Auth UID',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'whispeak_lp_item',
'display_text' => 'Whispeak Learning Path Item',
'item_type' => ExtraField::LP_ITEM_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'whispeak_quiz_question',
'display_text' => 'Whispeak Quiz Question',
'item_type' => ExtraField::QUESTION_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'terms_ville',
'display_text' => 'Terms City',
'item_type' => ExtraField::USER_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_TEXT,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'time',
'display_text' => 'Time',
'item_type' => ExtraField::QUESTION_FIELD_TYPE,
'value_type' => ExtraField::FIELD_TYPE_INTEGER,
'visible_to_self' => true,
'changeable' => true,
],
];
}
public function load(ObjectManager $manager): void
{
$list = self::getExtraFields();
foreach ($list as $data) {
$extraField = (new ExtraField())
->setVariable($data['variable'])
->setDisplayText($data['display_text'])
->setItemType($data['item_type'])
->setValueType($data['value_type'])
->setChangeable($data['changeable'] ?? false)
->setVisibleToSelf($data['visible_to_self'] ?? false)
;
$existingField = $manager->getRepository(ExtraField::class)->findOneBy([
'variable' => $data['variable'],
'itemType' => $data['item_type'],
]);
if (isset($data['default_value'])) {
$extraField->setDefaultValue((string) $data['default_value']);
}
if (!$existingField) {
$extraField = new ExtraField();
$extraField->setVariable($data['variable'])
->setDisplayText($data['display_text'])
->setItemType($data['item_type'])
->setValueType($data['value_type'])
->setChangeable($data['changeable'] ?? false)
->setVisibleToSelf($data['visible_to_self'] ?? false);
if (isset($data['add_options'])) {
foreach ($options as $key => $text) {
$extraFieldOption = (new ExtraFieldOptions())
->setField($extraField)
->setDisplayText($text)
->setOptionOrder($key + 1)
;
$manager->persist($extraFieldOption);
if (isset($data['default_value'])) {
$extraField->setDefaultValue((string) $data['default_value']);
}
if (isset($data['add_options']) && $data['add_options']) {
$options = ['At once', 'Daily', 'No'];
foreach ($options as $option) {
$extraFieldOption = new ExtraFieldOptions();
$extraFieldOption->setField($extraField)
->setDisplayText($option)
->setOptionOrder(array_search($option, $options) + 1);
$manager->persist($extraFieldOption);
}
}
$manager->persist($extraField);
}
$manager->persist($extraField);
}
$manager->flush();

File diff suppressed because it is too large Load Diff

@ -8,7 +8,9 @@ namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use Chamilo\CoreBundle\State\ColorThemeProcessor;
use Chamilo\CoreBundle\Traits\TimestampableTypedEntity;
use Doctrine\ORM\Mapping as ORM;
@ -18,15 +20,16 @@ use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity]
#[ApiResource(
operations: [
new Post(
processor: ColorThemeProcessor::class,
),
new Post(),
new Put(),
new GetCollection(),
],
denormalizationContext: [
'groups' => ['color_theme:write'],
],
paginationEnabled: false,
security: "is_granted('ROLE_ADMIN')",
processor: ColorThemeProcessor::class,
)]
class ColorTheme
{
@ -39,7 +42,7 @@ class ColorTheme
#[Groups(['color_theme:write'])]
#[ORM\Column(length: 255)]
private ?string $title = null;
private string $title;
/**
* @var array<string, mixed>
@ -52,9 +55,8 @@ class ColorTheme
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[Groups(['color_theme:write'])]
#[ORM\Column]
private ?bool $active = null;
private bool $active = false;
public function getId(): ?int
{

@ -97,8 +97,6 @@ class ExtraField
#[Gedmo\Translatable]
#[ORM\Column(name: 'display_text', type: 'string', length: 255, nullable: true, unique: false)]
protected ?string $displayText = null;
#[Gedmo\Locale]
protected ?string $locale = null;
#[ORM\Column(name: 'helper_text', type: 'text', nullable: true, unique: false)]
protected ?string $helperText = null;
#[ORM\Column(name: 'default_value', type: 'text', nullable: true, unique: false)]
@ -318,16 +316,6 @@ class ExtraField
return $this;
}
public function setTranslatableLocale($locale): static
{
$this->locale = $locale;
return $this;
}
public function getTranslatableLocale(): ?string
{
return $this->locale;
}
public function getAutoRemove(): bool
{

@ -33,9 +33,6 @@ class ExtraFieldOptions
#[ORM\Column(name: 'display_text', type: 'string', length: 255, nullable: true)]
protected ?string $displayText = null;
#[Gedmo\Locale]
protected ?string $locale = null;
#[ORM\Column(name: 'priority', type: 'string', length: 255, nullable: true)]
protected ?string $priority = null;
@ -133,16 +130,4 @@ class ExtraFieldOptions
return $this;
}
public function setTranslatableLocale($locale)
{
$this->locale = $locale;
return $this;
}
public function getTranslatableLocale()
{
return $this->locale;
}
}

@ -29,11 +29,13 @@ class MailTemplate
#[ORM\Column(name: 'type', type: 'string', nullable: false)]
protected string $type;
#[ORM\Column(name: 'score', type: 'float', nullable: true)]
protected float $authorId;
#[ORM\ManyToOne(targetEntity: "User")]
#[ORM\JoinColumn(name: 'author_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
protected ?User $author = null;
#[ORM\Column(name: 'result_id', type: 'integer', nullable: false)]
protected int $urlId;
#[ORM\ManyToOne(targetEntity: "AccessUrl")]
#[ORM\JoinColumn(name: 'url_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected ?AccessUrl $url = null;
#[ORM\Column(name: 'default_template', type: 'boolean', nullable: false)]
protected bool $defaultTemplate;

@ -356,9 +356,6 @@ class Version20 extends AbstractMigrationChamilo
$this->addSql(
'CREATE TABLE IF NOT EXISTS scheduled_announcements (id INT AUTO_INCREMENT NOT NULL, subject VARCHAR(255) NOT NULL, message LONGTEXT NOT NULL, date DATETIME DEFAULT NULL, sent TINYINT(1) NOT NULL, session_id INT NOT NULL, c_id INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;'
);
$this->addSql(
'CREATE TABLE IF NOT EXISTS ext_translations (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) NOT NULL, object_class VARCHAR(190) NOT NULL, field VARCHAR(32) NOT NULL, foreign_key VARCHAR(64) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX translations_lookup_idx (locale, object_class, foreign_key), UNIQUE INDEX lookup_unique_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;'
);
$this->addSql(
'CREATE TABLE IF NOT EXISTS ext_log_entries (id INT AUTO_INCREMENT NOT NULL, action VARCHAR(8) NOT NULL, logged_at DATETIME NOT NULL, object_id VARCHAR(64) DEFAULT NULL, object_class VARCHAR(191) NOT NULL, version INT NOT NULL, data LONGTEXT DEFAULT NULL COMMENT "(DC2Type:array)", username VARCHAR(191) DEFAULT NULL, INDEX log_class_lookup_idx (object_class), INDEX log_date_lookup_idx (logged_at), INDEX log_user_lookup_idx (username), INDEX log_version_lookup_idx (object_id, object_class, version), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;'
);
@ -406,8 +403,6 @@ class Version20 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE templates ADD CONSTRAINT FK_6F287D8EA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
}
$this->addSql('CREATE TABLE IF NOT EXISTS ext_translations (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) NOT NULL, object_class VARCHAR(191) NOT NULL, field VARCHAR(32) NOT NULL, foreign_key VARCHAR(64) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX translations_lookup_idx (locale, object_class, foreign_key), UNIQUE INDEX lookup_unique_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
// Rename extra_field field_type and extra_field_type to item_type and value_type, also, the term "value" in exta_field_values.value renamed to field_value
$table = $schema->getTable('extra_field');
if ($table->hasColumn('extra_field_type')) {

@ -6,6 +6,7 @@ declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\DataFixtures\SettingsCurrentFixtures;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
@ -22,447 +23,11 @@ class Version20230216122900 extends AbstractMigrationChamilo
public function up(Schema $schema): void
{
$connection = $this->getEntityManager()->getConnection();
$configurationValues = [
'Ticket' => [
'ticket_project_user_roles',
],
'Session' => [
'allow_redirect_to_session_after_inscription_about',
'remove_session_url',
'session_list_show_count_users',
'session_admins_access_all_content',
'session_admins_edit_courses_content',
'limit_session_admin_list_users',
'hide_search_form_in_session_list',
'allow_delete_user_for_session_admin',
'allow_disable_user_for_session_admin',
'session_multiple_subscription_students_list_avoid_emptying',
'hide_reporting_session_list',
'allow_session_admin_read_careers',
'session_list_order',
'allow_user_session_collapsable',
'allow_session_admin_login_as_teacher',
'catalog_course_subscription_in_user_s_session',
'default_session_list_view',
'session_automatic_creation_user_id',
'user_s_session_duration',
'my_courses_session_order',
'session_courses_read_only_mode',
'session_import_settings',
'catalog_settings',
'tracking_columns',
'my_progress_session_show_all_courses',
'assignment_base_course_teacher_access_to_all_session',
'allow_session_admin_extra_access',
'hide_session_graph_in_my_progress',
'show_users_in_active_sessions_in_tracking',
'session_coach_access_after_duration_end',
'session_course_users_subscription_limited_to_session_users',
'session_classes_tab_disable',
'email_template_subscription_to_session_confirmation_username',
'email_template_subscription_to_session_confirmation_lost_password',
'session_creation_user_course_extra_field_relation_to_prefill',
'session_creation_form_set_extra_fields_mandatory',
],
'Security' => [
'allow_online_users_by_status',
'password_requirements',
'security_strict_transport',
'security_content_policy',
'security_content_policy_report_only',
'security_public_key_pins',
'security_public_key_pins_report_only',
'security_x_frame_options',
'security_xss_protection',
'security_x_content_type_options',
'security_referrer_policy',
'security_block_inactive_users_immediately',
'security_session_cookie_samesite_none',
],
'Course' => [
'view_grid_courses',
'show_simple_session_info',
'my_courses_show_courses_in_user_language_only',
'allow_public_course_with_no_terms_conditions',
'show_all_sessions_on_my_course_page',
'disabled_edit_session_coaches_course_editing_course',
'allow_base_course_category',
'hide_course_sidebar',
'allow_course_extra_field_in_catalog',
'multiple_access_url_show_shared_course_marker',
'course_category_code_to_use_as_model',
'enable_unsubscribe_button_on_my_course_page',
'course_creation_donate_message_show',
'course_creation_donate_link',
'courses_list_session_title_link',
'hide_course_rating',
'course_log_hide_columns',
'course_student_info',
'course_catalog_settings',
'resource_sequence_show_dependency_in_course_intro',
'block_registered_users_access_to_open_course_contents',
'course_catalog_display_in_home',
'course_creation_form_set_course_category_mandatory',
'course_creation_form_hide_course_code',
'course_about_teacher_name_hide',
'course_visibility_change_only_admin',
'catalog_hide_public_link',
'course_log_default_extra_fields',
'show_courses_in_catalogue',
'courses_catalogue_show_only_category',
'course_creation_by_teacher_extra_fields_to_show',
'course_creation_form_set_extra_fields_mandatory',
'course_configuration_tool_extra_fields_to_show_and_edit',
'course_creation_user_course_extra_field_relation_to_prefill',
'allow_edit_tool_visibility_in_session',
],
'Language' => [
'show_language_selector_in_menu',
'language_flags_by_country',
'allow_course_multiple_languages',
'template_activate_language_filter',
],
'Platform' => [
'table_row_list',
'video_features',
'proxy_settings',
'unoconv_binaries',
'hide_main_navigation_menu',
'pdf_img_dpi',
'tracking_skip_generic_data',
'hide_complete_name_in_whoisonline',
'table_default_row',
'allow_double_validation_in_registration',
'block_my_progress_page',
'generate_random_login',
'timepicker_increment',
'default_template',
'webservice_return_user_field',
'multiple_url_hide_disabled_settings',
'login_max_attempt_before_blocking_account',
'force_renew_password_at_first_login',
'hide_breadcrumb_if_not_allowed',
'extldap_config',
'update_student_expiration_x_date',
'user_status_show_options_enabled',
'user_status_show_option',
'user_number_of_days_for_default_expiration_date_per_role',
'user_edition_extra_field_to_check',
'user_hide_never_expire_option',
'platform_logo_url',
'use_career_external_id_as_identifier_in_diagrams',
'disable_webservices',
'webservice_enable_adminonly_api',
'allow_working_time_edition',
'disable_user_conditions_sender_id',
'portfolio_advanced_sharing',
'redirect_index_to_url_for_logged_users',
'notification_event',
],
'Profile' => [
'linkedin_organization_id',
'career_diagram_disclaimer',
'career_diagram_legend',
'allow_career_diagram',
'hide_username_with_complete_name',
'disable_change_user_visibility_for_public_courses',
'my_space_users_items_per_page',
'add_user_course_information_in_mailto',
'pass_reminder_custom_link',
'registration_add_helptext_for_2_names',
'disable_gdpr',
'data_protection_officer_name',
'data_protection_officer_role',
'data_protection_officer_email',
'hide_user_field_from_list',
'send_notification_when_user_added',
'show_conditions_to_user',
'allow_teachers_to_classes',
'profile_fields_visibility',
'user_import_settings',
'user_search_on_extra_fields',
'allow_career_users',
'community_managers_user_list',
'allow_social_map_fields',
'hide_username_in_course_chat',
],
'Admin' => [
'user_status_option_only_for_admin_enabled',
'show_link_request_hrm_user',
'max_anonymous_users',
'send_inscription_notification_to_general_admin_only',
'plugin_redirection_enabled',
'usergroup_do_not_unsubscribe_users_from_course_nor_session_on_user_unsubscribe',
'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',
],
'Agenda' => [
'personal_agenda_show_all_session_events',
'allow_agenda_edit_for_hrm',
'agenda_legend',
'agenda_colors',
'agenda_on_hover_info',
'personal_calendar_show_sessions_occupation',
'agenda_reminders_sender_id',
'fullcalendar_settings',
],
'Lp' => [
'add_all_files_in_lp_export',
'show_prerequisite_as_blocked',
'hide_lp_time',
'lp_category_accordion',
'lp_view_accordion',
'disable_js_in_lp_view',
'allow_teachers_to_access_blocked_lp_by_prerequisite',
'allow_lp_chamilo_export',
'hide_accessibility_label_on_lp_item',
'lp_minimum_time',
'validate_lp_prerequisite_from_other_session',
'show_hidden_exercise_added_to_lp',
'lp_menu_location',
'lp_score_as_progress_enable',
'lp_prevents_beforeunload',
'disable_my_lps_page',
'scorm_api_username_as_student_id',
'scorm_api_extrafield_to_use_as_student_id',
'allow_import_scorm_package_in_course_builder',
'allow_htaccess_import_from_scorm',
'allow_session_lp_category',
'ticket_lp_quiz_info_add',
'lp_subscription_settings',
'lp_view_settings',
'download_files_after_all_lp_finished',
'allow_lp_subscription_to_usergroups',
'lp_fixed_encoding',
'lp_prerequisite_use_last_attempt_only',
'show_invisible_exercise_in_lp_list',
'force_edit_exercise_in_lp',
'student_follow_page_add_LP_subscription_info',
'lp_show_max_progress_instead_of_average',
'lp_show_max_progress_or_average_enable_course_level_redefinition',
'lp_allow_export_to_students',
'show_invisible_lp_in_course_home',
'lp_start_and_end_date_visible_in_student_view',
'scorm_lms_update_sco_status_all_time',
'scorm_upload_from_cache',
'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_include_not_subscribed_lp_students',
'my_progress_course_tools_order',
'lp_enable_flow',
'lp_item_prerequisite_dates',
],
'Gradebook' => [
'gradebook_hide_graph',
'gradebook_hide_pdf_report_button',
'hide_gradebook_percentage_user_result',
'gradebook_use_exercise_score_settings_in_categories',
'gradebook_use_apcu_cache',
'gradebook_report_score_style',
'gradebook_score_display_custom_standalone',
'gradebook_use_exercise_score_settings_in_total',
'gradebook_dependency',
'gradebook_dependency_mandatory_courses',
'gradebook_badge_sidebar',
'gradebook_multiple_evaluation_attempts',
'allow_gradebook_stats',
'gradebook_flatview_extrafields_columns',
'gradebook_pdf_export_settings',
'allow_gradebook_comments',
'gradebook_display_extra_stats',
'gradebook_hide_table',
'gradebook_hide_link_to_item_for_student',
'gradebook_enable_subcategory_skills_independant_assignement',
],
'Exercise' => [
'block_quiz_mail_notification_general_coach',
'allow_quiz_question_feedback',
'allow_quiz_show_previous_button_setting',
'allow_teacher_comment_audio',
'quiz_prevent_copy_paste',
'quiz_show_description_on_results_page',
'quiz_generate_certificate_ending',
'quiz_open_question_decimal_score',
'quiz_check_button_enable',
'allow_notification_setting_per_exercise',
'hide_free_question_score',
'hide_user_info_in_quiz_result',
'exercise_attempts_report_show_username',
'allow_exercise_auto_launch',
'disable_clean_exercise_results_for_teachers',
'show_exercise_question_certainty_ribbon_result',
'quiz_results_answers_report',
'send_score_in_exam_notification_mail_to_manager',
'show_exercise_expected_choice',
'exercise_hide_label',
'exercise_category_round_score_in_export',
'exercises_disable_new_attempts',
'show_question_id',
'show_question_pagination',
'question_pagination_length',
'limit_exercise_teacher_access',
'block_category_questions',
'exercise_score_format',
'exercise_additional_teacher_modify_actions',
'quiz_confirm_saved_answers',
'allow_exercise_categories',
'allow_quiz_results_page_config',
'quiz_image_zoom',
'quiz_answer_extra_recording',
'allow_mandatory_question_in_category',
'add_exercise_best_attempt_in_report',
'exercise_category_report_user_extra_fields',
'score_grade_model',
'allow_time_per_question',
'my_courses_show_pending_exercise_attempts',
'allow_quick_question_description_popup',
'exercise_hide_ip',
'tracking_my_progress_show_deleted_exercises',
'show_exercise_attempts_in_all_user_sessions',
'show_exercise_session_attempts_in_base_course',
'quiz_check_all_answers_before_end_test',
'quiz_discard_orphan_in_course_export',
'exercise_result_end_text_html_strict_filtering',
'question_exercise_html_strict_filtering',
'quiz_question_delete_automatically_when_deleting_exercise',
'quiz_hide_attempts_table_on_start_page',
'quiz_hide_question_number',
'quiz_keep_alive_ping_interval',
],
'Glossary' => [
'default_glossary_view',
'allow_remove_tags_in_glossary_export',
],
'Forum' => [
'global_forums_course_id',
'hide_forum_post_revision_language',
'allow_forum_post_revisions',
'forum_fold_categories',
'allow_forum_category_language_filter',
'subscribe_users_to_forum_notifications_also_in_base_course',
],
'Message' => [
'private_messages_about_user',
'private_messages_about_user_visible_to_user',
'social_enable_messages_feedback',
'disable_dislike_option',
'allow_user_message_tracking',
'filter_interactivity_messages',
],
'Display' => [
'hide_social_media_links',
],
'Social' => [
'social_show_language_flag_in_profile',
'social_make_teachers_friend_all',
],
'Editor' => [
'save_titles_as_html',
'full_ckeditor_toolbar_set',
'ck_editor_block_image_copy_paste',
'translate_html',
'editor_driver_list',
'enable_uploadimage_editor',
'editor_settings',
'video_context_menu_hidden',
'video_player_renderers',
],
'Chat' => [
'hide_chat_video',
'course_chat_restrict_to_coach',
],
'Survey' => [
'hide_survey_reporting_button',
'survey_mark_question_as_required',
'survey_anonymous_show_answered',
'survey_allow_answered_question_edit',
'survey_duplicate_order_by_name',
'survey_backwards_enable',
'hide_survey_edition',
'survey_additional_teacher_modify_actions',
'show_surveys_base_in_sessions',
],
'Document' => [
'send_notification_when_document_added',
'thematic_pdf_orientation',
'certificate_pdf_orientation',
'allow_general_certificate',
'group_document_access',
'group_category_document_access',
'allow_compilatio_tool',
'compilatio_tool',
'documents_hide_download_icon',
'enable_x_sendfile_headers',
'documents_custom_cloud_link_list',
],
'Announcement' => [
'disable_delete_all_announcements',
'disable_announcement_attachment',
'allow_scheduled_announcements',
'hide_announcement_sent_to_users_info',
'send_all_emails_to',
'allow_careers_in_global_announcements',
'announcements_hide_send_to_hrm_users',
'allow_coach_to_edit_announcements',
'course_announcement_scheduled_by_date',
],
'Skill' => [
'allow_private_skills',
'allow_teacher_access_student_skills',
'skills_teachers_can_assign_skills',
'hide_skill_levels',
'table_of_hierarchical_skill_presentation',
'skill_levels_names',
'allow_skill_rel_items',
],
'Mail' => [
'update_users_email_to_dummy_except_admins',
'mail_header_style',
'mail_content_style',
'allow_email_editor_for_anonymous',
'messages_hide_mail_content',
'send_two_inscription_confirmation_mail',
'show_user_email_in_notification',
'send_notification_score_in_percentage',
'cron_notification_help_desk',
'notifications_extended_footer_message',
],
'Work' => [
'block_student_publication_edition',
'block_student_publication_add_documents',
'block_student_publication_score_edition',
'allow_only_one_student_publication_per_user',
'allow_my_student_publication_page',
'assignment_prevent_duplicate_upload',
'considered_working_time',
'force_download_doc_before_upload_work',
'allow_redirect_to_main_page_after_work_upload',
'my_courses_show_pending_work',
],
'Wiki' => [
'wiki_categories_enabled',
'wiki_html_strict_filtering',
],
'Certificate' => [
'hide_my_certificate_link',
'add_certificate_pdf_footer',
],
'Attendance' => [
'enable_sign_attendance_sheet',
'attendance_calendar_set_duration',
'attendance_allow_comments',
],
'Registration' => [
'required_extra_fields_in_inscription',
'allow_fields_inscription',
'send_inscription_msg_to_inbox',
],
];
foreach ($configurationValues as $category => $variables) {
foreach ($variables as $variable) {
$configurationValues = SettingsCurrentFixtures::getNewConfigurationSettings();
foreach ($configurationValues as $category => $settings) {
foreach ($settings as $setting) {
$variable = $setting['name'];
$category = strtolower($category);
$result = $connection
->executeQuery(
@ -665,453 +230,24 @@ class Version20230216122900 extends AbstractMigrationChamilo
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (13, 13, 'send_to_coaches', 'Send to Coaches', 1, 1, 1, NOW())"
);
}
$workTimeExists = $this->connection->fetchOne("SELECT COUNT(*) FROM extra_field WHERE variable = 'work_time' AND item_type = 9");
if (0 == $workTimeExists) {
$this->addSql(
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (9, 15, 'work_time', 'Considered working time', 1, 1, 1, NOW())"
);
}
}
public function down(Schema $schema): void
{
$connection = $this->getEntityManager()->getConnection();
$configurationValues = [
'Registration' => [
'send_inscription_msg_to_inbox',
'allow_fields_inscription',
'required_extra_fields_in_inscription',
],
'Attendance' => [
'attendance_allow_comments',
'attendance_calendar_set_duration',
'enable_sign_attendance_sheet',
],
'Certificate' => [
'add_certificate_pdf_footer',
'hide_my_certificate_link',
],
'Wiki' => [
'wiki_html_strict_filtering',
'wiki_categories_enabled',
],
'Work' => [
'my_courses_show_pending_work',
'allow_redirect_to_main_page_after_work_upload',
'force_download_doc_before_upload_work',
'considered_working_time',
'assignment_prevent_duplicate_upload',
'allow_my_student_publication_page',
'allow_only_one_student_publication_per_user',
'block_student_publication_score_edition',
'block_student_publication_add_documents',
'block_student_publication_edition',
],
'Mail' => [
'notifications_extended_footer_message',
'cron_notification_help_desk',
'send_notification_score_in_percentage',
'show_user_email_in_notification',
'send_two_inscription_confirmation_mail',
'send_inscription_msg_to_inbox',
'messages_hide_mail_content',
'allow_email_editor_for_anonymous',
'mail_content_style',
'mail_header_style',
'update_users_email_to_dummy_except_admins',
],
'Skill' => [
'allow_skill_rel_items',
'skill_levels_names',
'table_of_hierarchical_skill_presentation',
'hide_skill_levels',
'skills_teachers_can_assign_skills',
'allow_teacher_access_student_skills',
'allow_private_skills',
],
'Announcement' => [
'course_announcement_scheduled_by_date',
'allow_coach_to_edit_announcements',
'announcements_hide_send_to_hrm_users',
'allow_careers_in_global_announcements',
'send_all_emails_to',
'hide_announcement_sent_to_users_info',
'allow_scheduled_announcements',
'disable_announcement_attachment',
'disable_delete_all_announcements',
],
'Document' => [
'documents_custom_cloud_link_list',
'enable_x_sendfile_headers',
'documents_hide_download_icon',
'compilatio_tool',
'allow_compilatio_tool',
'group_category_document_access',
'group_document_access',
'allow_general_certificate',
'certificate_pdf_orientation',
'thematic_pdf_orientation',
'send_notification_when_document_added',
],
'Survey' => [
'show_surveys_base_in_sessions',
'survey_additional_teacher_modify_actions',
'hide_survey_edition',
'survey_backwards_enable',
'survey_duplicate_order_by_name',
'survey_allow_answered_question_edit',
'survey_anonymous_show_answered',
'survey_mark_question_as_required',
'hide_survey_reporting_button',
],
'Chat' => [
'course_chat_restrict_to_coach',
'hide_chat_video',
],
'Editor' => [
'video_player_renderers',
'video_context_menu_hidden',
'editor_settings',
'enable_uploadimage_editor',
'editor_driver_list',
'translate_html',
'ck_editor_block_image_copy_paste',
'full_ckeditor_toolbar_set',
'save_titles_as_html',
],
'Social' => [
'social_make_teachers_friend_all',
'social_show_language_flag_in_profile',
],
'Display' => [
'hide_social_media_links',
],
'Message' => [
'filter_interactivity_messages',
'allow_user_message_tracking',
'disable_dislike_option',
'social_enable_messages_feedback',
'private_messages_about_user_visible_to_user',
'private_messages_about_user',
],
'Forum' => [
'subscribe_users_to_forum_notifications_also_in_base_course',
'allow_forum_category_language_filter',
'forum_fold_categories',
'allow_forum_post_revisions',
'hide_forum_post_revision_language',
'global_forums_course_id',
],
'Glossary' => [
'allow_remove_tags_in_glossary_export',
'default_glossary_view',
],
'Exercise' => [
'quiz_keep_alive_ping_interval',
'quiz_hide_question_number',
'quiz_hide_attempts_table_on_start_page',
'quiz_question_delete_automatically_when_deleting_exercise',
'question_exercise_html_strict_filtering',
'exercise_result_end_text_html_strict_filtering',
'quiz_discard_orphan_in_course_export',
'quiz_check_all_answers_before_end_test',
'show_exercise_session_attempts_in_base_course',
'show_exercise_attempts_in_all_user_sessions',
'tracking_my_progress_show_deleted_exercises',
'exercise_hide_ip',
'allow_quick_question_description_popup',
'my_courses_show_pending_exercise_attempts',
'allow_time_per_question',
'score_grade_model',
'exercise_category_report_user_extra_fields',
'add_exercise_best_attempt_in_report',
'allow_mandatory_question_in_category',
'quiz_answer_extra_recording',
'quiz_image_zoom',
'allow_quiz_results_page_config',
'allow_exercise_categories',
'quiz_confirm_saved_answers',
'exercise_additional_teacher_modify_actions',
'exercise_score_format',
'block_category_questions',
'limit_exercise_teacher_access',
'question_pagination_length',
'show_question_pagination',
'show_question_id',
'exercises_disable_new_attempts',
'exercise_category_round_score_in_export',
'exercise_hide_label',
'show_exercise_expected_choice',
'send_score_in_exam_notification_mail_to_manager',
'quiz_results_answers_report',
'show_exercise_question_certainty_ribbon_result',
'disable_clean_exercise_results_for_teachers',
'allow_exercise_auto_launch',
'exercise_attempts_report_show_username',
'hide_user_info_in_quiz_result',
'hide_free_question_score',
'allow_notification_setting_per_exercise',
'quiz_check_button_enable',
'quiz_open_question_decimal_score',
'quiz_generate_certificate_ending',
'quiz_show_description_on_results_page',
'quiz_prevent_copy_paste',
'allow_teacher_comment_audio',
'allow_quiz_show_previous_button_setting',
'allow_quiz_question_feedback',
'block_quiz_mail_notification_general_coach',
],
'Gradebook' => [
'gradebook_enable_subcategory_skills_independant_assignement',
'gradebook_hide_link_to_item_for_student',
'gradebook_hide_table',
'gradebook_display_extra_stats',
'allow_gradebook_comments',
'gradebook_pdf_export_settings',
'gradebook_flatview_extrafields_columns',
'allow_gradebook_stats',
'gradebook_multiple_evaluation_attempts',
'gradebook_badge_sidebar',
'gradebook_dependency_mandatory_courses',
'gradebook_dependency',
'gradebook_use_exercise_score_settings_in_total',
'gradebook_score_display_custom_standalone',
'gradebook_report_score_style',
'gradebook_use_apcu_cache',
'gradebook_use_exercise_score_settings_in_categories',
'hide_gradebook_percentage_user_result',
'gradebook_hide_pdf_report_button',
'gradebook_hide_graph',
],
'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_hide_lp_tests_average',
'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',
'show_invisible_lp_in_course_home',
'lp_allow_export_to_students',
'lp_show_max_progress_or_average_enable_course_level_redefinition',
'lp_show_max_progress_instead_of_average',
'student_follow_page_add_LP_subscription_info',
'force_edit_exercise_in_lp',
'show_invisible_exercise_in_lp_list',
'lp_prerequisite_use_last_attempt_only',
'lp_fixed_encoding',
'allow_lp_subscription_to_usergroups',
'download_files_after_all_lp_finished',
'lp_view_settings',
'lp_subscription_settings',
'ticket_lp_quiz_info_add',
'allow_session_lp_category',
'allow_htaccess_import_from_scorm',
'allow_import_scorm_package_in_course_builder',
'scorm_api_extrafield_to_use_as_student_id',
'scorm_api_username_as_student_id',
'disable_my_lps_page',
'lp_prevents_beforeunload',
'lp_score_as_progress_enable',
'lp_menu_location',
'show_hidden_exercise_added_to_lp',
'validate_lp_prerequisite_from_other_session',
'lp_minimum_time',
'hide_accessibility_label_on_lp_item',
'allow_lp_chamilo_export',
'allow_teachers_to_access_blocked_lp_by_prerequisite',
'disable_js_in_lp_view',
'lp_view_accordion',
'lp_category_accordion',
'hide_lp_time',
'show_prerequisite_as_blocked',
'add_all_files_in_lp_export',
],
'Agenda' => [
'fullcalendar_settings',
'agenda_reminders_sender_id',
'personal_calendar_show_sessions_occupation',
'agenda_on_hover_info',
'agenda_colors',
'agenda_legend',
'allow_agenda_edit_for_hrm',
'personal_agenda_show_all_session_events',
],
'Admin' => [
'drh_allow_access_to_all_students',
'usergroup_do_not_unsubscribe_users_from_session_on_session_unsubscribe',
'usergroup_do_not_unsubscribe_users_from_course_on_course_unsubscribe',
'usergroup_do_not_unsubscribe_users_from_course_nor_session_on_user_unsubscribe',
'plugin_redirection_enabled',
'send_inscription_notification_to_general_admin_only',
'max_anonymous_users',
'show_link_request_hrm_user',
'user_status_option_only_for_admin_enabled',
],
'Profile' => [
'hide_username_in_course_chat',
'allow_social_map_fields',
'community_managers_user_list',
'allow_career_users',
'user_search_on_extra_fields',
'user_import_settings',
'profile_fields_visibility',
'allow_teachers_to_classes',
'show_conditions_to_user',
'send_notification_when_user_added',
'hide_user_field_from_list',
'data_protection_officer_email',
'data_protection_officer_role',
'data_protection_officer_name',
'disable_gdpr',
'registration_add_helptext_for_2_names',
'pass_reminder_custom_link',
'add_user_course_information_in_mailto',
'my_space_users_items_per_page',
'disable_change_user_visibility_for_public_courses',
'hide_username_with_complete_name',
'allow_career_diagram',
'career_diagram_legend',
'career_diagram_disclaimer',
'linkedin_organization_id',
],
'Platform' => [
'notification_event',
'redirect_index_to_url_for_logged_users',
'portfolio_advanced_sharing',
'disable_user_conditions_sender_id',
'allow_working_time_edition',
'webservice_enable_adminonly_api',
'disable_webservices',
'use_career_external_id_as_identifier_in_diagrams',
'platform_logo_url',
'user_hide_never_expire_option',
'user_edition_extra_field_to_check',
'user_number_of_days_for_default_expiration_date_per_role',
'user_status_show_option',
'user_status_show_options_enabled',
'update_student_expiration_x_date',
'extldap_config',
'hide_breadcrumb_if_not_allowed',
'force_renew_password_at_first_login',
'login_max_attempt_before_blocking_account',
'multiple_url_hide_disabled_settings',
'webservice_return_user_field',
'default_template',
'timepicker_increment',
'generate_random_login',
'block_my_progress_page',
'allow_double_validation_in_registration',
'table_default_row',
'hide_complete_name_in_whoisonline',
'tracking_skip_generic_data',
'pdf_img_dpi',
'hide_main_navigation_menu',
'unoconv_binaries',
'proxy_settings',
'video_features',
'table_row_list',
],
'Language' => [
'template_activate_language_filter',
'allow_course_multiple_languages',
'language_flags_by_country',
'show_language_selector_in_menu',
],
'Course' => [
'allow_edit_tool_visibility_in_session',
'course_creation_user_course_extra_field_relation_to_prefill',
'course_configuration_tool_extra_fields_to_show_and_edit',
'course_creation_form_set_extra_fields_mandatory',
'course_creation_by_teacher_extra_fields_to_show',
'courses_catalogue_show_only_category',
'show_courses_in_catalogue',
'course_log_default_extra_fields',
'catalog_hide_public_link',
'course_visibility_change_only_admin',
'course_about_teacher_name_hide',
'course_creation_form_hide_course_code',
'course_creation_form_set_course_category_mandatory',
'course_catalog_display_in_home',
'block_registered_users_access_to_open_course_contents',
'resource_sequence_show_dependency_in_course_intro',
'course_catalog_settings',
'course_student_info',
'course_log_hide_columns',
'hide_course_rating',
'courses_list_session_title_link',
'course_creation_donate_link',
'course_creation_donate_message_show',
'enable_unsubscribe_button_on_my_course_page',
'course_category_code_to_use_as_model',
'multiple_access_url_show_shared_course_marker',
'allow_course_extra_field_in_catalog',
'hide_course_sidebar',
'allow_base_course_category',
'disabled_edit_session_coaches_course_editing_course',
'show_all_sessions_on_my_course_page',
'allow_public_course_with_no_terms_conditions',
'my_courses_show_courses_in_user_language_only',
'show_simple_session_info',
'view_grid_courses',
],
'Security' => [
'security_session_cookie_samesite_none',
'security_block_inactive_users_immediately',
'security_referrer_policy',
'security_x_content_type_options',
'security_xss_protection',
'security_x_frame_options',
'security_public_key_pins_report_only',
'security_public_key_pins',
'security_content_policy_report_only',
'security_content_policy',
'security_strict_transport',
'password_requirements',
'allow_online_users_by_status',
],
'Session' => [
'session_creation_form_set_extra_fields_mandatory',
'session_creation_user_course_extra_field_relation_to_prefill',
'email_template_subscription_to_session_confirmation_lost_password',
'email_template_subscription_to_session_confirmation_username',
'session_classes_tab_disable',
'session_course_users_subscription_limited_to_session_users',
'session_coach_access_after_duration_end',
'show_users_in_active_sessions_in_tracking',
'hide_session_graph_in_my_progress',
'allow_session_admin_extra_access',
'assignment_base_course_teacher_access_to_all_session',
'my_progress_session_show_all_courses',
'tracking_columns',
'catalog_settings',
'session_import_settings',
'session_courses_read_only_mode',
'my_courses_session_order',
'user_s_session_duration',
'session_automatic_creation_user_id',
'default_session_list_view',
'catalog_course_subscription_in_user_s_session',
'allow_session_admin_login_as_teacher',
'allow_user_session_collapsable',
'session_list_order',
'allow_session_admin_read_careers',
'hide_reporting_session_list',
'session_multiple_subscription_students_list_avoid_emptying',
'allow_disable_user_for_session_admin',
'allow_delete_user_for_session_admin',
'hide_search_form_in_session_list',
'limit_session_admin_list_users',
'session_admins_edit_courses_content',
'session_admins_access_all_content',
'session_list_show_count_users',
'remove_session_url',
'allow_redirect_to_session_after_inscription_about',
],
'Ticket' => [
'ticket_project_user_roles',
],
];
foreach ($configurationValues as $category => $variables) {
foreach ($variables as $variable) {
$configurationValues = SettingsCurrentFixtures::getNewConfigurationSettings();
foreach ($configurationValues as $category => $settings) {
foreach ($settings as $setting) {
$variable = $setting['name'];
$category = strtolower($category);
$result = $connection
->executeQuery(
"SELECT COUNT(1) FROM settings_current WHERE variable = '$variable' AND category = '$category'"
@ -1127,7 +263,6 @@ class Version20230216122900 extends AbstractMigrationChamilo
}
// Delete extra fields required.
$result = $connection
->executeQuery(
"SELECT COUNT(1) FROM extra_field WHERE variable = 'end_date' AND item_type = 7 AND value_type = 7"

@ -19,10 +19,13 @@ class Version20240414120300 extends AbstractMigrationChamilo
public function up(Schema $schema): void
{
$settingsToUpdate = array_merge(
SettingsCurrentFixtures::getExistingSettings(),
SettingsCurrentFixtures::getNewConfigurationSettings()
);
$existingSettings = SettingsCurrentFixtures::getExistingSettings();
$newConfigurationSettings = SettingsCurrentFixtures::getNewConfigurationSettings();
$flattenedExistingSettings = $this->flattenConfigurationSettings($existingSettings);
$flattenedNewSettings = $this->flattenConfigurationSettings($newConfigurationSettings);
$settingsToUpdate = array_merge($flattenedExistingSettings, $flattenedNewSettings);
foreach ($settingsToUpdate as $settingData) {
$variableExists = $this->connection->fetchOne(
@ -44,4 +47,15 @@ class Version20240414120300 extends AbstractMigrationChamilo
}
public function down(Schema $schema): void {}
private function flattenConfigurationSettings(array $categorizedSettings): array
{
$flattenedSettings = [];
foreach ($categorizedSettings as $category => $settings) {
foreach ($settings as $setting) {
$flattenedSettings[] = $setting;
}
}
return $flattenedSettings;
}
}

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Chamilo\CoreBundle\DataFixtures\ExtraFieldFixtures;
use Doctrine\DBAL\Schema\Schema;
class Version20240416110300 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Adds missing extra fields to the database based on the predefined list';
}
public function up(Schema $schema): void
{
$extraFields = ExtraFieldFixtures::getExtraFields();
foreach ($extraFields as $field) {
$count = $this->connection->executeQuery(
"SELECT COUNT(*) FROM extra_field WHERE variable = :variable AND item_type = :item_type",
[
'variable' => $field['variable'],
'item_type' => $field['item_type'],
]
)->fetchOne();
if ($count == 0) {
$this->connection->insert('extra_field', [
'item_type' => $field['item_type'],
'value_type' => $field['value_type'],
'variable' => $field['variable'],
'display_text' => $field['display_text'],
'visible_to_self' => $field['visible_to_self'] ? 1 : 0,
'changeable' => $field['changeable'] ? 1 : 0,
'filter' => 1,
'created_at' => (new \DateTime())->format('Y-m-d H:i:s'),
]);
}
}
}
public function down(Schema $schema): void {}
}

@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
class Version20240416132900 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Update mail_template table structure, adding author_id, changing url_id and removing old fields';
}
public function up(Schema $schema): void
{
if ($schema->hasTable('mail_template')) {
// Adding author_id and setting the foreign key
$this->addSql('ALTER TABLE mail_template ADD author_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE mail_template ADD CONSTRAINT FK_4AB7DECBF675F31B FOREIGN KEY (author_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_4AB7DECBF675F31B ON mail_template (author_id)');
// Updating result_id to url_id and adjusting foreign key
$this->addSql('ALTER TABLE mail_template CHANGE result_id url_id INT NOT NULL');
$this->addSql('ALTER TABLE mail_template ADD CONSTRAINT FK_4AB7DECB81CFDAE7 FOREIGN KEY (url_id) REFERENCES access_url (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_4AB7DECB81CFDAE7 ON mail_template (url_id)');
// Dropping unused column 'score'
$this->addSql('ALTER TABLE mail_template DROP score');
}
}
public function down(Schema $schema): void
{
if ($schema->hasTable('mail_template')) {
// Reverting changes
$this->addSql('ALTER TABLE mail_template DROP FOREIGN KEY FK_4AB7DECBF675F31B');
$this->addSql('ALTER TABLE mail_template DROP author_id');
$this->addSql('DROP INDEX IDX_4AB7DECBF675F31B ON mail_template');
$this->addSql('ALTER TABLE mail_template DROP FOREIGN KEY FK_4AB7DECB81CFDAE7');
$this->addSql('ALTER TABLE mail_template CHANGE url_id result_id INT NOT NULL');
$this->addSql('DROP INDEX IDX_4AB7DECB81CFDAE7 ON mail_template');
$this->addSql('ALTER TABLE mail_template ADD score FLOAT NULL DEFAULT NULL');
}
}
}

@ -15,18 +15,11 @@ class ColorThemeRepository extends ServiceEntityRepository
parent::__construct($registry, ColorTheme::class);
}
public function deactivateAll(): void
public function deactivateAllExcept(ColorTheme $colorTheme): void
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb
->update(ColorTheme::class, 'ct')
->set('ct.active', ':inactive')
->where(
$qb->expr()->eq('ct.active', ':active')
)
->setParameters(['active' => true, 'inactive' => false])
->getQuery()
->execute()
$this->getEntityManager()
->createQuery('UPDATE Chamilo\CoreBundle\Entity\ColorTheme t SET t.active = FALSE WHERE t.id <> :id')
->execute(['id' => $colorTheme->getId()])
;
}

@ -65,8 +65,20 @@ abstract class AbstractSettingsSchema implements SchemaInterface
if (isset($settingsInfo[$fieldName])) {
$fieldConfig = $settingsInfo[$fieldName];
$options = $field->getOptions();
$options['label'] = $this->translator->trans($fieldConfig['label']);
$options['help'] = $this->translator->trans($fieldConfig['help']);
$labelFromDb = $this->translator->trans($fieldConfig['label']);
$helpFromDb = $this->translator->trans($fieldConfig['help']);
$existingHelp = $options['help'] ?? '';
if (!empty($existingHelp)) {
$combinedHelp = $helpFromDb . "<br>" . $existingHelp;
} else {
$combinedHelp = $helpFromDb;
}
$options['label'] = $labelFromDb;
$options['help'] = $combinedHelp;
$builder->remove($fieldName);
$builder->add($fieldName, \get_class($field->getType()->getInnerType()), $options);
}

@ -69,8 +69,7 @@ class AdminSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('The user status is hidden when is false, it requires user_status_option_only_for_admin_enabled = true').
$this->settingArrayHelpValue('user_status_option_show_only_for_admin'),
'help' => $this->settingArrayHelpValue('user_status_option_show_only_for_admin'),
]
)
;

@ -64,8 +64,7 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Agenda legend options').
$this->settingArrayHelpValue('agenda_legend'),
'help' => $this->settingArrayHelpValue('agenda_legend'),
]
)
->add(
@ -73,8 +72,7 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Set customs colors to agenda events').
$this->settingArrayHelpValue('agenda_colors'),
'help' => $this->settingArrayHelpValue('agenda_colors'),
]
)
->add(
@ -82,8 +80,7 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Customize on hover agenda view. Show agenda comment and/or description').
$this->settingArrayHelpValue('agenda_on_hover_info'),
'help' => $this->settingArrayHelpValue('agenda_on_hover_info'),
]
)
->add('agenda_reminders_sender_id', TextType::class)
@ -92,8 +89,7 @@ class AgendaSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Extra settings for the agenda (FullCalendar v3)').
$this->settingArrayHelpValue('fullcalendar_settings'),
'help' => $this->settingArrayHelpValue('fullcalendar_settings'),
]
)
->add('allow_careers_in_global_agenda', YesNoType::class)

@ -52,10 +52,7 @@ class AnnouncementSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Add "attachment" file upload extra field label in: main/admin/extra_fields.php?type=scheduled_announcement&action=add
Add "send_to_coaches" checkbox options field label in: main/admin/extra_fields.php?type=scheduled_announcement&action=add
Add the list of emails as a bcc when sending an email. Configure a cron task pointing at main/cron/scheduled_announcement.php').
$this->settingArrayHelpValue('send_all_emails_to'),
'help' => $this->settingArrayHelpValue('send_all_emails_to'),
]
)
->add('allow_careers_in_global_announcements', YesNoType::class)

@ -289,8 +289,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Course log - Default columns to hide').
$this->settingArrayHelpValue('course_log_hide_columns'),
'help' => $this->settingArrayHelpValue('course_log_hide_columns'),
]
)
->add(
@ -298,8 +297,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Show student progress in My courses page').
$this->settingArrayHelpValue('course_student_info'),
'help' => $this->settingArrayHelpValue('course_student_info'),
]
)
->add(
@ -307,8 +305,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Course catalog links behaviour').
$this->settingArrayHelpValue('course_catalog_settings'),
'help' => $this->settingArrayHelpValue('course_catalog_settings'),
]
)
->add('resource_sequence_show_dependency_in_course_intro', YesNoType::class)
@ -323,8 +320,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Course log - User extra fields to show as columns for default').
$this->settingArrayHelpValue('course_log_default_extra_fields'),
'help' => $this->settingArrayHelpValue('course_log_default_extra_fields'),
]
)
->add('show_courses_in_catalogue', YesNoType::class)
@ -333,8 +329,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allows defining one or several categories of courses that will be visible in the course catalog').
$this->settingArrayHelpValue('courses_catalogue_show_only_category'),
'help' => $this->settingArrayHelpValue('courses_catalogue_show_only_category'),
]
)
->add(
@ -342,8 +337,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Course extra fields to be presented on main/create_course/add_course.php').
$this->settingArrayHelpValue('course_creation_by_teacher_extra_fields_to_show'),
'help' => $this->settingArrayHelpValue('course_creation_by_teacher_extra_fields_to_show'),
]
)
->add(
@ -351,8 +345,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Configuration setting to make some extra field required in course creation form').
$this->settingArrayHelpValue('course_creation_form_set_extra_fields_mandatory'),
'help' => $this->settingArrayHelpValue('course_creation_form_set_extra_fields_mandatory'),
]
)
->add(
@ -360,8 +353,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Course extra fields to be presented on course settings').
$this->settingArrayHelpValue('course_configuration_tool_extra_fields_to_show_and_edit'),
'help' => $this->settingArrayHelpValue('course_configuration_tool_extra_fields_to_show_and_edit'),
]
)
->add(
@ -369,8 +361,7 @@ class CourseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Relation to prefill course extra field with user extra field on course creacion on main/create_course/add_course.php and main/admin/course_add.php').
$this->settingArrayHelpValue('course_creation_user_course_extra_field_relation_to_prefill'),
'help' => $this->settingArrayHelpValue('course_creation_user_course_extra_field_relation_to_prefill'),
]
)
->add('allow_edit_tool_visibility_in_session', YesNoType::class)

@ -171,8 +171,7 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow compilatio plagiarism prevention tool, requires extension "php-soap" sudo apt-get install php-soap').
$this->settingArrayHelpValue('compilatio_tool'),
'help' => $this->settingArrayHelpValue('compilatio_tool'),
]
)
->add('documents_hide_download_icon', YesNoType::class)
@ -182,8 +181,7 @@ class DocumentSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Custom cloud link URLS, this requires enable_add_file_link = true').
$this->settingArrayHelpValue('documents_custom_cloud_link_list'),
'help' => $this->settingArrayHelpValue('documents_custom_cloud_link_list'),
]
)
;

@ -84,8 +84,7 @@ class EditorSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('List of driver to plugin in ckeditor').
$this->settingArrayHelpValue('editor_driver_list'),
'help' => $this->settingArrayHelpValue('editor_driver_list'),
]
)
->add('enable_uploadimage_editor', YesNoType::class)
@ -94,8 +93,7 @@ class EditorSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Ckeditor settings').
$this->settingArrayHelpValue('editor_settings'),
'help' => $this->settingArrayHelpValue('editor_settings'),
]
)
->add('video_context_menu_hidden', YesNoType::class)
@ -104,8 +102,7 @@ class EditorSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Enable player renderers for YouTube, Vimeo, Facebook, DailyMotion, Twitch medias').
$this->settingArrayHelpValue('video_player_renderers'),
'help' => $this->settingArrayHelpValue('video_player_renderers'),
]
)
;

@ -151,8 +151,7 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow add additional actions (as links) in exercises list for teachers').
$this->settingArrayHelpValue('exercise_additional_teacher_modify_actions'),
'help' => $this->settingArrayHelpValue('exercise_additional_teacher_modify_actions'),
]
)
->add('quiz_confirm_saved_answers', YesNoType::class)
@ -163,8 +162,7 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Zoom in description images quiz').
$this->settingArrayHelpValue('quiz_image_zoom'),
'help' => $this->settingArrayHelpValue('quiz_image_zoom'),
]
)
->add('quiz_answer_extra_recording', YesNoType::class)
@ -174,8 +172,7 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Shows the best exercise score attempt for a student in the reports').
$this->settingArrayHelpValue('add_exercise_best_attempt_in_report'),
'help' => $this->settingArrayHelpValue('add_exercise_best_attempt_in_report'),
]
)
->add(
@ -183,8 +180,7 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Add user extra fields in report: main/mySpace/exercise_category_report.php').
$this->settingArrayHelpValue('exercise_category_report_user_extra_fields'),
'help' => $this->settingArrayHelpValue('exercise_category_report_user_extra_fields'),
]
)
->add(
@ -192,8 +188,7 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow to convert a score into a text/color label using a model if score is inside those values. See BT#12898').
$this->settingArrayHelpValue('score_grade_model'),
'help' => $this->settingArrayHelpValue('score_grade_model'),
]
)
->add('allow_time_per_question', YesNoType::class)
@ -216,8 +211,7 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow extends allowed question types for embeddable exercises. By default, only the following question types are allowed: 1, 2, 17').
$this->settingArrayHelpValue('exercise_embeddable_extra_types'),
'help' => $this->settingArrayHelpValue('exercise_embeddable_extra_types'),
]
)
;

@ -124,8 +124,7 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Courses id list to check in the gradebook sidebar see BT#13099').
$this->settingArrayHelpValue('gradebook_dependency_mandatory_courses'),
'help' => $this->settingArrayHelpValue('gradebook_dependency_mandatory_courses'),
]
)
->add(
@ -133,8 +132,7 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Gradebook id list needed to build the gradebook sidebar see BT#13099').
$this->settingArrayHelpValue('gradebook_badge_sidebar'),
'help' => $this->settingArrayHelpValue('gradebook_badge_sidebar'),
]
)
->add('gradebook_multiple_evaluation_attempts', YesNoType::class)
@ -144,8 +142,7 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow add one column by each user extra field indicated to the Gradebook Flatview for each user').
$this->settingArrayHelpValue('gradebook_flatview_extrafields_columns'),
'help' => $this->settingArrayHelpValue('gradebook_flatview_extrafields_columns'),
]
)
->add(
@ -153,8 +150,7 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Gradebook student pdf export settings').
$this->settingArrayHelpValue('gradebook_pdf_export_settings'),
'help' => $this->settingArrayHelpValue('gradebook_pdf_export_settings'),
]
)
->add('allow_gradebook_comments', YesNoType::class)
@ -163,8 +159,7 @@ class GradebookSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Enable specific columns in gradebook table').
$this->settingArrayHelpValue('gradebook_display_extra_stats'),
'help' => $this->settingArrayHelpValue('gradebook_display_extra_stats'),
]
)
->add('gradebook_hide_table', YesNoType::class)

@ -122,8 +122,7 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow or block user subscriptions to a lp/lp category').
$this->settingArrayHelpValue('lp_subscription_settings'),
'help' => $this->settingArrayHelpValue('lp_subscription_settings'),
]
)
->add(
@ -131,8 +130,7 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('LP view custom settings').
$this->settingArrayHelpValue('lp_view_settings'),
'help' => $this->settingArrayHelpValue('lp_view_settings'),
]
)
->add(
@ -140,8 +138,7 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Show download files button after finishing all LP. Example: ABC is the course code, and 1 and 100 are the doc id').
$this->settingArrayHelpValue('download_files_after_all_lp_finished'),
'help' => $this->settingArrayHelpValue('download_files_after_all_lp_finished'),
]
)
->add('allow_lp_subscription_to_usergroups', YesNoType::class)
@ -167,8 +164,7 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow change the order to show the tools in "My progress" page').
$this->settingArrayHelpValue('my_progress_course_tools_order'),
'help' => $this->settingArrayHelpValue('my_progress_course_tools_order'),
]
)
->add('lp_enable_flow', YesNoType::class)

@ -54,8 +54,7 @@ class MailSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Help desk emails that will recieve email notifications in import_csv.php').
$this->settingArrayHelpValue('cron_notification_help_desk'),
'help' => $this->settingArrayHelpValue('cron_notification_help_desk'),
]
)
->add(
@ -63,8 +62,7 @@ class MailSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Add a custom extra footer for notificacions emails for a specific language, for example for privacy policy notices. Multiple languages and paragraphs can be added').
$this->settingArrayHelpValue('notifications_extended_footer_message'),
'help' => $this->settingArrayHelpValue('notifications_extended_footer_message'),
]
)
;

@ -22,8 +22,6 @@ class MessageSettingsSchema extends AbstractSettingsSchema
'message_max_upload_filesize' => '20971520',
'private_messages_about_user' => 'false',
'private_messages_about_user_visible_to_user' => 'false',
'social_enable_messages_feedback' => 'false',
'disable_dislike_option' => 'false',
'allow_user_message_tracking' => 'false',
'filter_interactivity_messages' => 'false',
]
@ -44,8 +42,6 @@ class MessageSettingsSchema extends AbstractSettingsSchema
->add('message_max_upload_filesize')
->add('private_messages_about_user', YesNoType::class)
->add('private_messages_about_user_visible_to_user', YesNoType::class)
->add('social_enable_messages_feedback', YesNoType::class)
->add('disable_dislike_option', YesNoType::class)
->add('allow_user_message_tracking', YesNoType::class)
->add('filter_interactivity_messages', YesNoType::class)
;

@ -206,8 +206,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Proxy settings for access external services').
$this->settingArrayHelpValue('proxy_settings'),
'help' => $this->settingArrayHelpValue('proxy_settings'),
]
)
->add(
@ -215,8 +214,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Enable speed controller in video player').
$this->settingArrayHelpValue('video_features'),
'help' => $this->settingArrayHelpValue('video_features'),
]
)
->add(
@ -224,8 +222,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Changes the row list when using jqgrid/sortable tables').
$this->settingArrayHelpValue('table_row_list'),
'help' => $this->settingArrayHelpValue('table_row_list'),
]
)
->add('webservice_return_user_field', TextType::class)
@ -238,8 +235,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Overwrites the app/config/auth.conf.php settings').
$this->settingArrayHelpValue('extldap_config'),
'help' => $this->settingArrayHelpValue('extldap_config'),
]
)
->add(
@ -247,8 +243,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Update user expiration in x days or months when login the first time').
$this->settingArrayHelpValue('update_student_expiration_x_date'),
'help' => $this->settingArrayHelpValue('update_student_expiration_x_date'),
]
)
->add('user_status_show_options_enabled', YesNoType::class)
@ -257,8 +252,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('The user status is hidden when is false, it requires user_status_show_options_enabled = true').
$this->settingArrayHelpValue('user_status_show_option'),
'help' => $this->settingArrayHelpValue('user_status_show_option'),
]
)
->add(
@ -266,8 +260,7 @@ class PlatformSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Set the default expiration date when a user is created by role and days').
$this->settingArrayHelpValue('user_number_of_days_for_default_expiration_date_per_role'),
'help' => $this->settingArrayHelpValue('user_number_of_days_for_default_expiration_date_per_role'),
]
)
->add('user_edition_extra_field_to_check', TextType::class)

@ -141,8 +141,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Hide fields from this list array').
$this->settingArrayHelpValue('hide_user_field_from_list'),
'help' => $this->settingArrayHelpValue('hide_user_field_from_list'),
]
)
->add(
@ -150,8 +149,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Send email notification to admin when a user is created').
$this->settingArrayHelpValue('send_notification_when_user_added'),
'help' => $this->settingArrayHelpValue('send_notification_when_user_added'),
]
)
->add(
@ -159,8 +157,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Show multiple conditions to user during sign up process. Example with a GDPR condition').
$this->settingArrayHelpValue('show_conditions_to_user'),
'help' => $this->settingArrayHelpValue('show_conditions_to_user'),
]
)
->add('allow_teachers_to_classes', YesNoType::class)
@ -169,8 +166,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Validate user login via a webservice, Chamilo will send a "login" and "password" parameters to the "myWebServiceFunctionToLogin" function, the result should be "1" if the user have access').
$this->settingArrayHelpValue('profile_fields_visibility'),
'help' => $this->settingArrayHelpValue('profile_fields_visibility'),
]
)
->add(
@ -178,8 +174,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('This option sets default parameters in the main/admin/user_import.php').
$this->settingArrayHelpValue('user_import_settings'),
'help' => $this->settingArrayHelpValue('user_import_settings'),
]
)
->add(
@ -187,8 +182,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Search user by extra field in the user list').
$this->settingArrayHelpValue('user_search_on_extra_fields'),
'help' => $this->settingArrayHelpValue('user_search_on_extra_fields'),
]
)
->add('allow_career_users', YesNoType::class)
@ -197,8 +191,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Community manager users').
$this->settingArrayHelpValue('community_managers_user_list'),
'help' => $this->settingArrayHelpValue('community_managers_user_list'),
]
)
->add(
@ -206,8 +199,7 @@ class ProfileSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow to show users in a map, users need to have a coordinates extra field BT#15176').
$this->settingArrayHelpValue('allow_social_map_fields'),
'help' => $this->settingArrayHelpValue('allow_social_map_fields'),
]
)
->add('career_diagram_legend', YesNoType::class)

@ -149,8 +149,7 @@ class RegistrationSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Set extra fields as required in the inscription.php page').
$this->settingArrayHelpValue('required_extra_fields_in_inscription'),
'help' => $this->settingArrayHelpValue('required_extra_fields_in_inscription'),
]
)
->add(
@ -158,8 +157,7 @@ class RegistrationSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Only shows the fields in this list').
$this->settingArrayHelpValue('allow_fields_inscription'),
'help' => $this->settingArrayHelpValue('allow_fields_inscription'),
]
)
->add('send_inscription_msg_to_inbox', YesNoType::class)

@ -148,8 +148,7 @@ class SecuritySettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Customize password generation and verification').
$this->settingArrayHelpValue('password_requirements'),
'help' => $this->settingArrayHelpValue('password_requirements'),
]
)
->add(
@ -157,8 +156,7 @@ class SecuritySettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow online users by user profile 1 = COURSEMANAGER (teacher) 5 = STUDENT 11 = PLATFORM_ADMIN Example: The online users will be available only for teachers and students').
$this->settingArrayHelpValue('allow_online_users_by_status'),
'help' => $this->settingArrayHelpValue('allow_online_users_by_status'),
]
)
->add('security_session_cookie_samesite_none', YesNoType::class)

@ -163,8 +163,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('My courses session order. Possible field values: "start_date", "end_date", "name" Order values: "asc" or "desc"').
$this->settingArrayHelpValue('my_courses_session_order'),
'help' => $this->settingArrayHelpValue('my_courses_session_order'),
]
)
->add('session_courses_read_only_mode', YesNoType::class)
@ -173,8 +172,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('This option sets default parameters in the main/session/session_import.php').
$this->settingArrayHelpValue('session_import_settings'),
'help' => $this->settingArrayHelpValue('session_import_settings'),
]
)
->add(
@ -182,8 +180,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Catalog search settings visibility').
$this->settingArrayHelpValue('catalog_settings'),
'help' => $this->settingArrayHelpValue('catalog_settings'),
]
)
->add(
@ -191,8 +188,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Customize course session tracking columns').
$this->settingArrayHelpValue('tracking_columns'),
'help' => $this->settingArrayHelpValue('tracking_columns'),
]
)
->add('my_progress_session_show_all_courses', YesNoType::class)
@ -209,8 +205,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Relation to prefill session extra field with user extra field on session creation on main/session/session_add.php').
$this->settingArrayHelpValue('session_creation_user_course_extra_field_relation_to_prefill'),
'help' => $this->settingArrayHelpValue('session_creation_user_course_extra_field_relation_to_prefill'),
]
)
->add(
@ -218,8 +213,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Configuration setting to make some extra field required in session creation form on main/session/session_add.php').
$this->settingArrayHelpValue('session_creation_form_set_extra_fields_mandatory'),
'help' => $this->settingArrayHelpValue('session_creation_form_set_extra_fields_mandatory'),
]
)
->add('session_model_list_field_ordered_by_id', YesNoType::class)

@ -148,73 +148,77 @@ class SettingsManager implements SettingsManagerInterface
if ($loadFromDb) {
$settings = $this->load($category, $name);
return $settings->get($name);
if ($settings->has($name)) {
return $settings->get($name);
} else {
return null;
}
}
$this->loadAll();
if (!empty($this->schemaList)) {
if (!empty($this->schemaList) && isset($this->schemaList[$category])) {
$settings = $this->schemaList[$category];
return $settings->get($name);
if ($settings->has($name)) {
return $settings->get($name);
} else {
error_log("Attempted to access undefined setting '$name' in category '$category'.");
return null;
}
}
throw new InvalidArgumentException(sprintf('Category %s not found', $category));
/*exit;
$settings = $this->load($category, $name);
if (!$settings) {
throw new \InvalidArgumentException(sprintf("Parameter '$name' not found in category '$category'"));
}
$this->settings = $settings;
return $settings->get($name);*/
}
public function loadAll(): void
{
$session = null;
if ($this->request->getCurrentRequest()) {
$session = $this->request->getCurrentRequest()->getSession();
$schemaList = $session->get('schemas');
$this->schemaList = $schemaList;
if (!empty($schemaList)) {
$this->schemaList = $schemaList;
return;
}
}
if (empty($this->schemaList)) {
$schemas = array_keys($this->getSchemas());
$schemaList = [];
$settingsBuilder = new SettingsBuilder();
$all = $this->getAllParametersByCategory();
foreach ($schemas as $schema) {
$schemaRegister = $this->schemaRegistry->get($schema);
$schemaRegister->buildSettings($settingsBuilder);
$name = $this->convertServiceToNameSpace($schema);
$settings = new Settings();
$parameters = $all[$name] ?? [];
$transformers = $settingsBuilder->getTransformers();
foreach ($transformers as $parameter => $transformer) {
if (\array_key_exists($parameter, $parameters)) {
if ('course_creation_use_template' === $parameter) {
if (empty($parameters[$parameter])) {
$parameters[$parameter] = null;
}
} else {
$parameters[$parameter] = $transformer->reverseTransform($parameters[$parameter]);
$schemas = array_keys($this->getSchemas());
$schemaList = [];
$settingsBuilder = new SettingsBuilder();
$all = $this->getAllParametersByCategory();
foreach ($schemas as $schema) {
$schemaRegister = $this->schemaRegistry->get($schema);
$schemaRegister->buildSettings($settingsBuilder);
$name = $this->convertServiceToNameSpace($schema);
$settings = new Settings();
$parameters = $all[$name] ?? [];
$knownParameters = array_filter($parameters, function ($key) use ($settingsBuilder) {
return $settingsBuilder->isDefined($key);
}, ARRAY_FILTER_USE_KEY);
$transformers = $settingsBuilder->getTransformers();
foreach ($transformers as $parameter => $transformer) {
if (\array_key_exists($parameter, $knownParameters)) {
if ('course_creation_use_template' === $parameter) {
if (empty($knownParameters[$parameter])) {
$knownParameters[$parameter] = null;
}
} else {
$knownParameters[$parameter] = $transformer->reverseTransform($knownParameters[$parameter]);
}
}
$parameters = $settingsBuilder->resolve($parameters);
$settings->setParameters($parameters);
$schemaList[$name] = $settings;
}
$this->schemaList = $schemaList;
if ($session && $this->request->getCurrentRequest()) {
$session->set('schemas', $schemaList);
}
$parameters = $settingsBuilder->resolve($knownParameters);
$settings->setParameters($parameters);
$schemaList[$name] = $settings;
}
$this->schemaList = $schemaList;
if ($session && $this->request->getCurrentRequest()) {
$session->set('schemas', $schemaList);
}
}

@ -55,8 +55,7 @@ class SkillSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Set skill levels name, then later it will be parsed using get_lang BT#13586').
$this->settingArrayHelpValue('skill_levels_names'),
'help' => $this->settingArrayHelpValue('skill_levels_names'),
]
)
->add('allow_skill_rel_items', YesNoType::class)

@ -65,8 +65,7 @@ class SurveySettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Hide survey edition tools for all or some surveys. Set an asterisk to hide for all, otherwise set an array with the survey codes in which the options will be blocked').
$this->settingArrayHelpValue('hide_survey_edition'),
'help' => $this->settingArrayHelpValue('hide_survey_edition'),
]
)
->add(
@ -74,8 +73,7 @@ class SurveySettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Allow add additional actions (as links) in survey list for teachers').
$this->settingArrayHelpValue('survey_additional_teacher_modify_actions'),
'help' => $this->settingArrayHelpValue('survey_additional_teacher_modify_actions'),
]
)
->add('show_surveys_base_in_sessions', YesNoType::class)

@ -47,8 +47,7 @@ class TicketSettingsSchema extends AbstractSettingsSchema
TextareaType::class,
[
'help_html' => true,
'help' => get_lang('Ticket project user roles').
$this->settingArrayHelpValue('ticket_project_user_roles'),
'help' => $this->settingArrayHelpValue('ticket_project_user_roles'),
]
)
;

@ -27,14 +27,14 @@ class ColorThemeProcessor implements ProcessorInterface
{
\assert($data instanceof ColorTheme);
$this->colorThemeRepository->deactivateAll();
$data->setActive(true);
/** @var ColorTheme $colorTheme */
$colorTheme = $this->persistProcessor->process($data, $operation, $uriVariables, $context);
if ($colorTheme) {
$this->colorThemeRepository->deactivateAllExcept($colorTheme);
$projectDir = $this->parameterBag->get('kernel.project_dir');
$contentParts = [];

@ -32,7 +32,7 @@ class SettingsControllerTest extends WebTestCase
$client->request('GET', '/admin/settings/admin');
$this->assertResponseIsSuccessful();
$this->assertSelectorTextContains('#sectionMainContent', 'administrator_email');
$this->assertSelectorTextContains('#sectionMainContent', 'Portal Administrator: e-mail');
}
public function testSearchSettingAction(): void

@ -12,7 +12,6 @@ use Chamilo\CoreBundle\Repository\ExtraFieldOptionsRepository;
use Chamilo\CoreBundle\Repository\ExtraFieldRepository;
use Chamilo\Tests\AbstractApiTest;
use Chamilo\Tests\ChamiloTestTrait;
use Gedmo\Translatable\Entity\Translation;
class ExtraFieldOptionsRepositoryTest extends AbstractApiTest
{
@ -58,56 +57,4 @@ class ExtraFieldOptionsRepositoryTest extends AbstractApiTest
$this->assertSame($defaultCount + 1, $extraFieldRepo->count([]));
$this->assertSame($defaultCountOptions + 1, $extraFieldOptionsRepo->count([]));
}
public function testCreateWithTranslation(): void
{
$this->testCreate();
$em = $this->getEntityManager();
$extraFieldOptionsRepo = static::getContainer()->get(ExtraFieldOptionsRepository::class);
/** @var ExtraFieldOptions $extraFieldOption */
$extraFieldOption = $extraFieldOptionsRepo->findOneBy(['value' => 'value']);
$this->assertNotNull($extraFieldOption);
$this->assertInstanceOf(ExtraFieldOptions::class, $extraFieldOption);
$extraFieldOption
->setTranslatableLocale('fr_FR')
->setDisplayText('test in FRENCH')
;
$em->persist($extraFieldOption);
$em->flush();
/** @var ExtraFieldOptions $extraFieldOption */
$extraFieldOption = $extraFieldOptionsRepo->find($extraFieldOption->getId());
$extraFieldOption
->setTranslatableLocale('pl')
->setDisplayText('test in POLISH')
;
$em->persist($extraFieldOption);
$em->flush();
$em->clear();
/** @var ExtraFieldOptions $extraFieldOption */
$extraFieldOption = $extraFieldOptionsRepo->find($extraFieldOption->getId());
$repository = $em->getRepository(Translation::class);
$translations = $repository->findTranslations($extraFieldOption);
$this->assertCount(2, $translations);
$expected = [
'fr_FR' => [
'displayText' => 'test in FRENCH',
],
'pl' => [
'displayText' => 'test in POLISH',
],
];
$this->assertSame($expected, $translations);
/** @var ExtraFieldOptions $extraFieldOption */
$extraFieldOption = $extraFieldOptionsRepo->find($extraFieldOption->getId());
$this->assertSame('test in ENGLISH', $extraFieldOption->getDisplayText());
}
}

@ -11,7 +11,6 @@ use Chamilo\CoreBundle\Entity\ExtraFieldSavedSearch;
use Chamilo\CoreBundle\Repository\ExtraFieldRepository;
use Chamilo\Tests\AbstractApiTest;
use Chamilo\Tests\ChamiloTestTrait;
use Gedmo\Translatable\Entity\Translation;
class ExtraFieldRepositoryTest extends AbstractApiTest
{
@ -57,75 +56,6 @@ class ExtraFieldRepositoryTest extends AbstractApiTest
$this->assertSame($defaultCount + 1, $repo->count([]));
}
public function testCreateWithTranslation(): void
{
$em = $this->getEntityManager();
// $extraFieldRepo = static::getContainer()->get(ExtraFieldRepository::class);
$extraFieldRepo = $em->getRepository(ExtraField::class);
$translator = static::getContainer()->get('translator');
$defaultLocale = $translator->getLocale();
$this->assertSame('en_US', $defaultLocale);
$defaultCount = $extraFieldRepo->count([]);
$extraField = (new ExtraField())
->setDisplayText('test in ENGLISH')
->setVariable('test in en')
->setItemType(ExtraField::USER_FIELD_TYPE)
->setValueType(\ExtraField::FIELD_TYPE_TEXT)
;
$this->assertHasNoEntityViolations($extraField);
$em->persist($extraField);
$em->flush();
$this->assertSame($defaultCount + 1, $extraFieldRepo->count([]));
/** @var ExtraField $extraField */
$extraField = $extraFieldRepo->find($extraField->getId());
$extraField
->setTranslatableLocale('fr_FR')
->setDisplayText('test in FRENCH')
;
$em->persist($extraField);
$em->flush();
/** @var ExtraField $extraField */
$extraField = $extraFieldRepo->find($extraField->getId());
$extraField
->setTranslatableLocale('it')
->setDisplayText('test in ITALIAN')
;
$em->persist($extraField);
$em->flush();
$em->clear();
$this->assertSame($defaultCount + 1, $extraFieldRepo->count([]));
/** @var ExtraField $extraField */
$extraField = $extraFieldRepo->find($extraField->getId());
$repository = $em->getRepository(Translation::class);
$translations = $repository->findTranslations($extraField);
$this->assertCount(2, $translations);
$expected = [
'fr_FR' => [
'displayText' => 'test in FRENCH',
],
'it' => [
'displayText' => 'test in ITALIAN',
],
];
$this->assertSame($expected, $translations);
/** @var ExtraField $extraField */
$extraField = $extraFieldRepo->find($extraField->getId());
$this->assertSame('test in ENGLISH', $extraField->getDisplayText());
}
public function testGetExtraFields(): void
{
$repo = static::getContainer()->get(ExtraFieldRepository::class);

@ -73,7 +73,7 @@ class SettingsManagerTest extends AbstractApiTest
$settingsManager->updateSetting('skill.badge_assignation_notification', 'true');
$badgeSetting = $settingsManager->getSetting('skill.badge_assignation_notification');
$this->assertSame('false', $badgeSetting);
$this->assertSame('true', $badgeSetting);
$settingEntity = $repo->findOneBy(['variable' => 'badge_assignation_notification']);
$this->assertSame('true', $settingEntity->getSelectedValue());

Loading…
Cancel
Save