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 showMyStudentsScheduleButton = ref(false)
const isPersonal = !course.value
watchEffect(() => {
if (
isAllowedToEdit.value ||
(!course.value &&
!securityStore.isAuthenticated &&
platformConfigStore.getSetting("agenda.allow_personal_agenda")) ||
("1" === courseAllowUserEditAgenda && !securityStore.isAuthenticated && isAllowedToSessionEdit)
(isPersonal &&
securityStore.isAuthenticated &&
"true" === platformConfigStore.getSetting("agenda.allow_personal_agenda")) ||
("1" === courseAllowUserEditAgenda && securityStore.isAuthenticated && isAllowedToSessionEdit)
) {
showAddButton.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 { storeToRefs } from "pinia"
import CalendarSectionHeader from "../../components/ccalendarevent/CalendarSectionHeader.vue"
import { useCalendarActionButtons } from "../../composables/calendar/calendarActionButtons"
const store = useStore()
const confirm = useConfirm()
@ -137,6 +138,8 @@ const { course, session, group } = storeToRefs(cidReqStore)
const { abbreviatedDatetime } = useFormatDate()
const { showAddButton } = useCalendarActionButtons()
const item = ref({})
const dialog = ref(false)
const dialogShow = ref(false)
@ -256,6 +259,10 @@ const calendarOptions = ref({
dialogShow.value = true
},
select(info) {
if (!showAddButton.value) {
return
}
item.value = {}
item.value["parentResourceNode"] = currentUser.value.resourceNode["id"]
item.value["allDay"] = info.allDay

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

Loading…
Cancel
Save