From c960b4832d110794842de25d9c8caa5274dfff0a Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 17 Feb 2025 14:40:24 +0100 Subject: [PATCH 001/260] test --- public/js/api/stundenplan.js | 11 +++++++++++ public/js/apps/Dashboard/Fhc.js | 16 ++++++++-------- public/js/components/Calendar/Week/Page.js | 4 +++- public/js/components/Cis/Cms/Content.js | 2 +- public/js/components/Cis/Cms/News.js | 2 +- .../StudiengangInformation.js | 4 ++-- public/js/components/Cis/Mylv/LvUebersicht.js | 4 ++-- .../js/components/Cis/Stundenplan/Stundenplan.js | 5 +++++ 8 files changed, 33 insertions(+), 15 deletions(-) diff --git a/public/js/api/stundenplan.js b/public/js/api/stundenplan.js index 9ddbeff54..0f5de934e 100644 --- a/public/js/api/stundenplan.js +++ b/public/js/api/stundenplan.js @@ -42,4 +42,15 @@ export default { {} ); }, + getMoodleEventsByUserid(username, timestart, timeend) { + return this.$fhcApi.get( + FHC_JS_DATA_STORAGE_OBJECT.app_root + + `addons/moodle/cis/get_events_by_userid.php`, + { + username: username, + timestart: timestart, + timeend: timeend, + } + ); + }, }; \ No newline at end of file diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 9f77d4b9b..19f6b3a2b 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -2,14 +2,14 @@ import FhcDashboard from '../../components/Dashboard/Dashboard.js'; import FhcApi from '../../plugin/FhcApi.js'; import Phrasen from '../../plugin/Phrasen.js'; import contrast from '../../directives/contrast.js'; -import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers"; -import Stundenplan from "../../components/Cis/Stundenplan/Stundenplan"; -import MylvStudent from "../../components/Cis/Mylv/Student"; -import Profil from "../../components/Cis/Profil/Profil"; -import CmsNews from "../../components/Cis/Cms/News"; -import CmsContent from "../../components/Cis/Cms/Content"; -import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info"; -import RoomInformation from "../../components/Cis/Mylv/RoomInformation"; +import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers.js"; +import Stundenplan from "../../components/Cis/Stundenplan/Stundenplan.js"; +import MylvStudent from "../../components/Cis/Mylv/Student.js"; +import Profil from "../../components/Cis/Profil/Profil.js"; +import CmsNews from "../../components/Cis/Cms/News.js"; +import CmsContent from "../../components/Cis/Cms/Content.js"; +import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info.js"; +import RoomInformation from "../../components/Cis/Mylv/RoomInformation.js"; const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; diff --git a/public/js/components/Calendar/Week/Page.js b/public/js/components/Calendar/Week/Page.js index 10ff6c495..b029b854a 100644 --- a/public/js/components/Calendar/Week/Page.js +++ b/public/js/components/Calendar/Week/Page.js @@ -197,7 +197,9 @@ export default { 'grid-template-columns': 'repeat(' + day.lanes + ', 1fr)', 'grid-template-rows': 'repeat(' + (this.hours.length * 60 / this.smallestTimeFrame) + ', 1fr)', } - + console.log(this.smallestTimeFrame,"this is the smallest timeframe") + console.log(this.hours.length,"this is the length of the hours") + console.log(this.hours.length/60, "this is the length of the hours multiplied by 60 resulting in minutes") if(day.isPast) { styleObj['background-color'] = '#F5E9D7' styleObj['border-color'] = '#E8E8E8'; diff --git a/public/js/components/Cis/Cms/Content.js b/public/js/components/Cis/Cms/Content.js index ed87e1aae..d657322ba 100644 --- a/public/js/components/Cis/Cms/Content.js +++ b/public/js/components/Cis/Cms/Content.js @@ -1,6 +1,6 @@ import raum_contentmittitel from './Content_types/Raum_contentmittitel.js' import general from './Content_types/General.js' -import BsConfirm from "../../Bootstrap/Confirm"; +import BsConfirm from "../../Bootstrap/Confirm.js"; export default { name: "ContentComponent", diff --git a/public/js/components/Cis/Cms/News.js b/public/js/components/Cis/Cms/News.js index 89bed18d7..1567cbef4 100644 --- a/public/js/components/Cis/Cms/News.js +++ b/public/js/components/Cis/Cms/News.js @@ -1,6 +1,6 @@ import Pagination from "../../Pagination/Pagination.js"; import StudiengangInformation from "./StudiengangInformation/StudiengangInformation.js"; -import BsConfirm from "../../Bootstrap/Confirm"; +import BsConfirm from "../../Bootstrap/Confirm.js"; export default { name: "NewsComponent", diff --git a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js index 06743ae5d..92e303801 100644 --- a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js +++ b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js @@ -1,5 +1,5 @@ -import StudiengangPerson from "./StudiengangPerson"; -import StudiengangVertretung from "./StudiengangVertretung"; +import StudiengangPerson from "./StudiengangPerson.js"; +import StudiengangVertretung from "./StudiengangVertretung.js"; export default { data(){ diff --git a/public/js/components/Cis/Mylv/LvUebersicht.js b/public/js/components/Cis/Mylv/LvUebersicht.js index 6670a0c76..13972af5e 100644 --- a/public/js/components/Cis/Mylv/LvUebersicht.js +++ b/public/js/components/Cis/Mylv/LvUebersicht.js @@ -1,5 +1,5 @@ -import BsModal from "../../Bootstrap/Modal"; -import LvMenu from "./LvMenu"; +import BsModal from "../../Bootstrap/Modal.js"; +import LvMenu from "./LvMenu.js"; export default { props:{ diff --git a/public/js/components/Cis/Stundenplan/Stundenplan.js b/public/js/components/Cis/Stundenplan/Stundenplan.js index d35c9c536..ba3a3c649 100644 --- a/public/js/components/Cis/Stundenplan/Stundenplan.js +++ b/public/js/components/Cis/Stundenplan/Stundenplan.js @@ -150,6 +150,11 @@ export const Stundenplan = { }, created() { + let time_start = Math.floor(this.eventCalendarDate.firstDayOfCalendarMonth.getTime() / 1000); + let time_end = Math.floor(this.eventCalendarDate.lastDayOfCalendarMonth.getTime() / 1000); + this.$fhcApi.factory.stundenplan.getMoodleEventsByUserid('io23m005', time_start, time_end).then((response) => { + console.log(response); + }) this.$fhcApi.factory.authinfo.getAuthUID().then((res) => res.data) .then(data=>{ this.uid = data.uid; From e086da2274ce66bc477d8ba5b6c8308b38eba720 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 18 Feb 2025 14:23:56 +0100 Subject: [PATCH 002/260] feature(Calendar Moodle Events): displays moodle events as allDayEvents in the Calendar --- public/js/components/Calendar/Week/Page.js | 75 ++++++++++++++----- public/js/components/Cis/Mylv/LvModal.js | 4 +- .../components/Cis/Stundenplan/Stundenplan.js | 74 +++++++++++++----- 3 files changed, 116 insertions(+), 37 deletions(-) diff --git a/public/js/components/Calendar/Week/Page.js b/public/js/components/Calendar/Week/Page.js index b029b854a..504293d07 100644 --- a/public/js/components/Calendar/Week/Page.js +++ b/public/js/components/Calendar/Week/Page.js @@ -10,7 +10,7 @@ export default { hourPosition:null, hourPositionTime:null, resizeObserver: null, - width: 0 + width: 0, } }, inject: [ @@ -36,6 +36,16 @@ export default { 'input', ], computed: { + allDayEvents(){ + let allDayEvents = {}; + for(let day in this.events){ + const filteredAllDayEvents = this.events[day].filter(event=>event.allDayEvent); + if (filteredAllDayEvents.length > 0){ + allDayEvents[day]=filteredAllDayEvents; + } + }; + return allDayEvents; + }, getGridStyle() { return { 'min-height': '100px', @@ -126,6 +136,7 @@ export default { d.isToday = nextDay.getFullYear() === this.todayDate.getFullYear() && nextDay.getMonth() === this.todayDate.getMonth() && nextDay.getDate() === this.todayDate.getDate() if (this.events[key]) { this.events[key].forEach(evt => { + if (evt.allDayEvent) return; let event = {orig:evt,lane:1,maxLane:1,start: evt.start < day ? day : evt.start, end: evt.end > nextDay ? nextDay : evt.end,shared:[],setSharedMaxRecursive(doneItems) { this.maxLane = Math.max(doneItems[0].maxLane, this.maxLane); doneItems.push(this); @@ -197,31 +208,44 @@ export default { 'grid-template-columns': 'repeat(' + day.lanes + ', 1fr)', 'grid-template-rows': 'repeat(' + (this.hours.length * 60 / this.smallestTimeFrame) + ', 1fr)', } - console.log(this.smallestTimeFrame,"this is the smallest timeframe") - console.log(this.hours.length,"this is the length of the hours") - console.log(this.hours.length/60, "this is the length of the hours multiplied by 60 resulting in minutes") if(day.isPast) { styleObj['background-color'] = '#F5E9D7' styleObj['border-color'] = '#E8E8E8'; styleObj.opacity = 0.5; } else if (day.isToday) { - // styleObj['backgroundImage'] = 'linear-gradient(to bottom, #F5E9D7 '+this.getDayTimePercent+'%, #FFFFFF '+this.getDayTimePercent+'%)' - // styleObj['border-color'] = '#E8E8E8'; - // styleObj.opacity = 0.5; + styleObj['backgroundImage'] = 'linear-gradient(to bottom, #F5E9D7 '+this.getDayTimePercent+'%, #FFFFFF '+this.getDayTimePercent+'%)' + styleObj['border-color'] = '#E8E8E8'; + styleObj.opacity = 0.5; } return styleObj }, eventGridStyle(day, event) { - return { - 'z-index': 1, - 'grid-column-start': 1 + (event.lane - 1) * day.lanes / event.maxLane, - 'grid-column-end': 1 + event.lane * day.lanes / event.maxLane, - 'grid-row-start': this.dateToMinutesOfDay(event.start), - 'grid-row-end': this.dateToMinutesOfDay(event.end), - 'background-color': event.orig.color, - 'max-height': '75px' + if (event.orig.allDayEvent) + { + return; + return { + 'z-index': '2', + 'grid-column': '1 / -1', + 'background-color': 'rgb(204, 204, 204)', + 'max-height': '75px', + color: 'black', + position: 'sticky', + top: '44px', + }; + } + else + { + return { + 'z-index': 1, + 'grid-column-start': 1 + (event.lane - 1) * day.lanes / event.maxLane, + 'grid-column-end': 1 + event.lane * day.lanes / event.maxLane, + 'grid-row-start': this.dateToMinutesOfDay(event.start), + 'grid-row-end': this.dateToMinutesOfDay(event.end), + 'background-color': event.orig.color, + 'max-height': '75px' + }; } }, calcHourPosition(event) { @@ -333,12 +357,27 @@ export default { {{hourPositionTime}} - +
+
{{hour}}:00
-
+
+
+
+
+ +

this is a placeholder which means that no template was passed to the Calendar Page slot

+
+
+
+
{{curTime}} @@ -350,7 +389,7 @@ export default { :style="eventGridStyle(day,event)" class="mx-2 small rounded overflow-hidden fhc-entry " v-contrast > - +

this is a placeholder which means that no template was passed to the Calendar Page slot

diff --git a/public/js/components/Cis/Mylv/LvModal.js b/public/js/components/Cis/Mylv/LvModal.js index e873dd5f8..acb2a7693 100644 --- a/public/js/components/Cis/Mylv/LvModal.js +++ b/public/js/components/Cis/Mylv/LvModal.js @@ -35,7 +35,7 @@ export default { }, data() { return { - menu: [], + menu: null, result: false, info: null, }; @@ -76,7 +76,7 @@ export default {