Calendar: Fix conditions to show the add button

pull/5215/head
Angel Fernando Quiroz Campos 2 years ago
parent c00729368d
commit 6dbbaa1a45
  1. 10
      assets/vue/composables/calendar/calendarActionButtons.js
  2. 7
      assets/vue/views/ccalendarevent/CCalendarEventList.vue
  3. 1
      src/CoreBundle/Controller/PlatformConfigurationController.php

@ -29,13 +29,15 @@ export function useCalendarActionButtons() {
const showSessionPlanningButton = ref(false) const showSessionPlanningButton = ref(false)
const showMyStudentsScheduleButton = ref(false) const showMyStudentsScheduleButton = ref(false)
const isPersonal = !course.value
watchEffect(() => { watchEffect(() => {
if ( if (
isAllowedToEdit.value || isAllowedToEdit.value ||
(!course.value && (isPersonal &&
!securityStore.isAuthenticated && securityStore.isAuthenticated &&
platformConfigStore.getSetting("agenda.allow_personal_agenda")) || "true" === platformConfigStore.getSetting("agenda.allow_personal_agenda")) ||
("1" === courseAllowUserEditAgenda && !securityStore.isAuthenticated && isAllowedToSessionEdit) ("1" === courseAllowUserEditAgenda && securityStore.isAuthenticated && isAllowedToSessionEdit)
) { ) {
showAddButton.value = true showAddButton.value = true
showImportICalButton.value = true showImportICalButton.value = true

@ -128,6 +128,7 @@ import { RESOURCE_LINK_PUBLISHED } from "../../components/resource_links/visibil
import { useLocale, useParentLocale } from "../../composables/locale" import { useLocale, useParentLocale } from "../../composables/locale"
import { storeToRefs } from "pinia" import { storeToRefs } from "pinia"
import CalendarSectionHeader from "../../components/ccalendarevent/CalendarSectionHeader.vue" import CalendarSectionHeader from "../../components/ccalendarevent/CalendarSectionHeader.vue"
import { useCalendarActionButtons } from "../../composables/calendar/calendarActionButtons"
const store = useStore() const store = useStore()
const confirm = useConfirm() const confirm = useConfirm()
@ -137,6 +138,8 @@ const { course, session, group } = storeToRefs(cidReqStore)
const { abbreviatedDatetime } = useFormatDate() const { abbreviatedDatetime } = useFormatDate()
const { showAddButton } = useCalendarActionButtons()
const item = ref({}) const item = ref({})
const dialog = ref(false) const dialog = ref(false)
const dialogShow = ref(false) const dialogShow = ref(false)
@ -256,6 +259,10 @@ const calendarOptions = ref({
dialogShow.value = true dialogShow.value = true
}, },
select(info) { select(info) {
if (!showAddButton.value) {
return
}
item.value = {} item.value = {}
item.value["parentResourceNode"] = currentUser.value.resourceNode["id"] item.value["parentResourceNode"] = currentUser.value.resourceNode["id"]
item.value["allDay"] = info.allDay item.value["allDay"] = info.allDay

@ -56,6 +56,7 @@ class PlatformConfigurationController extends AbstractController
'registration.allow_terms_conditions', 'registration.allow_terms_conditions',
'agenda.allow_personal_agenda',
'agenda.personal_calendar_show_sessions_occupation', 'agenda.personal_calendar_show_sessions_occupation',
// 'agenda.agenda_reminders', // 'agenda.agenda_reminders',
'agenda.agenda_collective_invitations', 'agenda.agenda_collective_invitations',

Loading…
Cancel
Save