Compare commits

...

258 Commits

Author SHA1 Message Date
cgfhtw b2ebb804a8 added multilanguage functions to DB_Model 2024-08-02 14:21:41 +02:00
Harald Bamberger d0f3cee7de add permissions for vw_oe_path 2024-07-29 18:11:13 +02:00
Harald Bamberger e6684a0116 add db view that contains oe path 2024-07-29 17:41:24 +02:00
Harald Bamberger 965e23dba7 Merge branch 'feature-40743/Anrechnung_Config-fuer-zusaetzliche-Felder' 2024-07-17 14:08:55 +02:00
Harald Bamberger f064a29efc Merge branch 'master' into feature-40743/Anrechnung_Config-fuer-zusaetzliche-Felder 2024-07-17 08:02:55 +02:00
Harald Bamberger 6dd1dc62bf Merge branch 'feature-39592/vereinfachte_Sicht_fuer_Assistenz' 2024-07-16 20:59:48 +02:00
Harald Bamberger fcacd2a660 Merge branch 'master' into feature-39592/vereinfachte_Sicht_fuer_Assistenz 2024-07-16 14:23:16 +02:00
Harald Bamberger 8c9ed2c52c Textaenderung 2024-07-16 14:19:32 +02:00
Harald Bamberger 36aab1b579 Merge branch 'feature-36555/Studstatus_HinweistextFAS_Pruefungsdatum' 2024-07-16 14:11:34 +02:00
Harald Bamberger 3c50ffd945 remove unnecessary style 2024-07-16 14:07:44 +02:00
Harald Bamberger bf1f0428ea use textbox to retain layout 2024-07-15 19:06:19 +02:00
Harald Bamberger f49161420d try to improve layout 2024-07-15 18:18:53 +02:00
Harald Bamberger 464dbba457 add missing api js files 2024-07-11 18:43:31 +02:00
Harald Bamberger 9d455c35d0 Betriebsmittel.js: use arrow function for dynamic ajaxParams, Filter.js: remove required from filterType 2024-07-11 18:32:47 +02:00
Harald Bamberger 3f84024ce8 uncomment null check, layout of hint 2024-07-11 17:35:18 +02:00
Harald Bamberger 16ab9998b0 Merge branch 'master' into feature-39592/vereinfachte_Sicht_fuer_Assistenz 2024-07-11 14:44:44 +02:00
Harald Bamberger 115151473a backport recent changes of Betriebsmittel component and phrases from feature-30660/FHC4_StudierendenGUI_Prototyp Branch 2024-07-11 11:57:45 +02:00
Cris a23b133217 Adapted requestAnrechnung.js to handle submit data and events on Begruendung-zur-Gleichwertigkeit fields
...depending on $config['explain_equivalence']
2024-07-11 10:54:43 +02:00
Cris 1139b251ef Adapted Views to handle display of Begruendung-zur-Gleichwertigkeit fields
...depending on $config['explain_equivalence']
2024-07-11 10:52:51 +02:00
Cris 8c3b85066a Adapted Controller RequestAnrechnung.php to handle Begruendung-zur-Gleichwertigkeit fields
...depending on $config['explain_equivalence']
2024-07-11 10:49:05 +02:00
Cris 0b48e94d3c Added config variable $config['explain_equivalence'] (Begruendung zu Gleichwertigkeit)
...to display and enable 'Begründung zu Gleichwertigkeit'-fields
2024-07-11 10:44:12 +02:00
Harald Bamberger 46ea054bac change text, add config to show hint or not, styling 2024-07-10 15:52:57 +02:00
Cris 03205674aa Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-07-10 15:51:51 +02:00
Harald Bamberger 8b254b3967 Merge branch 'master' into feature-36555/Studstatus_HinweistextFAS_Pruefungsdatum 2024-07-09 11:52:07 +02:00
Harald Bamberger c4ef0f998c Merge branch 'feature-40285/Studstatus_Datum_der_Abmeldung_auf_den_3_Abmeldungsdokumenten' 2024-07-09 11:49:41 +02:00
Harald Bamberger 37fb9dd851 use date that seems more stable than one that depends on a config entry that may change over time and then change the date in previous documents 2024-07-09 11:38:16 +02:00
Harald Bamberger 2a537df687 Merge branch 'master' into feature-40285/Studstatus_Datum_der_Abmeldung_auf_den_3_Abmeldungsdokumenten 2024-07-09 10:35:40 +02:00
Harald Bamberger dd0bdddbc6 backport recent changes of Betriebsmittel component and phrases from feature-30660/FHC4_StudierendenGUI_Prototyp Branch 2024-07-01 14:12:48 +02:00
Cris e8fe3c2eff Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-06-26 11:53:28 +02:00
Andreas Österreicher b56e8c5f9f Im Abschlusspruefung Karteireiter wird in der Liste bei der Beurteilung jetzt die
Bezeichnung der Note angezeigt anstatt der Kurzbz
2024-06-21 13:02:55 +02:00
cgfhtw 9c53a7a75b PDF Download Button während Einspruchsfrist verbergen 2024-06-19 14:02:20 +02:00
Harald Bamberger 1f36a08f05 Merge branch 'merge_37107_37133_39212' 2024-06-19 11:41:11 +02:00
cgfhtw 631a552708 Datum bei Abmeldung d Stud PDF 2024-06-19 10:55:48 +02:00
Harald Bamberger ea9c35a64b Merge branch 'feature-37107/Fristenmanagement' into merge_37107_37133_39212 2024-06-19 10:28:39 +02:00
Harald Bamberger 04c006a733 do not create dummy manual events 2024-06-19 10:28:03 +02:00
Harald Bamberger aff1f9126f Merge branch 'master' into merge_37107_37133_39212 2024-06-19 09:45:05 +02:00
cgfhtw a8acf91980 Datum bei Abmeldung Fristablauf d WH PDF 2024-06-19 09:21:13 +02:00
Andreas Österreicher fb77ab67e7 Prüfungshonorare im Notenkarteireiter zeigen nur aktive Mitarbeiter an 2024-06-19 09:05:08 +02:00
Harald Bamberger d3a277f9fb Merge branch 'feature-39212/PV21-Grund_beim_Beenden_eines_DV' into merge_37107_37133_39212 2024-06-19 08:52:03 +02:00
Harald Bamberger 0aa53f64ff db Aenderungen Gegenpruefung hinzugefuegt 2024-06-19 08:51:34 +02:00
cgfhtw 3e0c15e18f Datum bei Abmeldung d StgL PDF 2024-06-18 11:12:12 +02:00
Cris 538c2e09ce Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-06-17 14:20:43 +02:00
Harald Bamberger e05fa0f4d8 Merge branch 'master' into merge_37107_37133_39212 2024-06-14 11:50:32 +02:00
Harald Bamberger c3278ad30f add app softwarebereitstellung to prevent checksystem errors when adding phrases for softwarebereitstellung while not having installed the extension 2024-06-14 11:49:43 +02:00
Harald Bamberger e4326e00e4 Merge branch 'feature-39212/PV21-Grund_beim_Beenden_eines_DV' into merge_37107_37133_39212 2024-06-14 11:02:25 +02:00
Harald Bamberger 93d0f88b0d function getDVByPersonUID: add dvendegrund_kurzbz and dvendegrund_anmerkung to select 2024-06-14 10:48:43 +02:00
Harald Bamberger 1c385d22cd Merge branch 'feature-37133/Gehaltsbaender' into merge_37107_37133_39212 2024-06-14 10:41:48 +02:00
Harald Bamberger 24786c6ae6 Merge branch 'feature-37107/Fristenmanagement' into merge_37107_37133_39212 2024-06-13 13:30:38 +02:00
Harald Bamberger 0e5d4b30ed Merge branch 'master' into feature-37133/Gehaltsbaender 2024-06-13 13:26:48 +02:00
Harald Bamberger 4e233f760d Merge branch 'master' into feature-37107/Fristenmanagement 2024-06-13 13:26:02 +02:00
Harald Bamberger fd2474cc38 Merge branch 'master' into feature-39212/PV21-Grund_beim_Beenden_eines_DV 2024-06-13 11:51:10 +02:00
Andreas Österreicher 20eee62c19 Merge branch 'sonstiges-40279/SWB-Lizenzserverport' 2024-06-13 11:13:30 +02:00
Werner Masik eb327c3adc update Handyverwaltung filter 2024-06-12 14:52:22 +02:00
Harald Bamberger 1e56707e5a Merge branch 'feature-40415/Studstatus-UID_in_Sancho_Message_Abmeldung_StG_Ablauf_Einspruchsfrist' 2024-06-12 08:13:11 +02:00
Harald Bamberger 6816a300f6 Beschriftung korrigiert 2024-06-11 16:39:20 +02:00
Harald Bamberger 0b8191a435 Beschriftung zu IDs in Sancho Message hinzugefuegt 2024-06-11 16:26:52 +02:00
Harald Bamberger f8d8a44a3c student_uid zu sancho message Abmeldung StG Ablauf Einspruchsfrist 2024-06-11 14:47:54 +02:00
Cris cd0eacf947 Updated phrases: Added phrases 'lizenzserverPort' and 'raumSwZuordnung' 2024-06-11 13:52:03 +02:00
Cris dd47cd2a7c Updated filter: Added lizenzserver_kurzbz and lizenzserver_port to SoftwareManagement filter 2024-06-11 13:51:03 +02:00
Cris a4b77fc43f Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-06-11 11:32:47 +02:00
Andreas Österreicher f943ae7566 Merge branch 'feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' 2024-06-10 14:05:49 +02:00
Cris f1547b069d Merge branch 'feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' of https://github.com/FH-Complete/FHC-Core into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2024-06-10 13:37:46 +02:00
Cris ac7dc1599c Corrected path to init.js.php 2024-06-10 13:37:14 +02:00
Andreas Österreicher 46b7dc1ce7 Dauer für die Anzeige von abgelaufenen Projekten in der Zeitaufzeichnung
auf 2 Monate verlängert
2024-06-07 10:19:12 +02:00
Werner Masik cd8fffd2f7 added filter update for Handyverwaltung 2024-06-04 16:20:43 +02:00
Cris 125a2da9b3 Merge branch 'feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' of https://github.com/FH-Complete/FHC-Core into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2024-06-04 16:16:49 +02:00
Cris 884d930e71 Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2024-06-04 16:05:33 +02:00
Cris 49045c06af Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-06-04 16:04:19 +02:00
Harald Bamberger 7b148b1a39 Merge branch 'master' into feature-39212/PV21-Grund_beim_Beenden_eines_DV 2024-06-03 17:21:50 +02:00
Harald Bamberger 0cbb8997e2 migratecontract config und config check auch in MigrateHourlyRate verwenden 2024-06-03 17:14:55 +02:00
Cris 512002c0e8 Created init.js file and changed link url in stpl_week to open Software-Raumsuche by OrtKurzbz 2024-06-03 16:40:35 +02:00
Cris 9652f48044 Added phrases 'zugeklappt', 'softwareliste', 'raumverfuegbarkeit' 2024-06-03 16:27:31 +02:00
Harald Bamberger 9454bde14a backport Betriebsmittel Component from feature-30660/FHC4_StudierendenGUI_Prototyp Branch 2024-05-29 15:19:23 +02:00
Harald Bamberger a924c9d2bb backport Betriebsmittel Component from feature-30660/FHC4_StudierendenGUI_Prototyp Branch 2024-05-29 11:49:11 +02:00
Andreas Österreicher 5453579c7b Merge branch 'feature-36963/BIS_check_duales_Studium' 2024-05-28 09:29:44 +02:00
KarpAlex d8ba92e343 Merge branch 'master' into feature-36963/BIS_check_duales_Studium 2024-05-27 19:42:48 +02:00
cgfhtw d5e8227918 Bugfix: api/frontend/fas controller do not inherit from FHCAPI_Controller 2024-05-27 12:45:10 +02:00
Harald Bamberger 8cba0aec5a vertragsarten dvbund, dvanderegk und dvanderebet hinzugefuegt, MigrateContract default oe und ba1code mapping in config verschoben und config check implementiert 2024-05-22 15:32:28 +02:00
Cris aab198e355 Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2024-05-22 11:03:34 +02:00
Cris 559a6b317d Fixed multiple display of child software 2024-05-21 14:44:41 +02:00
Cris 66a80697c2 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-05-21 14:21:34 +02:00
Werner Masik 706dad6df6 added DV Ende 2024-05-16 21:58:34 +02:00
Harald Bamberger f2a2469e6e MigrateContract: keine ZeitaufzeichnungsVbs erstellen wenn za oder azg flag null ist. MigrateHourlyRate: kalkulatorische Stundensaetze nur migrieren wenn SAP Sync Tabelle existiert. 2024-05-15 17:25:26 +02:00
Cris c4c17f69c7 Added phrase softwaretypKurzbz 2024-05-14 13:41:33 +02:00
Cris 8a0d2a2f10 Refactored Tabs title assignment to utilize computed property
This is necessary to render language phrases correctly
2024-05-13 14:02:05 +02:00
Cris 6d728ae0e7 Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software
# Conflicts:
#	public/js/components/Tabs.js
#	public/js/components/filter/Filter.js
2024-05-13 12:07:37 +02:00
Cris 58f52dfaae Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-05-13 11:07:16 +02:00
Cris 5643607845 Added phrases 'statusErfolgreichUebertragen' and 'statusUebertragenMsg' to Softwarebereitstellung app 2024-05-13 11:06:32 +02:00
Harald Bamberger 93b111af93 fix handleSystemError is not a function 2024-05-06 16:48:38 +02:00
Harald Bamberger 6a8a96b748 fix long lasting request getPrestudents to block browser when timedout once 2024-05-06 16:04:45 +02:00
Harald Bamberger 69b0b3601d Merge branch 'master' into feature-39212/PV21-Grund_beim_Beenden_eines_DV 2024-05-03 13:08:12 +02:00
Andreas Österreicher 40c0393bc0 Voller Name der Kritikalität des Services wird angezeigt im
Servicekatalog
2024-05-02 16:31:34 +02:00
Andreas Österreicher c6193530db Merge branch 'feature-39288/Servicekatalog_Kritikalitaet' 2024-05-02 16:27:09 +02:00
Harald Bamberger 3a3d28e9e6 Merge branch 'feature-37246/APIs_Konsolidierung' 2024-04-30 21:45:48 +02:00
Harald Bamberger 3b8776f947 Merge branch 'master' into feature-37246/APIs_Konsolidierung 2024-04-30 16:26:15 +02:00
Andreas Österreicher 23255ed84f Merge branch 'feature-17727/FasDefaultStundensatzProjektbetreuungAnzeigen' 2024-04-30 16:17:00 +02:00
Andreas Österreicher a3b5996c50 Stundensatz wird abhängig vom Studiensemester der Projektarbeit /
Lehreinheit ermittelt
2024-04-30 16:16:03 +02:00
Andreas Österreicher a606add6eb Merge branch 'master' into feature-17727/FasDefaultStundensatzProjektbetreuungAnzeigen 2024-04-30 10:55:58 +02:00
KarpAlex 18dabf26e4 service uebersicht in cis: loading only one moodle config instead of all addon configs to avoid php notices 2024-04-29 14:00:30 +02:00
Harald Bamberger ef5040557d Merge branch 'master' into feature-37246/APIs_Konsolidierung 2024-04-29 09:37:06 +02:00
Andreas Österreicher 8999b59f4e Renamed Field 2024-04-26 13:41:33 +02:00
Harald Bamberger 2ea3597a10 Merge branch 'master' into feature-39212/PV21-Grund_beim_Beenden_eines_DV 2024-04-25 15:11:41 +02:00
Harald Bamberger 08dd6a7783 add dvendegrund_kurzbz and dvendegrund_anmerkung when reading dvs from db 2024-04-25 15:11:16 +02:00
Andreas Österreicher d55cb56a1a Merge branch 'bug-39609/automatischer_abgewiesener_status_setzen' 2024-04-25 14:24:43 +02:00
ma0048 8bac75ae52 - bug behoben, damit keine leeren "Status Abgewiesen gesetzt" Mails verschickt werden 2024-04-25 14:20:18 +02:00
Werner Masik 3b06519f2f updated phrases for salary range 2024-04-24 15:25:42 +02:00
Werner Masik c15a350392 moved dbUpdate for gehaltsband to extension 2024-04-24 14:55:22 +02:00
Harald Bamberger c33a11e952 Merge branch 'master' into feature-37246/APIs_Konsolidierung 2024-04-24 08:30:25 +02:00
Harald Bamberger 844c07be9c Merge branch 'feature-39174/Studstatus_AbmeldungStglFuerUnterbrecher' 2024-04-24 08:25:51 +02:00
Harald Bamberger 5175dcdbe4 Merge branch 'master' into feature-37246/APIs_Konsolidierung 2024-04-23 15:57:50 +02:00
Andreas Österreicher 0655118f2b Merge branch 'feature-39349/tdb_phrasen' 2024-04-19 10:38:39 +02:00
Alexei Karpenko 412bb10a06 Servicekatalog: renamed Kategorie column to Kritikalität in vilesci, added column Kritikalitaet in cis overview 2024-04-18 15:38:22 +02:00
Andreas Österreicher 3a4492671d Fixed Signing Documents via CIS 2024-04-18 08:53:22 +02:00
Werner Masik b2deea6962 added db schema for Gehaltsbaender 2024-04-17 16:40:12 +02:00
Andreas Österreicher 8a115626ba CDATA bei Lernergebnisse hinzugefügt 2024-04-16 10:33:27 +02:00
Andreas Österreicher 20aba9aa90 Merge branch 'feature-27349/DiplomaSupplementQuereinstiegerRahmenvertrag' 2024-04-16 10:22:48 +02:00
Andreas Österreicher 8057ecbc60 Merge branch 'feature-15490/lehrauftragsliste_stammkostenstelle_bei_fix_angestellten' 2024-04-15 15:41:53 +02:00
cgfhtw e0c7691e04 missing catch 2024-04-11 15:14:15 +02:00
Andreas Österreicher c03e6deb95 Removed useless code 2024-04-10 16:45:46 +02:00
ma0068 941dce6032 Diplomasupplement: Adaptierung Wording Niveau 2024-04-10 14:48:04 +02:00
Harald Bamberger 94224f7ef7 dvendegrund Ablauf durch Zeit added 2024-04-10 14:28:07 +02:00
Cris f51f006377 Corrected phrase anmerkungIntern 2024-04-10 14:07:41 +02:00
Andreas Österreicher 637392c844 Merge branch 'master' into feature-15490/lehrauftragsliste_stammkostenstelle_bei_fix_angestellten 2024-04-10 09:56:58 +02:00
Harald Bamberger e11dd21a1e add parameter dvendegrund_kurzbz and dvendegrund_anmerkung 2024-04-09 16:35:00 +02:00
Harald Bamberger 1a1cd76bc4 add grant on hr.tbl_dvendegrund to user vilesci 2024-04-09 15:42:00 +02:00
Harald Bamberger a9818e1f63 add initial values to hr.tbl_dvendegrund 2024-04-09 15:27:47 +02:00
Harald Bamberger 56900e31db add table hr.tbl_dvendegrund, add columns dvendegrund_kurzbz and dvendegrund_anmerkung to hr.tbl_dienstverhaeltnis 2024-04-09 15:08:32 +02:00
Andreas Österreicher e41eada893 Removed unused Code 2024-04-09 14:08:58 +02:00
Andreas Österreicher a32e78c9b8 Merge branch 'master' into feature-27349/DiplomaSupplementQuereinstiegerRahmenvertrag 2024-04-09 13:53:37 +02:00
Cris 1d0c2be449 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-04-09 11:33:38 +02:00
Andreas Österreicher bdb0a5702d Fehler behoben wodurch keine Note im Freigabemail angezeigt wurde
Fehler behoben wodurch keine Punkteübernahme bie Nachprüfungen möglich
war
2024-04-09 11:24:44 +02:00
Harald Bamberger 026a276c02 add grant on frist_id sequence 2024-04-09 11:11:03 +02:00
Harald Bamberger 3b41df5ddc Merge branch 'master' into feature-37107/Fristenmanagement 2024-04-09 10:44:02 +02:00
Andreas Österreicher 8a9477eaf0 Fixed PHP7.4 Warning 2024-04-08 12:54:05 +02:00
Werner Masik f2ba0fd469 update phrases and added events for fristenmanagement 2024-04-07 00:33:25 +02:00
Andreas Österreicher 257c7a5aac Projektzeitenexport für Administration/HR im Vilesci hinzugefügt 2024-04-05 14:14:13 +02:00
ma0048 753a193be1 - added phrases for bpks details 2024-04-04 15:41:18 +02:00
KarpAlex 2132fe76ae added Plausicheck: students in DUAL Studiengang should have set boolean value dual to true, plausicheck bugfixes (loading model, remove unnecessary property) 2024-04-03 17:39:00 +02:00
Cris cfe73b361e Sorted project phases by start date and bezeichnung in Zeitaufzeichnung
Sorted within dropdown
2024-04-03 15:13:32 +02:00
Cris a2791fecd1 Sorted projects in alphabetical order in Zeitaufzeichnung
Sorted within dropdown and in project cvs export file.
2024-04-03 13:10:30 +02:00
Cris d2a8d59f6d Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-04-03 12:59:00 +02:00
Cris 9907ee2267 Added phrase global/zeilenAuswaehlen 2024-04-03 11:45:43 +02:00
Werner Masik 5cabac62d7 add frist events for befristung 2024-04-02 18:33:37 +02:00
cgfhtw 8ffc8a20d3 s&d 2024-03-29 14:27:45 +01:00
cgfhtw d34ce78c94 s&d 2024-03-29 13:00:54 +01:00
Cris ba1fa6add4 Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2024-03-28 13:20:51 +01:00
Cris 8d8e45b6de Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-03-28 13:20:16 +01:00
Cris 05516f2952 Fixed: issue with component tabs not recognizing loaded phrases
Vue.computed ensures loading phrase reactively when phrases are loaded
2024-03-28 13:19:31 +01:00
Cris d34f5b92f4 Added new phrases for softwarebereitstellung- and for core app 2024-03-28 13:14:34 +01:00
cgfhtw 06b0529813 Autocomplete: empty message 2024-03-22 09:10:13 +01:00
cgfhtw c4942cc70e Studstatus => FhcApi 2024-03-21 15:45:55 +01:00
Cris bc798bd0b4 Added uniqueId prop to Filter.js to fix URL using apiFunctionParameters.filterUniqueId 2024-03-20 09:58:25 +01:00
Cris f6eceb892d Added label property 'class' to Input.js
...which fixes style issues when creating input-group buttons using the Input.js component
2024-03-20 09:52:26 +01:00
Cris 6eae83f4eb Added primevues autocomplete slot template to Input.js
Now, when using the Input Component with type 'autocomplete', it is possible to add also primevues built in slot templates there
2024-03-20 09:50:03 +01:00
Cris 842e62b0dd Fixed Input.js error causing to keep last entries' first letter in form inputs, even when formdata was emptied 2024-03-20 09:42:23 +01:00
Cris 10e57dae2d Adapted style of .tabulator-cell .btn to be squared and increased padding 2024-03-20 09:38:08 +01:00
cgfhtw 69803cdb0d Phrasen: Bugfix - correct function for multiple categories 2024-03-20 08:27:26 +01:00
Werner Masik 426a439552 added sort column to frist 2024-03-20 00:13:55 +01:00
cgfhtw 4e6b7a845b FhcApi: use errorHeader for multiple calls 2024-03-19 16:54:14 +01:00
cgfhtw 30efd55d6c FhcApi: settle handled Promises & discard them in FhcAlert 2024-03-19 16:53:36 +01:00
cgfhtw 8f0e837fb7 Phrasen Plugin: Bugfix this 2024-03-19 08:45:10 +01:00
cgfhtw b147f73954 Merge branch 'master' into feature-37246/APIs_Konsolidierung 2024-03-18 09:51:29 +01:00
Werner Masik e28627a676 removed verantwortlich column from tbl_frist 2024-03-12 17:34:13 +01:00
cgfhtw 6acf65b49f Form Component: expose _defaultErrorHandlers 2024-03-11 15:24:48 +01:00
cgfhtw 40c98b1dcc FHCAPI Controller: optional status param for error function 2024-03-11 15:23:54 +01:00
cgfhtw b359a77a8d Comments 2024-03-11 09:56:34 +01:00
cgfhtw d259c0d35c Fetch: more robust error handling 2024-03-11 09:46:59 +01:00
cgfhtw 011b4a83eb Filter => FhcApi 2024-03-11 09:46:39 +01:00
cgfhtw 85f9b14326 Comments 2024-03-07 16:56:37 +01:00
cgfhtw 5f77bdd6fc Spelling 2024-03-07 16:56:30 +01:00
cgfhtw d2eadb98ce Navigation => FhcApi 2024-03-07 16:56:14 +01:00
cgfhtw 291f32bfe2 Tabs => FhcApi 2024-03-07 14:35:29 +01:00
cgfhtw f539ed8977 Depricated comment 2024-03-07 08:54:28 +01:00
cgfhtw 20619311e3 Use fhcApi in Searchbar 2024-03-07 08:50:27 +01:00
cgfhtw 4ac46d19e9 Testsearch view: naming convention 2024-03-07 08:23:29 +01:00
cgfhtw dad459e023 Testsearch: Codequality 2024-03-07 08:18:49 +01:00
cgfhtw 8f6fbda4cf Testsearch: Bugfixes 2024-03-07 08:11:58 +01:00
cgfhtw b6723e92d8 Code Quality 2024-03-07 08:01:11 +01:00
cgfhtw 1344ab987e Options for custom FhcApiFactory 2024-03-06 16:52:42 +01:00
cgfhtw 1dcece8563 Use Factory for Phrasen 2024-03-06 16:52:10 +01:00
cgfhtw f2ebf25640 Use new FhcApiFactory Folder 2024-03-06 16:51:25 +01:00
cgfhtw f6427f57b8 Use FHCAPI Controller for Phrasen 2024-03-06 16:49:35 +01:00
cgfhtw 68459e086a Auth_Controller special permissions 2024-03-06 16:15:04 +01:00
Cris 03e166dc89 Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software
# Conflicts:
#	public/js/components/filter/Filter.js
#	public/js/plugin/FhcAlert.js
#	system/filtersupdate.php
2024-03-06 14:07:19 +01:00
Cris 0940ea77de Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-03-06 13:59:06 +01:00
cgfhtw 872ef7c31c Move Phrasen API 2024-03-06 13:02:34 +01:00
cgfhtw e89aa824d2 FHCAPI_Controller extends Auth_Controller + auth error handling in FhcApi 2024-03-06 11:48:15 +01:00
cgfhtw 1b65378d6c Auth_Controller private functions 2024-03-06 11:47:34 +01:00
Werner Masik 77666e5210 added column verantwortlich_uid 2024-03-06 08:27:39 +01:00
Cris 7f735e9a10 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-03-05 13:05:03 +01:00
Werner Masik c60f7ed8b0 dbUpdate for fristenmanagement completed 2024-03-01 15:43:15 +01:00
Werner Masik 7a6d095b78 create db tables for fristenmanagement 2024-02-29 17:09:59 +01:00
Cris 8f81426fa4 Corrected error when using alertMultiple and handleSystemMessage 2024-02-13 14:54:42 +01:00
Cris 6140e15139 Removed unused tabulatorAdditionalColumns property. Instead additional cols like 'action buttons' are now checked by index. 2024-02-13 14:53:01 +01:00
Cris acb29c5c69 Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software
# Conflicts:
#	application/views/templates/FHC-Footer.php
#	composer.json
#	public/js/components/Bootstrap/Modal.js
#	public/js/components/filter/Filter.js
#	public/js/plugin/FhcAlert.js
2024-02-13 11:54:55 +01:00
Cris 91f43665fd Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-02-13 10:54:14 +01:00
Cris 7e14fff7f3 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-01-30 17:18:55 +01:00
Cris af010a51e9 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-01-17 11:33:54 +01:00
Cris 579c1c6aff Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2024-01-15 10:28:10 +01:00
ma0068 e7703f3c9b neues Attribut abschlussbeurteilung_deutsch 2023-12-22 07:55:29 +01:00
Cris 8a29146fc2 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core 2023-12-06 14:42:45 +01:00
ma0068 9fdef54efc Funktion json2odt für newline Qualifikationsziele 2023-11-15 14:24:47 +01:00
ma0068 dc76ae8506 neue Tags addon_aktiv und lernergebnisse 2023-11-15 09:44:25 +01:00
Cris c494dd1cdc Added handleFormErrors- and resetFormErrors method to FhcAlert Plugin 2023-10-31 10:41:00 +01:00
Cris 5a002c0f04 Minor change: Adapted mail-text 2023-10-31 10:40:06 +01:00
Cris fbb00be7cd Added slot 'search' to Filterwidget.js
Slot to inject a autoselect / inputfield to search tabulator, if tabulator should stay empty until search results are provided. (Example: performance reasons if too many data; search for multiple at once)
2023-10-25 12:55:35 +02:00
Cris c6d82fe029 Minor style change of confirmDelete message 2023-10-25 12:49:37 +02:00
Cris 6b2150b066 Fixed: unknown 'fhcerror' to this 2023-10-25 12:48:00 +02:00
Cris 007ee49844 Merge branch 'feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' of https://github.com/FH-Complete/FHC-Core into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-10-24 15:51:10 +02:00
cgfhtw 22453c71b4 fhcAlert: slight improvements 2 2023-10-24 13:35:50 +02:00
cgfhtw d57fd9eb60 fhcAlert: slight improvements 2023-10-24 12:23:12 +02:00
cgfhtw b01cd99a93 Plugin: Fhc Alert 2023-10-19 14:10:55 +02:00
Cris c0b4ad2633 Merge branch 'feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' of https://github.com/FH-Complete/FHC-Core into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-10-17 11:38:29 +02:00
Cris 0f80b9d31b Added Primevue-Toast and -Confirmdialog libraries to FHC-Footer 2023-10-17 11:30:35 +02:00
KarpAlex af678b3c56 added vue datepicker to composer 2023-10-09 14:29:38 +02:00
Cris 4e11e12c99 Removed aktiv column from SoftwareManagement Filter
Not used anymore.
2023-09-21 14:40:50 +02:00
Cris fa3a718ad4 Added getAutocompleteSuggestions method to OE Model
Get OEs by eventQuery string. Use with autocomplete event queries.
2023-09-21 14:40:05 +02:00
Cris e1c23fc6fa Added Filter ImageVerwaltung 2023-08-10 11:34:54 +02:00
Cris b7a3d2dcb4 Removed column 'actions' from filtersupdate 2023-08-09 10:57:06 +02:00
Cris 49e4aa78e9 Merge branch 'feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' of https://github.com/FH-Complete/FHC-Core into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-08-09 10:43:57 +02:00
KarpAlex 4a2cdaf52a added primevue autocomplete 2023-08-04 14:46:53 +02:00
Cris 56230e3752 Changed button-color of Tabulators Header-'ADD Button' to primary color 2023-08-03 09:45:45 +02:00
Cris 4e17be39f6 Added column 'actions' to filtersupdate 2023-08-03 09:44:28 +02:00
KarpAlex 2f001987f3 Filter.js additional columns: additional columns are displayed based on field name, not title 2023-08-02 19:14:58 +02:00
KarpAlex 553f2feaa4 filter component: enabled nested tabulator 2023-08-02 16:22:10 +02:00
Cris b70011436e Added column 'softwarestatus_kurzbz' to filtersupdate 2023-08-02 13:39:47 +02:00
Cris 44182af5fa Formatted Tabulator Header: Abstaende vergroessert
Abstand Titel zu Actionbuttons und zwischen Actionbuttons untereinander vergroessert
2023-07-31 09:30:45 +02:00
Cris 1aae75312e Merge remote-tracking branch 'origin/feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-07-19 10:30:31 +02:00
KarpAlex d88ff104a3 filter component: added property tabulatorAdditionalColumns for displaying additional columns not in filter 2023-07-18 19:11:10 +02:00
ma0068 073cd6cb23 neue Tags für Anzeige Semester in Anrechnungen 2023-07-14 14:17:05 +02:00
ma0048 533291bf33 - bug fix
- neue sortierung
- neue spalte
- sqls abfragen angepasst
2023-07-11 14:17:51 +02:00
Cris 0d690b60b6 Merge remote-tracking branch 'origin/feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-07-10 11:28:31 +02:00
KarpAlex 539efcb6ec added Modal.js to Bootstrap components 2023-07-06 12:03:38 +02:00
KarpAlex ddf72af139 Merge branch 'feature-28886/Filter_Component_vs_Table_Component' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-07-04 14:43:28 +02:00
Cris 06b929381d Merge remote-tracking branch 'origin/feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software
# Conflicts:
#	system/filtersupdate.php
2023-07-04 13:48:21 +02:00
KarpAlex fc147f577a filter.js: fix for nested tabulator: set columns before set data, filtersupdate: renamed columns 2023-07-04 12:17:15 +02:00
KarpAlex 388400338e Merge branch 'feature-28886/Filter_Component_vs_Table_Component' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software 2023-07-04 12:16:06 +02:00
KarpAlex 71e86cfcde filter.js bugfixes: saving customfilter, and set columns before data (necessary e.g. for nested tabulator) 2023-07-03 11:45:15 +02:00
Cris 7356b17688 Added SW-ID column to SW-Table 2023-07-03 09:37:32 +02:00
KarpAlex f0d0c0837a added Filter for Software Management 2023-06-17 20:51:33 +02:00
ma0048 e26ba1d219 - spalte gesamtstunden erteilt hinzugefuegt 2023-06-12 09:22:32 +02:00
ma0048 afebd44b78 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core into feature-15490/lehrauftragsliste_stammkostenstelle_bei_fix_angestellten 2023-06-01 10:21:26 +02:00
ma0068 f1402c439c Adaptierungen Rahmenvertrag FHG 2023-04-12 08:15:55 +02:00
Andreas Österreicher 9d8adaba26 Ermittlung des Projektbetreuer Stundensatz an Config angepasst 2023-03-14 13:05:10 +01:00
Andreas Österreicher 1165f4407e Merge branch 'master' into feature-17727/FasDefaultStundensatzProjektbetreuungAnzeigen 2023-03-14 12:53:08 +01:00
ma0068 7a554b0d0c Adaptierung Berechnung ECTS 2023-03-10 12:49:34 +01:00
ma0068 345cc6cf83 Adaptierung Attribut studPlan 2023-03-09 08:19:05 +01:00
ma0068 eee4faa241 Adaptierungen Matr_nr als zusätzliches Feld, LVS statt ALVS, Herausfiltern von nicht studienplanrelevanten LVs 2023-03-07 17:47:40 +01:00
ma0068 83896113d8 Anpassungen rdf diplomasupplement 2023-03-06 15:02:44 +01:00
ma0048 75f8c4e909 Merge branch 'master' of https://github.com/FH-Complete/FHC-Core into feature-15490/lehrauftragsliste_stammkostenstelle_bei_fix_angestellten 2022-11-15 15:09:29 +01:00
ma0048 c3ff32a9d6 - unterschiedliche farbmarkierungen hinzugefuegt 2022-11-07 11:16:27 +01:00
ma0048 592fd7ac10 Merge remote-tracking branch 'origin/master' into feature-15490/lehrauftragsliste_stammkostenstelle_bei_fix_angestellten 2022-11-04 10:49:27 +01:00
ma0068 d7897d7129 Merge branch 'master' into feature-17727/FasDefaultStundensatzProjektbetreuungAnzeigen 2022-11-02 16:18:23 +01:00
ma0068 d2e0f34d9e Reset Defaulstundensatz bei Neuanlage Projektbetreuer 2022-05-07 12:02:51 +02:00
ma0068 bdee476a74 Adaptierungen Stundensatz: Aktualisierung Anzeige Defaultstundensatz, Zuordnung externe Betreuer 2022-05-02 11:53:14 +02:00
ma0068 9dbf59d1a1 Adaptierungen Codesniffer 2022-04-26 12:27:58 +02:00
ma0068 a4378b4592 Add Default Stundensatz 2022-04-26 09:48:22 +02:00
ma0048 4101929cd5 stammkostenstelle anzeigen bei fixangestellten / fallback falls keine eingetragen ist 2021-10-15 12:57:18 +02:00
130 changed files with 8524 additions and 2815 deletions
+3
View File
@@ -21,3 +21,6 @@ $config['grades_blocking_application'] = array(
$config['fbl'] = FALSE;
//Enables Info Mails
$config['send_mail'] = TRUE;
// Display fields to explain equivalence of ECTS and LV-Inhalte
$config['explain_equivalence'] = TRUE;
+36
View File
@@ -0,0 +1,36 @@
<?php
/**
* Copyright (C) 2023 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['migratecontract_oe_default'] = 'TODO_OE_DEFAULT';
$config['migratecontract_matching_ba1_vertragsart'] = array(
'101'=>'dvbund',
'102'=>'dvanderengk',
'103'=>'echterdv',
'104'=>'studentischehilfskr',
'105'=>'externerlehrender',
'106'=>'dvanderenbet',
'107'=>'werkvertrag',
'108'=>'studentischehilfskr',
'109'=>'ueberlassungsvertrag',
'110'=>'echterfreier',
'111'=>'echterdv' //All-In
);
@@ -0,0 +1,163 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (FAS) and the AntragLib (back-end)
* This controller works with calls on the HTTP GET or POST and the output is always RDF
*/
class Wiederholung extends Auth_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct([
'getLvs' => ['student/studierendenantrag:r', 'student/noten:r'],
'moveLvsToZeugnis' => ['student/studierendenantrag:w', 'student/noten:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getLvs($prestudent_id)
{
// header für no cache
$this->output->set_header("Cache-Control: no-cache");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Pragma: no-cache");
$this->output->set_header("Content-type: application/xhtml+xml");
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$sem_akt = $this->variablelib->getVar('semester_aktuell');
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $sem_akt);
if (isError($result))
return $result;
$lvs = $result->retval;
$rdf_url = 'http://www.technikum-wien.at/antragnote';
$this->load->view('lehre/Antrag/Wiederholung/getLvs.rdf.php', [
'url' => $rdf_url,
'lvs' => $lvs
]);
}
public function moveLvsToZeugnis()
{
$anzahl = $this->input->post('anzahl');
$student_uid = $this->input->post('student_uid');
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$errormsg = array();
for($i=0; $i<$anzahl; $i++)
{
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id_' . $i);
$result =$this->StudierendenantraglehrveranstaltungModel->load($id);
if(isError($result))
{
$errormsg[] = getError($result);
}
elseif(!hasData($result))
{
$errormsg[] = $this->p->t('studierendenantrag', 'error_no_lv_in_application');
}
else
{
$antragLv = getData($result)[0];
$result= $this->ZeugnisnoteModel->load([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
]);
if(isError($result))
{
$errormsg[] = getError($result);
}
else
{
if (hasData($result))
{
$result = $this->ZeugnisnoteModel->update(
[
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
],
[
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'updateamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'updatevon'=>getAuthUID()
]
);
}
else
{
$result = $this->ZeugnisnoteModel->insert([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz,
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'insertamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'insertvon'=>getAuthUID()
]);
}
if(isError($result))
{
$errormsg[] = getError($result);
}
}
}
}
if($errormsg)
$return = false;
else
$return = true;
$this->load->view('lehre/Antrag/Wiederholung/moveLvs.rdf.php', [
'return' => $return,
'errormsg' => $errormsg
]);
}
}
@@ -0,0 +1,231 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the FilterCmptLib (back-end)
* Provides data to the ajax get calls about the filter component
* Listens to ajax post calls to change the filter data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Filter extends FHCAPI_Controller
{
const FILTER_UNIQUE_ID = 'filterUniqueId'; // Name of the filter cmpt unique id (mandatory)
const FILTER_TYPE = 'filterType'; // The filter type (PHP filter definition) used (mandatory)
const FILTER_ID = 'filterId'; // The id of the used filter (optional)
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
// NOTE: FilterCmpt has its own permissions checks
parent::__construct([
'getFilter' => self::PERM_LOGGED,
'removeFilterField' => self::PERM_LOGGED,
'addFilterField' => self::PERM_LOGGED,
'applyFilterFields' => self::PERM_LOGGED,
'removeCustomFilter' => self::PERM_LOGGED,
'saveCustomFilter' => self::PERM_LOGGED,
'reloadDataset' => self::PERM_LOGGED
]);
// Loads the FiltersModel
$this->load->model('system/Filters_model', 'FiltersModel');
// Loads the FilterCmptLib with HTTP GET/POST parameters
$this->_startFilterCmptLib();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data about the current filter from the session and will be written on the output in JSON format
*/
public function getFilter()
{
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$session = $this->filtercmptlib->getSession();
if (is_object($session)) {
// If stdClass it is an retval object
$session = $this->getDataOrTerminateWithError($session);
}
$this->terminateWithSuccess($session);
}
/**
* Remove an applied filter (SQL where condition) from the current filter
*/
public function removeFilterField()
{
$this->form_validation->set_rules('filterField', 'filterField', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->removeFilterField($this->input->post('filterField'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Field removed');
}
/**
* Add a filter (SQL where clause) to be applied to the current filter
*/
public function addFilterField()
{
$this->form_validation->set_rules('filterField', 'filterField', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->addFilterField($this->input->post('filterField'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Field added');
}
/**
* Apply the filter changes
*/
public function applyFilterFields()
{
$this->form_validation->set_rules('filterFields', 'filterFields', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->applyFilterFields($this->input->post('filterFields'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Applied');
}
/**
* Save the current filter as a custom filter for this user with the given description
*/
public function saveCustomFilter()
{
$this->form_validation->set_rules('customFilterName', 'customFilterName', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->saveCustomFilter($this->input->post('customFilterName'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Saved');
}
/**
* Remove a custom filter by its filterId
*/
public function removeCustomFilter()
{
$this->form_validation->set_rules('filterId', 'filterId', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->removeCustomFilter($this->input->post('filterId'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Removed');
}
/**
* Reloads the dataset
*/
public function reloadDataset()
{
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$this->filtercmptlib->reloadDataset();
$this->terminateWithSuccess('Success');
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter
* If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _startFilterCmptLib()
{
$filterUniqueId = null;
$filterType = null;
$filterId = null;
$validations = [
[
'field' => self::FILTER_UNIQUE_ID,
'label' => self::FILTER_UNIQUE_ID,
'rules' => 'required'
],
[
'field' => self::FILTER_TYPE,
'label' => self::FILTER_TYPE,
'rules' => 'required'
],
];
$this->load->library('form_validation');
if ($this->input->method() == 'get')
$this->form_validation->set_data($this->input->get());
$this->form_validation->set_rules($validations);
if ($this->form_validation->run()) {
$filterUniqueId = $this->input->post_get(self::FILTER_UNIQUE_ID);
$filterType = $this->input->post_get(self::FILTER_TYPE);
$filterId = $this->input->post_get(self::FILTER_ID);
// Loads the FilterCmptLib that contains all the used logic
$this->load->library(
'FilterCmptLib',
array(
'filterUniqueId' => $filterUniqueId,
'filterType' => $filterType,
'filterId' => $filterId
)
);
// Start the component
$this->filtercmptlib->start();
}
}
}
@@ -0,0 +1,101 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the NavigationLib (back-end)
* Provides data to the ajax get calls about the filter
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Navigation extends FHCAPI_Controller
{
const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name
/**
* Loads the NavigationLib where the used logic lies
*/
public function __construct()
{
parent::__construct([
'menu' => self::PERM_LOGGED,
'header' => self::PERM_LOGGED
]);
$this->_loadNavigationLib(); // Loads the NavigationLib with parameters
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* This function creates the left Menu for each Page
* @param NAVIGATION_PAGE_PARAM GET Parameter witch holds the currently called Page
* @return JSON object with the Menu Entries
*/
public function menu()
{
$menuArray = $this->navigationlib->getMenuArray($this->input->get(self::NAVIGATION_PAGE_PARAM));
$this->terminateWithSuccess($menuArray);
}
/**
* This function creates the Top Menu for each Page
* @param NAVIGATION_PAGE_PARAM GET Parameter witch holds the currently called Page
* @return JSON object with the Menu Entries
*/
public function header()
{
$headerArray = $this->navigationlib->getHeaderArray($this->input->get(self::NAVIGATION_PAGE_PARAM));
$this->terminateWithSuccess($headerArray);
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the NavigationLib with the NAVIGATION_PAGE_PARAM parameter
* If the parameter NAVIGATION_PAGE_PARAM is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _loadNavigationLib()
{
// If the parameter NAVIGATION_PAGE_PARAM is present in the HTTP GET or POST
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]) || isset($_POST[self::NAVIGATION_PAGE_PARAM]))
{
// If it is present in the HTTP GET
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]))
{
$navigationPage = $this->input->get(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP GET
}
elseif (isset($_POST[self::NAVIGATION_PAGE_PARAM])) // Else if it is present in the HTTP POST
{
$navigationPage = $this->input->post(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP POST
}
// Loads the NavigationLib that contains all the used logic
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE_PARAM => $navigationPage));
}
else // Otherwise an error will be written in the output
{
show_error('Parameter "' . self::NAVIGATION_PAGE_PARAM . '" not provided!');
}
}
}
@@ -0,0 +1,46 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the PhrasesLib (back-end)
* Provides data to the ajax get calls about the Phrasen plugin
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Phrasen extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'loadModule' => self::PERM_ANONYMOUS
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @param string $module
*/
public function loadModule($module)
{
$this->load->library('PhrasesLib', [$module], 'pj');
$this->terminateWithSuccess(json_decode($this->pj->getJSON()));
}
}
@@ -0,0 +1,69 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
* Provides data to the ajax get calls about the searchbar component
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Searchbar extends FHCAPI_Controller
{
const SEARCHSTR_PARAM = 'searchstr';
const TYPES_PARAM = 'types';
/**
* Object initialization
*/
public function __construct()
{
// NOTE(chris): additional permission checks will be done in SearchBarLib
parent::__construct([
'search' => self::PERM_LOGGED
]);
// Load the library SearchBarLib
$this->load->library('SearchBarLib');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function search()
{
$this->load->library('form_validation');
// Checks if the searchstr and the types parameters are in the POSTed JSON
$this->form_validation->set_rules(self::SEARCHSTR_PARAM, null, 'required');
$this->form_validation->set_rules(self::TYPES_PARAM . '[]', null, 'required');
if (!$this->form_validation->run())
$this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL);
// Convert to json the result from searchbarlib->search
$result = $this->searchbarlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
if (property_exists($result, 'error'))
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess($result);
}
}
@@ -0,0 +1,387 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
use \DateTime as DateTime;
class BetriebsmittelP extends FHCAPI_Controller
{
private $person_id = null;
public function __construct()
{
parent::__construct([
'getAllBetriebsmittel' => ['admin:r', 'assistenz:r'],
'addNewBetriebsmittel' => self::PERM_LOGGED,
'updateBetriebsmittel' => self::PERM_LOGGED,
'loadBetriebsmittel' => ['admin:r', 'assistenz:r'],
'deleteBetriebsmittel' => self::PERM_LOGGED,
'getTypenBetriebsmittel' => ['admin:r', 'assistenz:r'],
'loadInventarliste' => ['admin:r', 'assistenz:r']
]);
//Load Models
$this->load->model('ressource/Betriebsmittel_model', 'BetriebsmittelModel');
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
// Additional Permission Checks
if ($this->router->method == 'addNewBetriebsmittel') {
$this->person_id = current(array_slice($this->uri->rsegments, 2));
$this->checkPermissionsForPerson(
$this->person_id,
['admin:rw', 'mitarbeiter:rw', 'basis/betriebsmittel:rw'],
['admin:rw', 'assistenz:rw', 'basis/betriebsmittel:rw']
);
} elseif ($this->router->method == 'updateBetriebsmittel' || $this->router->method == 'deleteBetriebsmittel') {
$betriebsmittelperson_id = current(array_slice($this->uri->rsegments, 2));
$result = $this->BetriebsmittelpersonModel->load($betriebsmittelperson_id);
if (!hasData($result))
show_404();
$this->person_id = current(getData($result))->person_id;
$this->checkPermissionsForPerson(
$this->person_id,
['admin:rw', 'mitarbeiter:rw', 'basis/betriebsmittel:rw'],
['admin:rw', 'assistenz:rw', 'basis/betriebsmittel:rw']
);
}
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$this->load->library('form_validation');
// Load language phrases
$this->loadPhrases([
'ui',
'wawi'
]);
}
public function getAllBetriebsmittel($type_id, $id)
{
$result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($id, $type_id);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
protected function validateNewOrUpdate()
{
$this->form_validation->set_rules('betriebsmitteltyp', 'Typ', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired')
]);
$this->form_validation->set_rules('kaution', 'Kaution', 'numeric|less_than_equal_to[9999.99]', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric')
]);
$this->form_validation->set_rules('ausgegebenam', 'Ausgegeben am', 'required|is_valid_date', [
'required' => $this->p->t('ui', 'error_fieldRequired')
]);
if ($this->input->post('ausgegebenam') && $this->input->post('retouram')) {
$this->form_validation->set_rules('retouram', 'Retour am', [
'is_valid_date',
['is_not_before_ausgegebenam', function ($value) {
return (new DateTime($value) >= new DateTime($this->input->post('ausgegebenam')));
}]
], [
'is_not_before_ausgegebenam' => $this->p->t('wawi', 'error_retourdatumVorAusgabe')
]);
} else {
$this->form_validation->set_rules('retouram', 'Retour am', 'is_valid_date');
}
$this->form_validation->set_rules('anmerkung', 'Anmerkung', 'max_length[256]');
if ($this->input->post('betriebsmitteltyp') == 'Inventar') {
// Inventar
$this->form_validation->set_rules('betriebsmittel_id', 'Inventarnummer', 'required');
} elseif ($this->input->post('betriebsmitteltyp') == 'Zutrittskarte') {
// Zutrittskarte
if ($this->input->post('nummer') === null && $this->input->post('nummer') === null) {
$this->form_validation->set_rules('nummer', 'Nummer', 'required', [
'required' => $this->p->t('wawi', 'error_zutrittskarteOhneNummer')
]);
$this->form_validation->set_rules('nummer2', 'Nummer2', 'required', [
'required' => $this->p->t('wawi', 'error_zutrittskarteOhneNummer')
]);
} else {
if ($this->input->post('nummer') === null) {
$result = $this->BetriebsmittelpersonModel->loadViewWhere([
'betriebsmitteltyp' => $this->input->post('betriebsmitteltyp'),
'nummer2' => $this->input->post('nummer2'),
'person_id !=' => $this->person_id,
'retouram IS NULL' => null
]);
if (hasData($result))
$this->form_validation->set_rules('nummer2', 'Nummer2', 'is_array', [
'is_array' => $this->p->t('wawi', 'error_bmZutrittskarteOccupied', (array)current(getData($result)))
]);
} else {
$result = $this->BetriebsmittelpersonModel->loadViewWhere([
'betriebsmitteltyp' => $this->input->post('betriebsmitteltyp'),
'nummer' => $this->input->post('nummer'),
'person_id !=' => $this->person_id,
'retouram IS NULL' => null
]);
if (hasData($result))
$this->form_validation->set_rules('nummer', 'Nummer', 'is_array', [
'is_array' => $this->p->t('wawi', 'error_bmZutrittskarteOccupied', (array)current(getData($result)))
]);
}
}
}
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
public function addNewBetriebsmittel($person_id)
{
$this->form_validation->set_rules('uid', 'UID', [
['uid_in_person', function ($value) use ($person_id) {
if ($value === null)
return true;
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$result = $this->BenutzerModel->loadWhere([
'uid' => $value,
'person_id' => $person_id
]);
return hasData($result);
}]
], [
'uid_in_person' => $this->p->t('person', 'error_uidNotInPerson')
]);
$this->validateNewOrUpdate();
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');
$nummer = $this->input->post('nummer');
$nummer2 = $this->input->post('nummer2');
$beschreibung = $this->input->post('beschreibung');
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
$anmerkung = $this->input->post('anmerkung');
$kaution = $this->input->post('kaution');
$ausgegebenam = $this->input->post('ausgegebenam');
$retouram = $this->input->post('retouram');
$uid = $this->input->post('uid');
// NOTE(chris): transform_kartennummer
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer)
$nummer = is_numeric($nummer) ? ltrim($nummer, "0") : hexdec(implode("", array_reverse(str_split(trim($nummer)))));
$this->db->trans_start();
if ($betriebsmitteltyp != 'Inventar') {
$this->BetriebsmittelModel->addOrder('updateamum', 'DESC');
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer === null) {
$result = $this->BetriebsmittelModel->loadWhere([
'betriebsmitteltyp' => $betriebsmitteltyp,
'nummer2' => $nummer2
]);
} else {
$result = $this->BetriebsmittelModel->loadWhere([
'betriebsmitteltyp' => $betriebsmitteltyp,
'nummer' => $nummer
]);
}
$data = $this->getDataOrTerminateWithError($result);
if ($data) {
$data = current($data);
if ($data->nummer !== $nummer || $data->nummer2 !== $nummer2 || $data->beschreibung !== $beschreibung) {
$result = $this->BetriebsmittelModel->update($data->betriebsmittel_id, [
'nummer' => $nummer,
'nummer2' => $nummer2,
'beschreibung' => $beschreibung,
'updateamum' => date('c'),
'updatevon' => getAuthUID()
]);
$this->getDataOrTerminateWithError($result);
}
$betriebsmittel_id = $data->betriebsmittel_id;
} else {
$result = $this->BetriebsmittelModel->insert([
'betriebsmitteltyp' => $betriebsmitteltyp,
'nummer' => $nummer,
'nummer2' => $nummer2,
'beschreibung' => $beschreibung,
'reservieren' => false,
'ort_kurzbz' => null,
'insertamum' => date('c'),
'insertvon' => getAuthUID(),
]);
$betriebsmittel_id = $this->getDataOrTerminateWithError($result);
}
}
$result = $this->BetriebsmittelpersonModel->insert([
'person_id' => $person_id,
'betriebsmittel_id' => $betriebsmittel_id,
'anmerkung' => $anmerkung,
'kaution' => $kaution,
'ausgegebenam' => $ausgegebenam,
'retouram' => $retouram,
'uid' => $uid,
'insertamum' => date('c'),
'insertvon' => getAuthUID()
]);
$data = $this->getDataOrTerminateWithError($result);
$this->db->trans_complete();
$this->terminateWithSuccess(true);
}
public function updateBetriebsmittel($betriebsmittelperson_id)
{
$this->validateNewOrUpdate();
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');
$nummer = $this->input->post('nummer');
$nummer2 = $this->input->post('nummer2');
$beschreibung = $this->input->post('beschreibung');
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
$anmerkung = $this->input->post('anmerkung');
$kaution = $this->input->post('kaution');
$ausgegebenam = $this->input->post('ausgegebenam');
$retouram = $this->input->post('retouram');
// NOTE(chris): transform_kartennummer
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer)
$nummer = is_numeric($nummer) ? ltrim($nummer, "0") : hexdec(implode("", array_reverse(str_split(trim($nummer)))));
$this->db->trans_start();
if ($betriebsmitteltyp != 'Inventar') {
$found = false;
if ($nummer !== null && $betriebsmittel_id !== null) {
$result = $this->BetriebsmittelModel->load($betriebsmittel_id);
$data = $this->getDataOrTerminateWithError($result);
if ($data && current($data)->nummer == $nummer) {
$found = true;
}
}
if (!$found) {
$this->BetriebsmittelModel->addOrder('updateamum', 'DESC');
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer === null) {
$result = $this->BetriebsmittelModel->loadWhere([
'betriebsmitteltyp' => $betriebsmitteltyp,
'nummer2' => $nummer2
]);
} else {
$result = $this->BetriebsmittelModel->loadWhere([
'betriebsmitteltyp' => $betriebsmitteltyp,
'nummer' => $nummer
]);
}
$data = $this->getDataOrTerminateWithError($result);
}
if ($data) {
$data = current($data);
if ($data->nummer !== $nummer || $data->nummer2 !== $nummer2 || $data->beschreibung !== $beschreibung) {
$result = $this->BetriebsmittelModel->update($data->betriebsmittel_id, [
'nummer' => $nummer,
'nummer2' => $nummer2,
'beschreibung' => $beschreibung,
'updateamum' => date('c'),
'updatevon' => getAuthUID()
]);
$this->getDataOrTerminateWithError($result);
}
$betriebsmittel_id = $data->betriebsmittel_id;
} else {
$result = $this->BetriebsmittelModel->insert([
'betriebsmitteltyp' => $betriebsmitteltyp,
'nummer' => $nummer,
'nummer2' => $nummer2,
'beschreibung' => $beschreibung,
'reservieren' => false,
'ort_kurzbz' => null,
'insertamum' => date('c'),
'insertvon' => getAuthUID(),
]);
$betriebsmittel_id = $this->getDataOrTerminateWithError($result);
}
}
$result = $this->BetriebsmittelpersonModel->update($betriebsmittelperson_id, [
'betriebsmittel_id' => $betriebsmittel_id,
'anmerkung' => $anmerkung,
'kaution' => $kaution,
'ausgegebenam' => $ausgegebenam,
'retouram' => $retouram,
'updateamum' => date('c'),
'updatevon' => getAuthUID()
]);
$data = $this->getDataOrTerminateWithError($result);
$this->db->trans_complete();
$this->terminateWithSuccess(true);
}
public function loadBetriebsmittel($betriebsmittelperson_id)
{
$result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($betriebsmittelperson_id, 'betriebsmittelperson_id');
if (isError($result)) {
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
if (!hasData($result)) {
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Betriebsmittelperson_id']), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess(current(getData($result)));
}
public function deleteBetriebsmittel($betriebsmittelperson_id)
{
$result = $this->BetriebsmittelpersonModel->delete(
array('betriebsmittelperson_id' => $betriebsmittelperson_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' => 'Betriebsmittelperson_id']), self::ERROR_TYPE_GENERAL);
}
return $this->outputJsonSuccess(current(getData($result)));
}
public function getTypenBetriebsmittel()
{
$this->load->model('ressource/Betriebsmitteltyp_model', 'BetriebsmitteltypModel');
$this->BetriebsmitteltypModel->addOrder('beschreibung', 'ASC');
$result = $this->BetriebsmitteltypModel->load(); // load All
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
return $this->terminateWithSuccess(getData($result) ?: []);
}
public function loadInventarliste($searchString)
{
$result = $this->BetriebsmittelModel->loadInventarliste($searchString);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -0,0 +1,187 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \REST_Controller as REST_Controller;
use \Studierendenantrag_model as Studierendenantrag_model;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Abmeldung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the AntragLib
*/
public function __construct()
{
parent::__construct([
'getDetailsForNewAntrag' => self::PERM_LOGGED,
'getDetailsForAntrag' => self::PERM_LOGGED,
'createAntrag' => self::PERM_LOGGED,
'cancelAntrag' => self::PERM_LOGGED
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, true))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_student'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -3) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_stg_blacklist'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -1) {
$result = $this->antraglib->getDetailsForLastAntrag(
$prestudent_id,
[
Studierendenantrag_model::TYP_ABMELDUNG,
Studierendenantrag_model::TYP_ABMELDUNG_STGL
]
);
$data = $this->getDataOrTerminateWithError($result);
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
$this->terminateWithSuccess($data);
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function getDetailsForAntrag($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id))
return show_404();
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
$data = $this->getDataOrTerminateWithError($result);
if ($data->typ !== Studierendenantrag_model::TYP_ABMELDUNG_STGL && $data->typ !== Studierendenantrag_model::TYP_ABMELDUNG)
return show_404();
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
$this->terminateWithSuccess($data);
}
public function createAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('grund', 'Grund', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$grund = $this->input->post('grund');
$studiensemester = $this->input->post('studiensemester');
$prestudent_id = $this->input->post('prestudent_id');
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
elseif ($result == -3)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
elseif ($result < 0)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
$result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund);
$data = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($data);
if (!hasData($result))
return $this->terminateWithSuccess(true);
$data = getData($result);
$data->canCancel = (boolean)$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id);
$this->terminateWithSuccess($data);
}
public function cancelAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$antrag_id = $this->input->post('antrag_id');
if (!$this->antraglib->isEntitledToCancelAntrag($antrag_id))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
if (!hasData($result))
$this->terminateWithSuccess($antrag_id);
$data = getData($result);
$this->terminateWithSuccess($data);
}
}
@@ -0,0 +1,428 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \stdClass as stdClass;
use \Studierendenantrag_model as Studierendenantrag_model;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Leitung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the AntragLib
*/
public function __construct()
{
parent::__construct([
'getActiveStgs' => ['student/antragfreigabe:r', 'student/studierendenantrag:r'],
'getAntraege' => ['student/antragfreigabe:r', 'student/studierendenantrag:r'],
'getHistory' => ['student/antragfreigabe:r', 'student/studierendenantrag:r'],
'getPrestudents' => 'student/studierendenantrag:w',
'approveAntrag' => 'student/antragfreigabe:w',
'rejectAntrag' => 'student/antragfreigabe:w',
'reopenAntrag' => 'student/studierendenantrag:w',
'pauseAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'unpauseAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'objectAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'approveObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'denyObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getActiveStgs()
{
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe') ?: [];
$studiengaenge = array_merge($studiengaenge, $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: []);
$result = $this->StudierendenantragModel->loadStgsWithAntraege($studiengaenge);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function getAntraege($studiengang = null, $extra = null)
{
if ($studiengang && $studiengang == 'todo') {
$studiengang = $extra;
$extra = true;
} else {
$extra = false;
}
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe');
if(!is_array($studiengaenge))
$studiengaenge = [];
$stgsNeuanlage = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
if(!is_array($stgsNeuanlage))
$stgsNeuanlage = [];
$studiengaenge = array_unique(array_merge($studiengaenge, $stgsNeuanlage));
if ($studiengang) {
if (!in_array($studiengang, $studiengaenge))
$this->terminateWithError(
'Forbidden',
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
$studiengaenge = [$studiengang];
}
$antraege = [];
if ($studiengaenge) {
$result = $extra
? $this->StudierendenantragModel->loadActiveForStudiengaenge($studiengaenge)
: $this->StudierendenantragModel->loadForStudiengaenge($studiengaenge);
$antraege = $this->getDataOrTerminateWithError($result);
}
$this->terminateWithSuccess($antraege ?: []);
}
public function getHistory($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToSeeHistoryForAntrag($studierendenantrag_id))
$this->terminateWithError(
'Forbidden',
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
$result = $this->antraglib->getAntragHistory($studierendenantrag_id);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data ?: []);
}
public function getPrestudents()
{
$query = $this->input->post('query');
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
$result = $this->antraglib->getAktivePrestudentenInStgs($studiengaenge, $query);
$result = $this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($result ?: []);
}
public function approveAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToApproveAntrag', [$this->antraglib, 'isEntitledToApproveAntrag']],
],
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules(
'typ',
'Typ',
'required|in_list[' . implode(',', [
Studierendenantrag_model::TYP_ABMELDUNG,
Studierendenantrag_model::TYP_ABMELDUNG_STGL,
Studierendenantrag_model::TYP_UNTERBRECHUNG,
Studierendenantrag_model::TYP_WIEDERHOLUNG
]) . ']'
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
switch ($this->input->post('typ')) {
case Studierendenantrag_model::TYP_ABMELDUNG:
case Studierendenantrag_model::TYP_ABMELDUNG_STGL:
$result = $this->antraglib->approveAbmeldung([$studierendenantrag_id], getAuthUID());
break;
case Studierendenantrag_model::TYP_UNTERBRECHUNG:
$result = $this->antraglib->approveUnterbrechung([$studierendenantrag_id], getAuthUID());
break;
case Studierendenantrag_model::TYP_WIEDERHOLUNG:
$result = $this->antraglib->approveWiederholung($studierendenantrag_id, getAuthUID());
break;
}
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function rejectAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToRejectAntrag', [$this->antraglib, 'isEntitledToRejectAntrag']],
],
[
'isEntitledToRejectAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules('grund', 'Grund', 'required');
$this->form_validation->set_rules(
'typ',
'Typ',
'required|in_list[' . implode(',', [
Studierendenantrag_model::TYP_UNTERBRECHUNG
]) . ']'
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->rejectUnterbrechung([$studierendenantrag_id], getAuthUID(), $grund);
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function reopenAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToReopenAntrag', [$this->antraglib, 'isEntitledToReopenAntrag']],
],
[
'isEntitledToReopenAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules(
'typ',
'Typ',
'required|in_list[' . implode(',', [
Studierendenantrag_model::TYP_WIEDERHOLUNG
]) . ']'
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->reopenWiederholung($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function pauseAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToPauseAntrag', [$this->antraglib, 'isEntitledToPauseAntrag']],
['antragCanBeManualPaused', [$this->antraglib, 'antragCanBeManualPaused']]
],
[
'isEntitledToPauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualPaused' => $this->p->t(
'studierendenantrag',
'error_not_pauseable',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->pauseAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function unpauseAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToUnpauseAntrag', [$this->antraglib, 'isEntitledToUnpauseAntrag']],
['antragCanBeManualUnpaused', [$this->antraglib, 'antragCanBeManualUnpaused']]
],
[
'isEntitledToUnpauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualUnpaused' => $this->p->t(
'studierendenantrag',
'error_not_paused',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->unpauseAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function objectAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToObjectAntrag', [$this->antraglib, 'isEntitledToObjectAntrag']],
['canBeObjected', function ($a) {
return $this->antraglib->hasType($a, Studierendenantrag_model::TYP_ABMELDUNG_STGL);
}]
],
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'canBeObjected' => $this->p->t(
'studierendenantrag',
'error_no_objection'
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->objectAbmeldung($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function approveObjection()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToObjectAntrag', [$this->antraglib, 'isEntitledToObjectAntrag']],
['isObjected', function ($a) {
return $this->antraglib->hasStatus($a, Studierendenantragstatus_model::STATUS_OBJECTED);
}]
],
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t(
'studierendenantrag',
'error_not_objected'
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->cancelAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function denyObjection()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToObjectAntrag', [$this->antraglib, 'isEntitledToObjectAntrag']],
['isObjected', function ($a) {
return $this->antraglib->hasStatus($a, Studierendenantragstatus_model::STATUS_OBJECTED);
}]
],
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t(
'studierendenantrag',
'error_not_objected'
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID(), $grund);
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
}
@@ -1,4 +1,20 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
@@ -6,23 +22,28 @@ use \Studierendenantrag_model as Studierendenantrag_model;
use \DateTime as DateTime;
/**
*
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Unterbrechung extends FHC_Controller
class Unterbrechung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
* Calls the parent's constructor and loads the AntragLib
*/
public function __construct()
{
parent::__construct();
parent::__construct([
'getDetailsForNewAntrag' => self::PERM_LOGGED,
'getDetailsForAntrag' => self::PERM_LOGGED,
'createAntrag' => self::PERM_LOGGED,
'cancelAntrag' => self::PERM_LOGGED
]);
// Configs
$this->load->config('studierendenantrag');
// Libraries
$this->load->library('AuthLib');
$this->load->library('AntragLib');
// Load language phrases
@@ -38,74 +59,62 @@ class Unterbrechung extends FHC_Controller
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false)) {
$this->output->set_status_header(403);
return $this->outputJsonError('Forbidden');
}
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($prestudent_id);
if (isError($result)) {
$this->output->set_status_header(500);
return $this->outputJsonError(getError($result));
}
$result = $result->retval;
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student'));
}
elseif ($result == -1)
{
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_student'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -1) {
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_UNTERBRECHUNG);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = $this->getDataOrTerminateWithError($result);
return $this->outputJsonSuccess(getData($result));
}
elseif ($result == -2)
{
return $this->terminateWithSuccess($data);
} elseif ($result == -2) {
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$result = getData($result);
$this->output->set_status_header(400);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_pending', [
$data = $this->getDataOrTerminateWithError($result);
return $this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_pending', [
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
]));
}
elseif ($result == -3)
{
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
} elseif ($result == -3) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_stg_blacklist'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
}
$data = getData($result);
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$data->studiensemester = $this->antraglib->getSemesterForUnterbrechung($prestudent_id, null);
$this->outputJsonSuccess($data);
$this->terminateWithSuccess($data);
}
public function getDetailsForAntrag($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id)) return show_404();
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id))
return show_404();
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$data = $this->getDataOrTerminateWithError($result);
if ($data->typ !== Studierendenantrag_model::TYP_UNTERBRECHUNG)
return show_404();
$this->outputJsonSuccess($data);
$this->terminateWithSuccess($data);
}
public function createAntrag()
@@ -125,9 +134,8 @@ class Unterbrechung extends FHC_Controller
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
if (!$this->form_validation->run()) {
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$grund = $this->input->post('grund');
@@ -137,25 +145,17 @@ class Unterbrechung extends FHC_Controller
$dms_id = null;
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($prestudent_id, $studiensemester, $datum_wiedereinstieg);
if (isError($result)) {
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $result->retval;
if (!$result)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -3)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
}
elseif ($result < 0)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
}
if(isset($_FILES['attachment']) && (!isset($_FILES['attachment']['error']) || $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE))
{
$result = $this->getDataOrTerminateWithError($result);
if (!$result)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
elseif ($result == -3)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
elseif ($result < 0)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
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');
@@ -167,53 +167,46 @@ class Unterbrechung extends FHC_Controller
$allowed_filetypes = $this->config->item('unterbrechung_dms_filetypes') ?: ['*'];
$result = $this->dmslib->upload($dms, 'attachment', $allowed_filetypes);
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$dms_id = getData($result)['dms_id'];
$data = $this->getDataOrTerminateWithError($result);
$dms_id = $data['dms_id'];
}
$result = $this->antraglib->createUnterbrechung($prestudent_id, $studiensemester, getAuthUID(), $grund, $datum_wiedereinstieg, $dms_id);
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$antragId = getData($result);
$antragId = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($antragId);
if(!hasData($result))
return $this->outputJsonSuccess($antragId);
$this->outputJsonSuccess(getData($result));
if (!hasData($result))
$this->terminateWithSuccess($antragId);
$this->terminateWithSuccess(getData($result));
}
public function cancelAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
if (!$this->form_validation->run()) {
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$antrag_id = $this->input->post('antrag_id');
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
if (!hasData($result))
return $this->outputJsonSuccess($antrag_id);
$this->outputJsonSuccess(getData($result));
return $this->terminateWithSuccess($antrag_id);
$this->terminateWithSuccess(getData($result));
}
public function isValidDate($date)
@@ -0,0 +1,258 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \REST_Controller as REST_Controller;
use \Studierendenantragstatus_model as Studierendenantragstatus_model;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Wiederholung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct([
'getDetailsForNewAntrag' => self::PERM_LOGGED,
'createAntrag' => self::PERM_LOGGED,
'cancelAntrag' => self::PERM_LOGGED,
'getLvs' => self::PERM_LOGGED,
'saveLvs' => ['student/studierendenantrag:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_student_no_failed_exam'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -1) {
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_WIEDERHOLUNG);
$data = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id, $data->datum, $data->studiensemester_kurzbz);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->terminateWithSuccess($data);
} elseif ($result == -2) {
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_antrag_pending', [
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
]),
self::ERROR_TYPE_GENERAL,
REST_Controller::HTTP_BAD_REQUEST
);
} elseif ($result == -3) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_stg_blacklist'),
self::ERROR_TYPE_GENERAL,
REST_Controller::HTTP_BAD_REQUEST
);
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->terminateWithSuccess($data);
}
public function createAntrag()
{
$this->createAntragWithStatus(true);
}
public function cancelAntrag()
{
$this->createAntragWithStatus(false);
}
protected function createAntragWithStatus($repeat)
{
$this->load->library('form_validation');
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$prestudent_id = $this->input->post('prestudent_id');
$studiensemester = $this->input->post('studiensemester');
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
} elseif ($result == -1) {
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_prestudentstatus', [
'prestudent_id' => $prestudent_id
]), self::ERROR_TYPE_GENERAL);
if (!in_array(current($result)->status_kurzbz, $this->config->item('antrag_prestudentstatus_whitelist')))
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
} elseif ($result == -2) {
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
} elseif ($result == -3) {
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
}
$result = $this->antraglib->createWiederholung($prestudent_id, $studiensemester, getAuthUID(), $repeat);
$antragId = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($antragId);
if (!hasData($result))
$this->terminateWithSuccess(true);
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->terminateWithSuccess($data);
}
public function getLvs($antrag_id)
{
$result = $this->antraglib->getLvsForAntrag($antrag_id);
if (isError($result)) {
$error = getError($result);
if ($error == 'Forbidden')
$this->terminateWithError(
$error,
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
$this->terminateWithError(
$error,
self::ERROR_TYPE_GENERAL
);
}
$lvs = getData($result);
$this->terminateWithSuccess($lvs);
}
public function saveLvs()
{
$forbiddenLvs = $this->input->post('forbiddenLvs');
$mandatoryLvs = $this->input->post('mandatoryLvs');
$antragsLvs = array_merge($forbiddenLvs, $mandatoryLvs);
if (!$antragsLvs)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_lv'), self::ERROR_TYPE_GENERAL);
$insert = array_map(function ($lv) {
return [
'studierendenantrag_id' => $lv['studierendenantrag_id'],
'lehrveranstaltung_id' => $lv['lehrveranstaltung_id'],
'note' => $lv['zugelassen']
? ($lv['zugelassen'] == 1 ? 0 : $this->config->item('wiederholung_note_angerechnet'))
: $this->config->item('wiederholung_note_nicht_zugelassen'),
'anmerkung' => $lv['anmerkung'],
'insertvon' => getAuthUID(),
'studiensemester_kurzbz' => $lv['studiensemester_kurzbz']
];
}, $antragsLvs);
$antrag_ids = array_unique(array_map(function ($lv) {
return $lv['studierendenantrag_id'];
}, $insert));
foreach ($antrag_ids as $antrag_id) {
$result = $this->StudierendenantragModel->loadIdAndStatusWhere([
'studierendenantrag_id' => $antrag_id
]);
$antrag = $this->getDataOrTerminateWithError($result);
if (!$antrag)
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $antrag_id]),
self::ERROR_TYPE_GENERAL
);
$antrag = current($antrag);
if ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED
&& $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED)
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_antrag_locked'),
self::ERROR_TYPE_GENERAL
);
}
$result = $this->antraglib->saveLvs($insert);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -1,218 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \Studierendenantrag_model as Studierendenantrag_model;
/**
*
*/
class Abmeldung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Libraries
$this->load->library('AuthLib');
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, true)) {
$this->output->set_status_header(403);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
if (isError($result)) {
$this->output->set_status_header(500);
return $this->outputJsonError(getError($result));
}
$result = $result->retval;
if (!$result) {
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student'));
}
elseif ($result == -3)
{
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
}
elseif ($result == -1)
{
$result = $this->antraglib->getDetailsForLastAntrag(
$prestudent_id,
[
Studierendenantrag_model::TYP_ABMELDUNG,
Studierendenantrag_model::TYP_ABMELDUNG_STGL
]
);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
return $this->outputJsonSuccess($data);
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$this->outputJsonSuccess(getData($result));
}
public function getDetailsForAntrag($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id)) return show_404();
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
if ($data->typ !== Studierendenantrag_model::TYP_ABMELDUNG_STGL && $data->typ !== Studierendenantrag_model::TYP_ABMELDUNG)
return show_404();
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
$this->outputJsonSuccess($data);
}
public function createAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('grund', 'Grund', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$grund = $this->input->post('grund');
$studiensemester = $this->input->post('studiensemester');
$prestudent_id = $this->input->post('prestudent_id');
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $result->retval;
if (!$result)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -3)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
}
elseif ($result < 0)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
}
$result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund);
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $this->antraglib->getDetailsForAntrag(getData($result));
if (!hasData($result))
return $this->outputJsonSuccess(true);
$data = getData($result);
$data->canCancel = (boolean)$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id);
$this->outputJsonSuccess($data);
}
public function cancelAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$antrag_id = $this->input->post('antrag_id');
if(!$this->antraglib->isEntitledToCancelAntrag($antrag_id))
{
$this->output->set_status_header(403);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
if (!hasData($result))
return $this->outputJsonSuccess($antrag_id);
$this->outputJsonSuccess(getData($result));
}
public function getStudiengaengeAssistenz()
{
$this->load->library('PermissionLib');
$_POST = json_decode($this->input->raw_input_stream, true);
$query = $this->input->post('query');
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
$result = $this->antraglib->getAktivePrestudentenInStgs($studiengaenge, $query);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$result = getData($result);
if (!$result) {
return $this->outputJsonSuccess([]);
}
return $this->outputJsonSuccess($result);
}
}
@@ -1,479 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \stdClass as stdClass;
/**
*
*/
class Leitung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Libraries
$this->load->library('AuthLib');
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getActiveStgs()
{
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe') ?: [];
$studiengaenge = array_merge($studiengaenge, $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: []);
$result = $this->StudierendenantragModel->loadStgsWithAntraege($studiengaenge);
if (isError($result)) {
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
}
$this->outputJson($result);
}
public function getAntraege($studiengang = null, $extra = null)
{
if ($studiengang && $studiengang == 'todo') {
$studiengang = $extra;
$extra = true;
} else {
$extra = false;
}
if ($studiengang) {
$studiengaenge = [$studiengang];
} else {
$studiengaenge =$this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe');
if(!is_array($studiengaenge))
$studiengaenge = [];
$stgsNeuanlage = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
if(!is_array($stgsNeuanlage))
$stgsNeuanlage = [];
$studiengaenge = array_unique(array_merge($studiengaenge, $stgsNeuanlage));
}
$antraege = [];
if ($studiengaenge) {
$result = $extra
? $this->StudierendenantragModel->loadActiveForStudiengaenge($studiengaenge)
: $this->StudierendenantragModel->loadForStudiengaenge($studiengaenge);
if (isError($result)) {
$this->output->set_status_header(500);
return $this->outputJson('Internal Server Error');
}
if(hasData($result))
{
$antraege = getData($result);
}
}
$this->outputJson($antraege);
}
public function reopenAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToReopenAntrag',
[
'isEntitledToReopenAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->reopenWiederholung($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function pauseAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
[
'isEntitledToPauseAntrag',
[$this->antraglib, 'isEntitledToPauseAntrag']
],
[
'antragCanBeManualPaused',
[$this->antraglib, 'antragCanBeManualPaused']
]
],
[
'isEntitledToPauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualPaused' => $this->p->t(
'studierendenantrag',
'error_not_pauseable',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->pauseAntrag($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function unpauseAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
[
'isEntitledToUnpauseAntrag',
[$this->antraglib, 'isEntitledToUnpauseAntrag']
],
[
'antragCanBeManualUnpaused',
[$this->antraglib, 'antragCanBeManualUnpaused']
]
],
[
'isEntitledToUnpauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualUnpaused' => $this->p->t(
'studierendenantrag',
'error_not_paused',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->unpauseAntrag($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function objectAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToObjectAntrag|callback_canBeObjected',
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'canBeObjected' => $this->p->t('studierendenantrag', 'error_no_objection')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->objectAbmeldung($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function objectionDeny()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToObjectAntrag|callback_isObjected',
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t('studierendenantrag', 'error_not_objected')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID(), $grund);
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function objectionApprove()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToObjectAntrag|callback_isObjected',
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t('studierendenantrag', 'error_not_objected')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->cancelAntrag($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function isEntitledToReopenAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToReopenAntrag($studierendenantrag_id);
}
public function isEntitledToObjectAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToObjectAntrag($studierendenantrag_id);
}
public function isEntitledToRejectAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToRejectAntrag($studierendenantrag_id);
}
public function canBeObjected($studierendenantrag_id)
{
return $this->antraglib->hasType($studierendenantrag_id, Studierendenantrag_model::TYP_ABMELDUNG_STGL);
}
public function isObjected($studierendenantrag_id)
{
return $this->antraglib->hasStatus($studierendenantrag_id, Studierendenantragstatus_model::STATUS_OBJECTED);
}
public function approveAbmeldung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToApproveAntrag',
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->approveAbmeldung([$studierendenantrag_id], getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function approveAbmeldungStgl()
{
return $this->approveAbmeldung();
}
public function approveUnterbrechung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToApproveAntrag',
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->approveUnterbrechung([$studierendenantrag_id], getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function rejectUnterbrechung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToRejectAntrag',
[
'isEntitledToRejectAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules('grund', 'Grund', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->rejectUnterbrechung([$studierendenantrag_id], getAuthUID(), $grund);
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function approveWiederholung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToApproveAntrag',
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->approveWiederholung($studierendenantrag_id, getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function isEntitledToApproveAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToApproveAntrag($studierendenantrag_id);
}
public function getHistory($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToSeeHistoryForAntrag($studierendenantrag_id)) {
$this->output->set_status_header(403);
return $this->outputJson('Forbidden');
}
$result = $this->antraglib->getAntragHistory($studierendenantrag_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$this->outputJsonSuccess(getData($result) ?: []);
}
}
@@ -1,384 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \REST_Controller as REST_Controller;
/**
*
*/
class Wiederholung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Configs
$this->load->config('studierendenantrag');
// Libraries
$this->load->library('AuthLib');
$this->load->library('PermissionLib');
$this->load->library('AntragLib');
$requiredPermissions = [
'saveLvs' => ['student/studierendenantrag:w'],
'getLvsAsRdf' => ['student/studierendenantrag:r', 'student/noten:r'],
'moveLvsToZeugnis' => ['student/studierendenantrag:w', 'student/noten:w']
];
if (isset($requiredPermissions[$this->router->method])) {
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) {
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
$this->outputJson('Forbidden');
exit;
}
}
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false)) {
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
if (isError($result)) {
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
return $this->outputJsonError(getError($result));
}
$result = $result->retval;
if (!$result) {
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student_no_failed_exam'));
}
elseif ($result == -1)
{
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_WIEDERHOLUNG);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id, $data->datum, $data->studiensemester_kurzbz);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
return $this->outputJsonSuccess($data);
}
elseif ($result == -2)
{
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$result = getData($result);
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_pending', [
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
]));
}
elseif ($result == -3)
{
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->outputJsonSuccess($data);
}
public function createAntrag()
{
$this->createAntragWithStatus(true);
}
public function cancelAntrag()
{
$this->createAntragWithStatus(false);
}
protected function createAntragWithStatus($repeat)
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$prestudent_id = $this->input->post('prestudent_id');
$studiensemester = $this->input->post('studiensemester');
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $result->retval;
if (!$result)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -1)
{
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
if (isError($result))
return $this->outputJsonError(['db' => getError($result)]);
if (!hasData($result))
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_prestudentstatus', [
'prestudent_id' => $prestudent_id
])]);
if (!in_array(current(getData($result))->status_kurzbz, $this->config->item('antrag_prestudentstatus_whitelist')))
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -2)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
}
elseif ($result == -3)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
}
$result = $this->antraglib->createWiederholung($prestudent_id, $studiensemester, getAuthUID(), $repeat);
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$antragId = getData($result);
$result = $this->antraglib->getDetailsForAntrag($antragId);
if(!hasData($result))
return $this->outputJsonSuccess(true);
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->outputJsonSuccess($data);
}
public function getLvs($antrag_id)
{
$result = $this->antraglib->getLvsForAntrag($antrag_id);
if (isError($result)) {
$error = getError($result);
if ($error == 'Forbidden')
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
return $this->outputJsonError(getError($result));
}
$lvs = getData($result);
$this->outputJsonSuccess($lvs);
}
public function saveLvs()
{
$result = $this->getPostJSON();
$antragsLvs = array_merge($result->forbiddenLvs, $result->mandatoryLvs);
$insert = array_map(function ($lv) {
return [
'studierendenantrag_id' => $lv->studierendenantrag_id,
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id,
'note' => $lv->zugelassen
? ($lv->zugelassen == 1 ? 0 : $this->config->item('wiederholung_note_angerechnet'))
: $this->config->item('wiederholung_note_nicht_zugelassen'),
'anmerkung' => $lv->anmerkung,
'insertvon' => getAuthUID(),
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz
];
}, $antragsLvs);
$antrag_ids = array_unique(array_map(function ($lv) {
return $lv['studierendenantrag_id'];
}, $insert));
foreach ($antrag_ids as $antrag_id) {
$result = $this->StudierendenantragModel->loadIdAndStatusWhere([
'studierendenantrag_id' => $antrag_id
]);
if (isError($result))
return $this->outputJsonError(getError($result));
if (!hasData($result))
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $antrag_id]));
$antrag = current(getData($result));
if ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED
&& $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED)
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_locked'));
}
if(!$antragsLvs)
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_lv'));
$result = $this->antraglib->saveLvs($insert);
if (isError($result))
return $this->outputJsonError(getError($result));
$this->outputJsonSuccess(getData($result));
}
public function getLvsAsRdf($prestudent_id)
{
// header für no cache
$this->output->set_header("Cache-Control: no-cache");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Pragma: no-cache");
$this->output->set_header("Content-type: application/xhtml+xml");
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$sem_akt = $this->variablelib->getVar('semester_aktuell');
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $sem_akt);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$lvs = getData($result) ?: [];
$rdf_url = 'http://www.technikum-wien.at/antragnote';
$this->load->view('lehre/Antrag/Wiederholung/getLvs.rdf.php', [
'url' => $rdf_url,
'lvs' => $lvs
]);
}
public function moveLvsToZeugnis()
{
$anzahl = $this->input->post('anzahl');
$student_uid = $this->input->post('student_uid');
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$errormsg = array();
for($i=0; $i<$anzahl; $i++)
{
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id_' . $i);
$result =$this->StudierendenantraglehrveranstaltungModel->load($id);
if(isError($result))
{
$errormsg[] = getError($result);
}
elseif(!hasData($result))
{
$errormsg[] = $this->p->t('studierendenantrag', 'error_no_lv_in_application');
}
else
{
$antragLv = getData($result)[0];
$result= $this->ZeugnisnoteModel->load([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
]);
if(isError($result))
{
$errormsg[] = getError($result);
}
else
{
if (hasData($result))
{
$result = $this->ZeugnisnoteModel->update(
[
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
],
[
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'updateamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'updatevon'=>getAuthUID()
]
);
}
else
{
$result = $this->ZeugnisnoteModel->insert([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz,
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'insertamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'insertvon'=>getAuthUID()
]);
}
if(isError($result))
{
$errormsg[] = getError($result);
}
}
}
}
if($errormsg)
$return = false;
else
$return = true;
$this->load->view('lehre/Antrag/Wiederholung/moveLvs.rdf.php', [
'return' => $return,
'errormsg' => $errormsg
]);
}
}
@@ -9,6 +9,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterCmpt has its
* own permissions check
* TODO(chris): deprecated
*/
class Filter extends FHC_Controller
{
@@ -3,7 +3,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
* TODO(chris): deprecated
*/
class Phrasen extends FHC_Controller
{
@@ -3,7 +3,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
* TODO(chris): deprecated
*/
class SearchBar extends FHC_Controller
{
+3 -1
View File
@@ -412,6 +412,8 @@ class AntragJob extends JOB_Controller
$this->StudierendenantragModel->addSelect('studiensemester_kurzbz');
$this->StudierendenantragModel->addSelect('s.insertamum');
$this->StudierendenantragModel->addSelect('s.insertvon');
$this->StudierendenantragModel->addJoin('public.tbl_student pts', 'prestudent_id');
$this->StudierendenantragModel->addSelect('pts.student_uid');
$this->StudierendenantragModel->db->where_in(
'public.get_rolle_prestudent(prestudent_id, studiensemester_kurzbz)',
@@ -484,7 +486,7 @@ class AntragJob extends JOB_Controller
$person = current(getData($result));
$email = $studiengang->email;
$dataMail = array(
'prestudent' => $antrag->prestudent_id,
'prestudent' => 'UID: ' . $antrag->student_uid . ', PreStudentId: ' . $antrag->prestudent_id,
'studiensemester' => $antrag->studiensemester_kurzbz,
'name' => trim($person->vorname . ' '. $person->nachname),
);
@@ -45,6 +45,7 @@ class IssueResolver extends IssueResolver_Controller
'CORE_STUDENTSTATUS_0013' => 'CORE_STUDENTSTATUS_0013',
'CORE_STUDENTSTATUS_0014' => 'CORE_STUDENTSTATUS_0014',
'CORE_STUDENTSTATUS_0015' => 'CORE_STUDENTSTATUS_0015',
'CORE_STUDENTSTATUS_0016' => 'CORE_STUDENTSTATUS_0016',
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
@@ -1023,7 +1023,7 @@ class ReihungstestJob extends JOB_Controller
{
$studiengang = $this->StudiengangModel->load($stg);
$mailcontent = '';
$content = false;
foreach ($orgform AS $art=>$value)
{
// Orgform nur dazu schreiben, wenn es mehr als Eine gibt
@@ -1044,6 +1044,7 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table><br><br>';
$content = true;
}
if (isset($value['AufnahmeHoeherePrio']) && !isEmptyArray($value['AufnahmeHoeherePrio']))
{
@@ -1058,6 +1059,7 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table>';
$content = true;
}
if (isset($value['AbgewiesenHoeherePrio']) && !isEmptyArray($value['AbgewiesenHoeherePrio']))
{
@@ -1071,6 +1073,7 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table>';
$content = true;
}
if ($bcc != '' && isset($value['AbgewiesenWeilBewerber']) && !isEmptyArray($value['AbgewiesenWeilBewerber']))
{
@@ -1085,13 +1088,14 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table>';
$content = true;
}
}
$mailcontent_data_arr['table'] = $mailcontent;
// Send email in Sancho design
if (!isEmptyString($mailcontent))
if (!isEmptyString($mailcontent) && $content === true)
{
sendSanchoMail(
'Sancho_ReihungstestteilnehmerJob',
@@ -111,8 +111,13 @@ class requestAnrechnung extends Auth_Controller
$lehrveranstaltung_id = $this->input->post('lv_id');
$studiensemester_kurzbz = $this->input->post('studiensemester');
$bestaetigung = $this->input->post('bestaetigung');
$begruendung_ects = $this->input->post('begruendung_ects');
$begruendung_lvinhalt = $this->input->post('begruendung_lvinhalt');
$begruendung_ects = $this->config->item('explain_equivalence') === TRUE
? $this->input->post('begruendung_ects')
: NULL;
$begruendung_lvinhalt = $this->config->item('explain_equivalence') === TRUE
? $this->input->post('begruendung_lvinhalt')
: NULL;
// Validate data
if (empty($_FILES['uploadfile']['name']))
@@ -124,8 +129,8 @@ class requestAnrechnung extends Auth_Controller
isEmptyString($anmerkung) ||
isEmptyString($lehrveranstaltung_id) ||
isEmptyString($studiensemester_kurzbz) ||
isEmptyString($begruendung_ects) ||
isEmptyString($begruendung_lvinhalt))
($this->config->item('explain_equivalence') === TRUE && isEmptyString($begruendung_ects)) ||
($this->config->item('explain_equivalence') === TRUE && isEmptyString($begruendung_lvinhalt)))
{
return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen'));
}
@@ -168,7 +173,7 @@ class requestAnrechnung extends Auth_Controller
// Hold just inserted DMS ID
$lastInsert_dms_id = $result->retval['dms_id'];
// Save Anrechnung and Anrechnungstatus
$result = $this->AnrechnungModel->createAnrechnungsantrag(
$prestudent_id,
@@ -16,7 +16,9 @@ class MigrateContract extends CLI_Controller
{
private $matching_ba1_vertragsart;
private $OE_DEFAULT = 'gst';
private $OE_DEFAULT;
protected $configerrors;
/**
* Constructor
@@ -28,29 +30,70 @@ class MigrateContract extends CLI_Controller
$this->load->model('codex/bisverwendung_model', 'BisVerwendungModel');
$this->load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel');
$this->matching_ba1_vertragsart = array(
'101'=>'externerlehrender',
'102'=>'DV anderen Gebietskörperschaft',
'103'=>'echterdv',
'104'=>'studentischehilfskr',
'105'=>'externerlehrender',
'106'=>'Andere Bildungseinrichtung',
'107'=>'werkvertrag',
'108'=>'studentischehilfskr',
'109'=>'ueberlassungsvertrag',
'110'=>'echterfreier',
'111'=>'echterdv', //All-In
);
$this->load->config('migratecontract');
$this->OE_DEFAULT = $this->config->item('migratecontract_oe_default');
$this->matching_ba1_vertragsart = $this->config->item('migratecontract_matching_ba1_vertragsart');
$this->configerrors = array();
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
public function checkConfig()
{
echo "OE_DEFAULT: " . $this->OE_DEFAULT . "\n";
echo "matching_ba1_vertragsart: " . print_r($this->matching_ba1_vertragsart, true);
$this->checkOE_DEFAULT();
$this->checkMatching_ba1_vertragsart();
if( count($this->configerrors) > 0 )
{
foreach($this->configerrors AS $configerror)
{
echo $configerror . "\n";
}
die("Fehler in der Konfiguration. Abbruch!\n");
}
else
{
echo "Konfiguration OK.\n";
}
}
protected function checkOE_DEFAULT()
{
$db = new DB_Model();
$oesql = 'SELECT * FROM public.tbl_organisationseinheit WHERE oe_kurzbz = ?';
$oeres = $db->execReadOnlyQuery($oesql, array($this->OE_DEFAULT));
if( !hasData($oeres) )
{
$this->configerrors[] = 'Default Organisationseinheit: "'
. $this->OE_DEFAULT . '" nicht gefunden.';
}
}
protected function checkMatching_ba1_vertragsart() {
$db = new DB_Model();
foreach( $this->matching_ba1_vertragsart AS $vertragsart_kurzbz )
{
$vasql = 'SELECT * FROM hr.tbl_vertragsart WHERE vertragsart_kurzbz = ?';
$vares = $db->execReadOnlyQuery($vasql, array($vertragsart_kurzbz));
if( !hasData($vares) )
{
$this->configerrors[] = 'Vertragsart "' . $vertragsart_kurzbz
. '" nicht gefunden.';
}
}
}
/**
* Everything has a beginning
*/
public function index($user = null)
{
$this->checkConfig();
if (!is_null($user))
{
$contracts = $this->_transformUser($user);
@@ -400,6 +443,11 @@ class MigrateContract extends CLI_Controller
*/
private function _addVertragsbestandteilZeitaufzeichnung(&$contracts, $dv, $row_verwendung)
{
if( is_null($row_verwendung->zeitaufzeichnungspflichtig) || is_null($row_verwendung->azgrelevant) )
{
return;
}
if (isset($contracts['dv'][$dv]['vbs']))
{
foreach ($contracts['dv'][$dv]['vbs'] as $index_vbs=>$row_vbs)
@@ -4,14 +4,15 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
class MigrateHourlyRate extends CLI_Controller
{
CONST DEFAULT_OE = 'gst';
CONST DEFAULT_DATE = '1970-01-01';
CONST STUNDENSTAZTYP_LEHRE = 'lehre';
CONST STUNDENSTAZTYP_KALKULATORISCH = 'kalkulatorisch';
private $OE_DEFAULT;
private $_ci;
protected $configerrors;
public function __construct()
{
parent::__construct();
@@ -21,10 +22,38 @@ class MigrateHourlyRate extends CLI_Controller
$this->load->model('codex/Bisverwendung_model', 'BisVerwendungModel');
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
$this->load->model('ressource/Stundensatz_model', 'StundensatzModel');
$this->load->config('migratecontract');
$this->OE_DEFAULT = $this->config->item('migratecontract_oe_default');
$this->configerrors = array();
}
public function checkConfig()
{
echo "OE_DEFAULT: " . $this->OE_DEFAULT . "\n";
$this->checkOE_DEFAULT();
if( count($this->configerrors) > 0 )
{
foreach($this->configerrors AS $configerror)
{
echo $configerror . "\n";
}
die("Fehler in der Konfiguration. Abbruch!\n");
}
else
{
echo "Konfiguration OK.\n";
}
}
public function index($user = null)
{
$this->checkConfig();
echo "Lehre Stundensaetze werden migriert.\n";
$mitarbeiterResult = $this->_getMitarbeiterStunden($user);
if (isError($mitarbeiterResult)) return $mitarbeiterResult;
if (!hasData($mitarbeiterResult)) return error('Keine Mitarbeiterstunden gefunden');
@@ -38,20 +67,71 @@ class MigrateHourlyRate extends CLI_Controller
if (isError($insertResult)) return $insertResult;
}
$sapResult = $this->_getSapStunden($user);
if (isError($sapResult)) return $sapResult;
if (!hasData($sapResult)) return error('Keinen kalkulatorischen Stundensaetze gefunden');
$mitarbeiterArray = getData($sapResult);
foreach ($mitarbeiterArray as $mitarbeiter)
if( $this->checkIfSAPSyncTableExists() )
{
$this->_getUnternehmen($mitarbeiter);
$insertResult = $this->_addStundensatz($mitarbeiter, self::STUNDENSTAZTYP_KALKULATORISCH, date_format(date_create($mitarbeiter->beginn), 'Y-m-d'));
if (isError($insertResult)) return $insertResult;
echo "SAP Sync Tabelle gefunden. SAP Stundensaetze werden migriert.\n";
$sapResult = $this->_getSapStunden($user);
if (isError($sapResult)) return $sapResult;
if (!hasData($sapResult)) return error('Keinen kalkulatorischen Stundensaetze gefunden');
$mitarbeiterArray = getData($sapResult);
foreach ($mitarbeiterArray as $mitarbeiter)
{
$this->_getUnternehmen($mitarbeiter);
$insertResult = $this->_addStundensatz($mitarbeiter, self::STUNDENSTAZTYP_KALKULATORISCH, date_format(date_create($mitarbeiter->beginn), 'Y-m-d'));
if (isError($insertResult)) return $insertResult;
}
}
else
{
echo "SAP Sync Tabelle nicht gefunden. Ignoriere SAP Stundensaetze.\n";
}
}
protected function checkOE_DEFAULT()
{
$db = new DB_Model();
$oesql = 'SELECT * FROM public.tbl_organisationseinheit WHERE oe_kurzbz = ?';
$oeres = $db->execReadOnlyQuery($oesql, array($this->OE_DEFAULT));
if( !hasData($oeres) )
{
$this->configerrors[] = 'Default Organisationseinheit: "'
. $this->OE_DEFAULT . '" nicht gefunden.';
}
}
protected function checkIfSAPSyncTableExists()
{
$dbModel = new DB_Model();
$params = array(
DB_NAME,
'sync',
'tbl_sap_stundensatz'
);
$sql = "SELECT
1 AS exists
FROM
information_schema.tables
WHERE
table_catalog = ? AND
table_schema = ? AND
table_name = ?";
$res = $dbModel->execReadOnlyQuery($sql, $params);
if( hasData($res) )
{
return true;
}
else
{
return false;
}
}
private function _getSapStunden($user = null)
{
$dbModel = new DB_Model();
@@ -127,7 +207,7 @@ class MigrateHourlyRate extends CLI_Controller
$unternehmenResult = $this->_findUnternehmen($mitarbeiter->uid, "'kstzuordnung', 'oezuordnung'");
}
$unternehmen = self::DEFAULT_OE;
$unternehmen = $this->OE_DEFAULT;
if (hasData($unternehmenResult))
$unternehmen = getData($unternehmenResult)[0]->oe_kurzbz;
@@ -22,6 +22,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
* This controller operates between (interface) the JS (GUI) and the NavigationLib (back-end)
* Provides data to the ajax get calls about the filter
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* TODO(chris): deprecated
*/
class Navigation extends FHC_Controller
{
+123 -18
View File
@@ -7,6 +7,10 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
*/
abstract class Auth_Controller extends FHC_Controller
{
// Special Permissions
const PERM_ANONYMOUS = 'anonymous'; // Everyone
const PERM_LOGGED = 'logged_in'; // Every registered user
/**
* Extends this controller if authentication is required
*/
@@ -14,17 +18,41 @@ abstract class Auth_Controller extends FHC_Controller
{
parent::__construct();
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
if (!is_array($requiredPermissions) || isEmptyArray($requiredPermissions))
show_error('The given permissions is not a valid array or it is an empty one');
if (!isset($requiredPermissions[$this->router->method]))
show_error('The given permission array does not contain the given method or is not correctly set');
$anonAllowed = false;
if ($requiredPermissions[$this->router->method] == self::PERM_ANONYMOUS)
$anonAllowed = true;
elseif (is_array($requiredPermissions[$this->router->method])
&& in_array(self::PERM_ANONYMOUS, $requiredPermissions[$this->router->method]))
$anonAllowed = true;
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
if ($anonAllowed) {
// Loads authentication library without authentication
$this->load->library('AuthLib', [false]);
// Loads helper since it would only be called on authentication
$this->load->helper('hlp_authentication');
} else {
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
}
}
/**
* Checks if the caller is allowed to access to this content with the given permissions
* If it is not allowed will set the HTTP header with code 401
* Wrapper for permissionlib->isEntitled
*
* @param array $requiredPermissions
* @return void
*/
private function _isAllowed($requiredPermissions)
{
@@ -34,28 +62,105 @@ abstract class Auth_Controller extends FHC_Controller
// Checks if this user is entitled to access to this content
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
{
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
// Prints the main error message
$this->eprintflib->printError('You are not allowed to access to this content');
// Prints the called controller name
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
// Prints the called controller method name
$this->eprintflib->printInfo('Method name: '.$this->router->method);
// Prints the required permissions needed to access to this method
$this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method));
$this->_outputAuthError($requiredPermissions);
exit; // immediately terminate the execution
}
}
/**
* Checks for Permissions depending if the given person is a
* Mitarbeiter and/or Student
* and exits/outputs an error if they are not met.
*
* @param integer $person_id
* @param array $permMa Perms if the person is a Mitarbeiter
* @param array $permStud Perms if the person is a Student
*
* @return void
*/
protected function checkPermissionsForPerson($person_id, $permMa, $permStud)
{
$res = $this->hasPermissionsForPerson($person_id, $permMa, $permStud);
if ($res) {
$perm = array_keys(array_flip(array_merge($res|1 ? $permMa : [], $res|2 ? $permStud : [])));
$this->_outputAuthError([$this->router->method => $perm]);
}
}
/**
* Checks for Permissions depending if the given person is a
* Mitarbeiter and/or Student
* and returns the result.
*
* @param integer $person_id
* @param array $permMa Perms if the person is a Mitarbeiter
* @param array $permStud Perms if the person is a Student
*
* @return boolean
*/
protected function hasPermissionsForPerson($person_id, $permMa, $permStud)
{
$res = 0;
$this->load->model('person/Person_model', 'PersonModel');
$this->PersonModel->addJoin('public.tbl_benutzer', 'person_id');
$this->PersonModel->addJoin('public.tbl_mitarbeiter', 'uid = mitarbeiter_uid');
$result = $this->PersonModel->load($person_id);
if (hasData($result)) {
if ($this->permissionlib->isEntitled(['a' => $permMa], 'a'))
return 0;
$res = 1;
}
$this->PersonModel->addJoin('public.tbl_prestudent', 'person_id');
$result = $this->PersonModel->load($person_id);
if (hasData($result)) {
$permStudConverted = [];
foreach (getData($result) as $row) {
foreach ($permStud as $k => $v) {
if (!isset($permStudConverted[$k])) {
$permStudConverted[$k] = $this->permissionlib->convertAccessType($v);
}
if ($this->permissionlib->isBerechtigt($permStudConverted[$k][0], $permStudConverted[$k][1], $row->studiengang_kz))
return 0;
}
}
$res += 2;
}
return $res;
}
/**
* Outputs an error message and sets the HTTP Header.
* This function is protected so that it can be overwritten.
*
* @param array $requiredPermissions
* @return void
*/
protected function _outputAuthError($requiredPermissions)
{
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
// Prints the main error message
$this->eprintflib->printError('You are not allowed to access to this content');
// Prints the called controller name
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
// Prints the called controller method name
$this->eprintflib->printInfo('Method name: '.$this->router->method);
// Prints the required permissions needed to access to this method
$this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method));
}
/**
* Converts an array of permissions to a string that contains them as a comma separated list
* Ex: "<permission 1>, <permission 2>, <permission 3>"
*
* @param array $requiredPermissions
* @param string $method
* @return void
*/
private function _rpsToString($requiredPermissions, $method)
final protected function _rpsToString($requiredPermissions, $method)
{
$strRequiredPermissions = ''; // string that contains all the required permissions needed to access to this method
+51
View File
@@ -64,6 +64,9 @@ class DB_Model extends CI_Model
private $executedQueryMetaData;
private $executedQueryListFields;
// caching
private $lang = null;
private $debugMode; // Debug mode enable (true) or disabled (false)
/**
@@ -510,6 +513,34 @@ class DB_Model extends CI_Model
return success();
}
/**
* Add translated select clause
*
* @param string $select
* @param string $alias (optional)
* @param string $lang (optional)
*
* @return stdClass
*/
public function addTranslatedSelect($select, $alias = null, $lang = null)
{
return $this->addSelect($this->getTranslatedSelectQuery($select, $alias, $lang), false);
}
/**
* gets translated select query
*
* @param string $select
* @param string $alias (optional)
* @param string $lang (optional)
*
* @return string
*/
public function getTranslatedSelectQuery($select, $alias = null, $lang = null)
{
return $select . '[(SELECT index FROM public.tbl_sprache WHERE sprache=' . $lang ? $lang : $this->loadLang() . ')] AS ' . $alias ? $alias : end(explode('.', $select));
}
/**
* Add distinct clause
*
@@ -903,6 +934,26 @@ class DB_Model extends CI_Model
// Private methods
//
//
/**
* Loads the user language and caches it
*
* @return string
*/
private function loadLang()
{
if ($this->lang)
return $this->lang;
$tmp = clone $this->db;
$this->db->reset_query();
$this->lang = $this->escape(getUserLanguage());
$this->db = $tmp;
return $this->lang;
}
/**
* To add the pgp_sym_encrypt function to the set clause where needed
+45 -69
View File
@@ -5,7 +5,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Controller using JSON
*/
class FHCAPI_Controller extends FHC_Controller
class FHCAPI_Controller extends Auth_Controller
{
/**
@@ -19,12 +19,13 @@ class FHCAPI_Controller extends FHC_Controller
/**
* Error types
*/
const ERROR_TYPE_PHP = 'php'; // TODO(chris): php types from severity?
const ERROR_TYPE_PHP = 'php';
const ERROR_TYPE_EXCEPTION = 'exception';
const ERROR_TYPE_GENERAL = 'general';
const ERROR_TYPE_404 = '404';
const ERROR_TYPE_DB = 'db';
const ERROR_TYPE_VALIDATION = 'validation';
const ERROR_TYPE_AUTH = 'auth';
/**
* Return Object
@@ -45,10 +46,6 @@ class FHCAPI_Controller extends FHC_Controller
if (is_cli())
show_404();
parent::__construct();
$this->config->set_item('error_views_path', VIEWPATH.'errors'.DIRECTORY_SEPARATOR.'json'.DIRECTORY_SEPARATOR);
global $g_result;
$g_result = $this;
@@ -74,18 +71,14 @@ class FHCAPI_Controller extends FHC_Controller
}
}
#$this->returnObj['test'] = implode('/n', headers_list());
return json_encode($this->returnObj);
});
// Load libraries
$this->load->library('AuthLib');
$this->load->library('PermissionLib');
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
// NOTE(chris): overwrite error_views_path before constructor
load_class('Config')->set_item('error_views_path', VIEWPATH.'errors'.DIRECTORY_SEPARATOR.'json'.DIRECTORY_SEPARATOR);
parent::__construct($requiredPermissions);
// For JSON Requests (as opposed to multipart/form-data) get the $_POST variable from the input stream instead
if ($this->input->get_request_header('Content-Type', true) == 'application/json')
$_POST = json_decode($this->security->xss_clean($this->input->raw_input_stream), true);
@@ -136,15 +129,25 @@ class FHCAPI_Controller extends FHC_Controller
$this->returnObj['data'] = $data;
}
/**
* @param string $key
* @param mixed $value
* @return void
*/
public function addMeta($key, $value)
{
if (!isset($this->returnObj['meta']))
$this->returnObj['meta'] = [];
$this->returnObj['meta'][$key] = $value;
}
/**
* @param string $status
* @return void
*/
public function setStatus($status)
{
if (!isset($this->returnObj['meta']))
$this->returnObj['meta'] = [];
$this->returnObj['meta']['status'] = $status;
$this->addMeta('status', $status);
}
@@ -152,6 +155,17 @@ class FHCAPI_Controller extends FHC_Controller
// Handle Output object - Shortcut functions
// ---------------------------------------------------------------
/**
* @param mixed $data (optional)
* @return void
*/
protected function terminateWithSuccess($data = null)
{
$this->setData($data);
$this->setStatus(self::STATUS_SUCCESS);
exit;
}
/**
* @param array $errors
* @return void
@@ -164,25 +178,15 @@ class FHCAPI_Controller extends FHC_Controller
exit(EXIT_ERROR);
}
/**
* @param mixed $data (optional)
* @return void
*/
protected function terminateWithSuccess($data = null)
{
$this->setData($data);
$this->setStatus(self::STATUS_SUCCESS);
exit;
}
/**
* @param array $error
* @param string $type (optional)
* @param integer $status (optional)
* @return void
*/
protected function terminateWithError($error, $type = null)
protected function terminateWithError($error, $type = null, $status = REST_Controller::HTTP_INTERNAL_SERVER_ERROR)
{
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
$this->output->set_status_header($status);
$this->addError($error, $type);
$this->setStatus(self::STATUS_ERROR);
exit;
@@ -193,63 +197,35 @@ class FHCAPI_Controller extends FHC_Controller
* @param string $errortype
* @return void
*/
protected function checkForErrors($result, $errortype = self::ERROR_TYPE_GENERAL)
protected function getDataOrTerminateWithError($result, $errortype = self::ERROR_TYPE_GENERAL)
{
// TODO(chris): IMPLEMENT!
if (isError($result)) {
$this->terminateWithError(getError($result), $errortype);
}
return $result->retval;
}
// TODO(chris): complete list
// ---------------------------------------------------------------
// Security
// ---------------------------------------------------------------
/**
* Checks if the caller is allowed to access to this content with the given permissions
* If it is not allowed will set the HTTP header with code 401
* Wrapper for permissionlib->isEntitled
* Outputs an error message and sets the HTTP Header.
* This overwrites the default behaviour to output a json object.
*
* @param array $requiredPermissions
* @return void
*/
protected function _isAllowed($requiredPermissions)
protected function _outputAuthError($requiredPermissions)
{
// Checks if this user is entitled to access to this content
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
{
$this->output->set_status_header(isLogged() ? REST_Controller::HTTP_FORBIDDEN : REST_Controller::HTTP_UNAUTHORIZED);
$this->output->set_status_header(isLogged() ? REST_Controller::HTTP_FORBIDDEN : REST_Controller::HTTP_UNAUTHORIZED);
$this->addError([
'message' => 'You are not allowed to access to this content',
'controller' => $this->router->class,
'method' => $this->router->method,
'required_permissions' => $this->_rpsToString($requiredPermissions, $this->router->method)
]);
exit; // immediately terminate the execution
}
}
/**
* Converts an array of permissions to a string that contains them as a comma separated list
* Ex: "<permission 1>, <permission 2>, <permission 3>"
*
* @param array $requiredPermissions
* @param string $method
* @return void
*/
protected function _rpsToString($requiredPermissions, $method)
{
if (!isset($requiredPermissions[$method]))
return '';
if (!is_array($requiredPermissions[$method]))
return $requiredPermissions[$method];
return implode(', ', $requiredPermissions[$method]);
$this->addError([
'message' => 'You are not allowed to access to this content',
'controller' => $this->router->class,
'method' => $this->router->method,
'required_permissions' => $this->_rpsToString($requiredPermissions, $this->router->method)
], self::ERROR_TYPE_AUTH);
}
}
+76
View File
@@ -422,3 +422,79 @@ function isValidDate($dateString)
return false;
}
}
// ------------------------------------------------------------------------
// Collection of utility functions for form validation purposes
// ------------------------------------------------------------------------
/**
* check if string can be converted to a date
*/
function is_valid_date($dateString)
{
try
{
return (new DateTime($dateString)) !== false;
}
catch(Exception $e)
{
return false;
}
}
/**
* check if given permissions are met
*/
function has_write_permissions($value, $permissions = '')
{
if (!$permissions)
$permissions = $value;
$permissions = explode(',', $permissions);
$CI =& get_instance();
$CI->load->library('AuthLib');
$CI->load->library('PermissionLib');
return $CI->permissionlib->hasAtLeastOne(
$permissions,
'sometable',
PermissionLib::WRITE_RIGHT
);
}
/**
* check if has permissions for a studiengang_kz
*/
function has_permissions_for_stg($studiengang_kz, $permissions = '')
{
if (!$permissions)
return false;
$permissions = explode(',', $permissions);
$CI =& get_instance();
$CI->load->library('AuthLib');
$CI->load->library('PermissionLib');
foreach ($permissions as $perm) {
if (strpos($perm, PermissionLib::PERMISSION_SEPARATOR) === false) {
$CI->addError(
'The given permission does not use the correct format',
FHCAPI_Controller::ERROR_TYPE_GENERAL
);
return false;
}
list($perm, $accesstype) = explode(PermissionLib::PERMISSION_SEPARATOR, $perm);
$at = '';
if (strpos($accesstype, PermissionLib::READ_RIGHT) !== false)
$at = PermissionLib::SELECT_RIGHT; // S
if (strpos($accesstype, PermissionLib::WRITE_RIGHT) !== false)
$at .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID
if ($CI->permissionlib->isBerechtigt($perm, $at, $studiengang_kz))
return true;
}
return false;
}
@@ -0,0 +1,43 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
$lang['form_validation_has_write_permissions'] = 'You have no rights to edit {field} field.';
$lang['form_validation_is_valid_date'] = 'The date format is invalid or out of range.';
$lang['form_validation_has_permissions_for_stg'] = 'You have no rights for stg {field}.';
+1 -1
View File
@@ -2058,7 +2058,7 @@ class AntragLib
*/
public function isEntitledToUnpauseAntrag($antrag_id)
{
return $this->hasAccessToAntrag($antrag_id, 'student/studierendenantrag');
return ($this->hasAccessToAntrag($antrag_id, 'student/antragfreigabe') || $this->hasAccessToAntrag($antrag_id, 'student/studierendenantrag'));
}
/**
+34 -14
View File
@@ -21,6 +21,8 @@ require_once(FHCPATH.'include/functions.inc.php');
require_once(FHCPATH.'include/wawi_kostenstelle.class.php');
require_once(FHCPATH.'include/benutzerberechtigung.class.php');
use \benutzerberechtigung as benutzerberechtigung;
class PermissionLib
{
// Available rights in the DB
@@ -65,8 +67,10 @@ class PermissionLib
if (!is_cli())
{
// API Caller rights initialization
$authObj = $this->_ci->authlib->getAuthObj();
self::$bb = new benutzerberechtigung();
self::$bb->getBerechtigungen(($this->_ci->authlib->getAuthObj())->{AuthLib::AO_USERNAME});
if ($authObj)
self::$bb->getBerechtigungen($authObj->{AuthLib::AO_USERNAME});
}
}
@@ -143,19 +147,7 @@ class PermissionLib
if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false)
{
// Retrieves permission and required access type from the $requiredPermissions array
list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]);
$accessType = '';
// Set the access type
if (strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false)
{
$accessType = PermissionLib::SELECT_RIGHT; // S
}
if (strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false)
{
$accessType .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID
}
list($permission, $accessType) = $this->convertAccessType($permissions[$pCounter]);
if (!isEmptyString($accessType)) // if compliant
{
@@ -166,6 +158,16 @@ class PermissionLib
if ($checkPermissions === true) break;
}
}
elseif ($permissions[$pCounter] == Auth_Controller::PERM_ANONYMOUS)
{
$checkPermissions = true;
break;
}
elseif ($permissions[$pCounter] == Auth_Controller::PERM_LOGGED)
{
$checkPermissions = isLogged();
break;
}
else
{
show_error('The given permission does not use the correct format');
@@ -195,6 +197,24 @@ class PermissionLib
return $checkPermissions;
}
/**
* Retrieves permission and required access type from the newly formatted permission string
*
* @param string $permission
*
* @return array
*/
public function convertAccessType($permission)
{
list($permission, $reqAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permission);
$accessType = '';
if (strpos($reqAccessType, PermissionLib::READ_RIGHT) !== false)
$accessType = PermissionLib::SELECT_RIGHT;
if (strpos($reqAccessType, PermissionLib::WRITE_RIGHT) !== false)
$accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT;
return [$permission, $accessType];
}
/**
* Checks if at least one of the permissions given as parameter (requiredPermissions) belongs to the authenticated user
* It checks the given permissions against a given method (controller method name) and a given permission type (R and/or W)
@@ -33,7 +33,8 @@ class PlausicheckDefinitionLib
'PrestudentMischformOhneOrgform' => 'PrestudentMischformOhneOrgform',
'StgPrestudentUngleichStgStudienplan' => 'StgPrestudentUngleichStgStudienplan',
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher'
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher',
'DualesStudiumOhneMarkierung' => 'DualesStudiumOhneMarkierung'
//'StudienplanUngueltig' => 'StudienplanUngueltig'
);
@@ -12,8 +12,7 @@ class PlausicheckProducerLib
private $_ci; // ci instance
private $_extensionName; // name of extension
private $_app; // name of application
private $_konfiguration = array(); // konfigratio parameters
private $_konfiguration = array(); // configuration parameters
public function __construct($params = null)
{
@@ -0,0 +1,143 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
require_once('PlausiChecker.php');
/**
*
*/
class DualesStudiumOhneMarkierung extends PlausiChecker
{
public function executePlausiCheck($params)
{
$results = array();
// get parameters from config
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
// pass parameters needed for plausicheck
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
// get all students failing the plausicheck
$prestudentRes = $this->getDualesStudiumOhneMarkierung(
$studiensemester_kurzbz,
$studiengang_kz,
null,
$exkludierte_studiengang_kz
);
if (isError($prestudentRes)) return $prestudentRes;
if (hasData($prestudentRes))
{
$prestudents = getData($prestudentRes);
// populate results with data necessary for writing issues
foreach ($prestudents as $prestudent)
{
$results[] = array(
'person_id' => $prestudent->person_id,
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
'fehlertext_params' => array(
'prestudent_id' => $prestudent->prestudent_id,
'studienplan' => $prestudent->studienplan
),
'resolution_params' => array(
'prestudent_id' => $prestudent->prestudent_id,
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
)
);
}
}
// return the results
return success($results);
}
/**
* All prestudents in dual Studiengang should have set the dual flag to true.
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
* @param studiengang_kz int if check is to be executed for certain Studiengang
* @param prestudent_id int if check is to be executed only for one prestudent
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
* @return success with prestudents or error
*/
public function getDualesStudiumOhneMarkierung(
$studiensemester_kurzbz,
$studiengang_kz = null,
$prestudent_id = null,
$exkludierte_studiengang_kz = null
) {
$params = array($studiensemester_kurzbz);
$qry = "
SELECT
DISTINCT pre.person_id, pre.prestudent_id,
stpl.bezeichnung AS studienplan,
status.studiensemester_kurzbz,
status.ausbildungssemester,
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
FROM
public.tbl_prestudent pre
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
JOIN public.tbl_person USING(person_id)
JOIN lehre.tbl_studienplan stpl USING(studienplan_id)
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
JOIN public.tbl_studiensemester sem USING(studiensemester_kurzbz)
WHERE
(stpl.orgform_kurzbz = 'DUA' OR status.orgform_kurzbz = 'DUA')
AND pre.dual = FALSE
AND status.studiensemester_kurzbz=?
AND pre.bismelden
AND stg.melderelevant
AND NOT EXISTS (
SELECT 1
FROM
public.tbl_prestudentstatus
JOIN lehre.tbl_studienplan USING(studienplan_id)
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
WHERE
prestudent_id = pre.prestudent_id
AND
(
-- if there is a newer non-dual status, dual has not to be set
(
(
tbl_studienplan.orgform_kurzbz <> stpl.orgform_kurzbz
OR status.orgform_kurzbz <> tbl_prestudentstatus.orgform_kurzbz
)
AND
(
tbl_studiensemester.ende::date > sem.ende::date
OR (tbl_studiensemester.ende::date = sem.ende::date AND tbl_prestudentstatus.datum::date > status.datum::date)
)
)
OR
-- exclude Abgewiesene - they are not reported
tbl_prestudentstatus.status_kurzbz = 'Abgewiesener'
)
)";
if (isset($studiengang_kz))
{
$qry .= " AND stg.studiengang_kz = ?";
$params[] = $studiengang_kz;
}
if (isset($prestudent_id))
{
$qry .= " AND pre.prestudent_id = ?";
$params[] = $prestudent_id;
}
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
{
$qry .= " AND stg.studiengang_kz NOT IN ?";
$params[] = $exkludierte_studiengang_kz;
}
return $this->_db->execReadOnlyQuery($qry, $params);
}
}
@@ -67,6 +67,7 @@ class InaktiverStudentAktiverStatus extends PlausiChecker
$prestudent_id = null,
$exkludierte_studiengang_kz = null
) {
$this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
$aktStudiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
if (isError($aktStudiensemesterRes)) return $aktStudiensemesterRes;
@@ -0,0 +1,36 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Student in dual Studiengang should have set the dual flag to true.
*/
class CORE_STUDENTSTATUS_0016 implements IIssueResolvedChecker
{
public function checkIfIssueIsResolved($params)
{
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
$this->_ci =& get_instance(); // get code igniter instance
$this->_ci->load->library('issues/plausichecks/DualesStudiumOhneMarkierung');
// check if issue persists
$checkRes = $this->_ci->dualesstudiumohnemarkierung->getDualesStudiumOhneMarkierung(
$params['studiensemester_kurzbz'],
null,
$params['prestudent_id']
);
if (isError($checkRes)) return $checkRes;
if (hasData($checkRes))
return success(false); // not resolved if issue is still present
else
return success(true); // resolved otherwise
}
}
@@ -29,6 +29,9 @@ class Dienstverhaeltnis extends AbstractBestandteil {
protected $updateamum;
protected $updatevon;
protected $dvendegrund_kurzbz;
protected $dvendegrund_anmerkung;
public function __construct()
{
parent::__construct();
@@ -49,6 +52,8 @@ class Dienstverhaeltnis extends AbstractBestandteil {
isset($data->insertvon) && $this->setInsertvon($data->insertvon);
isset($data->updateamum) && $this->setUpdateamum($data->updateamum);
isset($data->updatevon) && $this->setUpdatevon($data->updatevon);
isset($data->dvendegrund_kurzbz) && $this->setDvendegrund_kurzbz($data->dvendegrund_kurzbz);
isset($data->dvendegrund_anmerkung) && $this->setDvendegrund_anmerkung($data->dvendegrund_anmerkung);
$this->fromdb = false;
}
@@ -64,7 +69,9 @@ class Dienstverhaeltnis extends AbstractBestandteil {
'insertamum' => $this->getInsertamum(),
'insertvon' => $this->getInsertvon(),
'updateamum' => $this->getUpdateamum(),
'updatevon' => $this->getUpdatevon()
'updatevon' => $this->getUpdatevon(),
'dvendegrund_kurzbz' => $this->getDvendegrund_kurzbz(),
'dvendegrund_anmerkung' => $this->getDvendegrund_anmerkung()
);
$tmp = array_filter($tmp, function($k) {
@@ -139,6 +146,16 @@ EOTXT;
return $this->updatevon;
}
public function getDvendegrund_kurzbz()
{
return $this->dvendegrund_kurzbz;
}
public function getDvendegrund_anmerkung()
{
return $this->dvendegrund_anmerkung;
}
public function setDienstverhaeltnis_id($dienstverhaeltnis_id)
{
$this->markDirty('dienstverhaeltnis_id', $this->dienstverhaeltnis_id, $dienstverhaeltnis_id);
@@ -214,6 +231,20 @@ EOTXT;
return $this;
}
public function setDvendegrund_kurzbz($dvendegrund_kurzbz)
{
$this->markDirty('dvendegrund_kurzbz', $this->dvendegrund_kurzbz, $dvendegrund_kurzbz);
$this->dvendegrund_kurzbz = $dvendegrund_kurzbz;
return $this;
}
public function setDvendegrund_anmerkung($dvendegrund_anmerkung)
{
$this->markDirty('dvendegrund_anmerkung', $this->dvendegrund_anmerkung, $dvendegrund_anmerkung);
$this->dvendegrund_anmerkung = $dvendegrund_anmerkung;
return $this;
}
public function validate() {
//do Validation here
$ci = get_instance();
@@ -435,7 +435,7 @@ class VertragsbestandteilLib
return $result;
}
public function endDienstverhaeltnis(Dienstverhaeltnis $dv, $enddate)
public function endDienstverhaeltnis(Dienstverhaeltnis $dv, $enddate, $dvendegrund_kurzbz=null, $dvendegrund_anmerkung=null)
{
if( $dv->getBis() !== null && $dv->getBis() < $enddate )
{
@@ -460,6 +460,14 @@ class VertragsbestandteilLib
$this->endVertragsbestandteil($vb, $enddate);
}
if( $dvendegrund_kurzbz !== null )
{
$dv->setDvendegrund_kurzbz($dvendegrund_kurzbz);
}
if( $dvendegrund_anmerkung !== null )
{
$dv->setDvendegrund_anmerkung($dvendegrund_anmerkung);
}
$dv->setBis($enddate);
$this->updateDienstverhaeltnis($dv);
@@ -188,4 +188,20 @@ class Organisationseinheit_model extends DB_Model
}
return $this->loadWhere($condition);
}
/**
* Get OEs by eventQuery string. Use with autocomplete event queries.
* @param $eventQuery String
* @return array
*/
public function getAutocompleteSuggestions($eventQuery)
{
$this->addSelect('oe_kurzbz');
$this->addSelect('organisationseinheittyp_kurzbz, oe_kurzbz, bezeichnung, aktiv, lehre');
$this->addOrder('organisationseinheittyp_kurzbz, bezeichnung');
return $this->loadWhere("
oe_kurzbz ILIKE '%". $this->escapeLike($eventQuery). "%'
");
}
}
@@ -563,7 +563,7 @@ class Studiengang_model extends DB_Model
$this->addJoin('public.tbl_student stud', 'p.prestudent_id=stud.prestudent_id', 'LEFT');
$this->db->where_in($this->dbTable . '.studiengang_kz', $studiengang_kzs);
$this->db->where_in('ps.status_kurzbz', $this->config->item('antrag_prestudentstatus_whitelist'));
$this->db->where_in('ps.status_kurzbz', $this->config->item('antrag_prestudentstatus_whitelist_abmeldung'));
$this->db->where($this->dbTable . ".aktiv", true);
if ($not_antrag_typ !== null && is_array($not_antrag_typ)) {
@@ -11,4 +11,24 @@ class Betriebsmittel_model extends DB_Model
$this->dbTable = 'wawi.tbl_betriebsmittel';
$this->pk = 'betriebsmittel_id';
}
/**
* load Liste Inventarnummern
*/
public function loadInventarliste($filter)
{
$filter = urldecode(strtoLower($filter));
$qry = "
SELECT
bm.inventarnummer, bm.betriebsmitteltyp, bm.betriebsmittel_id, CONCAT(bm.inventarnummer, ' ', bm.beschreibung) as dropdowntext
FROM
wawi.tbl_betriebsmittel bm
WHERE
upper(bm.inventarnummer) LIKE '%" .$this->db->escape_like_str($filter)."%'
OR
lower(bm.inventarnummer) LIKE '%" .$this->db->escape_like_str($filter)."%'";
return $this->execQuery($qry);
}
}
@@ -96,4 +96,49 @@ class Betriebsmittelperson_model extends DB_Model
return $this->loadWhere($condition);
}
public function getBetriebsmittelData($id, $type_id)
{
switch ($type_id) {
case 'person_id':
$cond = 'bmp.person_id';
break;
case 'uid':
$cond = 'bmp.uid';
break;
case 'betriebsmittelperson_id':
$cond = 'bmp.betriebsmittelperson_id';
break;
default:
return error("ID nicht gültig");
}
$query = "
SELECT
bm.nummer, bmp.person_id, bm.betriebsmitteltyp, bmp.anmerkung as anmerkung, bmp.retouram, TO_CHAR(bmp.retouram::timestamp, 'DD.MM.YYYY') AS format_retour, bmp.ausgegebenam, TO_CHAR(bmp.ausgegebenam::timestamp, 'DD.MM.YYYY') AS format_ausgabe, bm.beschreibung, bmp.uid, bmp.kaution, bm.betriebsmittel_id, bmp.betriebsmittelperson_id, bm.inventarnummer, bm.nummer2
FROM
wawi.tbl_betriebsmittelperson bmp
JOIN
wawi.tbl_betriebsmittel bm ON (bmp.betriebsmittel_id = bm.betriebsmittel_id)
WHERE
" . $cond . " = ? ";
return $this->execQuery($query, array($id));
}
/**
* Perform a loadWhere on the vw_betriebsmittelperson DB View
*
* @param array $where
*
* @return stdClass
*/
public function loadViewWhere($where)
{
$table = $this->dbTable;
$this->dbTable = 'public.vw_betriebsmittelperson';
$result = $this->loadWhere($where);
$this->dbTable = $table;
return $result;
}
}
@@ -31,9 +31,13 @@ class Dienstverhaeltnis_model extends DB_Model
org.bezeichnung oe_bezeichnung,
dv.von,
dv.bis,
dv.dvendegrund_kurzbz,
dv.dvendegrund_anmerkung,
dv.vertragsart_kurzbz,
dv.updateamum,
dv.updatevon
dv.updatevon,
dv.dvendegrund_kurzbz,
dv.dvendegrund_anmerkung
FROM tbl_mitarbeiter
JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text
JOIN tbl_person USING (person_id)
@@ -11,6 +11,7 @@ $sitesettings = array(
'customJSModules' => array('public/js/apps/lehre/Antrag.js'),
'customCSSs' => array(
'public/css/Fhc.css',
'public/css/components/primevue.css',
'vendor/vuejs/vuedatepicker_css/main.css'
),
'customJSs' => array(
@@ -20,7 +20,8 @@ $sitesettings = array(
),
'customJSModules' => array('public/js/apps/lehre/Antrag/Leitung.js'),
'customCSSs' => array(
'public/css/Fhc.css'
'public/css/Fhc.css',
'public/css/components/primevue.css',
),
'customJSs' => array(
)
@@ -10,7 +10,8 @@ $sitesettings = array(
),
'customJSModules' => array('public/js/apps/lehre/Antrag/Student.js'),
'customCSSs' => array(
'public/css/Fhc.css'
'public/css/Fhc.css',
'public/css/components/primevue.css',
),
'customJSs' => array(
)
@@ -149,8 +150,6 @@ $this->load->view(
break;
case Studierendenantrag_model::TYP_ABMELDUNG_STGL:
$allowed = [
Studierendenantragstatus_model::STATUS_APPROVED,
Studierendenantragstatus_model::STATUS_OBJECTED,
Studierendenantragstatus_model::STATUS_OBJECTION_DENIED,
Studierendenantragstatus_model::STATUS_DEREGISTERED
];
@@ -14,6 +14,8 @@ $sitesettings = array(
),
'customJSModules' => array('public/js/apps/lehre/Antrag/Lvzuweisung.js'),
'customCSSs' => array(
'public/css/Fhc.css',
'public/css/components/primevue.css',
),
'customJSs' => array(
)
@@ -30,7 +32,7 @@ $this->load->view(
<h1 class="h2"><?= $this->p->t('studierendenantrag', 'title_lvzuweisen', ['name' => $antrag->name]);?></h1>
</div>
<div class="fhc-container row mt-3">
<lv-zuweisung antrag-id="<?= $antrag_id; ?>" initial-status-code="<?= $antrag->status; ?>" initial-status-msg="<?= $antrag->statustyp; ?>"<?= ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED && $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED) ? ' disabled' : ''; ?>></lv-zuweisung>
<lv-zuweisung :antrag-id="<?= $antrag_id; ?>" initial-status-code="<?= $antrag->status; ?>" initial-status-msg="<?= $antrag->statustyp; ?>"<?= ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED && $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED) ? ' disabled' : ''; ?>></lv-zuweisung>
</div>
</div>
@@ -1,4 +1,5 @@
<?php
$this->load->config('anrechnung');
$this->load->view(
'templates/FHC-Header',
array(
@@ -172,14 +173,16 @@ $this->load->view(
<th class="col-xs-4"><?php echo $this->p->t('global', 'begruendung'); ?></th>
<td><span id="begruendung_id" data-begruendung_id="<?php echo $anrechnungData->begruendung_id ?>" ><?php echo $anrechnungData->begruendung ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php if ($this->config->item('explain_equivalence')): ?>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
@@ -4,6 +4,7 @@ const CHAR_LENGTH150 = 150;
const CHAR_LENGTH500 = 500;
const CHAR_LENGTH1000 = 1000;
$this->load->config('anrechnung');
$this->load->view(
'templates/FHC-Header',
array(
@@ -200,27 +201,29 @@ $this->load->view(
</div>
</div>
</div>
<!-- Begruendung ECTS -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<b><?php echo $this->p->t('anrechnung', 'begruendungEcts'); ?></b>&emsp;
<span class="requestAnrechnung-anrechnungInfoTooltip" data-toggle="tooltip" data-placement="right"
title="<?php echo $this->p->t('anrechnung', 'anrechnungBegruendungEctsTooltipText'); ?>">
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
</span>
</div>
<div class="panel-body">
<textarea class="form-control" name="begruendung_ects" rows="1" id="requestAnrechnung-begruendungEcts"
maxlength="<?php echo CHAR_LENGTH150 ?>" required><?php echo $anrechnungData->begruendung_ects; ?></textarea>
<small><span class="text-muted pull-right"><?php echo $this->p->t('ui', 'maxZeichen'); ?> :<span id="requestAnrechnung-begruendungEcts-charCounter"><?php echo CHAR_LENGTH150 ?></span></span></small>
<?php if ($this->config->item('explain_equivalence')): ?>
<!-- Begruendung ECTS -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<b><?php echo $this->p->t('anrechnung', 'begruendungEcts'); ?></b>&emsp;
<span class="requestAnrechnung-anrechnungInfoTooltip" data-toggle="tooltip" data-placement="right"
title="<?php echo $this->p->t('anrechnung', 'anrechnungBegruendungEctsTooltipText'); ?>">
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
</span>
</div>
<div class="panel-body">
<textarea class="form-control" name="begruendung_ects" rows="1" id="requestAnrechnung-begruendungEcts"
maxlength="<?php echo CHAR_LENGTH150 ?>" required><?php echo $anrechnungData->begruendung_ects; ?></textarea>
<small><span class="text-muted pull-right"><?php echo $this->p->t('ui', 'maxZeichen'); ?> :<span id="requestAnrechnung-begruendungEcts-charCounter"><?php echo CHAR_LENGTH150 ?></span></span></small>
</div>
</div>
</div>
</div>
</div>
<!-- Begruendung LV Inhalt -->
<div class="row">
<!-- Begruendung LV Inhalt -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
@@ -240,6 +243,8 @@ $this->load->view(
</div>
</div>
</div>
<?php endif; ?>
<!-- Dokument Upload-->
<div class="row">
<div class="col-lg-12">
@@ -1,4 +1,5 @@
<?php
$this->load->config('anrechnung');
$this->load->view(
'templates/FHC-Header',
array(
@@ -143,14 +144,16 @@ $this->load->view(
target="_blank"><?php echo htmlentities($anrechnungData->dokumentname) ?></a>
</td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php if ($this->config->item('explain_equivalence')): ?>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php endif; ?>
</tbody>
</table>
+8 -9
View File
@@ -1,13 +1,12 @@
<?php
$includesArray = array(
'title' => 'Test Search',
'jquery3' => true,
'bootstrap5' => true,
'fontawesome6' => true,
'tablesorter2' => true,
'tabulator5' => true,
'primevue3' => true,
'axios027' => true,
'vue3' => true,
'ajaxlib' => true,
'jqueryui1' => true,
'filtercomponent' => true,
'navigationcomponent' => true,
'phrases' => array(
@@ -17,8 +16,8 @@
'customCSSs' => array(
'public/css/components/verticalsplit.css',
'public/css/components/searchbar.css',
'public/css/components/primevue.css',
),
'customJSs' => array('vendor/axios/axios/axios.min.js'),
'customJSModules' => array('public/js/apps/TestSearch.js')
);
@@ -40,17 +39,17 @@
</div>
<div>
<searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction"></searchbar>
<core-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction"></core-searchbar>
<verticalsplit>
<core-verticalsplit>
<template #top>
<searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunctiondummy"></searchbar>
<core-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunctiondummy"></core-searchbar>
</template>
<template #bottom>
<!-- Filter component -->
<core-filter-cmpt filter-type="LogsViewer" @nw-new-entry="newSideMenuEntryHandler"></core-filter-cmpt>
</template>
</verticalsplit>
</core-verticalsplit>
</div>
</div>
@@ -127,6 +127,11 @@
generateJSsInclude('vendor/npm-asset/primevue/autocomplete/autocomplete.min.js');
generateJSsInclude('vendor/npm-asset/primevue/overlaypanel/overlaypanel.min.js');
generateJSsInclude('vendor/npm-asset/primevue/datatable/datatable.min.js');
// TODO check ob notwendig
generateJSsInclude('vendor/npm-asset/primevue/toast/toast.min.js');
generateJSsInclude('vendor/npm-asset/primevue/toastservice/toastservice.min.js');
generateJSsInclude('vendor/npm-asset/primevue/confirmdialog/confirmdialog.min.js');
generateJSsInclude('vendor/npm-asset/primevue/confirmationservice/confirmationservice.min.js');
}
// --------------------------------------------------------------------------------------------------------
+16 -15
View File
@@ -45,25 +45,22 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../../vendor/jquery/jquery1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>';
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../../vendor/jquery/jquery1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>';
const MOODLE_ADDON_KURZBZ = 'moodle';
// Load Addons to get Moodle_Path
$addon_obj = new addon();
if ($addon_obj->loadAddons())
// include moodle addon config if active
if ($addon_obj->checkActiveAddon(MOODLE_ADDON_KURZBZ) && file_exists('../../../addons/'.MOODLE_ADDON_KURZBZ.'/config.inc.php'))
{
if (count($addon_obj->result) > 0)
{
foreach ($addon_obj->result as $row)
{
if (file_exists('../../../addons/'.$row->kurzbz.'/config.inc.php'))
include_once('../../../addons/'.$row->kurzbz.'/config.inc.php');
}
}
include_once('../../../addons/'.MOODLE_ADDON_KURZBZ.'/config.inc.php');
}
echo '
@@ -117,6 +114,7 @@ echo '</SELECT>
<input type="submit" value="'.$p->t("services/filtern").'" />
</form>';
$servicekategorie_arr = $service->getKategorieArray();
if($oe_kurzbz!='')
{
@@ -134,6 +132,7 @@ echo '<table class="tablesorter" id="myTable">
<th>'.$p->t("global/bezeichnung").'</th>
<th>'.$p->t("services/leistung").'</th>
<th>'.$p->t("services/design").'</th>
<th>'.$p->t("services/kritikalitaet").'</th>
<th>'.$p->t("services/details").'</th>
</tr>
</thead>
@@ -159,6 +158,8 @@ foreach($service->result as $row)
echo '<td><nobr><a href="../profile/index.php?uid='.$row->design_uid.'">',$design,'</a></nobr></td>';
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->betrieb_uid.'">',$betrieb,'</a></nobr></td>';
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->operativ_uid.'">',$operativ,'</a></nobr></td>';
$title = (isset($servicekategorie_arr[$row->servicekategorie_kurzbz])?$servicekategorie_arr[$row->servicekategorie_kurzbz]:'');
echo '<td><span title="'.$service->convert_html_chars($title).'">',$title,'</span></td>';
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">Details</a>':'');
if (defined("ADDON_MOODLE_PATH"))
echo ' '.($row->ext_id!=''?'<a href="'.ADDON_MOODLE_PATH.'course/view.php?id='.$row->ext_id.'" target="_blank">Beschreibung</a>':'');
+4 -7
View File
@@ -62,7 +62,7 @@
$stsem = $_GET['stsem'];
else
die($p->t('anwesenheitsliste/studiensemesterIstUngueltig'));
$covidhelper = new CovidHelper();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -114,9 +114,6 @@ $covidhelper = new CovidHelper();
echo "</table>";
$qry = "SELECT *, tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id) JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
WHERE lehrveranstaltung_id='$lvid' AND studiensemester_kurzbz=".$db->db_add_param($stsem);
$qry = "SELECT *, tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester ,tbl_lehreinheit.lehrform_kurzbz
FROM lehre.tbl_lehreinheit
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
@@ -213,7 +210,7 @@ $covidhelper = new CovidHelper();
$covid_content = "<table border='0' cellspacing='0'><tr><td><h3>".$p->t('anwesenheitsliste/covidstatuslisten')."</h3></td></tr>".$covid_content."</table>";
else
$covid_content = ($covidhelper->isUdfDefined()) ? $p->t('anwesenheitsliste/keineStudentenVorhanden') : '';
if($aw_content!='')
$aw_content = "<table border='0' cellspacing='0'><tr><td><h3>".$p->t('anwesenheitsliste/anwesenheitslisten')."</h3></td></tr>".$aw_content."</table>";
else
@@ -241,9 +238,9 @@ $covidhelper = new CovidHelper();
{
$covid_content = '';
}
echo "<table cellpadding='0' cellspacing='0'>
<tr>
<td>$aw_content</td>
<td class=\"covidstatus\">$covid_content</td>
@@ -102,6 +102,22 @@ $noten_obj->getAll();
$sprachen = new sprache();
$sprachen->getAll(true);
$noten_array = array();
$js_noten='';
foreach ($noten_obj->result as $row)
{
$js_noten .= " noten_array['" . $row->note . "']='" . addslashes($row->bezeichnung) . "';\n";
$noten_array[$row->note]['bezeichnung'] = $row->bezeichnung;
$noten_array[$row->note]['positiv'] = $row->positiv;
$noten_array[$row->note]['aktiv'] = $row->aktiv;
$noten_array[$row->note]['lehre'] = $row->lehre;
$noten_array[$row->note]['lkt_ueberschreibbar'] = $row->lkt_ueberschreibbar;
$noten_array[$row->note]['anmerkung'] = $row->anmerkung;
foreach ($sprachen->result as $s)
$noten_array[$row->note]['bezeichnung_mehrsprachig'][$s->sprache] = $row->bezeichnung_mehrsprachig[$s->sprache];
}
$errormsg = '';
// eingetragene lv-gesamtnoten freigeben
@@ -326,19 +342,7 @@ echo '<!DOCTYPE HTML>
var noten_array = Array();
';
$noten_array = array();
foreach ($noten_obj->result as $row)
{
echo " noten_array['" . $row->note . "']='" . addslashes($row->bezeichnung) . "';\n";
$noten_array[$row->note]['bezeichnung'] = $row->bezeichnung;
$noten_array[$row->note]['positiv'] = $row->positiv;
$noten_array[$row->note]['aktiv'] = $row->aktiv;
$noten_array[$row->note]['lehre'] = $row->lehre;
$noten_array[$row->note]['lkt_ueberschreibbar'] = $row->lkt_ueberschreibbar;
$noten_array[$row->note]['anmerkung'] = $row->anmerkung;
foreach ($sprachen->result as $s)
$noten_array[$row->note]['bezeichnung_mehrsprachig'][$s->sprache] = $row->bezeichnung_mehrsprachig[$s->sprache];
}
echo $js_noten;
?>
@@ -806,16 +810,16 @@ foreach ($noten_obj->result as $row)
for(row in rows)
{
linenumber++;
if( rows[row] == '' )
if( rows[row] == '' )
{
//skip empty lines
continue;
}
zeile = rows[row].split(" ");
if( zeile.length < 2 )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ 'Zu wenig Paramter - 2 erforderlich. '
+ 'Die Zeile wurde uebersprungen.' + "\n\n";
continue;
@@ -917,36 +921,36 @@ foreach ($noten_obj->result as $row)
for(row in rows)
{
linenumber++;
if( rows[row] == '' )
if( rows[row] == '' )
{
//skip empty lines
continue;
}
zeile = rows[row].split(" ");
if( zeile.length < 3 )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ 'Zu wenig Paramter - 3 erforderlich. '
+ 'Die Zeile wurde uebersprungen.' + "\n\n";
continue;
}
if( zeile[1] == '' && zeile[2] == '' )
{
// ignore lines just copied from excel
// ignore lines just copied from excel
continue;
}
if( zeile[2] == '' )
if( zeile[2] == '' )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ "Die Note oder Punkte fehlen. "
+ "Die Zeile wurde uebersprungen. \n\n";
continue;
continue;
}
if (CIS_GESAMTNOTE_PUNKTE == false)
if (CIS_GESAMTNOTE_PUNKTE == false)
{
// check for valid grades
if (validGrades.indexOf(zeile[2]) === -1)
@@ -958,7 +962,7 @@ foreach ($noten_obj->result as $row)
}
}
if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) )
if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ "Das Datum "+zeile[1]+" fehlt oder ist nicht zulaessig. "
@@ -251,7 +251,7 @@ else
// deshalb wird hier versucht eine passende Lehreinheit zu ermitteln.
$lehreinheit_id = getLehreinheit($db, $lvid, $student_uid, $stsem);
$response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note);
$response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note, $punkte);
echo $response;
}
else
+1 -1
View File
@@ -270,7 +270,7 @@ if (isset($_POST['titel']))
foreach($addon_obj->result as $addon)
{
if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php'))
echo '<script type="application/x-javascript" src="../../../addons/'.$addon->kurzbz.'/cis/init.js.php" ></script>';
echo '<script type="application/x-javascript" src="../../../addons/'.$addon->kurzbz.'/cis/init.js.php"></script>';
}
// Wenn Seite fertig geladen ist Addons aufrufen
+11 -10
View File
@@ -65,6 +65,11 @@ $xsl_stg_kz = 0;
$sign = false;
/* Signing on CIS disabled
if(isset($_GET['sign']))
$sign = true;
*/
// Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll
if (isset($_GET['xsl_stg_kz']))
$xsl_stg_kz = $_GET['xsl_stg_kz'];
@@ -298,22 +303,18 @@ if ((((isset($_GET["uid"]) && $user == $_GET["uid"])) || $rechte->isBerechtigt('
$dokument->setFilename($filename);
if (!$dokument->create($output))
die($dokument->errormsg);
if ($sign === true)
{
if ($dokument->sign($user))
{
$dokument->output();
}
else
if (!$dokument->sign($user))
{
echo $dokument->errormsg;
}
}
else
$dokument->output();
if (!$dokument->create($output))
die($dokument->errormsg);
$dokument->output();
$dokument->close();
}
else
-2
View File
@@ -1222,7 +1222,6 @@ if ($projekt->getProjekteMitarbeiter($user, true))
<td colspan="4"><SELECT name="projekt" id="projekt">
<OPTION value="">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
sort($projekt->result);
$projektfound = false;
foreach ($projekt->result as $row_projekt)
{
@@ -1976,7 +1975,6 @@ function getDataForProjectOverviewCSV($user)
}
}
sort($csvData);
//headers schreiben
$header = array('PROJEKT', 'PROJEKT KURZBEZEICHNUNG', 'PROJEKTPHASE', 'PROJEKTPHASEN ID', 'START', 'PROJEKT ENDE');
@@ -60,7 +60,7 @@ if (isset($_GET['uid']))
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if ($rechte->isBerechtigt('admin') || (in_array($_GET['uid'], $untergebenen_arr)))
if ($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('mitarbeiter/zeitsperre') || (in_array($_GET['uid'], $untergebenen_arr)))
{
$uid = $_GET['uid'];
}
+2
View File
@@ -332,4 +332,6 @@ define('DOCSBOX_ENABLED', false);
// (true | false)
define('DIENSTVERHAELTNIS_SUPPORT', false);
// Falls Studstatus (Abmeldung, AbmeldungStg, Unterbrechung, Wiederholung) verwendet wird zeige Hinweistext bei Eingabe einer kommissionellen oder zusaetzlichen kommissionellen Pruefung
define('FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT', false);
?>
@@ -122,7 +122,7 @@ echo "<?xml-stylesheet href=\"".APP_ROOT."content/bindings.css\" type=\"text/css
<splitter class="tree-splitter"/>
<treecol id="lehrveranstaltung-noten-tree-verband" label="Verband" flex="2" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/zeugnisnote/rdf#verband" />
sort="rdf:http://www.technikum-wien.at/zeugnisnote/rdf#verband" />
<splitter class="tree-splitter"/>
<treecol id="lehrveranstaltung-noten-tree-studiengang_kz_lv" label="LehrveranstaltungStudiengang_kz" flex="1" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
@@ -299,7 +299,7 @@ if(defined('FAS_GESAMTNOTE_PRUEFUNGSHONORAR') && FAS_GESAMTNOTE_PRUEFUNGSHONORAR
<hbox>
<label value="MitarbeiterIn" control="lehrveranstaltung-noten-pruefung-menulist-mitarbeiter"/>
<menulist id="lehrveranstaltung-noten-pruefung-menulist-mitarbeiter"
datasources="'.APP_ROOT.'rdf/mitarbeiter.rdf.php" flex="1"
datasources="'.APP_ROOT.'rdf/mitarbeiter.rdf.php?aktiv=true" flex="1"
ref="http://www.technikum-wien.at/mitarbeiter/_alle"
minwidth="250"
>
+262 -66
View File
@@ -30,6 +30,8 @@ require_once('../../include/Excel/excel.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/studiensemester.class.php');
require_once('../../include/mail.class.php');
require_once('../../include/benutzerfunktion.class.php');
require_once('../../include/organisationseinheit.class.php');
$stsem = new studiensemester();
@@ -96,12 +98,11 @@ $qry_stg = "SELECT distinct studiengang_kz, typ, kurzbz
SELECT
studiengang_kz
FROM
lehre.tbl_projektbetreuer, lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
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
WHERE
lehre.tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
tbl_projektbetreuer.projektarbeit_id=tbl_projektarbeit.projektarbeit_id AND
tbl_projektarbeit.lehreinheit_id = tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
lehre.tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
) as foo
JOIN public.tbl_studiengang USING (studiengang_kz)
";
@@ -124,6 +125,10 @@ $workbook->setCustomColor(10, 255, 186, 179);
$format_colored =& $workbook->addFormat();
$format_colored->setFgColor(10);
$workbook->setCustomColor(10, 238, 238, 0);
$oe_colored =& $workbook->addFormat();
$oe_colored->setFgColor(11);
$format_number_colored =& $workbook->addFormat();
$format_number_colored->setNumFormat('0,0.00');
//$format_number_colored->setNumFormat('0.00');
@@ -185,6 +190,17 @@ if ($result_stg = $db->db_query($qry_stg))
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtkosten", $format_bold);
$worksheet->write(2, ++$i, "Gesamtstunden bestellt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden bestellt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten bestellt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtkosten bestellt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtstunden erteilt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden erteilt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten erteilt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtkosten erteilt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtstunden angenommen", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden angenommen", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten angenommen", $format_bold);
@@ -209,7 +225,7 @@ if ($result_stg = $db->db_query($qry_stg))
SELECT tbl_organisationseinheit.organisationseinheittyp_kurzbz || ' ' || tbl_organisationseinheit.bezeichnung
FROM PUBLIC.tbl_benutzerfunktion
JOIN PUBLIC.tbl_organisationseinheit USING (oe_kurzbz)
WHERE funktion_kurzbz = 'oezuordnung'
WHERE funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
AND (
datum_von IS NULL
OR datum_von <= now()
@@ -229,7 +245,7 @@ if ($result_stg = $db->db_query($qry_stg))
WHERE oe_kurzbz IN (
SELECT oe_kurzbz
FROM PUBLIC.tbl_benutzerfunktion
WHERE funktion_kurzbz = 'oezuordnung'
WHERE funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
AND (
datum_von IS NULL
OR datum_von <= now()
@@ -262,26 +278,20 @@ if ($result_stg = $db->db_query($qry_stg))
THEN 't'
ELSE 'f'
END AS geaendert,
(SELECT
vertragsstatus_kurzbz
FROM
lehre.tbl_vertrag_vertragsstatus
WHERE
vertrag_id = tbl_lehreinheitmitarbeiter.vertrag_id
ORDER BY datum DESC
LIMIT 1) as vertragsstatus
FROM lehre.tbl_lehreinheit,
lehre.tbl_lehreinheitmitarbeiter,
PUBLIC.tbl_mitarbeiter,
PUBLIC.tbl_benutzer,
PUBLIC.tbl_person,
lehre.tbl_lehrveranstaltung
WHERE tbl_person.person_id = tbl_benutzer.person_id
AND tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid
AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid = tbl_mitarbeiter.mitarbeiter_uid
AND tbl_lehreinheit.lehreinheit_id = tbl_lehreinheitmitarbeiter.lehreinheit_id
AND tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
AND studiengang_kz = ".$db->db_add_param($studiengang_kz)."
(SELECT
ARRAY_TO_STRING(ARRAY_AGG(vertragsstatus_kurzbz), ',')
FROM
lehre.tbl_vertrag_vertragsstatus
WHERE
vertrag_id = tbl_lehreinheitmitarbeiter.vertrag_id
) as vertragsstatus
FROM lehre.tbl_lehreinheit
JOIN lehre.tbl_lehreinheitmitarbeiter ON tbl_lehreinheit.lehreinheit_id = tbl_lehreinheitmitarbeiter.lehreinheit_id
JOIN PUBLIC.tbl_mitarbeiter ON tbl_lehreinheitmitarbeiter.mitarbeiter_uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN PUBLIC.tbl_benutzer ON tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN PUBLIC.tbl_person ON tbl_person.person_id = tbl_benutzer.person_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
WHERE studiengang_kz = ".$db->db_add_param($studiengang_kz)."
AND studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)."
AND tbl_lehreinheitmitarbeiter.semesterstunden <> 0
AND tbl_lehreinheitmitarbeiter.semesterstunden IS NOT NULL
@@ -302,6 +312,7 @@ if ($result_stg = $db->db_query($qry_stg))
$gesamtsheet_row++;
while ($row = $db->db_fetch_object($result))
{
$row->vertragsstatus = explode(',', $row->vertragsstatus);
//Gesamtstunden und Kosten ermitteln
if (array_key_exists($row->mitarbeiter_uid, $liste))
{
@@ -314,13 +325,43 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->mitarbeiter_uid]['gesamtkosten'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten'] + ($row->semesterstunden * $row->stundensatz);
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_akzeptiert'] = 0;
}
if ($row->vertragsstatus == 'akzeptiert')
if (in_array('bestellt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('erteilt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('akzeptiert', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] + $row->semesterstunden;
@@ -336,13 +377,43 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->mitarbeiter_uid]['gesamtstunden'] = $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten'] = $row->semesterstunden * $row->stundensatz;
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_akzeptiert'] = 0;
}
if ($row->vertragsstatus == 'akzeptiert')
if (in_array('bestellt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('erteilt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('akzeptiert', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] + $row->semesterstunden;
@@ -356,8 +427,20 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->mitarbeiter_uid]['vorname'] = $row->vorname;
$liste[$row->mitarbeiter_uid]['nachname'] = $row->nachname;
$liste[$row->mitarbeiter_uid]['fixangestellt'] = $row->fixangestellt;
$liste[$row->mitarbeiter_uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->mitarbeiter_uid]['department'] = $row->department;
if (is_null($row->oezuordnung))
{
$oeInfos = getOe($row->mitarbeiter_uid, $row->fixangestellt);
$liste[$row->mitarbeiter_uid]['oezuordnung'] = $oeInfos['oezuordnung'];
$liste[$row->mitarbeiter_uid]['department'] = $oeInfos['department'];
$liste[$row->mitarbeiter_uid]['organisationgeaendert'] = $oeInfos['organisationgeaendert'];
}
else
{
$liste[$row->mitarbeiter_uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->mitarbeiter_uid]['department'] = $row->department;
}
$liste[$row->mitarbeiter_uid]['betreuergesamtstunden'] = 0;
$liste[$row->mitarbeiter_uid]['betreuergesamtkosten'] = 0;
if ($row->geaendert == 't')
@@ -375,7 +458,7 @@ if ($result_stg = $db->db_query($qry_stg))
public.tbl_benutzerfunktion
JOIN public.tbl_organisationseinheit USING (oe_kurzbz)
WHERE
funktion_kurzbz='oezuordnung'
funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
AND (datum_von IS NULL OR datum_von <= now())
AND (datum_bis IS NULL OR datum_bis >= now())
AND tbl_benutzerfunktion.uid = tbl_benutzer.uid
@@ -390,7 +473,7 @@ if ($result_stg = $db->db_query($qry_stg))
WHERE oe_kurzbz IN (
SELECT oe_kurzbz
FROM PUBLIC.tbl_benutzerfunktion
WHERE funktion_kurzbz = 'oezuordnung'
WHERE funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
AND (
datum_von IS NULL
OR datum_von <= now()
@@ -419,27 +502,23 @@ if ($result_stg = $db->db_query($qry_stg))
WHERE meine_oes.organisationseinheittyp_kurzbz = 'Department'
) AS department
FROM
lehre.tbl_projektbetreuer, public.tbl_person, public.tbl_benutzer,
public.tbl_mitarbeiter, lehre.tbl_projektarbeit, lehre.tbl_lehreinheit,
lehre.tbl_lehrveranstaltung
lehre.tbl_projektbetreuer JOIN public.tbl_person ON tbl_projektbetreuer.person_id=tbl_person.person_id
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
WHERE
tbl_projektbetreuer.person_id=tbl_person.person_id AND
tbl_person.person_id=tbl_benutzer.person_id AND
tbl_mitarbeiter.mitarbeiter_uid=tbl_benutzer.uid 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_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
NOT EXISTS (SELECT
mitarbeiter_uid
FROM
lehre.tbl_lehreinheitmitarbeiter, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
lehre.tbl_lehreinheitmitarbeiter JOIN lehre.tbl_lehreinheit ON tbl_lehreinheitmitarbeiter.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id
WHERE
mitarbeiter_uid=tbl_benutzer.uid AND
tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
tbl_lehreinheitmitarbeiter.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheitmitarbeiter.semesterstunden<>0 AND
tbl_lehreinheitmitarbeiter.semesterstunden is not null AND
EXISTS (
@@ -461,8 +540,20 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->uid]['vorname'] = $row->vorname;
$liste[$row->uid]['nachname'] = $row->nachname;
$liste[$row->uid]['fixangestellt'] = $row->fixangestellt;
$liste[$row->uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->uid]['department'] = $row->department;
if (is_null($row->oezuordnung))
{
$oeInfos = getOe($row->uid, $row->fixangestellt);
$liste[$row->uid]['oezuordnung'] = $oeInfos['oezuordnung'];
$liste[$row->uid]['department'] = $oeInfos['department'];
$liste[$row->uid]['organisationgeaendert'] = $oeInfos['organisationgeaendert'];
}
else
{
$liste[$row->uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->uid]['department'] = $row->department;
}
$liste[$row->uid]['geaendert'] = false;
$liste[$row->uid]['gesamtstunden'] = 0;
$liste[$row->uid]['gesamtkosten'] = 0;
@@ -488,32 +579,29 @@ if ($result_stg = $db->db_query($qry_stg))
ELSE
'f'
END as geaendert,
(
SELECT
vertragsstatus_kurzbz
(SELECT
ARRAY_TO_STRING(ARRAY_AGG(vertragsstatus_kurzbz), ',')
FROM
lehre.tbl_vertrag_vertragsstatus
WHERE
vertrag_id = tbl_projektbetreuer.vertrag_id
ORDER BY datum DESC
LIMIT 1
) as vertragsstatus
FROM lehre.tbl_projektbetreuer, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung,
public.tbl_benutzer, lehre.tbl_projektarbeit, campus.vw_student
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 campus.vw_student ON vw_student.uid = student_uid
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
tbl_benutzer.uid = ".$db->db_add_param($uid)."
AND tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
AND tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
AND tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER);
if ($result = $db->db_query($qry))
{
while ($row = $db->db_fetch_object($result))
{
$row->vertragsstatus = explode(',', $row->vertragsstatus);
$liste[$uid]['gesamtstunden'] = $liste[$uid]['gesamtstunden'] + $row->stunden;
$liste[$uid]['gesamtkosten'] =
$liste[$uid]['gesamtkosten'] + ($row->stunden * $row->stundensatz);
@@ -524,13 +612,42 @@ if ($result_stg = $db->db_query($qry_stg))
{
$liste[$uid]['geaendert'] = true;
}
if (!isset($liste[$uid]['gesamtstunden_bestellt']))
{
$liste[$uid]['gesamtstunden_bestellt'] = 0;
$liste[$uid]['gesamtkosten_bestellt'] = 0;
}
if (!isset($liste[$uid]['gesamtstunden_erteilt']))
{
$liste[$uid]['gesamtstunden_erteilt'] = 0;
$liste[$uid]['gesamtkosten_erteilt'] = 0;
}
if (!isset($liste[$uid]['gesamtstunden_akzeptiert']))
{
$liste[$uid]['gesamtstunden_akzeptiert'] = 0;
$liste[$uid]['gesamtkosten_akzeptiert'] = 0;
}
if ($row->vertragsstatus == 'akzeptiert')
if (in_array('bestellt', $row->vertragsstatus))
{
$liste[$uid]['gesamtstunden_bestellt'] =
$liste[$uid]['gesamtstunden_bestellt'] + $row->stunden;
$liste[$uid]['gesamtkosten_bestellt'] =
$liste[$uid]['gesamtkosten_bestellt'] + ($row->stunden * $row->stundensatz);
}
if (in_array('erteilt', $row->vertragsstatus))
{
$liste[$uid]['gesamtstunden_erteilt'] =
$liste[$uid]['gesamtstunden_erteilt'] + $row->stunden;
$liste[$uid]['gesamtkosten_erteilt'] =
$liste[$uid]['gesamtkosten_erteilt'] + ($row->stunden * $row->stundensatz);
}
if (in_array('akzeptiert', $row->vertragsstatus))
{
$liste[$uid]['gesamtstunden_akzeptiert'] =
$liste[$uid]['gesamtstunden_akzeptiert'] + $row->stunden;
@@ -558,13 +675,20 @@ if ($result_stg = $db->db_query($qry_stg))
if (isset($row['geaendert']) && $row['geaendert'] == true)
{
$format = $format_colored;
$formatOE = $format_colored;
$formatnb = $format_number_colored;
}
else
{
$format = $format_normal;
$formatOE = $format_normal;
$formatnb = $format_number;
}
if(isset($row['organisationgeaendert']) && $row['organisationgeaendert'] === true)
{
$formatOE = $oe_colored;
}
//Studiengang
$worksheet->write($zeile, $i, $studiengang->kuerzel, $format);
$gesamt->write($gesamtsheet_row, $i, $studiengang->kuerzel, $format);
@@ -584,11 +708,11 @@ if ($result_stg = $db->db_query($qry_stg))
$worksheet->write($zeile, ++$i, $row['fixangestellt'], $format);
$gesamt->write($gesamtsheet_row, $i, $row['fixangestellt'], $format);
//OE-Zuordnung
$worksheet->write($zeile, ++$i, $row['oezuordnung'], $format);
$gesamt->write($gesamtsheet_row, $i, $row['oezuordnung'], $format);
$worksheet->write($zeile, ++$i, $row['oezuordnung'], $formatOE);
$gesamt->write($gesamtsheet_row, $i, $row['oezuordnung'], $formatOE);
//Department der OE-Zuordnung
$worksheet->write($zeile, ++$i, $row['department'], $format);
$gesamt->write($gesamtsheet_row, $i, $row['department'], $format);
$worksheet->write($zeile, ++$i, $row['department'], $formatOE);
$gesamt->write($gesamtsheet_row, $i, $row['department'], $formatOE);
//LVStunden
$lvstunden = str_replace(', ', '.', $row['lvstunden']);
$worksheet->write($zeile, ++$i, $lvstunden, $format);
@@ -613,6 +737,25 @@ if ($result_stg = $db->db_query($qry_stg))
$gesamtkosten_row = str_replace(', ', '.', $row['gesamtkosten']);
$worksheet->writeNumber($zeile, ++$i, $gesamtkosten_row, $formatnb);
$gesamt->writeNumber($gesamtsheet_row, $i, $gesamtkosten_row, $formatnb);
//Gesamtstunden bestellt
$gesamtstunden_bestellt = str_replace(', ', '.', $row['gesamtstunden_bestellt']);
$worksheet->write($zeile, ++$i, $gesamtstunden_bestellt, $formatnb);
$gesamt->write($gesamtsheet_row, $i, $gesamtstunden_bestellt, $formatnb);
//Gesamtkosten bestellt
$gesamtkosten_bestellt_row = str_replace(', ', '.', $row['gesamtkosten_bestellt']);
$worksheet->writeNumber($zeile, ++$i, $gesamtkosten_bestellt_row, $formatnb);
$gesamt->writeNumber($gesamtsheet_row, $i, $gesamtkosten_bestellt_row, $formatnb);
//Gesamtstunden erteilt
$gesamtstunden_erteilt = str_replace(', ', '.', $row['gesamtstunden_erteilt']);
$worksheet->write($zeile, ++$i, $gesamtstunden_erteilt, $formatnb);
$gesamt->write($gesamtsheet_row, $i, $gesamtstunden_erteilt, $formatnb);
//Gesamtkosten erteilt
$gesamtkosten_erteilt_row = str_replace(', ', '.', $row['gesamtkosten_erteilt']);
$worksheet->writeNumber($zeile, ++$i, $gesamtkosten_erteilt_row, $formatnb);
$gesamt->writeNumber($gesamtsheet_row, $i, $gesamtkosten_erteilt_row, $formatnb);
//Gesamtstunden akzeptiert
$gesamtstunden_akzeptiert = str_replace(', ', '.', $row['gesamtstunden_akzeptiert']);
$worksheet->write($zeile, ++$i, $gesamtstunden_akzeptiert, $formatnb);
@@ -641,11 +784,31 @@ if ($result_stg = $db->db_query($qry_stg))
else
$liste_gesamt[$uid]['gesamtkosten'] = $row['gesamtkosten'];
if (isset($liste_gesamt[$uid]['gesamtstunden_bestellt']))
$liste_gesamt[$uid]['gesamtstunden_bestellt'] += $row['gesamtstunden_bestellt'];
else
$liste_gesamt[$uid]['gesamtstunden_bestellt'] = $row['gesamtstunden_bestellt'];
if (isset($liste_gesamt[$uid]['gesamtkosten_bestellt']))
$liste_gesamt[$uid]['gesamtkosten_bestellt'] += $row['gesamtkosten_bestellt'];
else
$liste_gesamt[$uid]['gesamtkosten_bestellt'] = $row['gesamtkosten_bestellt'];
if (isset($liste_gesamt[$uid]['gesamtstunden_erteilt']))
$liste_gesamt[$uid]['gesamtstunden_erteilt'] += $row['gesamtstunden_erteilt'];
else
$liste_gesamt[$uid]['gesamtstunden_erteilt'] = $row['gesamtstunden_erteilt'];
if (isset($liste_gesamt[$uid]['gesamtkosten_erteilt']))
$liste_gesamt[$uid]['gesamtkosten_erteilt'] += $row['gesamtkosten_erteilt'];
else
$liste_gesamt[$uid]['gesamtkosten_erteilt'] = $row['gesamtkosten_erteilt'];
if (isset($liste_gesamt[$uid]['gesamtstunden_akzeptiert']))
$liste_gesamt[$uid]['gesamtstunden_akzeptiert'] += $row['gesamtstunden_akzeptiert'];
else
$liste_gesamt[$uid]['gesamtstunden_akzeptiert'] = $row['gesamtstunden_akzeptiert'];
if (isset($liste_gesamt[$uid]['gesamtkosten_akzeptiert']))
$liste_gesamt[$uid]['gesamtkosten_akzeptiert'] += $row['gesamtkosten_akzeptiert'];
else
@@ -745,3 +908,36 @@ if ($result_stg = $db->db_query($qry_stg))
else
echo "Fehler beim Versenden der Lehrauftragsliste";
}
function getOe($mitarbeiter_uid, $fixangestellt)
{
$benutzerfunktion = new Benutzerfunktion();
$oe = new Organisationseinheit();
$benutzerfunktion->getBenutzerFunktionByUid($mitarbeiter_uid, $fixangestellt === 'Ja' ? 'kstzuordnung' : 'oezuordnung', date('Y-m-d'));
if (isset($benutzerfunktion->result[0]))
{
array_multisort(array_column($benutzerfunktion->result, 'datum_von'), SORT_ASC, $benutzerfunktion->result);
}
else
{
$benutzerfunktion->getBenutzerFunktionByUid($mitarbeiter_uid, $fixangestellt === 'Ja' ? 'kstzuordnung' : 'oezuordnung', null, date('Y-m-d'));
array_multisort(array_column($benutzerfunktion->result, 'datum_bis'), SORT_DESC, $benutzerfunktion->result);
}
if (!isset($benutzerfunktion->result[0]))
return array('oezuordnung' => '', 'department' => '', 'organisationgeaendert' => false);
$oe->load($benutzerfunktion->result[0]->oe_kurzbz);
$oezuordnung = $oe->organisationseinheittyp_kurzbz . ' ' . $oe->bezeichnung;
$oe_parents = $oe->getParents_withOEType($oe->oe_kurzbz);
if (is_array($oe_parents))
$department = ($oe_parents[array_search('Department', array_column($oe_parents, 'oe_typ_bezeichnung'))]->oe_bezeichnung);
else
$department = '';
return array('oezuordnung' => $oezuordnung, 'department' => $department, 'organisationgeaendert' => true);
}
+87 -22
View File
@@ -74,7 +74,10 @@ require_once('../../include/reihungstest.class.php');
require_once('../../include/studienplan.class.php');
require_once('../../include/mobilitaet.class.php');
require_once('../../include/studienordnung.class.php');
require_once('../../include/mitarbeiter.class.php');
require_once('../../include/bisverwendung.class.php');
require_once('../../include/bismeldestichtag.class.php');
require_once('../../include/stundensatz.class.php');
$user = get_uid();
$db = new basis_db();
@@ -4654,6 +4657,7 @@ if(!$error)
$errormsg = 'Fehlerhafte Parameteruebergabe';
}
}
elseif(isset($_POST['type']) && $_POST['type']=='getstundensatz')
{
if(isset($_POST['person_id']) && isset($_POST['studiensemester_kurzbz']))
@@ -4661,33 +4665,87 @@ if(!$error)
$studiensemester = new studiensemester();
if ($studiensemester->load($_POST['studiensemester_kurzbz']))
{
$qry = "SELECT ss.stundensatz
FROM hr.tbl_stundensatz ss
JOIN public.tbl_mitarbeiter ON ss.uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN public.tbl_benutzer ON(tbl_benutzer.uid=tbl_mitarbeiter.mitarbeiter_uid)
WHERE person_id=".$db->db_add_param($_POST['person_id'], FHC_INTEGER) ."
AND stundensatztyp = ". $db->db_add_param('lehre') ."
AND gueltig_von <= ". $db->db_add_param($studiensemester->ende) ."
AND (gueltig_bis >= ". $db->db_add_param($studiensemester->start) ." OR gueltig_bis IS NULL)
ORDER BY gueltig_bis DESC NULLS FIRST, gueltig_von DESC NULLS LAST LIMIT 1
";
if($result = $db->db_query($qry))
if (defined('FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ')
&& !FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ)
{
if($row = $db->db_fetch_object($result))
// Mitarbeiter laden
$qry = "
SELECT
mitarbeiter_uid, fixangestellt
FROM
public.tbl_mitarbeiter
JOIN public.tbl_benutzer ON(tbl_benutzer.uid=tbl_mitarbeiter.mitarbeiter_uid)
WHERE
person_id=".$db->db_add_param($_POST['person_id'], FHC_INTEGER) ."
ORDER BY tbl_mitarbeiter.insertamum DESC NULLS LAST LIMIT 1
";
if($result = $db->db_query($qry))
{
$data = $row->stundensatz;
$return = true;
}
else
{
$data = '80.00';
$return = true;
if($row = $db->db_fetch_object($result))
{
$uid = $row->mitarbeiter_uid;
if($db->db_parse_bool($row->fixangestellt)==true)
{
// Fixangestellte haben keinen Stundensatz
$data = '';
$return = true;
}
else
{
// Stundensatz des Mitarbeiters laden
$stundensatz = new stundensatz();
if($stundensatz->getStundensatzDatum($uid, $studiensemester->start, $studiensemester->ende, 'lehre'))
{
$data = $stundensatz->stundensatz;
$return = true;
}
else
{
// Keine Stundensatz hinterlegt
$data = '0.00';
$return = true;
}
}
}
else
{
// Kein Mitarbeiter gefunden, kein Stundensatz
$data = '0.00';
$return = true;
}
}
}
else
{
$return = false;
$errormsg = 'Unbekannter Fehler';
$qry = "SELECT ss.stundensatz
FROM hr.tbl_stundensatz ss
JOIN public.tbl_mitarbeiter ON ss.uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN public.tbl_benutzer ON(tbl_benutzer.uid=tbl_mitarbeiter.mitarbeiter_uid)
WHERE person_id=".$db->db_add_param($_POST['person_id'], FHC_INTEGER) ."
AND stundensatztyp = ". $db->db_add_param('lehre') ."
AND gueltig_von <= ". $db->db_add_param($studiensemester->ende) ."
AND (gueltig_bis >= ". $db->db_add_param($studiensemester->start) ." OR gueltig_bis IS NULL)
ORDER BY gueltig_bis DESC NULLS FIRST, gueltig_von DESC NULLS LAST LIMIT 1
";
if($result = $db->db_query($qry))
{
if($row = $db->db_fetch_object($result))
{
$data = $row->stundensatz;
$return = true;
}
else
{
$data = '80.00';
$return = true;
}
}
else
{
$return = false;
$errormsg = 'Unbekannter Fehler';
}
}
}
else
@@ -4695,8 +4753,15 @@ if(!$error)
$return = false;
$errormsg = 'Fehler beim Laden des Studiensemesters';
}
}
}
else
{
$data = '20.00'.$_POST['studiensemester_kurzbz'];
$return = true;
}
}
elseif(isset($_POST['type']) && $_POST['type']=='saveanrechnung')
{
$anrechnung = new anrechnung();
@@ -137,7 +137,7 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#pruefer1_nachname" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#pruefer2_nachname" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#pruefer3_nachname" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#abschlussbeurteilung_kurzbz" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#abschlussbeurteilung_bezeichnung" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#datum" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#uhrzeit" />
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#freigabedatum" />
+15 -2
View File
@@ -1658,7 +1658,7 @@ function StudentAuswahl()
var antragnotentree = document.getElementById('student-antragnoten-tree');
url='<?php echo APP_ROOT;?>index.ci.php/components/Antrag/Wiederholung/getLvsAsRdf/'+prestudent_id+"?"+gettimestamp();
url='<?php echo APP_ROOT;?>index.ci.php/api/frontend/fas/studstatus/Wiederholung/getLvs/'+prestudent_id+"?"+gettimestamp();
try
{
@@ -4764,7 +4764,7 @@ function StudentNotenMoveFromAntrag()
var paramList= '';
var i = 0;
var url = '<?php echo APP_ROOT ?>index.ci.php/components/Antrag/Wiederholung/moveLvsToZeugnis';
var url = '<?php echo APP_ROOT ?>index.ci.php/api/frontend/fas/studstatus/Wiederholung/moveLvsToZeugnis';
var req = new phpRequest(url,'','');
for (var t = 0; t < numRanges; t++)
@@ -5139,6 +5139,7 @@ function StudentPruefungNeu()
document.getElementById('student-pruefung-menulist-note').value='9';
document.getElementById('student-pruefung-textbox-datum').value='<?php echo date('d.m.Y');?>';
document.getElementById('student-pruefung-textbox-anmerkung').value='';
StudentPruefungTypChange();
}
// ****
@@ -5190,6 +5191,17 @@ function StudentPruefungLVAChange()
LEDropDown.selectedIndex=-1;
}
// ****
// * Wenn der Typ der Pruefung geaendert wird, dann wird ein Hinweistext angezeigt.
// ****
function StudentPruefungTypChange()
{
var typ = document.getElementById('student-pruefung-menulist-typ').value;
var hinweisid = document.getElementById('student-pruefung-textbox-datum-hinweis');
if(hinweisid === null) return;
hinweisid.hidden = (typ != 'kommPruef' && typ != 'zusKommPruef');
}
// ****
// * Speichert die Pruefung
// ****
@@ -5424,6 +5436,7 @@ function StudentPruefungAuswahl()
document.getElementById('student-pruefung-checkbox-neu').checked=false;
document.getElementById('student-pruefung-textbox-pruefung_id').value=pruefung_id;
document.getElementById('student-pruefung-textbox-punkte').value=punkte;
StudentPruefungTypChange();
}
function StudentPruefungFilterStsem()
+37 -4
View File
@@ -393,6 +393,7 @@ function StudentProjektarbeitAuswahl()
anmerkung = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#anmerkung" ));
gesamtstunden = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#gesamtstunden" ));
final = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#final" ));
var lehreinheit_stsem = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#lehreinheit_stsem" ));
var stg_kz = document.getElementById('student-detail-menulist-studiengang_kz').value;
@@ -440,6 +441,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-projekttyp').value=projekttyp_kurzbz;
document.getElementById('student-projektarbeit-menulist-lehrveranstaltung').value=lehrveranstaltung_id;
document.getElementById('student-projektarbeit-menulist-lehreinheit').value=lehreinheit_id;
@@ -649,6 +651,8 @@ function StudentProjektarbeitNeu()
document.getElementById('student-projektarbeit-checkbox-neu').checked=true;
document.getElementById('student-projektarbeit-textbox-projektarbeit_id').value='';
document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value='';
StudentProjektarbeitResetFields();
StudentProjektarbeitDetailDisableFields(false);
StudentProjektbetreuerDisableFields(true);
@@ -872,6 +876,7 @@ function StudentProjektbetreuerAuswahl()
name = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#name" ));
punkte = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#punkte" ));
stunden = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#stunden" ));
stundensatz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#stundensatz" ));
betreuerart_kurzbz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#betreuerart_kurzbz" ));
person_nachname = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#person_nachname" ));
@@ -892,6 +897,16 @@ 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);
if (default_stundensatz != '')
default_stundensatz = 'Stundensatz (Default '+default_stundensatz+'):';
else
default_stundensatz = 'Stundensatz';
document.getElementById('student-projektbetreuer-label-stundensatz').value= default_stundensatz;
var gesamtkosten = StudentProjektbetreuerGesamtkosten();
@@ -1171,7 +1186,9 @@ function StudentProjektbetreuerDetailReset()
document.getElementById('student-projektbetreuer-textbox-stunden').value='0.0';
document.getElementById('student-projektbetreuer-menulist-betreuerart').value='Begutachter';
}
document.getElementById('student-projektbetreuer-textbox-stundensatz').value='80.0';
document.getElementById('student-projektbetreuer-label-stundensatz').value= 'Stundensatz (Default 80.0):';
document.getElementById('student-projektbetreuer-menulist-person').value='';
}
@@ -1358,16 +1375,16 @@ function StudentProjektbetreuerLoeschen()
}
}
function StudentProjektbetreuerLoadMitarbeiterDaten()
function StudentProjektbetreuerLoadStundensatz(person_id, studiensemester)
{
person_id = MenulistGetSelectedValue('student-projektbetreuer-menulist-person');
var stundensatz='';
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'getstundensatz');
req.add('person_id', person_id);
req.add('studiensemester_kurzbz', getStudiensemester())
req.add('studiensemester_kurzbz', studiensemester)
var response = req.executePOST();
@@ -1385,7 +1402,23 @@ function StudentProjektbetreuerLoadMitarbeiterDaten()
stundensatz = val.dbdml_data
}
document.getElementById('student-projektbetreuer-textbox-stundensatz').value=stundensatz;
return stundensatz;
}
function StudentProjektbetreuerLoadMitarbeiterDaten()
{
var person_id = MenulistGetSelectedValue('student-projektbetreuer-menulist-person');
var lehreinheitstsem = document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value;
var stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, lehreinheitstsem);
if (stundensatz != '')
default_stundensatz = 'Stundensatz (Default '+stundensatz+'):';
else
default_stundensatz = 'Stundensatz';
document.getElementById('student-projektbetreuer-label-stundensatz').value = default_stundensatz;
document.getElementById('student-projektbetreuer-textbox-stundensatz').value = stundensatz;
}
// ****
@@ -171,7 +171,11 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
<rows>
<row>
<label value="Projektarbeit ID" control="student-projektarbeit-textbox-projektarbeit_id"/>
<hbox><textbox id="student-projektarbeit-textbox-projektarbeit_id" readonly="true" maxlength="16" size="16"/></hbox>
<hbox>
<textbox id="student-projektarbeit-textbox-projektarbeit_id" readonly="true" maxlength="16" size="16"/>
<textbox id="student-projektarbeit-textbox-lehreinheit_stsem" hidden="true" readonly="true" maxlength="32" size="32"/>
</hbox>
</row>
<row>
<label value="Titel" control="student-projektarbeit-textbox-titel"/>
@@ -523,7 +527,7 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
<textbox id="student-projektbetreuer-textbox-stunden" disabled="true" maxlength="8"/>
</row>
<row>
<label value="Stundensatz" control="student-projektbetreuer-textbox-stundensatz"/>
<label id="student-projektbetreuer-label-stundensatz" value="Stundensatz: " control="student-projektbetreuer-textbox-stundensatz"/>
<textbox id="student-projektbetreuer-textbox-stundensatz" disabled="true" maxlength="5"/>
</row>
<row hidden="true"><!-- Faktor wird nicht mehr benoetigt -->
+13 -1
View File
@@ -34,6 +34,11 @@ if(defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE)
else
$punktehidden = 'true';
if(defined('FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT') && FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT)
$show_komm_prfg_hint = true;
else
$show_komm_prfg_hint = false;
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
?>
@@ -203,7 +208,8 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<label value="Typ" control="student-pruefung-menulist-typ"/>
<menulist id="student-pruefung-menulist-typ" disabled="true"
datasources="<?php echo APP_ROOT; ?>rdf/pruefungstyp.rdf.php?abschluss=false" flex="1"
ref="http://www.technikum-wien.at/pruefungstyp/liste" >
ref="http://www.technikum-wien.at/pruefungstyp/liste"
oncommand="StudentPruefungTypChange()">
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/pruefungstyp/rdf#pruefungstyp_kurzbz"
@@ -251,6 +257,12 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<spacer flex="1" />
</hbox>
</row>
<?php if($show_komm_prfg_hint) { ?>
<row id="student-pruefung-textbox-datum-hinweis" hidden="true">
<label><image width="20" class="message-icon"/></label>
<textbox readonly="true" multiline="true" rows="3" value="Bitte bei Neuanlage einer kommissionellen Prüfung das Datum der Noteneintragung (i. d. R. heute) eintragen, um den korrekten Fristenablauf der Wiederholung zu ermöglichen. Das Datum der Prüfung bitte im Anmerkungsfeld vermerken."></textbox>
</row>
<?php } ?>
<row>
<label value="Anmerkung" control="student-pruefung-textbox-anmerkung"/>
<textbox id="student-pruefung-textbox-anmerkung" disabled="true" maxlength="256"/>
+9 -1
View File
@@ -317,7 +317,7 @@ class mitarbeiter extends benutzer
* gibt array mit allen Mitarbeitern zurueck
* @return array mit Mitarbeitern
*/
public function getMitarbeiter($lektor=true,$fixangestellt=null,$stg_kz=null)
public function getMitarbeiter($lektor=true,$fixangestellt=null,$stg_kz=null, $aktiv=null)
{
$sql_query='SELECT DISTINCT campus.vw_mitarbeiter.uid, titelpre, titelpost, vorname, vornamen, wahlname, nachname, gebdatum, gebort, gebzeit, anmerkung, aktiv,
homepage, campus.vw_mitarbeiter.updateamum, campus.vw_mitarbeiter.updatevon, personalnummer, kurzbz, lektor, fixangestellt, standort_id, telefonklappe FROM campus.vw_mitarbeiter
@@ -346,6 +346,14 @@ class mitarbeiter extends benutzer
$sql_query.=" AND oe_kurzbz=".$this->db_add_param($stg->oe_kurzbz);
}
if(!is_null($aktiv))
{
$sql_query.=' AND';
if (!$aktiv)
$sql_query.=' NOT';
$sql_query.=' aktiv';
}
$sql_query.=' ORDER BY nachname, vornamen, kurzbz;';
if(!$this->db_query($sql_query))
+3 -1
View File
@@ -382,7 +382,7 @@ class projekt extends basis_db
JOIN fue.tbl_projekt_ressource USING(ressource_id)
JOIN fue.tbl_projekt USING(projekt_kurzbz)
WHERE (beginn<=now() or beginn is null)
AND (ende + interval '1 month 1 day' >=now() OR ende is null)
AND (ende + interval '2 month 1 day' >=now() OR ende is null)
AND
(
mitarbeiter_uid=" . $this->db_add_param($mitarbeiter_uid) . " OR
@@ -413,6 +413,8 @@ class projekt extends basis_db
AND mitarbeiter_uid=" . $this->db_add_param($mitarbeiter_uid);
}
$qry .= ' ORDER BY titel';
if ($result = $this->db_query($qry))
{
while ($row = $this->db_fetch_object($result))
+3 -2
View File
@@ -190,7 +190,7 @@ class projektphase extends basis_db
if(!is_null($foreignkey))
$qry .= " and projektphase_fk is NULL";
$qry .= " ORDER BY start, projektphase_fk DESC;";
$qry .= " ORDER BY tbl_projektphase.start, tbl_projektphase.bezeichnung, projektphase_fk DESC;";
if($this->db_query($qry))
{
@@ -794,7 +794,8 @@ class projektphase extends basis_db
)
)
AND mitarbeiter_uid = ".$this->db_add_param($mitarbeiter_uid)."
AND tbl_projekt.projekt_kurzbz = ".$this->db_add_param($projekt_kurzbz);
AND tbl_projekt.projekt_kurzbz = ".$this->db_add_param($projekt_kurzbz). "
ORDER BY tbl_projektphase.start, tbl_projektphase.bezeichnung";
if($result = $this->db_query($qry))
{
+1
View File
@@ -120,6 +120,7 @@ $menu=array
'name'=>'Mitarbeiter','permissions'=>array('admin','mitarbeiter','support'),
'Übersicht'=>array('name'=>'Übersicht', 'link'=>'personen/lektor_uebersicht.php', 'target'=>'main'),
'Zeitsperren'=>array('name'=>'Zeitsperren/Urlaub', 'link'=>'personen/urlaubsverwaltung.php', 'target'=>'main','permissions'=>array('mitarbeiter/zeitsperre:begrenzt')),
'Projektexport'=>array('name'=>'Projektexport', 'link'=>'personen/projektexport.php', 'target'=>'main','permissions'=>array('mitarbeiter/zeitsperre')),
),
'Betriebsmittel'=>array('name'=>'Betriebsmittel', 'link'=>'stammdaten/betriebsmittel_frameset.php', 'target'=>'main','permissions'=>array('basis/betriebsmittel')),
'AnwesenheitslistenBarcode'=>array('name'=>'Anwesenheitslisten mit Barcodes', 'link'=>'personen/anwesenheitslisten_barcode.php', 'target'=>'main','permissions'=>array('basis/person')),
+1
View File
@@ -5,6 +5,7 @@ $this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filtern';
$this->phrasen['services/leistung']='Leistung';
$this->phrasen['services/design']='Verantwortlich';
$this->phrasen['services/kritikalitaet']='Kritikalität';
$this->phrasen['services/betrieb']='Betrieb';
$this->phrasen['services/operativ']='Operativ';
?>
+2 -1
View File
@@ -5,6 +5,7 @@ $this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filter';
$this->phrasen['services/leistung']='Service';
$this->phrasen['services/design']='Design';
$this->phrasen['services/kritikalitaet']='Criticality';
$this->phrasen['services/betrieb']='Running';
$this->phrasen['services/operativ']='Operating';
?>
?>
+3 -3
View File
@@ -40,7 +40,7 @@
}
.tabulator-cell .btn {
padding: 0 .5rem;
max-height: 22px;
min-width: 30px;
padding: 0 .7rem;
min-height: 25px;
min-width: 25px;
}
+5
View File
@@ -0,0 +1,5 @@
import person from "./betriebsmittel/person.js";
export default {
person
}
+26
View File
@@ -0,0 +1,26 @@
export default {
getAllBetriebsmittel(url, config, params){
return this.$fhcApi.get('api/frontend/v1/betriebsmittel/betriebsmittelP/getAllBetriebsmittel/' + params.type + '/' + params.id);
},
addNewBetriebsmittel(form, person_id, formData) {
return this.$fhcApi.post(form, 'api/frontend/v1/betriebsmittel/betriebsmittelP/addNewBetriebsmittel/' +
person_id, formData
);
},
loadBetriebsmittel(betriebsmittelperson_id){
return this.$fhcApi.post('api/frontend/v1/betriebsmittel/betriebsmittelP/loadBetriebsmittel/' + betriebsmittelperson_id);
},
updateBetriebsmittel(form, betriebsmittelperson_id, formData) {
return this.$fhcApi.post(form, 'api/frontend/v1/betriebsmittel/betriebsmittelP/updateBetriebsmittel/' + betriebsmittelperson_id,
formData);
},
deleteBetriebsmittel(betriebsmittelperson_id){
return this.$fhcApi.post('api/frontend/v1/betriebsmittel/betriebsmittelP/deleteBetriebsmittel/' + betriebsmittelperson_id);
},
getTypenBetriebsmittel(){
return this.$fhcApi.get('api/frontend/v1/betriebsmittel/betriebsmittelP/getTypenBetriebsmittel/');
},
loadInventarliste(query){
return this.$fhcApi.get('api/frontend/v1/betriebsmittel/betriebsmittelP/loadInventarliste/' + query);
}
}
+32
View File
@@ -0,0 +1,32 @@
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import search from "./search.js";
import phrasen from "./phrasen.js";
import navigation from "./navigation.js";
import filter from "./filter.js";
import studstatus from "./studstatus.js";
import betriebsmittel from "./betriebsmittel.js";
export default {
search,
phrasen,
navigation,
filter,
studstatus,
betriebsmittel
};
+89
View File
@@ -0,0 +1,89 @@
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
saveCustomFilter(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/saveCustomFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
customFilterName: wsParams.customFilterName
}
);
},
removeCustomFilter(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/removeCustomFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterId: wsParams.filterId
}
);
},
applyFilterFields(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/applyFilterFields',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterFields: wsParams.filterFields
}
);
},
addFilterField(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/addFilterField',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterField: wsParams.filterField
}
);
},
removeFilterField(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/removeFilterField',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterField: wsParams.filterField
}
);
},
getFilterById(wsParams) {
return this.$fhcApi.get(
'/api/frontend/v1/filter/getFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterId: wsParams.filterId
}
);
},
getFilter(wsParams) {
return this.$fhcApi.get(
'/api/frontend/v1/filter/getFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType
}
);
}
};
+32
View File
@@ -0,0 +1,32 @@
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
getHeader(navigation_page) {
return this.$fhcApi.get(
'/api/frontend/v1/navigation/header',
{ navigation_page }
);
},
getMenu: function(navigation_page) {
return this.$fhcApi.get(
'/api/frontend/v1/navigation/menu',
{ navigation_page }
);
}
};
+22
View File
@@ -0,0 +1,22 @@
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
loadCategory(category) {
return this.$fhcApi.get('/api/frontend/v1/phrasen/loadModule/' + category);
}
};
+27
View File
@@ -0,0 +1,27 @@
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
search(searchsettings) {
const url = '/api/frontend/v1/searchbar/search';
return this.$fhcApi.post(url, searchsettings);
},
searchdummy(searchsettings) {
const url = 'public/js/apps/api/dummyapi.php/Search';
return this.$fhcApi.post(url, searchsettings);
}
};
+223
View File
@@ -0,0 +1,223 @@
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
abmeldung: {
getDetails(antrag_id, prestudent_id) {
const url = '/api/frontend/v1/studstatus/abmeldung/'
+ (antrag_id !== undefined ? 'getDetailsForAntrag/' + antrag_id : 'getDetailsForNewAntrag/' + prestudent_id);
return this.$fhcApi.get(url);
},
create(stdsem, prestudent_id, grund) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/abmeldung/createAntrag', {
studiensemester: stdsem,
prestudent_id,
grund
}, {
errorHandling: 'strict'
});
},
cancel(antrag_id) {
if (!Array.isArray(antrag_id))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/abmeldung/cancelAntrag',
{ antrag_id }
);
return Promise.allSettled(antrag_id.map(antrag => this.$fhcApi.post(
'/api/frontend/v1/studstatus/abmeldung/cancelAntrag',
{ antrag_id: antrag.studierendenantrag_id },
{ errorHeader: '#' + antrag.studierendenantrag_id }
)));
}
},
unterbrechung: {
getDetails(antrag_id, prestudent_id) {
const url = '/api/frontend/v1/studstatus/unterbrechung/'
+ (antrag_id !== undefined ? 'getDetailsForAntrag/' + antrag_id : 'getDetailsForNewAntrag/' + prestudent_id);
return this.$fhcApi.get(url);
},
create(studiensemester, prestudent_id, grund, datum_wiedereinstieg, attachment) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/unterbrechung/createAntrag', {
studiensemester,
prestudent_id,
grund,
datum_wiedereinstieg,
attachment
}, {
errorHandling: 'strict'
});
},
cancel(antrag_id) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/unterbrechung/cancelAntrag', {
antrag_id
}, {
errorHandling: 'strict'
});
}
},
wiederholung: {
getDetails(prestudent_id) {
const url = '/api/frontend/v1/studstatus/wiederholung/getDetailsForNewAntrag/' + prestudent_id;
return this.$fhcApi.get(url)
},
getLvs(antrag_id) {
const url = '/api/frontend/v1/studstatus/wiederholung/getLvs/' + antrag_id;
return this.$fhcApi.get(url)
},
create(prestudent_id, studiensemester) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/createAntrag', {
prestudent_id,
studiensemester
}, {
errorHandling: 'strict'
});
},
cancel(prestudent_id, studiensemester) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/cancelAntrag', {
prestudent_id,
studiensemester
}, {
errorHandling: 'strict'
});
},
saveLvs(forbiddenLvs, mandatoryLvs) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/saveLvs', {
forbiddenLvs,
mandatoryLvs
});
}
},
leitung: {
getStgs() {
return this.$fhcApi.get('/api/frontend/v1/studstatus/leitung/getActiveStgs');
},
getAntraege(url, config, params) {
return this.$fhcApi
.get('/api/frontend/v1/studstatus/leitung/getAntraege/' + url)
.then(res => res.data); // Return data for tabulator
},
getHistory(antrag_id) {
return this.$fhcApi.get('/api/frontend/v1/studstatus/leitung/getHistory/' + antrag_id)
},
getPrestudents(query, signal) {
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/getPrestudents',
{ query },
{
signal: signal,
timeout: 30000
}
);
},
approve(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
reject(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/rejectAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/rejectAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
reopen(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/reopenAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/reopenAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
pause(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/pauseAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/pauseAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
unpause(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/unpauseAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/unpauseAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
object(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/objectAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/objectAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
approveObjection(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveObjection',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveObjection',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
denyObjection(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/denyObjection',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/denyObjection',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
}
}
};
+194 -194
View File
@@ -1,195 +1,195 @@
import {CoreFilterCmpt} from '../components/Filter.js';
import {CoreNavigationCmpt} from '../components/Navigation.js';
import verticalsplit from "../components/verticalsplit/verticalsplit.js";
import searchbar from "../components/searchbar/searchbar.js";
import fhcapifactory from "./api/fhcapifactory.js";
import {CoreFilterCmpt} from '../components/filter/Filter.js';
import {CoreNavigationCmpt} from '../components/navigation/Navigation.js';
import CoreVerticalsplit from "../components/verticalsplit/verticalsplit.js";
import CoreSearchbar from "../components/searchbar/searchbar.js";
import FhcApi from "../plugin/FhcApi.js";
Vue.$fhcapi = fhcapifactory;
Vue.createApp({
"data": function() {
return {
"title": "Test Search",
"appSideMenuEntries": {},
"searchbaroptions": {
"types": [
"person",
"raum",
"mitarbeiter",
"student",
"prestudent",
"document",
"cms",
"organisationunit"
],
"actions": {
"person": {
"defaultaction": {
"type": "link",
"action": function(data) {
//alert('person defaultaction ' + JSON.stringify(data));
//window.location.href = data.profil;
return data.profil;
}
},
"childactions": [
{
"label": "testchildaction1",
"icon": "fas fa-check-circle",
"type": "function",
"action": function(data) {
alert('person testchildaction 01 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction2",
"icon": "fas fa-file-csv",
"type": "function",
"action": function(data) {
alert('person testchildaction 02 ' + JSON.stringify(data));
}
}
]
},
"raum": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
"childactions": [
{
"label": "Rauminformation",
"icon": "fas fa-info-circle",
"type": "link",
"action": function(data) {
return data.infolink;
}
},
{
"label": "Raumreservierung",
"icon": "fas fa-bookmark",
"type": "link",
"action": function(data) {
return data.booklink;
}
}
]
},
"employee": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('employee defaultaction ' + JSON.stringify(data));
}
},
"childactions": [
{
"label": "testchildaction1",
"icon": "fas fa-address-book",
"type": "function",
"action": function(data) {
alert('employee testchildaction 01 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction2",
"icon": "fas fa-user-slash",
"type": "function",
"action": function(data) {
alert('employee testchildaction 02 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction3",
"icon": "fas fa-bell",
"type": "function",
"action": function(data) {
alert('employee testchildaction 03 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction4",
"icon": "fas fa-calculator",
"type": "function",
"action": function(data) {
alert('employee testchildaction 04 ' + JSON.stringify(data));
}
}
]
},
"organisationunit": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
"childactions": []
}
}
},
"searchbaroptions2": {
"types": [
"raum",
"organisationunit"
],
"actions": {
"raum": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
"childactions": [
{
"label": "Rauminformation",
"icon": "fas fa-info-circle",
"type": "link",
"action": function(data) {
return data.infolink;
}
},
{
"label": "Raumreservierung",
"icon": "fas fa-bookmark",
"type": "link",
"action": function(data) {
return data.booklink;
}
}
]
},
"organisationunit": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
"childactions": []
}
}
}
};
},
"components": {
"CoreNavigationCmpt": CoreNavigationCmpt,
"CoreFilterCmpt": CoreFilterCmpt,
"verticalsplit": verticalsplit,
"searchbar": searchbar
},
"methods": {
"newSideMenuEntryHandler": function(payload) {
this.appSideMenuEntries = payload;
},
"searchfunction": function(searchsettings) {
return Vue.$fhcapi.Search.search(searchsettings);
},
"searchfunctiondummy": function(searchsettings) {
return Vue.$fhcapi.Search.searchdummy(searchsettings);
}
}
}).mount('#main');
const app = Vue.createApp({
components: {
CoreNavigationCmpt,
CoreFilterCmpt,
CoreVerticalsplit,
CoreSearchbar
},
data() {
return {
title: "Test Search",
appSideMenuEntries: {},
searchbaroptions: {
types: [
"person",
"raum",
"mitarbeiter",
"student",
"prestudent",
"document",
"cms",
"organisationunit"
],
actions: {
person: {
defaultaction: {
type: "link",
action(data) {
//alert('person defaultaction ' + JSON.stringify(data));
//window.location.href = data.profil;
return data.profil;
}
},
childactions: [
{
label: "testchildaction1",
icon: "fas fa-check-circle",
type: "function",
action(data) {
alert('person testchildaction 01 ' + JSON.stringify(data));
}
},
{
label: "testchildaction2",
icon: "fas fa-file-csv",
type: "function",
action(data) {
alert('person testchildaction 02 ' + JSON.stringify(data));
}
}
]
},
raum: {
defaultaction: {
type: "function",
action(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
childactions: [
{
label: "Rauminformation",
icon: "fas fa-info-circle",
type: "link",
action(data) {
return data.infolink;
}
},
{
label: "Raumreservierung",
icon: "fas fa-bookmark",
type: "link",
action(data) {
return data.booklink;
}
}
]
},
employee: {
defaultaction: {
type: "function",
action(data) {
alert('employee defaultaction ' + JSON.stringify(data));
}
},
childactions: [
{
label: "testchildaction1",
icon: "fas fa-address-book",
type: "function",
action(data) {
alert('employee testchildaction 01 ' + JSON.stringify(data));
}
},
{
label: "testchildaction2",
icon: "fas fa-user-slash",
type: "function",
action(data) {
alert('employee testchildaction 02 ' + JSON.stringify(data));
}
},
{
label: "testchildaction3",
icon: "fas fa-bell",
type: "function",
action(data) {
alert('employee testchildaction 03 ' + JSON.stringify(data));
}
},
{
label: "testchildaction4",
icon: "fas fa-calculator",
type: "function",
action(data) {
alert('employee testchildaction 04 ' + JSON.stringify(data));
}
}
]
},
organisationunit: {
defaultaction: {
type: "function",
action(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
childactions: []
}
}
},
searchbaroptions2: {
types: [
"raum",
"organisationunit"
],
actions: {
raum: {
defaultaction: {
type: "function",
action(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
childactions: [
{
label: "Rauminformation",
icon: "fas fa-info-circle",
type: "link",
action(data) {
return data.infolink;
}
},
{
label: "Raumreservierung",
icon: "fas fa-bookmark",
type: "link",
action(data) {
return data.booklink;
}
}
]
},
organisationunit: {
defaultaction: {
type: "function",
action(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
childactions: []
}
}
}
};
},
methods: {
newSideMenuEntryHandler(payload) {
this.appSideMenuEntries = payload;
},
searchfunction(searchsettings) {
return this.$fhcApi.factory.search.search(searchsettings);
},
searchfunctiondummy(searchsettings) {
return this.$fhcApi.factory.search.searchdummy(searchsettings);
}
}
});
app.use(FhcApi)
app.mount('#main');
-2
View File
@@ -1,12 +1,10 @@
import StudierendenantragAntrag from "../../components/Studierendenantrag/Antrag.js";
import StudierendenantragStatus from "../../components/Studierendenantrag/Status.js";
import StudierendenantragInfoblock from "../../components/Studierendenantrag/Infoblock.js";
import VueDatePicker from "../../components/vueDatepicker.js.php";
import Phrasen from '../../plugin/Phrasen.js';
const app = Vue.createApp({
components: {
VueDatePicker,
StudierendenantragAntrag,
StudierendenantragStatus,
StudierendenantragInfoblock
@@ -0,0 +1,408 @@
import {CoreFilterCmpt} from "../filter/Filter.js";
import BsModal from "../Bootstrap/Modal.js";
import CoreForm from '../Form/Form.js';
import FormInput from '../Form/Input.js';
export default {
components: {
CoreFilterCmpt,
BsModal,
CoreForm,
FormInput
},
inject: {
cisRoot: {
from: 'cisRoot'
},
},
props: {
endpoint: {
type: Object,
required: true
},
typeId: String,
id: {
type: [Number, String],
required: true
},
uid: {
type: [Number, String],
required: true
}
},
data() {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.endpoint.getAllBetriebsmittel,
ajaxParams: () => {
return {
type: this.typeId,
id: this.id
}
},
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Nummer", field: "nummer", width: 150},
{title: "PersonId", field: "person_id", visible: false},
{title: "Typ", field: "betriebsmitteltyp", width: 125},
{title: "Anmerkung", field: "anmerkung", visible: false},
{title: "Retourdatum", field: "format_retour", width: 128},
{title: "Beschreibung", field: "beschreibung"},
{title: "UID", field: "uid", width: 87},
{title: "Kaution", field: "kaution", visible: false},
{title: "Ausgabedatum", field: "format_ausgabe", width: 144, visible: false},
{title: "Betriebsmittel ID", field: "betriebsmittel_id", visible: false},
{title: "Betriebsmittelperson ID", field: "betriebsmittelperson_id", visible: false},
{
title: 'Aktionen', field: 'actions',
minWidth: 150, // Ensures Action-buttons will be always fully displayed
maxWidth: 150,
formatter: (cell, formatterParams, onRendered) => {
let container = document.createElement('div');
container.className = "d-flex gap-2";
let button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-print"></i>';
button.title = 'Übernahmebestätigung drucken';
let cellData = cell.getData();
button.addEventListener(
'click',
(event) =>
{
let linkToPdf = this.cisRoot +
'/content/pdfExport.php?xml=betriebsmittelperson.rdf.php&xsl=Uebernahme&id=' + cellData.betriebsmittelperson_id + '&output=pdf';
window.open(linkToPdf, '_blank');
});
container.append(button);
button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-edit"></i>';
button.title = 'Betriebsmittel bearbeiten';
button.addEventListener(
'click',
(event) =>
this.actionEditBetriebsmittel(cell.getData().betriebsmittelperson_id)
);
container.append(button);
button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-xmark"></i>';
button.title = 'Betriebsmittel löschen';
button.addEventListener(
'click',
() =>
this.actionDeleteBetriebsmittel(cell.getData().betriebsmittelperson_id)
);
container.append(button);
return container;
},
frozen: true
}],
layout: 'fitColumns',
layoutColumnsOnNewData: false,
height: '550',
selectableRangeMode: 'click',
selectable: true,
persistenceID: 'core-betriebsmittel'
},
tabulatorEvents: [
{
event: 'tableBuilt',
handler: async() => {
await this.$p.loadCategory(['wawi', 'global', 'infocenter']);
let cm = this.$refs.table.tabulator.columnManager;
cm.getColumnByField('nummer').component.updateDefinition({
title: this.$p.t('wawi', 'nummer')
});
cm.getColumnByField('anmerkung').component.updateDefinition({
title: this.$p.t('global', 'anmerkung')
});
cm.getColumnByField('format_retour').component.updateDefinition({
title: this.$p.t('wawi', 'retourdatum')
});
cm.getColumnByField('kaution').component.updateDefinition({
title: this.$p.t('infocenter', 'kaution')
});
cm.getColumnByField('format_ausgabe').component.updateDefinition({
title: this.$p.t('wawi', 'ausgabedatum')
});
}
}
],
listBetriebsmitteltyp: [],
formData: {
ausgegebenam : new Date(),
betriebsmitteltyp: 'Zutrittskarte'
},
statusNew: true,
filteredInventar: []
}
},
watch: {
id() {
this.$refs.table.tabulator.setData('dummy');
}
},
methods: {
actionEditBetriebsmittel(betriebsmittelperson_id) {
this.statusNew = false;
this
.loadBetriebsmittel(betriebsmittelperson_id)
.then(this.$refs.betriebsmittelModal.show);
},
actionNewBetriebsmittel() {
this.resetModal();
this.$refs.betriebsmittelModal.show();
},
actionDeleteBetriebsmittel(betriebsmittelperson_id) {
this.$fhcAlert
.confirmDelete()
.then(result => result
? betriebsmittelperson_id
: Promise.reject({handled: true}))
.then(this.endpoint.deleteBetriebsmittel)
.then(result => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
window.scrollTo(0, 0);
this.reload();
})
.catch(this.$fhcAlert.handleSystemError);
},
addNewBetriebsmittel() {
//just append uid to formdata
this.formData.uid = this.uid;
if (this.formData.betriebsmitteltyp == 'Inventar')
this.formData.betriebsmittel_id = this.formData.inventarData?.betriebsmittel_id;
return this.endpoint
.addNewBetriebsmittel(this.$refs.betriebsmittelData, this.id, this.formData)
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$refs.betriebsmittelModal.hide();
this.resetModal();
window.scrollTo(0, 0);
this.reload();
})
.catch(this.$fhcAlert.handleSystemError);
},
updateBetriebsmittel(betriebsmittelperson_id) {
if (this.formData.betriebsmitteltyp == 'Inventar')
this.formData.betriebsmittel_id = this.formData.inventarData?.betriebsmittel_id;
return this.endpoint
.updateBetriebsmittel(this.$refs.betriebsmittelData, betriebsmittelperson_id, this.formData)
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$refs.betriebsmittelModal.hide();
this.resetModal();
window.scrollTo(0, 0);
this.reload();
})
.catch(this.$fhcAlert.handleSystemError);
},
loadBetriebsmittel(betriebsmittelperson_id) {
this.resetModal();
this.statusNew = false;
return this.endpoint
.loadBetriebsmittel(betriebsmittelperson_id)
.then(result => {
this.formData = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
searchInventar(event) {
const encodedQuery = encodeURIComponent(event.query);
return this.endpoint
.loadInventarliste(encodedQuery)
.then(result => {
this.filteredInventar = result.data;
});
},
reload() {
this.$refs.table.reloadTable();
},
resetModal() {
this.formData = {};
this.formData.ausgegebenam = new Date();
this.formData.retouram = null;
this.formData.betriebsmitteltyp = null;
this.formData.nummer = null;
this.formData.nummer2 = null;
this.formData.kaution = null;
this.formData.anmerkung = null;
this.formData.beschreibung = null;
this.statusNew = true;
}
},
created() {
return this.endpoint
.getTypenBetriebsmittel()
.then(result => {
this.listBetriebsmitteltyp = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
template: `
<div class="core-betriebsmittel h-100 d-flex flex-column">
<core-filter-cmpt
ref="table"
:tabulator-options="tabulatorOptions"
:tabulator-events="tabulatorEvents"
table-only
:side-menu="false"
reload
new-btn-show
new-btn-label="Betriebsmittel"
@click:new="actionNewBetriebsmittel"
>
</core-filter-cmpt>
<!--Modal: betriebsmittelModal-->
<bs-modal ref="betriebsmittelModal">
<template #title>
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('ui', 'add_betriebsmittel')}}</p>
<p v-else class="fw-bold mt-3">{{$p.t('ui', 'edit_betriebsmittel')}}</p>
</template>
<core-form class="row g-3" ref="betriebsmittelData">
<legend>Details</legend>
<div class="row mb-3">
<form-input
type="select"
:label="$p.t('global/typ')"
name="betriebsmitteltyp"
v-model="formData.betriebsmitteltyp"
:disabled="!statusNew"
>
<option
v-for="entry in listBetriebsmitteltyp"
:key="entry.betriebsmitteltyp"
:value="entry.betriebsmitteltyp"
>
{{entry.beschreibung}}
</option>
</form-input>
</div>
<div v-if="formData.betriebsmitteltyp == 'Inventar'" class="row mb-3">
<form-input
type="autocomplete"
:label="$p.t('wawi/inventarnummer')"
name="betriebsmittel_id"
v-model="formData.inventarData"
option-label="dropdowntext"
:suggestions="filteredInventar"
@complete="searchInventar"
:min-length="3"
>
</form-input>
</div>
<div v-else-if="formData.inventarnummer" class="row mb-3">
<form-input
type="text"
:label="$p.t('wawi/inventarnummer')"
name="inventarnummer"
v-model="formData.inventarnummer"
:disabled="!statusNew"
>
</form-input>
</div>
<div v-if="formData.betriebsmitteltyp!='Inventar' && !formData.inventarnummer" class="row mb-3">
<form-input
type="text"
:label="$p.t('wawi/nummer')"
name="nummer"
v-model="formData.nummer"
>
</form-input>
</div>
<div v-if="formData.betriebsmitteltyp!='Inventar' && !formData.inventarnummer" class="row mb-3">
<form-input
type="text"
:label="$p.t('wawi/nummer') + ' 2'"
name="nummer2"
v-model="formData.nummer2"
>
</form-input>
</div>
<div v-if="formData.betriebsmitteltyp!='Inventar'" class="row mb-3">
<form-input
type="textarea"
:label="$p.t('global/beschreibung')"
name="beschreibung"
v-model="formData.beschreibung"
:disabled="formData.inventarnummer"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="text"
:label="$p.t('infocenter/kaution')"
name="kaution"
v-model="formData.kaution"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="textarea"
:label="$p.t('global/anmerkung')"
name="anmerkung"
v-model="formData.anmerkung"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="DatePicker"
:label="$p.t('wawi/ausgegebenam')"
name="ausgegebenam"
v-model="formData.ausgegebenam"
auto-apply
:enable-time-picker="false"
format="dd.MM.yyyy"
preview-format="dd.MM.yyyy"
:teleport="true"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="DatePicker"
:label="$p.t('wawi/retouram')"
name="retouram"
v-model="formData.retouram"
auto-apply
:enable-time-picker="false"
format="dd.MM.yyyy"
preview-format="dd.MM.yyyy"
:teleport="true"
>
</form-input>
</div>
</core-form>
<template #footer>
<button type="button" class="btn btn-primary" @click="statusNew ? addNewBetriebsmittel() : updateBetriebsmittel(formData.betriebsmittelperson_id)">{{$p.t('ui', 'speichern')}}</button>
</template>
</bs-modal>
</div>`
}
+3 -1
View File
@@ -99,8 +99,10 @@ export const CoreFetchCmpt = {
*
*/
errorHandler: function(error) {
if (error.response.data.retval)
if (error.response?.data?.retval)
this.setError(error.response.data.retval);
else if (error.data?.message)
this.setError(error.data.message);
else
this.setError(error.message);
},
+2 -1
View File
@@ -46,7 +46,8 @@ export default {
const factory = Object.create(Object.getPrototypeOf(this.$fhcApi.factory), Object.getOwnPropertyDescriptors(this.$fhcApi.factory));
factory.$fhcApi = {
get: this.get,
post: this.post
post: this.post,
_defaultErrorHandlers: this.$fhcApi._defaultErrorHandlers
};
return factory;
}
+15 -3
View File
@@ -160,12 +160,12 @@ export default {
},
modelValueCmp: {
get() {
if (this.$attrs.modelValue === undefined)
if (!this.$attrs.hasOwnProperty('modelValue'))
return this.modelValueDummy;
return this.$attrs.modelValue;
},
set(v) {
if (this.$attrs.modelValue === undefined)
if (!this.$attrs.hasOwnProperty('modelValue'))
this.modelValueDummy = v;
this.$emit('update:modelValue', v);
}
@@ -236,12 +236,13 @@ export default {
},
template: `
<component :is="!hasContainer ? 'FhcFragment' : 'div'" class="position-relative" :class="autoContainerClass">
<label v-if="$attrs.label && lcType != 'radio' && lcType != 'checkbox'" :for="idCmp">{{$attrs.label}}</label>
<label v-if="$attrs.label && lcType != 'radio' && lcType != 'checkbox'" :class="!noAutoClass && 'form-label'" :for="idCmp">{{$attrs.label}}</label>
<input v-if="tag == 'input'" :type="lcType" ref="input" v-model="modelValueCmp" v-bind="$attrs" :id="idCmp" :name="name" :class="validationClass" :modelValue="undefined" @input="clearValidationForThisName(); $emit('input', $event)">
<textarea v-else-if="tag == 'textarea'" ref="input" v-model="modelValueCmp" v-bind="$attrs" :id="idCmp" :name="name" :class="validationClass" :modelValue="undefined" @input="clearValidationForThisName(); $emit('input', $event)"></textarea>
<select v-else-if="tag == 'select'" ref="input" v-model="modelValueCmp" v-bind="$attrs" :id="idCmp" :name="name" :class="validationClass" :modelValue="undefined" @input="clearValidationForThisName(); $emit('input', $event)">
<slot></slot>
</select>
<component
v-else-if="tag == 'VueDatePicker'"
ref="input"
@@ -272,6 +273,17 @@ export default {
@update:model-value="clearValidationForThisName"
>
<slot></slot>
<template #chip="data"><slot name="chip" v-bind="data"></slot></template>
<template #header="data"><slot name="header" v-bind="data"></slot></template>
<template #footer="data"><slot name="footer" v-bind="data"></slot></template>
<template #option="data"><slot name="option" v-bind="data"></slot></template>
<template #optiongroup="data"><slot name="optiongroup" v-bind="data"></slot></template>
<template #content="data"><slot name="content" v-bind="data"></slot></template>
<template #loader="data"><slot name="loader" v-bind="data"></slot></template>
<template #empty="data"><slot name="empty" v-bind="data"></slot></template>
<template #dropdownicon="data"><slot name="dropdownicon" v-bind="data"></slot></template>
<template #removetokenicon="data"><slot name="removetokenicon" v-bind="data"></slot></template>
<template #loadingicon="data"><slot name="loadingicon" v-bind="data"></slot></template>
</component>
<component
v-else-if="tag == 'UploadDms'"
@@ -1,10 +1,16 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt
CoreFetchCmpt,
CoreForm,
FormValidation,
FormInput
},
emits: [
'setInfos',
@@ -18,9 +24,8 @@ export default {
return {
data: null,
saving: false,
errors: {
grund: [],
default: []
formData: {
grund: ''
}
}
},
@@ -34,24 +39,14 @@ export default {
case 'Genehmigt': return 'success';
default: return 'warning';
}
},
loadUrl() {
if (this.studierendenantragId)
return '/components/Antrag/Abmeldung/getDetailsForAntrag/'+
this.studierendenantragId;
return '/components/Antrag/Abmeldung/getDetailsForNewAntrag/' +
this.prestudentId;
}
},
methods: {
load() {
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
return this.$fhcApi.factory
.studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
.then(result => {
this.data = result.data;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
@@ -63,8 +58,8 @@ export default {
});
}
return result;
}
);
})
.catch(this.$fhcAlert.handleSystemError);
},
createAntrag() {
bootstrap.Modal.getOrCreateInstance(this.$refs.modal).hide();
@@ -73,52 +68,39 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/createAntrag/', {
studiensemester: this.data.studiensemester_kurzbz,
prestudent_id: this.data.prestudent_id,
grund: this.$refs.grund.value
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.create(
this.data.studiensemester_kurzbz,
this.data.prestudent_id,
this.formData.grund
)
.then(result => {
if (result.data === true)
document.location += "";
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
{
if (result.data.retval === true)
document.location += "";
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
});
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
});
this.saving = false;
}
);
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
},
cancelAntrag() {
this.$emit('setStatus', {
@@ -126,51 +108,37 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/cancelAntrag/', {
antrag_id: this.data.studierendenantrag_id
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity:'danger'
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.cancel(
this.data.studierendenantrag_id
)
.then(result => {
if (Number.isInteger(result.data))
document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data;
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
{
if (Number.isInteger(result.data.retval)) {
document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data.retval;
}
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
});
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
});
this.saving = false;
}
);
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
},
created() {
@@ -179,10 +147,9 @@ export default {
template: `
<div class="studierendenantrag-form-abmeldung">
<core-fetch-cmpt :api-function="load">
<div class="row">
<core-form ref="form" class="row">
<div class="col-12">
<div v-for="error in errors.default" class="alert alert-danger" role="alert" v-html="error">
</div>
<form-validation></form-validation>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -219,19 +186,16 @@ export default {
<pre>{{data.grund}}</pre>
</div>
<div v-else class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-grund'" class="form-label">Grund:</label>
<textarea
class="form-control"
:class="{'is-invalid': errors.grund.length}"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-grund'"
<form-input
type="textarea"
label="Grund:"
v-model="formData.grund"
name="grund"
rows="5"
:disabled="saving"
ref="grund"
required
></textarea>
<div v-if="errors.grund.length" class="invalid-feedback">
{{errors.grund.join(".")}}
</div>
>
</form-input>
</div>
<div class="col-12 text-end">
<button
@@ -286,13 +250,13 @@ export default {
</div>
</div>
</div>
</div>
</core-form>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
{{ errorMessage }}
</div>
</template>
</core-fetch-cmpt>
</div>
`
</div>`
}
@@ -1,10 +1,16 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt
CoreFetchCmpt,
CoreForm,
FormValidation,
FormInput
},
emits: [
'setInfos',
@@ -18,9 +24,8 @@ export default {
return {
data: null,
saving: false,
errors: {
grund: [],
default: []
formData: {
grund: ''
}
}
},
@@ -35,24 +40,14 @@ export default {
case 'Abgemeldet': return 'success';
default: return 'warning';
}
},
loadUrl() {
if (this.studierendenantragId)
return '/components/Antrag/Abmeldung/getDetailsForAntrag/'+
this.studierendenantragId;
return '/components/Antrag/Abmeldung/getDetailsForNewAntrag/' +
this.prestudentId;
}
},
methods: {
load() {
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
return this.$fhcApi.factory
.studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
.then(result => {
this.data = result.data;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
@@ -64,8 +59,7 @@ export default {
});
}
return result;
}
);
});
},
createAntrag() {
bootstrap.Modal.getOrCreateInstance(this.$refs.modal).hide();
@@ -74,63 +68,44 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/createAntrag/', {
studiensemester: this.data.studiensemester_kurzbz,
prestudent_id: this.data.prestudent_id,
grund: this.$refs.grund.value
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (result.data.retval === true)
document.location += "";
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
});
}
this.saving = false;
}
);
},
appendDropDownText(event){
let templateText = this.$refs.grund;
if(event.target.value)
{
let templateT= this.$p.t('studierendenantrag', event.target.value);
templateText.value = templateT;
}
else
templateText.value = '';
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.create(
this.data.studiensemester_kurzbz,
this.data.prestudent_id,
this.formData.grund
)
.then(result => {
if (result.data === true)
document.location += "";
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
});
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
},
appendDropDownText(event) {
this.formData.grund = event.target.value
? this.$p.t('studierendenantrag', event.target.value)
: '';
},
},
created() {
@@ -139,8 +114,9 @@ export default {
template: `
<div class="studierendenantrag-form-abmeldung">
<core-fetch-cmpt :api-function="load">
<div class="row">
<core-form ref="form" class="row">
<div class="col-12">
<form-validation></form-validation>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -181,8 +157,7 @@ export default {
<div v-else class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-grund'" class="form-label">Grund:</label>
<div class="mb-2">
<select name="grundAv" @change="appendDropDownText
($event)">
<select name="grundAv" class="form-select" @change="appendDropDownText">
<option value="" > --- bitte auswählen, sofern zutreffend ---- </option>
<option value="textLong_NichtantrittStudium">{{$p.t('studierendenantrag', 'dropdown_NichtantrittStudium')}}
</option>
@@ -199,19 +174,17 @@ export default {
<option value="textLong_MissingZgv">{{$p.t('studierendenantrag', 'dropdown_MissingZgv')}}
</option>
</select>
</div>
<textarea
class="form-control"
:class="{'is-invalid': errors.grund.length}"
</div>
<form-input
type="textarea"
v-model="formData.grund"
name="grund"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-grund'"
rows="5"
:disabled="saving"
ref="grund"
required
></textarea>
<div v-if="errors.grund.length" class="invalid-feedback">
{{errors.grund.join(".")}}
</div>
>
</form-input>
</div>
<div class="col-12 text-end">
@@ -257,7 +230,7 @@ export default {
</div>
</div>
</div>
</div>
</core-form>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
@@ -265,6 +238,5 @@ export default {
</div>
</template>
</core-fetch-cmpt>
</div>
`
</div>`
}
@@ -1,12 +1,15 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import VueDatepicker from '../../vueDatepicker.js.php';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt,
VueDatepicker
CoreForm,
FormValidation,
FormInput
},
emits: [
'setInfos',
@@ -20,12 +23,7 @@ export default {
return {
data: null,
saving: false,
errors: {
grund: [],
studiensemester: [],
datum_wiedereinstieg: [],
default: []
},
attachment: [],
stsem: null,
currentWiedereinstieg: '',
siteUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root +
@@ -45,13 +43,6 @@ export default {
default: return 'warning';
}
},
loadUrl() {
if (this.studierendenantragId)
return '/components/Antrag/Unterbrechung/getDetailsForAntrag/'+
this.studierendenantragId;
return '/components/Antrag/Unterbrechung/getDetailsForNewAntrag/' +
this.prestudentId;
},
datumWsFormatted() {
let datumUnformatted = '';
@@ -81,26 +72,24 @@ export default {
},
methods: {
load() {
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
return this.$p.t('studierendenantrag', 'status_x', {status});
}) : Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp}));
this.$emit("setStatus", {
msg,
severity: this.statusSeverity
});
return this.$fhcApi.factory
.studstatus.unterbrechung.getDetails(this.studierendenantragId, this.prestudentId)
.then(
result => {
this.data = result.data;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
return this.$p.t('studierendenantrag', 'status_x', {status});
}) : Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp}));
this.$emit("setStatus", {
msg,
severity: this.statusSeverity
});
}
return result;
}
return result;
}
);
);
},
createAntrag() {
this.$emit('setStatus', {
@@ -108,63 +97,41 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
var formData = new FormData();
var attachment = this.$refs.attachment;
formData.append("attachment", attachment.files[0]);
formData.append("studiensemester", this.stsem !== null && this.data.studiensemester[this.stsem].studiensemester_kurzbz);
formData.append("prestudent_id", this.data.prestudent_id);
formData.append("grund", this.$refs.grund.value);
formData.append("datum_wiedereinstieg", this.stsem !== null && this.currentWiedereinstieg);
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.unterbrechung.create(
this.stsem !== null && this.data.studiensemester[this.stsem].studiensemester_kurzbz,
this.data.prestudent_id,
this.data.grund,
this.stsem !== null && this.currentWiedereinstieg,
this.attachment
)
.then(result => {
if (Number.isInteger(result.data))
document.location += "/" + result.data;
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Unterbrechung/createAntrag/',
formData,
{
headers: {
'Content-Type': 'multipart/form-data'
}
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
{
if (Number.isInteger(result.data.retval))
document.location += "/" + result.data.retval;
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_created')})),
severity: 'info'
});
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_created')})),
severity: 'info'
});
this.saving = false;
}
);
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
},
cancelAntrag() {
this.$emit('setStatus', {
@@ -172,63 +139,45 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Unterbrechung/cancelAntrag/', {
antrag_id: this.data.studierendenantrag_id
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.unterbrechung.cancel(
this.data.studierendenantrag_id
)
.then(result => {
if (Number.isInteger(result.data))
document.location = document.location.replace(/unterbrechung\/([0-9]*)\/[0-9]*[\/]?$/, 'unterbrechung/$1') + "/" + result.data;
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
});
}
else
{
if (Number.isInteger(result.data.retval)) {
document.location = document.location.replace(/unterbrechung\/([0-9]*)\/[0-9]*[\/]?$/, 'unterbrechung/$1') + "/" + result.data.retval;
}
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
});
}
this.saving = false;
}
);
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
},
created() {
this.uuid = _uuid++;
},
template: `
<div class="studierendenantrag-form-unterbrechung">
<core-fetch-cmpt :api-function="load">
<div class="row">
<core-form ref="form" class="row">
<div class="col-12">
<div v-for="error in errors.default" class="alert alert-danger" role="alert" v-html="error">
</div>
<form-validation></form-validation>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -260,93 +209,99 @@ export default {
</div>
<div class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-stsem'" class="form-label">
{{$p.t('lehre', 'studiensemester')}}
</label>
<div v-if="data.studierendenantrag_id">
{{data.studiensemester_kurzbz}}
</div>
<div v-else>
<select
class="form-select"
:class="{'is-invalid': errors.studiensemester.length}"
v-model="stsem"
required
:id="'studierendenantrag-form-abmeldung-' + uuid + '-stsem'"
@input="currentWiedereinstieg = ''"
>
<option v-for="(stsem, index) in data.studiensemester" :key="index" :value="index" :disabled="stsem.disabled">
{{stsem.studiensemester_kurzbz}}
</option>
</select>
<div v-if="errors.studiensemester.length" class="invalid-feedback">
{{errors.studiensemester.join(".")}}
<label class="form-label">
{{$p.t('lehre', 'studiensemester')}}
</label>
<div>
{{data.studiensemester_kurzbz}}
</div>
</div>
<form-input
v-else
type="select"
v-model="stsem"
name="studiensemester"
:label="$p.t('lehre', 'studiensemester')"
required
@input="currentWiedereinstieg = ''"
>
<option v-for="(stsem, index) in data.studiensemester" :key="index" :value="index" :disabled="stsem.disabled">
{{stsem.studiensemester_kurzbz}}
</option>
</form-input>
</div>
<div class="col-sm-6 mb-3">
<label class="form-label">
{{$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')}}
</label>
<div v-if="data.studierendenantrag_id">
{{datumWsFormatted}}
</div>
<div v-else-if="stsem === null">
<select class="form-select" disabled>
<option selected>{{$p.t('ui/select_studiensemester')}}</option>
</select>
</div>
<div v-else>
<select v-model="currentWiedereinstieg" class="form-select">
<option v-for="sem in data.studiensemester[stsem].wiedereinstieg" :key="sem.studiensemester_kurzbz" :value="sem.start" :disabled="sem.disabled">
{{sem.studiensemester_kurzbz}}
</option>
</select>
</div>
<div v-if="errors.datum_wiedereinstieg.length" class="invalid-feedback d-block">
{{errors.datum_wiedereinstieg.join(".")}}
<label class="form-label">
{{$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')}}
</label>
<div>
{{datumWsFormatted}}
</div>
</div>
<form-input
v-else-if="stsem === null"
type="select"
:label="$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')"
modelValue=""
name="datum_wiedereinstieg"
disabled
>
<template #default>
<option value="" selected disabled hidden>{{$p.t('ui/select_studiensemester')}}</option>
</template>
</form-input>
<form-input
v-else
type="select"
:label="$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')"
v-model="currentWiedereinstieg"
name="datum_wiedereinstieg"
>
<option v-for="sem in data.studiensemester[stsem].wiedereinstieg" :key="sem.studiensemester_kurzbz" :value="sem.start" :disabled="sem.disabled">
{{sem.studiensemester_kurzbz}}
</option>
</form-input>
</div>
<div v-if="data.studierendenantrag_id" class="mb-3">
<h5>{{$p.t('studierendenantrag', 'antrag_grund')}}:</h5>
<textarea class="form-control" rows="5" readonly>{{data.grund}}</textarea>
</div>
<div v-else class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-grund'" class="form-label">Grund:</label>
<textarea
class="form-control"
:class="{'is-invalid': errors.grund.length}"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-grund'"
<div class="col-sm-6 mb-3">
<form-input
v-if="data.studierendenantrag_id"
type="textarea"
:label="$p.t('studierendenantrag', 'antrag_grund') + ':'"
v-model="data.grund"
name="grund"
rows="5"
:disabled="saving"
readonly
>
</form-input>
<form-input
v-else
ref="grund"
type="textarea"
:label="$p.t('studierendenantrag', 'antrag_grund') + ':'"
v-model="data.grund"
name="grund"
:disabled="saving"
rows="5"
required
></textarea>
<div v-if="errors.grund.length" class="invalid-feedback">
{{errors.grund.join(".")}}
</div>
>
</form-input>
</div>
<div class="col-12 mb-3">
<div v-if="data.studierendenantrag_id">
<a v-if="data.dms_id" target="_blank" :href="siteUrl + '/lehre/Antrag/Attachment/Show/' + data.dms_id"> {{$p.t('studierendenantrag', 'antrag_dateianhaenge')}} </a>
<span v-else>{{$p.t('studierendenantrag', 'no_attachments')}}</span>
</div>
<div v-else>
<label
:for="'studierendenantrag-form-abmeldung-' + uuid + '-attachment'"
class="form-label">
{{$p.t('studierendenantrag', 'antrag_dateianhaenge')}}
</label>
<input
class="form-control"
type="file"
ref="attachment"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-attachment'"
name="attachment">
</div>
<form-input
v-else
ref="attachment"
type="uploadfile"
:label="$p.t('studierendenantrag', 'antrag_dateianhaenge')"
v-model="attachment"
name="attachment"
>
</form-input>
</div>
<div class="col-12 text-end">
<button
@@ -368,13 +323,12 @@ export default {
{{$p.t('studierendenantrag', 'btn_cancel')}}
</button>
</div>
</div>
</core-form>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
{{ errorMessage }}
</div>
</template>
</core-fetch-cmpt>
</div>
`
</div>`
}
@@ -1,12 +1,13 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import VueDatepicker from '../../vueDatepicker.js.php';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt,
VueDatepicker
CoreForm,
FormValidation
},
emits: [
'setInfos',
@@ -22,12 +23,6 @@ export default {
return {
data: null,
saving: false,
errors: {
grund: [],
default: []
},
siteUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router,
infos: []
}
},
@@ -45,10 +40,6 @@ export default {
default: return 'warning';
}
},
loadUrl() {
return '/components/Antrag/Wiederholung/getDetailsForNewAntrag/' +
this.prestudentId;
},
datumPruefungFormatted() {
if(!this.data.pruefungsdatum)
return '';
@@ -58,13 +49,12 @@ export default {
},
methods: {
load() {
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
return this.$fhcApi.factory
.studstatus.wiederholung.getDetails(
this.prestudentId
)
.then(result => {
this.data = result.data;
if (!this.data.status || this.data.status == 'ErsteAufforderungVersandt' || this.data.status == 'ZweiteAufforderungVersandt') {
this.data.status = 'Offen';
this.data.statustyp = this.$p.t('studierendenantrag', 'status_open');
@@ -79,8 +69,7 @@ export default {
severity: this.statusSeverity
});
return result;
}
);
});
},
createAntrag() {
this.createAntragWithStatus(true);
@@ -89,7 +78,7 @@ export default {
this.createAntragWithStatus(false);
},
createAntragWithStatus(repeat) {
let func = repeat ? 'createAntrag' : 'cancelAntrag';
let func = repeat ? 'create' : 'cancel';
let nextState = repeat ? 'Erstellt' : 'Verzichtet';
this.$emit('setStatus', {
@@ -97,54 +86,36 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Wiederholung/' + func + '/',
{
prestudent_id: this.data.prestudent_id,
studiensemester: this.data.studiensemester_kurzbz
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (result.data.retval === true)
document.location += "";
this.data = result.data.retval;
if (!this.data.status)
this.data.status = nextState;
this.$emit('update:status', this.data.status);
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
this.$refs.form.factory
.studstatus.wiederholung[func](
this.data.prestudent_id,
this.data.studiensemester_kurzbz
)
.then(result => {
if (result.data === true)
document.location += "";
this.data = result.data;
if (!this.data.status)
this.data.status = nextState;
this.$emit('update:status', this.data.status);
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
this.saving = false;
}
);
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
},
created() {
this.uuid = _uuid++;
},
mounted() {
this.infos = [...Array(5).keys()].map(n => ({
body: Vue.computed(() => this.$p.t('studierendenantrag', 'infotext_Wiederholung_' + n))
@@ -154,10 +125,9 @@ export default {
template: `
<div class="studierendenantrag-form-wiederholung">
<core-fetch-cmpt :api-function="load">
<div class="row">
<core-form ref="form" class="row">
<div class="col-12">
<div v-for="error in errors.default" class="alert alert-danger" role="alert" v-html="error">
</div>
<form-validation></form-validation>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -206,7 +176,7 @@ export default {
{{$p.t('studierendenantrag/antrag_Wiederholung_button_no')}}
</button>-->
</div>
</div>
</core-form>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
{{ errorMessage }}
@@ -39,15 +39,10 @@ export default {
},
methods: {
loadFilter() {
axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/getActiveStgs'
).then(result => {
this.stgs = result.data.retval;
}).catch(error => {
console.error(error);
});
this.$fhcApi.factory
.studstatus.leitung.getStgs()
.then(result => this.stgs = result.data)
.catch(this.$fhcAlert.handleSystemError);
},
changeFilter(filter) {
this.filter = filter || undefined;
@@ -103,21 +98,9 @@ export default {
}
} else {
this.$refs.loader.show();
axios
.all(
oks.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/approve' + antrag.typ,
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.approve(oks)
.then(this.showResults);
}
},
actionReject(evt, gruende) {
@@ -147,99 +130,38 @@ export default {
.catch(() => {});
} else {
this.$refs.loader.show();
axios
.all(
gruende.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/reject' + antrag.typ,
{
studierendenantrag_id: antrag.studierendenantrag_id,
grund: antrag.grund
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.reject(gruende)
.then(this.showResults);
}
},
actionReopen(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/reopenAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.reopen(gruende)
.then(this.showResults);
},
actionPause(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/pauseAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.pause(antraege)
.then(this.showResults);
},
actionUnpause(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/unpauseAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.unpause(antraege)
.then(this.showResults);
},
actionObject(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.object(antraege)
.then(this.showResults);
},
actionoObjectionDeny(evt, gruende) {
var antraege = evt || this.selectedData;
@@ -267,84 +189,31 @@ export default {
.catch(() => {});
} else {
this.$refs.loader.show();
axios
.all(
gruende.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectionDeny/',
{
studierendenantrag_id: antrag.studierendenantrag_id,
grund: antrag.grund
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.denyObjection(gruende)
.then(this.showResults);
}
},
actionObjectionApprove(evt, gruende) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectionApprove/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.leitung.approveObjection(antraege)
.then(this.showResults);
},
actionCancel(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/cancelAntrag/',
{
antrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
this.$fhcApi.factory
.studstatus.abmeldung.cancel(antraege)
.then(this.showResults);
},
showValidation(results) {
var errors = results.filter(res => res.data.error);
showResults(results) {
let fulfilled = results.filter(res => res.status == 'fulfilled');
this.$refs.loader.hide();
if (errors.length) {
let errorMsg = errors.map(
error =>
'Antrag ' +
JSON.parse(error.config.data).studierendenantrag_id +
'\n' +
Object.values(error.data.retval).join('\n')
).join('\n');
BsAlert.popup(errorMsg, {dialogClass: 'alert alert-danger'});
}
this.reload();
},
showError(error) {
this.$refs.loader.hide();
let msg = error.response.data;
if (msg.replace(/^\s+/, '').substr(0, 9) == '<!DOCTYPE' || msg.replace(/^\s+/, '').substr(0, 4).toLowerCase() == '<div')
msg = error.message;
BsAlert.popup(msg, {dialogClass: 'alert alert-danger'});
//fulfilled.forEach(a => this.$fhcAlert.alertDefault('success', '#' + a.value.data, 'Approved, ...'));
if (fulfilled.length)
this.reload();
}
},
created() {
@@ -35,28 +35,32 @@ export default {
});
},
loadData(evt) {
if (this.abortController)
this.abortController.abort();
if( evt.query.length < 2 )
{
return false;
}
if (this.abortController instanceof AbortController
&& this.abortController.signal.aborted === false)
{
this.abortController.abort();
}
this.abortController = new AbortController();
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/getStudiengaengeAssistenz/',
evt,
{
signal: this.abortController.signal
}
).then(
result => {
if (result.data.error) {
BsAlert.popup(result.data.retval, {dialogClass: 'alert alert-danger'});
} else {
this.data = result.data.retval;
}
return result;
}
).catch(() => {});
this.$fhcApi.factory
.studstatus.leitung.getPrestudents(evt.query, this.abortController.signal)
.then(result => {
this.data = result.data;
this.abortController = null;
})
.catch(error => {
if (this.abortController instanceof AbortController
&& this.abortController.signal.aborted === false)
{
this.abortController.abort();
}
this.$fhcAlert.handleSystemError(error);
});
}
},
template: `
@@ -79,15 +83,20 @@ export default {
class="w-100"
v-model="student"
:suggestions="data"
optionLabel = "name"
option-label = "name"
@complete="loadData"
inputId="newAntragModalAutoComplete"
input-id="newAntragModalAutoComplete"
dropdown
dropdown-mode="current"
>
<template #option="slotProps">
<div :title="slotProps.option.prestudent_id">
{{slotProps.option.name}}
{{slotProps.option.name}}
</div>
</template>
<template #empty>
<div class="text-muted px-3 py-2">
{{ $p.t('ui/keineEintraegeGefunden') }}
</div>
</template>
</auto-complete>
@@ -36,21 +36,17 @@ export default {
},
methods: {
setlvs(param) {
if(param.error) {
this.$refs.fetchCompt.error = true;
this.$refs.fetchCompt.errorMessage = param.retval;
} else {
this.repeat_last = !!param.retval.repeat_last;
if (this.repeat_last) {
delete param.retval.repeat_last;
}
this.lvs = param.retval;
this.repeat_last = !!param.repeat_last;
if (this.repeat_last) {
delete param.repeat_last;
}
this.lvs = param;
},
loadlvs() {
if (!this.antragId)
return new Promise(() => {});
return axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Antrag/Wiederholung/getLvs/' + this.antragId);
return this.$fhcApi.factory
.studstatus.wiederholung.getLvs(this.antragId);
},
submit(result) {
this.result = [result, this.check];
@@ -31,9 +31,6 @@ export default {
],
data() {
return {
ajaxUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/getAntraege/',
table: null,
lastHistoryClickedId: null,
historyData: [],
@@ -42,7 +39,7 @@ export default {
},
methods: {
reload(stg) {
this.table.setData(this.ajaxUrl + (stg || ''));
this.table.setData('/' + (stg || ''));
},
download() {
this.table.download("csv", "data.csv", {
@@ -53,14 +50,12 @@ export default {
getHistory() {
if (this.lastHistoryClickedId === null)
return null;
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/getHistory/' +
this.lastHistoryClickedId
).then(res => {
this.historyData = res.data.retval.sort((a, b) => a.insertamum > b.insertamum);
});
return this.$fhcApi.factory
.studstatus.leitung.getHistory(this.lastHistoryClickedId)
.then(res => {
this.historyData = res.data.sort((a, b) => a.insertamum > b.insertamum);
})
.catch(this.$fhcApi.handleSystemError);
},
getHistoryStatus(data, index) {
if (data.insertvon == 'Studienabbruch')
@@ -116,7 +111,8 @@ export default {
movableColumns: true,
height: '65vh',
layout: "fitDataFill",
ajaxURL: this.ajaxUrl + (this.filter || ''),
ajaxURL: '/' + (this.filter || ''),
ajaxRequestFunc: this.$fhcApi.factory.studstatus.leitung.getAntraege,
persistence: { // NOTE(chris): do not store column titles
sort: true, //persist column sorting
filter: true, //persist filters
@@ -269,7 +265,7 @@ export default {
allowed_status_for_download = ['Genehmigt'];
break;
case 'AbmeldungStgl':
allowed_status_for_download = ['Genehmigt', 'Beeinsprucht', 'EinspruchAbgelehnt', 'Abgemeldet'];
allowed_status_for_download = ['EinspruchAbgelehnt', 'Abgemeldet'];
break;
case 'Unterbrechung':
allowed_status_for_download = ['Genehmigt', 'EmailVersandt'];
@@ -56,39 +56,19 @@ export default {
anmerkung: lv.antrag_anmerkung || "",
studiensemester_kurzbz: this.lvs2sem
}));
axios.post(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Antrag/Wiederholung/saveLvs/', {forbiddenLvs, mandatoryLvs})
this.$fhcApi.factory
.studstatus.wiederholung.saveLvs(forbiddenLvs, mandatoryLvs)
.then(response => {
if(!response.data.error) {
this.addAlert('Speichern erfolgreich', 'alert-success');
this.statusCode = response.data.retval[0].studierendenantrag_statustyp_kurzbz;
this.statusMsg = response.data.retval[0].typ;
} else {
this.addAlert(response.data.retval.message || response.data.retval, 'alert-danger');
this.statusCode = 0;
this.statusMsg = 'Error';
}
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
this.statusCode = response.data[0].studierendenantrag_statustyp_kurzbz;
this.statusMsg = response.data[0].typ;
this.isloading = false;
}).catch(error => {
this.addAlert(error.message, 'alert-danger');
})
.catch(error => {
this.statusCode = 0;
this.statusMsg = 'Error';
this.isloading = false;
}).finally(() => {
window.scrollTo(0, 0);
});
},
addAlert(text, type) {
const para = document.createElement("p");
para.innerText = text;
para.className = "alert " + type + " alert-dismissible fade show";
const btn = document.createElement("button");
btn.className = "btn-close";
btn.type = "button";
btn.setAttribute("aria-label", "Close");
btn.setAttribute("data-bs-dismiss", "alert");
para.appendChild(btn);
this.$refs.alertbox.appendChild(para);
}
},
created() {
@@ -96,149 +76,141 @@ export default {
this.statusMsg = this.initialStatusMsg;
},
mounted() {
axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Antrag/Wiederholung/getLvs/' + this.antragId).then(
result => {
if(result.data.error)
{
this.addAlert(result.data.retval, 'alert-danger');
this.isloading = true;
}
else
{
let res = {};
this.$p
.loadCategory(['ui', 'lehre', 'studierendenantrag', 'global'])
.then(() => {
for (var k in result.data.retval) {
if (k === 'repeat_last')
continue;
if (result.data.retval[k] === null) {
const alert = document.createElement('div');
alert.innerHTML = this.$p.t('studierendenantrag', 'error_stg_last_semester');
alert.className = 'alert alert-warning';
alert.role = 'alert';
this.$refs["lvtable" + k.substr(0,1)].append(alert);
continue;
this.$p
.loadCategory(['ui', 'lehre', 'studierendenantrag', 'global'])
.then(() => this.antragId)
.then(this.$fhcApi.factory.studstatus.wiederholung.getLvs)
.then(result => {
let res = {};
for (var k in result.data) {
if (k === 'repeat_last')
continue;
if (result.data[k] === null) {
const alert = document.createElement('div');
alert.innerHTML = this.$p.t('studierendenantrag', 'error_stg_last_semester');
alert.className = 'alert alert-warning';
alert.role = 'alert';
this.$refs["lvtable" + k.substr(0,1)].append(alert);
continue;
}
let lvs = result.data[k].reduce((obj,lv) => {
obj[lv.studienplan_lehrveranstaltung_id] = lv;
return obj;
}, {});
for (var lv of Object.values(lvs)) {
if (!lv.studienplan_lehrveranstaltung_id_parent)
continue;
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent])
console.error('parent not available');
else {
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent]._children)
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children = [];
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children.push(lv);
}
}
res[k] = Object.values(lvs).filter(lv => !lv.studienplan_lehrveranstaltung_id_parent);
let current = res[k];
let index = k.substr(0,1);
const options = {
data: current,
dataTree: true,
dataTreeStartExpanded: true, //start with an expanded tree
dataTreeChildIndent: 15,
layout: "fitDataStretch",
columns: [
{title: this.$p.t('ui', 'bezeichnung'), field: "bezeichnung"},
{title: this.$p.t('lehre','lehrform'), field: "lehrform_kurzbz"},
{title: "ECTS", field: "ects"},
{title: this.$p.t('lehre','note'), field: "note", formatter:(cell, formatterParams, onRendered) => cell.getValue() || "---"},
{
title: index == 1 && !result.data.repeat_last ? this.$p.t('studierendenantrag','lv_nicht_zulassen') : this.$p.t('studierendenantrag','lv_wiederholen'),
field: "antrag_zugelassen",
formatter: (cell, formatterParams, onRendered) => {
let data = cell.getData();
if (data._children || !data.zeugnis)
return "";
let input = document.createElement('input');
input.className = "form-check-input";
input.type = "checkbox";
input.role = "switch";
input.checked = cell.getValue();
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen = input.checked;
cell.getRow().reformat();
});
if (this.disabled) {
input.disabled = true;
}
let div = document.createElement('div');
div.className = 'form-check form-switch';
div.append(input);
return div;
}
let lvs = result.data.retval[k].reduce((obj,lv) => {
obj[lv.studienplan_lehrveranstaltung_id] = lv;
return obj;
}, {});
for (var lv of Object.values(lvs)) {
if (!lv.studienplan_lehrveranstaltung_id_parent)
continue;
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent])
console.error('parent not available');
else {
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent]._children)
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children = [];
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children.push(lv);
},
{
title: this.$p.t('global','anmerkung'),
field: "antrag_anmerkung",
headerSort:false,
titleFormatter:(cell, formatterParams, onRendered)=>{
let link = document.createElement('a');
link.addEventListener('click', (e) => {
e.preventDefault();
});
link.href ="#";
link.title = this.$p.t('studierendenantrag','anmerkung_tooltip');
new bootstrap.Tooltip(link);
let tooltip = document.createElement('span');
tooltip.innerHTML = this.$p.t('global','anmerkung') + " ";
tooltip.append(link);
let icon = document.createElement('i');
link.append(icon);
icon.className = "fa fa-info-circle";
icon.setAttribute("aria-hidden", "true");
icon.style.minWidth = '1em';
return tooltip;
},
formatter: (cell, formatterParams, onRendered) => {
if (this.disabled) {
return cell.getValue() || "";
}
var data = cell.getData();
if (lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen)
{
let input = document.createElement('input');
input.className = "form-control";
input.type = "text";
input.value = cell.getValue() || "";
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_anmerkung = input.value;
});
return input;
}
else
{
return "";
}
}
res[k] = Object.values(lvs).filter(lv => !lv.studienplan_lehrveranstaltung_id_parent);
let current = res[k];
let index = k.substr(0,1);
const options = {
data: current,
dataTree: true,
dataTreeStartExpanded: true, //start with an expanded tree
dataTreeChildIndent: 15,
layout: "fitDataStretch",
columns: [
{title: this.$p.t('ui', 'bezeichnung'), field: "bezeichnung"},
{title: this.$p.t('lehre','lehrform'), field: "lehrform_kurzbz"},
{title: "ECTS", field: "ects"},
{title: this.$p.t('lehre','note'), field: "note", formatter:(cell, formatterParams, onRendered)=>cell.getValue() || "---"},
{
title: index == 1 && !result.data.retval.repeat_last ? this.$p.t('studierendenantrag','lv_nicht_zulassen') : this.$p.t('studierendenantrag','lv_wiederholen'),
field: "antrag_zugelassen",
formatter: (cell, formatterParams, onRendered) => {
let data = cell.getData();
if(data._children || !data.zeugnis)
return "";
let input = document.createElement('input');
input.className = "form-check-input";
input.type = "checkbox";
input.role = "switch";
input.checked = cell.getValue();
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen = input.checked;
cell.getRow().reformat();
});
if (this.disabled) {
input.disabled = true;
}
let div = document.createElement('div');
div.className = 'form-check form-switch';
div.append(input);
return div;
}
},
{
title: this.$p.t('global','anmerkung'),
field: "antrag_anmerkung",
headerSort:false,
titleFormatter:(cell, formatterParams, onRendered)=>{
let link = document.createElement('a');
link.addEventListener('click', (e) => {
e.preventDefault();
});
link.href ="#";
link.title = this.$p.t('studierendenantrag','anmerkung_tooltip');
new bootstrap.Tooltip(link);
let tooltip = document.createElement('span');
tooltip.innerHTML = this.$p.t('global','anmerkung') + " ";
tooltip.append(link);
let icon = document.createElement('i');
link.append(icon);
icon.className = "fa fa-info-circle";
icon.setAttribute("aria-hidden", "true");
icon.style.minWidth = '1em';
return tooltip;
},
formatter: (cell, formatterParams, onRendered) => {
if (this.disabled) {
return cell.getValue() || "";
}
var data = cell.getData();
if (lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen)
{
let input = document.createElement('input');
input.className = "form-control";
input.type = "text";
input.value = cell.getValue() || "";
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_anmerkung = input.value;
});
return input;
}
else
{
return "";
}
}
}
]
};
var table = new Tabulator(this.$refs["lvtable" + k.substr(0,1)], options);
}
this.lvs = result.data.retval;
});
]
};
var table = new Tabulator(this.$refs["lvtable" + k.substr(0,1)], options);
}
}
);
this.lvs = result.data;
})
.catch(error => {
this.$fhcAlert.handleSystemError(error);
this.isloading = true;
});
},
template: `
<div class="col-sm-10">
<div ref="alertbox"></div>
<span class="d-flex justify-content-between h4">
<span>{{lvs.repeat_last ? $p.t('studierendenantrag', 'title_lv_wiederholen') : $p.t('studierendenantrag', 'title_lv_nicht_zugelassen')}}</span>
<span>{{lvs1sem}}</span>

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