Kleinere Bugfixes (Datepicker, Darstellung SE-Klassen) und Anzeige des Orts für Pausenvertretungen
This commit is contained in:
parent
606301587f
commit
4da52fa7d9
6 changed files with 121 additions and 7 deletions
68
proxy.php
Normal file
68
proxy.php
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
<?php
|
||||||
|
// Konfiguration
|
||||||
|
$iserv_gpu001_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU001.TXT';
|
||||||
|
$iserv_gpu002_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU002.TXT';
|
||||||
|
$iserv_gpu005_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU005.TXT';
|
||||||
|
$iserv_gpu009_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU009.TXT';
|
||||||
|
$iserv_gpu014_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU014.TXT';
|
||||||
|
$iserv_gpu017_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU017.TXT';
|
||||||
|
|
||||||
|
$iserv_rsslul_url = 'https://iserv.de/iserv/public/news/rss/Lehrer?pwd=<PASSWORT>';
|
||||||
|
$iserv_rsssul_url = 'https://iserv.de/iserv/public/news/rss/Lehrer%20und%20Sch%C3%BCler?pwd=<PASSWORT>';
|
||||||
|
$iserv_rsssus_url = 'https://iserv.de/iserv/public/news/rss/Sch%C3%BCler?pwd=<PASSWORT>';
|
||||||
|
|
||||||
|
|
||||||
|
$iserv_username = 'webexport.system';
|
||||||
|
$iserv_password = '<PASSWORT>';
|
||||||
|
|
||||||
|
// Angefragte Datei auswerten
|
||||||
|
switch ($_GET["file"]) {
|
||||||
|
case "G001":
|
||||||
|
$iserv_url = $iserv_gpu001_url;
|
||||||
|
break;
|
||||||
|
case "G002":
|
||||||
|
$iserv_url = $iserv_gpu002_url;
|
||||||
|
break;
|
||||||
|
case "G005":
|
||||||
|
$iserv_url = $iserv_gpu005_url;
|
||||||
|
break;
|
||||||
|
case "G009":
|
||||||
|
$iserv_url = $iserv_gpu009_url;
|
||||||
|
break;
|
||||||
|
case "G014":
|
||||||
|
$iserv_url = $iserv_gpu014_url;
|
||||||
|
break;
|
||||||
|
case "G017":
|
||||||
|
$iserv_url = $iserv_gpu017_url;
|
||||||
|
break;
|
||||||
|
case "rsslul":
|
||||||
|
$iserv_url = $iserv_rsslul_url;
|
||||||
|
break;
|
||||||
|
case "rsssul":
|
||||||
|
$iserv_url = $iserv_rsssul_url;
|
||||||
|
break;
|
||||||
|
case "rsssus":
|
||||||
|
default:
|
||||||
|
$iserv_url = $iserv_rsssus_url;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Daten via Curl aus IServ laden
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $iserv_url);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
curl_setopt($ch, CURLOPT_USERPWD, "$iserv_username:$iserv_password");
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||||
|
|
||||||
|
$output = curl_exec($ch);
|
||||||
|
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Datei ausgeben
|
||||||
|
echo $output;
|
||||||
|
|
||||||
|
exit();
|
||||||
|
?>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<h1>SISSy v0.5.1</h1>
|
<h1>SISSy v0.5.1</h1>
|
||||||
<h2>Sedan Informations- und Stundenplansystem</h2>
|
<h2>Sedan Informations- und Stundenplansystem</h2>
|
||||||
<img src="@/assets/sissy.png" width="350" />
|
<img src="@/assets/sissy.png" width="350" />
|
||||||
|
<br/>
|
||||||
<span>2021 by Daniel Spittank</span><br/>
|
<span>2021 by Daniel Spittank</span><br/>
|
||||||
<span>Lizensiert unter der AGPL 3.0 oder später</span>
|
<span>Lizensiert unter der AGPL 3.0 oder später</span>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
:class="cssClass"
|
:class="cssClass"
|
||||||
v-if="id !== '' && typ === 'block'"
|
v-if="id !== '' && typ === 'block'"
|
||||||
>
|
>
|
||||||
{{ (oberstufe) ? '' : stufe }}{{ zug }}
|
{{ (oberstufe || zug === 'SE') ? '' : stufe }}{{ zug }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
<v-chip
|
<v-chip
|
||||||
:class="cssClass"
|
:class="cssClass"
|
||||||
v-if="id !== '' && typ !== 'block'"
|
v-if="id !== '' && typ !== 'block'"
|
||||||
>
|
>
|
||||||
{{ (oberstufe) ? '' : stufe }}{{ zug }}
|
{{ (oberstufe || zug === 'SE') ? '' : stufe }}{{ zug }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -41,6 +41,10 @@
|
||||||
<v-date-picker
|
<v-date-picker
|
||||||
v-model="neuesDatum"
|
v-model="neuesDatum"
|
||||||
@input="datepicker = false"
|
@input="datepicker = false"
|
||||||
|
first-day-of-week="1"
|
||||||
|
:allowedDates= "allowedDates"
|
||||||
|
:show-week="true"
|
||||||
|
locale="de-DE"
|
||||||
></v-date-picker>
|
></v-date-picker>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
|
@ -80,6 +84,15 @@
|
||||||
{{ vertretungsart(item.art_vertretung) }}
|
{{ vertretungsart(item.art_vertretung) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- Darstellung des Raums (Orts für Pausenaufsichten) -->
|
||||||
|
<template v-slot:item.raum="{ item }">
|
||||||
|
{{ (item.art_vertretung !== 'B') ? item.raum : paOrt(vpDatum.getDay(), item.stunde, item.lehrkraft) }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:item.raum_vertretung="{ item }">
|
||||||
|
{{ (item.art_vertretung !== 'B') ? item.raum_vertretung : paOrt(vpDatum.getDay(), item.stunde, item.lehrkraft) }}
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- Button für Anmerkungen -->
|
<!-- Button für Anmerkungen -->
|
||||||
<template v-slot:item.expand="{ item }">
|
<template v-slot:item.expand="{ item }">
|
||||||
<v-btn @click="expanded = [item]" v-if="item.anmerkung !== '' && !expanded.includes(item)"><v-icon>mdi-comment-plus</v-icon></v-btn>
|
<v-btn @click="expanded = [item]" v-if="item.anmerkung !== '' && !expanded.includes(item)"><v-icon>mdi-comment-plus</v-icon></v-btn>
|
||||||
|
@ -123,6 +136,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
vp: [],
|
vp: [],
|
||||||
|
pa: [],
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: 'Datum',
|
text: 'Datum',
|
||||||
|
@ -182,7 +196,7 @@ export default {
|
||||||
text: 'Durch',
|
text: 'Durch',
|
||||||
value: 'lehrkraft_vertretung',
|
value: 'lehrkraft_vertretung',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
// nur Zeilen mit Vertreter
|
// nur Zeilen mit Vertreter (keine Entfälle)
|
||||||
filter: value => {
|
filter: value => {
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
return false
|
return false
|
||||||
|
@ -211,11 +225,14 @@ export default {
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
vpUrl: String, // URL der GPU014,
|
vpUrl: String, // URL der GPU014,
|
||||||
|
paUrl: String, // URL der GPU009
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
// Vertretungsplandatum als ISO-String formatieren (YYYY-MM-DD)
|
||||||
datumIso () {
|
datumIso () {
|
||||||
return this.vpDatum.getFullYear() + "" + (this.vpDatum.getMonth() + 1) + "" + this.vpDatum.getDate()
|
return this.vpDatum.getFullYear() + "" + (this.vpDatum.getMonth() + 1) + "" + this.vpDatum.getDate()
|
||||||
},
|
},
|
||||||
|
// neues Datum über Datepicker festgelegt
|
||||||
neuesDatum: {
|
neuesDatum: {
|
||||||
get: function () {
|
get: function () {
|
||||||
return this.vpDatum.toISOString().substr(0, 10)
|
return this.vpDatum.toISOString().substr(0, 10)
|
||||||
|
@ -225,6 +242,7 @@ export default {
|
||||||
this.vpDatumsgrenze = parseInt(this.vpDatum.toISOString().split('T')[0].replace(/-/g,'') + "0800")
|
this.vpDatumsgrenze = parseInt(this.vpDatum.toISOString().split('T')[0].replace(/-/g,'') + "0800")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Ist das ausgewählte Datum heute?
|
||||||
today () {
|
today () {
|
||||||
var d = new Date()
|
var d = new Date()
|
||||||
return d.toDateString() === this.vpDatum.toDateString()
|
return d.toDateString() === this.vpDatum.toDateString()
|
||||||
|
@ -243,20 +261,46 @@ export default {
|
||||||
// Sonntag => Montag
|
// Sonntag => Montag
|
||||||
this.vpDatum.setDate(this.vpDatum.getDate() + 1)
|
this.vpDatum.setDate(this.vpDatum.getDate() + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PAUSENAUFSICHTEN
|
||||||
|
const paHeader = 'ort,lehrkraft,tag,vor_stunde,dauer,extra\n'
|
||||||
|
// Vertretungsplan abrufen
|
||||||
|
const paRes = await fetch(this.paUrl)
|
||||||
|
// Text extrahieren und Feldnamen hinzufügen
|
||||||
|
const paText = paHeader + await paRes.text()
|
||||||
|
console.log(paText)
|
||||||
|
// Parsen und Array in Daten ablegen
|
||||||
|
this.pa = this.$papa.parse(paText, {'header': 'true', 'skipEmptyLines': 'greedy'}).data
|
||||||
|
console.log(this.pa)
|
||||||
|
|
||||||
|
// VERTRETUNGPLAN
|
||||||
// Feldnamen definieren
|
// Feldnamen definieren
|
||||||
const vpHeader = 'nr,datum,stunde,absenznr,id_unterricht,lehrkraft,lehrkraft_vertretung,fach,fach_statistik_id,fach_vertretung,fach_vertretung_statistik_id,raum,raum_vertretung,statistik_id,klassen,absenzgrund,anmerkung,art,klassen_vertretung,art_vertretung,letzte_aenderung,extra\n'
|
const vpHeader = 'nr,datum,stunde,absenznr,id_unterricht,lehrkraft,lehrkraft_vertretung,fach,fach_statistik_id,fach_vertretung,fach_vertretung_statistik_id,raum,raum_vertretung,statistik_id,klassen,absenzgrund,anmerkung,art,klassen_vertretung,art_vertretung,letzte_aenderung,extra\n'
|
||||||
// Abrufen
|
// Vertretungsplan abrufen
|
||||||
const res = await fetch(this.vpUrl)
|
const vpRes = await fetch(this.vpUrl)
|
||||||
// Text extrahieren und Feldnamen hinzufügen
|
// Text extrahieren und Feldnamen hinzufügen
|
||||||
const vpText = vpHeader + await res.text()
|
const vpText = vpHeader + await vpRes.text()
|
||||||
// Parsen und Array in Daten ablegen
|
// Parsen und Array in Daten ablegen
|
||||||
this.vp = this.$papa.parse(vpText, {'header': 'true', 'skipEmptyLines': 'greedy'}).data
|
this.vp = this.$papa.parse(vpText, {'header': 'true', 'skipEmptyLines': 'greedy'}).data
|
||||||
},
|
},
|
||||||
|
// Filter für Wochenenden (Datepicker)
|
||||||
|
allowedDates: val => ![0, 6].includes(new Date(val).getDay()),
|
||||||
vertretungsart (code) {
|
vertretungsart (code) {
|
||||||
return vertretungsarten[code]
|
return vertretungsarten[code]
|
||||||
},
|
},
|
||||||
klassen (klassenString) {
|
klassen (klassenString) {
|
||||||
return klassenString.split('~')
|
return klassenString.split('~')
|
||||||
|
},
|
||||||
|
// Ort zu einer Pausenaufsicht ermitteln
|
||||||
|
paOrt (tag, vor_stunde, lehrkraft) {
|
||||||
|
console.log(tag + ', ' + vor_stunde + ', ' + lehrkraft)
|
||||||
|
var regAufsicht = this.pa.filter(aufsicht => parseInt(aufsicht.tag) === parseInt(tag) && parseInt(aufsicht.vor_stunde) === parseInt(vor_stunde) && aufsicht.lehrkraft === lehrkraft)[0];
|
||||||
|
console.log(regAufsicht)
|
||||||
|
if (typeof regAufsicht != 'undefined') {
|
||||||
|
return regAufsicht.ort
|
||||||
|
} else {
|
||||||
|
return 'PAUSE'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
<Vertretungsplan
|
<Vertretungsplan
|
||||||
ref="vp"
|
ref="vp"
|
||||||
vpUrl="/stundenplan/proxy.php?file=G014"
|
vpUrl="/stundenplan/proxy.php?file=G014"
|
||||||
|
paUrl="/stundenplan/proxy.php?file=G009"
|
||||||
/>
|
/>
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
Loading…
Reference in a new issue