Compare commits

..
Author SHA1 Message Date
Paolo e94eb33d81 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-10-05 14:55:32 +02:00
Harald Bamberger 4ba2869632 Merge branch 'master' into bugfix-83059_incorrect-ical-semester-parameters 2026-10-05 11:22:59 +02:00
Andreas Österreicher 293bb77179 Merge branch 'bug-44023/EingabemaskeEntwicklungsteamNamenOhneUid2' 2026-10-02 13:23:02 +02:00
Andreas Österreicher 3fe10d715d Fixed Saving of Entwicklungsteam 2026-10-02 13:14:41 +02:00
Andreas Österreicher 36064afbba Fixed Testing Projektarbeit Seeds 2026-10-01 15:33:05 +02:00
Harald Bamberger f3d031ab16 cismenu: add cis-main-menu class to main nav, add li elements to ul, style cis-main-menu ul and li to prevent interferec with cms content styles, add draggable false to cis menu entries to improve menu scrolling especially on mobile devices 2026-10-01 11:48:51 +02:00
Harald Bamberger 3d8c4fa4d0 Merge branch 'feature-77757/WidgetsBerechtigung' 2026-09-30 15:48:00 +02:00
Harald Bamberger 272014bd78 remove odd phrases 2026-09-30 15:38:43 +02:00
Harald Bamberger 76a8e00edf Merge branch 'master' into feature-77757/WidgetsBerechtigung 2026-09-30 15:23:08 +02:00
Paolo 5d6a6b9413 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-09-30 13:55:02 +02:00
Harald Bamberger ce62713790 Merge branch 'bug-82297/ausweis-date-preview-issue' 2026-09-30 12:11:13 +02:00
Harald Bamberger 34761db664 rename phrase 2026-09-30 10:56:30 +02:00
Harald Bamberger c7131ed775 revert changes to old cis since issue does not occur there 2026-09-30 10:53:01 +02:00
Harald Bamberger b57e1984a8 Merge branch 'master' into bug-82297/ausweis-date-preview-issue 2026-09-30 10:20:28 +02:00
Harald Bamberger acedc11be8 adapt styling detailheader employees 2026-09-24 14:39:38 +02:00
Harald Bamberger 15c1da74a2 CisMenu: do not overwrite calculated url if menuitem is multiple times in menu tree 2026-09-23 16:09:42 +02:00
Harald Bamberger d33b45d7cb Merge branch 'bhdev_backport_compat' 2026-09-23 14:58:26 +02:00
Andreas Österreicher b3b6d847a7 Merge branch 'feature-62260/international_skills_groupheader_filter' 2026-09-23 14:36:13 +02:00
Andreas Österreicher 80365de28c Merge branch 'feature-62602/mehrfachnennungen_innerhalb_einer_kategorie' 2026-09-23 14:35:36 +02:00
Andreas Österreicher 2d74522a4f Merge branch 'feature-54225/reihungstest_ablauf_fuer_quereinsteiger' 2026-09-23 12:28:35 +02:00
ma0048 d00aef66e1 master gemerged 2026-09-23 11:32:01 +02:00
ma0048 241eec3ef2 Merge remote-tracking branch 'origin/master' into feature-54225/reihungstest_ablauf_fuer_quereinsteiger
# Conflicts:
#	cis/testtool/menu.php
#	system/dbupdate_3.4.php
2026-09-23 11:29:43 +02:00
Andreas Österreicher 2050f5ae65 Merge branch 'feature-75891/Electronic_Onboarding_Infocenter_Tool' 2026-09-23 11:14:01 +02:00
Andreas Österreicher 587e523990 Merge branch 'feature-67251/infocenter_zum_reihungstest_freigegeben_neue_spalte_eqk' 2026-09-23 11:03:20 +02:00
Andreas Österreicher 5ec1a1c54c Merge branch 'feature-77686/infocentertool_status_setzen_fuer_zgv_pruefung_soll_message_ausloesen' 2026-09-23 10:56:54 +02:00
Andreas Österreicher 2c65ccc8da Merge branch 'bug-77684/reihungstest_auswertung_freischalten_sperren' 2026-09-23 09:40:37 +02:00
Andreas Österreicher 787308aad4 Merge branch 'feature-77356/teilgenommen_setzen_beim_reihungstest_punkte_uebertragen' 2026-09-23 09:37:41 +02:00
Harald Bamberger 8b44e4475b Merge branch 'master' of github.com:FH-Complete/FHC-Core into bhdev_backport_compat 2026-09-22 16:51:34 +02:00
Harald Bamberger d251987850 backport compat controller and component 2026-09-22 16:50:56 +02:00
Harald Bamberger ba92eea7eb studvw: fix lvtermine student_lehrverband 2026-09-22 14:09:51 +02:00
Harald Bamberger 50951dfdcf anrechnungen: add pdf file extension to content disposition filename 2026-09-22 13:00:28 +02:00
Harald Bamberger be7527e994 increase length of column taglib in table public.tbl_notiz_typ 2026-09-22 09:52:09 +02:00
Harald Bamberger d5c1721ab1 Merge branch 'feature-83457/cis4_redirect_blank_target' 2026-09-18 17:14:49 +02:00
Harald Bamberger 8eb27b194f add target attribute to redirect content menu entries, use entry target attribute if set when rendering cis4 menu 2026-09-18 17:12:30 +02:00
Harald Bamberger 579a55a00d fix nested ternary operators 2026-09-17 14:18:10 +02:00
Andreas Österreicher 0a00caa1e4 Merge branch 'feature-82683/lvverwaltung_zusaetzliche_spalten_bei_lehrenden' 2026-09-17 14:00:07 +02:00
ma0048 224cef7fad bug beim Loeschen von Antworten eines Prueflings in reihungstet_administration.php fixed 2026-09-17 13:29:58 +02:00
Andreas Österreicher c53040ed5c Zusätzliche Datumsberechnung für Zutrittskarten hinzugefügt 2026-09-17 11:21:23 +02:00
Harald Bamberger f7465047cb Merge branch 'feature-75469/LeOptional4Projektarbeit' 2026-09-16 17:35:55 +02:00
Alexei Karpenko 0dadaece08 Merge branch 'master' into feature-75891/Electronic_Onboarding_Infocenter_Tool 2026-09-16 16:59:09 +02:00
Johann Hoffmann 69fd223358 fix load projektarbeit.studiensemester_kurzbz for fetchProjektarbeitById in order to query getDefaultStundensaetze successfully 2026-09-15 11:49:19 +02:00
Harald Bamberger 9c43374267 Merge branch 'master' into feature-75469/LeOptional4Projektarbeit 2026-09-15 07:53:10 +02:00
Paolo ea7c0cccde Added base seeders for testing/staging/demoing 2026-09-14 16:36:12 +02:00
Harald Bamberger 6dfe292776 API LV: extend regex to allow studiengang_kz 0 2026-09-14 11:09:45 +02:00
ma0048 c90f7a31bb columns hinzugefuegt: insertvon/updatevon insertamum/updateamum 2026-09-11 12:03:06 +02:00
Harald Bamberger c8c7d1566c Merge branch 'master' into bugfix-83059_incorrect-ical-semester-parameters 2026-09-11 11:43:23 +02:00
Alexei Karpenko 073160dde4 Merge branch 'master' into feature-75891/Electronic_Onboarding_Infocenter_Tool 2026-09-10 20:08:08 +02:00
Paolo ae935326d1 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-09-10 12:30:03 +02:00
Johann Hoffmann 56fe8c9d09 Merge remote-tracking branch 'origin/feature-75469/LeOptional4Projektarbeit' into feature-75469/LeOptional4Projektarbeit 2026-09-10 11:51:26 +02:00
Johann Hoffmann 9a3532265f information schema guard check for the data migration & table alter statements aswell, so they dont run on every checksystem.php invocation 2026-09-10 11:50:51 +02:00
Harald Bamberger 4abe6f0d24 Merge branch 'bugfix_missing-studvw-filter-clear-action-button' 2026-09-09 16:15:39 +02:00
adisposkofh 9fbbd6b855 moved studvw 'clear filter' action button into 'actions' slot in the filter component 2026-09-09 15:14:20 +02:00
Andreas Österreicher 59b4b2bac9 Merge branch 'feature-71639/StudVw_Noten_Renaming_Infopopup' 2026-09-09 12:40:42 +02:00
Andreas Österreicher 5f546fca2a Merge branch 'feature-82630/Infocenter_Verlinkung_StudVW' 2026-09-09 12:37:33 +02:00
adisposkofh 9d4218bf38 implemented displayed semester/ical dates changes from my lv plan to other lv plan 2026-09-09 11:36:19 +02:00
adisposkofh 67f30c7765 fixed issue with wrong semester displayed and wrong ical dates used in my lv plan 2026-09-09 11:30:43 +02:00
Andreas Österreicher 1bf2b707ef Merge branch 'master' into feature-75469/LeOptional4Projektarbeit 2026-09-09 09:43:11 +02:00
Andreas Österreicher f74b885253 Abfrage von Verträgen korrigiert für Fälle wo der Monatsletzte gleichzeitig der Start des neuen Studiensemesters ist (zB 31.08.2026) damit die Abrechnung korrekt funktioniert (BFI) 2026-09-09 08:55:24 +02:00
Andreas Österreicher 3ab402adef Merge branch 'bugfix-82884_grades-export-group-names' 2026-09-08 14:43:17 +02:00
Manuela Thamer 52f24645fb update link StudVW 2026-09-08 14:23:59 +02:00
Manuela Thamer 4ac108174b rename title delete button 2026-09-08 08:29:08 +02:00
adisposkofh 6378b80d87 fixed issue where exported gradelist excel file formatted group names as numbers 2026-09-07 15:24:38 +02:00
Andreas Österreicher 658c8d6bd4 Schreibberechtigungsprüfung bei Anrechnungen angepasst damit diese korrekt angezeigt wird wenn oe_kurzb nicht gleich der Kurzbz des Studiegangs ist 2026-09-03 08:44:10 +02:00
Andreas Österreicher bf29faa5a7 Merge branch 'feature-82292/Cis4StudiumLVohneModulAnzeigen' 2026-09-02 15:20:28 +02:00
Andreas Österreicher 2ada167557 Merge branch 'bug-82614/StudVw_International_Incoming_Outgoing_GS_wird_nicht_geladen' 2026-09-02 14:56:27 +02:00
chfhtw cc9d1f983e bugfix: missing call to getStudiensemesterKurzbz 2026-09-01 10:39:02 +02:00
Ivymaster 5fff45e302 Added check for date existence 2026-08-27 11:00:43 +02:00
Johann Hoffmann 57c48f2c4a cis4 studium page dont filter away lehrveranstaltungen without a module and give them their own box in the ui; 2026-08-26 13:15:16 +02:00
Andreas Österreicher e32691994c Merge branch 'master' into feature-75469/LeOptional4Projektarbeit 2026-08-26 08:21:30 +02:00
Paolo dee1db8282 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-08-13 10:40:14 +02:00
Johann Hoffmann 46f8d0d07d remove all remaining projektarbeit-lehreinheit joins across the codebase;
master merge reverted the LE removal in Projektarbeit_model -> re-applied that fix and went through every file that touches tbl_projektarbeit to find remaining issues.

Projektarbeit_model, stv Projektarbeit controller, Vertrag_model, vertrag.class, lehrauftragsliste_gst.xls.php, zeitaufzeichnung.class.php, sammelzeugnis.rdf.php, zeugnis.rdf.php, projektarbeit.rdf.php,
lehrauftrag.xml.php, personal_lektorenohnelehrauftrag.php, personal_generateverwendung.php

tbl_lehreinheit joins remain in tbl_lehreinheitmitarbeiter contexts where lehreinheit_id is always set.
2026-08-12 18:05:45 +02:00
Johann Hoffmann 9274743df3 Merge branch 'master' into feature-75469/LeOptional4Projektarbeit
# Conflicts:
#	application/controllers/api/frontend/v1/Abgabe.php
#	application/controllers/api/frontend/v1/stv/Projektarbeit.php
#	application/models/education/Projektarbeit_model.php
#	public/css/Studentenverwaltung.css
#	public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js
#	public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js
#	public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektarbeit.js
#	public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js
2026-08-12 11:26:51 +02:00
Johann Hoffmann d40040efd8 added new fkey to tbl_widget for system.tbl_berechtigung; check for permission status during load & in widget picker; if widget was already picked/configured but not permitted anymore -> show a generalized "missing permission" screen via fallback component during widget init; 2026-07-21 18:14:26 +02:00
ma0048 66e400013a bei status setzen fuer zgv pruefung message rausschicken 2026-07-14 13:30:32 +02:00
ma0048 3f95bfd82f boolean auf fhc_boolean geandert 2026-07-14 11:31:23 +02:00
Paolo 10896909d4 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-07-09 10:48:04 +02:00
Andreas Österreicher 9629345473 Merge branch 'master' into feature-62260/international_skills_groupheader_filter 2026-07-08 15:28:23 +02:00
Andreas Österreicher 4d72b0047a Merge branch 'master' into feature-62602/mehrfachnennungen_innerhalb_einer_kategorie 2026-07-08 15:26:41 +02:00
ma0048 dc22ac6b06 teilgenommen setzen beim uebetragen der punkte 2026-06-30 17:03:43 +02:00
Johann Hoffmann f4cc311806 getFormData (which loads lehrveranstaltungen) on editProjektarbeit + always query with student.studiengang_kz to have the same set of options when creating the projektarbeit; should work for incomings aswell. first attempt: lva in studienplan of last studentenstatus; if that yields no options just take the full lv list; 2026-06-17 10:44:55 +02:00
Johann Hoffmann df46b8ebdd Merge remote-tracking branch 'origin/master' into feature-75469/LeOptional4Projektarbeit 2026-06-16 10:46:44 +02:00
Paolo 8ae4a0ef3d Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-06-11 12:49:46 +02:00
Johann Hoffmann 870c36e76b Merge remote-tracking branch 'origin/master' into feature-75469/LeOptional4Projektarbeit
# Conflicts:
#	system/dbupdate_3.4.php
2026-05-20 16:22:31 +02:00
Alexei Karpenko 96b2d88d39 Merge branch 'master' into feature-75891/Electronic_Onboarding_Infocenter_Tool 2026-04-27 18:19:42 +02:00
Alexei Karpenko 474fc1fc57 Notiz model: possible to add specific insertvon 2026-04-27 18:17:29 +02:00
Alexei Karpenko 3825e2fb38 adresse class: added method to get austrian adress 2026-04-27 17:56:18 +02:00
Paolo 92465fd943 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-04-27 13:03:56 +02:00
Johann Hoffmann 4c0635be7c adapt lehrauftrag.xml.php queries to find projektbetreuer mitarbeiter_uid of projektarbeiten without le in future semesters for the lehrauftrag dokument (single lehrauftrag dokument curated for one betreuer) and also for the aggregated statistik listing the costs of all lehraufträge in a studiengang - resulting in the same data; 2026-04-02 16:45:03 +02:00
Johann Hoffmann 67b863f9db implemented the same studienplan lva_id check for stv projektarbeit anlage inside lva.rdf and lva.class; should result in the same data even though the quereies are written a second time; 2026-04-02 11:51:37 +02:00
Johann Hoffmann 7628ebc9ca remove unnecessary LE join in diplomasupplement.xml.php; fix studiensemester_kurzbz col datatype in dbupdate script; stv projektarbeit dropdown selection also by studienplan of current prestudent_status history entry 2026-04-01 16:05:51 +02:00
Johann Hoffmann deb6dad7ad WIP trying to get diplomasupplement.xml.php to print a thesis title; remove console log stv; removed le from getProjektarbeitStudiensemester in projektarbeit.class.php; 2026-03-30 18:45:01 +02:00
Johann Hoffmann 077f052112 stv projektarbeit getFormData call on actionEditProjektarbeit 2026-03-30 14:26:58 +02:00
Johann Hoffmann e7f57c9ddd remove last pa-le join from statistik/lvplanung.php 2026-03-30 13:52:50 +02:00
Johann Hoffmann 095e2bf581 revert lvgesamtnoteverwalten.php change 2026-03-27 11:29:04 +01:00
Johann Hoffmann 25345a0522 remove le join from vertrag.class.php; lehrauftrag_annehmen.xml.php fix 2nd query; 2026-03-27 11:24:38 +01:00
Johann Hoffmann e2b5201b5a remove le join from vertrag.class.php 2026-03-27 11:09:34 +01:00
Johann Hoffmann 5c80a382bf remove le join from lehrauftragsliste_gst.xls.php 2026-03-27 11:01:17 +01:00
Johann Hoffmann aa940683d6 remove le join from lvgesamtnoteverwalten.php 2026-03-27 10:49:13 +01:00
Johann Hoffmann 843c65d52b Lehraufträge workflow wurde angepasst & getestet für zukünftige Projektarbeiten ohne hinterlegte LE. Subqueries "Projektbetreuungsaufträge and -vertragsstati" verwenden KEINE Lehreinheit table mehr, join funktioniert via pb -> pa -> lva & where clauses wurden entsprechend auf pa.lva & pa.sem_kurzbz angepasst für orderLehrauftragData.php, approveLehrauftragData.php & acceptLehrauftragData.php.
Weitere Anpassung in Vertrag_model: prüfung auf lehreinheit nur wenn vertragstyp nicht 'Betreuung' ist.

Added missing "setFormData" Method in stv Projektarbeit Details component
2026-03-25 11:56:19 +01:00
Johann Hoffmann e26f4262df LEFT join tbl_projektarbeit with tbl_lehreinheit to account for nullability 2026-03-24 16:08:20 +01:00
Paolo 5df7358aff Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-03-24 10:51:09 +01:00
Johann Hoffmann dde586e004 Merge remote-tracking branch 'origin/master' into feature-75469/LeOptional4Projektarbeit 2026-03-23 15:37:57 +01:00
Johann Hoffmann 506c23ae89 fix joins in lehrauftragData files from 'pa JOIN lv JOIN le' to 'pa JOIN le JOIN lv'; fix join in projektarbeit.class.php "getProjektarbeitStudiensemester" to also correctly join on le table first but with lva_id & sem_kurzbz as join conditions; push all the relevant changes from "feature-75838/UXImproveProjektarbeitSTVSprint247" since we apparently still want them in the LE optional branch; fix FAS issue where lva dropdown loaded a limited list when existing projektarbeit was loaded into UI -> now query the lehrveranstaltung.rdf with the stg_kz selected and then set the value to achieve desired behaviour; 2026-03-23 15:29:16 +01:00
Alexei Karpenko e90e03e0cc infocenter: added info if registered with electronic onboarding, or login with Electronic Onboarding. controller: moved public methods up to public section, hand cursor appear on all links in Stammdaten section 2026-03-18 13:47:24 +01:00
Johann Hoffmann 335671b46a query fix 2026-03-17 17:03:18 +01:00
Johann Hoffmann 19b8c16057 specify lehrveranstaltung_id in 2 rdf queries 2026-03-17 16:15:47 +01:00
Johann Hoffmann dea3aac222 WIP stv projektarbeit detail modal ux rework 2026-03-16 17:20:31 +01:00
Johann Hoffmann 5d7281e470 Merge branch 'master' into feature-75469/LeOptional4Projektarbeit
# Conflicts:
#	application/controllers/api/frontend/v1/Abgabe.php
#	public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js
#	public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js
#	public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Details.js
#	public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js
#	system/phrasesupdate.php
2026-03-16 12:36:30 +01:00
Johann Hoffmann a7d925a177 even more legacy query projektarbeit join updates le_id -> lva_id & sem_kurzbz; WIP somehow touching the holy statistik queries 2026-03-13 12:58:55 +01:00
Johann Hoffmann 4ef4a06a7e more legacy query projektarbeit join updates le_id -> lva_id & sem_kurzbz 2026-03-12 18:30:12 +01:00
Johann Hoffmann 29515491a2 WIP legacy queries refactor projektarbeit lehreinheit optional 2026-03-12 14:02:52 +01:00
Johann Hoffmann 6cb8d0a9d1 projektarbeit fas tab lva_id & sem_kurzbz required; le optional 2026-03-11 15:06:11 +01:00
Johann Hoffmann 2c4574d93b form input bugfix where 2 inputs where needed for select elements after invalid validation; Abgabetool Download Latest Action; WIP stv projektarbeit details/betreuer considerations; WIP adding le_id -> lva_id & sem_kurzbz to FAS code; 2026-03-10 16:45:15 +01:00
Johann Hoffmann 2fde630971 adjust abgabetool queries Studentenverwaltung Projektarbeit Tab: lehreinheit required -> lehreinheit optional, lehrveranstaltung & studiensemester_kurbz required; changed occurences of the typo "Studiensemster" rigorously; 2026-03-09 15:25:44 +01:00
Johann Hoffmann fce5ee7a16 adjust abgabetool queries lehreinheit -> lehrveranstaltung table; always redraw with scrollX/Y preserve in abgabetool 2026-03-09 11:24:17 +01:00
Johann Hoffmann 8ccb9cd892 db migrate skript from le_id -> lva_id & stsem_kurzbz via existing references 2026-03-06 11:47:09 +01:00
Johann Hoffmann d1af44bcdc dbupdate entry; WIP table altering statements for lehre.tbl_projektarbeit 2026-03-05 17:33:18 +01:00
Paolo c70129cf37 Code cleaning OP#71539 2026-02-23 14:55:50 +01:00
Paolo 4b8f757a7c Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-02-23 12:26:37 +01:00
Alexei Karpenko e1bad61a27 api/frontend/Documents.php: removed addmeta debugging calls 2026-02-09 18:53:51 +01:00
Alexei Karpenko f4d8a396f5 document export bugfixes: getting content from db in Documents.php, correctly return data in Dokumente.php, passing temp folder in DocumentExportLib, path fix in DocumentLib, correct parameters in Archiv.php getByPersonId call, Archiv.js: check if array is returned, different controller for download (dokumente instead of akte) 2026-02-09 14:22:39 +01:00
Paolo 0b797cfdb1 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-02-09 12:35:12 +01:00
Alexei Karpenko 7909edb402 fixed bug in FHC_Controller outputFile method: corrected filename header name 2026-02-03 17:32:38 +01:00
Paolo 7a7cda3488 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2026-01-13 16:38:13 +01:00
ma0048 c664c14afc phrase hinzugefuegt 2025-12-18 11:10:08 +01:00
ma0048 efc67d14a5 qulikurs spalte hinzugekommen bei infocenter freigegebendata 2025-11-06 12:38:13 +01:00
Paolo 3f52b8c8d1 Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2025-10-21 15:04:48 +02:00
ma0048 9183c4f04c massnahme einmalig flag hinzugefuegt 2025-10-01 12:03:18 +02:00
Paolo deaacc494d Fixed indentation 2025-10-01 11:05:41 +02:00
Paolo 21733d1e5e Merge branch 'master' into feature-61599/DocumentExportLib_erweitern 2025-10-01 09:39:40 +02:00
Paolo 28ef0b5892 Replaced global function uploadFile with the protected method FHC_Controller->uploadFile 2025-09-29 09:37:39 +02:00
Paolo 1657ae8291 - Removed global function uploadFile from application/helpers/hlp_common_helper.php
- Added new protected method uploadFile to application/core/FHC_Controller.php
- Replaced global function uploadFile with the protected method FHC_Controller->uploadFile
2025-09-29 09:32:21 +02:00
Paolo 517f39dc1f Removed unused parameter from the application/libraries/DmsLib.php constructor 2025-09-24 14:29:31 +02:00
Paolo b129bb659b - application/libraries/DocumentExportLib.php now makes use of the application/libraries/SignatureLib.php
- Fixex & improvements
2025-09-18 10:40:28 +02:00
Paolo d54ab06ad4 - Removed DocumentExportLib->showContent
- Adapted code to replace DocumentExportLib->showContent with DocumentExportLib->getContent + file download
- DocumentExportLib now makes use of the DocumentLib
2025-09-17 16:53:14 +02:00
Paolo 2dc341e048 Removed DMS_PATH from the file name in the DmsLib->getOutputFileInfo 2025-09-16 17:37:55 +02:00
Paolo 36f857428e - Fixed typos
- application/controllers/Cis/Pub.php bild method refactored
- Replaced AkteModel with AkteLib where possible
- application/core/FHC_Controller->outputFile added new features + improvements
- Added new public methods outputImageByContent and outputImageByFile to application/core/FHC_Controller
- Added new private method _outputImage to application/core/FHC_Controller
- AkteLib fixes
2025-09-16 17:12:59 +02:00
Paolo 909eb0bf57 Fixed AkteLib->_remove 2025-09-15 17:42:40 +02:00
Paolo 949fdfa5ca - DmsLib->download removed
- DmsLib->upload replaced by uploadFile
- Removed who parameter from DmsLib constructor
- Added insert by into DmsLib add and addLastVersion
- Removed commented code
- Replaced self with $this in the Anrechnung classes
- Added removeByPersonIdAndDmsId to AkteLib
2025-09-15 17:16:48 +02:00
Paolo 6edc8a127f Fixed application/libraries/DocumentExportLib.php to generate docs with DocsboxLib 2025-09-09 15:55:56 +02:00
Paolo eaacbcf7cc - Bugfix in application/controllers/Cis/Documents.php
- application/libraries/AkteLib.php->_get fixes
- b/application/libraries/DmsLib.php better handling when no DMS is found
2025-09-09 15:48:53 +02:00
Paolo 88cdd43b3e Fixed AkteLib 2025-09-09 14:28:36 +02:00
Paolo 2ee0c95467 - DmsLib:
- Removed deprecated methods from the DMSLib, these were the "problematic" types of methods:
		- Methods that would perform an upload/download of the file (should be performed by a controller)
		- Methods that were returning a base64 representation of the file (what if the file is a 1Gb?)
		- Methods that were performing operation on the akte (should be done in the AkteLib)
	- The first two types have been removed and added new utility method to read a file (wrapper of the DMSFSModel)
	- The last type of methods has been removed and same functionalities already exists in the AkteLib
	- Minor fixes
- AkteLib:
	- Added new methods to get an akte with relative content (even from the DMS) with different parameters (akte_id, person_id, dokument_kurzbz, signiert, stud_selfservice)
- AkteModel:
	- Removed the getArchiv method
