Pausenvalidierung
Alle 4h muss ein Dozent eine Pause von 15 min einlegen // alle 8h eine von 30 min
This commit is contained in:
Generated
+1
@@ -6,6 +6,7 @@
|
||||
<component name="ChangeListManager">
|
||||
<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$/anwendung/src/components/CalenderView.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/anwendung/src/components/CalenderView.jsx" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -9,6 +9,7 @@ import BasicDateCalendar from "@/components/CalendarSideBar";
|
||||
import feiertagejs from "feiertagejs";
|
||||
import PopUp from "@/components/PopUp";
|
||||
import {useRouter} from "next/router";
|
||||
import {info} from "autoprefixer";
|
||||
|
||||
let cellHeight = 20;
|
||||
|
||||
@@ -167,15 +168,32 @@ export default function CalenderView(p) {
|
||||
|
||||
if(localStorage.getItem("admin") == 0)
|
||||
{
|
||||
|
||||
let entriesURL = baseURL + "/entries/all/module?sessionid=" + localStorage.getItem("sessionid") + "&moduleid=" + localStorage.getItem("moduleid")
|
||||
fetch(entriesURL).then(r => r.json()).then(allEn => {
|
||||
//console.log(allEn)
|
||||
|
||||
let moduleid = localStorage.getItem("moduleid")
|
||||
let sum = 0
|
||||
|
||||
let checkTime = 0
|
||||
for (let j = 0; j < allEn.length; j++) {
|
||||
if (allEn[j] != null && allEn[j].moduleid == moduleid) {
|
||||
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