mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Compare commits
640 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 81244a06ca | |||
| 64279bace2 | |||
| fde1623dc0 | |||
| 3687f63189 | |||
| 5b62271711 | |||
| 43813b3ef0 | |||
| aa5868826f | |||
| f03d218872 | |||
| 151012fedf | |||
| 1530726b0a | |||
| 250434b806 | |||
| 2e742a7913 | |||
| 5bfa8ca53c | |||
| 29d7a97ee8 | |||
| 20f9f52eef | |||
| 72217d9793 | |||
| c400e112fd | |||
| 3f88bba9bb | |||
| ca55b63e01 | |||
| ba7f60b16e | |||
| 6c0fa3fed3 | |||
| a02e79a33a | |||
| f4194c251a | |||
| d8dc19ef2f | |||
| 7868c2e073 | |||
| 55fbf40374 | |||
| e698564202 | |||
| adc66695e4 | |||
| 9e59caf7bc | |||
| a75234165b | |||
| 18f88b7697 | |||
| 5c3f5b26d3 | |||
| 14c24005fe | |||
| 9fa7e6e56c | |||
| b6585dc186 | |||
| b15adf7b23 | |||
| b6b21d54fc | |||
| 3e9dcf2911 | |||
| 98de634393 | |||
| f3be186c5a | |||
| ab5d0693eb | |||
| a4417bdd98 | |||
| a8efe3c109 | |||
| 4ceca78ebc | |||
| af1db47e1d | |||
| fa80c49eba | |||
| 483b6171c7 | |||
| 0e04138480 | |||
| a3963248dd | |||
| ea14fa1a4b | |||
| 734ab45264 | |||
| 1310dea4a5 | |||
| be0e2a6dca | |||
| 0f2f21aa19 | |||
| bbd41f17cc | |||
| c123ad0578 | |||
| 6b2d728143 | |||
| a6f18ae424 | |||
| 71495877f3 | |||
| 28e533fb3c | |||
| a1aff9bd0c | |||
| 66cbe5199a | |||
| b0d6212c5e | |||
| c93a4d2fb5 | |||
| 4932f21204 | |||
| 2d25e08227 | |||
| d0bebeaa4a | |||
| 594dbdca21 | |||
| 8142982ac7 | |||
| ca2256bb32 | |||
| ad8a18ed7d | |||
| 73e8761728 | |||
| cc779f3d27 | |||
| 2158e7a28d | |||
| a82df1058d | |||
| f9cf1a5b32 | |||
| 5b2bfb9340 | |||
| 89c546f74f | |||
| 18f36c9d23 | |||
| cb009529af | |||
| e56ccffe8d | |||
| 479d1a900f | |||
| 1d2a92f37f | |||
| 46855c9547 | |||
| 85f178fcf3 | |||
| 4bfc26006b | |||
| 05744f3921 | |||
| fad475fb64 | |||
| e0a2fba209 | |||
| 6e18d2ee2b | |||
| c7508d2b8c | |||
| c12169557b | |||
| f956db5889 | |||
| 8971f79a77 | |||
| fdb4eb5e7d | |||
| d37a8f1357 | |||
| ccace2f826 | |||
| 2254aa3643 | |||
| 684a741f2a | |||
| f53bca1ba6 | |||
| 2ed6f30bea | |||
| 73cbaf77f1 | |||
| aead4f3380 | |||
| c9331771b3 | |||
| dc496deadd | |||
| ecba22acfc | |||
| 01ca583167 | |||
| a1ee027ea4 | |||
| 548a3e39b9 | |||
| 6a008fc5da | |||
| d85bbac19b | |||
| 1bc957821e | |||
| 22d3b08a06 | |||
| 60ee3ec8f0 | |||
| 52dd2c56a2 | |||
| d06819f25f | |||
| b5c0c14e2a | |||
| 56f26e6ebe | |||
| 9d31cdffe6 | |||
| 95d3b6ac5b | |||
| af89ec3942 | |||
| c3b6a77dad | |||
| 16fdb0de69 | |||
| 9db6874dc4 | |||
| ebdd6a2040 | |||
| 6137cf3347 | |||
| b5ce0ba7ed | |||
| 5010a1653a | |||
| 0a25982fa2 | |||
| c5b246dc8e | |||
| 17d5cff178 | |||
| c1a53a1be3 | |||
| 3ab8fd22f4 | |||
| 23aeba4620 | |||
| e30ad887c9 | |||
| cda93ce85b | |||
| b618ad247a | |||
| 6c8b3b4ec4 | |||
| ad191f3f90 | |||
| 54bcf83781 | |||
| c828fe2ee4 | |||
| dc78660433 | |||
| a237cb1808 | |||
| af3588aa61 | |||
| 867a1e94c7 | |||
| 137c5f28ec | |||
| f9af5638f5 | |||
| 285af0a7f4 | |||
| 2d963c92cc | |||
| 4fcf4a57d1 | |||
| 1809ff3008 | |||
| d8bd100dbb | |||
| 31426d3c5e | |||
| 972e9b7025 | |||
| be3e4e552b | |||
| b1f3916e49 | |||
| 746ee76a3b | |||
| f71b0e500e | |||
| 9eeeeca62c | |||
| 9b11b19cf9 | |||
| e886b4742b | |||
| 4242f75fde | |||
| 47c956bf1e | |||
| 418a149840 | |||
| 91f3197c24 | |||
| e8c7ecf1ee | |||
| 2a77fb361a | |||
| 96f8ee33a9 | |||
| 38da37980d | |||
| 6fba58c113 | |||
| 0e1f4148f5 | |||
| 4175ecc209 | |||
| 07deb7b6c5 | |||
| 7f0d716bd8 | |||
| 60246100e6 | |||
| f81c9939f7 | |||
| 1b1f45e690 | |||
| fc4915a6ee | |||
| ca79bb1f82 | |||
| 2fe9bda46b | |||
| 20aaefffb1 | |||
| 86aac2388d | |||
| f3453670b3 | |||
| b23eaa2967 | |||
| 6e2c5acc6f | |||
| f8bbdf4b35 | |||
| a2a645b7c7 | |||
| 2dbbadea2e | |||
| 0f5c261528 | |||
| b93cfbfa9e | |||
| 7609554a74 | |||
| 26e63160ba | |||
| 7c365cea81 | |||
| db96dd1388 | |||
| c440711145 | |||
| 16366d976d | |||
| ac945ab540 | |||
| 0b51239f8c | |||
| 45816c0352 | |||
| 73a9d34fba | |||
| ac10473b08 | |||
| 571ae5f6e5 | |||
| 057b003977 | |||
| e6be6e19d1 | |||
| 754ed07621 | |||
| bf6fc52fcf | |||
| 294bfeb2e4 | |||
| b9bf2487c2 | |||
| 8da161120f | |||
| f9f0e238c6 | |||
| b468f01d0e | |||
| 376ce0e440 | |||
| 4a505631de | |||
| 1d938ea33d | |||
| 70aa0a9c9c | |||
| 743ba83148 | |||
| c7d2608cce | |||
| 672ee59ba5 | |||
| 95e8859896 | |||
| 9aa5f701f7 | |||
| fcd3733f3c | |||
| fab1022c49 | |||
| b8aadab509 | |||
| 08f79b69cb | |||
| 7bc1e8cdd9 | |||
| e784400943 | |||
| 8122ab0292 | |||
| c62198b4b5 | |||
| d200fc1961 | |||
| 913f45fcda | |||
| 3ea74ab23c | |||
| 353e2deaf7 | |||
| f9be090bbf | |||
| b77e715bdb | |||
| c9e947831e | |||
| 44141ce8d8 | |||
| 9dc36af7fc | |||
| 5c018e204e | |||
| 61c6245e1a | |||
| da0dc0e053 | |||
| d0d42a6a15 | |||
| 9550457b24 | |||
| d1eaebba33 | |||
| d689e8fb2f | |||
| d50ba773fe | |||
| 392112977c | |||
| f5703a2438 | |||
| b5a81b540f | |||
| 4c75f908b9 | |||
| 83bf874156 | |||
| dd392caef7 | |||
| 096b436d54 | |||
| af24ef1517 | |||
| cfb034bc69 | |||
| 349e9b9442 | |||
| 1e082ed225 | |||
| 459f068765 | |||
| 91f79b2021 | |||
| 02b64ad6a7 | |||
| 7239113847 | |||
| 8c98cea114 | |||
| 6eaa8c4c01 | |||
| f5ace15f7b | |||
| 74b1ca0614 | |||
| 5d97abc6ac | |||
| b4370ece82 | |||
| 8923a099cc | |||
| 5670bac3f6 | |||
| 35d01b042e | |||
| 110d6bace3 | |||
| 54d819e1ea | |||
| 8bb3b6d53c | |||
| 550df4fbd8 | |||
| c2962f51e1 | |||
| 5e6262da56 | |||
| 5f096b58b7 | |||
| c6fee48c8c | |||
| 7ab5d3add6 | |||
| 68fbc13a69 | |||
| a96d99bcd1 | |||
| a53ca81784 | |||
| b04aefc105 | |||
| 9d0801676d | |||
| c8fc6c747f | |||
| f8da119ad7 | |||
| 3192a1b3f2 | |||
| 6f1eed6696 | |||
| f438d240f9 | |||
| 1aa78386f4 | |||
| f4c8f00c8f | |||
| 2213fed5b2 | |||
| 477da65817 | |||
| cb1c4d01e0 | |||
| 3219f43e6d | |||
| 25258f7d87 | |||
| 15786dd772 | |||
| e6a1ea621e | |||
| eee3aa08e4 | |||
| 1006132451 | |||
| 3fce448451 | |||
| 5eca034911 | |||
| 761af30a75 | |||
| 573a8d8e33 | |||
| 1bca1a8dc3 | |||
| 94ff4b717d | |||
| b7a1add2f3 | |||
| 8a1de56dc2 | |||
| 5e88ccb5d7 | |||
| 9651903200 | |||
| af9418d456 | |||
| f35f41a049 | |||
| 398b9f9d8f | |||
| cb4ce6dab6 | |||
| d4450e1ae1 | |||
| f7dac04dae | |||
| 1e0e93dfa3 | |||
| 61856473ea | |||
| 3ca80904ea | |||
| 3798720ee0 | |||
| 7eed07a682 | |||
| ff93cb26fe | |||
| b39fa7667e | |||
| 16356d8a5c | |||
| 64ce3d1f6a | |||
| d5d7797eb7 | |||
| f6661fabea | |||
| 74814db900 | |||
| 18d25069f3 | |||
| f49771ec7f | |||
| 097010290d | |||
| 2a3eba6441 | |||
| 0a961d8e95 | |||
| 5213ab44ff | |||
| c89f375015 | |||
| d6cce60b8f | |||
| a54c7a3492 | |||
| efdd81ac0d | |||
| 635494b303 | |||
| e200cd4455 | |||
| a81ceb51b8 | |||
| ee011ef201 | |||
| fb84fb62f7 | |||
| c85bf159ff | |||
| 55fe358d9b | |||
| 17c2004a39 | |||
| 82019bb77f | |||
| 4e22b1ac1c | |||
| f29d5a7b50 | |||
| 050a4214f9 | |||
| f865d09033 | |||
| fb3247c91e | |||
| da4ab6bf49 | |||
| 7bc8e22906 | |||
| ab5dc7b1ac | |||
| fe9bf1dc8a | |||
| e6b47266b9 | |||
| f95c5ec7cf | |||
| df64ad30eb | |||
| dd98434522 | |||
| c490aa0040 | |||
| c9c6955198 | |||
| ae1817fc7b | |||
| bce7e6ce7f | |||
| 42197c39ed | |||
| f5ee097b72 | |||
| 9e883a48a0 | |||
| 0994b2cc8f | |||
| 7c2d235960 | |||
| 73774b0c5d | |||
| 9f13f876ef | |||
| bf344df8d6 | |||
| b9325875a1 | |||
| a9666a5f55 | |||
| 1d63f7aa53 | |||
| a5110893ea | |||
| 1ea45269bd | |||
| de4fe258fd | |||
| b5d0cc9626 | |||
| 0a179c963f | |||
| 34715712f3 | |||
| be331d6200 | |||
| f6f2defc8c | |||
| 4b2e3c2f6b | |||
| 09bc985431 | |||
| 94a15093ac | |||
| d10a229b59 | |||
| de43e69ccf | |||
| f993780ec3 | |||
| b624d91119 | |||
| 7a005a9141 | |||
| cc8be23f7e | |||
| 86e032b27f | |||
| 429c595e04 | |||
| 0d6ad6aab0 | |||
| 186412144d | |||
| 696849062f | |||
| 4154df1704 | |||
| 5001713d16 | |||
| 311d235fda | |||
| 2f573263ba | |||
| 54de577eee | |||
| 8584be651b | |||
| 08c594148b | |||
| 76fd425027 | |||
| 38f2bb89a4 | |||
| 1568e619a5 | |||
| 2b363119c5 | |||
| da5494ad35 | |||
| d3be5a7805 | |||
| 06f62b19b4 | |||
| 4844da317f | |||
| 00f555b141 | |||
| d3ec6cad1d | |||
| a64fafb6ad | |||
| 9180244e0d | |||
| 5c79951f00 | |||
| 388a265db7 | |||
| d4653bc89f | |||
| 1ec52e710a | |||
| fd7c193894 | |||
| 040cd09691 | |||
| c5e1674264 | |||
| e96a3506a8 | |||
| 28baa49f6d | |||
| 96172c67fd | |||
| 81e51c2b92 | |||
| e97d2d89d6 | |||
| 2cb4ee9879 | |||
| 4c5241dd95 | |||
| c086eddfae | |||
| 33e313a633 | |||
| c6fe7a3d6a | |||
| 94a126f64e | |||
| 1b57df7a52 | |||
| 451a21e84e | |||
| f7ec0c4ce0 | |||
| 6c1a47955f | |||
| 3b1d913006 | |||
| 33c1cc80b2 | |||
| 58bae0953f | |||
| fdc3265e97 | |||
| 8efe601826 | |||
| 96d115e808 | |||
| 8b74420e4f | |||
| f2479c6f36 | |||
| 9a4c61d1c3 | |||
| a528018761 | |||
| eefffa8a0e | |||
| 5bdfd447ac | |||
| da484fbbb0 | |||
| 39137d1348 | |||
| 5519f6af57 | |||
| d16a670726 | |||
| 54864da770 | |||
| 64aa3c1250 | |||
| a663fa9436 | |||
| aa572e8a22 | |||
| 48798e8309 | |||
| 01ca8f6fb9 | |||
| 80eb64e418 | |||
| ea79b92beb | |||
| 42d6ea9bed | |||
| 0a8432514c | |||
| 3122825b73 | |||
| bc8709f842 | |||
| f39fb46b25 | |||
| 48172216cc | |||
| 1fa215103c | |||
| 88c8b13208 | |||
| 8eb423414a | |||
| 5d668791f9 | |||
| d766e2fd01 | |||
| 9c801d2723 | |||
| dce81d614e | |||
| a63a79ab91 | |||
| 19d369c3c7 | |||
| f325daab43 | |||
| 326b53544a | |||
| 1a3d651759 | |||
| e46d5a2433 | |||
| 995b3ecb18 | |||
| 43f613b0bc | |||
| 5226da2652 | |||
| 15049640c6 | |||
| 0d5a7aee35 | |||
| cfa71c852c | |||
| a1a9b10ee1 | |||
| fb57ea5838 | |||
| d93c19913b | |||
| 80d5d09ed5 | |||
| 9e4489093c | |||
| 772e60c944 | |||
| 9527fd006f | |||
| bbd5962fd4 | |||
| 47fba23a5e | |||
| 75aff023d3 | |||
| 8183144251 | |||
| 1e00f2683e | |||
| d8fc724b10 | |||
| 8feec18ff7 | |||
| cff3cab075 | |||
| 84b1f1c81a | |||
| 76c4c4a0e9 | |||
| 3e056ebf3d | |||
| 25313a8f52 | |||
| fbcf9d9778 | |||
| 1b53b17b48 | |||
| b7661b200e | |||
| 26ed20b1f5 | |||
| f94274ae1c | |||
| a78b4507da | |||
| 651bd9e37a | |||
| 7336525021 | |||
| 8035176e8b | |||
| e4fca1b823 | |||
| b59b00dbe4 | |||
| 455d7e9aa2 | |||
| ca502488b7 | |||
| 7f99b26e48 | |||
| b827d8cbea | |||
| 598f6b4b09 | |||
| 2c4dc542b6 | |||
| c365896865 | |||
| 813cca99e2 | |||
| d606418072 | |||
| d69788e8d2 | |||
| 4a009f3cef | |||
| 792d1980fe | |||
| 22cd1e075a | |||
| 1da8881905 | |||
| 3e092bf375 | |||
| 8a7bcab2c6 | |||
| 6644564738 | |||
| 31b6ff9954 | |||
| 81f279964c | |||
| 9830025853 | |||
| 84ca798dad | |||
| bae6675efe | |||
| ef32586d86 | |||
| 4a5e83fece | |||
| ba0e084311 | |||
| a7f02548b0 | |||
| 9882065b20 | |||
| 058d01b6be | |||
| 68a6554d19 | |||
| f8349a2a9b | |||
| c78e715c3e | |||
| ba31a0b5b0 | |||
| 479feea8aa | |||
| 043f09892a | |||
| 9e15668c37 | |||
| 9c85877d3d | |||
| f8fb59e806 | |||
| d3f88597d9 | |||
| 727d0b5876 | |||
| 87a1b3647d | |||
| 35c68d98a1 | |||
| 7bb340a415 | |||
| 37364d9775 | |||
| 3076753a19 | |||
| 22fbe098ec | |||
| 6d1d4cb74b | |||
| 601eae1e95 | |||
| a667ddaf5e | |||
| 4f2ca62d05 | |||
| 62550423a3 | |||
| fe7cd05d57 | |||
| 844f72d3d4 | |||
| 88dee31289 | |||
| feb14a9f39 | |||
| 44bfe52529 | |||
| f0b1c14ea4 | |||
| 5872612d86 | |||
| 8bd007b6ea | |||
| f2231fcba2 | |||
| 3f4efbcd16 | |||
| fb4f9981f0 | |||
| d1319a23ad | |||
| 29f1760a7c | |||
| ed99325bb9 | |||
| d9098179a2 | |||
| db53de363c | |||
| 8d221be050 | |||
| 40c7e1c9f0 | |||
| 32bdeec02e | |||
| 91a2bf4f21 | |||
| c3e3d8e9d7 | |||
| 8735318545 | |||
| 21060b31dc | |||
| e148d8c2f4 | |||
| d3a1ed222c | |||
| 0197e5b175 | |||
| fe2601b29a | |||
| 4a87fb49e9 | |||
| 88246c443a | |||
| 10ed780b6c | |||
| cee15a68ba | |||
| ca217f1869 | |||
| 7cdb7688c4 | |||
| 72c0f97218 | |||
| 1ec742b8fe | |||
| 01107e361f | |||
| deeb1cdb5e | |||
| 406e1bebfe | |||
| 540fc4bede | |||
| a412db7356 | |||
| ac1df7691a | |||
| 9c0d70fe89 | |||
| 180e24b916 | |||
| 9b79a2f446 | |||
| 314e71a2d0 | |||
| 7b5e5562b5 | |||
| c7f477555c | |||
| 73dd6e6dc1 | |||
| 5e9b5b2ce5 | |||
| aadd6b0d92 | |||
| 47d3ab33e7 | |||
| 8754c46575 | |||
| ce3cea5515 | |||
| 29fc5181bf | |||
| 035d196ae5 | |||
| 54411f4de7 | |||
| a2c2eddf0d | |||
| 82cbc63096 | |||
| 1b49ea2a20 | |||
| 9b3b571bd9 | |||
| 5f8a530857 | |||
| d82426cd91 | |||
| b293673ee9 | |||
| a27ad33e0e | |||
| ec07c4154d | |||
| 450b0b6433 | |||
| 8880e07bf2 | |||
| 7f2025c414 | |||
| c354c69e21 | |||
| 94a1534c14 | |||
| 2d23836396 | |||
| 22bba685ff | |||
| d4042228d9 | |||
| 2a8b61c07f |
@@ -6,10 +6,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
// Deadline for Application given as Time-Interval after Semesterstart.
|
||||
$config['interval_blocking_application'] = 'P1M';
|
||||
|
||||
// Application submission period given by start- and enddate.
|
||||
$config['submit_application_start'] = '05.09.2022';
|
||||
$config['submit_application_end'] = '22.09.2022';
|
||||
|
||||
// Lehrveranstaltungen with these grades will be blocked for application
|
||||
$config['grades_blocking_application'] = array(
|
||||
5, // nicht genügend
|
||||
@@ -19,4 +15,9 @@ $config['grades_blocking_application'] = array(
|
||||
14, // nicht bestanden,
|
||||
15, // nicht teilgenommen
|
||||
18 // unentschuldigt
|
||||
);
|
||||
);
|
||||
|
||||
//Enables Fachbereichsleiter instead of LV Leiter
|
||||
$config['fbl'] = FALSE;
|
||||
//Enables Info Mails
|
||||
$config['send_mail'] = TRUE;
|
||||
|
||||
@@ -31,6 +31,14 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 20,
|
||||
'requiredPermissions' => 'admin:w'
|
||||
),
|
||||
'bismeldestichtagsverwaltung' => array(
|
||||
'link' => site_url('codex/Bismeldestichtag'),
|
||||
'icon' => '',
|
||||
'description' => 'BIS-Meldestichtagsverwaltung',
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'admin:w'
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -164,7 +172,14 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 20,
|
||||
'requiredPermissions' => 'system/developer:r'
|
||||
)
|
||||
),
|
||||
'anrechnungen' => array(
|
||||
'link' => site_url('lehre/anrechnung/AdminAnrechnung'),
|
||||
'description' => 'Anrechnungen',
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'lehre/anrechnungszeitfenster:rw'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -184,6 +199,15 @@ $config['navigation_menu']['Vilesci/index'] = array(
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['Vilesci/index'] = array(
|
||||
'dashboard' => array(
|
||||
'link' => '#',
|
||||
'description' => 'Dashboard',
|
||||
'icon' => 'dashboard',
|
||||
'sort' => 1
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['organisation/Reihungstest/index'] = array(
|
||||
'reihungstestverwalung' => array(
|
||||
'link' => base_url('vilesci/stammdaten/reihungstestverwaltung.php'),
|
||||
@@ -267,10 +291,18 @@ $config['navigation_menu']['system/issues/Issues/*'] = array(
|
||||
'fehlerzustaendigkeiten' => array(
|
||||
'link' => site_url('system/issues/IssuesZustaendigkeiten'),
|
||||
'description' => 'Fehler Zuständigkeiten',
|
||||
'icon' => 'cogs',
|
||||
'icon' => 'users',
|
||||
'sort' => 100,
|
||||
'target' => '_blank',
|
||||
'requiredPermissions' => array('admin:rw')
|
||||
)
|
||||
),
|
||||
'fehlerkonfiguration' => array(
|
||||
'link' => site_url('system/issues/IssuesKonfiguration'),
|
||||
'description' => 'Fehler Konfiguration',
|
||||
'icon' => 'cogs',
|
||||
'sort' => 200,
|
||||
'target' => '_blank',
|
||||
'requiredPermissions' => array('admin:rw')
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['frist_rueckzahlung_studiengebuer_WS'] = '15.10.';
|
||||
$config['frist_rueckzahlung_studiengebuer_SS'] = '15.03.';
|
||||
|
||||
// TODO(chris): review this!
|
||||
#$config['unterbrechung_dms'] = ['oe_kurzbz' => null, 'dokument_kurzbz' => null, 'kategorie_kurzbz' => null];
|
||||
$config['unterbrechung_dms'] = ['oe_kurzbz' => null, 'dokument_kurzbz' => null, 'kategorie_kurzbz' => 'Akte'];
|
||||
|
||||
/**
|
||||
* UPLOAD
|
||||
*/
|
||||
|
||||
/**
|
||||
* Allowed filetypes for attachment upload in unterbrechung antrag
|
||||
*
|
||||
* @var array An array of fileextensions
|
||||
*/
|
||||
$config['unterbrechung_dms_filetypes'] = ['jpg', 'pdf'];
|
||||
|
||||
|
||||
/**
|
||||
* GRADES
|
||||
*/
|
||||
|
||||
/**
|
||||
* On wiederholung the student must repeat certain lvs.
|
||||
* This lvs will be graded with this id
|
||||
*
|
||||
* @var integer tbl_note.note
|
||||
*/
|
||||
$config['wiederholung_note_angerechnet'] = 19;
|
||||
|
||||
/**
|
||||
* On wiederholung the student can not attend certain lvs.
|
||||
* Those lvs will be graded with this id
|
||||
*
|
||||
* @var integer tbl_note.note
|
||||
*/
|
||||
$config['wiederholung_note_nicht_zugelassen'] = 20;
|
||||
|
||||
|
||||
/**
|
||||
* JOBS
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Job will remind for every Unterbrecher who has a
|
||||
* wiedereinstieg_datum between the date the Job is run
|
||||
* and the modified date
|
||||
* e.g.: If the Job is running on 2023-04-20 and the modifier
|
||||
* is '+3 days' it will remind of everyone that
|
||||
* has a wiedereinstiegs_datum between 2023-04-20 and 2023-04-23
|
||||
*
|
||||
* @var string A string formated as PHP DateTime modifier
|
||||
* @see https://www.php.net/manual/de/datetime.modify.php
|
||||
*/
|
||||
$config['unterbrechung_job_remind_wiedereinstieg_date_modifier'] = '+3 days';
|
||||
|
||||
/**
|
||||
* The Job will sent a request to everyone who faild the 3rd committee exam
|
||||
* and respecting the given conditions (not repeated yet, stg not in blacklist)
|
||||
* to decide if he/she will repeat or not
|
||||
*
|
||||
* First request
|
||||
*
|
||||
* @var string A string formated as PHP DateTime modifier
|
||||
* @see https://www.php.net/manual/de/datetime.modify.php
|
||||
*/
|
||||
$config['wiederholung_job_request_1_date_modifier'] = '+0 days';
|
||||
|
||||
/**
|
||||
* Second request
|
||||
*
|
||||
* @var string A string formated as PHP DateTime modifier
|
||||
* @see https://www.php.net/manual/de/datetime.modify.php
|
||||
*/
|
||||
$config['wiederholung_job_request_2_date_modifier'] = '+3 weeks';
|
||||
|
||||
/**
|
||||
* Final deadline - after this the student will be abgemeldet if he hasn't chosen yet
|
||||
*
|
||||
* @var string A string formated as PHP DateTime modifier
|
||||
* @see https://www.php.net/manual/de/datetime.modify.php
|
||||
*/
|
||||
$config['wiederholung_job_deadline_date_modifier'] = '+1 month';
|
||||
|
||||
/**
|
||||
* before this exam dates for Wiederholer will be ignored
|
||||
*
|
||||
* @var string A string formated as Date
|
||||
*
|
||||
*/
|
||||
$config['digitalization_start'] = '2022-07-01';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Objection period - the student will be abgemeldet if he hasn't objected in this period
|
||||
*
|
||||
* @var string A string formated as PHP DateTime modifier
|
||||
* @see https://www.php.net/manual/de/datetime.modify.php
|
||||
*/
|
||||
$config['abmeldung_job_deadline_date_modifier'] = '+2 weeks';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* System User - uid of a user that is allowed to set prestudentstatus
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
$config['antrag_job_systemuser'] = '';
|
||||
|
||||
|
||||
/**
|
||||
* WHITELISTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* List of stati who entitle a prestudent to create an Antrag
|
||||
*
|
||||
* @var array Array of tbl_status.status_kurzbz's
|
||||
*/
|
||||
$config['antrag_prestudentstatus_whitelist'] = ['Student', 'Diplomand'];
|
||||
$config['antrag_prestudentstatus_whitelist_abmeldung'] = ['Student', 'Diplomand', 'Unterbrecher'];
|
||||
|
||||
|
||||
/**
|
||||
* BLACKLISTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* List of Statusgründe that prevent a prestudent from create an Wiederholungsantrag
|
||||
*
|
||||
* @var array An array of tbl_status_grund.statusgrund_id's
|
||||
*/
|
||||
$config['status_gruende_wiederholer'] = [16, 15];
|
||||
|
||||
/**
|
||||
* Blacklisted for abmeldung anträge
|
||||
*
|
||||
* @var array An array of tbl_studiengang.studiengang_kz's
|
||||
*/
|
||||
$config['stgkz_blacklist_abmeldung'] = [];
|
||||
|
||||
/**
|
||||
* Blacklisted for unterbrechung anträge
|
||||
*
|
||||
* @var array An array of tbl_studiengang.studiengang_kz's
|
||||
*/
|
||||
$config['stgkz_blacklist_unterbrechung'] = [];
|
||||
|
||||
/**
|
||||
* Blacklisted for wiederholung anträge
|
||||
*
|
||||
* @var array An array of tbl_studiengang.studiengang_kz's
|
||||
*/
|
||||
$config['stgkz_blacklist_wiederholung'] = [];
|
||||
|
||||
/**
|
||||
* Blacklisted noten for negative committee exams
|
||||
* noten with this ids won't be seen as negative
|
||||
*
|
||||
* @var array An array of noten ids
|
||||
*/
|
||||
$config['note_blacklist_wiederholung'] = [];
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Overview on Bismeldestichtage
|
||||
*/
|
||||
class Bismeldestichtag extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'admin:r',
|
||||
'getStudiensemester' => 'admin:r',
|
||||
'getBismeldestichtage' => 'admin:r',
|
||||
'addBismeldestichtag' => 'admin:rw',
|
||||
'deleteBismeldestichtag' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load models
|
||||
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'bismeldestichtag'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Everything has a beginning
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('codex/bismeldestichtag.php');
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
// load semester list
|
||||
$semList = array();
|
||||
$this->StudiensemesterModel->addSelect('studiensemester_kurzbz');
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$semRes = $this->StudiensemesterModel->load();
|
||||
|
||||
if (hasData($semRes))
|
||||
{
|
||||
$semList = getData($semRes);
|
||||
}
|
||||
|
||||
// load current semester
|
||||
$currSem = null;
|
||||
$semRes = $this->StudiensemesterModel->getAkt();
|
||||
|
||||
if (hasData($semRes))
|
||||
{
|
||||
$currSem = getData($semRes)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
// output data
|
||||
$this->outputJsonSuccess(
|
||||
array('semList' => $semList, 'currSem' => $currSem)
|
||||
);
|
||||
}
|
||||
|
||||
public function getBismeldestichtage()
|
||||
{
|
||||
$this->BismeldestichtagModel->addSelect(
|
||||
'meldestichtag_id, meldestichtag,
|
||||
tbl_bismeldestichtag.studiensemester_kurzbz, sem.start AS semester_start,
|
||||
tbl_bismeldestichtag.insertamum, tbl_bismeldestichtag.insertvon, tbl_bismeldestichtag.updateamum, tbl_bismeldestichtag.updatevon'
|
||||
);
|
||||
$this->BismeldestichtagModel->addJoin('public.tbl_studiensemester sem', 'studiensemester_kurzbz', 'LEFT');
|
||||
$this->BismeldestichtagModel->addOrder('semester_start');
|
||||
$this->BismeldestichtagModel->addOrder('meldestichtag', 'DESC');
|
||||
$this->BismeldestichtagModel->addOrder('meldestichtag_id', 'DESC');
|
||||
$this->outputJson($this->BismeldestichtagModel->load());
|
||||
}
|
||||
|
||||
public function addBismeldestichtag()
|
||||
{
|
||||
// get request data
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
// check request data
|
||||
if (!property_exists($request, 'meldestichtag') || isEmptyString($request->meldestichtag))
|
||||
$this->terminateWithJsonError('Error occured: Meldestichtag missing');
|
||||
if (!property_exists($request, 'studiensemester_kurzbz') || isEmptyString($request->studiensemester_kurzbz))
|
||||
$this->terminateWithJsonError('Error occured: Studiensemester missing');
|
||||
|
||||
$meldestichtag = $request->meldestichtag;
|
||||
$studiensemester_kurzbz = $request->studiensemester_kurzbz;
|
||||
|
||||
// check if Bismeldestichtag already exists
|
||||
$this->BismeldestichtagModel->addSelect('1');
|
||||
$bismeldestichtagRes = $this->BismeldestichtagModel->loadWhere(
|
||||
array('meldestichtag' => $meldestichtag, 'studiensemester_kurzbz' => $studiensemester_kurzbz)
|
||||
);
|
||||
|
||||
// return success if already exists
|
||||
if (hasData($bismeldestichtagRes))
|
||||
$this->outputJsonSuccess('Bismeldestichtag already exists');
|
||||
else
|
||||
{
|
||||
// insert new if Stichtag does not exist
|
||||
$this->outputJson($this->BismeldestichtagModel->insert(
|
||||
array(
|
||||
'meldestichtag' => $request->meldestichtag,
|
||||
'studiensemester_kurzbz' => $request->studiensemester_kurzbz,
|
||||
'insertvon' => getAuthUID()
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteBismeldestichtag()
|
||||
{
|
||||
// get request data
|
||||
$request = $this->getPostJSON();
|
||||
|
||||
// check request data
|
||||
if (!property_exists($request, 'meldestichtag_id'))
|
||||
$this->terminateWithJsonError('Error occured: Meldestichtag Id missing');
|
||||
|
||||
$meldestichtag_id = $request->meldestichtag_id;
|
||||
|
||||
// deletetion
|
||||
$this->outputJson($this->BismeldestichtagModel->delete($meldestichtag_id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class UHSTAT1 extends FHC_Controller
|
||||
{
|
||||
const BERECHTIGUNG_UHSTAT_VERWALTEN = 'student/uhstat1daten_verwalten';
|
||||
const PERSON_ID_SESSION_INDEX = 'bewerbung/personId';
|
||||
const CODEX_OESTERREICH = 'A';
|
||||
const LOWER_BOUNDARY_YEARS = 160;
|
||||
const UPPER_BOUNDARY_YEARS = 20;
|
||||
|
||||
private $_uid;
|
||||
private $_uhstat1Fields = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// load ci libs
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// load ci helpers
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
// load libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// load models
|
||||
$this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->load->model('codex/Abschluss_model', 'AbschlussModel');
|
||||
$this->load->model('codex/Uhstat1daten_model', 'Uhstat1datenModel');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui',
|
||||
'uhstat'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
// set form field information
|
||||
$this->_uhstat1Fields = array(
|
||||
'mutter_geburtsstaat' => array('name' => 'Geburtsstaat Mutter'),
|
||||
'mutter_geburtsjahr' => array('name' => 'Geburtsjahr Mutter'),
|
||||
'mutter_bildungsstaat' => array('name' => 'Bildungsstaat Mutter'),
|
||||
'mutter_bildungmax' => array(
|
||||
'name' => 'Geburtsjahr Mutter',
|
||||
'rules' => array(
|
||||
'callback_bildungsstaat_bildungmax_check[m]' => array(
|
||||
'bildungsstaat_bildungmax_check' => $this->p->t('uhstat', 'ausbildungBildungsstaatUebereinstimmung')
|
||||
)
|
||||
)
|
||||
),
|
||||
'vater_geburtsstaat' => array('name' => 'Geburtsstaat Vater'),
|
||||
'vater_geburtsjahr' => array('name' => 'Geburtsjahr Vater'),
|
||||
'vater_bildungsstaat' => array('name' => 'Bildungsstaat Vater'),
|
||||
'vater_bildungmax' => array('name' => 'Geburtsjahr Vater'),
|
||||
'vater_bildungmax' => array(
|
||||
'name' => 'Geburtsjahr Vater',
|
||||
'rules' => array(
|
||||
'callback_bildungsstaat_bildungmax_check[v]' => array(
|
||||
'bildungsstaat_bildungmax_check' => $this->p->t('uhstat', 'ausbildungBildungsstaatUebereinstimmung')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function index()
|
||||
{
|
||||
$formMetaData = $this->_getFormMetaData();
|
||||
|
||||
if (isError($formMetaData)) show_error(getError($formMetaData));
|
||||
|
||||
if (!hasData($formMetaData)) show_error("No form meta data could be loaded");
|
||||
|
||||
$uhstatData = $this->_getUHSTAT1Data();
|
||||
|
||||
if (isError($uhstatData)) show_error(getError($uhstatData));
|
||||
|
||||
$this->load->view("codex/uhstat1.php", array(
|
||||
'formMetaData' => getData($formMetaData),
|
||||
'uhstatData' => getData($uhstatData)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or update UHSTAT1 data
|
||||
*/
|
||||
public function saveUHSTAT1Data()
|
||||
{
|
||||
$saved = false;
|
||||
|
||||
$person_id = $this->_getValidPersonId('sui');
|
||||
|
||||
$this->form_validation->set_error_delimiters('<span class="text-danger">', '</span>');
|
||||
|
||||
foreach ($this->_uhstat1Fields as $field => $params)
|
||||
{
|
||||
// all fields are required
|
||||
$ruleNames = 'required';
|
||||
$ruleMessages = array('required' => $this->p->t('uhstat', 'angabeFehlt'));
|
||||
|
||||
// add additional rules
|
||||
if (isset($params['rules']))
|
||||
{
|
||||
foreach ($params['rules'] as $ruleName => $ruleMessage)
|
||||
{
|
||||
$ruleNames .= '|'.$ruleName;
|
||||
$ruleMessages = array_merge($ruleMessages, $ruleMessage);
|
||||
}
|
||||
}
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
$field,
|
||||
$params['name'],
|
||||
$ruleNames,
|
||||
$ruleMessages
|
||||
);
|
||||
}
|
||||
|
||||
$uhstat1datenRes = null;
|
||||
if ($this->form_validation->run()) // if valid
|
||||
{
|
||||
// get post fields
|
||||
$uhstatData = array();
|
||||
foreach ($this->_uhstat1Fields as $field => $params)
|
||||
{
|
||||
$uhstatData[$field] = $this->input->post($field);
|
||||
}
|
||||
|
||||
// check if entry already exists
|
||||
$uhstat1datenloadRes = $this->Uhstat1datenModel->loadWhere(array('person_id' => $person_id));
|
||||
|
||||
// if yes, update
|
||||
if (hasData($uhstat1datenloadRes))
|
||||
{
|
||||
$uhstatData['updateamum'] = 'NOW()';
|
||||
$uhstatData['updatevon'] = $this->_uid;
|
||||
$uhstat1datenRes = $this->Uhstat1datenModel->update(
|
||||
array('person_id' => $person_id),
|
||||
$uhstatData
|
||||
);
|
||||
}
|
||||
else // otherwise insert
|
||||
{
|
||||
$uhstatData['insertamum'] = 'NOW()';
|
||||
$uhstatData['insertvon'] = $this->_uid;
|
||||
$uhstat1datenRes = $this->Uhstat1datenModel->insert(
|
||||
array_merge($uhstatData, array('person_id' => $person_id))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$formMetaData = $this->_getFormMetaData();
|
||||
|
||||
if (isError($formMetaData)) show_error(getError($formMetaData));
|
||||
|
||||
if (!hasData($formMetaData)) show_error("No form meta data could be loaded");
|
||||
|
||||
$successMessage = '';
|
||||
$errorMessage = '';
|
||||
// pass success/error messages to view
|
||||
if (isset($uhstat1datenRes))
|
||||
{
|
||||
if (isSuccess($uhstat1datenRes))
|
||||
{
|
||||
$successMessage = $this->p->t('uhstat', 'erfolgreichGespeichert');
|
||||
$saved = true;
|
||||
}
|
||||
else
|
||||
$errorMessage = $this->p->t('uhstat', 'fehlerBeimSpeichern');
|
||||
}
|
||||
|
||||
// load view with form data
|
||||
$this->load->view("codex/uhstat1.php", array(
|
||||
'formMetaData' => getData($formMetaData),
|
||||
'saved' => $saved,
|
||||
'successMessage' => $successMessage,
|
||||
'errorMessage' => $errorMessage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check callback for Bildungsstaat - if Bildungsstaat is Austria, a highest education should be in Austria.
|
||||
* @param $bildungmax
|
||||
* @param $bildungsstaat_typ - mother (m) or father (v)
|
||||
* @return bool true if valid, false otherwise
|
||||
*/
|
||||
public function bildungsstaat_bildungmax_check($bildungmax, $bildungsstaat_typ)
|
||||
{
|
||||
// valid if no type passed
|
||||
if (!isset($bildungsstaat_typ) || !isset($bildungmax)) return true;
|
||||
|
||||
// get correct input
|
||||
if ($bildungsstaat_typ == 'm') // mutter
|
||||
$bildungsstaat = $this->input->post('mutter_bildungsstaat');
|
||||
elseif ($bildungsstaat_typ == 'v') // vater
|
||||
$bildungsstaat = $this->input->post('vater_bildungsstaat');
|
||||
else
|
||||
return true;
|
||||
|
||||
if (!isset($bildungsstaat)) return true;
|
||||
|
||||
// find out if abschluss is in Austria
|
||||
$this->AbschlussModel->addSelect("in_oesterreich");
|
||||
$abschlussRes = $this->AbschlussModel->load($bildungmax);
|
||||
|
||||
if (hasData($abschlussRes))
|
||||
{
|
||||
$in_oesterreich = getData($abschlussRes)[0]->in_oesterreich;
|
||||
// invalid if abschluss in Austria, but not Bildungsstaat, or abschluss not in Austria, but Bildungsstaat in Austria
|
||||
return ($in_oesterreich && $bildungsstaat == self::CODEX_OESTERREICH) || (!$in_oesterreich && $bildungsstaat != self::CODEX_OESTERREICH);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes UHSTAT1 entry.
|
||||
*/
|
||||
public function deleteUHSTAT1Data()
|
||||
{
|
||||
$saved = false;
|
||||
|
||||
// uhstat data can only be deleted with permission
|
||||
if (!$this->_checkPermission('suid')) show_error('no permission');
|
||||
|
||||
$person_id = $this->_getValidPersonId('suid');
|
||||
|
||||
$uhstat1datenRes = $this->Uhstat1datenModel->delete(
|
||||
array('person_id' => $person_id)
|
||||
);
|
||||
|
||||
$formMetaData = $this->_getFormMetaData();
|
||||
|
||||
if (isError($formMetaData)) show_error(getError($formMetaData));
|
||||
|
||||
if (!hasData($formMetaData)) show_error("No form meta data could be loaded");
|
||||
|
||||
$successMessage = '';
|
||||
$errorMessage = '';
|
||||
// pass success/error messages to view
|
||||
if (isset($uhstat1datenRes))
|
||||
{
|
||||
if (isSuccess($uhstat1datenRes))
|
||||
{
|
||||
$successMessage = $this->p->t('uhstat', 'erfolgreichGeloescht');
|
||||
}
|
||||
else
|
||||
$errorMessage = $this->p->t('uhstat', 'fehlerBeimLoeschen');
|
||||
}
|
||||
|
||||
// load view with form data
|
||||
$this->load->view("codex/uhstat1.php", array(
|
||||
'formMetaData' => getData($formMetaData),
|
||||
'successMessage' => $successMessage,
|
||||
'errorMessage' => $errorMessage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Gets initial data needed to display UHSTAT1 form.
|
||||
*/
|
||||
private function _getFormMetaData()
|
||||
{
|
||||
$person_id = $this->_getValidPersonId('s');
|
||||
|
||||
// read only display param
|
||||
$readOnly = $this->input->get('readOnly');
|
||||
|
||||
// depending on permissions, editing or deleting is possible
|
||||
$editPermission = $this->_checkPermission('sui');
|
||||
$deletePermission = $this->_checkPermission('suid');
|
||||
|
||||
$languageIdx = $this->_getLanguageIndex();
|
||||
|
||||
$formMetaData = array(
|
||||
'nation' => array(),
|
||||
'abschluss_oesterreich' => array(),
|
||||
'abschluss_nicht_oesterreich' => array(),
|
||||
'jahre' => array(),
|
||||
'person_id' => $person_id,
|
||||
'editPermission' => $editPermission,
|
||||
'deletePermission' => $deletePermission,
|
||||
'readOnly' => $readOnly
|
||||
);
|
||||
|
||||
// get person data
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->PersonModel->addSelect("vorname, nachname");
|
||||
$personRes = $this->PersonModel->load($person_id);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$person = getData($personRes)[0];
|
||||
$formMetaData['vorname'] = $person->vorname;
|
||||
$formMetaData['nachname'] = $person->nachname;
|
||||
}
|
||||
|
||||
$nationTextFieldName = $languageIdx == 1 ? 'langtext' : 'engltext';
|
||||
|
||||
// get nation list
|
||||
$this->load->model('codex/Nation_model', 'NationModel');
|
||||
|
||||
$this->NationModel->addSelect("nation_code, $nationTextFieldName AS nation_text");
|
||||
$this->NationModel->addOrder("nation_text");
|
||||
$nationRes = $this->NationModel->loadWhere('sperre IS NULL OR sperre = FALSE');
|
||||
|
||||
if (isError($nationRes)) return $nationRes;
|
||||
|
||||
if (hasData($nationRes))
|
||||
{
|
||||
$nations = getData($nationRes);
|
||||
|
||||
// put austria in beginning of selection
|
||||
foreach ($nations as $nation)
|
||||
{
|
||||
if ($nation->nation_code == self::CODEX_OESTERREICH) array_unshift($nations, $nation);
|
||||
}
|
||||
|
||||
$formMetaData['nation'] = $nations;
|
||||
}
|
||||
|
||||
// get abschluss list
|
||||
$abschlussRes = $this->AbschlussModel->getActiveAbschluesse($languageIdx);
|
||||
|
||||
if (isError($abschlussRes)) return $abschlussRes;
|
||||
|
||||
$abschlussData = getData($abschlussRes);
|
||||
|
||||
if (hasData($abschlussRes))
|
||||
{
|
||||
foreach (getData($abschlussRes) as $abschluss)
|
||||
{
|
||||
if ($abschluss->in_oesterreich === true)
|
||||
$formMetaData['abschluss_oesterreich'][] = $abschluss;
|
||||
elseif ($abschluss->in_oesterreich === false)
|
||||
$formMetaData['abschluss_nicht_oesterreich'][] = $abschluss;
|
||||
else
|
||||
{
|
||||
$formMetaData['abschluss_oesterreich'][] = $abschluss;
|
||||
$formMetaData['abschluss_nicht_oesterreich'][] = $abschluss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get realistic birth years, dated back from current year
|
||||
$currYear = date("Y");
|
||||
$formMetaData['jahre'] = range($currYear - self::UPPER_BOUNDARY_YEARS, $currYear - self::LOWER_BOUNDARY_YEARS);
|
||||
|
||||
return success($formMetaData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets initial data needed to display UHSTAT1 form.
|
||||
*/
|
||||
private function _getUHSTAT1Data()
|
||||
{
|
||||
$person_id = $this->_getValidPersonId('s');
|
||||
|
||||
$this->Uhstat1datenModel->addSelect(
|
||||
implode(', ', array_keys($this->_uhstat1Fields))
|
||||
);
|
||||
$uhstatRes = $this->Uhstat1datenModel->loadWhere(array('person_id' => $person_id));
|
||||
|
||||
if (isError($uhstatRes)) return $uhstatRes;
|
||||
|
||||
return success(hasData($uhstatRes) ? getData($uhstatRes)[0] : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets language index of currently logged in user.
|
||||
* @return int (the index, start at 1)
|
||||
*/
|
||||
private function _getLanguageIndex()
|
||||
{
|
||||
$idx = 1;
|
||||
$this->SpracheModel->addSelect('index');
|
||||
$langRes = $this->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
|
||||
|
||||
if (hasData($langRes))
|
||||
{
|
||||
$idx = getData($langRes)[0]->index;
|
||||
}
|
||||
|
||||
return $idx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Id of person having permissions to manage UHSTAT1 data.
|
||||
* Can be passed as parameter or be in session.
|
||||
* @return int person_id
|
||||
*/
|
||||
private function _getValidPersonId($berechtigungsArt)
|
||||
{
|
||||
// if coming from bewerbungstool - person id is in session (person must be logged in bewerbungstool)
|
||||
if (isset($_SESSION[self::PERSON_ID_SESSION_INDEX]) && is_numeric($_SESSION[self::PERSON_ID_SESSION_INDEX]))
|
||||
return $_SESSION[self::PERSON_ID_SESSION_INDEX];
|
||||
|
||||
// if person id passed directly...
|
||||
$person_id = $this->input->post('person_id');
|
||||
if (!isset($person_id)) $person_id = $this->input->get('person_id');
|
||||
|
||||
if (!isset($person_id) || !is_numeric($person_id)) show_error("invalid person id");
|
||||
|
||||
// ...check if there is a permission for editing UHSTAT1 data
|
||||
if ($this->_checkPermission($berechtigungsArt)) return $person_id;
|
||||
|
||||
show_error("No permission");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if logged user has the UHSTAT management permission.
|
||||
* @param $art - type of permission, e.g. suid for full permissions
|
||||
* @return bool
|
||||
*/
|
||||
private function _checkPermission($art)
|
||||
{
|
||||
return $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_UHSTAT_VERWALTEN, $art);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \Studierendenantrag_model as Studierendenantrag_model;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Abmeldung extends FHC_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Calls the parent's constructor and loads the FilterCmptLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Retrieves data of the current studiengang for the current user
|
||||
*/
|
||||
|
||||
public function getDetailsForNewAntrag($prestudent_id)
|
||||
{
|
||||
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, true)) {
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJsonError('Forbidden');
|
||||
}
|
||||
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(500);
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
$result = $result->retval;
|
||||
if (!$result) {
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student'));
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
|
||||
}
|
||||
elseif ($result == -1)
|
||||
{
|
||||
$result = $this->antraglib->getDetailsForLastAntrag(
|
||||
$prestudent_id,
|
||||
[
|
||||
Studierendenantrag_model::TYP_ABMELDUNG,
|
||||
Studierendenantrag_model::TYP_ABMELDUNG_STGL
|
||||
]
|
||||
);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
$data->canCancel = (
|
||||
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
|
||||
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
|
||||
);
|
||||
|
||||
return $this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function getDetailsForAntrag($studierendenantrag_id)
|
||||
{
|
||||
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id)) return show_404();
|
||||
|
||||
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
if ($data->typ !== Studierendenantrag_model::TYP_ABMELDUNG_STGL && $data->typ !== Studierendenantrag_model::TYP_ABMELDUNG)
|
||||
return show_404();
|
||||
|
||||
$data->canCancel = (
|
||||
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
|
||||
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
public function createAntrag()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
|
||||
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
|
||||
$this->form_validation->set_rules('grund', 'Grund', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$grund = $this->input->post('grund');
|
||||
$studiensemester = $this->input->post('studiensemester');
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
|
||||
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
$result = $result->retval;
|
||||
if (!$result)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
|
||||
}
|
||||
elseif ($result < 0)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
|
||||
}
|
||||
|
||||
$result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund);
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getDetailsForAntrag(getData($result));
|
||||
if (!hasData($result))
|
||||
return $this->outputJsonSuccess(true);
|
||||
|
||||
$data = getData($result);
|
||||
$data->canCancel = (boolean)$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
public function cancelAntrag()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$antrag_id = $this->input->post('antrag_id');
|
||||
if(!$this->antraglib->isEntitledToCancelAntrag($antrag_id))
|
||||
{
|
||||
$this->output->set_status_header(403);
|
||||
|
||||
return $this->outputJsonError('Forbidden');
|
||||
}
|
||||
|
||||
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
|
||||
if(isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
|
||||
|
||||
if (!hasData($result))
|
||||
return $this->outputJsonSuccess($antrag_id);
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function getStudiengaengeAssistenz()
|
||||
{
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
$query = $this->input->post('query');
|
||||
|
||||
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
|
||||
|
||||
$result = $this->antraglib->getAktivePrestudentenInStgs($studiengaenge, $query);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
$result = getData($result);
|
||||
if (!$result) {
|
||||
return $this->outputJsonSuccess([]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Leitung extends FHC_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Calls the parent's constructor and loads the FilterCmptLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getActiveStgs()
|
||||
{
|
||||
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe') ?: [];
|
||||
$studiengaenge = array_merge($studiengaenge, $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: []);
|
||||
|
||||
$result = $this->StudierendenantragModel->loadStgsWithAntraege($studiengaenge);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getAntraege($studiengang = null, $extra = null)
|
||||
{
|
||||
if ($studiengang && $studiengang == 'todo') {
|
||||
$studiengang = $extra;
|
||||
$extra = true;
|
||||
} else {
|
||||
$extra = false;
|
||||
}
|
||||
|
||||
if ($studiengang) {
|
||||
$studiengaenge = [$studiengang];
|
||||
} else {
|
||||
$studiengaenge =$this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe');
|
||||
if(!is_array($studiengaenge))
|
||||
$studiengaenge = [];
|
||||
|
||||
|
||||
$stgsNeuanlage = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
|
||||
if(!is_array($stgsNeuanlage))
|
||||
$stgsNeuanlage = [];
|
||||
|
||||
$studiengaenge = array_unique(array_merge($studiengaenge, $stgsNeuanlage));
|
||||
}
|
||||
|
||||
|
||||
$antraege = [];
|
||||
if ($studiengaenge) {
|
||||
$result = $extra
|
||||
? $this->StudierendenantragModel->loadActiveForStudiengaenge($studiengaenge)
|
||||
: $this->StudierendenantragModel->loadForStudiengaenge($studiengaenge);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(500);
|
||||
return $this->outputJson('Internal Server Error');
|
||||
}
|
||||
if(hasData($result))
|
||||
{
|
||||
$antraege = getData($result);
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJson($antraege);
|
||||
}
|
||||
|
||||
public function reopenAntrag()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToReopenAntrag',
|
||||
[
|
||||
'isEntitledToReopenAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
|
||||
$result = $this->antraglib->reopenWiederholung($studierendenantrag_id, getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
|
||||
|
||||
$this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function objectAntrag()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToObjectAntrag|callback_canBeObjected',
|
||||
[
|
||||
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
|
||||
'canBeObjected' => $this->p->t('studierendenantrag', 'error_no_objection')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
|
||||
$result = $this->antraglib->objectAbmeldung($studierendenantrag_id, getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
|
||||
|
||||
$this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function objectionDeny()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToObjectAntrag|callback_isObjected',
|
||||
[
|
||||
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
|
||||
'isObjected' => $this->p->t('studierendenantrag', 'error_not_objected')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
$grund = $this->input->post('grund');
|
||||
|
||||
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID(), $grund);
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
|
||||
|
||||
$this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function objectionApprove()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToObjectAntrag|callback_isObjected',
|
||||
[
|
||||
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
|
||||
'isObjected' => $this->p->t('studierendenantrag', 'error_not_objected')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
|
||||
$result = $this->antraglib->cancelAntrag($studierendenantrag_id, getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
|
||||
|
||||
$this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function isEntitledToReopenAntrag($studierendenantrag_id)
|
||||
{
|
||||
return $this->antraglib->isEntitledToReopenAntrag($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function isEntitledToObjectAntrag($studierendenantrag_id)
|
||||
{
|
||||
return $this->antraglib->isEntitledToObjectAntrag($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function isEntitledToRejectAntrag($studierendenantrag_id)
|
||||
{
|
||||
return $this->antraglib->isEntitledToRejectAntrag($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function canBeObjected($studierendenantrag_id)
|
||||
{
|
||||
return $this->antraglib->hasType($studierendenantrag_id, Studierendenantrag_model::TYP_ABMELDUNG_STGL);
|
||||
}
|
||||
|
||||
public function isObjected($studierendenantrag_id)
|
||||
{
|
||||
return $this->antraglib->hasStatus($studierendenantrag_id, Studierendenantragstatus_model::STATUS_OBJECTED);
|
||||
}
|
||||
|
||||
|
||||
public function approveAbmeldung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToApproveAntrag',
|
||||
[
|
||||
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
|
||||
$result = $this->antraglib->approveAbmeldung([$studierendenantrag_id], getAuthUID());
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function approveAbmeldungStgl()
|
||||
{
|
||||
return $this->approveAbmeldung();
|
||||
}
|
||||
|
||||
public function approveUnterbrechung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToApproveAntrag',
|
||||
[
|
||||
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
|
||||
$result = $this->antraglib->approveUnterbrechung([$studierendenantrag_id], getAuthUID());
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function rejectUnterbrechung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToRejectAntrag',
|
||||
[
|
||||
'isEntitledToRejectAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
|
||||
]
|
||||
);
|
||||
$this->form_validation->set_rules('grund', 'Grund', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
$grund = $this->input->post('grund');
|
||||
|
||||
$result = $this->antraglib->rejectUnterbrechung([$studierendenantrag_id], getAuthUID(), $grund);
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function approveWiederholung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'studierendenantrag_id',
|
||||
'Studierenden Antrag',
|
||||
'required|callback_isEntitledToApproveAntrag',
|
||||
[
|
||||
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
|
||||
|
||||
$result = $this->antraglib->approveWiederholung($studierendenantrag_id, getAuthUID());
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function isEntitledToApproveAntrag($studierendenantrag_id)
|
||||
{
|
||||
return $this->antraglib->isEntitledToApproveAntrag($studierendenantrag_id);
|
||||
}
|
||||
|
||||
public function getHistory($studierendenantrag_id)
|
||||
{
|
||||
if (!$this->antraglib->isEntitledToSeeHistoryForAntrag($studierendenantrag_id)) {
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJson('Forbidden');
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getAntragHistory($studierendenantrag_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \Studierendenantrag_model as Studierendenantrag_model;
|
||||
use \DateTime as DateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Unterbrechung extends FHC_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Calls the parent's constructor and loads the FilterCmptLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Configs
|
||||
$this->load->config('studierendenantrag');
|
||||
|
||||
// Libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag',
|
||||
'ui'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getDetailsForNewAntrag($prestudent_id)
|
||||
{
|
||||
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false)) {
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJsonError('Forbidden');
|
||||
}
|
||||
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($prestudent_id);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(500);
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
$result = $result->retval;
|
||||
if (!$result) {
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student'));
|
||||
}
|
||||
elseif ($result == -1)
|
||||
{
|
||||
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_UNTERBRECHUNG);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
elseif ($result == -2)
|
||||
{
|
||||
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$result = getData($result);
|
||||
$this->output->set_status_header(400);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_pending', [
|
||||
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
|
||||
]));
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
$this->output->set_status_header(403);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
|
||||
}
|
||||
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
$data->studiensemester = $this->antraglib->getSemesterForUnterbrechung($data->studiensemester_kurzbz);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
public function getDetailsForAntrag($studierendenantrag_id)
|
||||
{
|
||||
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id)) return show_404();
|
||||
|
||||
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
if ($data->typ !== Studierendenantrag_model::TYP_UNTERBRECHUNG)
|
||||
return show_404();
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
public function createAntrag()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
|
||||
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
|
||||
$this->form_validation->set_rules('grund', 'Grund', 'required');
|
||||
$this->form_validation->set_rules(
|
||||
'datum_wiedereinstieg',
|
||||
'Datum Wiedereinstieg',
|
||||
'required|callback_isValidDate|callback_isDateInFuture',
|
||||
[
|
||||
'isValidDate' => $this->p->t('ui', 'error_invalid_date'),
|
||||
'isDateInFuture' => $this->p->t('ui', 'error_invalid_date')
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$grund = $this->input->post('grund');
|
||||
$studiensemester = $this->input->post('studiensemester');
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
$datum_wiedereinstieg = $this->input->post('datum_wiedereinstieg');
|
||||
$dms_id = null;
|
||||
|
||||
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
$result = $result->retval;
|
||||
if (!$result)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
|
||||
}
|
||||
elseif ($result < 0)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
|
||||
}
|
||||
|
||||
if(isset($_FILES['attachment']) && (!isset($_FILES['attachment']['error']) || $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE))
|
||||
{
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
$dms = $this->config->item('unterbrechung_dms');
|
||||
if (!count(array_filter($dms, function ($v) {
|
||||
return $v !== null;
|
||||
})))
|
||||
$dms = ['kategorie_kurzbz' => 'Akte'];
|
||||
$dms['version'] = 0;
|
||||
|
||||
$allowed_filetypes = $this->config->item('unterbrechung_dms_filetypes') ?: ['*'];
|
||||
$result = $this->dmslib->upload($dms, 'attachment', $allowed_filetypes);
|
||||
if(isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
$dms_id = getData($result)['dms_id'];
|
||||
}
|
||||
|
||||
$result = $this->antraglib->createUnterbrechung($prestudent_id, $studiensemester, getAuthUID(), $grund, $datum_wiedereinstieg, $dms_id);
|
||||
if(isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
$antragId = getData($result);
|
||||
$result = $this->antraglib->getDetailsForAntrag($antragId);
|
||||
|
||||
if(!hasData($result))
|
||||
return $this->outputJsonSuccess($antragId);
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function cancelAntrag()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$antrag_id = $this->input->post('antrag_id');
|
||||
|
||||
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
|
||||
|
||||
if (!hasData($result))
|
||||
return $this->outputJsonSuccess($antrag_id);
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function isValidDate($date)
|
||||
{
|
||||
try {
|
||||
new DateTime($date);
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isDateInFuture($date)
|
||||
{
|
||||
return new DateTime() < new DateTime($date);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \REST_Controller as REST_Controller;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Wiederholung extends FHC_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Calls the parent's constructor and loads the FilterCmptLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Configs
|
||||
$this->load->config('studierendenantrag');
|
||||
|
||||
// Libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
$requiredPermissions = [
|
||||
'saveLvs' => ['student/studierendenantrag:w'],
|
||||
'getLvsAsRdf' => ['student/studierendenantrag:r', 'student/noten:r'],
|
||||
'moveLvsToZeugnis' => ['student/studierendenantrag:w', 'student/noten:w']
|
||||
];
|
||||
|
||||
if (isset($requiredPermissions[$this->router->method])) {
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
|
||||
$this->outputJson('Forbidden');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'studierendenantrag'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Retrieves data of the current studiengang for the current user
|
||||
*/
|
||||
|
||||
public function getDetailsForNewAntrag($prestudent_id)
|
||||
{
|
||||
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
|
||||
return $this->outputJsonError('Forbidden');
|
||||
}
|
||||
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
$result = $result->retval;
|
||||
if (!$result) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student_no_failed_exam'));
|
||||
}
|
||||
elseif ($result == -1)
|
||||
{
|
||||
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_WIEDERHOLUNG);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
$data = getData($result);
|
||||
|
||||
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id, $data->datum, $data->studiensemester_kurzbz);
|
||||
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
|
||||
$pruefungsdata = current(getData($result));
|
||||
|
||||
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
|
||||
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
|
||||
$data->pruefungsdatum = $pruefungsdata->datum;
|
||||
|
||||
return $this->outputJsonSuccess($data);
|
||||
}
|
||||
elseif ($result == -2)
|
||||
{
|
||||
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$result = getData($result);
|
||||
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_pending', [
|
||||
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
|
||||
]));
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
|
||||
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
|
||||
$pruefungsdata = current(getData($result));
|
||||
|
||||
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
|
||||
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
|
||||
$data->pruefungsdatum = $pruefungsdata->datum;
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
public function createAntrag()
|
||||
{
|
||||
$this->createAntragWithStatus(true);
|
||||
}
|
||||
|
||||
public function cancelAntrag()
|
||||
{
|
||||
$this->createAntragWithStatus(false);
|
||||
}
|
||||
|
||||
protected function createAntragWithStatus($repeat)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
|
||||
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
$studiensemester = $this->input->post('studiensemester');
|
||||
|
||||
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
$result = $result->retval;
|
||||
if (!$result)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
|
||||
}
|
||||
elseif ($result == -2)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
|
||||
}
|
||||
|
||||
$result = $this->antraglib->createWiederholung($prestudent_id, $studiensemester, getAuthUID(), $repeat);
|
||||
if(isError($result))
|
||||
{
|
||||
return $this->outputJsonError(['db' => getError($result)]);
|
||||
}
|
||||
|
||||
$antragId = getData($result);
|
||||
$result = $this->antraglib->getDetailsForAntrag($antragId);
|
||||
|
||||
if(!hasData($result))
|
||||
return $this->outputJsonSuccess(true);
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
|
||||
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
|
||||
$pruefungsdata = current(getData($result));
|
||||
|
||||
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
|
||||
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
|
||||
$data->pruefungsdatum = $pruefungsdata->datum;
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
|
||||
|
||||
public function getLvs($antrag_id)
|
||||
{
|
||||
$result = $this->antraglib->getLvsForAntrag($antrag_id);
|
||||
if (isError($result)) {
|
||||
$error = getError($result);
|
||||
if ($error == 'Forbidden')
|
||||
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
$lvs = getData($result);
|
||||
|
||||
$this->outputJsonSuccess($lvs);
|
||||
}
|
||||
|
||||
public function saveLvs()
|
||||
{
|
||||
$result = $this->getPostJSON();
|
||||
$antragsLvs = array_merge($result->forbiddenLvs, $result->mandatoryLvs);
|
||||
|
||||
$insert = array_map(function ($lv) {
|
||||
return [
|
||||
'studierendenantrag_id' => $lv->studierendenantrag_id,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id,
|
||||
'note' => $lv->zugelassen
|
||||
? ($lv->zugelassen == 1 ? 0 : $this->config->item('wiederholung_note_angerechnet'))
|
||||
: $this->config->item('wiederholung_note_nicht_zugelassen'),
|
||||
'anmerkung' => $lv->anmerkung,
|
||||
'insertvon' => getAuthUID(),
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz
|
||||
];
|
||||
}, $antragsLvs);
|
||||
|
||||
$antrag_ids = array_unique(array_map(function ($lv) {
|
||||
return $lv['studierendenantrag_id'];
|
||||
}, $insert));
|
||||
|
||||
foreach ($antrag_ids as $antrag_id) {
|
||||
$result = $this->StudierendenantragModel->loadIdAndStatusWhere([
|
||||
'studierendenantrag_id' => $antrag_id
|
||||
]);
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (!hasData($result))
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $antrag_id]));
|
||||
$antrag = current(getData($result));
|
||||
if ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED && $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED)
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_locked'));
|
||||
}
|
||||
|
||||
if(!$antragsLvs)
|
||||
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_lv'));
|
||||
|
||||
$result = $this->antraglib->saveLvs($insert);
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function getLvsAsRdf($prestudent_id)
|
||||
{
|
||||
// header für no cache
|
||||
$this->output->set_header("Cache-Control: no-cache");
|
||||
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
$this->output->set_header("Pragma: no-cache");
|
||||
$this->output->set_header("Content-type: application/xhtml+xml");
|
||||
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$sem_akt = $this->variablelib->getVar('semester_aktuell');
|
||||
|
||||
|
||||
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $sem_akt);
|
||||
if (isError($result)) {
|
||||
return $this->outputJsonError(getError($result));
|
||||
}
|
||||
|
||||
$lvs = getData($result) ?: [];
|
||||
$rdf_url = 'http://www.technikum-wien.at/antragnote';
|
||||
|
||||
$this->load->view('lehre/Antrag/Wiederholung/getLvs.rdf.php', [
|
||||
'url' => $rdf_url,
|
||||
'lvs' => $lvs
|
||||
]);
|
||||
}
|
||||
|
||||
public function moveLvsToZeugnis()
|
||||
{
|
||||
$anzahl = $this->input->post('anzahl');
|
||||
$student_uid = $this->input->post('student_uid');
|
||||
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
|
||||
$errormsg = array();
|
||||
|
||||
for($i=0; $i<$anzahl; $i++)
|
||||
{
|
||||
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id_' . $i);
|
||||
$result =$this->StudierendenantraglehrveranstaltungModel->load($id);
|
||||
if(isError($result))
|
||||
{
|
||||
$errormsg[] = getError($result);
|
||||
}
|
||||
elseif(!hasData($result))
|
||||
{
|
||||
$errormsg[] = $this->p->t('studierendenantrag', 'error_no_lv_in_application');
|
||||
}
|
||||
else
|
||||
{
|
||||
$antragLv = getData($result)[0];
|
||||
$result= $this->ZeugnisnoteModel->load([
|
||||
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
|
||||
'student_uid'=> $student_uid,
|
||||
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
|
||||
]);
|
||||
if(isError($result))
|
||||
{
|
||||
$errormsg[] = getError($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasData($result))
|
||||
{
|
||||
$result = $this->ZeugnisnoteModel->update(
|
||||
[
|
||||
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
|
||||
'student_uid'=> $student_uid,
|
||||
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
|
||||
],
|
||||
[
|
||||
'note'=> $antragLv->note,
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $antragLv->insertamum,
|
||||
'updateamum' => date('c'),
|
||||
'bemerkung'=>$antragLv->anmerkung,
|
||||
'updatevon'=>getAuthUID()
|
||||
]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->ZeugnisnoteModel->insert([
|
||||
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
|
||||
'student_uid'=> $student_uid,
|
||||
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz,
|
||||
'note'=> $antragLv->note,
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $antragLv->insertamum,
|
||||
'insertamum' => date('c'),
|
||||
'bemerkung'=>$antragLv->anmerkung,
|
||||
'insertvon'=>getAuthUID()
|
||||
]);
|
||||
}
|
||||
if(isError($result))
|
||||
{
|
||||
$errormsg[] = getError($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($errormsg)
|
||||
$return = false;
|
||||
else
|
||||
$return = true;
|
||||
|
||||
$this->load->view('lehre/Antrag/Wiederholung/moveLvs.rdf.php', [
|
||||
'return' => $return,
|
||||
'errormsg' => $errormsg
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,9 @@ class Filter extends FHC_Controller
|
||||
// Loads authentication library and starts authentication
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
// Loads the FiltersModel
|
||||
$this->load->model('system/Filters_model', 'FiltersModel');
|
||||
|
||||
// Loads the FilterCmptLib with HTTP GET/POST parameters
|
||||
$this->_startFilterCmptLib();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Phrasen extends FHC_Controller
|
||||
{
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @param string $module
|
||||
*/
|
||||
public function loadModule($module)
|
||||
{
|
||||
$this->load->library('PhrasesLib', [$module], 'pj');
|
||||
$this->outputJsonSuccess(json_decode($this->pj->getJSON()));
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,9 @@ class SearchBar extends FHC_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the AuthLib and starts the authentication
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
// Load the library SearchBarLib
|
||||
$this->load->library('SearchBarLib');
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ class AnrechnungJob extends JOB_Controller
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
$this->load->library('AnrechnungLib');
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +216,7 @@ class AnrechnungJob extends JOB_Controller
|
||||
'datentabelle' => $anrechnungen_table,
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
|
||||
// Send mail
|
||||
sendSanchoMail(
|
||||
'AnrechnungAntragStellen',
|
||||
@@ -227,6 +230,82 @@ class AnrechnungJob extends JOB_Controller
|
||||
$this->logInfo('SUCCEDED: Sending emails to STGL about yesterdays new Anrechnungen succeded.');
|
||||
}
|
||||
|
||||
// Send Sancho mail to LV-Leitung (fallback Lectors) that were requested for recommendation yesterday.
|
||||
public function sendMailRecommendationRequests(){
|
||||
|
||||
$this->logInfo('Start AnrechnungJob sendMailRecommendationRequests to inform lecturers about yesterdays requests for recommendation.');
|
||||
|
||||
// Get Anrechnungen, für die gestern eine Empfehlung angefragt worden ist
|
||||
$this->AnrechnungModel->addSelect('astat.anrechnung_id, astat.datum, astat.insertamum');
|
||||
$this->AnrechnungModel->addDistinct('astat.anrechnung_id');
|
||||
$this->AnrechnungModel->addJoin('lehre.tbl_anrechnung_anrechnungstatus astat', 'anrechnung_id');
|
||||
|
||||
$result = $this->AnrechnungModel->loadWhere('
|
||||
studiensemester_kurzbz = (SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE now()::date BETWEEN start AND ende)
|
||||
AND genehmigt_von IS NULL
|
||||
AND empfehlung_anrechnung IS NULL
|
||||
AND status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) .' -- in Bearbeitung durch Lektor
|
||||
AND NOW()::date = (astat.datum + interval \'1 day\') -- nur gestrige Empfehlungsanfrage
|
||||
ORDER BY astat.anrechnung_id, astat.datum DESC, astat.insertamum DESC -- nur letzten status dabei prüfen
|
||||
');
|
||||
|
||||
// Exit, wenn es gestern keine Empfehlungsanfragen gab
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->logInfo('End AnrechnungJob sendMailRecommendationRequests, because no recommendations were requested yesterday.');
|
||||
exit;
|
||||
}
|
||||
|
||||
$anrechnung_id_arr = array_column(getData($result), 'anrechnung_id');
|
||||
|
||||
$arr_lvLector_arr = array();
|
||||
foreach ($anrechnung_id_arr as $anrechnung_id)
|
||||
{
|
||||
// Get full name of Fachbereichsleitung or LV Leitung.
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$arr_lvLector_arr[] = $this->anrechnunglib->getLeitungOfLvOe($anrechnung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$arr_lvLector_arr[] = $this->anrechnunglib->getLectors($anrechnung_id); // Returns LV Leitung. If not present, then all lectors of LV.
|
||||
}
|
||||
}
|
||||
|
||||
// Unique lector array to send only one mail per lector
|
||||
$arr_lvLector_arr = array_unique($arr_lvLector_arr, SORT_REGULAR);
|
||||
|
||||
// Link to 'Anrechnungen prüfen' dashboard
|
||||
$url =
|
||||
CIS_ROOT. 'cis/index.php?menu='.
|
||||
CIS_ROOT. 'cis/menu.php?content_id=&content='.
|
||||
CIS_ROOT. index_page(). self::REVIEW_ANRECHNUNG_URI;
|
||||
|
||||
foreach ($arr_lvLector_arr as $lvLector_arr)
|
||||
{
|
||||
foreach ($lvLector_arr as $lector)
|
||||
{
|
||||
// Prepare mail content
|
||||
$fields = array(
|
||||
'vorname' => $lector->vorname,
|
||||
'stgl_name' => 'Die Studiengangsleitung',
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
// Send mail
|
||||
sendSanchoMail(
|
||||
'AnrechnungEmpfehlungAnfordern',
|
||||
$fields,
|
||||
$lector->uid. '@'. DOMAIN,
|
||||
'Deine Empfehlung wird benötigt zur Anerkennung nachgewiesener Kenntnisse'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo('SUCCEDED AnrechnungJob sendMailRecommendationRequests');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Sancho mail to students, whose Anrechnungen were approved 24 hours ago.
|
||||
*/
|
||||
@@ -308,7 +387,7 @@ class AnrechnungJob extends JOB_Controller
|
||||
|
||||
$db = new DB_Model();
|
||||
$result = $db->execReadOnlyQuery($qry);
|
||||
|
||||
|
||||
// Exit if there are no rejected Anrechnungen
|
||||
if (!hasData($result))
|
||||
{
|
||||
@@ -361,9 +440,9 @@ html;
|
||||
|
||||
$result = $this->AnrechnungModel->loadWhere('
|
||||
studiensemester_kurzbz = (
|
||||
SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE now()::date BETWEEN start AND ende)
|
||||
SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE now()::date BETWEEN start AND ende
|
||||
)
|
||||
AND genehmigt_von IS NULL
|
||||
AND genehmigt_von IS NULL
|
||||
AND empfehlung_anrechnung IS NULL
|
||||
AND status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) .' -- in Bearbeitung durch Lektor
|
||||
AND NOW()::date = (astat.datum + interval \'1 week\') -- eine Woche nach Empfehlungsanfrage
|
||||
@@ -376,7 +455,7 @@ html;
|
||||
$this->logInfo('End AnrechnungJob sendMailRemindRecommendation, because no recommendations to be done.');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$anrechnung_id_arr = array_column(getData($result), 'anrechnung_id');
|
||||
|
||||
$arr_lvLector_arr = array();
|
||||
@@ -435,7 +514,7 @@ html;
|
||||
'vorname' => $stgl->vorname
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $stglMailAdress_arr;
|
||||
}
|
||||
// If not available, get assistance mail address
|
||||
|
||||
@@ -0,0 +1,627 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class AntragJob extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Configs
|
||||
$this->load->config('studierendenantrag');
|
||||
|
||||
// Loads SanchoHelper
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
// Load Model
|
||||
$this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
$this->load->model('education/Studierendenantragstatus_model', 'StudierendenantragstatusModel');
|
||||
$this->load->model('education/Pruefung_model', 'PruefungModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send infomail to Stgl
|
||||
*/
|
||||
public function sendStglSammelmail()
|
||||
{
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$this->logInfo('Start Job sendStglSammelmail');
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudierendenantragModel->addJoin('public.tbl_prestudent', 'prestudent_id');
|
||||
$this->db->group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG_STGL);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_UNTERBRECHUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_WIEDERHOLUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_LVSASSIGNED);
|
||||
$this->db->group_end();
|
||||
|
||||
$result = $this->StudierendenantragModel->load();
|
||||
if(isError($result))
|
||||
return $this->logError(getError($result));
|
||||
|
||||
if(!hasData($result))
|
||||
return $this->logInfo('End Job sendStglSammelmail: 0 Mails sent');
|
||||
|
||||
$antraege = getData($result);
|
||||
|
||||
$stgs = array();
|
||||
$stgLeitungen = array();
|
||||
|
||||
foreach ($antraege as $antrag)
|
||||
{
|
||||
if (!isset($stgs[$antrag->studiengang_kz]))
|
||||
{
|
||||
$result = $this->StudiengangModel->getLeitung($antrag->studiengang_kz);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
continue;
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->logError('Keine Leitung für Studiengang ' . $antrag->studiengang_kz . ' gefunden!');
|
||||
continue;
|
||||
}
|
||||
|
||||
$leitung = current(getData($result));
|
||||
if (!isset($stgLeitungen[$leitung->uid]))
|
||||
{
|
||||
$stgLeitungen[$leitung->uid] = [ 'Details' => $leitung, 'stgs' => [] ];
|
||||
}
|
||||
$stgLeitungen[$leitung->uid]['stgs'][] = $antrag->studiengang_kz;
|
||||
|
||||
$result = $this->StudierendenantragModel->getStgAndSem($antrag->studierendenantrag_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
continue;
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->logError('Keine Details für Studiengang ' . $antrag->studiengang_kz . ' gefunden!');
|
||||
continue;
|
||||
}
|
||||
$details = current(getData($result));
|
||||
|
||||
$stgs[$antrag->studiengang_kz] = [
|
||||
'Abmeldung' => [],
|
||||
'Unterbrechung' => [],
|
||||
'Wiederholung' => [],
|
||||
'Details' => $details
|
||||
];
|
||||
}
|
||||
$stgs[$antrag->studiengang_kz][str_replace('Stgl', '', $antrag->typ)] = $antrag;
|
||||
}
|
||||
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$result = $this->SpracheModel->loadWhere(['content' => true]);
|
||||
if (isError($result)) {
|
||||
$this->logError(getError($result));
|
||||
$languages = [DEFAULT_LANGUAGE];
|
||||
} elseif (!hasData($result)) {
|
||||
$languages = [DEFAULT_LANGUAGE];
|
||||
} else {
|
||||
$languages = array_map(function ($row) {
|
||||
return $row->sprache;
|
||||
}, getData($result));
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
foreach ($stgLeitungen as $leitung)
|
||||
{
|
||||
$data = [
|
||||
'name' => trim($leitung['Details']->vorname . ' ' . $leitung['Details']->nachname),
|
||||
'vorname' => $leitung['Details']->vorname,
|
||||
'nachname' => $leitung['Details']->nachname
|
||||
];
|
||||
|
||||
foreach ($languages as $lang) {
|
||||
unset($this->p);
|
||||
$this->loadPhrases(['studierendenantrag'], $lang);
|
||||
|
||||
$table = '';
|
||||
foreach ($leitung['stgs'] as $studiengang_kz) {
|
||||
$rows = '';
|
||||
$stg = $stgs[$studiengang_kz];
|
||||
foreach (['Abmeldung', 'Unterbrechung', 'Wiederholung'] as $typ) {
|
||||
$c = count($stg[$typ]);
|
||||
if ($c) {
|
||||
$rows .= $this->p->t('studierendenantrag', 'mail_part_x_new_' . $typ, ['count' => $c]);
|
||||
}
|
||||
}
|
||||
$table .= $this->p->t('studierendenantrag', 'mail_part_table', [
|
||||
'stg_bezeichnung' => $stg['Details']->bezeichnung,
|
||||
'stg_orgform_kurzbz' => $stg['Details']->orgform_kurzbz,
|
||||
'rows' => $rows
|
||||
]);
|
||||
}
|
||||
$data['table_' . $lang] = $table;
|
||||
}
|
||||
|
||||
$data['table'] = $data['table_' . DEFAULT_LANGUAGE];
|
||||
$data['leitungLink'] = APP_ROOT. 'index.ci.php/lehre/Studierendenantrag/leitung';
|
||||
|
||||
//Mail an Stgl und Assistenz
|
||||
$to = $leitung['Details']->uid . '@' . DOMAIN;
|
||||
$cc = $leitung['Details']->email;
|
||||
|
||||
// NOTE(chris): Sancho mail
|
||||
if (sendSanchoMail("Sancho_Mail_Antrag_Stgl", $data, $to, 'Anträge - Aktion(en) erforderlich', DEFAULT_SANCHO_HEADER_IMG, DEFAULT_SANCHO_FOOTER_IMG, '', $cc))
|
||||
$count++;
|
||||
}
|
||||
|
||||
$this->logInfo($count . " Emails erfolgreich versandt");
|
||||
|
||||
$this->logInfo('End Job sendStglSammelmail');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send reminder to Assistant 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');
|
||||
|
||||
$end = new DateTime();
|
||||
$end->modify($modifier);
|
||||
|
||||
$this->logInfo(sprintf(
|
||||
'Start Job sendReminderWiedereinstieg (Wiedereinstieg zwischen %s - %s)',
|
||||
$now->format('Y-m-d'),
|
||||
$end->format('Y-m-d')
|
||||
));
|
||||
|
||||
$result = $this->StudierendenantragModel->getAntraegeWhereWiedereinstiegBetween($now, $end);
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
$this->logInfo('Ende Job sendReminderWiedereinstieg');
|
||||
return;
|
||||
}
|
||||
|
||||
$antraege = getData($result) ?: [];
|
||||
$count = 0;
|
||||
foreach ($antraege as $antrag)
|
||||
{
|
||||
$res = $this->StudierendenantragModel->getStgAndSem($antrag->studierendenantrag_id);
|
||||
$stg = '';
|
||||
$orgform = '';
|
||||
if (hasData($res)) {
|
||||
$studiengang = current(getData($res));
|
||||
$stg = $studiengang->bezeichnung;
|
||||
$orgform = $studiengang->orgform_kurzbz;
|
||||
}
|
||||
|
||||
$datum = new DateTime($antrag->datum_wiedereinstieg);
|
||||
$data = array(
|
||||
'prestudent' => $antrag->prestudent_id,
|
||||
'name' => trim($antrag->vorname . ' '. $antrag->nachname),
|
||||
'datum_wiedereinstieg' => $datum->format('d.m.Y'),
|
||||
'vorname' => $antrag->vorname,
|
||||
'nachname' => $antrag->nachname,
|
||||
'Orgform' => $orgform,
|
||||
'stg' => $stg
|
||||
);
|
||||
$result = $this->StudentModel->loadWhere(['prestudent_id'=> $antrag->prestudent_id]);
|
||||
if (hasData($result)) {
|
||||
$student = current(getData($result));
|
||||
$data['UID'] = $student->student_uid;
|
||||
}
|
||||
|
||||
// NOTE(chris): Sancho mail
|
||||
if(sendSanchoMail('Sancho_Mail_Antrag_U_Reminder', $data, $antrag->email, 'Reminder: Unterbrechung Wiedereinstieg'))
|
||||
{
|
||||
$count++;
|
||||
$this->StudierendenantragstatusModel->insert([
|
||||
'studierendenantrag_id' => $antrag->studierendenantrag_id,
|
||||
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_REMINDERSENT,
|
||||
'insertvon' => 'AntragJob'
|
||||
]);
|
||||
}
|
||||
}
|
||||
$this->logInfo($count . ' Reminder gesendet - Ende Job sendReminderWiedereinstieg');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Wiederholer after deadline to Abbrecher
|
||||
*
|
||||
*/
|
||||
public function handleWiederholerDeadline()
|
||||
{
|
||||
$this->logInfo('Start Job handleWiederholerDeadline');
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
|
||||
$insertvon = $this->config->item('antrag_job_systemuser');
|
||||
if (!$insertvon) {
|
||||
$this->logError('Config "antrag_job_systemuser" nicht gesetzt');
|
||||
$this->logInfo('Ende Job handleWiederholerDeadline');
|
||||
return;
|
||||
}
|
||||
|
||||
$modifier_deadline = $this->config->item('wiederholung_job_deadline_date_modifier');
|
||||
if (!$modifier_deadline) {
|
||||
$this->logError('Config "wiederholung_job_deadline_date_modifier" nicht gesetzt');
|
||||
$this->logInfo('Ende Job handleWiederholerDeadline');
|
||||
return;
|
||||
}
|
||||
|
||||
$digi_start= $this->config->item('digitalization_start');
|
||||
if($digi_start)
|
||||
$digi_start = new DateTime($digi_start);
|
||||
|
||||
$dateDeadline = new DateTime();
|
||||
$dateDeadline->sub(DateInterval::createFromDateString($modifier_deadline));
|
||||
|
||||
$result = $this->PruefungModel->getAllPrestudentsWhereCommitteeExamFailed(
|
||||
[
|
||||
Studierendenantragstatus_model::STATUS_REQUESTSENT_1,
|
||||
Studierendenantragstatus_model::STATUS_REQUESTSENT_2
|
||||
],
|
||||
$dateDeadline,
|
||||
$digi_start
|
||||
);
|
||||
if(isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
$prestudents = getData($result) ?: [];
|
||||
$count = 0;
|
||||
|
||||
$prestudents = $this->prestudentsGetUnique($prestudents);
|
||||
|
||||
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$result = $this->prestudentlib->setAbbrecher($prestudent->prestudent_id, $prestudent->studiensemester_kurzbz, $insertvon);
|
||||
if (isError($result))
|
||||
$this->logError(getError($result));
|
||||
else
|
||||
$count++;
|
||||
}
|
||||
$this->logInfo($count . " Students set to Abbrecher");
|
||||
}
|
||||
|
||||
$this->logInfo('Ende Job handleWiederholerDeadline');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Abmeldungen after deadline to Abbrecher
|
||||
*
|
||||
*/
|
||||
public function handleAbmeldungenStglDeadline()
|
||||
{
|
||||
$this->logInfo('Start Job handleAbmeldungenStglDeadline');
|
||||
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
$insertvon = $this->config->item('antrag_job_systemuser');
|
||||
if (!$insertvon) {
|
||||
$this->logError('Config "antrag_job_systemuser" nicht gesetzt');
|
||||
$this->logInfo('Ende Job handleAbmeldungenStglDeadline');
|
||||
return;
|
||||
}
|
||||
|
||||
$modifier_deadline = $this->config->item('abmeldung_job_deadline_date_modifier');
|
||||
if (!$modifier_deadline) {
|
||||
$this->logError('Config "abmeldung_job_deadline_date_modifier" nicht gesetzt');
|
||||
$this->logInfo('Ende Job handleAbmeldungenStglDeadline');
|
||||
return;
|
||||
}
|
||||
|
||||
$dateDeadline = new DateTime();
|
||||
$dateDeadline->sub(DateInterval::createFromDateString($modifier_deadline));
|
||||
|
||||
$this->StudierendenantragModel->addSelect('tbl_studierendenantrag.studierendenantrag_id');
|
||||
$this->StudierendenantragModel->addSelect('prestudent_id');
|
||||
$this->StudierendenantragModel->addSelect('studiensemester_kurzbz');
|
||||
$this->StudierendenantragModel->addSelect('s.insertamum');
|
||||
$this->StudierendenantragModel->addSelect('s.insertvon');
|
||||
|
||||
$this->StudierendenantragModel->db->where_in('public.get_rolle_prestudent(prestudent_id, studiensemester_kurzbz)', $this->config->item('antrag_prestudentstatus_whitelist'));
|
||||
|
||||
$result = $this->StudierendenantragModel->getWithLastStatusWhere([
|
||||
'typ' => Studierendenantrag_model::TYP_ABMELDUNG_STGL,
|
||||
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_APPROVED,
|
||||
's.insertamum <=' => $dateDeadline->format('c')
|
||||
]);
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
$antraege = getData($result) ?: [];
|
||||
$count = 0;
|
||||
|
||||
foreach ($antraege as $antrag)
|
||||
{
|
||||
$result = $this->StudierendenantragstatusModel->insert([
|
||||
'studierendenantrag_id' => $antrag->studierendenantrag_id,
|
||||
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_DEREGISTERED,
|
||||
'insertvon' => 'AntragJob'
|
||||
]);
|
||||
if (isError($result))
|
||||
$this->logError(getError($result));
|
||||
else {
|
||||
$deregisterStatus = getData($result);
|
||||
|
||||
$result = $this->prestudentlib->setAbbrecher(
|
||||
$antrag->prestudent_id,
|
||||
$antrag->studiensemester_kurzbz,
|
||||
'AntragJob',
|
||||
'abbrecherStgl',
|
||||
$antrag->insertamum,
|
||||
null,
|
||||
$antrag->insertvon ?: $insertvon
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->StudierendenantragstatusModel->delete($deregisterStatus);
|
||||
$this->logError(getError($result));
|
||||
} else {
|
||||
$count++;
|
||||
$result = $this->PrestudentModel->load($antrag->prestudent_id);
|
||||
if(!hasData($result)) {
|
||||
$this->logWarning('No Prestudent found');
|
||||
continue;
|
||||
}
|
||||
$prestudent = current(getData($result));
|
||||
$result = $this->StudiengangModel->load($prestudent->studiengang_kz);
|
||||
if(!hasData($result)) {
|
||||
$this->logWarning('No Studiengang found');
|
||||
continue;
|
||||
}
|
||||
$studiengang = current(getData($result));
|
||||
$result = $this->PersonModel->loadPrestudent($antrag->prestudent_id);
|
||||
if(!hasData($result))
|
||||
{
|
||||
$this->logWarning('No Person found');
|
||||
continue;
|
||||
}
|
||||
$person = current(getData($result));
|
||||
$email = $studiengang->email;
|
||||
$dataMail = array(
|
||||
'prestudent' => $antrag->prestudent_id,
|
||||
'studiensemester' => $antrag->studiensemester_kurzbz,
|
||||
'name' => trim($person->vorname . ' '. $person->nachname),
|
||||
);
|
||||
|
||||
if(!sendSanchoMail('Sancho_Mail_Antrag_A_Assist', $dataMail, $email, 'Einspruchsfrist abgelaufen'))
|
||||
{
|
||||
$this->logWarning("Failed to send Notification to " . $email);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$this->logInfo($count . "/" . count($antraege) . " Students set to Abbrecher");
|
||||
}
|
||||
$this->logInfo('Ende Job handleAbmeldungenStglDeadline');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Request to Student do Decide between Wiederholung and Verzicht
|
||||
*
|
||||
*/
|
||||
public function sendAufforderungWiederholer()
|
||||
{
|
||||
$this->logInfo('Start Job sendAufforderungWiederholer');
|
||||
|
||||
$modifier_request_1 = $this->config->item('wiederholung_job_request_1_date_modifier');
|
||||
$modifier_request_2 = $this->config->item('wiederholung_job_request_2_date_modifier');
|
||||
$modifier_deadline = $this->config->item('wiederholung_job_deadline_date_modifier');
|
||||
|
||||
$digi_start = $this->config->item('digitalization_start');
|
||||
if ($digi_start) {
|
||||
try {
|
||||
$digi_start = new DateTime($digi_start);
|
||||
} catch(Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($modifier_deadline) {
|
||||
$dateDeadline = new DateTime();
|
||||
$dateDeadline->sub(DateInterval::createFromDateString($modifier_deadline));
|
||||
|
||||
if ($digi_start)
|
||||
$dateDeadline = max($digi_start, $dateDeadline);
|
||||
} else {
|
||||
$dateDeadline = $digi_start ?: null;
|
||||
}
|
||||
|
||||
//first request
|
||||
if ($modifier_request_1) {
|
||||
$dateStichtag = new DateTime();
|
||||
$dateStichtag->sub(DateInterval::createFromDateString($modifier_request_1));
|
||||
if (!$dateDeadline || $dateStichtag > $dateDeadline)
|
||||
$this->sendReminder(
|
||||
'Request1',
|
||||
null,
|
||||
Studierendenantragstatus_model::STATUS_REQUESTSENT_1,
|
||||
$dateDeadline,
|
||||
$dateStichtag,
|
||||
$modifier_deadline,
|
||||
'Aufforderung: Bekanntgabe Wiederholung'
|
||||
);
|
||||
} else
|
||||
$this->logError('Config "wiederholung_job_request_1_date_modifier" nicht gesetzt');
|
||||
|
||||
//second request
|
||||
if ($modifier_request_2) {
|
||||
$dateStichtag = new DateTime();
|
||||
$dateStichtag->sub(DateInterval::createFromDateString($modifier_request_2));
|
||||
if (!$dateDeadline || $dateStichtag > $dateDeadline)
|
||||
$this->sendReminder(
|
||||
'Request2',
|
||||
Studierendenantragstatus_model::STATUS_REQUESTSENT_1,
|
||||
Studierendenantragstatus_model::STATUS_REQUESTSENT_2,
|
||||
$dateDeadline,
|
||||
$dateStichtag,
|
||||
$modifier_deadline,
|
||||
'Reminder Aufforderung: Bekanntgabe Wiederholung'
|
||||
);
|
||||
} else
|
||||
$this->logError('Config "wiederholung_job_request_2_date_modifier" nicht gesetzt');
|
||||
|
||||
$this->logInfo('Ende Job sendAufforderungWiederholer');
|
||||
}
|
||||
|
||||
protected function prestudentsGetUnique($prestudents)
|
||||
{
|
||||
$result = [];
|
||||
foreach ($prestudents as $prestudent) {
|
||||
if (!isset($result[$prestudent->prestudent_id]))
|
||||
$result[$prestudent->prestudent_id] = $prestudent;
|
||||
else {
|
||||
if ($result[$prestudent->prestudent_id]->datum > $prestudent->datum)
|
||||
$result[$prestudent->prestudent_id] = $prestudent;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function sendReminder($name, $status_from, $status_to, $deadline, $date_stichtag, $modifier_deadline, $subject)
|
||||
{
|
||||
$this->logInfo('Start Job sendAufforderungWiederholer ' . $name);
|
||||
|
||||
$result = $this->PruefungModel->getAllPrestudentsWhereCommitteeExamFailed($status_from, $date_stichtag, $deadline);
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
$prestudents = getData($result) ?: [];
|
||||
$count = 0;
|
||||
|
||||
$prestudents = $this->prestudentsGetUnique($prestudents);
|
||||
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$stg_kz = $prestudent->studiengang_kz;
|
||||
if (in_array($stg_kz, $this->config->item('stgkz_blacklist_wiederholung')))
|
||||
continue;
|
||||
$url = site_url('lehre/Studierendenantrag/wiederholung/' . $prestudent->prestudent_id);
|
||||
$urlCIS = CIS_ROOT . 'index.ci.php/lehre/Studierendenantrag/wiederholung/' . $prestudent->prestudent_id;
|
||||
$email = $this->StudentModel->getEmailFH($this->StudentModel->getUID($prestudent->prestudent_id));
|
||||
|
||||
$fristende = new DateTime($prestudent->datum);
|
||||
$fristende->add(DateInterval::createFromDateString($modifier_deadline));
|
||||
|
||||
$datum_kp = new DateTime($prestudent->datum);
|
||||
|
||||
$result = $this->StudiensemesterModel->getNextFrom($prestudent->studiensemester_kurzbz);
|
||||
$next_sem = "";
|
||||
$sem_after_next_sem = "";
|
||||
if (hasData($result)) {
|
||||
$next_sem = current(getData($result))->studiensemester_kurzbz;
|
||||
$result = $this->StudiensemesterModel->getNextFrom($next_sem);
|
||||
if (hasData($result)) {
|
||||
$sem_after_next_sem = current(getData($result))->studiensemester_kurzbz;
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$result = $this->PrestudentstatusModel->loadLastWithStgDetails($prestudent->prestudent_id, $prestudent->studiensemester_kurzbz);
|
||||
if (hasData($result)) {
|
||||
$ausbildungssemester = current(getData($result))->semester;
|
||||
}
|
||||
|
||||
$dataMail = array(
|
||||
'name'=> trim($prestudent->vorname . ' '. $prestudent->nachname),
|
||||
'vorname' => $prestudent->vorname,
|
||||
'nachname' => $prestudent->nachname,
|
||||
'pers_kz'=> $prestudent->matrikelnr,
|
||||
'stg' => $prestudent->bezeichnung,
|
||||
'lvbezeichnung' => $prestudent->lvbezeichnung,
|
||||
'datum_kp' => $datum_kp->format('d.m.Y'),
|
||||
'studiensemester'=> $prestudent->studiensemester_kurzbz,
|
||||
'Orgform'=> $prestudent->orgform,
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'url' => $url,
|
||||
'urlCIS' => $urlCIS,
|
||||
'fristablauf' => $fristende->format('d.m.Y'),
|
||||
'pre_wiederholer_sem' => $next_sem,
|
||||
'wiederholer_sem' => $sem_after_next_sem,
|
||||
'sem' => $ausbildungssemester
|
||||
);
|
||||
|
||||
// NOTE(chris): Sancho mail
|
||||
if(sendSanchoMail('Sancho_Mail_Antrag_W_' . $name, $dataMail, $email, $subject))
|
||||
{
|
||||
$antrag_id = null;
|
||||
$result = $this->StudierendenantragModel->loadWhere([
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG
|
||||
]);
|
||||
if (isError($result))
|
||||
$this->logError(getError($result));
|
||||
elseif (hasData($result))
|
||||
$antrag_id = current(getData($result) ?: []) -> studierendenantrag_id;
|
||||
if ($antrag_id == null)
|
||||
{
|
||||
$result = $this->StudierendenantragModel->insert([
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz'=> $prestudent->studiensemester_kurzbz,
|
||||
'datum' => date('c'),
|
||||
'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG,
|
||||
'insertvon' => 'AntragJob'
|
||||
]);
|
||||
if (isError($result))
|
||||
$this->logError(getError($result));
|
||||
else
|
||||
$antrag_id = getData($result);
|
||||
}
|
||||
if ($antrag_id)
|
||||
{
|
||||
$result = $this->StudierendenantragstatusModel->insert([
|
||||
'studierendenantrag_id' => $antrag_id,
|
||||
'studierendenantrag_statustyp_kurzbz' => $status_to,
|
||||
'insertvon' => 'AntragJob'
|
||||
]);
|
||||
if (isError($result))
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
$this->logInfo($count . " Mails '" . $subject . "' sent");
|
||||
}
|
||||
$this->logInfo('Ende Job sendAufforderungWiederholer ' . $name);
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,7 @@ class IssueResolver extends IssueResolver_Controller
|
||||
'CORE_STUDENTSTATUS_0012' => 'CORE_STUDENTSTATUS_0012',
|
||||
'CORE_STUDENTSTATUS_0013' => 'CORE_STUDENTSTATUS_0013',
|
||||
'CORE_STUDENTSTATUS_0014' => 'CORE_STUDENTSTATUS_0014',
|
||||
'CORE_STUDENTSTATUS_0015' => 'CORE_STUDENTSTATUS_0015',
|
||||
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
|
||||
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
|
||||
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Job for producing Plausicheck issues
|
||||
* Job for producing core Plausicheck issues
|
||||
*/
|
||||
class PlausiIssueProducer extends JOB_Controller
|
||||
class PlausiIssueProducer extends PlausiIssueProducer_Controller
|
||||
{
|
||||
private $_currentStudiensemester;
|
||||
protected $_app = 'core';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('issues/PlausicheckProducerLib');
|
||||
$this->load->library('IssuesLib');
|
||||
$this->load->library('issues/PlausicheckDefinitionLib');
|
||||
|
||||
// load models
|
||||
$this->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// get current Studiensemester
|
||||
$studiensemesterRes = $this->StudiensemesterModel->getAkt();
|
||||
if (hasData($studiensemesterRes)) $this->_currentStudiensemester = getData($studiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
|
||||
// set fehler which can be produced by the job
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
$this->_fehlerLibMappings = $this->plausicheckdefinitionlib->getFehlerLibMappings();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,43 +33,10 @@ class PlausiIssueProducer extends JOB_Controller
|
||||
*/
|
||||
public function run($studiensemester_kurzbz = null, $studiengang_kz = null)
|
||||
{
|
||||
$fehlerKurzbz = $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
// get Studiensemester
|
||||
if (isEmptyString($studiensemester_kurzbz)) $studiensemester_kurzbz = $this->_currentStudiensemester;
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job started");
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// execute the check
|
||||
$this->logInfo("Checking " . $fehler_kurzbz . "...");
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($plausicheckRes)) $this->logError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// write the issue
|
||||
$addIssueRes = $this->issueslib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isError($addIssueRes))
|
||||
$this->logError(getError($addIssueRes));
|
||||
elseif (hasData($addIssueRes) && is_integer(getData($addIssueRes)))
|
||||
$this->logInfo("Plausicheck issue " . $fehler_kurzbz . " successfully produced, person_id: " . $person_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job stopped");
|
||||
// producing issues for semester and optionally Studiengang
|
||||
$this->producePlausicheckIssues(array('studiensemester_kurzbz' => $studiensemester_kurzbz, 'studiengang_kz' => $studiengang_kz));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class ReihungstestJob extends JOB_Controller
|
||||
{
|
||||
|
||||
const LAST_DAYS_PRESTUDENTSTATUS = 5;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -464,7 +467,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
$this->PrestudentstatusModel->addJoin('public.tbl_person', 'person_id');
|
||||
|
||||
$yesterdays_applicants_arr = $this->PrestudentstatusModel->loadWhere('
|
||||
status_kurzbz = \'Interessent\' AND
|
||||
status_kurzbz IN (\'Interessent\', \'Bewerber\') AND
|
||||
typ = \'b\' AND
|
||||
bestaetigtam = current_date - 1
|
||||
');
|
||||
@@ -727,33 +730,27 @@ class ReihungstestJob extends JOB_Controller
|
||||
tbl_reihungstest.reihungstest_id,
|
||||
tbl_studienplan.studienplan_id,
|
||||
tbl_reihungstest.studiensemester_kurzbz,
|
||||
tbl_studienordnung.studiengang_kz
|
||||
tbl_studienordnung.studiengang_kz,
|
||||
tbl_studienplan.orgform_kurzbz
|
||||
FROM
|
||||
public.tbl_reihungstest
|
||||
JOIN public.tbl_rt_studienplan ON(tbl_rt_studienplan.reihungstest_id=tbl_reihungstest.reihungstest_id)
|
||||
JOIN lehre.tbl_studienplan USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
JOIN public.tbl_rt_studienplan ON(tbl_rt_studienplan.reihungstest_id=tbl_reihungstest.reihungstest_id)
|
||||
JOIN lehre.tbl_studienplan USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
WHERE
|
||||
NOT EXISTS(
|
||||
SELECT 1 FROM lehre.tbl_studienplan_semester
|
||||
WHERE studienplan_id=tbl_rt_studienplan.studienplan_id
|
||||
AND tbl_studienplan_semester.studiensemester_kurzbz=tbl_reihungstest.studiensemester_kurzbz
|
||||
EXISTS (
|
||||
SELECT studienplan_id
|
||||
FROM lehre.tbl_studienordnung sordnung
|
||||
JOIN lehre.tbl_studienplan USING (studienordnung_id)
|
||||
JOIN lehre.tbl_studienplan_semester USING (studienplan_id)
|
||||
WHERE sordnung.studiengang_kz = tbl_studienordnung.studiengang_kz
|
||||
AND tbl_studienplan_semester.studiensemester_kurzbz = tbl_reihungstest.studiensemester_kurzbz
|
||||
AND tbl_studienplan.studienplan_id NOT IN
|
||||
(
|
||||
SELECT studienplan_id FROM tbl_rt_studienplan WHERE reihungstest_id = tbl_reihungstest.reihungstest_id
|
||||
)
|
||||
)
|
||||
AND tbl_reihungstest.datum >= now()
|
||||
AND NOT EXISTS(
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
public.tbl_rt_studienplan rtstp
|
||||
JOIN lehre.tbl_studienplan stp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung sto USING(studienordnung_id)
|
||||
JOIN lehre.tbl_studienplan_semester stpsem USING(studienplan_id)
|
||||
WHERE
|
||||
sto.studiengang_kz=tbl_studienordnung.studiengang_kz
|
||||
AND rtstp.reihungstest_id=tbl_reihungstest.reihungstest_id
|
||||
AND stpsem.studiensemester_kurzbz=tbl_reihungstest.studiensemester_kurzbz
|
||||
)
|
||||
";
|
||||
AND tbl_reihungstest.datum >= now()";
|
||||
|
||||
$db = new DB_Model();
|
||||
$result_rt = $db->execReadOnlyQuery($qry);
|
||||
@@ -763,7 +760,9 @@ class ReihungstestJob extends JOB_Controller
|
||||
// find an active studyplan for the same degree program with is valid in this semester
|
||||
$result_stpl = $this->StudienplanModel->getStudienplaeneBySemester(
|
||||
$row_rt->studiengang_kz,
|
||||
$row_rt->studiensemester_kurzbz
|
||||
$row_rt->studiensemester_kurzbz,
|
||||
null,
|
||||
$row_rt->orgform_kurzbz
|
||||
);
|
||||
|
||||
if (hasData($result_stpl)) {
|
||||
@@ -826,7 +825,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
AND tbl_studiengang.typ IN ('b', 'm')
|
||||
)
|
||||
SELECT * FROM prst
|
||||
WHERE prestudenstatus_datum >= (SELECT CURRENT_DATE - 1)
|
||||
WHERE prestudenstatus_datum >= (SELECT CURRENT_DATE - ". self::LAST_DAYS_PRESTUDENTSTATUS .")
|
||||
AND (studiengang_typ = 'b' OR (studiengang_typ = 'm' AND EXISTS (SELECT 1 /* Master Studiengänge berücksichtigen wenn auch Bachelor im gleichen Semester */
|
||||
FROM prst prstb
|
||||
WHERE studiengang_typ = 'b'
|
||||
@@ -868,7 +867,8 @@ class ReihungstestJob extends JOB_Controller
|
||||
tbl_person.nachname,
|
||||
tbl_person.vorname,
|
||||
tbl_prestudent.*,
|
||||
tbl_studiengang.typ AS studiengang_typ
|
||||
tbl_studiengang.typ AS studiengang_typ,
|
||||
tbl_prestudentstatus.datum
|
||||
FROM PUBLIC.tbl_person
|
||||
JOIN PUBLIC.tbl_prestudent USING (person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
@@ -901,7 +901,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
$mailArray[$rowNiedrPrios->studiengang_kz][$rowNiedrPrios->orgform_kurzbz]['AufnahmeHoeherePrio'][]
|
||||
= $rowNiedrPrios->nachname.' '.$rowNiedrPrios->vorname.' ('.$rowNiedrPrios->prestudent_id.')';
|
||||
}
|
||||
elseif ($rowNiedrPrios->laststatus == 'Bewerber')
|
||||
elseif ($rowNiedrPrios->laststatus == 'Bewerber' && $row_ps->prestudenstatus_datum > $rowNiedrPrios->datum)
|
||||
{
|
||||
// Abgewiesenen-Status mit Statusgrund "Aufnahme anderer Studiengang" (ID 5) setzen
|
||||
$lastStatus = $this->PrestudentstatusModel->getLastStatus($rowNiedrPrios->prestudent_id);
|
||||
@@ -927,7 +927,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
= $rowNiedrPrios->nachname.' '.$rowNiedrPrios->vorname.' ('.$rowNiedrPrios->prestudent_id.')';
|
||||
}
|
||||
}
|
||||
elseif ($rowNiedrPrios->laststatus == 'Wartender')
|
||||
elseif ($rowNiedrPrios->laststatus == 'Wartender' && $row_ps->prestudenstatus_datum > $rowNiedrPrios->datum)
|
||||
{
|
||||
// Abgewiesenen-Status mit Statusgrund "Aufnahme anderer Studiengang" (ID 5) setzen
|
||||
// Mail zur Info an Assistenz schicken
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \REST_Controller as REST_Controller;
|
||||
|
||||
/**
|
||||
*/
|
||||
class Attachment extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
|
||||
$this->load->library('DmsLib');
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('PermissionLib');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @param integer $dms_id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function show($dms_id)
|
||||
{
|
||||
$result = $this->StudierendenantragModel->loadWhere(['dms_id' => $dms_id]);
|
||||
if (!getData($result))
|
||||
return show_404();
|
||||
|
||||
if (!$this->permissionlib->isBerechtigt('student/antragfreigabe'))
|
||||
{
|
||||
$isSamePerson = false;
|
||||
$antraege = getData($result);
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
foreach ($antraege as $antrag)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->load($antrag->prestudent_id);
|
||||
if(hasData($prestudent))
|
||||
{
|
||||
if(current(getData($prestudent))->person_id == getAuthPersonId())
|
||||
{
|
||||
$isSamePerson = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($isSamePerson == false)
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN); // set the HTTP header as unauthorized
|
||||
|
||||
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
|
||||
// Prints the main error message
|
||||
$this->eprintflib->printError('You are not allowed to access to this content');
|
||||
// Prints the called controller name
|
||||
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
|
||||
// Prints the called controller method name
|
||||
$this->eprintflib->printInfo('Method name: '.$this->router->method);
|
||||
// Prints the required permissions needed to access to this method
|
||||
$this->eprintflib->printInfo('Required permissions: student/antragfreigabe');
|
||||
|
||||
return show_error('You are not entitled to read this document');
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->dmslib->download($dms_id);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
|
||||
$this->outputFile(getData($result));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use \Studierendenantrag_model as Studierendenantrag_model;
|
||||
use \REST_Controller as REST_Controller;
|
||||
|
||||
/**
|
||||
*/
|
||||
class Wiederholung extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'assistenz'=> 'student/studierendenantrag:w'
|
||||
]);
|
||||
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function assistenz($antrag_id)
|
||||
{
|
||||
|
||||
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
|
||||
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
|
||||
if (!hasData($result))
|
||||
return show_404();
|
||||
|
||||
$this->load->view('lehre/Antrag/Wiederholung/Student', [
|
||||
'antrag_id' => $antrag_id,
|
||||
'antrag' => getData($result)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
*/
|
||||
class Studierendenantrag extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
// Load Models
|
||||
$this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
]);
|
||||
|
||||
if (strtolower($this->router->method) === 'leitung')
|
||||
$this->_isAllowed([
|
||||
'leitung' => ['student/studierendenantrag:r', 'student/antragfreigabe:r']
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
$dataAntrag = $this->StudierendenantragModel->loadForPerson(getAuthPersonId());
|
||||
if (isError($dataAntrag))
|
||||
return show_error(getError($dataAntrag));
|
||||
$dataAntrag = (getData($dataAntrag) ? : []);
|
||||
$prestudentenArr = array();
|
||||
|
||||
foreach ($dataAntrag as $antrag)
|
||||
{
|
||||
if (!isset($prestudentenArr[$antrag->prestudent_id]))
|
||||
{
|
||||
$prestudentenArr[$antrag->prestudent_id] = array(
|
||||
'allowedNewTypes' => array(),
|
||||
'antraege'=> array(),
|
||||
'bezeichnungStg' => $antrag->bezeichnung,
|
||||
'bezeichnungOrgform' => $antrag->orgform
|
||||
);
|
||||
|
||||
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Wiederholung';
|
||||
|
||||
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung';
|
||||
|
||||
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Abmeldung';
|
||||
}
|
||||
if ($antrag->studierendenantrag_id == null)
|
||||
continue;
|
||||
if ($antrag->typ == Studierendenantrag_model::TYP_ABMELDUNG_STGL && (!$antrag->isapproved))
|
||||
continue;
|
||||
|
||||
$prestudentenArr[$antrag->prestudent_id]['antraege'][] = $antrag;
|
||||
}
|
||||
|
||||
$this->load->view('lehre/Antrag/Student/List', [
|
||||
'antraege' => $prestudentenArr
|
||||
]);
|
||||
}
|
||||
|
||||
public function leitung()
|
||||
{
|
||||
$stgL = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe') ?: [];
|
||||
|
||||
$stgA = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: [];
|
||||
|
||||
$this->load->view('lehre/Antrag/Leitung/List', [
|
||||
'stgA' => $stgA,
|
||||
'stgL' => $stgL
|
||||
]);
|
||||
}
|
||||
|
||||
public function abmeldung($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Abmeldung'
|
||||
]);
|
||||
}
|
||||
|
||||
public function abmeldungstgl($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'AbmeldungStgl'
|
||||
]);
|
||||
}
|
||||
|
||||
public function unterbrechung($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Unterbrechung'
|
||||
]);
|
||||
}
|
||||
|
||||
public function wiederholung($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Wiederholung'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the caller is allowed to access to this content with the given permissions
|
||||
* If it is not allowed will set the HTTP header with code 401
|
||||
* Wrapper for permissionlib->isEntitled
|
||||
*/
|
||||
private function _isAllowed($requiredPermissions)
|
||||
{
|
||||
// Loads permission lib
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Checks if this user is entitled to access to this content
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
|
||||
|
||||
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
|
||||
// Prints the main error message
|
||||
$this->eprintflib->printError('You are not allowed to access to this content');
|
||||
// Prints the called controller name
|
||||
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
|
||||
// Prints the called controller method name
|
||||
$this->eprintflib->printInfo('Method name: '.$this->router->method);
|
||||
// Prints the required permissions needed to access to this method
|
||||
$this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method));
|
||||
|
||||
exit; // immediately terminate the execution
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an array of permissions to a string that contains them as a comma separated list
|
||||
* Ex: "<permission 1>, <permission 2>, <permission 3>"
|
||||
*/
|
||||
private function _rpsToString($requiredPermissions, $method)
|
||||
{
|
||||
$strRequiredPermissions = ''; // string that contains all the required permissions needed to access to this method
|
||||
|
||||
if (isset($requiredPermissions[$method])) // if the called method is present in the permissions array
|
||||
{
|
||||
// If it is NOT then convert it into an array
|
||||
$rpsMethod = $requiredPermissions[$method];
|
||||
if (!is_array($rpsMethod))
|
||||
{
|
||||
$rpsMethod = array($rpsMethod);
|
||||
}
|
||||
|
||||
// Copy all the permissions into $strRequiredPermissions separated by a comma
|
||||
for ($i = 0; $i < count($rpsMethod); $i++)
|
||||
{
|
||||
$strRequiredPermissions .= $rpsMethod[$i].', ';
|
||||
}
|
||||
|
||||
$strRequiredPermissions = rtrim($strRequiredPermissions, ', ');
|
||||
}
|
||||
|
||||
return $strRequiredPermissions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class AdminAnrechnung extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'lehre/anrechnungszeitfenster:rw',
|
||||
'save' => 'lehre/anrechnungszeitfenster:rw',
|
||||
'edit' => 'lehre/anrechnungszeitfenster:rw',
|
||||
'delete' => 'lehre/anrechnungszeitfenster:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungszeitraum_model', 'AnrechnungszeitraumModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('WidgetLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AnrechnungLib');
|
||||
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'lehre',
|
||||
'anrechnung',
|
||||
'table'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->setControllerId();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Set nearest Studiensemester as default
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
$studiensemester_kurzbz = hasData($result) ? getData($result)[0]->studiensemester_kurzbz : '';
|
||||
|
||||
// Get existing Anrechnungszeitraeume
|
||||
$this->AnrechnungszeitraumModel->addOrder('anrechnungszeitraum_id', 'DESC');
|
||||
$result = $this->AnrechnungszeitraumModel->load();
|
||||
$anrechnungszeitraum_arr = hasData($result) ? getData($result) : array();
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'anrechnungszeitraum_arr' => $anrechnungszeitraum_arr
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/adminAnrechnung.php', $viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new Anrechnungszeitraum.
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$this->_validate($this->input->post());
|
||||
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$anrechnungstart = $this->input->post('anrechnungstart');
|
||||
$anrechnungende = $this->input->post('anrechnungende');
|
||||
|
||||
$result = $this->AnrechnungszeitraumModel->insertAzr($studiensemester_kurzbz, $anrechnungstart, $anrechnungende);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJsonSuccess(array('anrechnungszeitraum_id' => getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Anrechnungszeitraum.
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$this->_validate($this->input->post());
|
||||
|
||||
$anrechnungszeitraum_id = $this->input->post('anrechnungszeitraum_id');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$anrechnungstart = $this->input->post('anrechnungstart');
|
||||
$anrechnungende = $this->input->post('anrechnungende');
|
||||
|
||||
$result = $this->AnrechnungszeitraumModel->updateAzr(
|
||||
$anrechnungszeitraum_id,
|
||||
$studiensemester_kurzbz,
|
||||
$anrechnungstart,
|
||||
$anrechnungende
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJsonSuccess(array('anrechnungszeitraum_id' => getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Anrechnungszeitraum.
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$anrechnungszeitraum_id = $this->input->post('anrechnungszeitraum_id');
|
||||
|
||||
$result = $this->AnrechnungszeitraumModel->deleteAzr($anrechnungszeitraum_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJsonSuccess(array('anrechnungszeitraum_id' => getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates post parameters.
|
||||
*
|
||||
* @param $post
|
||||
*/
|
||||
private function _validate($post)
|
||||
{
|
||||
$studiensemester_kurzbz = $post['studiensemester_kurzbz'];
|
||||
$anrechnungstart = $post['anrechnungstart'];
|
||||
$anrechnungende = $post['anrechnungende'];
|
||||
|
||||
if (isEmptyString($studiensemester_kurzbz)
|
||||
|| isEmptyString($anrechnungstart)
|
||||
|| isEmptyString($anrechnungende))
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorFelderFehlen'));
|
||||
}
|
||||
|
||||
if ($anrechnungstart > $anrechnungende)
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorStartdatumNachEndedatum'));
|
||||
}
|
||||
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$studiensemester = getData($result)[0];
|
||||
|
||||
if ($anrechnungstart < $studiensemester->start || $anrechnungstart > $studiensemester->ende)
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorStartdatumNichtInStudiensemester'));
|
||||
}
|
||||
|
||||
if ($anrechnungende < $studiensemester->start || $anrechnungende > $studiensemester->ende)
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorEndedatumNichtInStudiensemester'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,9 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
//Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -90,7 +93,8 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
$antragData = $this->anrechnunglib->getAntragData(
|
||||
$anrechnungData->prestudent_id,
|
||||
$anrechnungData->studiensemester_kurzbz,
|
||||
$anrechnungData->lehrveranstaltung_id
|
||||
$anrechnungData->lehrveranstaltung_id,
|
||||
$anrechnungData->anrechnung_id
|
||||
);
|
||||
|
||||
// Get Empfehlung data
|
||||
@@ -209,71 +213,64 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
*/
|
||||
public function requestRecommendation()
|
||||
{
|
||||
$data = $this->input->post('data');
|
||||
$anrechnung_id = $this->input->post('anrechnung_id');
|
||||
|
||||
if(isEmptyArray($data))
|
||||
if(isEmptyString($anrechnung_id))
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
$retval = array();
|
||||
$counter = 0;
|
||||
|
||||
// Check if Anrechnungs-LV has lector
|
||||
if (!$this->anrechnunglib->LVhasLector($anrechnung_id))
|
||||
{
|
||||
$this->terminateWithJsonError('LV has no lector');
|
||||
}
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Check if Anrechnungs-LV has lector
|
||||
if (!$this->anrechnunglib->LVhasLector($item['anrechnung_id']))
|
||||
{
|
||||
// Count up LV with no lector
|
||||
$counter++;
|
||||
// Get Fachbereichsleitung or LV Leitung.
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->anrechnunglib->getLeitungOfLvOe($anrechnung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If LV Leitung is not present, gets all LV lectors.
|
||||
$result = $this->anrechnunglib->getLectors($anrechnung_id);
|
||||
}
|
||||
|
||||
// Break, if LV has no lector
|
||||
break;
|
||||
}
|
||||
$empfehlungsanfrage_an = !isEmptyArray($result) ? implode(', ', array_column($result, 'fullname')) : '';
|
||||
|
||||
// Get full name of LV Leitung.
|
||||
// If LV Leitung is not present, get full name of LV lectors.
|
||||
$lector_arr = $this->anrechnunglib->getLectors($item['anrechnung_id']);
|
||||
$empfehlungsanfrage_an = !isEmptyArray($lector_arr)
|
||||
? implode(', ', array_column($lector_arr, 'fullname'))
|
||||
: '';
|
||||
|
||||
// Request Recommendation
|
||||
if($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))
|
||||
{
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR),
|
||||
'empfehlung_anrechnung' => null,
|
||||
'empfehlungsanfrageAm' => (new DateTime())->format('d.m.Y'),
|
||||
'empfehlungsanfrageAn' => $empfehlungsanfrage_an
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mails to lectors
|
||||
* NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector
|
||||
* even if they are required for more recommendations
|
||||
* */
|
||||
if (!isEmptyArray($retval))
|
||||
{
|
||||
self::_sendSanchoMailToLectors($retval);
|
||||
|
||||
// Output json to ajax
|
||||
return $this->outputJsonSuccess($retval);
|
||||
}
|
||||
// Request Recommendation
|
||||
if ($this->anrechnunglib->requestRecommendation($anrechnung_id))
|
||||
{
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $anrechnung_id,
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR),
|
||||
'empfehlung_anrechnung' => null,
|
||||
'empfehlungsanfrageAm' => (new DateTime())->format('d.m.Y'),
|
||||
'empfehlungsanfrageAn' => $empfehlungsanfrage_an
|
||||
);
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter > 0)
|
||||
{
|
||||
return $this->outputJsonError(
|
||||
"Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt."
|
||||
);
|
||||
}
|
||||
if ($empfehlungsanfrage_an == '')
|
||||
{
|
||||
$this->terminateWithJsonError(
|
||||
"Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt."
|
||||
);
|
||||
}
|
||||
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
if (isEmptyArray($retval))
|
||||
{
|
||||
$this->terminateWithJsonError("Empfehlung wurde nicht angefordert");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Output json to ajax
|
||||
return $this->outputJsonSuccess($retval);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -467,39 +464,33 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
|
||||
/**
|
||||
* Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv)
|
||||
* @param $mail_params
|
||||
* @param $anrechnung_id
|
||||
* @return bool
|
||||
*/
|
||||
private function _sendSanchoMailToLectors($mail_params)
|
||||
private function _sendSanchoMailToLectors($anrechnung_id)
|
||||
{
|
||||
// Get Lehrveranstaltungen
|
||||
$anrechnung_arr = array();
|
||||
|
||||
foreach ($mail_params as $item)
|
||||
{
|
||||
$this->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz');
|
||||
$anrechnung_arr[]= array(
|
||||
'lehrveranstaltung_id' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->lehrveranstaltung_id,
|
||||
'studiensemester_kurzbz' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiensemester_kurzbz
|
||||
);
|
||||
}
|
||||
|
||||
$anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR);
|
||||
|
||||
$lehrveranstaltung_id = $this->AnrechnungModel->load($anrechnung_id)->retval[0]->lehrveranstaltung_id;
|
||||
$studiensemester_kurzbz = $this->AnrechnungModel->load($anrechnung_id)->retval[0]->studiensemester_kurzbz;
|
||||
|
||||
/**
|
||||
* Get lectors (prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Get mail receivers.
|
||||
* If config is default (lectors): prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
|
||||
* **/
|
||||
$lector_arr = $this->_getLectors($anrechnung_arr);
|
||||
if ($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$receiver_arr = $this->_getLeitungOfLvOe($lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$receiver_arr = $this->_getLectors($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Send mail to lectors
|
||||
foreach ($lector_arr as $lector)
|
||||
// Send mail
|
||||
foreach ($receiver_arr as $receiver)
|
||||
{
|
||||
$to = $lector->uid;
|
||||
$vorname = $lector->vorname;
|
||||
$to = $receiver->uid. '@'. DOMAIN;;
|
||||
$vorname = $receiver->vorname;
|
||||
|
||||
// Get full name of stgl
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
@@ -537,35 +528,30 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
* @param $anrechnung_arr
|
||||
* @return array
|
||||
*/
|
||||
private function _getLectors($anrechnung_arr)
|
||||
private function _getLectors($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
{
|
||||
$lector_arr = array();
|
||||
|
||||
// Get lectors
|
||||
foreach($anrechnung_arr as $anrechnung)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($anrechnung['studiensemester_kurzbz'], $anrechnung['lehrveranstaltung_id']);
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
|
||||
if (!$result = getData($result))
|
||||
{
|
||||
show_error('Failed retrieving lectors of Lehrveranstaltung');
|
||||
}
|
||||
if (!$result = getData($result))
|
||||
{
|
||||
show_error('Failed retrieving lectors of Lehrveranstaltung');
|
||||
}
|
||||
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
{
|
||||
$lector_arr = array_merge($lector_arr, $result);
|
||||
}
|
||||
}
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
{
|
||||
$lector_arr = array_merge($lector_arr, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: This step is only done to make the array unique by uid, vorname and nachname in the following step
|
||||
@@ -584,6 +570,14 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
|
||||
}
|
||||
|
||||
// Get Leitungen of Lehrveranstaltungs-Organisationseinheit
|
||||
private function _getLeitungOfLvOe($lehrveranstaltung_id)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($lehrveranstaltung_id);
|
||||
|
||||
return hasData($result) ? getData($result) : show_error('Failed retrieving Leitung of Lehrveranstaltungs-Organisationseinheit');
|
||||
}
|
||||
|
||||
private function _saveEmpfehlungsNotiz($anrechnung_id, $empfehlungstext, $notiz_id)
|
||||
{
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
@@ -606,8 +600,5 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
trim($empfehlungstext),
|
||||
$this->_uid
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -78,6 +81,19 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
show_error(getError($studiengang_kz_arr));
|
||||
}
|
||||
|
||||
// Get oes the user is entitled for
|
||||
$oe_kurzbz_arr_schreibberechtigt = array();
|
||||
if ($oe_arr = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN))
|
||||
{
|
||||
foreach($oe_arr as $oe)
|
||||
{
|
||||
$berechtigt = $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid', $oe);
|
||||
|
||||
if ($berechtigt) $oe_kurzbz_arr_schreibberechtigt[]= $oe;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if permission is readonly
|
||||
$hasReadOnlyAccess =
|
||||
$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's')
|
||||
&& !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid');
|
||||
@@ -87,9 +103,11 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz,
|
||||
'studiengaenge_entitled' => $studiengang_kz_arr,
|
||||
'studiengaenge_entitled' => $studiengang_kz_arr, // alle STG mit Lese- und Schreibberechtigung
|
||||
'oes_schreibberechtigt' => $oe_kurzbz_arr_schreibberechtigt, // alle STG nur mit Schreibberechtigung
|
||||
'hasReadOnlyAccess' => $hasReadOnlyAccess,
|
||||
'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess
|
||||
'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess,
|
||||
'configFachbereichsleitung' => $this->config->item('fbl')
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData);
|
||||
@@ -207,14 +225,20 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
// Request Recommendation
|
||||
if($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))
|
||||
{
|
||||
// Get full name of LV Leitung.
|
||||
// If LV Leitung is not present, get full name of LV lectors.
|
||||
$lector_arr = $this->anrechnunglib->getLectors($item['anrechnung_id']);
|
||||
$empfehlungsanfrage_an = !isEmptyArray($lector_arr)
|
||||
? implode(', ', array_column($lector_arr, 'fullname'))
|
||||
: '';
|
||||
// Get full name of Fachbereichsleitung or LV Leitung.
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->anrechnunglib->getLeitungOfLvOe($item['anrechnung_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If LV Leitung is not present, get full name of LV lectors.
|
||||
$result = $this->anrechnunglib->getLectors($item['anrechnung_id']);
|
||||
}
|
||||
|
||||
$retval[]= array(
|
||||
$empfehlungsanfrage_an = !isEmptyArray($result) ? implode(', ', array_column($result, 'fullname')) : '';
|
||||
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR),
|
||||
@@ -225,23 +249,18 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mails to lectors
|
||||
* NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector
|
||||
* even if they are required for more recommendations
|
||||
* */
|
||||
if (!isEmptyArray($retval))
|
||||
{
|
||||
self::_sendSanchoMailToLectors($retval);
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter == 0)
|
||||
if (isEmptyArray($retval))
|
||||
{
|
||||
return $this->outputJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
if ($counter > 0)
|
||||
{
|
||||
$this->terminateWithJsonError('Bei '. $counter.' LV sind keine LektorInnen zugeteilt.');
|
||||
}
|
||||
|
||||
$this->terminateWithJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($retval);
|
||||
$this->outputJsonSuccess($retval);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +335,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
* @param $mail_params
|
||||
* @return bool
|
||||
*/
|
||||
private function _sendSanchoMailToLectors($mail_params)
|
||||
private function _sendSanchoMail($mail_params)
|
||||
{
|
||||
// Get Lehrveranstaltungen
|
||||
$anrechnung_arr = array();
|
||||
@@ -332,18 +351,25 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
$anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR);
|
||||
|
||||
|
||||
/**
|
||||
* Get lectors (prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
|
||||
* **/
|
||||
$lector_arr = $this->_getLectors($anrechnung_arr);
|
||||
/**
|
||||
* Get mail receivers.
|
||||
* If retrieving lectors: prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* This function will receive a unique array to avoid sending more mails to one and the same user.
|
||||
**/
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$receiver_arr = $this->_getLeitungOfLvOe($anrechnung_arr);
|
||||
}
|
||||
else
|
||||
{
|
||||
$receiver_arr = $this->_getLectors($anrechnung_arr);
|
||||
}
|
||||
|
||||
// Send mail to lectors
|
||||
foreach ($lector_arr as $lector)
|
||||
foreach ($receiver_arr as $receiver)
|
||||
{
|
||||
$to = $lector->uid;
|
||||
$vorname = $lector->vorname;
|
||||
$to = $receiver->uid. '@'. DOMAIN;
|
||||
$vorname = $receiver->vorname;
|
||||
|
||||
// Get full name of stgl
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
@@ -427,4 +453,34 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
return $lector_arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Leitungen of Lehrveranstaltungs-Organisationseinheit with unique uids.
|
||||
*
|
||||
* @param $anrechnung_arr
|
||||
* @return array
|
||||
*/
|
||||
private function _getLeitungOfLvOe($anrechnung_arr)
|
||||
{
|
||||
$oeLeitung_arr = array();
|
||||
|
||||
// Get Leitungen
|
||||
foreach($anrechnung_arr as $anrechnung)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($anrechnung['lehrveranstaltung_id']);
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
show_error('No Leitung found');
|
||||
}
|
||||
|
||||
$oeLeitung_arr = array_merge($oeLeitung_arr, getData($result));
|
||||
}
|
||||
|
||||
// Make array unique
|
||||
$oeLeitung_arr = array_unique($oeLeitung_arr, SORT_REGULAR);
|
||||
|
||||
return $oeLeitung_arr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,11 +80,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$prestudent_id = getData($result)[0]->prestudent_id;
|
||||
|
||||
// Check if application deadline is expired
|
||||
$is_expired = self::_isExpired(
|
||||
$this->config->item('submit_application_start'),
|
||||
$this->config->item('submit_application_end'),
|
||||
$studiensemester_kurzbz
|
||||
);
|
||||
$is_expired = $this->_isExpired($studiensemester_kurzbz);
|
||||
|
||||
// Check if Lehrveranstaltung was already graded with application blocking grades
|
||||
$is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
@@ -93,7 +89,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id);
|
||||
|
||||
// Get Antrag data
|
||||
$antragData = $this->anrechnunglib->getAntragData($prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
$antragData = $this->anrechnunglib->getAntragData($prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id, $anrechnungData->anrechnung_id);
|
||||
|
||||
$viewData = array(
|
||||
'antragData' => $antragData,
|
||||
@@ -115,6 +111,8 @@ class requestAnrechnung extends Auth_Controller
|
||||
$lehrveranstaltung_id = $this->input->post('lv_id');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester');
|
||||
$bestaetigung = $this->input->post('bestaetigung');
|
||||
$begruendung_ects = $this->input->post('begruendung_ects');
|
||||
$begruendung_lvinhalt = $this->input->post('begruendung_lvinhalt');
|
||||
|
||||
// Validate data
|
||||
if (empty($_FILES['uploadfile']['name']))
|
||||
@@ -125,7 +123,9 @@ class requestAnrechnung extends Auth_Controller
|
||||
if (isEmptyString($begruendung_id) ||
|
||||
isEmptyString($anmerkung) ||
|
||||
isEmptyString($lehrveranstaltung_id) ||
|
||||
isEmptyString($studiensemester_kurzbz))
|
||||
isEmptyString($studiensemester_kurzbz) ||
|
||||
isEmptyString($begruendung_ects) ||
|
||||
isEmptyString($begruendung_lvinhalt))
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen'));
|
||||
}
|
||||
@@ -152,10 +152,10 @@ class requestAnrechnung extends Auth_Controller
|
||||
return $this->outputJsonError($this->p->t('anrechnung', 'antragBereitsGestellt'));
|
||||
}
|
||||
|
||||
// Exit if application is not for actual studysemester
|
||||
if (!self::_applicationIsForActualSS($studiensemester_kurzbz))
|
||||
// Exit if application is a past ( < actual ) studysemester
|
||||
if (self::_applicationIsPastSS($studiensemester_kurzbz))
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('anrechnung', 'antragNurImAktSS'));
|
||||
return $this->outputJsonError($this->p->t('anrechnung', 'antragNichtFuerVerganganeSS'));
|
||||
}
|
||||
|
||||
// Upload document
|
||||
@@ -176,7 +176,9 @@ class requestAnrechnung extends Auth_Controller
|
||||
$lehrveranstaltung_id,
|
||||
$begruendung_id,
|
||||
$lastInsert_dms_id,
|
||||
$anmerkung
|
||||
$anmerkung,
|
||||
$begruendung_ects,
|
||||
$begruendung_lvinhalt
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
@@ -234,32 +236,30 @@ class requestAnrechnung extends Auth_Controller
|
||||
* @return bool True if deadline is expired
|
||||
* @throws Exception
|
||||
*/
|
||||
private function _isExpired($start, $ende, $studiensemester_kurzbz)
|
||||
private function _isExpired($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$today = new DateTime('today midnight');
|
||||
|
||||
// If start is not given, set to Semesterstart.
|
||||
if (!isset($start) || isEmptyString($start))
|
||||
{
|
||||
$this->StudiensemesterModel->addSelect('start');
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$start = getData($result)[0]->start;
|
||||
}
|
||||
// Load all Anrechnungszeitfenster for this Studiensemester
|
||||
$this->load->model('education/Anrechnungszeitraum_model', 'AnrechnungszeitraumModel');
|
||||
$result = $this->AnrechnungszeitraumModel->loadWhere(array('studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
|
||||
// If ende is not given, set to Semesterende.
|
||||
if (!isset($ende) || isEmptyString($ende))
|
||||
{
|
||||
$this->StudiensemesterModel->addSelect('ende');
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$ende = getData($result)[0]->ende;
|
||||
}
|
||||
if (hasData($result))
|
||||
{
|
||||
// Loop through Anrechnungszeitfenster
|
||||
foreach (getData($result) as $azrObj)
|
||||
{
|
||||
$start = new DateTime($azrObj->anrechnungstart);
|
||||
$ende = new DateTime($azrObj->anrechnungende);
|
||||
|
||||
$today = new DateTime('today midnight');
|
||||
$start = new DateTime($start);
|
||||
$ende = new DateTime($ende);
|
||||
// Return false if today is at least within one Anrechnungszeitraum
|
||||
if (($today >= $start && $today <= $ende)) return false;
|
||||
|
||||
// True if expired
|
||||
return ($today < $start || $today > $ende);
|
||||
}
|
||||
}
|
||||
|
||||
// Return true if today is in none Anrechnungszeitraum
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,18 +312,21 @@ class requestAnrechnung extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if applications' study semester is actual study semester.
|
||||
* Check if applications' study semester is < actual study semester.
|
||||
*
|
||||
* @param $studiensemester_kurzbz
|
||||
* @return bool
|
||||
*/
|
||||
private function _applicationIsForActualSS($studiensemester_kurzbz)
|
||||
private function _applicationIsPastSS($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
$actual_ss = getData($result)[0]->studiensemester_kurzbz;
|
||||
$actual_ss = getData($result)[0];
|
||||
|
||||
return $studiensemester_kurzbz == $actual_ss;
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$anrechnung_ss = getData($result)[0];
|
||||
|
||||
return $anrechnung_ss->ende < $actual_ss->start;
|
||||
}
|
||||
|
||||
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
|
||||
@@ -28,6 +28,9 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -84,16 +87,21 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
$antragData = $this->anrechnunglib->getAntragData(
|
||||
$anrechnungData->prestudent_id,
|
||||
$anrechnungData->studiensemester_kurzbz,
|
||||
$anrechnungData->lehrveranstaltung_id
|
||||
$anrechnungData->lehrveranstaltung_id,
|
||||
$anrechnungData->anrechnung_id
|
||||
);
|
||||
|
||||
// Get Empfehlung data
|
||||
$empfehlungData = $this->anrechnunglib->getEmpfehlungData($anrechnung_id);
|
||||
|
||||
// False if LV-Leitung is present and user is not LV-Leitung. Otherwise always true.
|
||||
$isEmpfehlungsberechtigt = $this->anrechnunglib->isEmpfehlungsberechtigt($anrechnung_id);
|
||||
|
||||
$viewData = array(
|
||||
'antragData' => $antragData,
|
||||
'anrechnungData' => $anrechnungData,
|
||||
'empfehlungData' => $empfehlungData
|
||||
'empfehlungData' => $empfehlungData,
|
||||
'isEmpfehlungsberechtigt' => $isEmpfehlungsberechtigt
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/reviewAnrechnungDetail.php', $viewData);
|
||||
@@ -140,10 +148,13 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
* Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
* NOTE: mails are sent at the end to ensure sending only one mail to each STGL
|
||||
* */
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -191,10 +202,13 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
// Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -253,8 +267,14 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($result->lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
@@ -282,14 +302,20 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($result->lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
$entitled_lector_arr = array_column($result, 'uid');
|
||||
$entitled_uid_arr = array_column($result, 'uid');
|
||||
|
||||
if (in_array($this->_uid, $entitled_lector_arr))
|
||||
if (in_array($this->_uid, $entitled_uid_arr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -72,7 +75,8 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz
|
||||
'studiensemester_selected' => $studiensemester_kurzbz,
|
||||
'configFachbereichsleitung' => $this->config->item('fbl')
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/reviewAnrechnungUebersicht.php', $viewData);
|
||||
@@ -111,16 +115,19 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
* Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
* NOTE: mails are sent at the end to ensure sending only one mail to each STGL
|
||||
* */
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,10 +161,13 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
// Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -217,14 +227,20 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
if ($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($result->lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
$entitled_lector_arr = array_column($result, 'uid');
|
||||
$entitled_uid_arr = array_column($result, 'uid');
|
||||
|
||||
if (in_array($this->_uid, $entitled_lector_arr))
|
||||
if (in_array($this->_uid, $entitled_uid_arr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ class InfoCenter extends Auth_Controller
|
||||
const FREIGEGEBEN_PAGE = 'freigegeben';
|
||||
const REIHUNGSTESTABSOLVIERT_PAGE = 'reihungstestAbsolviert';
|
||||
const ABGEWIESEN_PAGE = 'abgewiesen';
|
||||
const AUFGENOMMEN_PAGE = 'aufgenommen';
|
||||
const SHOW_DETAILS_PAGE = 'showDetails';
|
||||
const SHOW_ZGV_DETAILS_PAGE = 'showZGVDetails';
|
||||
const ZGV_UBERPRUEFUNG_PAGE = 'ZGVUeberpruefung';
|
||||
@@ -115,6 +116,7 @@ class InfoCenter extends Auth_Controller
|
||||
'index' => 'infocenter:r',
|
||||
'freigegeben' => 'infocenter:r',
|
||||
'abgewiesen' => 'infocenter:r',
|
||||
'aufgenommen' => 'infocenter:r',
|
||||
'reihungstestAbsolviert' => 'infocenter:r',
|
||||
'showDetails' => 'infocenter:r',
|
||||
'showZGVDetails' => 'lehre/zgvpruefung:r',
|
||||
@@ -142,12 +144,6 @@ class InfoCenter extends Auth_Controller
|
||||
'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'reloadLogs' => 'infocenter:r',
|
||||
'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'getPostponeDate' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'park' => 'infocenter:rw',
|
||||
'unpark' => 'infocenter:rw',
|
||||
'setOnHold' => 'infocenter:rw',
|
||||
'removeOnHold' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
|
||||
'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'setNavigationMenuArrayJson' => 'infocenter:r',
|
||||
'getAbsageData' => 'infocenter:r',
|
||||
'saveAbsageForAll' => 'infocenter:rw',
|
||||
@@ -164,6 +160,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->model('crm/Statusgrund_model', 'StatusgrundModel');
|
||||
$this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel');
|
||||
$this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel');
|
||||
$this->load->model('crm/Rueckstellung_model', 'RueckstellungModel');
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('system/Message_model', 'MessageModel');
|
||||
@@ -233,6 +230,16 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$this->load->view('system/infocenter/infocenterAbgewiesen.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Aufgenommene page of the InfoCenter tool
|
||||
*/
|
||||
public function aufgenommen()
|
||||
{
|
||||
$this->_setNavigationMenu(self::AUFGENOMMEN_PAGE); // define the navigation menu for this page
|
||||
|
||||
$this->load->view('system/infocenter/infocenterAufgenommen.php');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -319,7 +326,7 @@ class InfoCenter extends Auth_Controller
|
||||
show_error('Person does not exist!');
|
||||
|
||||
$origin_page = $this->input->get(self::ORIGIN_PAGE);
|
||||
if ($origin_page == self::INDEX_PAGE)
|
||||
if (in_array($origin_page, array(self::INDEX_PAGE, self::ABGEWIESEN_PAGE)))
|
||||
{
|
||||
// mark person as locked for editing
|
||||
$result = $this->PersonLockModel->lockPerson($person_id, $this->_uid, self::APP);
|
||||
@@ -364,7 +371,14 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($result)) show_error(getError($result));
|
||||
|
||||
$redirectLink = '/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId();
|
||||
$origin_page = $this->input->get(self::ORIGIN_PAGE);
|
||||
|
||||
if ($origin_page === self::ABGEWIESEN_PAGE)
|
||||
$redirectLink = self::INFOCENTER_URI. '/' .self::ABGEWIESEN_PAGE;
|
||||
else
|
||||
$redirectLink = '/'.self::INFOCENTER_URI;
|
||||
|
||||
$redirectLink .= '?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId();
|
||||
|
||||
// Force reload of Dataset after Unlock
|
||||
$redirectLink .= '&'.self::KEEP_TABLESORTER_FILTER.'=true';
|
||||
@@ -606,7 +620,7 @@ class InfoCenter extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang
|
||||
* Sendet bei einer neuen ZGV Prüfung eine Mail an den Studiengang
|
||||
*/
|
||||
private function sendZgvMail($mail, $typ, $person){
|
||||
$data = array(
|
||||
@@ -697,7 +711,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
/**
|
||||
* Fügt einen neuen ZGV Status hinzu oder updated einen bestehenden
|
||||
* Falls es erfolgreich war, sendet er die Mail raus
|
||||
* Falls es erfolgreich war, wird eine Mail rausgeschickt
|
||||
*/
|
||||
public function zgvRueckfragen()
|
||||
{
|
||||
@@ -751,7 +765,8 @@ class InfoCenter extends Auth_Controller
|
||||
$this->sendZgvMail($mail, $typ, $person);
|
||||
elseif (isError($insert))
|
||||
$this->terminateWithJsonError('Fehler beim Speichern');
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
$insert = $this->ZGVPruefungModel->insert(
|
||||
array(
|
||||
@@ -781,7 +796,7 @@ class InfoCenter extends Auth_Controller
|
||||
}
|
||||
|
||||
$hold = false;
|
||||
if ($this->personloglib->getOnHoldDate($person_id) !== null)
|
||||
if (hasData($this->RueckstellungModel->getByPersonId($person_id, 'onhold_zgv')))
|
||||
$hold = true;
|
||||
|
||||
$this->outputJsonSuccess(
|
||||
@@ -1162,107 +1177,7 @@ class InfoCenter extends Auth_Controller
|
||||
->set_output($aktecontent->retval)
|
||||
->_display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the date until which a person is parked
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getPostponeDate($person_id)
|
||||
{
|
||||
$result = array(
|
||||
'type' => null,
|
||||
'date' => null
|
||||
);
|
||||
|
||||
$parkedDate = $this->personloglib->getParkedDate($person_id);
|
||||
|
||||
if (isset($parkedDate))
|
||||
{
|
||||
$result['type'] = 'parked';
|
||||
$result['date'] = $parkedDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$onholdDate = $this->personloglib->getOnHoldDate($person_id);
|
||||
|
||||
if (isset($onholdDate))
|
||||
{
|
||||
$result['type'] = 'onhold';
|
||||
$result['date'] = $onholdDate;
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes parking of a person, i.e. a person is not expected to do any actions while parked
|
||||
*/
|
||||
public function park()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('parkdate');
|
||||
|
||||
$result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes parking of a person
|
||||
*/
|
||||
public function unPark()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->personloglib->unPark($person_id);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a person on hold ("zurückstellen")
|
||||
*/
|
||||
public function setOnHold()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('onholddate');
|
||||
|
||||
$result = $this->personloglib->setOnHold($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removed on hold status of a person
|
||||
*/
|
||||
public function removeOnHold()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->personloglib->removeOnHold($person_id);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the End date of the current Studienjahr
|
||||
*/
|
||||
public function getStudienjahrEnd()
|
||||
{
|
||||
$this->load->model('organisation/studienjahr_model', 'StudienjahrModel');
|
||||
|
||||
$result = $this->StudienjahrModel->getCurrStudienjahr();
|
||||
|
||||
$json = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$json = $result->retval[0]->ende;
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(array($json));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper for setNavigationMenu, returns JSON message
|
||||
@@ -1484,7 +1399,6 @@ class InfoCenter extends Auth_Controller
|
||||
if($nachreichungAm < $today)
|
||||
$this->terminateWithJsonError($this->p->t('infocenter', 'nachreichDatumNichtVergangenheit'));
|
||||
|
||||
|
||||
$akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ]));
|
||||
|
||||
if (hasData($akte)) {
|
||||
@@ -1631,6 +1545,7 @@ class InfoCenter extends Auth_Controller
|
||||
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
|
||||
$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);
|
||||
|
||||
$currentFilterId = $this->input->get(self::FILTER_ID);
|
||||
if (isset($currentFilterId))
|
||||
@@ -1638,6 +1553,7 @@ class InfoCenter extends Auth_Controller
|
||||
$freigegebenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
|
||||
$reihungstestAbsolviertLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
|
||||
$abgewiesenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
|
||||
$aufgenommenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
|
||||
}
|
||||
|
||||
$this->navigationlib->setSessionMenu(
|
||||
@@ -1688,7 +1604,19 @@ class InfoCenter extends Auth_Controller
|
||||
null, // subscriptLinkValue
|
||||
'', // target
|
||||
30 // sort
|
||||
)
|
||||
),
|
||||
'aufgenommen' => $this->navigationlib->oneLevel(
|
||||
'Aufgenommene', // description
|
||||
$aufgenommenLink, // link
|
||||
null, // children
|
||||
'check', // icon
|
||||
null, // subscriptDescription
|
||||
false, // expand
|
||||
null, // subscriptLinkClass
|
||||
null, // subscriptLinkValue
|
||||
'', // target
|
||||
40 // sort
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -1716,6 +1644,9 @@ class InfoCenter extends Auth_Controller
|
||||
if ($origin_page === self::ABGEWIESEN_PAGE)
|
||||
$link = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
|
||||
|
||||
if ($origin_page === self::AUFGENOMMEN_PAGE)
|
||||
$link = site_url(self::INFOCENTER_URI.'/'.self::AUFGENOMMEN_PAGE);
|
||||
|
||||
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
|
||||
if (isset($prevFilterId))
|
||||
{
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Rueckstellung extends Auth_Controller
|
||||
{
|
||||
private $_ci; // Code igniter instance
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'get' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'set' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'delete' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'getStatus' => array('infocenter:rw', 'lehre/zgvpruefung:rw')
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->model('crm/Rueckstellung_model', 'RueckstellungModel');
|
||||
$this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->library('PersonLogLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
}
|
||||
|
||||
public function get($person_id)
|
||||
{
|
||||
$result = null;
|
||||
$rueckstellung = $this->_ci->RueckstellungModel->getByPersonId($person_id);
|
||||
|
||||
if (isError($rueckstellung))
|
||||
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimLesen'));
|
||||
|
||||
if (hasData($rueckstellung))
|
||||
{
|
||||
$rueckstellung = getData($rueckstellung)[0];
|
||||
$fullName = getData($this->_ci->PersonModel->getFullName($rueckstellung->insertvon));
|
||||
|
||||
$result = array(
|
||||
'von' => $fullName,
|
||||
'bezeichnung' => $rueckstellung->bezeichnung,
|
||||
'bis' => $rueckstellung->datum_bis,
|
||||
'status_kurzbz' => $rueckstellung->status_kurzbz
|
||||
);
|
||||
|
||||
if ($rueckstellung->status_kurzbz === 'parked' && $rueckstellung->datum_bis < date('Y-m-d'))
|
||||
{
|
||||
$this->_ci->RueckstellungModel->delete(array('person_id' => $person_id, 'status_kurzbz' => 'parked'));
|
||||
$result = null;
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($result);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$datum_bis = $this->input->post('datum_bis');
|
||||
$status_kurzbz = $this->input->post('status_kurzbz');
|
||||
|
||||
$result = $this->_ci->RueckstellungModel->insert(
|
||||
array('person_id' => $person_id,
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'datum_bis' => date_format(date_create($datum_bis), 'Y-m-d'),
|
||||
'insertvon' => $this->_uid
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
|
||||
$this->_log($person_id, $status_kurzbz);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$status = $this->input->post('status');
|
||||
|
||||
$result = $this->_ci->RueckstellungModel->delete(array('person_id' => $person_id, 'status_kurzbz' => $status));
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimSpeichern'));
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getStatus($aktiv = true)
|
||||
{
|
||||
$this->_ci->RueckstellungStatusModel->addOrder('sort');
|
||||
$result = $this->_ci->RueckstellungStatusModel->loadWhere(array('aktiv' => $aktiv));
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimLesen'));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
|
||||
private function _log($person_id, $status_kurzbz)
|
||||
{
|
||||
$message = "Person $person_id set to $status_kurzbz";
|
||||
|
||||
$this->_ci->personloglib->log(
|
||||
$person_id,
|
||||
'Action',
|
||||
array(
|
||||
'name' => 'Person status set',
|
||||
'message' => $message,
|
||||
'success' => true
|
||||
),
|
||||
'bewerbung',
|
||||
'infocenter',
|
||||
null,
|
||||
$this->_uid
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ class Issues extends Auth_Controller
|
||||
// Load models
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
@@ -45,10 +46,11 @@ class Issues extends Auth_Controller
|
||||
public function index()
|
||||
{
|
||||
$oes_for_issues = $this->_getOesForIssues();
|
||||
$language_index = $this->_getLanguageIndex();
|
||||
|
||||
$this->load->view(
|
||||
'system/issues/issues',
|
||||
$oes_for_issues
|
||||
array_merge($oes_for_issues, array('language_index' => $language_index))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -166,4 +168,28 @@ class Issues extends Auth_Controller
|
||||
'all_oe_kurzbz_berechtigt' => $all_oe_kurzbz_berechtigt
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets language index of currently logged in user.
|
||||
* @return object int (the index, start at 1)
|
||||
*/
|
||||
private function _getLanguageIndex()
|
||||
{
|
||||
$idx = 1;
|
||||
$this->SpracheModel->addSelect('sprache, index');
|
||||
$langRes = $this->SpracheModel->load();
|
||||
|
||||
if (hasData($langRes))
|
||||
{
|
||||
$userLang = getUserLanguage();
|
||||
$lang = getData($langRes);
|
||||
|
||||
foreach ($lang as $l)
|
||||
{
|
||||
if ($l->sprache == $userLang) $idx = $l->index;
|
||||
}
|
||||
}
|
||||
|
||||
return $idx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class IssuesKonfiguration extends Auth_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
const STRING_DATA_TYPE = 'string';
|
||||
const INTEGER_DATA_TYPE = 'integer';
|
||||
const FLOAT_DATA_TYPE = 'float';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'admin:r',
|
||||
'getApps' => 'admin:r',
|
||||
'getFehlerKonfigurationByApp' => 'admin:r',
|
||||
'saveFehlerKonfiguration' => 'admin:rw',
|
||||
'deleteKonfiguration' => 'admin:rw',
|
||||
'deleteKonfigurationsWerte' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('IssuesLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Fehlerkonfigurationstyp_model', 'FehlerkonfigurationstypModel');
|
||||
$this->load->model('system/Fehlerkonfiguration_model', 'FehlerkonfigurationModel');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'filter',
|
||||
'fehlermonitoring'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Load initial view.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view("system/issues/issuesKonfiguration.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all Apps to which Fehler exist.
|
||||
*/
|
||||
public function getApps()
|
||||
{
|
||||
$this->FehlerModel->addDistinct();
|
||||
$this->FehlerModel->addSelect('app');
|
||||
$this->FehlerModel->addJoin('system.tbl_fehler_konfigurationstyp', 'app');
|
||||
$this->FehlerModel->addOrder('app');
|
||||
|
||||
$appRes = $this->FehlerModel->load();
|
||||
|
||||
$this->outputJson($appRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehlercodes, optionally by app.
|
||||
*/
|
||||
public function getFehlerKonfigurationByApp()
|
||||
{
|
||||
$app = $this->input->get('app');
|
||||
|
||||
// get all Konfiguration types, optionally filtered by app
|
||||
$this->FehlerkonfigurationstypModel->addSelect('konfigurationstyp_kurzbz, konfigurationsdatentyp, beschreibung');
|
||||
$this->FehlerkonfigurationstypModel->addOrder('konfigurationstyp_kurzbz');
|
||||
$konfRes = isEmptyString($app)
|
||||
? $this->FehlerkonfigurationstypModel->load()
|
||||
: $this->FehlerkonfigurationstypModel->loadWhere(array('app' => $app));
|
||||
|
||||
if (isError($konfRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerKonfigurationLaden'));
|
||||
|
||||
// get all Fehler, optionally filtered by app
|
||||
$params = array('fehlercode_extern' => null);
|
||||
$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertyp_kurzbz, fehlertext');
|
||||
$this->FehlerModel->addOrder('fehlercode');
|
||||
if (!isEmptyString($app)) $params['app'] = $app;
|
||||
$fehlerRes = $this->FehlerModel->loadWhere($params);
|
||||
|
||||
if (isError($fehlerRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerLaden'));
|
||||
|
||||
// return object with retrieved data
|
||||
$konfObj = new StdClass();
|
||||
$konfObj->konfigurationstypen = array();
|
||||
$konfObj->fehler = array();
|
||||
|
||||
if (hasData($konfRes)) $konfObj->konfigurationstypen = getData($konfRes);
|
||||
if (hasData($fehlerRes)) $konfObj->fehler = getData($fehlerRes);
|
||||
|
||||
$this->outputJsonSuccess($konfObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a Fehler configuration, inserts new configuration or updates existing.
|
||||
* Checks if datatype of passed configuration is correct.
|
||||
*/
|
||||
public function saveFehlerKonfiguration()
|
||||
{
|
||||
$result = null;
|
||||
$konfigurationstyp_kurzbz = $this->input->post('konfigurationstyp_kurzbz');
|
||||
$fehlercode = $this->input->post('fehlercode');
|
||||
$konfigurationsWert = $this->input->post('konfigurationsWert');
|
||||
|
||||
// check if all params passed
|
||||
if (isEmptyString($konfigurationstyp_kurzbz)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationstyp'));
|
||||
|
||||
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlercodeFehlt'));
|
||||
|
||||
// separate by semicolon if multiple values passed
|
||||
$konfigurationsWert = explode(';', $konfigurationsWert);
|
||||
|
||||
// check konfigurationswert
|
||||
|
||||
// get the expected data type
|
||||
$dataType = self::STRING_DATA_TYPE;
|
||||
$this->FehlerkonfigurationstypModel->addSelect('konfigurationsdatentyp');
|
||||
$konfigtypRes = $this->FehlerkonfigurationstypModel->loadWhere(array('konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz));
|
||||
|
||||
if (hasData($konfigtypRes))
|
||||
{
|
||||
$konfigurationsdatentyp = getData($konfigtypRes)[0]->konfigurationsdatentyp;
|
||||
foreach ($konfigurationsWert as $idx => $konfWert)
|
||||
{
|
||||
// check if data type correct
|
||||
$valid = false;
|
||||
switch ($konfigurationsdatentyp)
|
||||
{
|
||||
case self::INTEGER_DATA_TYPE:
|
||||
$valid = (string)(int)$konfWert == $konfWert;
|
||||
$konfigurationsWert[$idx] = (int) $konfWert;
|
||||
break;
|
||||
case self::FLOAT_DATA_TYPE:
|
||||
$valid = (string)(float)$konfWert == $konfWert;
|
||||
$konfigurationsWert[$idx] = (float) $konfWert;
|
||||
break;
|
||||
default:
|
||||
$valid = is_string($konfWert) && preg_match('/^[A-Za-z0-9_]+$/', $konfWert);
|
||||
}
|
||||
if (!$valid) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationswert', array($konfigurationsdatentyp)));
|
||||
}
|
||||
}
|
||||
|
||||
// check if konfiguration already set for the fehlercode
|
||||
$this->FehlerkonfigurationModel->addSelect('konfiguration');
|
||||
$fehlerkonfigurationRes = $this->FehlerkonfigurationModel->loadWhere(
|
||||
array(
|
||||
'konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz,
|
||||
'fehlercode' => $fehlercode
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($fehlerkonfigurationRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerKonfigurationLaden'));
|
||||
|
||||
// if konfiguration exists, update by add konfiguration values to existing
|
||||
if (hasData($fehlerkonfigurationRes))
|
||||
{
|
||||
$fehlerkonfiguration = getData($fehlerkonfigurationRes);
|
||||
|
||||
$existingKonf = json_decode($fehlerkonfiguration[0]->konfiguration);
|
||||
|
||||
if (!$existingKonf) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerJsonDekodierung'));
|
||||
|
||||
if (!is_array($existingKonf)) $existingKonf = array($existingKonf);
|
||||
|
||||
$newKonf = json_encode(array_values(array_unique(array_merge($existingKonf, $konfigurationsWert))));
|
||||
if (!$newKonf) $this->terminateWithJsonError("error when encoding JSON");
|
||||
|
||||
$result = $this->FehlerkonfigurationModel->update(
|
||||
array('konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz, 'fehlercode' => $fehlercode),
|
||||
array('konfiguration' => $newKonf, 'updateamum' => 'NOW()', 'updatevon' => $this->_uid)
|
||||
);
|
||||
}
|
||||
else // if no konfiguration exists, add new konfiguration entry
|
||||
{
|
||||
$newKonf = json_encode($konfigurationsWert);
|
||||
if (!$newKonf) $this->terminateWithJsonError("error when encoding JSON");
|
||||
|
||||
$result = $this->FehlerkonfigurationModel->insert(
|
||||
array(
|
||||
'konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz,
|
||||
'fehlercode' => $fehlercode,
|
||||
'konfiguration' => $newKonf,
|
||||
'insertvon' => $this->_uid
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// output result (insert or update)
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes values of a Konfiguration.
|
||||
*/
|
||||
public function deleteKonfigurationsWerte()
|
||||
{
|
||||
$konfigurationstyp_kurzbz = $this->input->post('konfigurationstyp_kurzbz');
|
||||
$fehlercode = $this->input->post('fehlercode');
|
||||
$konfigurationsWert = $this->input->post('konfigurationsWert');
|
||||
|
||||
// check if Konfigurationstyp correctly passed
|
||||
if (isEmptyString($konfigurationstyp_kurzbz)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationstyp'));
|
||||
|
||||
// check if fehlercode correctly passed
|
||||
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlercodeFehlt'));
|
||||
|
||||
// separate by semicolon if multiple values passed
|
||||
$konfigurationsWert = explode(';', $konfigurationsWert);
|
||||
|
||||
// check if konfiguration already set for the fehlercode
|
||||
$this->FehlerkonfigurationModel->addSelect('konfiguration');
|
||||
$fehlerkonfigurationRes = $this->FehlerkonfigurationModel->loadWhere(
|
||||
array(
|
||||
'konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz,
|
||||
'fehlercode' => $fehlercode
|
||||
)
|
||||
);
|
||||
|
||||
if (!hasData($fehlerkonfigurationRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerKonfigurationLaden'));
|
||||
|
||||
// if konfiguration exists, update values
|
||||
if (hasData($fehlerkonfigurationRes))
|
||||
{
|
||||
$fehlerkonfiguration = getData($fehlerkonfigurationRes);
|
||||
|
||||
$existingKonf = json_decode($fehlerkonfiguration[0]->konfiguration);
|
||||
|
||||
if (!$existingKonf) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerJsonDekodierung'));
|
||||
|
||||
if (!is_array($existingKonf)) $existingKonf = array($existingKonf);
|
||||
|
||||
$newKonfArr = array_values(array_diff($existingKonf, $konfigurationsWert));
|
||||
|
||||
// if no konfiguration values left, delete whole entry
|
||||
if (isEmptyArray($newKonfArr))
|
||||
{
|
||||
$this->outputJson(
|
||||
$this->FehlerkonfigurationModel->delete(
|
||||
array('konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz, 'fehlercode' => $fehlercode)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$newKonf = json_encode($newKonfArr);
|
||||
if (!$newKonf) $this->terminateWithJsonError("error when encoding JSON");
|
||||
|
||||
// if there are still values, delete only part of the konfiguration
|
||||
$this->outputJson(
|
||||
$this->FehlerkonfigurationModel->update(
|
||||
array('konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz, 'fehlercode' => $fehlercode),
|
||||
array('konfiguration' => $newKonf, 'updateamum' => 'NOW()', 'updatevon' => $this->_uid)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Konfiguration.
|
||||
*/
|
||||
public function deleteKonfiguration()
|
||||
{
|
||||
$konfigurationstyp_kurzbz = $this->input->post('konfigurationstyp_kurzbz');
|
||||
$fehlercode = $this->input->post('fehlercode');
|
||||
|
||||
// check if Konfigurationstyp correctly passed
|
||||
if (isEmptyString($konfigurationstyp_kurzbz)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationstyp'));
|
||||
|
||||
// check if fehlercode correctly passed
|
||||
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlercodeFehlt'));
|
||||
|
||||
$this->outputJson(
|
||||
$this->FehlerkonfigurationModel->delete(
|
||||
array('konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz, 'fehlercode' => $fehlercode)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@ class IssuesZustaendigkeiten extends Auth_Controller
|
||||
// Load models
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('system/Fehlerzustaendigkeiten_model', 'FehlerzustaendigkeitenModel');
|
||||
|
||||
$this->loadPhrases(
|
||||
@@ -70,7 +69,7 @@ class IssuesZustaendigkeiten extends Auth_Controller
|
||||
{
|
||||
$app = $this->input->get('app');
|
||||
|
||||
//$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertext, fehlertyp_kurzbz');
|
||||
$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertext, fehlertyp_kurzbz, app');
|
||||
$this->FehlerModel->addOrder('fehlercode');
|
||||
|
||||
$fehlerRes = isset($app) ? $this->FehlerModel->loadWhere(array('app' => $app)) : $this->FehlerModel->load();
|
||||
|
||||
@@ -4,6 +4,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Plausichecks extends Auth_Controller
|
||||
{
|
||||
const GENERIC_ISSUE_OCCURED_TEXT = 'Issue aufgetreten';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
@@ -14,7 +16,8 @@ class Plausichecks extends Auth_Controller
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('issues/PlausicheckProducerLib');
|
||||
$this->load->library('issues/PlausicheckProducerLib', array('app' => 'core'));
|
||||
$this->load->library('issues/PlausicheckDefinitionLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load models
|
||||
@@ -42,18 +45,43 @@ class Plausichecks extends Auth_Controller
|
||||
$fehler_kurzbz = $this->input->get('fehler_kurzbz');
|
||||
|
||||
// issues array for passing issue texts
|
||||
$issueTexts = array();
|
||||
$allIssues = array();
|
||||
// all fehler kurzbz which are going to be checked
|
||||
$fehlerKurzbz = !isEmptyString($fehler_kurzbz) ? array($fehler_kurzbz) : $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
$fehlerKurzbz = !isEmptyString($fehler_kurzbz) ? array($fehler_kurzbz) : $this->plausicheckdefinitionlib->getFehlerKurzbz();
|
||||
$fehlerLibMappings = $this->plausicheckdefinitionlib->getFehlerLibMappings();
|
||||
// set Studiengang to null if not passed
|
||||
if (isEmptyString($studiengang_kz)) $studiengang_kz = null;
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// get Text and fehlercode of the Fehler
|
||||
$this->FehlerModel->addSelect('fehlercode, fehlertext, fehlertyp_kurzbz');
|
||||
$fehlerRes = $this->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (isError($fehlerRes)) $this->terminateWithJsonError(getError($fehlerRes));
|
||||
|
||||
// do not check error if no data
|
||||
if (!hasData($fehlerRes)) continue;
|
||||
|
||||
// get the error data
|
||||
$fehler = getData($fehlerRes)[0];
|
||||
|
||||
// initialize issue array
|
||||
$allIssues[$fehler_kurzbz] = array('fehlercode' => $fehler->fehlercode, 'data' => array());
|
||||
|
||||
// get library name for producing issue
|
||||
$libName = $fehlerLibMappings[$fehler_kurzbz];
|
||||
|
||||
// execute the check
|
||||
$issueTexts[$fehler_kurzbz] = array();
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz, $studiengang_kz);
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue(
|
||||
$libName,
|
||||
$fehler_kurzbz,
|
||||
array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($plausicheckRes)) $this->terminateWithJsonError(getError($plausicheckRes));
|
||||
|
||||
@@ -67,21 +95,17 @@ class Plausichecks extends Auth_Controller
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// get Text of the Fehler
|
||||
$this->FehlerModel->addSelect('fehlertext');
|
||||
$fehlerRes = $this->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (isError($fehlerRes)) $this->outputJsonError(getError($fehlerRes));
|
||||
|
||||
// optionally replace fehler parameters in text, output the fehlertext
|
||||
if (hasData($fehlerRes))
|
||||
if (!isEmptyString($fehler->fehlertext))
|
||||
{
|
||||
$fehlerText = getData($fehlerRes)[0]->fehlertext;
|
||||
$fehlercode = $fehler->fehlercode;
|
||||
$fehlerText = $fehler->fehlertext;
|
||||
$fehlerTyp = $fehler->fehlertyp_kurzbz;
|
||||
|
||||
if (!isEmptyArray($fehlertext_params))
|
||||
{
|
||||
// replace placeholder with params, if present
|
||||
if (count($fehlertext_params) != substr_count($fehlerText, '%s'))
|
||||
$this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler_kurzbz);
|
||||
|
||||
@@ -90,13 +114,25 @@ class Plausichecks extends Auth_Controller
|
||||
|
||||
if (isset($person_id)) $fehlerText .= "; person_id: $person_id";
|
||||
if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz";
|
||||
$issueTexts[$fehler_kurzbz][] = $fehlerText;
|
||||
|
||||
$issueObj = new StdClass();
|
||||
$issueObj->fehlertext = $fehlerText;
|
||||
$issueObj->type = $fehlerTyp;
|
||||
$allIssues[$fehler_kurzbz]['data'][] = $issueObj;
|
||||
}
|
||||
else // if no issue text found, use generic text
|
||||
{
|
||||
$fehlerText = self::GENERIC_ISSUE_OCCURED_TEXT;
|
||||
}
|
||||
|
||||
// add generic parameters to issue text
|
||||
if (isset($person_id)) $fehlerText .= "; person_id: $person_id";
|
||||
if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($issueTexts);
|
||||
$this->outputJsonSuccess($allIssues);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,13 +157,38 @@ class Plausichecks extends Auth_Controller
|
||||
|
||||
if (isError($studiengaengeRes)) show_error(getError($studiengaengeRes));
|
||||
|
||||
$fehlerKurzbz = $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
$fehlerKurzbz = $this->plausicheckdefinitionlib->getFehlerKurzbz();
|
||||
|
||||
$db = new DB_Model();
|
||||
|
||||
// get fehlercodes for fehler_kurzbz
|
||||
$fehlerRes = $db->execReadOnlyQuery(
|
||||
'SELECT
|
||||
fehler_kurzbz, fehlercode
|
||||
FROM
|
||||
system.tbl_fehler
|
||||
WHERE
|
||||
fehler_kurzbz IN ?',
|
||||
array($fehlerKurzbz)
|
||||
);
|
||||
|
||||
if (isError($fehlerRes)) show_error(getError($fehlerRes));
|
||||
|
||||
$fehlerKurzbzCodeMappings = array();
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehler = getData($fehlerRes);
|
||||
foreach ($fehler as $fe)
|
||||
{
|
||||
$fehlerKurzbzCodeMappings[$fe->fehler_kurzbz] = $fe->fehlercode;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'semester' => hasData($studiensemesterRes) ? getData($studiensemesterRes) : array(),
|
||||
'currsemester' => hasData($currSemRes) ? getData($currSemRes) : array(),
|
||||
'studiengaenge' => hasData($studiengaengeRes) ? getData($studiengaengeRes) : array(),
|
||||
'fehler' => $fehlerKurzbz
|
||||
'fehlerKurzbzCodeMappings' => $fehlerKurzbzCodeMappings
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class FASMessages extends Auth_Controller
|
||||
|
||||
// Loads the view to write a new message with a template
|
||||
$this->load->view(
|
||||
'system/messages/htmlWriteTemplate',
|
||||
'system/messages/FAShtmlWriteTemplate',
|
||||
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents)
|
||||
);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class FASMessages extends Auth_Controller
|
||||
|
||||
// Loads the view to write a new message with a template
|
||||
$this->load->view(
|
||||
'system/messages/htmlWriteTemplate',
|
||||
'system/messages/FAShtmlWriteTemplate',
|
||||
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents, $message_id, $recipient_id)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Interface defining method to implement for issue producer (from core and extensions)
|
||||
*/
|
||||
interface IIssueExistsChecker
|
||||
{
|
||||
/**
|
||||
* Checks if an issue exists.
|
||||
* @param array $params parameters needed for issue detection
|
||||
* @return object with success(true) if issue exists, success(false) otherwise
|
||||
*/
|
||||
public function checkIfIssueExists($paramsForChecking);
|
||||
|
||||
/**
|
||||
* Produces an issue.
|
||||
* @param array $params parameters needed for issue detection
|
||||
* @return object with success(true) if issue exists, success(false) otherwise
|
||||
*/
|
||||
//public function produceIssue($person_id, $oe_kurzbz, $paramsForProducing);
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
const CI_PATH = 'application';
|
||||
const CI_LIBRARY_FOLDER = 'libraries';
|
||||
const EXTENSIONS_FOLDER = 'extensions';
|
||||
const ISSUE_RESOLVERS_FOLDER = 'issues/resolvers';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
|
||||
@@ -60,10 +62,15 @@ abstract class IssueResolver_Controller extends JOB_Controller
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($this->_extensionName) ? self::EXTENSIONS_FOLDER . '/' . $this->_extensionName . '/' : '';
|
||||
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH . '/' . $libRootPath . 'libraries/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// file path of library for check if file exists
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH
|
||||
. '/' . $libRootPath . self::CI_LIBRARY_FOLDER . '/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Job for producing Plausicheck issues
|
||||
*/
|
||||
abstract class PlausiIssueProducer_Controller extends JOB_Controller
|
||||
{
|
||||
protected $_fehlerLibMappings;
|
||||
protected $_app;
|
||||
|
||||
public function __construct($app = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// pass extension name if calling from extension
|
||||
$extensionName = isset($this->_extensionName) ? $this->_extensionName : null;
|
||||
|
||||
// load libraries
|
||||
$this->load->library('issues/PlausicheckProducerLib', array('extensionName' => $extensionName, 'app' => $this->_app));
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
protected function producePlausicheckIssues($params)
|
||||
{
|
||||
$this->logInfo("Plausicheck issue producer job started");
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($this->_fehlerLibMappings as $fehler_kurzbz => $libName)
|
||||
{
|
||||
// execute the check
|
||||
$this->logInfo("Checking " . $fehler_kurzbz . "...");
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue(
|
||||
$libName,
|
||||
$fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
|
||||
if (isError($plausicheckRes)) $this->logError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// write the issue
|
||||
$addIssueRes = $this->issueslib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isError($addIssueRes))
|
||||
$this->logError(getError($addIssueRes));
|
||||
elseif (hasData($addIssueRes) && is_integer(getData($addIssueRes)))
|
||||
$this->logInfo("Plausicheck issue " . $fehler_kurzbz . " successfully produced, person_id: " . $person_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job stopped");
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Collection of utility functions for general purpose
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -405,3 +407,17 @@ function findResource($path, $resource, $subdir = false, $extraDir = null)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if String can be converted to a date
|
||||
*/
|
||||
function isValidDate($dateString)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (new DateTime($dateString)) !== false;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,19 +37,30 @@ class AnrechnungLib
|
||||
* @param $lv_id
|
||||
* @return StdClass
|
||||
*/
|
||||
public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id)
|
||||
public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id, $anrechnung_id = null)
|
||||
{
|
||||
$antrag_data = new StdClass();
|
||||
|
||||
// Get students UID.
|
||||
$uid = $this->ci->StudentModel->getUID($prestudent_id);
|
||||
|
||||
// Get lehrveranstaltung data. Break, if course is not assigned to student.
|
||||
if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0])
|
||||
|
||||
// If Anrechnung exists
|
||||
if (is_numeric($anrechnung_id))
|
||||
{
|
||||
show_error('You are not assigned to this course yet.');
|
||||
// Just load LV by lv_id
|
||||
$result = $this->ci->LehrveranstaltungModel->load($lv_id);
|
||||
$lv = getData($result)[0];
|
||||
}
|
||||
|
||||
// If Anrechnung not exists
|
||||
else
|
||||
{
|
||||
// Load LV, but check if student is assigned to that LV. Break, if not.
|
||||
if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0])
|
||||
{
|
||||
show_error('You are not assigned to this course yet.');
|
||||
}
|
||||
}
|
||||
|
||||
// Get the students personal data
|
||||
if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0])
|
||||
{
|
||||
@@ -163,6 +174,8 @@ class AnrechnungLib
|
||||
$anrechnung_data->insertvon = '';
|
||||
$anrechnung_data->studiensemester_kurzbz = '';
|
||||
$anrechnung_data->empfehlung = '';
|
||||
$anrechnung_data->begruendung_ects = '';
|
||||
$anrechnung_data->begruendung_lvinhalt = '';
|
||||
$anrechnung_data->status_kurzbz = '';
|
||||
$anrechnung_data->status = getUserLanguage() == 'German' ? 'neu' : 'new';
|
||||
$anrechnung_data->dokumentname = '';
|
||||
@@ -274,14 +287,21 @@ class AnrechnungLib
|
||||
if (hasData($result))
|
||||
{
|
||||
$empfehlung_data->empfehlungsanfrageAm = (new DateTime($result->retval[0]->insertamum))->format('d.m.Y');
|
||||
|
||||
// Get lectors who received request for recommendation
|
||||
$lector_arr = self::getLectors($anrechnung_id);
|
||||
|
||||
if (!isEmptyArray($lector_arr))
|
||||
{
|
||||
$empfehlung_data->empfehlungsanfrageAn = implode(', ', array_column($lector_arr, 'fullname'));
|
||||
}
|
||||
|
||||
// Get users who received request for recommendation
|
||||
if($this->ci->config->item('fbl') === TRUE)
|
||||
{
|
||||
$res = $this->getLeitungOfLvOe($anrechnung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $this->getLectors($anrechnung_id);
|
||||
}
|
||||
|
||||
if (!isEmptyArray($res))
|
||||
{
|
||||
$empfehlung_data->empfehlungsanfrageAn = implode(', ', array_column($res, 'fullname'));
|
||||
}
|
||||
}
|
||||
|
||||
if (is_null($anrechnung->empfehlung_anrechnung))
|
||||
@@ -741,6 +761,25 @@ class AnrechnungLib
|
||||
// Continue, if LV has no lector (there is no one to ask for recommendation)
|
||||
return hasData($result) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is allowed to recommend Anrechnung.
|
||||
*
|
||||
* @param $anrechnung_id
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmpfehlungsberechtigt($anrechnung_id)
|
||||
{
|
||||
if($this->ci->config->item('fbl') === TRUE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Get lv-leitungen or, if not present, all lectors of lv.
|
||||
$lector_arr = $this->getLectors($anrechnung_id);
|
||||
|
||||
// Return false if lv-leitung is present and user is not lv-leitung. Otherways return always true.
|
||||
return in_array(getAuthUID(), array_column($lector_arr, 'uid'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LV Leitung. If not present, get all LV lectors.
|
||||
@@ -774,11 +813,14 @@ class AnrechnungLib
|
||||
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
|
||||
// If lv has 1 or more LV-Leitungen, keep only them
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
foreach ($result as $lector)
|
||||
{
|
||||
if ($lector->lvleiter) $lector_arr[]= $lector;
|
||||
}
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
@@ -803,6 +845,40 @@ class AnrechnungLib
|
||||
return $lector_arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Leitung of Lehrveranstaltungs-Organisationseinheit.
|
||||
*
|
||||
* @param $anrechnung_id
|
||||
* @return false|mixed|null
|
||||
*/
|
||||
public function getLeitungOfLvOe($anrechnung_id)
|
||||
{
|
||||
$this->ci->AnrechnungModel->addSelect('lehrveranstaltung_id');
|
||||
$result = $this->ci->AnrechnungModel->load($anrechnung_id);
|
||||
|
||||
$lehrveranstaltung_id = getData($result)[0]->lehrveranstaltung_id;
|
||||
|
||||
// Get Leitungen
|
||||
$result = $this->ci->LehrveranstaltungModel->getLeitungOfLvOe($lehrveranstaltung_id);
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$oeLeitung_arr = getData($result);
|
||||
|
||||
foreach ($oeLeitung_arr as $oeLeitung)
|
||||
{
|
||||
$oeLeitung->fullname = $oeLeitung->vorname. ' '. $oeLeitung->nachname;
|
||||
}
|
||||
|
||||
// Now make the array unique
|
||||
$oeLeitung_arr = array_unique($oeLeitung_arr, SORT_REGULAR);
|
||||
|
||||
return $oeLeitung_arr;
|
||||
}
|
||||
|
||||
// Return an object with Anrechnungdata
|
||||
private function _setAnrechnungDataObject($anrechnung)
|
||||
{
|
||||
@@ -820,6 +896,8 @@ class AnrechnungLib
|
||||
$anrechnung_data->insertvon= $anrechnung->insertvon;
|
||||
$anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz;
|
||||
$anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung;
|
||||
$anrechnung_data->begruendung_ects = $anrechnung->begruendung_ects;
|
||||
$anrechnung_data->begruendung_lvinhalt = $anrechnung->begruendung_lvinhalt;
|
||||
|
||||
// Get last status_kurzbz
|
||||
$result = $this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung->anrechnung_id);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -551,10 +551,7 @@ class AuthLib
|
||||
// Needed information
|
||||
$this->_ci->PersonModel->addSelect('person_id, vorname, nachname, uid');
|
||||
// Retrieves the uid if it is possible for active users
|
||||
$this->_ci->PersonModel->addJoin(
|
||||
'(SELECT uid, person_id FROM public.tbl_benutzer WHERE aktiv = TRUE) tb', 'person_id',
|
||||
'LEFT'
|
||||
);
|
||||
$this->_ci->PersonModel->addJoin('public.tbl_benutzer', 'person_id', 'LEFT');
|
||||
|
||||
// Execute query with where clause
|
||||
$personResult = $this->_ci->PersonModel->loadWhere($queryParamsArray);
|
||||
|
||||
@@ -595,6 +595,8 @@ class DmsLib
|
||||
if (isError($insDmsResult)) return $insDmsResult;
|
||||
|
||||
$upload_data['dms_id'] = getData($insDmsResult);
|
||||
if(isset($upload_data['file_type']) && !isset($dms['mimetype']))
|
||||
$dms['mimetype'] = $upload_data['file_type'];
|
||||
|
||||
// Insert DMS version
|
||||
$insVersionResult = $this->_ci->DmsVersionModel->insert(
|
||||
|
||||
@@ -182,6 +182,7 @@ class MailLib
|
||||
{
|
||||
if ($this->sended == $this->email_number_per_time_range)
|
||||
{
|
||||
$this->sended = 0;
|
||||
sleep($this->email_time_range); // Wait!!!
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class PersonLogLib
|
||||
{
|
||||
const PARKED_LOGNAME = 'Parked';
|
||||
const ONHOLD_LOGNAME = 'Onhold';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -78,168 +75,6 @@ class PersonLogLib
|
||||
else
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parks a person, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent)
|
||||
* Done by adding a logentry in the future
|
||||
* @param $person_id
|
||||
* @param $date
|
||||
* @param $taetigkeit_kurzbz
|
||||
* @param string $app
|
||||
* @param null $oe_kurzbz
|
||||
* @param null $user
|
||||
* @return insert object
|
||||
*/
|
||||
public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
|
||||
{
|
||||
$onhold = $this->getOnHoldDate($person_id);
|
||||
|
||||
if (hasData($onhold))
|
||||
return error("Person already on hold");
|
||||
|
||||
$logjson = array(
|
||||
'name' => self::PARKED_LOGNAME
|
||||
);
|
||||
|
||||
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unparks a person, i.e. removes all log entries in the future with logname for parking
|
||||
* @param $person_id
|
||||
* @return array with deleted logids
|
||||
*/
|
||||
public function unPark($person_id)
|
||||
{
|
||||
$deleted = array();
|
||||
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
|
||||
{
|
||||
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
|
||||
if (isSuccess($delresult))
|
||||
{
|
||||
$deleted[] = $log->log_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success($deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets date until which a person is parked
|
||||
* @param $person_id
|
||||
* @return the date if person is parked, null otherwise
|
||||
*/
|
||||
public function getParkedDate($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
|
||||
$parkeddate = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
|
||||
{
|
||||
$parkeddate = $log->zeitpunkt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $parkeddate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets person on hold, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent).
|
||||
* Done by adding a logentry with a special name. can be undone only manually by clicking button.
|
||||
* @param $person_id
|
||||
* @param $date
|
||||
* @param $taetigkeit_kurzbz
|
||||
* @param string $app
|
||||
* @param null $oe_kurzbz
|
||||
* @param null $user
|
||||
* @return array
|
||||
*/
|
||||
public function setOnHold($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
|
||||
{
|
||||
$parked = $this->getParkedDate($person_id);
|
||||
|
||||
if (hasData($parked))
|
||||
return error("Person already parked");
|
||||
|
||||
$logjson = array(
|
||||
'name' => self::ONHOLD_LOGNAME
|
||||
);
|
||||
|
||||
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes on hold status, i.e. removes all log entries with logname for on hold
|
||||
* @param $person_id
|
||||
* @return array
|
||||
*/
|
||||
public function removeOnHold($person_id)
|
||||
{
|
||||
$deleted = array();
|
||||
|
||||
$result = $this->ci->PersonLogModel->filterLog($person_id);
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
|
||||
{
|
||||
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
|
||||
if (isSuccess($delresult))
|
||||
{
|
||||
$deleted[] = $log->log_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return success($deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets date until which a person is on hold
|
||||
* @param $person_id
|
||||
* @return the date if person is on hold, null otherwise
|
||||
*/
|
||||
public function getOnHoldDate($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->filterLog($person_id);
|
||||
|
||||
$onholddate = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
|
||||
{
|
||||
$onholddate = $log->zeitpunkt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $onholddate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a processstate log with specified parameters, including a specified log date.
|
||||
* @param $person_id
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2023 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PrestudentLib
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// // Configs
|
||||
// $this->_ci->load->config('studierendenantrag');
|
||||
|
||||
// // Models
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$this->_ci->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->_ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->_ci->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$this->_ci->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
$this->_ci->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->_ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
public function setAbbrecher($prestudent_id, $studiensemester_kurzbz, $insertvon = null, $statusgrund_kurzbz = null, $datum = null, $bestaetigtam = null, $bestaetigtvon = null)
|
||||
{
|
||||
if (!$insertvon)
|
||||
$insertvon = getAuthUID();
|
||||
if (!$bestaetigtvon)
|
||||
$bestaetigtvon = $insertvon;
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_prestudent_in_sem', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]));
|
||||
|
||||
$prestudent_status = current($result);
|
||||
|
||||
$result = $this->_ci->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_student_for_prestudent', ['prestudent_id' => $prestudent_id]));
|
||||
|
||||
$student = current($result);
|
||||
|
||||
if(!$datum)
|
||||
$datum = date('c');
|
||||
|
||||
if(!$bestaetigtam)
|
||||
$bestaetigtam = date('c');
|
||||
|
||||
//Status und Statusgrund updaten
|
||||
$result = $this->_ci->PrestudentstatusModel->withGrund($statusgrund_kurzbz)->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_ABBRECHER,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $prestudent_status->ausbildungssemester,
|
||||
'datum' => $datum,
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('c'),
|
||||
'orgform_kurzbz'=> $prestudent_status->orgform_kurzbz,
|
||||
'studienplan_id'=> $prestudent_status->studienplan_id,
|
||||
'bestaetigtvon' => $bestaetigtvon,
|
||||
'bestaetigtam' => $bestaetigtam
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
|
||||
//Verband anlegen
|
||||
$result = $this->_ci->LehrverbandModel->load([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'A',
|
||||
'gruppe' => ''
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
{
|
||||
$result = $this->_ci->LehrverbandModel->load([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => '',
|
||||
'gruppe' => ''
|
||||
]);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
$this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => '',
|
||||
'gruppe' => '',
|
||||
'bezeichnung' => 'Ab-Unterbrecher',
|
||||
'aktiv' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'A',
|
||||
'gruppe' => '',
|
||||
'bezeichnung' => 'Abbrecher',
|
||||
'aktiv' => true
|
||||
]);
|
||||
}
|
||||
|
||||
//noch nicht eingetragene Zeugnisnoten auf 9 setzen
|
||||
$result = $this->_ci->ZeugnisnoteModel->getZeugnisnoten($student->student_uid, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result) ?: [];
|
||||
|
||||
foreach ($result as $lv)
|
||||
{
|
||||
if (!$lv->note)
|
||||
{
|
||||
$result = $this->_ci->ZeugnisnoteModel->insert([
|
||||
'note' => 9,
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz,
|
||||
'student_uid' => $lv->uid,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$result = $this->_ci->ZeugnisnoteModel->update([
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz,
|
||||
'student_uid' => $lv->uid,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id
|
||||
], [
|
||||
'note' => 9
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Update Aktionen
|
||||
|
||||
//StudentModel updaten
|
||||
$this->_ci->StudentModel->update([
|
||||
'student_uid' => $student->student_uid
|
||||
], [
|
||||
'verband' => 'A',
|
||||
'gruppe' => '',
|
||||
'semester' => 0,
|
||||
'updatevon' => $insertvon,
|
||||
'updateamum' => date('c')
|
||||
]);
|
||||
|
||||
//Studentlehrverband setzen
|
||||
$this->_ci->StudentlehrverbandModel->update([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student->student_uid
|
||||
], [
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'A',
|
||||
'gruppe' => '',
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $insertvon
|
||||
]);
|
||||
|
||||
//Benutzer inaktiv setzen
|
||||
$this->_ci->BenutzerModel->update([
|
||||
'uid' => $student->student_uid
|
||||
], [
|
||||
'aktiv' => false,
|
||||
'updateaktivvon' => $insertvon,
|
||||
'updateaktivam' => date('c'),
|
||||
'updatevon' => $insertvon,
|
||||
'updateamum' => date('c')
|
||||
]);
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
public function setUnterbrecher($prestudent_id, $studiensemester_kurzbz, $studierendenantrag_id, $insertvon = null)
|
||||
{
|
||||
$ausbildungssemester_plus = 0;
|
||||
if (!$insertvon)
|
||||
$insertvon = getAuthUID();
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result) {
|
||||
//NOTE(manu): only valid if nextSemester focus max
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
//check if ausbildungssemester is last
|
||||
$this->_ci->StudiengangModel->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$res = $this->_ci->StudiengangModel->loadWhere(['p.prestudent_id' => $prestudent_id]);
|
||||
if(isError($res))
|
||||
return $res;
|
||||
if(!hasData($res))
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_stg_for_prestudent', [
|
||||
'prestudent_id' => $prestudent_id
|
||||
]));
|
||||
|
||||
$studiengang = current(getData($res));
|
||||
$prestudent_status = current($result);
|
||||
if($prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester)
|
||||
$ausbildungssemester_plus = 1;
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_prestudent_in_sem', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
$prestudent_status = current($result);
|
||||
$result = $this->_ci->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_student_for_prestudent', ['prestudent_id' => $prestudent_id]));
|
||||
|
||||
$student = current($result);
|
||||
|
||||
$resultAntrag = $this->_ci->StudierendenantragModel->load($studierendenantrag_id);
|
||||
if (isError($resultAntrag))
|
||||
return $resultAntrag;
|
||||
$resultAntrag = getData($resultAntrag);
|
||||
if (!$resultAntrag)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $studierendenantrag_id]));
|
||||
|
||||
$antrag = current($resultAntrag);
|
||||
|
||||
//Status updaten
|
||||
$result = $this->_ci->PrestudentstatusModel->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_UNTERBRECHER,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $prestudent_status->ausbildungssemester + $ausbildungssemester_plus,
|
||||
'datum' => date('c'),
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('c'),
|
||||
'orgform_kurzbz'=> $prestudent_status->orgform_kurzbz,
|
||||
'studienplan_id'=> $prestudent_status->studienplan_id,
|
||||
'bestaetigtvon' => $insertvon,
|
||||
'bestaetigtam' => date('c'),
|
||||
'anmerkung'=> 'Wiedereinstieg ' . $antrag->datum_wiedereinstieg
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
//Verband anlegen
|
||||
$result = $this->_ci->LehrverbandModel->load([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => ''
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
{
|
||||
$result = $this->_ci->LehrverbandModel->load([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => '',
|
||||
'gruppe' => ''
|
||||
]);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
$this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => '',
|
||||
'gruppe' => '',
|
||||
'bezeichnung' => 'Ab-Unterbrecher',
|
||||
'aktiv' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'bezeichnung' => 'Unterbrecher',
|
||||
'aktiv' => true
|
||||
]);
|
||||
}
|
||||
|
||||
//noch nicht eingetragene Zeugnisnoten auf 9 setzen
|
||||
$result = $this->_ci->ZeugnisnoteModel->getZeugnisnoten($student->student_uid, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result) ?: [];
|
||||
|
||||
foreach ($result as $lv)
|
||||
{
|
||||
if (!$lv->note)
|
||||
{
|
||||
$result = $this->_ci->ZeugnisnoteModel->insert([
|
||||
'note' => 9,
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz,
|
||||
'student_uid' => $lv->uid,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$result = $this->_ci->ZeugnisnoteModel->update([
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz,
|
||||
'student_uid' => $lv->uid,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id
|
||||
], [
|
||||
'note' => 9
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Update Aktionen
|
||||
|
||||
//StudentModel updaten
|
||||
$this->_ci->StudentModel->update([
|
||||
'student_uid' => $student->student_uid
|
||||
], [
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'semester' => 0,
|
||||
'updatevon' => $insertvon,
|
||||
'updateamum' => date('c')
|
||||
]);
|
||||
|
||||
//Studentlehrverband setzen
|
||||
$result = $this->_ci->StudentlehrverbandModel->loadWhere([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student->student_uid
|
||||
]);
|
||||
if (hasData($result)) {
|
||||
$this->_ci->StudentlehrverbandModel->update([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student->student_uid
|
||||
], [
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $insertvon
|
||||
]);
|
||||
} else {
|
||||
$this->_ci->StudentlehrverbandModel->insert([
|
||||
'student_uid' => $student->student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $insertvon
|
||||
]);
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../../vendor/nategood/httpful/bootstrap.php');
|
||||
|
||||
/**
|
||||
* Simple client to call the signature server
|
||||
*/
|
||||
class SignatureLib
|
||||
{
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Public static methods
|
||||
|
||||
/**
|
||||
* Returns the list of signature inside the given file
|
||||
*/
|
||||
public static function list($inputFileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Dont send Document if it is bigger than 30 MB (Limit of Signature Server)
|
||||
if (filesize($inputFileName) > 30000000)
|
||||
{
|
||||
$returnObject = new stdClass();
|
||||
$returnObject->code = 1;
|
||||
$returnObject->error = 1;
|
||||
$returnObject->retval = 'File to big';
|
||||
|
||||
return $returnObject;
|
||||
}
|
||||
|
||||
// Get the content of the given file
|
||||
$inputFileContent = file_get_contents($inputFileName);
|
||||
if ($inputFileContent === false) // if failed
|
||||
{
|
||||
error_log('An error occurred while getting the content from: '.$inputFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Posts the given file content + file name and expects a response in JSON format
|
||||
$resultPost = \Httpful\Request::post(SIGNATUR_URL.'/'.SIGNATUR_LIST_API)
|
||||
->sendsJson()
|
||||
->authenticateWith(SIGNATUR_USER, SIGNATUR_PASSWORD)
|
||||
->body('{"filename": "'.basename($inputFileName).'", "content": "'.base64_encode($inputFileContent).'"}')
|
||||
->expectsJson()
|
||||
->send();
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
// If the response is fine
|
||||
if (isset($resultPost->body) && is_object($resultPost->body)
|
||||
&& isset($resultPost->body->retval) && is_array($resultPost->body->retval))
|
||||
{
|
||||
return $resultPost->body->retval;
|
||||
}
|
||||
|
||||
// Otherwise return a null as error
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Library containing definitions of all core plausichecks.
|
||||
*/
|
||||
class PlausicheckDefinitionLib
|
||||
{
|
||||
// set fehler for core plausichecks
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
private $_fehlerLibMappings = array(
|
||||
'AbbrecherAktiv' => 'AbbrecherAktiv',
|
||||
'AbschlussstatusFehlt' => 'AbschlussstatusFehlt',
|
||||
'AktSemesterNull' => 'AktSemesterNull',
|
||||
'AktiverStudentOhneStatus' => 'AktiverStudentOhneStatus',
|
||||
'AusbildungssemPrestudentUngleichAusbildungssemStatus' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten',
|
||||
'DatumAbschlusspruefungFehlt' => 'DatumAbschlusspruefungFehlt',
|
||||
'DatumSponsionFehlt' => 'DatumSponsionFehlt',
|
||||
'DatumStudiensemesterFalscheReihenfolge' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'FalscheAnzahlAbschlusspruefungen' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'FalscheAnzahlHeimatadressen' => 'FalscheAnzahlHeimatadressen',
|
||||
'FalscheAnzahlZustelladressen' => 'FalscheAnzahlZustelladressen',
|
||||
'GbDatumWeitZurueck' => 'GbDatumWeitZurueck',
|
||||
'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus',
|
||||
'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich',
|
||||
'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz',
|
||||
'IncomingOrGsFoerderrelevant' => 'IncomingOrGsFoerderrelevant',
|
||||
'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung',
|
||||
'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde',
|
||||
'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'PrestudentMischformOhneOrgform' => 'PrestudentMischformOhneOrgform',
|
||||
'StgPrestudentUngleichStgStudienplan' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
|
||||
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher'
|
||||
//'StudienplanUngueltig' => 'StudienplanUngueltig'
|
||||
);
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz-library mappings for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerLibMappings()
|
||||
{
|
||||
return $this->_fehlerLibMappings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerKurzbz()
|
||||
{
|
||||
return array_keys($this->_fehlerLibMappings);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,77 +4,70 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PlausicheckProducerLib
|
||||
{
|
||||
const CI_LIBRARY_PATH = 'application/libraries';
|
||||
const CI_PATH = 'application';
|
||||
const CI_LIBRARY_FOLDER = 'libraries';
|
||||
const EXTENSIONS_FOLDER = 'extensions';
|
||||
const PLAUSI_ISSUES_FOLDER = 'issues/plausichecks';
|
||||
const EXECUTE_PLAUSI_CHECK_METHOD_NAME = 'executePlausiCheck';
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_currentStudiensemester; // current Studiensemester
|
||||
private $_extensionName; // name of extension
|
||||
private $_app; // name of application
|
||||
private $_konfiguration = array(); // konfigratio parameters
|
||||
|
||||
// set fehler which can be produced by the job
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
private $_fehlerLibMappings = array(
|
||||
'AbbrecherAktiv' => 'AbbrecherAktiv',
|
||||
'AbschlussstatusFehlt' => 'AbschlussstatusFehlt',
|
||||
'AktSemesterNull' => 'AktSemesterNull',
|
||||
'AktiverStudentOhneStatus' => 'AktiverStudentOhneStatus',
|
||||
'AusbildungssemPrestudentUngleichAusbildungssemStatus' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten',
|
||||
'DatumAbschlusspruefungFehlt' => 'DatumAbschlusspruefungFehlt',
|
||||
'DatumSponsionFehlt' => 'DatumSponsionFehlt',
|
||||
'DatumStudiensemesterFalscheReihenfolge' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'FalscheAnzahlAbschlusspruefungen' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'FalscheAnzahlHeimatadressen' => 'FalscheAnzahlHeimatadressen',
|
||||
'FalscheAnzahlZustelladressen' => 'FalscheAnzahlZustelladressen',
|
||||
'GbDatumWeitZurueck' => 'GbDatumWeitZurueck',
|
||||
'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus',
|
||||
'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich',
|
||||
'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz',
|
||||
'IncomingOrGsFoerderrelevant' => 'IncomingOrGsFoerderrelevant',
|
||||
'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung',
|
||||
'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde',
|
||||
'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'PrestudentMischformOhneOrgform' => 'PrestudentMischformOhneOrgform',
|
||||
'StgPrestudentUngleichStgStudienplan' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
|
||||
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher'
|
||||
//'StudienplanUngueltig' => 'StudienplanUngueltig'
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params = null)
|
||||
{
|
||||
// set extension name if called from extension
|
||||
if (isset($params['extensionName'])) $this->_extensionName = $params['extensionName'];
|
||||
|
||||
// set application
|
||||
$app = isset($params['app']) ? $params['app'] : null;
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// load models
|
||||
$this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
$this->_ci->load->model('system/Fehlerkonfiguration_model', 'FehlerkonfigurationModel');
|
||||
|
||||
// get current Studiensemester
|
||||
$studiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
|
||||
if (hasData($studiensemesterRes)) $this->_currentStudiensemester = getData($studiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
// get all configuration parameters for the application
|
||||
$fehlerkonfigurationRes = $this->_ci->FehlerkonfigurationModel->getKonfiguration($app);
|
||||
|
||||
if (hasData($fehlerkonfigurationRes))
|
||||
{
|
||||
$fehlerkonfiguration = getData($fehlerkonfigurationRes);
|
||||
|
||||
foreach ($fehlerkonfiguration as $fk)
|
||||
{
|
||||
$this->_konfiguration[$fk->fehler_kurzbz][$fk->konfigurationstyp_kurzbz] = $fk->konfiguration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes check for a fehler_kurzbz, returns the result.
|
||||
* @param $fehler_kurzbz string
|
||||
* @param $studiensemester_kurzbz string optionally needed for issue production
|
||||
* @param $studiengang_kz int optionally needed for issue production
|
||||
* Executes plausicheck using a given library, returns the result.
|
||||
* @param $libName string name of library producing the issue
|
||||
* @param $fehler_kurzbz string unique short name of fehler, for which issue is produced
|
||||
* @param $params parameters passed to issue production method
|
||||
*/
|
||||
public function producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz = null, $studiengang_kz = null)
|
||||
public function producePlausicheckIssue($libName, $fehler_kurzbz, $params)
|
||||
{
|
||||
$libName = $this->_fehlerLibMappings[$fehler_kurzbz];
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($this->_extensionName) ? self::EXTENSIONS_FOLDER . '/' . $this->_extensionName . '/' : '';
|
||||
|
||||
// get Studiensemester
|
||||
if (isEmptyString($studiensemester_kurzbz)) $studiensemester_kurzbz = $this->_currentStudiensemester;
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::PLAUSI_ISSUES_FOLDER . '/';
|
||||
|
||||
// get path of library for issue to be produced
|
||||
$issuesLibPath = DOC_ROOT . self::CI_LIBRARY_PATH . '/' . self::PLAUSI_ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = $issuesLibPath . $libName . '.php';
|
||||
// file path of library for check if file exists
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH
|
||||
. '/' . $libRootPath . self::CI_LIBRARY_FOLDER . '/' . self::PLAUSI_ISSUES_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath)) return error("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
|
||||
// load konfiguration parameters of the fehler_kurzbz
|
||||
$config = isset($this->_konfiguration[$fehler_kurzbz]) ? $this->_konfiguration[$fehler_kurzbz] : null;
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library(self::PLAUSI_ISSUES_FOLDER . '/'.$libName);
|
||||
$this->_ci->load->library($issuesLibPath . $libName, $config);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
@@ -82,21 +75,7 @@ class PlausicheckProducerLib
|
||||
if (!is_callable(array($this->_ci->{$lowercaseLibName}, self::EXECUTE_PLAUSI_CHECK_METHOD_NAME)))
|
||||
return error("Method " . self::EXECUTE_PLAUSI_CHECK_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
|
||||
// pass the data needed for issue check
|
||||
$paramsForCheck = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz
|
||||
);
|
||||
|
||||
// call the function for checking for issue production
|
||||
return $this->_ci->{$lowercaseLibName}->{self::EXECUTE_PLAUSI_CHECK_METHOD_NAME}($paramsForCheck);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerKurzbz()
|
||||
{
|
||||
return array_keys($this->_fehlerLibMappings);
|
||||
return $this->_ci->{$lowercaseLibName}->{self::EXECUTE_PLAUSI_CHECK_METHOD_NAME}($params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,14 @@ class AbbrecherAktiv extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAbbrecherAktiv($studiengang_kz);
|
||||
$prestudentRes = $this->getAbbrecherAktiv($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -40,4 +43,49 @@ class AbbrecherAktiv extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Abbrecher cannot be active.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAbbrecherAktiv($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudentstatus pre_status
|
||||
JOIN public.tbl_prestudent pre USING(prestudent_id)
|
||||
JOIN public.tbl_student student USING(prestudent_id)
|
||||
JOIN public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
pre_status.status_kurzbz ='Abbrecher'
|
||||
AND benutzer.aktiv=true";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class AbschlussstatusFehlt extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAbschlussstatusFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getAbschlussstatusFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -41,4 +49,95 @@ class AbschlussstatusFehlt extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prestudent should have a final status.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAbschlussstatusFehlt(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (pre.prestudent_id)
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
NOT EXISTS( /*student does not study anymore*/
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
public.tbl_prestudentstatus ps
|
||||
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE
|
||||
prestudent_id=pre.prestudent_id
|
||||
/* 4 months: There might be Diplomanden, in summer months end status is often not entered yet */
|
||||
AND tbl_studiensemester.ende>now() - interval '4 months'
|
||||
)
|
||||
/* check only valid begininng with 2018 */
|
||||
AND '2018-01-01'<(SELECT max(datum) FROM public.tbl_prestudentstatus WHERE prestudent_id=pre.prestudent_id)
|
||||
AND NOT EXISTS( /* no end status */
|
||||
SELECT 1
|
||||
FROM public.tbl_prestudentstatus ps
|
||||
WHERE
|
||||
prestudent_id=pre.prestudent_id
|
||||
AND status_kurzbz IN('Abbrecher','Abgewiesener','Absolvent','Incoming')
|
||||
)
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$prevStudiensemesterRes = $this->_ci->StudiensemesterModel->getPreviousFrom($studiensemester_kurzbz);
|
||||
|
||||
if (isError($prevStudiensemesterRes)) return $prevStudiensemesterRes;
|
||||
|
||||
if (hasData($prevStudiensemesterRes))
|
||||
{
|
||||
// if Studiensemester given, check only if has status in current or previous semester
|
||||
$prevStudiensemester = getData($prevStudiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
$qry .= " AND EXISTS (
|
||||
SELECT 1
|
||||
FROM public.tbl_prestudentstatus ps
|
||||
WHERE studiensemester_kurzbz IN (?, ?)
|
||||
AND ps.prestudent_id = pre.prestudent_id
|
||||
)";
|
||||
$params[] = $prevStudiensemester;
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,15 @@ class AktSemesterNull extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -47,4 +50,51 @@ class AktSemesterNull extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Current Ausbildungssemester shouldn't be 0.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, prestat.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_prestudentstatus prestat USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
prestat.status_kurzbz != 'Incoming'
|
||||
AND prestat.studiensemester_kurzbz = ?
|
||||
AND ausbildungssemester = 0
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,14 @@ class AktiverStudentOhneStatus extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktiverStudentOhneStatus($studiengang_kz);
|
||||
$prestudentRes = $this->getAktiverStudentOhneStatus($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -40,4 +43,57 @@ class AktiverStudentOhneStatus extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students with active Benutzer should have a status in the current semester.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAktiverStudentOhneStatus($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT (student_uid), prestudent.person_id, prestudent.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_student student
|
||||
JOIN public.tbl_benutzer benutzer on (benutzer.uid = student.student_uid)
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
benutzer.aktiv=TRUE
|
||||
AND stg.melderelevant
|
||||
AND prestudent.bismelden
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM public.tbl_prestudentstatus
|
||||
JOIN public.tbl_studiensemester sem USING (studiensemester_kurzbz)
|
||||
WHERE prestudent_id = prestudent.prestudent_id
|
||||
/* buffer of four months, as status are often entered later */
|
||||
AND sem.ende::date > NOW() - interval '4 months'
|
||||
)";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with negative or zero value.
|
||||
*/
|
||||
class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAktiverStudentstatusOhneKontobuchung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with a negative or zero value.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAktiverStudentstatusOhneKontobuchung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (pre.prestudent_id)
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_person pers USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
status.studiensemester_kurzbz = ?
|
||||
AND status.status_kurzbz IN ('Student', 'Incoming')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
public.tbl_konto
|
||||
WHERE
|
||||
person_id = pers.person_id
|
||||
AND studiensemester_kurzbz = status.studiensemester_kurzbz
|
||||
AND buchungsnr_verweis IS NULL
|
||||
AND betrag <= 0
|
||||
)
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
+62
-2
@@ -13,14 +13,19 @@ class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$prestudentRes = $this->getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
@@ -53,4 +58,59 @@ class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ausbildungssemester of prestudent (lehrverband) must be the same as Ausbildungssemester of prestudentstatus.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz, $studiensemester_kurzbz, $studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT(student.student_uid), student.student_uid, prestudent.person_id, prestudent.prestudent_id,
|
||||
status.ausbildungssemester AS status_ausbildungssemester, lv.semester AS student_ausbildungssemester, status.studiensemester_kurzbz,
|
||||
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_student student
|
||||
JOIN public.tbl_studentlehrverband lv USING(student_uid)
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
status.studiensemester_kurzbz = ?
|
||||
AND lv.studiensemester_kurzbz = ?
|
||||
AND status.status_kurzbz NOT IN ('Interessent','Bewerber','Aufgenommener','Wartender','Abgewiesener','Unterbrecher')
|
||||
AND get_rolle_prestudent (prestudent_id, ?)='Student'
|
||||
AND status.ausbildungssemester != lv.semester";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getBewerberNichtZumRtAngetreten($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getBewerberNichtZumRtAngetreten(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -44,4 +52,72 @@ class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bewerber should have participated in Reihungstest.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getBewerberNichtZumRtAngetreten(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$previousStudiensemesterRes = $this->_ci->StudiensemesterModel->getPreviousFrom($studiensemester_kurzbz);
|
||||
|
||||
if (isError($previousStudiensemesterRes)) return $previousStudiensemesterRes;
|
||||
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
prestudent.person_id, prestudent.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent prestudent
|
||||
JOIN public.tbl_prestudentstatus status ON(prestudent.prestudent_id=status.prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN bis.tbl_orgform USING(orgform_kurzbz)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
status_kurzbz='Bewerber'
|
||||
AND reihungstestangetreten=false
|
||||
AND stg.melderelevant
|
||||
AND prestudent.bismelden";
|
||||
|
||||
if (hasData($previousStudiensemesterRes))
|
||||
{
|
||||
$previousStudiensemester = getData($previousStudiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
$qry .= " AND (studiensemester_kurzbz=? OR studiensemester_kurzbz=?)";
|
||||
$params[] = $previousStudiensemester;
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry .= " AND studiensemester_kurzbz=?";
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumAbschlusspruefungFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getDatumAbschlusspruefungFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -44,4 +52,72 @@ class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Date of final exam shouldn't be missing for Absolvent.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param abschlusspruefung_id int if check is to be executed for a certain Abschlussprüfung
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getDatumAbschlusspruefungFehlt(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$abschlusspruefung_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id,
|
||||
pruefung.sponsion, pruefung.datum, pruefung.abschlusspruefung_id,
|
||||
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus prestatus USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN lehre.tbl_abschlusspruefung pruefung ON stud.student_uid = pruefung.student_uid
|
||||
WHERE
|
||||
status_kurzbz = 'Absolvent'
|
||||
AND NOT EXISTS ( /* exclude gs */
|
||||
SELECT 1
|
||||
FROM bis.tbl_mobilitaet
|
||||
WHERE prestudent_id = pre.prestudent_id
|
||||
AND studiensemester_kurzbz = prestatus.studiensemester_kurzbz
|
||||
)
|
||||
AND abschlussbeurteilung_kurzbz!='nicht'
|
||||
AND abschlussbeurteilung_kurzbz IS NOT NULL
|
||||
AND pruefung.datum IS NULL
|
||||
AND pre.bismelden
|
||||
AND stg.melderelevant";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND prestatus.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($abschlusspruefung_id))
|
||||
{
|
||||
$qry .= " AND pruefung.abschlusspruefung_id = ?";
|
||||
$params[] = $abschlusspruefung_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class DatumSponsionFehlt extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumSponsionFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getDatumSponsionFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -44,4 +52,72 @@ class DatumSponsionFehlt extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Date of sponsion shouldn't be missing for Absolvent.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param abschlusspruefung_id int if check is to be executed only for a certain Abschlussprüfung
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getDatumSponsionFehlt(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$abschlusspruefung_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id,
|
||||
pruefung.sponsion, pruefung.datum, pruefung.abschlusspruefung_id,
|
||||
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus prestatus USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN lehre.tbl_abschlusspruefung pruefung ON stud.student_uid = pruefung.student_uid
|
||||
WHERE
|
||||
status_kurzbz = 'Absolvent'
|
||||
AND NOT EXISTS ( /* exclude gs */
|
||||
SELECT 1
|
||||
FROM bis.tbl_mobilitaet
|
||||
WHERE prestudent_id = pre.prestudent_id
|
||||
AND studiensemester_kurzbz = prestatus.studiensemester_kurzbz
|
||||
)
|
||||
AND abschlussbeurteilung_kurzbz!='nicht'
|
||||
AND abschlussbeurteilung_kurzbz IS NOT NULL
|
||||
AND pruefung.sponsion IS NULL
|
||||
AND pre.bismelden
|
||||
AND stg.melderelevant";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND prestatus.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($abschlusspruefung_id))
|
||||
{
|
||||
$qry .= " AND pruefung.abschlusspruefung_id = ?";
|
||||
$params[] = $abschlusspruefung_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
+64
-1
@@ -13,11 +13,14 @@ class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumStudiensemesterFalscheReihenfolge($studiengang_kz);
|
||||
$prestudentRes = $this->getDatumStudiensemesterFalscheReihenfolge($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -42,4 +45,64 @@ class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Status Dates and status studysemester dates should be in correct order.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if check is to be executed only for certain Studiengaenge
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getDatumStudiensemesterFalscheReihenfolge($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
// all active students with Status student in current semester
|
||||
$qry = "
|
||||
SELECT DISTINCT ON (prestudent_id) *
|
||||
FROM (
|
||||
SELECT
|
||||
prestudent.person_id, prestudent.prestudent_id,
|
||||
stg.studiengang_kz, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz,
|
||||
ROW_NUMBER () OVER (
|
||||
PARTITION BY prestudent.prestudent_id
|
||||
ORDER BY sem.start DESC, status.datum DESC, status.insertamum DESC, status.ext_id DESC
|
||||
) AS reihenfolge_semester,
|
||||
ROW_NUMBER () OVER (
|
||||
PARTITION BY prestudent.prestudent_id
|
||||
ORDER BY status.datum DESC, status.insertamum DESC, status.ext_id DESC
|
||||
) AS reihenfolge_datum
|
||||
FROM
|
||||
public.tbl_student student
|
||||
JOIN public.tbl_benutzer benutzer on(student.student_uid = benutzer.uid)
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester sem USING(studiensemester_kurzbz)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
benutzer.aktiv=true
|
||||
AND status.status_kurzbz='Student'
|
||||
) reihenfolge
|
||||
WHERE reihenfolge_semester <> reihenfolge_datum";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getFalscheAnzahlAbschlusspruefungen($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getFalscheAnzahlAbschlusspruefungen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -41,4 +49,77 @@ class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students with finished studies should have exactly one final exam.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getFalscheAnzahlAbschlusspruefungen(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
DISTINCT ON(pre.prestudent_id) pre.person_id, pre.prestudent_id, student_uid, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM lehre.tbl_abschlusspruefung
|
||||
WHERE student_uid = stud.student_uid
|
||||
AND abschlussbeurteilung_kurzbz != 'nicht'
|
||||
AND abschlussbeurteilung_kurzbz IS NOT NULL
|
||||
) AS anzahl_abschlusspruefungen
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
status_kurzbz = 'Absolvent'
|
||||
AND pre.bismelden
|
||||
AND stg.melderelevant
|
||||
AND NOT EXISTS ( /* exclude gs */
|
||||
SELECT 1
|
||||
FROM bis.tbl_mobilitaet
|
||||
WHERE prestudent_id = pre.prestudent_id
|
||||
AND studiensemester_kurzbz = status.studiensemester_kurzbz
|
||||
)";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
$qry .= ") studenten
|
||||
WHERE anzahl_abschlusspruefungen != 1";
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class FalscheAnzahlHeimatadressen extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getFalscheAnzahlHeimatadressen($studiensemester_kurzbz, $studiengang_kz);
|
||||
$personRes = $this->getFalscheAnzahlHeimatadressen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
@@ -39,4 +47,67 @@ class FalscheAnzahlHeimatadressen extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students should have exactly one home address.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getFalscheAnzahlHeimatadressen(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT person_id
|
||||
FROM
|
||||
(
|
||||
SELECT person_id, COUNT(adresse_id) AS anzahl_adressen
|
||||
FROM public.tbl_adresse addr
|
||||
WHERE heimatadresse IS TRUE
|
||||
GROUP BY person_id
|
||||
) adressen
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudent pre USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_student USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
anzahl_adressen != 1
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class FalscheAnzahlZustelladressen extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getFalscheAnzahlZustelladressen($studiensemester_kurzbz, $studiengang_kz);
|
||||
$personRes = $this->getFalscheAnzahlZustelladressen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
@@ -39,4 +47,67 @@ class FalscheAnzahlZustelladressen extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students should have exactly one delivery address.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getFalscheAnzahlZustelladressen(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT person_id
|
||||
FROM
|
||||
(
|
||||
SELECT person_id, COUNT(adresse_id) AS anzahl_adressen
|
||||
FROM public.tbl_adresse addr
|
||||
WHERE zustelladresse IS TRUE
|
||||
GROUP BY person_id
|
||||
) adressen
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudent pre USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_student USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
anzahl_adressen != 1
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,15 @@ class GbDatumWeitZurueck extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getGbDatumWeitZurueck($studiensemester_kurzbz, $studiengang_kz);
|
||||
$personRes = $this->getGbDatumWeitZurueck($studiensemester_kurzbz, $studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
@@ -39,4 +42,63 @@ class GbDatumWeitZurueck extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Birthdate is too long ago.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getGbDatumWeitZurueck(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pers.person_id
|
||||
FROM
|
||||
public.tbl_person pers
|
||||
WHERE
|
||||
pers.gebdatum < '1920-01-01'
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE person_id = pers.person_id";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
$qry .= ")";
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pers.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getInaktiverStudentAktiverStatus($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getInaktiverStudentAktiverStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -44,4 +52,62 @@ class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students with active status should have an active Benutzer.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getInaktiverStudentAktiverStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$aktStudiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
|
||||
|
||||
if (isError($aktStudiensemesterRes)) return $aktStudiensemesterRes;
|
||||
|
||||
$studiensemester_kurzbz = hasData($aktStudiensemesterRes) ? getData($aktStudiensemesterRes)[0]->studiensemester_kurzbz : '';
|
||||
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT(student.student_uid), prestudent.person_id, prestudent.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_benutzer benutzer
|
||||
JOIN public.tbl_student student on(benutzer.uid = student.student_uid)
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
benutzer.aktiv=false
|
||||
AND EXISTS (SELECT 1 FROM public.tbl_prestudentstatus WHERE prestudent_id = prestudent.prestudent_id AND studiensemester_kurzbz = ?)
|
||||
AND get_rolle_prestudent(prestudent_id, NULL) IN ('Student', 'Diplomand', 'Unterbrecher', 'Praktikant')
|
||||
AND stg.melderelevant
|
||||
AND prestudent.bismelden";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class IncomingHeimatNationOesterreich extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($studiensemester_kurzbz, $studiengang_kz);
|
||||
$personRes = $this->getIncomingHeimatNationOesterreich(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
@@ -39,4 +47,58 @@ class IncomingHeimatNationOesterreich extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getIncomingHeimatNationOesterreich(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT pers.person_id, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_person pers USING(person_id)
|
||||
JOIN public.tbl_adresse addr USING(person_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
status.status_kurzbz = 'Incoming'
|
||||
AND addr.nation = 'A'
|
||||
AND addr.heimatadresse
|
||||
AND status.studiensemester_kurzbz = ?
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pers.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,14 @@ class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getIncomingOhneIoDatensatz($studiengang_kz);
|
||||
$prestudentRes = $this->getIncomingOhneIoDatensatz($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -40,4 +43,54 @@ class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Incoming should have IN/OUT data.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getIncomingOhneIoDatensatz($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON(student_uid, nachname, vorname)
|
||||
tbl_person.person_id,
|
||||
tbl_prestudent.prestudent_id,
|
||||
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_student
|
||||
JOIN public.tbl_benutzer ON(student_uid=uid)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus ON(tbl_prestudent.prestudent_id=tbl_prestudentstatus.prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON(stg.studiengang_kz=tbl_student.studiengang_kz)
|
||||
WHERE
|
||||
bismelden=TRUE
|
||||
AND status_kurzbz='Incoming' AND NOT EXISTS (SELECT 1 FROM bis.tbl_bisio WHERE student_uid=tbl_student.student_uid)
|
||||
AND stg.melderelevant";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND tbl_prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getIncomingOrGsFoerderrelevant(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -41,4 +49,77 @@ class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Incoming or gemeinsame Studien students should not receive funding (not be förderrelevant).
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return object success or error
|
||||
*/
|
||||
public function getIncomingOrGsFoerderrelevant(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON(prestudent_id)
|
||||
pers.person_id,
|
||||
ps.prestudent_id,
|
||||
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_student stud
|
||||
JOIN public.tbl_benutzer ON(student_uid=uid)
|
||||
JOIN public.tbl_person pers USING(person_id)
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON(stg.studiengang_kz=stud.studiengang_kz)
|
||||
WHERE
|
||||
(
|
||||
status.status_kurzbz = 'Incoming'
|
||||
OR EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
bis.tbl_mobilitaet
|
||||
JOIN public.tbl_prestudent USING(prestudent_id)
|
||||
WHERE
|
||||
prestudent_id = ps.prestudent_id
|
||||
AND gsstudientyp_kurzbz = 'Extern'
|
||||
)
|
||||
)
|
||||
AND (ps.foerderrelevant <> FALSE OR ps.foerderrelevant IS NULL)
|
||||
AND bismelden=TRUE
|
||||
AND stg.melderelevant";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND ps.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getInskriptionVorLetzerBismeldung($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getInskriptionVorLetzerBismeldung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -48,4 +56,93 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students of a semester shouldn't start studies before the date of Bismeldung.
|
||||
* e.g. If student studies in WS2022 datum of status shouldn't be before 15.4.2020
|
||||
* e.g. If student studies in SS2022 datum of status shouldn't be before 15.11.2022
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getInskriptionVorLetzerBismeldung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
// get Bismeldedatum
|
||||
$datumBis = $this->_getBisdateFromSemester($studiensemester_kurzbz);
|
||||
|
||||
$params = array($datumBis, $studiensemester_kurzbz, $datumBis);
|
||||
|
||||
// get active students
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (student.student_uid) ? AS datum_bismeldung,
|
||||
prestudent.person_id, prestudent.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_benutzer benutzer
|
||||
JOIN public.tbl_student student on(benutzer.uid = student.student_uid)
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
benutzer.aktiv=true
|
||||
AND status.studiensemester_kurzbz = ?
|
||||
/* inscription date before date of first student status */
|
||||
AND (
|
||||
SELECT datum
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = prestudent.prestudent_id
|
||||
AND studiensemester_kurzbz = status.studiensemester_kurzbz
|
||||
AND status_kurzbz = 'Student'
|
||||
ORDER BY datum, insertamum, ext_id
|
||||
LIMIT 1
|
||||
) < ?
|
||||
AND stg.melderelevant
|
||||
AND prestudent.bismelden";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Bismeldedate from Studiensemester.
|
||||
* @param studiensemester_kurzbz string
|
||||
*/
|
||||
private function _getBisdateFromSemester($studiensemester_kurzbz)
|
||||
{
|
||||
$semesterYear = substr($studiensemester_kurzbz, 2, 6);
|
||||
$semesterType = substr($studiensemester_kurzbz, 0, 2);
|
||||
|
||||
if ($semesterType == 'SS')
|
||||
{
|
||||
return date_format(date_create(($semesterYear - 1)."-11-15"), 'Y-m-d');
|
||||
}
|
||||
|
||||
if ($semesterType == 'WS')
|
||||
{
|
||||
return date_format(date_create($semesterYear."-04-15"), 'Y-m-d');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,18 @@ class NationNichtOesterreichAberGemeinde extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getNationNichtOesterreichAberGemeinde($studiengang_kz);
|
||||
$personRes = $this->getNationNichtOesterreichAberGemeinde(
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
@@ -39,4 +46,49 @@ class NationNichtOesterreichAberGemeinde extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Nation is not Austria, but address has austrian Gemeinde.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getNationNichtOesterreichAberGemeinde($studiengang_kz = null, $person_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "SELECT DISTINCT tbl_person.person_id, adr.gemeinde, adr.adresse_id
|
||||
FROM
|
||||
public.tbl_adresse adr
|
||||
JOIN public.tbl_prestudent USING(person_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_student USING(prestudent_id)
|
||||
JOIN public.tbl_benutzer ON(uid=student_uid)
|
||||
JOIN public.tbl_studiengang stg ON tbl_prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
adr.nation!='A'
|
||||
AND tbl_benutzer.aktiv
|
||||
AND gemeinde NOT IN ('Münster')
|
||||
AND EXISTS(SELECT 1 FROM bis.tbl_gemeinde WHERE name = adr.gemeinde)";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND tbl_person.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getOrgformStgUngleichOrgformPrestudent($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getOrgformStgUngleichOrgformPrestudent(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -49,4 +57,74 @@ class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Orgform of a Studiengang in Studienplan should be the same as orgform of student.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getOrgformStgUngleichOrgformPrestudent(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
prestudent.person_id, prestudent.prestudent_id, status.studiensemester_kurzbz,
|
||||
studiengang.orgform_kurzbz AS stg_orgform, status.orgform_kurzbz AS student_orgform,
|
||||
prestudent.studiengang_kz AS student_studiengang, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_studiengang studiengang
|
||||
JOIN public.tbl_student student USING(studiengang_kz)
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_benutzer benutzer on(benutzer.uid = student.student_uid)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
LEFT JOIN lehre.tbl_studienplan stpl USING (studienplan_id)
|
||||
WHERE
|
||||
benutzer.aktiv = true
|
||||
AND status.status_kurzbz IN ('Student', 'Unterbrecher', 'Abbrecher', 'Diplomand', 'Absolvent')
|
||||
AND studiengang.studiengang_kz < 10000
|
||||
AND status.studiensemester_kurzbz = ?
|
||||
AND NOT (status.orgform_kurzbz IS NULL AND studiengang.mischform = FALSE)
|
||||
AND NOT EXISTS(
|
||||
SELECT 1
|
||||
FROM
|
||||
lehre.tbl_studienplan
|
||||
JOIN
|
||||
lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
WHERE
|
||||
tbl_studienplan.studienplan_id = stpl.studienplan_id
|
||||
AND tbl_studienordnung.studiengang_kz = prestudent.studiengang_kz
|
||||
AND tbl_studienplan.orgform_kurzbz = status.orgform_kurzbz)";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND studiengang.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
$qry .= "
|
||||
ORDER BY student_uid";
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,18 @@
|
||||
abstract class PlausiChecker
|
||||
{
|
||||
protected $_ci; // code igniter instance
|
||||
protected $_config; // configuration parameters for this plausicheck
|
||||
protected $_db; // database for queries
|
||||
|
||||
public function __construct()
|
||||
public function __construct($configurationParams = null)
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// load libraries
|
||||
$this->_ci->load->library('issues/PlausicheckLib'); // load plausicheck library
|
||||
// set configuration
|
||||
$this->_config = $configurationParams;
|
||||
|
||||
// get database for queries
|
||||
$this->_db = new DB_Model();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,12 +13,20 @@ class PrestudentMischformOhneOrgform extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getPrestudentMischformOhneOrgform($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getPrestudentMischformOhneOrgform(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -47,4 +55,55 @@ class PrestudentMischformOhneOrgform extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students in "mixed" Studiengang should have Orgform.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getPrestudentMischformOhneOrgform(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
status.status_kurzbz IN ('Bewerber', 'Student')
|
||||
AND stg.mischform
|
||||
AND (status.orgform_kurzbz='' OR status.orgform_kurzbz IS NULL)
|
||||
AND status.studiensemester_kurzbz=?";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,14 @@ class StgPrestudentUngleichStgStudent extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudent($studiengang_kz);
|
||||
$prestudentRes = $this->getStgPrestudentUngleichStgStudent($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -40,4 +43,48 @@ class StgPrestudentUngleichStgStudent extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Studiengang should be the same for prestudent and student.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getStgPrestudentUngleichStgStudent($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz prestudent_stg_oe_kurzbz, student_stg.oe_kurzbz student_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING(prestudent_id)
|
||||
JOIN public.tbl_person pers USING(person_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN public.tbl_studiengang student_stg ON stud.studiengang_kz = student_stg.studiengang_kz
|
||||
WHERE
|
||||
stud.studiengang_kz != pre.studiengang_kz";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,14 @@ class StgPrestudentUngleichStgStudienplan extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudienplan($studiengang_kz);
|
||||
$prestudentRes = $this->getStgPrestudentUngleichStgStudienplan($studiengang_kz, null, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -40,4 +43,62 @@ class StgPrestudentUngleichStgStudienplan extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Studiengang should be the same for prestudent and studienplan.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param studienordnung_id int if check is to be executed only for a certain studienordnung_id
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getStgPrestudentUngleichStgStudienplan(
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$studienordnung_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (ps.prestudent_id) ps.person_id, ps.prestudent_id, stordnung.studienordnung_id,
|
||||
stplan.bezeichnung AS studienplan, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent ps
|
||||
JOIN public.tbl_prestudentstatus USING(prestudent_id)
|
||||
JOIN lehre.tbl_studienplan stplan USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung stordnung USING(studienordnung_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_studiengang stg ON ps.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
ps.studiengang_kz<>stordnung.studiengang_kz
|
||||
AND stg.melderelevant";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND ps.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($studienordnung_id))
|
||||
{
|
||||
$qry .= " AND stordnung.studienordnung_id = ?";
|
||||
$params[] = $studienordnung_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,14 @@ class StudentstatusNachAbbrecher extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStudentstatusNachAbbrecher($studiengang_kz);
|
||||
$prestudentRes = $this->getStudentstatusNachAbbrecher($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -40,4 +43,48 @@ class StudentstatusNachAbbrecher extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* There shouldn't be any status after Abbrecher status.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getStudentstatusNachAbbrecher($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
prestudent.person_id, prestudent.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_student student
|
||||
JOIN public.tbl_prestudent prestudent USING(prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus prestatus USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON prestudent.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
prestatus.status_kurzbz = 'Abbrecher'
|
||||
AND get_rolle_prestudent(prestudent.prestudent_id, prestatus.studiensemester_kurzbz) <> 'Abbrecher'";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,20 @@ class StudienplanUngueltig extends PlausiChecker
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStudienplanUngueltig($studiensemester_kurzbz, $studiengang_kz);
|
||||
$prestudentRes = $this->getStudienplanUngueltig(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -48,4 +56,71 @@ class StudienplanUngueltig extends PlausiChecker
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Studienplan should be valid in current Ausbildungssemester of prestudent.
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getStudienplanUngueltig(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT pre.person_id, pre.prestudent_id,
|
||||
tbl_studienplan.bezeichnung AS studienplan,
|
||||
status.status_kurzbz,
|
||||
status.studiensemester_kurzbz,
|
||||
status.ausbildungssemester,
|
||||
stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN lehre.tbl_studienplan USING(studienplan_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
status_kurzbz in('Student', 'Interessent','Bewerber','Aufgenommener')
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
lehre.tbl_studienplan_semester
|
||||
WHERE
|
||||
studienplan_id=status.studienplan_id
|
||||
AND tbl_studienplan_semester.semester = status.ausbildungssemester
|
||||
AND tbl_studienplan_semester.studiensemester_kurzbz = status.studiensemester_kurzbz
|
||||
)
|
||||
AND status.studiensemester_kurzbz=?
|
||||
AND pre.bismelden
|
||||
AND stg.melderelevant";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND tbl_prestudent.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ class CORE_INOUT_0007 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/IncomingHeimatNationOesterreich');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($params['studiensemester_kurzbz'], null, $params['issue_person_id']);
|
||||
$checkRes = $this->_ci->incomingheimatnationoesterreich->getIncomingHeimatNationOesterreich($params['studiensemester_kurzbz'], null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Incoming should have IN/OUT data entry.
|
||||
*/
|
||||
class CORE_INOUT_0008 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_INOUT_0008 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/IncomingOhneIoDatensatz');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingOhneIoDatensatz(null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->incomingohneiodatensatz->getIncomingOhneIoDatensatz(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ class CORE_INOUT_0009 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/IncomingOrGsFoerderrelevant');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant(null, null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->incomingorgsfoerderrelevant->getIncomingOrGsFoerderrelevant(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Birth date of person shouldn't be too long ago.
|
||||
*/
|
||||
class CORE_PERSON_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_PERSON_0001 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/GbDatumWeitZurueck');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getGbDatumWeitZurueck(null, null, $params['issue_person_id']);
|
||||
$checkRes = $this->_ci->gbdatumweitzurueck->getGbDatumWeitZurueck(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Nation of person should be austria if Gemeinde (city) is austrian.
|
||||
*/
|
||||
class CORE_PERSON_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_PERSON_0002 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/NationNichtOesterreichAberGemeinde');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getNationNichtOesterreichAberGemeinde(null, $params['issue_person_id']);
|
||||
$checkRes = $this->_ci->nationnichtoesterreichabergemeinde->getNationNichtOesterreichAberGemeinde(null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Person should have only one home adress.
|
||||
*/
|
||||
class CORE_PERSON_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_PERSON_0003 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/FalscheAnzahlHeimatadressen');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlHeimatadressen(null, null, $params['issue_person_id']);
|
||||
$checkRes = $this->_ci->falscheanzahlheimatadressen->getFalscheAnzahlHeimatadressen(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Person should have only one delivery adress.
|
||||
*/
|
||||
class CORE_PERSON_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_PERSON_0004 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/FalscheAnzahlZustelladressen');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlZustelladressen(null, null, $params['issue_person_id']);
|
||||
$checkRes = $this->_ci->falscheanzahlzustelladressen->getFalscheAnzahlZustelladressen(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Studiengang should be the same for prestudent and student.
|
||||
*/
|
||||
class CORE_STG_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STG_0001 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/StgPrestudentUngleichStgStudent');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudent(null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->stgprestudentungleichstgstudent->getStgPrestudentUngleichStgStudent(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Orgform of a Studiengang in Studienplan should be the same as orgform of student.
|
||||
*/
|
||||
class CORE_STG_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,10 @@ class CORE_STG_0002 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/OrgformStgUngleichOrgformPrestudent');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getOrgformStgUngleichOrgformPrestudent($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->orgformstgungleichorgformprestudent->getOrgformStgUngleichOrgformPrestudent($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Students in "mixed" Studiengang should have Orgform.
|
||||
*/
|
||||
class CORE_STG_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,10 @@ class CORE_STG_0003 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/PrestudentMischformOhneOrgform');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getPrestudentMischformOhneOrgform($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->prestudentmischformohneorgform->getPrestudentMischformOhneOrgform($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Studiengang should be the same for prestudent and studienplan.
|
||||
*/
|
||||
class CORE_STG_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,10 @@ class CORE_STG_0004 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/StgPrestudentUngleichStgStudienplan');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudienplan(null, $params['prestudent_id'], $params['studienordnung_id']);
|
||||
$checkRes = $this->_ci->stgprestudentungleichstgstudienplan->getStgPrestudentUngleichStgStudienplan(null, $params['prestudent_id'], $params['studienordnung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Abbrecher cannot be active.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0001 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/AbbrecherAktiv');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAbbrecherAktiv(null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->abbrecheraktiv->getAbbrecherAktiv(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* There shouldn't be any status after Abbrecher status.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0002 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/StudentstatusNachAbbrecher');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStudentstatusNachAbbrecher(null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->studentstatusnachabbrecher->getStudentstatusNachAbbrecher(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Ausbildungssemester of prestudent (lehrverband) must be the same as Ausbildungssemester of prestudentstatus.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,14 @@ class CORE_STUDENTSTATUS_0003 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/AusbildungssemPrestudentUngleichAusbildungssemStatus');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAusbildungssemPrestudentUngleichAusbildungssemStatus($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->ausbildungssemprestudentungleichausbildungssemstatus->getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$params['studiensemester_kurzbz'],
|
||||
null,
|
||||
$params['prestudent_id']
|
||||
);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Students with active status should have an active Benutzer.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,14 @@ class CORE_STUDENTSTATUS_0004 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/InaktiverStudentAktiverStatus');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getInaktiverStudentAktiverStatus($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->inaktiverstudentaktiverstatus->getInaktiverStudentAktiverStatus(
|
||||
$params['studiensemester_kurzbz'],
|
||||
null,
|
||||
$params['prestudent_id']
|
||||
);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Students of a semester shouldn't start studies before the date of Bismeldung.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,10 @@ class CORE_STUDENTSTATUS_0005 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/InskriptionVorLetzerBismeldung');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getInskriptionVorLetzerBismeldung($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->inskriptionvorletzerbismeldung->getInskriptionVorLetzerBismeldung($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Status Dates and status studysemester dates should be in correct order.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0006 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0006 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/DatumStudiensemesterFalscheReihenfolge');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumStudiensemesterFalscheReihenfolge(null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->datumstudiensemesterfalschereihenfolge->getDatumStudiensemesterFalscheReihenfolge(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Students with active Benutzer should have a status in the current semester.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0007 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0007 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/AktiverStudentOhneStatus');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktiverStudentOhneStatus(null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->aktiverstudentohnestatus->getAktiverStudentOhneStatus(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Studienplan should be valid in current Ausbildungssemester of prestudent.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0008 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,10 @@ class CORE_STUDENTSTATUS_0008 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/StudienplanUngueltig');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStudienplanUngueltig($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->studienplanungueltig->getStudienplanUngueltig($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Students with finished studies should have exactly one final exam.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0009 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0009 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/FalscheAnzahlAbschlusspruefungen');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlAbschlusspruefungen(null, null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->falscheanzahlabschlusspruefungen->getFalscheAnzahlAbschlusspruefungen(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Date of final exam shouldn't be missing for Absolvent.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0010 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0010 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/DatumAbschlusspruefungFehlt');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumAbschlusspruefungFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
$checkRes = $this->_ci->datumabschlusspruefungfehlt->getDatumAbschlusspruefungFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Date of sponsion shouldn't be missing for Absolvent.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0011 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0011 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/DatumSponsionFehlt');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumSponsionFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
$checkRes = $this->_ci->datumsponsionfehlt->getDatumSponsionFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Bewerber should have participated in Reihungstest.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0012 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,14 @@ class CORE_STUDENTSTATUS_0012 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/BewerberNichtZumRtAngetreten');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getBewerberNichtZumRtAngetreten($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->bewerbernichtzumrtangetreten->getBewerberNichtZumRtAngetreten(
|
||||
$params['studiensemester_kurzbz'],
|
||||
null,
|
||||
$params['prestudent_id']
|
||||
);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Current Ausbildungssemester shouldn't be 0.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0013 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -17,10 +17,10 @@ class CORE_STUDENTSTATUS_0013 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/AktSemesterNull');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktSemesterNull($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->aktsemesternull->getAktSemesterNull($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
* Prestudent should have a final status.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0014 implements IIssueResolvedChecker
|
||||
{
|
||||
@@ -14,10 +14,10 @@ class CORE_STUDENTSTATUS_0014 implements IIssueResolvedChecker
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
$this->_ci->load->library('issues/plausichecks/AbschlussstatusFehlt');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAbschlussstatusFehlt(null, null, $params['prestudent_id']);
|
||||
$checkRes = $this->_ci->abschlussstatusfehlt->getAbschlussstatusFehlt(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user