- Replaced the usage of the AkteModel with the AkteLib as much as possible. AkteModel is used mainly to quickly check if an akte exists or not, otherwise the AkteLib is used for read/write operations
- Replaced the DmsLib usage with the AkteLib usage where the old deprecated DmsLib methods, that were working with the akte too, were used
2025-09-09 13:28:56 +02:00
ma0048 6495f741b9 added missing phrase 2025-07-09 14:02:41 +02:00
ma0048 d3210f0d3d - foreign keys hinzugefuegt
- beim zuruecksetzen der gebiete, wird auch tbl_pruefling_gebiet zurueckgesetzt
2025-02-18 13:51:20 +01:00
ma0048 a0dce925d4 - rt holt sich zusätzlich alle gebiete aus den semestern davor 2025-01-14 10:56:28 +01:00
143 changed files with 4171 additions and 2237 deletions
+1
View File
@@ -3,3 +3,4 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
$config['infocenter_studiengang_kz'] = '10021, 10027, 10002';
$config['infocenter_qualifikationskurs_kz'] = '10002';
+44
View File
@@ -0,0 +1,44 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Compat extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct([
'ci' => ['basis/cis:r'],
'legacy' => ['basis/cis:r'],
]);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @access public
* @return void
*/
public function ci()
{
$this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']);
}
/**
* @access public
* @return void
*/
public function legacy()
{
$this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']);
}
}
+10 -5
View File
@@ -20,8 +20,12 @@ class Documents extends Auth_Controller
'download' => [self::PERM_LOGGED]
]);
// Load models
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
// Load libraries
$this->load->library('AkteLib');
$this->loadPhrases([
'global',
'tools'
@@ -112,10 +116,12 @@ class Documents extends Auth_Controller
$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);
$result = $this->aktelib->getByPersonId(
$person_id,
true
);
if (isError($result))
return $this->load->view('errors/html/error_db.php', [
'heading' => 'Database Error',
@@ -147,14 +153,13 @@ class Documents extends Auth_Controller
if (!is_numeric($akte_id))
return show_404();
$this->load->model('crm/Akte_model', 'AkteModel');
$result = $this->AkteModel->load($akte_id);
$result = $this->aktelib->getByAkteId($akte_id);
if (isError($result))
return show_error(getError($result));
$akte = getData($result);
if (!$akte)
return show_404();
$akte = current($akte);
$akte = reset($akte);
$admin_access = false;
if ($uid !== null && $this->permissionlib->isBerechtigt('admin')) {
+2 -1
View File
@@ -64,7 +64,7 @@ class ProfilUpdate extends Auth_Controller
{
// Get file to be downloaded from DMS
$newFilename = $this->uid . "/document_" . $dms_id;
$download = $this->dmslib->download($dms_id);
$download = $this->dmslib->getOutputFileInfo($dms_id);
if (isError($download))
return $download;
@@ -84,3 +84,4 @@ class ProfilUpdate extends Auth_Controller
}
}
}
+48 -82
View File
@@ -29,10 +29,14 @@ class Pub extends Auth_Controller
*/
public function bild($source, $id)
{
$this->load->model('person/Person_model', 'PersonModel');
$person_id_user = '';
$person_id_user = getAuthPersonId();
$serverzugriff = false;
// Default Bild (Dummy Profilbild)
$outputFileName = FHCPATH . 'skin/images/profilbild_dummy.jpg';
$outputFileContent = '';
$mimetype = 'application/jpeg';
$this->load->model('person/Person_model', 'PersonModel');
// Wenn das Bild direkt aufgerufen wird, ist eine Authentifizierung erforderlich
// Wenn es vom Server selbst aufgerufen wird, ist keine Auth. notwendig
@@ -45,31 +49,27 @@ class Pub extends Auth_Controller
'zugangscode' => $_SESSION['incoming/user']
]);
if (hasData($result))
$person_id_user = current(getData($result))->person_id;
$person_id_user = getData($result)[0]->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;
$person_id_user = getData($result)[0]->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) {
// If the picture is from the person table
if ($source == 'person' && is_numeric($id)) {
$foto_gesperrt = false;
// Person laden und Fotosperre überprüfen
$result = $this->PersonModel->load($id);
if (hasData($result)) {
$person = current(getData($result));
$person = getData($result)[0];
if ($person->foto_sperre) {
// Wenn der User selbst darauf zugreift darf er das Bild sehen
$foto_gesperrt = ($person_id_user != $id);
@@ -77,91 +77,57 @@ class Pub extends Auth_Controller
$foto_gesperrt = true;
}
if ($person->foto && !$foto_gesperrt) {
$cTmpHEX = base64_decode($person->foto);
if (!isEmptyString($person->foto) && !$foto_gesperrt) {
$outputFileContent = base64_decode($person->foto);
}
}
}
if($source == 'akte' && $id != '')
// If the picture is from the akte/dms
if($source == 'akte' && is_numeric($id))
{
$this->load->model('crm/Akte_model', 'AkteModel');
$mimetype = '';
$this->load->library('AkteLib');
$this->AkteModel->addJoin('public.tbl_person', 'person_id');
$result = $this->AkteModel->loadWhere([
'person_id' => $id,
'dokument_kurzbz' => 'Lichtbil'
]);
$akteResult = $this->aktelib->getByAkteId($id, 'Lichtbil');
if (hasData($result)) {
if (hasData($akteResult)) {
$foto_gesperrt = false;
$akte = getData($akteResult)[0];
$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';
$personResult = $this->PersonModel->load($akte->person_id);
if (hasData($personResult)) {
$person = getData($personResult)[0];
if ($person->foto_sperre) {
$foto_gesperrt = ($person_id_user != $id);
} elseif (!$person_id_user && !$serverzugriff) {
$foto_gesperrt = true;
}
}
if ($akte->inhalt && !$foto_gesperrt) {
$cTmpHEX = $akte->inhalt;
// Wenn das Foto nicht im Inhalt steht wird aus aus dem DMS geladen
if (!isEmptyString($akte->inhalt)) {
$outputFileContent = base64_decode($akte->inhalt);
$mimetype = $akte->mimetype;
}
}
}
// 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);
// If file content is provided
if (!isEmptyString($outputFileContent))
{
// If a mimetype is still not found
if (isEmptyString($mimetype))
{
$fo = finfo_open();
$mimetype = finfo_buffer($fo, $outputFileContent, FILEINFO_MIME_TYPE);
}
$this->outputImageByContent($mimetype, $outputFileContent);
}
else // otherwise use the file
{
$this->outputImageByFile($mimetype, $outputFileName);
}
}
}
+18 -6
View File
@@ -143,7 +143,7 @@ class Documents extends Auth_Controller
$result = $this->VorlagestudiengangModel->getCurrent($xsl, $xsl_oe_kurzbz, $version);
if (isError($result))
return show_error(getError($result));
show_error(getError($result));
if (!hasData($result))
return show_404();
@@ -226,13 +226,13 @@ class Documents extends Auth_Controller
$result = $this->VorlageModel->load($xsl);
if (isError($result))
return show_error(getError($result));
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"));
show_error($this->p->t("stv", "grades_error_sign"));
// Filename
@@ -284,11 +284,23 @@ class Documents extends Auth_Controller
// XML Data
$result = $this->documentexportlib->getDataURL($xml, $params);
if (isError($result))
return show_error(getError($result));
show_error(getError($result));
$data = getData($result);
// Output
$this->documentexportlib->showContent($filename, $vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
// Get the content
$contentResult = $this->documentexportlib->getContent($filename, $vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
// If an error occurred
if (isError($contentResult)) show_error(getError($contentResult));
$fileObj = new stdClass();
$fileObj->file_content = getData($contentResult);
$fileObj->name = $filename;
$fileObj->mimetype = isEmptyString($vorlage->mimetype) ? 'application/pdf' : $vorlage->mimetype;
$fileObj->disposition = 'attachment';
// Download
$this->outputFile($fileObj);
}
}
@@ -67,8 +67,11 @@ class CisMenu extends FHCAPI_Controller
private function generateUrlForMenuItem($menuItem)
{
$menuItem->url = $this->menuItemUrlHelper($menuItem);
unset($menuItem->content);
if(!isset($menuItem->url))
{
$menuItem->url = $this->menuItemUrlHelper($menuItem);
unset($menuItem->content);
}
if ($menuItem->childs && count($menuItem->childs)) {
$menuItem->childs = $this->generateUrlsForMenuItems($menuItem->childs);
@@ -83,7 +86,7 @@ class CisMenu extends FHCAPI_Controller
return site_url("/CisVue/Cms/content/" . $menuItem->content_id);
}
if (!$menuItem->content || !mb_strlen($menuItem->content)) {
if (!isset($menuItem->content) || !$menuItem->content || !mb_strlen($menuItem->content)) {
return '';
}
@@ -91,6 +94,8 @@ class CisMenu extends FHCAPI_Controller
$doc->loadXML($menuItem->content);
$urlElem = $doc->getElementsByTagName('url')->item(0);
$this->menuItemUrlTargetHelper($menuItem, $doc);
if (!$urlElem) {
return '';
}
@@ -122,5 +127,18 @@ class CisMenu extends FHCAPI_Controller
return $url;
}
private function menuItemUrlTargetHelper($menuItem, $xmldoc)
{
if($menuItem->template_kurzbz === 'redirect')
{
$targetElem = $xmldoc->getElementsByTagName('target')->item(0);
$target = ($targetElem) ? $targetElem->textContent : '';
if(!in_array($target, array('_self', '_top', '_blank')))
{
$target = '_self';
}
$menuItem->target = $target;
}
}
}
@@ -51,6 +51,8 @@ class Documents extends FHCAPI_Controller
$this->loadPhrases([
'stv'
]);
$this->load->library('DocumentExportLib');
}
/**
@@ -100,23 +102,11 @@ class Documents extends FHCAPI_Controller
{
$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
]
*/
$akteData = $akteExportData['akteData'];
$exportData = $akteExportData['exportData'];
// Output
$result = $this->documentexportlib->showContent(
$akteData['akteData']['inhalt'],
$contentResult = $this->documentexportlib->getContent(
$exportData['vorlage'],
$exportData['xml_data'],
$exportData['oe_kurzbz'],
@@ -125,7 +115,9 @@ class Documents extends FHCAPI_Controller
$exportData['sign_user']
);
$this->terminateWithSuccess(true);
$content = $this->getDataOrTerminateWithError($contentResult);
$this->terminateWithFileOutput($akteData['mimetype'], $content, $akteData['titel'] . '.pdf');
}
/**
@@ -161,12 +153,10 @@ class Documents extends FHCAPI_Controller
$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');
}
@@ -465,18 +455,13 @@ class Documents extends FHCAPI_Controller
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);
$contentResult = $this->documentexportlib->getContent($vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
// Output
$result = $this->documentexportlib->getContent($vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
$content = $this->getDataOrTerminateWithError($result);
$content = $this->getDataOrTerminateWithError($contentResult);
$akteData['titel'] .= '.pdf';
$akteData['inhalt'] = base64_encode($content);
@@ -494,3 +479,4 @@ class Documents extends FHCAPI_Controller
];
}
}
@@ -81,7 +81,7 @@ class Lehrveranstaltung extends FHCAPI_Controller
{
$studiengang_kz = $this->getStudiengangKz($stg_kz);
if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
if (is_null($studiengang_kz) || !preg_match("/^(-?[1-9][0-9]*|0)$/", (string)$studiengang_kz))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$verband = null;
@@ -136,7 +136,7 @@ class ProfilUpdate extends FHCAPI_Controller
$this->uid == $profil_update->uid
) {
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id);
$download = $this->dmslib->getOutputFileInfo($dms_id);
$download = $this->getDataOrTerminateWithError($download);
// Download file
$this->outputFile($download);
@@ -456,24 +456,28 @@ class ProfilUpdate extends FHCAPI_Controller
$_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()",
];
// File upload
$uploadDataResult = $this->uploadFile('files', array('jpg', 'png', 'pdf'));
if (isError($uploadDataResult)) $this->addError(getError($uploadDataResult));
if (!hasData($uploadDataResult)) $this->addError('Upload failed');
$tmp_res = $this->dmslib->upload($dms, 'files', array("jpg", "png", "pdf"));
if(isError($tmp_res)){
$this->addError(getError($tmp_res));
if (hasData($uploadDataResult))
{
// Add file to the DMS (DB + file system)
$dms_res = $this->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'profil_aenderung', // kategorie_kurzbz
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
$dms_res = $this->getDataOrTerminateWithError($dms_res);
array_push($res, $dms_res);
}
$tmp_res = $this->getDataOrTerminateWithError($tmp_res);
array_push($res, $tmp_res);
}
$this->terminateWithSuccess($res);
@@ -167,7 +167,9 @@ class Studium extends FHCAPI_Controller
if($aktuelles_studienplan){
$lehrveranstaltungen = $this->computeStudienplanLehrveranstaltungen($aktuelles_studienplan->studienplan_id, $aktuelles_semester);
foreach($lehrveranstaltungen as $lehrv){
foreach($lehrv->lehrveranstaltungen as $lv){
// a lehrveranstaltung without a modul has no children and gets its lektoren directly
$lvs = isset($lehrv->lehrveranstaltungen) ? $lehrv->lehrveranstaltungen : [$lehrv];
foreach($lvs as $lv){
$lvLektoren =$this->computeLektorenFromLehrveranstaltung($lv->lehrveranstaltung_id,$aktuelles_semester, $aktuelles_studiengang->studiengang_kz, $aktuelles_studiensemester->studiensemester_kurzbz);
$lv->lektoren = $lvLektoren;
}
@@ -286,6 +288,7 @@ SELECT tbl_lehrveranstaltung.*,
$lehrveranstaltungen = $this->LehrveranstaltungModel->execReadOnlyQuery($query,[$studienplan_id, $semester]);
$lehrveranstaltungen = $this->getDataOrTerminateWithError($lehrveranstaltungen);
usort($lehrveranstaltungen, function($a, $b){
if($a->lehrtyp_kurzbz == "modul"){
return -1;
@@ -302,12 +305,17 @@ SELECT tbl_lehrveranstaltung.*,
}
else{
$parent =array_filter($carry, function($item)use($lehrv){
return $item->studienplan_lehrveranstaltung_id == $lehrv->studienplan_lehrveranstaltung_id_parent;
return isset($item->lehrveranstaltungen)
&& $item->studienplan_lehrveranstaltung_id == $lehrv->studienplan_lehrveranstaltung_id_parent;
});
$parent = current($parent);
if($parent){
$parent->lehrveranstaltungen[] = $lehrv;
}
else{
// lehrveranstaltung without a modul: keep it on the top level
array_push($carry, $lehrv);
}
}
return $carry;
}, []);
@@ -101,6 +101,9 @@ class Widget extends FHCAPI_Controller
$tmpsetup = json_decode($widget->setup);
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
$widget->setup = $tmpsetup;
$widget->permitted = empty($widget->berechtigung_kurzbz)
|| $this->permissionlib->isBerechtigt($widget->berechtigung_kurzbz);
return $widget;
}, $widgets);
@@ -28,7 +28,8 @@ class Studiensemester extends FHCAPI_Controller
'getStudienjahrByStudiensemester' => self::PERM_LOGGED,
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED,
'current' => self::PERM_LOGGED,
'set' => self::PERM_LOGGED
'set' => self::PERM_LOGGED,
'getContainingOrNearestByDateRange' => self::PERM_LOGGED,
)
);
// Load model StudiensemesterModel
@@ -203,4 +204,15 @@ class Studiensemester extends FHCAPI_Controller
$this->terminateWithSuccess(true);
}
public function getContainingOrNearestByDateRange()
{
$from = $this->input->get("from");
$to = $this->input->get("to");
$result = $this->StudiensemesterModel->getContainingOrNearestByDateRange($from, $to);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -158,19 +158,27 @@ class Unterbrechung extends FHCAPI_Controller
if (isset($_FILES['attachment']) && (!isset($_FILES['attachment']['error']) || $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE)) {
$this->load->library('DmsLib');
$dms = $this->config->item('unterbrechung_dms');
if (!count(array_filter($dms, function ($v) {
return $v !== null;
})))
$dms = ['kategorie_kurzbz' => 'Akte'];
$dms['version'] = 0;
$allowed_filetypes = $this->config->item('unterbrechung_dms_filetypes') ?: ['*'];
$result = $this->dmslib->upload($dms, 'attachment', $allowed_filetypes);
$uploadDataResult = $this->uploadFile('attachment', $this->config->item('unterbrechung_dms_filetypes') ?: array('*'));
$data = $this->getDataOrTerminateWithError($result);
$dms_id = $data['dms_id'];
$data = $this->getDataOrTerminateWithError($uploadDataResult);
// Add file to the DMS (DB + file system)
$dms_res = $this->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'studierendenantrag',
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
$dms_data = $this->getDataOrTerminateWithError($dms_res);
$dms_id = $dms_data->dms_id;
}
$result = $this->antraglib->createUnterbrechung($prestudent_id, $studiensemester, getAuthUID(), $grund, $datum_wiedereinstieg, $dms_id);
@@ -32,8 +32,8 @@ class Akte extends Auth_Controller
'download' => ['admin:w', 'assistenz:w'],
]);
// Load models
$this->load->model('crm/Akte_model', 'AkteModel');
// Load libraries
$this->load->library('AkteLib');
}
//------------------------------------------------------------------------------------------------------------------
@@ -49,22 +49,22 @@ class Akte extends Auth_Controller
if (!is_numeric($akte_id)) $this->terminateWithError('akte Id missing');
$result = $this->AkteModel->load($akte_id);
$akteResult = $this->aktelib->getByAkteId($akte_id);
if (!hasData($result)) $this->terminateWithError('Akte not found');
if (!hasData($akteResult)) $this->terminateWithError('Akte not found');
$data = getData($result)[0];
$data = getData($akteResult)[0];
if (isset($data->inhalt) && $data->inhalt != '')
if (!isEmptyString($data->inhalt))
{
header('Content-Description: File Transfer');
header('Content-Type: '. $data->mimetype);
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Disposition: attachment; filename="'.$data->titel.'"');
echo base64_decode($data->inhalt);
die();
$fileObj = new stdClass();
$fileObj->file_content = base64_decode($data->inhalt);
$fileObj->name = $data->filename;
$fileObj->mimetype = $data->mimetype;
$fileObj->disposition = 'attachment';
$this->outputFile($fileObj);
}
}
}
@@ -46,6 +46,9 @@ class Archiv extends FHCAPI_Controller
$this->load->model('crm/Akte_model', 'AkteModel');
$this->load->model('system/Vorlage_model', 'VorlageModel');
// Load libraries
$this->load->library('AkteLib');
// Load language phrases
$this->loadPhrases([
'archiv'
@@ -57,7 +60,7 @@ class Archiv extends FHCAPI_Controller
/**
* Get archive documents for a person
* @return void
*/
public function getArchiv()
@@ -74,7 +77,11 @@ class Archiv extends FHCAPI_Controller
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$result = $this->AkteModel->getArchiv($person_id);
$result = $this->aktelib->getByPersonId(
$person_id,
null, // dokument_kurzbz
true // archiv
);
$data = $this->getDataOrTerminateWithError($result);
@@ -94,51 +101,6 @@ class Archiv extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
/**
*
* @param
* @return object success or error
*/
public function download()
{
$akte_id = $this->input->get('akte_id');
if (!is_numeric($akte_id)) $this->terminateWithError('akte Id missing');
$result = $this->AkteModel->load($akte_id);
if (!hasData($result)) $this->terminateWithError('Akte not found');
$data = getData($result)[0];
$fileObj = new stdClass();
if (isset($data->inhalt) && $data->inhalt != '')
{
// Define handle to output stream
$tmpFilePointer = fopen("php://output", 'w');
$meta_data = stream_get_meta_data($tmpFilePointer);
$filename = $meta_data["uri"];
fwrite($tmpFilePointer, $data->inhalt);
header('Content-Description: File Transfer');
header('Content-Type: '. $data->mimetype);
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
//header('Content-Length: ' . filesize($fileObj->file));
//header("Content-type: $data->mimetype");
header('Content-Disposition: attachment; filename="'.$data->titel.'"');
readfile($filename);
die();
}
else
{
$this->load->library('AkteLib');
$result = $this->aktelib->get($akte_id);
}
}
/**
* Updating an Akte
* @return void
@@ -193,7 +155,7 @@ class Archiv extends FHCAPI_Controller
$this->addMeta('content', base64_encode($content));
}
foreach ($allowed as $field)
if ($this->input->post($field) !== null)
$data[$field] = $this->input->post($field);
@@ -248,7 +210,7 @@ class Archiv extends FHCAPI_Controller
'akte_id' => $akte_id
]));
}
$result = $this->AkteModel->delete($akte_id);
if (isError($result)) $this->terminateWithError(getError($result));
@@ -27,7 +27,8 @@ class Dokumente extends FHCAPI_Controller
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$this->load->library('form_validation');
$this->load->library('DmsLib', array('who' => getAuthUID()));
$this->load->library('AkteLib');
$this->load->library('DmsLib');
// Load language phrases
$this->loadPhrases([
@@ -184,7 +185,7 @@ class Dokumente extends FHCAPI_Controller
'titel_intern' => $this->input->post('titel_intern'),
'nachgereicht_am' => $nachgereicht_am,
'updateamum' => date('c'),
'updatevon' => $uid,
'updatevon' => getAuthUID(),
]
);
@@ -201,8 +202,6 @@ class Dokumente extends FHCAPI_Controller
if(!$dokument_kurzbz)
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Dokument_kurzbz']), self::ERROR_TYPE_GENERAL);
$uid = getAuthUid();
//check if more than 1 dokumentkurzbz
//if()
@@ -210,10 +209,10 @@ class Dokumente extends FHCAPI_Controller
[
'prestudent_id' => $prestudent_id,
'dokument_kurzbz' => $dokument_kurzbz,
'mitarbeiter_uid' => $uid,
'mitarbeiter_uid' => getAuthUID(),
'datum' => date('c'),
'insertamum' => date('c'),
'insertvon' => $uid,
'insertvon' => getAuthUID(),
]
);
@@ -236,7 +235,6 @@ class Dokumente extends FHCAPI_Controller
$nachgereicht = current($dataAkte)->nachgereicht;
$inhalt = current($dataAkte)->inhalt;
$inhaltVorhanden = $inhalt != '';
$uid = getAuthUid();
$this->db->trans_start();
@@ -250,16 +248,15 @@ class Dokumente extends FHCAPI_Controller
$logdata_dms = "Logdata: " . var_export($logdata_dms, true);
//delete from dmsLib
$this->load->library('DmsLib');
$person_id = current($dataAkte)->person_id;
$result = $this->dmslib->delete($person_id, $dms_id);
$result = $this->aktelib->removeByPersonIdAndDmsId($person_id, $dms_id);
$this->getDataOrTerminateWithError($result);
//LOGGING Dms ID
$this->load->model('system/Log_model', 'LogModel');
$result = $this->LogModel->insert([
'executetime' => date('c'),
'mitarbeiter_uid' => $uid,
'mitarbeiter_uid' => getAuthUID(),
'beschreibung' => "Löschen der DMS_ID ". $dms_id,
'sql' => $logdata_dms
]);
@@ -276,7 +273,7 @@ class Dokumente extends FHCAPI_Controller
//Logging Deletion Akte
$result = $this->LogModel->insert([
'executetime' => date('c'),
'mitarbeiter_uid' => $uid,
'mitarbeiter_uid' => getAuthUID(),
'beschreibung' => "Löschen der Akte ". $akte_id,
'sql' => "DELETE FROM public.tbl_akte WHERE akte_id=" .$akte_id. " LogData: ". $logdata_akte
]);
@@ -295,7 +292,7 @@ class Dokumente extends FHCAPI_Controller
$result = $this->LogModel->insert([
'executetime' => date('c'),
'mitarbeiter_uid' => $uid,
'mitarbeiter_uid' => getAuthUID(),
'beschreibung' => "Löschen der Akte ". $akte_id,
'sql' => "DELETE FROM public.tbl_akte WHERE akte_id=" .$akte_id. " LogData: ". $logdata_akte
]);
@@ -310,7 +307,6 @@ class Dokumente extends FHCAPI_Controller
public function uploadDokument()
{
$this->load->library('DmsLib');
$prestudent_id = $this->input->post('prestudent_id');
$anmerkung_intern = $this->input->post('anmerkung_intern');
$titel_intern = $this->input->post('titel_intern');
@@ -333,34 +329,44 @@ class Dokumente extends FHCAPI_Controller
}
$this->db->trans_start();
$uid = getAuthUID();
$dms = array(
'kategorie_kurzbz' => 'Akte',
'version' => 0,
'name' => $_FILES['anhang']['name'],
'mimetype' => $_FILES['anhang']['type'],
'insertamum' => date('c'),
'insertvon' => $uid
);
$result = $this->dmslib->upload($dms, 'anhang', array("jpg", "png", "pdf"));
if (isError($result))
$uploadDataResult = $this->uploadFile('anhang', array('jpg', 'png', 'pdf'));
if (isError($uploadDataResult))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
return $this->terminateWithError(getError($uploadDataResult), self::ERROR_TYPE_GENERAL);
}
$dms_id = $result->retval['dms_id'];
// If data exists
if (hasData($uploadDataResult))
{
// Add file to the DMS (DB + file system)
$dms_res = $this->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'Akte', // kategorie_kurzbz
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
}
// Error occurred or data not found
if (isError($dms_res) || !hasData($dms_res)) $this->terminateWithError(getError($dms_res), self::ERROR_TYPE_GENERAL);
$dms_id = getData($dms_res)->dms_id;
$person_id = $this->_getPersonId($prestudent_id);
$result = $this->DokumentModel->load($dokument_kurzbz);
$data = $this->getDataOrTerminateWithError($result);
$dokumentResult = $this->DokumentModel->load($dokument_kurzbz);
$data = $this->getDataOrTerminateWithError($dokumentResult);
$bezeichnung = current($data)->bezeichnung;
//save entry in akte
if($dms_id)
// Save entry in akte
if ($dms_id)
{
$result = $this->AkteModel->insert([
'person_id' => $person_id,
@@ -369,7 +375,7 @@ class Dokumente extends FHCAPI_Controller
'mimetype' => $_FILES['anhang']['type'],
'insertamum' => date('c'),
'erstelltam' => date('c'),
'insertvon' => $uid,
'insertvon' => getAuthUID(),
'anmerkung_intern' => $anmerkung_intern,
'titel_intern' => $titel_intern,
'bezeichnung' => $bezeichnung,
@@ -416,28 +422,26 @@ class Dokumente extends FHCAPI_Controller
$filecontentbase64 = $data->inhalt;
$filename = $data->titel;
if(intval($data->dms_id) > 0)
if (intval($data->dms_id) > 0)
{
$dmsdokres = $this->dmslib->read($data->dms_id);
if (!hasData($dmsdokres)) $this->terminateWithError('DMS File not found');
$dmsdok = getData($dmsdokres)[0];
$file = $this->dmslib->getOutputFileInfo($data->dms_id, $filename);
$mimetype = $dmsdok->mimetype;
$filecontentbase64 = $dmsdok->file_content;
$filename = $dmsdok->name;
$this->terminateWithFileOutput(getData($file)->mimetype, file_get_contents(getData($file)->file), $filename);
}
else
{
$filecontent = '';
$filecontent = '';
if (!empty($filecontentbase64)) {
$filecontent = base64_decode($filecontentbase64, true);
if (!empty($filecontentbase64)) {
$filecontent = base64_decode($filecontentbase64, true);
if ($filecontent === false) {
$this->terminateWithError('Base64-Dekodierung failed.');
if ($filecontent === false) {
$this->terminateWithError('Base64-Dekodierung failed.');
}
}
}
$this->terminateWithFileOutput($mimetype, $filecontent, $filename);
$this->terminateWithFileOutput($mimetype, $filecontent, $filename);
}
}
private function _getMissingDocuments($studiengang_kz, $prestudent_id)
@@ -753,10 +757,7 @@ class Dokumente extends FHCAPI_Controller
);
$data = $this->getDataOrTerminateWithError($result);
$student = current($data);
return $student->prestudent_id;
return hasData($data) ? getData($data)[0]->prestudent_id : null;
}
/**
@@ -60,8 +60,8 @@ class LvTermine extends FHCAPI_Controller
$semester_range,
$benutzer_gruppen,
$student_lehrverband,
$dbStundenplanTable,
true
true,
$dbStundenplanTable
);
if(!$stundenplan_query)
@@ -370,6 +370,7 @@ class LvTermine extends FHCAPI_Controller
$result->semester = $item->semester;
$result->verband = $item->verband;
$result->gruppe = $item->gruppe;
$result->studiensemester_kurzbz = $item->studiensemester_kurzbz;
return $result;
},
$lehrverband_query_result));
@@ -33,11 +33,6 @@ class Notiz extends Notiz_Controller
]);
}
/* public function getUid()
{
$this->terminateWithSuccess(getAuthUID());
}*/
public function getNotizen($id, $type)
{
@@ -59,317 +54,6 @@ class Notiz extends Notiz_Controller
}
/* public function loadNotiz()
{
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
$notiz_id = $this->input->post('notiz_id');
//$this->load->model('person/Notiz_model', 'NotizModel');
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'notiz_id', 'LEFT');
$this->NotizModel->addSelect('*');
$this->NotizModel->addSelect("TO_CHAR(CASE WHEN public.tbl_notiz.updateamum >= public.tbl_notiz.insertamum
THEN public.tbl_notiz.updateamum ELSE public.tbl_notiz.insertamum END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate");
$this->NotizModel->addLimit(1);
$result = $this->NotizModel->loadWhere(
array('notiz_id' => $notiz_id)
);
if (isError($result))
{
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
elseif (!hasData($result))
{
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL);
}
else
{
$this->terminateWithSuccess(current(getData($result)));
}
}
public function updateNotiz()
{
$this->load->library('form_validation');
$this->load->library('DmsLib');
if (isset($_POST['data']))
{
$data = json_decode($_POST['data']);
unset($_POST['data']);
foreach ($data as $k => $v) {
$_POST[$k] = $v;
}
}
$notiz_id = $this->input->post('notiz_id');
if(!$notiz_id)
{
$this->terminateWithError($this->p->t('ui','error_missingId',['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL);
}
//Form Validation
$this->form_validation->set_rules('titel', 'Titel', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Titel'])
]);
$this->form_validation->set_rules('text', 'Text', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Text'])
]);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
//update Notiz
$uid = getAuthUID();
$titel = $this->input->post('titel');
$text = $this->input->post('text');
$verfasser_uid = $this->input->post('verfasser');
$bearbeiter_uid = isset($_POST['bearbeiter']) ? $_POST['bearbeiter'] : $uid;
$erledigt = $this->input->post('erledigt');
$start = $this->input->post('start');
$ende = $this->input->post('ende');
$result = $this->NotizModel->update(
[
'notiz_id' => $notiz_id
],
[
'titel' => $titel,
'updatevon' => $uid,
'updateamum' => date('c'),
'text' => $text,
'verfasser_uid' => $verfasser_uid,
'bearbeiter_uid' => $bearbeiter_uid,
'start' => $start,
'ende' => $ende,
'erledigt' => $erledigt
]
);
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
//update(1) laden aller bereits mit dieser notiz_id verknüpften DMS-Einträge
$this->load->model('person/Notizdokument_model', 'NotizdokumentModel');
$this->NotizdokumentModel->addJoin('campus.tbl_dms_version', 'dms_id');
$dms_uploaded = null;
$result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id));
if (isError($result))
{
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
elseif (!hasData($result))
{
$dms_id_arr = null;
}
else
{
$result = getData($result);
foreach($result as $doc) {
$dms_id_arr[] = array(
'name' => $doc->name,
'dms_id' => $doc->dms_id
);
}
}
foreach ($_FILES as $k => $file)
{
//update(2) alle neuen files (alle außer type application/x.fhc-dms+json) anhängen
if($file["type"] == 'application/x.fhc-dms+json')
{
$dms_uploaded[] = array(
'name' => $file["name"]
);
}
else
{
$dms = array(
'kategorie_kurzbz' => 'notiz',
'version' => 0,
'name' => $file["name"],
'mimetype' => $file["type"],
'insertamum' => date('c'),
'insertvon' => $uid
);
//Todo(manu) check if filetypes weiter eingeschränkt werden sollen
//Todo(manu)check name files: nicht gleiches file 2mal hochladen
$result = $this->dmslib->upload($dms, $k, array('*'));
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$dms_id = $result->retval['dms_id'];
$result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_id));
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
}
}
//update(3) check if Dateien gelöscht wurden
if(count($dms_uploaded) != count($dms_id_arr))
{
if (count($dms_uploaded) == 0)
{
$filesDeleted = $dms_id_arr;
}
else
{
$upload_new_names = array_column($dms_uploaded, "name");
$filesDeleted = array_filter($dms_id_arr, function ($file) use ($upload_new_names) {
return !in_array($file["name"], $upload_new_names);
});
}
foreach ($filesDeleted as $file)
{
$result = $this->dmslib->removeAll($file['dms_id']);
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
else
$this->outputJson($result);
}
}
return $this->terminateWithSuccess($result);
}*/
/* public function deleteNotiz()
{
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
$notiz_id = $this->input->post('notiz_id');
$type = $this->input->post('type_id');
$id = $this->input->post('id');
//dms_id auslesen aus notizdokument wenn vorhanden
$dms_id_arr = [];
$this->load->model('person/Notizdokument_model', 'NotizdokumentModel');
$result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id));
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
if(hasData($result))
{
$result = getData($result);
foreach ($result as $doc) {
$dms_id_arr[] = $doc->dms_id;
}
}
if($dms_id_arr)
{
$this->load->library('DmsLib');
foreach($dms_id_arr as $dms_id)
{
$result = $this->dmslib->removeAll($dms_id);
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->outputJson($result);
}
}
//delete Notizzuordnung
if($type == "software_id")
{
// Loads extension Model
$this->load->model('extensions/FHC-Core-Softwarebereitstellung/Softwarenotizzuordnung_model', 'ExtensionnotizzuordnungModel');
$result = $this->ExtensionnotizzuordnungModel->delete([
'notiz_id' => $notiz_id,
'id' => strval($id)
],
[
'type_id' => $type
]);
}
else
{
//notizzuordnungsid!
$result = $this->NotizzuordnungModel->delete(['notiz_id' => $notiz_id, $type => $id]);
}
$this->load->model('person/Notiz_model', 'NotizModel');
//$this->NotizModel->addJoin('public.tbl_notizzuordnung', 'notiz_id');
//TODO (erweitern um Type_id) für Extensions, damit auch Notizzuordnung gelöscht werden kann
//Löschen von Notiz
$result = $this->NotizModel->delete(
array('notiz_id' => $notiz_id)
);
if (isError($result))
{
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
if(!hasData($result))
{
return $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL);
}
return $this->terminateWithSuccess(current(getData($result)));
}*/
/* public function loadDokumente()
{
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
$notiz_id = $this->input->post('notiz_id');
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)');
$this->NotizModel->addJoin('campus.tbl_dms_version', 'ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)');
$result = $this->NotizModel->loadWhere(
array('public.tbl_notiz.notiz_id' => $notiz_id)
);
if (isError($result)) {
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
if(!hasData($result))
{
return $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL);
}
return $this->terminateWithSuccess(getData($result));
}*/
/* public function getMitarbeiter($searchString)
{
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString);
if (isError($result)) {
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
return $this->terminateWithSuccess($result);
}*/
public function isBerechtigt($id, $typeId)
{
if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid'))
@@ -379,7 +63,6 @@ class Notiz extends Notiz_Controller
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
return success("berechtigt in überschreibender Funktion");
/* return $this->terminateWithError('keine Berechtigung bro', self::ERROR_TYPE_GENERAL);*/
}
}
}
@@ -42,6 +42,8 @@ class Projektarbeit extends FHCAPI_Controller
$this->load->model('education/Note_model', 'NoteModel');
$this->load->model('education/Projektbetreuer_model', 'BetreuerModel');
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
// load libraries
$this->load->library('PermissionLib');
@@ -100,16 +102,16 @@ class Projektarbeit extends FHCAPI_Controller
private function fetchProjektarbeitById($projektarbeit_id) {
$this->ProjektarbeitModel->resetQuery();
$this->ProjektarbeitModel->addSelect(
'lehre.tbl_projektarbeit.projektarbeit_id, titel, titel_english, themenbereich, projekttyp_kurzbz, lehrveranstaltung_id, lehreinheit_id,
firma_id, beginn, ende, gesperrtbis, note, final, freigegeben, tbl_projektarbeit.anmerkung, fa.name AS firma_name'
'lehre.tbl_projektarbeit.projektarbeit_id, titel, titel_english, themenbereich, projekttyp_kurzbz, lehrveranstaltung_id, lehreinheit_id,
tbl_projektarbeit.studiensemester_kurzbz, firma_id, beginn, ende, gesperrtbis, note, final, freigegeben, tbl_projektarbeit.anmerkung, fa.name AS firma_name'
);
$this->ProjektarbeitModel->addJoin('lehre.tbl_lehreinheit le', 'lehreinheit_id');
$this->ProjektarbeitModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id');
$this->ProjektarbeitModel->addJoin('public.tbl_firma fa', 'firma_id', 'LEFT');
return $this->ProjektarbeitModel->loadWhere(
array('projektarbeit_id' => $projektarbeit_id)
);
}
/**
@@ -246,14 +248,38 @@ class Projektarbeit extends FHCAPI_Controller
$additional_lehrveranstaltung_id = $this->input->get('additional_lehrveranstaltung_id');
if (!isset($student_uid)) $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemster missing', self::ERROR_TYPE_GENERAL);
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemester missing', self::ERROR_TYPE_GENERAL);
// get Lvs
// get prestudent_id from student model
$studentRes = $this->StudentModel->load(['student_uid' => $student_uid]);
if(hasData($studentRes)) {
$student = getData($studentRes);
} else {
$this->terminateWithError($studentRes, self::ERROR_TYPE_GENERAL);
}
// to get prestudent_status history
$historyRes = $this->PrestudentstatusModel->getHistoryPrestudent($student[0]->prestudent_id);
if(hasData($historyRes)) {
$history = getData($historyRes);
} else {
$this->terminateWithError($historyRes, self::ERROR_TYPE_GENERAL);
}
// query for every lva of a studiengang that has projektarbeit flag true
$lvsResult = $this->LehrveranstaltungModel->getLvsForProjektarbeit($student_uid, $studiengang_kz, $additional_lehrveranstaltung_id);
if (isError($lvsResult)) return $this->terminateWithError($lvsResult, self::ERROR_TYPE_GENERAL);
$lvs = hasData($lvsResult) ? getData($lvsResult) : [];
$lvsIDs = array_column($lvs, 'lehrveranstaltung_id');
// get current studienplan_id from status history to find out which lva options are actually assigned to the students studienplan
// important so the projektarbeit has the correct lva assigned to be able to find and print the thesis title on the degree documents!
$currentStatus = $history[0];
$lvByStudienPlanRes = $this->LehrveranstaltungModel->getLvsByStudienplanByLvaIDs($currentStatus->studienplan_id, $lvsIDs);
if(hasData($lvByStudienPlanRes)) {
$lvs = getData($lvByStudienPlanRes);
}
foreach ($lvs as $lv)
{
@@ -320,11 +346,18 @@ class Projektarbeit extends FHCAPI_Controller
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Projekttyp'])
]);
$this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'required|is_natural', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehreinheit']),
$this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'is_natural', [
'is_natural' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Lehreinheit'])
]);
$this->form_validation->set_rules('lehrveranstaltung_id', 'Lehrveranstaltung', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehrveranstaltung'])
]);
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studiensemester'])
]);
$this->form_validation->set_rules('beginn', 'Beginn', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Beginn'])
]);
@@ -354,6 +387,8 @@ class Projektarbeit extends FHCAPI_Controller
'projekttyp_kurzbz' => $formData['projekttyp_kurzbz'],
'firma_id' => $formData['firma_id'] ?? null,
'lehreinheit_id' => $formData['lehreinheit_id'],
'lehrveranstaltung_id' => $formData['lehrveranstaltung_id'],
'studiensemester_kurzbz' => $formData['studiensemester_kurzbz'],
'beginn' => isset($formData['beginn']) && !isEmptyString($formData['beginn']) ? $formData['beginn'] : null,
'ende' => isset($formData['ende']) && !isEmptyString($formData['ende']) ? $formData['ende'] : null,
'note' => $formData['note'] ?? null,
@@ -108,6 +108,7 @@ class Students extends FHCAPI_Controller
'studiensemester_kurzbz' => $studiensemester_kurzbz
]);
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$this->studentlistlib->addJoin(
"(
@@ -153,7 +154,8 @@ class Students extends FHCAPI_Controller
$this->addMeta('ci_params', [
'studiensemester_kurzbz' => $studiensemester_kurzbz
]);
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$this->studentlistlib->addJoin(
"(
@@ -213,6 +215,7 @@ class Students extends FHCAPI_Controller
'studiensemester_kurzbz' => $studiensemester_kurzbz
]);
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$this->studentlistlib->addJoin(
"(
@@ -803,7 +803,7 @@ class ReihungstestJob extends JOB_Controller
{
if (!isset($studiensemester) || isEmptyString($studiensemester))
{
$this->logError("Studiensemster not passed as parameter");
$this->logError("Studiensemester not passed as parameter");
return;
}
@@ -73,7 +73,7 @@ class Attachment extends FHC_Controller
}
}
$result = $this->dmslib->download($dms_id);
$result = $this->dmslib->getOutputFileInfo($dms_id);
if (isError($result))
return show_error(getError($result));
@@ -393,7 +393,7 @@ class approveAnrechnungDetail extends Auth_Controller
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id, $filename);
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
if (isError($download)) return $download;
// Download file
@@ -282,7 +282,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id, $filename);
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
if (isError($download)) return $download;
// Download file
@@ -150,15 +150,12 @@ class CreateAnrechnung extends Auth_Controller
}
// Upload document
$result = self::_uploadFile();
$result = $this->_uploadFile();
if (isError($result))
{
$this->terminateWithJsonError($result->retval);
}
if (isError($result)) $this->terminateWithJsonError(getError($result));
// Hold just inserted DMS ID
$lastInsert_dms_id = $result->retval['dms_id'];
$lastInsert_dms_id = getData($result)->dms_id;
// Save Anrechnung and Anrechnungstatus
$result = $this->AnrechnungModel->createAnrechnungsantrag(
@@ -227,17 +224,25 @@ class CreateAnrechnung extends Auth_Controller
*/
private function _uploadFile()
{
$dms = array(
'kategorie_kurzbz' => 'anrechnung',
'version' => 0,
'name' => $_FILES['uploadfile']['name'],
'mimetype' => $_FILES['uploadfile']['type'],
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
'insertvon' => $this->_uid
);
// Upload document
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
$uploadDataResult = $this->uploadFile('uploadfile', array('pdf'));
// If an error occurred while uploading the file
if (isError($uploadDataResult)) return $uploadDataResult;
if (!hasData($uploadDataResult)) return error('Upload failed');
// Add file to the DMS (DB + file system)
return $this->_ci->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'anrechnung', // kategorie_kurzbz
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
}
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id, $prestudent_id)
@@ -268,4 +273,4 @@ class CreateAnrechnung extends Auth_Controller
return false;
}
}
}
@@ -83,7 +83,7 @@ class requestAnrechnung extends Auth_Controller
$is_expired = $this->_isExpired($studiensemester_kurzbz);
// Check if Lehrveranstaltung was already graded with application blocking grades
$is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
$is_blocked = $this->_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
// Get Anrechung data
$anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id);
@@ -152,27 +152,24 @@ class requestAnrechnung extends Auth_Controller
$prestudent_id = getData($result)[0]->prestudent_id;
// Exit if application already exists
if (self::_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id))
if ($this->_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id))
{
return $this->outputJsonError($this->p->t('anrechnung', 'antragBereitsGestellt'));
}
// Exit if application is a past ( < actual ) studysemester
if (self::_applicationIsPastSS($studiensemester_kurzbz))
if ($this->_applicationIsPastSS($studiensemester_kurzbz))
{
return $this->outputJsonError($this->p->t('anrechnung', 'antragNichtFuerVerganganeSS'));
}
// Upload document
$result = self::_uploadFile();
$result = $this->_uploadFile();
if (isError($result))
{
return $this->outputJsonError($result->retval);
}
if (isError($result)) return $this->outputJsonError(getError($result));
// Hold just inserted DMS ID
$lastInsert_dms_id = $result->retval['dms_id'];
$lastInsert_dms_id = getData($result)->dms_id;
// Save Anrechnung and Anrechnungstatus
$result = $this->AnrechnungModel->createAnrechnungsantrag(
@@ -182,8 +179,8 @@ class requestAnrechnung extends Auth_Controller
$begruendung_id,
$lastInsert_dms_id,
$anmerkung,
$begruendung_ects,
$begruendung_lvinhalt
$begruendung_ects,
$begruendung_lvinhalt
);
if (isError($result))
@@ -215,11 +212,11 @@ class requestAnrechnung extends Auth_Controller
$this->_checkIfEntitledToReadDMSDoc($dms_id);
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id);
if (isError($download)) return $download;
$download = $this->dmslib->getOutputFileInfo($dms_id);
if (isError($download)) return $download;
// Download file
$this->outputFile(getData($download));
// Download file
$this->outputFile(getData($download));
}
/**
@@ -367,16 +364,25 @@ class requestAnrechnung extends Auth_Controller
*/
private function _uploadFile()
{
$dms = array(
'kategorie_kurzbz' => 'anrechnung',
'version' => 0,
'name' => $_FILES['uploadfile']['name'],
'mimetype' => $_FILES['uploadfile']['type'],
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
'insertvon' => $this->_uid
);
// Upload document
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
$uploadDataResult = $this->uploadFile('uploadfile', array('pdf'));
// If an error occurred while uploading the file
if (isError($uploadDataResult)) return $uploadDataResult;
// If an error occurred while uploading the file
if (!hasData($uploadDataResult)) return error('Upload failed');
// Add file to the DMS (DB + file system)
return $this->_ci->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'anrechnung',
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
}
}
@@ -237,7 +237,7 @@ class reviewAnrechnungDetail extends Auth_Controller
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id, $filename);
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
if (isError($download)) return $download;
// Download file
@@ -196,7 +196,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
// Get file to be downloaded from DMS
$download = $this->dmslib->download($dms_id, $filename);
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
if (isError($download)) return $download;
// Download file
@@ -34,6 +34,9 @@ class InfoCenter extends Auth_Controller
const PREV_FILTER_ID = 'prev_filter_id';
const KEEP_TABLESORTER_FILTER = 'keepTsFilter';
const ONBOARDING_INSERTVON = 'onboarding';
const ONBOARDING_KENNZEICHENTYP = 'eobRegistrierungsId';
private $_uid; // contains the UID of the logged user
// Used to log with PersonLogLib
@@ -175,10 +178,12 @@ class InfoCenter extends Auth_Controller
$this->load->model('person/Kontakt_model', 'KontaktModel');
$this->load->model('person/Geschlecht_model', 'GeschlechtModel');
$this->load->model('person/adresse_model', 'AdresseModel');
$this->load->model('person/Kennzeichen_model', 'KennzeichenModel');
// Loads libraries
$this->load->library('PersonLogLib');
$this->load->library('WidgetLib');
$this->load->library('AkteLib');
$this->load->config('infocenter');
@@ -452,8 +457,7 @@ class InfoCenter extends Auth_Controller
if (isset($akte_id) && isset($person_id))
{
$this->load->library('AkteLib');
$akte = $this->aktelib->get($akte_id);
$akte = $this->aktelib->getByAkteId($akte_id);
if (hasData($akte))
{
@@ -1169,8 +1173,6 @@ class InfoCenter extends Auth_Controller
*/
public function outputAkteContent($akte_id)
{
$this->load->library('DmsLib');
$akte = $this->AkteModel->load($akte_id);
if (isError($akte))
@@ -1178,7 +1180,7 @@ class InfoCenter extends Auth_Controller
show_error(getError($akte));
}
$aktecontent = $this->dmslib->getAkteContent($akte_id);
$aktecontent = $this->aktelib->getByAkteId($akte_id);
if (isError($aktecontent))
{
@@ -1452,6 +1454,100 @@ class InfoCenter extends Auth_Controller
$this->outputJsonSuccess("Done!");
}
public function getAbsageData()
{
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
if (!is_null($stg_typ))
{
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
$data = array (
'statusgruende' => $statusgruende,
'studiengaenge' => $studiengaenge->retval
);
$this->outputJsonSuccess($data);
}
else
$this->outputJsonSuccess(null);
}
public function getStudienArtBerechtigung($typ = null)
{
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
return getData($stg_typ);
}
public function getStudienartData()
{
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
}
public function saveAbsageForAll()
{
$statusgrund = $this->input->post('statusgrund');
$studiengang = $this->input->post('studiengang');
$abgeschickt = $this->input->post('abgeschickt');
$personen = $this->input->post('personen');
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
if ($studiengang === 'all' && $abgeschickt === 'all')
{
foreach($personen as $person)
{
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
if (!hasData($prestudenten))
continue;
$prestudentenData = getData($prestudenten);
foreach ($prestudentenData as $prestudent)
{
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
}
}
}
else
{
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
$this->StudienplanModel->addSelect('1');
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
$this->StudienplanModel->addLimit(1);
$studiengangResult = $this->StudienplanModel->load();
if (hasData($studiengangResult))
{
foreach($personen as $person)
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
if (!hasData($prestudent))
continue;
$prestudentData = getData($prestudent);
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
}
}
else
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
}
$this->outputJsonSuccess("Success");
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
@@ -1946,6 +2042,17 @@ class InfoCenter extends Auth_Controller
show_error(getError($user_person));
}
// add info about first electronig onboarding login
$this->KennzeichenModel->addSelect('insertamum');
$onboarding_first_login = $this->KennzeichenModel->loadWhere(
array('person_id' => $person_id, 'kennzeichentyp_kurzbz' => self::ONBOARDING_KENNZEICHENTYP)
);
if (isError($onboarding_first_login))
{
show_error(getError($onboarding_first_login));
}
$data = array (
'lockedby' => $lockedby,
'lockedbyother' => $lockedbyother,
@@ -1955,7 +2062,9 @@ class InfoCenter extends Auth_Controller
'messages' => $messages->retval,
'logs' => $logs,
'notizen' => $notizen->retval,
'notizenbewerbung' => $notizen_bewerbung->retval
'notizenbewerbung' => $notizen_bewerbung->retval,
'created_by_onboarding' => $stammdaten->retval->insertvon == self::ONBOARDING_INSERTVON,
'onboarding_first_login' => hasData($onboarding_first_login) ? getData($onboarding_first_login)[0]->insertamum : null
);
return $data;
@@ -2375,97 +2484,5 @@ class InfoCenter extends Auth_Controller
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
}
}
}
public function getAbsageData()
{
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
if (!is_null($stg_typ))
{
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
$data = array (
'statusgruende' => $statusgruende,
'studiengaenge' => $studiengaenge->retval
);
$this->outputJsonSuccess($data);
}
else
$this->outputJsonSuccess(null);
}
public function getStudienArtBerechtigung($typ = null)
{
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
return getData($stg_typ);
}
public function getStudienartData()
{
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
}
public function saveAbsageForAll()
{
$statusgrund = $this->input->post('statusgrund');
$studiengang = $this->input->post('studiengang');
$abgeschickt = $this->input->post('abgeschickt');
$personen = $this->input->post('personen');
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
if ($studiengang === 'all' && $abgeschickt === 'all')
{
foreach($personen as $person)
{
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
if (!hasData($prestudenten))
continue;
$prestudentenData = getData($prestudenten);
foreach ($prestudentenData as $prestudent)
{
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
}
}
}
else
{
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
$this->StudienplanModel->addSelect('1');
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
$this->StudienplanModel->addLimit(1);
$studiengangResult = $this->StudienplanModel->load();
if (hasData($studiengangResult))
{
foreach($personen as $person)
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
if (!hasData($prestudent))
continue;
$prestudentData = getData($prestudent);
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
}
}
else
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
}
$this->outputJsonSuccess("Success");
}
}
@@ -7,6 +7,8 @@ class Rueckstellung extends Auth_Controller
private $_ci; // Code igniter instance
private $_uid;
const ZGV_UEBERPRUEFUNG_MAIL_VORLAGE = 'ZGVUEP';
public function __construct()
{
parent::__construct(
@@ -23,6 +25,7 @@ class Rueckstellung extends Auth_Controller
$this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel');
$this->load->model('person/Person_model', 'PersonModel');
$this->load->library('PersonLogLib');
$this->load->library('MessageLib');
$this->_setAuthUID(); // sets property uid
@@ -78,6 +81,8 @@ class Rueckstellung extends Auth_Controller
$this->_log($person_id, $status_kurzbz);
if ($status_kurzbz === 'onhold_zgv')
$this->sendRueckstellungMessage($person_id);
$this->outputJson($result);
}
@@ -104,6 +109,10 @@ class Rueckstellung extends Auth_Controller
if (isError($result))
$this->terminateWithJsonError(getError($result));
$this->_log($person, $status_kurzbz);
if ($status_kurzbz === 'onhold_zgv')
$this->sendRueckstellungMessage($person);
}
$this->outputJsonSuccess("Erfolgreich gespeichert!");
}
@@ -160,4 +169,26 @@ class Rueckstellung extends Auth_Controller
$this->_uid
);
}
private function sendRueckstellungMessage($person_id)
{
$person = $this->_ci->PersonModel->load($person_id);
if (hasData($person))
{
$person = getData($person)[0];
return $this->messagelib->sendMessageUserTemplate(
$person_id,
self::ZGV_UEBERPRUEFUNG_MAIL_VORLAGE,
array(
'anrede' => $person->anrede,
'nachname' => $person->nachname
),
null,
getAuthPersonId(),
'infocenter'
);
}
}
}
+121 -19
View File
@@ -136,37 +136,77 @@ abstract class FHC_Controller extends CI_Controller
/**
* To download the given file represented by the fileObj parameter.
* fileObj has the following structure:
* $fileObj->filename
* $fileObj->file
* $fileObj->file OR $fileObj->file_content
* $fileObj->name
* $fileObj->mimetype
* $fileObj->disposition
* $fileObj->disposition (inline OR attachment)
*/
protected function outputFile($fileObj)
{
// If the file exists
if (isset($fileObj->file) && !isEmptyString($fileObj->file) && file_exists($fileObj->file))
if ((isset($fileObj->file) && !isEmptyString($fileObj->file) && file_exists($fileObj->file))
|| (isset($fileObj->file_content) && !isEmptyString($fileObj->file_content)))
{
header('Content-Description: File Transfer');
header('Content-Type: '. $fileObj->mimetype);
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($fileObj->file));
$content_length = 0;
if (isset($fileObj->disposition)
&& ($fileObj->disposition == 'inline' || $fileObj->disposition == 'attachment'))
// If file content has been provided
if (isset($fileObj->file_content) && !isEmptyString($fileObj->file_content))
{
header('Content-Disposition: '. $fileObj->disposition. '; filename="'. $fileObj->name. '"');
$content_length = strlen($fileObj->file_content);
}
else // otherwise the path + name of the file
{
$content_length = filesize($fileObj->file);
}
readfile($fileObj->file); // reads the file content to the output buffer
}
else
{
// Otherwise print an error
show_error('The provided file does not exist: '.(isset($fileObj->file) ? $fileObj->file : 'file not given'));
header('Content-Description: File Transfer');
header('Content-Type: '. $fileObj->mimetype);
header('Content-Length: ' . $content_length);
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: '. $fileObj->disposition. '; filename="'. $fileObj->name. '"');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Expires: ' . date("D, d M Y H:i:s", time()));
header('Pragma: public');
// Clean the output buffer
flush();
// If file content has been provided
if (isset($fileObj->file_content) && !isEmptyString($fileObj->file_content))
{
echo $fileObj->file_content;
}
else // otherwise get the content from file system
{
readfile($fileObj->file);
}
// Terminate the execution
exit();
}
// Otherwise return an error
show_error('The provided file does not exist or file content is empty');
}
/**
*
*/
protected function outputImageByContent($mimetype, $file_content)
{
if (isEmptyString($file_content)) show_error('The provided file content is not valid');
$this->_outputImage($mimetype, $file_content);
}
/**
*
*/
protected function outputImageByFile($mimetype, $file_name)
{
if (!file_exists($file_name)) show_error('The provided file does not exist');
$this->_outputImage($mimetype, null, $file_name);
}
/**
@@ -178,6 +218,29 @@ abstract class FHC_Controller extends CI_Controller
return json_decode($this->input->raw_input_stream);
}
/**
* Utility function to upload a file
* - post_field_name: the name of the field in the HTTP POST payload, this is also the index in the super global $_FILES array
* - allowed_types: a list of file extensions that are allowed to be uploaded (ex. array('pdf', 'odt') or array('jpg', 'jpeg', 'gif')
*/
protected function uploadFile($post_field_name, $allowed_types = array('*'))
{
$this->load->library(
'upload',
array(
'upload_path' => sys_get_temp_dir(),
'allowed_types' => $allowed_types,
'overwrite' => true
)
);
// If the upload was a success then return the uploaded file info
if ($this->upload->do_upload($post_field_name)) return success($this->upload->data());
// If an error occurred then return it without tags
return error($this->upload->display_errors('', ''));
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
@@ -193,5 +256,44 @@ abstract class FHC_Controller extends CI_Controller
show_error('This web site cannot work correctly without the HTTPS protocol enabled');
}
}
/**
*
*/
private function _outputImage($mimetype, $file_content = null, $file_name = null)
{
$content_length = 0;
// If file content has been provided
if ($file_content != null)
{
$content_length = strlen($file_content);
}
else // otherwise the path + name of the file
{
$content_length = filesize($file_name);
}
header('Content-Type: '. $mimetype);
header('Content-Length: ' . $content_length);
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Expires: ' . date("D, d M Y H:i:s", time()));
// Clean the output buffer
flush();
// If file content has been provided
if ($file_content != null)
{
echo $file_content;
}
else // otherwise get the content from file system
{
readfile($file_name);
}
// Terminate the execution
exit();
}
}
+57 -26
View File
@@ -196,26 +196,39 @@ abstract class Notiz_Controller extends FHCAPI_Controller
$dms_id_arr = [];
foreach ($_FILES as $k => $file)
{
$dms = array(
'kategorie_kurzbz' => 'notiz',
'version' => 0,
'name' => $file["name"],
'mimetype' => $file["type"],
'insertamum' => date('c'),
'insertvon' => $uid
);
//Todo(manu) check if filetypes weiter eingeschränkt werden sollen
//Todo(manu)check name files: nicht gleiches file 2mal hochladen
//Todo define in dms component: readFile, downloadFile
$result = $this->dmslib->upload($dms, $k, ['*']);
/* $result = $this->dmslib->upload($dms, $k, ['application/pdf','application/x.fhc-dms+json']);*/
if (isError($result))
$uploadDataResult = $this->uploadFile($k);
if (isError($uploadDataResult))
{
$this->db->trans_rollback();
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
$this->terminateWithError(getError($uploadDataResult), self::ERROR_TYPE_GENERAL);
}
$dms_id_arr[] = $result->retval['dms_id'];
if (!hasData($uploadDataResult))
{
$this->db->trans_rollback();
$this->terminateWithError('Upload failed', self::ERROR_TYPE_GENERAL);
}
// Add file to the DMS (DB + file system)
$addResult = $this->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'notiz', // kategorie_kurzbz
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
// If error occurred
if (isError($addResult) || !hasData($addResult))
$this->terminateWithError(getError($addResult), self::ERROR_TYPE_GENERAL);
$dms_id_arr[] = getData($addResult)->dms_id;
}
//save entry in Notizdokument
@@ -319,22 +332,40 @@ abstract class Notiz_Controller extends FHCAPI_Controller
}
else
{
$dms = array(
'kategorie_kurzbz' => 'notiz',
'version' => 0,
'name' => $file["name"],
'mimetype' => $file["type"],
'insertamum' => date('c'),
'insertvon' => $uid
);
//Todo(manu) check if filetypes weiter eingeschränkt werden sollen
//Todo(manu)check name files: nicht gleiches file 2mal hochladen
//Todo define in dms component: readFile, downloadFile
$result = $this->dmslib->upload($dms, $k, array('*'));
$uploadDataResult = $this->uploadFile($k);
if (isError($uploadDataResult))
{
$this->db->trans_rollback();
$this->terminateWithError(getError($uploadDataResult), self::ERROR_TYPE_GENERAL);
}
if (!hasData($uploadDataResult))
{
$this->db->trans_rollback();
$this->terminateWithError('Upload failed', self::ERROR_TYPE_GENERAL);
}
$result = $this->getDataOrTerminateWithError($result);
$dms_id = $result['dms_id'];
// Add file to the DMS (DB + file system)
$addResult = $this->dmslib->add(
getData($uploadDataResult)['file_name'],
getData($uploadDataResult)['file_type'],
fopen(getData($uploadDataResult)['full_path'], 'r'),
'notiz', // kategorie_kurzbz
null, // dokument_kurzbz
null, // beschreibung
false, // cis_suche
null, // schlagworte
getAuthUID() // insertvon
);
// If error occurred
if (isError($addResult) || !hasData($addResult))
$this->terminateWithError(getError($addResult), self::ERROR_TYPE_GENERAL);
$addResult = $this->getDataOrTerminateWithError($addResult);
$dms_id = $addResult['dms_id'];
$result = $this->NotizdokumentModel->insert(array('notiz_id' => $post_data['notiz_id'], 'dms_id' => $dms_id));
+4 -4
View File
@@ -418,10 +418,10 @@ function findResource($path, $resource, $subdir = false, $extraDir = null)
if (!function_exists('array_is_list')) {
function array_is_list(array $arr)
{
if ($arr === []) {
return true;
}
return array_keys($arr) === range(0, count($arr) - 1);
if ($arr === []) {
return true;
}
return array_keys($arr) === range(0, count($arr) - 1);
}
}
+203 -124
View File
@@ -1,12 +1,21 @@
<?php
/**
* FH-Complete
/* Copyright (C) 2025 fhcomplete.net
*
* 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.
*
* @package FHC-Helper
* @author FHC-Team
* @copyright Copyright (c) 2022 fhcomplete.net
* @license GPLv3
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
@@ -121,90 +130,32 @@ class AkteLib
* Gets akte data and associated dms data by akte Id
* Returns success with akte and dms data or error
*/
public function get($akte_id)
public function getByAkteId($akte_id, $dokument_kurzbz = null, $archiv = null, $signiert = null, $stud_selfservice = null)
{
// get Akte data
$this->_ci->AkteModel->addSelect('person_id, dokument_kurzbz, mimetype, erstelltam, titel, bezeichnung,
gedruckt, uid, dms_id, nachgereicht, nachgereicht_am, anmerkung,
ausstellungsnation, formal_geprueft_amum, archiv, signiert,
stud_selfservice, akzeptiertamum, insertvon, insertamum, updatevon, updateamum');
$this->_ci->AkteModel->load($akte_id);
$akteResult = $this->_ci->AkteModel->load($akte_id);
if (isError($akteResult)) return $akteResult;
if (!hasData($akteResult)) return error("Akte not found");
$resultObject = getData($akteResult)[0];
// set properties with same name in Akte and Dms table
$resultObject->akte_mimetype = $resultObject->mimetype;
// get dms data
$dmsResult = $this->_ci->dmslib->getLastVersion($resultObject->dms_id);
if (isError($dmsResult)) return $dmsResult;
// properties to retrieve from dms
$dmsProperties = array('version', 'filename', 'mimetype', 'name', 'beschreibung', 'cis_suche', 'schlagworte', DmsLib::FILE_CONTENT_PROPERTY);
// set dms properties
if (hasData($dmsResult))
{
$dmsData = getData($dmsResult);
foreach ($dmsProperties as $dmsProperty)
{
$resultObject->{$dmsProperty} = $dmsData->{$dmsProperty};
}
}
else
{
// set null if no dms result found
foreach ($dmsProperties as $dmsProperty)
{
$resultObject->{$dmsProperty} = null;
}
}
// return the object containing akte and dms data
return success($resultObject);
return $this->_get(
$akte_id,
null, // person_id
$dokument_kurzbz,
$archiv,
$signiert,
$stud_selfservice
);
}
/**
* Gets Akte data and associated dms data by person Id and dokument_kurzbz
* Returns success with result array with akte and dms data or error
*/
public function getByPersonIdAndDocumentType($person_id, $dokument_kurzbz)
public function getByPersonId($person_id, $dokument_kurzbz = null, $archiv = null, $signiert = null, $stud_selfservice = null)
{
// load all Akte entries for given person and dokument_kurzbz
$this->_ci->AkteModel->addSelect('akte_id');
$akteResult = $this->_ci->AkteModel->loadWhere(
array(
'person_id' => $person_id,
'dokument_kurzbz' => $dokument_kurzbz
)
return $this->_get(
null, // akte_id
$person_id,
$dokument_kurzbz,
$archiv,
$signiert,
$stud_selfservice
);
if (!hasData($akteResult)) return error("Akte not found");
$akteData = getData($akteResult);
$resultArr = array();
// for each found akte entry
foreach ($akteData as $akte)
{
// get dms and akte data from akte Id
$getAkteDmsResult = $this->get($akte->akte_id);
if (isError($getAkteDmsResult)) return $getAkteDmsResult;
$resultArr[] = getData($getAkteDmsResult);
}
// return all found entries
return success($resultArr);
}
/**
@@ -213,56 +164,184 @@ class AkteLib
*/
public function remove($akte_id)
{
// get dms_id for akte
return $this->_remove($akte_id, null, null);
}
/**
* Removes Akte by $person_id and $dms_id, removes all associated dms entries and versions, and deletes all associated files
* Returns success with removed version numbers or error
*/
public function removeByPersonIdAndDmsId($person_id, $dms_id)
{
return $this->_remove(null, $person_id, $dms_id);
}
/**
*
*/
private function _get($akte_id = null, $person_id = null, $dokument_kurzbz = null, $archiv = null, $signiert = null, $stud_selfservice = null)
{
$dbModel = new DB_Model();
$query = 'SELECT akte_id,
person_id,
dokument_kurzbz,
inhalt,
CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden,
mimetype,
erstelltam,
gedruckt,
titel,
bezeichnung,
updateamum,
updatevon,
insertamum,
insertvon,
uid,
dms_id,
nachgereicht,
anmerkung,
titel_intern,
anmerkung_intern,
nachgereicht_am,
ausstellungsnation,
formal_geprueft_amum,
archiv,
signiert,
stud_selfservice,
akzeptiertamum
FROM public.tbl_akte
WHERE TRUE';
// Query parameters
$paramArray = array();
// akte_id
if (is_numeric($akte_id) || is_array($akte_id))
{
$paramArray[] = $akte_id;
if (is_numeric($akte_id)) $query .= ' AND akte_id = ?';
if (is_array($akte_id)) $query .= ' AND akte_id IN ?';
}
// person_id
if (is_numeric($person_id) || is_array($person_id))
{
$paramArray[] = $person_id;
if (is_numeric($person_id)) $query .= ' AND person_id = ?';
if (is_array($person_id)) $query .= ' AND person_id IN ?';
}
// dokument_kurzbz
if (!isEmptyString($dokument_kurzbz))
{
$paramArray[] = $dokument_kurzbz;
$query .= ' AND dokument_kurzbz = ?';
}
// archiv
if (is_bool($archiv))
{
$paramArray[] = $archiv;
$query .= ' AND archiv = ?';
}
// signiert
if (is_bool($signiert))
{
$paramArray[] = $signiert;
$query .= ' AND signiert = ?';
}
// stud_selfservice
if (is_bool($stud_selfservice))
{
$paramArray[] = $stud_selfservice;
$query .= ' AND stud_selfservice = ?';
}
// If no parameters has been provided exit
if (isEmptyArray($paramArray)) return error('Called without giving any parameter');
// Loads data from DB
$akteResult = $dbModel->execReadOnlyQuery($query, $paramArray);
// If error or data not found then exit
if (isError($akteResult)) return $akteResult;
if (!hasData($akteResult)) return error('Akte not found');
// For each record from the akte
foreach (getData($akteResult) as $resultObject)
{
// get dms data
$dmsResult = $this->_ci->dmslib->getLastVersion($resultObject->dms_id);
if (isError($dmsResult)) return $dmsResult;
// properties to retrieve from dms
$dmsProperties = array('version', 'filename', 'mimetype', 'name', 'beschreibung', 'cis_suche', 'schlagworte');
// set dms properties
if (hasData($dmsResult))
{
$dmsData = getData($dmsResult)[0];
foreach ($dmsProperties as $dmsProperty)
{
// If the property is _not_ 'mimetype' _or_
// If the mimetype from the akte table is null then overwrite it with the one from the DMS
if ($dmsProperty != 'mimetype' || ($dmsProperty == 'mimetype' && $resultObject->{$dmsProperty} == null))
{
$resultObject->{$dmsProperty} = $dmsData->{$dmsProperty};
}
}
}
else
{
// Set null if no dms result found
foreach ($dmsProperties as $dmsProperty)
{
if ($dmsProperty != 'mimetype') $resultObject->{$dmsProperty} = null;
}
}
}
// return the object containing akte and dms data
return success(getData($akteResult));
}
/**
* Removes Akte by akte Id, person id and/or dms id
* Removes all associated dms entries and versions, and deletes all associated files
* Returns success with removed version numbers or error
*/
private function _remove($akte_id = null, $person_id = null, $dms_id = null)
{
// Get dms_id for akte
$this->_ci->AkteModel->addSelect('akte_id');
$this->_ci->AkteModel->addSelect('dms_id');
$akteResult = $this->_ci->AkteModel->load($akte_id);
$paramArray = array();
if (is_numeric($akte_id)) $paramArray['akte_id'] = $akte_id;
if (is_numeric($person_id)) $paramArray['person_id'] = $person_id;
if (is_numeric($dms_id)) $paramArray['dms_id'] = $dms_id;
$akteResult = $this->_ci->AkteModel->loadWhere($paramArray);
if (isError($akteResult)) return $akteResult;
if (!hasData($akteResult)) return error("Akte not found");
if (!hasData($akteResult)) return error('Akte not found');
$dms_id = getData($akteResult)[0]->dms_id;
$error = null;
// Delete Akte
$deleteResult = $this->_ci->AkteModel->delete(getData($akteResult)[0]->akte_id);
// Start DB transaction to avoid deleting only part of the data
$this->_ci->db->trans_begin();
if (isError($deleteResult)) return $deleteResult;
// delete Akte
$deleteResult = $this->_ci->AkteModel->delete($akte_id);
// Remove all dms entry for dms of the akte
$removeAllResult = $this->_ci->dmslib->removeAll(getData($akteResult)[0]->dms_id);
if (isError($deleteResult))
{
$error = $deleteResult;
}
else
{
// remove all dms entry for dms of the akte
$removeAllResult = $this->_ci->dmslib->removeAll($dms_id);
if (isError($removeAllResult))
$error = $removeAllResult;
}
// Transaction complete!
$this->_ci->db->trans_complete();
// Check if everything went ok during the transaction
if ($this->_ci->db->trans_status() === false || isset($error))
{
$this->_ci->db->trans_rollback();
// return occured error
if (isset($error))
return $error;
else
return error("Error occured when deleting, rolled back");
}
else
{
$this->_ci->db->trans_commit();
// return removed dms entry data
return $removeAllResult;
}
return $removeAllResult;
}
}
+1 -1
View File
@@ -741,7 +741,7 @@ class AnrechnungLib
$fullname = hasData($result) ? $result->retval[0]->vorname. $result->retval[0]->nachname : '';
// Return filename
return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname;
return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname . '.pdf';
}
public function LVhasLector($anrechnung_id)
+118 -523
View File
@@ -1,12 +1,21 @@
<?php
/**
* FH-Complete
/* Copyright (C) 2025 fhcomplete.net
*
* 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.
*
* @package FHC-Helper
* @author FHC-Team
* @copyright Copyright (c) 2022 fhcomplete.net
* @license GPLv3
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
@@ -15,24 +24,17 @@ use \stdClass as stdClass;
class DmsLib
{
const FILE_CONTENT_PROPERTY = 'file_content'; // property name for file content
const DMS_SYS_NAME = 'DMS System';
private $_ci; // code igniter instance
private $_who; // who added this document
/**
* Object initialization
*/
public function __construct($params = null)
public function __construct()
{
$this->_ci =& get_instance();
// Set the the _who property
$this->_who = 'DMS system'; // default
// It is possible to set it using the who parameter
if (!isEmptyArray($params) && isset($params['who']) && !isEmptyString($params['who'])) $this->_who = $params['who'];
$this->_ci->load->model('crm/Akte_model', 'AkteModel'); // deprecated, should not be used here!
$this->_ci->load->model('content/Dms_model', 'DmsModel');
$this->_ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
$this->_ci->load->model('content/DmsFS_model', 'DmsFSModel');
@@ -46,69 +48,85 @@ class DmsLib
* Returns success info of added dms entry (dms_id, version, filename) or error
*/
public function add(
$name, $mimetype, $fileHandle, // Required parameters
$kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null
// Required parameters
$name, $mimetype, $fileHandle,
// Optional parameters
$kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null, $insertvon = self::DMS_SYS_NAME
)
{
// create unique filename, using original document name to detect file extension
$filename = $this->_getUniqueFilename($name);
// If the file handle is not valid
if ($fileHandle === false) return error('Was not possible to open the given file');
// copy file from fileHandle to dms folder
$copyFileResult = $this->_copyFile($fileHandle, $filename);
// Create unique filename, using original document name to detect file extension
$filename = $this->_getUniqueFilename($name);
if (isError($copyFileResult)) return $copyFileResult;
// Copy file from fileHandle to dms folder
$copyFileResult = $this->_copyFile($fileHandle, $filename);
// if file written successful, insert dms
$dmsResult = $this->_ci->DmsModel->insert(
array(
'kategorie_kurzbz' => $kategorie_kurzbz,
'dokument_kurzbz' => $dokument_kurzbz
)
// If an error occrured while copying the file
if (isError($copyFileResult)) return $copyFileResult;
// Insert the new DMS
$dmsResult = $this->_ci->DmsModel->insert(
array(
'kategorie_kurzbz' => $kategorie_kurzbz,
'dokument_kurzbz' => $dokument_kurzbz
)
);
// If an error occurred
if (isError($dmsResult)) return $dmsResult;
// If a DMS in the previous insert returned the new PK value
if (hasData($dmsResult))
{
$dms_id = getData($dmsResult);
// Insert the DMS version
$dmsVersion = array(
'dms_id' => $dms_id,
'version' => 0,
'filename' => $filename,
'mimetype' => $mimetype,
'name' => $name,
'beschreibung' => $beschreibung,
'cis_suche' => $cis_suche,
'schlagworte' => $schlagworte,
'insertvon' => $insertvon,
'insertamum' => date('Y-m-d H:i:s')
);
if (isError($dmsResult)) return $dmsResult;
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
if (hasData($dmsResult))
{
$dms_id = getData($dmsResult);
$version = 0;
// If an error occured
if (isError($dmsVersionResult)) return $dmsVersionResult;
// insert dms version
$dmsVersion = array(
'dms_id' => $dms_id,
'version' => $version,
'filename' => $filename,
'mimetype' => $mimetype,
'name' => $name,
'beschreibung' => $beschreibung,
'cis_suche' => $cis_suche,
'schlagworte' => $schlagworte,
'insertvon' => $this->_who,
'insertamum' => date('Y-m-d H:i:s')
);
// Return dms info
$resObj = new stdClass();
$resObj->dms_id = $dms_id;
$resObj->version = 0;
$resObj->filename = $filename;
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
if (isError($dmsVersionResult)) return $dmsVersionResult;
// return dms info
$resObj = new stdClass();
$resObj->dms_id = $dms_id;
$resObj->version = $version;
$resObj->filename = $filename;
return success($resObj);
}
else
return error("error when inserting DMS");
return success($resObj);
}
else
return success();
}
/**
* Writes a new file with content of fileHandle, adds a new dms version (max version number + 1) for the written file
* Returns success with info of added dms version (version, filename) or error
*/
public function addNewVersion($dms_id, $fileHandle, $name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null)
public function addNewVersion(
// Required parameters
$dms_id, $fileHandle,
// Optional parameters
$name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null, $insertvon = self::DMS_SYS_NAME
)
{
// If the file handle is not valid
if ($fileHandle === false) return error('Was not possible to open the given file');
// get the latest version
$lastVersionResult = $this->getLastVersion($dms_id);
@@ -141,7 +159,7 @@ class DmsLib
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
'insertvon' => $this->_who,
'insertvon' => $insertvon,
'insertamum' => date('Y-m-d H:i:s')
);
@@ -157,7 +175,7 @@ class DmsLib
return success($resObj);
}
else
return error("last version not found");
return success();
}
/**
@@ -167,6 +185,9 @@ class DmsLib
*/
public function updateLastVersion($dms_id, $fileHandle, $name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null)
{
// If the file handle is not valid
if ($fileHandle === false) return error('Was not possible to open the given file');
// get the latest version
$lastVersionResult = $this->getLastVersion($dms_id);
@@ -208,12 +229,12 @@ class DmsLib
return success($resObj);
}
else
return error("last version not found");
return success();
}
/**
* Gets dms version with highest number
* Returns success with dms data and fileHandle with file content or error
* Returns success with dms data or error
*/
public function getLastVersion($dms_id)
{
@@ -237,12 +258,12 @@ class DmsLib
return $this->getVersion($dms_id, $lastDmsVersion);
}
else
return error("Dms last version not found");
return success();
}
/**
* Gets specified dms version
* Returns success with dms data and fileHandle with file content or error
* Returns success with dms data or error
*/
public function getVersion($dms_id, $version)
{
@@ -254,34 +275,7 @@ class DmsLib
)
);
if (isError($dmsVersionResult)) return $dmsVersionResult;
if (hasData($dmsVersionResult))
{
$dmsVersion = getData($dmsVersionResult)[0];
// get file content as file pointer
$fileHandleResult = $this->_ci->DmsFSModel->openRead($dmsVersion->filename);
if (isError($fileHandleResult)) return $fileHandleResult;
if (hasData($fileHandleResult))
{
$fileHandle = getData($fileHandleResult);
$dmsVersion->{self::FILE_CONTENT_PROPERTY} = $fileHandle;
// close file pointer
$closeResult = $this->_ci->DmsFSModel->close($fileHandle);
if (isError($closeResult)) return $closeResult;
return success($dmsVersion);
}
else
return error("File could not be opened");
}
else
return error("Dms version not found");
return $dmsVersionResult;
}
/**
@@ -420,6 +414,34 @@ class DmsLib
return success($removeVersionResultObj);
}
/**
* Get info from the DMS to be provided to the FHC_Controller->outputFile
*/
public function getOutputFileInfo($dms_id, $file_name = '', $disposition = 'attachment')
{
// Loads the last DMS version from database
$lastVersionResult = $this->getLastVersion($dms_id);
// If an error occurred then return it
if (isError($lastVersionResult)) return $lastVersionResult;
// If has been found
if (hasData($lastVersionResult))
{
$lastVersion = getData($lastVersionResult)[0];
$fileObj = new stdClass();
$fileObj->file = DMS_PATH.$lastVersion->filename;
$fileObj->name = isEmptyString($file_name) ? $lastVersion->name : $file_name;
$fileObj->mimetype = $lastVersion->mimetype;
$fileObj->disposition = $disposition;
return success($fileObj);
}
return success();
}
// -----------------------------------------------------------------------------------------------------------
// Private methods
@@ -474,432 +496,5 @@ class DmsLib
return $uniqueFilename;
}
// -----------------------------------------------------------------------------------------------------------
// Deprecated methods, not to be used
/**
* Load a DMS Document.
* If no version is particularly given, the latest version is loaded.
*
* @param $dms_id
* @param integer $version
* @return array
*/
public function load($dms_id, $version = null)
{
if (is_numeric($dms_id))
{
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
$this->_ci->DmsModel->addOrder('version', 'DESC');
$this->_ci->DmsModel->addLimit(1);
if (!is_numeric($version))
{
return $this->_ci->DmsModel->load($dms_id);
}
else
{
return $this->_ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
}
}
return error('The parameter DMS ID must be a number');
}
/**
* Read a DMS Document from the Filesystem
* @param int $dms_id ID of the Document.
* @param int $version The version of the Document (latest if null).
* @return object success or error
*/
public function read($dms_id, $version = null)
{
$result = error('Wrong dms_id parameter');
if (isset($dms_id))
{
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
$this->_ci->DmsModel->addOrder('version', 'DESC');
$this->_ci->DmsModel->addLimit(1);
if (!isset($version))
{
$result = $this->_ci->DmsModel->load($dms_id);
}
else
{
$result = $this->_ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
}
// If a dms has been found
if (hasData($result))
{
$resultFS = $this->_ci->DmsFSModel->readBase64(getData($result)[0]->filename);
if (isError($resultFS)) return $resultFS; // if an error occurred return it
$result->retval[0]->{self::FILE_CONTENT_PROPERTY} = getData($resultFS);
}
}
return $result;
}
/**
* Get all accepted Documents of a Person
*
* @param int $person_id ID of the person.
* @param string $dokument_kurzbz Type of document.
* @param bool $no_file If null then loads also the content.
* @return object success or error
*/
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null, $no_file = null)
{
$result = $this->_ci->AkteModel->getAktenAcceptedDms($person_id, $dokument_kurzbz);
if (hasData($result) && $no_file == null)
{
for ($i = 0; $i < count(getData($result)); $i++)
{
$resultFS = $this->_ci->DmsFSModel->readBase64(getData($result)[$i]->filename);
if (isError($resultFS)) return $resultFS; // if an error occurred return it
$result->retval[$i]->{self::FILE_CONTENT_PROPERTY} = getData($resultFS);
}
}
return $result;
}
/**
* Uploads a document and saves it to DMS
* @param $dms DMS assoc array
* @param $field_name Name of the HTML uploadfile input name attribute
* @param array $allowed_types Default: all. Param example: array(jpg, pdf)
* @return array
*/
public function upload($dms, $field_name, $allowed_types = array('*'))
{
// Init upload configs
$this->_loadUploadLibrary($allowed_types);
if (!$this->_ci->upload->do_upload($field_name))
{
return error($this->_ci->upload->display_errors());
}
$upload_data = $this->_ci->upload->data(); // data about the uploaded file
// Insert to DMS table
$insDmsResult = $this->_ci->DmsModel->insert($this->_ci->DmsModel->filterFields($dms));
if (isError($insDmsResult)) return $insDmsResult;
$upload_data['dms_id'] = getData($insDmsResult);
if(isset($upload_data['file_type']) && !isset($dms['mimetype']))
$dms['mimetype'] = $upload_data['file_type'];
// Insert DMS version
$insVersionResult = $this->_ci->DmsVersionModel->insert(
$this->_ci->DmsVersionModel->filterFields(
$dms,
$upload_data['dms_id'],
$upload_data['file_name']
)
);
if (isError($insVersionResult)) return $insVersionResult;
// Return result of uploaded data
return success($upload_data);
}
/**
* Download a document.
*
* @param $dms_id
* @param string $filename $filename If String is given, it will be used as filename on download
* @param string $disposition [inline | attachment]
* Inline opens doc in new tab. Attachment displays download dialog box.
*/
public function download($dms_id, $filename = null, $disposition = 'inline')
{
// Retrieves info about the given dms
$fileInfoResult = $this->getFileInfo($dms_id);
if (isError($fileInfoResult)) return error(getError($fileInfoResult));
// If data have been found
if (hasData($fileInfoResult))
{
$fileObj = getData($fileInfoResult);
// Change filename, if filename is provided
if (!isEmptyString($filename)) $fileObj->name = $filename;
// Add file disposition if disposition has a valid value
if ($disposition == 'attachment' || $disposition == 'inline')
{
$fileObj->disposition = $disposition;
}
return success($fileObj);
}
// If no data have been found then return an empty success
return success();
}
/**
* Get file information.
*
* @param $dms_id
* @param integer $version
* @return array with File Object.
*/
public function getFileInfo($dms_id, $version = null)
{
// Checks the dms_id parameter
if (!is_numeric($dms_id)) return error('Wrong parameter');
// Load DMS from database
$result = $this->load($dms_id, $version);
if (isError($result)) return error(getError($result));
// If data have been found
if (hasData($result))
{
// Store file information in fileObj
$fileObj = new stdClass();
$fileObj->filename = getData($result)[0]->filename;
$fileObj->file = DMS_PATH.getData($result)[0]->filename;
$fileObj->name = getData($result)[0]->name; // original user filename
$fileObj->mimetype = getData($result)[0]->mimetype;
return success($fileObj);
}
// If no data have been found return an empty success
return success();
}
/**
* Saves a Document
* @param object $dms DMS Object ot be saved.
* @return object
*/
public function save($dms)
{
$result = null;
if (isset($dms['new']) && $dms['new'] == true)
{
// Remove new parameter to avoid DB insert errors
unset($dms['new']);
$result = $this->_saveFileOnInsert($dms);
if (isSuccess($result))
{
$filename = getData($result);
if (isset($dms['dms_id']) && $dms['dms_id'] != '')
{
$result = $this->_ci->DmsVersionModel->insert(
$this->_ci->DmsVersionModel->filterFields($dms, $dms['dms_id'], $filename)
);
}
else
{
$result = $this->_ci->DmsModel->insert($this->_ci->DmsModel->filterFields($dms));
if (isSuccess($result))
{
$result = $this->_ci->DmsVersionModel->insert(
$this->_ci->DmsVersionModel->filterFields($dms, getData($result), $filename)
);
}
}
}
}
else
{
$result = $this->_saveFileOnUpdate($dms);
if (isSuccess($result))
{
$result = $this->_ci->DmsModel->update($dms['dms_id'], $this->_ci->DmsModel->filterFields($dms));
if (isSuccess($result))
{
$result = $this->_ci->DmsVersionModel->update(
array(
$dms['dms_id'],
$dms['version']
),
$this->_ci->DmsVersionModel->filterFields($dms)
);
}
}
}
return $result;
}
/**
* Deletes a Akte of a Person
* @param int $person_id ID of the person.
* @param int $dms_id Id of the Document.
* @return object
*/
public function delete($person_id, $dms_id)
{
$result = null;
// If the parameters are valid
if (is_numeric($person_id) && is_numeric($dms_id))
{
// Start DB transaction
$this->_ci->db->trans_start(false);
// Get akte_id from table tbl_akte
$result = $this->_ci->AkteModel->loadWhere(array('person_id' => $person_id, 'dms_id' => $dms_id));
if (isSuccess($result))
{
// Delete all entries in tbl_akte
for ($i = 0; $i < count(getData($result)); $i++)
{
$this->_ci->AkteModel->delete(getData($result)[$i]->akte_id);
}
// Get all filenames related to this dms
$resultFileNames = $this->_ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id));
if (isSuccess($resultFileNames))
{
// Delete from tbl_dms_version
$result = $this->_ci->DmsVersionModel->delete(array('dms_id' => $dms_id));
if (isSuccess($result))
{
// Delete from tbl_dms
$result = $this->_ci->DmsModel->delete($dms_id);
}
}
}
// Transaction complete!
$this->_ci->db->trans_complete();
// Check if everything went ok during the transaction
if ($this->_ci->db->trans_status() === false || isError($result))
{
$this->_ci->db->trans_rollback();
$result = error('An error occurred while performing a delete operation', EXIT_ERROR);
}
else
{
$this->_ci->db->trans_commit();
$result = success('Dms successfully removed from DB');
}
// If everything is ok
if (isSuccess($result))
{
// Remove all files related to this person and dms
for ($i = 0; $i < count(getData($resultFileNames)); $i++)
{
$this->_ci->DmsFSModel->removeBase64(getData($resultFileNames)[$i]->filename);
}
}
}
else
{
$result = error('Invalid parameters');
}
return $result;
}
/**
* Loads the Content of an akte
* @param int $akte_id Id of the akte.
* @return object with document content or error
*/
public function getAkteContent($akte_id)
{
$akte = $this->_ci->AkteModel->load($akte_id);
if (hasData($akte))
{
if (getData($akte)[0]->inhalt != '')
{
return success(base64_decode(getData($akte)[0]->inhalt));
}
elseif (getData($akte)[0]->dms_id != '')
{
$dmscontent = $this->read(getData($akte)[0]->dms_id);
if (isSuccess($dmscontent))
{
return success(base64_decode(getData($dmscontent)[0]->file_content));
}
else
{
return error(getError($dmscontent));
}
}
else
{
return error('No Content available');
}
}
else
{
return error(getError($akte));
}
}
/**
* Saves the Content of a DMS in the Filesystem
* @param object $dms DMS object to be saved.
* @return object
*/
private function _saveFileOnInsert($dms)
{
$filename = uniqid().'.'.pathinfo($dms['name'], PATHINFO_EXTENSION);
$result = $this->_ci->DmsFSModel->writeBase64($filename, $dms['file_content']);
if (isSuccess($result))
{
$result = success($filename);
}
return $result;
}
/**
* Updates the File in the Filesystem
* @param object $dms DMS object to update.
* @return object
*/
private function _saveFileOnUpdate($dms)
{
$result = null;
if (isset($dms['version']))
{
$result = $this->read($dms['dms_id'], $dms['version']);
if (hasData($result))
{
$result = $this->_ci->DmsFSModel->writeBase64(getData($result)[0]->filename, $dms['file_content']);
}
}
return $result;
}
/**
* Loads the upload library of CI
*/
private function _loadUploadLibrary($allowed_types)
{
$config = array();
$config['upload_path'] = DMS_PATH;
$config['allowed_types'] = implode('|', $allowed_types);
$config['overwrite'] = true;
$config['file_name'] = uniqid().'.pdf';
$this->_ci->load->library('upload', $config);
$this->_ci->upload->initialize($config);
}
}
+37 -236
View File
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2024 fhcomplete.net
/* Copyright (C) 2025 fhcomplete.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -34,15 +34,11 @@ use SimpleXMLElement as SimpleXMLElement;
* modifiing said data (sign()/setXMLTag_archivierbar()) or adding
* images (addImage()) and then call output() and close().
* Now the create, output and close functions are combined into one function and adding data and images is done via parameters.
* There are now two functions getContent() and showContent() where showContent() equals to output(false) and getContent equals to output(true)
* Instead of calling addDataArray, addDataXML or addDataURL just call
* getDataArray, getDataXML or getDataURL respectevily and use the return
* value as $xml_data parameter in the showContent and getContent calls.
* value as $xml_data parameter in the getContent call.
* Instead of calling addImages just create an array and pass it as $images
* parameter to the showContent/getContent function.
* The old setFilename() function is now a parameter in showContent(). It is
* not needed in getContent() since that function does not do anything that
* requires a filename.
* parameter to the getContent function.
* To get/show a signed document just pass a valid uid as $sign_user
* parameter.
*
@@ -63,21 +59,10 @@ use SimpleXMLElement as SimpleXMLElement;
* 'name' => $imagename,
* 'contenttype' => $imagecontenttype
* ]];
* $this->documentexportlib->showContent(
* $filename,
* $vorlage,
* $xml_data,
* $oe_kurzbz,
* $version,
* $outputformat,
* null,
* null,
* $images
* );
*/
class DocumentExportLib
{
private $unoconv_version;
private $_ci;
/**
* Constructor
@@ -85,33 +70,14 @@ class DocumentExportLib
public function __construct()
{
// Gets CI instance
$this->ci =& get_instance();
$this->_ci =& get_instance();
// Load Phrases
$this->ci->load->library('PhrasesLib', ['document_export', null], 'documentExportPhrases');
// Load phrases
$this->_ci->load->library('PhrasesLib', ['document_export', null], 'DocumentExportPhrases');
// Which document converter has to be used
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
{
// Use docsbox!!
}
else
{
exec('unoconv --version', $ret_arr);
if(isset($ret_arr[0]))
{
$hlp = explode(' ', $ret_arr[0]);
if(isset($hlp[1]))
{
$this->unoconv_version = $hlp[1];
}
else
show_error($this->ci->documentExportPhrases->t("document_export", "error_unoconv_version"));
}
else
show_error($this->ci->documentExportPhrases->t("document_export", "error_unoconv"));
}
// Load libraries
$this->_ci->load->library('DocumentLib');
$this->_ci->load->library('SignatureLib');
}
/**
@@ -172,7 +138,7 @@ class DocumentExportLib
$xml_data = new DOMDocument;
if (!$xml_data->load($xml_url))
return error($this->ci->documentExportPhrases->t("document_export", "error_xml_load", [
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_xml_load", [
"url" => $xml_url,
"xml" => $xml,
"params" => $params
@@ -236,7 +202,7 @@ class DocumentExportLib
$outputformat = $this->getDefaultOutputFormat($outputformat, $vorlage->mimetype);
$result = $this->createAndSignContent(
$createResult = $this->createAndSignContent(
$temp_folder,
$outputformat,
$vorlage,
@@ -247,118 +213,26 @@ class DocumentExportLib
$sign_user,
$sign_profile
);
if (isError($result)) {
if (isError($createResult)) {
$this->close($temp_folder, $source_folder);
return $result;
return $createResult;
}
$temp_filename = getData($result);
$temp_filename = getData($createResult);
$fsize = filesize($temp_filename);
$handle = fopen($temp_filename, 'r');
if (!$handle)
return error($this->ci->documentExportPhrases->t("document_export", "error_file_load"));
$result = fread($handle, $fsize);
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_file_load"));
$fileContentResult = fread($handle, $fsize);
fclose($handle);
$this->close($temp_folder, $source_folder);
return success($result);
return success($fileContentResult);
}
/**
* Sets the headers and displays the Document.
* On failure the exit() function will be called
*
* @param string $filename
* @param stdClass $vorlage A db entry from tbl_vorlage
* @param DomDocument $xml_data
* @param string $oe_kurzbz
* @param integer|null $version (optional)
* @param string $outputformat (optional)
* @param string $sign_user (optional) Must be a valid uid
* @param string $sign_profile (optional) Signatureprofile for signing
* @param array $images (optional) Each element should have a property path, name & contenttype which are all strings
*
* @return void
*/
public function showContent(
$filename,
$vorlage,
$xml_data,
$oe_kurzbz,
$version = null,
$outputformat = null,
$sign_user = null,
$sign_profile = null,
$images = []
) {
$source_folder = getcwd();
$temp_folder = sys_get_temp_dir() . '/fhcunoconv-' . uniqid();
$outputformat = $this->getDefaultOutputFormat($outputformat, $vorlage->mimetype);
$result = $this->createAndSignContent(
$temp_folder,
$outputformat,
$vorlage,
$oe_kurzbz,
$version,
$xml_data,
$images,
$sign_user,
$sign_profile
);
if (isError($result)) {
$this->close($temp_folder, $source_folder);
exit(getError($result));
}
$temp_filename = getData($result);
$fsize = filesize($temp_filename);
$handle = fopen($temp_filename, 'r');
if (!$handle) {
$this->close($temp_folder, $source_folder);
exit($this->ci->documentExportPhrases->t("document_export", "error_file_load"));
}
if (headers_sent()) {
$this->close($temp_folder, $source_folder);
exit($this->ci->documentExportPhrases->t("document_export", "error_headers"));
}
switch ($outputformat) {
case 'pdf':
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="' . $filename . '.pdf"');
header('Content-Length: ' . $fsize);
break;
case 'doc':
header('Content-type: application/vnd.ms-word');
header('Content-Disposition: attachment; filename="' . $filename . '.doc"');
header('Content-Length: ' . $fsize);
break;
case 'odt':
header('Content-type: application/vnd.oasis.opendocument.text');
header('Content-Disposition: attachment; filename="' . $filename . '.odt"');
header('Content-Length: ' . $fsize);
break;
default:
$this->close($temp_folder, $source_folder);
exit($this->ci->documentExportPhrases->t("document_export", "error_outputformat_missing"));
}
while (!feof($handle)) {
echo fread($handle, 8192);
}
fclose($handle);
$this->close($temp_folder, $source_folder);
}
/**
* Helper function for getContent and showContent.
* Helper function for getContent
* Creates the temp folder and calls create and sign functions.
*
* @param string $temp_folder
@@ -387,13 +261,13 @@ class DocumentExportLib
mkdir($temp_folder);
chdir($temp_folder);
$this->ci->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
$this->_ci->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
$result = $this->ci->VorlagestudiengangModel->getCurrent($vorlage->vorlage_kurzbz, $oe_kurzbz, $version);
$result = $this->_ci->VorlagestudiengangModel->getCurrent($vorlage->vorlage_kurzbz, $oe_kurzbz, $version);
if (isError($result))
return $result;
if (!hasData($result))
return error($this->ci->documentExportPhrases->t("document_export", "error_template_missing"));
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_template_missing"));
$vorlage_stg = current(getData($result));
foreach ($vorlage_stg as $k => $v)
$vorlage->$k = $v;
@@ -437,7 +311,7 @@ class DocumentExportLib
{
$content_xsl = new DOMDocument();
if (!$content_xsl->loadXML($vorlage->text))
return error($this->ci->documentExportPhrases->t("document_export", "error_xsl_load"));
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_xsl_load"));
$proc = new XSLTProcessor();
$proc->importStyleSheet($content_xsl);
@@ -454,7 +328,7 @@ class DocumentExportLib
if ($vorlage->style) {
$styles_xsl = new DOMDocument();
if (!$styles_xsl->loadXML($vorlage->style))
return error($this->ci->documentExportPhrases->t("document_export", "error_styles_load"));
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_styles_load"));
$style_proc = new XSLTProcessor();
$style_proc->importStyleSheet($styles_xsl);
@@ -482,7 +356,7 @@ class DocumentExportLib
$tempname_zip = $temp_folder . '/out.zip';
if (!copy($zipfile, $tempname_zip))
return error($this->ci->documentExportPhrases->t("document_export", "error_file_copy"));
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_file_copy"));
exec("zip $tempname_zip content.xml");
if (!is_null($styles_xsl))
@@ -502,7 +376,7 @@ class DocumentExportLib
$manifest_xml = new DOMDocument;
if (!$manifest_xml->loadXML($manifest))
return error($this->ci->documentExportPhrases->t("document_export", "error_manifest"));
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_manifest"));
//root-node holen
$root = $manifest_xml->getElementsByTagName('manifest')->item(0);
@@ -529,42 +403,16 @@ class DocumentExportLib
clearstatcache();
$temp_filename = $temp_folder . '/out.' . $outputformat;
switch ($outputformat) {
case 'pdf':
case 'doc':
$ret = 0;
$temp_filename = $temp_folder . '/out.' . $outputformat;
$converResult = $this->_ci->documentlib->convert($tempname_zip, $temp_filename, $outputformat);
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) {
// Use docsbox
$this->ci->load->library("DocsboxLib");
$docboxlib = get_class($this->ci->docboxlib);
$ret = $docboxlib::convert($tempname_zip, $temp_filename, $outputformat);
} else {
// Use unoconv
// Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt
// werden. Deshalb wird dies hier speziell behandelt.
// Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist
if ($this->unoconv_version == '0.6')
$command = 'unoconv -e IsSkipEmptyPages=false -f ' . $outputformat . ' %2$s > %1$s';
else
$command = 'unoconv -e IsSkipEmptyPages=false -f ' . $outputformat . ' --output %s %s 2>&1';
$command = sprintf($command, $temp_filename, $tempname_zip);
exec($command, $out, $ret);
}
if ($ret)
return error($this->ci->documentExportPhrases->t("document_export", "error_conv_timeout"));
if (isError($converResult))
return error($this->_ci->DocumentExportPhrases->t('document_export', 'error_conv_timeout'));
break;
case 'odt':
default:
$temp_filename = $tempname_zip;
}
return success($temp_filename);
@@ -584,63 +432,15 @@ class DocumentExportLib
*/
protected function sign($temp_folder, $temp_filename, $outputformat, $user, $profile)
{
if ($outputformat != 'pdf')
return error($this->ci->documentExportPhrases->t("document_export", "error_sign_pdf"));
if ($outputformat != 'pdf') return error($this->_ci->DocumentExportPhrases->t('document_export', 'error_sign_pdf'));
// Load the File
$file_data = file_get_contents($temp_filename);
$signed_filename = $this->_ci->signaturelib->sign($temp_folder, $temp_filename, $user, $profile);
$data = new stdClass();
$data->document = base64_encode($file_data);
// If fine then return it
if (isSuccess($signed_filename)) return $signed_filename;
// Signatur Profil
if (!is_null($profile))
$data->profile = $profile;
else
$data->profile = SIGNATUR_DEFAULT_PROFILE;
// Username des Endusers der die Signatur angefordert hat
$data->user = $user;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, SIGNATUR_URL . '/' . SIGNATUR_SIGN_API);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7);
curl_setopt($ch, CURLOPT_USERAGENT, "FH-Complete");
// SSL Zertifikatsprüfung deaktivieren
// Besser ist es das Zertifikat am Server zu installieren!
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data_string = json_encode($data, JSON_FORCE_OBJECT);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Content-Length:' . mb_strlen($data_string),
'Authorization: Basic ' . base64_encode(SIGNATUR_USER . ":" . SIGNATUR_PASSWORD)
]);
$result = curl_exec($ch);
if (curl_errno($ch)) {
curl_close($ch);
return error($this->ci->documentExportPhrases->t("document_export", "error_sign_timeout"));
}
curl_close($ch);
$resultdata = json_decode($result);
// If it is success
if (isset($resultdata->error) && $resultdata->error == 0) {
$signed_filename = $temp_folder . '/signed.pdf';
file_put_contents($signed_filename, base64_decode($resultdata->retval));
return success($signed_filename);
}
// otherwise if it is an error
return error($resultdata->retval ?? $this->ci->documentExportPhrases->t("global", "unknown_error", ["error" => $result]));
// Otherwise it is an error
return error($this->_ci->DocumentExportPhrases->t('global', 'unknown_error', ['error' => getError($signed_filename)]));
}
/**
@@ -717,3 +517,4 @@ class DocumentExportLib
return 'pdf';
}
}
+25 -24
View File
@@ -4,7 +4,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
class DocumentLib
{
private $unoconv_version;
private $_ci;
private $_unoconv_version;
/**
* Constructor
@@ -12,7 +13,10 @@ class DocumentLib
public function __construct()
{
// Gets CI instance
$this->ci =& get_instance();
$this->_ci =& get_instance();
// Load phrases
$this->_ci->load->library('PhrasesLib', ['document_export', null], 'DocumentExportPhrases');
// Which document converter has to be used
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
@@ -28,13 +32,13 @@ class DocumentLib
$hlp = explode(' ', $ret_arr[0]);
if(isset($hlp[1]))
{
$this->unoconv_version = $hlp[1];
$this->_unoconv_version = $hlp[1];
}
else
show_error('Could not get Unoconv Version');
show_error($this->_ci->DocumentExportPhrases->t('document_export', 'error_unoconv_version'));
}
else
show_error('Unoconv not found - Please install Unoconv');
show_error($this->_ci->DocumentExportPhrases->t('document_export', 'error_unoconv'));
}
}
@@ -56,7 +60,7 @@ class DocumentLib
case 'image/jpeg':
case 'image/jpg':
case 'image/pjpeg':
$this->_jpegtopdf($filename, $outFile);
$this->_jpegToPdf($filename, $outFile);
return success($outFile);
case 'application/vnd.oasis.opendocument.spreadsheet':
case 'application/msword':
@@ -72,23 +76,19 @@ class DocumentLib
else
{
// Unoconv Version 0.6 seems to fail on converting TXT Files
if ($this->unoconv_version == '0.6')
return error();
if ($this->_unoconv_version == '0.6') return error('Unoconv Version 0.6 does not convert TXT Files correctly');
}
// Convertion
$ret = $this->convert($filename, $outFile, 'pdf');
if(isSuccess($ret))
{
return success($outFile);
}
else
{
return error(getError($ret));
}
if(isSuccess($ret)) return success($outFile);
// Error
return $ret;
case 'application/pdf':
return success($filename);
default:
return error('Unknown Mimetype:'.$mimetype);
return error('Unknown Mimetype:' . $mimetype);
}
}
@@ -101,20 +101,20 @@ class DocumentLib
*/
public function mergePDF($files, $outFile)
{
$cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outFile ";
$cmd = 'gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outFile ';
$finfo = finfo_open(FILEINFO_MIME_TYPE);
// add all pdf files to the command
foreach ($files as $f)
{
$cmd .= $f." ";
$cmd .= $f.' ';
if (!file_exists($f))
{
return error("File not found: '$f'");
}
if (finfo_file($finfo, $f) != "application/pdf")
if (finfo_file($finfo, $f) != 'application/pdf')
{
return error("Wrong format(".finfo_file($finfo, $f)."): '$f'");
return error('Wrong format('.finfo_file($finfo, $f)."): '$f'");
}
}
@@ -144,13 +144,13 @@ class DocumentLib
// If it is set to use docsbox
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
{
require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php');
require_once(dirname(__FILE__).'/DocsboxLib.php');
$ret = DocsboxLib::convert($inFile, $outFile, $format);
}
else // otherwise use unoconv
{
if ($this->unoconv_version == '0.6')
if ($this->_unoconv_version == '0.6')
$command = 'unoconv -f %1$s %3$s > %2$s';
else
$command = 'unoconv -f %s --output %s %s 2>&1';
@@ -175,7 +175,7 @@ class DocumentLib
* @param string $outfile Path to Output (pdf) File.
* @return success or error object
*/
private function _jpegtopdf($filename, $outfile)
private function _jpegToPdf($filename, $outfile)
{
if (!file_exists($filename))
return error('File does not exists');
@@ -230,3 +230,4 @@ class DocumentLib
return true;
}
}
+77 -9
View File
@@ -36,15 +36,7 @@ class SignatureLib
try
{
// Dont send Document if it is bigger than 30 MB (Limit of Signature Server)
if (filesize($inputFileName) > 30000000)
{
$returnObject = new stdClass();
$returnObject->code = 1;
$returnObject->error = 1;
$returnObject->retval = 'File to big';
return $returnObject;
}
if (filesize($inputFileName) > 30000000) return $this->_returnObject(1, 1, 'File too big');
// Get the content of the given file
$inputFileContent = file_get_contents($inputFileName);
@@ -82,4 +74,80 @@ class SignatureLib
// Otherwise return a null as error
return null;
}
/**
*
*/
public function sign($temp_folder, $inputFileName, $user, $profile)
{
// Load the File
$file_data = file_get_contents($inputFileName);
$data = new stdClass();
$data->document = base64_encode($file_data);
// Signatur Profil
if (!is_null($profile))
$data->profile = $profile;
else
$data->profile = SIGNATUR_DEFAULT_PROFILE;
// Username des Endusers der die Signatur angefordert hat
$data->user = $user;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, SIGNATUR_URL . '/' . SIGNATUR_SIGN_API);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7);
curl_setopt($ch, CURLOPT_USERAGENT, "FH-Complete");
// SSL Zertifikatsprüfung deaktivieren
// Besser ist es das Zertifikat am Server zu installieren!
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data_string = json_encode($data, JSON_FORCE_OBJECT);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Content-Length:' . mb_strlen($data_string),
'Authorization: Basic ' . base64_encode(SIGNATUR_USER . ':' . SIGNATUR_PASSWORD)
]);
$result = curl_exec($ch);
if (curl_errno($ch)) {
curl_close($ch);
return $this->_returnObject(1, 1, 'CURL error');
}
curl_close($ch);
$resultdata = json_decode($result);
// If it is success
if (isset($resultdata->error) && $resultdata->error == 0)
{
$signed_filename = $temp_folder . '/signed.pdf';
file_put_contents($signed_filename, base64_decode($resultdata->retval));
return $this->_returnObject(0, 0, $signed_filename);
}
// Otherwise it is an error
return $this->_returnObject(1, 1, 'Error while signing the given document');
}
/**
*
*/
private function _returnObject($code, $error, $retval)
{
$returnObject = new stdClass();
$returnObject->code = $code;
$returnObject->error = $error;
$returnObject->retval = $retval;
return $returnObject;
}
}
+24 -19
View File
@@ -31,18 +31,20 @@ class Vertrag_model extends DB_Model
*/
public function save($person_id, $mitarbeiter_uid, $lehrveranstaltung_id, $lehreinheit_id, $projektarbeit_id = null, $vertragsstunden, $betrag, $studiensemester_kurzbz)
{
$person_id = (isset($person_id) && is_numeric($person_id))
$vertragstyp_kurzbz = (is_null($projektarbeit_id)) ? 'Lehrauftrag' : 'Betreuung';
$person_id = (isset($person_id) && is_numeric($person_id))
? $person_id
: show_error('peron_id must be set and numeric.');
$lehreinheit_id = (isset($lehreinheit_id) && is_numeric($lehreinheit_id))
? $lehreinheit_id
: show_error('lehreinheit_id must be set and numeric.');
$lehrveranstaltung_id = (isset($lehrveranstaltung_id) && is_numeric($lehrveranstaltung_id))
? $lehrveranstaltung_id
: show_error('lehrveranstaltung_id must be set and numeric.');
$projektarbeit_id = (isset($projektarbeit_id) && is_numeric($projektarbeit_id))
? $projektarbeit_id
: null;
$lehreinheit_id = (isset($lehreinheit_id) && is_numeric($lehreinheit_id))
? $lehreinheit_id
: (($vertragstyp_kurzbz == 'Betreuung') ? null : show_error('lehreinheit_id must be set and numeric.'));
$vertragsstunden = (isset($vertragsstunden) && is_numeric($vertragsstunden))
? $vertragsstunden
: 0;
@@ -53,7 +55,7 @@ class Vertrag_model extends DB_Model
? $mitarbeiter_uid
: show_error('mitarbeiter_uid must be set and a string value.');;
$vertragstyp_kurzbz = (is_null($projektarbeit_id)) ? 'Lehrauftrag' : 'Betreuung';
// First check if Vertrag already exists for that Lehrauftrag or for that Projektbetreuerauftrag
if ($vertragstyp_kurzbz == 'Lehrauftrag')
@@ -257,7 +259,7 @@ class Vertrag_model extends DB_Model
}
elseif ($vertragstyp_kurzbz == 'Betreuung')
{
$this->addSelect('lehreinheit_id');
$this->addSelect('lehreinheit_id, lehre.tbl_projektarbeit.lehrveranstaltung_id, lehre.tbl_projektarbeit.studiensemester_kurzbz');
$this->addJoin('lehre.tbl_projektbetreuer', 'vertrag_id');
$this->addJoin('lehre.tbl_projektarbeit', 'projektarbeit_id');
if ($result = $this->loadWhere(array('vertrag_id' => $vertrag_id)))
@@ -281,17 +283,22 @@ class Vertrag_model extends DB_Model
{
if ($result = getData($this->getLehreinheitID($vertrag_id)))
{
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$this->LehreinheitModel->addSelect($select);
if (!empty($result[0]->lehreinheit_id))
{
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$this->LehreinheitModel->addSelect($select);
if($result = $this->LehreinheitModel->load($result[0]->lehreinheit_id))
{
return success($result->retval);
}
else
{
return error('Fehler beim Laden der Lehreinheit');
if ($result = $this->LehreinheitModel->load($result[0]->lehreinheit_id))
{
return success($result->retval);
}
else
{
return error('Fehler beim Laden der Lehreinheit');
}
}
return success($result);
}
else
{
@@ -563,14 +570,13 @@ SELECT
null::integer as pruefung_id,
projektarbeit_id,
(tbl_projektbetreuer.stunden*tbl_projektbetreuer.stundensatz) as betrag1,
tbl_lehreinheit.studiensemester_kurzbz,
tbl_projektarbeit.studiensemester_kurzbz,
tbl_projektbetreuer.betreuerart_kurzbz,
(SELECT nachname || ' ' || vorname FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid=tbl_projektarbeit.student_uid)
as bezeichnung
FROM
lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
tbl_projektbetreuer.person_id=?
AND vertrag_id IS NULL
@@ -619,14 +625,13 @@ SELECT
null::integer as pruefung_id,
projektarbeit_id,
(tbl_projektbetreuer.stunden * tbl_projektbetreuer.stundensatz) as betrag,
tbl_lehreinheit.studiensemester_kurzbz,
tbl_projektarbeit.studiensemester_kurzbz,
tbl_projektbetreuer.betreuerart_kurzbz,
(SELECT nachname || ' ' || vorname FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid=tbl_projektarbeit.student_uid)
as bezeichnung, vertrag_id
FROM
lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
tbl_projektbetreuer.person_id=?
AND vertrag_id = ?
+1 -56
View File
@@ -248,60 +248,5 @@ class Akte_model extends DB_Model
return success($dokumente->retval);
}
/**
* Liefert die Archivdokumente einer Person/mehrerer Personen
*
* @param integer/array $person_id
* @param boolean|null $signiert Wenn true werden nur Dokumente geliefert die digital signiert wurden.
* @param boolean|null $stud_selfservice Wenn true werden nur Dokumente geliefert die Studierende selbst herunterladen duerfen.
*
* @return stdClass
*/
public function getArchiv($person_id, $signiert = null, $stud_selfservice = null)
{
$this->addSelect('akte_id');
$this->addSelect('person_id');
$this->addSelect('dokument_kurzbz');
$this->addSelect('mimetype');
$this->addSelect('erstelltam');
$this->addSelect('gedruckt');
$this->addSelect('titel_intern');
$this->addSelect('anmerkung_intern');
$this->addSelect('titel');
$this->addSelect('bezeichnung');
$this->addSelect('updateamum');
$this->addSelect('insertamum');
$this->addSelect('updatevon');
$this->addSelect('insertvon');
$this->addSelect('uid');
$this->addSelect('dms_id');
$this->addSelect('anmerkung');
$this->addSelect('nachgereicht');
$this->addSelect('CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden', false);
$this->addSelect('nachgereicht_am');
$this->addSelect('ausstellungsnation');
$this->addSelect('formal_geprueft_amum');
$this->addSelect('archiv');
$this->addSelect('signiert');
$this->addSelect('stud_selfservice');
$this->addSelect('akzeptiertamum');
if ($signiert !== null)
$this->db->where('signiert', (boolean)$signiert);
if ($stud_selfservice !== null)
$this->db->where('stud_selfservice', (boolean)$stud_selfservice);
if (is_array($person_id))
$this->db->where_in('person_id', $person_id);
else
$this->db->where('person_id', $person_id);
$this->addOrder('erstelltam', 'DESC');
$this->addOrder('akte_id', 'DESC');
return $this->loadWhere([
'archiv' => true
]);
}
}
@@ -177,7 +177,7 @@ class Prestudentstatus_model extends DB_Model
* @param prestudent_id ID of the Prestudent.
* @param $status_kurzbz kurzbz of the status.
* @param $ausbildungssemester ausbildungssemester of the status.
* @param $studiensemester_kurzbz studiensemster of the status.
* @param $studiensemester_kurzbz studiensemester of the status.
*
* @return result object with all the status entries
*/
@@ -85,9 +85,18 @@ class Lehreinheitmitarbeiter_model extends DB_Model
public function getLektorenByLe($lehreinheit_id)
{
$this->addSelect('vorname, nachname, tbl_lehreinheitmitarbeiter.*, stundenplan.verplant');
$this->addSelect('tbl_person.vorname, tbl_person.nachname, tbl_lehreinheitmitarbeiter.*, stundenplan.verplant,
COALESCE(insertvonperson.vorname || \' \' || insertvonperson.nachname, tbl_lehreinheitmitarbeiter.insertvon) as insertvon,
COALESCE(updatevonperson.vorname || \' \' || updatevonperson.nachname, tbl_lehreinheitmitarbeiter.updatevon) as updatevon');
$this->addJoin('tbl_benutzer', 'uid = mitarbeiter_uid');
$this->addJoin('tbl_person', 'person_id');
$this->addJoin('tbl_benutzer insertvonbenutzer', 'insertvonbenutzer.uid = tbl_lehreinheitmitarbeiter.insertvon', 'LEFT');
$this->addJoin('tbl_person insertvonperson', 'insertvonperson.person_id = insertvonbenutzer.person_id', 'LEFT');
$this->addJoin('tbl_benutzer updatevonbenutzer', 'updatevonbenutzer.uid = tbl_lehreinheitmitarbeiter.updatevon', 'LEFT');
$this->addJoin('tbl_person updatevonperson', 'updatevonperson.person_id = updatevonbenutzer.person_id', 'LEFT');
$this->addJoin('(
SELECT 1 as verplant, lehreinheit_id, mitarbeiter_uid
@@ -1263,6 +1263,39 @@ class Lehrveranstaltung_model extends DB_Model
";
}
/**
* Gets lehrveranstaltungen of Studienplan of a certain lva_id set
* used if a bigger set of lva id is already available and it needs to be checked against a certain studienplan aswell
* @param $studienplan_id ID des Studienplans
* @param $lva_ids LVA_ID welche abgegleicht werden sollen
* @return array|null
*/
public function getLvsByStudienplanByLvaIDs($studienplan_id, $lva_ids)
{
$params = array($studienplan_id, $lva_ids);
$qry = "SELECT tbl_lehrveranstaltung.*,
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
tbl_studienplan_lehrveranstaltung.sort stpllv_sort,
tbl_studienplan_lehrveranstaltung.curriculum,
tbl_studienplan_lehrveranstaltung.export,
tbl_studienplan_lehrveranstaltung.genehmigung
FROM lehre.tbl_lehrveranstaltung
JOIN lehre.tbl_studienplan_lehrveranstaltung
USING(lehrveranstaltung_id)
WHERE tbl_studienplan_lehrveranstaltung.studienplan_id = ?
AND tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id IN ?
";
$qry .= " ORDER BY stpllv_sort, semester, sort";
return $this->execQuery($qry, $params);
}
public function getAllOe($lv_id)
{
$qry = "SELECT DISTINCT oe_kurzbz
@@ -50,8 +50,7 @@ class Paabgabe_model extends DB_Model
JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id)
JOIN public.tbl_benutzer bn_student ON(tbl_projektarbeit.student_uid=bn_student.uid)
JOIN public.tbl_person person_student ON(bn_student.person_id=person_student.person_id)
JOIN lehre.tbl_lehreinheit ON(tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung ON(tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id)
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
JOIN public.tbl_studiengang ON(tbl_lehrveranstaltung.studiengang_kz=tbl_studiengang.studiengang_kz)
JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz)
WHERE
@@ -68,14 +67,13 @@ class Paabgabe_model extends DB_Model
campus.tbl_paabgabe.insertvon, campus.tbl_paabgabe.insertamum, campus.tbl_paabgabe.updatevon, campus.tbl_paabgabe.updateamum,
campus.tbl_paabgabe.note, upload_allowed, beurteilungsnotiz, student_uid, tbl_projektarbeit.note, lehre.tbl_projektarbeit.titel,
UPPER(tbl_studiengang.typ) as stgtyp, UPPER(tbl_studiengang.kurzbz) as stgkz, public.tbl_studiengang.studiengang_kz,
public.tbl_studiengang.oe_kurzbz as stg_oe_kurzbz, tbl_lehreinheit.studiensemester_kurzbz,
public.tbl_studiengang.oe_kurzbz as stg_oe_kurzbz, tbl_projektarbeit.studiensemester_kurzbz,
public.tbl_person.anrede, public.tbl_person.titelpre, public.tbl_person.vorname, public.tbl_person.nachname, public.tbl_person.titelpost
FROM campus.tbl_paabgabe
JOIN campus.tbl_paabgabetyp USING (paabgabetyp_kurzbz)
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
JOIN lehre.tbl_lehreinheit using(lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung using(lehrveranstaltung_id)
JOIN public.tbl_studiengang on(lehre.tbl_lehrveranstaltung.studiengang_kz = public.tbl_studiengang.studiengang_kz)
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
JOIN public.tbl_studiengang ON(lehre.tbl_lehrveranstaltung.studiengang_kz = public.tbl_studiengang.studiengang_kz)
JOIN public.tbl_benutzer ON (public.tbl_benutzer.uid = student_uid)
JOIN public.tbl_person USING (person_id)
@@ -93,7 +91,7 @@ class Paabgabe_model extends DB_Model
campus.tbl_paabgabe.insertvon, campus.tbl_paabgabe.insertamum, campus.tbl_paabgabe.updatevon, campus.tbl_paabgabe.updateamum,
campus.tbl_paabgabe.note, upload_allowed, beurteilungsnotiz, student_uid, tbl_projektarbeit.note, lehre.tbl_projektarbeit.titel,
UPPER(tbl_studiengang.typ) as stgtyp, UPPER(tbl_studiengang.kurzbz) as stgkz, public.tbl_studiengang.studiengang_kz,
public.tbl_studiengang.oe_kurzbz as stg_oe_kurzbz, tbl_lehreinheit.studiensemester_kurzbz,
public.tbl_studiengang.oe_kurzbz as stg_oe_kurzbz, tbl_projektarbeit.studiensemester_kurzbz,
lehre.tbl_projektbetreuer.betreuerart_kurzbz, lehre.tbl_projektbetreuer.person_id,
public.tbl_person.anrede, public.tbl_person.titelpre, public.tbl_person.vorname, public.tbl_person.nachname, public.tbl_person.titelpost
@@ -101,8 +99,7 @@ class Paabgabe_model extends DB_Model
JOIN campus.tbl_paabgabetyp USING (paabgabetyp_kurzbz)
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
JOIN lehre.tbl_lehreinheit using(lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung using(lehrveranstaltung_id)
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
JOIN public.tbl_studiengang on(lehre.tbl_lehrveranstaltung.studiengang_kz = public.tbl_studiengang.studiengang_kz)
JOIN public.tbl_benutzer ON (public.tbl_benutzer.uid = student_uid)
JOIN public.tbl_person ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
@@ -25,7 +25,7 @@ class Projektarbeit_model extends DB_Model
{
$qry = "SELECT
pa.*, tbl_projekttyp.bezeichnung,
tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.lehrveranstaltung_id,
pa.studiensemester_kurzbz, pa.lehrveranstaltung_id,
tbl_firma.name AS firma_name,
(
SELECT
@@ -41,7 +41,6 @@ class Projektarbeit_model extends DB_Model
FROM
lehre.tbl_projektarbeit pa
JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
LEFT JOIN public.tbl_firma USING (firma_id)
WHERE
@@ -57,7 +56,7 @@ class Projektarbeit_model extends DB_Model
if (isset($studiensemester_kurzbz))
{
$qry .= ' AND tbl_lehreinheit.studiensemester_kurzbz=?';
$qry .= ' AND tbl_projektarbeit.studiensemester_kurzbz=?';
$params[] = $studiensemester_kurzbz;
}
@@ -134,7 +133,7 @@ class Projektarbeit_model extends DB_Model
projektarbeit_id,
lehre.tbl_projekttyp.bezeichnung as projekttypbezeichnung,
lehre.tbl_projekttyp.projekttyp_kurzbz as projekttypkurzbz,
lehre.tbl_lehreinheit.studiensemester_kurzbz,
lehre.tbl_projektarbeit.studiensemester_kurzbz,
lehre.tbl_lehrveranstaltung.studiengang_kz,
public.tbl_studiengang.kurzbzlang,
lehre.tbl_projektarbeit.note as note,
@@ -157,7 +156,6 @@ class Projektarbeit_model extends DB_Model
LEFT JOIN public.tbl_benutzer USING(person_id)
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
LEFT JOIN lehre.tbl_betreuerart USING(betreuerart_kurzbz)
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
LEFT JOIN public.tbl_mitarbeiter ON(public.tbl_mitarbeiter.mitarbeiter_uid = public.tbl_benutzer.uid)
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
@@ -366,7 +364,7 @@ class Projektarbeit_model extends DB_Model
tbl_studiengang.typ, tbl_studiengang.kurzbz,
tbl_projektarbeit.projekttyp_kurzbz, tbl_projekttyp.bezeichnung,
tbl_projektarbeit.titel, tbl_projektarbeit.projektarbeit_id, tbl_projektarbeit.note,
student_benutzer.uid, tbl_student.matrikelnr, tbl_lehreinheit.studiensemester_kurzbz, public.tbl_student.student_uid,
student_benutzer.uid, tbl_student.matrikelnr, tbl_projektarbeit.studiensemester_kurzbz, public.tbl_student.student_uid,
lehre.tbl_projektarbeit.sprache,
lehre.tbl_projektarbeit.seitenanzahl,
@@ -430,7 +428,6 @@ class Projektarbeit_model extends DB_Model
LEFT JOIN public.tbl_benutzer student_benutzer ON student_benutzer.uid = lehre.tbl_projektarbeit.student_uid
LEFT JOIN public.tbl_person student_person ON student_benutzer.person_id = student_person.person_id
LEFT JOIN public.tbl_student ON student_benutzer.uid = public.tbl_student.student_uid
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
LEFT JOIN public.tbl_studiengang ON public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
@@ -503,7 +500,7 @@ class Projektarbeit_model extends DB_Model
student_person.vorname AS student_vorname,
student_person.nachname AS student_nachname,
public.tbl_student.matrikelnr,
tbl_lehreinheit.studiensemester_kurzbz,
tbl_projektarbeit.studiensemester_kurzbz,
betreuer_benutzer.uid AS betreuer_benutzer_uid,
betreuer_person.titelpre AS betreuer_titelpre,
betreuer_person.vorname AS betreuer_vorname,
@@ -565,7 +562,6 @@ class Projektarbeit_model extends DB_Model
LEFT JOIN public.tbl_benutzer student_benutzer ON student_benutzer.uid = lehre.tbl_projektarbeit.student_uid
LEFT JOIN public.tbl_person student_person ON student_benutzer.person_id = student_person.person_id
LEFT JOIN public.tbl_student ON student_benutzer.uid = public.tbl_student.student_uid
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
LEFT JOIN public.tbl_studiengang ON public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
@@ -633,7 +629,7 @@ class Projektarbeit_model extends DB_Model
student_person.vorname AS student_vorname,
student_person.nachname AS student_nachname,
public.tbl_student.matrikelnr,
tbl_lehreinheit.studiensemester_kurzbz,
tbl_projektarbeit.studiensemester_kurzbz,
betreuer_benutzer.uid AS betreuer_benutzer_uid,
betreuer_person.titelpre AS betreuer_titelpre,
betreuer_person.vorname AS betreuer_vorname,
@@ -695,7 +691,6 @@ class Projektarbeit_model extends DB_Model
LEFT JOIN public.tbl_benutzer student_benutzer ON student_benutzer.uid = lehre.tbl_projektarbeit.student_uid
LEFT JOIN public.tbl_person student_person ON student_benutzer.person_id = student_person.person_id
LEFT JOIN public.tbl_student ON student_benutzer.uid = public.tbl_student.student_uid
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
LEFT JOIN public.tbl_studiengang ON public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
@@ -218,7 +218,7 @@ class Studiensemester_model extends DB_Model
*/
public function getByDate($date)
{
// gets the studiensemster of a date or the next closest previous studiensemester if a date is not within a studiensemester
// gets the studiensemester of a date or the next closest previous studiensemester if a date is not within a studiensemester
$query = "
SELECT studiensemester_kurzbz, start, ende
FROM public.tbl_studiensemester
@@ -292,13 +292,29 @@ class Studiensemester_model extends DB_Model
COALESCE(
(SELECT studiensemester_kurzbz FROM semester_interval_startdate),
(SELECT studiensemester_kurzbz FROM nearest_semester_interval_startdate)
) AS studiensemester_kurzbz
) AS studiensemester_kurzbz,
COALESCE(
(SELECT start FROM semester_interval_startdate),
(SELECT start FROM nearest_semester_interval_startdate)
) as start,
COALESCE(
(SELECT ende FROM semester_interval_startdate),
(SELECT ende FROM nearest_semester_interval_startdate)
) as ende
UNION
SELECT
COALESCE(
(SELECT studiensemester_kurzbz FROM semester_interval_enddate),
(SELECT studiensemester_kurzbz FROM nearest_semester_interval_enddate)
) AS studiensemester_kurzbz
) AS studiensemester_kurzbz,
COALESCE(
(SELECT start FROM semester_interval_enddate),
(SELECT start FROM nearest_semester_interval_enddate)
) as start,
COALESCE(
(SELECT ende FROM semester_interval_enddate),
(SELECT ende FROM nearest_semester_interval_enddate)
) as ende
EOSQL;
+10 -3
View File
@@ -98,7 +98,7 @@ class Notiz_model extends DB_Model
/**
* Add a Notiz for a given person
*/
public function addNotizForPerson($person_id, $titel, $text, $erledigt, $verfasser_uid)
public function addNotizForPerson($person_id, $titel, $text, $erledigt, $verfasser_uid, $insertvon = null)
{
// Loads model Notizzuordnung_model
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
@@ -106,8 +106,15 @@ class Notiz_model extends DB_Model
// Start DB transaction
$this->db->trans_start(false);
$result = $this->insert(array('titel' => $titel, 'text' => $text, 'erledigt' => $erledigt, 'verfasser_uid' => $verfasser_uid,
"insertvon" => $verfasser_uid));
$result = $this->insert(
array(
'titel' => $titel,
'text' => $text,
'erledigt' => $erledigt,
'verfasser_uid' => $verfasser_uid,
'insertvon' => $insertvon ?? $verfasser_uid
)
);
if (isSuccess($result))
{
@@ -532,12 +532,12 @@ class Stundenplan_model extends DB_Model
/**
* NO STANDALONE FUNCTION - Generates a SQL query string to fetch 'stundenplan' events for a specific student within the current semester.
*
* @param showLvsStundenplan if Lvs of stundenplan should be shown
* @param isLvList if condition needed for Tab LV Termine is given
* @param db_stpl_table enables switch to db 'stundenplandev'
*
* @return mixed
*/
public function getStundenplanQuery($start_date, $end_date, $semester, $gruppen, $studentlehrverbaende, $db_stpl_table='stundenplan', $showLvsStundenplan=false){
public function getStundenplanQuery($start_date, $end_date, $semester, $gruppen, $studentlehrverbaende, $isLvList=false, $db_stpl_table='stundenplan'){
// helper function to check if either $gruppen or $studentlehrverbaende are empty for each semester
$emptyCheck = function($toBeCheckedArray) use ($semester){
@@ -559,17 +559,17 @@ class Stundenplan_model extends DB_Model
}
$query =
"select sp.*
"select sp.*
from lehre.vw_".$db_stpl_table." sp
WHERE
sp.datum >= ".$this->escape($start_date)."
AND sp.datum <= ".$this->escape($end_date);
// adds the AND sql chain only if both $gruppen and $studentlehrverbaende are not empty
if(!$emptyCheck($gruppen) || !$emptyCheck($studentlehrverbaende))
{
$query .= " AND ( ";
}
}
foreach($semester as $sem => $semester_date_range)
{
@@ -583,10 +583,10 @@ class Stundenplan_model extends DB_Model
}
// converts the array of gruppen strings into a sql IN (_,_,_) chain
$query .="(sp.gruppe_kurzbz IN (" .implode(',',$gruppen[$sem_date]).") AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)." AND ".$this->escape($sem_date_range->ende)." )";
$query .="OR";
}
}
}
// if there are no studentlehrverbaende and the gruppen are not empty, we can remove the last OR added after the groups
if($emptyCheck($studentlehrverbaende) && !$emptyCheck($gruppen))
@@ -594,15 +594,27 @@ class Stundenplan_model extends DB_Model
$query = substr($query, 0, -2);
}
//Condition for showLVList FHC4
if(!$isLvList)
$stringGroupLv = "AND gruppe_kurzbz is null";
else
$stringGroupLv ="";
foreach($semester as $sem=>$semester_date_range)
{
foreach($semester_date_range as $sem_date => $sem_date_range)
{
if(!array_key_exists($sem_date,$studentlehrverbaende) || count($studentlehrverbaende[$sem_date]) == 0)
if(!array_key_exists($sem,$studentlehrverbaende) || count($studentlehrverbaende[$sem]) == 0)
{
continue;
}
foreach($studentlehrverbaende[$sem_date] as $key=>$lehrverband)
$studlvbds = array_filter(
$studentlehrverbaende[$sem],
function($value) use ($sem_date) {
return $value->studiensemester_kurzbz === $sem_date;
}
);
foreach($studlvbds as $key=>$lehrverband)
{
$query .= "(((sp.studiengang_kz = ".$this->escape($lehrverband->studiengang_kz)." AND sp.semester = ".$this->escape($lehrverband->semester)." AND sp.verband = ".$this->escape($lehrverband->verband)." AND sp.gruppe = ".$this->escape($lehrverband->gruppe)." AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)." AND ".$this->escape($sem_date_range->ende).")";
// Eintraege fuer den ganzen Verband
@@ -611,24 +623,9 @@ class Stundenplan_model extends DB_Model
$query .= "OR (sp.studiengang_kz = ".$this->escape($lehrverband->studiengang_kz)." AND sp.semester = ".$this->escape($lehrverband->semester)." AND (sp.verband is null OR sp.verband='') AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)
." AND ".$this->escape($sem_date_range->ende).")) AND gruppe_kurzbz is null)";
// Eintraege vom Stundenplan
if($showLvsStundenplan)
{
$query .= "
OR EXISTS (
SELECT 1
FROM lehre.tbl_stundenplan tsp
WHERE tsp.lehreinheit_id = sp.lehreinheit_id
AND tsp.studiengang_kz = " . $this->escape($lehrverband->studiengang_kz) . "
AND (tsp.semester = " . $this->escape($lehrverband->semester) . " OR tsp.semester IS NULL)
AND (tsp.verband = " . $this->escape($lehrverband->verband) . " OR tsp.verband IS NULL OR tsp.verband = '0' OR tsp.verband = '')
AND (tsp.gruppe = " . $this->escape($lehrverband->gruppe) . " OR tsp.gruppe IS NULL OR tsp.gruppe = '0' OR tsp.gruppe = '')
AND tsp.gruppe_kurzbz IS NULL)";
}
$query .= "OR";
$query .="OR";
}
}
}
}
// if the studentlehrverbaende is not empty we can remove the last OR that was added to the query
@@ -641,7 +638,7 @@ class Stundenplan_model extends DB_Model
if(!$emptyCheck($gruppen) || !$emptyCheck($studentlehrverbaende))
{
$query .= ")";
}
}
return $query;
}
@@ -16,7 +16,7 @@ $query = '
anrechnung.begruendung_id,
anrechnung.dms_id,
CASE
WHEN stg.typ || stg.kurzbz IN (' . $ORGANISATIONSEINHEITEN_SCHREIBBERECHTIGT . ') THEN TRUE
WHEN stg.oe_kurzbz IN (' . $ORGANISATIONSEINHEITEN_SCHREIBBERECHTIGT . ') THEN TRUE
ELSE FALSE
END "schreibberechtigt",
anrechnung.studiensemester_kurzbz,
@@ -232,8 +232,8 @@ FROM
SELECT
pa.lehreinheit_id,
lv.lehrveranstaltung_id,
pa.projektarbeit_id::text AS "projektarbeit_id",
le.studiensemester_kurzbz,
pa.projektarbeit_id::text AS "projektarbeit_id",
pa.studiensemester_kurzbz,
stg.studiengang_kz,
upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz",
lv.orgform_kurzbz,
@@ -268,8 +268,7 @@ FROM
FROM
lehre.tbl_projektbetreuer pb
JOIN lehre.tbl_projektarbeit pa USING (projektarbeit_id)
JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
JOIN lehre.tbl_lehrveranstaltung lv ON (pa.lehrveranstaltung_id = lv.lehrveranstaltung_id)
JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz)
JOIN PUBLIC.tbl_person person USING (person_id)
LEFT JOIN lehre.tbl_vertrag vertrag USING (vertrag_id)
@@ -280,7 +279,7 @@ FROM
/* filter projektbetreuuer */
pb.person_id = \'' . $PERSON_ID . '\'
/* filter studiensemester */
AND le.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
AND pa.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
/* filter active lehrveranstaltungen */
AND lv.aktiv = TRUE
/* filter active organisationseinheiten */
@@ -242,8 +242,8 @@ FROM
pa.lehreinheit_id,
lv.lehrveranstaltung_id,
lv.bezeichnung AS "lv_bezeichnung",
(pa.projektarbeit_id::text) AS "projektarbeit_id",
le.studiensemester_kurzbz,
(pa.projektarbeit_id::text) AS "projektarbeit_id",
pa.studiensemester_kurzbz,
stg.studiengang_kz,
upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz",
lv.orgform_kurzbz,
@@ -270,7 +270,7 @@ FROM
ELSE (oe.organisationseinheittyp_kurzbz ||
\' \' || oe.bezeichnung)
END AS "lv_oe_kurzbz",
(nachname || \' \' || vorname) AS "lektor",
(nachname || \' \' || vorname) AS "lektor",
TRUNC(pb.stunden, 1) AS "stunden",
pb.stundensatz,
TRUNC((pb.stunden * pb.stundensatz), 2) AS "betrag",
@@ -280,8 +280,7 @@ FROM
FROM
lehre.tbl_projektbetreuer pb
JOIN lehre.tbl_projektarbeit pa USING (projektarbeit_id)
JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
JOIN lehre.tbl_lehrveranstaltung lv ON (pa.lehrveranstaltung_id = lv.lehrveranstaltung_id)
JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz)
JOIN PUBLIC.tbl_person person USING (person_id)
LEFT JOIN lehre.tbl_vertrag vertrag USING (vertrag_id)
@@ -291,7 +290,7 @@ FROM
/* filter organisationseinheit */
lv.oe_kurzbz IN (\'' . implode('\',\'', $ORGANISATIONSEINHEIT) . '\')
/* filter studiensemester */
AND le.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
AND pa.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
/* filter active lehrveranstaltungen */
AND lv.aktiv = TRUE
/* filter active organisationseinheiten */
@@ -272,8 +272,8 @@ FROM
pa.lehreinheit_id,
lv.lehrveranstaltung_id,
lv.bezeichnung AS "lv_bezeichnung",
pa.projektarbeit_id::text AS "projektarbeit_id",
le.studiensemester_kurzbz,
pa.projektarbeit_id::text AS "projektarbeit_id",
pa.studiensemester_kurzbz,
stg.studiengang_kz,
upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz",
lv.orgform_kurzbz,
@@ -310,8 +310,7 @@ FROM
FROM
lehre.tbl_projektbetreuer pb
JOIN lehre.tbl_projektarbeit pa USING (projektarbeit_id)
JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
JOIN lehre.tbl_lehrveranstaltung lv ON (pa.lehrveranstaltung_id = lv.lehrveranstaltung_id)
JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz)
JOIN PUBLIC.tbl_person person USING (person_id)
LEFT JOIN lehre.tbl_vertrag vertrag USING (vertrag_id)
@@ -321,7 +320,7 @@ FROM
/* filter studiengang */
lv.studiengang_kz IN ('. implode(',', $STUDIENGANG) . ')
/* filter studiensemester */
AND le.studiensemester_kurzbz = \''. $STUDIENSEMESTER. '\'
AND pa.studiensemester_kurzbz = \''. $STUDIENSEMESTER. '\'
/* filter active lehrveranstaltungen */
AND lv.aktiv = TRUE
/* filter ausbildungssemester */
@@ -57,7 +57,7 @@
<div class="row<?php if ($lockedbyother) echo ' alert-danger' ?>">
<div class="col-lg-8">
<h3 class="page-header">
Infocenter Details: <a target="_blank" title="Studentenverwaltung" href="<?php echo site_url('/Studentenverwaltung/' . $studiensemester . '/person/' . $stammdaten->person_id) ?>"><?php echo $stammdaten->vorname.' '.$stammdaten->nachname ?> <i class="fa fa-external-link" style="font-size:small"></i></a>
Infocenter Details: <a target="_blank" title="Studentenverwaltung" href="<?php echo site_url('/studvw/stdsem/' . $studiensemester . '/person/' . $stammdaten->person_id) ?>"><?php echo $stammdaten->vorname.' '.$stammdaten->nachname ?> <i class="fa fa-external-link" style="font-size:small"></i></a>
</h3>
</div>
<div class="col-lg-4">
@@ -8,6 +8,7 @@
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Attempt to register with existing mailadress\', \'Access code sent\', \'Personal data saved\'';
$REJECTED_STATUS = '\'Abgewiesener\'';
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
$QUALIFIKATIONSKURS = $this->config->item('infocenter_qualifikationskurs_kz');
$STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\'';
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
$ORG_NAME = '\'InfoCenter\'';
@@ -277,7 +278,26 @@ $query = '
WHERE konto.person_id = p.person_id
AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .'
AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .'
) AS "Kaution"
) AS "Kaution",
(
SELECT 1
FROM public.tbl_prestudentstatus pss
JOIN public.tbl_prestudent ps USING(prestudent_id)
JOIN public.tbl_studiengang sg USING(studiengang_kz)
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
AND pss.bewerbung_abgeschicktamum IS NOT NULL
AND ps.person_id = p.person_id
AND sg.studiengang_kz in('.$QUALIFIKATIONSKURS.')
AND NOT EXISTS (
SELECT 1
FROM tbl_prestudentstatus spss
WHERE spss.prestudent_id = ps.prestudent_id
AND spss.status_kurzbz = '.$REJECTED_STATUS.'
)
LIMIT 1
) AS "Qualikurs"
FROM public.tbl_person p
LEFT JOIN (
SELECT tpl.person_id,
@@ -351,7 +371,8 @@ $query = '
'ZGV Nation MA',
'InfoCenter Mitarbeiter',
'Identitätsnachweis',
ucfirst($this->p->t('infocenter', 'kaution'))
ucfirst($this->p->t('infocenter', 'kaution')),
'Qualikurs'
),
'formatRow' => function($datasetRaw) {
@@ -480,6 +501,14 @@ $query = '
$datasetRaw->{'Kaution'} = 'Offen';
}
if ($datasetRaw->{'Qualikurs'} === null)
{
$datasetRaw->{'Qualikurs'} = 'Nein';
}
else
{
$datasetRaw->{'Qualikurs'} = 'Ja';
}
return $datasetRaw;
},
'markRow' => function($datasetRaw) {
@@ -92,6 +92,14 @@
</table>
</div>
<div class="col-lg-6 table-responsive">
<?php if ($onboarding_first_login): ?>
<div class="row" id="onboardingRow">
<?php if ($created_by_onboarding): ?>
<div class="col-xs-5"><strong><?php echo $this->p->t('infocenter','onboardingRegistriert') ?></strong></div>
<?php endif; ?>
<div class="col-xs-7<?php echo $created_by_onboarding ? ' text-right' : '' ?>"><strong><?php echo $this->p->t('infocenter','ersterOnboardingLogin').': '.date_format(date_create($onboarding_first_login), 'd.m.Y') ?></strong></div>
</div>
<?php endif; ?>
<table class="table table-bordered stammdaten_form">
<thead>
<tr>
@@ -191,12 +199,12 @@
</div>
<?php endif; ?>
<div class="col-xs-6">
<a class="editStammdaten">
<a class="editStammdaten" href="javascript:void(0);">
<i class="fa fa-edit"></i>&nbsp;<?php echo $this->p->t('ui','bearbeiten'); ?></a>
<div class="editActionStammdaten" style="display:none">
<a class="cancelStammdaten">
<a class="cancelStammdaten" href="javascript:void(0);">
<i class="fa fa-trash"></i>&nbsp;<?php echo $this->p->t('ui','abbrechen');?></a>
<a class="saveStammdaten">
<a class="saveStammdaten" href="javascript:void(0);">
<i class="fa fa-save"></i>&nbsp;<?php echo $this->p->t('ui','speichern'); ?></a>
</div>
</div>
+1 -1
View File
@@ -351,7 +351,7 @@ if (!$berechtigung->isBerechtigt('admin')
{
$worksheet->write($lines,3,$elem->vorname);
}
$worksheet->write($lines,4,$elem->semester.$elem->verband.$elem->gruppe);
$worksheet->writeString($lines,4,$elem->semester.$elem->verband.$elem->gruppe);
$worksheet->write($lines,5,trim($elem->matrikelnr),$format_highlight);
$worksheet->write($lines,6, $note, $format_highlightright);
+3 -4
View File
@@ -345,11 +345,10 @@ $qry = "SELECT
WHERE uid=student_uid) as student, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.semester,
tbl_studiengang.email, tbl_betreuerart.beschreibung AS beutreuerart_beschreibung, tbl_projektbetreuer.stunden
FROM
lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer, public.tbl_studiengang, lehre.tbl_betreuerart
lehre.tbl_lehrveranstaltung, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer, public.tbl_studiengang, lehre.tbl_betreuerart
WHERE
tbl_lehreinheit.lehreinheit_id=tbl_projektarbeit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($stdsem)." AND
tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_projektarbeit.lehrveranstaltung_id AND
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($stdsem)." AND
tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND
tbl_lehrveranstaltung.studiengang_kz=tbl_studiengang.studiengang_kz AND
tbl_projektbetreuer.betreuerart_kurzbz=tbl_betreuerart.betreuerart_kurzbz AND
-2
View File
@@ -143,7 +143,6 @@ if($aktion!='zip')
JOIN campus.tbl_paabgabe USING(projektarbeit_id)
LEFT JOIN public.tbl_benutzer ON(uid=student_uid)
LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id)
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
@@ -214,7 +213,6 @@ if(isset($_REQUEST['ok']) || (isset($_REQUEST['aktion']) && $_REQUEST['aktion']=
JOIN campus.tbl_paabgabe USING(projektarbeit_id)
LEFT JOIN public.tbl_benutzer ON(uid=student_uid)
LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id)
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
@@ -87,7 +87,6 @@ cellSeparator (default value: "|")
JOIN campus.tbl_paabgabe USING(projektarbeit_id)
LEFT JOIN public.tbl_benutzer ON(uid=student_uid)
LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id)
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
+1
View File
@@ -632,6 +632,7 @@ elseif (isset($prestudent_id))
$ps_obj->lastStatus = $ps_tmp->status_kurzbz; // letzten Status dem result array hinzufügen
$ps_obj->status_mehrsprachig = $ps_tmp->status_mehrsprachig;
$ps_obj->ausbildungssemester = $ps_tmp->ausbildungssemester;
}
// Falls Status 'Abgewiesene' vorhanden, nach hinten reihen
+33 -15
View File
@@ -29,6 +29,7 @@ require_once('../../include/sprache.class.php');
require_once '../../include/phrasen.class.php';
require_once '../../include/studiengang.class.php';
require_once('../../include/gebiet.class.php');
require_once('../../include/gebiet_pruefling.class.php');
if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
@@ -198,8 +199,8 @@ else if (isset($_SESSION['pruefling_id']))
)
SELECT DISTINCT ON
(gebiet_id, semester, reihung)
SELECT * FROM (SELECT DISTINCT ON
(gebiet_id)
semester,
gebiet_id,
STRING_AGG(studiengang_kz::TEXT, ', ' ORDER BY studiengang_kz) AS studiengang_kz_list,
@@ -226,13 +227,7 @@ else if (isset($_SESSION['pruefling_id']))
JOIN
testtool.tbl_gebiet USING (gebiet_id)
WHERE
(
(prestudent_data.semester= 1 AND tbl_ablauf.semester = 1)
OR
(prestudent_data.semester= 2 AND tbl_ablauf.semester = 2)
OR
(prestudent_data.semester= 3 AND tbl_ablauf.semester IN (1,3))
)
tbl_ablauf.semester <= prestudent_data.semester
AND (
prestudent_data.studienplan_id = tbl_ablauf.studienplan_id
OR
@@ -259,9 +254,7 @@ else if (isset($_SESSION['pruefling_id']))
JOIN
testtool.tbl_gebiet USING (gebiet_id)
WHERE
(prestudent_data.semester= 1 AND tbl_ablauf.semester = 1)
OR
(prestudent_data.semester= 3 AND tbl_ablauf.semester IN (1,3))
tbl_ablauf.semester <= prestudent_data.semester
)
) temp
) temp2
@@ -270,7 +263,7 @@ else if (isset($_SESSION['pruefling_id']))
semester,
gebiet_id,
bezeichnung,
". $bezeichnung_mehrsprachig_sel ."
". $bezeichnung_mehrsprachig_sel ." ) temp3
ORDER BY
semester,
@@ -283,6 +276,8 @@ else if (isset($_SESSION['pruefling_id']))
$lastsemester = '';
$quereinsteiger_stg = '';
$_SESSION['alleGebiete']= [];
$gebiet_pruefling = new gebiet_pruefling();
$quereinsteiger_menu = false;
while($row = $db->db_fetch_object($result))
{
//Jedes Semester in einer eigenen Tabelle anzeigen
@@ -294,8 +289,25 @@ else if (isset($_SESSION['pruefling_id']))
}
$lastsemester = $row->semester;
echo '<table border="0" cellspacing="0" cellpadding="0" id="Gebiet" style="display: visible; border-collapse: separate; border-spacing: 0 3px; margin-top: 5px;">';
echo '<tr><td class="HeaderTesttool">'. ($row->semester == '1' ? $p->t('testtool/basisgebiete') : $p->t('testtool/quereinstiegsgebiete')).'</td></tr>';
if ($row->semester == '1')
{
// Basisgebiete anzeigen
echo '<table border="0" cellspacing="0" cellpadding="0" id="Gebiet" style="display: visible; border-collapse: separate; border-spacing: 0 3px; margin-top: 5px;">';
echo '<tr><td class="HeaderTesttool">' . $p->t('testtool/basisgebiete') . '</td></tr>';
}
else
{
if (!$quereinsteiger_menu)
{
echo '<table border="0" cellspacing="0" cellpadding="0" id="Gebiet" style="display: visible; border-collapse: separate; border-spacing: 0 3px; margin-top: 5px;">';
echo '<tr><td class="HeaderTesttool">' . $p->t('testtool/quereinstiegsgebiete') . '</td></tr>';
$quereinsteiger_menu = true;
}
else
{
echo '<table border="0" cellspacing="0" cellpadding="0" id="Gebiet" style="display: visible; border-collapse: separate; border-spacing: 0 3px; margin-top: 5px;">';
}
}
}
// Bei Quereinstiegsgebieten nach STG clustern und die STG anzeigen
@@ -394,6 +406,12 @@ else if (isset($_SESSION['pruefling_id']))
</td>
<!--<td width="10" class="ItemTesttoolRight" nowrap>&nbsp;</td>-->
</tr>';
if (!$gebiet_pruefling->checkIfExists($_SESSION['pruefling_id'], $row->gebiet_id))
{
$gebiet_pruefling->pruefling_id = $_SESSION['pruefling_id'];
$gebiet_pruefling->gebiet_id = $row->gebiet_id;
$gebiet_pruefling->saveGebietForPruefling();
}
$_SESSION['alleGebiete'][] = $row->gebiet_id;
}
else
+1 -2
View File
@@ -122,8 +122,7 @@ foreach ($project_arr as $project)
// * get studiensemester
$pa = new Projektarbeit($pa_id);
$le = new Lehreinheit($pa->lehreinheit_id);
$studiensemester_kurzbz = $le->studiensemester_kurzbz;
$studiensemester_kurzbz = $pa->studiensemester_kurzbz;
// * get begin- and end date of studiensemester
$ss = new Studiensemester($studiensemester_kurzbz);
+3 -5
View File
@@ -107,16 +107,14 @@ SELECT
FROM
lehre.tbl_projektarbeit,
lehre.tbl_lehrveranstaltung,
lehre.tbl_lehreinheit,
lehre.tbl_projektbetreuer,
public.tbl_person
WHERE
tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND
tbl_lehreinheit.lehreinheit_id=tbl_projektarbeit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektbetreuer.person_id=tbl_person.person_id AND
tbl_projektbetreuer.stunden<>0 AND
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($stsem)."
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($stsem)."
GROUP BY studiengang_kz,geschlecht";
if(!$result = $db->db_query($qry))
@@ -231,7 +229,7 @@ if($format=='xls')
if(!isset($stunden['w']))
$stunden['w']=0;
$summe_w+=$stunden['w'];
if(!isset($summe_oe[$oe]['w']))
if(!isset($summe_oe[$oe]['w']))
$summe_oe[$oe]['w']=0;
$summe_oe[$oe]['w']+=$stunden['w'];
$worksheet->write($zeile,$organisationseinheiten_idx[$oe]+1,$stunden['w'],$format_data);
@@ -85,7 +85,7 @@ $db = new basis_db();
//Daten holen
$qry = "SELECT * FROM (
SELECT
tbl_lehreinheit.*, tbl_person.vorname, tbl_person.nachname, tbl_person.titelpre,
tbl_person.vorname, tbl_person.nachname, tbl_person.titelpre,
tbl_mitarbeiter.personalnummer, tbl_person.person_id, tbl_mitarbeiter.mitarbeiter_uid,
tbl_mitarbeiter.fixangestellt,
tbl_lehreinheitmitarbeiter.stundensatz as stundensatz,
@@ -109,21 +109,20 @@ if($semester!='')
//Projektsbetreuungen
$qry.= " UNION
SELECT
tbl_lehreinheit.*, tbl_person.vorname, tbl_person.nachname, tbl_person.titelpre,
tbl_person.vorname, tbl_person.nachname, tbl_person.titelpre,
tbl_mitarbeiter.personalnummer, tbl_person.person_id, tbl_mitarbeiter.mitarbeiter_uid,
tbl_mitarbeiter.fixangestellt,
0 as stundensatz,
0 as semesterstunden
FROM
lehre.tbl_lehreinheit, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer,
lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer,
public.tbl_mitarbeiter, public.tbl_benutzer, lehre.tbl_lehrveranstaltung, public.tbl_person
WHERE
tbl_mitarbeiter.mitarbeiter_uid = tbl_benutzer.uid AND
tbl_benutzer.person_id = tbl_projektbetreuer.person_id AND
tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id AND
tbl_projektarbeit.lehreinheit_id = tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)." AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)." AND
tbl_lehrveranstaltung.studiengang_kz = ".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
tbl_person.person_id = tbl_projektbetreuer.person_id";
if($semester!='')
@@ -164,16 +163,15 @@ if($result = $db->db_query($qry))
$qry = "
SELECT
tbl_projektbetreuer.stunden, tbl_projektbetreuer.stundensatz
FROM lehre.tbl_projektbetreuer, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung,
FROM lehre.tbl_projektbetreuer, lehre.tbl_lehrveranstaltung,
public.tbl_benutzer, lehre.tbl_projektarbeit, campus.vw_student
WHERE
tbl_projektbetreuer.person_id=tbl_benutzer.person_id
AND tbl_benutzer.uid=".$db->db_add_param($uid)."
AND tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id
AND student_uid=vw_student.uid
AND tbl_lehreinheit.lehreinheit_id=tbl_projektarbeit.lehreinheit_id
AND tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
AND tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
AND tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
AND tbl_projektarbeit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
AND tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER);
if($semester!='')
$qry.=" AND tbl_lehrveranstaltung.semester=".$db->db_add_param($semester, FHC_INTEGER);
@@ -99,10 +99,9 @@ $qry_stg = "SELECT distinct studiengang_kz, typ, kurzbz
studiengang_kz
FROM
lehre.tbl_projektbetreuer JOIN lehre.tbl_projektarbeit ON tbl_projektbetreuer.projektarbeit_id=tbl_projektarbeit.projektarbeit_id
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_projektarbeit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_projektarbeit.lehrveranstaltung_id
WHERE
lehre.tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
lehre.tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
) as foo
JOIN public.tbl_studiengang USING (studiengang_kz)
";
@@ -506,10 +505,9 @@ if ($result_stg = $db->db_query($qry_stg))
JOIN public.tbl_benutzer ON tbl_benutzer.person_id=tbl_person.person_id
JOIN public.tbl_mitarbeiter ON tbl_mitarbeiter.mitarbeiter_uid=tbl_benutzer.uid
JOIN lehre.tbl_projektarbeit ON tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id=tbl_projektarbeit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_projektarbeit.lehrveranstaltung_id
WHERE
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
NOT EXISTS (SELECT
mitarbeiter_uid
@@ -589,12 +587,11 @@ if ($result_stg = $db->db_query($qry_stg))
FROM
lehre.tbl_projektbetreuer JOIN public.tbl_benutzer ON tbl_projektbetreuer.person_id = tbl_benutzer.person_id
JOIN lehre.tbl_projektarbeit ON tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_projektarbeit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_projektarbeit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
JOIN campus.vw_student ON vw_student.uid = student_uid
WHERE
tbl_benutzer.uid = ".$db->db_add_param($uid)."
AND tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
AND tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
AND tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER);
if ($result = $db->db_query($qry))
@@ -825,15 +822,14 @@ if ($result_stg = $db->db_query($qry_stg))
$worksheet =& $workbook->addWorksheet('Betreuerstunden');
$worksheet->setInputEncoding('utf-8');
$qry = "SELECT
studiensemester_kurzbz, nachname, vorname, sum(stunden) AS stunden, titelpre,
lehre.tbl_projektarbeit.studiensemester_kurzbz, nachname, vorname, sum(stunden) AS stunden, titelpre,
sum(tbl_projektbetreuer.stundensatz*tbl_projektbetreuer.stunden)::numeric(8, 2) AS euro, person_id
FROM
public.tbl_person JOIN lehre.tbl_projektbetreuer USING (person_id)
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
WHERE
studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)." AND
lehre.tbl_projektarbeit.studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)." AND
stunden > 0";
if (count($stg_arr) > 0)
@@ -841,7 +837,7 @@ if ($result_stg = $db->db_query($qry_stg))
$qry .= "
GROUP BY
studiensemester_kurzbz, person_id, nachname, vorname, titelpre
lehre.tbl_projektarbeit.studiensemester_kurzbz, person_id, nachname, vorname, titelpre
ORDER BY
nachname, vorname
";
+10 -13
View File
@@ -304,15 +304,14 @@ if($studiengang_kz!='')
$qry = "SELECT
*
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung,
lehre.tbl_projektarbeit, lehre.tbl_lehrveranstaltung,
lehre.tbl_projektbetreuer, public.tbl_person
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND
tbl_person.person_id=tbl_projektbetreuer.person_id AND
tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
";
if($semester!='')
@@ -323,14 +322,13 @@ elseif($mitarbeiter_uid!='')
$qry = "SELECT
*
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektbetreuer, public.tbl_person
lehre.tbl_projektarbeit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektbetreuer, public.tbl_person
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND
tbl_person.person_id=tbl_projektbetreuer.person_id AND
tbl_projektbetreuer.person_id=".$db->db_add_param($mitarbeiter->person_id, FHC_INTEGER)." AND
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
";
}
elseif($oe_kurzbz!='')
@@ -338,15 +336,14 @@ elseif($oe_kurzbz!='')
$qry = "SELECT
*
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektbetreuer,
lehre.tbl_projektarbeit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektbetreuer,
public.tbl_person, lehre.tbl_lehrveranstaltung as lehrfach
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND
tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id=lehrfach.lehrveranstaltung_id AND
tbl_person.person_id=tbl_projektbetreuer.person_id AND
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
lehrfach.oe_kurzbz=".$db->db_add_param($oe_kurzbz)."
";
}
+2 -4
View File
@@ -490,15 +490,13 @@ if($result = $db->db_query($qry))
tbl_projektbetreuer.person_id,
tbl_lehrveranstaltung.orgform_kurzbz
FROM lehre.tbl_projektarbeit,
lehre.tbl_lehreinheit,
lehre.tbl_lehrveranstaltung,
lehre.tbl_projektbetreuer,
PUBLIC.tbl_person
WHERE tbl_projektarbeit.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
AND tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
WHERE tbl_projektarbeit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
AND tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id
AND tbl_person.person_id = tbl_projektbetreuer.person_id
AND tbl_lehreinheit.studiensemester_kurzbz = ".$db->db_add_param($studiensemester_kurzbz);
AND tbl_projektarbeit.studiensemester_kurzbz = ".$db->db_add_param($studiensemester_kurzbz);
if($uid!=='')
{
@@ -84,15 +84,14 @@ $qry = "SELECT
ende, CASE WHEN freigegeben THEN 'Ja' ELSE 'Nein' END, gesperrtbis, themenbereich,
tbl_projektarbeit.anmerkung, projektarbeit_id
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung,
lehre.tbl_projektarbeit, lehre.tbl_lehrveranstaltung,
public.tbl_benutzer, public.tbl_person, lehre.tbl_projekttyp
WHERE
tbl_projektarbeit.lehreinheit_id = tbl_lehreinheit.lehreinheit_id AND
tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.student_uid = tbl_benutzer.uid AND
tbl_benutzer.person_id = tbl_person.person_id AND
tbl_projektarbeit.projekttyp_kurzbz = tbl_projekttyp.projekttyp_kurzbz AND
tbl_lehreinheit.studiensemester_kurzbz = ".$db->db_add_param($studiensemester_kurzbz)." AND
tbl_projektarbeit.studiensemester_kurzbz = ".$db->db_add_param($studiensemester_kurzbz)." AND
tbl_lehrveranstaltung.studiengang_kz = ".$db->db_add_param($studiengang_kz)." AND
tbl_projektarbeit.projekttyp_kurzbz IN ('Bachelor','Diplom','Projekt')";
+2
View File
@@ -4374,6 +4374,8 @@ if(!$error)
$projektarbeit->titel = $_POST['titel'];
$projektarbeit->titel_english = $_POST['titel_english'];
$projektarbeit->lehreinheit_id = $_POST['lehreinheit_id'];
$projektarbeit->lehrveranstaltung_id = $_POST['lehrveranstaltung_id'];
$projektarbeit->studiensemester_kurzbz = $_POST['studiensemester_kurzbz'];
$projektarbeit->student_uid = $_POST['student_uid'];
$projektarbeit->firma_id = $_POST['firma_id'];
$projektarbeit->note = $_POST['note'];
+23 -9
View File
@@ -239,6 +239,7 @@ function StudentProjektarbeitDetailDisableFields(val)
document.getElementById('student-projektarbeit-button-speichern').disabled=val;
document.getElementById('student-projektarbeit-menulist-projekttyp').disabled=val;
document.getElementById('student-projektarbeit-menulist-lehrveranstaltung').disabled=val;
document.getElementById('student-projektarbeit-menulist-studiensemester').disabled=val;
document.getElementById('student-projektarbeit-menulist-lehreinheit').disabled=val;
document.getElementById('student-projektarbeit-menulist-firma').disabled=val;
document.getElementById('student-projektarbeit-menulist-note').disabled=val;
@@ -290,6 +291,7 @@ function StudentProjektarbeitResetFields()
document.getElementById('student-projektarbeit-menulist-firma').value='';
document.getElementById('student-projektarbeit-menulist-note').value='';
document.getElementById('student-projektarbeit-checkbox-final').checked=true;
document.getElementById('student-projektarbeit-menulist-studiensemester').value=getStudiensemester();
var stg_kz = document.getElementById('student-detail-menulist-studiengang_kz').value;
@@ -379,6 +381,7 @@ function StudentProjektarbeitAuswahl()
lehreinheit_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#lehreinheit_id" ));
lehrveranstaltung_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#lehrveranstaltung_id" ));
lehreinheit_stsem = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#lehreinheit_stsem" ));
projektarbeit_stsem = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#projektarbeit_stsem" ));
student_uid = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#student_uid" ));
firma_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#firma_id" ));
note = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#note" ));
@@ -399,7 +402,7 @@ function StudentProjektarbeitAuswahl()
//Lehrveranstaltung DropDown laden
var LvDropDown = document.getElementById('student-projektarbeit-menulist-lehrveranstaltung');
url='<?php echo APP_ROOT;?>rdf/lehrveranstaltung.rdf.php?uid='+student_uid+"&projektarbeit=true&withlv="+lehrveranstaltung_id+"&"+gettimestamp();
url='<?php echo APP_ROOT;?>rdf/lehrveranstaltung.rdf.php?uid='+student_uid+"&stg_kz="+stg_kz+"&projektarbeit=true&withlv="+lehrveranstaltung_id+"&"+gettimestamp();
//Alte DS entfernen
var oldDatasources = LvDropDown.database.GetDataSources();
@@ -420,7 +423,7 @@ function StudentProjektarbeitAuswahl()
// Lehreinheit Drop Down laden
var LeDropDown = document.getElementById('student-projektarbeit-menulist-lehreinheit');
url='<?php echo APP_ROOT;?>rdf/lehreinheit.rdf.php?lehrveranstaltung_id='+lehrveranstaltung_id+"&studiensemester_kurzbz="+lehreinheit_stsem+"&"+gettimestamp();
url='<?php echo APP_ROOT;?>rdf/lehreinheit.rdf.php?lehrveranstaltung_id='+lehrveranstaltung_id+"&studiensemester_kurzbz="+projektarbeit_stsem+"&"+gettimestamp();
//Alte DS entfernen
var oldDatasources = LeDropDown.database.GetDataSources();
@@ -442,6 +445,7 @@ function StudentProjektarbeitAuswahl()
//Werte setzen
document.getElementById('student-projektarbeit-textbox-projektarbeit_id').value=projektarbeit_id;
document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value=lehreinheit_stsem;
document.getElementById('student-projektarbeit-menulist-studiensemester').value=projektarbeit_stsem;
document.getElementById('student-projektarbeit-menulist-projekttyp').value=projekttyp_kurzbz;
document.getElementById('student-projektarbeit-menulist-lehrveranstaltung').value=lehrveranstaltung_id;
document.getElementById('student-projektarbeit-menulist-lehreinheit').value=lehreinheit_id;
@@ -539,6 +543,7 @@ function StudentProjektarbeitSpeichern()
projektarbeit_id = document.getElementById('student-projektarbeit-textbox-projektarbeit_id').value;
projekttyp_kurzbz = document.getElementById('student-projektarbeit-menulist-projekttyp').value;
lehrveranstaltung_id = document.getElementById('student-projektarbeit-menulist-lehrveranstaltung').value;
studiensemester_kurzbz = document.getElementById('student-projektarbeit-menulist-studiensemester').value;
lehreinheit_id = document.getElementById('student-projektarbeit-menulist-lehreinheit').value;
titel = document.getElementById('student-projektarbeit-textbox-titel').value;
titel_english = document.getElementById('student-projektarbeit-textbox-titel_english').value;
@@ -585,12 +590,18 @@ function StudentProjektarbeitSpeichern()
return false;
}
if(lehreinheit_id=='')
if(lehrveranstaltung_id=='')
{
alert('Bitte einen LV-Teil auswaehlen');
alert('Bitte eine Lehrveranstaltung auswaehlen');
return false;
}
if(studiensemester_kurzbz=='')
{
alert('Bitte ein Studiensemester auswaehlen');
return false;
}
if(isNaN(gesamtstunden))
gesamtstunden=0;
@@ -603,6 +614,8 @@ function StudentProjektarbeitSpeichern()
req.add('projekttyp_kurzbz', projekttyp_kurzbz );
req.add('titel', titel);
req.add('titel_english', titel_english);
req.add('lehrveranstaltung_id', lehrveranstaltung_id);
req.add('studiensemester_kurzbz', studiensemester_kurzbz);
req.add('lehreinheit_id', lehreinheit_id);
req.add('student_uid', student_uid);
req.add('firma_id', firma_id);
@@ -738,7 +751,7 @@ function StudentProjektarbeitLVAChange()
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
lehrveranstaltung_id = document.getElementById('student-projektarbeit-menulist-lehrveranstaltung').value;
studiensemester_kurzbz = getStudiensemester();
studiensemester_kurzbz = document.getElementById('student-projektarbeit-menulist-studiensemester').value;
// Lehreinheit Drop Down laden
var LeDropDown = document.getElementById('student-projektarbeit-menulist-lehreinheit');
@@ -897,8 +910,8 @@ function StudentProjektbetreuerAuswahl()
document.getElementById('student-projektbetreuer-textbox-person_id').value=person_id;
document.getElementById('student-projektbetreuer-checkbox-neu').checked=false;
var lehreinheitstsem = document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value;
var default_stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, lehreinheitstsem);
var projektarbeitstsem = document.getElementById('student-projektarbeit-menulist-studiensemester').value;
var default_stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, projektarbeitstsem);
if (default_stundensatz != '')
default_stundensatz = 'Stundensatz (Default '+default_stundensatz+'):';
@@ -1410,9 +1423,10 @@ function StudentProjektbetreuerLoadStundensatz(person_id, studiensemester)
function StudentProjektbetreuerLoadMitarbeiterDaten()
{
var person_id = MenulistGetSelectedValue('student-projektbetreuer-menulist-person');
var lehreinheitstsem = document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value;
var projektarbeitstsem = document.getElementById('student-projektarbeit-menulist-studiensemester').value;
var stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, lehreinheitstsem);
var stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, projektarbeitstsem);
if (stundensatz != '')
default_stundensatz = 'Stundensatz (Default '+stundensatz+'):';
@@ -104,6 +104,10 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projektarbeit/rdf#projektarbeit_id" />
<splitter class="tree-splitter"/>
<treecol id="student-projektarbeit-tree-lehrveranstaltung_id" label="LehrveranstaltungID" flex="2" hidden="true"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projektarbeit/rdf#lehrveranstaltung_id" />
<splitter class="tree-splitter"/>
<treecol id="student-projektarbeit-tree-lehreinheit_id" label="LehreinheitID" flex="2" hidden="true"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projektarbeit/rdf#lehreinheit_id" />
@@ -131,7 +135,7 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#lehreinheit_stsem"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#projektarbeit_stsem"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#titel"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#note"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#beginn"/>
@@ -141,6 +145,7 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#themenbereich"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#anmerkung"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#projektarbeit_id"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#lehrveranstaltung_id"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#lehreinheit_id"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#student_uid"/>
<treecell label="rdf:http://www.technikum-wien.at/projektarbeit/rdf#firma_id"/>
@@ -249,6 +254,20 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
</template>
</menulist>
</row>
<row>
<label value="Studiensemester" control="student-projektarbeit-menulist-studiensemester"/>
<menulist id="student-projektarbeit-menulist-studiensemester" disabled="true"
datasources="<?php echo APP_ROOT ?>rdf/studiensemester.rdf.php?order=desc" flex="1"
ref="http://www.technikum-wien.at/studiensemester/liste">
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/studiensemester/rdf#kurzbz"
label="rdf:http://www.technikum-wien.at/studiensemester/rdf#kurzbz"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="LV-Teil" control="student-projektarbeit-menulist-lehreinheit"/>
<menulist id="student-projektarbeit-menulist-lehreinheit" disabled="true"
+2 -1
View File
@@ -271,7 +271,8 @@ foreach ($uid_arr as $uid)
'matr_nr' => $person->matr_nr,
'ausstellungsdatum' => date('M.Y'),
'gueltigbis' => $datum_obj->formatDatum($gueltigbis, 'd.m.Y'),
'gueltigbis_3jahre' => date('d.m.Y', strtotime('+3 years'))
'gueltigbis_3jahre' => date('d.m.Y', strtotime('+3 years')),
'gueltigbis_2jahre' => date('d.m.Y', strtotime('+2 years'))
);
}
}
+58
View File
@@ -521,5 +521,63 @@ class adresse extends basis_db
}
return true;
}
/**
* Laedt die österreichische Zustell Adresse einer Person
* @param $person_id ID der Person
* @return true wenn ok, false im Fehlerfall
*/
public function loadOesterreichischeZustellAdresse($person_id, $typ = null)
{
//Pruefen ob person_id eine gueltige Zahl ist
if(!is_numeric($person_id) || $person_id == '')
{
$this->errormsg = 'PersonID muss eine Zahl sein';
return false;
}
$typ_clause = '';
if (isset($typ)) $typ_clause = "AND typ=".$this->db_add_param($typ);
//Daten aus der Datenbank lesen
$qry = "SELECT * FROM public.tbl_adresse WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER, false)."
AND nation = 'A'
{$typ_clause}
ORDER BY zustelladresse DESC, adresse_id DESC LIMIT 1";
if(!$this->db_query($qry))
{
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
return false;
}
if($row = $this->db_fetch_object())
{
$this->adresse_id = $row->adresse_id;
$this->heimatadresse = $this->db_parse_bool($row->heimatadresse);
$this->zustelladresse = $this->db_parse_bool($row->zustelladresse);
$this->gemeinde = $row->gemeinde;
$this->name = $row->name;
$this->nation = $row->nation;
$this->ort = $row->ort;
$this->person_id = $row->person_id;
$this->plz = $row->plz;
$this->strasse = $row->strasse;
$this->typ = $row->typ;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->firma_id = $row->firma_id;
$this->rechnungsadresse = $this->db_parse_bool($row->rechnungsadresse);
$this->anmerkung = $row->anmerkung;
$this->co_name = $row->co_name;
}
else
{
$this->errormsg = 'Es ist kein Datensatz mit dieser ID vorhanden';
return false;
}
return true;
}
}
?>
+2 -2
View File
@@ -48,7 +48,7 @@ class bisarchiv extends basis_db
*/
protected function validate()
{
if($this->studiensemster_kurzbz == null || mb_strlen($this->studiensemster_kurzbz) > 6)
if($this->studiensemester_kurzbz == null || mb_strlen($this->studiensemester_kurzbz) > 6)
{
$this->errormsg = "Studiensemester ist ungueltig";
return false;
@@ -107,7 +107,7 @@ class bisarchiv extends basis_db
return false;
$qry = "INSERT INTO bis.tbl_archiv (studiensemester_kurzbz, meldung, html, studiengang_kz, insertamum, insertvon, typ) VALUES ("
. $this->db_add_param($this->studiensemster_kurzbz) . ","
. $this->db_add_param($this->studiensemester_kurzbz) . ","
. $this->db_add_param($this->meldung) . ","
. $this->db_add_param($this->html) . ","
. $this->db_add_param($this->studiengang_kz) . ","
+63 -25
View File
@@ -21,6 +21,7 @@
* Manuela Thamer <manuela.thamer@technikum-wien.at>
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/mitarbeiter.class.php');
class entwicklungsteam extends basis_db
{
@@ -43,7 +44,6 @@ class entwicklungsteam extends basis_db
public $ext_id;
public $besqual;
public $studiengang_kz_old;
/**
* Konstruktor
@@ -74,7 +74,7 @@ class entwicklungsteam extends basis_db
$qry = "SELECT * FROM bis.tbl_entwicklungsteam JOIN bis.tbl_besqual USING(besqualcode)
WHERE entwicklungsteam_id=".$this->db_add_param($entwicklungsteam_id);
$qry.=";";
$qry.=";";
if($this->db_query($qry))
{
@@ -147,6 +147,11 @@ class entwicklungsteam extends basis_db
$this->errormsg = 'Es muss ein Mitarbeiter angegeben werden';
return false;
}
if(!$this->checkIfExistingUid($this->mitarbeiter_uid))
{
$this->errormsg = 'Bitte einen Eintrag aus dem Dropdown Personensuche auswählen!';
return false;
}
if($this->studiengang_kz=='')
{
$this->errormsg = 'Es muss ein Studiengang angegeben werden';
@@ -162,6 +167,26 @@ class entwicklungsteam extends basis_db
$this->errormsg = 'Endedatum darf nicht vor Anfangsdatum liegen';
return false;
}
if($this->beginn != '')
{
$beginnParts = explode('-', $this->beginn);
if (!checkdate((int)$beginnParts[1], (int)$beginnParts[2], (int)$beginnParts[0])) {
$this->errormsg = 'Anfangsdatum ist ungültig';
return false;
}
}
if($this->ende != '')
{
$endeParts = explode('-', $this->ende);
if (!checkdate((int)$endeParts[1], (int)$endeParts[2], (int)$endeParts[0]))
{
$this->errormsg = 'Endedatum ist ungültig';
return false;
}
}
return true;
}
@@ -183,30 +208,28 @@ class entwicklungsteam extends basis_db
//Neuen Datensatz anlegen
$qry = "INSERT INTO bis.tbl_entwicklungsteam (mitarbeiter_uid, studiengang_kz, besqualcode, beginn, ende,
updateamum, updatevon, insertamum, insertvon) VALUES (".
$this->db_add_param($this->mitarbeiter_uid).', '.
$this->db_add_param($this->studiengang_kz, FHC_INTEGER).', '.
$this->db_add_param($this->besqualcode, FHC_INTEGER).', '.
$this->db_add_param($this->beginn).', '.
$this->db_add_param($this->ende).', '.
$this->db_add_param($this->updateamum).', '.
$this->db_add_param($this->updatevon).', '.
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).');';
$this->db_add_param($this->mitarbeiter_uid).', '.
$this->db_add_param($this->studiengang_kz, FHC_INTEGER).', '.
$this->db_add_param($this->besqualcode, FHC_INTEGER).', '.
$this->db_add_param($this->beginn).', '.
$this->db_add_param($this->ende).', '.
$this->db_add_param($this->updateamum).', '.
$this->db_add_param($this->updatevon).', '.
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).');';
}
else
{
if($this->studiengang_kz_old=='')
$this->studiengang_kz_old = $this->studiengang_kz;
//Bestehenden Datensatz aktualisieren
$qry= "UPDATE bis.tbl_entwicklungsteam SET".
" besqualcode=".$this->db_add_param($this->besqualcode, FHC_INTEGER).",".
" beginn=".$this->db_add_param($this->beginn).",".
" studiengang_kz=".$this->db_add_param($this->studiengang_kz, FHC_INTEGER).",".
" ende=".$this->db_add_param($this->ende).",".
" updateamum=".$this->db_add_param($this->updateamum).",".
" updatevon=".$this->db_add_param($this->updatevon).
" WHERE entwicklungsteam_id=".$this->db_add_param($this->entwicklungsteam_id).";";
" besqualcode=".$this->db_add_param($this->besqualcode, FHC_INTEGER).",".
" beginn=".$this->db_add_param($this->beginn).",".
" studiengang_kz=".$this->db_add_param($this->studiengang_kz, FHC_INTEGER).",".
" ende=".$this->db_add_param($this->ende).",".
" mitarbeiter_uid=".$this->db_add_param($this->mitarbeiter_uid).",".
" updateamum=".$this->db_add_param($this->updateamum).",".
" updatevon=".$this->db_add_param($this->updatevon).
" WHERE entwicklungsteam_id=".$this->db_add_param($this->entwicklungsteam_id).";";
}
if($this->db_query($qry))
@@ -234,7 +257,7 @@ class entwicklungsteam extends basis_db
if($studiengang_kz!=null)
$qry.=" AND studiengang_kz=".$this->db_add_param($studiengang_kz);
$qry.=";";
$qry.=";";
if($this->db_query($qry))
{
@@ -316,7 +339,7 @@ class entwicklungsteam extends basis_db
if ($sort != null)
{
$qry .= " ORDER BY ".$sort;
$qry .= " ORDER BY ".$sort;
}
$qry .= ";";
@@ -364,7 +387,7 @@ class entwicklungsteam extends basis_db
$bismeldung_jahr = $datetime->format('Y');
//laden des Datensatzes
$qry = "SELECT tbl_entwicklungsteam.*, tbl_besqual.*, tbl_studiengang.studiengang_kz, tbl_studiengang.melderelevant
$qry = "SELECT tbl_entwicklungsteam.*, tbl_besqual.*, tbl_studiengang.studiengang_kz, tbl_studiengang.melderelevant
FROM bis.tbl_entwicklungsteam
JOIN bis.tbl_besqual USING(besqualcode)
JOIN public.tbl_studiengang USING(studiengang_kz)
@@ -375,7 +398,7 @@ class entwicklungsteam extends basis_db
if($studiengang_kz!=null)
$qry.=" AND studiengang_kz=".$this->db_add_param($studiengang_kz);
$qry.=";";
$qry.=";";
if($this->db_query($qry))
{
@@ -407,5 +430,20 @@ class entwicklungsteam extends basis_db
return false;
}
}
/*
* Überprüft, ob die übergebene Uid in der Tabelle tbl_mitarbeiter vorhanden ist
* @param String $uid UID des Mitarbeiters
* @return true wenn vorhanden, false wenn nicht
*/
private function checkIfExistingUid($uid)
{
$mitarbeiter = new mitarbeiter();
if(!$mitarbeiter->checkIfExistingUid($uid))
return false;
return true;
}
}
?>
+97
View File
@@ -0,0 +1,97 @@
<?php
/* Copyright (C) 2024 Technikum-Wien
*
* 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.
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class gebiet_pruefling extends basis_db
{
//Tabellenspalten
public $prueflinggebiet_id;
public $pruefling_id;
public $gebiet_id;
public $insertamum;
public function __construct()
{
parent::__construct();
}
public function loadByPruefling($pruefling_id)
{
$qry = "SELECT *
FROM testtool.tbl_pruefling_gebiet
WHERE pruefling_id = ".$this->db_add_param($pruefling_id, FHC_INTEGER);
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->prueflinggebiet_id = $row->prueflinggebiet_id;
$this->pruefling_id = $row->pruefling_id;
$this->gebiet_id = $row->gebiet_id;
return true;
}
else
{
$this->errormsg = "Pruefling nicht gefunden";
return false;
}
}
else
{
$this->errormsg = "Fehler beim Laden der Gebiete für den Pruefling";
return false;
}
}
public function checkIfExists($pruefling_id, $gebiet_id)
{
$qry = "SELECT 1
FROM testtool.tbl_pruefling_gebiet
WHERE pruefling_id =".$this->db_add_param($pruefling_id, FHC_INTEGER) ." AND gebiet_id =".$this->db_add_param($gebiet_id, FHC_INTEGER);
if ($result = $this->db_query($qry))
{
if ($this->db_num_rows($result) > 0)
return true;
else
return false;
}
}
public function saveGebietForPruefling()
{
$qry = "INSERT INTO testtool.tbl_pruefling_gebiet
(pruefling_id, gebiet_id)
VALUES(".
$this->db_add_param($this->pruefling_id, FHC_INTEGER).','.
$this->db_add_param($this->gebiet_id, FHC_INTEGER).');';
if ($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Speichern der Daten';
return true;
}
}
}
?>
+172 -1
View File
@@ -2088,7 +2088,7 @@ class lehrveranstaltung extends basis_db
/**
* lädt die Lehrveranstaltungen zum zugehörigen Mitarbeiter
* @param String $uid User ID des Mitarbeiters
* @param String $studiensemster_kurzbz Kurzbezeichnung des Studiensemesters
* @param String $studiensemester_kurzbz Kurzbezeichnung des Studiensemesters
*/
public function getLVByMitarbeiter($uid, $studiensemester_kurzbz = null)
{
@@ -2911,5 +2911,176 @@ class lehrveranstaltung extends basis_db
return null;
}
/**
* Filtert die geladenen Lehrveranstaltungen gegen den aktuellen Studienplan des Studenten.
* Ermittelt den Studienplan über den Prestudent-Status (aktuellster Eintrag) und gleicht
* die vorhandenen IDs mit der Tabelle tbl_studienplan_lehrveranstaltung ab.
* Die interne Liste wird nur bei gefundenen Treffern aktualisiert.
*
* @param string $student_uid Student uid.
* @return bool True bei erfolgreicher Abwicklung oder leeren Ausgangsdaten, False bei Datenbankfehlern.
*/
public function checkLvaAgainstStudentCurrentStudienplan($student_uid) {
$qryStudent = "SELECT prestudent_id FROM tbl_student WHERE student_uid = ".$this->db_add_param($student_uid)."";
if($result = $this->db_query($qryStudent))
{
if($row = $this->db_fetch_object($result))
{
$prestudent_id = $row->prestudent_id;
}
else
{
$this->errormsg = 'Fehler beim Ermitteln der des aktuellen studienplan für studenten über prestudent';
return false;
}
}
else
{
$this->errormsg='Fehler bei Datenbankabfrage ' .$this->db_last_error();
return false;
}
$qryHistory = "SELECT studienplan_id
FROM public.tbl_prestudentstatus
WHERE prestudent_id = ".$this->db_add_param($prestudent_id)."
ORDER BY public.tbl_prestudentstatus.datum DESC";
if($result = $this->db_query($qryHistory))
{
if($row = $this->db_fetch_object($result))
{
$studienplan_id = $row->studienplan_id;
}
else
{
$this->errormsg = 'Fehler beim Ermitteln der des aktuellen studienplan für studenten über prestudentstatus';
return false;
}
}
else
{
$this->errormsg='Fehler bei Datenbankabfrage ' .$this->db_last_error();
return false;
}
// needs to have lva_ids from previous query in this context
$lvsIDs = array_column($this->lehrveranstaltungen, 'lehrveranstaltung_id');
if (empty($lvsIDs)) {
// exit without modifying object state if no lva_id to query by are found
return true;
}
$ids = $this->db_implode4SQL($lvsIDs);
$qry = "SELECT tbl_lehrveranstaltung.*,
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
tbl_studienplan_lehrveranstaltung.sort stpllv_sort,
tbl_studienplan_lehrveranstaltung.curriculum,
tbl_studienplan_lehrveranstaltung.export,
tbl_studienplan_lehrveranstaltung.genehmigung
FROM lehre.tbl_lehrveranstaltung
JOIN lehre.tbl_studienplan_lehrveranstaltung
USING(lehrveranstaltung_id)
WHERE tbl_studienplan_lehrveranstaltung.studienplan_id = ".$this->db_add_param($studienplan_id)."
AND tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id IN (".$ids.");";
if($result = $this->db_query($qry))
{
// reset the lva array and fill it with the new set
$temp_lvas = array();
while($row = $this->db_fetch_object($result))
{
$obj = new lehrveranstaltung();
$obj->lehrveranstaltung_id = $row->lehrveranstaltung_id;
$obj->studiengang_kz = $row->studiengang_kz;
$obj->bezeichnung = $row->bezeichnung;
$obj->kurzbz = $row->kurzbz;
$obj->lehrform_kurzbz = $row->lehrform_kurzbz;
$obj->semester = $row->semester;
$obj->ects = $row->ects;
$obj->semesterstunden = $row->semesterstunden;
$obj->anmerkung = $row->anmerkung;
$obj->lehre = $this->db_parse_bool($row->lehre);
$obj->lehreverzeichnis = $row->lehreverzeichnis;
$obj->aktiv = $this->db_parse_bool($row->aktiv);
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->planfaktor = $row->planfaktor;
$obj->planlektoren = $row->planlektoren;
$obj->planpersonalkosten = $row->planpersonalkosten;
$obj->plankostenprolektor = $row->plankostenprolektor;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$obj->sprache = $row->sprache;
$obj->sort = $row->sort;
$obj->incoming = $row->incoming;
$obj->zeugnis = $this->db_parse_bool($row->zeugnis);
$obj->projektarbeit = $this->db_parse_bool($row->projektarbeit);
$obj->koordinator = $row->koordinator;
$obj->bezeichnung_english = $row->bezeichnung_english;
$obj->orgform_kurzbz = $row->orgform_kurzbz;
$obj->lehrtyp_kurzbz = $row->lehrtyp_kurzbz;
$obj->lehrmodus_kurzbz = $row->lehrmodus_kurzbz;
$obj->oe_kurzbz = $row->oe_kurzbz;
$obj->raumtyp_kurzbz = $row->raumtyp_kurzbz;
$obj->anzahlsemester = $row->anzahlsemester;
$obj->semesterwochen = $row->semesterwochen;
$obj->lvnr = $row->lvnr;
$obj->semester_alternativ = $row->semester_alternativ;
$obj->farbe = $row->farbe;
$obj->lehrveranstaltung_template_id = $row->lehrveranstaltung_template_id;
$obj->stpllv_sort = $row->stpllv_sort;
$obj->benotung = $this->db_parse_bool($row->benotung);
$obj->lvinfo = $this->db_parse_bool($row->lvinfo);
$obj->lehrauftrag = $this->db_parse_bool($row->lehrauftrag);
$obj->evaluierung = $this->db_parse_bool($row->evaluierung);
$obj->bezeichnung_arr['German'] = $row->bezeichnung;
$obj->bezeichnung_arr['English'] = $row->bezeichnung_english;
if ($obj->bezeichnung_arr['English'] == '')
$obj->bezeichnung_arr['English'] = $obj->bezeichnung_arr['German'];
$obj->sws = $row->sws;
$obj->lvs = $row->lvs;
$obj->alvs = $row->alvs;
$obj->lvps = $row->lvps;
$obj->las = $row->las;
$obj->stpllv_semester = $row->stpllv_semester;
$obj->stpllv_pflicht = $this->db_parse_bool($row->stpllv_pflicht);
$obj->stpllv_koordinator = $row->stpllv_koordinator;
$obj->studienplan_lehrveranstaltung_id = $row->studienplan_lehrveranstaltung_id;
$obj->studienplan_lehrveranstaltung_id_parent = $row->studienplan_lehrveranstaltung_id_parent;
$obj->curriculum = $this->db_parse_bool($row->curriculum);
$obj->export = $this->db_parse_bool($row->export);
$obj->genehmigung = $this->db_parse_bool($row->genehmigung);
$obj->new = false;
$temp_lvas[] = $obj;
}
// Only update the class property if we actually found matching records.
// If $temp_lvas is empty, $this->lehrveranstaltungen remains unchanged.
if (!empty($temp_lvas)) {
$this->lehrveranstaltungen = $temp_lvas;
}
return true;
}
else
{
$this->errormsg='Fehler bei Datenbankabfrage ' .$this->db_last_error();
return false;
}
}
}
?>
+18
View File
@@ -1995,5 +1995,23 @@ class mitarbeiter extends benutzer
return true;
}
}
/**
* Prueft ob eine existierende ma_uid übergeben wurde
* @param String $mitarbeiter_uid mitarbeiter_uid
* @return bool True wenn mitarbeiter_uid vorhanden sonst false.
*/
public function checkIfExistingUid($mitarbeiter_uid)
{
$qry = "Select 1 from public.tbl_mitarbeiter where mitarbeiter_uid =".$this->db_add_param($mitarbeiter_uid);
if ($result = $this->db_query($qry))
{
if ($this->db_num_rows($result) > 0)
return true;
else
return false;
}
}
}
?>
+24 -9
View File
@@ -37,6 +37,8 @@ class projektarbeit extends basis_db
public $titel; // string
public $titel_english; // string
public $lehreinheit_id; // integer
public $lehrveranstaltung_id; // integer
public $studiensemester_kurzbz; // string
public $student_uid; // integer
public $firma_id; // integer
public $note; // integer
@@ -129,6 +131,8 @@ class projektarbeit extends basis_db
$this->titel = $row->titel;
$this->titel_english = $row->titel_english;
$this->lehreinheit_id = $row->lehreinheit_id;
$this->lehrveranstaltung_id = $row->lehrveranstaltung_id;
$this->studiensemester_kurzbz = $row->studiensemester_kurzbz;
$this->student_uid = $row->student_uid;
$this->firma_id = $row->firma_id;
$this->note = $row->note;
@@ -178,9 +182,13 @@ class projektarbeit extends basis_db
{
$this->errormsg='Projekttyp_kurzbz darf nicht NULL sein!';
}
if ($this->lehreinheit_id==null)
if ($this->lehrveranstaltung_id==null)
{
$this->errormsg='Lehreinheit_id darf nicht NULL sein!';
$this->errormsg='Lehrveranstaltung_id darf nicht NULL sein!';
}
if ($this->studiensemester_kurzbz==null)
{
$this->errormsg='Studiensemester_kurzbz darf nicht NULL sein!';
}
if(mb_strlen($this->projekttyp_kurzbz)>16)
{
@@ -261,12 +269,15 @@ class projektarbeit extends basis_db
{
//Neuen Datensatz einfuegen
$qry='BEGIN; INSERT INTO lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte,
$qry='BEGIN; INSERT INTO lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id,
lehrveranstaltung_id, studiensemester_kurzbz, student_uid, firma_id, note, punkte,
beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, gesamtstunden, themenbereich, anmerkung,
insertamum, insertvon, updateamum, updatevon, titel_english, final) VALUES('.
$this->db_add_param($this->projekttyp_kurzbz).', '.
$this->db_add_param($this->titel).', '.
$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).', '.
$this->db_add_param($this->lehrveranstaltung_id, FHC_INTEGER).', '.
$this->db_add_param($this->studiensemester_kurzbz).', '.
$this->db_add_param($this->student_uid).', '.
$this->db_add_param($this->firma_id, FHC_INTEGER).', '.
$this->db_add_param($this->note).', '.
@@ -301,6 +312,8 @@ class projektarbeit extends basis_db
'titel='.$this->db_add_param($this->titel).', '.
'titel_english='.$this->db_add_param($this->titel_english).', '.
'lehreinheit_id='.$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).', '.
'lehrveranstaltung_id='.$this->db_add_param($this->lehrveranstaltung_id, FHC_INTEGER).', '.
'studiensemester_kurzbz='.$this->db_add_param($this->studiensemester_kurzbz).', '.
'student_uid='.$this->db_add_param($this->student_uid).', '.
'firma_id='.$this->db_add_param($this->firma_id, FHC_INTEGER).', '.
'note='.$this->db_add_param($this->note).', '.
@@ -406,6 +419,8 @@ class projektarbeit extends basis_db
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->lehrveranstaltung_id = $row->lehrveranstaltung_id;
$obj->studiensemester_kurzbz = $row->studiensemester_kurzbz;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
@@ -449,14 +464,13 @@ class projektarbeit extends basis_db
tbl_projektarbeit.* , tbl_projekttyp.bezeichnung
FROM
lehre.tbl_projektarbeit
JOIN
lehre.tbl_projekttyp USING (projekttyp_kurzbz), lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
JOIN lehre.tbl_lehrveranstaltung ON (lehre.tbl_projektarbeit.lehrveranstaltung_id = lehre.tbl_lehrveranstaltung.lehrveranstaltung_id)
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER)." AND
tbl_lehreinheit.studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
tbl_projektarbeit.studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
if($this->db_query($qry))
{
@@ -470,6 +484,8 @@ class projektarbeit extends basis_db
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->lehrveranstaltung_id = $row->lehrveranstaltung_id;
$obj->studiensemester_kurzbz = $row->studiensemester_kurzbz;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
@@ -534,7 +550,6 @@ class projektarbeit extends basis_db
pa.projekttyp_kurzbz
FROM
lehre.tbl_projektarbeit pa
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
JOIN public.tbl_studiensemester sem USING(studiensemester_kurzbz)
LEFT JOIN (
SELECT
+11 -15
View File
@@ -121,7 +121,7 @@ class vertrag extends basis_db
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
vertrag_id=tbl_vertrag.vertrag_id
AND studiensemester_kurzbz in (SELECT studiensemester_kurzbz FROM public.tbl_studiensemester WHERE start>=".$this->db_add_param($datum).")
AND studiensemester_kurzbz in (SELECT studiensemester_kurzbz FROM public.tbl_studiensemester WHERE start>".$this->db_add_param($datum).")
)
)";
}
@@ -371,14 +371,14 @@ class vertrag extends basis_db
null::integer as pruefung_id,
projektarbeit_id,
(tbl_projektbetreuer.stunden*tbl_projektbetreuer.stundensatz) as betrag,
tbl_lehreinheit.studiensemester_kurzbz,
tbl_projektarbeit.studiensemester_kurzbz,
tbl_projektbetreuer.betreuerart_kurzbz,
(SELECT nachname || ' ' || vorname FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid=tbl_projektarbeit.student_uid)
as bezeichnung
FROM
lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
tbl_projektbetreuer.person_id=".$this->db_add_param($person_id, FHC_INTEGER)."
AND vertrag_id IS NULL";
@@ -461,9 +461,8 @@ class vertrag extends basis_db
OR
EXISTS (SELECT 1 FROM lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz)."
tbl_projektarbeit.studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz)."
AND tbl_projektbetreuer.person_id=tbl_person.person_id
AND tbl_projektbetreuer.vertrag_id IS NULL
)
@@ -535,12 +534,12 @@ class vertrag extends basis_db
UNION
SELECT
'Betreuung' as type,
tbl_projektarbeit.lehreinheit_id as lehreinheit_id,
NULL as lehreinheit_id,
null as mitarbeiter_uid,
null::integer as pruefung_id,
projektarbeit_id,
(tbl_projektbetreuer.stunden*tbl_projektbetreuer.stundensatz) as betrag,
tbl_lehreinheit.studiensemester_kurzbz,
tbl_projektarbeit.studiensemester_kurzbz,
tbl_projektbetreuer.betreuerart_kurzbz,
(SELECT nachname || ' ' || vorname FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid=tbl_projektarbeit.student_uid)
as bezeichnung,
@@ -549,7 +548,6 @@ class vertrag extends basis_db
FROM
lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
JOIN lehre.tbl_vertrag USING (vertrag_id)
WHERE
vertrag_id=".$this->db_add_param($vertrag_id, FHC_INTEGER).";";
@@ -942,17 +940,16 @@ class vertrag extends basis_db
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
vertrag_id=tbl_vertrag.vertrag_id
AND studiensemester_kurzbz=".$this->db_add_param($stsem).")
AND lehre.tbl_lehreinheit.studiensemester_kurzbz=".$this->db_add_param($stsem).")
OR
EXISTS (SELECT
1
FROM
lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
vertrag_id=tbl_vertrag.vertrag_id
AND studiensemester_kurzbz=".$this->db_add_param($stsem).")
AND lehre.tbl_projektarbeit.studiensemester_kurzbz=".$this->db_add_param($stsem).")
OR
(NOT EXISTS (SELECT
1
@@ -980,7 +977,7 @@ class vertrag extends basis_db
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
vertrag_id=tbl_vertrag.vertrag_id
AND studiensemester_kurzbz=".$this->db_add_param($stsem).")
AND lehre.tbl_lehreinheit.studiensemester_kurzbz=".$this->db_add_param($stsem).")
)
AND tbl_benutzer.uid=".$this->db_add_param($mitarbeiter_uid);
@@ -1077,7 +1074,7 @@ class vertrag extends basis_db
JOIN lehre.tbl_lehreinheitmitarbeiter USING(vertrag_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
lehre.tbl_lehreinheit.studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid NOT IN(SELECT uid FROM public.tbl_benutzer WHERE person_id=tbl_vertrag.person_id)
UNION
SELECT
@@ -1086,9 +1083,8 @@ class vertrag extends basis_db
lehre.tbl_vertrag
JOIN lehre.tbl_projektbetreuer USING(vertrag_id)
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
WHERE
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
tbl_projektarbeit.studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
AND tbl_projektbetreuer.person_id!=tbl_vertrag.person_id";
if($result = $this->db_query($qry))
+6 -9
View File
@@ -748,17 +748,14 @@ or not exists
UNION
SELECT sum(pb.stunden) AS semstunden
FROM
lehre.tbl_projektarbeit pa,
lehre.tbl_projektbetreuer pb,
public.tbl_benutzer b,
lehre.tbl_lehreinheit l
JOIN
lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id)
JOIN
public.tbl_studiengang s using (studiengang_kz)
lehre.tbl_projektarbeit pa
JOIN lehre.tbl_projektbetreuer pb ON(pa.projektarbeit_id = pb.projektarbeit_id)
JOIN public.tbl_benutzer b ON(pb.person_id = b.person_id)
JOIN lehre.tbl_lehreinheit l ON(pa.lehrveranstaltung_id = l.lehrveranstaltung_id AND pa.studiensemester_kurzbz = l.studiensemester_kurzbz)
JOIN lehre.tbl_lehrveranstaltung lv ON (l.lehrveranstaltung_id = lv.lehrveranstaltung_id)
JOIN public.tbl_studiengang s USING (studiengang_kz)
WHERE
pa.lehreinheit_id = l.lehreinheit_id AND
pb.projektarbeit_id = pa.projektarbeit_id AND
pb.person_id = b.person_id AND
b.uid = ".$this->db_add_param($user)." AND
+17 -1
View File
@@ -853,4 +853,20 @@ html {
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0.5rem;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
}
.cis-main-menu {
max-width: 100vw;
}
.cis-main-menu ul {
list-style: none;
margin: 0;
padding: 0;
}
.cis-main-menu ul li {
margin: 0;
padding: 0;
width: 100%;
}
@@ -107,4 +107,9 @@
.gesperrtoption {
color: gray;
}
#onboardingRow
{
margin-bottom: 15px;
}
+11 -1
View File
@@ -44,5 +44,15 @@ export default {
studiensemester_kurzbz
}
};
}
},
getContainingOrNearestByDateRange(from, to) {
return {
method: 'get',
url: 'api/frontend/v1/organisation/studiensemester/getContainingOrNearestByDateRange',
params: {
from,
to,
}
};
},
};
+14 -1
View File
@@ -19,6 +19,7 @@ import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.j
import Studium from "../../components/Cis/Studium/Studium.js";
import StgOrgLvPlan from "../../components/Cis/LvPlan/StgOrg.js";
import OtherLvPlan from "../../components/Cis/LvPlan/OtherLvPlan.js";
import Compat from "../../components/Cis/Compat.js";
import ApiRouteInfo from '../../api/factory/routeinfo.js';
import {capitalize} from "../../helpers/StringHelpers.js";
@@ -29,6 +30,18 @@ const isMobile = window.matchMedia("(max-width: 767px)").matches;
const router = VueRouter.createRouter({
history: VueRouter.createWebHistory(`/${ciPath}`),
routes: [
{
path: `/Cis/Compat/:mode(ci|legacy)/:path(.*)`,
name: 'Compat',
component: Compat,
props: (route) => {
return {
mode: route.params.mode,
path: route.params.path,
query_string: VueRouter.stringifyQuery(route.query)
};
}
},
{
path: `/Cis/Studium`,
name: 'Studium',
@@ -277,7 +290,7 @@ const app = Vue.createApp({
if (target && this.isInternalRoute(target.href)) {
const url = new URL(target.href)
const path = url.pathname
const path = url.pathname + url.search;
const base = this.$router.options.history.base
const route = path.replace(base, '') || '/'
+93
View File
@@ -0,0 +1,93 @@
export default {
name: "Compat",
props: {
mode: { type: String, required: true },
path: { type: String, required: true },
query_string: { type: String, required: true, default: ''}
},
data: function() {
return {
lastLoadediFrameURL: '',
srcUrl: ''
};
},
computed: {
propsWatchHelper: function() {
return this.mode + '#' + this.path + '#' + this.query_string;
}
},
mounted: function() {
this.srcUrl = this.buildSrcUrl();
},
watch: {
propsWatchHelper: function() {
if(this.lastLoadediFrameURL === '') {
return;
}
let currentiFrameURL = this.$refs.compatiframe ? this.$refs.compatiframe.src : '';
let url = this.buildSrcUrl();
if(this.lastLoadediFrameURL !== url) {
this.srcUrl = url;
if(this.srcUrl === url) {
this.$refs.compatiframe.contentWindow.location.href = url;
}
}
}
},
methods: {
buildSrcUrl: function() {
let url = false;
switch(this.mode) {
case 'ci':
url = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/' + this.path;
break;
case 'legacy':
url = FHC_JS_DATA_STORAGE_OBJECT.app_root + this.path;
break;
default:
url = false;
}
if(this.query_string !== '' && url) {
url += '?' + this.query_string;
}
return url;
},
loadHandler: function() {
let iframe_href = this.$refs.compatiframe.contentWindow.location.href;
let ci_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/';
let legacy_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root;
let routerpath = null;
this.lastLoadediFrameURL = iframe_href;
if(iframe_href.startsWith(ci_urlstart)) {
routerpath = iframe_href.replace(
ci_urlstart, '/Cis/Compat/ci/');
} else if(iframe_href.startsWith(legacy_urlstart)) {
routerpath = iframe_href.replace(
legacy_urlstart, '/Cis/Compat/legacy/');
} else {
return;
}
if(this.$route.fullPath !== routerpath) {
this.$router.push(routerpath);
}
}
},
template: `
<div class="w-100">
<iframe
ref="compatiframe"
v-if="srcUrl"
:src="srcUrl"
@load="loadHandler"
style="width:100%; height:90vh; border:0; display:block;"
></iframe>
<div v-else class="alert alert-warning">Keine URL gefunden.</div>
</div>
`
};
+30 -19
View File
@@ -1,6 +1,7 @@
import FhcCalendar from "../../Calendar/LvPlan.js";
import ApiLvPlan from '../../../api/factory/lvPlan.js';
import ApiStudienSemester from '../../../api/factory/studiensemester.js';
import ApiAuthinfo from '../../../api/factory/authinfo.js';
export const DEFAULT_MODE_LVPLAN_DESKTOP = "Week";
@@ -16,13 +17,12 @@ export default {
},
data() {
return {
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
uid: null,
isMitarbeiter: false,
isStudent: false,
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
startSemester: null,
endSemester: null,
};
},
inject: ["isMobile"],
@@ -48,9 +48,12 @@ export default {
return this.propsViewData?.mode;
},
downloadLinks() {
if (!this.studiensemester_start || !this.studiensemester_ende || !this.uid)
return false;
const startDate = this.startSemester?.start;
const endDate = this.endSemester ? this.endSemester.ende : this.startSemester?.ende;
if (!startDate || !endDate || !this.uid)
return false;
let type = false;
type = this.isStudent ? 'student' : type;
type = this.isMitarbeiter ? 'lektor' : type;
@@ -61,10 +64,10 @@ export default {
const opts = { zone: this.timezone };
const start = luxon.DateTime
.fromISO(this.studiensemester_start, opts)
.fromISO(startDate, opts)
.toUnixInteger();
const ende = luxon.DateTime
.fromISO(this.studiensemester_ende, opts)
.fromISO(endDate, opts)
.toUnixInteger();
const download_link = FHC_JS_DATA_STORAGE_OBJECT.app_root
@@ -109,16 +112,21 @@ export default {
}
});
},
updateRange(rangeInterval) {
this.$api
.call(ApiLvPlan.studiensemesterDateInterval(
rangeInterval.end.startOf('week').toISODate()
))
.then(res => {
this.studiensemester_kurzbz = res.data.studiensemester_kurzbz;
this.studiensemester_start = res.data.start;
this.studiensemester_ende = res.data.ende;
});
async updateRange(rangeInterval) {
const semesterResponse = await this.$api.call(
ApiStudienSemester.getContainingOrNearestByDateRange(
rangeInterval.s.toISO().slice(0, 10),
rangeInterval.e.toISO().slice(0, 10),
),
);
this.startSemester =
semesterResponse.data.length
? semesterResponse.data[0]
: null;
this.endSemester =
semesterResponse.data.length > 1
? semesterResponse.data[1]
: null;
},
getPromiseFunc(start, end) {
return [
@@ -142,8 +150,11 @@ export default {
<div class="cis-lvplan-personal d-flex flex-column h-100">
<h2>
{{ $p.t('lehre/stundenplan') }}
<span v-if="studiensemester_kurzbz" class="ps-3">
{{ studiensemester_kurzbz }}
<span v-if="startSemester?.studiensemester_kurzbz">
{{ startSemester.studiensemester_kurzbz }}
<span v-if="endSemester?.studiensemester_kurzbz">
{{ "- " + endSemester.studiensemester_kurzbz }}
</span>
</span>
</h2>
<hr>
+32 -25
View File
@@ -5,6 +5,7 @@ import FhcCalendar from "../../Calendar/LvPlan.js";
import ApiLvPlan from "../.././../api/factory/lvPlan.js";
import ApiOtherLvPlan from "../.././../api/factory/otherLvPlan.js";
import ApiAuthinfo from "../../../api/factory/authinfo.js";
import ApiStudienSemester from '../../../api/factory/studiensemester.js';
export const DEFAULT_MODE_LVPLAN_DESKTOP = "Week";
export const DEFAULT_MODE_LVPLAN_MOBILE = "List";
@@ -22,9 +23,6 @@ export default {
data() {
return {
localProps: {},
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
isOtherPersonMitarbeiter: false,
isOtherPersonStudent: false,
currentStgBezeichnung: null,
@@ -36,6 +34,8 @@ export default {
photo: "",
},
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
startSemester: null,
endSemester: null,
};
},
inject: ["isMobile"],
@@ -67,11 +67,10 @@ export default {
// do not show download links in otherLvPlan Mode
return false;
if (
!this.studiensemester_start ||
!this.studiensemester_ende ||
!this.propsViewData.otherUid
)
const startDate = this.startSemester?.start;
const endDate = this.endSemester ? this.endSemester.ende : this.startSemester?.ende;
if (!startDate || !endDate || !this.uid)
return false;
const type = this.isOtherPersonStudent
@@ -84,11 +83,11 @@ export default {
const opts = { zone: this.timezone };
const start = luxon.DateTime.fromISO(
this.studiensemester_start,
startDate,
opts,
).toUnixInteger();
const ende = luxon.DateTime.fromISO(
this.studiensemester_ende,
endDate,
opts,
).toUnixInteger();
@@ -166,19 +165,21 @@ export default {
},
});
},
updateRange(rangeInterval) {
this.$api
.call(
ApiLvPlan.studiensemesterDateInterval(
rangeInterval.end.startOf("week").toISODate(),
),
)
.then((res) => {
this.studiensemester_kurzbz =
res.data.studiensemester_kurzbz;
this.studiensemester_start = res.data.start;
this.studiensemester_ende = res.data.ende;
});
async updateRange(rangeInterval) {
const semesterResponse = await this.$api.call(
ApiStudienSemester.getContainingOrNearestByDateRange(
rangeInterval.s.toISO().slice(0, 10),
rangeInterval.e.toISO().slice(0, 10),
),
);
this.startSemester =
semesterResponse.data.length
? semesterResponse.data[0]
: null;
this.endSemester =
semesterResponse.data.length > 1
? semesterResponse.data[1]
: null;
},
getPromiseFunc(start, end) {
return [
@@ -250,8 +251,14 @@ export default {
<div class="d-flex flex-column h-100">
<h2>
<div class="d-flex flex-row justify-content-between align-items-center">
<span>
{{ $p.t('lehre/stundenplan') + (studiensemester_kurzbz ? " " + studiensemester_kurzbz : "") }}
<span>
{{ $p.t('lehre/stundenplan') }}
<span v-if="startSemester?.studiensemester_kurzbz">
{{ startSemester.studiensemester_kurzbz }}
<span v-if="endSemester?.studiensemester_kurzbz">
{{ "- " + endSemester.studiensemester_kurzbz }}
</span>
</span>
</span>
<div @click="this.$router.push({name: 'ProfilView', params: {uid: propsViewData.otherUid}})" type="button" class="d-flex flex-row align-items-center gap-3">
<span v-if="otherPersonData.fullNameWithTitle?.length">
+1 -1
View File
@@ -186,7 +186,7 @@ export default {
</div>
</div>
<nav id="nav-main" class="offcanvas offcanvas-start" tabindex="-1" aria-labelledby="nav-main-btn" data-bs-backdrop="false">
<nav id="nav-main" class="cis-main-menu offcanvas offcanvas-start" tabindex="-1" aria-labelledby="nav-main-btn" data-bs-backdrop="false">
<div id="nav-main-sticky">
<div class="d-flex flex-row h-100">
<div class="offcanvas-body p-0">
+8 -14
View File
@@ -72,20 +72,10 @@ export default {
return this.entry.url.startsWith(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router)
},
target() {
if (this.entry.template_kurzbz == 'redirect') {
if (!this.entry.content)
return '';
let xmlDoc = (new DOMParser()).parseFromString(this.entry.content,"text/xml");
let target = xmlDoc.getElementsByTagName('target')[0];
if (!target)
return '';
target = target.childNodes[0].nodeValue + "";
if (target == 'content' || target == '_self')
target = "";
return target;
if (this.entry?.target) {
return this.entry.target;
}
return ''
return '_self';
},
hasChilds() {
return this.entry.childs && this.entry.childs.length !== 0;
@@ -172,6 +162,7 @@ export default {
<div class="btn-group w-100">
<a :target="target"
:href="(entry.menu_open && hasFullLink) ? entry.url : null"
draggable="false"
@click="toggleCollapse"
:class="{
'btn btn-default rounded-0 text-start': true,
@@ -190,12 +181,15 @@ export default {
</div>
<ul ref="children"
class="nav w-100 collapse">
<cis-menu-entry :highestMatchingUrlCount="highestMatchingUrlCount" :activeContent="activeContent" v-for="child in entry.childs" :key="child" :entry="child" :level="level + 1"/>
<li>
<cis-menu-entry :highestMatchingUrlCount="highestMatchingUrlCount" :activeContent="activeContent" v-for="child in entry.childs" :key="child" :entry="child" :level="level + 1"/>
</li>
</ul>
</template>
<a v-else
:href="entry.url"
:target="target"
draggable="false"
:class="{
'btn btn-default rounded-0 w-100 text-start': true,
['btn-level-' + level]: true,
@@ -2,15 +2,16 @@ export default {
props: {
data: {
type: String,
}
},
},
data() {
return {}
return {};
},
template: /*html*/`
template: /*html*/ `
<div class="card">
<div class="card-body">
<span >{{$p.t('profil','fhAusweisStatus',[data])}}</span>
<span v-if="data">{{$p.t('profil','fhAusweisStatus',[data])}}</span>
<span v-else>{{$p.t('profil','fhAusweisStatusNichtAusgegeben')}}</span>
</div>
</div>`,
}
};
@@ -206,6 +206,8 @@ export default {
});
this.lehrveranstaltungen.forEach((lehrveranstaltung)=>{
// a lehrveranstaltung without a modul has no children
if(!Array.isArray(lehrveranstaltung.lehrveranstaltungen)) return;
lehrveranstaltung.lehrveranstaltungen.sort((lv1,lv2)=>{
if (lv1.bezeichnung.toLowerCase() > lv2.bezeichnung.toLowerCase()) {
return 1;
@@ -393,6 +395,16 @@ export default {
</ul>
</div>
</div>
<div class="card" v-else-if="!Array.isArray(lehrveranstaltung.lehrveranstaltungen)">
<div class="card-body">
<ul class="list-group list-group-flush">
<li class="d-flex list-group-item">
<a class="fhc-link-color d-block me-auto" href="#" @click="openLvUebersicht(lehrveranstaltung)">{{isGermanLanguage ? lehrveranstaltung.bezeichnung : lehrveranstaltung.bezeichnung_english}}</a>
<p>{{lehrveranstaltung.lehrform_kurzbz}}</p>
</li>
</ul>
</div>
</div>
</template>
</div>
+13 -2
View File
@@ -1,5 +1,6 @@
import BsModal from "../Bootstrap/Modal.js";
import HeightTransition from "../Tranistion/HeightTransition.js";
import MissingPermissionWidget from "../DashboardWidget/MissingPermission.js";
import { enableDragDropTouch } from "../../../../vendor/drag-drop-touch-js/dragdroptouch/dist/drag-drop-touch.esm.min.js";
@@ -112,6 +113,12 @@ export default {
isPinned() {
return this.place?.pinned ? true : false;
},
permitted() {
// widgets without a linked permission (or before the template loaded)
// are considered permitted; the backend sets permitted === false only
// when the user is missing the widget's required permission
return this.widgetTemplate?.permitted !== false;
},
ready() {
return this.component && this.arguments !== null;
}
@@ -169,7 +176,11 @@ export default {
&& this.widgetTemplate.widget_id
&& this.widgetTemplate.arguments
) {
let component = (await import(this.widgetTemplate.setup.file)).default;
// render the "missing permission" screen instead of the actual
// widget when the user does not hold the widget's linked permission
let component = this.permitted
? (await import(this.widgetTemplate.setup.file)).default
: MissingPermissionWidget;
this.$options.components["widget" + this.widgetTemplate.widget_id] = component;
this.component = "widget" + this.widgetTemplate.widget_id;
this.arguments = { ...this.widgetTemplate.arguments, ...this.config };
@@ -269,7 +280,7 @@ export default {
</template>
<!-- widget link -->
<a
v-if="widgetTemplate.setup.cis4link"
v-if="widgetTemplate.setup.cis4link && permitted"
:href="getWidgetC4Link(widgetTemplate)"
class="col-auto ms-auto"
:aria-label="$p.t('dashboard/widget_link')"
@@ -14,10 +14,14 @@ export default {
callbacks: {}
}),
computed: {
// filter widgets away the user has no permissions for
availableWidgets() {
return (this.widgets || []).filter(widget => widget.permitted !== false);
},
hasAnyWidgets() {
if (!this.widgets)
return false;
if (!this.widgets.length && !this.hiddenWidgets?.length)
if (!this.availableWidgets.length && !this.hiddenWidgets?.length)
return false;
return true;
}
@@ -54,7 +58,7 @@ export default {
<template v-slot:default>
<template v-if="widgets && hiddenWidgets">
<div
v-if="!widgets.length && !hiddenWidgets.length"
v-if="!availableWidgets.length && !hiddenWidgets.length"
class="row g-2"
>
<div>{{ $p.t('dashboard/noWidgetsAvailable') }}</div>
@@ -74,16 +78,17 @@ export default {
</div>
</div>
<div
v-if="widgets.length"
v-if="availableWidgets.length"
class="row g-2"
>
<div
v-for="widget in widgets"
<template
v-for="widget in availableWidgets"
:key="widget.widget_id"
class="widget-icon-container col-sm-6 col-md-4 col-lg-3 col-xl-2"
>
<widget-icon @select="pick" :widget="widget"></widget-icon>
</div>
<div v-if="widget.permitted" class="widget-icon-container col-sm-6 col-md-4 col-lg-3 col-xl-2">
<widget-icon @select="pick" :widget="widget"></widget-icon>
</div>
</template>
</div>
</template>
</template>
@@ -0,0 +1,21 @@
import AbstractWidget from './Abstract.js';
/**
* Fallback screen rendered in place of a widget when the current user is missing
* the permission (berechtigung_kurzbz) linked to that widget. Used for widgets
* that are already on a user's dashboard but whose required permission the user
* no longer holds.
*/
export default {
mixins: [
AbstractWidget
],
created() {
this.$emit('setConfig', false);
},
template: /*html*/`
<div class="dashboard-widget-missing-permission d-flex flex-column justify-content-center align-items-center text-center h-100 p-3 text-body-secondary">
<i class="fa-solid fa-lock fa-2x mb-2" aria-hidden="true"></i>
<p class="mb-0">{{ $p.t('dashboard/widget_missing_permission') }}</p>
</div>`
}
@@ -542,10 +542,10 @@ export default {
<template v-if="typeHeader==='mitarbeiter'">
<div class="foto-container col-md-2 d-flex justify-content-start align-items-center w-30 pb-3 gap-3 mt-3 position-relative" style="max-height: 8rem; max-width: 6rem; overflow: hidden;">
<div class="foto-container d-flex flex-column align-items-center h-100 position-relative d-inline-block">
<img
class="d-block w-100 h-100 rounded"
style="height: 84px; object-fit: contain;"
class="d-block rounded"
style="height: 96px;"
alt="Profilbild"
:src="getFotoSrc(headerDataMa.foto)"
/>
@@ -558,15 +558,13 @@ export default {
<template v-if="fotoEditable">
<button
type="button"
class="fotoedit btn btn-outline-dark btn-sm d-flex justify-content-center align-items-center position-absolute start-0"
style="z-index: 104; font-size: 1rem; width: 2.5rem; height: 2.5rem; opacity:0; transition: opacity 0.2s; top:13%;"
class="fotoedit buttonleft btn btn-outline-dark btn-sm d-flex justify-content-center align-items-center position-absolute start-0"
@click="showDeleteModal(person_id)">
<i class="fa fa-xmark"></i>
</button>
<button
type="button"
class="fotoedit btn btn-outline-dark btn-sm d-flex justify-content-center align-items-center position-absolute end-0"
style="z-index: 104; font-size: 1rem; width: 2.5rem; height: 2.5rem; opacity:0; transition: opacity 0.2s; top:13%;"
class="fotoedit buttonright btn btn-outline-dark btn-sm d-flex justify-content-center align-items-center position-absolute end-0"
@click="showModal(person_id)">
<i class="fa fa-pen"></i>
</button>
@@ -49,6 +49,52 @@ export default{
{title: this.$p.t('person', 'nachname'), field:"nachname"},
{title: this.$p.t('person', 'vorname'), field:"vorname"},
{title: this.$p.t('person', 'uid'), field:"mitarbeiter_uid"},
{title: this.$p.t('global/insertvon'), field: 'insertvon', visible: false},
{
title: this.$p.t('global/insertamum'),
field: "insertamum",
visible: false,
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
const date = new Date(dateStr);
return date.toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
hour12: false
});
}
},
{title: this.$p.t('global/updatevon'), field: 'updatevon', visible: false},
{
title: this.$p.t('global/updateamum'),
field: "updateamum",
visible: false,
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
const date = new Date(dateStr);
return date.toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
hour12: false
});
}
},
{title: this.$p.t('lehre', 'lehreinheit_id'), field:"lehreinheit_id"},
{
title: this.$p.t('lehre', 'verplant'),
@@ -102,7 +148,7 @@ export default{
selectable: true,
selectableRangeMode: 'click',
selectableRows:1,
persistenceID: 'lehrveranstaltungen_lektor_table_2025_05_27_v1',
persistenceID: 'lehrveranstaltungen_lektor_table_2026_09_11_v1',
}},
},
mounted(){
@@ -341,7 +341,8 @@ export default {
actionDownload(akte_id) {
window.open(
FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/api/frontend/v1/stv/akte/download?akte_id=' + encodeURIComponent(akte_id),
//+ FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/api/frontend/v1/stv/akte/download?akte_id=' + encodeURIComponent(akte_id),
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/api/frontend/v1/stv/dokumente/download?akte_id=' + encodeURIComponent(akte_id),
'_blank'
);
},

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