Compare commits

..

83 Commits

Author SHA1 Message Date
Andreas Moik 93da6868a9 outgoing changed for eine_uid 2016-07-26 14:07:31 +02:00
Andreas Moik 5f07058338 more changes for eine_uid 2016-06-29 12:02:49 +02:00
Andreas Moik 78c4481ab3 changed tbl_prestudent JOIN tbl_benutzer and reverse from person_id to uid 2016-06-23 13:55:27 +02:00
Andreas Moik 89a1353df7 bugfix 2016-06-23 13:43:30 +02:00
Andreas Moik 1376d98631 Merge branch 'master' into eine_uid 2016-06-23 13:27:18 +02:00
Andreas Moik b6f936608a more new student calls modified 2016-06-23 12:53:38 +02:00
Andreas Moik 57ca955efa delete_studentlehrverband, save_studentlehrverband and getUid copied to prestudent.class.php 2016-06-22 13:31:57 +02:00
Andreas Moik e86fda71f4 Merge branch 'master' into eine_uid 2016-06-22 12:04:14 +02:00
Andreas Moik 42d3b5bfa8 added missing db parameters to prestudent->load_studentlehrverband 2016-06-22 12:02:12 +02:00
Andreas Moik cfa4439c00 more new student -> prestudent changes
ported student->getTab to prestudent->getTab
ported student->getStudents to prestudent->getPrestudents
2016-06-22 11:25:08 +02:00
Andreas Moik 6e157bd746 Merge branch 'master' into eine_uid 2016-06-20 16:18:28 +02:00
Andreas Moik f6358f92ed more TODO EINE comments modified 2016-06-20 15:04:51 +02:00
Andreas Moik c431303b43 studentDBDM changes 2016-06-13 12:47:08 +02:00
Andreas Moik b4e93ecfe0 bugfixes in studentDBDML.php
added prestudent_id to cis/private/pdfExport.php
2016-06-10 14:39:57 +02:00
Andreas Moik 27e5b1cdb6 cis/private/profile/studienerfolgsbestaetigung.php: added dropdown to choose prestudent 2016-06-10 13:11:30 +02:00
Andreas Moik 96c9882f8a legesamtnoteeintragen _GET["uid"] -> _GET["prestudent_id"] 2016-06-10 12:24:50 +02:00
Andreas Moik aedd895b94 added TODO EINE comment for non-unique $student->prestudent_id 2016-06-10 11:55:43 +02:00
Andreas Moik bcf57fcbf2 cis/private/profile/studienplan.php added an option to choose between prestudents 2016-06-10 11:51:10 +02:00
Andreas Moik b41122e174 TODO EINE fixes
tbl_pruefung.student_uid TO tbl_pruefung.prestuent_id
2016-06-09 10:01:32 +02:00
Andreas Moik 9d12a47486 multiple TODO EINE comments fixed 2016-06-07 14:07:49 +02:00
Andreas Moik 1c2f8e126f Merge branch 'master' into eine_uid 2016-06-03 12:48:57 +02:00
Andreas Moik b6d9f2a4ce param changes for rdfs 2016-06-03 12:30:53 +02:00
Andreas Moik 4c3d0bf5aa TODO-tags for non-unique student->prestudent_id 2016-06-01 14:37:10 +02:00
Andreas Moik 3cba596571 student-io-detail-textbox-uid removed
abschlusspruefung.rdf.php chages for eine_uid
2016-05-30 16:34:19 +02:00
Andreas Moik 0e0f762fc4 bugfix for bug "L is NULL" 2016-05-30 14:15:10 +02:00
Andreas Moik d136937aa0 pruefungsanmeldung.json.php changed for eine_uid 2016-05-30 14:03:13 +02:00
Andreas Moik 6214ad3a66 multiple rdfs changed from student_uid to prestudent_id _GET and return 2016-05-23 10:52:47 +02:00
Andreas Moik 7115ef2443 Merge branch 'master' into eine_uid 2016-05-19 15:56:36 +02:00
Andreas Moik 92ee653ae4 tbl_student to tbl_prestudent finished 2016-05-19 15:55:49 +02:00
Andreas Moik 5f9aa4474e Merge branch 'master' into eine_uid 2016-05-18 11:03:13 +02:00
Andreas Moik c2512a5755 div 2016-05-18 10:32:35 +02:00
Andreas Moik 4cdd47669a cleanups 2016-05-18 09:50:23 +02:00
Andreas Moik 81a1b35ee6 cleanups 2016-05-18 09:31:04 +02:00
Andreas Moik 249076bfcc tbl_student changed to tbl_prestudent 2016-05-18 09:11:17 +02:00
Andreas Moik 1aa2756ea8 tbl_student changes for vilesci/personen 2016-05-13 12:02:00 +02:00
Andreas Moik 6e97ba92aa vilesci/statistik: replaced tbl_student 2016-05-11 11:24:41 +02:00
Andreas Moik 2eb0df0716 replaced tbl_student 2016-05-11 11:16:57 +02:00
Andreas Moik 068bcddb07 mlists: tbl_student replaced 2016-05-10 14:17:27 +02:00
Andreas Moik 1185c68fb6 content/statistik/oeh_beitraege.xls.php 2016-05-09 17:04:15 +02:00
Andreas Moik a63be15c8b removed two obsolete files 2016-05-09 16:59:26 +02:00
Andreas Moik 3258b23c0a bewerberstatistik changes 2016-05-09 16:47:26 +02:00
Andreas Moik 02c787df3f checkStudenten: tbl_student removed 2016-05-09 14:26:27 +02:00
Andreas Moik 8d9a038e2d changed studentDBDML.php to take a prestudent_id instead of a uid 2016-05-02 14:31:54 +02:00
Andreas Moik b5a4645540 changes for tbl_zeugnisnote 2016-04-27 18:01:25 +02:00
Andreas Moik 5d3032e5de many bugfixes
changed some tbl_student to tbl_prestudent
2016-04-27 13:42:29 +02:00
Andreas Moik bda7a51ab2 changes for lehre.tbl_zeugnis 2016-04-25 14:34:16 +02:00
Andreas Moik dd4b14fe99 changes for lehre.tbl_pruefung 2016-04-25 14:02:26 +02:00
Andreas Moik 958ec7f81a lehre.tbl_pruefung - db changes 2016-04-22 14:22:30 +02:00
Andreas Moik 975ab02d74 Merge branch 'master' into eine_uid 2016-04-21 14:08:44 +02:00
Andreas Moik a9f19fd7e2 cleanups 2016-04-20 17:05:03 +02:00
Andreas Moik 3f74f253a7 fue.tbl_ressource.student_uid to uid 2016-04-20 11:18:58 +02:00
Andreas Moik a4b67c5072 changes for tbl_projektarbeit student_uid to prestudent_id 2016-04-20 10:38:48 +02:00
Andreas Moik 8c475139e4 db-changes for lehre.tbl_projektarbeit 2016-04-19 16:04:21 +02:00
Andreas Moik 01eab769ec bugfix 2016-04-19 16:04:08 +02:00
Andreas Moik b3a77052f7 db changes for eine_uid
-lehre.tbl_abschlusspruefung.student_uid -> prestudent_id
	-public.tbl_studentlehrverband.student_uid -> prestudent_id
2016-04-19 15:31:15 +02:00
Andreas Moik 48e0ea2124 removed echo 2016-04-06 15:58:06 +02:00
Andreas Moik 17cd4e4f16 bugfix 2016-04-06 15:57:05 +02:00
Andreas Moik d9a22b7642 angular-tablesort for eine_uid 2016-04-06 15:17:54 +02:00
Andreas Moik fe7840a803 Merge branch 'eine_uid' of https://github.com/FH-Complete/FHC-Core into eine_uid 2016-04-06 11:26:07 +02:00
Andreas Moik 9db228b9d0 Merge branch 'master' into eine_uid 2016-04-06 11:25:46 +02:00
Andreas Moik 24f1bc6068 fixed variable names 2016-04-06 11:03:35 +02:00
Andreas Moik b2805920c2 check for CREATE/DROP view 2016-04-06 10:31:11 +02:00
Andreas Moik 3b22c6bd07 bugfix 2016-04-06 10:14:52 +02:00
Andreas Moik 5b678f5fa6 benotungstool changed for uid 2016-04-06 09:17:03 +02:00
Andreas Moik 0963969c5e changed prestudent_id to uid(tbl_benutzer):
-campus.tbl_studentbeispiel
	-campus.tbl_studentuebung
