Compare commits

...
Author SHA1 Message Date
adisposkofh 00f07ba6f0 excluding zeitverfugbarkeit option from zeitsperren dropdown 2026-08-14 14:13:03 +02:00
Harald Bamberger 9c7e98f1cb js import add missing file extension 2026-05-06 18:31:26 +02:00
ma0068 c34ffedb42 Autocomplete Field Vertretung
Form with ISO fields for hours
Admin functionality for seeing Timelocks of uid in route
Backend with CI-Validations
Phrases
2026-01-21 10:59:16 +01:00
ma0068 b5382b1bdf Form and Start Backend 2026-01-15 15:39:42 +01:00
ma0068 519cbc7601 base structure and table 2026-01-14 09:26:15 +01:00
Harald Bamberger c113c80862 fix calculation of next student matrikelnr aka personenkennzeichen and student uid 2025-12-22 21:11:05 +01:00
Andreas Österreicher 063cbcbf4f Merge branch 'feature-62775/reihungstesttool_firefox_check_entfernen' 2025-12-19 09:50:15 +01:00
Harald Bamberger 0616236e00 bugfix: ZGV Übernahme bei Interessentenanlage, bestehende ZGVs die null sind ausfiltern 2025-12-18 12:48:08 +01:00
Harald Bamberger 79ad8601da Merge branch 'feature-68763/CIS4_Profilupdate_Additional_Changes' 2025-12-17 13:35:59 +01:00
Harald Bamberger 6b0526fb95 add tabulator persistence config 2025-12-17 13:22:39 +01:00
Harald Bamberger 39d708aa61 Merge branch 'master' into feature-68763/CIS4_Profilupdate_Additional_Changes 2025-12-17 12:56:07 +01:00
Harald Bamberger becbe5823c Merge branch 'feature-69286/StudStatusWiedereinstiegsmail_an_Studierende' 2025-12-16 16:16:29 +01:00
Harald Bamberger ddfcef9ad7 log Error if mail can not be sent, only change status if both reminder emails were successfully sent 2025-12-16 15:52:44 +01:00
Harald Bamberger 4f5e49a93c send to all private email addresses marked as zustellung 2025-12-16 15:27:31 +01:00
Harald Bamberger a3b5718422 Merge branch 'master' into feature-69286/StudStatusWiedereinstiegsmail_an_Studierende 2025-12-16 07:43:45 +01:00
Harald Bamberger a4be020156 Merge branch 'feature-68768/Studierendenstatus_Neue_Abmeldungsgruende' 2025-12-15 16:36:16 +01:00
Harald Bamberger 2149ed2384 Merge branch 'master' into feature-68768/Studierendenstatus_Neue_Abmeldungsgruende 2025-12-15 16:27:57 +01:00
Harald Bamberger 29c8e6fb19 Merge branch 'master' into feature-69286/StudStatusWiedereinstiegsmail_an_Studierende 2025-12-15 16:27:25 +01:00
Harald Bamberger cf7e9921b5 change grades sort order 2025-12-15 16:11:46 +01:00
Harald Bamberger 887d9f9cbd Merge branch 'feature-69877/StudVw_Status_GrundAndAnmerkungEditable' 2025-12-15 15:31:52 +01:00
Harald Bamberger 7de3c4a24e remove unnecessary line 2025-12-15 15:22:32 +01:00
Harald Bamberger 11ff26d8e7 remove empty lines 2025-12-15 15:20:19 +01:00
Harald Bamberger 718272e8a1 remove empty line 2025-12-15 15:13:53 +01:00
Harald Bamberger 3f891179aa move check for critical changes bis from frontend to backend 2025-12-15 15:12:49 +01:00
Andreas Österreicher 56ef700ec8 Merge branch 'feature-69439/negative_stunden_im_neuen_kartereiter' 2025-12-15 14:27:27 +01:00
Harald Bamberger afc3cd0131 Merge branch 'master' into feature-69877/StudVw_Status_GrundAndAnmerkungEditable 2025-12-15 13:53:28 +01:00
Harald Bamberger 5536408065 add property stg_kz to json of org_forms to prevent clearing tabulator when changing form a node with stg_kz property set to an orgform_node 2025-12-15 13:35:50 +01:00
Harald Bamberger 293a8625e4 change sort order in grades list api endpoint 2025-12-15 12:03:41 +01:00
Harald Bamberger 5266a6fe4d Merge branch 'master' into feature-69877/StudVw_Status_GrundAndAnmerkungEditable 2025-12-12 16:28:35 +01:00
Harald Bamberger 3485ee624c Merge branch 'studvw_2025-12_rc3' 2025-12-12 15:22:24 +01:00
Harald Bamberger 61c859f2e1 Merge branch 'bugfix-69874/Dokument_Ausbildungsvertrag_ohneParamUid' into studvw_2025-12_rc3 2025-12-12 15:06:49 +01:00
Harald Bamberger b967f83dd4 skip adding uid to params for templates Ausbildungsver and AusbVerEng instead of deleting it afterwards 2025-12-12 15:05:37 +01:00
Harald Bamberger ad184f5c16 change projektbetreuer tabulator layout, use correct phrases for columns person_id and punkte 2025-12-12 14:37:44 +01:00
ma0068 34d6b2d97a use only prestundent_id in Archive-functionality 2025-12-12 14:36:02 +01:00
ma0068 431ae8ddac - make button edit editable
- set field anmerkung editable (like statusgrund and statusgrund)
- refactor function updateStatus to skip validation
- change phrases
2025-12-12 13:04:58 +01:00
Harald Bamberger 0072d87f3b Merge branch 'bug-69804/FHC4_StudVw_Mobility_showAddedZweckAndGrund' into studvw_2025-12_rc3 2025-12-11 16:41:43 +01:00
ma0068 d91789aee5 Aufruf Ausbildungsvertrag mit Param prestudent-id 2025-12-11 16:20:09 +01:00
Harald Bamberger d8766e8f7a Merge branch 'feature-69065/Projektarbeiten_Firmen_verwalten' into studvw_2025-12_rc3 2025-12-11 16:06:28 +01:00
Alexei Karpenko 91f141326a Studierendenverwaltung Projektarbeiten PRojektbetreuer: replaced "formdata modified" check with edit mode check 2025-12-11 15:38:53 +01:00
ma0068 a6907d1bc5 - bugfix delete Purpose
- reload local data after pushing new entries in Purpose and Support
2025-12-11 14:20:22 +01:00
Harald Bamberger 95027937bd remove debug code 2025-12-11 12:52:05 +01:00
Harald Bamberger a86d35f731 Merge branch 'master' into feature-69065/Projektarbeiten_Firmen_verwalten 2025-12-11 12:12:05 +01:00
Alexei Karpenko 1c511f9c66 Projektarbeit controller: added comments 2025-12-11 11:42:31 +01:00
Alexei Karpenko 80f80ab8e8 added comments to Projektbetreuer 2025-12-10 19:43:15 +01:00
Alexei Karpenko 32b73b7287 Studierendenverwaltung Projektarbeiten: delete checks bugfixes, layout guidelines 2025-12-10 18:03:04 +01:00
Alexei Karpenko 98bcbda53e added check for Projektarbeitsbeurteilung when deleting Projektarbeit 2025-12-10 16:09:44 +01:00
Harald Bamberger ba1f3da02f Merge branch 'master' into studvw_2025-12_rc3 2025-12-10 15:35:58 +01:00
Harald Bamberger 994d523258 Merge branch 'feature-69451/FHC4_Studierendenverwaltung/BerechtigungenZGVs' 2025-12-10 15:29:07 +01:00
Harald Bamberger 213f20eab3 Merge branch 'feature-69451/FHC4_Studierendenverwaltung/BerechtigungenZGVs' into studvw_2025-12_rc3 2025-12-10 15:20:27 +01:00
Harald Bamberger 2bb58e24cc fix timing to prevent zgv autocomplete fields from being empty when switching from and to prestudent tab 2025-12-10 15:18:16 +01:00
ma0048 53cf777970 check im menu entfernt 2025-12-10 15:18:15 +01:00
Harald Bamberger da78332a92 Merge branch 'feature-69451/FHC4_Studierendenverwaltung/BerechtigungenZGVs' into studvw_2025-12_rc3 2025-12-10 14:50:56 +01:00
Harald Bamberger 83a76d06b6 Merge branch 'master' into studvw_2025-12_rc3 2025-12-10 14:16:46 +01:00
Harald Bamberger cfd24dd8bc Merge branch 'feature-69452/studvw_status_aktion_vorruecken_ausblenden_via_config' 2025-12-10 14:07:45 +01:00
Harald Bamberger ea5d2bc6f8 Merge branch 'master' into studvw_2025-12_rc3 2025-12-10 13:50:20 +01:00
Harald Bamberger 8468d881f1 Merge branch 'feature-69517/FHC4_Abschlusspruefung_Pruefungsprotokolltext' 2025-12-10 13:40:59 +01:00
Harald Bamberger 5041999b4b Merge branch 'master' into feature-69517/FHC4_Abschlusspruefung_Pruefungsprotokolltext 2025-12-10 13:34:52 +01:00
Harald Bamberger 033af68343 teleport datepicker out of modal 2025-12-09 17:01:30 +01:00
Harald Bamberger f460a909d9 Merge branch 'feature-69438/FHC4_Studierendenverwaltung/FeedbackPunkte' into studvw_2025-12_rc3 2025-12-09 16:37:16 +01:00
Harald Bamberger 054574f9fb Merge branch 'feature-63468/Studierendenverwaltung_Neuanlage_von_Interessenten_ueberarbeiten' into studvw_2025-12_rc3 2025-12-09 16:35:45 +01:00
ma0048 597aa1aa4e status vorruecken ueber config steuerbar
statusgrund kann wieder entfernt werden
2025-12-09 12:36:08 +01:00
Harald Bamberger 7c57f5a308 Merge branch 'master' into feature-69438/FHC4_Studierendenverwaltung/FeedbackPunkte 2025-12-09 11:50:08 +01:00
Harald Bamberger 50439ee6cc Merge branch 'master' into feature-63468/Studierendenverwaltung_Neuanlage_von_Interessenten_ueberarbeiten 2025-12-09 11:37:57 +01:00
Alexei Karpenko 016d4a1927 Studierendenverwaltung Projektbetreuer: added phrases, added check for existing Projektbetreuer when saving 2025-12-06 01:28:38 +01:00
Alexei Karpenko 112e30ab39 Studierendenverwaltung Projektarbeit: added concatenated Betreuer, sorted autocomplete suggestions, added Gesamtnote, freigegeben check removed when lock date set, added phrases 2025-12-05 22:01:35 +01:00
Harald Bamberger 7e0acdbf45 fix typo 2025-12-04 14:57:03 +01:00
Harald Bamberger 391a4753d5 fix flex-grow with tabulator exceeding width (found by ma0646) 2025-12-04 14:38:30 +01:00
ma0068 c6686f56f6 make ZGV fields and bisMelden field editable
- new Berechtigung student/editDokZgv
- Berechtigungen student/editBakkZGV, student/editMakkZGV, student/editBismelden
2025-12-04 10:35:43 +01:00
Harald Bamberger 1c2937dfb6 Merge branch 'feature-69570/StudVw_Filter_broken' 2025-12-04 08:47:55 +01:00
Harald Bamberger 841b4736a9 do not send filters to backend when search endpoint is used 2025-12-04 08:39:37 +01:00
Alexei Karpenko c79ff24c89 Studierendenverwaltung Projektarbeit: added Studiensemester dropdown for Lv-Teil 2025-12-03 19:29:42 +01:00
Alexei Karpenko 77a1067ea5 Studierendenverwaltung Projektbetreuer: default Stunden coming from global config, Stundensatz is requested each time BetreuerIn is selected 2025-12-03 15:32:21 +01:00
ma0068 d33af0ae21 bugfix: resetModal in openMode modal 2025-12-03 15:14:26 +01:00
ma0068 7726c3ce21 disable pruefungsnotizen 2025-12-03 10:23:58 +01:00
Harald Bamberger 5a970c3f2e fix typo 2025-12-03 09:58:33 +01:00
Harald Bamberger abcc1269eb add permission to show profile images in new studvw 2025-12-03 09:44:34 +01:00
Harald Bamberger c849b5defa fix broken filters 2025-12-02 18:08:03 +01:00
ma0068 d75939a8f8 refactor Messages
- endpoint: using apiMessages instead of prop
- add Phrases
- openMode Modal: resetModal if no messageId
- openMode inSamePage: loadReplyData
- function getNameOfDefaulRecipients: add missing check, if id[]
2025-12-02 16:08:13 +01:00
Andreas Österreicher 3ee81ae6e7 Merge branch 'feature-55978/infocenter_electronic_onboarding_filter' 2025-12-02 16:04:51 +01:00
Andreas Österreicher d1f684f0b3 Merge branch 'feature-69182/PHP8-Stringzugriff_mit_geschwungenen_Klammern' 2025-12-02 15:53:15 +01:00
ma0048 257038a2d1 negative stunden markieren
headerfilter angepasst fuer minusstunden
2025-12-02 13:25:46 +01:00
Harald Bamberger 4dabc642ed Merge branch 'master' into feature-69438/FHC4_Studierendenverwaltung/FeedbackPunkte 2025-12-02 07:54:40 +01:00
Harald Bamberger afb3ce4cae modify using open mode newTab or window with multiple Recipients via post request 2025-12-02 07:54:13 +01:00
ma0068 be2b578f82 reset default openmode to modal 2025-12-01 14:43:21 +01:00
ma0068 17519eac83 refactor Messaging
- headerFilter for table Messages
- multiactions for sendMessages for openmodes modal and inSamePage
2025-12-01 13:27:42 +01:00
Harald Bamberger 89ec51bd0a Merge branch 'feature-69065/Projektarbeiten_Firmen_verwalten' 2025-11-28 14:45:29 +01:00
Harald Bamberger 0372853df2 Aufnahmetermine: fix error persiting boolean, GS: sortorder studiensemester, Gruppen exclude generated groups from search result 2025-11-28 14:01:20 +01:00
Harald Bamberger dc603375ec Merge branch 'master' into feature-69065/Projektarbeiten_Firmen_verwalten 2025-11-28 11:15:59 +01:00
ma0068 aa84bdec1e ---staging---- 2025-11-27 14:46:55 +01:00
Alexei Karpenko eb1c3189b5 Studierendenverwaltung Projektarbeit: title not required anymore 2025-11-26 16:45:51 +01:00
Andreas Österreicher 6d27c3f6e2 PHPInfo entfernt 2025-11-26 08:27:14 +01:00
ma0068 93e25bb5fc added Reminder for Unterbrecher for Student 2025-11-25 17:35:44 +01:00
Harald Bamberger a413b6c779 fix bug when changing studiensemester on route search 2025-11-25 14:00:31 +01:00
Harald Bamberger f0e0bdc082 add optional query parameter studiensemester to notenspiegel and notenspiegel_erweitert to override semester_aktuell if multiple tabs in new studvw have different current semesters 2025-11-24 18:37:30 +01:00
Harald Bamberger 60661d3457 Merge branch 'studvw_2025-11_rc2' 2025-11-24 17:02:00 +01:00
Harald Bamberger 41bb99b5ea Merge branch 'master' into studvw_2025-11_rc2 2025-11-24 16:48:11 +01:00
Harald Bamberger 054b9fdee3 Merge branch 'feature-69388/Pruefung_API_insert_Propleme' 2025-11-24 16:42:49 +01:00
Harald Bamberger 61faf5386a Merge branch 'master' into studvw_2025-11_rc2 2025-11-24 16:39:47 +01:00
Harald Bamberger 6b4f5778c2 refactor stv Pruefung Tab and API endpoint to use same logic for insert and update, use luxon lib to initialize datepicker with iso date and send iso date format to api endpoint 2025-11-24 16:26:11 +01:00
Andreas Österreicher 060f11f1d8 Anmerkung und Spaltenanzahl bei Leistungsstipendien Import angepasst 2025-11-24 09:49:15 +01:00
Harald Bamberger cdc1933ce4 fix typo 2025-11-24 09:48:05 +01:00
Harald Bamberger 239a9c89d7 compare DateTime with DateTime instead of String 2025-11-24 09:46:53 +01:00
Harald Bamberger 4964a2c06d set tabulator layout to fitDataStretchFrozen when frozen columns are defined, change css classes to display disabled status use the same as in students list 2025-11-24 09:40:33 +01:00
Harald Bamberger ce5e3131c1 Merge branch 'master' into studvw_2025-11_rc2 2025-11-21 10:55:47 +01:00
Harald Bamberger 7eee6d51aa clear tabulator when returning to index or studiensemester route from search route 2025-11-21 10:55:01 +01:00
chfhtw 1666ba82b2 Bugfix: correct compare values in Pruefung->insertPruefung() 2025-11-21 10:42:13 +01:00
Harald Bamberger e54e83f718 Merge branch 'bug-68552/LV-Plan_mobile_Wochenansicht_links_rechts_scrollen' 2025-11-21 08:48:19 +01:00
chfhtw d916c6ab31 make Pruefung->insertPruefung() behave exactly like old FAS 2025-11-21 08:27:05 +01:00
Harald Bamberger be35fd5313 fix typo 2025-11-20 19:09:31 +01:00
Harald Bamberger dd92c815da fix back button behavior in studvw and lvverwaltung 2025-11-20 18:59:44 +01:00
ma0068 d76e84639f neue Phrasen bzw. Phrasenupdate zu Abmeldungsgruende Studierendenantrag 2025-11-20 16:18:55 +01:00
Harald Bamberger 6357aca656 show combine person tab only if permission basis/person, restore endpoint handling logic in List.js 2025-11-20 15:19:36 +01:00
Harald Bamberger d001e3c168 add option to deactivate livesearch, so the searchresult in studvw is shown in tabulator 2025-11-20 13:40:10 +01:00
Harald Bamberger d88f2a0a48 Merge branch 'feature-69176/Studierendenverwaltung_Berichte' into studvw_2025-11_rc2 2025-11-20 13:35:01 +01:00
Harald Bamberger 6378e75c37 Merge branch 'feature-68744/Studierendenverwaltung_Einstellungen' into studvw_2025-11_rc2 2025-11-20 13:33:56 +01:00
Harald Bamberger e22344e9dd Merge branch 'feature-68770/FHC4_Studierendenverwaltung_Funktion_Personen_Zusammenlegen' into studvw_2025-11_rc2 2025-11-20 13:28:37 +01:00
Harald Bamberger 0ed11a02a5 Merge branch 'master' into feature-69176/Studierendenverwaltung_Berichte 2025-11-20 13:27:30 +01:00
Harald Bamberger 23d1104602 Merge branch 'master' into feature-68770/FHC4_Studierendenverwaltung_Funktion_Personen_Zusammenlegen 2025-11-20 13:26:34 +01:00
Harald Bamberger bab15bc5b2 add fs_x-small and fs_xx-small and ajust css em settings 2025-11-19 13:01:47 +01:00
Harald Bamberger 1cc77c8eba Merge branch 'master' into feature-68744/Studierendenverwaltung_Einstellungen 2025-11-19 11:42:21 +01:00
Paolo e837101651 PHP8 compatibility: replaced the curly brackets {} with square brackets [] where used in combination with strings 2025-11-19 10:53:59 +01:00
Alexei Karpenko ad7012367c added Link to company management in project work management 2025-11-17 14:52:58 +01:00
chfhtw 03b3182000 adding Notenspiegel to AppMenu 2025-11-17 13:09:16 +01:00
chfhtw de012b290b get semester & orgform from Verband to StudVw Main Component 2025-11-13 16:27:15 +01:00
chfhtw dbf9547f9c add CSS class disabled to AppMenu 2025-11-13 16:23:57 +01:00
chfhtw 65df13ca9f add slot to AppMenu 2025-11-13 16:23:04 +01:00
chfhtw e36e86fd50 Code Quality 2025-11-13 09:54:56 +01:00
chfhtw cd574cd12c Reload settings setup on language change 2025-11-13 09:39:38 +01:00
chfhtw 95f1c66684 Stv Settings Phrases 2025-11-13 09:11:06 +01:00
chfhtw 5d957e38ae Phrase settings saved 2025-11-13 08:52:47 +01:00
chfhtw 7566e8aac2 Make AppConfig a general Component 2025-11-13 08:48:54 +01:00
chfhtw 7fdfa94d11 Merge branch 'master' into feature-68744/Studierendenverwaltung_Einstellungen 2025-11-12 08:15:56 +01:00
chfhtw 77604c5e15 StV: Font Size setting 2025-11-12 08:02:06 +01:00
chfhtw 775d865878 StV settings 2025-11-10 12:38:57 +01:00
chfhtw 5ecd81bb09 translate logout 2025-11-05 16:50:22 +01:00
chfhtw 1cdebbe977 remove unused changed eventlistener 2025-11-05 16:49:12 +01:00
chfhtw a97a176522 use phrasen in stv list 2025-11-05 16:47:31 +01:00
chfhtw ede2e1710e Merge branch 'master' into feature-68744/Studierendenverwaltung_Einstellungen 2025-11-05 16:45:21 +01:00
chfhtw 6011109132 Fix language on details tabs 2025-11-05 11:44:25 +01:00
chfhtw cc3da1439d StV: add user menu 2025-11-05 11:06:45 +01:00
Andreas Österreicher aa43a2f32c Merge branch 'master' into feature-55978/infocenter_electronic_onboarding_filter 2025-11-03 12:57:41 +01:00
chfhtw d6c4e0db41 show submit btn in StV 2025-11-03 11:36:24 +01:00
chfhtw 398478e575 searchbar submit button 2025-11-03 11:36:10 +01:00
chfhtw 17540070a1 remove comments 2025-11-03 11:35:31 +01:00
chfhtw d923f30ccf Add search from url functionality 2025-11-03 11:05:26 +01:00
chfhtw fc16a9e4c6 Stv: add search results to student list 2025-10-30 14:01:46 +01:00
chfhtw 9699684946 Stv: students search function 2025-10-30 14:00:41 +01:00
chfhtw 06b562786d searchbar: make abort function 2025-10-30 14:00:03 +01:00
chfhtw 539c78166f Stv list: allow post calls on tabulator 2025-10-30 13:59:12 +01:00
chfhtw 5a0134c6cc searchbar: prevent clear on enter 2025-10-30 13:58:18 +01:00
chfhtw a8535e6e0f replace old $fhcApi calls with new $api 2025-10-30 13:57:15 +01:00
ma0068 4be0a831a1 add Phrases 2025-10-23 13:49:05 +02:00
ma0068 9ed3251e55 open in iframe, only show tab if count in config is valid 2025-10-23 12:55:14 +02:00
ma0068 9a8fbabbe4 move dropdown profileUpdateStates to FilterComponent, delete not needed code 2025-10-22 14:25:43 +02:00
ma0068 6337869098 new Multitab CombinePeople, start Function 2025-10-22 10:23:24 +02:00
ma0068 1423579a49 refactor Profile Update for filter, backendfilter not active 2025-10-21 14:42:02 +02:00
ma0068 6e9969d9e4 use shorter table names for columns stg and orgform , add column ausbildungssemester 2025-10-20 16:08:12 +02:00
chfhtw 1fbca8bdab Bugfix: Add overflow for horizontal scrolling 2025-10-17 10:14:47 +02:00
Alexei Karpenko 07bcbee11b add Interessent: insertamum and insertvon when adding prestuden 2025-10-13 10:52:52 +02:00
Alexei Karpenko b9cb8f9cce Interessent anlegen: bugfix Geburtsdatum save, when searching for existing persons, more fields are displayed, form is emptied each time it is opened, adress can only be added, but not overwritten 2025-10-10 16:42:14 +02:00
Alexei Karpenko 309faaae06 phrasesupdate coma bugfix 2025-10-06 16:57:31 +02:00
Alexei Karpenko 1c21e8f88d Merge branch 'master' into feature-63468/Studierendenverwaltung_Neuanlage_von_Interessenten_ueberarbeiten 2025-10-06 16:54:41 +02:00
Alexei Karpenko 5640f229d3 Studierendenverwaltung add Interessenten: switched to new API, Studienplaene are loaded in time 2025-10-06 16:10:06 +02:00
Alexei Karpenko b22c6c10e4 Student.php controller: renamed method add Interessent to addFirstPrestudentstatus 2025-10-03 14:05:40 +02:00
Alexei Karpenko 60a1d40048 prstudentlib incoming: removed addmeta (debugging) 2025-10-03 14:03:41 +02:00
Alexei Karpenko 8c6033fed6 add first incoming: correctly check lehrverband, moved creating of incoming prestudentstatus to prestudent lib 2025-10-03 14:02:53 +02:00
Alexei Karpenko 3a6fb08350 Creating of Interessenten: moved to PRestudentlib, renamed check to getPerson, corrected transaction handling, enabled creating of Incomings 2025-10-02 16:52:11 +02:00
Alexei Karpenko 6199283698 Merge branch 'feature-61232/Studierendenverwaltung_Karteireiter_Projektarbeit_portieren' into feature-63468/Studierendenverwaltung_Neuanlage_von_Interessenten_ueberarbeiten 2025-09-22 17:36:11 +02:00
Alexei Karpenko 0cb36c2d30 Merge branch 'feature-61232/Studierendenverwaltung_Karteireiter_Projektarbeit_portieren' into feature-63468/Studierendenverwaltung_Neuanlage_von_Interessenten_ueberarbeiten 2025-09-22 15:54:46 +02:00
Alexei Karpenko c07697c541 Merge branch 'feature-61232/Studierendenverwaltung_Karteireiter_Projektarbeit_portieren' into feature-63468/Studierendenverwaltung_Neuanlage_von_Interessenten_ueberarbeiten 2025-09-22 13:52:37 +02:00
ma0048 153e273fec firefox check entfernt 2025-07-09 13:52:46 +02:00
Andreas Österreicher 02df06288e Bugfix Rückstellgrund 2025-06-16 11:37:04 +02:00
Andreas Österreicher ce47579870 Merge branch 'master' into feature-55978/infocenter_electronic_onboarding_filter 2025-06-16 11:35:49 +02:00
ma0048 bc48445304 - infocenter filter fuer electronic onboarding hinzugefuegt 2025-02-10 13:05:44 +01:00
107 changed files with 6543 additions and 1296 deletions
+15 -4
View File
@@ -61,7 +61,11 @@ $config['tabs'] =
'notes' => [
//if true, the count of Messages will be shown in the header of the Tab Messages
'showCountNotes' => true
]
],
'combinePeople' => [
//multitab should only be shown with this length of selection
'validCountMulti' => 2,
],
];
// List of fields to show when ZGV_DOKTOR_ANZEIGEN is defined
@@ -84,9 +88,14 @@ if (!defined('ZGV_DOKTOR_ANZEIGEN') || !ZGV_DOKTOR_ANZEIGEN) {
);
}
$config['tabs']['projektarbeit']['defaultProjektbetreuerStunden'] = '4.0';
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundenDiplom'] = '5.0';
$config['tabs']['projektarbeit']['lvLektroinnenzuteilungFixangestelltStundensatz'] = true;
$config['tabs']['projektarbeit']['defaultProjektbetreuerStunden'] =
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR')
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR
: '0.0';
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundenDiplom'] =
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER')
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER
: '0.0';
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundensatz'] = '80.0';
$config['student_tab_order'] = [
@@ -115,7 +124,9 @@ $config['student_tab_order'] = [
$config['students_tab_order'] = [
'banking',
'status',
'messages',
'groups',
'finalexam',
'combinePeople',
'archive',
];
+1 -1
View File
@@ -14,7 +14,7 @@ class Pub extends Auth_Controller
{
parent::__construct(
array(
'bild' => ['basis/cis:r']
'bild' => ['basis/cis:r', 'assistenz:r']
)
);
}
@@ -0,0 +1,30 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Zeitsperren extends Auth_Controller
{
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r'],
]);
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
}
/**
* index loads the view Zeitsperren
* @access public
* @return void
*/
public function index()
{
$viewData = array(
'uid'=>getAuthUID(),
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'zeitsperren']);
}
}
+8 -1
View File
@@ -20,11 +20,18 @@ class NeueNachricht extends Auth_Controller
*/
public function _remap()
{
$typeid = $this->input->post('typeid');
$ids = ($this->input->post('ids') && strpos($this->input->post('ids'), ','))
? explode(',', $this->input->post('ids'))
: $this->input->post('ids');
//now working
$this->load->view('Nachrichten', [
'permissions' => [
'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz','suid'),
]
],
'ids' => $ids,
'typeid' => $typeid
]);
}
}
@@ -32,6 +32,10 @@ class Studentenverwaltung extends Auth_Controller
'student/keine_studstatuspruefung' => $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung'),
'lehre/reihungstestAufsicht' => $this->permissionlib->isBerechtigt('lehre/reihungstestAufsicht'),
'system/change_outputformat' => $this->permissionlib->getOE_isEntitledFor('system/change_outputformat'),
'student/editBakkZgv' => $this->permissionlib->isBerechtigt('student/editBakkZgv'),
'student/editMakkZgv' => $this->permissionlib->isBerechtigt('student/editMakkZgv'),
'student/editDokZgv' => $this->permissionlib->isBerechtigt('student/editDokZgv'),
'student/editBismelden' => $this->permissionlib->isBerechtigt('student/editBismelden')
],
'variables' => [
'semester_aktuell' => $this->variablelib->getVar('semester_aktuell')
@@ -442,6 +442,10 @@ class Documents extends FHCAPI_Controller
'betreuerart_kurzbz',
'studiensemester_kurzbz'
] as $key) {
if (in_array($xsl, array('Ausbildungsver', 'AusbVerEng')) && $key === 'uid')
{
continue;
}
$value = $this->input->post_get($key);
if ($value !== null)
$params .= '&' . $key . '=' . urlencode($value);
@@ -0,0 +1,367 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Zeitsperren extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'getZeitsperrenUser' => self::PERM_LOGGED,
'getTypenZeitsperren' => self::PERM_LOGGED,
'getTypenErreichbarkeit' => self::PERM_LOGGED,
'getStunden' => self::PERM_LOGGED,
'loadZeitsperre' => self::PERM_LOGGED,
'add' => self::PERM_LOGGED,
'update' => self::PERM_LOGGED,
'delete' => self::PERM_LOGGED,
]);
// Load Libraries
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$this->load->library('form_validation');
// Load language phrases
$this->loadPhrases([
'ui',
'person',
'zeitsperren'
]);
// Load models
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
$this->load->model('ressource/Zeitsperretyp_model', 'ZeitsperretypModel');
$this->load->model('ressource/Erreichbarkeit_model', 'ErreichbarkeitModel');
$this->load->model('ressource/Stunde_model', 'StundeModel');
$this->load->model('ressource/Zeitaufzeichnung_model', 'ZeitaufzeichnungModel');
}
public function getZeitsperrenUser($uid)
{
//check if $uid is passedUser
$loggedInUser = getAuthUID();
if($loggedInUser != $uid) {
$this->load->library('PermissionLib');
$isAdmin = $this->permissionlib->isBerechtigt('admin');
if(!$isAdmin) {
$this->terminateWithError($this->p->t('ui', 'noAdmin'), self::ERROR_TYPE_GENERAL);
}
}
$result = $this->ZeitsperreModel->getZeitsperrenUser($uid);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
public function getTypenZeitsperren()
{
$excludedTypes = array('ZVerfueg');
$result = $this->ZeitsperretypModel->getTypenZeitsperren($excludedTypes);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
public function getTypenErreichbarkeit()
{
$result = $this->ErreichbarkeitModel->load();
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
public function getStunden()
{
$this->StundeModel->addOrder('stunde', 'ASC');
$result = $this->StundeModel->load();
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
public function loadZeitsperre($zeitsperre_id)
{
$this->ZeitsperreModel->addSelect(
'campus.tbl_zeitsperre.*, typ.*,
ma.person_id AS ma_person_id, ma.vorname AS ma_vorname, ma.nachname AS ma_nachname,
ma.titelpre AS ma_titelpre, ma.titelpost AS ma_titelpost'
);
$this->ZeitsperreModel->addJoin('campus.tbl_zeitsperretyp typ', 'ON (typ.zeitsperretyp_kurzbz = campus.tbl_zeitsperre.zeitsperretyp_kurzbz)');
$this->ZeitsperreModel->addJoin('public.tbl_benutzer ben', 'ON (ben.uid = campus.tbl_zeitsperre.vertretung_uid)', 'LEFT');
$this->ZeitsperreModel->addJoin('public.tbl_person ma', 'ON (ma.person_id = ben.person_id)', 'LEFT');
$result = $this->ZeitsperreModel->loadWhere(
array('zeitsperre_id' => $zeitsperre_id)
);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((current(getData($result)) ?: []));
}
public function add($mitarbeiter_uid)
{
$loggedInUser = getAuthUID();
if($mitarbeiter_uid != $loggedInUser)
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
$this->form_validation->set_rules('zeitsperretyp_kurzbz', 'Grund Zeitsperre', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Grund Zeitsperre'])
]);
$this->form_validation->set_rules('vondatum', 'VonDatum', 'required|is_valid_date', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'VonDatum']),
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
]);
$this->form_validation->set_rules('bisdatum', 'BisDatum', 'required|is_valid_date|callback_check_von_bis_datum|callback_check_diff_intval', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'BisDatum']),
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'BisDatum']),
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
]);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$bezeichnung = $this->input->post('bezeichnung');
$vondatum = $this->input->post('vondatum');
$vonstunde = $this->input->post('vonstunde');
$bisdatum = $this->input->post('bisdatum');
$bisstunde = $this->input->post('bisstunde');
//$vonIso = $this->input->post('vonISO'); //Timestamp für Stunde
//$bisIso = $this->input->post('bisISO'); //Timestamp für Stunde
$erreichbarkeit_kurzbz = $this->input->post('erreichbarkeit_kurzbz');
$vertretung_uid = $this->input->post('vertretung_uid');
$zeitsperretyp_kurzbz = $this->input->post('zeitsperretyp_kurzbz');
//check if existing zeitsperre
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
$data = $this->getDataOrTerminateWithError($result);
if(hasData($result))
{
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
}
//check if existing zeitaufzeichnung
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
{
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
if(hasData($result))
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
}
$result = $this->ZeitsperreModel->insert(
[
'mitarbeiter_uid' => $mitarbeiter_uid,
'bezeichnung' => $bezeichnung,
'vondatum' => $vondatum,
'vonstunde' => $vonstunde,
'bisdatum' => $bisdatum,
'bisstunde' => $bisstunde,
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
'vertretung_uid' => $vertretung_uid,
'insertvon' => $loggedInUser,
'insertamum' => date('c'),
]
);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function update($zeitsperre_id)
{
//check if loggedin User is owner of the zeitsperre
$loggedInUser = getAuthUID();
$result = $this->ZeitsperreModel->load($zeitsperre_id);
$data = $this->getDataOrTerminateWithError($result);
$uid = current($data)->mitarbeiter_uid;
if($uid != $loggedInUser)
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
if(!$zeitsperre_id)
{
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
}
//get current params
$array_update = [
'bezeichnung',
'vondatum',
'vonstunde',
'bisdatum',
'bisstunde',
// 'vonISO', //Timestamp für Stunde
// 'bisISO', //Timestamp für Stunde
'erreichbarkeit_kurzbz',
'vertretung_uid',
'zeitsperretyp_kurzbz',
'mitarbeiter_uid',
];
$post = $this->input->post();
$update = [];
foreach ($array_update as $prop)
{
if (array_key_exists($prop, $post))
{
$update[$prop] = $post[$prop];
}
}
// Validation
$rulesDefined = false; //necessary, otherwise CI validation will always be triggered, even without rules
foreach ($update as $key => $val) {
switch ($key) {
case 'zeitsperretyp_kurzbz':
$this->form_validation->set_rules(
$key,
'Grund Zeitsperre',
'required',
['required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'Grund Zeitsperre'])]
);
$rulesDefined = true;
break;
case 'vondatum':
$this->form_validation->set_rules(
$key,
'VonDatum',
'required|is_valid_date',
[
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'VonDatum']),
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'VonDatum'])
]
);
$rulesDefined = true;
break;
case 'bisdatum':
$rules = 'required|is_valid_date';
if (array_key_exists('vondatum', $update)) {
$rules .= '|callback_check_von_bis_datum|callback_check_diff_intval';
}
$this->form_validation->set_rules(
$key,
'BisDatum',
$rules,
[
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'BisDatum']),
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'BisDatum']),
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
]
);
$rulesDefined = true;
break;
}
}
if ($rulesDefined && $this->form_validation->run() == false) {
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
if(array_key_exists('vondatum', $post) || array_key_exists('bisdatum', $post))
{
$result = $this->ZeitsperreModel->load($zeitsperre_id);
$data = $this->getDataOrTerminateWithError($result);
$data = current($data);
$mitarbeiter_uid = array_key_exists('mitarbeiter_uid', $post) ? $update['mitarbeiter_uid'] : $data->mitarbeiter_uid;
$vondatum = array_key_exists('vondatum', $post) ? $update['vondatum'] : $data->vondatum;
$bisdatum = array_key_exists('bisdatum', $post) ? $update['bisdatum'] : $data->bisdatum;
$vonstunde = array_key_exists('vonstunde', $post) ? $update['vonstunde'] : $data->vonstunde;
$zeitsperretyp_kurzbz = array_key_exists('zeitsperretyp_kurzbz', $post) ? $update['zeitsperretyp_kurzbz'] : $data->zeitsperretyp_kurzbz;
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
$data = $this->getDataOrTerminateWithError($result);
if(hasData($result))
{
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
}
//check if existing zeitaufzeichnung
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
{
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
if(hasData($result))
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
}
}
if (!empty($update)) {
$update['updatevon'] = $loggedInUser;
$update['updateamum'] = date('c');
$result = $this->ZeitsperreModel->update($zeitsperre_id, $update);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
else
$this->terminateWithSuccess("no update");
}
public function delete($zeitsperre_id)
{
if (!is_numeric($zeitsperre_id) || (int)$zeitsperre_id <= 0)
{
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
}
//check if loggedin User is owner of the zeitsperre
$loggedInUser = getAuthUID();
$result = $this->ZeitsperreModel->load($zeitsperre_id);
$data = $this->getDataOrTerminateWithError($result);
$uid = current($data)->mitarbeiter_uid;
if($uid != $loggedInUser)
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
$result = $this->ZeitsperreModel->delete(
array('zeitsperre_id' => $zeitsperre_id)
);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
public function check_von_bis_datum($bisdatum)
{
$vondatum = $this->input->post('vondatum');
return $vondatum <= $bisdatum;
}
public function check_diff_intval($bisdatum)
{
$vondatum = $this->input->post('vondatum');
// Intervall in days
$vonTs = strtotime($vondatum);
$bisTs = strtotime($bisdatum);
$tage = ($bisTs - $vonTs) / 86400;
// if intervall > 14
return $tage <= 14;
}
}
@@ -1,6 +1,5 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Messages extends FHCAPI_Controller
@@ -14,6 +13,7 @@ class Messages extends FHCAPI_Controller
'getMsgVarsPrestudent' => ['admin:r', 'assistenz:r'],
'getMsgVarsLoggedInUser' => ['admin:r', 'assistenz:r'],
'getNameOfDefaultRecipient' => ['admin:r', 'assistenz:r'],
'getNameOfDefaultRecipients' => ['admin:r', 'assistenz:r'],
'sendMessage' => ['admin:r', 'assistenz:r'],
'deleteMessage' => ['admin:r', 'assistenz:r'],
'getDataVorlage' => ['admin:r', 'assistenz:r'],
@@ -21,6 +21,7 @@ class Messages extends FHCAPI_Controller
'getReplyData' => ['admin:r', 'assistenz:r'],
'getPersonId' => ['admin:r', 'assistenz:r'],
'getUid' => ['admin:r', 'assistenz:r'],
'getUids' => ['admin:r', 'assistenz:r'],
]);
//Load Models
@@ -37,7 +38,7 @@ class Messages extends FHCAPI_Controller
// Load language phrases
$this->loadPhrases([
'ui'
'ui', 'messages'
]);
}
@@ -101,22 +102,49 @@ class Messages extends FHCAPI_Controller
$this->terminateWithSuccess($vorlage);
}
public function getMessageVarsPerson($id, $typeId)
public function getMessageVarsPerson($typeId)
{
$person_id = ($typeId == 'mitarbeiter_uid') ? $this->_getPersonId($id, $typeId) : $id;
$result = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
$data = $this->getDataOrTerminateWithError($result);
$ids = $this->input->post('ids');
$messageVarsPerson = [];
$this->terminateWithSuccess($data);
foreach ($ids as $id)
{
$person_id = ($typeId == 'mitarbeiter_uid') ? $this->_getPersonId($id, $typeId) : $id;
$result = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
$data = $this->getDataOrTerminateWithError($result);
$messageVarsPerson[] = current($data);
}
$this->terminateWithSuccess($messageVarsPerson);
}
public function getMsgVarsPrestudent($id, $typeId)
public function getMsgVarsPrestudent($typeId)
{
$prestudent_id = ($typeId == 'uid') ? $this->_getPrestudentIdFromUid($id) : $id;
$result = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$ids = $this->input->post('ids');
if(!is_array($ids)) {
$ids = array($ids);
}
$messageVarsPrestudent = [];
$this->terminateWithSuccess($data);
if($typeId == 'uid')
{
$prestudent_ids = [];
foreach ($ids as $id)
{
$prestudent_ids[] = $this->_getPrestudentIdFromUid($id);
}
}
else
$prestudent_ids = $ids;
foreach ($prestudent_ids as $prestudent_id)
{
$result = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$messageVarsPrestudent[] = current($data);
}
$this->terminateWithSuccess($messageVarsPrestudent);
}
public function getMsgVarsLoggedInUser()
@@ -127,27 +155,45 @@ class Messages extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
public function getNameOfDefaultRecipient($id, $type_id)
public function getNameOfDefaultRecipients($type_id)
{
$id = ($type_id != 'person_id') ? $this->_getPersonId($id, $type_id) : $id;
$ids = $this->input->post('ids');
if(!is_array($ids)) {
$ids = array($ids);
}
$recipients = [];
if (empty($ids)) {
throw new InvalidArgumentException($this->p->t('ui', 'errorMissingOrInvalidParameters', ['parameter'=> 'Id(s)']), self::ERROR_TYPE_GENERAL);
}
$this->load->model('person/Person_model', 'PersonModel');
if($type_id != 'person_id'){
foreach ($ids as $id)
{
$person_id = $this->_getPersonId($id, $type_id);
$result = $this->PersonModel->load($person_id);
$data = $this->getDataOrTerminateWithError($result);
$name = current($data);
$recipients[$id] = $name->vorname . " " . $name->nachname;
}
}
else {
foreach ($ids as $id) {
$result = $this->PersonModel->load($id);
$data = $this->getDataOrTerminateWithError($result);
$name = current($data);
$recipients[$id] = $name->vorname . " " . $name->nachname;
}
}
$result = $this->PersonModel->load($id);
$data = $this->getDataOrTerminateWithError($result);
$name = current($data);
$this->terminateWithSuccess($name->vorname . " " . $name->nachname );
$this->terminateWithSuccess($recipients);
}
public function sendMessage($recipient_id)
public function sendMessage($typeId)
{
//has to be uid
// $this->terminateWithError("uid", $recipient_id, self::ERROR_TYPE_GENERAL);
//default setting
$receiversPersonId = $this->_getPersonId($recipient_id, 'uid');
$resultReturn = [];
$uid = getAuthUID();
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$result = $this->BenutzerModel->loadWhere(
@@ -185,47 +231,61 @@ class Messages extends FHCAPI_Controller
$body = $this->input->post('body');
$relationmessage_id = $this->input->post('relationmessage_id');
$typeId = $this->input->post('type_id');
$id = $this->input->post('id');
if($typeId == 'uid')
if (isset($_POST['ids']))
{
$prestudent_id = $this-> _getPrestudentIdFromUid($id);
//parseMessagetext for variables Prestudent
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
if($typeId == 'mitarbeiter_uid')
{
$person_id = $this->_getPersonId($id, $typeId);
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
$this->terminateWithError($bodyParsed, self::ERROR_TYPE_GENERAL);
}
elseif($typeId == 'person_id')
{
$result = $this->MessagesModel->parseMessageTextPerson($id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
elseif($typeId == 'prestudent_id')
{
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
else
{
$this->terminateWithError("type_id " . $typeId . " not valid", self::ERROR_TYPE_GENERAL);
$ids = json_decode($_POST['ids']);
unset($_POST['ids']);
foreach ($data as $k => $v) {
$_POST[$k] = $v;
}
}
$result = $this->messagelib->sendMessageUser($receiversPersonId, $subject, $bodyParsed, $benutzer->person_id, null, $relationmessage_id);
if (!is_array($ids)) {
$ids = [$ids];
}
$this->terminateWithSuccess($result);
foreach ($ids as $id)
{
$receiversPersonId = $typeId == "person_id" ? $id : $this->_getPersonId($id, $typeId);
if($typeId == 'uid')
{
$prestudent_id = $this-> _getPrestudentIdFromUid($id);
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
if($typeId == 'mitarbeiter_uid')
{
$person_id = $this->_getPersonId($id, $typeId);
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
elseif($typeId == 'person_id')
{
$result = $this->MessagesModel->parseMessageTextPerson($id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
elseif($typeId == 'prestudent_id')
{
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $body);
$bodyParsed = $this->getDataOrTerminateWithError($result);
}
else
{
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
}
$result =$this->messagelib->sendMessageUser($receiversPersonId, $subject, $bodyParsed, $benutzer->person_id, null, $relationmessage_id);
$data = $this->getDataOrTerminateWithError($result);
$resultReturn[] = current($data);
}
$this->terminateWithSuccess($resultReturn);
}
public function getPreviewText($id, $type_id)
public function getPreviewText($type_id)
{
if (isset($_POST['data']))
{
@@ -233,39 +293,60 @@ class Messages extends FHCAPI_Controller
unset($_POST['data']);
}
else
$this->terminateWithError("Textbody missing ", self::ERROR_TYPE_GENERAL);
$this->terminateWithError($this->p->t('messages', 'errorMissingOrInvalidParameters', ['parameter'=> "Textbody"]), self::ERROR_TYPE_GENERAL);
switch($type_id)
if (isset($_POST['ids']))
{
case 'uid':
$prestudent_id = $this->_getPrestudentIdFromUid($id);
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $data);
break;
case 'prestudent_id':
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $data);
break;
case 'person_id':
$result = $this->MessagesModel->parseMessageTextPerson($id, $data);
break;
case 'mitarbeiter_uid':
{
$person_id = $this->_getPersonId($id, $type_id);
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $data);
}
break;
default:
$this->terminateWithError("MESSAGES::getPreviewText logic for type_id " . $type_id . " not defined yet", self::ERROR_TYPE_GENERAL);
break;
$ids = json_decode($_POST['ids']);
if(!is_array($ids))
{
$ids = array($ids);
}
unset($_POST['ids']);
}
else
$this->terminateWithError($this->p->t('ui', 'errorMissingOrInvalidParameters', ['parameter'=> 'Id(s)']), self::ERROR_TYPE_GENERAL);
$bodyParsed = $this->getDataOrTerminateWithError($result);
$bodyParsed = [];
foreach ($ids as $id)
{
switch($type_id)
{
case 'uid':
$prestudent_id = $this->_getPrestudentIdFromUid($id);
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $data);
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
break;
case 'prestudent_id':
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $data);
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
break;
case 'person_id':
$result = $this->MessagesModel->parseMessageTextPerson($id, $data);
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
break;
case 'mitarbeiter_uid':
{
$person_id = $this->_getPersonId($id, $type_id);
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $data);
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
}
break;
default:
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $type_id]), self::ERROR_TYPE_GENERAL);
break;
}
}
$this->terminateWithSuccess($bodyParsed);
}
public function getReplyData($messageId)
{
//TODO(Manu) validation of messageId: if number
if (!is_numeric($messageId)) {
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value'=> 'Message ID']), self::ERROR_TYPE_GENERAL);
}
$this->MessageModel->addSelect('public.tbl_msg_message.*');
$this->MessageModel->addSelect('r.*');
@@ -288,7 +369,6 @@ class Messages extends FHCAPI_Controller
$replyBody = $this->_getReplyBody($body, $dataMessage[0]->nachname, $dataMessage[0]->vorname, $dataMessage[0]->insertamum);
$dataMessage[0]->replyBody = $replyBody;
$dataMessage[0]->rest = "Help Manu";
$dataMessage[0]->replySubject = $prefix . $subject;
$this->terminateWithSuccess($dataMessage);
@@ -336,6 +416,11 @@ class Messages extends FHCAPI_Controller
['prestudent_id' => $id]
);
}
else
{
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
}
$data = $this->getDataOrTerminateWithError($result);
$person = current($data);
@@ -343,8 +428,11 @@ class Messages extends FHCAPI_Controller
$this->terminateWithSuccess($person->person_id);
}
public function getUid($id, $typeId)
public function getUids($typeId)
{
$ids = $this->input->post('ids');
$benutzerIds = [];
if (!$typeId)
{
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Type ID']), self::ERROR_TYPE_GENERAL);
@@ -352,39 +440,50 @@ class Messages extends FHCAPI_Controller
elseif ($typeId == 'person_id')
{
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$result = $this->BenutzerModel->loadWhere(
['person_id' => $id]
);
foreach ($ids as $id)
{
$result = $this->BenutzerModel->loadWhere(
['person_id' => $id]
);
$data = $this->getDataOrTerminateWithError($result);
$benutzer = current($data);
$benutzerIds[$id] = $benutzer->uid;
}
}
elseif($typeId == 'prestudent_id')
{
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$result = $this->PrestudentModel->loadWhere(
['prestudent_id' => $id]
);
foreach ($ids as $id)
{
$result = $this->PrestudentModel->loadWhere(
['prestudent_id' => $id]
);
$data = $this->getDataOrTerminateWithError($result);
$person = current($data);
$person_id = $person->person_id;
$data = $this->getDataOrTerminateWithError($result);
$person = current($data);
$person_id = $person->person_id;
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$result = $this->BenutzerModel->loadWhere(
['person_id' => $person_id]
);
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$result = $this->BenutzerModel->loadWhere(
['person_id' => $person_id]
);
$data = $this->getDataOrTerminateWithError($result);
$benutzer = current($data);
$benutzerIds[$id] = $benutzer->uid;
}
}
elseif($typeId == 'uid' || $typeId == 'mitarbeiter_uid')
{
$this->terminateWithSuccess($id);
$this->terminateWithSuccess($ids);
}
else
{
$this->terminateWithError("MESSAGES::getUID logic for type_id " . $typeId . " not defined yet", self::ERROR_TYPE_GENERAL);
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
}
$data = $this->getDataOrTerminateWithError($result);
$benutzer = current($data);
$this->terminateWithSuccess($benutzer->uid);
$this->terminateWithSuccess($benutzerIds);
}
private function _getPersonId($id, $typeId)
@@ -403,11 +502,16 @@ class Messages extends FHCAPI_Controller
['prestudent_id' => $id]
);
}
else
{
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
}
$data = $this->getDataOrTerminateWithError($result);
if (count($data) < 1)
{
$this->terminateWithError('Error: Messages API no person_id found.');
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
}
$person = current($data);
@@ -416,7 +520,6 @@ class Messages extends FHCAPI_Controller
private function _getPrestudentIdFromUid($uid)
{
// $this->terminateWithError($uid, self::ERROR_TYPE_GENERAL);
$this->load->model('crm/Student_model', 'StudentModel');
$result = $this->StudentModel->loadWhere(
['student_uid' => $uid]
@@ -425,7 +528,7 @@ class Messages extends FHCAPI_Controller
$data = $this->getDataOrTerminateWithError($result);
if (count($data) < 1)
{
$this->terminateWithError('Error: Messages API no prestudent_id found.');
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
}
$student = current($data);
@@ -0,0 +1,69 @@
<?php
/**
* FH-Complete
*
* @package FHC-API
* @author FHC-Team
* @copyright Copyright (c) 2016, fhcomplete.org
* @license GPLv3
* @link http://fhcomplete.org
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Studienplan extends FHCAPI_Controller
{
public function __construct()
{
// TODO(chris): access!
parent::__construct([
'getBySemester' => self::PERM_LOGGED
]);
}
public function getBySemester()
{
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
$studiengang_kz = $this->input->get('studiengang_kz');
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
$ausbildungssemester = $this->input->get('ausbildungssemester') ?: null;
$orgform_kurzbz = $this->input->get('orgform_kurzbz') ?: null;
if (!$studiengang_kz || !is_numeric($studiengang_kz))
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
if (!$studiensemester_kurzbz)
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiensemester']), self::ERROR_TYPE_GENERAL);
if (isset($ausbildungssemester) && !is_numeric($ausbildungssemester))
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Ausbildungssemester']), self::ERROR_TYPE_GENERAL);
//~ $this->load->library('form_validation');
//~ $this->form_validation->set_rules('studiengang_kz', 'StudiengangKz', 'required|numeric');
//~ $this->form_validation->set_rules('studiensemester_kurzbz', 'StudiensemesterKurbz', 'required');
//~ $this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'numeric');
//~ if (!$this->form_validation->run())
//~ {
//~ $this->addMeta('fail2', 'fail2');
//~ return $this->terminateWithValidationErrors($this->form_validation->error_array());
//~ }
$this->addMeta('stg_kz', $studiengang_kz);
$this->addMeta('sem', $studiensemester_kurzbz);
$this->addMeta('sem2', $ausbildungssemester);
$this->addMeta('org', $orgform_kurzbz);
$result = $this->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester, $orgform_kurzbz);
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
}
@@ -298,7 +298,7 @@ class Aufnahmetermine extends FHCAPI_Controller
$reihungstestangetreten =
(isset($formData['reihungstestangetreten']) && !empty($formData['reihungstestangetreten']))
? $formData['reihungstestangetreten']
: null;
: false;
$aufnahmegruppe_kurzbz =
(isset($formData['aufnahmegruppe_kurzbz']) && !empty($formData['aufnahmegruppe_kurzbz']))
? $formData['aufnahmegruppe_kurzbz']
@@ -33,6 +33,8 @@ class Config extends FHCAPI_Controller
{
// TODO(chris): permissions
parent::__construct([
'get' => ['admin:r', 'assistenz:r'],
'set' => ['admin:r', 'assistenz:r'],
'filter' => ['admin:r', 'assistenz:r'],
'student' => ['admin:r', 'assistenz:r'],
'students' => ['admin:r', 'assistenz:r']
@@ -55,6 +57,95 @@ class Config extends FHCAPI_Controller
}
/**
* get App config
*/
public function get()
{
$this->load->model('system/Variable_model', 'VariableModel');
$this->load->config('stv');
$config = [];
#number_displayed_past_studiensemester
$result = $this->VariableModel->getVariables(getAuthUID(), ['number_displayed_past_studiensemester']);
$data = $this->getDataOrTerminateWithError($result);
$number_displayed_past_studiensemester_default = $this->config->item('number_displayed_past_studiensemester_default');
$config['number_displayed_past_studiensemester'] = [
"type" => "number",
"label" => $this->p->t('stv', 'settings_no_displayed_past_sem'),
"value" => $data['number_displayed_past_studiensemester']
?? $number_displayed_past_studiensemester_default
];
#font_size
$result = $this->VariableModel->getVariables(getAuthUID(), ['stv_font_size']);
$data = $this->getDataOrTerminateWithError($result);
$config['font_size'] = [
"type" => "select",
"label" => $this->p->t('stv', 'settings_fontsize'),
"value" => $data['stv_font_size'] ?? "fs_normal",
"options" => [
"fs_xx-small" => $this->p->t('stv', 'settings_fontsize_xx-small'),
"fs_x-small" => $this->p->t('stv', 'settings_fontsize_x-small'),
"fs_small" => $this->p->t('stv', 'settings_fontsize_small'),
"fs_normal" => $this->p->t('stv', 'settings_fontsize_normal'),
"fs_big" => $this->p->t('stv', 'settings_fontsize_big'),
"fs_huge" => $this->p->t('stv', 'settings_fontsize_huge')
]
];
#others
Events::trigger('stv_config_get', function & () use (&$config) {
return $config;
});
$this->terminateWithSuccess($config);
}
/**
* set App config
*/
public function set()
{
$this->load->model('system/Variable_model', 'VariableModel');
$this->load->library('form_validation');
$this->form_validation->set_rules(
'number_displayed_past_studiensemester',
$this->p->t('stv', 'settings_no_displayed_past_sem'),
'required|integer'
);
$this->form_validation->set_rules(
'font_size',
$this->p->t('stv', 'settings_fontsize'),
'required|in_list[fs_xx-small,fs_x-small,fs_small,fs_normal,fs_big,fs_huge]'
);
Events::trigger('stv_config_validation', $this->form_validation);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$this->VariableModel->setVariable(
getAuthUID(),
'number_displayed_past_studiensemester',
$this->input->post('number_displayed_past_studiensemester')
);
$this->VariableModel->setVariable(
getAuthUID(),
'stv_font_size',
$this->input->post('font_size')
);
Events::trigger('stv_config_set', $this->input);
$this->terminateWithSuccess();
}
/*
* Get the config for the student filters
*
* @return void
@@ -240,7 +331,10 @@ class Config extends FHCAPI_Controller
];
$result['status'] = [
'title' => 'Status',
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js')
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js'),
'config' => [
'showStatusVorruecken' => defined('STATUS_VORRUECKEN_ANZEIGEN') ? STATUS_VORRUECKEN_ANZEIGEN : true,
]
];
$result['documents'] = [
'title' => $this->p->t('stv', 'tab_documents'),
@@ -271,7 +365,6 @@ class Config extends FHCAPI_Controller
$result['messages'] = [
'title' => $this->p->t('stv', 'tab_messages'),
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Messages.js'),
'showOnlyWithUid' => true
];
$result['grades'] = [
@@ -407,11 +500,25 @@ class Config extends FHCAPI_Controller
]
];
if($this->permissionlib->isBerechtigt('basis/person'))
{
$result['combinePeople'] = [
'title' => $this->p->t('stv', 'tab_combine_people'),
'component' => './Stv/Studentenverwaltung/Details/CombinePeople.js',
'config' => $config['combinePeople']
];
}
$result['kontaktieren'] = [
'title' => $this->p->t('stv', 'tab_kontaktieren'),
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js'),
];
$result['messages'] = [
'title' => $this->p->t('stv', 'tab_messages'),
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Messages.js'),
];
Events::trigger('stv_conf_students', function & () use (&$result) {
return $result;
});
@@ -590,8 +590,8 @@ class Dokumente extends FHCAPI_Controller
$documents = [
buildDropdownEntryPrintArray("accountinfo", "Accountinfoblatt", "xml=accountinfoblatt.xml.php&xsl=AccountInfo&output=pdf", $uid, 10, null),
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf", $uid, 20, null),
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Zweisprachig", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf", $uid, 21, null),
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf&prestudent_id=$prestudent_id", null,20, null),
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Zweisprachig", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf&prestudent_id=$prestudent_id", null,21, null),
buildDropdownEntryPrintArray("bescheid", "Bescheid (nur Voransicht)", "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf", $uid, 25, null),
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uid, 26, null),
@@ -83,7 +83,7 @@ class GemeinsameStudien extends FHCAPI_Controller
{
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->StudiensemesterModel->addOrder('studienjahr_kurzbz', 'DESC');
$this->StudiensemesterModel->addOrder('start', 'DESC');
$result = $this->StudiensemesterModel->load();
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
@@ -60,7 +60,8 @@ class Grades extends FHCAPI_Controller
{
$this->load->model('codex/Note_model', 'NoteModel');
$this->NoteModel->addOrder('note');
$this->NoteModel->addOrder('notenwert', 'ASC');
$this->NoteModel->addOrder('bezeichnung', 'ASC');
$result = $this->NoteModel->load();
@@ -147,7 +147,8 @@ class Gruppen extends FHCAPI_Controller
'lehre' => true,
'sichtbar' => true,
'aktiv' => true,
'direktinskription' => false
'direktinskription' => false,
'generiert' => false
]);
$data = $this->getDataOrTerminateWithError($result);
@@ -17,7 +17,8 @@ class Projektarbeit extends FHCAPI_Controller
'getTypenProjektarbeit' => ['admin:r', 'assistenz:r'],
'getFirmen' => ['admin:r', 'assistenz:r'],
'getLehrveranstaltungen' => ['admin:r', 'assistenz:r'],
'getNoten' => ['admin:r', 'assistenz:r']
'getNoten' => ['admin:r', 'assistenz:r'],
'getStudiensemester' => ['admin:r', 'assistenz:r']
]);
// Load Libraries
@@ -40,11 +41,15 @@ class Projektarbeit extends FHCAPI_Controller
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('education/Note_model', 'NoteModel');
$this->load->model('education/Projektbetreuer_model', 'BetreuerModel');
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
// load libraries
$this->load->library('PermissionLib');
}
/**
* Get projekt works for a uid.
*/
public function getProjektarbeit()
{
$student_uid = $this->input->get('uid');
@@ -53,10 +58,7 @@ class Projektarbeit extends FHCAPI_Controller
$result = $this->ProjektarbeitModel->getProjektarbeit($student_uid);
if (isError($result))
{
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
if (!hasData($result)) $this->terminateWithSuccess([]);
@@ -79,6 +81,9 @@ class Projektarbeit extends FHCAPI_Controller
$this->terminateWithSuccess($projektarbeiten);
}
/**
* Load a single Projektarbeit by id.
*/
public function loadProjektarbeit()
{
$projektarbeit_id = $this->input->get('projektarbeit_id');
@@ -101,6 +106,9 @@ class Projektarbeit extends FHCAPI_Controller
$this->terminateWithSuccess(current($data));
}
/**
* Inwert a Projektarbeit.
*/
public function insertProjektarbeit()
{
$student_uid = $this->input->post('uid');
@@ -128,6 +136,9 @@ class Projektarbeit extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
/**
* Update a Projektarbeit by ID.
*/
public function updateProjektarbeit()
{
$projektarbeit_id = $this->input->post('projektarbeit_id');
@@ -157,6 +168,9 @@ class Projektarbeit extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
/**
* Delete Projektarbeit by ID after validation.
*/
public function deleteProjektarbeit()
{
$projektarbeit_id = $this->input->post('projektarbeit_id');
@@ -185,6 +199,9 @@ class Projektarbeit extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($result)) ? : null);
}
/**
* Get all active projekt work types.
*/
public function getTypenProjektarbeit()
{
$result = $this->ProjekttypModel->loadWhere(['aktiv' => true]);
@@ -194,6 +211,9 @@ class Projektarbeit extends FHCAPI_Controller
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
/**
* Gets companies by search string.
*/
public function getFirmen()
{
$searchString = $this->input->get('searchString');
@@ -208,6 +228,9 @@ class Projektarbeit extends FHCAPI_Controller
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
/**
* Get Lehrveranstaltungen by params, incling lehreinheiten for a specific Studiensemester..
*/
public function getLehrveranstaltungen()
{
$student_uid = $this->input->get('student_uid');
@@ -218,6 +241,7 @@ class Projektarbeit extends FHCAPI_Controller
if (!isset($student_uid)) $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemster missing', self::ERROR_TYPE_GENERAL);
// get Lvs
$lvsResult = $this->LehrveranstaltungModel->getLvsForProjektarbeit($student_uid, $studiengang_kz, $additional_lehrveranstaltung_id);
if (isError($lvsResult)) return $this->terminateWithError($lvsResult, self::ERROR_TYPE_GENERAL);
@@ -226,6 +250,7 @@ class Projektarbeit extends FHCAPI_Controller
foreach ($lvs as $lv)
{
// add Lehreinheiten for each Lv for the semester
$lehreinheiten = $this->LehreinheitModel->getLesForLv(
$lv->lehrveranstaltung_id, $studiensemester_kurzbz
);
@@ -250,8 +275,14 @@ class Projektarbeit extends FHCAPI_Controller
return $this->terminateWithSuccess($lvs);
}
/**
* Get all noten.
*/
public function getNoten()
{
$this->NoteModel->addOrder('notenwert', 'ASC');
$this->NoteModel->addOrder('bezeichnung', 'ASC');
$result = $this->NoteModel->load();
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
@@ -260,18 +291,27 @@ class Projektarbeit extends FHCAPI_Controller
}
/**
*
* @param
* @return object success or error
* Get all Studiensemester, sorted.
*/
public function getStudiensemester()
{
$this->StudiensemesterModel->addOrder('start', 'DESC');
$result = $this->StudiensemesterModel->load();
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
/**
* Validate Projektarbeit data.
* @param formData
* @return bool true if data valid
*/
private function _validate($formData)
{
$this->form_validation->set_data($formData);
$this->form_validation->set_rules('titel', 'Titel', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Titel'])
]);
$this->form_validation->set_rules('projekttyp_kurzbz', 'Projekttyp', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Projekttyp'])
]);
@@ -297,9 +337,9 @@ class Projektarbeit extends FHCAPI_Controller
}
/**
*
* @param
* @return object success or error
* Extract Projektarbeit data from passed form data.
* @param formData
* @return array
*/
private function _getProjektarbeitArr($formData)
{
@@ -321,9 +361,9 @@ class Projektarbeit extends FHCAPI_Controller
}
/**
*
* @param
* @return object success or error
* Check if deletion of a Projektarbeit is possible.
* @param $projektarbeit_id
* @return object success if deletion possible, error otherwise.
*/
private function _validateDelete($projektarbeit_id)
{
@@ -344,6 +384,11 @@ class Projektarbeit extends FHCAPI_Controller
return success();
}
/**
* Checks permissions for a student.
* @param $student_uid
* @return bool true if authorized
*/
private function _hasBerechtigungForStudent($student_uid)
{
if (!$student_uid)
@@ -3,7 +3,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \DateTime as DateTime;
use CI3_Events as Events;
use \CI3_Events as Events;
class Projektbetreuer extends FHCAPI_Controller
{
@@ -43,6 +43,9 @@ class Projektbetreuer extends FHCAPI_Controller
$this->load->library('PermissionLib');
}
/**
* Gets Projektbetreuer data for a Projektarbeit.
*/
public function getProjektbetreuer()
{
$projektarbeit_id = $this->input->get('projektarbeit_id');
@@ -50,21 +53,30 @@ class Projektbetreuer extends FHCAPI_Controller
if (!isset($projektarbeit_id))
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Projektarbeit ID']), self::ERROR_TYPE_GENERAL);
$this->ProjektbetreuerModel->addSelect(
'projektarbeit_id, person_id, nachname, vorname, note, punkte, round(stunden, 1) AS stunden,
stundensatz, betreuerart_kurzbz, vertrag_id, titelpre, titelpost'
);
$this->ProjektbetreuerModel->addSelect("CASE
WHEN EXISTS
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) WHERE person_id=pers.person_id)
THEN 'Mitarbeiter'
WHEN EXISTS
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE person_id=pers.person_id)
THEN 'Student'
ELSE 'Person'
END AS status");
$this->ProjektbetreuerModel->addJoin('public.tbl_person pers', 'person_id');
$result = $this->ProjektbetreuerModel->loadWhere(['projektarbeit_id' => $projektarbeit_id]);
$qry = "
SELECT * FROM (
SELECT
projektarbeit_id, person_id, nachname, vorname, note, punkte, round(stunden, 1) AS stunden,
stundensatz, betreuerart_kurzbz, vertrag_id, titelpre, titelpost,
CASE
WHEN EXISTS
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) WHERE person_id=pers.person_id)
THEN 'Mitarbeiter'
WHEN EXISTS
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE person_id=pers.person_id)
THEN 'Student'
ELSE 'Person'
END AS status
FROM
lehre.tbl_projektbetreuer
JOIN public.tbl_person pers USING (person_id)
WHERE
projektarbeit_id = ?
) betreuer
ORDER BY
CASE WHEN status = 'Mitarbeiter' THEN 0 WHEN status = 'Person' THEN 1 ELSE 2 END";
$result = $this->ProjektbetreuerModel->execReadOnlyQuery($qry, [$projektarbeit_id]);
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
@@ -86,6 +98,7 @@ class Projektbetreuer extends FHCAPI_Controller
//~ }
//~ }
// add thesis download link (from external extension)
foreach ($projektbetreuer as $pb)
{
$downloadLink = null;
@@ -104,6 +117,9 @@ class Projektbetreuer extends FHCAPI_Controller
$this->terminateWithSuccess($this->_addFullNameToBetreuer($projektbetreuer));
}
/**
* Saves (adds or updates) a single Projektbetreuer for a Projektarbeit.
*/
public function saveProjektbetreuer()
{
$projektarbeit_id = $this->input->post('projektarbeit_id');
@@ -118,14 +134,36 @@ class Projektbetreuer extends FHCAPI_Controller
if ($this->_validate($projektbetreuer) == false) $this->terminateWithValidationErrors($this->form_validation->error_array());
// check if assessor has already been assigned
if (isset($projektbetreuer['person_id']))
{
$this->ProjektbetreuerModel->addSelect('1');
$betreuerRes = $this->ProjektbetreuerModel->loadWhere(
[
'person_id' => $projektbetreuer['person_id'],
'projektarbeit_id' => $projektbetreuer['projektarbeit_id'],
'betreuerart_kurzbz' => $projektbetreuer['betreuerart_kurzbz']
]
);
if (hasData($betreuerRes)
&& (!isset($projektbetreuer['person_id_old']) || $projektbetreuer['person_id'] != $projektbetreuer['person_id_old'])) {
return $this->terminateWithError($this->p->t('projektarbeit', 'betreuerZugewiesen'), self::ERROR_TYPE_GENERAL);
}
}
$result = null;
$stunden = isset($projektbetreuer['stunden']) && !isEmptyString($projektbetreuer['stunden']) ? $projektbetreuer['stunden'] : null;
$stundensatz =
isset($projektbetreuer['stundensatz']) && !isEmptyString($projektbetreuer['stundensatz']) ? $projektbetreuer['stundensatz'] : null;
$betreuer = [
'projektarbeit_id' => $projektarbeit_id,
'person_id' => $projektbetreuer['person_id'],
'note' => $projektbetreuer['note'],
'stunden' => $projektbetreuer['stunden'],
'stundensatz' => $projektbetreuer['stundensatz'],
'stunden' => $stunden,
'stundensatz' => $stundensatz,
'betreuerart_kurzbz' => $projektbetreuer['betreuerart_kurzbz']
];
@@ -152,6 +190,9 @@ class Projektbetreuer extends FHCAPI_Controller
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
/**
* Delete a Projektbetreuer assignment to a Projektarbeit.
*/
public function deleteProjektbetreuer()
{
$projektarbeit_id = $this->input->post('projektarbeit_id');
@@ -159,21 +200,44 @@ class Projektbetreuer extends FHCAPI_Controller
$betreuerart_kurzbz = $this->input->post('betreuerart_kurzbz');
if (!isset($projektarbeit_id) || !is_numeric($projektarbeit_id))
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'projektarbeit').' ID'], self::ERROR_TYPE_GENERAL));
{
return $this->terminateWithError(
$this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'projektarbeit').' ID'], self::ERROR_TYPE_GENERAL)
);
}
if (!isset($person_id) || !is_numeric($person_id))
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID'], self::ERROR_TYPE_GENERAL));
if (!isset($betreuerart_kurzbz))
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'betreuerart')], self::ERROR_TYPE_GENERAL));
{
return $this->terminateWithError(
$this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'betreuerart')], self::ERROR_TYPE_GENERAL)
);
}
// check permission
if (!$this->ProjektarbeitModel->hasBerechtigungForProjektarbeit($projektarbeit_id))
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw']]);
$validate = $this->_validateDelete($projektarbeit_id, $person_id);
$validate = $this->_validateDelete($projektarbeit_id, $person_id, $betreuerart_kurzbz);
if (isError($validate)) return $this->terminateWithError(getError($validate), self::ERROR_TYPE_GENERAL);
// check if there is a Projektarbeitsbeurteilung - if yes, it is handled (possibly deleted) by external extension.
$beurteilungDeleteSuccess = true;
Events::trigger(
'projektarbeitsbeurteilung_delete',
$projektarbeit_id,
function ($value) use (&$beurteilungDeleteSuccess) {
$beurteilungDeleteSuccess = $value;
}
);
// if there is still a Beurteilung, Projektarbeit cannot be deleted - return with error
if (!$beurteilungDeleteSuccess) return $this->terminateWithError($this->p->t('projektarbeit', 'error_paarbeitHatBeurteilung'));
$result = $this->ProjektbetreuerModel->delete(
['projektarbeit_id' => $projektarbeit_id, 'person_id' => $person_id, 'betreuerart_kurzbz' => $betreuerart_kurzbz]
);
@@ -185,9 +249,12 @@ class Projektbetreuer extends FHCAPI_Controller
$this->outputJson($result);
}
return $this->terminateWithSuccess(current(getData($result)) ? : null);
return $this->terminateWithSuccess(getData($result));
}
/**
* Get all active Betreuerarten.
*/
public function getBetreuerarten()
{
$result = $this->BetreuerartModel->loadWhere(['aktiv' => true]);
@@ -197,6 +264,9 @@ class Projektbetreuer extends FHCAPI_Controller
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
/**
* Get all Noten.
*/
public function getNoten()
{
$result = $this->NoteModel->load();
@@ -206,6 +276,9 @@ class Projektbetreuer extends FHCAPI_Controller
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
}
/**
* Get default Stundensätze for an employee in a semester.
*/
public function getDefaultStundensaetze()
{
$person_id = $this->input->get('person_id');
@@ -216,6 +289,9 @@ class Projektbetreuer extends FHCAPI_Controller
return $this->terminateWithSuccess($result);
}
/**
* Get all Projektbetreuer by search string.
*/
public function getProjektbetreuerBySearchQuery()
{
$searchString = $this->input->get('searchString');
@@ -227,9 +303,23 @@ class Projektbetreuer extends FHCAPI_Controller
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
return $this->terminateWithSuccess(hasData($result) ? $this->_addFullNameToBetreuer(getData($result)) : []);
if (!hasData($result)) $this->terminateWithSuccess([]);
$persons = $this->_addFullNameToBetreuer(getData($result));
// sort persons by type (employees first)
usort($persons, function ($a, $b) {
$statusRanks = ['Mitarbeiter' => 0, 'Person' => 1, 'Student' => 2];
return (isset($statusRanks[$a->status]) ? $statusRanks[$a->status] : count($statusRanks) + 1)
- (isset($statusRanks[$b->status]) ? $statusRanks[$b->status] : count($statusRanks) + 1);
});
return $this->terminateWithSuccess($persons);
}
/**
* Get person info by Id.
*/
public function getPerson()
{
$person_id = $this->input->get('person_id');
@@ -255,9 +345,7 @@ class Projektbetreuer extends FHCAPI_Controller
}
/**
*
* @param
* @return object success or error
* Validate list of Projektbetreuer.
*/
public function validateProjektbetreuer()
{
@@ -277,9 +365,9 @@ class Projektbetreuer extends FHCAPI_Controller
}
/**
*
* @param
* @return object success or error
* Validation funciton for checking Projektbetreuer input.
* @param $formData Betreuer data
* @return bool true when data is valid
*/
private function _validate($formData)
{
@@ -306,26 +394,32 @@ class Projektbetreuer extends FHCAPI_Controller
}
/**
*
* @param
* @return object success or error
* Check possibility of deletion of a Projektbetreuer.
* @param projektarbeit_id
* @param person_id
* @param betreuerart_kurzbz
* @return object success when delete possible, error otherwise
*/
private function _validateDelete($projektarbeit_id, $person_id)
private function _validateDelete($projektarbeit_id, $person_id, $betreuerart_kurzbz)
{
// check if contract exists
$this->ProjektbetreuerModel->addSelect('vertrag_id');
$result = $this->ProjektbetreuerModel->loadWhere(['projektarbeit_id' => $projektarbeit_id, 'person_id' => $person_id]);
$result = $this->ProjektbetreuerModel->loadWhere(
['projektarbeit_id' => $projektarbeit_id, 'person_id' => $person_id, 'betreuerart_kurzbz' => $betreuerart_kurzbz]
);
if (isError($result)) return $result;
// if contract exists, no deletion is possible
if (hasData($result) && getData($result)[0]->vertrag_id != null) return error($this->p->t('projektarbeit', 'error_betreuerHatVertrag'));
return success();
}
/**
*
* @param
* @return object success or error
* Add full name to array with Betreuer.
* @param $betreuerArr
* @return array including Betreuer with their full names
*/
private function _addFullNameToBetreuer($betreuerArr)
{
@@ -18,6 +18,8 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \DateTime as DateTime;
/**
* This controller operates between (interface) the JS (GUI) and the back-end
* Provides data to the ajax get calls about addresses
@@ -111,7 +113,7 @@ class Pruefung extends FHCAPI_Controller
// Load language phrases
$this->loadPhrases([
'global', 'ui','lehre'
'global', 'ui', 'lehre', 'exam'
]);
}
@@ -172,174 +174,11 @@ class Pruefung extends FHCAPI_Controller
*
* @param lehrveranstaltung_id, student_uid, lehreinheit_id
*
* @return values on success
* retval 0: pruefung inserted
* reval 1: pruefung and zeugnisnote inserted
* retval 2: pruefung inserted, no insert Zeugnisnote
* (change after date of examination)
* retval 3: pruefung of type Termin2 inserted
* and pruefung of type Termin1 as well
* retval 5: prueufungen Termin 2 and 1 inserted
* and no insert Zeugnisnote (change after date of examination)
* @return void
*/
public function insertPruefung()
{
$authUID = getAuthUID();
$this->load->library('form_validation');
$this->form_validation->set_rules('lehrveranstaltung_id', $this->p->t('lehre', 'lehrveranstaltung'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehrveranstaltung')]),
]);
$this->form_validation->set_rules('lehreinheit_id', $this->p->t('lehre', 'lehreinheit'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehreinheit')]),
]);
$this->form_validation->set_rules('pruefungstyp_kurzbz', $this->p->t('lehre', 'pruefung'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global', 'typ')]),
]);
$this->form_validation->set_rules(
'datum',
$this->p->t('global', 'datum'),
['is_valid_date']
);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
//calculate studiensemester_kurzbz this from lehreinheit (case newPruefung)
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
if (!$studiensemester_kurzbz)
{
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$result = $this->LehreinheitModel->load($this->input->post('lehreinheit_id'));
$lehreinheit = $this->getDataOrTerminateWithError($result);
$studiensemester_kurzbz = current($lehreinheit)->studiensemester_kurzbz;
if (isError($result))
{
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
}
$result = $this->PruefungModel->insert([
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
'datum' => $this->input->post('datum'),
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
'note' => $this->input->post('note'),
'anmerkung' => $this->input->post('anmerkung'),
'insertamum' => date('c'),
'insertvon' => $authUID,
]);
$this->getDataOrTerminateWithError($result);
//check if existing zeugnisnote
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$result = $this->ZeugnisnoteModel->loadWhere(array(
'lehrveranstaltung_id' => $this->input->post('lehrveranstaltung_id'),
'student_uid' => $this->input->post('student_uid'),
'studiensemester_kurzbz' => $studiensemester_kurzbz));
if (isError($result))
{
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
if (!hasData($result))
{
//insert zeugnisnote, if not existing
$result = $this->ZeugnisnoteModel->insert(array(
'lehrveranstaltung_id' => $this->input->post('lehrveranstaltung_id'),
'student_uid' => $this->input->post('student_uid'),
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'note' => $this->input->post('note'),
'uebernahmedatum' => date('c'),
'benotungsdatum' => $this->input->post('datum'),
'insertamum' => date('c'),
'insertvon' => $authUID
));
if (isError($result))
{
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess(1);
}
$return_code = 0;
//handling Termin1 if not existing
if($this->input->post('pruefungstyp_kurzbz') == "Termin2")
{
$resultP = $this->PruefungModel->loadWhere(array(
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'pruefungstyp_kurzbz' => 'Termin1'));
if (isError($resultP))
{
$this->terminateWithError(getError($resultP), self::ERROR_TYPE_GENERAL);
}
if(!hasData($resultP))
{
//check if existing Zeugnisnote
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$this->ZeugnisnoteModel->addJoin('lehre.tbl_lehreinheit', 'lehrveranstaltung_id');
$resultP = $this->ZeugnisnoteModel->loadWhere(array(
'lehrveranstaltung_id' => $this->input->post('lehrveranstaltung_id'),
'student_uid' => $this->input->input->post('student_uid'),
'lehre.tbl_zeugnisnote.studiensemester_kurzbz' => $studiensemester_kurzbz));
if (isError($resultP))
{
$this->terminateWithError(getError($resultP), self::ERROR_TYPE_GENERAL);
}
if (!hasData($resultP))
{
$this->terminateWithError("Zeugnisnote existiert nicht", self::ERROR_TYPE_GENERAL);
}
$dataNote = current(getData($resultP));
$resultN = $this->PruefungModel->insert([
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
'datum' => $dataNote->benotungsdatum,
'pruefungstyp_kurzbz' => 'Termin1',
'note' => $dataNote->note,
'punkte' => $dataNote->punkte,
'anmerkung' => 'automatisiert aus Zeugnisnote erstellt',
'insertamum' => date('c'),
'insertvon' => $authUID,
]);
if (isError($resultN)) {
$this->terminateWithError(getError($resultN), self::ERROR_TYPE_GENERAL);
}
$return_code = 3;
}
}
$note = current(getData($result));
$uebernahmedatum = new DateTime($note->uebernahmedatum);
$benotungsdatum = new DateTime($note->benotungsdatum);
$checkDate = $uebernahmedatum === '' || $benotungsdatum > $uebernahmedatum
? $benotungsdatum
: $uebernahmedatum;
if ($checkDate >= $this->input->post('datum') && $note !== $note->note)
{
$this->terminateWithSuccess($return_code + 2);
}
$this->terminateWithSuccess($return_code + 2);
$this->insertOrUpdatePruefung();
}
/**
@@ -348,8 +187,6 @@ class Pruefung extends FHCAPI_Controller
* @param pruefung_id
*
* @return success or error
*
* no impact on lehre.tbl_zeugnisnote
*/
public function updatePruefung($pruefung_id)
{
@@ -359,48 +196,7 @@ class Pruefung extends FHCAPI_Controller
if (!$oldpruefung)
show_404(); // Pruefung that should be updated does not exist
$authUID = getAuthUID();
$this->load->library('form_validation');
$this->form_validation->set_rules('lehrveranstaltung_id', $this->p->t('lehre', 'lehrveranstaltung'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehrveranstaltung')]),
]);
$this->form_validation->set_rules('lehreinheit_id', $this->p->t('lehre', 'lehreinheit'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehreinheit')]),
]);
$this->form_validation->set_rules('pruefungstyp_kurzbz', $this->p->t('lehre', 'pruefung'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global', 'typ')]),
]);
$this->form_validation->set_rules(
'datum',
$this->p->t('global', 'datum'),
['is_valid_date']
);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$result = $this->PruefungModel->update(
[
'pruefung_id' => $pruefung_id
],
[ 'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
'note' => $this->input->post('note'),
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
'datum' => $this->input->post('datum'),
'anmerkung' => $this->input->post('anmerkung'),
'updatevon' => $authUID,
'updateamum' => date('c'),
]
);
$this->getDataOrTerminateWithError($result);
return $this->outputJsonSuccess(true);
$this->insertOrUpdatePruefung($pruefung_id);
}
/**
@@ -574,4 +370,198 @@ class Pruefung extends FHCAPI_Controller
return $this->terminateWithSuccess($data);
}
protected function insertOrUpdatePruefung($pruefung_id=null)
{
$authUID = getAuthUID();
$this->load->library('form_validation');
$this->form_validation->set_rules('lehreinheit_id', $this->p->t('lehre', 'lehreinheit'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehreinheit')]),
]);
$this->form_validation->set_rules('pruefungstyp_kurzbz', $this->p->t('lehre', 'pruefung'), 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global', 'typ')]),
]);
$this->form_validation->set_rules(
'datum',
$this->p->t('global', 'datum'),
['is_valid_date']
);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$this->PruefungModel->db->trans_start();
if ($this->input->post('pruefungstyp_kurzbz') == "Termin2")
{
//Wenn ein 2. Termin angelegt wird, und kein 1. Termin vorhanden ist,
//dann wird auch ein 1. Termin angelegt mit der derzeitigen Zeugnisnote
$resultP = $this->PruefungModel->loadWhere(array(
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'pruefungstyp_kurzbz' => 'Termin1'));
$termin1 = $this->getDataOrTerminateWithError($resultP);
if (!$termin1)
{
//check if existing Zeugnisnote
$this->ZeugnisnoteModel->addJoin('lehre.tbl_lehreinheit', 'lehrveranstaltung_id');
$this->ZeugnisnoteModel->db->where(
'lehre.tbl_zeugnisnote.studiensemester_kurzbz',
'lehre.tbl_lehreinheit.studiensemester_kurzbz',
false
);
$resultP = $this->ZeugnisnoteModel->loadWhere(array(
'lehrveranstaltung_id' => $this->input->post('lehrveranstaltung_id'),
'student_uid' => $this->input->post('student_uid')
));
$zeugnisnoten = $this->getDataOrTerminateWithError($resultP);
if ($zeugnisnoten)
{
$zeugnisnote = current($zeugnisnoten);
$resultN = $this->PruefungModel->insert([
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
'datum' => $zeugnisnote->benotungsdatum,
'pruefungstyp_kurzbz' => 'Termin1',
'note' => $zeugnisnote->note,
'punkte' => $zeugnisnote->punkte,
'anmerkung' => 'automatisiert aus Zeugnisnote erstellt',
'insertamum' => date('c'),
'insertvon' => $authUID,
]);
$this->getDataOrTerminateWithError($resultN);
}
//Wenn keine Zeugnisnote vorhanden ist, dann wird kein
//1.Termin angelegt
}
}
if(intval($pruefung_id) > 0)
{
$result = $this->PruefungModel->update(
[
'pruefung_id' => $pruefung_id
],
[ 'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
'note' => $this->input->post('note'),
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
'datum' => $this->input->post('datum'),
'anmerkung' => $this->input->post('anmerkung'),
'updatevon' => $authUID,
'updateamum' => date('c'),
]
);
}
else
{
$result = $this->PruefungModel->insert([
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
'student_uid' => $this->input->post('student_uid'),
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
'datum' => $this->input->post('datum'),
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
'note' => $this->input->post('note'),
'anmerkung' => $this->input->post('anmerkung'),
'insertamum' => date('c'),
'insertvon' => $authUID,
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
]);
}
$this->getDataOrTerminateWithError($result);
//get studiensemester_kurzbz and lehreveranstaltung_id from lehreinheit
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$result = $this->LehreinheitModel->load($this->input->post('lehreinheit_id'));
$lehreinheiten = $this->getDataOrTerminateWithError($result);
if (!$lehreinheiten) {
$this->terminateWithValidationErrors([
'lehreinheit_id' => $this->p->t('ui', 'error_fieldNotFound', [
'field' => $this->p->t('lehre', 'lehreinheit')
])
]);
}
$lehreinheit = current($lehreinheiten);
$studiensemester_kurzbz = $lehreinheit->studiensemester_kurzbz;
$lehrveranstaltung_id = $lehreinheit->lehrveranstaltung_id;
//check if existing zeugnisnote
$result = $this->ZeugnisnoteModel->loadWhere(array(
'lehrveranstaltung_id' => $lehrveranstaltung_id,
'student_uid' => $this->input->post('student_uid'),
'studiensemester_kurzbz' => $studiensemester_kurzbz
));
$zeugnisnoten = $this->getDataOrTerminateWithError($result);
if (!$zeugnisnoten)
{
//insert zeugnisnote, if not existing
$result = $this->ZeugnisnoteModel->insert(array(
'lehrveranstaltung_id' => $lehrveranstaltung_id,
'student_uid' => $this->input->post('student_uid'),
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'note' => $this->input->post('note'),
'uebernahmedatum' => date('c'),
'benotungsdatum' => $this->input->post('datum'),
'insertamum' => date('c'),
'insertvon' => $authUID,
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
));
$this->getDataOrTerminateWithError($result);
$this->PruefungModel->db->trans_complete();
$this->terminateWithSuccess();
}
$note = current($zeugnisnoten);
$uebernahmedatum = new DateTime($note->uebernahmedatum);
$benotungsdatum = new DateTime($note->benotungsdatum);
$pruefungsdatum = new DateTime($this->input->post('datum'));
$checkDate = $note->uebernahmedatum === '' || $benotungsdatum > $uebernahmedatum
? $benotungsdatum
: $uebernahmedatum;
if ($checkDate > $pruefungsdatum && $this->input->post('note') !== $note->note)
{
$this->PruefungModel->db->trans_complete();
$this->terminateWithSuccess($this->p->t('exam', 'hinweis_changeAfterExamDate'));
}
//update zeugnisnote, if existing and valid datum
$result = $this->ZeugnisnoteModel->update([
'lehrveranstaltung_id' => $lehrveranstaltung_id,
'student_uid' => $this->input->post('student_uid'),
'studiensemester_kurzbz' => $studiensemester_kurzbz
], [
'note' => $this->input->post('note'),
'uebernahmedatum' => date('c'),
'benotungsdatum' => $this->input->post('datum'),
'updateamum' => date('c'),
'updatevon' => $authUID,
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
]);
$this->PruefungModel->db->trans_complete();
$this->terminateWithSuccess();
}
}
@@ -1078,6 +1078,24 @@ class Status extends FHCAPI_Controller
$this->terminateWithSuccess(true);
}
protected function checkForCriticalChangesBis($oldstatus)
{
$changedFields = array();
$allowedFields = array('anmerkung', 'statusgrund_id');
$oldstatus_array = get_object_vars($oldstatus);
foreach($oldstatus_array as $key => $oldValue)
{
$newValue = $this->input->post($key);
if( $newValue !== $oldValue )
{
$changedFields[] = $key;
}
}
$criticalFieldsChanged = array_diff($changedFields, $allowedFields);
$hasCriticalChangesBis = count($criticalFieldsChanged) > 0 ? true : false;
return $hasCriticalChangesBis;
}
/**
* Updates a status entry
*
@@ -1102,6 +1120,7 @@ class Status extends FHCAPI_Controller
$oldstatus = current($oldstatus);
$hasCriticalChangesBis = $this->checkForCriticalChangesBis($oldstatus);
$isBerechtigtNoStudstatusCheck = $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung');
$isBerechtigtBasisPrestudentstatus = $this->permissionlib->isBerechtigt('basis/prestudentstatus');
@@ -1112,7 +1131,6 @@ class Status extends FHCAPI_Controller
$ausbildungssemester = $this->input->post('ausbildungssemester') ?: $oldstatus->ausbildungssemester;
$datum = $this->input->post('datum') ?: $oldstatus->datum;
//Form Validation
$this->load->library('form_validation');
@@ -1135,9 +1153,15 @@ class Status extends FHCAPI_Controller
$this->p->t('global', 'datum'),
[
'is_valid_date',
['meldestichtag_not_exceeded', function ($value) use ($isBerechtigtNoStudstatusCheck) {
['meldestichtag_not_exceeded', function ($value) use ($isBerechtigtNoStudstatusCheck, $hasCriticalChangesBis){
if ($isBerechtigtNoStudstatusCheck)
return true; // Skip if access right says so
{
return true; // Skip if access right says so*/
}
if (!$hasCriticalChangesBis) {
return true; // Skip if no critical changes were made
}
if (!$value)
return true; // Error will be handled by the required statement above
@@ -1341,6 +1365,7 @@ class Status extends FHCAPI_Controller
'updateamum' => date('c'),
'updatevon' => $authUID
];
$nullableFields = ['statusgrund_id', 'anmerkung', 'rt_stufe'];
foreach ([
'orgform_kurzbz',
'anmerkung',
@@ -1349,8 +1374,17 @@ class Status extends FHCAPI_Controller
'rt_stufe',
'statusgrund_id'
] as $key)
if ($this->input->post($key))
{
if (in_array($key, $nullableFields))
{
$updateData[$key] = ($this->input->post($key) === '') ? null : $this->input->post($key);
}
else if ($this->input->post($key))
{
$updateData[$key] = $this->input->post($key);
}
}
if ($this->input->post('bestaetigtam')) {
$updateData['bestaetigtam'] = $this->input->post('bestaetigtam');
@@ -37,7 +37,7 @@ class Student extends FHCAPI_Controller
'get' => ['admin:r', 'assistenz:r'],
'save' => ['admin:rw', 'assistenz:rw'],
'saveStudent' => ['admin:rw', 'assistenz:rw'],
'check' => ['admin:rw', 'assistenz:rw'],
'getPerson' => ['admin:rw', 'assistenz:rw'],
'add' => ['admin:rw', 'assistenz:rw'] // TODO(chris): extra permissions
]);
@@ -159,9 +159,9 @@ class Student extends FHCAPI_Controller
'LEFT');*/
$result = $this->PrestudentModel->loadWhere(['tbl_prestudent.prestudent_id' => $prestudent_id]);
$student = $this->getDataOrTerminateWithError($result);
if (!$student)
return show_404();
@@ -221,7 +221,7 @@ class Student extends FHCAPI_Controller
]);
$this->load->library('UDFLib');
$result = $this->udflib->getCiValidations($this->PersonModel, $this->input->post());
$udf_field_validations = $this->getDataOrTerminateWithError($result);
@@ -232,7 +232,7 @@ class Student extends FHCAPI_Controller
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
$student = $this->getDataOrTerminateWithError($result);
$uid = $student ? current($student)->student_uid : null;
@@ -245,7 +245,6 @@ class Student extends FHCAPI_Controller
$person_id = $person ? current($person)->person_id : null;
$array_allowed_props_lehrverband = ['verband', 'semester', 'gruppe'];
$update_lehrverband = array();
foreach ($array_allowed_props_lehrverband as $prop) {
@@ -305,7 +304,7 @@ class Student extends FHCAPI_Controller
}
$array_allowed_props_student = ['matrikelnr'];
if($this->isLaufendesSemester($studiensemester_kurzbz))
if($this->isLaufendesSemester($studiensemester_kurzbz))
{
$array_allowed_props_student = ['matrikelnr', 'verband', 'semester', 'gruppe'];
}
@@ -462,7 +461,7 @@ class Student extends FHCAPI_Controller
return $this->save($student->prestudent_id, $studiensemester_kurzbz);
}
public function check()
public function getPerson()
{
$this->load->library('form_validation');
@@ -480,21 +479,55 @@ class Student extends FHCAPI_Controller
$this->load->model('person/Person_model', 'PersonModel');
$this->PersonModel->addSelect(
'person_id, vorname, nachname, vornamen, wahlname, gebdatum, staatsbuergerschaft, geburtsnation, sprache, anrede,
titelpost, titelpre, gebort, gebzeit, homepage, geschlecht, matr_nr,
aktiv, unruly, tbl_geschlecht.bezeichnung_mehrsprachig AS geschlecht_bezeichnung'
);
$this->PersonModel->addJoin('public.tbl_geschlecht', 'geschlecht');
if ($gebdatum)
$this->PersonModel->db->where('gebdatum', (new DateTime($gebdatum))->format('Y-m-d'));
if ($vorname && $nachname) {
$this->PersonModel->db->or_group_start();
$this->PersonModel->db->where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->db->escape($nachname) . ')', false);
$this->PersonModel->db->where('LOWER(vorname)', 'LOWER(' . $this->PersonModel->db->escape($vorname) . ')', false);
$this->PersonModel->db->where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->db->escape(trim($nachname)) . ')', false);
$this->PersonModel->db->where('LOWER(vorname)', 'LOWER(' . $this->PersonModel->db->escape(trim($vorname)) . ')', false);
$this->PersonModel->db->group_end();
} elseif ($nachname) {
$this->PersonModel->db->or_where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->escape($nachname) . ')', false);
$this->PersonModel->db->or_where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->escape(trim($nachname)) . ')', false);
}
$result = $this->PersonModel->load();
$data = $this->getDataOrTerminateWithError($result);
$this->load->model('person/Adresse_model', 'AdresseModel');
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
foreach ($data as $person)
{
// get adresses
$langIdx = $this->_getLanguageIndex() - 1;
$person->geschlecht_bezeichnung = isset($person->geschlecht_bezeichnung[$langIdx]) ? $person->geschlecht_bezeichnung[$langIdx] : '';
// get Adresse
$this->AdresseModel->addOrder('heimatadresse', 'DESC');
$this->AdresseModel->addOrder('zustelladresse', 'DESC');
$this->AdresseModel->addOrder('adresse_id', 'DESC');
$result = $this->AdresseModel->loadWhere(['person_id' => $person->person_id]);
$adressen = $this->getDataOrTerminateWithError($result);
$person->adressen = $adressen;
// get status
$result = $this->PrestudentstatusModel->getLastStatusPerson($person->person_id);
$status = $this->getDataOrTerminateWithError($result);
$person->status = $status;
}
$this->terminateWithSuccess($data);
}
@@ -508,71 +541,52 @@ class Student extends FHCAPI_Controller
$_POST['ausbildungssemester'] = 0;
}
$this->load->library('form_validation');
$this->_validate();
$this->form_validation->set_rules('nachname', 'Nachname', 'callback_requiredIfNotPersonId', [
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'nachname')])
]);
$this->form_validation->set_rules('geschlecht', 'Geschlecht', 'callback_requiredIfNotPersonId', [
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'geschlecht')])
]);
$this->form_validation->set_rules('gebdatum', 'Geburtsdatum', ['isValidDate', function($value) { return isValidDate($value); }], [
'isValidDate' => $this->p->t('ui', 'error_invalid_date')
]);
$this->form_validation->set_rules('address[func]', 'Address', 'required|integer|less_than[2]|greater_than[-2]');
$this->form_validation->set_rules('address[plz]', 'PLZ', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'plz')])
]);
$this->form_validation->set_rules('address[gemeinde]', 'Gemeinde', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'gemeinde')])
]);
$this->form_validation->set_rules('address[ort]', 'Ort', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'ort')])
]);
$this->form_validation->set_rules('address[address]', 'Adresse', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'adresse')])
]);
$this->form_validation->set_rules('email', 'E-Mail', 'valid_email');
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'callback_requiredIfStudentFunc', [
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiengang')])
]);
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'callback_requiredIfStudentFunc', [
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiensemester')])
]);
$this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'callback_requiredIfStudentFunc|integer|less_than[9]|greater_than[-1]', [
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'ausbildungssemester')])
]);
// TODO(chris): validate studienplan with studiengang, semester and orgform?
// TODO(chris): validate person_id, studiengang_kz, studiensemester_kurzbz, orgform_kurzbz, nation, gemeinde, ort, geschlecht?
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
// TODO(chris): This should be in a library
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
$this->db->trans_start();
$this->load->library('PrestudentLib');
$result = $this->addInteressent();
$errors = [];
$person_id = null;
$this->db->trans_complete();
$this->db->trans_begin();
if ($this->db->trans_status() === FALSE)
$this->terminateWithError('TODO(chris): TEXT', self::ERROR_TYPE_GENERAL);
$result = $this->_addPerson();
if (isError($result)) $errors[] = getError($result);
$data = $this->getDataOrTerminateWithError($result);
if (hasData($result))
{
$person_id = getData($result);
$result = $this->_addAdresse($person_id);
if (isError($result)) $errors[] = getError($result);
$result = $this->_addKontakt($person_id);
if (isError($result)) $errors[] = getError($result);
if (!$this->input->post('personOnly')) $result = $this->_addFirstPrestudentstatus($person_id);
if (isError($result)) $errors[] = getError($result);
}
$this->terminateWithSuccess($data);
if ($this->db->trans_status() === FALSE || !isEmptyArray($errors))
{
$this->db->trans_rollback();
$this->terminateWithError(isEmptyArray($errors) ? $this->p->t('stv', 'error_add_student') : $errors);
}
$this->db->trans_commit();
$this->terminateWithSuccess($person_id);
}
protected function addInteressent()
private function _addPerson()
{
// Person anlegen wenn nötig
$person_id = $this->input->post('person_id');
if (!$person_id) {
$this->load->model('person/Person_model', 'PersonModel');
$data = [
'nachname' => $this->input->post('nachname'),
'insertamum' => date('c'),
@@ -595,19 +609,25 @@ class Student extends FHCAPI_Controller
if ($this->input->post('geschlecht'))
$data['geschlecht'] = $this->input->post('geschlecht');
if ($this->input->post('gebdatum'))
$data['gebdatum'] = (new DateTime($this->input->post('datum_obj')))->format('Y-m-d');
$data['gebdatum'] = (new DateTime($this->input->post('gebdatum')))->format('Y-m-d');
if ($this->input->post('geburtsnation'))
$data['geburtsnation'] = $this->input->post('geburtsnation');
if ($this->input->post('staatsbuergerschaft'))
$data['staatsbuergerschaft'] = $this->input->post('staatsbuergerschaft');
$result = $this->PersonModel->insert($data);
$person_id = $this->getDataOrTerminateWithError($result);
return $this->PersonModel->insert($data);
}
// Addresse anlegen
$anlegen = $this->input->post('address[func]');
if ($anlegen) {
return success($person_id);
}
private function _addAdresse($person_id)
{
// Addresse anlegen?
$anlegen = $this->input->post('address[checked]');
if ($anlegen === true)
{
// Adresse laden
$this->load->model('person/Adresse_model', 'AdresseModel');
$data = [
@@ -619,52 +639,45 @@ class Student extends FHCAPI_Controller
'typ' => 'h',
'zustelladresse' => true,
];
if ($anlegen < 0) { // Überschreiben
$this->AdresseModel->addSelect('adresse_id');
$this->AdresseModel->addJoin('public.tbl_adressentyp', 'typ = adressentyp_kurzbz');
$this->AdresseModel->addOrder('zustelladresse', 'DESC');
$this->AdresseModel->addOrder('sort');
$result = $this->AdresseModel->loadWhere([
'person_id' => $person_id
]);
$address = $this->getDataOrTerminateWithError($result);
if ($address) {
$address = current($address);
$data['updateamum'] = date('c');
$data['updatevon'] = getAuthUID();
if (isError($result)) return $result;
// wenn neue Adresse, heimatadresse setzen
if (!hasData($result)) $data['heimatadresse'] = true;
$result = $this->AdresseModel->update($address->adresse_id, $data);
$this->getDataOrTerminateWithError($result);
} else {
//Wenn keine Adrese vorhanden ist dann eine neue Anlegen
$anlegen = 1;
$data['heimatadresse'] = true;
}
}
if ($anlegen > 0) {
$data['person_id'] = $person_id;
$data['insertamum'] = date('c');
$data['insertvon'] = getAuthUID();
if (!isset($data['heimatadresse']))
$data['heimatadresse'] = !$this->input->post('person_id');
$result = $this->AdresseModel->insert($data);
$this->getDataOrTerminateWithError($result);
}
return $this->AdresseModel->insert($data);
}
return success(null);
}
private function _addKontakt($person_id)
{
// Kontaktdaten
$kontaktdaten = [];
foreach (['email', 'telefon', 'mobil'] as $k) {
foreach (['email', 'telefon', 'mobil'] as $k)
{
$v = $this->input->post($k);
if ($v)
$kontaktdaten[$k] = $v;
}
if (count($kontaktdaten)) {
if (count($kontaktdaten))
{
$this->load->model('person/Kontakt_model', 'KontaktModel');
foreach ($kontaktdaten as $typ => $kontakt) {
foreach ($kontaktdaten as $typ => $kontakt)
{
$data = [
'person_id' => $person_id,
'kontakttyp' => $typ,
@@ -674,87 +687,70 @@ class Student extends FHCAPI_Controller
'insertvon' => getAuthUID()
];
$result = $this->KontaktModel->insert($data);
$this->getDataOrTerminateWithError($result);
if (isError($result)) return $result;
}
}
return success(null);
}
$personOnly = $anlegen = $this->input->post('personOnly');
private function _addFirstPrestudentstatus($person_id)
{
// Prestudent anlegen
if (!$personOnly)
// Anmerkung with Ausbildungsart
$studiengang_kz = $this->input->post('studiengang_kz');
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
$ausbildungsart = $this->input->post('ausbildungsart');
$anmerkung = $this->input->post('anmerkungen');
$foerderrelevant = null;
if ($ausbildungsart)
$anmerkung .= ' Ausbildungsart:' . $ausbildungsart;
// Incomings und ausserordentliche sind bei Meldung nicht förderrelevant
$incoming = $this->input->post('incoming');
if ($incoming || substr($studiengang_kz, 0, 1) == '9')
$foerderrelevant = false;
// Prestudent speichern
$result = $this->prestudentlib->setPrestudent(
$person_id,
$studiengang_kz,
$this->input->post('letzteausbildung'),
$anmerkung,
$foerderrelevant
);
if (isError($result)) return $result;
if (!hasData($result)) return error('Error when adding prestudent');
$prestudent_id = getData($result);
// wenn Incoming, Incoming Daten hinzufügen
if ($incoming)
{
// Prestudent anlegen
$data = [
'aufmerksamdurch_kurzbz' => 'k.A.',
'person_id' => $person_id,
'studiengang_kz' => $this->input->post('studiengang_kz'),
'ausbildungcode' => $this->input->post('letzteausbildung'),
'anmerkung' => $this->input->post('anmerkungen'),
'reihungstestangetreten' => false,
'bismelden' => true
];
$ausbildungsart = $this->input->post('ausbildungsart');
if ($ausbildungsart)
$data['anmerkung'] .= ' Ausbildungsart:' . $ausbildungsart;
// Incomings und ausserordentliche sind bei Meldung nicht förderrelevant
$incoming = $this->input->post('incoming');
if ($incoming || substr($data['studiengang_kz'], 0, 1) == '9')
$data['foerderrelevant'] = false;
// Wenn die Person schon im System erfasst ist, dann die ZGV des Datensatzes uebernehmen
$this->PrestudentModel->addOrder('zgvmas_code');
$this->PrestudentModel->addOrder('zgv_code', 'DESC');
$this->PrestudentModel->addLimit(1);
$result = $this->PrestudentModel->loadWhere([
'person_id' => $person_id
]);
$prestudent = $this->getDataOrTerminateWithError($result);
if ($prestudent) {
$prestudent = current($prestudent);
if ($prestudent->zgv_code) {
$data['zgv_code'] = $prestudent->zgv_code;
$data['zgvort'] = $prestudent->zgvort;
$data['zgvdatum'] = $prestudent->zgvdatum;
$data['zgvmas_code'] = $prestudent->zgvmas_code;
$data['zgvmaort'] = $prestudent->zgvmaort;
$data['zgvmadatum'] = $prestudent->zgvmadatum;
}
}
// Prestudent speichern
$result = $this->PrestudentModel->insert($data);
$prestudent_id = $this->getDataOrTerminateWithError($result);
// Prestudent Rolle Anlegen
$data = [
'prestudent_id' => $prestudent_id,
'status_kurzbz' => $incoming ? 'Incoming' : 'Interessent',
'studiensemester_kurzbz' => $this->input->post('studiensemester_kurzbz'),
'ausbildungssemester' => $this->input->post('ausbildungssemester') ?: 0,
'orgform_kurzbz' => $this->input->post('orgform_kurzbz') ?: null,
'studienplan_id' => $this->input->post('studienplan_id') ?: null,
'datum' => date('Y-m-d'),
'insertamum' => date('c'),
'insertvon' => getAuthUID()
];
$result = $this->PrestudentstatusModel->insert($data);
$this->getDataOrTerminateWithError($result);
if ($incoming) {
// TODO(chris): IMPLEMENT!
//Matrikelnummer und UID generieren
//Benutzerdatensatz anlegen
//Studentendatensatz anlegen
//StudentLehrverband anlegen
}
$statusResult = $this->prestudentlib->setFirstIncoming(
$prestudent_id,
$studiengang_kz,
$studiensemester_kurzbz,
$this->input->post('orgform_kurzbz'),
$this->input->post('studienplan_id')
);
}
// TODO(chris): DEBUG
/*$result = $this->PrestudentModel->loadWhere([
'pestudent_id' => 1
]);
if (isError($result)) {
return $result;
}*/
else
{
// Prestudent Rolle Anlegen
$statusResult = $this->prestudentlib->setFirstStatus(
$prestudent_id,
$this->PrestudentstatusModel::STATUS_INTERESSENT,
$studiensemester_kurzbz,
$this->input->post('ausbildungssemester'),
$this->input->post('orgform_kurzbz'),
$this->input->post('studienplan_id')
);
}
if (!hasData($statusResult)) return error('error when adding status');
if (isError($statusResult)) return $statusResult;
return success($person_id);
return success($prestudent_id);
}
public function requiredIfNotPersonId($value)
@@ -766,20 +762,84 @@ class Student extends FHCAPI_Controller
public function requiredIfAddressFunc($value)
{
if (!$_POST['address']['func'] || $_POST['address']['func'] == 0)
if (!isset($_POST['address']['checked']) || !$_POST['address']['checked'])
return true;
return !!$value;
}
public function requiredIfStudentFunc($value)
{
if ($_POST['personOnly'])
if (isset($_POST['personOnly']) && $_POST['personOnly'])
return true;
return !!$value;
}
public function isValidDate($value)
public function requiredIfStudentAndNotIncomingFunc($value)
{
return isValidDate($value);
if ((isset($_POST['incoming']) && $_POST['incoming']) || $this->requiredIfStudentFunc($value))
return true;
return !!$value;
}
/**
* Validates input data. Terminates with validation errors, if invalid.
*/
private function _validate()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('nachname', 'Nachname', 'callback_requiredIfNotPersonId', [
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'nachname')])
]);
$this->form_validation->set_rules('geschlecht', 'Geschlecht', 'callback_requiredIfNotPersonId', [
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'geschlecht')])
]);
$this->form_validation->set_rules('gebdatum', 'Geburtsdatum', ['isValidDate', function($value) { return isValidDate($value); }], [
'isValidDate' => $this->p->t('ui', 'error_invalid_date')
]);
//$this->form_validation->set_rules('address[checked]', 'Address', 'required');
$this->form_validation->set_rules('address[plz]', 'PLZ', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'plz')])
]);
$this->form_validation->set_rules('address[gemeinde]', 'Gemeinde', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'gemeinde')])
]);
$this->form_validation->set_rules('address[ort]', 'Ort', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'ort')])
]);
$this->form_validation->set_rules('address[address]', 'Adresse', 'callback_requiredIfAddressFunc', [
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'adresse')])
]);
$this->form_validation->set_rules('email', 'E-Mail', 'valid_email');
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'callback_requiredIfStudentFunc', [
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiengang')])
]);
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'callback_requiredIfStudentFunc', [
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiensemester')])
]);
$this->form_validation->set_rules(
'ausbildungssemester',
'Ausbildungssemester',
'callback_requiredIfStudentAndNotIncomingFunc|integer|less_than[9]|greater_than[-1]',
[
'requiredIfStudentAndNotIncomingFunc' =>
$this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'ausbildungssemester')]),
]
);
// TODO(chris): validate studienplan with studiengang, semester and orgform?
// TODO(chris): validate person_id, studiengang_kz, studiensemester_kurzbz, orgform_kurzbz, nation, gemeinde, ort, geschlecht?
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
private function _getLanguageIndex()
{
$this->load->model('system/Sprache_model', 'SpracheModel');
$this->SpracheModel->addSelect('index');
$result = $this->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
$this->addMeta('lang', getUserLanguage());
return hasData($result) ? getData($result)[0]->index : 1;
}
}
@@ -765,6 +765,86 @@ class Students extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
/**
* @param string $studiensemester_kurzbz
*
* @return void
*/
public function search($studiensemester_kurzbz)
{
$this->addMeta('ci_method', __FUNCTION__);
$this->addMeta('ci_params', array(
'studiensemester_kurzbz' => $studiensemester_kurzbz
));
$this->load->library('SearchLib', [ 'config' => 'searchstv' ]);
$this->load->library('form_validation');
$this->form_validation->set_rules('searchstr', 'searchstr', 'required');
$this->form_validation->set_rules('types[]', 'types', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->searchlib->search($this->input->post('searchstr'), $this->input->post('types'));
$data = $this->getDataOrTerminateWithError($result);
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->prepareQuery($studiensemester_kurzbz);
$this->PrestudentModel->addSelect("COALESCE(v.semester::text, CASE WHEN public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL) IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent') THEN public.get_absem_prestudent(tbl_prestudent.prestudent_id, NULL)::text ELSE ''::text END) AS semester", false);
$this->PrestudentModel->addSelect('v.verband');
$this->PrestudentModel->addSelect('v.gruppe');
//add status per semester
$this->PrestudentModel->addSelect(
"(
SELECT status_kurzbz
FROM public.tbl_prestudentstatus pss
WHERE pss.prestudent_id = public.tbl_prestudent.prestudent_id
AND pss.studiensemester_kurzbz = " . $this->PrestudentModel->escape($studiensemester_kurzbz) . "
ORDER BY GREATEST(pss.datum, '0001-01-01') DESC
LIMIT 1
) AS statusofsemester"
);
$this->addSelectPrioRel();
$this->addFilter($studiensemester_kurzbz);
$prestudent_ids = [];
$student_uids = [];
$this->addMeta('data', $data);
foreach ($data as $row) {
$dataset = json_decode($row->data);
if ($row->type == 'prestudent') {
$prestudent_ids[] = $dataset->prestudent_id;
} elseif ($row->type == 'student') {
$student_uids[] = $dataset->uid;
}
}
if ($prestudent_ids && $student_uids) {
$this->PrestudentModel->db->where_in('tbl_prestudent.prestudent_id', $prestudent_ids);
$this->PrestudentModel->db->or_where_in('s.student_uid', $student_uids);
} elseif ($prestudent_ids) {
$this->PrestudentModel->db->where_in('tbl_prestudent.prestudent_id', $prestudent_ids);
} elseif ($student_uids) {
$this->PrestudentModel->db->where_in('s.student_uid', $student_uids);
} else {
$this->terminateWithSuccess([]);
}
$result = $this->PrestudentModel->load();
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
/**
* @param string|null $studiensemester_kurzbz
* @param string $type
@@ -165,7 +165,17 @@ class Verband extends FHCAPI_Controller
$this->StudiengangModel->addDistinct();
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester ORDER BY verband, gruppe LIMIT 1)) AS name", false);
$this->StudiengangModel->addSelect("CONCAT(
UPPER(CONCAT(typ, kurzbz)),
'-',
semester,
(
SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END
FROM public.tbl_lehrverband
WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester
ORDER BY verband, gruppe LIMIT 1
)
) AS name", false);
$this->StudiengangModel->addSelect('semester');
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
@@ -173,6 +183,7 @@ class Verband extends FHCAPI_Controller
$this->StudiengangModel->addOrder('semester');
if ($org_form !== null) {
$this->StudiengangModel->addSelect("v.orgform_kurzbz");
$this->StudiengangModel->db->group_start();
$this->StudiengangModel->db->where('v.semester', 0);
$this->StudiengangModel->db->or_where('v.orgform_kurzbz', $org_form);
@@ -188,6 +199,7 @@ class Verband extends FHCAPI_Controller
array_unshift($list, [
'name' => 'PreStudent',
'link' => $link . 'prestudent',
'no_sem_reload' => true,
'stg_kz' => (int)$studiengang_kz,
'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz)
]);
@@ -203,6 +215,7 @@ class Verband extends FHCAPI_Controller
$this->StudienordnungModel->addDistinct();
$this->StudienordnungModel->addSelect("CONCAT(studiengang_kz, '/', p.orgform_kurzbz) AS link");
$this->StudienordnungModel->addSelect("p.orgform_kurzbz AS name");
$this->StudienordnungModel->addSelect("studiengang_kz AS stg_kz");
$this->StudienordnungModel->addJoin('lehre.tbl_studienplan p', 'studienordnung_id');
@@ -216,7 +229,6 @@ class Verband extends FHCAPI_Controller
$list = array_merge($list, $result);
}
}
}
$this->terminateWithSuccess($list);
}
@@ -233,10 +233,10 @@ class Person extends API_Controller
//Quersumme bilden
for ($i = 0; $i < 10; $i++)
{
$erg += $gewichtung[$i] * $tmpSvnr{$i};
$erg += $gewichtung[$i] * $tmpSvnr[$i];
}
if ($tmpSvnr{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11
if ($tmpSvnr[3] != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11
{
return error('SVNR ist ungueltig');
}
@@ -244,7 +244,7 @@ class Person extends API_Controller
if (mb_strlen($person['svnr']) == 12)
{
$last = substr($person['svnr'], 10, 12);
if ($last{0} != 'v' || !is_numeric($last{1}))
if ($last[0] != 'v' || !is_numeric($last[1]))
{
return error('SVNR ist ungueltig');
}
+88 -4
View File
@@ -200,13 +200,14 @@ class AntragJob extends JOB_Controller
}
/**
* Send reminder to Assistant for Wiedereinstieg Unterbrecher
* Send reminder to Assistant and to Student for Wiedereinstieg Unterbrecher
*
*/
public function sendReminderWiedereinstieg()
{
$now = new DateTime();
$modifier = $this->config->item('unterbrechung_job_remind_wiedereinstieg_date_modifier');
if (!$modifier)
return $this->logError('Konnte Job nicht starten: Config "unterbrechung_job_remind_wiedereinstieg_date_modifiers" nicht gesetzt');
@@ -230,6 +231,7 @@ class AntragJob extends JOB_Controller
$antraege = getData($result) ?: [];
$count = 0;
$countReminderStudent = 0;
foreach ($antraege as $antrag)
{
$res = $this->StudierendenantragModel->getStgAndSem($antrag->studierendenantrag_id);
@@ -257,10 +259,92 @@ class AntragJob extends JOB_Controller
$data['UID'] = $student->student_uid;
}
// NOTE(chris): Sancho mail
if(sendSanchoMail('Sancho_Mail_Antrag_U_Reminder', $data, $antrag->email, 'Reminder: Unterbrechung Wiedereinstieg'))
//Data für Email Student
$result = $this->PrestudentModel->load($antrag->prestudent_id);
$dataPrestudent = current(getData($result));
$person_id = $dataPrestudent->person_id;
$this->KontaktModel->addSelect('kontakt');
$result = $this->KontaktModel->loadWhere([
'person_id'=> $person_id,
'zustellung' => true,
'kontakttyp' => 'email'
]);
$email_student_privat = null;
$dataKontakt = getData($result);
if ($dataKontakt) {
$stud_private_zustell_emails = array_map(function($kontakt) {
return $kontakt->kontakt;
}, $dataKontakt);
$email_student_privat = implode(', ', $stud_private_zustell_emails);
}
$email_student_FH = $this->StudentModel->getEmailFH($this->StudentModel->getUID($antrag->prestudent_id));
//studiensemester
$result = $this->StudiensemesterModel->getByDate($datum->format('Y-m-d'));
if (hasData($result)) {
$dataSem = current(getData($result));
}
$studiensemester = $dataSem->studiensemester_kurzbz;
$studsemShort = substr($studiensemester, 0, 2);
if($studsemShort == "SS")
{
$data['studSemShort_Eng'] = "summer semester";
$data['meldenBis'] = "15.1.";
$data['meldenBis_Eng'] = "January 15";
}
elseif ($studsemShort == "WS") {
$data['studSemShort_Eng'] = "winter semester";
$data['meldenBis'] = "1.8.";
$data['meldenBis_Eng'] = "August 1";
}
else
{
$studsemShort = "SS/WS";
$data['studSemShort_Eng'] = "summer/winter semester";
$data['meldenBis'] = "15.1. (bei Einstieg ins SS) / 1.8. (bei Einstieg ins WS)";
$data['meldenBis_Eng'] = "January 15 (for sommer semester enrollment) / August 1 (for winter semester enrollment)";
}
$data['studSemShort'] = $studsemShort;
// NOTE(chris): Sancho mail Assistant
$sancho_assistant_sent = sendSanchoMail('Sancho_Mail_Antrag_U_Reminder', $data, $antrag->email, 'Reminder: Unterbrechung Wiedereinstieg');
if($sancho_assistant_sent)
{
$count++;
}
else
{
$this->logError('Error: failed to send Assistant Reminder studierendenantrag_id: ' . $antrag->studierendenantrag_id);
}
//Mail to Student
$sancho_student_sent = sendSanchoMail(
'Sancho_Mail_Antrag_U_Remind_Stud',
$data,
$email_student_FH,
'Reminder: Unterbrechung Wiedereinstieg',
'',
'',
'',
$email_student_privat);
if($sancho_student_sent)
{
$countReminderStudent++;
}
else
{
$this->logError('Error: failed to send Student Reminder studierendenantrag_id: ' . $antrag->studierendenantrag_id);
}
if($sancho_assistant_sent && $sancho_student_sent)
{
$this->StudierendenantragstatusModel->insert([
'studierendenantrag_id' => $antrag->studierendenantrag_id,
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_REMINDERSENT,
@@ -268,7 +352,7 @@ class AntragJob extends JOB_Controller
]);
}
}
$this->logInfo($count . ' Reminder gesendet - Ende Job sendReminderWiedereinstieg');
$this->logInfo($count . ' Reminder an Assistenz und ' . $countReminderStudent . ' Reminder an Student gesendet - Ende Job sendReminderWiedereinstieg');
}
/**
@@ -22,6 +22,7 @@ class InfoCenter extends Auth_Controller
const REIHUNGSTESTABSOLVIERT_PAGE = 'reihungstestAbsolviert';
const ABGEWIESEN_PAGE = 'abgewiesen';
const AUFGENOMMEN_PAGE = 'aufgenommen';
const ONBOARDING_PAGE = 'onboarding';
const SHOW_DETAILS_PAGE = 'showDetails';
const SHOW_ZGV_DETAILS_PAGE = 'showZGVDetails';
const ZGV_UBERPRUEFUNG_PAGE = 'ZGVUeberpruefung';
@@ -116,6 +117,7 @@ class InfoCenter extends Auth_Controller
'index' => 'infocenter:r',
'freigegeben' => 'infocenter:r',
'abgewiesen' => 'infocenter:r',
'onboarding' => 'infocenter:r',
'aufgenommen' => 'infocenter:r',
'reihungstestAbsolviert' => 'infocenter:r',
'showDetails' => 'infocenter:r',
@@ -230,6 +232,13 @@ class InfoCenter extends Auth_Controller
$this->load->view('system/infocenter/infocenterAbgewiesen.php');
}
public function onboarding()
{
$this->_setNavigationMenu(self::ONBOARDING_PAGE); // define the navigation menu for this page
$this->load->view('system/infocenter/onboarding.php');
}
/**
* Aufgenommene page of the InfoCenter tool
@@ -1553,6 +1562,7 @@ class InfoCenter extends Auth_Controller
$reihungstestAbsolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
$abgewiesenLink = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
$aufgenommenLink = site_url(self::INFOCENTER_URI.'/'.self::AUFGENOMMEN_PAGE);
$onboardingLink = site_url(self::INFOCENTER_URI.'/'.self::ONBOARDING_PAGE);
$currentFilterId = $this->input->get(self::FILTER_ID);
if (isset($currentFilterId))
@@ -1561,6 +1571,7 @@ class InfoCenter extends Auth_Controller
$reihungstestAbsolviertLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$abgewiesenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$aufgenommenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$onboardingLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
}
$this->navigationlib->setSessionMenu(
@@ -1624,6 +1635,18 @@ class InfoCenter extends Auth_Controller
'', // target
40 // sort
),
'ohnePrestudent' => $this->navigationlib->oneLevel(
'Electronic Onboarding', // description
$onboardingLink, // link
null, // children
'users', // icon
null, // subscriptDescription
false, // expand
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
50 // sort
),
)
);
}
@@ -1650,6 +1673,8 @@ class InfoCenter extends Auth_Controller
$link = site_url(self::ZGV_UEBERPRUEFUNG_URI);
if ($origin_page === self::ABGEWIESEN_PAGE)
$link = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
if ($origin_page === self::ONBOARDING_PAGE)
$link = site_url(self::INFOCENTER_URI.'/'.self::ONBOARDING_PAGE);
if ($origin_page === self::AUFGENOMMEN_PAGE)
$link = site_url(self::INFOCENTER_URI.'/'.self::AUFGENOMMEN_PAGE);
@@ -1691,6 +1716,7 @@ class InfoCenter extends Auth_Controller
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
$absolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
$abgewiesenLink = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
$onboardingLink = site_url(self::INFOCENTER_URI.'/'.self::ONBOARDING_PAGE);
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
if (isset($prevFilterId))
{
@@ -1767,6 +1793,24 @@ class InfoCenter extends Auth_Controller
)
);
}
if($page == self::ONBOARDING_PAGE)
{
$this->navigationlib->setSessionElementMenu(
'onboarding',
$this->navigationlib->oneLevel(
'Electronic Onboarding', // description
$onboardingLink, // link
null, // children
'users', // icon
null, // subscriptDescription
false, // expand
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
50 // sort
)
);
}
}
/**
+236 -5
View File
@@ -35,6 +35,90 @@ class PrestudentLib
$this->_ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
}
/**
* Sets initial prestudent entry, no status yet.
* @return object success or error
*/
public function setPrestudent(
$person_id,
$studiengang_kz,
$ausbildungscode,
$anmerkung,
$foerderrelevant
)
{
// Prestudent anlegen
$data = [
'aufmerksamdurch_kurzbz' => 'k.A.',
'person_id' => $person_id,
'studiengang_kz' => $studiengang_kz,
'ausbildungcode' => $ausbildungscode,
'anmerkung' => $anmerkung,
'reihungstestangetreten' => false,
'bismelden' => true,
'foerderrelevant' => $foerderrelevant,
'insertamum' => date('c'),
'insertvon' => getAuthUID()
];
// Wenn die Person schon im System erfasst ist, dann die ZGV des Datensatzes uebernehmen
$this->_ci->PrestudentModel->addSelect('public.tbl_prestudent.*, public.tbl_person.vorname, public.tbl_person.nachname');
$this->_ci->PrestudentModel->addJoin('public.tbl_person', 'person_id');
$this->_ci->PrestudentModel->addOrder('zgvmas_code');
$this->_ci->PrestudentModel->addOrder('zgv_code', 'DESC');
$this->_ci->PrestudentModel->addLimit(1);
$result = $this->_ci->PrestudentModel->loadWhere([
'person_id' => $person_id,
'zgv_code IS NOT NULL' => null
]);
if (isError($result)) return $result;
if (hasData($result)) {
$prestudent = getData($result)[0];
if ($prestudent->zgv_code) {
$data['zgv_code'] = $prestudent->zgv_code;
$data['zgvort'] = $prestudent->zgvort;
$data['zgvdatum'] = $prestudent->zgvdatum;
$data['zgvmas_code'] = $prestudent->zgvmas_code;
$data['zgvmaort'] = $prestudent->zgvmaort;
$data['zgvmadatum'] = $prestudent->zgvmadatum;
}
}
// Prestudent speichern
return $this->_ci->PrestudentModel->insert($data);
}
/**
* Sets first status of a prestudent.!
* @return object success or error
*/
public function setFirstStatus(
$prestudent_id,
$status_kurzbz,
$studiensemester_kurzbz,
$ausbildungssemester = null,
$orgform_kurzbz = null,
$studienplan_id = null
)
{
// Prestudent Rolle Anlegen
$data = [
'prestudent_id' => $prestudent_id,
'status_kurzbz' => $status_kurzbz,
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'ausbildungssemester' => $ausbildungssemester ?: 0,
'orgform_kurzbz' => $orgform_kurzbz ?: null,
'studienplan_id' => $studienplan_id ?: null,
'datum' => date('Y-m-d'),
'insertamum' => date('c'),
'insertvon' => getAuthUID()
];
return $this->_ci->PrestudentstatusModel->insert($data);
}
public function setAbbrecher(
$prestudent_id,
$studiensemester_kurzbz,
@@ -603,9 +687,6 @@ class PrestudentLib
$now = date('c');
$today = date('Y-m-d');
$jahr = mb_substr($studiensemester_kurzbz, 4, 2);
// Genererate Personenkennzeichen
$personenkennzeichen = $this->_ci->StudentModel->generateMatrikelnummer2(
$student_data->studiengang_kz,
@@ -615,8 +696,9 @@ class PrestudentLib
if (isError($personenkennzeichen))
return $personenkennzeichen;
$personenkennzeichen = getData($personenkennzeichen);
$jahr = mb_substr($personenkennzeichen, 0, 2);
// Generate UID
$uid = $this->_ci->StudentModel->generateUID(
$student_data->kurzbz,
@@ -889,6 +971,155 @@ class PrestudentLib
);
}
/**
* Creates an incoming, saves necessary data for an incoming.
* @param $prestudent_id existing prestudent, for which incoming entry is created
* @param $studiengang_kz Studiengang assigned to incoming
* @param $studiensemester_kurzbz start semester for incoming
* @return object success if incoming successfully saved, or error
*/
public function setFirstIncoming($prestudent_id, $studiengang_kz, $studiensemester_kurzbz, $orgform_kurzbz, $studienplan_id)
{
// Verband and Ausbildungssemester for incoming
$authUID = getAuthUID();
$incomingVerband = 'I';
$incomingAusbildungssemester = '0';
// get prestudent
$this->_ci->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
$this->_ci->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz');
$result = $this->_ci->PrestudentModel->load($prestudent_id);
if (isError($result)) return $result;
if (!hasData($result)) return error('No prestudent');
$student_data = getData($result)[0];
$result = $this->setFirstStatus(
$prestudent_id,
$this->_ci->PrestudentstatusModel::STATUS_INCOMING,
$studiensemester_kurzbz,
$incomingAusbildungssemester,
$orgform_kurzbz,
$studienplan_id
);
if (isError($result)) return $result;
if (!hasData($result)) return error('Error when adding prestudentstatus');
// generate Personenkennzeichen
$result = $this->_ci->StudentModel->generateMatrikelnummer2($studiengang_kz, $studiensemester_kurzbz);
if (isError($result)) return $result;
if (!hasData($result)) return error('No personenkennzeichen could be generated');
$personenkennzeichen = getData($result);
$jahr = mb_substr($personenkennzeichen, 0, 2);
$stg = mb_substr($personenkennzeichen, 3, 4);
$nachname_clean = mb_strtolower(sanitizeProblemChars($student_data->nachname));
$vorname_clean = mb_strtolower(sanitizeProblemChars($student_data->vorname));
$nachname_clean = str_replace(' ','_', $nachname_clean);
$vorname_clean = str_replace(' ','_', $vorname_clean);
// get Studiengang data
$result = $this->_ci->StudiengangModel->load(ltrim($stg, '0'));
if (isError($result)) return $result;
if (!hasData($result)) return error('No Studiengang');
$stgObj = getData($result)[0];
// gernerate uid
$result = $this->_ci->StudentModel->generateUID($stgObj->kurzbz, $jahr, $stgObj->typ, $personenkennzeichen, $vorname_clean, $nachname_clean);
if (isError($result)) return $result;
if (!hasData($result)) return error("UID could not be generated");
$uid = getData($result);
//Benutzerdatensatz anlegen
$benutzer = [
'uid' => $uid,
'person_id' => $student_data->person_id,
'aktiv' => true,
'aktivierungscode' => $this->_ci->BenutzerModel->generateActivationkey()
];
// Generate Alias
$alias = '';
if (!defined('GENERATE_ALIAS_STUDENT') || GENERATE_ALIAS_STUDENT === true)
{
$result = $this->_ci->BenutzerModel->generateAliasFromName($student_data->vorname, $student_data->nachname);
if (isError($result))
return $result;
$alias = getData($result);
}
$benutzer['alias'] = $alias;
$benutzer['insertamum'] = date('Y-m-d H:i:s');
$benutzer['insertvon'] = $authUID;
$result = $this->_ci->BenutzerModel->insert($benutzer);
if (isError($result)) return $result;
// Studentendatensatz anlegen
$student = [
'student_uid' => $uid,
'matrikelnr' => $personenkennzeichen,
'prestudent_id' => $prestudent_id,
'studiengang_kz' => $studiengang_kz,
'semester' => $incomingAusbildungssemester,
'verband' => $incomingVerband,
'gruppe' => ' '
];
$result = $this->_ci->LehrverbandModel->loadWhere([
'studiengang_kz' => $student['studiengang_kz'],
'semester' => $student['semester'],
'verband' => $student['verband'],
'gruppe' => $student['gruppe']
]);
if (isError($result)) return $result;
if (!hasData($result))
{
// Add Lehrverband if it does not exist
$result = $this->_ci->LehrverbandModel->insert([
'studiengang_kz' => $student_data->studiengang_kz,
'semester' => $student['semester'],
'verband' => $student['verband'],
'gruppe' => $student['gruppe'],
'bezeichnung' => 'Incoming',
'aktiv' => true
]);
if (isError($result)) return $result;
}
// add student
$student['insertamum'] = date('Y-m-d H:i:s');
$student['insertvon'] = $authUID;
$result = $this->_ci->StudentModel->insert($student);
if (isError($result)) return $result;
// Add Studentlehrverband
$result = $this->_ci->StudentlehrverbandModel->insert([
'student_uid' => $uid,
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'studiengang_kz' => $student_data->studiengang_kz,
'semester' => $incomingAusbildungssemester,
'verband' => $incomingVerband,
'gruppe' => ' ',
'insertamum' => date('Y-m-d H:i:s'),
'insertvon' => $authUID
]);
if (isError($result))
return $result;
return success($prestudent_id);
}
protected function setBasic($authUID, $now, $status_kurzbz, $prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $statusgrund_id = null)
{
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
@@ -290,7 +290,11 @@ class Prestudentstatus_model extends DB_Model
*/
public function getLastStatusPerson($person_id, $studiensemester_kurzbz = null)
{
$query = 'SELECT *
$query = 'SELECT p.*, ps.*, s.*,
stg.kurzbz AS studiengang_kurzbz, stg.kurzbzlang AS studiengang_kurzbzlang,
UPPER(typ::varchar(1) || kurzbz) AS studiengang_kuerzel,
stg.typ AS studiengang_typ, stg.bezeichnung AS studiengang_bezeichnung, stg.english AS studiengang_bezeichnung_english,
stg.orgform_kurzbz AS studiengang_orgform
FROM public.tbl_prestudent p
JOIN (
SELECT DISTINCT ON(prestudent_id) *
@@ -298,7 +302,8 @@ class Prestudentstatus_model extends DB_Model
WHERE prestudent_id IN (SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id = ?)
ORDER BY prestudent_id, datum desc, insertamum desc
) ps USING(prestudent_id)
JOIN public.tbl_status USING(status_kurzbz)';
JOIN public.tbl_status s USING(status_kurzbz)
JOIN public.tbl_studiengang stg USING (studiengang_kz)';
$parametersArray = array($person_id);
+2 -2
View File
@@ -27,7 +27,7 @@ class Student_model extends DB_Model
$this->addSelect('1');
$result = $this->loadWhere(array('student_uid' => $uid));
if(hasData($result))
{
@@ -169,7 +169,7 @@ class Student_model extends DB_Model
$max = 0;
if ($matrikelnrres && hasData($matrikelnrres)) {
$max = mb_substr($matrikelnrres->retval[0]->matrikelnr, 7);
$max = mb_substr(trim(getData($matrikelnrres)[0]->matrikelnr), -3);
if (!is_numeric($max)) {
$max = (int)$max;
}
@@ -24,17 +24,28 @@ class Projektarbeit_model extends DB_Model
public function getProjektarbeit($student_uid, $studiengang_kz = null, $studiensemester_kurzbz = null, $projekttyp = null, $final = null)
{
$qry = "SELECT
tbl_projektarbeit.*, tbl_projekttyp.bezeichnung,
pa.*, tbl_projekttyp.bezeichnung,
tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.lehrveranstaltung_id,
tbl_firma.name AS firma_name
tbl_firma.name AS firma_name,
(
SELECT
STRING_AGG(trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')), ', ')
FROM
lehre.tbl_projektbetreuer
JOIN public.tbl_person USING (person_id)
WHERE
projektarbeit_id = pa.projektarbeit_id
AND student_uid = pa.student_uid
GROUP BY projektarbeit_id
) AS projektbetreuer
FROM
lehre.tbl_projektarbeit
lehre.tbl_projektarbeit pa
JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
LEFT JOIN public.tbl_firma USING (firma_id)
WHERE
tbl_projektarbeit.student_uid = ?";
pa.student_uid = ?";
$params = array($student_uid);
@@ -135,7 +135,8 @@ class Profil_update_model extends DB_Model
attachment_id,
UPPER(public.tbl_studiengang.typ || public.tbl_studiengang.kurzbz) AS studiengang,
COALESCE(of.orgform_kurzbz, public.tbl_studiengang.orgform_kurzbz) AS orgform,
NULL as oezuordnung
NULL as oezuordnung,
tbl_student.semester
FROM public.tbl_profil_update
JOIN public.tbl_profil_update_status ON public.tbl_profil_update_status.status_kurzbz = public.tbl_profil_update.status
JOIN public.tbl_student ON public.tbl_student.student_uid=public.tbl_profil_update.uid
@@ -47,7 +47,6 @@ class Stundensatz_model extends DB_Model
{
$this->load->config('stv');
$useFixangestelltStundensatz = $this->config->item('tabs')['projektarbeit']['lvLektroinnenzuteilungFixangestelltStundensatz'];
$defaultStundensatz = $this->config->item('tabs')['projektarbeit']['defaultProjektbetreuerStundensatz'];
$stundensatz = '';
@@ -63,7 +62,7 @@ class Stundensatz_model extends DB_Model
{
$studiensemester = getData($result)[0];
if (isset($useFixangestelltStundensatz) && !$useFixangestelltStundensatz)
if (defined('FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ') && !FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ)
{
// load Mitarbeiter
$params = [$person_id];
@@ -83,19 +82,30 @@ class Stundensatz_model extends DB_Model
if (hasData($result))
{
foreach (getData($result) as $ma)
{
if (!$ma->fixangestellt)
{
$stundensatzRes = $this->getStundensatzByDatum(
$ma->mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre'
);
$ma = getData($result)[0];
if (hasData($stundensatzRes))
$stundensatz = getData($stundensatzRes)[0]->stundensatz;
else
$stundensatz = '0.00';
}
$this->load->model('vertragsbestandteil/Dienstverhaeltnis_model','DienstverhaeltnisModel');
$echterdv_result = $this->DienstverhaeltnisModel->existsDienstverhaeltnis(
$ma->mitarbeiter_uid,
$studiensemester->start,
$studiensemester->ende,
'echterdv'
);
if (hasData($echterdv_result))
{
$stundensatz = null;
}
else
{
$stundensatzRes = $this->getStundensatzByDatum(
$ma->mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre'
);
if (hasData($stundensatzRes))
$stundensatz = getData($stundensatzRes)[0]->stundensatz;
else
$stundensatz = '0.00';
}
}
else
@@ -12,6 +12,8 @@ class Zeitsperre_model extends DB_Model
$this->pk = 'zeitsperre_id';
}
const BLOCKIERENDE_ZEITSPERREN = ['Krank','Urlaub','ZA','DienstV','PflegeU','DienstF','CovidSB','CovidKS'];
/**
* Save or update Zeitsperre.
*
@@ -61,4 +63,128 @@ class Zeitsperre_model extends DB_Model
return $this->execQuery($qry);
}
/**
* get Zeitsperren of a user
*
* @param $uid mitarbeiteruid
* @param $bisgrenze @true show only entries of actual business year (1.9.- 31.8.)
*
* @return array
*/
public function getZeitsperrenUser($uid, $bisgrenze = true)
{
$qry = "
SELECT
tbl_zeitsperre.*, tbl_zeitsperretyp.*, tbl_erreichbarkeit.farbe AS erreichbarkeit_farbe,
tbl_erreichbarkeit.beschreibung AS erreichbarkeit_beschreibung,
CONCAT (ps.vorname, ' ', ps.nachname) as vertretung
FROM (campus.tbl_zeitsperre JOIN campus.tbl_zeitsperretyp USING (zeitsperretyp_kurzbz))
LEFT JOIN campus.tbl_erreichbarkeit USING (erreichbarkeit_kurzbz)
LEFT JOIN public.tbl_benutzer ON campus.tbl_zeitsperre.vertretung_uid = public.tbl_benutzer.uid
LEFT JOIN public.tbl_person ps USING (person_id)
WHERE mitarbeiter_uid= ?
";
if($bisgrenze)
{
$qry.="
AND (
(date_part('month',vondatum)>=9 AND date_part('year', vondatum)>='".(date('Y')-1)."')
OR
(date_part('month',vondatum)<9 AND date_part('year', vondatum)>='".(date('Y'))."')
)";
}
$qry.= " ORDER BY vondatum DESC";
return $this->execQuery($qry, array('mitarbeiter_uid' => $uid));
}
/**
* check a date for existing zeitsperre
*
* @param $uid mitarbeiteruid
* @param $datum datum to check
* @param $stunde stunde (default = null)
* @param bool $nurblockierend if only hr relevante zeitsperren have to be checked
*
* @return array
*/
public function getSperreByDate($uid, $datum, $stunde = null, $nurblockierend = false)
{
$parametersArray = [$datum, $datum];
$qry = "
SELECT
*
FROM
campus.tbl_zeitsperre
WHERE
vondatum <= ?
AND bisdatum>= ?";
if($nurblockierend)
{
$qry .= " AND zeitsperretyp_kurzbz IN ('"
. implode("','", self::BLOCKIERENDE_ZEITSPERREN)
. "')";
}
if(!is_null($stunde))
{
$parametersArray = array_merge(
$parametersArray,
[$datum, $stunde, $datum, $datum, $stunde, $datum]
);
$qry.=" AND
((vondatum= ? AND vonstunde<= ? OR vonstunde is null OR vondatum<> ?) AND
(bisdatum= ? AND bisstunde>= ? OR bisstunde is null OR bisdatum<> ?))";
}
array_push($parametersArray, $uid);
$qry .= "AND mitarbeiter_uid= ? ";
return $this->execQuery($qry, $parametersArray);
}
/**
* check a date for existing zeitsperre
*
* @param $uid mitarbeiteruid
* @param $vondatum datum in Format IS0
* @param $bisdatum datum in Format ISO
*
* @return array
*/
public function existsZeitaufzeichnung($uid, $vonDay, $bisDay)
{
try {
$from = new DateTime($vonDay);
$to = new DateTime($bisDay);
} catch (Exception $e) {
throw new Exception("Invalid date format");
}
//remove hour stamps
$from->setTime(0, 0, 0);
$to->setTime(0, 0, 0)->modify('+1 day');
$fromSql = $from->format('Y-m-d');
$toSql = $to->format('Y-m-d');
$params = [$uid, $fromSql, $toSql];
$qry = "
SELECT *
FROM campus.tbl_zeitaufzeichnung
WHERE uid = ?
AND start >= ?
AND ende < ? ";
$result = $this->execQuery($qry, $params);
return $result;
}
}
@@ -11,4 +11,20 @@ class Zeitsperretyp_model extends DB_Model
$this->dbTable = 'campus.tbl_zeitsperretyp';
$this->pk = 'zeitsperretyp_kurzbz';
}
public function getTypenZeitsperren($excludedTypes = [])
{
$whereNotClause = "";
if (count($excludedTypes)) {
$excludedTypes = array_map(
function ($type) {
return "'$type'";
},
$excludedTypes
);
$excludedTypes = implode(", ", $excludedTypes);
$whereNotClause = "WHERE NOT zeitsperretyp_kurzbz IN ($excludedTypes)";
}
return $this->execQuery("SELECT * FROM $this->dbTable $whereNotClause ORDER BY beschreibung ASC");
}
}
@@ -23,6 +23,7 @@ $includesArray = array(
'public/css/components/FormUnderline.css',
'public/css/Cis4/Cms.css',
'public/css/Cis4/Studium.css',
'public/css/Cis4/Zeitsperren.css',
),
'customJSs' => array(
'vendor/npm-asset/primevue/accordion/accordion.min.js',
+4
View File
@@ -40,6 +40,10 @@ $configArray = [
cis-root="<?= CIS_ROOT; ?>"
:permissions="<?= htmlspecialchars(json_encode($permissions)); ?>"
:config="<?= htmlspecialchars(json_encode($configArray)); ?>"
<?php if($ids !== null && $typeid !== null) { ?>
:id ="<?= htmlspecialchars(json_encode($ids)); ?>"
type-id ="<?= htmlspecialchars($typeid); ?>"
<?php } ?>
>
</router-view>
</div>
+4 -1
View File
@@ -22,7 +22,8 @@
'public/css/components/function.css'
],
'customJSs' => [
'vendor/vuejs/vuedatepicker_js/vue-datepicker.iife.js'
'vendor/vuejs/vuedatepicker_js/vue-datepicker.iife.js',
'vendor/moment/luxonjs/luxon.min.js'
#'vendor/npm-asset/primevue/tree/tree.min.js',
#'vendor/npm-asset/primevue/toast/toast.min.js'
],
@@ -53,6 +54,8 @@ $configArray = [
active-addons="<?= defined('ACTIVE_ADDONS') ? ACTIVE_ADDONS : ''; ?>"
stv-root="<?= site_url('Studentenverwaltung'); ?>"
cis-root="<?= CIS_ROOT; ?>"
avatar-url="<?= site_url('Cis/Pub/bild/person/' . getAuthPersonId()); ?>"
logout-url="<?= site_url('Cis/Auth/logout'); ?>"
:permissions="<?= htmlspecialchars(json_encode($permissions)); ?>"
:config="<?= htmlspecialchars(json_encode($configArray)); ?>"
>
@@ -0,0 +1,47 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Info Center',
'jquery3' => true,
'jqueryui1' => true,
'jquerycheckboxes1' => true,
'bootstrap3' => true,
'fontawesome4' => true,
'sbadmintemplate3' => true,
'tablesorter2' => true,
'ajaxlib' => true,
'filterwidget' => true,
'navigationwidget' => true,
'dialoglib' => true,
'phrases' => array(
'person' => array('vorname', 'nachname'),
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
<div id="wrapper">
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
Electronic Onboarding
</h3>
</div>
</div>
<div>
<?php $this->load->view('system/infocenter/onboardingData.php'); ?>
</div>
</div>
</div>
</div>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -0,0 +1,116 @@
<?php
$APP = '\'infocenter\'';
$KENNZEICHEN = '\'eobRegistrierungsId\'';
$query = '
SELECT
p.person_id AS "PersonId",
p.vorname AS "Vorname",
p.nachname AS "Nachname",
pl.zeitpunkt AS "LockDate",
pl.lockuser AS "LockUser",
rueck.datum_bis AS "HoldDate",
rueck.bezeichnung AS "Rueckstellgrund"
FROM public.tbl_person p
JOIN tbl_kennzeichen ON p.person_id = tbl_kennzeichen.person_id AND kennzeichentyp_kurzbz = '. $KENNZEICHEN .'
LEFT JOIN (
SELECT tpl.person_id,
tpl.zeitpunkt,
sp.nachname AS lockuser
FROM system.tbl_person_lock tpl
JOIN public.tbl_benutzer sb USING (uid)
JOIN public.tbl_person sp ON sb.person_id = sp.person_id
WHERE tpl.app = '.$APP.'
) pl ON p.person_id = pl.person_id
LEFT JOIN (
SELECT
tbl_rueckstellung.person_id,
tbl_rueckstellung.datum_bis,
tbl_rueckstellung.status_kurzbz,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
FROM public.tbl_rueckstellung
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
WHERE tbl_rueckstellung.rueckstellung_id =
(
SELECT srueck.rueckstellung_id
FROM public.tbl_rueckstellung srueck
WHERE srueck.person_id = tbl_rueckstellung.person_id
AND datum_bis >= NOW()
ORDER BY srueck.datum_bis DESC LIMIT 1
)
) rueck ON rueck.person_id = p.person_id
WHERE p.person_id NOT IN (SELECT person_id FROM public.tbl_prestudent)';
$filterWidgetArray = array(
'query' => $query,
'app' => InfoCenter::APP,
'datasetName' => 'onboarding',
'filter_id' => $this->input->get('filter_id'),
'requiredPermissions' => 'infocenter',
'datasetRepresentation' => 'tablesorter',
'checkboxes' => 'PersonId',
'additionalColumns' => array('Details'),
'columnsAliases' => array(
'PersonId',
ucfirst($this->p->t('person', 'vorname')) ,
ucfirst($this->p->t('person', 'nachname')),
ucfirst($this->p->t('global', 'sperrdatum')),
ucfirst($this->p->t('global', 'gesperrtVon')),
ucfirst($this->p->t('infocenter', 'rueckstelldatum')),
ucfirst($this->p->t('infocenter', 'rueckstellgrund')),
),
'formatRow' => function($datasetRaw) {
/* NOTE: Dont use $this here for PHP Version compatibility */
$datasetRaw->{'Details'} = sprintf(
'<a href="%s?person_id=%s&origin_page=%s&fhc_controller_id=%s&prev_filter_id=%s">Details</a>',
site_url('system/infocenter/InfoCenter/showDetails'),
$datasetRaw->{'PersonId'},
'onboarding',
(isset($_GET['fhc_controller_id']) ? $_GET['fhc_controller_id'] : ''),
(isset($_GET['filter_id']) ? $_GET['filter_id'] : '')
);
if ($datasetRaw->{'LockDate'} == null)
{
$datasetRaw->{'LockDate'} = '-';
}
if ($datasetRaw->{'LockUser'} == null)
{
$datasetRaw->{'LockUser'} = '-';
}
if ($datasetRaw->{'HoldDate'} == null)
{
$datasetRaw->{'HoldDate'} = '-';
}
else
{
$datasetRaw->{'HoldDate'} = date_format(date_create($datasetRaw->{'HoldDate'}), 'Y-m-d H:i');
}
if ($datasetRaw->{'Rueckstellgrund'} === null)
{
$datasetRaw->{'Rueckstellgrund'} = '-';
}
return $datasetRaw;
},
'markRow' => function($datasetRaw) {
if ($datasetRaw->LockDate != null)
{
return FilterWidget::DEFAULT_MARK_ROW_CLASS;
}
}
);
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
?>
-8
View File
@@ -447,14 +447,6 @@ if (isset($_POST['save']) && isset($_SESSION['prestudent_id']))
{
e.preventDefault();
});
// If Browser is any other than Mozilla Firefox and the test includes any MathML,
// show message to use Mozilla Firefox
var ua = navigator.userAgent;
if ((ua.indexOf("Firefox") > -1) == false)
{
$("#alertmsgdiv").html("<div class='alert alert-danger'>BITTE VERWENDEN SIE DEN MOZILLA FIREFOX BROWSER!<br>(Manche Prüfungsfragen werden sonst nicht korrekt dargestellt.<br><br>PLEASE USE MOZILLA FIREFOX BROWSER!<br>(Otherwise some exam items will not be displayed correctly</div>");
//alert('BITTE VERWENDEN SIE DEN MOZILLA FIREFOX BROWSER!\n(Manche Prüfungsfragen werden sonst nicht korrekt dargestellt.\n\nPLEASE USE MOZILLA FIREFOX BROWSER!\n(Ohterwise some exam items will not be displayed correctly.)');
}
});
</script>
<?php
-22
View File
@@ -425,28 +425,6 @@ else
e.preventDefault();
});
});
// Get users Browser
var ua = navigator.userAgent;
// If Browser is any other than Mozilla Firefox and the test includes any MathML,
// show message to use Mozilla Firefox
if ((ua.indexOf("Firefox") > -1) == false)
{
let hasMathML = "<?php echo (isset($gebiet_hasMathML)?$gebiet_hasMathML:''); ?>";
let userLang = "<?php echo $sprache_user; ?>";
if (hasMathML == true)
{
if (userLang == 'German')
{
alert('BITTE VERWENDEN SIE DEN MOZILLA FIREFOX BROWSER!\n(Manche Prüfungsfragen werden sonst nicht korrekt dargestellt.)');
}
else if(userLang == 'English')
{
alert('PLEASE USE MOZILLA FIREFOX BROWSER!\n(Ohterwise some exam items will not be displayed correctly.)');
}
}
}
// Error massage if check_gebiet function returns false
$(function() {
var invalid_gebiete = "<?php echo (isset($invalid_gebiete)?$invalid_gebiete:''); ?>";
+4
View File
@@ -360,4 +360,8 @@ define('SANCHO_MAIL_HEADER_IMG', 'sancho_header_DEFAULT.jpg');
// footer image for eigene Mails
define('SANCHO_MAIL_FOOTER_IMG', 'sancho_footer_DEFAULT.jpg');
// Gibt an, ob in der StudVW der Status vorgerueckt werden kann
define('STATUS_VORRUECKEN_ANZEIGEN', true);
?>
+5
View File
@@ -62,6 +62,11 @@ if(!$rechte->isBerechtigt('student/noten',$studiengang_kz, 's'))
$semester = isset($_GET['semester'])?$_GET['semester']:'';
$typ = isset($_GET['typ'])?$_GET['typ']:'';
if(isset($_GET['studiensemester']) && preg_match('/[WS]S[0-9]{4}/', $_GET['studiensemester']))
{
$semester_aktuell = $_GET['studiensemester'];
}
if($semester=='')
die('Bitte ein Semester auswaehlen');
@@ -64,6 +64,11 @@ if (!$rechte->isBerechtigt('student/noten', $studiengang_kz, 's'))
$semester = isset($_GET['semester']) ? $_GET['semester'] : '';
$typ = isset($_GET['typ']) ? $_GET['typ'] : '';
if(isset($_GET['studiensemester']) && preg_match('/[WS]S[0-9]{4}/', $_GET['studiensemester']))
{
$semester_aktuell = $_GET['studiensemester'];
}
if ($semester == '')
die('Bitte ein Semester auswaehlen');
+6 -6
View File
@@ -178,7 +178,7 @@ class File_CSV
return $field;
}
if ($quote && $field{0} == $quote && $field{strlen($field)-1} == $quote) {
if ($quote && $field[0] == $quote && $field[strlen($field) - 1] == $quote) {
return substr($field, 1, -1);
}
return $field;
@@ -230,7 +230,7 @@ class File_CSV
} elseif ($c == "\n" || $c == "\r") {
$sub = ($prev == "\r") ? 2 : 1;
if ((strlen($buff) >= $sub) &&
($buff{strlen($buff) - $sub} == $quote))
($buff[strlen($buff) - $sub] == $quote))
{
$in_quote = false;
}
@@ -312,9 +312,9 @@ class File_CSV
$last =& $fields[count($fields) - 1];
// Fallback to read the line with readQuoted when guess
// that the simple explode won't work right
if (($last{strlen($last) - 1} == "\n"
&& $last{0} == $conf['quote']
&& $last{strlen(rtrim($last)) - 1} != $conf['quote'])
if (($last[strlen($last) - 1] == "\n"
&& $last[0] == $conf['quote']
&& $last[strlen(rtrim($last)) - 1] != $conf['quote'])
||
(count($fields) != $conf['fields'])
// XXX perhaps there is a separator inside a quoted field
@@ -511,4 +511,4 @@ class File_CSV
return true;
}
}
?>
?>
+5 -5
View File
@@ -96,7 +96,7 @@ class File_Util
{
if (File_Util::isAbsolute($path)) {
if (FILE_WIN32) {
return substr($path, $path{3} == '\\' ? 4 : 3);
return substr($path, $path[3] == '\\' ? 4 : 3);
}
return ltrim($path, '/');
}
@@ -182,7 +182,7 @@ class File_Util
if (FILE_WIN32) {
return preg_match('/^[a-zA-Z]:(\\\|\/)/', $path);
}
return ($path{0} == '/') || ($path{0} == '~');
return ($path[0] == '/') || ($path[0] == '~');
}
/**
@@ -244,11 +244,11 @@ class File_Util
} else {
$cwd = getcwd();
$drive = substr($cwd, 0, 2);
if ($path{0} !== $separator{0}) {
if ($path[0] !== $separator[0]) {
$path = substr($cwd, 3) . $separator . $path;
}
}
} elseif ($path{0} !== $separator) {
} elseif ($path[0] !== $separator) {
$path = getcwd() . $separator . $path;
}
@@ -323,7 +323,7 @@ class File_Util
$entries = array();
for ($dir = dir($path); false !== $entry = $dir->read(); ) {
if ($list & FILE_LIST_DOTS || $entry{0} !== '.') {
if ($list & FILE_LIST_DOTS || $entry[0] !== '.') {
$isRef = ($entry === '.' || $entry === '..');
$isDir = $isRef || is_dir($path .'/'. $entry);
if ( ((!$isDir && $list & FILE_LIST_FILES) ||
+1 -1
View File
@@ -240,7 +240,7 @@ class filter extends basis_db
{
//$value->value = preg_replace('/(.*?)selected=.selected./', '$1', $value->value);
//$value->value = preg_replace('/(.*?)\s*[selected=?selected?]/', '$1', $value->value);
//$value->value = preg_replace('/(.*?)\s*selected="selected"\s*/', '${1}', $value->value);
//$value->value = preg_replace('/(.*?)\s*selected="selected"\s*/', '$[1]', $value->value);
//$value->value = preg_replace('/^\s*selected=.*?selected.*?\s*/', ' ', $value->value);
//$value->value = str_replace('selected=', '', $value->value);
+1 -1
View File
@@ -1532,7 +1532,7 @@ class WavFile
} else {
// replace
for ($i = 0; $i < $sampleBytes; ++$i) {
$this->_samples{$offset + $i} = $sampleBinary{$i};
$this->_samples[$offset + $i] = $sampleBinary[$i];
}
}
+1 -1
View File
@@ -1435,7 +1435,7 @@ class Securimage
$length = strlen($code['display']);
for($i = 0; $i < $length; ++$i) {
$letter = $code['display']{$i};
$letter = $code['display'][$i];
$letters[] = $letter;
}
}
+2 -1
View File
@@ -407,6 +407,7 @@ html {
background-color: var(--fhc-background);
border-color: var(--fhc-border);
padding: var(--fhc-cis-main-py) var(--fhc-cis-main-px);
min-width: 0; /* fix flex-grow with tabulator exceeding width */
}
#cis-main .fa-arrow-up-right-from-square {
@@ -854,4 +855,4 @@ html {
#cis-main .modal-footer {
background-color: var(--fhc-secondary);
}
}
+39
View File
@@ -0,0 +1,39 @@
/* Repositioning clear icon Datepicker for not being outside the textfield */
/* Wrapper */
.dp__input_wrap {
position: relative;
}
/* calender-Icon left */
.dp__input_icon {
position: absolute;
left: 10px;
right: auto;
top: 50%;
transform: translateY(-50%);
}
/* Clear-Icon right */
.dp__clear_icon {
position: absolute;
right: 10px;
left: auto;
top: 50%;
transform: translateY(-50%);
}
/* padding for Icons */
.dp__input {
padding-left: 36px !important;
padding-right: 36px !important;
}
.info-feedback {
display: block;
font-size: 0.875em;
color: #0d6efd; /* Bootstrap primary */
}
.is-info {
border-color: #0d6efd;
}
+25 -1
View File
@@ -11,6 +11,24 @@
html {
font-size: .875em;
}
html.fs_xx-small {
font-size: .5em;
}
html.fs_x-small {
font-size: .625em;
}
html.fs_small {
font-size: .75em;
}
html.fs_normal {
font-size: .875em;
}
html.fs_big {
font-size: 1em;
}
html.fs_huge {
font-size: 1.125em;
}
#appMenu {
width: 300px;
@@ -43,6 +61,12 @@ html {
flex: 1 1 auto;
}
#nav-user-btn img {
object-fit: contain;
height: 2.5rem;
width: 2.5rem;
}
.tabulator-row.disabled.tabulator-row-odd .tabulator-cell {
color: var(--gray-400);
}
@@ -160,4 +184,4 @@ html {
.tiny-90 div.tox.tox-tinymce {
height: 90% !important;
}
}
+4
View File
@@ -16,11 +16,15 @@
padding: .5rem 1rem;
text-decoration: none;
}
.fhc-app-menu li a.disabled {
--bs-link-opacity: .5;
}
.fhc-app-menu li a.active,
.fhc-app-menu li a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
background: var(--surface-hover);
}
.fhc-app-menu li a.disabled,
.fhc-app-menu li a.active {
pointer-events: none;
}
+70
View File
@@ -0,0 +1,70 @@
/**
* Copyright (C) 2026 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 {
getTimelocksUser(uid) {
return {
method: 'get',
url: '/api/frontend/v1/Zeitsperren/getZeitsperrenUser/' + uid
};
},
getTypenZeitsperren(){
return {
method: 'get',
url: '/api/frontend/v1/Zeitsperren/getTypenZeitsperren/'
};
},
getTypenErreichbarkeit(){
return {
method: 'get',
url: '/api/frontend/v1/Zeitsperren/getTypenErreichbarkeit/'
};
},
getStunden(){
return {
method: 'get',
url: '/api/frontend/v1/Zeitsperren/getStunden/'
};
},
addZeitsperre(uid, params) {
return {
method: 'post',
url: '/api/frontend/v1/Zeitsperren/add/' + uid,
params
};
},
editZeitsperre(zeitsperre_id, params) {
return {
method: 'post',
url: '/api/frontend/v1/Zeitsperren/update/' + zeitsperre_id,
params
};
},
loadZeitsperre(zeitsperre_id) {
return {
method: 'get',
url: '/api/frontend/v1/Zeitsperren/loadZeitsperre/' + zeitsperre_id
};
},
deleteZeitsperre(zeitsperre_id) {
return {
method: 'post',
url: '/api/frontend/v1/Zeitsperren/delete/' + zeitsperre_id
};
}
};
+17 -27
View File
@@ -38,16 +38,18 @@ export default {
url: 'api/frontend/v1/messages/messages/getMsgVarsLoggedInUser/'
};
},
getMessageVarsPerson(userParams){
getMessageVarsPerson(ids, type_id){
return {
method: 'post',
url: 'api/frontend/v1/messages/messages/getMessageVarsPerson/' + userParams.id + '/' + userParams.type_id
url: 'api/frontend/v1/messages/messages/getMessageVarsPerson/' + type_id,
params: {ids}
};
},
getMsgVarsPrestudent(userParams){
getMsgVarsPrestudent(ids, type_id){
return {
method: 'post',
url: 'api/frontend/v1/messages/messages/getMsgVarsPrestudent/' + userParams.id + '/' + userParams.type_id
url: 'api/frontend/v1/messages/messages/getMsgVarsPrestudent/' + type_id,
params: {ids}
};
},
getPersonId(params){
@@ -56,28 +58,23 @@ export default {
url: 'api/frontend/v1/messages/messages/getPersonId/' + params.id + '/' + params.type_id
};
},
getUid(userParams){
return {
method: 'get',
url: 'api/frontend/v1/messages/messages/getUid/' + userParams.id + '/' + userParams.type_id
};
},
getDataVorlage(vorlage_kurzbz){
return {
method: 'get',
url: 'api/frontend/v1/messages/messages/getDataVorlage/' + vorlage_kurzbz
};
},
getNameOfDefaultRecipient(params){
return {
method: 'get',
url: 'api/frontend/v1/messages/messages/getNameOfDefaultRecipient/' + params.id + '/' + params.type_id
};
},
getPreviewText(userParams, params){
getNameOfDefaultRecipients(ids, type_id){
return {
method: 'post',
url: 'api/frontend/v1/messages/messages/getPreviewText/' + userParams.id + '/' + userParams.type_id,
url: 'api/frontend/v1/messages/messages/getNameOfDefaultRecipients/' + type_id,
params: {ids}
};
},
getPreviewText(type_id, params){
return {
method: 'post',
url: 'api/frontend/v1/messages/messages/getPreviewText/' + type_id,
params
};
},
@@ -87,17 +84,10 @@ export default {
url: 'api/frontend/v1/messages/messages/getReplyData/' + messageId
};
},
sendMessageFromModalContext(id, params) {
sendMessage(type_id, params) {
return {
method: 'post',
url: 'api/frontend/v1/messages/messages/sendMessage/' + id,
params
};
},
sendMessage(id, params) {
return {
method: 'post',
url: 'api/frontend/v1/messages/messages/sendMessage/' + id,
url: 'api/frontend/v1/messages/messages/sendMessage/' + type_id,
params
};
},
+11
View File
@@ -0,0 +1,11 @@
export default {
getStudienplaeneBySemester(studiengang_kz, studiensemester_kurzbz, ausbildungssemester, orgform_kurzbz)
{
return {
method: 'get',
url: 'api/frontend/v1/organisation/studienplan/getBySemester',
params: { studiengang_kz, studiensemester_kurzbz, ausbildungssemester, orgform_kurzbz },
};
}
}
+11
View File
@@ -0,0 +1,11 @@
export default {
getAll(order = null, start = null)
{
return {
method: 'get',
url: 'api/frontend/v1/organisation/studiensemester/getAll',
params: { order, start }
};
}
}
+32
View File
@@ -0,0 +1,32 @@
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
get() {
return {
method: 'get',
url: 'api/frontend/v1/stv/config/get'
};
},
set(params) {
return {
method: 'post',
url: 'api/frontend/v1/stv/config/set',
params
};
}
};
+1 -1
View File
@@ -101,7 +101,7 @@ export default {
deleteMobilityPurpose(params) {
return {
method: 'post',
url: 'api/frontend/v1/stv/mobility/deleteMobilityPurpose/',
url: 'api/frontend/v1/stv/mobility/deleteMobilityPurpose/' + params.bisio_id,
params
};
},
@@ -49,6 +49,12 @@ export default {
url: 'api/frontend/v1/stv/projektarbeit/getNoten'
};
},
getStudiensemester() {
return {
method: 'get',
url: 'api/frontend/v1/stv/projektarbeit/getStudiensemester'
};
},
loadProjektarbeit(projektarbeit_id) {
return {
method: 'get',
+10 -2
View File
@@ -46,16 +46,24 @@ export default {
url: url
};
},
search(params, studiensemester_kurzbz) {
return {
method: 'post',
url: 'api/frontend/v1/stv/students/search/'
+ encodeURIComponent(studiensemester_kurzbz),
params
};
},
verband(relative_path) {
return {
method: 'get',
url: 'api/frontend/v1/stv/students/' + relative_path
};
},
check(params) {
getPerson(params) {
return {
method: 'post',
url: 'api/frontend/v1/stv/student/check',
url: 'api/frontend/v1/stv/student/getPerson',
params
};
},
+7
View File
@@ -16,6 +16,7 @@ import AbgabetoolStudent from "../../components/Cis/Abgabetool/AbgabetoolStudent
import AbgabetoolMitarbeiter from "../../components/Cis/Abgabetool/AbgabetoolMitarbeiter.js";
import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.js";
import Studium from "../../components/Cis/Studium/Studium.js";
import Zeitsperren from "../../components/Cis/Zeitsperren/Zeitsperren.js";
import ApiRenderers from '../../api/factory/renderers.js';
import ApiRouteInfo from '../../api/factory/routeinfo.js';
@@ -216,6 +217,12 @@ const router = VueRouter.createRouter({
};
},
},
{
path: `/Cis/Zeitsperren`,
name: 'Zeitsperren',
component: Zeitsperren,
props: true
},
]
})
+4 -3
View File
@@ -1,14 +1,15 @@
import NewMessage from "../components/Messages/Details/NewMessage/NewDiv.js";
import Phrasen from "../plugin/Phrasen.js";
import Phrasen from "../plugins/Phrasen.js";
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
const router = VueRouter.createRouter({
history: VueRouter.createWebHistory(),
routes: [
{ path: `/${ciPath}/NeueNachricht/:id/:typeId`, component: NewMessage },
{ path: `/${ciPath}/NeueNachricht/:id/:typeId/:messageId`, component: NewMessage },
{ path: `/${ciPath}/NeueNachricht`, component: NewMessage, props: true },
{ path: `/${ciPath}/NeueNachricht/:id/:typeId`, component: NewMessage, props: true },
{ path: `/${ciPath}/NeueNachricht/:id/:typeId/:messageId`, component: NewMessage, props: true },
]
});
+38
View File
@@ -148,6 +148,44 @@ const router = VueRouter.createRouter({
next();
}
},
{
name: 'search',
path: `/${ciPath}/studentenverwaltung/:studiensemester_kurzbz/search/:searchstr`,
component: FhcStudentenverwaltung,
props(route) {
return {
url_studiensemester_kurzbz: route.params.studiensemester_kurzbz,
url_mode: 'search',
url_prestudent_id: route.params.searchstr
};
},
beforeEnter(to, from, next) {
const isSemester = /^[WS]S\d{4}$/.test(to.params.studiensemester_kurzbz);
if (!isSemester) {
return next({name: 'index'});
}
next();
}
},
{
name: 'search_w_types',
path: `/${ciPath}/studentenverwaltung/:studiensemester_kurzbz/search/:types/:searchstr`,
component: FhcStudentenverwaltung,
props(route) {
return {
url_studiensemester_kurzbz: route.params.studiensemester_kurzbz,
url_mode: 'search',
url_prestudent_id: route.params.type + '/' + route.params.searchstr
};
},
beforeEnter(to, from, next) {
const isSemester = /^[WS]S\d{4}$/.test(to.params.studiensemester_kurzbz);
if (!isSemester) {
return next({name: 'index'});
}
next();
}
},
{
path: '/:pathMatch(.*)*',
redirect: {
+135
View File
@@ -0,0 +1,135 @@
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import BsModal from "./Bootstrap/Modal.js";
import FhcForm from "./Form/Form.js";
import FormInput from "./Form/Input.js";
export default {
name: 'AppConfig',
components: {
BsModal,
FhcForm,
FormInput
},
emits: [
'update:modelValue'
],
props: {
modelValue: {
type: Object,
required: true
},
endpoints: {
type: Object,
required: true
}
},
data() {
return {
setup: {},
tempValues: {}
};
},
watch: {
'$p.user_language.value'(n, o) {
if (n !== o && o !== undefined && Object.keys(this.setup).length) {
this.$api
.call(this.endpoints.get())
.then(res => {
this.setup = {};
Object.keys(res.data).forEach(key => {
const binding = { ...res.data[key] };
delete binding.value;
delete binding.options;
const options = res.data[key].options;
this.setup[key] = {
binding,
options
};
});
})
.catch(this.$fhcAlert.handleSystemErrors);
}
}
},
methods: {
update() {
this.$refs.form
.call(this.endpoints.set(this.tempValues))
.then(() => {
this.$emit('update:modelValue', { ...this.tempValues });
this.$refs.modal.hide();
this.$fhcAlert.alertSuccess(this.$p.t('ui/settings_saved'));
})
.catch(this.$fhcAlert.handleSystemErrors);
}
},
created() {
this.$api
.call(this.endpoints.get())
.then(res => {
Object.keys(res.data).forEach(key => {
const binding = { ...res.data[key] };
delete binding.value;
delete binding.options;
const options = res.data[key].options;
this.tempValues[key] = res.data[key].value;
this.setup[key] = {
binding,
options
};
});
this.$emit('update:modelValue', { ...this.tempValues });
})
.catch(this.$fhcAlert.handleSystemErrors);
},
template: /* html */`
<fhc-form class="stv-config" ref="form" @submit.prevent="update">
<bs-modal
ref="modal"
class="fade"
id="configModal"
dialog-class="modal-lg"
@hidden-bs-modal="tempValues = { ...modelValue }"
>
<template #title>{{ $p.t('ui/settings') }}</template>
<template #default>
<div class="d-flex flex-column gap-5">
<form-input
v-for="(value, key) in setup"
v-model="tempValues[key]"
v-bind="value.binding"
>
<option
v-for="(label, val) in value.options"
:key="val"
:value="val"
>{{ label }}</option>
</form-input>
</div>
</template>
<template #footer>
<button class="btn btn-primary" type="submit">
{{ $p.t('ui/speichern') }}
</button>
</template>
</bs-modal>
</fhc-form>`
};
+1
View File
@@ -64,5 +64,6 @@ export default {
{{ menu.description }}
</a>
</li>
<slot />
</ul>`
};
+1 -1
View File
@@ -316,7 +316,7 @@ export default {
template: /* html */`
<div
class="fhc-calendar-base-grid"
style="display:grid;width:100%;height:100%"
style="display:grid;width:100%;height:100%;overflow:auto"
:style="'grid-template-' + axisRow + 's:auto' + (allDayEvents ? ' auto ' : ' ') + '1fr;grid-template-' + axisCol + 's:auto ' + styleGridCols"
>
<div
@@ -46,7 +46,6 @@ export default {
loading: false,
filter: "Pending",
profil_update_id: Number(this.id),
};
},
computed: {
@@ -60,6 +59,10 @@ export default {
},
profilUpdateOptions: function () {
return {
persistence: {
columns: ["width", "visible", "frozen"],
},
persistenceID: 'cis-profilupdate-2025121702',
ajaxURL: 'dummy',
ajaxRequestFunc: (url, config, params) => {
return this.$api.call(ApiProfilUpdate.getProfilUpdateWithPermission(params.filter));
@@ -205,7 +208,7 @@ export default {
//responsive:0,
},
{
title: this.$p.t("lehre", "studiengang") + ' (' + this.$p.t("profil", "studentIn") + ')',
title: this.$p.t("profil", "stg_short") + ' (' + this.$p.t("profil", "studentIn") + ')',
field: "studiengang",
minWidth: 50,
resizable: true,
@@ -213,8 +216,14 @@ export default {
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
//responsive:0,
},
{
title: this.$p.t("lehre", "organisationsform") + ' (' + this.$p.t("profil", "studentIn") + ')',
{
title: this.$p.t("profil", "sem_short") + ' (' + this.$p.t("profil", "studentIn") + ')',
field: "semester",
headerFilter: "list",
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}
},
{
title: this.$p.t("profil", "orgform_short") + ' (' + this.$p.t("profil", "studentIn") + ')',
field: "orgform",
minWidth: 50,
resizable: true,
@@ -222,8 +231,8 @@ export default {
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
//responsive:0,
},
{
title: this.$p.t("lehre", "organisationseinheit") + ' (' + this.$p.t("profil", "mitarbeiterIn") + ')',
{
title: this.$p.t("profil", "orgeinheit_short") + ' (' + this.$p.t("profil", "mitarbeiterIn") + ')',
field: "oezuordnung",
minWidth: 200,
resizable: true,
@@ -231,7 +240,7 @@ export default {
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
//responsive:0,
},
{
{
title: this.$p.t("profilUpdate", "Topic"),
field: "topic",
resizable: true,
@@ -240,7 +249,7 @@ export default {
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
//responsive:0,
},
{
{
title: this.$p.t("profilUpdate", "insertamum"),
field: "insertamum_iso",
resizable: true,
@@ -251,7 +260,7 @@ export default {
formatterParams: this.datetimeFormatterParams(),
//responsive:0,
},
{
{
title: this.$p.t("profilUpdate", "Status"),
field: "status_translated",
hozAlign: "center",
@@ -273,7 +282,6 @@ export default {
}
return `<div class='row justify-content-center'><div class='col-2'><i class='${iconClasses}'></i></div> <div class='col-4'><span>${cell.getValue()}</span></div></div>`;
},
resizable: true,
minWidth: 200,
//responsive:0,
@@ -309,7 +317,6 @@ export default {
],
};
}
},
methods: {
denyProfilUpdate: function (data) {
@@ -351,7 +358,6 @@ export default {
this.showModal = false;
this.modalData = null;
},
showAcceptDenyModal(value) {
this.modalData = value;
if (!this.modalData) {
@@ -364,7 +370,6 @@ export default {
this.$refs.AcceptDenyModal.show();
});
},
updateData: function (event) {
this.$refs.UpdatesTable.tabulator.setData();
//? store the selected view in the session storage of the browser
@@ -415,22 +420,30 @@ export default {
},
template: /*html*/ `
<div>
<accept-deny-update :title="$p.t('profilUpdate','profilUpdateRequest')" v-if="showModal" ref="AcceptDenyModal" @hideBsModal="hideAcceptDenyModal" :value="JSON.parse(JSON.stringify(modalData))" :setLoading="setLoading" ></accept-deny-update>
<div class="form-underline flex-fill ">
<div class="form-underline-titel">{{$p.t('ui','anzeigen')}} </div>
<select class="mb-4 form-select" v-model="filter" @change="updateData" aria-label="Profil updates display selection">
<option :selected="true" :value="profilUpdateStates['Pending']" >{{$p.t('profilUpdate','pendingRequests')}}</option>
<option :value="profilUpdateStates['Accepted']">{{$p.t('profilUpdate','acceptedRequests')}}</option>
<option :value="profilUpdateStates['Rejected']">{{$p.t('profilUpdate','rejectedRequests')}}</option>
<option :value="'Alle'">{{$p.t('profilUpdate','allRequests')}}</option>
</select>
</div>
<loading ref="loadingModalRef" :timeout="0"></loading>
<core-filter-cmpt v-if="profilUpdateStates && categoryLoaded" :title="$p.t('profilUpdate','profilUpdateRequests')" ref="UpdatesTable" :tabulatorEvents="profilUpdateEvents" :tabulator-options="profilUpdateOptions" tableOnly :sideMenu="false" />
<accept-deny-update :title="$p.t('profilUpdate','profilUpdateRequest')" v-if="showModal" ref="AcceptDenyModal" @hideBsModal="hideAcceptDenyModal" :value="JSON.parse(JSON.stringify(modalData))" :setLoading="setLoading" ></accept-deny-update>
<h3>{{$p.t('profilUpdate', 'profilUpdateRequests')}}</h3>
<loading ref="loadingModalRef" :timeout="0"></loading>
</div>`,
<core-filter-cmpt
v-if="profilUpdateStates && categoryLoaded"
ref="UpdatesTable"
:tabulatorEvents="profilUpdateEvents"
:tabulator-options="profilUpdateOptions"
table-only
:sideMenu="false">
<template #actions>
<div style="width: 94vw;" class="d-flex justify-content-end">
<div>
<select class="mb-4 form-select" v-model="filter" @change="updateData" aria-label="Profil updates display selection">
<option :selected="true" :value="profilUpdateStates['Pending']" >{{$p.t('profilUpdate','pendingRequests')}}</option>
<option :value="profilUpdateStates['Accepted']">{{$p.t('profilUpdate','acceptedRequests')}}</option>
<option :value="profilUpdateStates['Rejected']">{{$p.t('profilUpdate','rejectedRequests')}}</option>
<option :value="'Alle'">{{$p.t('profilUpdate','allRequests')}}</option>
</select>
</div>
</div>
</template>
</core-filter-cmpt>
</div>`,
};
@@ -0,0 +1,673 @@
import {CoreFilterCmpt} from "../../filter/Filter.js";
import FormForm from '../../Form/Form.js';
import FormInput from '../../Form/Input.js';
import PvAutoComplete from '../../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js';
import ApiAuthinfo from '../../../api/factory/authinfo.js';
import ApiTimelocks from "../../../api/factory/cis/zeitsperren.js";
import ApiStvAbschlusspruefung from "../../../api/factory/stv/abschlusspruefung.js";
export default {
name: 'ZeitsperrenComponent',
components: {
CoreFilterCmpt,
FormForm,
FormInput,
PvAutoComplete
},
data(){
return {
uid: null,
statusNew: true,
timeRecordingLockedUntil: '2015-08-31', //TODO(Manu) check if needed
typesTimeLocks: ["Urlaub", "PflegeU", "ZA", "Krank", "DienstF", "DienstV", "CovidSB", "CovidKS"],
typesHideStunden: ["Urlaub", "ZA", "Krank", "DienstF", "DienstV", "CovidSB", "CovidKS"],
listTypenZeitsperren: [],
listTypenErreichbarkeit: [],
listStunden: [],
tabulatorOptions: null,
tabulatorEvents: [],
originalData: {},
zeitsperreData: {
vondatum : new Date(),
bisdatum: new Date(),
vonISO : "00:00:00", //later
bisISO: "23:59:59", //later
erreichbarkeit_kurzbz: 'n',
zeitsperretyp_kurzbz: 'Arzt',
vonstunde: null,
bisstunde: null
},
changedData: {},
selectedVertretung: null,
filteredMitarbeiter: [],
abortController: {
mitarbeiter: null
},
};
},
computed: {
dienstverhinderungen() {
return {
"Eheschließung": "a) " + this.$p.t('zeitsperren', 'eheschliessung'),
"Geburt eigenes Kind": "b) " + this.$p.t('zeitsperren', 'geburt'),
"Heirat Kind/Geschwister": "c) " + this.$p.t('zeitsperren', 'heirat'),
"Eigene Sponsion/Promotion": "d) " + this.$p.t('zeitsperren', 'sponsion'),
"Lebensbedr. Erkrankung P/K/E": "e) " + this.$p.t('zeitsperren', 'erkrankung_lebensbedr'),
"Ableben P/K/E": "f) " + this.$p.t('zeitsperren', 'ableben'),
"Bestattung G/S/G": "g) " + this.$p.t('zeitsperren', 'bestattung'),
"Wohnungswechsel": "h) " + this.$p.t('zeitsperren', 'umzug'),
"Bundesheer": "i) " + this.$p.t('zeitsperren', 'bundesheer'),
"Volksschultag": "j) " + this.$p.t('zeitsperren', 'volksschultag')};
},
showInfo(){
return this.zeitsperreData.zeitsperretyp_kurzbz === 'DienstF';
},
},
methods: {
actionEditZeitsperre(zeitsperre_id){
this.statusNew = false;
return this.$api
.call(ApiTimelocks.loadZeitsperre(zeitsperre_id))
.then(response => {
this.originalData = structuredClone(response.data);
this.zeitsperreData = structuredClone(response.data);
this.selectedVertretung = {
label: this.getPersonLabel(this.zeitsperreData.ma_titelpre, this.zeitsperreData.ma_nachname, this.zeitsperreData.ma_vorname, this.zeitsperreData.ma_titelpost, this.zeitsperreData.vertretung_uid),
person_id: this.zeitsperreData.ma_person_id,
mitarbeiter_uid: this.zeitsperreData.vertretung_uid
};
})
.catch(this.$fhcAlert.handleSystemError);
},
actionDeleteZeitsperre(zeitsperre_id){
this.$fhcAlert
.confirmDelete()
.then(result => result
? zeitsperre_id
: Promise.reject({ handled: true })
)
.then(() => this.deleteZeitsperre(zeitsperre_id))
.catch(this.$fhcAlert.handleSystemError);
},
saveZeitsperre(zeitsperreId = null) {
const isNew = !zeitsperreId;
let payload = isNew
? { ...this.zeitsperreData } // add
: this.getChangedFields(this.originalData, // edit
this.zeitsperreData);
if (!isNew && Object.keys(payload).length === 0) {
return Promise.resolve();
}
const request = isNew
? ApiTimelocks.addZeitsperre(this.uid, payload)
: ApiTimelocks.editZeitsperre(zeitsperreId, payload);
return this.$refs.dataZeitsperre
.call(request)
.then(() => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.reset();
this.reload();
})
.catch(this.$fhcAlert.handleSystemError);
},
deleteZeitsperre(zeitsperre_id){
return this.$api
.call(ApiTimelocks.deleteZeitsperre(zeitsperre_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
})
.catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
this.reload();
});
},
searchMitarbeiter(event) {
if (this.abortController.mitarbeiter) {
this.abortController.mitarbeiter.abort();
}
this.abortController.mitarbeiter = new AbortController();
return this.$api
.call(ApiStvAbschlusspruefung.getMitarbeiter(event.query))
.then(result => {
this.filteredMitarbeiter = [];
for (let mitarbeiter of result.data.retval) {
this.filteredMitarbeiter.push(
{
label: this.getPersonLabel(
mitarbeiter.titelpre,
mitarbeiter.nachname,
mitarbeiter.vorname,
mitarbeiter.titelpost,
mitarbeiter.mitarbeiter_uid
),
person_id: mitarbeiter.person_id,
mitarbeiter_uid: mitarbeiter.mitarbeiter_uid
}
);
}
});
},
getPersonLabel(titelpre, nachname, vorname, titelpost, uid) {
if(!uid)
return '';
return nachname + ' ' + vorname + (titelpre ? ' ' + titelpre : '') + (titelpost ? ' ' + titelpost : '') + (uid ? ' (' + uid + ')' : '');
},
reload() {
if (this.$refs.table)
this.$refs.table.reloadTable();
},
reset(){
this.statusNew = true;
this.selectedVertretung = null;
this.zeitsperreData = {
vondatum : new Date(),
bisdatum: new Date(),
vonISO : "00:00:00", //later
bisISO: "23:59:59", //later
erreichbarkeit_kurzbz: 'n',
zeitsperretyp_kurzbz: 'Arzt',
vonstunde: null,
bisstunde: null
};
this.originalData = {};
},
handleChangeVonStunde(){
let stunde = this.zeitsperreData.vonstunde;
const result = this.listStunden.find(item => item.stunde === stunde);
if (!result) {
this.zeitsperreData.vonISO = '00:00:00';
return;
}
this.zeitsperreData.vonISO = result.beginn;
},
handleChangeBisStunde(){
let stunde = this.zeitsperreData.bisstunde;
const result = this.listStunden.find(item => item.stunde === stunde);
if (!result) {
this.zeitsperreData.bisISO = '23:59:59';
return;
}
this.zeitsperreData.bisISO = result.ende;
},
handleStunden(){
if (this.typesHideStunden.includes(this.zeitsperreData.zeitsperretyp_kurzbz)){
this.zeitsperreData.vonstunde = null;
this.zeitsperreData.bisstunde = null;
this.zeitsperreData.vonISO = '00:00:00';
this.zeitsperreData.bisISO = '23:59:59';
}
},
copyDateForBis(){
this.zeitsperreData.bisdatum = this.zeitsperreData.vondatum;
},
getChangedFields(original, current) {
const diff = {};
Object.keys(current).forEach((key) => {
if (current[key] !== original[key]) {
diff[key] = current[key];
}
});
return diff;
},
},
watch: {
selectedVertretung(newVal) {
this.zeitsperreData.vertretung_uid = newVal?.mitarbeiter_uid || null;
},
'zeitsperreData.zeitsperretyp_kurzbz'(newVal) {
if (newVal === 'DienstV') {
// set first key as default
if (!this.zeitsperreData.bezeichnung) {
const firstKey = Object.keys(this.dienstverhinderungen)[0];
this.zeitsperreData.bezeichnung = firstKey;
}
} else {
this.zeitsperreData.bezeichnung = '';
}
}
},
created() {
this.$api.call(ApiAuthinfo.getAuthUID()).then(res => {
//check if there is a user, passed via route
const urlUid = this.$route?.query?.uid;
this.uid = urlUid ? urlUid : res.data.uid;
this.tabulatorOptions = {
ajaxURL: 'dummy',
ajaxRequestFunc: () =>
this.$api.call(ApiTimelocks.getTimelocksUser(this.uid)),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title:"bezeichnung", field:"bezeichnung"},
{title:"Grund", field:"beschreibung"},
{title:"Von", field:"vondatum",
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
const date = new Date(dateStr);
return date.toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
}
},
{title:"Bis", field:"bisdatum",
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
const date = new Date(dateStr);
return date.toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
}
},
{title:"vonstunde", field:"vonstunde", visible: false},
{title:"bisstunde", field:"bisstunde", visible: false},
{title:"Vertretung", field:"vertretung"},
{title:"Erreichbarkeit", field:"erreichbarkeit_beschreibung"},
{title:"zeitsperre_id", field:"zeitsperre_id", visible: false},
{title:"mitarbeiter_uid", field:"mitarbeiter_uid", visible: false},
{title:"freigabeamum", field:"freigabeamum", visible: false,
formatter: function (cell) {
const value = cell.getValue();
return value === null
? ''
: '<i class="fa fa-check text-success"></i>';
}
},
{title: 'Aktionen', field: 'actions',
minWidth: 150, // Ensures Action-buttons will be always fully displayed
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-edit"></i>';
button.title = this.$p.t('ui', 'bearbeiten');
button.addEventListener('click', (event) =>
this.actionEditZeitsperre(cell.getData().zeitsperre_id)
);
if(cell.getData().zeitsperretyp_kurzbz == 'DienstV' || cell.getData().zeitsperretyp_kurzbz == 'ZVerfueg'){
button.disabled = true;
}
//TODO(Manu) check if needed
if(this.typesTimeLocks.includes(cell.getData().zeitsperretyp_kurzbz) && (cell.getData().vondatum < this.timeRecordingLockedUntil)){
button.disabled = true;
}
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 = this.$p.t('ui', 'loeschen');
button.addEventListener('click', () =>
//this.deleteZeitsperre(cell.getData().zeitsperre_id)
this.actionDeleteZeitsperre(cell.getData().zeitsperre_id)
);
if(cell.getData().zeitsperretyp_kurzbz == 'Urlaub' || cell.getData().zeitsperretyp_kurzbz == 'ZVerfueg'){
button.disabled = true;
}
//TODO(Manu) check if needed
if(this.typesTimeLocks.includes(cell.getData().zeitsperretyp_kurzbz) && (cell.getData().vondatum < this.timeRecordingLockedUntil)){
button.disabled = true;
}
container.append(button);
return container;
},
frozen: true
},
]
};
this.tabulatorEvents = [
{
event: 'tableBuilt',
handler: async() => {
await this.$p.loadCategory(['global', 'person', 'zeitsperren', 'ui', 'abschlusspruefung']);
let cm = this.$refs.table.tabulator.columnManager;
cm.getColumnByField('bezeichnung').component.updateDefinition({
title: this.$p.t('person', 'grund')
});
cm.getColumnByField('beschreibung').component.updateDefinition({
title: this.$p.t('global', 'bezeichnung')
});
cm.getColumnByField('vondatum').component.updateDefinition({
title: this.$p.t('ui', 'von')
});
cm.getColumnByField('bisdatum').component.updateDefinition({
title: this.$p.t('global', 'bis')
});
cm.getColumnByField('vonstunde').component.updateDefinition({
title: this.$p.t('zeitsperren', 'stunde_von')
});
cm.getColumnByField('bisstunde').component.updateDefinition({
title: this.$p.t('zeitsperren', 'stunde_bis')
});
cm.getColumnByField('vertretung').component.updateDefinition({
title: this.$p.t('person', 'vertretung')
});
cm.getColumnByField('erreichbarkeit_beschreibung').component.updateDefinition({
title: this.$p.t('person', 'erreichbarkeit')
});
cm.getColumnByField('freigabeamum').component.updateDefinition({
title: this.$p.t('abschlusspruefung', 'freigabe')
});
/* cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});*/
}
}
];
});
this.$api
.call(ApiTimelocks.getTypenZeitsperren())
.then(result => {
this.listTypenZeitsperren = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiTimelocks.getTypenErreichbarkeit())
.then(result => {
this.listTypenErreichbarkeit = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiTimelocks.getStunden())
.then(result => {
this.listStunden = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
template: /* html */`
<div class="zeitsperre">
<h4>{{$p.t('zeitsperren', 'header_zeitsperren')}} ({{uid}}) </h4>
<form-form class="row g-3 mt-3" ref="dataZeitsperre">
<div class= "w-50">
<div class="row mb-3">
<form-input
type="select"
:class="showInfo ? 'is-info' : ''"
name="zeitsperretyp_kurzbz"
:label="$p.t('person/grund')"
v-model="zeitsperreData.zeitsperretyp_kurzbz"
@change="handleStunden"
>
<option
v-for="typ in listTypenZeitsperren"
:key="typ.zeitsperretyp_kurzbz"
:value="typ.zeitsperretyp_kurzbz"
:disabled="typ.zeitsperretyp_kurzbz == 'Urlaub'"
>
{{typ.beschreibung}}
</option>
</form-input>
<div v-if="showInfo" class="info-feedback">
<strong> Dienstfreistellungen</strong> nur in Absprache mit HR Service eintragen!
</div>
</div>
<div v-if="zeitsperreData.zeitsperretyp_kurzbz == 'DienstV'" class="row mb-3">
<form-input
type="select"
name="beschreibung"
:label="$p.t('ui/bezeichnung')"
v-model="zeitsperreData.bezeichnung"
>
<option v-for="(beschreibung, key) in dienstverhinderungen"
:key="key"
:value="key">{{beschreibung}}
</option>
</form-input>
</div>
<div v-else class="row mb-3">
<form-input
type="text"
name="beschreibung"
:label="$p.t('ui/bezeichnung')"
v-model="zeitsperreData.bezeichnung"
>
</form-input>
</div>
</div>
<div>
<div class="row">
<div class="mb-3 col-2">
<form-input
type="DatePicker"
name="vondatum"
:label="$p.t('ui/from')"
v-model="zeitsperreData.vondatum"
auto-apply
:enable-time-picker="false"
format="dd.MM.yyyy"
text-input
preview-format="dd.MM.yyyy"
:teleport="true"
required
>
</form-input>
</div>
<div class="mb-3 col-1 d-flex align-items-end">
<button
class="btn btn-outline-secondary"
title="Für Bis-Datum übernehmen"
@click.prevent="copyDateForBis"
>
<i class="fa-solid fa-arrow-down"></i>
</button>
</div>
<div class="mb-3 col-3">
<form-input
v-if="!typesHideStunden.includes(zeitsperreData.zeitsperretyp_kurzbz)"
type="select"
name="vonstunde"
:label="$p.t('zeitsperren/stunde')"
v-model="zeitsperreData.vonstunde"
@change="handleChangeVonStunde"
>
<option value='null'>*</option>
<option
v-for="std in listStunden"
:key="std.stunde"
:value="std.stunde"
>
{{std.stunde}} ({{std.beginn}} - {{std.ende}})
</option>
</form-input>
</div>
<!-- Uncomment to use timestamp VON
<div class="mb-3 col-3">
<form-input
type="text"
name="vonISO"
label="vonISO"
v-model="zeitsperreData.vonISO"
auto-apply
:enable-time-picker="true"
format="dd.MM.yyyy HH:mm"
text-input
preview-format="dd.MM.yyyy HH:mm"
:teleport="true"
>
{{timestampHoursVon}}
</form-input>
</div>
-->
</div>
<div class="row">
<div class="mb-3 col-2">
<form-input
type="DatePicker"
name="bisdatum"
:label="$p.t('global/bis')"
v-model="zeitsperreData.bisdatum"
auto-apply
:enable-time-picker="false"
format="dd.MM.yyyy"
text-input
preview-format="dd.MM.yyyy"
:teleport="true"
required
>
</form-input>
</div>
<div class="mb-3 col-1"></div>
<div class="mb-3 col-3">
<form-input
v-if="!typesHideStunden.includes(zeitsperreData.zeitsperretyp_kurzbz)"
type="select"
name="bisstunde"
:label="$p.t('zeitsperren/stunde')"
v-model="zeitsperreData.bisstunde"
@change="handleChangeBisStunde"
>
<option value='null'>*</option>
<option
v-for="std in listStunden"
:key="std.stunde"
:value="std.stunde"
>
{{std.stunde}} ({{std.beginn}} - {{std.ende}})
</option>
</form-input>
</div>
<!-- Uncomment to use timestamp BIS
<div class="mb-3 col-3">
<form-input
type="text"
name="bisISO"
label="bisISO"
v-model="zeitsperreData.bisISO"
auto-apply
:enable-time-picker="true"
format="dd.MM.yyyy HH:mm"
text-input
preview-format="dd.MM.yyyy HH:mm"
:teleport="true"
>
</form-input>
</div>
-->
</div>
<div class= "w-50">
<div class="row mb-3">
<form-input
type="autocomplete"
name="vertretung_uid"
:label="$p.t('person/vertretung')"
v-model="selectedVertretung"
optionLabel="label"
optionValue="mitarbeiter_uid"
dropdown
forceSelection
:suggestions="filteredMitarbeiter"
@complete="searchMitarbeiter"
:min-length="3"
>
</form-input>
</div>
</div>
<div class="row align-items-end">
<div class="mb-3 col-4">
<form-input
type="select"
name="erreichbarkeit"
:label="$p.t('person/erreichbarkeit')"
v-model="zeitsperreData.erreichbarkeit_kurzbz"
>
<option
v-for="typ in listTypenErreichbarkeit"
:key="typ.erreichbarkeit_kurzbz"
:value="typ.erreichbarkeit_kurzbz"
>
{{typ.beschreibung}}
</option>
</form-input>
</div>
<div class="mb-3 col-3">
<button
v-if="statusNew"
type="button"
class="btn btn-primary"
@click="saveZeitsperre()">
{{$p.t('zeitsperren', 'addZeitsperre')}}
</button>
<button
v-else
type="button"
class="btn btn-warning"
@click="saveZeitsperre(zeitsperreData.zeitsperre_id)">
{{$p.t('zeitsperren', 'saveZeitsperre')}}
</button>
</div>
</div>
</div>
</form-form>
<div class="d-flex align-items-start text-muted small">
<i class="fa fa-circle-info me-2 mt-1"></i>
<div>
<strong>{{$p.t('alert', 'attention')}}</strong><br>
{{$p.t('zeitsperren', 'info_zeitsperrenMoreDays')}}
</div>
</div>
<hr>
<core-filter-cmpt
v-if="tabulatorOptions"
ref="table"
:tabulator-options="tabulatorOptions"
:tabulator-events="tabulatorEvents"
table-only
:side-menu="false"
reload
:reload-btn-infotext="this.$p.t('table', 'reload')"
>
</core-filter-cmpt>
</div>
`
};
@@ -124,6 +124,10 @@ export default {
? `${this.stg}/${this.semester}`
: this.stg;
}
else
{
this.selectedStudiengang = '';
}
this.filter = filter;
},
handleRowClicked(data)
@@ -163,6 +167,7 @@ export default {
const routeName = this.filter.emp ? 'byEmp' : 'byStg';
const params = { stg };
params.semester = '';
if (semester !== null)
params.semester = semester;
if (studiensemester_kurzbz)
@@ -4,6 +4,8 @@ import FormInput from '../../../Form/Input.js';
import ListBox from "../../../../../../index.ci.php/public/js/components/primevue/listbox/listbox.esm.min.js";
import DropdownComponent from "../../../VorlagenDropdown/VorlagenDropdown.js";
import ApiMessages from '../../../../api/factory/messages/messages.js';
export default {
name: "ModalNewMessages",
components: {
@@ -14,13 +16,9 @@ export default {
ListBox
},
props: {
endpoint: {
type: Object,
required: true
},
typeId: String,
id: {
type: [Number, String],
type: Array,
required: true
},
messageId: {
@@ -43,6 +41,8 @@ export default {
vorlagen: [],
recipientsArray: [],
defaultRecipient: null,
defaultRecipients: [],
defaultRecipientString: null,
editor: null,
fieldsUser: [],
fieldsPerson: [],
@@ -56,7 +56,6 @@ export default {
previewText: null,
previewBody: "",
replyData: null,
uid: null,
}
},
methods: {
@@ -111,34 +110,28 @@ export default {
},
sendMessage() {
const data = new FormData();
const params = {
id: this.id,
type_id: this.typeId
};
const merged = {
...this.formData,
...params
};
data.append('data', JSON.stringify(merged));
data.append('data', JSON.stringify(this.formData));
data.append('ids', JSON.stringify(this.id));
return this.$refs.formMessage
.call(this.endpoint.sendMessageFromModalContext(this.uid, data))
.call(ApiMessages.sendMessage(this.typeId, data))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent'));
this.hideModal('modalNewMessage');
this.resetForm();
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
//this.resetForm();
//closeModal
//closewindwo
//just emit if no multitasking
if(this.id.length == 1){
this.$emit('reloadTable');
}
}
);
},
getDataVorlage(vorlage_kurzbz){
return this.$api
.call(this.endpoint.getDataVorlage(vorlage_kurzbz))
.call(ApiMessages.getDataVorlage(vorlage_kurzbz))
.then(response => {
this.formData.body = response.data.text;
this.formData.subject = response.data.subject;
@@ -146,17 +139,17 @@ export default {
},
getPreviewText(){
const data = new FormData();
data.append('data', JSON.stringify(this.formData.body));
data.append('ids', JSON.stringify(this.id));
return this.$api
.call(this.endpoint.getPreviewText({
id: this.id,
type_id: this.typeId}, data))
.call(ApiMessages.getPreviewText(
this.typeId, data))
.then(response => {
this.previewText = response.data;
const previews = response.data;
this.previewText = previews[this.defaultRecipient];
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
//this.resetForm();
//closeModal
//closewindwo
});
@@ -171,7 +164,7 @@ export default {
this.editor.save();
} else {
console.error("Editor instance is not available.");
console.error(this.$p.t('messages', 'errorEditorNotAvailable'));
}
},
resetForm(){
@@ -180,6 +173,7 @@ export default {
body: null,
subject: null,
};
this.$emit('resetMessageId');
if (this.editor) {
@@ -201,18 +195,6 @@ export default {
this.previewBody = this.previewText;
});
},
getUid(id, typeId){
const params = {
id: id,
type_id: typeId
};
this.$api
.call(this.endpoint.getUid(params))
.then(result => {
this.uid = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
show(){
this.$refs.modalNewMessage.show();
},
@@ -245,7 +227,7 @@ export default {
if (!newMessageId) return;
try {
const result = await this.$api.call(this.endpoint.getReplyData(newMessageId));
const result = await this.$api.call(ApiMessages.getReplyData(newMessageId));
this.replyData = result.data;
if (this.replyData.length > 0) {
@@ -260,15 +242,9 @@ export default {
}
},
created(){
this.getUid(this.id, this.typeId);
if(this.typeId == 'person_id' || this.typeId == 'mitarbeiter_uid'){
const params = {
id: this.id,
type_id: this.typeId
};
this.$api
.call(this.endpoint.getMessageVarsPerson(params))
.call(ApiMessages.getMessageVarsPerson(this.id, this.typeId))
.then(result => {
this.fieldsPerson = result.data;
const person = this.fieldsPerson[0];
@@ -281,12 +257,8 @@ export default {
}
if(this.typeId == 'prestudent_id' || this.typeId == 'uid'){
const params = {
id: this.id,
type_id: this.typeId
};
this.$api
.call(this.endpoint.getMsgVarsPrestudent(params))
.call(ApiMessages.getMsgVarsPrestudent(this.id, this.typeId))
.then(result => {
this.fieldsPrestudent = result.data;
const prestudent = this.fieldsPrestudent[0];
@@ -299,7 +271,7 @@ export default {
}
this.$api
.call(this.endpoint.getMsgVarsLoggedInUser())
.call(ApiMessages.getMsgVarsLoggedInUser())
.then(result => {
this.fieldsUser = result.data;
const user = this.fieldsUser;
@@ -311,21 +283,18 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(this.endpoint.getNameOfDefaultRecipient({
id: this.id,
type_id: this.typeId}))
.call(ApiMessages.getNameOfDefaultRecipients(this.id, this.typeId))
.then(result => {
this.defaultRecipient = result.data;
this.recipientsArray.push({
'uid': this.uid,
'details': this.defaultRecipient});
this.defaultRecipients = result.data;
this.defaultRecipientString = Object.values(this.defaultRecipients).join("; ");
})
.catch(this.$fhcAlert.handleSystemError);
//case of reply
if(this.messageId) {
this.$api
.call(this.endpoint.getReplyData(this.messageId))
.call(ApiMessages.getReplyData(this.messageId))
.then(result => {
this.replyData = result.data;
this.formData.subject = this.replyData[0].replySubject;
@@ -381,7 +350,7 @@ export default {
type="text"
name="recipient"
:label="$p.t('messages/recipient')"
v-model="defaultRecipient"
v-model="defaultRecipientString"
disabled
>
</form-input>
@@ -502,17 +471,17 @@ export default {
>
<option :value="null">{{ $p.t('messages', 'recipient') }}...</option>
<option
v-for="recipient in recipientsArray"
:key="recipient.uid"
:value="recipient.uid"
>{{recipient.details}}
v-for="(name, id) in defaultRecipients"
:key="id"
:value="Number(id)"
> {{name}}
</option>
</form-input>
</div>
<div class="col-md-2 mt-4">
<br>
<button type="button" class="btn btn-secondary" @click="showPreview()">{{ $p.t('ui', 'btnAktualisieren') }}</button>
<button type="button" class="btn btn-secondary" @click="showPreview(defaultRecipient)">{{ $p.t('ui', 'btnAktualisieren') }}</button>
</div>
</form-form>
@@ -2,6 +2,7 @@ import FormForm from '../../../Form/Form.js';
import FormInput from '../../../Form/Input.js';
import ListBox from "../../../../../../index.ci.php/public/js/components/primevue/listbox/listbox.esm.min.js";
import DropdownComponent from '../../../VorlagenDropdown/VorlagenDropdown.js';
import ApiMessages from "../../../../api/factory/messages/messages.js"; //props not working with route
export default {
name: "ComponentNewMessages",
@@ -12,33 +13,17 @@ export default {
DropdownComponent,
},
props: {
endpoint: {
type: Object,
required: true
},
openMode: String,
tempTypeId: String,
tempId: {
type: [Number, String],
typeId: String,
id: {
type: Array,
required: false
},
tempMessageId: {
messageId: {
type: Number,
required: false,
}
},
computed: {
//params with routes for new tab and new window AND props for inSamePage
id(){
return this.$props.tempId || this.$route.params.id;
},
typeId(){
return this.$props.tempTypeId || this.$route.params.typeId;
},
messageId(){
return this.$props.tempMessageId ||this.$route.params.messageId;
}
},
data(){
return {
formData: {
@@ -53,6 +38,8 @@ export default {
vorlagen: [],
recipientsArray: [],
defaultRecipient: null,
defaultRecipients: [],
defaultRecipientString: null,
editor: null,
isVisible: false,
fieldsUser: [],
@@ -67,8 +54,7 @@ export default {
previewText: null,
previewBody: "",
replyData: null,
uid: null,
messageSent: false
messageSent: false,
}
},
methods: {
@@ -106,19 +92,11 @@ export default {
},
sendMessage() {
const data = new FormData();
data.append('data', JSON.stringify(this.formData));
data.append('ids', JSON.stringify(this.id));
const params = {
id: this.id,
type_id: this.typeId
};
const merged = {
...this.formData,
...params
};
data.append('data', JSON.stringify(merged));
return this.$api
.call(this.endpoint.sendMessage(this.uid, data))
.call(ApiMessages.sendMessage(this.typeId, data))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent'));
this.hideTemplate();
@@ -126,11 +104,7 @@ export default {
this.messageSent = true;
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
//TODO(Manu) hier route definieren für openmode in Tab, Page?
// ist kein child sondern mit route aufgerufen
//würde allerdings neues fenster aktualisiert öffnen, altes bleibt ohne reload gleich
//Reload vorheriges tab???
if(this.openMode == "inSamePage"){
if(this.openMode == "inSamePage" && this.id.length == 1 ){
this.$emit('reloadTable');
}
}
@@ -138,25 +112,29 @@ export default {
},
getDataVorlage(vorlage_kurzbz){
return this.$api
.call(this.endpoint.getDataVorlage(vorlage_kurzbz))
.call(ApiMessages.getDataVorlage(vorlage_kurzbz))
.then(response => {
this.formData.body = response.data.text;
this.formData.subject = response.data.subject;
}).catch(this.$fhcAlert.handleSystemError);
},
getPreviewText(id, typeId){
getPreviewText(){
console.log("subj" + this.formData.subject);
const data = new FormData();
data.append('data', JSON.stringify(this.formData.body));
data.append('ids', JSON.stringify(this.id));
console.log("subj" + this.formData.subject);
return this.$api
.call(this.endpoint.getPreviewText({
id: this.id,
type_id: this.typeId}, data))
.call(ApiMessages.getPreviewText(
this.typeId, data))
.then(response => {
this.previewText = response.data;
const previews = response.data;
this.previewText = previews[this.defaultRecipient];
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
//this.resetForm();
});
},
insertVariable(selectedItem){
@@ -169,7 +147,7 @@ export default {
this.editor.save();
} else {
console.error("Editor instance is not available.");
console.error(this.$p.t('messages', 'errorEditorNotAvailable'));
}
},
resetForm(){
@@ -177,11 +155,13 @@ export default {
vorlage_kurzbz: null,
body: null,
subject: null,
recipient: null,
selectedValue: null
};
if (this.editor) {
this.editor.setContent("");
}
this.$refs.dropdownComp.setValue(null);
// this.$refs.dropdownComp.setValue(null);
this.previewBody = null;
@@ -199,23 +179,25 @@ export default {
this.isVisible = false;
},
showTemplate(){
if (this.openMode == "inSamePage")
if (this.openMode == "inSamePage") {
this.isVisible = true;
//to enable send newMessage after sentMessage
this.messageSent = false;
}
},
showPreview(id, typeId){
this.getPreviewText(id, typeId).then(() => {
showPreview(){
this.getPreviewText().then(() => {
this.previewBody = this.previewText;
});
},
getUid(id, typeId){
const params = {
id: id,
type_id: typeId
};
loadReplyData(messageId){
this.$api
.call(this.endpoint.getUid(params))
.call(ApiMessages.getReplyData(messageId))
.then(result => {
this.uid = result.data;
this.replyData = result.data;
this.formData.subject = this.replyData[0].replySubject;
this.formData.body = this.replyData[0].replyBody;
this.formData.relationmessage_id = messageId;
})
.catch(this.$fhcAlert.handleSystemError);
}
@@ -242,38 +224,43 @@ export default {
},
},
created(){
this.getUid(this.id, this.typeId);
const missingparamsmsgs = [];
if(!this.typeId)
{
missingparamsmsgs.push(this.$p.t('messages', 'errorMissingOrInvalidParameterRecipientTypeId'));
}
if (['person_id', 'mitarbeiter_uid'].includes(this.typeId)){
const params = {
id: this.id,
type_id: this.typeId
};
if(!this.id || this.id.length < 1)
{
missingparamsmsgs.push(this.$p.t('messages', 'errorMissingOrInvalidParameterRecipientIds'));
}
this.$api
.call(this.endpoint.getMessageVarsPerson(params))
.then(result => {
this.fieldsPerson = result.data;
const person = this.fieldsPerson[0];
this.itemsPerson = Object.entries(person).map(([key, value]) => ({
label: key.toLowerCase(),
value: '{' + key.toLowerCase() + '}'
}));
})
.catch(this.$fhcAlert.handleSystemError);
}
if(missingparamsmsgs.length > 0)
{
this.$fhcAlert.alertMultiple(missingparamsmsgs, 'warn', 'Warning', true);
return;
}
if (['prestudent_id', 'uid'].includes(this.typeId)){
const params = {
id: this.id,
type_id: this.typeId
};
if(this.typeId == 'person_id' || this.typeId == 'mitarbeiter_uid'){
this.$api
.call(this.endpoint.getMsgVarsPrestudent(params))
.call(ApiMessages.getMessageVarsPerson(this.id, this.typeId))
.then(result => {
this.fieldsPerson = result.data;
const person = this.fieldsPerson[0];
this.itemsPerson = Object.entries(person).map(([key, value]) => ({
label: key.toLowerCase(),
value: '{' + key.toLowerCase() + '}'
}));
})
.catch(this.$fhcAlert.handleSystemError);
}
if(this.typeId == 'prestudent_id' || this.typeId == 'uid'){
this.$api
.call(ApiMessages.getMsgVarsPrestudent(this.id, this.typeId))
.then(result => {
this.fieldsPrestudent = result.data;
const prestudent = this.fieldsPrestudent[0];
this.itemsPrestudent = Object.entries(prestudent).map(([key, value]) => ({
label: key.toLowerCase(),
value: '{' + key.toLowerCase() + '}'
@@ -283,7 +270,7 @@ export default {
}
this.$api
.call(this.endpoint.getMsgVarsLoggedInUser())
.call(ApiMessages.getMsgVarsLoggedInUser())
.then(result => {
this.fieldsUser = result.data;
const user = this.fieldsUser;
@@ -295,28 +282,26 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(this.endpoint.getNameOfDefaultRecipient({
id: this.id,
type_id: this.typeId}))
.call(ApiMessages.getNameOfDefaultRecipients(this.id, this.typeId))
.then(result => {
this.defaultRecipient = result.data;
this.recipientsArray.push({
'uid': this.uid,
'details': this.defaultRecipient});
this.defaultRecipients = result.data;
this.defaultRecipientString = Object.values(this.defaultRecipients).join("; ");
})
.catch(this.$fhcAlert.handleSystemError);
//case of reply
if(this.messageId != null) {
this.$api
.call(this.endpoint.getReplyData(this.messageId))
this.loadReplyData(this.messageId);
/* this.$api
.call(ApiMessages.getReplyData(this.messageId))
.then(result => {
this.replyData = result.data;
this.formData.subject = this.replyData[0].replySubject;
this.formData.body = this.replyData[0].replyBody;
this.formData.relationmessage_id = this.messageId;
})
.catch(this.$fhcAlert.handleSystemError);
.catch(this.$fhcAlert.handleSystemError);*/
}
},
@@ -330,7 +315,7 @@ export default {
<div class="messages-detail-newmessage-newdiv">
<!--new page-->
<div v-if="!messageSent" class="overflow-auto m-3">
<div v-if="!messageSent" ref="divNewMessage" class="overflow-auto m-3">
<h4>{{ $p.t('messages', 'neueNachricht') }}</h4>
<div class="row">
@@ -343,7 +328,7 @@ export default {
type="text"
name="recipient"
:label="$p.t('messages/recipient')"
v-model="defaultRecipient"
v-model="defaultRecipientString"
disabled
>
</form-input>
@@ -472,18 +457,18 @@ export default {
v-model="defaultRecipient"
>
<option :value="null">{{ $p.t('messages', 'recipient') }}...</option>
<option
v-for="recipient in recipientsArray"
:key="recipient.uid"
:value="recipient.uid"
>{{recipient.details}}
<option
v-for="(name, id) in defaultRecipients"
:key="id"
:value="Number(id)"
> {{name}}
</option>
</form-input>
</div>
<div class="col-md-2 mt-4">
<br>
<button type="button" class="btn btn-secondary" @click="showPreview(id, typeId)">{{ $p.t('ui', 'btnAktualisieren') }}</button>
<button type="button" class="btn btn-secondary" @click="showPreview(defaultRecipient)">{{ $p.t('ui', 'btnAktualisieren') }}</button>
</div>
</form-form>
@@ -1,6 +1,8 @@
import {CoreFilterCmpt} from "../../filter/Filter.js";
import FormForm from '../../Form/Form.js';
import ApiMessages from "../../../api/factory/messages/messages.js"
export default {
name: "TableMessages",
components: {
@@ -13,13 +15,9 @@ export default {
},
},
props: {
endpoint: {
type: Object,
required: true
},
typeId: String,
id: {
type: [Number, String],
type: Array,
required: true
},
messageLayout: String,
@@ -38,12 +36,13 @@ export default {
},
ajaxResponse: (url, params, response) => this.buildTreemap(response),
columns: [
{title: "subject", field: "subject"},
{title: "body", field: "body", formatter: "html", visible: false},
{title: "message_id", field: "message_id", visible: false},
{title: "subject", field: "subject", headerFilter: true},
{title: "body", field: "body", formatter: "html", visible: false, headerFilter: true},
{title: "message_id", field: "message_id", visible: false, headerFilter: true},
{
title: "Datum",
field: "insertamum",
headerFilter: true,
formatter: function (cell) {
const dateStr = cell.getValue();
const date = new Date(dateStr); // Convert to Date object
@@ -55,16 +54,28 @@ export default {
minute: "2-digit",
hour12: false
});
},
headerFilterFunc(headerValue, rowValue) {
const matches = headerValue.match(/^(([0-9]{2})\.)?([0-9]{2})\.([0-9]{4})?$/);
let comparestr = headerValue;
if(matches !== null) {
const year = (matches[4] !== undefined) ? matches[4] : '';
const month = matches[3];
const day = (matches[2] !== undefined) ? matches[2] : '';
comparestr = year + '-' + month + '-' + day;
}
return rowValue.match(comparestr);
}
},
{title: "sender", field: "sender"},
{title: "recipient", field: "recipient"},
{title: "senderId", field: "sender_id"},
{title: "recipientId", field: "recipient_id"},
{title: "Relationmessage ID", field: "relationmessage_id"},
{title: "sender", field: "sender", headerFilter: true},
{title: "recipient", field: "recipient", headerFilter: true},
{title: "senderId", field: "sender_id", headerFilter: true},
{title: "recipientId", field: "recipient_id", headerFilter: true},
{title: "Relationmessage ID", field: "relationmessage_id", headerFilter: true},
{
title: "Status",
field: "status",
headerFilter: true,
formatterParams: [
"unread",
"read",
@@ -73,11 +84,12 @@ export default {
],
formatter: (cell, formatterParams) => {
return formatterParams[cell.getValue()];
}
},
},
{
title: "letzte Änderung",
field: "statusdatum",
headerFilter: true,
formatter: function (cell) {
const dateStr = cell.getValue();
const date = new Date(dateStr); // Convert to Date object
@@ -89,6 +101,17 @@ export default {
minute: "2-digit",
hour12: false
});
},
headerFilterFunc(headerValue, rowValue) {
const matches = headerValue.match(/^(([0-9]{2})\.)?([0-9]{2})\.([0-9]{4})?$/);
let comparestr = headerValue;
if(matches !== null) {
const year = (matches[4] !== undefined) ? matches[4] : '';
const month = matches[3];
const day = (matches[2] !== undefined) ? matches[2] : '';
comparestr = year + '-' + month + '-' + day;
}
return rowValue.match(comparestr);
}
},
{
@@ -132,9 +155,10 @@ export default {
frozen: true
}
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: '400',
selectable: 1,
selectableRangeMode: 'click',
index: 'message_id',
pagination: true,
@@ -147,7 +171,7 @@ export default {
dataTreeCollapseElement:"<i class='fas fa-minus-square'></i>",
dataTreeChildIndent: 15,
dataTreeStartExpanded: false,
persistenceID: 'core-message',
persistenceID: 'core-message-2025112401',
locale: 'de',
"langs": {
"de":{ //German language definition
@@ -255,7 +279,7 @@ export default {
},
deleteMessage(message_id){
return this.$api
.call(this.endpoint.deleteMessage(message_id))
.call(ApiMessages.deleteMessage(message_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
}).catch(this.$fhcAlert.handleSystemError)
@@ -321,7 +345,7 @@ export default {
},
loadAjaxCall(url, config, params){
return this.$api.call(
this.endpoint.getMessages(params)
ApiMessages.getMessages(params)
);
}
},
@@ -346,13 +370,13 @@ export default {
});*/
},
created(){
if(this.typeId != 'person_id') {
if(this.typeId != 'person_id' && Array.isArray(this.id) && this.id.length === 1) {
const params = {
id: this.id,
type_id: this.typeId
};
this.$api
.call(this.endpoint.getPersonId(params))
.call(ApiMessages.getPersonId(params))
.then(result => {
this.personId = result.data;
})
+55 -30
View File
@@ -14,10 +14,6 @@ export default {
}
},
props: {
endpoint: {
type: Object,
required: true
},
typeId: {
type: String,
required: true,
@@ -31,7 +27,7 @@ export default {
}
},
id: {
type: [Number, String],
type: Array,
required: true
},
showTable: Boolean,
@@ -65,6 +61,9 @@ export default {
}
},
methods: {
getControllerUrl() {
return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/NeueNachricht';
},
reloadTable(){
this.$refs.templateTableMessage.reload();
},
@@ -77,44 +76,65 @@ export default {
this.openInNewTab(id, typeId, messageId);
}
else if (this.openMode == "modal"){
if(!messageId)
this.$refs.modalMsg.resetForm();
this.$refs.modalMsg.show();
}
else if (this.openMode == "inSamePage"){
console.log("in same Page");
this.isVisibleDiv = true;
if(messageId)
this.$refs.templateNewDivMessage.loadReplyData(messageId);
else
this.$refs.templateNewDivMessage.resetForm();
this.$refs.templateNewDivMessage.showTemplate();
}
else
console.log("no valid openMode");
},
openInNewTab(id, typeId, messageId= null){
openInNewTab(id, typeId, messageId=null){
if(id.length > 1)
{
this.$refs['newMsgForm'].submit();
return;
}
let path = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
let path = this.getControllerUrl();
if (messageId){
path += "/NeueNachricht/" + id + "/" + typeId + "/" + messageId;
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId) + "/" + encodeURIComponent(messageId);
}
else {
path += "/NeueNachricht/" + id + "/" + typeId;
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId);
}
const newTab = window.open(path, "_blank");
},
openInNewWindow(id, typeId, messageId){
let path = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
if (messageId){
path += "/NeueNachricht/" + id + "/" + typeId + "/" + messageId;
}
else {
path += "/NeueNachricht/" + id + "/" + typeId;
}
const width = Math.round(window.innerWidth * 0.75);
const height = Math.round(window.innerHeight * 0.75);
const left = Math.round((window.innerWidth - width) / 2);
const top = Math.round((window.innerHeight - height) / 2);
if(id.length > 1)
{
const newWindow = window.open('', "NewMsgWindow", `width=${width},height=${height},left=${left},top=${top}`);
this.$refs['newMsgForm'].submit();
return;
}
let path = this.getControllerUrl();
if (messageId){
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId) + "/" + encodeURIComponent(messageId);
}
else {
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId);
}
const newWindow = window.open(path, "_blank", `width=${width},height=${height},left=${left},top=${top}`);
},
resetMessageId(){
@@ -124,13 +144,21 @@ export default {
},
template: `
<div class="core-messages h-100 pb-3">
<!-- TODO(bh) set target _self for debugging post but _blank for newTab -->
<form ref="newMsgForm"
method="post"
:action="getControllerUrl()"
:target="(openMode === 'window') ? 'NewMsgWindow' : '_blank'"
>
<input type="hidden" name="typeid" :value="typeId">
<input type="hidden" name="ids" :value="id">
</form>
<message-modal
ref="modalMsg"
:type-id="typeId"
:id="id"
:message-id="messageId"
:endpoint="endpoint"
:openMode="openMode"
@reloadTable="reloadTable"
@resetMessageId="resetMessageId"
@@ -138,26 +166,23 @@ export default {
</message-modal>
<!--in same page-->
<div v-if="isVisibleDiv" class="overflow-auto m-3" style="max-height: 500px; border: 1px solid #ccc;">
<div v-show="isVisibleDiv" class="overflow-auto m-3" style="max-height: 500px; border: 1px solid #ccc;">
<form-only
ref="templateNewMessage"
:temp-type-id="typeId"
:temp-id="id"
:temp-message-id="messageId"
:endpoint="endpoint"
ref="templateNewDivMessage"
:type-id="typeId"
:id="id"
:message-id="messageId"
:openMode="openMode"
@reloadTable="reloadTable"
>
</form-only>
</div>
<div v-if="showTable">
<div v-if="showTable && id.length==1">
<table-messages
ref="templateTableMessage"
:type-id="typeId"
:id="id"
:endpoint="endpoint"
:messageLayout="messageLayout"
:openMode="openMode"
@newMessage="handleMessage"
@@ -192,7 +192,15 @@ export default {
<option value="textLong_plageat">{{$p.t('studierendenantrag', 'dropdown_plageat')}}
</option>
<option value="textLong_MissingZgv">{{$p.t('studierendenantrag', 'dropdown_MissingZgv')}}
</option>
</option>
<option value="textLong_Studienwechsel">{{$p.t('studierendenantrag', 'dropdown_Studienwechsel')}}
</option>
<option value="textLong_Studienabbruch_allgemein">{{$p.t('studierendenantrag', 'dropdown_Studienabbruch_allgemein')}}
</option>
<option value="textLong_vsCodeOfConduct">{{$p.t('studierendenantrag', 'dropdown_vsCodeOfConduct')}}
</option>
<option value="textLong_additionalReason">{{$p.t('studierendenantrag', 'dropdown_additionalReason')}}
</option>
<!--
<option value="textLong_unruly">{{$p.t('studierendenantrag', 'dropdown_unruly')}}
</option>
+236 -12
View File
@@ -16,8 +16,10 @@
*/
import CoreSearchbar from "../searchbar/searchbar.js";
import NavLanguage from "../navigation/Language.js";
import VerticalSplit from "../verticalsplit/verticalsplit.js";
import AppMenu from "../AppMenu.js";
import AppConfig from "../AppConfig.js";
import StvVerband from "./Studentenverwaltung/Verband.js";
import StvList from "./Studentenverwaltung/List.js";
import StvDetails from "./Studentenverwaltung/Details.js";
@@ -26,14 +28,17 @@ import StvStudiensemester from "./Studentenverwaltung/Studiensemester.js";
import ApiSearchbar from "../../api/factory/searchbar.js";
import ApiStv from "../../api/factory/stv.js";
import ApiStvVerband from '../../api/factory/stv/verband.js';
import ApiStvConfig from '../../api/factory/stv/config.js';
export default {
name: 'Studentenverwaltung',
components: {
CoreSearchbar,
NavLanguage,
VerticalSplit,
AppMenu,
AppConfig,
StvVerband,
StvList,
StvDetails,
@@ -45,6 +50,8 @@ export default {
permissions: Object,
stvRoot: String,
cisRoot: String,
avatarUrl: String,
logoutUrl: String,
activeAddons: String, // semicolon separated list of active addons
url_studiensemester_kurzbz: String,
url_mode: String,
@@ -76,15 +83,24 @@ export default {
},
configShowAufnahmegruppen: this.config.showAufnahmegruppen,
configAllowUebernahmePunkte: this.config.allowUebernahmePunkte,
configUseReihungstestPunkte: this.config.useReihungstestPunkte
configUseReihungstestPunkte: this.config.useReihungstestPunkte,
appConfig: Vue.computed(() => this.appconfig),
hasZGVBakkPermission: this.permissions['student/editBakkZgv'],
hasZGVMasterPermission: this.permissions['student/editMakkZgv'],
hasZGVDoctorPermission: this.permissions['student/editDokZgv'],
hasBismeldenPermission: this.permissions['student/editBismelden'],
}
},
data() {
return {
appconfig: {},
configEndpoints: ApiStvConfig,
selected: [],
searchbaroptions: {
origin: 'stv',
calcheightonly: true,
nolivesearch: true,
types: {
student: Vue.computed(() => this.$p.t('search/type_student')),
prestudent: Vue.computed(() => this.$p.t('search/type_prestudent'))
@@ -123,6 +139,8 @@ export default {
studiengangKz: undefined,
studiengangKuerzel: '',
studiensemesterKurzbz: this.defaultSemester,
selected_semester: undefined,
selected_orgform: undefined,
lists: {
nations: [],
sprachen: [],
@@ -131,12 +149,60 @@ export default {
verbandEndpoint: ApiStvVerband
}
},
computed: {
appMenuExtraItems() {
const extraItems = [];
if (this.studiengangKz !== undefined && this.selected_semester !== undefined) {
const studiengang_kz = String(this.studiengangKz);
const semester = String(this.selected_semester);
const orgform = this.selected_orgform || '';
extraItems.push({
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'content/statistik/notenspiegel.php?typ=xls'
+ '&studiengang_kz=' + studiengang_kz
+ '&semester=' + semester
+ '&studiensemester=' + this.studiensemesterKurzbz
+ '&orgform=' + orgform,
description: 'stv/grade_report_xls'
});
extraItems.push({
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'content/statistik/notenspiegel_erweitert.php?typ=xls'
+ '&studiengang_kz=' + studiengang_kz
+ '&semester=' + semester
+ '&studiensemester=' + this.studiensemesterKurzbz
+ '&orgform=' + orgform,
description: 'stv/grade_report_xls_extended'
});
extraItems.push({
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'content/statistik/notenspiegel.php?typ=html'
+ '&studiengang_kz=' + studiengang_kz
+ '&semester=' + semester
+ '&studiensemester=' + this.studiensemesterKurzbz
+ '&orgform=' + orgform,
description: 'stv/grade_report_html'
});
}
return extraItems;
}
},
watch: {
'url_studiensemester_kurzbz': function (newVal, oldVal) {
if (newVal !== oldVal) {
this.studiensemesterKurzbz = newVal;
this.$refs.stvList.updateUrl();
this.$refs.details.reload();
if(this.$route.name === 'search')
{
this.handleSearchUrl();
}
else
{
this.$refs.stvList.updateUrl();
this.$refs.details.reload();
}
}
},
'url_studiengang': function (newVal, oldVal) {
@@ -146,6 +212,25 @@ export default {
},
'url_mode': function () {
this.handlePersonUrl();
},
url_prestudent_id() {
this.handlePersonUrl();
},
'appconfig.font_size'() {
// add to html class
const classList = Object.keys(this.$refs.config.setup.font_size.options);
classList.forEach(cn => document.documentElement.classList.remove(cn));
document.documentElement.classList.add(this.appconfig.font_size);
// recalc Tabulator heights
if (this.$el) {
const tabulatorEls = this.$el.querySelectorAll('.tabulator');
for (const el of tabulatorEls) {
const tabulators = Tabulator.findTable(el);
if (tabulators) {
tabulators[0].searchRows().forEach(row => row.normalizeHeight());
}
}
}
}
},
methods: {
@@ -159,7 +244,7 @@ export default {
}
},
buildPrestudentSearchResultLink(data) {
return this.$fhcApi.getUri(
return this.$api.getUri(
'/studentenverwaltung'
+ '/' + this.studiensemesterKurzbz
+ '/prestudent/'
@@ -167,7 +252,7 @@ export default {
);
},
buildStudentSearchResultLink(data) {
return this.$fhcApi.getUri(
return this.$api.getUri(
'/studentenverwaltung'
+ '/' + this.studiensemesterKurzbz
+ '/student/'
@@ -175,14 +260,14 @@ export default {
);
},
buildPersonSearchResultLink(data) {
return this.$fhcApi.getUri(
return this.$api.getUri(
'/studentenverwaltung'
+ '/' + this.studiensemesterKurzbz
+ '/person/'
+ data.person_id
);
},
onSelectVerband( {link, studiengang_kz}) {
onSelectVerband({ link, studiengang_kz, semester, orgform_kurzbz }) {
let urlpath = String(link);
if (!urlpath.match(/\/prestudent/))
{
@@ -191,6 +276,8 @@ export default {
this.$refs.stvList.updateUrl(ApiStv.students.verband(urlpath));
this.studiengangKz = studiengang_kz;
this.selected_semester = semester;
this.selected_orgform = orgform_kurzbz;
const stg = this.lists.stgs.find((element) => {
return (element.studiengang_kz === this.studiengangKz);
});
@@ -223,9 +310,6 @@ export default {
studiensemester_kurzbz: v
}
});
this.$refs.stvList.updateUrl();
this.$refs.details.reload();
},
reloadList() {
this.$refs.stvList.reload();
@@ -249,6 +333,37 @@ export default {
ApiStv.students.person(this.$route.params.person_id, 'CURRENT_SEMESTER'),
true
);
} else if (this.$route.params.searchstr) {
this.handleSearchUrl();
}
else
{
this.clearTabulator();
}
},
handleSearchUrl() {
const searchsettings = {
searchstr: this.$route.params.searchstr,
types: this.$route.params.types?.split('+') || []
};
// init into student list
this.$refs.stvList.updateUrl(
ApiStv.students.search(searchsettings, this.studiensemesterKurzbz)
);
// init into searchbar
this.$refs.searchbar.searchsettings.searchstr = searchsettings.searchstr;
this.$refs.searchbar.searchsettings.types = searchsettings.types;
this.$nextTick(this.blurSearchbar);
},
clearTabulator() {
if(['index', 'studiensemester'].includes(this.$route.name))
{
if(this.$refs?.stvList?.$refs?.table?.tabulator)
{
this.$refs.stvList.$refs.table.tabulator.setData([]);
}
}
},
checkUrlStudiengang() {
@@ -269,6 +384,42 @@ export default {
});
}
}
else
{
this.studiengangKz = undefined;
this.studiengangKuerzel = '';
this.clearTabulator();
}
},
onSearch(e) {
const searchsettings = { ...this.$refs.searchbar.searchsettings };
if (searchsettings.searchstr.length >= 2) {
this.blurSearchbar();
if (!searchsettings.types.length || searchsettings.types.length == this.$refs.searchbar.types.length) {
this.$router.push({
name: 'search',
params: {
studiensemester_kurzbz: this.studiensemesterKurzbz,
searchstr: searchsettings.searchstr
}
});
} else {
this.$router.push({
name: 'search_w_types',
params: {
studiensemester_kurzbz: this.studiensemesterKurzbz,
searchstr: searchsettings.searchstr,
types: searchsettings.types.join('+')
}
});
}
}
},
blurSearchbar() {
this.$refs.searchbar.$refs.input.blur();
this.$refs.searchbar.abort();
this.$refs.searchbar.hideresult();
}
},
created() {
@@ -376,10 +527,58 @@ export default {
<span class="fa-solid fa-table-list"></span>
</button>
<core-searchbar
ref="searchbar"
:searchoptions="searchbaroptions"
:searchfunction="searchfunction"
class="searchbar position-relative w-100"
show-btn-submit
@submit.prevent="onSearch"
></core-searchbar>
<div id="nav-user" class="dropdown">
<button
id="nav-user-btn"
class="btn btn-link rounded-0 py-0"
type="button"
data-bs-toggle="dropdown"
data-bs-target="#nav-user-menu"
aria-expanded="false"
aria-controls="nav-user-menu"
>
<img
:src="avatarUrl"
:alt="$p.t('profilUpdate/profilBild')"
class="bg-light avatar rounded-circle border border-light"
/>
</button>
<ul
ref="navUserDropdown"
class="dropdown-menu dropdown-menu-dark dropdown-menu-end rounded-0 text-center m-0"
aria-labelledby="nav-user-btn"
>
<li>
<button
type="button"
class="dropdown-item"
data-bs-toggle="modal"
data-bs-target="#configModal"
>
{{ $p.t('ui/settings') }}
</button>
</li>
<li><hr class="dropdown-divider m-0"/></li>
<li>
<nav-language
item-class="dropdown-item border-left-dark"
/>
</li>
<li><hr class="dropdown-divider m-0"/></li>
<li>
<a class="dropdown-item" :href="logoutUrl">
{{ $p.t('ui/logout') }}
</a>
</li>
</ul>
</div>
</header>
<div class="container-fluid overflow-hidden">
<div class="row h-100">
@@ -389,14 +588,38 @@ export default {
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
</div>
<div class="offcanvas-body">
<app-menu app-identifier="stv" />
<app-menu app-identifier="stv">
<li class="dropend">
<a
class="dropdown-toggle"
href="#"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false"
:class="{ disabled: !appMenuExtraItems.length }"
data-bs-popper-config='{"strategy":"fixed"}'
>
{{ $p.t('stv/grade_report') }}
</a>
<ul class="dropdown-menu p-0">
<li
v-for="(item, key) in appMenuExtraItems"
:key="key"
>
<a class="dropdown-item" :href="item.link" target="_blank">
{{ $p.t(item.description) }}
</a>
</li>
</ul>
</li>
</app-menu>
</div>
</aside>
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100">
<div class="offcanvas-header justify-content-end px-1 d-md-none">
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
</div>
<stv-verband :preselectedKey="'' + studiengangKz" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
<stv-verband :preselectedKey="studiengangKz ? '' + studiengangKz : null" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
<stv-studiensemester v-model:studiensemester-kurzbz="studiensemesterKurzbz" @update:studiensemester-kurzbz="studiensemesterChanged"></stv-studiensemester>
</nav>
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
@@ -411,5 +634,6 @@ export default {
</main>
</div>
</div>
<app-config ref="config" v-model="appconfig" :endpoints="configEndpoints"></app-config>
</div>`
};
@@ -41,25 +41,34 @@ export default {
return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid && !value.showOnlyWithUid));
}
},
watch: {
'$p.user_language.value'(n, o) {
if (n !== o && o !== undefined)
this.loadConfig();
}
},
methods: {
loadConfig() {
this.$api
.call(ApiStvApp.configStudent())
.then(result => {
this.configStudent = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvApp.configStudents())
.then(result => {
this.configStudents = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
reload() {
if (this.$refs.tabs?.$refs?.current?.reload)
this.$refs.tabs.$refs.current.reload();
}
},
created() {
this.$api
.call(ApiStvApp.configStudent())
.then(result => {
this.configStudent = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvApp.configStudents())
.then(result => {
this.configStudents = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.loadConfig();
},
template: `
<div class="stv-details h-100 d-flex flex-column">
@@ -163,12 +163,12 @@ export default {
frozen: true
},
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: '200',
index: 'abschlusspruefung_id',
persistenceID: 'stv-details-finalexam'
persistenceID: 'stv-details-finalexam-2025112401'
},
tabulatorEvents: [
{
@@ -438,11 +438,9 @@ export default {
if (this.stgInfo.typ === 'b') {
this.formData.pruefungstyp_kurzbz = 'Bachelor';
this.formData.protokoll = this.$p.t('abschlusspruefung', 'pruefungsnotizenMaster');
}
if (this.stgInfo.typ === 'd' || this.stgInfo === 'm') {
this.formData.pruefungstyp_kurzbz = 'Diplom';
this.formData.protokoll = this.$p.t('abschlusspruefung', 'pruefungsnotizenMaster');
}
if (this.stgInfo.typ === 'lg') {
this.formData.pruefungstyp_kurzbz = 'lgabschluss';
@@ -107,10 +107,10 @@ export default {
frozen: true
},
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
height: '500',
index: 'anrechnung_id',
persistenceID: 'stv-details-anrechnungen'
persistenceID: 'stv-details-anrechnungen-2025112401'
},
tabulatorEvents: [
{
@@ -120,12 +120,12 @@ export default {
frozen: true
}
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: 200,
index: 'aufnahmetermin_id',
persistenceID: 'stv-details-table_admission-dates'
persistenceID: 'stv-details-table_admission-dates-2025112401'
},
tabulatorEvents: [
{
@@ -0,0 +1,83 @@
export default {
name: "TabCombinePeople",
inject: {
cisRoot: {
from: 'cisRoot'
},
},
props: {
modelValue: Object,
},
data(){
return {
iframeUrl: null,
viewLoaded: false
}
},
computed: {
personIds() {
return Array.isArray(this.modelValue)
? this.modelValue.map(e => e.person_id)
: [this.modelValue.person_id];
},
detailStringPerson1(){
let person1 = this.modelValue[0];
return person1.vorname + " " + person1.nachname + "(" + person1.person_id + ")";
},
detailStringPerson2(){
let person2 = this.modelValue[1];
return person2.vorname + " " + person2.nachname + "(" + person2.person_id+ ")";
},
},
methods: {
combinePeople(){
this.viewLoaded = true;
let person1_id = this.personIds[0];
let person2_id = this.personIds[1];
if(person1_id == person2_id) {
return this.$fhcAlert.alertError(this.$p.t('stv', 'error_combinePeople_samePerson'));
}
let linkCombinePeople = this.cisRoot + 'vilesci/stammdaten/personen_wartung.php?person_id_1=' + person1_id + '&person_id_2='+ person2_id;
this.openLink(linkCombinePeople);
},
openLink(url) {
this.iframeUrl = url;
},
goBack(){
this.viewLoaded = false;
this.iframeUrl = null;
}
},
template: /*html*/ `
<div class="stv-details-combine-people h-100 pb-3">
<div v-if="!this.viewLoaded">
<h4>Personen zusammenlegen</h4>
<div v-if="this.modelValue.length">
<div v-if="this.modelValue.length == 2">
<p>{{$p.t('stv', 'question_combine_people', { person1: detailStringPerson1, person2: detailStringPerson2 })}}</p>
<button class="btn btn-primary" @click="combinePeople">{{$p.t('ui', 'ok')}}</button>
</div>
<div v-else>
ungültige Anzahl: {{this.modelValue.length}} <!-- should not be seen anymore-->
</div>
</div>
</div>
<div v-else>
<button class="btn btn-secondary" @click="goBack">{{$p.t('ui', 'cancel')}}</button>
</div>
<!-- Iframe-Section -->
<iframe
v-if="iframeUrl"
:src="iframeUrl"
class="w-100 mt-4 border-0"
style="height: 600px;"
></iframe>
</div>
`
};
@@ -1,5 +1,5 @@
import CoreMessages from "../../../Messages/Messages.js";
import ApiMessages from "../../../../api/factory/messages/messages.js";
//import ApiMessages from "../../../../api/factory/messages/messages.js";
export default {
name: "TabMessages",
@@ -11,29 +11,50 @@ export default {
},
data(){
return {
endpoint: ApiMessages
//endpoint: ApiMessages
};
},
computed: {
prestudent_ids() {
if (this.modelValue.prestudent_id)
{
return [this.modelValue.prestudent_id];
}
return this.modelValue.map(e => e.prestudent_id);
},
person_ids() {
if (this.modelValue.person_id)
{
return [this.modelValue.person_id];
}
return this.modelValue.map(e => e.person_id);
},
},
template: `
<div class="stv-details-messages h-100 pb-3 overflow-hidden">
<template v-if="modelValue.prestudent_id">
<core-messages
ref="formc"
:endpoint="endpoint"
type-id="prestudent_id"
:id="modelValue.prestudent_id"
messageLayout="twoColumnsTableLeft"
open-mode="modal"
show-table
>
</core-messages>
</template>
<template v-else>
<h3><strong>No valid prestudent_id!</strong></h3>
<p>{{modelValue.anmerkungen}}</p>
</template>
<template v-if="prestudent_ids">
<core-messages
ref="formc"
type-id="prestudent_id"
:id="prestudent_ids"
messageLayout="twoColumnsTableLeft"
open-mode="modal"
show-table
>
</core-messages>
</template>
<template v-else >
<core-messages
ref="formc"
type-id="person_id"
:id="person_ids"
messageLayout="twoColumnsTableLeft"
open-mode="modal"
show-table
>
</core-messages>
</template>
</div>
`
};
@@ -71,10 +71,10 @@ export default {
frozen: true
},
],
layout: 'fitColumns',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 200,
persistenceID: 'core-mobility-purpose'
persistenceID: 'core-mobility-purpose-2025112401'
},
tabulatorEvents: [
{
@@ -169,6 +169,11 @@ export default {
{
this.localData.push(newEntry);
// reload tabulator mit tabulator method
if (this.$refs.table?.tabulator) {
this.$refs.table.tabulator.replaceData(this.localData);
}
this.$emit('setMobilityPurposeToNewMobility', {
zweck_code: this.formData.zweck_code,
});
@@ -198,7 +203,6 @@ export default {
<br>
<div class="override_filtercmpt_actions_style">
<core-filter-cmpt
ref="table"
:tabulator-options="tabulatorOptions"
@@ -69,10 +69,10 @@ export default {
frozen: true
},
],
layout: 'fitColumns',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 200,
persistenceID: 'core-mobility-support'
persistenceID: 'core-mobility-support-2025112401'
},
tabulatorEvents: [
{
@@ -157,6 +157,11 @@ export default {
{
this.localData.push(newEntry);
// reload tabulator mit tabulator method
if (this.$refs.table?.tabulator) {
this.$refs.table.tabulator.replaceData(this.localData);
}
this.$emit('setMobilitySupportToNewMobility', {
aufenthaltfoerderung_code: this.formData.aufenthaltfoerderung_code,
});
@@ -109,12 +109,12 @@ export default {
frozen: true
},
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: 200,
index: 'bisio_id',
persistenceID: 'stv-details-table_mobiliy'
persistenceID: 'stv-details-table_mobiliy-2025112401'
},
tabulatorEvents: [
{
@@ -7,10 +7,14 @@ export default {
},
props: {
modelValue: Object,
config: {
type: Object,
default: {}
}
},
template: `
<div class="stv-details-multistatus h-100">
<tbl-multi-status :model-value="modelValue"></tbl-multi-status>
<tbl-multi-status :model-value="modelValue" :config="config"></tbl-multi-status>
</div>
`
}
@@ -217,9 +217,10 @@ export default {
},
columns,
height: '100%',
layout: 'fitDataStretchFrozen',
selectable: 1,
selectableRangeMode: 'click',
persistenceID: 'stv-details-noten-zeugnis-2025111801',
persistenceID: 'stv-details-noten-zeugnis-2025112401',
persistence:{
columns: ["width", "visible", "frozen"]
}
@@ -30,6 +30,22 @@ export default {
from: 'hasAdminPermission',
default: false
},
hasZGVBakkPermission: {
from: 'hasZGVBakkPermission',
default: false
},
hasZGVMasterPermission: {
from: 'hasZGVMasterPermission',
default: false
},
hasZGVDoctorPermission: {
from: 'hasZGVDoctorPermission',
default: false
},
hasBismeldenPermission: {
from: 'hasBismeldenPermission',
default: false
},
currentSemester: {
from: 'currentSemester',
required: true
@@ -106,7 +122,7 @@ export default {
},
methods: {
loadPrestudent() {
async loadPrestudent() {
return this.$api
.call(ApiStvPrestudent.get(this.modelValue.prestudent_id, this.currentSemester))
.then(result => result.data)
@@ -154,8 +170,8 @@ export default {
)
},
},
created() {
this.loadPrestudent();
async created() {
await this.loadPrestudent();
this.$api
.call(ApiStvPrestudent.getBezeichnungZGV())
.then(result => result.data)
@@ -273,6 +289,7 @@ export default {
dropdown
name="zgv_code"
@complete="filterZgvs"
:disabled="!hasZGVBakkPermission"
>
<template #option="slotProps">
<div
@@ -291,6 +308,7 @@ export default {
type="text"
v-model="data.zgvort"
name="zgvort"
:disabled="!hasZGVBakkPermission"
>
</form-input>
<form-input
@@ -307,6 +325,7 @@ export default {
format="dd.MM.yyyy"
preview-format="dd.MM.yyyy"
:teleport="true"
:disabled="!hasZGVBakkPermission"
>
</form-input>
<form-input
@@ -316,6 +335,7 @@ export default {
type="select"
v-model="data.zgvnation"
name="zgvnation"
:disabled="!hasZGVBakkPermission"
>
<!-- TODO(chris): gesperrte nationen können nicht ausgewählt werden! Um das zu realisieren müsste man ein pseudo select machen -->
<option value="">&nbsp;</option>
@@ -336,6 +356,7 @@ export default {
dropdown
name="zgvmas_code"
@complete="filterMasterZgvs"
:disabled="!hasZGVMasterPermission"
>
<template #option="slotProps">
<div
@@ -354,6 +375,7 @@ export default {
type="text"
v-model="data.zgvmaort"
name="zgvmaort"
:disabled="!hasZGVMasterPermission"
>
</form-input>
<form-input
@@ -370,6 +392,7 @@ export default {
format="dd.MM.yyyy"
preview-format="dd.MM.yyyy"
:teleport="true"
:disabled="!hasZGVMasterPermission"
>
</form-input>
<form-input
@@ -379,6 +402,7 @@ export default {
type="select"
v-model="data.zgvmanation"
name="zgvmanation"
:disabled="!hasZGVMasterPermission"
>
<!-- TODO(chris): gesperrte nationen können nicht ausgewählt werden! Um das zu realisieren müsste man ein pseudo select machen -->
<option value="">&nbsp;</option>
@@ -400,6 +424,7 @@ export default {
dropdown
name="zgvdoktor_code"
@complete="filterDoktorZgvs"
:disabled="!hasZGVDoctorPermission"
>
<template #option="slotProps">
<div
@@ -418,6 +443,7 @@ export default {
type="text"
v-model="data.zgvdoktorort"
name="zgvdoktorort"
:disabled="!hasZGVDoctorPermission"
>
</form-input>
<form-input
@@ -434,6 +460,7 @@ export default {
format="dd.MM.yyyy"
preview-format="dd.MM.yyyy"
:teleport="true"
:disabled="!hasZGVDoctorPermission"
>
</form-input>
<form-input
@@ -443,6 +470,7 @@ export default {
type="select"
v-model="data.zgvdoktornation"
name="zgvdoktornation"
:disabled="!hasZGVDoctorPermission"
>
<!-- TODO(chris): gesperrte nationen können nicht ausgewählt werden! Um das zu realisieren müsste man ein pseudo select machen -->
<option value="">&nbsp;</option>
@@ -459,6 +487,7 @@ export default {
type="checkbox"
v-model="data.zgv_erfuellt"
name="zgv_erfuellt"
:disabled="!hasZGVBakkPermission"
>
</form-input>
</div>
@@ -470,6 +499,7 @@ export default {
type="checkbox"
v-model="data.zgvmas_erfuellt"
name="zgvmas_erfuellt"
:disabled="!hasZGVMasterPermission"
>
</form-input>
</div>
@@ -481,6 +511,7 @@ export default {
type="checkbox"
v-model="data.zgvdoktor_erfuellt"
name="zgvdoktor_erfuellt"
:disabled="!hasZGVDoctorPermission"
>
</form-input>
</div>
@@ -601,6 +632,7 @@ export default {
type="checkbox"
v-model="data.bismelden"
name="bismelden"
:disabled="!hasBismeldenPermission"
>
</form-input>
</div>
@@ -51,7 +51,8 @@ export default{
}
},
props: {
modelValue: Object
modelValue: Object,
config: Object,
},
data() {
return {
@@ -175,15 +176,18 @@ export default{
const data = cell.getData();
let button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-forward"></i>';
button.title = this.$p.t('ui', 'btn_statusVorruecken');
button.addEventListener('click', () =>
this.actionAdvanceStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
if (!['Student', 'Diplomand', 'Unterbrecher'].includes(data.status_kurzbz))
button.disabled = true;
container.append(button);
if (this.config?.showStatusVorruecken !== false)
{
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-forward"></i>';
button.title = this.$p.t('ui', 'btn_statusVorruecken');
button.addEventListener('click', () =>
this.actionAdvanceStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
if (!['Student', 'Diplomand', 'Unterbrecher'].includes(data.status_kurzbz))
button.disabled = true;
container.append(button);
}
button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
@@ -203,8 +207,8 @@ export default{
button.addEventListener('click', () =>
this.actionEditStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
if (this.dataMeldestichtag && this.dataMeldestichtag > data.datum && !this.hasPermissionToSkipStatusCheck)
button.disabled = true;
/* if (this.dataMeldestichtag && this.dataMeldestichtag > data.datum && !this.hasPermissionToSkipStatusCheck)
button.disabled = true;*/
container.append(button);
button = document.createElement('button');
@@ -227,15 +231,15 @@ export default{
const rowData = row.getData();
if (this.dataMeldestichtag && this.dataMeldestichtag > rowData.datum)
{
row.getElement().classList.add('disabled');
row.getElement().classList.add('text-black','text-opacity-50','fst-italic');
}
},
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
selectable: false,
index: 'statusId',
persistenceID: 'stv-multistatus'
persistenceID: 'stv-multistatus-2025112401'
},
tabulatorEvents: [
{
@@ -40,6 +40,9 @@ export default {
}
return lehreinheiten;
},
firmenverwaltungLink(){
return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'vilesci/stammdaten/firma_frameset.html';
}
},
props: {
@@ -66,10 +69,13 @@ export default {
final: true,
anmerkung: null
},
studiensemester: null,
arrTypen: [],
arrFirmen: [],
arrLvs: [],
arrNoten: [],
arrStudiensemester: [],
additional_lehrveranstaltung_id: null,
filteredFirmen: [],
abortController: {
firma: null
@@ -100,7 +106,11 @@ export default {
this.formData.anmerkung = null;
this.$refs.formDetails.clearValidation();
},
getFormData(statusNew, studiensemester_kurzbz, additional_lehrveranstaltung_id) {
getFormData(newProjektarbeit, studiensemester_kurzbz, additional_lehrveranstaltung_id) {
this.additional_lehrveranstaltung_id = additional_lehrveranstaltung_id;
this.studiensemester = studiensemester_kurzbz || this.defaultSemester;
this.newProjektarbeit = newProjektarbeit;
this.$api
.call(ApiStvProjektarbeit.getTypenProjektarbeit())
@@ -109,18 +119,7 @@ export default {
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvProjektarbeit.getLehrveranstaltungen(
this.student.uid,
statusNew ? this.student.studiengang_kz : null,
studiensemester_kurzbz ?? this.defaultSemester,
additional_lehrveranstaltung_id
))
.then(result => {
this.arrLvs = result.data
}
)
.catch(this.$fhcAlert.handleSystemError);
this.getLehrveranstaltungen();
this.$api
.call(ApiStvProjektarbeit.getNoten())
@@ -129,7 +128,14 @@ export default {
})
.catch(this.$fhcAlert.handleSystemError);
if (statusNew) this.resetForm();
this.$api
.call(ApiStvProjektarbeit.getStudiensemester())
.then(result => {
this.arrStudiensemester = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
if (this.newProjektarbeit) this.resetForm();
},
loadProjektarbeit(projektarbeit_id) {
@@ -175,9 +181,30 @@ export default {
this.filteredFirmen = result.data;
});
},
getLehrveranstaltungen() {
return this.$api
.call(ApiStvProjektarbeit.getLehrveranstaltungen(
this.student.uid,
this.newProjektarbeit ? this.student.studiengang_kz : null,
this.studiensemester,
this.additional_lehrveranstaltung_id
))
.then(result => {
this.arrLvs = result.data
}
)
.catch(this.$fhcAlert.handleSystemError);
},
lvChanged(event) {
this.formData.lehreinheit_id = null;
},
studiensemesterChanged() {
this.formData.lehreinheit_id = null;
this.getLehrveranstaltungen();
},
gesperrtBisChanged(newSperrdatum) {
this.formData.freigegeben = newSperrdatum == null || newSperrdatum == '';
},
// enrich and modify data before sending
getPreparedFormData() {
let preparedFormData = JSON.parse(JSON.stringify(this.formData)); // deep copy
@@ -255,23 +282,30 @@ export default {
<div class="row mb-3">
<form-input
container-class="stv-details-projektarbeit-firma"
:label="$p.t('projektarbeit', 'firma')"
type="autocomplete"
optionLabel="name"
v-model="formData.firma"
name="firma"
:suggestions="filteredFirmen"
@complete="searchFirma"
:min-length="3"
>
</form-input>
<div class="col-10">
<form-input
container-class="stv-details-projektarbeit-firma"
:label="$p.t('projektarbeit', 'firma')"
type="autocomplete"
optionLabel="name"
v-model="formData.firma"
name="firma"
:suggestions="filteredFirmen"
@complete="searchFirma"
:min-length="3"
>
</form-input>
</div>
<div class="col-2 align-content-center">
<a :href="firmenverwaltungLink" target="_blank">
{{ $p.t('projektarbeit', 'zurFirmenverwaltung') }}
</a>
</div>
</div>
<div class="row mb-3">
<form-input
container-class="stv-details-projektarbeit-lv"
container-class="stv-details-projektarbeit-lv col-10"
:label="$p.t('projektarbeit', 'lehrveranstaltung')"
type="select"
v-model="formData.lehrveranstaltung_id"
@@ -287,6 +321,23 @@ export default {
{{lv.bezeichnung + (lv.orgform_kurzbz ? ' ' + lv.orgform_kurzbz : '') + ' (' + lv.semester + ' Sem) ID: ' + lv.lehrveranstaltung_id}}
</option>
</form-input>
<form-input
container-class="col-2"
:label="$p.t('lehre', 'studiensemester')"
type="select"
v-model="studiensemester"
name="studiensemester"
@change="studiensemesterChanged"
>
<option :value="null"> -- {{$p.t('fehlermonitoring', 'keineAuswahl')}} -- </option>
<option
v-for="sem in arrStudiensemester"
:key="sem.studiensemester_kurzbz"
:value="sem.studiensemester_kurzbz"
>
{{sem.studiensemester_kurzbz}}
</option>
</form-input>
</div>
<div class="row mb-3">
@@ -352,6 +403,7 @@ export default {
format="dd.MM.yyyy"
model-type="yyyy-MM-dd"
name="gesperrtbis"
@update:model-value="gesperrtBisChanged"
>
</form-input>
<div class="col-4">
@@ -47,16 +47,25 @@ export default {
{
event: 'tableBuilt',
handler: async() => {
await this.$p.loadCategory(['global', 'person', 'stv', 'ui', 'projektarbeit']);
await this.$p.loadCategory(['global', 'person', 'lehre', 'stv', 'ui', 'projektarbeit']);
let cm = this.$refs.table.tabulator.columnManager;
cm.getColumnByField('projekttyp_kurzbz').component.updateDefinition({
title: this.$p.t('projektarbeit', 'typ_kurzbz')
});
cm.getColumnByField('bezeichnung').component.updateDefinition({
title: this.$p.t('projektarbeit', 'typ')
});
cm.getColumnByField('studiensemester_kurzbz').component.updateDefinition({
title: this.$p.t('lehre', 'studiensemester')
});
cm.getColumnByField('titel').component.updateDefinition({
title: this.$p.t('projektarbeit', 'titel')
});
cm.getColumnByField('note').component.updateDefinition({
title: this.$p.t('projektarbeit', 'gesamtnote')
});
cm.getColumnByField('beginn').component.updateDefinition({
title: this.$p.t('projektarbeit', 'beginn')
});
@@ -78,6 +87,12 @@ export default {
cm.getColumnByField('firma_id').component.updateDefinition({
title: this.$p.t('projektarbeit', 'firmaId')
});
cm.getColumnByField('abgabedatum').component.updateDefinition({
title: this.$p.t('projektarbeit', 'abgabeEndupload')
});
cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});
}
},
],
@@ -101,6 +116,7 @@ export default {
{title: "Typ Kurzbz", field: "projekttyp_kurzbz", visible: false},
{title: "Studiensemester", field: "studiensemester_kurzbz"},
{title: "Titel", field: "titel"},
{title: "Gesamtnote", field: "note"},
{
title: "Abgabe Enduplad",
field: "abgabedatum",
@@ -183,6 +199,7 @@ export default {
{title: "Anmerkung", field: "anmerkung", visible: false},
{title: "Lehreinheit ID", field: "lehreinheit_id", visible: false},
{title: "Student UID", field: "student_uid", visible: false},
{title: "Projektbetreuer", field: "projektbetreuer"},
{
title:"Final",
field:"final",
@@ -240,7 +257,7 @@ export default {
frozen: true
},
],
//layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
height: 'auto',
minHeight: '200',
selectable: 1,
@@ -248,7 +265,7 @@ export default {
persistence:{
columns: true, //persist column layout
},
persistenceID: 'stv-details-projektarbeit'
persistenceID: 'stv-details-projektarbeit-2025112401'
}
return options;
}
@@ -258,7 +275,7 @@ export default {
this.statusNew = true;
this.editedProjektarbeit = null;
this.toggleMenu('details');
this.$refs.projektarbeitDetails.getFormData(this.statusNew);
this.$refs.projektarbeitDetails.getFormData(this.statusNew, null, null);
this.$refs.projektarbeitModal.show();
},
actionEditProjektarbeit() {
@@ -388,7 +405,7 @@ export default {
<div class="tab-pane fade show" :class="activeTab == 'betreuer' ? 'active' : ''" id="betreuer" role="tabpanel" aria-labelledby="betreuer-tab">
<div class="row">
<div class="col-12">
<projektbetreuer ref="projektbetreuer" :config="config"></projektbetreuer>
<projektbetreuer ref="projektbetreuer" :config="config" @betreuer-saved="reload"></projektbetreuer>
</div>
</div>
</div>
@@ -396,8 +413,8 @@ export default {
<template #footer>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
<button v-if="statusNew" class="btn btn-primary" @click="addNewProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
<button v-if="!statusNew && activeTab == 'details'" class="btn btn-primary" @click="updateProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
<button v-if="statusNew" class="btn btn-primary" @click="addNewProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
<button v-if="!statusNew && activeTab == 'details'" class="btn btn-primary" @click="updateProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
</template>
</bs-modal>
@@ -20,6 +20,7 @@ export default {
Contact,
Vertrag
},
emits: ['betreuerSaved'],
provide() {
return {
configShowVertragsdetails: this.config.showVertragsdetails
@@ -115,7 +116,7 @@ export default {
frozen: true
},
],
//layout: 'fitDataFill',
layout: 'fitData',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: '100',
@@ -125,13 +126,49 @@ export default {
persistence:{
columns: true, //persist column layout
},
persistenceID: 'stv-details-projektbetreuer'
persistenceID: 'stv-details-projektbetreuer-2025121201'
},
tabulatorEvents: [
{
event: 'tableBuilt',
handler: async() => {
await this.$p.loadCategory(['global', 'person', 'stv', 'projektarbeit', 'ui']);
await this.$p.loadCategory(['global', 'person', 'lehre', 'stv', 'projektarbeit', 'ui']);
let cm = this.$refs.projektbetreuerTable.tabulator.columnManager;
cm.getColumnByField('nachname').component.updateDefinition({
title: this.$p.t('person', 'nachname')
});
cm.getColumnByField('vorname').component.updateDefinition({
title: this.$p.t('person', 'vorname')
});
cm.getColumnByField('note').component.updateDefinition({
title: this.$p.t('projektarbeit', 'note')
});
cm.getColumnByField('punkte').component.updateDefinition({
title: this.$p.t('projektarbeit', 'punkte')
});
cm.getColumnByField('stunden').component.updateDefinition({
title: this.$p.t('projektarbeit', 'stunden')
});
cm.getColumnByField('stundensatz').component.updateDefinition({
title: this.$p.t('projektarbeit', 'stundensatz')
});
cm.getColumnByField('betreuerart_kurzbz').component.updateDefinition({
title: this.$p.t('projektarbeit', 'betreuerart_kurzbz')
});
cm.getColumnByField('person_id').component.updateDefinition({
title: this.$p.t('person', 'person_id')
});
cm.getColumnByField('vertrag_id').component.updateDefinition({
title: this.$p.t('projektarbeit', 'vertrag_id')
});
cm.getColumnByField('projektarbeit_id').component.updateDefinition({
title: this.$p.t('projektarbeit', 'projektarbeit_id')
});
cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'actions')
});
// Force layout recalculation for handling overflow text
this.$refs.projektbetreuerTable.tabulator.redraw(true);
@@ -152,6 +189,7 @@ export default {
stunden: null,
stundensatz: null
},
defaultStundensatz: null,
newMode: false,
editMode: false,
initialFormData: null,
@@ -171,53 +209,49 @@ export default {
},
methods: {
actionNewProjektbetreuer() {
this.resetForm();
this.newMode = !this.newMode;
this.editMode = false;
this.resetForm();
this.defaultStundensatz = this.config.defaultProjektbetreuerStundensatz;
this.captureFormData();
},
actionEditProjektbetreuer(projektarbeit_id, person_id, betreuerart_kurzbz) {
this.editMode = true;
this.newMode = false;
this.$api
.call(ApiStvProjektbetreuer.getDefaultStundensaetze(person_id, this.studiensemester_kurzbz))
.then(result => {
this.resetForm();
this.resetForm();
this.getDefaultStundensaetze(person_id).finally(() => {
// get betreuer from tabulator list
let projektbetreuerListe = this.$refs.projektbetreuerTable.tabulator.getData();
const idx = projektbetreuerListe.findIndex(
betr =>
betr.person_id === person_id &&
betr.projektarbeit_id === projektarbeit_id &&
betr.betreuerart_kurzbz === betreuerart_kurzbz
);
// get betreuer from tabulator list
let projektbetreuerListe = this.$refs.projektbetreuerTable.tabulator.getData();
const idx = projektbetreuerListe.findIndex(
betr =>
betr.person_id === person_id &&
betr.projektarbeit_id === projektarbeit_id &&
betr.betreuerart_kurzbz === betreuerart_kurzbz
);
if (idx >= 0) { // if betreuer found
if (idx >= 0) { // if betreuer found
// set currently edited betreuer (deep copy)
this.formData = JSON.parse(JSON.stringify(projektbetreuerListe[idx]));
// set currently edited betreuer (deep copy)
this.formData = JSON.parse(JSON.stringify(projektbetreuerListe[idx]));
// set download link
if (this.formData.beurteilungDownloadLink !== null) this.beurteilungDownloadLink = this.formData.beurteilungDownloadLink;
// set download link
if (this.formData.beurteilungDownloadLink !== null) this.beurteilungDownloadLink = this.formData.beurteilungDownloadLink;
// set betreuer for autocomplete field
this.autocompleteSelectedBetreuer = {
person_id: this.formData.person_id,
name: this.formData.name,
vorname: this.formData.vorname,
nachname: this.formData.nachname,
vertrag_id: this.formData.vertrag_id
};
}
// set betreuer for autocomplete field
this.autocompleteSelectedBetreuer = {
person_id: this.formData.person_id,
name: this.formData.name,
vorname: this.formData.vorname,
nachname: this.formData.nachname,
vertrag_id: this.formData.vertrag_id
};
}
// set default stundensatz (if no other is set yet)
if (this.formData.stundensatz == null) this.formData.stundensatz = result.data;
// capture initial form data for detecting changes
this.captureFormData();
});
// capture initial form data for detecting changes
this.captureFormData();
})
.catch(this.$fhcAlert.handleSystemError);
},
actionDeleteProjektbetreuer(betreuer_id, projektarbeit_id, person_id, betreuerart_kurzbz) {
this.$fhcAlert
@@ -239,6 +273,7 @@ export default {
// default Stundensätze from config
this.defaultFormDataValues.stunden = this.getDefaultStunden(projekttyp_kurzbz);
this.defaultFormDataValues.stundensatz = this.config.defaultProjektbetreuerStundensatz;
this.defaultStundensatz = this.config.defaultProjektbetreuerStundensatz;
// get other initial data
this.$api
@@ -271,7 +306,7 @@ export default {
})
.catch(this.$fhcAlert.handleSystemError);
} else {
this.emptyBetreuer();
this.emptyBetreuerList();
}
},
saveProjektbetreuer() {
@@ -282,6 +317,7 @@ export default {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.getProjektbetreuer(this.projektarbeit_id, this.studiensemester_kurzbz);
this.resetModes();
this.$emit('betreuerSaved');
})
.catch(this.$fhcAlert.handleSystemError);
},
@@ -297,11 +333,12 @@ export default {
this.filteredBetreuer = result.data;
});
},
emptyBetreuer() {
emptyBetreuerList() {
this.$refs.projektbetreuerTable.tabulator.clearData();
},
resetForm() {
this.formData = this.getDefaultFormData();
const defaultFormData = this.getDefaultFormData();
this.formData = defaultFormData;
if (this.beurteilungDownloadLink !== null) this.beurteilungDownloadLink = '';
this.autocompleteSelectedBetreuer = null;
this.initialFormData = null;
@@ -360,28 +397,24 @@ export default {
},
setDefaultStunden(projekttyp_kurzbz) {
this.projekttyp_kurzbz = projekttyp_kurzbz;
// if form data has not already been modified by user, set the default stunden
if (!this.formDataModified()) {
// set default stunden if not in edit mode (so hours of editen person are not overwritten)
if (!this.editMode)
{
let defaultStunden = this.getDefaultStunden(projekttyp_kurzbz);
// adapt initial form data so it does not count as modified
if (this.initialFormData) this.initialFormData.stunden = defaultStunden;
// set default Stunden
this.formData.stunden = defaultStunden;
}
},
// check if form data has been modified since initial data has been captured
formDataModified() {
if (this.autocompleteSelectedBetreuer != null) return true;
for (const prop in this.initialFormData) {
if (typeof this.formData[prop] == 'undefined') return true;
if (this.formData[prop] != this.initialFormData[prop]) return true;
}
return false;
getDefaultStundensaetze(person_id) {
return this.$api
.call(ApiStvProjektbetreuer.getDefaultStundensaetze(person_id, this.studiensemester_kurzbz))
.then(result => {
// set default stundensatz (if no other is set yet)
this.defaultStundensatz = result.data;
this.formData.stundensatz = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
actionNewPerson() {
this.$refs.newPersonModal.reset();
this.$refs.newPersonModal.open();
},
actionKontaktdatenBearbeiten() {
@@ -395,12 +428,16 @@ export default {
.then(response => {
// set the new person in Betreuer autocomplete field
this.autocompleteSelectedBetreuer = response.data;
this.getDefaultStundensaetze(this.autocompleteSelectedBetreuer.person_id);
})
.catch(this.$fhcAlert.handleSystemError)
},
// disable fields which are dependent on Vertrag status
disableVertragFields(statusAkzeptiert) {
this.vertragFieldsDisabled = statusAkzeptiert;
},
onBetreuerSelected(ev) {
this.getDefaultStundensaetze(ev.value.person_id);
}
},
template: `
@@ -422,7 +459,7 @@ export default {
>
</core-filter-cmpt>
<form-form ref="formProjektbetreuer" v-show="betreuerFormOpened" @submit.prevent>
<form-form ref="formProjektbetreuer" v-show="betreuerFormOpened" class="mt-3" @submit.prevent >
<div class="row mb-3">
<form-input
container-class="stv-details-projektarbeit-betreuer"
@@ -433,6 +470,8 @@ export default {
name="person_id"
:suggestions="filteredBetreuer"
@complete="searchBetreuer"
@item-select="onBetreuerSelected"
@option-select="onBetreuerSelected"
:min-length="3"
:disabled="vertragFieldsDisabled"
>
@@ -502,7 +541,7 @@ export default {
container-class="stv-details-projektarbeit-stundensatz"
type="text"
name="stundensatz"
:label="$p.t('projektarbeit', 'stundensatz')"
:label="$p.t('projektarbeit', 'stundensatz') + (defaultStundensatz ? ' (Default ' + defaultStundensatz + ')' : '')"
:disabled="vertragFieldsDisabled"
v-model="formData.stundensatz"
>
@@ -46,8 +46,6 @@ export default{
{title: "Punkte", field: "punkte", visible: false},
{
title: 'Aktionen', field: 'actions',
minWidth: 150,
maxWidth: 150,
formatter: (cell, formatterParams, onRendered) => {
let container = document.createElement('div');
container.className = "d-flex gap-2";
@@ -93,7 +91,7 @@ export default{
layoutColumnsOnNewData: false,
height: 'auto',
index: 'pruefung_id',
persistenceID: 'stv-details-pruefung-list'
persistenceID: 'stv-details-pruefung-list-2025112402'
},
tabulatorEvents: [
{
@@ -148,7 +146,6 @@ export default{
listMas: [],
listMarks: [],
zeugnisData: [],
checkData:[],
filter: false,
statusNew: true,
isStartDropDown: false,
@@ -181,7 +178,7 @@ export default{
this.pruefungData.student_uid = this.uid;
this.pruefungData.note = 9;
this.pruefungData.datum = new Date();
this.pruefungData.datum = luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate();
this.pruefungData.pruefungstyp_kurzbz = null;
if(lv_id){
this.pruefungData.lehrveranstaltung_id = lv_id;
@@ -193,7 +190,7 @@ export default{
this.isStartDropDown = false;
this.loadPruefung(pruefung_id).then(() => {
this.pruefungData.note = 9;
this.pruefungData.datum = new Date();
this.pruefungData.datum = luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate();
this.pruefungData.pruefungstyp_kurzbz = null;
this.pruefungData.anmerkung = null;
this.prepareDropdowns();
@@ -229,9 +226,8 @@ export default{
return this.$refs.examData
.call(ApiStvExam.addPruefung(this.pruefungData))
.then(response => {
this.checkData = response.data;
if (this.checkData === 2 || this.checkData === 5)
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
if (response.data)
this.$fhcAlert.alertDefault('info', 'Info', response.data, true);
else
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('pruefungModal');
@@ -243,12 +239,13 @@ export default{
});
},
updatePruefung(pruefung_id){
this.checkChangeAfterExamDate();
return this.$refs.examData
.call(ApiStvExam.updatePruefung(pruefung_id, this.pruefungData))
.then(response => {
this.checkData = response.data;
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
if (response.data)
this.$fhcAlert.alertDefault('info', 'Info', response.data, true);
else
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('pruefungModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
@@ -266,27 +263,6 @@ export default{
else
this.showHint = false;
},
checkChangeAfterExamDate() {
const data = {
student_uid: this.pruefungData.student_uid,
studiensemester_kurzbz: this.pruefungData.studiensemester_kurzbz,
lehrveranstaltung_id: this.pruefungData.lehrveranstaltung_id
};
return this.$api
.call(ApiStvExam.checkZeugnisnoteLv(data))
.then(result => {
this.zeugnisData = result.data;
let checkDate = this.zeugnisData[0].uebernahmedatum === '' ||
this.zeugnisData[0].benotungsdatum > this.zeugnisData[0].uebernahmedatum
? this.zeugnisData[0].benotungsdatum
: this.zeugnisData[0].uebernahmedatum;
if (checkDate >= this.pruefungData.datum
&& this.pruefungData.note !== this.zeugnisData[0].note) {
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
}
})
.catch(this.$fhcAlert.handleSystemError);
},
deletePruefung(pruefung_id) {
return this.$api
.call(ApiStvExam.deletePruefung(pruefung_id))
@@ -534,6 +510,7 @@ export default{
container-class="mb-3"
type="DatePicker"
v-model="pruefungData.datum"
model-type="yyyy-MM-dd"
name="datum"
:label="$p.t('global/datum')"
auto-apply
@@ -185,24 +185,10 @@ export default{
.then(result => this.statusgruende = result.data)
.catch(this.$fhcAlert.handleSystemError);
//TODO(Manu) check why it is/was hard coded
this.$api
.call(ApiStvStatus.getStati())
.then(result => this.stati = result.data)
.catch(this.$fhcAlert.handleSystemError);
/* this.stati = [
{ status_kurzbz: 'Interessent', bezeichnung: 'Interessent'},
{ status_kurzbz: 'Bewerber', bezeichnung: 'Bewerber'},
{ status_kurzbz: 'Aufgenommener', bezeichnung: 'Aufgenommener'},
{ status_kurzbz: 'Student', bezeichnung: 'Student'},
{ status_kurzbz: 'Unterbrecher', bezeichnung: 'Unterbrecher'},
{ status_kurzbz: 'Diplomand', bezeichnung: 'Diplomand'},
{ status_kurzbz: 'Incoming', bezeichnung: 'Incoming'},
{ status_kurzbz: 'Absolvent', bezeichnung: 'Absolvent'},
{ status_kurzbz: 'Abbrecher', bezeichnung: 'Abbrecher'},
{ status_kurzbz: 'Abgewiesener', bezeichnung: 'Abgewiesener'},
{ status_kurzbz: 'Wartender', bezeichnung: 'Wartender'}
];*/
},
template: `
<bs-modal class="stv-status-modal" ref="modal" dialog-class="modal-dialog-scrollable">
@@ -220,7 +206,7 @@ export default{
<p v-if="bisLocked && isStatusBeforeStudent">
<b>{{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrundSemester')}}</b>
</p>
<form-input
container-class="mb-3"
type="select"
@@ -353,7 +339,6 @@ export default{
v-model="formData.anmerkung"
name="anmerkung"
:label="$p.t('global/anmerkung')"
:disabled="bisLocked"
>
</form-input>
<form-input
@@ -2,6 +2,8 @@ import {CoreFilterCmpt} from "../../filter/Filter.js";
import ListNew from './List/New.js';
import ListFilter from './List/Filter.js';
import { capitalize } from '../../../helpers/StringHelpers.js';
import draggable from '../../../directives/draggable.js';
export default {
@@ -133,7 +135,17 @@ export default {
{
return Promise.resolve({ data: []});
}
return this.$api.call({method: 'post', url, params});
/**
* NOTE(chris): Because of a bug in Tabulator
* we need to get the params from elsewhere.
* @see https://github.com/olifolkerd/tabulator/issues/4318
*/
const apiconfig = {
...this.tabulatorOptions.ajaxConfig,
url: this.tabulatorOptions.ajaxURL,
params: this.tabulatorOptions.ajaxParams
};
return this.$api.call(apiconfig);
},
ajaxResponse: (url, params, response) => {
return response?.data;
@@ -175,7 +187,7 @@ export default {
count: 0,
filteredcount: 0,
selectedcount: 0,
currentEndpointRawUrl: ''
currentEndpoint: null
}
},
computed: {
@@ -228,7 +240,84 @@ export default {
return "StudentList_" + today + ".csv";
}
},
watch: {
'$p.user_language.value'(n, o) {
if (n !== o && o !== undefined && this.$refs.table.tableBuilt) {
this.translateTabulator();
}
}
},
methods: {
translateTabulator() {
this.$p
.loadCategory(['global', 'person', 'lehre', 'ui', 'profilUpdate', 'admission', 'stv'])
.then(() => {
const translations = {
uid: capitalize(this.$p.t('person/uid')),
titelpre: capitalize(this.$p.t('person/titelpre')),
nachname: capitalize(this.$p.t('person/nachname')),
vorname: capitalize(this.$p.t('person/vorname')),
wahlname: capitalize(this.$p.t('person/wahlname')),
vornamen: capitalize(this.$p.t('person/vornamen')),
titelpost: capitalize(this.$p.t('person/titelpost')),
ersatzkennzeichen: capitalize(this.$p.t('person/ersatzkennzeichen')),
gebdatum: capitalize(this.$p.t('person/geburtsdatum')),
geschlecht: capitalize(this.$p.t('person/geschlecht')),
semester: capitalize(this.$p.t('lehre/sem')),
verband: capitalize(this.$p.t('lehre/verb')),
gruppe: capitalize(this.$p.t('lehre/grp')),
studiengang: capitalize(this.$p.t('lehre/studiengang')),
studiengang_kz: capitalize(this.$p.t('lehre/studiengang_kz')),
matrikelnr: capitalize(this.$p.t('person/personenkennzeichen')),
person_id: capitalize(this.$p.t('person/person_id')),
status: capitalize(this.$p.t('global/status')),
status_datum: capitalize(this.$p.t('profilUpdate/statusDate')),
status_bestaetigung: capitalize(this.$p.t('global/status_bestaetigung')),
mail_privat: capitalize(this.$p.t('person/email_private')),
mail_intern: capitalize(this.$p.t('person/email_intern')),
anmerkungen: capitalize(this.$p.t('stv/notes_person')),
anmerkung: capitalize(this.$p.t('stv/notes_prestudent')),
orgform_kurzbz: capitalize(this.$p.t('lehre/orgform')),
aufmerksamdurch_kurzbz: capitalize(this.$p.t('person/aufmerksamDurch')),
punkte: capitalize(this.$p.t('admission/gesamtpunkte')),
aufnahmegruppe_kurzbz: capitalize(this.$p.t('stv/aufnahmegruppe_kurzbz')),
dual: capitalize(this.$p.t('lehre/dual_short')),
matr_nr: capitalize(this.$p.t('person/matrikelnummer')),
studienplan_bezeichnung: capitalize(this.$p.t('lehre/studienplan')),
prestudent_id: capitalize(this.$p.t('ui/prestudent_id')),
priorisierung_relativ: capitalize(this.$p.t('lehre/prioritaet')),
mentor: capitalize(this.$p.t('stv/mentor')),
bnaktiv: capitalize(this.$p.t('person/aktiv'))
};
/** NOTE(chris):
* use this approach because updateDefinition
* on the Tabulator columns is way slower and
* freezes up the GUI.
*/
// Overwrite definition for column show/hide
this.$refs.table.tabulator.getColumns().forEach(col => {
const trans = translations[col.getField()];
if (!trans)
return;
col.getDefinition().title = trans;
});
// Overwrite node in dom
this.$refs.table.tabulator.element
.querySelectorAll('.tabulator-col[tabulator-field]')
.forEach(el => {
const field = el.getAttribute('tabulator-field');
if (!translations[field])
return;
const title = el.querySelector('.tabulator-col-title');
if (!title)
return;
title.innerText = translations[field];
});
});
},
reload() {
this.$refs.table.reloadTable();
},
@@ -273,16 +362,20 @@ export default {
updateUrl(endpoint, first) {
this.lastSelected = first ? undefined : this.selected;
if( endpoint === undefined )
console.log('function param endpoint: ' + JSON.stringify(endpoint));
console.log('current endpoint: ' + JSON.stringify(this.currentEndpoint));
if( endpoint === undefined && this.currentEndpoint === null)
{
endpoint = {url: this.currentEndpointRawUrl};
}
else if( endpoint.url === undefined )
endpoint = { url: '' };
}
else if( endpoint === undefined )
{
endpoint.url = this.currentEndpointRawUrl;
} else
endpoint = JSON.parse(JSON.stringify(this.currentEndpoint));
}
else
{
this.currentEndpointRawUrl = endpoint.url;
this.currentEndpoint = JSON.parse(JSON.stringify(endpoint));
}
endpoint.url = endpoint.url.replace(
@@ -290,20 +383,25 @@ export default {
encodeURIComponent(this.currentSemester)
);
const params = {};
if (this.filter.length)
const params = (endpoint?.params !== undefined) ? endpoint.params : {};
let method = (endpoint?.method !== undefined) ? endpoint.method : 'get';
if (this.filter.length && !endpoint.url.match(/\/search\//))
{
params.filter = this.filter;
method = 'post';
}
this.tabulatorOptions.ajaxURL = endpoint.url;
this.tabulatorOptions.ajaxParams = { ...params };
this.tabulatorOptions.ajaxConfig = {method};
if (!this.$refs.table.tableBuilt) {
if (!this.$refs.table.tabulator) {
this.tabulatorOptions.ajaxURL = endpoint.url;
this.tabulatorOptions.ajaxParams = params;
} else
if (this.$refs.table.tabulator) {
this.$refs.table.tabulator.on("tableBuilt", () => {
this.$refs.table.tabulator.setData(endpoint.url, params);
this.$refs.table.tabulator.setData(endpoint.url, params, method);
});
}
} else
this.$refs.table.tabulator.setData(endpoint.url, params);
this.$refs.table.tabulator.setData(endpoint.url, params, method);
},
dragCleanup(evt) {
if (evt.dataTransfer.dropEffect == 'none')
@@ -397,11 +495,10 @@ export default {
:side-menu="false"
reload
:download="downloadConfig"
` + /* TODO(chris): Ausgeblendet für Testing
new-btn-show
*/`
:new-btn-label="$p.t('stv/action_new')"
@click:new="actionNewPrestudent"
@table-built="translateTabulator"
>
<template #filter>
<div class="card">
@@ -6,13 +6,18 @@ import FormInput from '../../../Form/Input.js';
import accessibility from '../../../../directives/accessibility.js';
import ApiStvStudents from '../../../../api/factory/stv/students.js';
import ApiStvAddress from '../../../../api/factory/stv/kontakt/address.js';
import ApiStudiensemester from '../../../../api/factory/studiensemester.js';
import ApiStudienplan from '../../../../api/factory/studienplan.js';
var _uuid = 0;
const FORMDATA_DEFAULT = {
address: {
func: 1,
checked: true,
nation: 'A'
},
vorname: '',
nachname: '',
geburtsnation: 'A',
staatsbuergerschaft: 'A',
ausbildungssemester: 1,
@@ -35,14 +40,14 @@ export default {
],
emits: ['saved'],
props: {
personOnly: Boolean,
personOnly: Boolean,
studiengangKz: Number,
studiensemesterKurzbz: String
},
data() {
return {
places: [],
formData: FORMDATA_DEFAULT,
formData: null,
suggestions: {},
person: null,
semester: [],
@@ -60,7 +65,7 @@ export default {
return this.formData;
},
orte() {
return this.places.filter(ort => ort.name == this.formData.address.gemeinde);
return this.places.filter(ort => ort.name == this.formData?.address.gemeinde);
},
gemeinden() {
return Object.values(this.places.reduce((res,place) => {
@@ -70,7 +75,7 @@ export default {
},
formDataStg: {
get() {
return this.formData.studiengang_kz !== undefined ? this.formData.studiengang_kz : this.studiengangKz;
return this.formData?.studiengang_kz !== undefined ? this.formData?.studiengang_kz : this.studiengangKz;
},
set(v) {
this.formData.studiengang_kz = v;
@@ -78,7 +83,7 @@ export default {
},
formDataSem: {
get() {
return this.formData.studiensemester_kurzbz !== undefined ? this.formData.studiensemester_kurzbz : this.studiensemesterKurzbz;
return this.formData?.studiensemester_kurzbz !== undefined ? this.formData?.studiensemester_kurzbz : this.studiensemesterKurzbz;
},
set(v) {
this.formData.studiensemester_kurzbz = v;
@@ -98,10 +103,10 @@ export default {
this.$refs.modal.show();
},
reset() {
this.formData = FORMDATA_DEFAULT;
this.formData = JSON.parse(JSON.stringify(FORMDATA_DEFAULT));
this.person = null;
this.suggestions = [];
this.$refs.form.clearValidation();
if (this.$refs.form) this.$refs.form.clearValidation();
},
loadSuggestions() {
if (this.abortController.suggestions)
@@ -112,10 +117,10 @@ export default {
this.abortController.suggestions = new AbortController();
this.$api
.call(ApiStvStudents.check({
vorname: this.formData.vorname,
nachname: this.formData.nachname,
gebdatum: this.formData.gebdatum
.call(ApiStvStudents.getPerson({
vorname: this.formData?.vorname,
nachname: this.formData?.nachname,
gebdatum: this.formData?.gebdatum
}), {
signal: this.abortController.suggestions.signal
})
@@ -134,41 +139,40 @@ export default {
loadPlaces() {
if (this.abortController.places)
this.abortController.places.abort();
if (this.formData.address.nation != 'A' || !this.formData.address.plz)
if (this.formData?.address?.nation != 'A' || !this?.formData?.address?.plz)
return;
this.abortController.places = new AbortController();
this.$refs.form
.get(
'api/frontend/v1/stv/address/getPlaces/' + this.formData.address.plz,
undefined,
{
signal: this.abortController.places.signal
}
)
.then(result => {
this.places = result.data
})
.catch(error => {
if (error.code != "ERR_CANCELED")
window.setTimeout(this.loadPlaces, 100);
else
this.$fhcAlert.handleSystemError(error);
});
this.$refs.form.call(
ApiStvAddress.getPlaces(this.formData?.address.plz)
//~ undefined,
//~ {
//~ signal: this.abortController.places.signal
//~ }
)
.then(result => {
this.places = result.data
})
.catch(error => {
if (error.code != "ERR_CANCELED")
window.setTimeout(this.loadPlaces, 100);
else
this.$fhcAlert.handleSystemError(error);
});
},
loadStudienplaene() {
if (this.formDataStg)
CoreRESTClient
.post('components/stv/studienplan/get', {
studiengang_kz: this.formDataStg,
studiensemester_kurzbz: this.formDataSem,
ausbildungssemester: this.formData.ausbildungssemester,
orgform_kurzbz: this.formData.orgform_kurzbz
})
.then(result => CoreRESTClient.getData(result.data) || [])
if (this.formDataStg) {
this.$api
.call(ApiStudienplan.getStudienplaeneBySemester(
this.formDataStg,
this.formDataSem,
this.formData?.ausbildungssemester,
this.formData?.orgform_kurzbz
))
.then(result => result.data || [])
.then(result => {
this.studienplaene = result;
if (this.formData.studienplan_id !== '' && !this.studienplaene.filter(plan => plan.studienplan_id == this.formData.studienplan_id).length)
if (this.formData?.studienplan_id !== '' && !this.studienplaene.filter(plan => plan.studienplan_id == this.formData?.studienplan_id).length)
this.formData.studienplan_id = '';
})
.catch(error => {
@@ -179,12 +183,13 @@ export default {
if (error.code != "ERR_CANCELED")
window.setTimeout(this.loadStudienplaene, 100);
})
}
},
changeAddressNation(e) {
if (this.formData['geburtsnation'] == this.formData['address']['nation'])
this.formData['geburtsnation'] = e.target.value;
if (this.formData['staatsbuergerschaft'] == this.formData['address']['nation'])
this.formData['staatsbuergerschaft'] = e.target.value;
if (this.formData.geburtsnation == this.formData?.address.nation)
this.formData.geburtsnation = e.target.value;
if (this.formData.staatsbuergerschaft == this.formData?.address.nation)
this.formData.staatsbuergerschaft = e.target.value;
this.loadPlaces();
},
send(e) {
@@ -213,29 +218,38 @@ export default {
setPerson(suggestion)
{
this.person = suggestion;
this.formData.address.func = -1;
this.formData.address.checked = false;
},
dateFormatter(val)
{
if (!val)
return '';
let date = new Date(val);
return date.toLocaleDateString('de-AT', {
"day": "2-digit",
"month": "2-digit",
"year": "numeric"
});
}
},
created() {
this.uuid = _uuid++;
CoreRESTClient
.get('components/stv/Studiensemester')
.then(result => CoreRESTClient.getData(result.data) || [])
.then(result => {
this.semester = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.reset();
this.$api.call(ApiStudiensemester.getAll())
.then(result => result.data || [])
.then(result => {
this.semester = result;
})
.catch(this.$fhcAlert.handleSystemError);
},
template: `
<fhc-form ref="form" class="stv-list-new" @submit.prevent="send">
<bs-modal ref="modal" dialog-class="modal-lg modal-dialog-scrollable" @hidden-bs-modal="reset">
<bs-modal ref="modal" dialog-class="modal-lg modal-dialog-scrollable" style="min-height: 500px" @hidden-bs-modal="reset">
<template #title>
{{ personOnly ? $p.t('person', 'personAnlegen') : $p.t('lehre', 'interessentAnlegen') }}
</template>
<template #default>
<form-validation></form-validation>
<template v-if="person === null">
<div class="row">
<div class="col-sm-4 mb-3">
@@ -275,16 +289,25 @@ export default {
@update:model-value="loadSuggestions"
text-input
auto-apply
no-today
no-today
:enable-time-picker="false"
format="dd.MM.yyyy"
:teleport="true"
>
</form-input>
</div>
</div>
<!-- TODO(chris): more details -->
<table class="table caption-top table-striped table-hover">
<table class="table caption-top table-striped table-hover" >
<caption>{{ $p.t('person', 'personExistiertPruefung') }}</caption>
<thead v-if="suggestions?.length">
<th>{{ $p.t('person', 'nachname') }}</th>
<th>{{ $p.t('person', 'vorname') }}</th>
<th>{{ $p.t('person', 'weitereVornamen') }}</th>
<th>{{ $p.t('person', 'geburtsdatum') }}</th>
<th>{{ $p.t('person', 'geschlecht') }}</th>
<th>{{ $p.t('person', 'adresse') }}</th>
<th>Status</th>
</thead>
<tbody>
<tr
v-for="(suggestion, index) in suggestions"
@@ -293,8 +316,21 @@ export default {
@click="(index == 2) ? suggestions.shift() : setPerson(suggestion)"
v-accessibility:tab.vertical
>
<td>{{suggestion.vorname + ' ' + suggestion.nachname}}</td>
<td></td>
<td>{{ suggestion.nachname }}</td>
<td>{{ suggestion.vorname }}</td>
<td>{{ suggestion.vornamen }}</td>
<td>{{ dateFormatter(suggestion.gebdatum) }}</td>
<td>{{ suggestion.geschlecht_bezeichnung }}</td>
<td>
<div v-for="adresse in suggestion.adressen">
{{ (adresse.plz ?? '') + (adresse.plz && adresse.ort ? ' ' : '') + (adresse.ort ?? '') + (adresse.ort && adresse.strasse ? ', ' : '') + (adresse.strasse ?? '') }}
</div>
</td>
<td>
<div v-for="status in suggestion.status">
{{ status.status_kurzbz + " " + status.studiengang_kuerzel }}
</div>
</td>
</tr>
</tbody>
</table>
@@ -418,23 +454,22 @@ export default {
</form-input>
</div>
</div>
<div class="row">
<div class="col-sm-6 mb-3">
<form-input
type="select"
id="stv-list-new-address-func"
name="address[func]"
v-model="formData['address']['func']"
:label="$p.t('person', 'adresseHinzufuegen')"
type="checkbox"
id="stv-new-adresse"
name="adresseChecked"
v-model="formData['address']['checked']"
value="true"
>
<option value="-1" v-if="person">{{ $p.t('person', 'bestehendeAdresseUeberschreiben') }}</option>
<option value="1">{{ $p.t('person', 'adresseHinzufuegen') }}</option>
<option value="0">{{ $p.t('person', 'adresseNichtAnlegen') }}</option>
</form-input>
</div>
</div>
<fieldset v-if="formData['address']['func'] != 0">
<fieldset v-if="formData['address']['checked']">
<hr>
<legend>Adresse</legend>
<div class="row">
<div class="col-sm-4 mb-3">
@@ -519,6 +554,7 @@ export default {
</form-input>
</div>
</div>
<hr>
</fieldset>
<div class="row">
@@ -644,7 +680,7 @@ export default {
name="ausbildungssemester"
v-model="formData['ausbildungssemester']"
:disabled="formData['incoming']"
@input="loadStudienplaene"
@change="loadStudienplaene"
>
<option v-for="sem in Array.from({length:8}).map((u,i) => i+1)" :key="sem" :value="sem">{{sem}}. Semester</option>
</form-input>
@@ -658,7 +694,7 @@ export default {
id="stv-list-new-orgform_kurzbz"
name="orgform_kurzbz"
v-model="formData['orgform_kurzbz']"
@input="loadStudienplaene"
@change="loadStudienplaene"
>
<option value="">-- keine Auswahl --</option>
<option v-for="orgform in lists.orgforms" :key="orgform.orgform_kurzbz" :value="orgform.orgform_kurzbz">{{orgform.bezeichnung}}</option>
@@ -679,7 +715,7 @@ export default {
</div>
<div class="row">
<div class="col-10 mb-3">
<div class="form-check">
<div>
<form-input
label="Incoming"
type="checkbox"
@@ -696,7 +732,7 @@ export default {
</template>
</template>
<template #footer>
<button v-if="person !== null" type="button" class="btn btn-secondary" @click="person = null; formData.address.func = 1;"><i class="fa fa-chevron-left"></i>{{ $p.t('ui', 'zurueck') }}</button>
<button v-if="person !== null" type="button" class="btn btn-secondary" @click="person = null; formData.address.checked = true;"><i class="fa fa-chevron-left"></i>{{ $p.t('ui', 'zurueck') }}</button>
<button type="submit" class="btn btn-primary">{{ person === null || personOnly ? $p.t('person', 'personAnlegen') : $p.t('lehre', 'interessentAnlegen') }}</button>
</template>
</bs-modal>
@@ -16,11 +16,17 @@ export default {
inject: {
$reloadList: {
from: '$reloadList',
required: true
default: () => {}
},
currentSemester: {
from: 'currentSemester',
required: true
},
appConfig: {
from: 'appConfig',
default: {
number_displayed_past_studiensemester: 5
}
}
},
emits: [
@@ -52,6 +58,9 @@ export default {
return this.nodes.filter(node => this.favorites.list.includes(node.key));
return this.nodes;
},
noSemReloadNodes() {
return this.nodes.reduce(this.mapNodesToNoSemReloadNodes, []);
}
},
watch: {
@@ -59,6 +68,14 @@ export default {
if (newVal !== oldVal) {
this.setPreselection();
}
},
'appConfig.number_displayed_past_studiensemester'(newVal, oldVal) {
if (oldVal !== undefined) {
this.noSemReloadNodes.forEach(node => {
delete node.children;
this.onExpandTreeNode(node);
});
}
}
},
methods: {
@@ -114,7 +131,14 @@ export default {
},
onSelectTreeNode(node) {
if (node.data.link)
this.$emit('selectVerband', {link: node.data.link, studiengang_kz: node.data.stg_kz});
this.$emit('selectVerband', {link: node.data.link, studiengang_kz: node.data.stg_kz, semester: node.data.semester, orgform_kurzbz: node.data.orgform_kurzbz});
},
mapNodesToNoSemReloadNodes(result, node) {
if (node.data.no_sem_reload)
result.push(node);
if (node.children)
result = node.children.reduce(this.mapNodesToNoSemReloadNodes, result);
return result;
},
mapResultToTreeData(el) {
const cp = {
@@ -187,22 +211,25 @@ export default {
if (!currentNode)
return;
const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean);
if (currentSelectedKey) {
if (currentSelectedKey == currentKey)
return;
/**
* Do not select a new entry if the current is a child of the new one.
* This happens if a child entry of a new stg is selected and the router
* tries to select the stg root entry (because subtrees do not have
* routes yet)
*/
const isChild = this.findNodeByKey(
currentSelectedKey,
currentNode.children
);
if (isChild)
return;
if(this.selectedKey)
{
const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean);
if (currentSelectedKey) {
if (currentSelectedKey == currentKey)
return;
/**
* Do not select a new entry if the current is a child of the new one.
* This happens if a child entry of a new stg is selected and the router
* tries to select the stg root entry (because subtrees do not have
* routes yet)
*/
const isChild = this.findNodeByKey(
currentSelectedKey,
currentNode.children || []
);
if (isChild)
return;
}
}
for (let i = 1; i < parts.length; i++)
+59 -3
View File
@@ -33,7 +33,8 @@ export default {
data() {
return {
current: null,
tabs: {}
tabs: {},
count: null
}
},
computed: {
@@ -113,10 +114,12 @@ export default {
};
}
if (Array.isArray(config))
if (Array.isArray(config)) {
config.forEach((item, key) => _addToTabs(key, item));
else
}
else {
Object.entries(config).forEach(([key, item]) => _addToTabs(key, item));
}
if (this.current === null || !tabs[this.current]) {
if (tabs[this.default])
@@ -129,6 +132,57 @@ export default {
updateSuffix() {
this.getTabSuffix(this.currentTab);
},
removeInvalidCountTabs(){
if(this.modelValue.length)
{
let countIst = this.modelValue.length;
const tabsToDelete = [];
Object.entries(this.config).forEach(([key, item]) => {
const target = item?.config ? item : item?.value || item;
// check config for validCountMulti
if (target.config?.validCountMulti !== undefined) {
let tab;
let countSoll;
tab = key;
countSoll = target.config.validCountMulti;
//check if tab is existing
if (countSoll !== undefined && countSoll == countIst) {
//add tab if it was removed before
if (tab in this.tabs == false) {
const value = Vue.reactive({
suffix: '',
showSuffix: item.showSuffix || false
});
this.tabs[tab] = {
component: Vue.markRaw(Vue.defineAsyncComponent(() => import(item.component))),
title: Vue.computed(() => item.title || tab),
config: item.config,
tab,
value,
suffixhelper: item.suffixhelper ?? null
};
}
}
//add to toDeleteArray if count is not allowed
if (countSoll !== undefined && countSoll !== countIst) {
tabsToDelete.push(tab);
}
}
});
// Delete all tabs with count not allowed
tabsToDelete.forEach(k => {
delete this.tabs[k];
});
}
},
async getTabSuffix(tab) {
if (!tab.value.showSuffix) {
return;
@@ -151,9 +205,11 @@ export default {
},
mounted() {
this.getTabSuffixes();
this.removeInvalidCountTabs();
},
updated() {
this.getTabSuffixes();
this.removeInvalidCountTabs();
},
template: `
<template v-if="useprimevue">
@@ -0,0 +1,62 @@
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
emits: [
'changed'
],
props: {
activeClass: {
type: String,
default: 'active'
},
itemClass: {
type: [String, Array, Object],
default: ''
}
},
data() {
return {
languages: FHC_JS_DATA_STORAGE_OBJECT.server_languages
};
},
methods:{
onChange(lang) {
if (this.languages.some(l => l.sprache === lang)) {
this.$p
.setLanguage(lang)
.then(() => {
if (document.querySelector('[cis4Reload]'))
window.location.reload();
else
this.$emit('changed', lang);
});
}
}
},
template: /*html*/`
<div class="navigation-language d-flex justify-content-center align-items-center flex-nowrap overflow-hidden">
<button
v-for="lang in languages"
:class="[itemClass, {[activeClass]: $p.user_language.value == lang.sprache}]"
:selected="$p.user_language.value == lang.sprache"
@click.prevent="onChange(lang.sprache)"
>
{{ lang.bezeichnung }}
</button>
</div>`
};
+43 -14
View File
@@ -23,7 +23,17 @@ export default {
mergedStudent,
mergedPerson
},
props: [ "searchoptions", "searchfunction" ],
props: {
searchoptions: {
type: Object,
required: true
},
searchfunction: {
type: Function,
required: true
},
showBtnSubmit: Boolean
},
provide() {
return {
query: Vue.computed(() => this.lastQuery)
@@ -102,11 +112,22 @@ export default {
>
<button
v-if="searchsettings.searchstr"
type="button"
class="searchbar_input_clear btn btn-outline-secondary"
@click="clearInput"
@focusin.stop
>
<i class="fas fa-close"></i>
</button>
<button
v-if="showBtnSubmit"
type="submit"
class="btn btn-primary"
:title="$p.t('search/submit')"
:aria-label="$p.t('search/submit')"
>
<i class="fas fa-search"></i>
</button>
<button
data-bs-toggle="collapse"
data-bs-target="#searchSettings"
@@ -219,12 +240,12 @@ export default {
});
}
},
methods: {
clearInput() {
this.searchsettings.searchstr = "";
this.hideresult();
this.$refs.input.focus()
},
methods: {
clearInput() {
this.searchsettings.searchstr = "";
this.hideresult();
this.$refs.input.focus();
},
getInitiallySelectedTypes() {
let result = false;
if (this.searchoptions.origin) {
@@ -283,13 +304,9 @@ export default {
this.calcSearchResultHeight();
},
search: function() {
if( this.searchtimer !== null ) {
clearTimeout(this.searchtimer);
}
if (this.abortController) {
this.abortController.abort();
this.abortController = null;
}
if(this.searchoptions?.nolivesearch === true) return;
this.abort();
if( this.searchsettings.searchstr.length >= 2 ) {
this.calcSearchResultExtent();
this.searchtimer = setTimeout(
@@ -300,6 +317,16 @@ export default {
this.showresult = false;
}
},
abort() {
if (this.searchtimer !== null) {
clearTimeout(this.searchtimer);
}
if (this.abortController) {
this.abortController.abort();
this.abortController = null;
}
this.searchresult = [];
},
callsearchapi: function() {
this.error = null;
this.searchresult.splice(0, this.searchresult.length);
@@ -392,6 +419,8 @@ export default {
window.removeEventListener('resize', this.calcSearchResultExtent);
},
showsearchresult: function() {
if(this.searchoptions?.nolivesearch === true) return;
if( this.searchsettings.searchstr.length >= 2 ) {
this.showresult = true;
window.addEventListener('resize', this.calcSearchResultExtent);
@@ -13,7 +13,7 @@ function parseFilterExpression(expression)
andParts.forEach(term => {
const comparisonMatch = term.match(/^(<=|>=|<|>|=|!=)\s*(\d+(?:[.,]\d+)?)$/);
const comparisonMatch = term.match(/^(<=|>=|<|>|=|!=)\s*(-?\d+(?:[.,]\d+)?)$/);
if (comparisonMatch)
{

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