Pausenvalidierung
Alle 4h muss ein Dozent eine Pause von 15 min einlegen // alle 8h eine von 30 min
This commit is contained in:
1 parent
c979c3a801
commit
d81922d188
3 files changed
+9148
No files matched your search
Generated
+1
@@ -6,6 +6,7 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="744e9299-0ce3-415c-8733-c935bf920887" name="Changes" comment="">
|
<list default="true" id="744e9299-0ce3-415c-8733-c935bf920887" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/anwendung/src/components/CalenderView.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/anwendung/src/components/CalenderView.jsx" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import BasicDateCalendar from "@/components/CalendarSideBar";
|
|||||||
import feiertagejs from "feiertagejs";
|
import feiertagejs from "feiertagejs";
|
||||||
import PopUp from "@/components/PopUp";
|
import PopUp from "@/components/PopUp";
|
||||||
import {useRouter} from "next/router";
|
import {useRouter} from "next/router";
|
||||||
|
import {info} from "autoprefixer";
|
||||||
|
|
||||||
let cellHeight = 20;
|
let cellHeight = 20;
|
||||||
|
|
||||||
@@ -167,15 +168,32 @@ export default function CalenderView(p) {
|
|||||||
|
|
||||||
if(localStorage.getItem("admin") == 0)
|
if(localStorage.getItem("admin") == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
let entriesURL = baseURL + "/entries/all/module?sessionid=" + localStorage.getItem("sessionid") + "&moduleid=" + localStorage.getItem("moduleid")
|
let entriesURL = baseURL + "/entries/all/module?sessionid=" + localStorage.getItem("sessionid") + "&moduleid=" + localStorage.getItem("moduleid")
|
||||||
fetch(entriesURL).then(r => r.json()).then(allEn => {
|
fetch(entriesURL).then(r => r.json()).then(allEn => {
|
||||||
|
//console.log(allEn)
|
||||||
|
|
||||||
let moduleid = localStorage.getItem("moduleid")
|
let moduleid = localStorage.getItem("moduleid")
|
||||||
let sum = 0
|
let sum = 0
|
||||||
|
|
||||||
|
let checkTime = 0
|
||||||
for (let j = 0; j < allEn.length; j++) {
|
for (let j = 0; j < allEn.length; j++) {
|
||||||
if (allEn[j] != null && allEn[j].moduleid == moduleid) {
|
if (allEn[j] != null && allEn[j].moduleid == moduleid) {
|
||||||
sum += allEn[j].timeend - allEn[j].timestart
|
sum += allEn[j].timeend - allEn[j].timestart
|
||||||
|
checkTime = (allEn[j].timeend - allEn[j].timestart)/3
|
||||||
|
if (checkTime >= 4){
|
||||||
|
sum -= 1
|
||||||
|
/* Pause Info geben?
|
||||||
|
console.log(allEn[j].info + " 15 Minuten Pause")
|
||||||
|
allEn[j].info = allEn[j].info + "15 Minuten Pause"
|
||||||
|
|
||||||
|
*/
|
||||||
|
}else if (checkTime >= 8){
|
||||||
|
sum -= 2
|
||||||
|
}else if (checkTime >= 12){
|
||||||
|
sum -= 3
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user