2016-04-05 16:35:15 +02:00
Andreas Moik 7cda05f4f9 legesamtnoteeintragen and legesamtnoteverwalten changed request from student_uid to prestudent_id 2016-04-05 12:08:42 +02:00
Andreas Moik 3af78fa550 legesamtnoteverwalten now needs a prestudent_id instead of a student_uid 2016-04-05 11:28:13 +02:00
Andreas Moik 1f900e7d22 removed test-button in dbupdate_eine_uid 2016-04-05 10:28:55 +02:00
Andreas Moik 4ee0ba73c4 indices and primary keys will be recreated 2016-04-04 17:30:14 +02:00
Andreas Moik 11844a5739 bugfixes 2016-03-31 10:18:00 +02:00
Andreas Moik b55ae03e1e bugfixes 2016-03-31 09:48:50 +02:00
Andreas Moik e6117fd686 dbupdate_eine_uid entry for campus.tbl_legesamtnote 2016-03-30 16:36:54 +02:00
Andreas Moik 683a881fe7 changed campus.tbl_legesamtnote for eine_uid 2016-03-30 16:35:20 +02:00
Andreas Moik 6006cfd424 campus.tbl_studentuebung changed for eine_uid 2016-03-30 16:21:50 +02:00
Andreas Moik 9896d527e3 tbl_studentbeispiel changed for eine_uid 2016-03-30 11:50:52 +02:00
Andreas Moik 2f3513245f fixed typo 2016-03-29 17:02:55 +02:00
Andreas Moik 472849b92d more modularization for dbupdate_eine_uid 2016-03-29 17:02:00 +02:00
Andreas Moik ddad088249 cleanups 2016-03-24 11:17:09 +01:00
Andreas Moik 8d43fdc90f updated campus.tbl_lvgesamtnote to prestudent_id 2016-03-23 16:12:48 +01:00
Andreas Moik c9e2bb9abb dbupdate_eine_uid: added campus.tbl_lvgesamtnote 2016-03-22 09:38:27 +01:00
Andreas Moik 68099d2a1b bugfix 2016-03-22 09:08:48 +01:00
Andreas Moik 42685a5689 dbupdate für eine_uid 2016-01-14 10:56:54 +01:00
Andreas Moik dbe6746abe bisio mit allen nötigen Abhängigkeiten für "eine UID" geändert 2016-01-14 09:59:23 +01:00
6088 changed files with 450644 additions and 663196 deletions
+10 -43
View File
@@ -1,43 +1,10 @@
documents/
vendor/
/nbproject/
.vscode
composer.phar
/.idea/
.settings
.project
.buildpath
.ptp-sync*
.htaccess
.htaccessbak
application/config/development/
application/config/extensions/
application/config/production
application/config/testing/
application/controllers/extensions/
application/extensions/
application/helpers/extensions/
application/hooks/extensions/
application/libraries/extensions/
application/logs/
application/models/extensions/
application/views/extensions/
application/widgets/extensions/
application/components/extensions/
public/extensions/
tests/codeception/_output/*
!/tests/codeception/_output/.placeholder
tests/codeception/codeception.yml
tests/codeception/tests/acceptance.suite.yml
tests/codeception/tests/api.suite.yml
tests/codeception/tests/functional.suite.yml
tests/codeception/tests/unit.suite.yml
/sparks/*
/webdav/google.php
system/sql/
.htaccess
/nbproject/
/vendor/*
!/vendor/FHC-vendor
/.idea/
documents/
.settings
.project
.buildpath
bin
+6
View File
@@ -0,0 +1,6 @@
[submodule "submodules/bootstrap"]
path = submodules/bootstrap
url = https://github.com/twbs/bootstrap.git
[submodule "submodules/pivottable"]
path = submodules/pivottable
url = https://github.com/nicolaskruchten/pivottable.git
Regular → Executable
-94
View File
@@ -3,88 +3,7 @@
## [Unreleased]
### Added
- **[FAS]** Studierendensuche erweitert für leichteres auffinden von Personen mit Sonderzeichen;Suche nach EMail (#email),Telefon(#tel)
- **[FAS]** Die Anzahl der angezeigten Studiensemester im Menübaum ist pro User konfigurierbar
- **[CIS]** Im Coodle können nun auch Gruppen zu Umfragen hinzugefügt werden.
- **[CIS]** Reservierungen im Stundenplan prüft nun die Verfügbarkeit des Raums im Stundenplandev
- **[FAS]** Projektarbeiten können als Final markiert werden
- **[FAS]** Verwaltung von Rechnungsadressen
- **[CIS]** Mitarbeiter und Studierende können nach dem Login im CIS zur Passwortänderung umgeleitet werden wenn dieses seit über einem Jahr nicht geändert wurde
- **[FAS]** Bei Statuswechsel von Studierenden können Gründe für den Statuswechsel angegeben werden
- **[ADDONS]** Addons können Menüpunkte im Vilesci anpassen
- **[ADDONS]** Addons können Noten für die Gesamtnote vorschlagen
- **[CORE]** UserDefinedFields hinzugefügt zur Verwalung von eigenen Eingabefeldern
- **[CORE]** Support für Extensions hinzugefügt - eine Weiterentwicklung der Addons für die Verwendung mit Codeigniter
- **[CORE]** Infocenter Seite hinzugefügt zur zentralen Verwaltung und ZGV Prüfung von Interessenten
- **[CORE]** Unterstützung für Matrikelnummern und BPK - Anbindung an den Datenverbund
- **[CORE]** Digitale Signatur für Dokumente
- **[FAS]** Direkte Zuordnung von Personen zu Lehreinheiten für Wiederholer, Incoming, etc
### CHANGED
- **[CORE]** Berechtigungsprüfung wurde angepasst damit deaktivierte Benutzer keine Berechtigungen mehr haben
- **[FAS]** Mitarbeiterexport exportiert jetzt nur noch die markierten Personen
- **[CORE]** Has many as possible javascripts and css present in the repository were removed. Their lack is overcome by the packages in the composer. In the meanwhile also the versions were updated
- **[CIS]** Die Fotoliste wird jetzt mit unoconv erstellt. Die bestehende Vorlage für den Dokumentenexport muss hier angepasst werden
- **[CORE]** Resturlaubstage und Mehrarbeitsstunden wurden aus dem Core entfernt und können nicht mehr mit FH-Complete verwaltet werden.
- **[CORE]** Personenzusammenlegen agiert intelligenter und kann direkt aus dem FAS erfolgen.
- **[CIS]** Ampeln können jetzt verpflichtend sein und per Mail benachrichtigen
### Updateinfo
- **[CORE]** Infoscreen wurde umbenannt (informationsbildschirm.php)
- **[CORE]** Moodle Schnittstelle wurde aus dem Core entfernt und in ein eigenes Addon verschoben. Moodle Versionen < 2.4 werden nicht mehr unterstützt
- **[CORE]** Update campus.tbl_templates (contentmittitel and contentohnetitel) with system/templates/contentmittitel_xslt_xhtml.xslt andsystem/templates/contentohnetitel_xslt_xhtml.xslt
- **[CORE]** Neue Style Anweisungen (div.header_logo, td.headerbar, div.cis_logo) müssen in Custom Stylesheet hinzugefügt werden
### Removed
- **[CORE]** Removed Support for XSLFO2PDF Documents - use unoconv instead
- **[CORE]** Removed Support for FOP Documents - use unoconv instead
### Deprecated
- **[CORE]** Die folgenden Datenbank Tabellen und Spalten wurden als DEPRECATED markiert und werden mit der nächsten Version entfernt:
public.tbl_aufnahmeschluessel, public.tbl_aufnahmetermin, public.tbl_aufnahmetermintyp, public.tbl_preinteressent,
public.tbl_preinteressentstudiengang, campus.tbl_feedback, campus.tbl_lvinfo, campus.tbl_resturlaub, lehre.tbl_lehrfach
lehre.tbl_lehrmittel, lehre.tbl_moodle, lehre.tbl_moodle_version, lehre.tbl_studienordnung_semester, lehre.tbl_zeitfenster
lehre.tbl_zeugnis, fue.tbl_scrumsprint, fue.tbl_scrumteam, wawi.tbl_aufteilung, wawi.tbl_aufteilung_default,
testtool.tbl_kategorie, testtool.tbl_kriterien, public.tbl_prestudent.rt_punkte1, public.tbl_prestudent.rt_punkte2
public.tbl_prestudent.rt_punkte3, public.tbl_prestudent.anmeldungreihungstest, public.tbl_prestudent.reihungstest_id
public.tbl_prestudent.ausstellungsstaat, public.tbl_prestudent.aufnahmeschluessel, lehre.tbl_lehrveranstaltung.old_lehrfach_id, lehre.tbl_projektarbeit.gesamtstunden, lehre.tbl_projektarbeit.faktor,
lehre.tbl_projektarbeit.stundensatz
- **[CORE]** LV-Infos werden mit der kommenden Version aus dem Core entfernt - Dies ist jetzt ein Addon
- **[CORE]** WaWi wird mit der kommenden Version aus dem Core entfernt- Dies ist jetzt ein Addon
- **[CIS]** Benotungstool/Kreuzerltool wird mit der kommenden Version aus dem Core entfernt
- **[CIS]** Feedback wird mit der kommenden Version aus dem Core entfernt
## [3.2]
### Added
- **[FAS]** Unterstützung für gemeinsame Studien hinzugefügt
- **[FAS]** Inaktive Mitarbeiter sind jetzt ausgegraut
- **[FAS]** Anmerkungsfeld bei Konto-Buchungen hinzugefügt
- **[CIS]** Lehrveranstaltung Menü auf Studienplan Basis und Modularisiert
- **[CIS]** Ampeln koennen nun verpflichtend sein und Sperren die GUI
- **[FAS]** Bei Mitarbeitern können Notizen erfasst werden
- **[FAS]** Im FAS gibt es einen neuen Karteireiter Messages. Hier können Nachrichten an Studierende übermittelt werden. Die Kommunikation des Aufnahme Addons wird über Messages abgewickelt.
- **[FAS]** Neuer Karteireiter Aufnahmetermine ersetzt die Reihungstestauswahl im Karteireiter Prestudent
- **[CORE]** Es können nun beliebig viele Reihungstests pro Person gespeichert werden.
- **[CORE]** Reihungstests können mehrere Räume zugeteilt werden. Die angemeldeten Studierenden können auf diese Räume aufgeteilt werden. Es gibt dann getrennte Anwesenheitslisten für jeden Raum
- **[CORE]** Reihungstests haben jetzt verschiedene Stufen
- **[CORE]** Reihungstests können Studiensemestern zugeordnet werden
- **[CORE]** Reihungstests können Studienpläne zugeordnet werden. Dies legt fest welche Personen sich zu diesen Reihungstests anmelden können.
- **[CORE]** Es gibt eine Anmeldefrist für Reihungstests
- **[CORE]** Codeigniter Framework wird als neue Basis verwendet.
- **[CORE]** REST API für Zugriff auf alle Daten
- **[CORE]** Neues Phrasenmodul für Orgform spezifische Phrasen
- **[CORE]** Der Zugriff auf Reports kann mitgeloggt werden
- **[CORE]** Der Zugriff auf CMS Seiten kann mitgeloggt werden
- **[FAS]** Es ist möglich bei Statusänderungen im FAS automatisierte Nachrichten an die Studierenden zu senden
- **[FAS]** Bewerberakt - Erstellung eines Akts mit allen hochgeladenen Dokumenten einer Person
- **[FAS]** Bewerbungsfristen für einzelen Studienpläne
- **[FAS]** Beim Statuswechsel kann ein Statusgrund hinterlegt werden.
- **[FAS]** Es kann pro Studiengang hinterlegt werden ob ein Dokument nachreichbar ist oder nicht
- **[FAS]** Arbeitsplätze bei Räumen (zB für EDV Säle mit 50 Plätzen aber nur 25 PCs)
- **[FAS]** Zuteilung von Prestudenten zu Aufnahmegruppen
- **[FAS]** Zusätzliches Feld für Uhrzeit bei Abschlussprüfung
- **[FAS]** Reihungstest Dropdown zeigt verfügbare/belegte Plätze an
- **[CORE]** Reihungstest Punkteübernahme oder Prozentpunkte ist konfigurierbar
@@ -103,23 +22,10 @@
- **[CORE]** Removed NOT NULL constraint on 'verfasser\_uid' from public.tbl\_notiz
- **[CIS]** Studienplanansicht: Wenn eine LV nicht benotet ist, aber eine kompatible LV mit vorhandener Anrechnung benotet ist wird diese Note angezeigt.
- **[FAS]** Die RDF-Schnittstelle für das Zeugnis prüft bei Anrechnungen ob, die ECTS-Punkte übereinstimmen und wählt bei ungleichen Werten jene der angerechneten LV.
- **[FAS]** Der Ausbildungsvertrag kann nun jederzeit erstellt werden, auch wenn eine Person noch kein Student ist. Wenn in der Vorlage des Ausbildungsvertrags ein Attribut des Studenten-Datensatzen (zB Personenkennzeichen) abgefragt wird und eine Person noch nicht Student ist, kann dieses nicht angedruckt werden und sollte aus der Vorlage entfernt werden.
- **[CORE]** Check Constraint in der Datenbank für SVNR - Diese muss 10, 12 oder 16 Zeichen lang sein
### Updateinfo
- **[FAS]** Für Lehraufträge muss eine Unoconv-Vorlage erstellt werden, da der für xsl-fo notwendige Seitenumbruch-Tag aus dem RDF entfernt wurde.
- **[FAS]** Mehrsprachigkeitsspalte tbl_status.bezeichnung_mehrsprachig wird durch das Updatescript automatisch in den ersten beiden Sprachen mit der status_kurzbz vorbefüllt. Übersetzungen sind anzupassen.
- **[MOODLE]** Neue Webservicefunktion core_user_update_users wird benötigt
- **[CORE]** Kommune wurde aus Core entfernt
- **[DEPRECATED]]** WaWi wurde in ein Addon (FHC-ADDON-WAWI) ausgelagert. Die Funktionalität im Core wird demnächst entfernt.
- **[DEPRECATED]]** LV-Informationen (FHC-ADDON-LVINFO) wurde in ein Addon ausgelagert. Die Funktionalität im Core wird demnächst entfernt
- **[DEPRECATED]]** Punkte1, Punkte2 und Punkte3 in tbl_prestudent werden nicht mehr verwendet und in zukünftigen Versionen entfernt. Diese werden jetzt in tbl_rt_person gespeichert
- **[DEPRECATED]]** anmeldungreihungstest in tbl_prestudent wird nicht mehr verwendet und in zukünftigen Versionen entfernt
- **[CORE]** Spalte php und r wurde aus tbl_statistik entfernt
- **[DEPRECATED]** Spalte ort_kurzbz in tbl_reihungstest wird nicht mehr verwendet und in zukünftigen Versionen entfernt
Zum Update auf diese Version folgen Sie den Anweisungen auf folgender Seite:
https://wiki.fhcomplete.org/doku.php?id=fh-complete:codeigniter
## [3.1.0] - 2015-11-12
### Added
+23
View File
@@ -0,0 +1,23 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h1 style="text-align: center;"><br>
</h1>
<h1 style="text-align: center;"><br>
</h1>
<h1 style="text-align: center;"><big>System-Umstellung</big></h1>
<br>
<h2 style="text-align: center;">Ende der Umstellung ist vorraussichtlich <big><span style="text-decoration: underline;">
Dienstag 6.2.2007 19:00 Uhr</span></big></h2>
<br>
<div style="text-align: right;">
<h3><br>
</h3>
<h3><br>
</h3>
<h3>Wir bitten um Ihr Verst&auml;ndnis!</h3>
</div>
</body>
</html>
+4 -2
View File
@@ -1,5 +1,7 @@
# FH-Complete
* [FH-Complete Homepage](https://www.fhcomplete.org)
* [Wiki](https://wiki.fhcomplete.info/)
[![Build Status](http://phpci.fhcomplete.org/build-status/image/1)](http://phpci.fhcomplete.org/project/view/1)
* [FH-Complete Homepage](http://www.fhcomplete.org)
* [Wiki](http://fhcomplete.technikum-wien.at/dokuwiki/)
* [Changelog](CHANGELOG.md)
+1 -1
View File
@@ -1,6 +1,6 @@
#ignore all addons
*
#except template addon
!template**/**
!template/*
!CodingGuidelines.txt
!index.html
+2 -2
View File
@@ -45,7 +45,7 @@ $uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('basis/addon', null, 'suid'))
if(!$rechte->isBerechtigt('basis/addon'))
{
exit('Sie haben keine Berechtigung für die Verwaltung von Addons');
}
@@ -66,7 +66,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM addon.tbl_template_items"))
if(!$db->db_query($qry))
echo '<strong>addon.tbl_template_items: '.$db->db_last_error().'</strong><br>';
else
else
echo ' addon.tbl_template_items: Tabelle addon.template_items hinzugefuegt!<br>';
}
+1 -1
View File
@@ -43,7 +43,7 @@ $uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('basis/addon', null, 'suid'))
if(!$rechte->isBerechtigt('basis/addon'))
{
exit('Sie haben keine Berechtigung für die Verwaltung von Addons');
}
-44
View File
@@ -1,44 +0,0 @@
<?php
/* Copyright (C) 2017 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
*/
/**
* Hier koennen neue Menuepunkte im Vilesci definiert werden
*/
// Hauptmenuepunkt hinzufuegen
$menu_addon = array
(
'Template'=>array
(
'name'=>'Template', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('basis/addon'), 'image'=>'../../skin/images/vilesci_addons.png',
'link'=>'left.php?categorie=Template', 'target'=>'nav',
'TemplateEntry1'=>array('name'=>'Template Entry1', 'link'=>'../addons/template/vilesci/index.php', 'target'=>'main'),
'TemplateEntry2'=>array('name'=>'Template Entry2', 'link'=>'../addons/template/vilesci/index.php', 'target'=>'main')
)
);
$menu = array_merge($menu,$menu_addon);
// Submenuepunkt hinzufuegen unter dem Hauptmenue Punkt "Admin"
$menu_addon = array
(
'TemplateSubmenu'=>array('name'=>'Template', 'link'=>'../addons/template/vilesci/index.php', 'target'=>'main','permissions'=>array('basis/addon')),
);
$menu['Admin'] = array_merge($menu['Admin'],$menu_addon);
?>
-11
View File
@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -1,19 +0,0 @@
<?php
$filterCmptArray = array(
'app' => 'core',
'datasetName' => 'logs',
//'filterKurzbz' => 'jobs48hours', // REMOVE ME
'query' => '
SELECT wsl.webservicelog_id AS "LogId",
wsl.request_id AS "RequestId",
wsl.execute_time AS "ExecutionTime",
wsl.execute_user AS "ExecutedBy",
wsl.beschreibung AS "Description",
wsl.request_data AS "Data",
wsl.webservicetyp_kurzbz AS "WebserviceType"
FROM system.tbl_webservicelog wsl
ORDER BY wsl.execute_time DESC
',
'requiredPermissions' => 'admin'
);
@@ -1,36 +0,0 @@
<?php
$filterCmptArray = array(
"app" => 'core',
'datasetName' => 'vertragsverwaltung',
'query' => '
SELECT
uid,
person_id,
vorname,
nachname,
gebdatum,
vertragsarten,
unternehmen,
ids,
aktiv
FROM
(
SELECT
b.uid , p.person_id,
p.vorname, p.nachname,
gebdatum,
STRING_AGG(DISTINCT va.bezeichnung, \', \') AS Vertragsarten,
STRING_AGG(DISTINCT u.bezeichnung, \', \') AS Unternehmen,
STRING_AGG(d.dienstverhaeltnis_id::TEXT, \', \') AS ids,
b.aktiv
FROM
hr.tbl_dienstverhaeltnis d
JOIN public.tbl_benutzer b ON d.mitarbeiter_uid = b.uid
JOIN public.tbl_person p ON p.person_id = b.person_id
JOIN public.tbl_organisationseinheit u ON d.oe_kurzbz = u.oe_kurzbz
JOIN hr.tbl_vertragsart va ON d.vertragsart_kurzbz = va.vertragsart_kurzbz
GROUP BY b.uid, p.person_id, p.vorname, p.nachname, b.aktiv
) as vertragsdaten
',
'requiredPermissions' => 'vertrag/mitarbeiter'
);
-37
View File
@@ -1,37 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use CI3_Events as Events;
Events::on('loadRenderers', function ($renderers) {
$fhc_core_renderers =& $renderers();
$fhc_core_renderers["lehreinheit"] = array(
'calendarEvent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Lehreinheit/calendarEvent.js'),
'modalTitle' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Lehreinheit/modalTitle.js'),
'modalContent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Lehreinheit/modalContent.js'),
'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css'
);
});
Events::on('loadRenderers', function ($renderers) {
$fhc_core_renderers =& $renderers();
$fhc_core_renderers["reservierung"] = array(
'calendarEvent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Reservierungen/calendarEvent.js'),
'modalTitle' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Reservierungen/modalTitle.js'),
'modalContent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Reservierungen/modalContent.js'),
'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css'
);
});
Events::on('loadRenderers', function ($renderers) {
$fhc_core_renderers =& $renderers();
$fhc_core_renderers["ferien"] = array(
'calendarEvent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Feiertage/calendarEvent.js'),
'modalTitle' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Feiertage/modalTitle.js'),
'modalContent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Feiertage/modalContent.js'),
'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css'
);
});
-45
View File
@@ -1,45 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['turnitin_link'] = 'https://technikum-wien.turnitin.com/sso/sp/redwood/saml/5IyfmBr2OcSIaWQTKlFCGj/start';
$config['old_abgabe_beurteilung_link'] = 'https://moodle.technikum-wien.at/mod/page/view.php?id=1005052';
$config['PAABGABE_EMAIL_JOB_INTERVAL'] = '1 day';
// used as APP_ROOT.URL_STUDENTS -> cis4
$config['URL_STUDENTS'] = 'cis.php/Cis/Abgabetool/Student';
// used as APP_ROOT.URL_MITARBEITER -> old cis
$config['URL_MITARBEITER'] = 'index.ci.php/Cis/Abgabetool/Mitarbeiter';
// used as APP_ROOT.URL_MITARBEITER -> old cis
$config['URL_ASSISTENZ'] = 'index.ci.php/Cis/Abgabetool/Assistenz';
// lehre.tbl_paabgabetyp bezeichnung
//$config['ALLOWED_ABGABETYPEN_BETREUER'] = ['Zwischenabgabe', 'Quality Gate 1', 'Quality Gate 2'];
$config['ALLOWED_ABGABETYPEN_BETREUER'] = ['abstract','zwischen', 'qualgate1', 'qualgate2']; // tbl_paabgabetyp pk
// paabgabetypen for which betreuer is benachrichtigt via sammelmail
$config['RELEVANT_PAABGABETYPEN_SAMMELMAIL_BETREUER'] = ['qualgate1', 'qualgate2', 'end'];
// paabgabetypen for which assistenz is benachrichtigt via sammelmail
$config['RELEVANT_PAABGABETYPEN_SAMMELMAIL_ASSISTENZ'] = ['end'];
// paabgabetypen for which student is benachrichtigt via sammelmail -> basically all of them but still defined for consistency
$config['RELEVANT_PAABGABETYPEN_SAMMELMAIL_STUDENT'] = ['qualgate1', 'qualgate2', 'zwischen', 'note', 'abstract', 'end', 'enda'];
//$config['ALLOWED_NOTEN_ABGABETOOL'] = ['Bestanden', 'Nicht bestanden'];
$config['ALLOWED_NOTEN_ABGABETOOL'] = [10, 14]; // tbl_note pk
// benotete projektarbeiten sperren weitere terminanlage & bearbeitung, diese noten sind ausnahmen dieser Regel
// wie zB "Nicht beurteilt" & "Noch nicht eingetragen"
$config['NONFINAL_NOTEN_ABGABETOOL'] = [9];
$config['beurteilung_link_fallback'] = 'addons/fhtw/content/projektbeurteilung/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?';
$config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ERSTBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter';
$config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ZWEITBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter';
$config['SIGNATUR_CHECK_PAABGABETYPEN'] = ['end'];
// to be used as "https://moodle.technikum-wien.at/course/view.php?idnumber=dl{$stg_kz}" for stg specific moodle routing
$config['STG_MOODLE_LINK'] = 'https://moodle.technikum-wien.at/course/view.php?idnumber=dl';
$config['ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT'] = true;
$config['ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER'] = true;
$config['BETREUER_SAMMELMAIL_BUTTON_STUDENT'] = true;
-35
View File
@@ -1,35 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
// Deadline for Application given as Time-Interval after Semesterstart.
$config['interval_blocking_application'] = 'P1M';
// Lehrveranstaltungen with these grades will be blocked for application
$config['grades_blocking_application'] = array(
5, // nicht genügend
6, // angerechnet
9, // noch nicht eingetragen
13, // nicht erfolgreich absolviert
14, // nicht bestanden,
15, // nicht teilgenommen
18 // unentschuldigt
);
//Enables Fachbereichsleiter instead of LV Leiter
$config['fbl'] = FALSE;
//Enables Info Mails
$config['send_mail'] = TRUE;
// Display fields to explain equivalence of ECTS and LV-Inhalte
$config['explain_equivalence'] = TRUE;
// Displays infobox if set to true
$config['display_infobox'] = [
'fristen' => TRUE,
'referenzbeispiele_ects' => TRUE,
'voraussetzungen' => TRUE,
'nachweisdokumente' => TRUE,
'herkunft_kenntnisse' => TRUE
];
-21
View File
@@ -1,21 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
// Array or a string of authentication methods sorted by priority (highest to lowest)
// NOTE: AUTH_HBALDAP works also as login page (old ugly HTTP basic authentication)
// should be placed at the end of the array
$config['authentication_foreign_methods'] = array(AUTH_BT, AUTH_HBALDAP);
// Login method
$config['authentication_login'] = AUTH_LDAP;
// Array of login pages
$config['authentication_login_pages'] = array(
AUTH_DB => '/system/Login/emailCode',
AUTH_LDAP => '/system/Login/usernamePassword',
AUTH_SSO => '/system/Login/sso'
);
// Logout page
$config['authentication_logout_page'] = '/system/Logout';
-129
View File
@@ -1,129 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url');
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();
-6
View File
@@ -1,6 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
// Define configuration parameters
$config['timezone'] = 'Europe/Vienna';
-15
View File
@@ -1,15 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// CMS Content Id for CIS4 Menu Root
$config['cis_menu_root_content_id'] = 11091;
// send Mails for ProfilUpdate
$config['cis_send_profil_update_mails'] = true;
// Vilesci CI BaseUrl
$config['cis_vilesci_base_url'] = defined('VILESCI_ROOT') ? VILESCI_ROOT : APP_ROOT;
$config['cis_vilesci_index_page'] = 'index.ci.php';
// Cis CI BaseUrl
$config['cis_base_url'] = defined('CIS_ROOT') ? CIS_ROOT : APP_ROOT;
$config['cis_index_page'] = 'cis.php';
-517
View File
@@ -1,517 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will try guess the protocol, domain
| and path to your installation. However, you should always configure this
| explicitly and never rely on auto-guessing, especially in production
| environments.
|
*/
$config['base_url'] = 'http://phpci.fhcomplete.org/build/fhcomplete/';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.ci.php';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = '';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'FHC_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 1;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = 'log';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| http://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
| NOTE: Keep it as it is to prevent security issues (https://en.wikipedia.org/wiki/Session_fixation)
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'sess_ci_session';
$config['sess_expiration'] = 1800; // Session expires every 30 minutes
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| This is particularly useful for portability between UNIX-based OSes,
| (usually \n) and Windows (\r\n).
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
/*
|--------------------------------------------------------------------------
| FHComplete Build Version
|--------------------------------------------------------------------------
|
| Version Number of the Current Build
| This is used to invalidate Cache for JS and CSS Files
|
| Example: 2019102901
*/
$config['fhcomplete_build_version'] = '2019102903';
-150
View File
@@ -1,150 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Exit status codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
|
*/
define('EXIT_SUCCESS', 0); // no errors
define('EXIT_ERROR', 1); // generic error
define('EXIT_MODEL', 2); // model error
define('EXIT_CONFIG', 3); // configuration error
define('EXIT_UNKNOWN_FILE', 4); // file not found
define('EXIT_UNKNOWN_CLASS', 5); // unknown class
define('EXIT_UNKNOWN_METHOD', 6); // unknown class method
define('EXIT_USER_INPUT', 7); // invalid user input
define('EXIT_DATABASE', 8); // database error
define('EXIT_VALIDATION_UDF', 10); // UDF validation has been failed
define('EXIT_VALIDATION_UDF_MIN_VALUE', 11); // UDF validation has been failed -> MIN VALUE
define('EXIT_VALIDATION_UDF_MAX_VALUE', 12); // UDF validation has been failed -> MAX VALUE
define('EXIT_VALIDATION_UDF_MIN_LENGTH', 13); // UDF validation has been failed -> MIN LENGTH
define('EXIT_VALIDATION_UDF_MAX_LENGTH', 14); // UDF validation has been failed -> MAX LENGTH
define('EXIT_VALIDATION_UDF_REGEX', 15); // UDF validation has been failed -> REGEX
define('EXIT_VALIDATION_UDF_REQUIRED', 16); // UDF validation has been failed -> REQUIRED
define('EXIT_VALIDATION_UDF_NOT_VALID_VAL', 17); // UDF validation has been failed -> Not valid value, object or array
define('EXIT_AUTO_MIN', 1000); // lowest automatically-assigned error code
define('EXIT_AUTO_MAX', 2000); // highest automatically-assigned error code
/*
|--------------------------------------------------------------------------
| General purpose
|--------------------------------------------------------------------------
*/
define('BEGINNING_OF_TIME', '1970-01-01');
/*
|--------------------------------------------------------------------------
| Authentication constants
|--------------------------------------------------------------------------
*/
// Foreign authentication methods
define('AUTH_HBALDAP', 'httpBasicAuthLDAP');
define('AUTH_BT', 'bewerbung');
// Login methods
define('AUTH_LDAP', 'ldap');
define('AUTH_DB', 'database');
define('AUTH_SSO', 'sso');
// Authentication return codes
define('AUTH_SUCCESS', 0);
define('AUTH_NOT_AUTHENTICATED', 1);
define('AUTH_INVALID_CREDENTIALS', 2);
/*
|--------------------------------------------------------------------------
| Language constants
|--------------------------------------------------------------------------
*/
define('LANG_SESSION_NAME', 'LANGUAGE');
define('LANG_SESSION_INDEXES', 'INDEXES');
define('LANG_SESSION_ACTIVE_LANGUAGES', 'ACTIVE_LANGUAGES');
define('LANG_SESSION_CURRENT_LANGUAGE', 'sprache'); // NOTE: it is not under LANG_SESSION_NAME
/*
|--------------------------------------------------------------------------
| File and directory modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
| File stream modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
|--------------------------------------------------------------------------
| Display debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
| Email constants
|--------------------------------------------------------------------------
*/
define('EMAIL_CONFIG_INDEX', 'mail');
/*
|--------------------------------------------------------------------------
| Messaging system constants
|--------------------------------------------------------------------------
*/
// Message statuses
define('MSG_STATUS_UNREAD', 0);
define('MSG_STATUS_READ', 1);
define('MSG_STATUS_ARCHIVED', 2);
define('MSG_STATUS_DELETED', 3);
// Message priorities
define('MSG_PRIORITY_LOW', 1);
define('MSG_PRIORITY_NORMAL', 2);
define('MSG_PRIORITY_HIGH', 3);
define('MSG_PRIORITY_URGENT', 4);
// Message error status
define('MSG_ERR_INVALID_SUBJECT', 40);
define('MSG_ERR_INVALID_BODY', 41);
define('MSG_ERR_INVALID_TEMPLATE', 42);
define('MSG_ERR_INVALID_MSG_ID', 43);
define('MSG_ERR_INVALID_STATUS_ID', 44);
define('MSG_ERR_INVALID_SENDER', 45);
define('MSG_ERR_INVALID_RECIPIENTS', 46);
define('MSG_ERR_INVALID_OU', 47);
define('MSG_ERR_INVALID_TOKEN', 48);
-12
View File
@@ -1,12 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Autoload custom controllers, models, etc that are present in the application/core directory
*/
spl_autoload_register(function ($class) {
if (substr($class, 0, 3) !== 'CI_' && substr($class, 0, 4) !== 'FHC_')
if (file_exists($file = APPPATH.'core/'.$class.'.php'))
require_once $file;
});
-122
View File
@@ -1,122 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
defined('DB_HOST') OR require_once './config/system.config.inc.php'; // For CLI-Migrations
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => DB_HOST,
'username' => DB_USER,
'password' => DB_PASSWORD,
'port' => DB_PORT,
'database' => DB_NAME,
'dbdriver' => 'postgre',
'dbprefix' => '',
'pconnect' => DB_CONNECT_PERSISTENT,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
$db['system'] = array(
'dsn' => '',
'hostname' => DB_HOST,
'username' => 'fhcomplete',
'password' => 'fhcomplete',
'database' => DB_NAME,
'port' => DB_PORT,
'dbschema' => 'public',
'dbdriver' => 'postgre',
'dbprefix' => '',
'pconnect' => DB_CONNECT_PERSISTENT,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
-29
View File
@@ -1,29 +0,0 @@
<?php
/**
* Copyright (C) 2023 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
// NOTE: if database encryption is _not_ used then leave this array empty!
$config['encryption_passwords'] = array(
// 'password name 1' => 'password 1'
// 'password name 2' => 'password 2'
// 'password name ...' => 'password ...'
// 'password name N' => 'password N'
);
-24
View File
@@ -1,24 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
);
@@ -1 +0,0 @@
-103
View File
@@ -1,103 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ|Δ/' => 'Dj',
'/ð|ď|đ|δ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);
-13
View File
@@ -1,13 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/hooks.html
|
*/
-11
View File
@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
-5
View File
@@ -1,5 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$config['infocenter_studiengang_kz'] = '10021, 10027, 10002';
-11
View File
@@ -1,11 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// apps for which issues should be displayed
$config['issues_list_apps'] = array('core', 'dvuh');
// functions which enable users to see issues
$config['issues_list_functions'] = array('ass');
// functions which enable users to see issues
$config['issues_list_status'] = array('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent');
-12
View File
@@ -1,12 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// use vuejs dev version
$config['use_vuejs_dev_version'] = false;
// use bundled javascript
$config['use_bundled_javascript'] = false;
// systemerror_mailto use in FHC-Alert Plugin - if empty Link will not be rendered
$config['systemerror_mailto'] = '';
// use fhcomplete_build_version as path element after public (requires apache mod_rewrite)
// see <fhc_base_dir>/public/.htaccess_sample for details
$config['use_fhcomplete_build_version_in_path'] = false;
-14
View File
@@ -1,14 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// White list of permissions (write mode have to be set) that are able to store a specific job type in database
$config['job_type_permissions_white_list'] = array(
'SAPStammdatenUpdate' => array(
'admin:rw',
'developer:rw'
),
'OEHPayment' => 'developer:rw',
'SAPPayment' => 'developer:rw'
);
-68
View File
@@ -1,68 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
defined('LDAP_SERVER') OR require_once './config/system.config.inc.php'; // LDAP configs
$ldap_active_group = 'development';
$ldap['development'] = array(); // development LDAP configs
if (defined('LDAP_SERVER')) // 1st LDAP server
{
$ldap['development'][] = array(
'server' => LDAP_SERVER,
'port' => LDAP_PORT,
'starttls' => LDAP_STARTTLS,
'basedn' => LDAP_BASE_DN,
'username' => LDAP_BIND_USER,
'password' => LDAP_BIND_PASSWORD,
'usf' => LDAP_USER_SEARCH_FILTER,
'timeout' => 1
);
}
if (defined('LDAP2_SERVER')) // 2nd LDAP server
{
$ldap['development'][] = array(
'server' => LDAP2_SERVER,
'port' => LDAP2_PORT,
'starttls' => LDAP2_STARTTLS,
'basedn' => LDAP2_BASE_DN,
'username' => LDAP2_BIND_USER,
'password' => LDAP2_BIND_PASSWORD,
'usf' => LDAP2_USER_SEARCH_FILTER,
'timeout' => 1
);
}
$ldap['production'] = array(); // Live LDAP configs
if (defined('LDAP_SERVER')) // 1st LDAP server
{
$ldap['production'][] = array(
'server' => LDAP_SERVER,
'port' => LDAP_PORT,
'starttls' => LDAP_STARTTLS,
'basedn' => LDAP_BASE_DN,
'username' => LDAP_BIND_USER,
'password' => LDAP_BIND_PASSWORD,
'usf' => LDAP_USER_SEARCH_FILTER,
'timeout' => 1
);
}
if (defined('LDAP2_SERVER')) // 2nd LDAP server
{
$ldap['production'][] = array(
'server' => LDAP2_SERVER,
'port' => LDAP2_PORT,
'starttls' => LDAP2_STARTTLS,
'basedn' => LDAP2_BASE_DN,
'username' => LDAP2_BIND_USER,
'password' => LDAP2_BIND_PASSWORD,
'usf' => LDAP2_USER_SEARCH_FILTER,
'timeout' => 1
);
}
-11
View File
@@ -1,11 +0,0 @@
<?php
/*It defines which tags are available in LVVerwaltung and whether they are editable
$config['lvverwaltung_tags'] = [
'tag_1' => ['readonly' => false],
'tag_1' => ['readonly' => true]
];
*/
$config['lvverwaltung_tags'] = [];
-49
View File
@@ -1,49 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
// Define configuration parameters
$config['email_number_to_sent'] = 1000; // Number of emails to sent each time sendAll is called
$config['email_number_per_time_range'] = 1; // Number of emails to sent before pause
$config['email_time_range'] = 1; // Length of the pause in seconds
$config['email_from_system'] = 'no-reply@technikum-wien.at';
$config['alias_from_system'] = 'No Reply';
// Smtp: if the CI email library has to connect to a smtp server
// Mail: if the system is setup to send emails with the standard php mail function
// Sendmail: if the system is setup to send email via Sendmail (or similar)
$config['protocol'] = ''; // mail, sendmail, or smtp
// If protocol is set to sendmail
$config['mailpath'] = ''; // SThe server path to Sendmail (or similar)
// If protocol is set to smtp
$config['smtp_host'] = 'localhost'; // SMTP Server Address
$config['smtp_port'] = 25;
$config['smtp_timeout'] = 5; // in seconds
$config['smtp_keepalive'] = false; // Enable persistent SMTP connections
$config['smtp_user'] = '';
$config['smtp_pass'] = '';
$config['wordwrap'] = true; // {unwrap}http://example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
$config['wrapchars'] = 76; // Character count to wrap at.
$config['mailtype'] = 'html'; // html or text
$config['priority'] = 3; // Email Priority. 1 = highest. 5 = lowest. 3 = normal
$config['validate'] = false; // If true then the email address will be validated
// If enabled will be logged info about emails in Codeigniter error logs
$config['enable_debug'] = false;
// default sender
$config['sancho_mail_default_sender'] = defined('SANCHO_MAIL_DEFAULT_SENDER') ? SANCHO_MAIL_DEFAULT_SENDER : '';
// If to use images for custom mails
$config['sancho_mail_use_images'] = defined('SANCHO_MAIL_USE_IMAGES') ? SANCHO_MAIL_USE_IMAGES : false;
// image path for sancho mail, relativ to document root
$config['sancho_mail_img_path'] = defined('SANCHO_MAIL_IMG_PATH') ? SANCHO_MAIL_IMG_PATH : '';
// header image for custom mails
$config['sancho_mail_header_img'] = defined('SANCHO_MAIL_HEADER_IMG') ? SANCHO_MAIL_HEADER_IMG : '';
// footer image for custom mails
$config['sancho_mail_footer_img'] = defined('SANCHO_MAIL_FOOTER_IMG') ? SANCHO_MAIL_FOOTER_IMG : '';
-19
View File
@@ -1,19 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Memcached settings
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
| See: http://codeigniter.com/user_guide/libraries/caching.html#memcached
|
*/
$config = array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => '11211',
'weight' => '1',
),
);
-27
View File
@@ -1,27 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// ONLY FOR DEBUGGING - If you are unsure, don't change it. If the message should be sent immediately. Default false
$config['send_immediately'] = false;
$config['msg_delivery'] = true; // Default true
$config['system_person_id'] = 1; // Dummy sender, used for sending messages from the system
$config['redirect_view_message_url'] = '/system/messages/ViewMessage/redirectByToken/';
$config['message_html_view_url'] = '/system/messages/ViewMessage/toHTML/';
// Change this to CIS Server (https://cis.example.com/index.ci.php) if you are sending Messages from Vilesci
$config['message_server'] = site_url();
// Organization unit function that are allowed to read messages for the organisation unit
$config['ou_receivers'] = array('ass');
// Organization units that will never receive notice emails
$config['ou_receivers_no_notice'] = array('infocenter');
// Organization units that will not send the notice email to the internal account, but to the private one
$config['ou_receivers_private'] = array('eac', 'ewu', 'scs');
//
$config['ou_function_whitelist'] = array('ass', 'Leitung', 'fachzuordnung', 'oezuordnung');
$config['message_redirect_url'] = array();
$config['message_redirect_url']['fallback'] = site_url('system/messages/ViewMessage/writeReply');
// $config['message_redirect_url']['OE_ROOT_1'] = 'https://<server name>/addons/aufnahme/OE_ROOT/cis/index.php';
// $config['message_redirect_url']['OE_ROOT_2'] = 'https://<server name>/<where ever you like to land to a message reply page>';
-36
View File
@@ -1,36 +0,0 @@
<?php
/**
* Copyright (C) 2023 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['migratecontract_oe_default'] = 'TODO_OE_DEFAULT';
$config['migratecontract_matching_ba1_vertragsart'] = array(
'101'=>'dvbund',
'102'=>'dvanderengk',
'103'=>'echterdv',
'104'=>'studentischehilfskr',
'105'=>'externerlehrender',
'106'=>'dvanderenbet',
'107'=>'werkvertrag',
'108'=>'studentischehilfskr',
'109'=>'ueberlassungsvertrag',
'110'=>'echterfreier',
'111'=>'echterdv' //All-In
);
-85
View File
@@ -1,85 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';
-158
View File
@@ -1,158 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => array('video/3gp', 'video/3gpp'),
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => 'video/mp4',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => 'audio/ogg',
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7zip' => array('application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard',
'srt' => array('text/srt', 'text/plain'),
'vtt' => array('text/vtt', 'text/plain'),
'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon')
);
-392
View File
@@ -1,392 +0,0 @@
<?php
// Header menu
if(defined('CIS4') && CIS4) {
$root = APP_ROOT;
} else {
$root = CIS_ROOT;
}
$config['navigation_header'] = array(
'*' => array(
'fhcomplete' => array(
'link' => site_url(''),
'icon' => '',
'description' => 'FH-Complete',
'sort' => 10
),
'Organisation' => array(
'link' => '#',
'icon' => 'sitemap',
'description' => 'Organisation',
'sort' => 20,
'requiredPermissions' => 'basis/vilesci:r',
'children' => array(
'vilesci' => array(
'link' => base_url('vilesci'),
'icon' => '',
'description' => 'Vilesci',
'expand' => true,
'sort' => 10,
'requiredPermissions' => 'basis/vilesci:r'
),
'oehbeitragsverwaltung' => array(
'link' => site_url('codex/Oehbeitrag'),
'icon' => '',
'description' => 'ÖH-Beitragsverwaltung',
'expand' => true,
'sort' => 20,
'requiredPermissions' => 'admin:w'
),
'bismeldestichtagsverwaltung' => array(
'link' => site_url('codex/Bismeldestichtag'),
'icon' => '',
'description' => 'BIS-Meldestichtagsverwaltung',
'expand' => true,
'sort' => 30,
'requiredPermissions' => 'admin:w'
)
)
),
'Lehre' => array(
'link' => '#',
'icon' => 'graduation-cap',
'description' => 'Lehre',
'sort' => 30,
'requiredPermissions' => 'basis/vilesci:r',
'children' => array(
'cis' => array(
'link' => $root,
'icon' => '',
'description' => 'CIS',
'sort' => 10
),
'lehrveranstaltungen' => array(
'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'),
'icon' => '',
'description' => 'Lehrveranstaltungen Templates',
'sort' => 15
),
'reihungstest' => array(
'link' => site_url('organisation/Reihungstest'),
'description' => 'Reihungstests',
'expand' => true,
'sort' => 20,
'requiredPermissions' => 'infocenter:r'
),
'infocenter' => array(
'link' => site_url('system/infocenter/InfoCenter'),
'description' => 'Infocenter',
'expand' => true,
'sort' => 30,
'requiredPermissions' => 'infocenter:r'
),
'lvverwaltung' => array(
'link' => site_url('LVVerwaltung'),
'icon' => '',
'description' => 'LV Verwaltung',
'requiredPermissions' => array(
'admin:r',
'assistenz:r'
),
'sort' => 35
),
'lehrauftrag' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Lehrauftrag',
'expand' => true,
'sort' => 40,
'requiredPermissions' => array(
'lehre/lehrauftrag_bestellen:r',
'lehre/lehrauftrag_erteilen:r'
)
),
'zverfueg' => array(
'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'),
'description' => 'Zeitverfügbarkeit',
'expand' => true,
'sort' => 45,
'requiredPermissions' => array(
'lehre/zeitverfuegbarkeit:rw',
'lehre/zeitverfuegbarkeit:rw'
)
),
'zgvueberpruefung' => array(
'link' => site_url('system/infocenter/ZGVUeberpruefung'),
'description' => 'ZGV Überprüfung',
'expand' => true,
'sort' => 50,
'requiredPermissions' => array(
'lehre/zgvpruefung:r'
)
)
)
),
'Personen' => array(
'link' => '#',
'icon' => 'user',
'description' => 'Personen',
'sort' => 40,
'requiredPermissions' => 'basis/vilesci:r',
'children' => array(
'messages' => array(
'link' => site_url('system/messages/MessageClient/read'),
'icon' => '',
'target' => '_blank',
'description' => 'Messages',
'sort' => 10,
),
'bpk' => array(
'link' => site_url('person/BPKWartung'),
'icon' => '',
'description' => 'BPK Wartung',
'sort' => 20,
'requiredPermissions' => 'admin:r'
),
'errormonitoring' => array(
'link' => site_url('system/issues/Issues'),
'description' => 'Fehler Monitoring',
'expand' => true,
'sort' => 30,
'requiredPermissions' => 'system/issues_verwalten:r'
),
'plausichecks' => array(
'link' => site_url('system/issues/Plausichecks'),
'description' => 'Plausichecks',
'expand' => true,
'sort' => 40,
'requiredPermissions' => 'system/issues_verwalten:r'
),
'gruppenmanagement' => array(
'link' => site_url('person/Gruppenmanagement'),
'description' => 'Gruppenmanagement',
'expand' => true,
'sort' => 50,
'requiredPermissions' => 'lehre/gruppenmanager:r'
),
'vertragsverwaltung' => array(
'link' => site_url('vertragsverwaltung'),
'description' => 'Vertragsverwaltung',
'expand' => true,
'sort' => 51,
'requiredPermissions' => 'vertrag/mitarbeiter:r'
)
)
),
'Administration' => array(
'link' => '#',
'icon' => 'gear',
'description' => 'Administration',
'expand' => false,
'sort' => 50,
'requiredPermissions' => 'admin:r',
'children' => array(
'extensions' => array(
'link' => site_url('system/extensions/Manager'),
'description' => 'Extensions Manager',
'expand' => true,
'sort' => 10,
'requiredPermissions' => 'system/extensions:r'
),
'logsviewer' => array(
'link' => site_url('system/LogsViewer'),
'description' => 'Logs',
'expand' => true,
'sort' => 20,
'requiredPermissions' => 'system/developer:r'
),
'jobsqueueviewer' => array(
'link' => site_url('system/jq/JobsQueueViewer'),
'description' => 'Jobs Queue Viewer',
'expand' => true,
'sort' => 30,
'requiredPermissions' => 'system/developer:r'
),
'phrasesviewer' => array(
'link' => site_url('system/phrases/PhrasesViewer'),
'description' => 'Phrases viewer',
'expand' => true,
'sort' => 40,
'requiredPermissions' => 'system/developer:r'
),
'anrechnungen' => array(
'link' => site_url('lehre/anrechnung/AdminAnrechnung'),
'description' => 'Anrechnungen',
'expand' => true,
'sort' => 30,
'requiredPermissions' => 'lehre/anrechnungszeitfenster:rw'
),
'dashboardadmin' => array(
'link' => site_url('dashboard/Admin'),
'description' => 'Dashboard Admin',
'expand' => true,
'sort' => 40,
'requiredPermissions' => 'dashboard/admin:r'
)
)
)
)
);
// --------------------------------------------------------------------------------------------------------------------
// Left side menu
$config['navigation_menu'] = array();
$config['navigation_menu']['Vilesci/index'] = array(
'dashboard' => array(
'link' => '#',
'description' => 'Dashboard',
'icon' => 'dashboard',
'sort' => 1
)
);
$config['navigation_menu']['Vilesci/index'] = array(
'dashboard' => array(
'link' => '#',
'description' => 'Dashboard',
'icon' => 'dashboard',
'sort' => 1
)
);
$config['navigation_menu']['organisation/Reihungstest/index'] = array(
'reihungstestverwalung' => array(
'link' => base_url('vilesci/stammdaten/reihungstestverwaltung.php'),
'description' => 'Reihungstestverwaltung',
'icon' => 'cogs',
'sort' => 1,
'target' => '_blank'
),
'auswertung' => array(
'link' => $root.'/cis/testtool/admin/auswertung.php',
'description' => 'Auswertung',
'icon' => 'list-alt',
'sort' => 1,
'target' => '_blank'
)
);
$config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array(
'lehrauftragDashboard' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Dashboard',
'icon' => 'dashboard',
'sort' => 1,
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r')
),
'lehrauftragBestellen' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag'),
'description' => 'Lehrauftrag bestellen',
'icon' => '',
'sort' => 1,
'requiredPermissions' => 'lehre/lehrauftrag_bestellen:r'
),
'lehrauftragErteilen' => array(
'link' => site_url('lehre/lehrauftrag/LehrauftragErteilen'),
'description' => 'Lehrauftrag erteilen',
'icon' => '',
'sort' => 1,
'requiredPermissions' => 'lehre/lehrauftrag_erteilen:r'
),
'lehrauftragLehrendeÜbersicht' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/LehrendeUebersicht'),
'description' => 'Lehrendenübersicht',
'icon' => '',
'sort' => 1,
'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r')
)
);
$config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array(
'lehrauftragDashboard' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Dashboard',
'icon' => 'dashboard',
'sort' => 1,
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r')
),
'lehrauftragBestellen' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag'),
'description' => 'Lehrauftrag bestellen',
'icon' => '',
'sort' => 1,
'requiredPermissions' => 'lehre/lehrauftrag_bestellen:r'
),
'lehrauftragErteilen' => array(
'link' => site_url('lehre/lehrauftrag/LehrauftragErteilen'),
'description' => 'Lehrauftrag erteilen',
'icon' => '',
'sort' => 1,
'requiredPermissions' => 'lehre/lehrauftrag_erteilen:r'
),
'lehrauftragLehrendeÜbersicht' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/LehrendeUebersicht'),
'description' => 'Lehrendenübersicht',
'icon' => '',
'sort' => 1,
'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r')
)
);
$config['navigation_menu']['lehre/lvplanung/LvTemplateUebersicht/index'] = array(
'lvTemplateUebersicht' => array(
'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'),
'description' => 'LV Template Übersicht',
'icon' => '',
'sort' => 1
)
);
$config['navigation_menu']['system/issues/Issues/*'] = array(
'fehlerzustaendigkeiten' => array(
'link' => site_url('system/issues/IssuesZustaendigkeiten'),
'description' => 'Fehler Zuständigkeiten',
'icon' => 'users',
'sort' => 100,
'target' => '_blank',
'requiredPermissions' => array('admin:rw')
),
'fehlerkonfiguration' => array(
'link' => site_url('system/issues/IssuesKonfiguration'),
'description' => 'Fehler Konfiguration',
'icon' => 'cogs',
'sort' => 200,
'target' => '_blank',
'requiredPermissions' => array('admin:rw')
),
);
$config['navigation_menu']['vertragsverwaltung/*'] = array(
'vertragsverwaltung' => array(
'link' => site_url('vertragsverwaltung'),
'description' => 'Vertragsverwaltung',
'icon' => 'home',
'sort' => 100,
'target' => '_blank',
'requiredPermissions' => array('vertrag/mitarbeiter:r')
)
);
$config['navigation_menu']['apps'] = [
'stv' => [
'link' => site_url('studentenverwaltung'),
'description' => 'Studierendenverwaltung',
#'icon' => 'users',
'requiredPermissions' => array('admin:r', 'assistenz:r')
],
'lvv' => [
'link' => site_url('lVVerwaltung'),
'description' => 'LV Verwaltung',
#'icon' => 'person-chalkboard',
'requiredPermissions' => array('admin:r', 'assistenz:r')
],
'lav' => [
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Lehraufträge',
#'icon' => 'person-chalkboard',
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
]
];
-15
View File
@@ -1,15 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
// List of permissions that are allowed to perform loginAs (empty array to avoid any checks)
$config['permission_loginas_allowed'] = array('admin');
// List of permissions that cannot be gained with loginAs (empty array to avoid any checks)
$config['permission_loginas_blacklist'] = array('admin');
// List of users whose identity cannot be obtained with loginAs
$config['permission_loginas_users_blacklist'] = array('_DummyLektor', '_DummyStudent');
// List of person ids whose identity cannot be obtained with loginAs
$config['permission_loginas_personids_blacklist'] = array(92);
-14
View File
@@ -1,14 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/profiling.html
|
*/
-25
View File
@@ -1,25 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// liste von raumtyp_kurzbz welche in raumsuche studenten angezeigt werden
$config['roomtypes_student'] = array(
'LAB BM/Chem',
'xEDV 1-36',
'xEDV 37-60',
'EDV 60',
'EDV-HÖPL',
'EDV ES',
'LAB Elek',
'LAB ES/TK',
'Ener-EDV',
'Ener-Lab',
'Ener-SEM',
'Ener-HS',
'HS 59-109',
'HS 25-38',
'HS 39-58',
'LAB Inf',
'LAB Robo',
'LAB SET'
);
-166
View File
@@ -1,166 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| HTTP protocol
|--------------------------------------------------------------------------
|
| Set to force the use of HTTPS for REST API calls
|
*/
$config['force_https'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST Realm
|--------------------------------------------------------------------------
|
| Name of the password protected REST API displayed on login dialogs
|
| e.g: My Secret REST API
|
*/
$config['rest_realm'] = 'FHC REST API';
/*
|--------------------------------------------------------------------------
| REST Login
|--------------------------------------------------------------------------
|
| Set to specify the REST API requires to be logged in
|
| FALSE No login required
| 'basic' Unsecured login
| 'digest' More secured login
| 'session' Check for a PHP session variable. See 'auth_source' to set the
| authorization key
|
*/
$config['rest_auth'] = 'basic';
/*
|--------------------------------------------------------------------------
| REST Login Source
|--------------------------------------------------------------------------
|
| Is login required and if so, the user store to use
|
| '' Use config based users or wildcard testing
| 'ldap' Use LDAP authentication
| 'library' Use a authentication library
|
| Note: If 'rest_auth' is set to 'session' then change 'auth_source' to the name of the session variable
|
*/
$config['auth_source'] = 'library';
/*
|--------------------------------------------------------------------------
| REST Login Class and Function
|--------------------------------------------------------------------------
|
| If library authentication is used define the class and function name
|
| The function should accept two parameters: class->function($username, $password)
| In other cases override the function _perform_library_auth in your controller
|
| For digest authentication the library function should return already a stored
| md5(username:restrealm:password) for that username
|
| e.g: md5('admin:REST API:1234') = '1e957ebc35631ab22d5bd6526bd14ea2'
|
*/
$config['auth_library_class'] = 'AuthLib';
$config['auth_library_function'] = 'basicAuthentication';
/*
|--------------------------------------------------------------------------
| Global IP White-listing
|--------------------------------------------------------------------------
|
| Limit connections to your REST server to White-listed IP addresses
|
| Usage:
| 1. Set to TRUE and select an auth option for extreme security (client's IP
| address must be in white-list and they must also log in)
| 2. Set to TRUE with auth set to FALSE to allow White-listed IPs access with no login
| 3. Set to FALSE but set 'auth_override_class_method' to 'white-list' to
| restrict certain methods to IPs in your white-list
|
*/
$config['rest_ip_whitelist_enabled'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST IP White-list
|--------------------------------------------------------------------------
|
| Limit connections to your REST server with a comma separated
| list of IP addresses
|
| e.g: '123.456.789.0, 987.654.32.1'
|
| 127.0.0.1 and 0.0.0.0 are allowed by default
|
*/
$config['rest_ip_whitelist'] = '127.0.0.1';
/*
|--------------------------------------------------------------------------
| REST API Keys Table Name
|--------------------------------------------------------------------------
|
| The table name in your database that stores API keys
|
*/
$config['rest_keys_table'] = 'ci_apikey';
/*
|--------------------------------------------------------------------------
| REST Enable Keys
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API will look for a column name called 'key'.
| If no key is provided, the request will result in an error. To override the
| column name see 'rest_key_column'
|
| Default table schema:
| CREATE TABLE `keys` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `user_id` INT(11) NOT NULL,
| `key` VARCHAR(40) NOT NULL,
| `level` INT(2) NOT NULL,
| `ignore_limits` TINYINT(1) NOT NULL DEFAULT '0',
| `is_private_key` TINYINT(1) NOT NULL DEFAULT '0',
| `ip_addresses` TEXT NULL DEFAULT NULL,
| `date_created` INT(11) NOT NULL,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
*/
$config['rest_enable_keys'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST API Key Variable
|--------------------------------------------------------------------------
|
| Custom header to specify the API key
| Note: Custom headers with the X- prefix are deprecated as of
| 2012/06/12. See RFC 6648 specification for more details
|
*/
$config['rest_key_name'] = 'FHC-API-KEY';
/*
|--------------------------------------------------------------------------
| REST Methods name format
|--------------------------------------------------------------------------
|
| REST Controllers methods name format
|
*/
$config['rest_methods_name_format'] = '%2$s%1$s';
-148
View File
@@ -1,148 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = defined('CIS4') && CIS4 ? 'Cis4' : 'Vilesci';
$route['translate_uri_dashes'] = false;
// Class name conflicts
$route['api/v1/organisation/[S|s]tudiengang/(:any)'] = 'api/v1/organisation/studiengang2/$1';
$route['api/v1/organisation/[F|f]achbereich/(:any)'] = 'api/v1/organisation/fachbereich2/$1';
$route['api/v1/organisation/[G|g]eschaeftsjahr/(:any)'] = 'api/v1/organisation/geschaeftsjahr2/$1';
$route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisation/organisationseinheit2/$1';
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
$route['Abgabetool/Assistenz'] = 'Cis/Abgabetool/Assistenz';
$route['Abgabetool/Assistenz/(:any)'] = 'Cis/Abgabetool/Assistenz/$1';
$route['Abgabetool/Mitarbeiter'] = 'Cis/Abgabetool/Mitarbeiter';
$route['Abgabetool/Student'] = 'Cis/Abgabetool/Student';
$route['Abgabetool/Student/(:any)'] = 'Cis/Abgabetool/Student/$1';
$route['Abgabetool/Deadlines'] = 'Cis/Abgabetool/Deadlines';
// Studierendenverwaltung List Routes
$route['api/frontend/v1/stv/[sS]tudents/inout'] = 'api/frontend/v1/stv/Students/index';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/index';
// (studiensemester_kurzbz)/inout[/(incoming|outgoing|gemeinsamestudien)]
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout'] = 'api/frontend/v1/stv/Students/index';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/incoming'] = 'api/frontend/v1/stv/Students/getIncoming/$1';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/outgoing'] = 'api/frontend/v1/stv/Students/getOutgoing/$1';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/gemeinsamestudien'] = 'api/frontend/v1/stv/Students/getGemeinsamestudien/$1';
// (studiengang_kz)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]]
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudents/$1';
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2';
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$3';
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$4';
// (studiengang_kz)/(orgform)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]]
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2';
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3';
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$4';
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$5';
// (studiensemester_kurzbz)/(studiengang_kz)/(semester)/grp/(gruppe)
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsSpezialgruppe/$1/$2/$3/$4';
// (studiensemester_kurzbz)/(studiengang_kz)[/(semester)[/(verband)[/(gruppe)]]]
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/(:any)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3/$4';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3/$4/$5';
// (studiensemester_kurzbz)/(studiengang_kz)/(orgform)/(semester)/grp/(gruppe)
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgformSpezialgruppe/$1/$2/$3/$4/$5';
// (studiensemester_kurzbz)/(studiengang_kz)/(orgform)[/(semester)[/(verband)[/(gruppe)]]]
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4/$5';
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4/$5/$6';
// // (studiensemester_kurzbz)/uid/(uid)
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/uid/(:any)'] = 'api/frontend/v1/stv/Students/getStudent/$1/$2';
// // (studiensemester_kurzbz)/prestudent/(prestudent_id)
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/prestudent/(:num)'] = 'api/frontend/v1/stv/Students/getPrestudent/$1/$2';
// // (studiensemester_kurzbz)/person/(person_id)
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/person/(:num)'] = 'api/frontend/v1/stv/Students/getPerson/$1/$2';
// load routes from extensions, also look for environment-specific configs
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
foreach($subdirs as $subdir)
{
if(is_dir($subdir))
{
$dirlist = scandir($subdir);
if ($dirlist)
{
$files = array_diff($dirlist, array('.','..'));
foreach ($files as &$item)
{
if (is_dir($subdir . DIRECTORY_SEPARATOR . $item))
{
$routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php';
if (file_exists($routes_file))
{
require($routes_file);
}
}
}
}
}
}
-874
View File
@@ -1,874 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$config['person'] = [
'primarykey' => 'person_id',
'table' => 'public.tbl_person',
'searchfields' => [
'uid' => [
'comparison' => 'equals',
'field' => 'uid',
'join' => [
'table' => "public.tbl_benutzer",
'using' => "person_id"
],
'1-n' => true
],
'vorname' => [
'alias' => ['firstname'],
'comparison' => 'similar',
'field' => 'vorname'
],
'nachname' => [
'alias' => ['lastname', 'surename'],
'comparison' => 'similar',
'field' => 'nachname'
],
'name' => [
'comparison' => 'similar',
'field' => "(vorname || ' ' || nachname)"
],
'email' => [
'comparison' => 'similar',
'field' => 'kontakt',
'join' => [
'table' => "public.tbl_kontakt",
'on' => "kontakttyp = 'email' AND tbl_kontakt.person_id = tbl_person.person_id"
],
"1-n" => true
],
'tel' => [
'alias' => ['phone', 'telefon'],
'comparison' => 'similar',
'field' => 'kontakt',
'join' => [
'table' => "public.tbl_kontakt",
'on' => "kontakttyp IN ('telefon', 'so.tel', 'mobil') AND tbl_kontakt.person_id = tbl_person.person_id"
],
"1-n" => true
],
'preid' => [
'alias' => ['prestudent_id'],
'comparison' => 'equal-int',
'field' => 'prestudent_id',
'join' => [
'table' => "public.tbl_prestudent",
'using' => "person_id"
],
'1-n' => true
],
'pid' => [
'alias' => ['person_id'],
'comparison' => 'equal-int',
'field' => 'person_id'
]
],
'resultfields' => [
"ARRAY( SELECT uid FROM public.tbl_benutzer WHERE person_id = p.person_id ) AS uids",
"p.person_id",
"(p.vorname || ' ' || p.nachname) AS name",
"ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"CASE
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url"
],
'resultjoin' => "
JOIN public.tbl_person p USING (person_id)"
];
$config['student'] = [
'primarykey' => 'student_uid',
'table' => 'public.tbl_student',
'searchfields' => [
'uid' => [
'comparison' => 'equals',
'field' => 'student_uid'
],
'vorname' => [
'alias' => ['firstname'],
'comparison' => 'similar',
'field' => 'vorname',
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'nachname' => [
'alias' => ['lastname', 'surename'],
'comparison' => 'similar',
'field' => 'nachname',
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'name' => [
'comparison' => 'similar',
'field' => "(vorname || ' ' || nachname)",
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'email' => [
'comparison' => 'similar',
'field' => 'kontakt',
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_kontakt",
'on' => "kontakttyp = 'email' AND tbl_kontakt.person_id = tbl_prestudent.person_id"
]
],
"1-n" => true
],
'tel' => [
'alias' => ['phone', 'telefon'],
'comparison' => 'similar',
'field' => 'kontakt',
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_kontakt",
'on' => "kontakttyp IN ('telefon', 'so.tel', 'mobil') AND tbl_kontakt.person_id = tbl_prestudent.person_id"
]
],
"1-n" => true
],
'stg' => [
'alias' => ['studiengang'],
'comparison' => 'equals',
'field' => "typ || kurzbz",
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_studiengang",
'on' => "tbl_studiengang.studiengang_kz = tbl_prestudent.studiengang_kz"
]
]
],
'preid' => [
'alias' => ['prestudent_id'],
'comparison' => 'equal-int',
'field' => 'prestudent_id'
],
'pid' => [
'alias' => ['person_id'],
'comparison' => 'equal-int',
'field' => 'person_id',
'join' => [
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
]
]
],
'resultfields' => [
"s.student_uid AS uid",
"s.matrikelnr",
"p.person_id",
"(p.vorname || ' ' || p.nachname) AS name",
"(s.student_uid || '@" . DOMAIN . "') || ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"CASE
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url",
"b.aktiv"
],
'resultjoin' => "
JOIN public.tbl_student s USING (student_uid)
JOIN public.tbl_benutzer b ON(b.uid = s.student_uid)
JOIN public.tbl_person p USING(person_id)"
];
$prestudent_sort = [
"Student",
"Incoming",
"Outgoing",
"Diplomand",
"Unterbrecher",
"Aufgenommener",
"Wartender",
"Bewerber",
"Interessent",
"Abgewiesener",
"Absolvent",
"Abbrecher",
"Ausserordentlicher",
"Praktikant"
];
$prestudent_sort_array = "array['" . implode("','", $prestudent_sort) . "']";
$config['prestudent'] = [
'primarykey' => 'prestudent_id',
'table' => 'public.tbl_prestudent',
'searchfields' => [
'uid' => [
'comparison' => 'equals',
'field' => 'student_uid',
'join' => [
'table' => "public.tbl_student",
'using' => "prestudent_id"
]
],
'vorname' => [
'alias' => ['firstname'],
'comparison' => 'similar',
'field' => 'vorname',
'join' => [
'table' => "public.tbl_person",
'using' => "person_id"
]
],
'nachname' => [
'alias' => ['lastname', 'surename'],
'comparison' => 'similar',
'field' => 'nachname',
'join' => [
'table' => "public.tbl_person",
'using' => "person_id"
]
],
'name' => [
'comparison' => 'similar',
'field' => "(vorname || ' ' || nachname)",
'join' => [
'table' => "public.tbl_person",
'using' => "person_id"
]
],
'email' => [
'comparison' => 'similar',
'field' => 'kontakt',
'join' => [
'table' => "public.tbl_kontakt",
'on' => "kontakttyp = 'email' AND tbl_kontakt.person_id = tbl_prestudent.person_id"
],
"1-n" => true
],
'tel' => [
'alias' => ['phone', 'telefon'],
'comparison' => 'similar',
'field' => 'kontakt',
'join' => [
'table' => "public.tbl_kontakt",
'on' => "kontakttyp IN ('telefon', 'so.tel', 'mobil') AND tbl_kontakt.person_id = tbl_prestudent.person_id"
],
"1-n" => true
],
'stg' => [
'alias' => ['studiengang'],
'comparison' => 'equals',
'field' => "typ || kurzbz",
'join' => [
'table' => "public.tbl_studiengang",
'using' => "studiengang_kz"
]
],
'preid' => [
'alias' => ['prestudent_id'],
'comparison' => 'equal-int',
'field' => 'prestudent_id'
],
'pid' => [
'alias' => ['person_id'],
'comparison' => 'equal-int',
'field' => 'person_id',
'join' => [
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'resultfields' => [
"ps.prestudent_id",
"ps.studiengang_kz",
"s.matrikelnr",
"p.person_id",
"b.uid",
"(p.vorname || ' ' || p.nachname) AS name",
"(b.uid || '@" . DOMAIN . "') || ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"CASE
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url",
"UPPER(sg.typ || sg.kurzbz) AS stg_kuerzel",
"sg.bezeichnung",
"(
SELECT bezeichnung_mehrsprachig[(TABLE lang)]
FROM public.tbl_status
WHERE status_kurzbz = public.get_rolle_prestudent(ps.prestudent_id, NULL)
LIMIT 1
) AS status",
"COALESCE(
(
SELECT COALESCE(plan.orgform_kurzbz, pss.orgform_kurzbz)
FROM public.tbl_prestudentstatus pss
LEFT JOIN lehre.tbl_studienplan plan USING (studienplan_id)
WHERE pss.prestudent_id=ps.prestudent_id
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
LIMIT 1
),
sg.orgform_kurzbz
) AS orgform",
"b.aktiv",
"array_position(" . $prestudent_sort_array . ", public.get_rolle_prestudent(ps.prestudent_id, NULL)) AS sort"
],
'resultjoin' => "
LEFT JOIN public.tbl_prestudent ps USING (prestudent_id)
LEFT JOIN public.tbl_student s ON (ps.prestudent_id = s.prestudent_id)
LEFT JOIN public.tbl_benutzer b ON (b.uid = s.student_uid)
JOIN public.tbl_person p ON (p.person_id = ps.person_id)
LEFT JOIN public.tbl_studiengang sg ON (sg.studiengang_kz = ps.studiengang_kz)"
];
$config['employee'] = [
'alias' => ['ma', 'mitarbeiter'],
'primarykey' => 'mitarbeiter_uid',
'table' => 'public.tbl_mitarbeiter',
'searchfields' => [
'uid' => [
'alias' => ['mitarbeiter_uid'],
'comparison' => 'equals',
'field' => "mitarbeiter_uid"
],
'vorname' => [
'alias' => ['firstname'],
'comparison' => 'similar',
'field' => "vorname",
'join' => [
[
'table' => "public.tbl_benutzer",
'on' => "uid = mitarbeiter_uid"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'nachname' => [
'alias' => ['lastname', 'surename'],
'comparison' => 'similar',
'field' => "nachname",
'join' => [
[
'table' => "public.tbl_benutzer",
'on' => "uid = mitarbeiter_uid"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'name' => [
'comparison' => 'similar',
'field' => "(vorname || ' ' || nachname)",
'join' => [
[
'table' => "public.tbl_benutzer",
'on' => "uid = mitarbeiter_uid"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
],
'email' => [
'comparison' => 'similar',
'field' => "COALESCE(alias, uid) || '" . '@' . DOMAIN . "'",
'join' => [
'table' => "public.tbl_benutzer",
'on' => "uid = mitarbeiter_uid"
]
],
'tel' => [
'alias' => ['phone', 'telefon'],
'comparison' => 'similar',
'field' => "TRIM(COALESCE(kontakt, '') || ' ' || COALESCE(telefonklappe, ''))",
'join' => [
'table' => "public.tbl_kontakt",
'on' => "kontakttyp = 'telefon' AND tbl_kontakt.standort_id = tbl_mitarbeiter.standort_id"
],
"1-n" => true
],
'pid' => [
'alias' => ['person_id'],
'comparison' => 'equal-int',
'field' => "person_id",
'join' => [
'table' => "public.tbl_benutzer",
'on' => "uid = mitarbeiter_uid"
]
],
'oe' => [
'alias' => ['ou', 'organisationseinheit', 'organisationunit'],
'comparison' => 'vector',
'field' => "fts_bezeichnung",
'join' => [
[
'table' => "public.tbl_benutzerfunktion",
'on' => "mitarbeiter_uid = uid
AND funktion_kurzbz = 'oezuordnung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())"
],
[
'table' => "public.tbl_organisationseinheit",
'using' => "oe_kurzbz"
]
],
'1-n' => true
],
'kst' => [
'comparison' => 'vector',
'field' => "fts_bezeichnung",
'join' => [
[
'table' => "public.tbl_benutzerfunktion",
'on' => "mitarbeiter_uid = uid
AND funktion_kurzbz = 'kstzuordnung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())"
],
[
'table' => "public.tbl_organisationseinheit",
'using' => "oe_kurzbz"
]
],
'1-n' => true
]
],
'resultfields' => [
"b.uid",
"p.person_id",
"(p.vorname || ' ' || p.nachname) AS name",
"ARRAY(
SELECT
'[' || ot.bezeichnung || '] ' || o.bezeichnung AS bezeichnung
FROM public.tbl_benutzerfunktion bf
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
JOIN public.tbl_organisationseinheittyp ot USING(organisationseinheittyp_kurzbz)
WHERE bf.funktion_kurzbz = 'oezuordnung'
AND (bf.datum_von IS NULL OR bf.datum_von <= NOW())
AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW())
AND bf.uid = b.uid
GROUP BY o.bezeichnung, ot.bezeichnung
) AS organisationunit_name",
"COALESCE(b.alias, b.uid) || '" . '@' . DOMAIN . "' AS email",
"TRIM(COALESCE(k.kontakt, '') || ' ' || COALESCE(m.telefonklappe, '')) AS phone",
"'" . base_url("/cis/public/bild.php?src=person&person_id=") . "' || p.person_id AS photo_url",
"ARRAY(
SELECT
'[' || ot.bezeichnung || '] ' || o.bezeichnung AS bezeichnung
FROM public.tbl_benutzerfunktion bf
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
JOIN public.tbl_organisationseinheittyp ot USING(organisationseinheittyp_kurzbz)
WHERE bf.funktion_kurzbz = 'kstzuordnung'
AND (bf.datum_von IS NULL OR bf.datum_von <= NOW())
AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW())
AND bf.uid = b.uid
GROUP BY o.bezeichnung, ot.bezeichnung
) AS standardkostenstelle"
],
'resultjoin' => "
JOIN public.tbl_mitarbeiter m USING (mitarbeiter_uid)
JOIN public.tbl_benutzer b ON (b.uid = m.mitarbeiter_uid)
JOIN public.tbl_person p USING(person_id)
LEFT JOIN (
SELECT kontakt, standort_id
FROM public.tbl_kontakt
WHERE kontakttyp = 'telefon'
) k ON (k.standort_id = m.standort_id)"
];
// TODO(chris): move to searchpv21.php
$config['unassigned_employee'] = $config['employee'];
$config['unassigned_employee']['alias'] = ['mitarbeiter_ohne_zuordnung'];
$config['unassigned_employee']['prepare'] = "unassigned_employee AS (
SELECT tbl_mitarbeiter.*
FROM public.tbl_mitarbeiter
LEFT JOIN public.tbl_benutzerfunktion ON (
uid = mitarbeiter_uid
AND funktion_kurzbz = 'kstzuordnung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
)
WHERE tbl_benutzerfunktion.bezeichnung IS NULL
UNION
SELECT tbl_mitarbeiter.*
FROM public.tbl_mitarbeiter
LEFT JOIN public.tbl_benutzerfunktion ON (
uid = mitarbeiter_uid
AND funktion_kurzbz = 'oezuordnung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
)
WHERE tbl_benutzerfunktion.bezeichnung IS NULL
)";
$config['unassigned_employee']['table'] = "unassigned_employee";
$config['unassigned_employee']['searchfields']['tel']['join']['on'] = "
kontakttyp = 'telefon'
AND tbl_kontakt.standort_id = unassigned_employee.standort_id
";
$config['unassigned_employee']['renderer'] = 'employee';
$config['organisationunit'] = [
'alias' => ['ou', 'organisationseinheit', 'oe'],
'primarykey' => 'oe_kurzbz',
'table' => 'public.tbl_organisationseinheit',
'searchfields' => [
'uid' => [
'comparison' => 'equals',
'field' => 'uid',
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
SELECT oe_kurzbz, vorname, nachname, uid
FROM public.tbl_benutzerfunktion
JOIN public.tbl_benutzer USING (uid)
JOIN public.tbl_person USING (person_id)
WHERE funktion_kurzbz = 'Leitung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
AND tbl_benutzer.aktiv = TRUE
)",
'join' => [
'table' => "organisationunit_leader",
'using' => "oe_kurzbz"
],
'1-n' => true
],
'vorname' => [
'alias' => ['firstname'],
'comparison' => 'similar',
'field' => 'vorname',
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
SELECT oe_kurzbz, vorname, nachname, uid
FROM public.tbl_benutzerfunktion
JOIN public.tbl_benutzer USING (uid)
JOIN public.tbl_person USING (person_id)
WHERE funktion_kurzbz = 'Leitung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
AND tbl_benutzer.aktiv = TRUE
)",
'join' => [
'table' => "organisationunit_leader",
'using' => "oe_kurzbz"
],
'1-n' => true
],
'nachname' => [
'alias' => ['lastname', 'surename'],
'comparison' => 'similar',
'field' => 'nachname',
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
SELECT oe_kurzbz, vorname, nachname, uid
FROM public.tbl_benutzerfunktion
JOIN public.tbl_benutzer USING (uid)
JOIN public.tbl_person USING (person_id)
WHERE funktion_kurzbz = 'Leitung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
AND tbl_benutzer.aktiv = TRUE
)",
'join' => [
'table' => "organisationunit_leader",
'using' => "oe_kurzbz"
],
'1-n' => true
],
'name' => [
'comparison' => 'similar',
'field' => "(vorname || ' ' || nachname)",
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
SELECT oe_kurzbz, vorname, nachname, uid
FROM public.tbl_benutzerfunktion
JOIN public.tbl_benutzer USING (uid)
JOIN public.tbl_person USING (person_id)
WHERE funktion_kurzbz = 'Leitung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
AND tbl_benutzer.aktiv = TRUE
)",
'join' => [
'table' => "organisationunit_leader",
'using' => "oe_kurzbz"
],
'1-n' => true
],
'oe' => [
'alias' => ['ou', 'organisationseinheit', 'organisationunit'],
'comparison' => 'vector',
'field' => "fts_bezeichnung"
],
'kurzbz' => [
'alias' => ['oe_kurzbz'],
'comparison' => 'equals',
'field' => "oe_kurzbz"
]
],
'resultfields' => [
"oe.oe_kurzbz",
"('[' || type.bezeichnung || '] ' || oe.bezeichnung) AS name",
"oe_parent.oe_kurzbz AS parentoe_kurzbz",
"(CASE WHEN oe_parent.bezeichnung IS NOT NULL THEN '[' || type_parent.bezeichnung || '] ' || oe_parent.bezeichnung END) AS parentoe_name",
"ARRAY(
SELECT JSON_BUILD_OBJECT('uid', b.uid, 'vorname', p.vorname, 'nachname', p.nachname, 'name', (p.vorname || ' ' || p.nachname))
FROM public.tbl_benutzerfunktion bf
JOIN public.tbl_benutzer b USING (uid)
JOIN public.tbl_person p USING (person_id)
WHERE funktion_kurzbz = 'Leitung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
AND b.aktiv = TRUE
AND oe_kurzbz = oe.oe_kurzbz
) AS leaders",
"(
SELECT COUNT(*)
FROM public.tbl_benutzerfunktion
WHERE funktion_kurzbz = 'oezuordnung'
AND (datum_von IS NULL OR datum_von <= NOW())
AND (datum_bis IS NULL OR datum_bis >= NOW())
AND oe_kurzbz = oe.oe_kurzbz
) AS number_of_people",
"(CASE WHEN oe.mailverteiler THEN oe.oe_kurzbz || '" . '@' . DOMAIN . "' END) AS mailgroup"
],
'resultjoin' => "
JOIN public.tbl_organisationseinheit oe
USING (oe_kurzbz)
JOIN public.tbl_organisationseinheittyp type
USING (organisationseinheittyp_kurzbz)
LEFT JOIN public.tbl_organisationseinheit oe_parent
ON (oe_parent.oe_kurzbz = oe.oe_parent_kurzbz)
LEFT JOIN public.tbl_organisationseinheittyp type_parent
ON (oe_parent.organisationseinheittyp_kurzbz = type_parent.organisationseinheittyp_kurzbz)"
];
$config['room'] = [
'alias' => ['raum'],
'primarykey' => 'ort_kurzbz',
'table' => 'public.tbl_ort',
'searchfields' => [
'name' => [
'comparison' => 'similar',
'field' => 'ort_kurzbz'
]
],
'resultfields' => [
"ort.ort_kurzbz",
"ort.gebteil AS building",
"ort.ausstattung AS equipment",
"ort.stockwerk AS floor",
"ort.dislozierung AS room_number",
"ort.content_id",
"address.ort AS city",
"address.plz AS zip",
"address.strasse AS street",
"ort.max_person",
"ort.arbeitsplaetze AS workplaces"
],
'resultjoin' => "
JOIN public.tbl_ort ort
USING (ort_kurzbz)
LEFT JOIN public.tbl_standort
USING (standort_id)
LEFT JOIN public.tbl_adresse address
USING (adresse_id)"
];
$sprache = getUserLanguage();
$config['cms'] = [
'primarykey' => 'contentsprache_id',
'table' => 'campus.tbl_contentsprache',
'prepare' => "
cms_auth (content_id) AS (
SELECT content_id
FROM campus.tbl_content c
WHERE NOT EXISTS (SELECT 1 FROM campus.tbl_contentgruppe g WHERE g.content_id=c.content_id)
UNION
SELECT content_id
FROM public.vw_gruppen g
JOIN campus.tbl_contentgruppe c USING (gruppe_kurzbz)
WHERE uid = (TABLE auth)
),
cms_active (content_id, template_kurzbz) AS (
SELECT content_id, template_kurzbz
FROM cms_auth
JOIN campus.tbl_content USING (content_id)
WHERE aktiv = TRUE
),
cms_active_redirect (content_id) AS (
SELECT content_id
FROM cms_active
WHERE template_kurzbz = 'redirect'
),
cms_active_redirect_linked (content_id) AS (
SELECT content_id
FROM cms_active_redirect
JOIN campus.tbl_contentsprache USING (content_id)
WHERE LEFT((xpath('string(/content/url)', content))[1]::text, 1) <> '#'
),
cms_active_others (content_id) AS (
SELECT content_id
FROM cms_active
WHERE template_kurzbz IN ('contentmittitel', 'contentohnetitel', 'contentmittitel_filterwidget')
)
",
'searchfields' => [
'content' => [
'alias' => ['inhalt'],
'comparison' => "vector",
'field' => "(
setweight(to_tsvector('simple', COALESCE(titel, '')), 'A')
||
setweight(to_tsvector('simple', COALESCE(content, '')::text), 'B')
)"
],
'content_id' => [
'alias' => ['id'],
'comparison' => "equal-int",
'field' => "content_id"
],
'lang' => [
'alias' => ['language', 'sprache'],
'comparison' => "equals",
'field' => "sprache"
]
],
'resultfields' => [
"contentsprache.content_id",
"content.template_kurzbz",
"contentsprache.version",
"contentsprache.sprache AS language",
"contentsprache.titel AS title",
"contentsprache.content",
"(xpath('string(/content/url)', contentsprache.content))[1] AS content_url"
],
'resultjoin' => "
JOIN campus.tbl_contentsprache contentsprache
USING (contentsprache_id)
JOIN campus.tbl_content content
USING (content_id)
WHERE content_id IN (
SELECT content_id
FROM cms_active_redirect_linked
UNION
SELECT content_id
FROM cms_active_others
)
AND version = campus.get_highest_content_version(content_id)
AND contentsprache.sprache = '{$sprache}'"
];
$config['dms'] = [
'primarykey' => 'dms_id, version',
'table' => 'campus.tbl_dms_version',
'searchfields' => [
'keywords' => [
'alias' => ['keyword', 'keywords', 'schlagwort', 'schlagworte'],
'comparison' => "vector",
'field' => "(to_tsvector('simple', COALESCE(schlagworte, '')))"
]
],
'resultfields' => [
"v.dms_id",
"v.version",
"v.filename",
"v.mimetype",
"v.name",
"v.beschreibung AS description",
"v.schlagworte AS keywords"
],
'resultjoin' => "
JOIN campus.tbl_dms_version v
USING (dms_id, version)
WHERE cis_suche = TRUE
AND version=(SELECT MAX(version) FROM campus.tbl_dms_version WHERE dms_id=v.dms_id)
AND NOT EXISTS (
SELECT
1
FROM
fue.tbl_projekt_dokument p
WHERE p.dms_id = v.dms_id
) AND (
NOT EXISTS (
WITH RECURSIVE categories (kategorie_kurzbz) AS (
SELECT
kategorie_kurzbz
FROM
campus.tbl_dms c
WHERE c.dms_id = v.dms_id
UNION ALL
SELECT
cat.parent_kategorie_kurzbz AS kategorie_kurzbz
FROM
categories
JOIN campus.tbl_dms_kategorie cat USING (kategorie_kurzbz)
)
SELECT
1
FROM
categories
JOIN campus.tbl_dms_kategorie_gruppe USING (kategorie_kurzbz)
UNION
SELECT
1
FROM
categories
JOIN campus.tbl_dms_kategorie USING (kategorie_kurzbz)
WHERE
berechtigung_kurzbz IS NOT NULL
) OR EXISTS (
WITH RECURSIVE categories (kategorie_kurzbz) AS (
SELECT
kategorie_kurzbz
FROM
campus.tbl_dms c
WHERE c.dms_id = v.dms_id
UNION ALL
SELECT
cat.parent_kategorie_kurzbz AS kategorie_kurzbz
FROM
categories
JOIN campus.tbl_dms_kategorie cat USING (kategorie_kurzbz)
)
SELECT
1
FROM
categories
JOIN campus.tbl_dms_kategorie_gruppe USING (kategorie_kurzbz)
JOIN public.tbl_benutzergruppe USING(gruppe_kurzbz)
WHERE
uid = (TABLE auth)
)
)"
];
-48
View File
@@ -1,48 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$CI =& get_instance();
$config['employee'] = $CI->config->item('employee', 'search');
$config['employee']['resultjoin'] = "
JOIN public.tbl_mitarbeiter m USING (mitarbeiter_uid)
JOIN public.tbl_benutzer b ON (b.uid = m.mitarbeiter_uid AND b.aktiv = true)
JOIN public.tbl_person p USING(person_id)
LEFT JOIN (
SELECT kontakt, standort_id
FROM public.tbl_kontakt
WHERE kontakttyp = 'telefon'
) k ON (k.standort_id = m.standort_id)";
$config['student'] = $CI->config->item('student', 'search');
unset($config['student']['searchfields']['email']);
unset($config['student']['searchfields']['tel']);
$config['student']['resultfields'] = [
"s.student_uid AS uid",
"s.matrikelnr",
"p.person_id",
"(p.vorname || ' ' || p.nachname) AS name",
"ARRAY[s.student_uid || '@' || '" . DOMAIN . "'] AS email",
"CASE
WHEN (p.foto_sperre = false AND p.foto IS NOT NULL) THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url",
"b.aktiv"
];
$config['student']['resultjoin'] = "
JOIN public.tbl_student s USING (student_uid)
JOIN public.tbl_benutzer b ON(b.uid = s.student_uid AND b.aktiv = true)
JOIN public.tbl_person p USING(person_id)";
$config['organisationunit'] = $CI->config->item('organisationunit', 'search');
$config['organisationunit']['prepare'] = 'active_organisationseinheit AS (SELECT * FROM public.tbl_organisationseinheit WHERE aktiv = true AND organisationseinheittyp_kurzbz <> \'Container\')';
$config['organisationunit']['table'] = 'active_organisationseinheit';
$config['room'] = $CI->config->item('room', 'search');
$config['cms'] = $CI->config->item('cms', 'search');
$config['dms'] = $CI->config->item('dms', 'search');
-35
View File
@@ -1,35 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
* TODO: 2025-07-21 ma0080 bare integer comparision results in db error
* if searchstring is numeric but out of range of int, think about
* more sophisticated solution using column data type - quick fix
* convert field and search string to text
*/
$config['equal-int'] = [
'priority' => 4,
'rank' => "0",
'compare' => "{field}::text = {word}::text",
'force_integer' => true
];
$config['equals'] = [
'priority' => 3,
'rank' => "0",
'compare' => "LOWER({field}) = {word}"
];
$config['similar'] = [
'priority' => 2,
'rank' => "(COALESCE({field}, '') <->> {word})",
'compare' => "COALESCE({field}, '') %> {word}",
'compare_boolean' => "COALESCE({field}, '') ILIKE {like:word}"
];
$config['vector'] = [
'priority' => 1,
'rank' => "ts_rank({field}, plainto_tsquery('simple', {word}))",
'compare' => "plainto_tsquery('simple', {word}) @@ {field}"
];
-49
View File
@@ -1,49 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$CI =& get_instance();
$config['student'] = $CI->config->item('student', 'search');
$config['student']['searchfields']['pkz'] = [
'alias' => ['personenkennzeichen', 'personalid'],
'comparison' => 'equals',
'field' => 'matrikelnr'
];
$config['student']['searchfields']['matrnr'] = [
'alias' => ['matrikelnr', 'matrikelnummer', 'matrno', 'matriculationno', 'matriculationnumber', 'studno', 'studentno', 'studentnumber'],
'comparison' => 'equals',
'field' => 'matr_nr',
'join' => [
[
'table' => "public.tbl_prestudent",
'using' => "prestudent_id"
],
[
'table' => "public.tbl_person",
'using' => "person_id"
]
]
];
$config['prestudent'] = $CI->config->item('prestudent', 'search');
$config['prestudent']['searchfields']['pkz'] = [
'alias' => ['personenkennzeichen', 'personalid'],
'comparison' => 'equals',
'field' => 'matrikelnr',
'join' => [
'table' => "public.tbl_student",
'using' => "prestudent_id"
]
];
$config['prestudent']['searchfields']['matrnr'] = [
'alias' => ['matrikelnr', 'matrikelnummer', 'matrno', 'matriculationno', 'matriculationnumber', 'studno', 'studentno', 'studentnumber'],
'comparison' => 'equals',
'field' => 'matr_nr',
'join' => [
'table' => "public.tbl_person",
'using' => "person_id"
]
];
-170
View File
@@ -1,170 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$config['frist_rueckzahlung_studiengebuer_WS'] = '15.10.';
$config['frist_rueckzahlung_studiengebuer_SS'] = '15.03.';
// TODO(chris): review this!
#$config['unterbrechung_dms'] = ['oe_kurzbz' => null, 'dokument_kurzbz' => null, 'kategorie_kurzbz' => null];
$config['unterbrechung_dms'] = ['oe_kurzbz' => null, 'dokument_kurzbz' => null, 'kategorie_kurzbz' => 'Akte'];
/**
* UPLOAD
*/
/**
* Allowed filetypes for attachment upload in unterbrechung antrag
*
* @var array An array of fileextensions
*/
$config['unterbrechung_dms_filetypes'] = ['jpg', 'pdf'];
/**
* GRADES
*/
/**
* On wiederholung the student must repeat certain lvs.
* This lvs will be graded with this id
*
* @var integer tbl_note.note
*/
$config['wiederholung_note_angerechnet'] = 19;
/**
* On wiederholung the student can not attend certain lvs.
* Those lvs will be graded with this id
*
* @var integer tbl_note.note
*/
$config['wiederholung_note_nicht_zugelassen'] = 20;
/**
* JOBS
*/
/**
* The Job will remind for every Unterbrecher who has a
* wiedereinstieg_datum between the date the Job is run
* and the modified date
* e.g.: If the Job is running on 2023-04-20 and the modifier
* is '+3 days' it will remind of everyone that
* has a wiedereinstiegs_datum between 2023-04-20 and 2023-04-23
*
* @var string A string formated as PHP DateTime modifier
* @see https://www.php.net/manual/de/datetime.modify.php
*/
$config['unterbrechung_job_remind_wiedereinstieg_date_modifier'] = '+3 days';
/**
* The Job will sent a request to everyone who faild the 3rd committee exam
* and respecting the given conditions (not repeated yet, stg not in blacklist)
* to decide if he/she will repeat or not
*
* First request
*
* @var string A string formated as PHP DateTime modifier
* @see https://www.php.net/manual/de/datetime.modify.php
*/
$config['wiederholung_job_request_1_date_modifier'] = '+0 days';
/**
* Second request
*
* @var string A string formated as PHP DateTime modifier
* @see https://www.php.net/manual/de/datetime.modify.php
*/
$config['wiederholung_job_request_2_date_modifier'] = '+3 weeks';
/**
* Final deadline - after this the student will be abgemeldet if he hasn't chosen yet
*
* @var string A string formated as PHP DateTime modifier
* @see https://www.php.net/manual/de/datetime.modify.php
*/
$config['wiederholung_job_deadline_date_modifier'] = '+1 month';
/**
* before this exam dates for Wiederholer will be ignored
*
* @var string A string formated as Date
*
*/
$config['digitalization_start'] = '2022-07-01';
/**
* Objection period - the student will be abgemeldet if he hasn't objected in this period
*
* @var string A string formated as PHP DateTime modifier
* @see https://www.php.net/manual/de/datetime.modify.php
*/
$config['abmeldung_job_deadline_date_modifier'] = '+2 weeks';
/**
* System User - uid of a user that is allowed to set prestudentstatus
*
* @var string
*/
$config['antrag_job_systemuser'] = '';
/**
* WHITELISTS
*/
/**
* List of stati who entitle a prestudent to create an Antrag
*
* @var array Array of tbl_status.status_kurzbz's
*/
$config['antrag_prestudentstatus_whitelist'] = ['Student', 'Diplomand'];
$config['antrag_prestudentstatus_whitelist_abmeldung'] = ['Student', 'Diplomand', 'Unterbrecher'];
/**
* BLACKLISTS
*/
/**
* List of Statusgründe that prevent a prestudent from create an Wiederholungsantrag
*
* @var array An array of tbl_status_grund.statusgrund_id's
*/
$config['status_gruende_wiederholer'] = [16, 15];
/**
* Blacklisted for abmeldung anträge
*
* @var array An array of tbl_studiengang.studiengang_kz's
*/
$config['stgkz_blacklist_abmeldung'] = [];
/**
* Blacklisted for unterbrechung anträge
*
* @var array An array of tbl_studiengang.studiengang_kz's
*/
$config['stgkz_blacklist_unterbrechung'] = [];
/**
* Blacklisted for wiederholung anträge
*
* @var array An array of tbl_studiengang.studiengang_kz's
*/
$config['stgkz_blacklist_wiederholung'] = [];
/**
* Blacklisted noten for negative committee exams
* noten with this ids won't be seen as negative
*
* @var array An array of noten ids
*/
$config['note_blacklist_wiederholung'] = [];
-145
View File
@@ -1,145 +0,0 @@
<?php
$config['number_displayed_past_studiensemester_default'] = 5;
$config['tabs'] =
[
'details' => [
//all fields can be configured to be hidden, see class attribute stv-details-details-name for name
'hiddenFields' => [],
'hideUDFs' => false
],
'prestudent' => [
//all fields can be configured to be hidden, see class attribute stv-details-prestudent-name for name
'hiddenFields' => [
//propably used by FH-Communities
'aufnahmeschluessel', 'standort_code', 'facheinschlaegigBerufstaetig'
],
'hideUDFs' => false
],
'finalexam' => [
'documents' => [
'pruefungsprotokoll' => [
'de' => [
'Bakk' => 'PrProtBA',
'Master' => 'PrProtMA',
],
'en' => [
'Bakk' => 'PrProtBAEng',
'Master' => 'PrProtMAEng',
],
],
'pruefungszeugnis' => [
'de' => [
'Bakk' => 'Bakkzeugnis',
'Master' => 'Diplomzeugnis',
],
'en' => [
'Bakk' => 'BakkzeugnisEng',
'Master' => 'DiplomzeugnisEng',
],
],
'urkunde' => [
'de' => [
'Bakk' => 'Bakkurkunde',
'Master' => 'Diplomurkunde',
],
'en' => [
'Bakk' => 'BakkurkundeEng',
'Master' => 'DiplomurkundeEng',
],
],
],
],
'exemptions' => [
//if true, Anrechnungen can be added and edited in tab Anrechnungen
'editableAnrechnungen' => false,
],
'notes' => [
//if true, the count of Messages will be shown in the header of the Tab Messages
'showCountNotes' => true
],
'combinePeople' => [
//multitab should only be shown with this length of selection
'validCountMulti' => 2,
],
];
// List of fields to show when ZGV_DOKTOR_ANZEIGEN is defined
$fieldsZgvDoktor = ['zgvdoktorort', 'zgvdoktordatum', 'zgvdoktornation', 'zgvdoktor_erfuellt', 'zgvdoktor_code'];
// List of fields to show when ZGV_ERFUELLT_ANZEIGEN is defined
$fieldsZgvErfuellt = ['zgv_erfuellt', 'zgvmas_erfuellt','zgvdoktor_erfuellt'];
//order important: to show zgf_erfuellt_doktor just in case visibility of doktor is true
if (!defined('ZGV_ERFUELLT_ANZEIGEN') || !ZGV_ERFUELLT_ANZEIGEN) {
$config['tabs']['prestudent']['hiddenFields'] = array_merge(
$config['tabs']['prestudent']['hiddenFields'], $fieldsZgvErfuellt
);
}
if (!defined('ZGV_DOKTOR_ANZEIGEN') || !ZGV_DOKTOR_ANZEIGEN) {
$config['tabs']['prestudent']['hiddenFields'] = array_merge(
$config['tabs']['prestudent']['hiddenFields'],
$fieldsZgvDoktor
);
}
$config['tabs']['projektarbeit']['defaultProjektbetreuerStunden'] =
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR')
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR
: '0.0';
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundenDiplom'] =
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER')
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER
: '0.0';
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundensatz'] = '80.0';
$config['student_tab_order'] = [
'details',
'notes',
'messages',
'contact',
'prestudent',
'status',
'documents',
'archive',
'banking',
'grades',
'exam',
'exemptions',
'projektarbeit',
'finalexam',
'mobility',
'jointstudies',
'admissionDates',
'groups',
'functions',
'coursedates',
'resources',
];
$config['students_tab_order'] = [
'banking',
'status',
'messages',
'groups',
'finalexam',
'combinePeople',
'archive',
];
$config['stv_prestudent_tags'] = [
'prioone' => ['readonly' => false],
'priotwo' => ['readonly' => true],
'hinweis' => ['readonly' => false],
'hinweis_assistenz' => ['readonly' => true],
'hinweis_kf' => ['readonly' => true],
'hinweis_lehrende' => ['readonly' => false],
'hinweis_stg_kf' => ['readonly' => true],
'finished_stg' => ['readonly' => true],
'finished_kf' => ['readonly' => true],
'inwork_kf' => ['readonly' => true],
];
-11
View File
@@ -1,11 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// changing the color theme
$config['theme_name']='default';
$config['theme_css']= "public/css/theme/default.css";
$config['theme_logo']= "public/images/logo_fh-complete_300x46.png";
$config['theme_modes']=['light','dark'];
-75
View File
@@ -1,75 +0,0 @@
{
"title": "UDF",
"type": "object",
"tableswhitelist": {
"type": "string",
"enum": ["tbl_person", "tbl_prestudent", "tbl_mitarbeiter", "tbl_lehrveranstaltung", "tbl_lehreinheit"]
},
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["checkbox", "textfield", "textarea", "date", "dropdown", "multipledropdown"]
},
"requiredPermissions": {
"type": "array"
},
"description": {
"type": "array",
},
"placeholder": {
"type": "array",
},
"title": {
"type": "array",
},
"sort": {
"type": "integer"
},
"defaultValue": {
"type": "string"
},
"validation": {
"type": "object",
"properties": {
"required": {
"type": "boolean"
},
"min-length": {
"type": "integer"
},
"max-length": {
"type": "integer"
},
"min-value": {
"type": "integer"
},
"min-value": {
"type": "integer"
},
"regex": {
"type": "object",
"properties": {
"language": "string",
"expression": "string"
}
}
}
},
"listValues": {
"type": "object",
"properties": {
"sql": {
"type": "string"
},
"enum": {
"type": "array"
}
}
}
},
"required": ["type", "name", "requiredPermissions"]
}
-211
View File
@@ -1,211 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item.
*/
$platforms = array(
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'iphone' => 'iOS',
'ipad' => 'iOS',
'ipod' => 'iOS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Spartan',
'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser'
);
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => 'Motorola',
'nokia' => 'Nokia',
'palm' => 'Palm',
'iphone' => 'Apple iPhone',
'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo',
'lg' => 'LG',
'amoi' => 'Amoi',
'xda' => 'XDA',
'mda' => 'MDA',
'vario' => 'Vario',
'htc' => 'HTC',
'samsung' => 'Samsung',
'sharp' => 'Sharp',
'sie-' => 'Siemens',
'alcatel' => 'Alcatel',
'benq' => 'BenQ',
'ipaq' => 'HP iPaq',
'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC',
'panasonic' => 'Panasonic',
'philips' => 'Philips',
'sagem' => 'Sagem',
'sanyo' => 'Sanyo',
'spv' => 'SPV',
'zte' => 'ZTE',
'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
// Operating Systems
'android' => 'Android',
'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm',
'series60' => 'Symbian S60',
'windows ce' => 'Windows CE',
// Browsers
'obigo' => 'Obigo',
'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile',
// Other
'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo',
'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo',
'o2' => 'O2',
// Fallback
'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile'
);
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George'
);
@@ -1,97 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Abgabetool extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => self::PERM_LOGGED,
'Mitarbeiter' => array('basis/abgabe_lektor:rw', 'basis/abgabe_assistenz:rw'),
'Assistenz' => array('basis/abgabe_assistenz:rw'),
'Student' => array('basis/abgabe_student:rw', 'basis/abgabe_lektor:rw', 'basis/abgabe_assistenz:rw'),
'Deadlines' => array('basis/abgabe_lektor:rw', 'basis/abgabe_assistenz:rw')
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
// TODO: routing from index based on berechtigung?
$viewData = array(
'uid'=>getAuthUID(),
);
if(defined('CIS4') && CIS4) {
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
} else {
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'Abgabetool']);
}
}
public function Student($student_uid_prop = '')
{
$viewData = array(
'uid'=>getAuthUID(),
);
if(defined('CIS4') && CIS4) {
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']);
} else {
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolStudent', 'student_uid_prop' => $student_uid_prop]);
}
}
public function Mitarbeiter()
{
$viewData = array(
'uid'=>getAuthUID(),
);
if(defined('CIS4') && CIS4) {
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']);
} else {
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolMitarbeiter']);
}
}
public function Assistenz($stg_kz_prop = '')
{
$viewData = array(
'uid'=>getAuthUID(),
);
if(defined('CIS4') && CIS4) {
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolAssistenz']);
} else {
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolAssistenz', 'stg_kz_prop' => $stg_kz_prop]);
}
}
public function Deadlines()
{
$viewData = array(
'uid'=>getAuthUID(),
);
if(defined('CIS4') && CIS4) {
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']);
} else {
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'DeadlinesOverview']);
}
}
}
-78
View File
@@ -1,78 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Auth extends FHC_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// Load Helpers
$this->load->helper('form');
$this->load->helper('hlp_authentication');
// Loads phrases system
$this->loadPhrases([
'global'
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function login()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|trim|callback_validation');
$this->form_validation->set_rules('password', 'Password', 'required|trim');
if ($this->form_validation->run())
{
redirect($this->authlib->getLandingPage('/CisVue/Dashboard'));
}
else
{
$this->load->view('Cis/Login');
}
}
/**
* @return boolean
*/
public function validation()
{
$username = $this->input->post('username');
$password = $this->input->post('password');
$this->load->library('AuthLib', [false]); // without authentication otherwise loooooop!
$login = $this->authlib->loginLDAP($username, $password);
if (isSuccess($login))
return true;
$this->form_validation->set_message('validation', 'Incorrect username/password.');
return false;
}
/**
* @return void
*/
public function logout()
{
$this->load->library('AuthLib');
$this->authlib->logout();
setcookie('fhclogout', 'fhclogout', 0, '/');
redirect(base_url('/cis/private/logout.php'), 'refresh');
}
}
-192
View File
@@ -1,192 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \stdClass as stdClass;
/**
*
*/
class Documents extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => [self::PERM_LOGGED],
'student' => ['admin:r'],
'download' => [self::PERM_LOGGED]
]);
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
$this->loadPhrases([
'global',
'tools'
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
return $this->showDocuments(getAuthUID());
}
/**
* @param string $uid Administratoren dürfen die UID als Parameter übergeben um die Dokumente von anderen Personen anzuzeigen
* @return void
*/
public function student($uid)
{
return $this->showDocuments($uid);
}
/**
* @param string $uid
* @return void
*/
protected function showDocuments($uid)
{
$this->load->model('crm/Konto_model', 'KontoModel');
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$stati = $this->PrestudentstatusModel->loadWhereUid($uid, null, true);
if (isError($stati))
return $this->load->view('errors/html/error_db.php', [
'heading' => 'Database Error',
'message' => getError($stati)
]);
$stati = getData($stati);
if (!$stati)
return $this->load->view('errors/html/error_general.php', [
'heading' => 'User ist kein Student',
'message' => 'Es konnten keine Studiensemester gefunden werden in denen der User als Student inskripiert ist'
]);
$stgs = [];
$stsemArray = [];
$buchungstypen = defined("CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN") ? unserialize(CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN) : [];
$person_ids = [];
foreach ($stati as $status) {
$person_ids[] = $status->person_id;
if(!in_array($status->studiensemester_kurzbz, $stsemArray)) {
$stsemArray[] = $status->studiensemester_kurzbz;
}
if (!isset($stgs[$status->studiengang_kz])) {
$stg = $this->StudiengangModel->load($status->studiengang_kz);
if (isError($stg))
return $this->load->view('errors/html/error_db.php', [
'heading' => 'Database Error',
'message' => getError($stg)
]);
$stg = getData($stg);
if (!$stg)
return $this->load->view('errors/html/error_db.php', [
'heading' => 'Database Error',
'message' => 'No Studiengang found for studiengang_kz ' . $status->studiengang_kz
]);
$stgs[$status->studiengang_kz] = current($stg);
$stgs[$status->studiengang_kz]->studiensemester = [];
}
if (!isset($stgs[$status->studiengang_kz]->studiensemester[$status->studiensemester_kurzbz])) {
$stgs[$status->studiengang_kz]->studiensemester[$status->studiensemester_kurzbz] = new stdClass();
$stgs[$status->studiengang_kz]->studiensemester[$status->studiensemester_kurzbz]->inskriptionsbestaetigung = (boolean)getData(
$this->KontoModel->checkStudienbeitragFromPrestudent(
$status->prestudent_id,
$status->studiensemester_kurzbz,
$buchungstypen
)
);
}
}
$person_ids = array_unique($person_ids);
$selfservice = null;
if (!defined('CIS_DOKUMENTE_SELFSERVICE') || CIS_DOKUMENTE_SELFSERVICE) {
$this->load->model('crm/Akte_model', 'AkteModel');
$selfservice = [];
foreach ($person_ids as $person_id) {
$result = $this->AkteModel->getArchiv($person_id, null, true);
if (isError($result))
return $this->load->view('errors/html/error_db.php', [
'heading' => 'Database Error',
'message' => getError($result)
]);
$selfservice = array_merge($selfservice, getData($result) ?: []);
}
}
$this->load->view('Cis/Documents', [
'stsemArray' => $stsemArray,
'stgs' => $stgs,
'uid' => $uid,
'studienbuchblatt' => defined('CIS_DOKUMENTE_STUDIENBUCHLBATT_DRUCKEN') && CIS_DOKUMENTE_STUDIENBUCHLBATT_DRUCKEN,
'studienerfolgsbestaetigung' => defined('CIS_DOKUMENTE_STUDIENERFOLGSBESTAETIGUNG_DRUCKEN') && CIS_DOKUMENTE_STUDIENERFOLGSBESTAETIGUNG_DRUCKEN,
'selfservice' => $selfservice
]);
}
/**
* @param integer $akte_id
* @param string $uid (optional) Administratoren dürfen die UID als Parameter übergeben um die Dokumente von anderen Personen anzuzeigen
*
* @return void
*/
public function download($akte_id, $uid = null)
{
if (!is_numeric($akte_id))
return show_404();
$this->load->model('crm/Akte_model', 'AkteModel');
$result = $this->AkteModel->load($akte_id);
if (isError($result))
return show_error(getError($result));
$akte = getData($result);
if (!$akte)
return show_404();
$akte = current($akte);
$admin_access = false;
if ($uid !== null && $this->permissionlib->isBerechtigt('admin')) {
$stati = $this->PrestudentstatusModel->loadWhereUid($uid, null, true);
if (hasData($stati)) {
$person_ids = array_map(function ($status) {
return $status->person_id;
}, getData($stati));
$person_ids = array_unique($person_ids);
if (count($person_ids) == 1 && current($person_ids) == $akte->person_id) {
$admin_access = true;
}
}
}
if (!$admin_access && ($akte->person_id != getAuthPersonId() || !$akte->stud_selfservice))
return show_error('Forbidden', 403);
// NOTE(chris): Log bei einem Download vom Becheid
if (isset($akte->dokument_kurzbz) && ($akte->dokument_kurzbz === 'Bescheid' || $akte->dokument_kurzbz === 'BescheidEng')) {
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
$this->WebservicelogModel->insert([
'webservicetyp_kurzbz' => 'content',
'request_id' => (isset($akte->akte_id) && !empty($akte->akte_id)) ? $akte->akte_id : null,
'beschreibung' => 'Bescheidbestaetigungsdownload',
'request_data' => $_SERVER['QUERY_STRING'],
'execute_time' => date('c'),
'execute_user' => getAuthUID()
]);
}
$this->output->set_content_type($akte->mimetype);
$this->output->set_output(base64_decode($akte->inhalt));
}
}
@@ -1,30 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class InfoTerminal extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r'],
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$this->load->view('Cis/InfoTerminal.php', []);
}
}
-39
View File
@@ -1,39 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class LvPlan extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r']
]);
// Load Config
$this->load->config('calendar');
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$viewData = array(
'uid'=>getAuthUID(),
'timezone' => $this->config->item('timezone')
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'LvPlan']);
}
}
-36
View File
@@ -1,36 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class MyLv extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r'],
'Info' => [self::PERM_LOGGED]
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$viewData = array(
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLv']);
}
}
-39
View File
@@ -1,39 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class MyLvPlan extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r']
]);
// Load Config
$this->load->config('calendar');
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$viewData = array(
'uid'=>getAuthUID(),
'timezone' => $this->config->item('timezone')
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLvPlan']);
}
}
-755
View File
@@ -1,755 +0,0 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Profil extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r'],
'foto_sperre_function' => ['basis/cis:r'],
'getView' => ['basis/cis:r'],
'View' => ['basis/cis:r'],
'isMitarbeiter' => ['basis/cis:r'],
'isStudent' => ['basis/cis:r'],
'getZustellAdresse' => ['basis/cis:r'],
'getZustellKontakt' => ['basis/cis:r'],
'getAllNationen' => ['basis/cis:r'],
'getGemeinden' => ['basis/cis:r'],
]);
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$this->load->model('person/Person_model', 'PersonModel');
$this->load->model('person/Adresse_model', 'AdresseModel');
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
$this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
$this->load->model('person/Kontakt_model', 'KontaktModel');
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
//? put the uid and pid inside the controller for reusability
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* index loads the Profil view
* @access public
* @return void
*/
public function index()
{
$this->load->library('ProfilLib');
$profil_data = $this->profillib->getView(getAuthUID());
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
$viewData = array(
'editable'=>true,
'profil_data' => $profil_data,
);
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilIndex']);
}
/**
* redirects to the index function (needed to allow calling this URI)
* @access public
* @return void
*/
public function View($uid)
{
$this->load->library('ProfilLib');
$profil_data = $this->profillib->getView($uid);
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
$viewData = array (
'uid' => $uid,
'profil_data'=>$profil_data,
);
if($uid == getAuthUID()){
$viewData['editable'] = true;
}
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilViewUid']);
}
/**
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
* @access public
* @param $uid the userID used to check if it is a mitarbeiter
* @return boolean
*/
public function isStudent($uid)
{
$result = $this->StudentModel->isStudent($uid);
if (isError($result)) {
show_error("error when calling Student_model function isStudent with uid " . $uid);
}
$result = getData($result);
echo json_encode($result);
}
/**
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
* @access public
* @param $uid the userID used to check if it is a mitarbeiter
* @return boolean
*/
public function isMitarbeiter($uid)
{
$result = $this->MitarbeiterModel->isMitarbeiter($uid);
if (isError($result)) {
show_error("error when calling Mitarbeiter_model function isMitarbeiter with uid " . $uid);
}
$result = getData($result);
echo json_encode($result);
}
/**
* gets the adressen that are marked as zustell from the currenlty logged in user
* @access public
* @return array a list of adresse_id's
*/
public function getZustellAdresse()
{
$this->AdresseModel->addSelect(["adresse_id"]);
$adressen_res = $this->AdresseModel->loadWhere(['person_id' => $this->pid, 'zustelladresse' => true]);
$adressen_res = hasData($adressen_res) ? getData($adressen_res) : null;
$adressen_res = array_map(function ($item) {
return $item->adresse_id;
}, $adressen_res);
echo json_encode($adressen_res);
}
/**
* gets the kontakte that are marked as zustell from the currenlty logged in user
* @access public
* @return array a list of kontakt_id's
*/
public function getZustellKontakt()
{
$this->KontaktModel->addSelect(["kontakt_id"]);
$kontakt_res = $this->KontaktModel->loadWhere(['person_id' => $this->pid, 'zustellung' => true]);
$kontakt_res = hasData($kontakt_res) ? getData($kontakt_res) : null;
$kontakt_res = array_map(function ($item) {
return $item->kontakt_id;
}, $kontakt_res);
echo json_encode($kontakt_res);
}
/**
* function that returns the data used for the corresponding view
* the client side parses the @param $uid and calls this function to get the data to the correct view
* @access public
* @param boolean $uid the userID used to identify which information should be retrieved for which view
* @return stdClass all the data corresponding to a view of a user
*/
public function getView($uid)
{
$res = new stdClass();
// if parsing the URL did not found a UID then the UID of the logged in user is used
if ($uid == "Profil" || $uid == $this->uid) {
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid);
if (isError($isMitarbeiter)) {
show_error("error while checking if UID: " . $this->uid . " is a mitarbeiter");
}
$isMitarbeiter = getData($isMitarbeiter);
if ($isMitarbeiter) {
$res->view = "MitarbeiterProfil";
$res->data = $this->mitarbeiterProfil();
$res->data->pid = $this->pid;
} else {
$res->view = "StudentProfil";
$res->data = $this->studentProfil();
$res->data->pid = $this->pid;
}
}
// UID is availabe when accessing Profil/View/:uid
else {
$this->PersonModel->addSelect(["person_id"]);
$pid = $this->PersonModel->getByUid($uid);
if (isError($pid)) {
show_error("error while trying to update table public.tbl_person while searching for a person with UID: " . $uid);
}
$pid = hasData($pid) ? getData($pid)[0] : null;
if (!$pid) {
show_error("Person with UID: " . $uid . " does not exist");
}
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
if (isError($isMitarbeiter)) {
show_error("error while checking if UID: " . $uid . " is a mitarbeiter");
}
$isMitarbeiter = getData($isMitarbeiter);
if ($isMitarbeiter) {
$res->view = "ViewMitarbeiterProfil";
$res->data = $this->viewMitarbeiterProfil($uid);
} else {
$res->view = "ViewStudentProfil";
$res->data = $this->viewStudentProfil($uid);
}
}
echo json_encode($res);
}
/**
* update column foto_sperre in public.tbl_person
* @access public
* @param boolean $value new value for the column
* @return boolean the new value added to the column in public.tbl_person
*/
public function foto_sperre_function($value)
{
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
if (isError($res)) {
show_error("error while trying to update table public.tbl_person");
}
$this->PersonModel->addSelect("foto_sperre");
$res = $this->PersonModel->load($this->pid);
if (isError($res)) {
show_error("error while trying to query table public.tbl_person");
}
$res = hasData($res) ? getData($res)[0] : null;
echo json_encode($res);
}
/**
* gets all nations in the table bis.tbl_nation
*
* @access public
* @return array all the nations in table bis.tbl_nation
*/
public function getAllNationen()
{
$this->load->model('codex/Nation_model', "NationModel");
$this->NationModel->addSelect(["nation_code as code", "langtext"]);
$nation_res = $this->NationModel->load();
if (isError($nation_res)) {
show_error("error while trying to query table codex.tbl_nation");
}
$nation_res = hasData($nation_res) ? getData($nation_res) : null;
echo json_encode($nation_res);
}
/**
* gets specific gemeinden which are related to the ZIP and the Nation passed in the body of the get request
* @access public
* @var $_GET function uses GET request payload
* @return boolean the new value added to the column in public.tbl_person
*/
public function getGemeinden()
{
/** @var $nation value parsed out of the body of the get request */
$nation = $this->input->get('nation', true);
/** @var $zip value parsed out of the body of the get request and converted to a php integer with json_decode */
$zip = json_decode($this->input->get('zip', true));
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
$this->GemeindeModel->addDistinct();
$this->GemeindeModel->addSelect(["name"]);
if ($nation == "A") {
if (isset($zip) && $zip > 999 && $zip < 32000) {
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
if (isError($gemeinde_res)) {
show_error("error while trying to query bis.tbl_gemeinde");
}
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
$gemeinde_res = array_map(function ($obj) {
return $obj->name;
}, $gemeinde_res);
echo json_encode($gemeinde_res);
} else {
echo json_encode(error("ortschaftskennziffer code was not valid"));
}
} else {
echo json_encode(error("Nation was not 'A' (Austria)"));
}
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
/**
* function that returns the data used for viewing another mitarbeiter profile
* @access private
* @param integer $uid the userID to retrieve the mitarbeiter data
* @return stdClass restricted mitarbeiter data
*/
private function viewMitarbeiterProfil($uid)
{
$mailverteiler_res = $this->getMailverteiler($uid);
$benutzer_funktion_res = $this->getBenutzerFunktion($uid);
$benutzer_res = $this->getBenutzerAlias($uid);
$person_res = $this->getPersonInfo($uid);
$mitarbeiter_res = $this->getMitarbeiterInfo($uid);
$telefon_res = $this->getTelefonInfo($uid);
$res = new stdClass();
$res->username = $uid;
//? Person Info
foreach ($person_res as $key => $val) {
$res->$key = $val;
}
//? Mitarbeiter Info
foreach ($mitarbeiter_res as $key => $val) {
$res->$key = $val;
}
$intern_email = array();
$intern_email["type"] = "intern";
$intern_email["email"] = $uid . "@" . DOMAIN;
$extern_email = array();
$extern_email["type"] = "alias";
$extern_email["email"] = $benutzer_res->alias . "@" . DOMAIN;
$res->emails = array($intern_email, $extern_email);
$res->funktionen = $benutzer_funktion_res;
$res->mailverteiler = $mailverteiler_res;
$res->standort_telefon = isset($telefon_res) ? $telefon_res->kontakt : null;
return $res;
}
/**
* function that returns the data used for viewing another student profile
* @access private
* @param integer $uid the userID to retrieve the student data
* @return stdClass restricted student data
*/
private function viewStudentProfil($uid)
{
$mailverteiler_res = $this->getMailverteiler($uid);
$person_res = $this->getPersonInfo($uid);
$student_res = $this->getStudentInfo($uid);
$matr_res = $this->getMatrikelNummer($uid);
$res = new stdClass();
$res->username = $uid;
//? Person Information
foreach ($person_res as $key => $value) {
$res->$key = $value;
}
//? Student Information
foreach ($student_res as $key => $value) {
$res->$key = $value;
}
$intern_email = array();
$intern_email["type"] = "intern";
$intern_email["email"] = $uid . "@" . DOMAIN;
$res->emails = [$intern_email];
$res->matrikelnummer = $matr_res->matr_nr;
$res->mailverteiler = $mailverteiler_res;
return $res;
}
/**
* function that returns the data used for the mitarbeiter profile
* @access private
* @return stdClass mitarbeiter data
*/
private function mitarbeiterProfil()
{
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($this->uid);
$adresse_res = $this->getAdressenInfo($this->pid);
$kontakte_res = $this->getKontaktInfo($this->pid);
$mailverteiler_res = $this->getMailverteiler($this->uid);
$person_res = $this->getPersonInfo($this->uid, true);
$benutzer_funktion_res = $this->getBenutzerFunktion($this->uid);
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($this->pid);
$profilUpdates = $this->getProfilUpdates($this->uid);
$telefon_res = $this->getTelefonInfo($this->uid);
$mitarbeiter_res = $this->getMitarbeiterInfo($this->uid);
$res = new stdClass();
$res->username = $this->uid;
//? Person Information
foreach ($person_res as $key => $value) {
$res->$key = $value;
}
//? Mitarbeiter Information
foreach ($mitarbeiter_res as $key => $value) {
$res->$key = $value;
}
$res->adressen = $adresse_res;
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
$res->kontakte = $kontakte_res;
$res->mittel = $betriebsmittelperson_res;
$res->mailverteiler = $mailverteiler_res;
$intern_email = array();
$intern_email["type"] = "intern";
$intern_email["email"] = $this->uid . "@" . DOMAIN;
$extern_email = array();
$extern_email["type"] = "alias";
$extern_email["email"] = $mitarbeiter_res->alias . "@" . DOMAIN;
$res->emails = [$intern_email, $extern_email];
$res->funktionen = $benutzer_funktion_res;
$res->standort_telefon = $telefon_res;
$res->profilUpdates = $profilUpdates;
return $res;
}
/**
* function that returns the data used for the student profile
* @access private
* @return stdClass student data
*/
private function studentProfil()
{
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($this->pid);
$kontakte_res = $this->getKontaktInfo($this->pid);
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($this->uid);
$adresse_res = $this->getAdressenInfo($this->pid);
$mailverteiler_res = $this->getMailverteiler($this->uid);
$person_res = $this->getPersonInfo($this->uid, true);
$zutrittsgruppe_res = $this->getZutrittsgruppen($this->uid);
$student_res = $this->getStudentInfo($this->uid);
$matr_res = $this->getMatrikelNummer($this->uid);
$profilUpdates = $this->getProfilUpdates($this->uid);
$res = new stdClass();
$res->username = $this->uid;
//? Person Information
foreach ($person_res as $key => $value) {
$res->$key = $value;
}
//? Student Information
foreach ($student_res as $key => $value) {
$res->$key = trim($value);
}
$intern_email = array();
$intern_email["type"] = "intern";
$intern_email["email"] = $this->uid . "@" . DOMAIN;
$res->emails = [$intern_email];
$res->adressen = $adresse_res;
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
$res->kontakte = $kontakte_res;
$res->mittel = $betriebsmittelperson_res;
$res->matrikelnummer = $matr_res->matr_nr;
$res->zuttritsgruppen = $zutrittsgruppe_res;
$res->mailverteiler = $mailverteiler_res;
$res->profilUpdates = $profilUpdates;
return $res;
}
/**
* gets all the mailverteiler using the tables: tbl_benutzer, tbl_benutzergruppe, tbl_gruppe
* @access private
* @param integer $uid the userID used to retrieve the mailverteiler
* @return array returns the mailvertailer corresponding to a userID
*/
private function getMailverteiler($uid)
{
$this->PersonModel->addSelect('gruppe_kurzbz, beschreibung');
$this->PersonModel->addJoin('tbl_benutzer', 'person_id');
$this->PersonModel->addJoin('tbl_benutzergruppe', 'uid');
$this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
$mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $uid));
if (isError($mailverteiler_res)) {
show_error("was not able to query the table public.tbl_benutzer:" . getData($mailverteiler_res));
}
$mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null;
$mailverteiler_res = array_map(function ($element) {
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
return $element;
}, $mailverteiler_res);
return $mailverteiler_res;
}
/**
* gets all the Benutzerfunktionen of a corresponding user
* @access private
* @param integer $uid the userID used to retrieve the Benutzerfunktionen
* @return array returns the Benutzerfunktionen corresponding to a userID
*/
private function getBenutzerFunktion($uid)
{
$this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"]);
$this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz");
$benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid' => $uid));
if (isError($benutzer_funktion_res)) {
show_error("was not able to query the table public.tbl_benutzerfunktion:" . getData($benutzer_funktion_res));
}
$benutzer_funktion_res = hasData($benutzer_funktion_res) ? getData($benutzer_funktion_res) : null;
return $benutzer_funktion_res;
}
/**
* gets all the Betriebsmittel of a corresponding user
* @access private
* @param integer $uid the userID used to retrieve the Betriebsmittel
* @return array returns the Betriebsmittel corresponding to a userID
*/
private function getBetriebsmittelInfo($pid)
{
$this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel", "nummer as Nummer", "ausgegebenam as Ausgegeben_am"]);
//? betriebsmittel are not needed in a view
$betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($pid);
if (isError($betriebsmittelperson_res)) {
show_error("was not able to query the table public.tbl_betriebsmittelperson:" . getData($betriebsmittelperson_res));
}
$betriebsmittelperson_res = hasData($betriebsmittelperson_res) ? getData($betriebsmittelperson_res) : null;
return $betriebsmittelperson_res;
}
/**
* gets the alias of a corresponding user
* @access private
* @param integer $uid the userID used to get the alias
* @return string the alias of the userID
*/
private function getBenutzerAlias($uid)
{
$this->BenutzerModel->addSelect(["alias"]);
$benutzer_res = $this->BenutzerModel->load([$uid]);
if (isError($benutzer_res)) {
show_error("was not able to query the table public.tbl_benutzer:" . getData($benutzer_res));
} else {
$benutzer_res = hasData($benutzer_res) ? getData($benutzer_res)[0] : null;
}
return $benutzer_res;
}
/**
* gets the person information corresponding to a user
* @access private
* @param integer $uid the userID used to get the person information
* @param integer $geburtsInfo flag wether to add the columns gebort, gebdatum, foto_sperre or not
* @return array all the person informaion corresponding to a userID
*/
private function getPersonInfo($uid, $geburtsInfo = null)
{
$selectClause = ["foto", "anrede", "titelpost as postnomen", "titelpre as titel", "vorname", "nachname"];
/** @param integer $geburtsInfo */
if ($geburtsInfo) {
array_push($selectClause, "gebort");
array_push($selectClause, "gebdatum");
array_push($selectClause, "foto_sperre");
}
$this->BenutzerModel->addSelect($selectClause);
$this->BenutzerModel->addJoin("tbl_person", "person_id");
$person_res = $this->BenutzerModel->load([$uid]);
if (isError($person_res)) {
show_error("was not able to query the table public.tbl_benutzer:" . getData($person_res));
} else {
$person_res = hasData($person_res) ? getData($person_res)[0] : null;
}
return $person_res;
}
/**
* gets the mitarbeiter information corresponding to a user
* @access private
* @param integer $uid the userID used to get the mitarbeiter information
* @return array all the mitarbeiter informaion corresponding to a userID
*/
private function getMitarbeiterInfo($uid)
{
$this->MitarbeiterModel->addSelect(["kurzbz", "telefonklappe", "alias", "ort_kurzbz"]);
$this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid");
$mitarbeiter_res = $this->MitarbeiterModel->load($uid);
if (isError($mitarbeiter_res)) {
show_error("was not able to query the table public.tbl_mitarbeiter:" . getData($mitarbeiter_res));
} else {
$mitarbeiter_res = hasData($mitarbeiter_res) ? getData($mitarbeiter_res)[0] : null;
}
return $mitarbeiter_res;
}
/**
* gets the telefon information corresponding to a user
* @access private
* @param integer $uid the userID used to get the telefon information
* @return array all the telefon informaion corresponding to a userID
*/
private function getTelefonInfo($uid)
{
$this->MitarbeiterModel->addSelect(["kontakt"]);
$this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id");
$this->MitarbeiterModel->addLimit(1);
$telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid" => $uid, "kontakttyp" => "telefon"]);
if (isError($telefon_res)) {
show_error("was not able to query the table public.tbl_mitarbeiter:" . getData($telefon_res));
}
$telefon_res = hasData($telefon_res) ? getData($telefon_res)[0] : null;
return $telefon_res;
}
/**
* gets the student information corresponding to a user
* @access private
* @param integer $uid the userID used to get the student information
* @return array all the student informaion corresponding to a userID
*/
private function getStudentInfo($uid)
{
$this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen']);
$this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz");
$student_res = $this->StudentModel->load([$uid]);
if (isError($student_res)) {
show_error("was not able to query the table public.tbl_student:" . getData($student_res));
}
$student_res = hasData($student_res) ? getData($student_res)[0] : null;
return $student_res;
}
/**
* gets the profil updates corresponding to a user
* @access private
* @param integer $uid the userID used to get the profil updates
* @return array all the profil updates corresponding to a userID
*/
private function getProfilUpdates($uid)
{
$profilUpdates = $this->ProfilUpdateModel->getProfilUpdatesWhere(['uid' => $uid]);
if (isError($profilUpdates)) {
show_error("was not able to query the table public.tbl_profil_update:" . getData($profilUpdates));
}
$profilUpdates = hasData($profilUpdates) ? getData($profilUpdates) : null;
return $profilUpdates;
}
/**
* gets the Matrikelnummer corresponding to a user
* @access private
* @param integer $uid the userID used to get the Matrikelnummer
* @return integer the Matrikelnummer corresponding to a userID
*/
private function getMatrikelNummer($uid)
{
$this->BenutzerModel->addSelect(["matr_nr"]);
$this->BenutzerModel->addJoin("tbl_person", "person_id");
$matr_res = $this->BenutzerModel->load([$uid]);
if (isError($matr_res)) {
show_error("was not able to query the table public.tbl_benutzer:" . getData($matr_res));
}
$matr_res = hasData($matr_res) ? getData($matr_res)[0] : [];
return $matr_res;
}
/**
* gets the Zutrittsgruppen corresponding to a user
* @access private
* @param integer $uid the userID used to get the Zutrittsgruppen
* @return array all the Zutrittsgruppen corresponding to a userID
*/
private function getZutrittsgruppen($uid)
{
$this->BenutzergruppeModel->addSelect(['bezeichnung']);
$this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
$zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid" => $uid, "zutrittssystem" => true));
if (isError($zutrittsgruppe_res)) {
show_error("was not able to query the table public.tbl_benutzergruppe:" . getData($zutrittsgruppe_res));
}
$zutrittsgruppe_res = hasData($zutrittsgruppe_res) ? getData($zutrittsgruppe_res) : null;
return $zutrittsgruppe_res;
}
/**
* gets the address information corresponding to a user
* @access private
* @param integer $uid the userID used to get the address information
* @return array all the address information corresponding to a userID
*/
private function getAdressenInfo($pid)
{
$adresse_res = $this->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
$adresse_res = $this->AdresseModel->addOrder("zustelladresse", "DESC");
$adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
$adresse_res = $this->AdresseModel->loadWhere(["person_id" => $pid]);
if (isError($adresse_res)) {
show_error("was not able to query the table public.tbl_adresse:" . getData($adresse_res));
}
$adresse_res = hasData($adresse_res) ? getData($adresse_res) : null;
return $adresse_res;
}
/**
* gets the kontakt information corresponding to a user
* @access private
* @param integer $uid the userID used to get the kontakt information
* @return array all the kontakt information corresponding to a userID
*/
private function getKontaktInfo($pid)
{
$this->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
$this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT');
$this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
$this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
$kontakte_res = $this->KontaktModel->loadWhere(['person_id' => $pid]);
if (isError($kontakte_res)) {
show_error("was not able to query the table public.tbl_kontakt:" . getData($kontakte_res));
}
$kontakte_res = hasData($kontakte_res) ? getData($kontakte_res) : null;
return $kontakte_res;
}
/**
* gets the date of issue of the FH access card corresponding to a user
* @access private
* @param integer $uid the userID used to get the date of issue of the FH access card
* @return string the date of issue of the FH access card corresponding to a userID
*/
private function getZutrittskarteDatum($uid)
{
$zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($uid, "Zutrittskarte");
if (isError($zutrittskarte_ausgegebenam)) {
show_error("was not able to query the table wavi.tbl_bentriebsmittelperson:" . getData($zutrittskarte_ausgegebenam));
}
$zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam) ? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null;
//? formats date from 01-01-2000 to 01.01.2000
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
return $zutrittskarte_ausgegebenam;
}
}
@@ -1,86 +0,0 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/**
*
*/
class ProfilUpdate extends Auth_Controller
{
public function __construct()
{
parent::__construct([
'index' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
'show' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r', 'basis/cis:r'],
'id' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r']
]);
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('crm/Student_model', 'StudentModel');
// Load language phrases
$this->loadPhrases(
array(
'profilUpdate'
)
);
$this->load->library('DmsLib');
$this->load->library('PermissionLib');
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
}
public function index()
{
$this->load->view('Cis/ProfilUpdate');
}
public function id($profil_update_id = null)
{
$this->load->view('Cis/ProfilUpdate', ['profil_update_id' => $profil_update_id]);
}
public function show($dms_id)
{
$profil_update = $this->ProfilUpdateModel->loadWhere(['attachment_id' => $dms_id]);
$profil_update = hasData($profil_update) ? getData($profil_update)[0] : null;
//? checks if an profil update exists with the dms_id requested from the user
if ($profil_update)
{
$is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($profil_update->uid));
$is_student_profil_update = getData($this->StudentModel->isStudent($profil_update->uid));
if (
$this->permissionlib->isBerechtigt('student/stammdaten:r') && $is_student_profil_update ||
$this->permissionlib->isBerechtigt('mitarbeiter/stammdaten:r') && $is_mitarbeiter_profil_update ||
$this->uid == $profil_update->uid
)
{
// Get file to be downloaded from DMS
$newFilename = $this->uid . "/document_" . $dms_id;
$download = $this->dmslib->download($dms_id);
if (isError($download))
return $download;
// Download file
$this->outputFile(getData($download));
}
else
{
show_error($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
return;
}
}
else
{
show_error($this->p->t('profilUpdate', 'profilUpdate_dms_error'));
return;
}
}
}
-167
View File
@@ -1,167 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Pub extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'bild' => ['basis/cis:r', 'assistenz:r']
)
);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @param string $source [person|akte]
* @param integer $id
* @return void
*/
public function bild($source, $id)
{
$this->load->model('person/Person_model', 'PersonModel');
$person_id_user = '';
$serverzugriff = false;
// Wenn das Bild direkt aufgerufen wird, ist eine Authentifizierung erforderlich
// Wenn es vom Server selbst aufgerufen wird, ist keine Auth. notwendig
// (z.B. fuer die Erstellung von PDFs)
if ($_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR']) {
// Wenn Session gesetzt ist, keine Abfrage, da diese Personen noch keine UID haben
if (isset($_SESSION['incoming/user'])) { // Von Incomingtool
$result = $this->PersonModel->loadWhere([
'zugangscode' => $_SESSION['incoming/user']
]);
if (hasData($result))
$person_id_user = current(getData($result))->person_id;
} elseif (isset($_SESSION['prestudent/user'])) { // Von Prestudententool
$result = $this->PersonModel->loadWhere([
'zugangscode' => $_SESSION['prestudent/user']
]);
if (hasData($result))
$person_id_user = current(getData($result))->person_id;
} elseif (isset($_SESSION['bewerbung/personId'])) { // Von Bewerbungstool
$person_id_user = $_SESSION['bewerbung/personId'];
} else {
$person_id_user = getAuthPersonId();
}
} else {
$serverzugriff = true;
}
// Default Bild (Dummy Profilbild)
$cTmpHEX = base64_encode(file_get_contents(FHCPATH . 'skin/images/profilbild_dummy.jpg'));
if ($source == 'person' && $id) {
$foto_gesperrt = false;
// Person laden und Fotosperre überprüfen
$result = $this->PersonModel->load($id);
if (hasData($result)) {
$person = current(getData($result));
if ($person->foto_sperre) {
// Wenn der User selbst darauf zugreift darf er das Bild sehen
$foto_gesperrt = ($person_id_user != $id);
} elseif (!$person_id_user && !$serverzugriff) {
$foto_gesperrt = true;
}
if ($person->foto && !$foto_gesperrt) {
$cTmpHEX = base64_decode($person->foto);
}
}
}
if($source == 'akte' && $id != '')
{
$this->load->model('crm/Akte_model', 'AkteModel');
$this->AkteModel->addJoin('public.tbl_person', 'person_id');
$result = $this->AkteModel->loadWhere([
'person_id' => $id,
'dokument_kurzbz' => 'Lichtbil'
]);
if (hasData($result)) {
$foto_gesperrt = false;
$akte = current(getData($result));
if ($akte->foto_sperre) {
// Wenn der User selbst darauf zugreift darf er das Bild sehen
$foto_gesperrt = ($person_id_user != $id);
} elseif (!$person_id_user && !$serverzugriff) {
$foto_gesperrt = true;
}
// Wenn das Foto nicht im Inhalt steht wird aus aus dem DMS geladen
if (!$akte->inhalt && $akte->dms_id) {
$this->load->model('content/Dms_model', 'DmsModel');
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
$this->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
$this->DmsModel->addOrder('version', 'DESC');
$this->DmsModel->addLimit(1);
$result = $this->DmsModel->load($akte->dms_id);
if (!hasData($result))
die('Kein Dokument vorhanden');
$dms = current(getData($result));
$filename = DMS_PATH . $dms->filename;
$this->DmsVersionModel->update([
'dms_id' => $dms->dms_id,
'version' => $dms->version
], [
'letzterzugriff' => date('c')
]);
if (file_exists($filename)) {
$handle = fopen($filename, "r");
if ($handle) {
while (!feof($handle)) {
$akte->inhalt .= fread($handle, 8192);
}
fclose($handle);
} else {
echo 'Fehler: Datei konnte nicht geoeffnet werden';
}
} else {
echo 'Die Datei existiert nicht';
}
}
if ($akte->inhalt && !$foto_gesperrt) {
$cTmpHEX = $akte->inhalt;
}
}
}
// die bilder werden, sofern es funktioniert, in jpg umgewandelt da es sonst zu fehlern beim erstellen
// von pdfs kommen kann.
$im = @imagecreatefromstring(base64_decode($cTmpHEX));
if ($im) {
@ob_clean();
header("Content-type: image/jpeg");
exit(imagejpeg($im));
} else {
// bei manchen Bildern funktioniert die konvertierung nicht
// diese werden dann einfach so angezeigt.
@ob_clean();
header("Content-type: image/gif");
exit($cTmpHEX);
}
}
}
-35
View File
@@ -1,35 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Raumsuche extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r']
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$viewData = array(
'uid'=>getAuthUID(),
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Raumsuche']);
}
}
-40
View File
@@ -1,40 +0,0 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Studium extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r'],
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* index loads the Studium view
* @access public
* @return void
*/
public function index()
{
$viewData = array(
);
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'studium']);
}
}
-45
View File
@@ -1,45 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Cis4 extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'index' => 'basis/cis:r'
)
);
// Load Config
$this->load->config('calendar');
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$this->load->model('person/Person_model', 'PersonModel');
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
$viewData = array(
'uid' => getAuthUID(),
'name' => $personData->vorname,
'person_id' => $personData->person_id,
'timezone' => $this->config->item('timezone')
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'FhcDashboard']);
}
}
-101
View File
@@ -1,101 +0,0 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/**
*
*/
class Cms extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'content' => 'basis/cis:r',
'getNews' => 'basis/cis:r',
'getNewsRowCount' => 'basis/cis:r',
'getRoomInformation' => 'basis/cis:r',
'news' => 'basis/cis:r'
)
);
// Loads Libraries
$this->load->library('CmsLib');
// Loads phrases system
$this->loadPhrases([
'global'
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @param int $content_id
* @param int $version
* @param string $sprache
* @param boolean $sichtbar
*
* @return void
*/
public function content($content_id, $version = null, $sprache = null, $sichtbar = true)
{
// return early if the content_id for the content is missing
if (!isset($content_id))
$this->terminateWithError("content_id is missing");
$content = $this->ContentModel->load($content_id);
if (isError($content))
$this->terminateWithError(getError($content));
$content = getData($content);
if (NULL === $content)
$this->terminateWithError("Content not found");
$content = current($content);
$viewData = array(
'content_id' => $content_id,
'template_kurzbz' => $content->template_kurzbz,
'version' => $version,
'sichtbar' => $sichtbar
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Content']);
}
/**
* @param boolean $infoscreen
* @param string | null $studiengang_kz
* @param int | null $semester
* @param boolean $mischen
* @param string $titel
* @param boolean $edit
* @param boolean $sichtbar
*
* @return void
*/
public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
{
$viewData = array();
$this->load->view('CisRouterView/CisRouterView.php', ['viewData'=>$viewData, 'route' => 'News']);
}
public function getRoomInformation($ort_kurzbz)
{
// Load Config
$this->load->config('calendar');
$viewData = array(
'ort_kurzbz' => $ort_kurzbz,
'timezone' => $this->config->item('timezone')
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'CmsRoom']);
}
}
@@ -1,43 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Dashboard extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'index' => 'dashboard/benutzer:r'
)
);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @return void
*/
public function index()
{
$this->load->model('person/Person_model','PersonModel');
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
$viewData = array(
'uid' => getAuthUID(),
'name' => $personData->vorname,
'person_id' => $personData->person_id
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData]);
}
}
-294
View File
@@ -1,294 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller handles output and access to documents.
* It creates a XML file, transforms it with the XSL-FO Vorlage from the
* database and generates a PDF file with unoconv or docsbox.
* This file is then outputted as download.
*
* It is the CodeIgniter version of content/pdfExport.php when not using the
* get paremeters: "archivdokument" and "archive".
* Use exportSigned() instead of providing the "sign" get parameter and
* export() otherwise.
*/
class Documents extends Auth_Controller
{
public function __construct()
{
parent::__construct([
'export' => self::PERM_LOGGED,
'exportSigned' => self::PERM_LOGGED
]);
// Load Phrases
$this->loadPhrases([
'stv'
]);
}
/**
* Download a not signed document.
*
* @param string $xml
* @param string $xsl
*
* @return void
*/
public function export($xml, $xsl)
{
return $this->_export($xml, $xsl);
}
/**
* Download a signed document.
*
* @param string $xml
* @param string $xsl
*
* @return void
*/
public function exportSigned($xml, $xsl)
{
return $this->_export($xml, $xsl, getAuthUID());
}
/**
* Helper function for export() and exportSigned()
*
* @param string $xml
* @param string $xsl
* @param string $sign_user (optional)
*
* @return void
*/
protected function _export($xml, $xsl, $sign_user = null)
{
$xsl_oe_kurzbz = null;
$version = $this->input->post_get('version') ?: null;
// Get the OE or STG of the document
$xsl_oe_kurzbz = $this->input->post_get('xsl_oe_kurzbz')
?: $this->input->post_get('xsl_stg_kz')
?: $this->input->post_get('stg_kz');
if (is_null($xsl_oe_kurzbz)) {
$uid = $this->input->post_get('uid');
if ($uid) {
$uid = current(explode(';', $uid));
$this->load->model('crm/Student_model', 'StudentModel');
$result = $this->StudentModel->load([$uid]);
if (!isError($result) && hasData($result))
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
}
}
if (is_null($xsl_oe_kurzbz)) {
$prestudent_id = $this->input->post_get('prestudent_id');
if ($prestudent_id) {
$prestudent_id = current(explode(';', $prestudent_id));
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$result = $this->PrestudentModel->load($prestudent_id);
if (!isError($result) && hasData($result))
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
}
}
if (is_null($xsl_oe_kurzbz))
$xsl_oe_kurzbz = 0;
// Access rights
if ($xsl == 'AccountInfo') {
$this->load->model('resource/Mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('crm/Student_model', 'StudentModel');
$uids = $this->input->post_get('uid');
if ($uids) {
$uids = explode(';', $uids);
foreach ($uids as $uid) {
$result = $this->MitarbeiterModel->load($uid);
if (!isError($result) && hasData($result)) {
if (!$this->permissionlib->isBerechtigt('admin', 'suid', 0)
&& !$this->permissionlib->isBerechtigt('mitarbeiter', 'suid', 0))
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'mitarbeiter:rw']]);
} else {
$result = $this->StudentModel->load([$uid]);
if (!isError($result) && hasData($result)) {
$student = current(getData($result));
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $student->studiengang_kz)
&& !$this->permissionlib->isBerechtigt('admin', 'suid', 0)
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', $student->studiengang_kz)
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', 0)
&& !$this->permissionlib->isBerechtigt('support', 'suid', 0))
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw', 'support:rw']]);
}
}
}
}
} else {
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
$result = $this->VorlagestudiengangModel->getCurrent($xsl, $xsl_oe_kurzbz, $version);
if (isError($result))
return show_error(getError($result));
if (!hasData($result))
return show_404();
$access_rights = current(getData($result))->berechtigung;
if (!$access_rights)
return show_404();
$allowed = false;
foreach ($access_rights as $access_right) {
if ($this->permissionlib->isBerechtigt($access_right)) {
$allowed = true;
break;
}
}
if (!$allowed)
return $this->_outputAuthError([$this->router->method => $access_rights]);
}
// Output format
$outputformat = $this->input->post_get('output') ?: 'pdf';
if ($outputformat != 'pdf'
// An der FHTW darf das Studienblatt und das Prüfungsprotokoll auch in anderen Formaten exportiert werden
&& !(CAMPUS_NAME == 'FH Technikum Wien'
&& ($xsl == 'Studienblatt'
|| $xsl == 'StudienblattEng'
|| $xsl == 'PrProtBA'
|| $xsl == 'PrProtBAEng'
|| $xsl == 'PrProtMA'
|| $xsl == 'PrProtMAEng'
)
)
&& !$this->permissionlib->isBerechtigt('system/change_outputformat', null, $xsl_oe_kurzbz)
) {
$outputformat = 'pdf';
}
// XML Params
$params = 'xmlformat=xml';
foreach ([
'uid',
'stg_kz',
'person_id',
'id',
'prestudent_id',
'buchungsnummern',
'ss',
'abschlusspruefung_id',
'typ',
'all',
'preoutgoing_id',
'lvid',
'projekt_kurzbz',
'von',
'bis',
'stundevon',
'stundebis',
'sem',
'lehreinheit',
'mitarbeiter_uid',
'studienordnung_id',
'fixangestellt',
'standort',
'abrechnungsmonat',
'form',
'projektarbeit_id',
'betreuerart_kurzbz',
'studiensemester_kurzbz'
] as $key) {
$value = $this->input->post_get($key);
if ($value !== null)
$params .= '&' . $key . '=' . urlencode($value);
}
$value = $this->input->post_get('vertrag_id');
if ($value !== null) {
foreach ($value as $id)
$params .= '&vertrag_id[]=' . urlencode($id);
}
$this->load->library('DocumentExportLib');
$this->load->model('system/Vorlage_model', 'VorlageModel');
$result = $this->VorlageModel->load($xsl);
if (isError($result))
return show_error(getError($result));
if (!hasData($result))
show_404();
$vorlage = current(getData($result));
if ($sign_user && !$vorlage->signierbar)
return show_error($this->p->t("stv", "grades_error_sign"));
// Filename
$filename = ($vorlage->bezeichnung ?: $vorlage->vorlage_kurzbz);
switch ($xsl) {
case 'LV_Informationen':
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$result = $this->StudiengangModel->load($this->input->post_get('stg_kz'));
if (!isError($result) && hasData($result))
$filename .= '_' . sanitizeProblemChars(current(getData($result))->kurzbzlang);
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$result = $this->StudiensemesterModel->load($this->input->post_get('ss'));
if (!isError($result) && hasData($result))
$filename .= '_' . sanitizeProblemChars(current(getData($result))->studiensemester_kurzbz);
break;
case 'Honorarvertrag':
$uid = str_replace(';', '', $this->input->post_get('uid') ?: '');
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$this->BenutzerModel->addJoin('public.tbl_person', 'person_id', 'LEFT');
$result = $this->BenutzerModel->load([$uid]);
if (!isError($result) && hasData($result)) {
$user = current(getData($result));
$filename .= '_' . sanitizeProblemChars($user->nachname) . '_' . sanitizeProblemChars($user->vorname);
}
break;
case 'Studienordnung':
$filename = 'Studienordnung-Studienplan-';
$this->load->model('organisation/Studienordnung_model', 'StudienordnungModel');
$result = $this->StudienordnungModel->load($this->input->post_get('studienordnung_id'));
if (!isError($result) && hasData($result)) {
$so = current(getData($result));
$filename .= sprintf("%'.04d", $so->studiengang_kz) . '-' . $so->studiengangkurzbzlang;
}
break;
default:
$uid = str_replace(';', '', $this->input->post_get('uid') ?: '');
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$this->BenutzerModel->addJoin('public.tbl_person', 'person_id', 'LEFT');
$result = $this->BenutzerModel->load([$uid]);
if (!isError($result) && hasData($result)) {
$user = current(getData($result));
$filename .= '_' . sanitizeProblemChars($user->nachname);
}
break;
}
// XML Data
$result = $this->documentexportlib->getDataURL($xml, $params);
if (isError($result))
return show_error(getError($result));
$data = getData($result);
// Output
$this->documentexportlib->showContent($filename, $vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
}
}
-42
View File
@@ -1,42 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class LVVerwaltung extends Auth_Controller
{
public function __construct()
{
$permissions = [];
$router = load_class('Router');
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
parent::__construct($permissions);
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
}
/**
* @return void
*/
public function _remap()
{
$this->load->view('LVVerwaltung', [
'permissions' => [
'lehre/lehrveranstaltung' => $this->permissionlib->isBerechtigt('lehre/lehrveranstaltung'),
'lv-plan/gruppenentfernen' => $this->permissionlib->isBerechtigt('lv-plan/gruppenentfernen'),
'lv-plan/lektorentfernen' => $this->permissionlib->isBerechtigt('lv-plan/lektorentfernen'),
],
'variables' => [
'semester_aktuell' => $this->variablelib->getVar('semester_aktuell')
],
'configs' => [
'showVertragsdetails' => defined('FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN') && FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN,
'showGewichtung' => defined('CIS_GESAMTNOTE_GEWICHTUNG') && CIS_GESAMTNOTE_GEWICHTUNG,
'lehreinheitAnmerkungDefault' => defined('LEHREINHEIT_ANMERKUNG_DEFAULT') ? LEHREINHEIT_ANMERKUNG_DEFAULT : '',
'lehreinheitRaumtypDefault' => defined('DEFAULT_LEHREINHEIT_RAUMTYP') ? DEFAULT_LEHREINHEIT_RAUMTYP : '',
'lehreinheitRaumtypAlternativeDefault' => defined('DEFAULT_LEHREINHEIT_RAUMTYP_ALTERNATIV') ? DEFAULT_LEHREINHEIT_RAUMTYP_ALTERNATIV : ''
]
]);
}
}
-37
View File
@@ -1,37 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class NeueNachricht extends Auth_Controller
{
public function __construct()
{
$permissions = [];
$router = load_class('Router');
$permissions[$router->method] = ['vertrag/mitarbeiter:r'];
parent::__construct($permissions);
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
}
/**
* @return void
*/
public function _remap()
{
$typeid = $this->input->post('typeid');
$ids = ($this->input->post('ids') && strpos($this->input->post('ids'), ','))
? explode(',', $this->input->post('ids'))
: $this->input->post('ids');
//now working
$this->load->view('Nachrichten', [
'permissions' => [
'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz','suid'),
],
'ids' => $ids,
'typeid' => $typeid
]);
}
}
@@ -1,47 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Studentenverwaltung extends Auth_Controller
{
public function __construct()
{
$permissions = [];
$router = load_class('Router');
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
parent::__construct($permissions);
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
}
/**
* @return void
*/
public function _remap()
{
$this->load->view('Studentenverwaltung', [
'permissions' => [
'student/bpk' => $this->permissionlib->isBerechtigt('student/bpk'),
'student/alias' => $this->permissionlib->isBerechtigt('student/alias'),
'basis/prestudent' => $this->permissionlib->isBerechtigt('basis/prestudent'),
'basis/prestudentstatus' => $this->permissionlib->isBerechtigt('basis/prestudentstatus'),
'assistenz_stgs' => $this->permissionlib->getSTG_isEntitledFor('assistenz'),
'admin' => $this->permissionlib->isBerechtigt('admin'),
'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz', 'suid'),
'student/keine_studstatuspruefung' => $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung'),
'lehre/reihungstestAufsicht' => $this->permissionlib->isBerechtigt('lehre/reihungstestAufsicht'),
'system/change_outputformat' => $this->permissionlib->getOE_isEntitledFor('system/change_outputformat'),
'student/editBakkZgv' => $this->permissionlib->getSTG_isEntitledFor('student/editBakkZgv') ?: array(),
'student/editMakkZgv' => $this->permissionlib->getSTG_isEntitledFor('student/editMakkZgv') ?: array(),
'student/editDokZgv' => $this->permissionlib->getSTG_isEntitledFor('student/editDokZgv') ?: array(),
'student/editBismelden' => $this->permissionlib->isBerechtigt('student/editBismelden')
],
'variables' => [
'semester_aktuell' => $this->variablelib->getVar('semester_aktuell')
]
]);
}
}
@@ -1,30 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Vertragsverwaltung extends Auth_Controller
{
public function __construct()
{
$permissions = [];
$router = load_class('Router');
$permissions[$router->method] = ['vertrag/mitarbeiter:r'];
#$permissions[$router->method] = ['admin:rw'];
parent::__construct($permissions);
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
}
/**
* @return void
*/
public function _remap()
{
$this->load->view('Vertragsverwaltung', [
'permissions' => [
'vertragsverwaltung_schreibrechte' => $this->permissionlib->isBerechtigt('vertrag/mitarbeiter', 'suid')
]
]);
}
}
-38
View File
@@ -1,38 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Vilesci extends Auth_Controller
{
public function __construct()
{
parent::__construct(
array(
'index' => 'basis/vilesci:r'
)
);
$this->load->library('WidgetLib');
}
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
* @return void
*/
public function index()
{
$this->load->view('home');
}
}
@@ -1,163 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (FAS) and the AntragLib (back-end)
* This controller works with calls on the HTTP GET or POST and the output is always RDF
*/
class Wiederholung extends Auth_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct([
'getLvs' => ['student/studierendenantrag:r', 'student/noten:r'],
'moveLvsToZeugnis' => ['student/studierendenantrag:w', 'student/noten:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getLvs($prestudent_id)
{
// header für no cache
$this->output->set_header("Cache-Control: no-cache");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Pragma: no-cache");
$this->output->set_header("Content-type: application/xhtml+xml");
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$sem_akt = $this->variablelib->getVar('semester_aktuell');
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $sem_akt);
if (isError($result))
return $result;
$lvs = $result->retval;
$rdf_url = 'http://www.technikum-wien.at/antragnote';
$this->load->view('lehre/Antrag/Wiederholung/getLvs.rdf.php', [
'url' => $rdf_url,
'lvs' => $lvs
]);
}
public function moveLvsToZeugnis()
{
$anzahl = $this->input->post('anzahl');
$student_uid = $this->input->post('student_uid');
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$errormsg = array();
for($i=0; $i<$anzahl; $i++)
{
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id_' . $i);
$result =$this->StudierendenantraglehrveranstaltungModel->load($id);
if(isError($result))
{
$errormsg[] = getError($result);
}
elseif(!hasData($result))
{
$errormsg[] = $this->p->t('studierendenantrag', 'error_no_lv_in_application');
}
else
{
$antragLv = getData($result)[0];
$result= $this->ZeugnisnoteModel->load([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
]);
if(isError($result))
{
$errormsg[] = getError($result);
}
else
{
if (hasData($result))
{
$result = $this->ZeugnisnoteModel->update(
[
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
],
[
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'updateamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'updatevon'=>getAuthUID()
]
);
}
else
{
$result = $this->ZeugnisnoteModel->insert([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz,
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'insertamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'insertvon'=>getAuthUID()
]);
}
if(isError($result))
{
$errormsg[] = getError($result);
}
}
}
}
if($errormsg)
$return = false;
else
$return = true;
$this->load->view('lehre/Antrag/Wiederholung/moveLvs.rdf.php', [
'return' => $return,
'errormsg' => $errormsg
]);
}
}
File diff suppressed because it is too large Load Diff
@@ -1,145 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Ampeln extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'open' => self::PERM_LOGGED,
'all' => self::PERM_LOGGED,
'confirm' => self::PERM_LOGGED,
'alleAmpeln' => self::PERM_LOGGED,
]);
$this->load->model('content/Ampel_model', 'AmpelModel');
$this->load->model('system/Sprache_model', 'SpracheModel');
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* confirms ampel and inserts ampel_id in public.tbl_ampel_benutzer_bestaetigt
* @access public
*
*/
public function confirm($ampel_id)
{
$this->load->library('form_validation');
$this->form_validation->set_data(['ampel_id'=> $ampel_id]);
$this->form_validation->set_rules('ampel_id', 'Ampel ID', 'required|integer');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// load Ampel_benutzer_bestaetigt_model to confirm the ampel
$this->load->model('content/Ampel_Benutzer_Bestaetigt_model', 'AmpelBenutzerBestaetigtModel');
$insert_into_result = $this->AmpelBenutzerBestaetigtModel->insert(["ampel_id"=> $ampel_id, "uid"=> $this->uid]);
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
$this->terminateWithSuccess($insert_into_result);
}
/**
* queries active and not confirmed ampeln by the user
* @access public
*
*/
public function open()
{
$userAmpeln = array();
// fetch active ampeln
$activeAmpeln = $this->AmpelModel->openActive($this->uid, false);
$activeAmpeln = $this->getDataOrTerminateWithError($activeAmpeln);
foreach ($activeAmpeln as $ampel) {
// only include non confirmed active ampeln in the result
if (!$ampel->bestaetigt) {
// check if the user was assigned to the ampel
$zugeteilt = $this->AmpelModel->isZugeteilt($this->uid, $ampel->benutzer_select);
$zugeteilt = $this->getDataOrTerminateWithError($zugeteilt);
if($zugeteilt) $userAmpeln[] = $ampel;
}
}
$this->terminateWithSuccess($userAmpeln);
}
/**
* queries all ampeln of the user
* @access public
*
*/
public function all()
{
$userAmpeln = array();
$ampel_result = $this->AmpelModel->active(false, $this->uid);
$ampel_result = $this->getDataOrTerminateWithError($ampel_result);
foreach ($ampel_result as $ampel) {
// check if the ampel was assigned to the user
$zugeteilt = $this->AmpelModel->isZugeteilt($this->uid, $ampel->benutzer_select);
$zugeteilt = $this->getDataOrTerminateWithError($zugeteilt);
if ($zugeteilt) $userAmpeln[] = $ampel;
}
$this->terminateWithSuccess($userAmpeln);
}
/**
* queries all ampeln that were assigned to the user until start of first work day
* @access public
*
*/
public function alleAmpeln()
{
//fetch all ampeln
$alle_ampeln = $this->AmpelModel->alleAmpeln($this->uid);
$alle_ampeln = $this->getDataOrTerminateWithError($alle_ampeln);
$alle_ampeln = array_map(function ($ampel) {
// check if ampel is confirmed by user
$confirmedByUser = $this->AmpelModel->isConfirmed($ampel->ampel_id, $this->uid);
$ampel->bestaetigt = $confirmedByUser;
return $ampel;
}, $alle_ampeln);
$this->terminateWithSuccess($alle_ampeln);
}
}
@@ -1,70 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
class AuthInfo extends FHCAPI_Controller
{
protected $uid;
protected $pid;
protected $isMitarbeiter;
protected $isStudent;
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getAuthUID' => self::PERM_LOGGED,
'getAuthInfo' => self::PERM_LOGGED,
]);
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
$this->isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter($this->uid)) ?? false;
$this->isStudent = getData($this->StudentModel->isStudent($this->uid)) ?? false;
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* returns the uid of the currently logged in user
* @access public
*
*/
public function getAuthUID()
{
$this->terminateWithSuccess(['uid'=>$this->uid]);
}
public function getAuthInfo()
{
$data = (object) array(
'uid' => $this->uid,
'isMitarbeiter' => $this->isMitarbeiter,
'isStudent' => $this->isStudent
);
$this->terminateWithSuccess($data);
}
}
@@ -1,138 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Bookmark extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getBookmarks' => self::PERM_LOGGED,
'delete' => self::PERM_LOGGED,
'insert' => self::PERM_LOGGED,
'update' => self::PERM_LOGGED,
]);
$this->load->model('dashboard/Bookmark_model', 'BookmarkModel');
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* gets the bookmarks associated to a user
* @access public
* @return void
*/
public function getBookmarks()
{
$this->BookmarkModel->addOrder("bookmark_id");
$bookmarks = $this->BookmarkModel->loadWhere(["uid"=>$this->uid]);
$bookmarks = $this->getDataOrTerminateWithError($bookmarks);
$this->terminateWithSuccess($bookmarks);
}
/**
* deletes bookmark from associated user
* @access public
* @return void
*/
public function delete($bookmark_id)
{
$bookmark = $this->BookmarkModel->load($bookmark_id);
$bookmark = current($this->getDataOrTerminateWithError($bookmark));
// only delete bookmark if the user is the owner of the bookmark
if($bookmark->uid == $this->uid || $this->permissionlib->isBerechtigt('admin')){
$delete_result = $this->BookmarkModel->delete($bookmark_id);
$delete_result = $this->getDataOrTerminateWithError($delete_result);
$this->terminateWithSuccess($delete_result);
}else{
$this->_outputAuthError(['delete' => ['admin:rw']]);
}
}
/**
* inserts new bookmark into the bookmark table
* @access public
* @return void
*/
public function insert()
{
// form validation
$this->load->library('form_validation');
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
$url = $this->input->post('url',true);
$title = $this->input->post('title',true);
$tag = $this->input->post('tag', true);
$insert_into_result = $this->BookmarkModel->insert(['uid'=>$this->uid, 'url'=>$url, 'title'=>$title,'tag'=>$tag, 'insertvon'=>$this->uid, 'updateamum'=>NULL, 'updatevon'=>NULL]);
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
$this->terminateWithSuccess($insert_into_result);
}
/**
* updates bookmark in the bookmark table
* @access public
* @return void
*/
public function update($bookmark_id)
{
// form validation
$this->load->library('form_validation');
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
$url = $this->input->post('url',true);
$title = $this->input->post('title',true);
$now = new DateTime();
$now = $now->format('Y-m-d H:i:s');
$update_result = $this->BookmarkModel->update($bookmark_id,['url'=>$url, 'title'=>$title,'updateamum'=>$now]);
$update_result = $this->getDataOrTerminateWithError($update_result);
$this->terminateWithSuccess($update_result);
}
}
@@ -1,58 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Cis4FhcApi extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getViewData' => self::PERM_LOGGED,
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* fetches ViewData
*/
public function getViewData()
{
$this->load->model('person/Person_model','PersonModel');
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
$viewData = array(
'uid' => getAuthUID(),
'name' => $personData->vorname,
'person_id' => $personData->person_id
);
$this->terminateWithSuccess($viewData);
}
}
@@ -1,58 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
class CisMenu extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getMenu' => self::PERM_LOGGED,
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* fetches the menu for CIS from the database based on the userLanguage
*/
public function getMenu()
{
$this->load->model('content/Content_model', 'ContentModel');
$this->load->config('cis');
$cis4_content_id =$this->config->item('cis_menu_root_content_id');
$result = $this->ContentModel->getMenu($cis4_content_id, getAuthUID(),getUserLanguage());
$result = $this->getDataOrTerminateWithError($result);
$menu = $result->childs ?? [];
$this->terminateWithSuccess($menu);
}
}
@@ -1,207 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
* Provides data to the ajax get calls about the searchbar component
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Cms extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
// NOTE(chris): additional permission checks will be done in SearchBarLib
parent::__construct([
'ContentID' => self::PERM_LOGGED,
'getOrtKurzbzContent' => self::PERM_LOGGED,
'content' => self::PERM_LOGGED,
'news' => self::PERM_LOGGED,
'getNewsRowCount' => self::PERM_LOGGED,
'getNews' => self::PERM_LOGGED,
]);
$this->load->model('content/News_model', 'NewsModel');
// setting up the papgination_size
$this->page_size = 10;
$this->load->library('CmsLib');
// Loads phrases system
$this->loadPhrases([
'global'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* fetches the content with the content_id and additional parameters
*/
public function content()
{
// form validation
$this->load->library('form_validation');
$this->form_validation->set_data($_GET);
$this->form_validation->set_rules('content_id','Content ID','required|is_natural');
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
// getting the get parameters
$content_id = $this->input->get("content_id",TRUE);
$version = $this->input->get("version",TRUE);
$sprache = $this->input->get("sprache",TRUE);
$sichtbar = $this->input->get("sichtbar",TRUE);
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar);
$content = $this->getDataOrTerminateWithError($content);
$this->terminateWithSuccess($content);
}
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function ContentID()
{
// form validation
$this->load->library('form_validation');
$this->form_validation->set_data($_GET);
$this->form_validation->set_rules('ort_kurzbz', 'Ort', 'required');
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
$ort_kurzbz = $this->input->get('ort_kurzbz',TRUE);
$content_id = $this->OrtModel->getContentID($ort_kurzbz);
$content_id = current($this->getDataOrTerminateWithError($content_id))->content_id;
$this->terminateWithSuccess($content_id);
}
public function news()
{
// form validation
$this->load->library('form_validation');
$this->form_validation->set_data($_GET);
$this->form_validation->set_rules('limit','Limit','required|is_natural_no_zero');
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
$this->load->model('content/news_model', 'NewsModel');
$limit = $this->input->get('limit',TRUE);
//query the news
$news = $this->NewsModel->getAll($limit);
//get the data or terminate with error
$news = $this->getDataOrTerminateWithError($news);
// array that keeps track of which news don't have a betreff and have to be removed from the news array
$newsToRemove = array();
// collect the content of the news
foreach($news as $index=>$news_element){
$this->NewsModel->resetQuery();
$content = $this->cmslib->getContent($news_element->content_id);
if(isError($content))
{
// removes the news from the news array, so that the response does not include a invalid news
array_push($newsToRemove,$index);
//add the error to the api response? visual feedback
//$this->addError(print_r($content->retval,true));
continue;
}
$content = getData($content);
$news_element->content_obj = $content;
}
//removes all news that don't have a betreff
foreach($newsToRemove as $removeNewsIndex)
{
unset($news[$removeNewsIndex]);
}
$withContent = function($news) {
return $news->content_obj != null;
};
$newsWithContent = array_filter($news, $withContent);
$this->terminateWithSuccess($newsWithContent);
}
public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10)
{
list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester);
$all = $edit;
$this->load->model('content/News_model','NewsModel');
$num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen);
$num_rows = $this->getDataOrTerminateWithError($num_rows);
$this->terminateWithSuccess($num_rows);
}
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
{
//form validation
$this->load->library('form_validation');
$this->form_validation->set_data($_GET);
$this->form_validation->set_rules('page','Page','required|is_natural');
$this->form_validation->set_rules('page_size', 'PageSize', 'is_natural');
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
// getting the GET parameters
$page = intval($this->input->get('page', true));
$page_size = intval($this->input->get('page_size', true));
$sprache = $this->input->get('sprache', true);
if(!$sprache)
{
$sprache = getUserLanguage();
}
// default value for the page_size is 10
$page_size = $page_size ?? 10;
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size, $sprache);
$news = $this->getDataOrTerminateWithError($news);
$this->addMeta('phrases', json_decode($this->p->getJson()));
$this->terminateWithSuccess($news);
}
}
@@ -1,496 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the back-end
* Provides data to the ajax get calls about documents
* Listens to ajax post calls to change the documents data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*
* This controller handles output and access to documents.
* It checks permissions to render documents in an alternative format
* or it creates a XML file, transforms it with the XSL-FO Vorlage from the
* database and generates a PDF file with unoconv or docsbox.
* This file is then archivated in the database.
*
* The last part is the CodeIgniter version of content/pdfExport.php when not
* using the get paremeter: "archivdokument" but using the get parameter:
* "archive".
* Use archiveSigned() instead of providing the "sign" get parameter and
* archive() otherwise.
*/
class Documents extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'permissionAlternativeFormat' => self::PERM_LOGGED,
'archive' => ['admin:rw', 'assistenz:rw'],
'archiveSigned' => ['admin:rw', 'assistenz:rw'],
'download' => ['admin:rw', 'assistenz:rw']
]);
// Load Phrases
$this->loadPhrases([
'stv'
]);
}
/**
* Checks if the current user has permission to render documents in an
* alternative format.
*
* @param string $oe_kurzbz Or studiengang_kz
*
* @return void
*/
public function permissionAlternativeFormat($oe_kurzbz)
{
$this->terminateWithSuccess($this->permissionlib->isBerechtigt('system/change_outputformat', null, $oe_kurzbz));
}
/**
* Archive a not signed document.
*
* @param string $xml (optional)
* @param string $xsl (optional)
*
* @return void
*/
public function archive($xml = null, $xsl = null)
{
return $this->_archive($xml, $xsl);
}
/**
* Archive a signed document.
*
* @param string $xml (optional)
* @param string $xsl (optional)
*
* @return void
*/
public function archiveSigned($xml = null, $xsl = null)
{
return $this->_archive($xml, $xsl, getAuthUID());
}
/**
*
* @return void
*/
public function download($xml, $xsl, $sign_user = null)
{
$akteExportData = $this->_getAkteExportData($xml, $xsl, $sign_user);
$akteData = $akteData['akteData'];
$exportData = $akteData['exportData'];
/**
* [
'vorlage' => $vorlage,
'xml_data' => $data,
'oe_kurzbz' => $xsl_oe_kurzbz,
'version' => $version,
'outputformat' => $outputformat,
'sign_user' => $sign_user
]
*/
// Output
$result = $this->documentexportlib->showContent(
$akteData['akteData']['inhalt'],
$exportData['vorlage'],
$exportData['xml_data'],
$exportData['oe_kurzbz'],
$exportData['version'],
$exportData['outputformat'],
$exportData['sign_user']
);
$this->terminateWithSuccess(true);
}
/**
* Helper function for archive() and archiveSigned()
*
* @param string $xml
* @param string $xsl
* @param string $sign_user (optional)
*
* @return void
*/
private function _archive($xml, $xsl, $sign_user = null)
{
$akteData = $this->_getAkteExportData($xml, $xsl, $sign_user);
$this->load->model('crm/Akte_model', 'AkteModel');
$result = $this->AkteModel->insert($akteData['akteData']);
$this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess(true);
}
/**
* @param string $xml
* @param string $xsl
* @param string $sign_user (optional)
*
* @return array with Akte data and export data
*/
private function _getAkteExportData($xml, $xsl, $sign_user = null)
{
if (!$xml || !$xsl) {
$this->load->library('form_validation');
if (!$xml) {
$xml = $this->input->post_get('xml');
$this->addMeta('xml', $xml);
$this->form_validation->set_rules('xml', 'xml', 'required');
}
if (!$xsl) {
$xsl = $this->input->post_get('xsl');
$this->addMeta('xsl', $xsl);
$this->form_validation->set_rules('xsl', 'xsl', 'required');
}
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$xsl_oe_kurzbz = null;
$version = $this->input->post_get('version') ?: null;
// Get the OE or STG of the document
$xsl_oe_kurzbz = $this->input->post_get('xsl_oe_kurzbz')
?: $this->input->post_get('xsl_stg_kz')
?: $this->input->post_get('stg_kz');
if (is_null($xsl_oe_kurzbz)) {
$uid = $this->input->post_get('uid');
if ($uid) {
$uid = current(explode(';', $uid));
$this->load->model('crm/Student_model', 'StudentModel');
$result = $this->StudentModel->load([$uid]);
if (!isError($result) && hasData($result))
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
}
}
if (is_null($xsl_oe_kurzbz)) {
$prestudent_id = $this->input->post_get('prestudent_id');
if ($prestudent_id) {
$prestudent_id = current(explode(';', $prestudent_id));
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$result = $this->PrestudentModel->load($prestudent_id);
if (!isError($result) && hasData($result))
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
}
}
if (is_null($xsl_oe_kurzbz))
$xsl_oe_kurzbz = 0;
// Vorlage
$this->load->model('system/Vorlage_model', 'VorlageModel');
$result = $this->VorlageModel->load($xsl);
$vorlage = current($this->getDataOrTerminateWithError($result));
if (!$vorlage)
show_404();
// Akte Data
$akteData = [
'dokument_kurzbz' => $vorlage->dokument_kurzbz ?: 'Zeugnis',
'mimetype' => 'application/pdf',
'erstelltam' => date('Y-m-d'),
'gedruckt' => true,
'insertamum' => date('c'),
'insertvon' => getAuthUID(),
'uid' => $this->input->post_get('uid') ?: null,
'archiv' => true,
'signiert' => !!$sign_user,
'stud_selfservice' => $vorlage->stud_selfservice
];
$studiengang_kz = null;
if ($akteData['uid']) {
$this->load->model('crm/Student_model', 'StudentModel');
$this->StudentModel->addSelect('tbl_student.*, UPPER(typ || kurzbz) AS kuerzel');
$this->StudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
$result = $this->StudentModel->load([$akteData['uid']]);
$student = current($this->getDataOrTerminateWithError($result));
$ss = $this->input->post_get('ss');
if ($ss !== null) {
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
$result = $this->PrestudentstatusModel->getLastStatus($student->prestudent_id, $ss);
$status = current($this->getDataOrTerminateWithError($result));
if (!$status)
$this->terminateWithError($this->p->t("stv", "grades_error_prestudentstatus"));
$semester = $status->ausbildungssemester;
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
$this->StudentlehrverbandModel->addJoin('public.tbl_benutzer', 'uid = student_uid');
$this->StudentlehrverbandModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
$result = $this->StudentlehrverbandModel->load([
'studiensemester_kurzbz' => $ss,
'student_uid' => $akteData['uid']
]);
if (!hasData($result)) $this->terminateWithError($this->p->t("stv", "error_noLehrverbandAssigned"));
$res = current($this->getDataOrTerminateWithError($result));
$studiengang_kz = $res->studiengang_kz;
$akteData['person_id'] = $res->person_id;
switch ($xsl) {
case 'Ausbildungsver':
case 'AusbVerEng':
$akteData['titel'] = mb_substr($xsl .
"_" .
strtoupper($res->typ) .
strtoupper($res->kurzbz) .
"_" .
$semester .
"_" .
$ss, 0, 64);
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
break;
case 'LVZeugnisEng':
case 'LVZeugnis':
case 'Zertifikat':
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
$result = $this->LehrveranstaltungModel->load($this->input->post_get('lvid'));
$lv = current($this->getDataOrTerminateWithError($result));
$akteData['dokument_kurzbz'] = $xsl;
$akteData['titel'] = mb_substr($xsl .
"_" .
strtoupper($res->typ) .
strtoupper($res->kurzbz) .
"_" .
$semester .
'_' .
$ss .
'_' .
str_replace(' ', '_', $lv->bezeichnung), 0, 60);
$akteData['bezeichnung'] = mb_substr($xsl .
" " .
strtoupper($res->typ) .
strtoupper($res->kurzbz) .
" " .
$semester .
". Semester" .
' ' .
$ss .
' ' .
$lv->bezeichnung, 0, 64);
break;
case 'SZeugnis':
$akteData['titel'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
break;
default:
$akteData['titel'] = mb_substr($xsl .
"_" .
strtoupper($res->typ) .
strtoupper($res->kurzbz) .
"_" .
$semester .
"_" .
$ss, 0, 64);
$akteData['bezeichnung'] = mb_substr($xsl .
" " .
strtoupper($res->typ) .
strtoupper($res->kurzbz) .
" " .
$semester .
". Semester" .
' ' .
$ss, 0, 64);
break;
}
} else {
$studiengang_kz = $student->studiengang_kz;
$akteData['person_id'] = $student->person_id;
$akteData['titel'] = $vorlage->bezeichnung . '_' . $student->kuerzel;
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
}
} else {
$prestudent_id = $this->input->post_get('prestudent_id');
if ($prestudent_id) {
$this->load->model('crm/prestudent_model', 'PrestudentModel');
$this->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
$this->PrestudentModel->addSelect('tbl_prestudent.*, UPPER(typ || kurzbz) AS kuerzel');
$result = $this->PrestudentModel->load($prestudent_id);
$prestudent = current($this->getDataOrTerminateWithError($result));
$studiengang_kz = $prestudent->studiengang_kz;
$akteData['person_id'] = $prestudent->person_id;
$akteData['titel'] = mb_substr($xsl . "_" . $prestudent->kuerzel, 0, 64);
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $prestudent->kuerzel, 0, 64);
}
}
// Access rights
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $studiengang_kz)
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', $studiengang_kz))
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw']]);
if ($xsl == 'AccountInfo') {
$this->load->model('resource/Mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('crm/Student_model', 'StudentModel');
$uids = $this->input->post_get('uid');
if ($uids) {
$uids = explode(';', $uids);
foreach ($uids as $uid) {
$result = $this->MitarbeiterModel->load($uid);
if (!isError($result) && hasData($result)) {
if (!$this->permissionlib->isBerechtigt('admin', 'suid', 0)
&& !$this->permissionlib->isBerechtigt('mitarbeiter', 'suid', 0))
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'mitarbeiter:rw']]);
} else {
$result = $this->StudentModel->load([$uid]);
if (!isError($result) && hasData($result)) {
$student = current(getData($result));
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $student->studiengang_kz)
&& !$this->permissionlib->isBerechtigt('admin', 'suid', 0)
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', $student->studiengang_kz)
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', 0)
&& !$this->permissionlib->isBerechtigt('support', 'suid', 0))
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw', 'support:rw']]);
}
}
}
}
} else {
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
$result = $this->VorlagestudiengangModel->getCurrent($xsl, $xsl_oe_kurzbz, $version);
$access_rights = current($this->getDataOrTerminateWithError($result));
// TODO: was bedeutet wenn keine berechtigung?
if (!$access_rights || !$access_rights->berechtigung)
return show_404();
$allowed = false;
foreach ($access_rights->berechtigung as $access_right) {
if ($this->permissionlib->isBerechtigt($access_right)) {
$allowed = true;
break;
}
}
if (!$allowed)
return $this->_outputAuthError([$this->router->method => $access_rights]);
}
// Output format
$outputformat = $this->input->post_get('output') ?: 'pdf';
if ($outputformat != 'pdf'
// An der FHTW darf das Studienblatt und das Prüfungsprotokoll auch in anderen Formaten exportiert werden
&& !(CAMPUS_NAME == 'FH Technikum Wien'
&& ($xsl == 'Studienblatt'
|| $xsl == 'StudienblattEng'
|| $xsl == 'PrProtBA'
|| $xsl == 'PrProtBAEng'
|| $xsl == 'PrProtMA'
|| $xsl == 'PrProtMAEng'
)
)
&& !$this->permissionlib->isBerechtigt('system/change_outputformat', null, $xsl_oe_kurzbz)
) {
$outputformat = 'pdf';
}
// XML Params
$params = 'xmlformat=xml';
foreach ([
'uid',
'stg_kz',
'person_id',
'id',
'prestudent_id',
'buchungsnummern',
'ss',
'abschlusspruefung_id',
'typ',
'all',
'preoutgoing_id',
'lvid',
'projekt_kurzbz',
'von',
'bis',
'stundevon',
'stundebis',
'sem',
'lehreinheit',
'mitarbeiter_uid',
'studienordnung_id',
'fixangestellt',
'standort',
'abrechnungsmonat',
'form',
'projektarbeit_id',
'betreuerart_kurzbz',
'studiensemester_kurzbz'
] as $key) {
if (in_array($xsl, array('Ausbildungsver', 'AusbVerEng')) && $key === 'uid')
{
continue;
}
$value = $this->input->post_get($key);
if ($value !== null)
$params .= '&' . $key . '=' . urlencode($value);
}
$value = $this->input->post_get('vertrag_id');
if ($value !== null) {
foreach ($value as $id)
$params .= '&vertrag_id[]=' . urlencode($id);
}
if (!$vorlage->archivierbar)
$this->terminateWithError($this->p->t("stv", "grades_error_archive"));
if ($sign_user && !$vorlage->signierbar)
$this->terminateWithError($this->p->t("stv", "grades_error_sign"));
$this->load->library('DocumentExportLib');
// XML Data
$result = $this->documentexportlib->getDataURL($xml, $params);
$data = $this->getDataOrTerminateWithError($result);
$this->documentexportlib->addArchiveToData($data);
// Output
$result = $this->documentexportlib->getContent($vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
$content = $this->getDataOrTerminateWithError($result);
$akteData['titel'] .= '.pdf';
$akteData['inhalt'] = base64_encode($content);
return [
'akteData' => $akteData,
'exportData' =>
[
'vorlage' => $vorlage,
'xml_data' => $data,
'oe_kurzbz' => $xsl_oe_kurzbz,
'version' => $version,
'outputformat' => $outputformat,
'sign_user' => $sign_user
]
];
}
}
@@ -1,231 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the FilterCmptLib (back-end)
* Provides data to the ajax get calls about the filter component
* Listens to ajax post calls to change the filter data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Filter extends FHCAPI_Controller
{
const FILTER_UNIQUE_ID = 'filterUniqueId'; // Name of the filter cmpt unique id (mandatory)
const FILTER_TYPE = 'filterType'; // The filter type (PHP filter definition) used (mandatory)
const FILTER_ID = 'filterId'; // The id of the used filter (optional)
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
// NOTE: FilterCmpt has its own permissions checks
parent::__construct([
'getFilter' => self::PERM_LOGGED,
'removeFilterField' => self::PERM_LOGGED,
'addFilterField' => self::PERM_LOGGED,
'applyFilterFields' => self::PERM_LOGGED,
'removeCustomFilter' => self::PERM_LOGGED,
'saveCustomFilter' => self::PERM_LOGGED,
'reloadDataset' => self::PERM_LOGGED
]);
// Loads the FiltersModel
$this->load->model('system/Filters_model', 'FiltersModel');
// Loads the FilterCmptLib with HTTP GET/POST parameters
$this->_startFilterCmptLib();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data about the current filter from the session and will be written on the output in JSON format
*/
public function getFilter()
{
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$session = $this->filtercmptlib->getSession();
if (is_object($session)) {
// If stdClass it is an retval object
$session = $this->getDataOrTerminateWithError($session);
}
$this->terminateWithSuccess($session);
}
/**
* Remove an applied filter (SQL where condition) from the current filter
*/
public function removeFilterField()
{
$this->form_validation->set_rules('filterField', 'filterField', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->removeFilterField($this->input->post('filterField'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Field removed');
}
/**
* Add a filter (SQL where clause) to be applied to the current filter
*/
public function addFilterField()
{
$this->form_validation->set_rules('filterField', 'filterField', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->addFilterField($this->input->post('filterField'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Field added');
}
/**
* Apply the filter changes
*/
public function applyFilterFields()
{
$this->form_validation->set_rules('filterFields[]', 'filterFields', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->applyFilterFields($this->input->post('filterFields'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Applied');
}
/**
* Save the current filter as a custom filter for this user with the given description
*/
public function saveCustomFilter()
{
$this->form_validation->set_rules('customFilterName', 'customFilterName', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->saveCustomFilter($this->input->post('customFilterName'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Saved');
}
/**
* Remove a custom filter by its filterId
*/
public function removeCustomFilter()
{
$this->form_validation->set_rules('filterId', 'filterId', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->removeCustomFilter($this->input->post('filterId'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Removed');
}
/**
* Reloads the dataset
*/
public function reloadDataset()
{
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$this->filtercmptlib->reloadDataset();
$this->terminateWithSuccess('Success');
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter
* If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _startFilterCmptLib()
{
$filterUniqueId = null;
$filterType = null;
$filterId = null;
$validations = [
[
'field' => self::FILTER_UNIQUE_ID,
'label' => self::FILTER_UNIQUE_ID,
'rules' => 'required'
],
[
'field' => self::FILTER_TYPE,
'label' => self::FILTER_TYPE,
'rules' => 'required'
],
];
$this->load->library('form_validation');
if ($this->input->method() == 'get')
$this->form_validation->set_data($this->input->get());
$this->form_validation->set_rules($validations);
if ($this->form_validation->run()) {
$filterUniqueId = $this->input->post_get(self::FILTER_UNIQUE_ID);
$filterType = $this->input->post_get(self::FILTER_TYPE);
$filterId = $this->input->post_get(self::FILTER_ID);
// Loads the FilterCmptLib that contains all the used logic
$this->load->library(
'FilterCmptLib',
array(
'filterUniqueId' => $filterUniqueId,
'filterType' => $filterType,
'filterId' => $filterId
)
);
// Start the component
$this->filtercmptlib->start();
}
}
}
@@ -1,47 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the back-end
* Provides data to the ajax get calls about languages
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Language extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'get' => self::PERM_LOGGED
]);
// Load models
$this->load->model('system/Sprache_model', 'SpracheModel');
}
public function get()
{
$this->SpracheModel->addOrder('sprache');
$result = $this->SpracheModel->load();
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -1,104 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
//require_once('../../../include/studiengang.class.php');
//require_once('../../../include/student.class.php');
//require_once('../../../include/datum.class.php');
//require_once('../../../include/mail.class.php');
//require_once('../../../include/benutzerberechtigung.class.php');
//require_once('../../../include/phrasen.class.php');
//require_once('../../../include/projektarbeit.class.php');
//require_once('../../../include/projektbetreuer.class.php');
class Lehre extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'lvStudentenMail' => self::PERM_LOGGED,
'LV' => self::PERM_LOGGED,
'Pruefungen' => self::PERM_LOGGED
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* constructs the emails of the groups from a lehrveranstaltung
*/
public function lvStudentenMail()
{
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
// return early if the required parameter is missing
if(!isset($lehreinheit_id))
{
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
}
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
//convert array of objects into array of strings
$studentenMails = array_map(function($element){
return $element->mail;
}, $studentenMails);
$this->terminateWithSuccess($studentenMails);
}
public function LV($studiensemester_kurzbz, $lehrveranstaltung_id)
{
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage(), $lehrveranstaltung_id);
$result = current($this->getDataOrTerminateWithError($result));
$this->terminateWithSuccess($result);
}
/**
* fetches all Pruefungen of a student for a specific lehrveranstaltung
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
* @param mixed $lehrveranstaltung_id
* @return void
*/
public function Pruefungen($lehrveranstaltung_id)
{
$this->load->model('education/Pruefung_model', 'PruefungModel');
$result = $this->PruefungModel->getByStudentAndLv(getAuthUID(), $lehrveranstaltung_id, getUserLanguage());
$result = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($result);
}
}
@@ -1,277 +0,0 @@
<?php
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Lehrveranstaltung extends FHCAPI_Controller
{
private $_ci;
private $_uid;
public function __construct()
{
parent::__construct([
'getByEmp' => ['admin:r', 'assistenz:r'],
'getByStg' => ['admin:r', 'assistenz:r'],
'loadByLV' => ['admin:r', 'assistenz:r'],
]);
$this->_ci = &get_instance();
$this->_setAuthUID();
$this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
$this->loadPhrases(
array(
'ui'
)
);
}
public function getByEmp($studiensemester_kurzbz = null, $mitarbeiter_uid = null, $stg_kz = null)
{
if (is_null($mitarbeiter_uid))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz);
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
$tree = [];
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
{
$lehreinheiten = $this->_ci->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz, $mitarbeiter_uid);
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
if (!isset($lehrveranstaltung->_children))
{
$lehrveranstaltung->_children = $lehreinheiten_data;
}
$tree[] = $lehrveranstaltung;
}
$this->terminateWithSuccess($tree);
}
public function getByStg($studiensemester_kurzbz = null, $studiengang_kz = null, $semester = null)
{
if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$verband = null;
if (!is_null($semester) && !is_numeric($semester))
{
$verband = $semester;
$semester = null;
}
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
$studienplan_ids = array();
$only_ids = array();
$placeholders = array();
if (hasData($studienplan_data))
{
foreach (getData($studienplan_data) as $studienplan) {
$placeholders[] = "(?, ?)";
$studienplan_ids[] = $studienplan->studienplan_id;
$studienplan_ids[] = $studienplan->semester;
$only_ids[] = $studienplan->studienplan_id;
}
}
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
$lehrveranstaltungen_data = hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
$tree = [];
foreach ($lehrveranstaltungen_data as $row)
{
$rowData = $row;
$lehreinheiten_data = $this->_ci->LehreinheitModel->getByLvidStudiensemester($row->lehrveranstaltung_id, $studiensemester_kurzbz);
if (hasData($lehreinheiten_data))
{
$lehreinheiten = getData($lehreinheiten_data);
if (!isset($row->_children))
{
$row->_children = $lehreinheiten;
}
else
{
if (!is_array($row->_children))
{
$row->_children = [$row->_children];
}
$row->_children = array_merge($row->_children, $lehreinheiten);
}
}
if (!isEmptyString($row->studienplan_lehrveranstaltung_id_parent))
{
$child = $this->_ci->StudienplanModel->loadStudienplanLehrveranstaltung($row->studienplan_lehrveranstaltung_id_parent);
if (hasData($child))
{
$child = getData($child)[0];
$searchId = $child->lehrveranstaltung_id;
foreach ($lehrveranstaltungen_data as &$searchParent)
{
if ($searchParent->lehrveranstaltung_id === $searchId)
{
if (!isset($searchParent->_children))
{
$searchParent->_children = [];
}
if (is_array($searchParent->_children))
{
$searchParent->_children[] = $row;
}
else
{
$searchParent->_children = [$searchParent->_children, $row];
}
break;
}
}
}
}
else
{
$tree[] = $rowData;
}
}
$counter = 0;
$this->assignUniqueIndex($tree, $counter);
$this->terminateWithSuccess($tree);
}
public function loadByLV($lehrveranstaltung_id = null)
{
if (is_null($lehrveranstaltung_id) || !ctype_digit((string)$lehrveranstaltung_id))
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->_ci->LehrveranstaltungModel->addSelect('lehrveranstaltung_id, lehrform_kurzbz, lehre, bezeichnung as lvbezeichnung, sprache');
$lehrveranstaltung_result = $this->_ci->LehrveranstaltungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id));
$lehrveranstaltung_result = $this->getDataOrTerminateWithError($lehrveranstaltung_result);
$lehrveranstaltung = $lehrveranstaltung_result[0];
$this->_ci->LehreinheitModel->addSelect('lehrveranstaltung_id_kompatibel');
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung_kompatibel', 'lehrveranstaltung_id');
$lehrfaecher = $this->_ci->LehreinheitModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung->lehrveranstaltung_id));
$lehrfaecher_array = [];
if (hasData($lehrfaecher))
$lehrfaecher_array = array_merge($lehrfaecher_array, array_column(getData($lehrfaecher), 'lehrveranstaltung_id_kompatibel'));
$lehrfaecher_array[] = $lehrveranstaltung->lehrveranstaltung_id;
$this->_ci->LehrveranstaltungModel->addDistinct('lehrfach_id');
$this->_ci->LehrveranstaltungModel->addSelect("tbl_lehrveranstaltung.lehrveranstaltung_id, CONCAT(tbl_lehrveranstaltung.bezeichnung || '(' || tbl_lehrveranstaltung.oe_kurzbz || ')') as lehrfach");
$this->_ci->LehrveranstaltungModel->db->where_in('tbl_lehrveranstaltung.lehrveranstaltung_id', $lehrfaecher_array);
$lehrfaecher_result = $this->_ci->LehrveranstaltungModel->load();
$lehrfaecher_array = hasData($lehrfaecher_result) ? getData($lehrfaecher_result) : array();
$lehrveranstaltung->lehrfaecher = $lehrfaecher_array;
$this->terminateWithSuccess($lehrveranstaltung);
}
/*
* (david) ggf. im naechsten release
* public function loadByOrganization($oe_kurzbz)
{
$studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell');
$lehrveranstaltungen = $this->LehrveranstaltungModel->getLvsByOrganization($oe_kurzbz);
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
$tree = [];
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
{
$lehreinheiten = $this->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz);
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
if (!isset($lehrveranstaltung->_children))
{
$lehrveranstaltung->_children = $lehreinheiten_data;
}
$tree[] = $lehrveranstaltung;
}
$this->terminateWithSuccess($tree);
}*/
/*public function loadByFachbereich($fachbereich, $mitarbeiter_uid = null)
{
$studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell');
$this->LehreinheitModel->getLvsByFachbereich($fachbereich, $studiensemester_kurzbz, $mitarbeiter_uid);
}*/
private function _setAuthUID()
{
$this->_uid = getAuthUID();
if (!$this->_uid)
show_error('User authentification failed');
}
private function assignUniqueIndex(&$nodes, &$counter)
{
foreach ($nodes as &$node)
{
$node->uniqueindex = $counter++;
if (!empty($node->_children) && is_array($node->_children))
{
$this->assignUniqueIndex($node->_children, $counter);
}
}
}
private function getStudiensemesterKurzbz($studiensemester_kurzbz = null)
{
if (!is_null($studiensemester_kurzbz))
{
$studiensemester_result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
if (isError($studiensemester_result) || !hasData($studiensemester_result))
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
return getData($studiensemester_result)[0]->studiensemester_kurzbz;
}
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
}
}
@@ -1,544 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use CI3_Events as Events;
/**
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
* Provides data to the ajax get calls about the searchbar component
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class LvMenu extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getLvMenu' => self::PERM_LOGGED
]);
$this->load->model("ressource/Mitarbeiter_model");
$this->load->model("education/Lehreinheit_model");
$this->load->model("education/Lehrveranstaltung_model");
$this->load->model("organisation/Studiengang_model");
$this->load->model("accounting/Vertrag_model");
$this->load->model("system/Variable_model");
$this->load->model("person/Benutzergruppe_model");
$this->load->model("education/Lvangebot_model");
$this->load->model("ressource/Lehretools_model");
$this->load->library("PermissionLib", null, 'PermissionLib');
$this->load->library("PhrasesLib", null, 'PhrasesLib');
$this->loadPhrases(array('global', 'lehre'));
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* alternative function to get multiple lvMenus with a single http request
*/
public function getMultipleLvMenu($lvMenuOptionList){
$result =[];
foreach($lvMenuOptionList as $lvMenuOptions){
$lvMenu = $this->getLvMenu($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
if(isError($lvMenu)){
// TODO: some lvMenu threw an error, handle error here
}
$result[$lvMenuOptions['lvid']]=$lvMenu;
}
$this->terminateWithSuccess($result);
}
/**
*
*/
public function getLvMenu($lvid, $studiensemester_kurzbz)
{
// return early if parameters are missing
if(!isset($lvid) || !isset($studiensemester_kurzbz))
$this->terminateWithError('Missing parameters', self::ERROR_TYPE_GENERAL);
// get the sprache
$sprache = getUserLanguage();
// get the user
if (!$user=getAuthUID())
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
// check if is_lector
$is_lector = false;
$mares = $this->Mitarbeiter_model->isMitarbeiter($user);
if(hasData($mares))
{
$is_lector = getData($mares);
}
// definition of user_is_allowed_to_upload
$user_is_allowed_to_upload=false;
$angezeigtes_stsem = $studiensemester_kurzbz;
// load lehrveranstaltung
$lvres = $this->Lehrveranstaltung_model->load($lvid);
if(!hasData($lvres))
{
$this->terminateWithError('LV ' . $lvid . ' not found.');
}
$lv = (getData($lvres))[0];
$this->addMeta('lvInfo',$lv);
// define studiengang_kz / semester / lehrverzeichnis
$studiengang_kz = $lv->studiengang_kz;
$semester = $lv->semester;
$short = $lv->lehreverzeichnis;
// return empty menu for studiengang_kz = 0
if($studiengang_kz == 0){
$this->terminateWithSuccess("organisatorische_einheit");
}
// load studiengang
$stgres = $this->Studiengang_model->load(strval($studiengang_kz));
if(!hasData($stgres))
{
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
}
$stg = (getData($stgres))[0];
$kurzbz = strtoupper($stg->typ . $stg->kurzbz);
$short_name = $lv->bezeichnung;
$short_short_name = $lv->lehreverzeichnis;
// angemeldet
$angemeldet = true;
if(defined('CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN && !$is_lector)
{
$angemeldet = false;
$lesres = $this->Lehreinheit_model->getLehreinheitenForStudentAndStudienSemester(
$lvid, $user, $angezeigtes_stsem
);
if(hasData($lesres) && count(getData($lesres)) > 0)
$angemeldet = true;
}
// lehrfach
$lehrfach_id='';
if(defined('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN)
{
// Wenn der eingeloggte User zu einer der Lehreinheiten zugeteilt ist
// wird zusätzlich das Lehrfach der Lehreinheit angezeigt.
if($is_lector )
{
$result = $this->Lehreinheit_model->getLehrfachIdMitarbeiter($angezeigtes_stsem,$user,$lvid);
}
else
{
$result = $this->Lehreinheit_model->getLehrfachIdStudierender($angezeigtes_stsem,$user,$lvid);
}
// Wenn die LV mehrere verschiedenen Lehrfaecher hat, und der User zu mehreren davon zugeteilt ist
// wird das Lehrfach nicht angezeigt damit es nicht zu verwirrungen kommt.
if( ($lehrfaecher = getData($result)) && count($lehrfaecher)==1 && ($lehrfach = $lehrfaecher[0]))
{
$lehrfach_id=$lehrfach->lehrfach_id;
}
}
// lektor der lv
$lektor_der_lv=false;
$leinfores = $this->Lehreinheit_model->getLehreinheitInfo($lvid,$angezeigtes_stsem,$lehrfach_id);
$db_result = hasData($leinfores) ? getData($leinfores) : array();
foreach($db_result as $row_lector)
{
// Lektor wird erst angezeigt wenn der Auftrag erteilt wurde
if (defined('CIS_LV_LEKTORINNENZUTEILUNG_VERTRAGSPRUEFUNG_VON')
&& CIS_LV_LEKTORINNENZUTEILUNG_VERTRAGSPRUEFUNG_VON != '')
{
if (!$this->Vertrag_model->isVertragErteiltLV($lvid, $angezeigtes_stsem, $row_lector->uid))
{
continue;
}
}
if($user == $row_lector->uid)
{
$lektor_der_lv=true;
$user_is_allowed_to_upload=true;
}
// style of the link
if($row_lector->lvleiter === true)
$style='style="font-weight: bold"';
else
$style='';
}
//Berechtigungen auf Fachbereichsebene
$lehrfach_oe_kurzbz_arr = array();
$fbres = $this->Lehrveranstaltung_model->getBerechtigungenAufFachberechsebene($lvid, $angezeigtes_stsem);
$fbs = (hasData($fbres)) ? getData($fbres) : array();
foreach($fbs as $row)
{
$lehrfach_oe_kurzbz_arr[] = $row->oe_kurzbz;
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
{
$user_is_allowed_to_upload=true;
}
}
// FH-Core Menu Logic
// ##########################################################################################
$menu = array();
$this->fhc_menu_lvinfo($menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr);
$this->fhc_menu_feedback($menu, $angemeldet, $lvid);
$this->fhc_menu_gesamtnote($menu, $angemeldet, $lvid, $lv, $is_lector, $angezeigtes_stsem);
$this->fhc_menu_emailStudierende($menu, $user, $angemeldet, $lvid, $angezeigtes_stsem);
$this->fhc_menu_abmeldung($menu, $user, $is_lector, $lvid, $angezeigtes_stsem);
$this->fhc_menu_lehretools($menu, $lvid, $angezeigtes_stsem, $sprache);
$this->fhc_menu_anrechnungStudent($menu, $lvid, $angezeigtes_stsem);
$this->fhc_menu_anrechnungLector($menu, $angezeigtes_stsem);
// Addons Menu Logic
// ##########################################################################################
$params = [
'sprache'=>$sprache,
//'p'=>$p,
'ci_p'=> $this->p,
//'db'=>$db,
'user'=>$user,
'is_lector'=>$is_lector,
'user_is_allowed_to_upload'=>$user_is_allowed_to_upload,
//'rechte'=>$rechte,
'angezeigtes_stsem'=>$angezeigtes_stsem,
//'lehreinheit'=>$lehreinheit,
'lv_obj'=>$lv,
'lv'=>$lv,
'lvid'=>$lvid,
'studiengang_kz'=>$studiengang_kz,
'semester'=>$semester,
'short'=>$short,
'stg_obj'=>$stg,
'kurzbz'=>$kurzbz,
'short_name'=>$short_name,
'short_short_name'=>$short_short_name,
//'dir_name'=>$dir_name,
'angemeldet'=>$angemeldet,
'lehrfach_id'=>$lehrfach_id,
'lektor_der_lv'=>$lektor_der_lv,
'lehrfach_oe_kurzbz_arr'=>$lehrfach_oe_kurzbz_arr,
'permissionLib' => &$this->PermissionLib,
'phrasesLib' => &$this->PhrasesLib
];
Events::trigger('lvMenuBuild',
// passing $menu per reference
function & () use (&$menu) {
return $menu;
},
$params
);
// Menu sortieren
// ##########################################################################################
foreach ($menu as $key => $row){
// removes menu points that are not needed in the c4 lvUebersicht
if( !array_key_exists('c4_link',$row) || !array_key_exists('c4_icon',$row)){
unset($menu[$key]);
continue;
}
// fills pos array to sort the menu
$pos[$key] = $row['position'];
}
array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);
// HTTP response
// ##########################################################################################
$this->terminateWithSuccess($menu);
}
private function fhc_menu_lvinfo(&$menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr){
// LVINFO
if(!defined('CIS_LEHRVERANSTALTUNG_LVINFO_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_LVINFO_ANZEIGEN)
{
$c4_linkList=array();
// Bearbeiten Button anzeigen wenn Lektor der LV und bearbeiten fuer Lektoren aktiviert ist
// Oder Berechtigung zum Bearbeiten eingetragen ist
if((!defined('CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT') && $lektor_der_lv)
|| (defined('CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT') && CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT==true && $lektor_der_lv)
|| $this->PermissionLib->isBerechtigt('lehre/lvinfo',$studiengang_kz)
|| $this->PermissionLib->isBerechtigtMultipleOe('lehre/lvinfo', $lehrfach_oe_kurzbz_arr)
)
{
$c4_linkList[]= [$this->p->t('lehre', 'lvInfoBearbeiten'), 'ects/index.php?lvid='.$lvid];
}
elseif ($is_lector)
{
$c4_linkList[]= ["Bearbeiten der LV-Infos derzeit gesperrt",'#'];
}
$menu[]=array
(
'id'=>'core_menu_lvinfo',
'position'=>'10',
'name'=>$this->p->t('lehre', 'lehrveranstaltungsinformation'),
'phrase' => 'lehre/lehrveranstaltungsinformation',
'icon'=>'../../../skin/images/button_lvinfo.png',
'link'=>'',
'c4_icon'=> base_url('skin/images/button_lvinfo.png'),
'c4_link'=>'',
'c4_linkList'=>$c4_linkList
);
}
}
private function fhc_menu_feedback(&$menu, $angemeldet, $lvid){
//FEEDBACK
if((!defined('CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN) && $angemeldet)
{
$menu[]=array
(
'id'=>'core_menu_feedback',
'position'=>'60',
'name'=>$this->p->t('lehre', 'feedback'),
'phrase' => 'lehre/feedback',
'c4_icon'=> base_url('skin/images/button_feedback.png'),
'c4_link'=> base_url('feedback.php?lvid='.$lvid),
);
}
}
private function fhc_menu_gesamtnote(&$menu, $angemeldet, $lvid, $lv_obj, $is_lector, $angezeigtes_stsem){
//Gesamtnote
if($is_lector && ((!defined('CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN) && $angemeldet))
{
if($lv_obj->benotung)
{
$menu[]=array
(
'id'=>'core_menu_gesamtnote',
'position'=>'80',
'name'=>$this->p->t('lehre', 'gesamtnote'),
'phrase' => 'lehre/gesamtnote',
'c4_icon'=> base_url('skin/images/button_endnote.png'),
'c4_link'=> base_url('cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
//'c4_link'=> base_url('benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
);
}
else
{
$menu[]=array
(
'id'=>'core_menu_gesamtnote',
'position'=>'80',
'name'=>$this->p->t('lehre', 'gesamtnote'),
'phrase'=>'lehre/gesamtnote',
'c4_icon'=>base_url('skin/images/button_endnote.png'),
'c4_link'=>'#',
'c4_linkList'=>[[$this->p->t('lehre', 'noteneingabedeaktiviert'),'#']],
);
}
}
}
private function fhc_menu_emailStudierende(&$menu, $user, $angemeldet, $lvid, $angezeigtes_stsem){
// Email an Studierende
if((!defined('CIS_LEHRVERANSTALTUNG_MAILSTUDIERENDE_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_MAILSTUDIERENDE_ANZEIGEN) && $angemeldet)
{
$mailto='mailto:';
$c4_linkList=array();
$studentMailsRes = $this->Lehrveranstaltung_model->getStudentEMail($lvid, $angezeigtes_stsem);
// get the data of the database result and map the array of objects to their object property
$studentMails = $this->getDataOrTerminateWithError($studentMailsRes, 'No student mails found');
$nomail='';
$variablesres = $this->Variable_model->getVariables($user);
$variables = (hasData($variablesres)) ? getData($variablesres) : array();
foreach ($studentMails as $row)
{
if($row->gruppe_kurzbz != '')
{
$bngrp_uids = $this->Benutzergruppe_model->getUids($row->gruppe_kurzbz, $angezeigtes_stsem);
if(count($bngrp_uids) > 0)
{
if(!$row->mailgrp)
{
$nomail = $row->gruppe_kurzbz . ' ';
}
else
{
$mailto .= mb_strtolower($row->gruppe_kurzbz . '@'
. DOMAIN . $variables['emailadressentrennzeichen']);
}
}
}
else
{
$mailto .= mb_strtolower($row->stg_typ . $row->stg_kurzbz
. $row->semester . trim($row->verband) . trim($row->gruppe)
. '@' . DOMAIN . $variables['emailadressentrennzeichen']);
}
}
if($nomail != '')
{
$c4_linkList[] = array(
$this->p->t('lehre', 'keinMailverteiler', array('nomail' => $nomail)),
'#'
);
$link_onclick = 'alert(\''.$this->p->t('lehre', 'keinMailverteiler', array('nomail' => $nomail)) . '\');';
}
else
{
$link_onclick = '';
}
$menu[]=array
(
'id'=>'core_menu_mailanstudierende',
'position'=>'100',
'name'=>$this->p->t('lehre', 'mail'),
'phrase' => 'lehre/mail',
'c4_icon'=>base_url('skin/images/button_feedback.png'),
'c4_icon2' => 'fa-regular fa-envelope',
'c4_link'=>$mailto,
'c4_linkList'=>$c4_linkList,
'link_onclick'=>$link_onclick
);
}
}
private function fhc_menu_abmeldung(&$menu, $user, $is_lector, $lvid, $angezeigtes_stsem){
if(!defined('CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN)
{
if(!$is_lector)
{
$gruppen = $this->Lvangebot_model->AbmeldungMoeglich($lvid, $angezeigtes_stsem, $user);
if(count($gruppen) > 0)
{
$menu[]=array
(
'id'=>'core_menu_abmeldung',
'position'=>'120',
'name'=>$this->p->t('lehre', 'abmelden'),
'phrase'=>'lehre/abmelden',
'c4_icon'=>base_url('skin/images/button_studiupload.png'),
'c4_link'=>base_url('abmeldung.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem)),
);
}
}
}
}
private function fhc_menu_lehretools(&$menu, $lvid, $angezeigtes_stsem, $sprache){
//Anzeigen von zusaetzlichen Lehre-Tools
$lehretools = $this->Lehretools_model->getTools($lvid, $angezeigtes_stsem, $sprache);
foreach($lehretools as $row)
{
$menu[] = array(
'id' => 'core_menu_lehretools_' . $row->lehre_tools_id,
'position' => '1000',
'name' => $row->bezeichnung,
'c4_icon' => base_url('cms/dms.php?id='.$row->logo_dms_id),
'c4_link' => $row->basis_url,
);
}
}
private function fhc_menu_anrechnungStudent(&$menu, $lvid, $angezeigtes_stsem){
// Anerkennung nachgewiesener Kenntnisse (Anrechnung) - Anzeige fuer Studenten
if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN)
&& $this->PermissionLib->isBerechtigt('student/anrechnung_beantragen'))
{
$menu[]=array
(
'id' => 'core_menu_anerkennungNachgewiesenerKenntnisse',
'position' => '128',
'name' => $this->p->t('lehre', 'anrechnung'),
'phrase' => 'lehre/anrechnung',
'c4_icon' => base_url('skin/images/button_listen.png'),
'c4_icon2' => 'fa-regular fa-folder-open',
'c4_link' => base_url('cis.php/lehre/anrechnung/RequestAnrechnung?studiensemester='.urlencode($angezeigtes_stsem).'&lv_id='.urlencode($lvid))
);
}
}
private function fhc_menu_anrechnungLector(&$menu, $angezeigtes_stsem){
// Anerkennung nachgewiesener Kenntnisse (Anrechnung) - Anzeige fuer LektorInnen
if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN)
&& $this->PermissionLib->isBerechtigt('lehre/anrechnung_empfehlen'))
{
$menu[]=array
(
'id' => 'core_menu_anerkennungNachgewiesenerKenntnisse_empfehlen',
'position' => '128',
'name' => $this->p->t('lehre', 'anrechnungen'),
'phrase' => 'lehre/anrechnung',
'c4_icon'=> base_url('skin/images/button_listen.png'),
'c4_icon2' => 'fa-regular fa-folder-open',
'c4_link' => base_url('cis.php/lehre/anrechnung/ReviewAnrechnungUebersicht?studiensemester='.urlencode($angezeigtes_stsem))
);
}
}
}
@@ -1,363 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use CI3_Events as Events;
use \DateTime as DateTime;
use \DateTimeZone as DateTimeZone;
class LvPlan extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getRoomplan' => self::PERM_LOGGED,
'Stunden' => self::PERM_LOGGED,
'getReservierungen' => self::PERM_LOGGED,
'LvPlanEvents' => self::PERM_LOGGED,
'eventsPersonal' => self::PERM_LOGGED,
'eventsLv' => self::PERM_LOGGED,
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
'studiensemesterDateInterval' => self::PERM_LOGGED,
'getLvPlanForStudiensemester' => self::PERM_LOGGED,
'getLv' => self::PERM_LOGGED
]);
$this->load->library('LogLib');
$this->loglib->setConfigs(array(
'classIndex' => 5,
'functionIndex' => 5,
'lineIndex' => 4,
'dbLogType' => 'API', // required
'dbExecuteUser' => 'RESTful API'
));
$this->load->library('form_validation');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* fetches LvPlan and Moodle events together
* @access public
*
*/
public function LvPlanEvents()
{
$hasLv = $this->input->post('lv_id');
return $hasLv ? $this->eventsLv() : $this->eventsPersonal();
}
/**
* fetches LvPlan, Moodle and Ferien events together for the logged in user
*
* @access public
*/
public function eventsPersonal()
{
$this->load->library('StundenplanLib');
// form validation
$this->form_validation->set_rules('start_date', "start_date", "required");
$this->form_validation->set_rules('end_date', "end_date", "required");
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// storing the post parameter in local variables
$start_date = $this->input->post('start_date', true);
$end_date = $this->input->post('end_date', true);
// fetching lvplan events
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date);
$lvplanEvents = $this->getDataOrTerminateWithError($result);
// fetching moodle events
$moodleEvents = $this->fetchMoodleEvents($start_date, $end_date);
// fetching ferien events
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
$this->terminateWithSuccess(array_merge(
$lvplanEvents,
$moodleEvents,
$ferienEvents
));
}
/**
* fetches LvPlan and Ferien events together for the lv
*
* @access public
*/
public function eventsLv()
{
$this->load->library('StundenplanLib');
// form validation
$this->form_validation->set_rules('start_date', "start_date", "required");
$this->form_validation->set_rules('end_date', "end_date", "required");
$this->form_validation->set_rules('lv_id', "lv_id", "required|integer");
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// storing the post parameter in local variables
$start_date = $this->input->post('start_date', true);
$end_date = $this->input->post('end_date', true);
$lv_id = $this->input->post('lv_id', true);
// fetching lvplan events
$result = $this->stundenplanlib->getEventsLv($lv_id, $start_date, $end_date);
$lvplanEvents = $this->getDataOrTerminateWithError($result);
// fetching ferien events
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
$this->terminateWithSuccess(array_merge(
$lvplanEvents,
$ferienEvents
));
}
//TODO: delete this function if we don't use the old calendar export endpoints anymore
public function studiensemesterDateInterval($date){
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
$studiensemester =$this->StudiensemesterModel->getByDate(date_format(date_create($date),'Y-m-d'));
$studiensemester =current($this->getDataOrTerminateWithError($studiensemester));
$this->terminateWithSuccess($studiensemester);
}
public function getLvPlanForStudiensemester($studiensemester,$lvid){
$this->load->library('StundenplanLib');
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
$studiensemester_result = $this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz"=>$studiensemester]);
$studiensemester_result = current($this->getDataOrTerminateWithError($studiensemester_result));
$timespan_start = new DateTime($studiensemester_result->start);
$timespan_ende = new DateTime($studiensemester_result->ende);
$lvplan = $this->stundenplanlib->getStundenplan(date_format($timespan_start, 'Y-m-d'),date_format($timespan_ende, 'Y-m-d'), $lvid);
$this->terminateWithSuccess($lvplan);
}
/**
* fetches Stunden layout from database
* @access public
*
*/
public function Stunden()
{
$this->load->model('ressource/Stunde_model', 'StundeModel');
$this->StundeModel->addOrder('stunde', 'ASC');
$stunden = $this->StundeModel->load();
$stunden = $this->getDataOrTerminateWithError($stunden);
$this->terminateWithSuccess($stunden);
}
/**
* fetches room events from a certain date
* @access public
*
* @return void
*/
public function getRoomplan()
{
$this->form_validation->set_rules('ort_kurzbz', "Ort", "required");
$this->form_validation->set_rules('start_date', "start_date", "required");
$this->form_validation->set_rules('end_date', "end_date", "required");
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// storing the post parameter in local variables
$ort_kurzbz = $this->input->post('ort_kurzbz', true);
$start_date = $this->input->post('start_date', true);
$end_date = $this->input->post('end_date', true);
// get data
$this->load->library('StundenplanLib');
$roomplan_data = $this->stundenplanlib->getRoomplan($ort_kurzbz, $start_date, $end_date);
$roomplan_data = $this->getDataOrTerminateWithError($roomplan_data);
$this->terminateWithSuccess($roomplan_data);
}
/**
* gets the reservierungen of a room if the ort_kurzbz parameter is
* supplied otherwise gets the reservierungen of the lvplan of a student
* @access public
*
* @param string $ort_kurzbz
* @return void
*/
public function getReservierungen($ort_kurzbz = null)
{
$this->form_validation->set_rules('start_date', "StartDate", "required");
$this->form_validation->set_rules('end_date', "EndDate", "required");
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// storing the post parameter in local variables
$start_date = $this->input->post('start_date', true);
$end_date = $this->input->post('end_date', true);
// get data
$this->load->library('StundenplanLib');
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz);
$result = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($result);
}
public function getLehreinheitStudiensemester($lehreinheit_id){
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
$result = $this->LehreinheitModel->load($lehreinheit_id);
$result = current($this->getDataOrTerminateWithError($result))->studiensemester_kurzbz;
$this->terminateWithSuccess($result);
}
/**
* get details for a lv
* @access public
*
* @param integer $lehrveranstaltung_id
* @return void
*/
public function getLv($lehrveranstaltung_id)
{
if (!$lehrveranstaltung_id && $lehrveranstaltung_id !== 0 && $lehrveranstaltung_id !== '0')
return show_404();
// Load Phrases
$this->loadPhrases(['lehre']);
// Validation
$this->form_validation->set_data([
'lehrveranstaltung_id' => $lehrveranstaltung_id
]);
$this->form_validation->set_rules('lehrveranstaltung_id', $this->p->t('lehre', 'lehrveranstaltung_id'), 'integer');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// Get Data
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
$result = $this->LehrveranstaltungModel->load($lehrveranstaltung_id);
$result = $this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess(current($result));
}
/**
* fetch moodle events
*
* @param string $start_date
* @param string $end_date
* @return array
*/
private function fetchMoodleEvents($start_date, $end_date)
{
$this->load->config('calendar');
$tz = new DateTimeZone($this->config->item('timezone'));
$start = new DateTime($start_date);
$start->setTimezone($tz);
$end = new DateTime($end_date);
$end->setTimezone($tz);
$end->modify('+1 day -1 second');
$moodle_events = [];
Events::trigger(
'moodleCalendarEvents',
function & () use (&$moodle_events) {
return $moodle_events;
},
[
'start_date' => $start->format('c'),
'end_date' => $end->format('c'),
'username' => getAuthUID()
]
);
return $moodle_events;
}
/**
* fetch ferien events
*
* @param string $start_date
* @param string $end_date
* @return array
*/
private function fetchFerienEvents($start_date, $end_date)
{
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->load->model('education/Studentlehrverband_model', 'StudentLehrverbandModel');
$currentStudiensemester = $this->StudiensemesterModel->getByDate($start_date);
$currentStudiensemester = $this->getDataOrTerminateWithError($currentStudiensemester);
if ($currentStudiensemester) {
$studentsemester_kurzbz = current($currentStudiensemester)->studiensemester_kurzbz;
$studiengang = $this->StudentLehrverbandModel->loadWhere([
"student_uid" => getAuthUID(),
"studiensemester_kurzbz" => $studentsemester_kurzbz
]);
$studiengang = $this->getDataOrTerminateWithError($studiengang);
if ($studiengang)
$studiengang_kz = current($studiengang)->studiengang_kz;
else
$studiengang_kz = 0;
} else {
$studiengang_kz = 0;
}
$ferienEvents = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $studiengang_kz);
return $this->getDataOrTerminateWithError($ferienEvents);
}
}
@@ -1,101 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the NavigationLib (back-end)
* Provides data to the ajax get calls about the filter
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Navigation extends FHCAPI_Controller
{
const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name
/**
* Loads the NavigationLib where the used logic lies
*/
public function __construct()
{
parent::__construct([
'menu' => self::PERM_LOGGED,
'header' => self::PERM_LOGGED
]);
$this->_loadNavigationLib(); // Loads the NavigationLib with parameters
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* This function creates the left Menu for each Page
* @param NAVIGATION_PAGE_PARAM GET Parameter witch holds the currently called Page
* @return JSON object with the Menu Entries
*/
public function menu()
{
$menuArray = $this->navigationlib->getMenuArray($this->input->get(self::NAVIGATION_PAGE_PARAM));
$this->terminateWithSuccess($menuArray);
}
/**
* This function creates the Top Menu for each Page
* @param NAVIGATION_PAGE_PARAM GET Parameter witch holds the currently called Page
* @return JSON object with the Menu Entries
*/
public function header()
{
$headerArray = $this->navigationlib->getHeaderArray($this->input->get(self::NAVIGATION_PAGE_PARAM));
$this->terminateWithSuccess($headerArray);
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the NavigationLib with the NAVIGATION_PAGE_PARAM parameter
* If the parameter NAVIGATION_PAGE_PARAM is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _loadNavigationLib()
{
// If the parameter NAVIGATION_PAGE_PARAM is present in the HTTP GET or POST
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]) || isset($_POST[self::NAVIGATION_PAGE_PARAM]))
{
// If it is present in the HTTP GET
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]))
{
$navigationPage = $this->input->get(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP GET
}
elseif (isset($_POST[self::NAVIGATION_PAGE_PARAM])) // Else if it is present in the HTTP POST
{
$navigationPage = $this->input->post(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP POST
}
// Loads the NavigationLib that contains all the used logic
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE_PARAM => $navigationPage));
}
else // Otherwise an error will be written in the output
{
show_error('Parameter "' . self::NAVIGATION_PAGE_PARAM . '" not provided!');
}
}
}
@@ -1,178 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
* Provides data to the ajax get calls about the searchbar component
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Ort extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
// NOTE(chris): additional permission checks will be done in SearchBarLib
parent::__construct([
'ContentID' => self::PERM_LOGGED,
'getOrtKurzbzContent' => self::PERM_LOGGED,
'getRooms' => self::PERM_LOGGED,
'getTypes' => self::PERM_LOGGED
]);
$this->load->model('ressource/Ort_model', 'OrtModel');
$this->config->load('raumsuche');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves all Ort entries filtered by the provided parameters
*/
public function getRooms()
{
$this->load->library('form_validation');
$this->form_validation->set_data($_GET);
$this->form_validation->set_rules('datum','Datum','required');
$this->form_validation->set_rules('von','Uhrzeit Von','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
$this->form_validation->set_rules('bis','Uhrzeit Bis','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
if($this->form_validation->run() == FALSE) {
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$datum = $this->input->get('datum', TRUE);
$von = $this->input->get('von', TRUE);
$bis = $this->input->get('bis', TRUE);
$typ = $this->input->get('typ', TRUE);
$personenanzahl = $this->input->get('personenanzahl', TRUE);
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
$this->load->model('ressource/Stunde_model', 'StundeModel');
$vonStunde = getData($this->StundeModel->getStundeForTime($von))[0]->stunde;
$bisStunde = getData($this->StundeModel->getStundeForTime($bis))[0]->stunde;
$params = array();
$qry = "SELECT DISTINCT tbl_ort.*
FROM public.tbl_ort JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
WHERE aktiv AND lehre AND ort_kurzbz NOT LIKE '\\\\_%'";
if($typ) {
$params[] = $typ;
$qry.= "AND raumtyp_kurzbz = ?";
}
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
$qry.= ' AND raumtyp_kurzbz IN ?';
$params[] = $this->config->item('roomtypes_student');
$this->addMeta('config', $this->config->item('roomtypes_student'));
}
$qry.= "AND (max_person>= ? OR max_person is null)";
$params[] = $personenanzahl;
$qry.=" AND ort_kurzbz NOT IN
(
SELECT ort_kurzbz FROM lehre.tbl_stundenplandev WHERE datum = ? AND stunde >= ? AND stunde <= ?
UNION
SELECT ort_kurzbz FROM campus.tbl_reservierung WHERE datum= ? AND stunde >= ? AND stunde <= ?
)
";
$params = array_merge($params, [$datum, $vonStunde, $bisStunde, $datum, $vonStunde, $bisStunde]);
// $this->addMeta('qry', $qry);
// $this->addMeta('params', $params);
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
$this->terminateWithSuccess($result);
}
public function getTypes()
{
$this->load->model('ressource/Raumtyp_model', 'RaumtypModel');
$qry = "SELECT * FROM public.tbl_raumtyp WHERE aktiv = true";
$params = array();
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
$qry.= ' AND raumtyp_kurzbz IN ?';
$params[] = $this->config->item('roomtypes_student');
}
$qry .= " ORDER BY raumtyp_kurzbz;";
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
$this->terminateWithSuccess(getData($result));
}
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function ContentID()
{
// if error
//$this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL);
$ort_kurzbz = $this->input->get('ort_kurzbz',TRUE);
if(!$ort_kurzbz){
$this->terminateWithError("missing ort_kurzbz parameter", self::ERROR_TYPE_GENERAL);
}
$result = $this->OrtModel->getContentID($ort_kurzbz);
if(isError($result)){
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$result = hasData($result) ? current(getData($result)) : null;
$this->terminateWithSuccess($result->content_id ?? NULL);
}
/**
* @param int $version
* @param string $sprache
* @param boolean $sichtbar
*
* @return $content
*/
public function getOrtKurzbzContent($version = null, $sprache = null, $sichtbar = true)
{
$content_id = $this->input->get("content_id",TRUE);
$this->load->library('CmsLib');
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar);
if (isError($content))
$this->terminateWithError(getError($content), self::ERROR_TYPE_GENERAL);
$content = hasData($content) ? getData($content) : null;
$this->terminateWithSuccess($content);
}
}
@@ -1,95 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the PhrasesLib (back-end)
* Provides data to the ajax get calls about the Phrasen plugin
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Phrasen extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'loadModule' => self::PERM_ANONYMOUS,
'setLanguage' => self::PERM_ANONYMOUS,
'getLanguage' => self::PERM_ANONYMOUS,
'getAllLanguages' => self::PERM_ANONYMOUS,
]);
$this->load->helper('hlp_language');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @param string $module
*/
public function loadModule($module)
{
$this->load->library('PhrasesLib', [$module], 'pj');
$this->terminateWithSuccess(json_decode($this->pj->getJSON()));
}
public function setLanguage()
{
$postParams = $this->getPostJSON();
$language = $postParams->language;
$categories = $postParams->categories;
setUserLanguage($language);
$this->load->library('PhrasesLib', array($categories, $language), 'p');
$phrases = $this->p->setPhrases($categories, $language);
$this->terminateWithSuccess($phrases);
}
// gets the langauge of the currently logged in user session and otherwhise the system language
public function getLanguage()
{
$lang = getUserLanguage();
$this->terminateWithSuccess($lang);
}
// gets all languages that are set as active in the database
public function getAllLanguages()
{
$this->load->model('system/Sprache_model', 'SprachenModel');
// Add order clause by index and select the sprache,bezeichnung and index column
$this->SprachenModel->addOrder('index');
$this->SprachenModel->addSelect('sprache, bezeichnung, index');
// Retrieves from public.tbl_sprache
$langs = $this->SprachenModel->loadWhere(array('content' => true));
$langs = $this->getDataOrTerminateWithError($langs);
$langs = array_map(function($lang){
$data = new stdClass();
$data->sprache = $lang->sprache;
$data->bezeichnung = $lang->bezeichnung[($lang->index-1)];
return $data;
}, $langs);
$this->terminateWithSuccess($langs);
}
}
@@ -1,172 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Profil extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'fotoSperre' => self::PERM_LOGGED,
'getGemeinden' => self::PERM_LOGGED,
'getAllNationen' => self::PERM_LOGGED,
'isMitarbeiter' => self::PERM_LOGGED,
'profilViewData' => self::PERM_LOGGED,
]);
$this->load->library('PermissionLib');
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('person/Person_model', 'PersonModel');
//? put the uid and pid inside the controller for reusability
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function profilViewData($uid=null){
$this->load->library('ProfilLib');
$editable = false;
if(isset($uid) && $uid != null){
$profil_data = $this->profillib->getView($uid);
if($uid == getAuthUID()){
$editable = true;
}
}else{
$editable = true;
$profil_data = $this->profillib->getView(getAuthUID());
}
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
$viewData = array(
'editable'=>$editable,
'profil_data' => $profil_data,
);
$this->terminateWithSuccess($viewData);
}
/**
* update column foto_sperre in public.tbl_person
* @access public
* @param boolean $value new value for the column
* @return boolean the new value added to the column in public.tbl_person
*/
public function fotoSperre($value)
{
if(!isset($value)){
$this->terminateWithError("Missing parameter", self::ERROR_TYPE_GENERAL);
}
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
if (isError($res)) {
$this->terminateWithError("error while trying to update table public.tbl_person");
}
$this->PersonModel->addSelect("foto_sperre");
$res = $this->PersonModel->load($this->pid);
$res = $this->getDataOrTerminateWithError($res);
$this->terminateWithSuccess(current($res));
}
/**
* gets all nations in the table bis.tbl_nation
*
* @access public
* @return array all the nations in table bis.tbl_nation
*/
public function getAllNationen()
{
// load the nationen from the database
$this->load->model('codex/Nation_model', "NationModel");
$this->NationModel->addSelect(["nation_code as code", "langtext"]);
$nation_res = $this->NationModel->load();
if (isError($nation_res)) {
$this->terminateWithError("error while trying to query table codex.tbl_nation", self::ERROR_TYPE_GENERAL);
}
$nation_res = $this->getDataOrTerminateWithError($nation_res);
$this->terminateWithSuccess($nation_res);
}
public function getGemeinden($nation, $zip)
{
if(!isset($nation) || !isset($zip)){
echo json_encode(error("Missing parameters"));
return;
}
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
$gemeinde_res = $this->GemeindeModel->getGemeindeByPlz($zip);
if (isError($gemeinde_res)) {
$this->terminateWithError(getError($gemeinde_res),self::ERROR_TYPE_GENERAL);
}
$gemeinde_res = $this->getDataOrTerminateWithError($gemeinde_res);
/* $gemeinde_res = array_map(function ($obj) {
return $obj->ortschaftsname;
}, $gemeinde_res); */
$this->terminateWithSuccess($gemeinde_res);
}
/**
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
* @access public
* @param $uid the userID used to check if it is a mitarbeiter
* @return boolean
*/
public function isMitarbeiter($uid)
{
if(!$uid) $this->terminateWithError("No uid provided", self::ERROR_TYPE_GENERAL);
$result = $this->MitarbeiterModel->isMitarbeiter($uid);
if (isError($result)) {
$this->terminateWithError("error when calling Mitarbeiter_model function isMitarbeiter with uid " . $uid, self::ERROR_TYPE_GENERAL);
}
$result = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($result);
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
}
@@ -1,957 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
class ProfilUpdate extends FHCAPI_Controller
{
public static $STATUS_PENDING = NULL;
public static $STATUS_ACCEPTED = NULL;
public static $STATUS_REJECTED = NULL;
public static $TOPICS = [];
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getStatus' => self::PERM_LOGGED,
'getTopic' => self::PERM_LOGGED,
'getProfilRequestFiles' => self::PERM_LOGGED,
'getProfilUpdateWithPermission' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
'denyProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
'acceptProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
'selectProfilRequest' => self::PERM_LOGGED,
'insertProfilRequest' => self::PERM_LOGGED,
'updateProfilRequest' => self::PERM_LOGGED,
'deleteProfilRequest' => self::PERM_LOGGED,
'insertFile' => self::PERM_LOGGED,
'updateProfilbild' => self::PERM_LOGGED,
'show' => self::PERM_LOGGED,
]);
$this->load->config('cis');
// Load language phrases
$this->loadPhrases(
array(
'ui',
'global',
'person',
'profil',
'profilUpdate'
)
);
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
$this->load->model('person/Kontakt_model', 'KontaktModel');
$this->load->model('person/Adresse_model', 'AdresseModel');
$this->load->model('person/Adressentyp_model', 'AdressenTypModel');
$this->load->model('person/Person_model', 'PersonModel');
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$this->load->model('system/Sprache_model', 'SpracheModel');
$this->load->model('person/Profil_update_status_model', 'ProfilUpdateStatusModel');
$this->load->model('person/Profil_update_topic_model', 'ProfilUpdateTopicModel');
$this->load->library('DmsLib');
$this->load->library('PermissionLib');
//? put the uid and pid inside the controller for reusability
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
// setup the ProfilUpdate states
$this->ProfilUpdateStatusModel->addSelect(['status_kurzbz']);
$status_kurzbz = $this->ProfilUpdateStatusModel->load();
if (hasData($status_kurzbz)) {
list($status_pending, $status_accepted, $status_rejected) = getData($status_kurzbz);
self::$STATUS_PENDING = $status_pending->status_kurzbz;
self::$STATUS_ACCEPTED = $status_accepted->status_kurzbz;
self::$STATUS_REJECTED = $status_rejected->status_kurzbz;
}
// setup the ProfilUpdate topics
$this->ProfilUpdateTopicModel->addSelect(['topic_kurzbz']);
$topic_kurzbz = $this->ProfilUpdateTopicModel->load();
if (hasData($topic_kurzbz)) {
foreach (getData($topic_kurzbz) as $topic) {
self::$TOPICS[$topic->topic_kurzbz] = $topic->topic_kurzbz;
}
}
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getStatus()
{
$this->terminateWithSuccess([self::$STATUS_PENDING => self::$STATUS_PENDING, self::$STATUS_ACCEPTED => self::$STATUS_ACCEPTED, self::$STATUS_REJECTED => self::$STATUS_REJECTED]);
}
public function getTopic()
{
if(!count(self::$TOPICS)){
$this->terminateWithError('No topics found');
}
$this->terminateWithSuccess(self::$TOPICS);
}
public function show($dms_id)
{
$profil_update = $this->ProfilUpdateModel->loadWhere(['attachment_id' => $dms_id]);
$profil_update = hasData($profil_update) ? getData($profil_update)[0] : null;
//? checks if an profil update exists with the dms_id requested from the user
if ($profil_update) {
$is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($profil_update->uid));
$is_student_profil_update = getData($this->StudentModel->isStudent($profil_update->uid));
if (
$this->permissionlib->isBerechtigt('student/stammdaten:r') && $is_student_profil_update ||
$this->permissionlib->isBerechtigt('mitarbeiter/stammdaten:r') && $is_mitarbeiter_profil_update ||
$this->uid == $profil_update->uid
) {
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id);
$download = $this->getDataOrTerminateWithError($download);
// Download file
$this->outputFile($download);
} else {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
}
} else {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_dms_error'));
}
}
public function selectProfilRequest()
{
$uid = $this->input->get('uid',true);
$id = $this->input->get('id',true);
$whereClause = ['uid' => $this->uid];
if (isset($uid))
$whereClause['uid'] = $uid;
if (isset($id))
$whereClause['id'] = $id;
$res = $this->ProfilUpdateModel->getProfilUpdatesWhere($whereClause);
$res = $this->getDataOrTerminateWithError($res);
$this->terminateWithSuccess($res);
}
public function insertProfilRequest()
{
$payload = $this->input->post('payload');
$topic = $this->input->post('topic',true);
$fileID = $this->input->post('fileID',true);
if(!isset($payload) || !isset($topic)){
$this->terminateWithError("required parameters are missing");
}
$identifier = array_key_exists("kontakt_id", $payload) ? "kontakt_id" : (array_key_exists("adresse_id", $payload) ? "adresse_id" : null);
$data = ["topic" => $topic, "uid" => $this->uid, "requested_change" => json_encode($payload), "insertamum" => "NOW()", "insertvon" => $this->uid, "status" => self::$STATUS_PENDING ?: 'Pending'];
//? insert fileID in the dataset if sent with post request
if (isset($fileID)) {
$data['attachment_id'] = $fileID;
}
//? loops over all updateRequests from a user to validate if the new request is valid
$res = $this->ProfilUpdateModel->getProfilUpdatesWhere(["uid" => $this->uid]);
$res = $this->getDataOrTerminateWithError($res);
//? the user cannot delete a zustelladresse/kontakt
if (isset($payload["delete"]) && $payload[$identifier == "kontakt_id" ? "zustellung" : "zustelladresse"]) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error'));
}
//? if the user tries to delete a adresse, checks whether the adresse is a heimatadresse, if so an error is raised
if (isset($payload["delete"]) && $identifier == "adresse_id") {
$adr = $this->AdresseModel->load($payload[$identifier]);
$adr = $this->getDataOrTerminateWithError($adr)[0];
if ($adr->heimatadresse) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error'));
}
}
if ($res) {
$pending_changes = array_filter($res, function ($element) {
return $element->status == (self::$STATUS_PENDING ?: "Pending");
});
foreach ($pending_changes as $update_request) {
$existing_change = $update_request->requested_change;
//? the user can add as many new kontakte/adressen as he likes
if (!isset($payload["add"]) && property_exists($existing_change, $identifier) && array_key_exists($identifier,$payload) && $existing_change->$identifier == $payload[$identifier]) {
//? the kontakt_id / adresse_id of a change has to be unique
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_changeTwice_error'));
}
//? if it is not updating any kontakt/adresse, the topic has to be unique
elseif (!$identifier && $update_request->topic == $topic) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_changeTopicTwice_error', ['0' => $update_request->topic]));
}
}
}
$insertID = $this->ProfilUpdateModel->insert($data);
if (isError($insertID)) {
$this->terminateWithError(getError($insertID));
} else {
$insertID = hasData($insertID) ? getData($insertID) : null;
//? sends emails to the correspondents of the $uid
$this->sendEmail_onProfilUpdate_insertion($this->uid, $insertID, $topic);
$this->terminateWithSuccess(success($insertID));
}
}
public function updateProfilRequest()
{
$topic = $this->input->post('topic', true);
$payload = $this->input->post('payload', true);
$ID = $this->input->post('ID', true);
$fileID = $this->input->post('fileID', true);//optional
if(!isset($topic) || !isset($payload) || !isset($ID)){
$this->terminateWithError("required parameters are missing");
}
$updateData = ["requested_change" => json_encode($payload), "updateamum" => "NOW()", "updatevon" => $this->uid];
if (isset($fileID)) {
$updateData['attachment_id'] = json_decode($fileID);
}
$updateID = $this->ProfilUpdateModel->update([$ID], $updateData);
//? insert fileID in the dataset if sent with post request
if (isError($updateID)) {
$this->terminateWithError(getError($updateID));
}
$updateID = $this->getDataOrTerminateWithError($updateID)[0];
$this->terminateWithSuccess(success($updateID));
}
public function deleteProfilRequest()
{
$requestID = $this->input->post('requestID', true);
$result = $this->ProfilUpdateModel->delete([$requestID]);
if (isError($result)) {
$this->terminateWithError(getError($result));
}
$this->terminateWithSuccess($result);
}
public function getProfilRequestFiles($id)
{
if(!$id){
$this->terminateWithError("parameter id is missing");
}
$this->ProfilUpdateModel->addSelect(["attachment_id"]);
$attachmentID = $this->ProfilUpdateModel->load([$id]);
if (isError($attachmentID)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loading_error'),self::ERROR_TYPE_GENERAL);
}
//? get the attachmentID
$dms_id = $this->getDataOrTerminateWithError($attachmentID)[0]->attachment_id;
//? get the name to the file
$this->DmsVersionModel->addSelect(["name", "dms_id"]);
$attachment = $this->DmsVersionModel->load([$dms_id, 0]);
if (isError($attachment)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_dmsVersion_error'),self::ERROR_TYPE_GENERAL);
}
$attachment = $this->getDataOrTerminateWithError($attachment);
//? returns {name:..., dms_id:...}
$this->terminateWithSuccess($attachment);
}
public function denyProfilRequest()
{
$id = $this->input->post('profil_update_id', true);
$uid = $this->input->post('uid', true);
$topic = $this->input->post('topic', true);
$status_message = $this->input->post('status_message', true); //optional
if(!isset($id) || !isset($uid) || !isset($topic)){
$this->terminateWithError("parameter id, uid, topic or status_message is missing");
}
$is_mitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
$is_mitarbeiter = $this->getDataOrTerminateWithError($is_mitarbeiter);
$is_student = $this->StudentModel->isStudent($uid);
$is_student = $this->getDataOrTerminateWithError($is_student);
if (
$is_student && $this->permissionlib->isBerechtigt('student/stammdaten', "suid", $this->getOE_from_student($uid)) ||
$is_mitarbeiter && $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', "suid")
) {
$this->sendEmail_onProfilUpdate_response($uid, $topic, self::$STATUS_REJECTED);
$this->terminateWithSuccess($this->setStatusOnUpdateRequest($id, self::$STATUS_REJECTED, $status_message));
} else {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_permission_error'),self::ERROR_TYPE_GENERAL);
}
}
public function acceptProfilRequest()
{
$id = $this->input->post('profil_update_id', true);
$uid = $this->input->post('uid', true);
$topic = $this->input->post('topic', true);
$requested_change = $this->input->post('requested_change');
$status_message = $this->input->post('status_message', true); //optional
//? fetching person_id using UID
$personID = $this->PersonModel->getByUid($uid);
$personID = $this->getDataOrTerminateWithError($personID)[0]->person_id;
//! check for required information
if (!isset($id) || !isset($uid) || !isset($personID) || !isset($requested_change) || !isset($topic)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_requiredInformation_error'));
}
$is_mitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
$is_mitarbeiter = $this->getDataOrTerminateWithError($is_mitarbeiter);
$is_student = $this->StudentModel->isStudent($uid);
$is_student = $this->getDataOrTerminateWithError($is_student);
//? check if the permissions are set correctly
if (
$is_student && $this->permissionlib->isBerechtigt('student/stammdaten', "suid", $this->getOE_from_student($uid)) ||
$is_mitarbeiter && $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', "suid")
) {
if (is_array($requested_change) && array_key_exists("adresse_id", $requested_change)) {
$insertID = $this->handleAdresse($requested_change, $personID);
$insertID = getData($insertID);
if (isset($insertID)) {
$requested_change['adresse_id'] = $insertID;
$update_res = $this->updateRequestedChange($id, $requested_change);
if (isError($update_res)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_address_error', [$insertID]));
}
}
} else if (is_array($requested_change) && array_key_exists("kontakt_id", $requested_change)) {
$insertID = $this->handleKontakt($requested_change, $personID);
$insertID = getData($insertID);
if (isset($insertID)) {
$requested_change['kontakt_id'] = $insertID;
$update_res = $this->updateRequestedChange($id, $requested_change);
if (isError($update_res)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_kontakt_error', [$insertID]));
}
}
} else {
switch ($topic) {
// mapping phrasen to database columns to make the update with the correct column names
case self::$TOPICS['Titel']:
$topic = "titelpre";
break;
case self::$TOPICS['Postnomen']:
$topic = "titelpost";
break;
case self::$TOPICS['Vorname']:
$topic = "vorname";
break;
case self::$TOPICS['Nachname']:
$topic = "nachname";
break;
default:
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_topic_error', [$topic]));
}
$result = $this->PersonModel->update($personID, [$topic => $requested_change["value"]]);
if (isError($result)) $this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_insert_error'));
}
$this->sendEmail_onProfilUpdate_response($uid, $topic, self::$STATUS_ACCEPTED);
$this->terminateWithSuccess($this->setStatusOnUpdateRequest($id, self::$STATUS_ACCEPTED, $status_message, $requested_change));
} else {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
}
}
public function insertFile($replace)
{
$replace = json_decode($replace);
if (!count($_FILES)) {
$this->terminateWithError("No file available for upload");
}
//? if replace is set it contains the profil_update_id in which the attachment_id has to be replaced
if (isset($replace)) {
$this->ProfilUpdateModel->addSelect(["attachment_id"]);
$profilUpdate = $this->ProfilUpdateModel->load([$replace]);
if (isError($profilUpdate)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loading_error'));
}
//? get the attachmentID
$dms_id = $this->getDataOrTerminateWithError($profilUpdate)[0]->attachment_id;
//? delete old dms_file of Profil Update
$deleteOldFile_result = $this->deleteOldVersionFile($dms_id);
if(!$deleteOldFile_result){
$this->terminateWithError("error while deleting the old file");
}
}
$files = $_FILES['files'];
$file_count = count($files['name']);
$res = [];
for ($i = 0; $i < $file_count; $i++) {
$_FILES['files']['name'] = $files['name'][$i];
$_FILES['files']['type'] = $files['type'][$i];
$_FILES['files']['tmp_name'] = $files['tmp_name'][$i];
$_FILES['files']['error'] = $files['error'][$i];
$_FILES['files']['size'] = $files['size'][$i];
$dms = [
"kategorie_kurzbz" => "profil_aenderung",
"version" => 0,
"name" => $_FILES['files']['name'],
"mimetype" => $_FILES['files']['type'],
"beschreibung" => $this->uid . " Profil Änderung",
"insertvon" => $this->uid,
"insertamum" => "NOW()",
];
$tmp_res = $this->dmslib->upload($dms, 'files', array("jpg", "png", "pdf"));
if(isError($tmp_res)){
$this->addError(getError($tmp_res));
}
$tmp_res = $this->getDataOrTerminateWithError($tmp_res);
array_push($res, $tmp_res);
}
$this->terminateWithSuccess($res);
}
public function updateProfilbild()
{
$resize = function($filename, $width, $height){
// Hoehe und Breite neu berechnen
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
}
else
{
$height = ($width / $width_orig) * $height_orig;
}
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
//Bild nur verkleinern aber nicht vergroessern
if($width_orig>$width || $height_orig>$height)
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
else
$image_p = $image;
imagejpeg($image_p, $filename, 80);
@imagedestroy($image_p);
@imagedestroy($image);
};
if (!count($_FILES)) {
$this->terminateWithError("No file available for upload");
}
$files = $_FILES['files'];
$_FILES['files']['name'] = current($files['name']);
$_FILES['files']['type'] = current($files['type']);
$_FILES['files']['tmp_name'] = current($files['tmp_name']);
$_FILES['files']['error'] = current($files['error']);
$_FILES['files']['size'] = current($files['size']);
$_FILES['files']['tmp_name'] = current($files['tmp_name']);
$filename = $_FILES['files']['tmp_name'];
$ext = substr(current($files['name']), strrpos(current($files['name']), '.') + 1);
if($ext!='jpg' && $ext!='jpeg'){
$this->terminateWithError("Only jpg and jpeg files are allowed for profilbild upload");
}
// resize
$resize($filename, 827, 1063);
//akte
$fp = fopen($filename,'r');
//auslesen
$content = fread($fp, filesize($filename));
$base64_content = base64_encode($content);
$this->load->library('AkteLib');
$aktenInsertResult = $this->aktelib->add($this->pid,'Lichtbil',"Lichtbild_".$this->pid.".jpg","image/jpg",$fp,"Lichtbild gross");
fclose($fp);
if (isError($aktenInsertResult)) {
$this->terminateWithError(getError($aktenInsertResult));
}
// in person abspeichern
$resize($filename, 101, 130);
$fp = fopen($filename,'r');
$content = fread($fp, filesize($filename));
fclose($fp);
$base64_content = base64_encode($content);
$this->load->model('person/Person_model','PersonModel');
$personUpdate = $this->PersonModel->update($this->pid, ["foto"=>$base64_content]);
if(isError($personUpdate)){
$this->terminateWithError(getError($personUpdate));
}
// update foto status
$this->load->model('person/Fotostatusperson_model','FotostatusModel');
$fotoInsert = $this->FotostatusModel->insert(["person_id"=>$this->pid,"fotostatus_kurzbz"=>"hochgeladen","datum"=>date('Y-m-d'),"insertamum"=>date('Y-m-d H:i:s'),"insertvon"=>$this->uid,"updateamum"=>date('Y-m-d H:i:s'),"updatevon"=>$this->uid]);
if(isError($fotoInsert)){
$this->terminateWithError(getError($fotoInsert));
}
$this->terminateWithSuccess();
}
public function getProfilUpdateWithPermission($status = null)
{
// early return if no status has been passed as argument
if (!isset($status)) {
$this->terminateWithSuccess($this->ProfilUpdateModel->getProfilUpdateWithPermission());
}
// get the sprache of the user
$sprachenIndex = $this->SpracheModel->loadWhere(["sprache" => getUserLanguage()]);
$sprachenIndex = hasData($sprachenIndex) ? getData($sprachenIndex)[0]->index : null;
if (isset($sprachenIndex) && isset($status)) {
// get the corresponding status kurz_bz primary key out of the translation
$status = $this->ProfilUpdateStatusModel->execReadOnlyQuery("select * from public.tbl_profil_update_status where ? = ANY(bezeichnung_mehrsprachig)", [$status]);
$status = hasData($status) ? getData($status)[0]->status_kurzbz : null;
$res = $this->ProfilUpdateModel->getProfilUpdateWithPermission(isset($status) ? ['status' => $status] : null);
$this->terminateWithSuccess($res);
}
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic)
{
if($this->config->item('cis_send_profil_update_mails') === false)
{
return;
}
$this->load->helper('hlp_sancho_helper');
$emails = [];
$is_mitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
if (isError($is_mitarbeiter)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_mitarbeiterCheck_error'));
}
$is_mitarbeiter = $this->getDataOrTerminateWithError($is_mitarbeiter);
//! if the $uid is a mitarbeiter and student, only the hr is notified by email
if ($is_mitarbeiter) {
//? user is not a student therefore he is a mitarbeiter, send email to Personalverwaltung
//? use constant variable MAIL_GST to mail to the personalverwaltung
$this->MitarbeiterModel->addSelect([TRUE]);
$this->MitarbeiterModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid");
//? check if the the userID is a mitarbeiter and if the benutzer is active
$res = $this->MitarbeiterModel->loadWhere(["public.tbl_mitarbeiter.mitarbeiter_uid" => $uid, "public.tbl_benutzer.aktiv" => TRUE]);
if (isError($res)) {
$this->terminateWithError("was not able to query the mitarbeiter and benutzer by the uid: " . $uid);
}
if (hasData($res)) {
array_push($emails, MAIL_GST);
} else {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_mitarbeiterCheck_error'));
}
} else {
//? if it is not a mitarbeiter, check whether it is a student and send email to studiengang
$is_student = $this->StudentModel->isStudent($uid);
if (isError($is_student)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_studentCheck_error'));
}
$is_student = $this->getDataOrTerminateWithError($is_student);
if ($is_student) {
//? Send email to the Studiengangsassistentinnen
$this->StudentModel->addSelect(["public.tbl_studiengang.email"]);
$this->StudentModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_student.student_uid");
$this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id and public.tbl_student.studiengang_kz = public.tbl_prestudent.studiengang_kz");
$this->StudentModel->addJoin("public.tbl_prestudentstatus", "public.tbl_prestudentstatus.prestudent_id = public.tbl_prestudent.prestudent_id");
$this->StudentModel->addJoin("public.tbl_studiengang", "public.tbl_studiengang.studiengang_kz = public.tbl_prestudent.studiengang_kz");
$this->StudentModel->addGroupBy(["public.tbl_studiengang.email"]);
//* check if the benutzer itself is active
//* check if the student status is Student or Diplomand (active students)
$this->StudentModel->db->where_in("public.tbl_prestudentstatus.status_kurzbz", ['Student', 'Diplomand']);
$res = $this->StudentModel->loadWhere(["public.tbl_benutzer.aktiv" => TRUE, "public.tbl_student.student_uid" => $uid]);
if (isError($res)) {
$this->terminateWithError(getError($res));
} else {
$res = $this->getDataOrTerminateWithError($res);
foreach ($res as $emailObj) {
array_push($emails, $emailObj->email);
}
}
}
}
$mail_res = [];
//? sending email
foreach ($emails as $email)
{
$href = $this->config->item('cis_vilesci_base_url') . $this->config->item('cis_vilesci_index_page') . '/Cis/ProfilUpdate/id/' . $profil_update_id;
array_push($mail_res, sendSanchoMail("profil_update", ['uid' => $uid, 'topic' => $topic, 'href' => $href], $email, ("Profil Änderung von " . $uid)));
}
foreach ($mail_res as $m_res) {
if (!$m_res) {
$this->addError($this->p->t('profilUpdate', 'profilUpdate_email_error'));
}
}
}
private function sendEmail_onProfilUpdate_response($uid, $topic, $status)
{
if($this->config->item('cis_send_profil_update_mails') === false)
{
return;
}
$this->load->helper('hlp_sancho_helper');
$email = $uid . "@" . DOMAIN;
function languageQuery($language)
{
return "select index from public.tbl_sprache where sprache = '" . $language . "'";
}
$this->ProfilUpdateStatusModel->addSelect(["bezeichnung_mehrsprachig[(" . languageQuery('German') . ")] as status_de", "bezeichnung_mehrsprachig[(" . languageQuery('English') . ")] as status_en"]);
$status_translation = $this->ProfilUpdateStatusModel->loadWhere(["status_kurzbz" => $status]);
if (isError($status_translation)) {
$this->terminateWithError($this->p->t('profilUpdate', 'ProfilUpdateStatusTranslationError'));
}
$status_translation = hasData($status_translation) ? getData($status_translation)[0] : null;
if (isset($status_translation))
{
$href = $this->config->item('cis_base_url') . $this->config->item('cis_index_page') . '/Cis/Profil';
$mail_res = sendSanchoMail("profil_update_response", ['topic' => $topic, 'status_de' => $status_translation->status_de, 'status_en' => $status_translation->status_en, 'href' => $href], $email, ("Profil Änderung " . $status_translation->status_de . ' / Profile Update ' . $status_translation->status_en));
if (!$mail_res) {
$this->addError($this->p->t('profilUpdate', 'profilUpdate_email_error'));
}
}
}
private function setStatusOnUpdateRequest($id, $status, $status_message)
{
return $this->ProfilUpdateModel->update([$id], [
"status" => $status,
"status_timestamp" => "NOW()",
"status_message" => $status_message,
"updateamum" => "NOW()",
"updatevon" => getAuthUID()
]);
}
private function updateRequestedChange($id, $requested_change)
{
return $this->ProfilUpdateModel->update([$id], ['requested_change' => json_encode($requested_change)]);
}
private function deleteOldVersionFile($dms_id)
{
if (!isset($dms_id)) {
return true;
}
// starting the transaction
$this->db->trans_start();
//? delete the file from the profilUpdate first
$profilUpdateFileDelete = $this->ProfilUpdateModel->removeFileFromProfilUpdate($dms_id);
if(isError($profilUpdateFileDelete)){
$this->terminateWithError(getError($profilUpdateFileDelete));
}
//? delete all the different versions of the dms_file
$dmsVersions = $this->DmsVersionModel->loadWhere(["dms_id" => $dms_id]);
$dmsVersions = $this->getDataOrTerminateWithError($dmsVersions);
$dms_versions = array_map(function ($item) {
return $item->version;
}, $dmsVersions);
$test_array = array();
foreach ($dms_versions as $version) {
$delete_result = $this->dmslib->removeVersion($dms_id, $version);
array_push($test_array, $delete_result);
if(isError($delete_result)){
$this->addError(getError($delete_result));
}
}
// transaction complete
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
return false;
}
else
{
return true;
}
}
private function getOE_from_student($student_uid)
{
//? returns the oe_einheit eines Studenten
$query = "SELECT public.tbl_studiengang.oe_kurzbz
FROM public.tbl_student
JOIN public.tbl_studiengang ON tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
WHERE public.tbl_student.student_uid = ?;";
$res = $this->StudentModel->execReadOnlyQuery($query, [$student_uid]);
$res = $this->getDataOrTerminateWithError($res, $this->p->t('profilUpdate', 'profilUpdate_loadingOE_error'));
$oe = ($res[0])->oe_kurzbz;
return $oe;
}
private function handleAdresse($requested_change, $personID)
{
$this->AdressenTypModel->addSelect(["adressentyp_kurzbz"]);
$adr_kurzbz = $this->AdressenTypModel->loadWhere(["bezeichnung" => $requested_change['typ']]);
$adr_kurzbz = $this->getDataOrTerminateWithError($adr_kurzbz)[0]->adressentyp_kurzbz;
//? replace the address_typ with its correct kurzbz foreign key
$requested_change['typ'] = $adr_kurzbz;
$adresse_id = $requested_change["adresse_id"];
//? removes the adresse_id because we don't want to update the kontakt_id in the database
unset($requested_change["adresse_id"]);
//! ADD
if (array_key_exists('add', $requested_change) && $requested_change['add']) {
//? removes add flag
unset($requested_change['add']);
$requested_change['insertamum'] = "NOW()";
$requested_change['insertvon'] = getAuthUID();
$requested_change['person_id'] = $personID;
//TODO: zustelladresse, heimatadresse, rechnungsadresse und nation werden nicht beachtet
$insertID = $this->AdresseModel->insert($requested_change);
$insert_adresse_id = $insertID;
$insert_adresse_id = $this->getDataOrTerminateWithError($insert_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
if ($insert_adresse_id) {
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id, $personID);
}
}
//! DELETE
elseif (array_key_exists('delete', $requested_change) && $requested_change['delete']) {
$result = $this->AdresseModel->delete($adresse_id);
if (isError($result)) {
$this->terminateWithError(getError($result));
}
}
//! UPDATE
else {
$curadresse_res = $this->AdresseModel->load($adresse_id);
$curadresse = ($this->getDataOrTerminateWithError($curadresse_res))[0];
if($curadresse->heimatadresse)
{
$tmpadresse = array_merge((array) $curadresse, $requested_change);
unset($tmpadresse["adresse_id"]);
$tmpadresse['insertamum'] = "NOW()";
$tmpadresse['insertvon'] = getAuthUID();
$tmpadresse['person_id'] = $personID;
unset($tmpadresse["heimatadresse"]);
unset($tmpadresse["updateamum"]);
unset($tmpadresse["updatevon"]);
$tmpadresse_res = $this->AdresseModel->insert($tmpadresse);
$tmpadresse_id = $this->getDataOrTerminateWithError($tmpadresse_res, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $tmpadresse_id, $personID);
}
else
{
$requested_change['updateamum'] = "NOW()";
$requested_change['updatevon'] = getAuthUID();
$update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
$update_adresse_id = $this->getDataOrTerminateWithError($update_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id, $personID);
}
}
return $insertID ?? null;
}
private function handleKontakt($requested_change, $personID)
{
$kontakt_id = $requested_change["kontakt_id"];
//? removes the kontakt_id because we don't want to update the kontakt_id in the database
unset($requested_change["kontakt_id"]);
//! ADD
if (array_key_exists('add', $requested_change) && $requested_change['add']) {
//? removes add flag
unset($requested_change['add']);
$requested_change['person_id'] = $personID;
$requested_change['insertamum'] = "NOW()";
$requested_change['insertvon'] = getAuthUID();
$insertID = $this->KontaktModel->insert($requested_change);
$insert_kontakt_id = $insertID;
$insert_kontakt_id = $this->getDataOrTerminateWithError($insert_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_insertKontakt_error'));
if ($insert_kontakt_id) {
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id, $requested_change['kontakttyp'], $personID);
}
}
//! DELETE
elseif (array_key_exists('delete', $requested_change) && $requested_change['delete']) {
$result = $this->KontaktModel->delete($kontakt_id);
if (isError($result)) {
$this->terminateWithError(getError($result));
}
}
//! UPDATE
else {
$requested_change['updateamum'] = "NOW()";
$requested_change['updatevon'] = getAuthUID();
$update_kontakt_id = $this->KontaktModel->update($kontakt_id, $requested_change);
$update_kontakt_id = $this->getDataOrTerminateWithError($update_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_updateKontakt_error'));
if ($update_kontakt_id) {
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id, $requested_change['kontakttyp'], $personID);
}
}
return isset($insertID) ? $insertID : null;
}
private function handleDupplicateZustellAdressen($zustellung, $adresse_id, $person_id)
{
if ($zustellung) {
$this->PersonModel->addSelect("public.tbl_adresse.adresse_id");
$this->PersonModel->addJoin("public.tbl_adresse", "public.tbl_adresse.person_id = public.tbl_person.person_id");
$zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $person_id, "zustelladresse" => TRUE]);
if (isError($zustellAdressenArray)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loadingZustellAdressen_error'));
}
$zustellAdressenArray = $this->getDataOrTerminateWithError($zustellAdressenArray);
if (count($zustellAdressenArray) > 0) {
$zustellAdressenArray = array_filter($zustellAdressenArray, function ($adresse) use ($adresse_id) {
return $adresse->adresse_id != $adresse_id;
});
$this->addMeta('bhzustelladressen', $zustellAdressenArray);
// remove the zustelladresse from all other zustelladressen
foreach ($zustellAdressenArray as $adresse) {
$this->AdresseModel->update($adresse->adresse_id, ["zustelladresse" => FALSE]);
}
}
}
}
private function handleDupplicateZustellKontakte($zustellung, $kontakt_id, $kontakttyp, $person_id)
{
if ($zustellung) {
$this->PersonModel->addSelect("public.tbl_kontakt.kontakt_id");
$this->PersonModel->addJoin("public.tbl_kontakt", "public.tbl_kontakt.person_id = public.tbl_person.person_id");
$zustellKontakteArray = $this->PersonModel->loadWhere([
"public.tbl_person.person_id" => $person_id,
"zustellung" => TRUE,
"kontakttyp" => $kontakttyp
]);
if (!isSuccess($zustellKontakteArray)) {
return error($this->p->t('profilUpdate', 'profilUpdate_loadingZustellkontakte_error'));
}
$zustellKontakteArray = hasData($zustellKontakteArray) ? getData($zustellKontakteArray) : null;
if ($zustellung && count($zustellKontakteArray) > 0) {
$zustellKontakteArray = array_filter($zustellKontakteArray, function ($kontakt) use ($kontakt_id) {
return $kontakt->kontakt_id != $kontakt_id;
});
foreach ($zustellKontakteArray as $kontakt) {
$this->KontaktModel->update($kontakt->kontakt_id, ["zustellung" => FALSE]);
}
}
}
}
}
@@ -1,72 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use CI3_Events as Events;
class RendererLoader extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'GetRenderers' => self::PERM_LOGGED,
]);
$this->load->library('LogLib');
$this->loglib->setConfigs(array(
'classIndex' => 5,
'functionIndex' => 5,
'lineIndex' => 4,
'dbLogType' => 'API', // required
'dbExecuteUser' => 'RESTful API'
));
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* fetches Stundenplan and Moodle events together
* @access public
*
*/
public function GetRenderers(){
$renderer_paths = [];
Events::trigger(
'loadRenderers',
function & () use (&$renderer_paths)
{
return $renderer_paths;
}
);
$this->terminateWithSuccess($renderer_paths);
}
}
@@ -1,60 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class RouteInfo extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'info' => self::PERM_LOGGED,
]);
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
}
public function info()
{
$payload = json_decode($this->input->raw_input_stream);
if (isset($payload->app) && isset($payload->path) && $this->isValidApp($payload->app) && $this->isValidPath($payload->path))
{
$this->WebservicelogModel->insert(array(
'webservicetyp_kurzbz' => 'content',
'beschreibung' => $payload->app,
'request_data' => $payload->path,
'execute_user' => getAuthUID(),
'execute_time' => 'NOW()'
));
}
$this->terminateWithSuccess(true);
}
protected function isValidApp($app)
{
return preg_match("/^[A-Za-z0-9\-_]+$/", $app);
}
protected function isValidPath($path)
{
return preg_match("/^[\/A-Za-z0-9_.\-~?%=&;]+$/", $path);
}
}
@@ -1,128 +0,0 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
* Provides data to the ajax get calls about the searchbar component
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Searchbar extends FHCAPI_Controller
{
const SEARCHSTR_PARAM = 'searchstr';
const TYPES_PARAM = 'types';
/**
* Object initialization
*/
public function __construct()
{
// NOTE(chris): additional permission checks will be done in SearchBarLib
parent::__construct([
'search' => self::PERM_LOGGED,
'searchCis' => self::PERM_LOGGED,
'searchStv' => self::PERM_LOGGED
]);
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function search()
{
$this->load->library('SearchBarLib');
$this->load->library('form_validation');
// Checks if the searchstr and the types parameters are in the POSTed JSON
$this->form_validation->set_rules(self::SEARCHSTR_PARAM, null, 'required');
$this->form_validation->set_rules(self::TYPES_PARAM . '[]', null, 'required');
if (!$this->form_validation->run())
$this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL);
// Convert to json the result from searchbarlib->search
$result = $this->searchbarlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
if (property_exists($result, 'error'))
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
$this->addMeta('mode', 'simple');
$this->terminateWithSuccess($result->data);
}
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function searchCis()
{
return $this->searchAdvanced([ 'config' => 'searchcis' ]);
}
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function searchStv()
{
return $this->searchAdvanced([ 'config' => 'searchstv' ]);
}
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
private function searchAdvanced($config)
{
$this->load->library('SearchLib', $config);
$this->load->library('form_validation');
// Checks if the searchstr and the types parameters are in the POSTed JSON
$this->form_validation->set_rules(self::SEARCHSTR_PARAM, null, 'required');
$this->form_validation->set_rules(self::TYPES_PARAM . '[]', null, 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// Convert to json the result from searchlib->search
$result = $this->searchlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
$this->WebservicelogModel->insert(array(
'webservicetyp_kurzbz' => 'content',
'beschreibung' => $config['config'],
'request_data' => json_encode(array(
self::SEARCHSTR_PARAM => $this->input->post(self::SEARCHSTR_PARAM),
self::TYPES_PARAM => $this->input->post(self::TYPES_PARAM)
)),
'execute_user' => getAuthUID(),
'execute_time' => 'NOW()'
));
$data = $this->getDataOrTerminateWithError($result);
$this->addMeta('time', $result->meta['time']);
$this->addMeta('searchstring', $result->meta['searchstring']);
$this->addMeta('mode', 'advanced');
$this->terminateWithSuccess($data);
}
}

Some files were not shown because too many files have changed in this diff Show More