mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Compare commits
3483 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e8e977eef | |||
| 94eb7021bb | |||
| ef8314c33a | |||
| e4ebdd59b6 | |||
| d1cc7244f7 | |||
| 2f5b90b9d5 | |||
| 9b90e0edde | |||
| 56e9b253d2 | |||
| c5c7123358 | |||
| 50e93fc9ba | |||
| 47ea1e848c | |||
| e0f99a8e88 | |||
| 63aebde7f2 | |||
| 62f5b66324 | |||
| ef08e39449 | |||
| c720c46125 | |||
| 597d4dbfec | |||
| d67cad925d | |||
| 2d9e9df8a0 | |||
| 6d6659f6e5 | |||
| 6512ad0f1c | |||
| f034a99928 | |||
| 40ae57fb0c | |||
| c113c80862 | |||
| 063cbcbf4f | |||
| 7e6805ca98 | |||
| 871534af52 | |||
| 0616236e00 | |||
| 4dd4d8aaa5 | |||
| f9ac824cc0 | |||
| 79ad8601da | |||
| 6b0526fb95 | |||
| 39d708aa61 | |||
| becbe5823c | |||
| ddfcef9ad7 | |||
| 4f5e49a93c | |||
| a3b5718422 | |||
| db048e876c | |||
| a4be020156 | |||
| 2149ed2384 | |||
| e6ef234c8b | |||
| 29c8e6fb19 | |||
| cf7e9921b5 | |||
| 887d9f9cbd | |||
| 7de3c4a24e | |||
| 11ff26d8e7 | |||
| 718272e8a1 | |||
| 3f891179aa | |||
| 56ef700ec8 | |||
| afc3cd0131 | |||
| 5536408065 | |||
| 5a77478071 | |||
| 293a8625e4 | |||
| 5266a6fe4d | |||
| 3485ee624c | |||
| 61c859f2e1 | |||
| b967f83dd4 | |||
| ad184f5c16 | |||
| 34d6b2d97a | |||
| 431ae8ddac | |||
| 0072d87f3b | |||
| d91789aee5 | |||
| 8280ec42b0 | |||
| d8766e8f7a | |||
| 91f141326a | |||
| a6907d1bc5 | |||
| 95027937bd | |||
| a86d35f731 | |||
| 1c511f9c66 | |||
| df639c8b07 | |||
| 80f80ab8e8 | |||
| 32b73b7287 | |||
| 98bcbda53e | |||
| ba1f3da02f | |||
| 994d523258 | |||
| 213f20eab3 | |||
| 2bb58e24cc | |||
| 53cf777970 | |||
| 48512f46ab | |||
| da78332a92 | |||
| 83a76d06b6 | |||
| cfd24dd8bc | |||
| ea5d2bc6f8 | |||
| 8468d881f1 | |||
| 5041999b4b | |||
| 8bab5285e9 | |||
| 76cdaefdc7 | |||
| 033af68343 | |||
| f725594f0c | |||
| f460a909d9 | |||
| 054574f9fb | |||
| 597aa1aa4e | |||
| 7c57f5a308 | |||
| 50439ee6cc | |||
| 016d4a1927 | |||
| 112e30ab39 | |||
| 7e0acdbf45 | |||
| 391a4753d5 | |||
| c6686f56f6 | |||
| 1c2937dfb6 | |||
| 841b4736a9 | |||
| c79ff24c89 | |||
| 77a1067ea5 | |||
| d33af0ae21 | |||
| 7726c3ce21 | |||
| 5a970c3f2e | |||
| abcc1269eb | |||
| c849b5defa | |||
| d75939a8f8 | |||
| 3ee81ae6e7 | |||
| d1f684f0b3 | |||
| d8e57d43f9 | |||
| 5c9710f44d | |||
| 257038a2d1 | |||
| 4dabc642ed | |||
| afb3ce4cae | |||
| be2b578f82 | |||
| 17519eac83 | |||
| 89ec51bd0a | |||
| 0372853df2 | |||
| dc603375ec | |||
| aa84bdec1e | |||
| eb1c3189b5 | |||
| 6d27c3f6e2 | |||
| 93e25bb5fc | |||
| a413b6c779 | |||
| f0e0bdc082 | |||
| 60661d3457 | |||
| 41bb99b5ea | |||
| 054b9fdee3 | |||
| 61faf5386a | |||
| 6b4f5778c2 | |||
| 060f11f1d8 | |||
| cdc1933ce4 | |||
| 239a9c89d7 | |||
| 4964a2c06d | |||
| ce5e3131c1 | |||
| 7eee6d51aa | |||
| 1666ba82b2 | |||
| e54e83f718 | |||
| d916c6ab31 | |||
| be35fd5313 | |||
| dd92c815da | |||
| d76e84639f | |||
| 6357aca656 | |||
| d001e3c168 | |||
| d88f2a0a48 | |||
| 6378e75c37 | |||
| e22344e9dd | |||
| 0ed11a02a5 | |||
| 23d1104602 | |||
| bab15bc5b2 | |||
| 1cc77c8eba | |||
| 2f2c7d0d92 | |||
| e837101651 | |||
| e4a7955239 | |||
| 92030ca697 | |||
| 53424999dc | |||
| a59f90112d | |||
| ad7012367c | |||
| 03b3182000 | |||
| 126aa890c4 | |||
| 4762154bbc | |||
| c9506adc10 | |||
| f281925874 | |||
| 1c319addc5 | |||
| dbfa64a436 | |||
| 366d48b836 | |||
| 0a53ca49aa | |||
| 284633012f | |||
| 63eda8b934 | |||
| de012b290b | |||
| dbf9547f9c | |||
| 65df13ca9f | |||
| 1d786d3e16 | |||
| 339639cc6e | |||
| 993dff3351 | |||
| 0a118a1427 | |||
| 4ab0c0a44e | |||
| e36e86fd50 | |||
| d99d1c5ca0 | |||
| 43281c6ba2 | |||
| cd574cd12c | |||
| 95f1c66684 | |||
| 5d957e38ae | |||
| 7566e8aac2 | |||
| 7fdfa94d11 | |||
| 77604c5e15 | |||
| 84b9b08d28 | |||
| a9e90cf10d | |||
| b31ebf3412 | |||
| 00eac334c0 | |||
| 775d865878 | |||
| d2b1eb4645 | |||
| f15932964f | |||
| 5678c18619 | |||
| 74a00a4ce0 | |||
| 1c5d3d7c78 | |||
| 1ac9c9b6cb | |||
| 303f29ebdb | |||
| 383590fa6b | |||
| 0d449d60c2 | |||
| 5ecd81bb09 | |||
| 1cdebbe977 | |||
| a97a176522 | |||
| 327e849fc6 | |||
| ede2e1710e | |||
| f54ad298fa | |||
| 5e1fc3abf7 | |||
| 819a7ef219 | |||
| d815176bab | |||
| 4e01420ce0 | |||
| 683360b13a | |||
| 9042caa06b | |||
| 9668c67197 | |||
| 84610faedc | |||
| 8c4a163671 | |||
| 9e40c6b21f | |||
| 67d41f1df9 | |||
| 6011109132 | |||
| cc3da1439d | |||
| c97e1b6453 | |||
| 72403e0960 | |||
| e91b829c25 | |||
| c56fd038b8 | |||
| 24c014e8dd | |||
| 608dab1e65 | |||
| fe1433a19c | |||
| 8c83e08472 | |||
| 0893ec30d9 | |||
| 0417afeea8 | |||
| 9601c8bdd2 | |||
| 146bb5f336 | |||
| 9e4401d441 | |||
| aa43a2f32c | |||
| d6c4e0db41 | |||
| 398478e575 | |||
| 17540070a1 | |||
| d923f30ccf | |||
| 3c910d03bb | |||
| fc16a9e4c6 | |||
| 9699684946 | |||
| 06b562786d | |||
| 539c78166f | |||
| 5a0134c6cc | |||
| a8535e6e0f | |||
| 5677142b0b | |||
| 565640c73b | |||
| 3c9a52e389 | |||
| 3e52ea39d5 | |||
| 2b53eb327f | |||
| 406b93a628 | |||
| 4be0a831a1 | |||
| 9ed3251e55 | |||
| 94d5e8f780 | |||
| 5baf8b645f | |||
| 11daf96850 | |||
| 752ef8a57b | |||
| 8ddc2f02fe | |||
| 1623c8e51c | |||
| 9a8fbabbe4 | |||
| 6337869098 | |||
| 1423579a49 | |||
| 87ec4fd482 | |||
| 6e9969d9e4 | |||
| 4407310f40 | |||
| 4495632393 | |||
| 9fa7166c84 | |||
| 1fbca8bdab | |||
| a9670fce5c | |||
| e7788fc18f | |||
| 11205e9ec1 | |||
| 343964750b | |||
| 0201bac046 | |||
| 2aee86baba | |||
| 9d306fcb7e | |||
| fed45015bd | |||
| 07bcbee11b | |||
| 440477d249 | |||
| b9cb8f9cce | |||
| f483e87455 | |||
| 5be4e5e0f7 | |||
| 6bf823b4cf | |||
| 2c3843fce6 | |||
| 0fa8b6bc32 | |||
| c79e329439 | |||
| 5fbcc60c67 | |||
| e11d72ace0 | |||
| e4943e0bb8 | |||
| 4054a0cfee | |||
| da43c88567 | |||
| b681ca29c1 | |||
| 5f57c53ed0 | |||
| 8a1ca9a598 | |||
| 9927667086 | |||
| ba0dd5341f | |||
| a1d616ff03 | |||
| 309faaae06 | |||
| 1c21e8f88d | |||
| 5640f229d3 | |||
| 1340e762c3 | |||
| 9309a48e97 | |||
| b22c6c10e4 | |||
| 60a1d40048 | |||
| 8c6033fed6 | |||
| 3a6fb08350 | |||
| 00696bfa20 | |||
| 666a6ea42c | |||
| 81725a0fe9 | |||
| 35b37dec55 | |||
| a2d2025e4c | |||
| 0d51df95f9 | |||
| bfd513a475 | |||
| 3d50eacdc3 | |||
| 4e4269033b | |||
| 9d2b147248 | |||
| d148eaed11 | |||
| 7b1bb27b34 | |||
| 2f20ddaefa | |||
| ba7cfc3890 | |||
| ecbb6744a7 | |||
| deebe987d3 | |||
| cb77f3148a | |||
| cb64c83b50 | |||
| ac5ce1573a | |||
| 57345940ef | |||
| 10b6641aa2 | |||
| 1414d5f1ef | |||
| 81e705f297 | |||
| 9a74ab9c63 | |||
| 8fdabcb317 | |||
| f9e2d784cf | |||
| f518d56d4e | |||
| 93fa0ed180 | |||
| 3551172c0b | |||
| 795378bf40 | |||
| 76e6874a1a | |||
| 3c47453762 | |||
| 4fa2de5105 | |||
| ca55c8b1a7 | |||
| 2ede54b60e | |||
| 9db14effdc | |||
| 5c66dfad49 | |||
| 8403384cc2 | |||
| 4a55b73461 | |||
| 159904b8ad | |||
| 245e4a3028 | |||
| 0df9cf769f | |||
| 464b99b3f9 | |||
| e908215b05 | |||
| a021c85920 | |||
| 6047b19f47 | |||
| e5778acf9d | |||
| 58b942f044 | |||
| 2ef2948a6e | |||
| e3b6852017 | |||
| 0f43e8eb7a | |||
| 6abdb25c0a | |||
| 5efad50b62 | |||
| 6199283698 | |||
| 3f0f48a4e0 | |||
| eaec76c3d2 | |||
| 0cb36c2d30 | |||
| a533294121 | |||
| b5d44de0b4 | |||
| 60d09bd2a7 | |||
| 2b91ae87c0 | |||
| efcc4b8ea5 | |||
| c07697c541 | |||
| c69877ed85 | |||
| 8e7a1a2ddd | |||
| f97951966c | |||
| ef56af6337 | |||
| 3f5801f6ed | |||
| d062e8903f | |||
| 41143a6dfc | |||
| 0577f3f8b9 | |||
| 473715c25c | |||
| 566938d4f0 | |||
| 41dbd83bdb | |||
| 6a31eade8b | |||
| 57531d956d | |||
| 5b42c438d0 | |||
| e80cfc207e | |||
| af94cb1e40 | |||
| 8ae5ce27ce | |||
| bbfaf447f5 | |||
| dff8223d3e | |||
| aca4195df6 | |||
| 7e40e34212 | |||
| fe8bdbd0e4 | |||
| cef581178c | |||
| 34eb373061 | |||
| cb5623d228 | |||
| 379270c296 | |||
| 7f7488e61e | |||
| 651452d821 | |||
| 69a1e945b3 | |||
| 9e6ae4f5a4 | |||
| c498119b6c | |||
| e589aff1f3 | |||
| bdfd3d86de | |||
| 2c60dcb0a9 | |||
| edf2eca348 | |||
| bc318e79f5 | |||
| f0d9a43733 | |||
| 1adf1622db | |||
| 92ba45a84d | |||
| 776222fd11 | |||
| b8d197d923 | |||
| 3cbec91c2a | |||
| 012ae4ac62 | |||
| d9c716a62b | |||
| 97f72caf90 | |||
| e3ccb76e9b | |||
| 0ae0ceb5d9 | |||
| 6658e80d99 | |||
| 087fb6a702 | |||
| ee6e7f3a48 | |||
| 112211fb0b | |||
| 20f7c2e841 | |||
| 849a850e71 | |||
| b7d9edc85d | |||
| c9f8df8d98 | |||
| 41773fb6f0 | |||
| 632e7d74e5 | |||
| 06a41e24d6 | |||
| 3a06dc613f | |||
| af32f65015 | |||
| 4c3f9e42b9 | |||
| 86bbfe42db | |||
| c9425a0061 | |||
| 455698b28e | |||
| b95dd49d0e | |||
| 14d49d87b3 | |||
| 708e03bda3 | |||
| 14cca2b4cc | |||
| a2ff98b299 | |||
| 20f936c22c | |||
| eee9d6b691 | |||
| d015b208fc | |||
| 56e74fc365 | |||
| ff061a3e95 | |||
| 1b76b852cf | |||
| 5889bdb6ea | |||
| 6fb06397be | |||
| a1f305aa51 | |||
| 8bba492ec1 | |||
| 707a900ee4 | |||
| ed747fe07c | |||
| 10d58d1a42 | |||
| fd2ff27e22 | |||
| 594333889d | |||
| 2c3754b33f | |||
| 174ed990a7 | |||
| d027e62e75 | |||
| 61cfb175e3 | |||
| eae7ac1f15 | |||
| bf83b71585 | |||
| ab70968bfc | |||
| 86641ea02d | |||
| eae79e9f5e | |||
| b378649b06 | |||
| edce5716fd | |||
| 8e4f2143f2 | |||
| 0782de0550 | |||
| 022fb26e92 | |||
| 988ce11528 | |||
| fc845ebf4e | |||
| e0a3df5d06 | |||
| 0095595dd2 | |||
| 396251b061 | |||
| 374c1b66b5 | |||
| fa6d651b21 | |||
| 05a3c40a9e | |||
| 0d1cf2b043 | |||
| 34528bb014 | |||
| db61320b8c | |||
| f18de90c67 | |||
| 014d2b68ae | |||
| 4bc58ee946 | |||
| d17f87be09 | |||
| 3cdb391a6d | |||
| 7b187ebadd | |||
| 7df383f45e | |||
| 1d634a2530 | |||
| 1024fc6cab | |||
| 3a5c4444cb | |||
| 9a35ee5945 | |||
| 2d2bbd1bb3 | |||
| 41d26246aa | |||
| 7e6643c0ff | |||
| e2147c8f1f | |||
| e366556992 | |||
| f1c9e641bb | |||
| 1ef884de8c | |||
| 045b764d65 | |||
| e79b7a525f | |||
| d7c56ad05d | |||
| d8eac58ab1 | |||
| c6d04c7490 | |||
| ce432d4c43 | |||
| 866d95c4b8 | |||
| 1025a8b461 | |||
| 67290a5af8 | |||
| 531fae8ab5 | |||
| ce9a4e2e09 | |||
| 11868d9496 | |||
| fb9f2e86fc | |||
| 9b8ac595c6 | |||
| 608e2b5171 | |||
| 7de81fab7d | |||
| c9104749c5 | |||
| 5ba0007641 | |||
| 923427b41f | |||
| 31a5caa558 | |||
| b73eac62b5 | |||
| 6ee3f1d241 | |||
| ad83228396 | |||
| 905a2dadff | |||
| 1c86a6ad55 | |||
| a482016dee | |||
| 2198ea95e4 | |||
| ef80a19a24 | |||
| ca3f8bc554 | |||
| c5001f87bd | |||
| ba7f59de24 | |||
| 9707258e62 | |||
| eb8c3213df | |||
| f50171ad9a | |||
| 42a81a4558 | |||
| f695d8b66a | |||
| 6d7429eb8e | |||
| b9e3c47be9 | |||
| 5119858c12 | |||
| ed00c8d0ae | |||
| 83d98c258e | |||
| a42e70e2fe | |||
| aaf9e8c885 | |||
| 729618cbe7 | |||
| aa3e1ad1d1 | |||
| 1092463beb | |||
| e46f46c95b | |||
| 4d78abf9ec | |||
| 33fbbde99f | |||
| 79506319a0 | |||
| bbf147ec39 | |||
| a51f587da7 | |||
| e11ff91b53 | |||
| d4f5a7c92f | |||
| 34a239a823 | |||
| 645da5a5bf | |||
| 50b2334e5c | |||
| e7f58ca1ba | |||
| 3749955d5b | |||
| 4eab58177a | |||
| 3e69495842 | |||
| 2402693116 | |||
| 5e7514ffff | |||
| 57bc4d7b92 | |||
| 80f1edca8f | |||
| 3fad0fd69a | |||
| 8e6a103340 | |||
| c8c3361783 | |||
| 03397b7272 | |||
| 3c3038362a | |||
| c109d84492 | |||
| 9ae78f2de6 | |||
| f6432cdcd0 | |||
| 04cce2af4c | |||
| 8c797fb212 | |||
| b2d8b81ab5 | |||
| 73d269d54b | |||
| d071d0d9fe | |||
| 8494033bda | |||
| 2b7f56622c | |||
| 4f2499862f | |||
| 8048b9d9c3 | |||
| 954cd16d10 | |||
| 9e3ebca0a4 | |||
| 2faafea462 | |||
| 9ad2198b02 | |||
| 8104d77399 | |||
| c96db9f573 | |||
| 42a40072fa | |||
| 0605baf68f | |||
| 49ddf568e1 | |||
| 9de0a41035 | |||
| 8a1cbd754d | |||
| 555a4f01c2 | |||
| 603622a3f1 | |||
| 6391e58f74 | |||
| aded9067e5 | |||
| e241b586a8 | |||
| 133e1f08f6 | |||
| 41a46aa7b2 | |||
| 70274eef3a | |||
| c728f60ec5 | |||
| b4a1720a94 | |||
| d33f493543 | |||
| db30fa0d96 | |||
| 043c9fd5f3 | |||
| 8f44a8b33e | |||
| 2a9432d076 | |||
| 72bb465ecf | |||
| 30cc798c0b | |||
| 52e0535312 | |||
| 459d445f2f | |||
| ecc7e4672f | |||
| b8de311015 | |||
| f57e27fae0 | |||
| 0516fa2ff5 | |||
| cba5b39e29 | |||
| cc91fe7588 | |||
| e9807a210b | |||
| 4a69204384 | |||
| 9b396088c3 | |||
| b76bdfa431 | |||
| e727c03a42 | |||
| 648dca3eba | |||
| 8bcd0961f6 | |||
| 384dcd8411 | |||
| 9cbb612c8f | |||
| 42e31af94c | |||
| 89c64cadc7 | |||
| be24190636 | |||
| 502942deb3 | |||
| 405f7a551e | |||
| 02a52d1aee | |||
| 6714432c30 | |||
| 9999cb47c2 | |||
| 5329fadbac | |||
| a429b20823 | |||
| 37b67641ef | |||
| 66caf47d98 | |||
| 497e839963 | |||
| 219507ffa3 | |||
| e326c9483d | |||
| cf073d04b4 | |||
| 8472813246 | |||
| 472fceaf62 | |||
| 247de82e81 | |||
| 5d07879ebd | |||
| 66e27b3bb2 | |||
| 1cb637cb7f | |||
| 913b218fca | |||
| 5a9972a85f | |||
| 0d514ad482 | |||
| 562eb0a890 | |||
| 38fe68362d | |||
| 6217309c6f | |||
| 7755e2c7a6 | |||
| 9c1eb35e88 | |||
| 25da0d6865 | |||
| 9a231d4bb4 | |||
| 9c3c8cd186 | |||
| c4bb543c0a | |||
| 4d3ad0008e | |||
| bc7c811227 | |||
| 9a5790edf0 | |||
| f9f0748b89 | |||
| 2f10a3a3e9 | |||
| f12db529e0 | |||
| c876179762 | |||
| fa97116ec4 | |||
| 16db622bc9 | |||
| 2755a194eb | |||
| ee13cfadba | |||
| 79720a77c2 | |||
| a7698b9af8 | |||
| ba23a6496c | |||
| 4e7ae928b5 | |||
| 62aa022c69 | |||
| cb1ff2ef1a | |||
| 91624a3e53 | |||
| 1005963179 | |||
| 386ae59428 | |||
| 30b895ad04 | |||
| 868c15f47d | |||
| b0f8b316af | |||
| 3cd00a5e5f | |||
| ee5391f11a | |||
| 602a572518 | |||
| 2442c16eeb | |||
| c1ca8c78af | |||
| d262c5106c | |||
| fd04b26af4 | |||
| 31fb649cac | |||
| d76a5965db | |||
| 4d1c4bf7ab | |||
| dcb9fad0d2 | |||
| cc0572b386 | |||
| 5e0ef4ebab | |||
| 24df22ba24 | |||
| e2df03debf | |||
| 1b8ab88820 | |||
| d59b623cb4 | |||
| 58a85432ca | |||
| 76248175f7 | |||
| d101b53d3d | |||
| 53e395aca4 | |||
| 611a6204cd | |||
| 1d63b8de44 | |||
| c0e2a156d5 | |||
| d5f2f3d787 | |||
| d024d57ef5 | |||
| 3a8984a8c3 | |||
| ccb4a72ae4 | |||
| 96cb546b68 | |||
| 715b48c39f | |||
| 6994591a10 | |||
| b1fe60aab0 | |||
| 92bd09355b | |||
| ae725c08a9 | |||
| 0be83eedef | |||
| 8f73404307 | |||
| 66fd2e65a4 | |||
| d648f79ca5 | |||
| 4ead590732 | |||
| 132ab686c9 | |||
| 36fd2dcd90 | |||
| 72df2cb79c | |||
| db07f33e3c | |||
| 07ba21ff3e | |||
| 1b2d5ff6c6 | |||
| a13deed13f | |||
| 6c57c17eb5 | |||
| 9ddb9f46fd | |||
| ad080e61b2 | |||
| 0a9f4023b3 | |||
| f9a45a4917 | |||
| 9855a0b45d | |||
| 117a284dc4 | |||
| fa090153f2 | |||
| b4f1a8a56c | |||
| a0721fcd9a | |||
| 4524b9bcdc | |||
| 75adcefd51 | |||
| 9d809cf843 | |||
| 7726850193 | |||
| 91bb167c42 | |||
| 20e8964274 | |||
| f1971659b4 | |||
| 4e4a7a3880 | |||
| ff104461af | |||
| e25687be52 | |||
| f1e28cec4e | |||
| f4f59b2fff | |||
| 5ed2595222 | |||
| 90c30f21c1 | |||
| 4ae1ab88dc | |||
| 07d610d60f | |||
| a22041007c | |||
| d122a5e72d | |||
| 9fa23a1471 | |||
| 952f98de82 | |||
| 8191c5e19f | |||
| 94e25da6c8 | |||
| 1883e8a6f1 | |||
| 2f5a7addbd | |||
| 78a735f277 | |||
| 26b40866fc | |||
| 99f9509134 | |||
| c36459b508 | |||
| 1ff3f7b66d | |||
| 430da0b236 | |||
| c61f87a8d5 | |||
| ba3914c1c3 | |||
| f210bb8bbd | |||
| 90b944a047 | |||
| 0aef00bd9e | |||
| 01a3dc1fd0 | |||
| 1f258c84d4 | |||
| caa70715ad | |||
| a737dc20dc | |||
| 81280a5e91 | |||
| 2222199b95 | |||
| 133a611d0e | |||
| 08404a9440 | |||
| c69be4762e | |||
| c91b2481eb | |||
| c3d0f03704 | |||
| 325cbf9314 | |||
| 9e06f1468a | |||
| 77e5dfeb9a | |||
| da9f00fff0 | |||
| 4eaf71e5c6 | |||
| 4872792890 | |||
| 7aa074cdf6 | |||
| cb48c1e5e3 | |||
| 9fe7dd069f | |||
| 3ed2bb4d78 | |||
| a1fe2e1b4b | |||
| c9cced3f61 | |||
| 9d341cc045 | |||
| c89b88ec1b | |||
| 12cdf5a83e | |||
| 22afddc2ae | |||
| 1bf49ad7ab | |||
| 31fbaaa017 | |||
| 28e42163a1 | |||
| 75a93523e0 | |||
| c2cc1c5870 | |||
| 5bda4db592 | |||
| 1c8ffa786e | |||
| 2deef8039d | |||
| 5279ac9868 | |||
| dba435dafb | |||
| 6f3759d95d | |||
| 129b8b2e49 | |||
| 7039719700 | |||
| 08a394cad0 | |||
| 8138e23e71 | |||
| 153e273fec | |||
| d526a770c5 | |||
| abbeec11fc | |||
| 8ce672d914 | |||
| 1a0374bf18 | |||
| 3f9564b686 | |||
| e4fc936991 | |||
| 2262169699 | |||
| ddea3afde4 | |||
| 411fd8d056 | |||
| ca9eea6134 | |||
| b1ab0ddf18 | |||
| cfe76e09b1 | |||
| 7bd0b39f77 | |||
| 4937c1190a | |||
| 5280943099 | |||
| aca49114be | |||
| 5b2b715a16 | |||
| 101636e9fc | |||
| 88adb8b139 | |||
| d47fd105ed | |||
| a0e4c3d93b | |||
| d48865d2a1 | |||
| c8e7adc074 | |||
| 475290e3ef | |||
| b46c0147a0 | |||
| e659e8e12c | |||
| 549f7867ae | |||
| 3e924b62a6 | |||
| 014a034ce8 | |||
| 7fc98bd6a4 | |||
| 919471d067 | |||
| 4b26067380 | |||
| ac1335a50d | |||
| 5ddc4749fa | |||
| 31f0be35c8 | |||
| 0df082af1f | |||
| b3c05f2fe1 | |||
| 56bfe46675 | |||
| bf1dac3fd9 | |||
| 9315503ec1 | |||
| c353e854e8 | |||
| e9614e8ca8 | |||
| 34220a8f39 | |||
| 986d1cfb5f | |||
| 83ac1abcf6 | |||
| 9c30b5438f | |||
| ed17e87afd | |||
| 5b10c87e9b | |||
| 1c73fdc83c | |||
| 98f1cd7465 | |||
| 1c29bcd685 | |||
| 414e4c9565 | |||
| 19ef7c2ce1 | |||
| fbb00a2616 | |||
| 239eace246 | |||
| e3fe20831e | |||
| 0adf7ee9dc | |||
| 9610ca55f7 | |||
| d64f5610c9 | |||
| 444f7aec48 | |||
| 4dbffc3527 | |||
| af2aa416aa | |||
| c9cc86fdbd | |||
| aec0162c01 | |||
| 057288a4a5 | |||
| 7c251cafc7 | |||
| c2ce61d885 | |||
| daf9d2ea15 | |||
| 4b8af46a2e | |||
| cbc9a87a47 | |||
| c3ec34a038 | |||
| e385a06b73 | |||
| b344b5925a | |||
| fd2de106f8 | |||
| 7b627484c2 | |||
| e99cbc9f3d | |||
| cc40fd4393 | |||
| 7233bc3cdd | |||
| 301818be69 | |||
| 8c1c56077e | |||
| f7c03b29db | |||
| b217118df4 | |||
| d76e3feb2a | |||
| b9a920e498 | |||
| 9426ed9e59 | |||
| be6f5b6772 | |||
| ce8f0843cc | |||
| 08182fe0f5 | |||
| 2ec20423e9 | |||
| 5645f6a41f | |||
| 5bf8f647cb | |||
| ad7e473cbd | |||
| d00530d6d6 | |||
| cf62563fa3 | |||
| b96a7ab180 | |||
| 4d61cdeb91 | |||
| 30e4459f67 | |||
| 1d9936757c | |||
| b46da92f25 | |||
| 04d46b39ed | |||
| 819ef7bc32 | |||
| 0202bb261f | |||
| 0b00e393da | |||
| bc79fe2dd6 | |||
| a2250fc727 | |||
| 4f56d799ac | |||
| 707a05f6cd | |||
| cac58a0fc2 | |||
| cb87b072b3 | |||
| 37701dbdfd | |||
| 96e032bad9 | |||
| 913211e84d | |||
| 6e9650ddfa | |||
| 85c16b7f5d | |||
| 23e32a51b2 | |||
| ae10ac877f | |||
| d558240459 | |||
| 52c4ac64f1 | |||
| d3b3c9db41 | |||
| 1c7d339e14 | |||
| 4db21d9abb | |||
| 2b3d772a90 | |||
| 3db82aea95 | |||
| a080daa27a | |||
| e8d6d751e6 | |||
| fa20652fef | |||
| 0aa92debea | |||
| f596f16255 | |||
| b6cb9b356f | |||
| 329da58ce6 | |||
| cb2ed4696c | |||
| 5140d9de31 | |||
| 0804c5670e | |||
| 66ccd83b55 | |||
| 688f87e2ba | |||
| 02df06288e | |||
| ce47579870 | |||
| 9ed68648f6 | |||
| 57b0ae12d5 | |||
| 2aa3e7704f | |||
| f321e07731 | |||
| 1e32bc211b | |||
| 1f8d87587d | |||
| 9e0bad76ac | |||
| d15d27b3e1 | |||
| 7b5b6992c7 | |||
| e4100f5fb0 | |||
| 44c5b1dd5e | |||
| cd26667707 | |||
| 3a7e14a95f | |||
| 40a0affed9 | |||
| fce55e38ae | |||
| 3adaf8a528 | |||
| 982373d03b | |||
| 565925abb2 | |||
| 06c822fd84 | |||
| aed293f93d | |||
| e133f67de2 | |||
| f017f096f1 | |||
| 43c868000c | |||
| 44b538885f | |||
| 57d71be792 | |||
| eb35701280 | |||
| 7d91976704 | |||
| bd5925e1d6 | |||
| 596535b1b9 | |||
| 074403abf5 | |||
| 0f9c98dded | |||
| dc4f8bc640 | |||
| ab059e9099 | |||
| 90273f64c1 | |||
| d6f92d23a0 | |||
| 7929a6b74b | |||
| d83eb42a23 | |||
| 45b9bae0b0 | |||
| 77ccfa46de | |||
| 29f968f308 | |||
| 49c510537a | |||
| d2e8505689 | |||
| e26bce2cf7 | |||
| 6f5fa9624f | |||
| 83d3f515de | |||
| c080d1abb2 | |||
| a786dec9c1 | |||
| 9faccfa328 | |||
| 6d7f8522f3 | |||
| 970e950894 | |||
| 2821339c0a | |||
| 68b6402981 | |||
| 826dd52450 | |||
| e89233d6ac | |||
| fe81e7fb7c | |||
| c85e902b97 | |||
| d1264c7e5a | |||
| 7da8a9ed79 | |||
| 96274a2a4a | |||
| fb01629ec1 | |||
| 02dd466cc3 | |||
| 7e90771f89 | |||
| a2dee4d6ba | |||
| 3e3fa9c1eb | |||
| 3ff0f55cc0 | |||
| 750b956dd2 | |||
| 96fcff3ade | |||
| f233b33093 | |||
| c62b587299 | |||
| 8810657a61 | |||
| 9a7cba0717 | |||
| ba1ef83ba6 | |||
| 0da195810b | |||
| b885a8c72d | |||
| 42b750e120 | |||
| cb1f6e2e5f | |||
| 9d48b6ac57 | |||
| 3cebbc9fba | |||
| 8bcf01d1bb | |||
| 4d3d06e1d6 | |||
| cfa391677e | |||
| a5bb72baf6 | |||
| a756881a48 | |||
| c9b555db77 | |||
| bbf0d044fd | |||
| f96bfbe000 | |||
| 5ee72fd836 | |||
| 4f8c408a8a | |||
| 390434050e | |||
| 0ee5cc09cd | |||
| a0fb34420e | |||
| b40e1a2c65 | |||
| 4daf73ee6d | |||
| a52fcf1570 | |||
| 5d241b050a | |||
| 660f195c57 | |||
| 9b0e0fe135 | |||
| 867afa4411 | |||
| 69e05ccb38 | |||
| fa0b534471 | |||
| b5bacbbf75 | |||
| ad8963e5b5 | |||
| fce63eb31b | |||
| 94f0d43c4a | |||
| deec52b959 | |||
| 126b2d388b | |||
| 4c6c45ceec | |||
| 80faf92dc2 | |||
| d686ec0885 | |||
| a387533dc3 | |||
| f8438ee115 | |||
| 1ca5bd5691 | |||
| 12ca915b00 | |||
| c3e978b56e | |||
| 7e83df51a8 | |||
| a99cc96682 | |||
| f6dd79b9a3 | |||
| ede656845a | |||
| f5a3598c39 | |||
| 66e5384de6 | |||
| 55419c50f7 | |||
| c26bb98960 | |||
| d677cee1f9 | |||
| a1423c33e5 | |||
| 8786b60c4c | |||
| 375d56960a | |||
| 1faab59716 | |||
| 1ac6e50784 | |||
| 5d7d532396 | |||
| 5ed1bae456 | |||
| c861278aa8 | |||
| 2297055949 | |||
| bf3127d518 | |||
| 10f731f2e2 | |||
| b498da8603 | |||
| fc30222289 | |||
| cd99ba7fdc | |||
| 9b9351fe9b | |||
| 02701dc0c5 | |||
| a2b77411cb | |||
| 7d4fda4fe6 | |||
| e9a373afb8 | |||
| 1222d33e6e | |||
| af1364faef | |||
| 2db7f812ab | |||
| 8b89d6f1cb | |||
| d1c2cf8e64 | |||
| da118cbf0a | |||
| 4e945648d0 | |||
| 310bd08648 | |||
| bc4514b2a0 | |||
| 4a10faeb25 | |||
| df108482eb | |||
| 7548d7b55f | |||
| 168e2890c7 | |||
| 4cf2ef2927 | |||
| 382006aa8b | |||
| 875a788476 | |||
| c04c08bca4 | |||
| a858049e15 | |||
| a40f304d8d | |||
| ebcb33b316 | |||
| b8d0037e16 | |||
| ce2bd3c75d | |||
| 7b9b1a762e | |||
| 53f2776efe | |||
| 3c08bc12cd | |||
| 6e56de1790 | |||
| 2417d1549e | |||
| a72dcdf8b0 | |||
| dab628a72d | |||
| 8e2fd6e61c | |||
| ed2a467926 | |||
| 419341f496 | |||
| a94b52dbc6 | |||
| 12415279d1 | |||
| 4bceddcc82 | |||
| d3dc81eae8 | |||
| a99721bb22 | |||
| 233e768aad | |||
| a6180b3d59 | |||
| 9d4568e15e | |||
| 405062f549 | |||
| b62c063a43 | |||
| 7d095b4998 | |||
| b5d3bf3f1e | |||
| 05de9cd94a | |||
| 2ee7742ada | |||
| 6ab50654ba | |||
| 0930866beb | |||
| 7030d5b822 | |||
| 884a5e41ac | |||
| 6dfa7089e7 | |||
| eae44bc634 | |||
| 9b895fbd23 | |||
| 24b19a1d8b | |||
| 7d3ffdde7b | |||
| d791a6d3ef | |||
| 38424bc875 | |||
| c24a9997a9 | |||
| 3b7a862dbe | |||
| 5856f1c2ae | |||
| edcd2aa1df | |||
| bf0cd8e8e3 | |||
| a5ab2f1381 | |||
| 54e8a855f4 | |||
| 97d83d3acf | |||
| 2ab01132b1 | |||
| 9410388a7a | |||
| d48a0b62fd | |||
| a196da03d2 | |||
| ed6b9310ae | |||
| a4777724dc | |||
| eaaf5de9c0 | |||
| e28067259b | |||
| 854223a2d7 | |||
| 91910ef538 | |||
| 8442a3d758 | |||
| d780b472a6 | |||
| 3200a94d17 | |||
| 874c91e21c | |||
| 65c398498f | |||
| b9bd0e53d8 | |||
| 08b27edd64 | |||
| 2b9805aeb3 | |||
| 2d87663841 | |||
| 0c95dbad1f | |||
| 34eb2ab80c | |||
| 8c00158d04 | |||
| da86575e65 | |||
| ced54d76d5 | |||
| 7b30869f7c | |||
| 47917e42c3 | |||
| d4012232ab | |||
| c98d0a9c45 | |||
| ac5e95e6b9 | |||
| 59f83c33b0 | |||
| 3f607ec241 | |||
| 5abc48f568 | |||
| b323f91999 | |||
| 99587fd064 | |||
| b67b19bd1a | |||
| 26d7d17169 | |||
| b2a7ec6e67 | |||
| 9c5ebc902d | |||
| af30a3408c | |||
| 19f169aca2 | |||
| fc0a09180a | |||
| 1888c51a48 | |||
| ad93a0a84c | |||
| 3669e0df40 | |||
| 26bf1e33d4 | |||
| e8a233e503 | |||
| 1cb29ce8bb | |||
| 6b6ec311c7 | |||
| 8218c915d5 | |||
| 88c4a04aea | |||
| a25ccd79b2 | |||
| d4ae8b0f91 | |||
| 54bbfacf86 | |||
| 59ebd33ba6 | |||
| 31c1b087e5 | |||
| 9f94c8fafd | |||
| a5b8e7dc8b | |||
| f7138b2cfc | |||
| 7f7a423e65 | |||
| 75338a89c7 | |||
| 3c3e2ae662 | |||
| 4ee239dd62 | |||
| a0a2ac41bf | |||
| 90ce3e0263 | |||
| 204ae75f57 | |||
| bcc712e900 | |||
| 8788cf17e2 | |||
| 419c199e84 | |||
| 9b9b8b1532 | |||
| f45e0105b0 | |||
| d75e26f8ae | |||
| 242cee2b62 | |||
| 48a9ca0ff4 | |||
| cbd3c86e59 | |||
| 49cfeddfa2 | |||
| 93689e3906 | |||
| 958577902d | |||
| 01b3d4580e | |||
| b2fef71b47 | |||
| 4d1fc5e48c | |||
| 92a05c4711 | |||
| bef3e88e92 | |||
| f826c20949 | |||
| 1991418931 | |||
| 8c0325b693 | |||
| 9572bdf3eb | |||
| 97782b7f1d | |||
| 315b763380 | |||
| b41baad89d | |||
| cc51e7f04a | |||
| 2a2e2ea193 | |||
| a54f7531bf | |||
| 97e34948e5 | |||
| 33f800fa28 | |||
| 7345dd258d | |||
| 8a7290359a | |||
| 702a84a25d | |||
| e809e48262 | |||
| 232da256ac | |||
| 51f4e1e57d | |||
| b4b2d8da49 | |||
| 86158e6f28 | |||
| 7c61ee55c2 | |||
| 5197037126 | |||
| ba806c13fb | |||
| 95856c9e4d | |||
| 1e2a4d202f | |||
| 0113c9d97a | |||
| b32f60874c | |||
| 78c23699d5 | |||
| 8178368113 | |||
| 392c15da77 | |||
| 727b951bbc | |||
| 08cb4a7970 | |||
| b52993f7cc | |||
| c780b29732 | |||
| f55c309692 | |||
| c569af6d0f | |||
| ce54cf3c9c | |||
| fae299847e | |||
| 742ae40d98 | |||
| 1cdf89e405 | |||
| ab36d567b8 | |||
| 4c38d88840 | |||
| 75ad88eb24 | |||
| 7126ab4561 | |||
| 5d39d5ec46 | |||
| 45b7a56c3a | |||
| 9f06fbcf93 | |||
| 80c326360f | |||
| a6ee6a8c0f | |||
| 92db886a9f | |||
| 45f3acf922 | |||
| 08e38078a0 | |||
| ff311ddaa8 | |||
| 410231a427 | |||
| 0735c61361 | |||
| 7936e08d3d | |||
| 3f605e7051 | |||
| a3e22da633 | |||
| fb2f8d5c53 | |||
| b18b3b62a7 | |||
| 2a4f1af69f | |||
| b8417869b5 | |||
| b75c9cc524 | |||
| 2759bb0309 | |||
| 0a2bd1bdde | |||
| 19fdefc398 | |||
| f6352211f2 | |||
| 0dd1e4a628 | |||
| 3b8b8d7882 | |||
| 7b4f0f9dff | |||
| 2901847788 | |||
| a0ce635c7e | |||
| 669752dd90 | |||
| dc51e9bd85 | |||
| 129637cf4f | |||
| ff65852643 | |||
| ea2be8026b | |||
| ed2f895d8b | |||
| f219a19dec | |||
| 639c7d7e41 | |||
| f8eb265eb0 | |||
| 1f5925e860 | |||
| b9823a0278 | |||
| 2b4ccab2f1 | |||
| fad5f8b9d0 | |||
| 1989e65d72 | |||
| d349a64ca8 | |||
| 21e3169d8d | |||
| 740a473c8d | |||
| 83fe68c04e | |||
| c84ffdf893 | |||
| eedbab21a2 | |||
| 3a83d468ef | |||
| 85ef49bb62 | |||
| aab0dd7fc7 | |||
| bd7669ff5b | |||
| 00b766cb69 | |||
| 663ff947b0 | |||
| 11ba9c9911 | |||
| f942836453 | |||
| 2cbbcc9039 | |||
| 14f64401e5 | |||
| a4d2a2cace | |||
| 97ee1f8144 | |||
| ba2014b1a3 | |||
| c22118a26c | |||
| c677c48b00 | |||
| 44777e2f1b | |||
| 415e759586 | |||
| 188e6db759 | |||
| 588834d73f | |||
| fe4c14f75f | |||
| 45fd48a50e | |||
| d39dfbc41b | |||
| e69a9eeadb | |||
| eb958d19c8 | |||
| 358480600e | |||
| d5eae17ba5 | |||
| b1b0d5edd0 | |||
| 93ff868501 | |||
| 825ccfcc37 | |||
| 701c57966f | |||
| c2691f867d | |||
| 8320de66bc | |||
| 815307e392 | |||
| 2b16d8940f | |||
| 091aa1917b | |||
| f471321b98 | |||
| 1944152d13 | |||
| e4317f7a94 | |||
| 9aa8c33e83 | |||
| 20fc528107 | |||
| b8239b0842 | |||
| 20f22d5a7b | |||
| 225d6b0a83 | |||
| c028a769cc | |||
| 50ec93f5c1 | |||
| e61b6b447c | |||
| a408c85fd4 | |||
| 98fa76ca1d | |||
| 037811c24c | |||
| da9afa5c67 | |||
| 409a70bdf9 | |||
| 05a6109c27 | |||
| b50a4a16d1 | |||
| b8c45cf244 | |||
| 1fbc552d30 | |||
| bc7dba1c14 | |||
| 4a01198e10 | |||
| 28f11d7550 | |||
| a63c321f97 | |||
| c07c4ef4c9 | |||
| 45c929cb90 | |||
| b348119488 | |||
| f9f185bfef | |||
| e2b1dad776 | |||
| 9b68bfd336 | |||
| 80b67ad416 | |||
| 9acc2a8a9d | |||
| 55312848a3 | |||
| 737c9937c9 | |||
| 30c4245861 | |||
| 9bd5f6dcb6 | |||
| 00b77d726c | |||
| 8e697515bc | |||
| 1cecdcb8ef | |||
| fe98eb2784 | |||
| c833b40527 | |||
| 973b011f36 | |||
| e635d5e0e1 | |||
| fe1971a1d3 | |||
| ecd5e95f2d | |||
| bad19ccde7 | |||
| 881b7fb789 | |||
| ab20943493 | |||
| ba594a320b | |||
| 9876976c70 | |||
| 3c34b17d2d | |||
| ebbec03de4 | |||
| 7a0a2d756d | |||
| b989eae461 | |||
| 844c31885e | |||
| 3d467524e4 | |||
| 400ba2d7f9 | |||
| 1d9ea5d091 | |||
| dd2a13d92d | |||
| 2946d59e7a | |||
| 7c57a145bd | |||
| 661be92fed | |||
| 37f86f651e | |||
| 40f64cc979 | |||
| 5cb09c8e7b | |||
| 11e8ffb22c | |||
| 157ffd00f2 | |||
| bbd70749fe | |||
| f89c194d32 | |||
| 714d74d9aa | |||
| b817458222 | |||
| cb42ba110e | |||
| 8e76d93a5a | |||
| e086da2274 | |||
| e2e537b09c | |||
| d45a41b949 | |||
| 9fb2ea4ae3 | |||
| a557cd8d7c | |||
| b89eef0525 | |||
| c960b4832d | |||
| 57eec9b940 | |||
| 7083955702 | |||
| 48ef35c0e9 | |||
| f6f06c4d5e | |||
| b01400d21c | |||
| 92ba4aea9a | |||
| 7fed1d231c | |||
| 3a1055d87e | |||
| bb69e07340 | |||
| ff8d1c78fd | |||
| 350980c5df | |||
| cff606815e | |||
| ee0e5fe40e | |||
| ff60de5772 | |||
| 470eac7d3c | |||
| 40db480489 | |||
| 43e3fdcc46 | |||
| 4de9441699 | |||
| 47293a81d3 | |||
| 139a2f900f | |||
| 2d5309f97d | |||
| de895362be | |||
| 92f3f0d89c | |||
| 2f47cc7966 | |||
| 9bcd566bee | |||
| a6e0f10f32 | |||
| 480bef3b0d | |||
| e6edd42737 | |||
| 60e12e1ab7 | |||
| 09aae4c82b | |||
| d8438b4f4c | |||
| a9e3a85d99 | |||
| 8525c82305 | |||
| bcb88c0cb7 | |||
| ca187efce4 | |||
| bdb312cf56 | |||
| 2b27b55f40 | |||
| f25a969a6b | |||
| fe4351fc87 | |||
| eabe8ef401 | |||
| 36d3af91f1 | |||
| ae3072be92 | |||
| df685133b5 | |||
| 4936cfd61c | |||
| deea005f5b | |||
| 4ccbdecc48 | |||
| bc48445304 | |||
| 83baa0ed8b | |||
| bca95bcb66 | |||
| f653c2c054 | |||
| 72649f4177 | |||
| 5ae9a99de4 | |||
| 5ec886e815 | |||
| 21ecbf482f | |||
| acc57bbebd | |||
| 3db367b255 | |||
| 6ac91dc016 | |||
| cb46dff548 | |||
| 83321ac2ab | |||
| 4fe801ddf9 | |||
| a507533f40 | |||
| 0cca508881 | |||
| fc06ffe0e5 | |||
| 3ce803684a | |||
| e4e6849351 | |||
| 2008fc2a15 | |||
| 422ce28703 | |||
| 018220594a | |||
| 9d0e365516 | |||
| 3fff535713 | |||
| 9745621975 | |||
| a0ddde4978 | |||
| e901d414a0 | |||
| 61ec4ce6c1 | |||
| 4410baf7ac | |||
| 99c3403009 | |||
| b198b6a961 | |||
| b8823052f5 | |||
| 40d2a657c6 | |||
| 7c8508da0e | |||
| d038119a3b | |||
| d889756302 | |||
| 9ec57b6ce7 | |||
| d70cd58698 | |||
| a1841a0071 | |||
| 1436d12a53 | |||
| b177420cb1 | |||
| faeb0fbf4b | |||
| 749c147f8e | |||
| 6eb9c2ac22 | |||
| 7fbff20dd9 | |||
| 9082c3cb8c | |||
| cc5a14ea02 | |||
| c56c71a508 | |||
| 50fa3d6f94 | |||
| 03c192cbbf | |||
| b10ee208ff | |||
| 63239b3fb6 | |||
| 1a0601ebc0 | |||
| 5843d1d58e | |||
| 0059bc11f3 | |||
| fbd02e02f1 | |||
| ac98420130 | |||
| 11ad8ae1c8 | |||
| c1918726df | |||
| dbd7adc96c | |||
| 0892b94c93 | |||
| ec46dbd10d | |||
| ecbc1c8d09 | |||
| 07194cfaff | |||
| 3eb1f7b06b | |||
| 304433d76f | |||
| 7cf0060e40 | |||
| f2917b9ed7 | |||
| 51ba1d3fb9 | |||
| 9cd7caa6ba | |||
| 42a09ffa9e | |||
| b855c404e4 | |||
| 062e6e5f90 | |||
| 10c718b78c | |||
| 06dcad755b | |||
| 5b12e5eea7 | |||
| e068abd124 | |||
| d7cbe475bf | |||
| 7f645b363f | |||
| 402691b5cd | |||
| 6a2a4c22b3 | |||
| 0426e3498f | |||
| 9a53880b9d | |||
| 9a4211c980 | |||
| dacde5f5fd | |||
| d906e9b4a3 | |||
| bd3eeff684 | |||
| ad0fccab6a | |||
| 9a3221e88e | |||
| 4cd1bc3d63 | |||
| 8991ab86a5 | |||
| 4258e60b8b | |||
| 9816521291 | |||
| 7f6744047f | |||
| 39c2e44719 | |||
| a89ca4e143 | |||
| d96cc5672e | |||
| 519aa2f9b2 | |||
| 872f883ce1 | |||
| 637a7b1d17 | |||
| db70a7869c | |||
| a60ce78d18 | |||
| 2b5d23782b | |||
| ec23974129 | |||
| e53dae24e6 | |||
| 8afc2ab433 | |||
| b079d22e8d | |||
| 467072b94e | |||
| 38a083742d | |||
| c69910a338 | |||
| d6abfbbc23 | |||
| 87220e1789 | |||
| d2cce86131 | |||
| c5d79f750e | |||
| 9b348aed11 | |||
| e7df262cc5 | |||
| af79090de0 | |||
| 8ce4b452ec | |||
| 8133d73cff | |||
| 9350838ebc | |||
| 39ada20277 | |||
| 10e4032718 | |||
| de8a206f27 | |||
| 4c46a5f5c7 | |||
| 065f6bdede | |||
| bb8ebdd465 | |||
| c7f3398b11 | |||
| e9b01b7fa8 | |||
| 781e2dbd15 | |||
| d72bc4fa44 | |||
| d9532d7607 | |||
| 1853e44cf3 | |||
| 381b6a75db | |||
| e65322965f | |||
| 899c36c52c | |||
| 71d1a808f8 | |||
| ff0ee68229 | |||
| 08cb3d3809 | |||
| 0d99cc35d4 | |||
| 0ec3ba8e69 | |||
| 1489706027 | |||
| 103df5afe5 | |||
| ba2b41f63a | |||
| 4b2a1cd7f6 | |||
| 46c033ad77 | |||
| aef0e34b93 | |||
| f381ef229e | |||
| ece4f4a8b5 | |||
| 09b2615d82 | |||
| f1234c0b99 | |||
| 7b46db7100 | |||
| f60f735fa8 | |||
| fd67974d55 | |||
| bae7b330f8 | |||
| a1a9e96bc0 | |||
| aab0f339ab | |||
| cf57fe5086 | |||
| d4bb06c4f6 | |||
| 0770ec2bd8 | |||
| 13d86edcfc | |||
| 516554c1e3 | |||
| 50aca4a545 | |||
| cf32974652 | |||
| 6c858141fd | |||
| 907107d78d | |||
| 16097edfca | |||
| 05cbe495fe | |||
| 6b169d4183 | |||
| 14d4e103a3 | |||
| 478588aef0 | |||
| 03ad3116f7 | |||
| d9375e2c8b | |||
| 848d50ec93 | |||
| 036aeb5215 | |||
| 2fdca1f09f | |||
| 115b35ad7b | |||
| b20965fcff | |||
| 50f55eed1a | |||
| a67cc8cc4e | |||
| 26348bed80 | |||
| e432501a1f | |||
| 6361d40356 | |||
| 46914e8a65 | |||
| c7ee2934a7 | |||
| 5a45b29bcd | |||
| b43df5aea0 | |||
| 0a97b39efb | |||
| 574301d9e2 | |||
| 469c01c9e6 | |||
| e13e612ad9 | |||
| 174816e652 | |||
| d899bf3393 | |||
| 14eb27ae24 | |||
| de9e3d079c | |||
| 551fd3a860 | |||
| 64ff94882b | |||
| c980dee96b | |||
| 114562909f | |||
| e2af00e41d | |||
| 39a23693ba | |||
| ba62abc19b | |||
| 8bc1aec764 | |||
| 1094219a58 | |||
| 313a6a6030 | |||
| faa705408d | |||
| 9f5b3b6f32 | |||
| e1327453f7 | |||
| 636a331ca6 | |||
| e3f91003b3 | |||
| d247150fd6 | |||
| b78382f1ba | |||
| a802e67faf | |||
| 2c91756a36 | |||
| 25dbee7266 | |||
| 0509137ad8 | |||
| b4cd5055d2 | |||
| cb6fca9a2e | |||
| 701f44c767 | |||
| 0d2882d8aa | |||
| f62108f1d4 | |||
| 986b6934d6 | |||
| 499e3077e2 | |||
| 98d4a08836 | |||
| 746f8ab35a | |||
| 70b44c2202 | |||
| c0d2474ad2 | |||
| 5a174e554a | |||
| 3451741327 | |||
| a3840d4c77 | |||
| 9a1777d1aa | |||
| 4a86a48969 | |||
| 1f01c55d71 | |||
| 80222b7186 | |||
| d0266e7ef0 | |||
| 8f07bd6b4d | |||
| 3039fd2a1e | |||
| 7bd9129056 | |||
| 24ff474cad | |||
| 5b3ffcfc9a | |||
| 4321a2325b | |||
| 03d8205722 | |||
| 1d5f13c5ce | |||
| df8d4de50b | |||
| 9af3f1ec0f | |||
| 82e7783259 | |||
| 85d59f18be | |||
| 6a1e518da1 | |||
| 8127091e2e | |||
| e215e9e948 | |||
| a357001648 | |||
| bfc6e86f05 | |||
| 3c8bb37a36 | |||
| 2567db7725 | |||
| fcbb9e43a4 | |||
| 034e1397e8 | |||
| 35ded7950f | |||
| a6a74cd1e0 | |||
| bae48fa175 | |||
| 94f4761163 | |||
| cc99d2b378 | |||
| 53de29f3d2 | |||
| e9d02c41ff | |||
| 04583d0cf2 | |||
| cbdd6bc954 | |||
| a1045586fe | |||
| e9d2234353 | |||
| ce2d69fc82 | |||
| 9fd0f43d3b | |||
| 07ee3e1f4e | |||
| 39ffd6bdb9 | |||
| 0a5c335602 | |||
| 6fdad1b664 | |||
| 3969ebfa01 | |||
| 797e52aad7 | |||
| 5fd14949fa | |||
| 482f6b9a19 | |||
| 7f6884b67d | |||
| f0e97c915b | |||
| ecbb65c2a4 | |||
| f7bc01e63f | |||
| 65c154054d | |||
| 27cd9dca6b | |||
| 00fba24936 | |||
| 57cba02559 | |||
| 3cea79cb28 | |||
| e159dc44dc | |||
| 055cea2002 | |||
| a3dc5aec93 | |||
| f105bdb36a | |||
| af3334f227 | |||
| 1b445005af | |||
| 16e7ee8aba | |||
| 2fee03ebcc | |||
| d30ba24d2f | |||
| 7cff70e88d | |||
| 631010821b | |||
| b34a7bfabc | |||
| 6a1af1b2dd | |||
| fe6f229d9f | |||
| 6f69046b71 | |||
| 19b56ff252 | |||
| 446a5732d2 | |||
| af2f3348b4 | |||
| 41ad440cd4 | |||
| 1a1ed49f8b | |||
| 2ae9e4fffa | |||
| d67e240b06 | |||
| bf5e8e9c0e | |||
| e63234e7bc | |||
| 00d64f2c97 | |||
| ae58cef816 | |||
| 1ca0f35d29 | |||
| 1336860ecd | |||
| 278e5d8abd | |||
| 90ae50ac59 | |||
| 95e59007cc | |||
| 857d4d7282 | |||
| 7a7c91b67b | |||
| 9cf6036926 | |||
| cf6cc97475 | |||
| bf6b6e4563 | |||
| 11eae29dab | |||
| 0f476b4e46 | |||
| 677d6e97d6 | |||
| 021a140dd3 | |||
| 4f8ca679fb | |||
| 9dfa8d13a6 | |||
| 71c39edd66 | |||
| 1346466f79 | |||
| beb40cfcc9 | |||
| 0a4d8bb1f6 | |||
| 9024b43f62 | |||
| e8ded1f59f | |||
| b549622f50 | |||
| b2477bb603 | |||
| 3ec748e6fb | |||
| c94a2d2d0c | |||
| 1159b0dad5 | |||
| 39f1f825a5 | |||
| f398a5699f | |||
| 6e1943928a | |||
| ffe28ea8fb | |||
| 490a658e6d | |||
| fd91a4cb85 | |||
| 800d7ba005 | |||
| 3318147ba0 | |||
| 89539d59fd | |||
| 1ba857b524 | |||
| 0ebc6e820c | |||
| 24740d055e | |||
| c02c1e9955 | |||
| 3457309d63 | |||
| c32f65bc1e | |||
| 82f1a70de5 | |||
| 8983af4aef | |||
| 290da9f2c0 | |||
| 7fe3a7c8f5 | |||
| 766bec887a | |||
| 5f61ae43f9 | |||
| 90bdb68175 | |||
| 0bec551174 | |||
| f90f5154a0 | |||
| 2ed24ca60f | |||
| 699595e891 | |||
| 43fbd1d8f1 | |||
| 9c32e6f968 | |||
| 36c129fcaf | |||
| df0ed6715c | |||
| 28e4454409 | |||
| 334fc870d0 | |||
| 6f1e61fa00 | |||
| 1297a8a23a | |||
| 8e51071997 | |||
| ecab3ea4d9 | |||
| 14169fafd0 | |||
| 9c503ae66f | |||
| e2b42de6b3 | |||
| f4d16af68e | |||
| ab15a8675c | |||
| 20abd6aa05 | |||
| 4bd4301873 | |||
| fa3d36e99e | |||
| bb724bef6e | |||
| 16cfb0a3eb | |||
| 1a6b30588d | |||
| b0fb045b50 | |||
| fc5ea9f4db | |||
| f2b5c12e6d | |||
| 61728f3044 | |||
| a349a179d0 | |||
| d400f34e0f | |||
| cdc9e08cd0 | |||
| 94255709c7 | |||
| 8eb7d18ff9 | |||
| 920bd845f8 | |||
| 933ca20e65 | |||
| 763d038b4c | |||
| 6946028d76 | |||
| 4e857c9e4e | |||
| 7a0690227c | |||
| d17c776905 | |||
| 222f31c464 | |||
| 155e8da35a | |||
| b63146a8d8 | |||
| e94e9ceff2 | |||
| 8a22eab0c8 | |||
| 95ebc442a4 | |||
| ae94daa4a6 | |||
| 933af94344 | |||
| 8614e4301f | |||
| e0e123f264 | |||
| ad01c8bdeb | |||
| 8593fda5cd | |||
| e76d8fb85d | |||
| a5dd639404 | |||
| fe7ca2bf69 | |||
| 5369c95e77 | |||
| b189ac8cd0 | |||
| 7466e414f8 | |||
| 3896aa73ea | |||
| f6319aa845 | |||
| 9420e22b2a | |||
| 778149880f | |||
| 2c98438096 | |||
| a2bdca5551 | |||
| 05c52e41eb | |||
| 00406c50a5 | |||
| 5e9e08d65e | |||
| d8af18673c | |||
| c32046002d | |||
| df054a7088 | |||
| 4e4e8a0a5c | |||
| ad7b43f8a8 | |||
| f82c669475 | |||
| d2466b032a | |||
| 8d01995722 | |||
| 3cb9e5b4f8 | |||
| 5d5b2e5bc4 | |||
| 4cb3521361 | |||
| 46ef02b54d | |||
| 9c6509b32a | |||
| d6bdad27b2 | |||
| 4aed321b5e | |||
| 06dab52461 | |||
| 6fc7fd7788 | |||
| 13e77c8154 | |||
| b6a5e9b845 | |||
| ad31e73212 | |||
| 5596c12af9 | |||
| e044641600 | |||
| 65c9d5a84c | |||
| 545a9c31e4 | |||
| 2b98a35f59 | |||
| d650587418 | |||
| 96ec9aa8aa | |||
| 1b8980a0e2 | |||
| 1e5d7e01af | |||
| 78f216f9ad | |||
| 16cba022e2 | |||
| 488847984e | |||
| daf432fe8d | |||
| 3146f0795f | |||
| 87657a18f1 | |||
| 6e8aea7feb | |||
| d9f33a279d | |||
| fdcef8bdab | |||
| 65d0e89f06 | |||
| 45fca04029 | |||
| eccd827c71 | |||
| da465fffb1 | |||
| 5705cd2d66 | |||
| ef21936975 | |||
| 6b828179b0 | |||
| ebedb30c29 | |||
| 8da27a5c77 | |||
| 681fb18222 | |||
| f159d6e2a7 | |||
| 3fff0c5325 | |||
| 160294bea4 | |||
| a682d6e5ae | |||
| 9042f9b83b | |||
| cad2756613 | |||
| 2fd39a9d18 | |||
| 329a418be3 | |||
| e3cbbfa365 | |||
| c85790b637 | |||
| 5d524c5fda | |||
| 6613b0ea40 | |||
| a94d8d8fa5 | |||
| 3c966e00ba | |||
| e43a890aff | |||
| 59f8f91af9 | |||
| b0cd599999 | |||
| 1cdf1e7896 | |||
| c244b3ad1b | |||
| 6b04dff4a3 | |||
| f265e20dce | |||
| c691d155c9 | |||
| 3046c29ae2 | |||
| 6cf7a8e35e | |||
| add9263d35 | |||
| 35691b39c4 | |||
| 85bec1e0e3 | |||
| 094a3ed56a | |||
| bd1ce9fa63 | |||
| bd54399cfd | |||
| b7e89ab557 | |||
| 0e49dfaba0 | |||
| 96335a7979 | |||
| 355652cdb1 | |||
| 45bc65d32a | |||
| ca7ded38d2 | |||
| f304e79ee0 | |||
| 68042c1c77 | |||
| b9690988e5 | |||
| 1691c75a84 | |||
| 2ed5df8c1c | |||
| f4176b86ee | |||
| da70c77a2b | |||
| 72c992569c | |||
| 6732063e6a | |||
| b65d17e7ae | |||
| f82ed6928a | |||
| f68d18f0a8 | |||
| 4f2992fbe2 | |||
| 8c689418f7 | |||
| 2b516d40c9 | |||
| 39cedfe6a0 | |||
| 8316290b31 | |||
| 02a5465708 | |||
| e3119ee48c | |||
| 7653bc3e29 | |||
| d0cf86585a | |||
| 37dffbba19 | |||
| 3a13226298 | |||
| 2ff7c9f582 | |||
| b27564ea0f | |||
| a9fe52d3c6 | |||
| 20e0e2e910 | |||
| 835adca419 | |||
| 50880c696b | |||
| a65e94bc8a | |||
| 20715d6ef5 | |||
| c31cef349c | |||
| 50a67a8e88 | |||
| eafbdcfffe | |||
| 9c637b8575 | |||
| 86ee48888a | |||
| 9e45394deb | |||
| ad068ffe5f | |||
| 93ac45308f | |||
| 0916d34767 | |||
| 34c6c63c74 | |||
| f820a0148a | |||
| 8d00a9b4c9 | |||
| e78c2e1bf7 | |||
| d4f3fbfc79 | |||
| c5b81c22f9 | |||
| 837cc191bf | |||
| 9b4fb2ac2c | |||
| 6b991c514e | |||
| bdfea1763d | |||
| 587a193a6b | |||
| ec9e73180d | |||
| ff367339ea | |||
| ae80c3415d | |||
| 1e55b13546 | |||
| b9ccafe9db | |||
| 5f078a76c6 | |||
| 3eb2100b3d | |||
| fbf0417269 | |||
| b801401d2b | |||
| 46c4a30408 | |||
| 963391ec99 | |||
| b1f4e5487d | |||
| 084a13316d | |||
| a9a18d1cd4 | |||
| 6fc5714fdf | |||
| 74cf0ad173 | |||
| e387671e09 | |||
| 32137479e9 | |||
| 2398ca1962 | |||
| 9eb91574c3 | |||
| 2edfd1febc | |||
| 4789bfab42 | |||
| 0779bc5204 | |||
| e283997293 | |||
| e89beb610d | |||
| 805ed20a18 | |||
| f59bdf812a | |||
| 384de674c0 | |||
| fa0fe2a952 | |||
| 8787558fef | |||
| 8ba2a6852b | |||
| c763e332d8 | |||
| f3851da10d | |||
| dcb24415fc | |||
| 2e3bc855aa | |||
| 728e2f9b3a | |||
| 690080035a | |||
| d8c4c6506a | |||
| b8ff37eb8e | |||
| 9cd59a1250 | |||
| 289c99a5a1 | |||
| cf77a60b35 | |||
| 0775fae67d | |||
| 071b0c72dc | |||
| 44b81d9dff | |||
| 7ce426abc2 | |||
| 501784aba1 | |||
| 5cee80ed12 | |||
| 8ba370d3a7 | |||
| 59df85b05e | |||
| 909b9f5f5a | |||
| 236c4bbdfc | |||
| 755e8dd222 | |||
| c80e943b3b | |||
| d4494836b1 | |||
| a04b2725f9 | |||
| 0ab1ec1fc8 | |||
| e475fe568e | |||
| 2f448ca2bc | |||
| 38bf664b02 | |||
| 24ce443e95 | |||
| 439ae5113d | |||
| d913bf40d8 | |||
| 14aa98c223 | |||
| e2cee7ffa3 | |||
| 5774cb78c9 | |||
| 27e3f1d1bc | |||
| 301466f944 | |||
| 9ed08fb40c | |||
| 2893f2ec5a | |||
| b0e96fbab1 | |||
| 0528f3b262 | |||
| 123f29a750 | |||
| 322544c7fb | |||
| 462857080b | |||
| c67e78d135 | |||
| 4f9591fc3b | |||
| c444e27d0d | |||
| ed1d4b1a50 | |||
| 9fd02460ce | |||
| 1c61217891 | |||
| bf1bc8d1a9 | |||
| f9e72832c9 | |||
| 5359539a09 | |||
| d2ed82cb37 | |||
| f3fa2fa2dd | |||
| 469867e98c | |||
| bf8085f642 | |||
| 9be5dc3f73 | |||
| 9ca59f7928 | |||
| b3258e017c | |||
| 1da045f58e | |||
| 3c4b4b6a58 | |||
| 455d154b63 | |||
| 4d50d4380b | |||
| 45ff067379 | |||
| ebebf8af6d | |||
| 79c8edc6cf | |||
| a2f70be7e4 | |||
| 7096bba958 | |||
| b08e01f72f | |||
| 8744a00ce7 | |||
| 11b0e770a2 | |||
| 008bbedd98 | |||
| e75872adaa | |||
| 41a10320f8 | |||
| 25a64cbcae | |||
| 772fe616ff | |||
| a9d0f177da | |||
| ef0e3f3a66 | |||
| 35043ad0ec | |||
| 9dbb5291f4 | |||
| dbf5935897 | |||
| c754291c6d | |||
| ed6eb18c4d | |||
| 8042f3ae0b | |||
| 317796c919 | |||
| e8f38bfcf6 | |||
| 7f9352b820 | |||
| c461480d1d | |||
| b9911e69c5 | |||
| 00cf7b8112 | |||
| 567dd816be | |||
| 76facc40b9 | |||
| ce058df3a5 | |||
| 23b7d18906 | |||
| fa8aec2c2e | |||
| 6f0f3890f9 | |||
| 8f617c6222 | |||
| f38b0cf78f | |||
| 964f6c689c | |||
| 4a5a019841 | |||
| 24a2b4ba2f | |||
| 8c6f9d1bc4 | |||
| 0e385e8628 | |||
| bbed90c814 | |||
| c0596c08c5 | |||
| d1070656ac | |||
| 23badc3404 | |||
| 0f708f4934 | |||
| 0127982f50 | |||
| 73a2bf59f3 | |||
| be412abebc | |||
| bc6bc930fe | |||
| 9d5a0585b0 | |||
| b174818ed2 | |||
| b0a78658cf | |||
| a1fade0489 | |||
| 2fc0827d49 | |||
| 951d5bb2c7 | |||
| 3c050438b3 | |||
| 90931232d9 | |||
| 427a301d1a | |||
| f66c3466ed | |||
| 1df91303f0 | |||
| 7ed7ce1bb9 | |||
| b184cee975 | |||
| 419f608322 | |||
| 5d70f72cc2 | |||
| 5057b2d761 | |||
| 470192aabd | |||
| 45d350a76e | |||
| 3b20f5e45c | |||
| 2d3643d1f0 | |||
| effad6f62d | |||
| 7174f9cbe0 | |||
| 6c08741450 | |||
| 4579c133a8 | |||
| 98c85f1241 | |||
| 958c897467 | |||
| a2e4704223 | |||
| a7f51205b1 | |||
| 9343d1ee0c | |||
| ca4865011d | |||
| 693313a23b | |||
| f874ca43c0 | |||
| b9fd95741d | |||
| 5877411db8 | |||
| f7b3af4939 | |||
| 164fc4b132 | |||
| e6eea06900 | |||
| f499110bbf | |||
| d0281bb3b4 | |||
| 910a467fcc | |||
| 91174ca974 | |||
| 4d5ea1f519 | |||
| 79ea8c4521 | |||
| 6edc411a95 | |||
| 5ca639101c | |||
| 7c85e981f9 | |||
| d931aad11c | |||
| 61e6ad063a | |||
| d6d6d0ac48 | |||
| 585cec31e2 | |||
| 2f0514092a | |||
| e1c395146b | |||
| 363a014298 | |||
| 4836ed8de0 | |||
| b30156a65f | |||
| d6966b24fe | |||
| 88c38c9228 | |||
| cf1cb44afa | |||
| 2b9406b172 | |||
| 27c312d7d3 | |||
| 29fac520f3 | |||
| 1208c6829c | |||
| 1de8c00990 | |||
| e247621f95 | |||
| cfea7e10f2 | |||
| 6cf3896d49 | |||
| b2dbe65739 | |||
| cf4105dcb3 | |||
| b79a3bd5e9 | |||
| 04aaefd5d8 | |||
| aef267186f | |||
| d80761d952 | |||
| 8860d9a598 | |||
| f2a57f85a8 | |||
| ac35ba3e27 | |||
| 1de658ace6 | |||
| 715b8075b8 | |||
| 555e74b8cd | |||
| 79d23a4557 | |||
| 6bc58c00b7 | |||
| d9f5646ad1 | |||
| 888e3878bd | |||
| 7b110aaf50 | |||
| 7a63301f08 | |||
| 5f50d9f0ec | |||
| 26a0521379 | |||
| 996a49105b | |||
| ff51d3964f | |||
| c2c30b86a1 | |||
| 97b34d98fb | |||
| 1f4628720a | |||
| a8141e5dac | |||
| 33122a0708 | |||
| 92abfb8b58 | |||
| ec8b3ccb6f | |||
| 122673d291 | |||
| 8376e8b92d | |||
| 493405951d | |||
| f9b69fe08c | |||
| e33162d20e | |||
| 0e39cfd4e3 | |||
| fda03b88df | |||
| f74ccb0513 | |||
| 6076d59c4b | |||
| 87f82b7f5d | |||
| f19c1b4eaf | |||
| 8c5ca521ac | |||
| 7dc7816123 | |||
| de0fbdb72c | |||
| d03678e3dc | |||
| d254b9c10b | |||
| ec6efc5c2b | |||
| f2be396e7a | |||
| 0c4d1afded | |||
| 67a48c6f75 | |||
| 7fb7263424 | |||
| e5e4bb2ea1 | |||
| fc8c748bc4 | |||
| eb308b78ef | |||
| 6168a6b806 | |||
| d07f19d893 | |||
| bff5d4ffbe | |||
| 4dc698a6be | |||
| 3963358d95 | |||
| a2f9fba896 | |||
| 97b171176a | |||
| a594ddeb75 | |||
| c0e2cec556 | |||
| ebd5aebd33 | |||
| f771b54f10 | |||
| 67398607d8 | |||
| d33163aae8 | |||
| 2c6212f75f | |||
| 30396b3f0e | |||
| 336cfa8667 | |||
| 8a9e040554 | |||
| 2bd578edb3 | |||
| 3a466e8e0f | |||
| 8bc8c67f8d | |||
| 36bd1795ed | |||
| 308412b5a3 | |||
| e24c610bf1 | |||
| 2e3576b06e | |||
| 98f335ec00 | |||
| 50a96b3e4f | |||
| 5d169e188a | |||
| 4fc61c342c | |||
| f8f352fe65 | |||
| a988ff20c8 | |||
| 6fb050fa58 | |||
| f9a41b9685 | |||
| e5217afc09 | |||
| 3d07aa3bd0 | |||
| 761ec96662 | |||
| ed69d3a061 | |||
| db8e2bfb69 | |||
| 307ee8fb56 | |||
| d025359f72 | |||
| 9ac9ab6818 | |||
| a45fd217d9 | |||
| d3025dc4a8 | |||
| cce58fdc31 | |||
| 8232224b21 | |||
| 38e1308865 | |||
| 73dd89e5af | |||
| 054e59a891 | |||
| 097a507c9a | |||
| 47ddebf7c4 | |||
| d19a47d4b2 | |||
| fea7ed8f76 | |||
| 0a150a60bb | |||
| 781b4b31cd | |||
| fe7b05cce2 | |||
| 20ed9ffc41 | |||
| d7abc41137 | |||
| c378ec4347 | |||
| 7e302adf53 | |||
| 02c12c6a54 | |||
| d57bd7d7ba | |||
| 59e501e52b | |||
| 6f0575304c | |||
| 8b1ade86ac | |||
| ffabd681c8 | |||
| f1a2ef25c7 | |||
| b54449012b | |||
| 0f75b269c3 | |||
| 8fbd680ebd | |||
| dad5127d4c | |||
| ac29247783 | |||
| 59314ae0aa | |||
| 24d74dd332 | |||
| ba2c450bd2 | |||
| 0621073f8d | |||
| 1fc7f9d3e8 | |||
| 3f86961bda | |||
| 05e0d219f4 | |||
| 8b590dc58a | |||
| a6bef31862 | |||
| e7a29dc21a | |||
| ceb8eb9671 | |||
| e89677c36d | |||
| 4b7e445a25 | |||
| 47a4b63172 | |||
| 911eb66c4a | |||
| 428a56cfd0 | |||
| 9af8117749 | |||
| baa7417c22 | |||
| 6dd779b421 | |||
| b3e105908b | |||
| f87277e1f2 | |||
| 749b29a239 | |||
| 942e8a9229 | |||
| 09a0536921 | |||
| 21e69c6d94 | |||
| 07400e7551 | |||
| 46a0706057 | |||
| e6676e8868 | |||
| 9b034a6753 | |||
| ee78a94aa2 | |||
| 34db041ac4 | |||
| 7abe95ba5f | |||
| 50b15b9506 | |||
| 235a8a73e9 | |||
| a728d20b70 | |||
| a78976b136 | |||
| 437fd64a6f | |||
| f0db878623 | |||
| b0821be465 | |||
| e44c1bccb3 | |||
| b350c9da56 | |||
| a555067c43 | |||
| 90162ed2c9 | |||
| c5f57a0689 | |||
| 3bb87ef8d3 | |||
| 4811f223b9 | |||
| e6ba291549 | |||
| 9e1bd2b64d | |||
| fb6bca0ffb | |||
| 2de307682c | |||
| 9dc421e789 | |||
| 1d4f03e3f1 | |||
| d4e33eb1df | |||
| 4317d5ebe9 | |||
| 9bec0c61de | |||
| d301a66f57 | |||
| 3213c051b3 | |||
| 6f0e46ac57 | |||
| f2180257c5 | |||
| 6fcc8cf7e8 | |||
| 96b8d49ef2 | |||
| 0be45703b5 | |||
| e548e17776 | |||
| bd7e45547f | |||
| c9471c344d | |||
| 3641047963 | |||
| cf440ffb43 | |||
| c2be0a4790 | |||
| 085ca2a16d | |||
| 009360a127 | |||
| 8c84a63757 | |||
| 3d27c68dee | |||
| 10444e31ce | |||
| 8492a0aa13 | |||
| 6f216dbe52 | |||
| 49bd14496a | |||
| 414a0d7d6e | |||
| 39574c1b3a | |||
| 198b866268 | |||
| 02cf36c17c | |||
| b423fff074 | |||
| 96b9571ee1 | |||
| 25d6d9b59e | |||
| 284cf711fd | |||
| 1a4f04cb81 | |||
| dd23bc26a2 | |||
| 8a637f3fa9 | |||
| f2b81ea68c | |||
| f4210e7671 | |||
| 2c45478877 | |||
| e81856afb9 | |||
| 88b5fbc4c9 | |||
| f1d1c3cbfd | |||
| 6680e9b882 | |||
| 31a21954d9 | |||
| 65b71191a0 | |||
| fbcd1bd7de | |||
| fb30a8e009 | |||
| d4db49e09e | |||
| 32a20f4783 | |||
| 57e4f585fe | |||
| 916cecca73 | |||
| d286c3784d | |||
| dec08f5eb1 | |||
| 0534ab4ac2 | |||
| ca6e3a8463 | |||
| e1b179a248 | |||
| 5ab9acfe89 | |||
| 3809e6f994 | |||
| 60fc774ade | |||
| 7250154748 | |||
| df6f4a07d6 | |||
| a3377a77fa | |||
| abc74b09b3 | |||
| 7f0373e0e9 | |||
| df39272544 | |||
| 70dff47f26 | |||
| e42e015410 | |||
| 0849e795a0 | |||
| 012cbe9a25 | |||
| e9d45b6532 | |||
| 94df440f88 | |||
| 4e929f4cce | |||
| 563f5e5f9e | |||
| 1e3146d33f | |||
| 93b301ee08 | |||
| 4b0878b248 | |||
| d9cba6bf5c | |||
| 7498b327d4 | |||
| d12f3dd846 | |||
| 7a5bec077f | |||
| 1211d63ccf | |||
| 7e983292ea | |||
| 2083e95f8c | |||
| f207419859 | |||
| 4b97e33e20 | |||
| e613ac3255 | |||
| 9170653260 | |||
| 0ee57e488d | |||
| f4bf3eec86 | |||
| 0df9385f33 | |||
| 82417a7f6f | |||
| a0871657ca | |||
| 0cc6222175 | |||
| 8700abd0fa | |||
| 12626511e9 | |||
| fe4b5bf582 | |||
| 31abd39ba8 | |||
| a06f9b581f | |||
| be66150631 | |||
| 9eb61649eb | |||
| 4075245dcb | |||
| dcb001e0d9 | |||
| de41668e71 | |||
| ddd4d5bafe | |||
| 9a4061910a | |||
| 7db059b910 | |||
| 605ecb164a | |||
| f4376d44a2 | |||
| 5c4c3872f0 | |||
| 69b88b35b9 | |||
| 3514b02960 | |||
| b171959920 | |||
| e38e45c283 | |||
| f55b5120ff | |||
| 7a8d2986af | |||
| b62634242a | |||
| 2711113a69 | |||
| 328a46f16d | |||
| 885315c22b | |||
| 29aa7f5056 | |||
| fdd3026212 | |||
| 6475eb838e | |||
| 287d44f64a | |||
| da8bb697df | |||
| 3417dcd41d | |||
| 7031a4d9c4 | |||
| 043d876642 | |||
| 8860969649 | |||
| b8601bac51 | |||
| 630d2659b3 | |||
| 58403ff00e | |||
| 5043f00c97 | |||
| 0a457c4bac | |||
| 780dce293d | |||
| 5dbeea80df | |||
| 9af7ec3ff5 | |||
| af127d666d | |||
| 14df81cbfb | |||
| 1614771150 | |||
| eb12b35e37 | |||
| 19775fac3f | |||
| 0bb5cb1fdc | |||
| 78471a2c3a | |||
| e9ae046592 | |||
| ce7b368a8e | |||
| 4c862932e8 | |||
| 8a88aa2128 | |||
| 3706b0f972 | |||
| a728bec15f | |||
| f2ca9f765f | |||
| c94f185308 | |||
| eead73f10c | |||
| a83e07350e | |||
| d364630d92 | |||
| bc9f247323 | |||
| a930247eec | |||
| 108045ac54 | |||
| cccf85f3d9 | |||
| 56080f6681 | |||
| e79a70fc2f | |||
| 8a44a9e1af | |||
| 84029fc729 | |||
| 66b151dce0 | |||
| 1a8a7cc260 | |||
| 4d48dfe018 | |||
| 4e053a4769 | |||
| 0347f8bf02 | |||
| e98f59e984 | |||
| 578afaeb08 | |||
| 08555a77be | |||
| 79ffc1c077 | |||
| 92afdf71cd | |||
| 2a7735bca5 | |||
| affbe7821a | |||
| 19753a9ef7 | |||
| 57d3d3af13 | |||
| 3d2ea2821e | |||
| ff0f2320e1 | |||
| f4f08c0710 | |||
| 3e3f005525 | |||
| d0f457d8ed | |||
| f5286ae66b | |||
| 6b4e8df411 | |||
| c34144a4e8 | |||
| 18a6262eaf | |||
| 8fa395a582 | |||
| 834d03459b | |||
| ffc1241188 | |||
| 534faef82c | |||
| 5658e7a0b4 | |||
| b784ad6b26 | |||
| 32e1e487a9 | |||
| 5070353bf0 | |||
| a540ac3f7e | |||
| 1305633511 | |||
| 93b7f6e57c | |||
| 4640db5aff | |||
| 478adb740e | |||
| 7f32cca476 | |||
| 7cf89392a2 | |||
| c8f0bdd6d7 | |||
| c679e12d16 | |||
| 2144982829 | |||
| 580f063efe | |||
| 3a16c4ebf3 | |||
| ac04629f86 | |||
| f546554f87 | |||
| f4176ebcda | |||
| 10cd655b67 | |||
| 77d7417132 | |||
| dd044b9146 | |||
| 27287bd07a | |||
| 7267d526bb | |||
| f8c431e0bc | |||
| 629ea3716e | |||
| 6230aa47ae | |||
| b3dfcdc295 | |||
| bb9d4bda04 | |||
| d92ad0a6c6 | |||
| 63f089dc27 | |||
| 6cca4d2daa | |||
| 77cd3bb02d | |||
| 008847e490 | |||
| f1605011dd | |||
| cb617463ed | |||
| 570798b5f7 | |||
| e4abc745c8 | |||
| 155d2f9651 | |||
| 453f93aba6 | |||
| d2611ac0a5 | |||
| 7bf109298b | |||
| e78598900a | |||
| 823579dc59 | |||
| 58005d1832 | |||
| d6be83b48c | |||
| 29a920b1ce | |||
| 0729f2ed1a | |||
| b4b44d9a89 | |||
| f276435750 | |||
| d600a6d2c3 | |||
| b5dbb8a16a | |||
| 473815639b | |||
| 752632456c | |||
| 9220e1f85f | |||
| 1036c97be7 | |||
| a0472c6573 | |||
| 521423a343 | |||
| 04c5ccc891 | |||
| f83cd3b87a | |||
| dd7c8480f3 | |||
| de4accab83 | |||
| 182e370086 | |||
| ee2c937cbf | |||
| 2f65e6a801 | |||
| ad440e12b5 | |||
| f469f7aea9 | |||
| d1afd9f09d | |||
| 9c51f25c9e | |||
| d8460923ca | |||
| 2e06633972 | |||
| 5b193e89c0 | |||
| b7dff7d2c3 | |||
| bef53dadb1 | |||
| e7e5d76531 | |||
| 52a55a018c | |||
| aa1d70f8f0 | |||
| 9350e9230f | |||
| 022ad26dd2 | |||
| 392d8f38d2 | |||
| 8442690bc7 | |||
| 70b0b3fae7 | |||
| 0b24e1098a | |||
| 068aa03b4f | |||
| fe69c0a578 | |||
| 25d284389a | |||
| accb8f7f82 | |||
| 2d61dea287 | |||
| 1a5d270936 | |||
| 48d36cc859 | |||
| 8c4d00b8ef | |||
| 3df1aaf371 | |||
| 3b3191c407 | |||
| 7491b9c1b0 | |||
| 204de30459 | |||
| 9a3a72deb0 | |||
| 92319b9b29 | |||
| b477d814c6 | |||
| 39321dcde3 | |||
| b9bd8e1d4d | |||
| 0c44a497a5 | |||
| 5d8df75e86 | |||
| 0c8d4d830f | |||
| 0a4d89543a | |||
| f218174ad3 | |||
| dccf845e3b | |||
| fb4997b1ac | |||
| dd138380c9 | |||
| d020537679 | |||
| 259a3c218a | |||
| 5021c47c9f | |||
| 69abf1e9e2 | |||
| 87681351b9 | |||
| 21fb679c08 | |||
| 3d1f81a721 | |||
| 16f90604b6 | |||
| 234ec03db9 | |||
| 0536ff0044 | |||
| 729509a45d | |||
| 12b2f3ab07 | |||
| 854d836e30 | |||
| 25deb0a440 | |||
| cef41f3710 | |||
| 471e2e7b86 | |||
| 59a1e84fb2 | |||
| 7541770fbb | |||
| ae4c06f481 | |||
| 84013e42e7 | |||
| 5eafa6b5f4 | |||
| b52ea08013 | |||
| e20bebad87 | |||
| 186e9e6f08 | |||
| 1993e20ffc | |||
| c566d07847 | |||
| 6d97a9e9aa | |||
| 9cade51ff4 | |||
| 48bb2ef7e1 | |||
| 17512e60b2 | |||
| 393475e62c | |||
| d07c568d5e | |||
| 1f45ddc17d | |||
| 7530a74ff3 | |||
| 3ef5528196 | |||
| e915671a02 | |||
| c7e01bd3f2 | |||
| 56e6efe416 | |||
| 841e3b0390 | |||
| 4c671c2ee9 | |||
| b3c6127cfe | |||
| 1f4b029973 | |||
| 33267de4be | |||
| 141b1523e1 | |||
| 3b762c8065 | |||
| a0284c313a | |||
| fd8e49c11f | |||
| 6fa5ff81d6 | |||
| 0942480428 | |||
| 2fd2746a74 | |||
| 8e2129902c | |||
| d0509abb8b | |||
| c2a782e164 | |||
| 5ac0b249ec | |||
| 5142f5656b | |||
| 7bd70a6436 | |||
| c017014171 | |||
| 36c8862b99 | |||
| 29f7e34e10 | |||
| 730db74743 | |||
| d1207ced02 | |||
| fb6bb96fbd | |||
| 9db09a040a | |||
| a563f053ef | |||
| 3846f38a6f | |||
| d1b813b1cc | |||
| 8663d86f7a | |||
| efcebb567f | |||
| e6ad3b3168 | |||
| f9058b954e | |||
| 4aa8807830 | |||
| 9975f767b8 | |||
| 0b58d4fd6f | |||
| ce72294273 | |||
| bcafb6cea6 | |||
| 6ea802717b | |||
| 12e06776be | |||
| 2c08a482e3 | |||
| 10bfb6c9e8 | |||
| 86d3042cc6 | |||
| 9d0e63e695 | |||
| ac0103751d | |||
| fe06b2360e | |||
| c8009a8a6c | |||
| 20a2e369c5 | |||
| c2ffd02907 | |||
| 0536deda1a | |||
| 555db0d5af | |||
| 7bb98479dd | |||
| b0d31361c1 | |||
| 8cf63f3b76 | |||
| b5c830ed35 | |||
| 8e56b404b9 | |||
| e4ee83c590 | |||
| ffe4fcb0b3 | |||
| bc7fa71894 | |||
| dec6b160a6 | |||
| 81612da80c | |||
| 47130b48ec | |||
| 1b35b95173 | |||
| e4f1da751d | |||
| 88fd26d192 | |||
| 580b6239c2 | |||
| 7944ce091e | |||
| b7ffe00c69 | |||
| d01b05fd73 | |||
| deb0197452 | |||
| 4f4df8a8b7 | |||
| 912b018e32 | |||
| ab8b46203e | |||
| 1a6c107f0b | |||
| e3ff62001b | |||
| f47f8d5da4 | |||
| fed30daad0 | |||
| a2e943ac40 | |||
| f5d534a409 | |||
| cea06994de | |||
| b1e85fe92b | |||
| 1b19a0821f | |||
| 5a62dbc740 | |||
| 7dfe2f1932 | |||
| 633b9eeafe | |||
| 96b79c8740 | |||
| bebec98285 | |||
| 8d68faf922 | |||
| 9ae36b54e1 | |||
| 11c9622186 | |||
| 3a1ac15740 | |||
| 51ee16926c | |||
| 5e3a7d4307 | |||
| e1fac8e871 | |||
| ab978592a0 | |||
| fd0fb7c9b4 | |||
| 977c2d4432 | |||
| 258c5f7777 | |||
| e2e7966f83 | |||
| 349865b8fb | |||
| 27428b15bb | |||
| 93ae5577f8 | |||
| 28ab904144 | |||
| 1447a930d3 | |||
| 8d61025afa | |||
| a65336993c | |||
| 6025660e23 | |||
| ed59de7e80 | |||
| 4bb9c61168 | |||
| c90b875aa2 | |||
| bc0d581402 | |||
| eda68ef5e0 | |||
| 4e5379c5d9 | |||
| cc0ea44de3 | |||
| 3993d614d4 | |||
| 71f63095c2 | |||
| 92f2c6e0a2 | |||
| 284ae0637e | |||
| 6c642f1242 | |||
| 9da2854e61 | |||
| 6211a77119 | |||
| 2f08d1b1c1 | |||
| 006a763436 | |||
| e15f4981fb | |||
| 63d7716a6c | |||
| b51ce13024 | |||
| d77499b73b | |||
| 563e7bebc0 | |||
| ad956bef8e | |||
| 69067c1ef9 | |||
| efebaeeb27 | |||
| 8705341563 | |||
| e32bf2df57 | |||
| 44d60e5f52 | |||
| 10a6d374f1 | |||
| 054ef5d00f | |||
| 1fb019b795 | |||
| ea9bd93e73 | |||
| 86504fd663 | |||
| 2b68831415 | |||
| 4fc4cd762d | |||
| 21c2bafed6 | |||
| 487a2b6037 | |||
| 675ce0e9aa | |||
| aed3f99365 | |||
| 456700a06e | |||
| d63c7c3457 | |||
| 5b2365a1e2 | |||
| 78031bf1ad | |||
| 2df91bce5c | |||
| 960341e25d | |||
| 1b04d70839 | |||
| ee6221e325 | |||
| cf0c7a2f8c | |||
| b77e56161d | |||
| 0cd86e3e54 | |||
| 53e44b9df5 | |||
| 150b4ec09d | |||
| a5daa63da4 | |||
| c1cb2904e6 | |||
| 6af2a01166 | |||
| 2e5f53f59a | |||
| dd2f982e95 | |||
| 2951b2a0d1 | |||
| a2d71d3a8d | |||
| 51a65495aa | |||
| e33d863732 | |||
| 4e3ab802b6 | |||
| d8fb36543f | |||
| e29dfd99f3 | |||
| 61af95b7e5 | |||
| ab3c631030 | |||
| 2d88ee031c | |||
| c6f4fbb0b8 | |||
| b1c094383f | |||
| 46fff01eaa | |||
| 24641d1444 | |||
| abfd92e387 | |||
| 3023cd2e94 | |||
| 65c7db7ae4 | |||
| b907f01ebb | |||
| 927ed934c0 | |||
| 1b3c052c12 | |||
| 9038910303 | |||
| 7dec1178e4 | |||
| 72b19987bd | |||
| 1a76231df0 | |||
| 57e5626fe4 | |||
| a8c60c105d | |||
| 27715c7f5f | |||
| 47dfb66b8d | |||
| 081a2d69f5 | |||
| 1b4a2f2d7a | |||
| 59f25bd3a2 | |||
| 78a16982f8 | |||
| de15d43bb7 | |||
| a495ff9b98 | |||
| 54b2dce3d6 | |||
| acac5dfc65 | |||
| 92cb4dedef | |||
| 3cdc051861 | |||
| 961526925c | |||
| 571bf8ebad | |||
| 44260ddb4d | |||
| b39b8559d9 | |||
| 72bf2525b7 | |||
| 83ccc93305 | |||
| 5ecac3cb99 | |||
| 183cb1ac17 | |||
| cc461aab8b | |||
| f9c894307d | |||
| 9360c8a470 | |||
| 868d10ffd6 | |||
| 465ab736ee | |||
| e5a0dcb829 | |||
| 4f8d620814 | |||
| 8556632f90 | |||
| ac508a9f19 | |||
| e32c68e0e3 | |||
| 8a835cb7f8 | |||
| 9ae3a6dc29 | |||
| 3c2190b280 | |||
| c0e6552c08 | |||
| 87384f42f9 | |||
| e7480eb9ff | |||
| 1816f3f5f6 | |||
| 6722fde9c9 | |||
| 874f08f6dd | |||
| 77ebf1d857 | |||
| 70418b8ff6 | |||
| 1dc4f5b56a | |||
| 1a39abf7c7 | |||
| 691bbaaf82 | |||
| a49075bcb7 | |||
| aa7982fea9 | |||
| 1b65f6f4e6 | |||
| 3a9f6a0edd | |||
| 7eda02f366 | |||
| b1411549f3 | |||
| 96e0bfa72c | |||
| 464799d22b | |||
| fdbbba5038 | |||
| 5b795c2ccf | |||
| 7bec7016c3 | |||
| e41e24be04 | |||
| aadaa3f2a3 | |||
| 91c01f36f4 | |||
| 144a872c98 | |||
| 35bf6a2efd | |||
| 861f8a7288 | |||
| caac612a0d | |||
| b7a1236acc | |||
| dd309e972b | |||
| 84ba0dbb64 | |||
| a7f1e43225 | |||
| b98794a292 | |||
| ccf01100bb | |||
| 77e31f2da6 | |||
| 88df5057fb | |||
| 8ccc621a91 | |||
| 21f7099878 | |||
| 843ddad987 | |||
| f09692edd1 | |||
| ee7a819094 | |||
| 989f1ecf02 | |||
| 63a06dfef2 | |||
| 0b84e1b608 | |||
| 4edd242f09 | |||
| 2a393f0087 | |||
| 1bed062a01 | |||
| 6f7bca6eab | |||
| 47abce4aad | |||
| 1afb9130c0 | |||
| 2e9cc2b291 | |||
| 2d5aea2bb8 | |||
| 318087c572 | |||
| 501224b9b7 | |||
| 6a5b2db79d | |||
| 34b995ed6d | |||
| 04f6ee6156 | |||
| 6eeeb8b4b7 | |||
| 279fbe51c3 | |||
| afa00caa4c | |||
| fd260a6307 | |||
| 028be08ec3 | |||
| 5758d7cf4f | |||
| b655c4021a | |||
| 65a9b8c80f | |||
| bfba05753e | |||
| 5ee241d914 | |||
| 409221434a | |||
| 66b843be1b | |||
| 1be8c27cb5 | |||
| 92f2f5108c | |||
| 7ec24bfc7b | |||
| 24b467cd90 | |||
| 9ac523c087 | |||
| 4b898bd976 | |||
| f4197f090b | |||
| 78bffb1348 | |||
| 6aa0bbb037 | |||
| a09a350338 | |||
| 824423f3ea | |||
| a21a5ce044 | |||
| b21d3448cb | |||
| 90012856dc | |||
| bbf6616cd9 | |||
| 43492add0b | |||
| 898f40e8a5 | |||
| c5f69d0e44 | |||
| cda13ac705 | |||
| 89bc5a5d9d | |||
| 9d6159c202 | |||
| fa1871a059 | |||
| 3739581a29 | |||
| 9362aea0cf | |||
| 286c7be83d | |||
| d56dbdf563 | |||
| 1e260a178c | |||
| 3d2c7e4026 | |||
| 1ddf5a8370 | |||
| f47650f5e9 | |||
| c6d4c34cad | |||
| ff88581ecd | |||
| 4faaa78ee1 | |||
| a2d0f9e39a | |||
| 6e55382d15 | |||
| 23853e4a19 | |||
| 2fcbbcac84 | |||
| c88da53c03 | |||
| e5182a20ac | |||
| d813f55a9b | |||
| 1460e6ed80 | |||
| 0e69e432da | |||
| 6f081e4136 | |||
| df1fe01abe | |||
| 3362eb8e31 | |||
| a21a292da6 | |||
| ed71077243 | |||
| b99b09ca6a | |||
| 76f2501fec | |||
| 9ebb04a01b | |||
| 783a2fb2b0 | |||
| b7fa6b2072 | |||
| bdf59f3230 | |||
| bece495ac8 | |||
| e824d48edf | |||
| c49a36e9ca | |||
| 15cd9155f1 | |||
| 4653e070b1 | |||
| 20672cd311 | |||
| a390eefd75 | |||
| 20d6a34506 | |||
| b8c885c8a4 | |||
| 5f55834ccf | |||
| 2f5d93daa2 | |||
| e513550cba | |||
| 13f2bb4e85 | |||
| df74bade9b | |||
| 7abe04a69f | |||
| 4bd430ae79 | |||
| fb9b65b138 | |||
| 72bde46ca6 | |||
| 33a93457ec | |||
| 0d5e8e89a6 | |||
| 3e912f9545 | |||
| 7861829ee4 | |||
| 604bfeea20 | |||
| dc973217b7 | |||
| bc71415dd5 | |||
| 84b23a148e | |||
| 98c877e9ea | |||
| 5e7e2b63dd | |||
| 0512295b8b | |||
| b9329aa417 | |||
| c5f6ce861b | |||
| bd4bbe0b7a | |||
| 0c0d529478 | |||
| f17591327d | |||
| 8bda0f2f96 | |||
| 5c9e1b3fd3 | |||
| 8762e87658 | |||
| abb9885b3b | |||
| 22f6e3fe3b | |||
| 49fda27e56 | |||
| 364c3f0518 | |||
| dc5368f346 | |||
| a5c77543b1 | |||
| b53dec6a31 | |||
| 28fe3ef839 | |||
| 73792d1e78 | |||
| 09c02b0906 | |||
| e881abe904 | |||
| 70d7496ed9 | |||
| 20edb299a7 | |||
| 61616fbaef | |||
| 8d8c25bd6e | |||
| 4526c10d30 | |||
| ef6634a38e | |||
| db6e1add8a | |||
| d3a3ebacfc | |||
| 751c1fd31e | |||
| 75ce2a0aa8 | |||
| 7ef88fcc02 | |||
| 284351a024 | |||
| b1d8a2f5a4 | |||
| a3f9e19bd6 | |||
| d99e260b47 | |||
| 83335d6d30 | |||
| 5b597dbc31 | |||
| ff6f23b3f4 | |||
| e479a7aa49 | |||
| ee8051915e | |||
| c7e008b615 | |||
| ef91489b29 | |||
| b070607f91 | |||
| b4505536f6 | |||
| 9a81111ebc | |||
| b5bbf89b7d | |||
| 49c2911557 | |||
| d412c1d00e | |||
| b07d9a9a63 | |||
| ddab42123b | |||
| bb0656c480 | |||
| a27b80c394 | |||
| 59b848c576 | |||
| 414541b6cf | |||
| 981e782c57 | |||
| 87f640d66a | |||
| d8cd52f7a0 | |||
| f3e23b888d | |||
| 620528fa50 | |||
| 733275a162 | |||
| c2fb582db0 | |||
| cbd7566e3c | |||
| 7dbf29d655 | |||
| 4503e0db71 | |||
| 787d479a33 | |||
| a2f944ff92 | |||
| 2db669ca2e | |||
| 4b5e784081 | |||
| f479e7ff62 | |||
| c7ee0ce82b | |||
| d38ed229bf | |||
| d6ef9c4ec4 | |||
| fed4f7f929 | |||
| 5d4ec93b09 | |||
| 6f8bd9527c | |||
| 9c69d8cc46 | |||
| 8666dbe3a6 | |||
| c08171536c | |||
| 030be5b83f | |||
| a3e70afdc1 | |||
| 8b06ef030a | |||
| f0a3b8db95 | |||
| eb05922043 | |||
| 5fbe374ea3 | |||
| 64326136d5 | |||
| fa3d9e1e05 | |||
| 9c2f062d34 | |||
| 2e1f38cc91 | |||
| ae0c311be3 | |||
| b6adf1ad53 | |||
| 1d75a26230 | |||
| 7c29a726f2 | |||
| 798469dfcc | |||
| 98006b3d2b | |||
| 91781d3a38 | |||
| d87670edb8 | |||
| 5671bb340b | |||
| bff4fa5544 | |||
| b6dbe1513e | |||
| 8fe19d40bc | |||
| ba17974371 | |||
| b400ea758c | |||
| 058863ba8d | |||
| 4715ce3b95 | |||
| a72b8a153e | |||
| 633cd6be0f | |||
| 5b03abb50c | |||
| 036365e148 | |||
| 4b45914d4f | |||
| b2c8bcb2bf | |||
| 350911d474 | |||
| 3a191f4a11 | |||
| 38301572ae | |||
| aefe73b642 | |||
| efc8e7c5fe | |||
| 37f89010a4 | |||
| 84706c957e | |||
| 9beb426531 | |||
| 832a3de8c5 | |||
| d378cd3002 | |||
| f45d692e66 | |||
| e8a89cf277 | |||
| 8f152cdf50 | |||
| 3f84fa7f2d | |||
| 0b97a92ae9 | |||
| a48cbaabb9 | |||
| 6fa680d19f | |||
| 02e7ef12de | |||
| 617c126aa8 | |||
| 28b7a41b80 | |||
| 0d3c55b019 | |||
| 087bf229af | |||
| 44cc6a3a83 | |||
| 9c2ece2bda | |||
| 71fda916a3 | |||
| 75547ea5e3 | |||
| 4fb8bdd5d9 | |||
| 4ba828d0e8 | |||
| da9002356c | |||
| a105143771 | |||
| 48f4afae73 | |||
| 38f76f68f1 | |||
| 776908792a | |||
| 4e73b40a84 | |||
| c0252e5ad9 | |||
| 9ac31f3925 | |||
| 6f3335cc3d | |||
| a8b4e2b399 | |||
| dd2867a23d | |||
| 5d7370e4af | |||
| d0779eadf9 | |||
| a0635840b7 | |||
| 74f9ac7600 | |||
| 7a3bb2a374 | |||
| f26801b7de | |||
| c68856b740 | |||
| e3ec0fc36c | |||
| 2df956ef20 | |||
| 1817757745 | |||
| 27e2286096 | |||
| 9f336b4590 | |||
| dee3b35a5d | |||
| 1d9899d830 | |||
| d105ea7a56 | |||
| d08b904530 | |||
| a32cda96d0 | |||
| 3674315305 | |||
| f7d1f459ca | |||
| cc52a9a28b | |||
| 0e813f78fb | |||
| 92fdf3da4c | |||
| 16b61d0560 | |||
| 4fead18c06 | |||
| 6b27c00d30 | |||
| 40a58ad9d0 | |||
| 364217c36d | |||
| 4158a66da4 | |||
| 9c73908733 | |||
| b684c6a34d | |||
| 4502eefaae | |||
| dee0bdaa17 | |||
| 7c229bbcee | |||
| 9227cc12f0 | |||
| 5b385d376e | |||
| c0fbc74862 | |||
| c65fc571ac | |||
| a4b24880f6 | |||
| 219113bc73 | |||
| 8e3939a885 | |||
| 52d406bca7 | |||
| 81b080ec41 | |||
| 94fe3b594d | |||
| 45715d78f7 | |||
| 818a93ab2c | |||
| 29600f1059 | |||
| bd9f3abfea | |||
| 562b8b000f | |||
| be7321723a | |||
| aacba9f6ae | |||
| 6d8606795f | |||
| 8c7bbff1c1 | |||
| e34bacb443 | |||
| bae7096ca1 | |||
| 645972d549 | |||
| 65bf35fa3e | |||
| 697b1e5c00 | |||
| c744d48aef | |||
| 93ef1151df | |||
| c74d22d46c | |||
| 1e449e6fd1 | |||
| 39ed309dd5 | |||
| e28261f4f6 | |||
| 484a48e309 | |||
| d1377b3f4e | |||
| fa74438f66 | |||
| 2a0a0a81f2 | |||
| 468d334530 | |||
| 41ff430464 | |||
| 9eeaeb2a14 | |||
| bd92777b96 | |||
| 1009f73109 | |||
| 13f71502e6 | |||
| 34c84d00da | |||
| 7dee77a6af | |||
| ace3bd6736 | |||
| cfe7c5b0da | |||
| 764628d5fb | |||
| 2046b6c2a8 | |||
| 8901791911 | |||
| ffd12e8ddf | |||
| 044695183f | |||
| 0beabe0f4a | |||
| 0fd53dc3ac | |||
| 72169b26c3 | |||
| 7b96f99929 | |||
| 72d0517701 | |||
| dc21662fc9 | |||
| b0c9231d14 | |||
| c5db083a84 | |||
| 5f3e393ed1 | |||
| 1416e91af7 | |||
| 3e4703408b | |||
| d54868070f | |||
| 2780ec5636 | |||
| 4f43b79ed5 | |||
| 95458c193c | |||
| 2a59fad2fc | |||
| e2cf663f88 | |||
| 7e518c3978 | |||
| 06179ee714 | |||
| 9e11dfb668 | |||
| 6b6392deb4 | |||
| 2238b872c6 | |||
| 83c0413815 | |||
| 91e43bbc07 | |||
| f9975eb530 | |||
| 555b8f4e6b | |||
| 280890a00d | |||
| 3d1908982a | |||
| 9f72206796 | |||
| 13b898179e | |||
| 7e2d63e3fe | |||
| 0f60ab2a54 | |||
| d1f69d4696 | |||
| 034bed6580 | |||
| 2e126692f2 | |||
| 559e4d2bc0 | |||
| 2f2f19306b | |||
| ebc7b5a3d9 | |||
| c5b996f35e | |||
| 00c52e4880 | |||
| 4335c2da80 | |||
| 085ed750ca | |||
| c56b774d1d | |||
| 266ba7523f | |||
| 546e55ed96 | |||
| 4120f5a566 | |||
| 4758fcb413 | |||
| 3e0aa849d4 | |||
| 3e17892831 | |||
| d51a95a8a0 | |||
| d7c2362a0e | |||
| a5749a5ea2 | |||
| 0e7343acfb | |||
| 0d65ae5b85 | |||
| 55959ccd41 | |||
| 935881dce2 | |||
| 3764df6102 | |||
| e1addbfe04 | |||
| 677f74781b | |||
| c78c731388 | |||
| 8fd61edaab | |||
| 92ec7f44ef | |||
| be6ad8ce2a | |||
| 630c1bc2bc | |||
| a1ccd392f5 | |||
| bc723b22f4 | |||
| 71699f6e74 | |||
| 1d6c5b4257 | |||
| 7f1cc966f0 | |||
| aaf64a759b | |||
| ae05b34cbf | |||
| fdc52ae47d | |||
| c5d3f47457 | |||
| 699b76f4cb | |||
| 1043714767 | |||
| a65d297997 | |||
| a3722273e9 | |||
| 4aa7b9854a | |||
| b6308d1ff5 | |||
| 8983a0e821 | |||
| 67f1094a97 | |||
| 065dd1d081 | |||
| ecbc6d8e3d | |||
| 0bd6af8da1 | |||
| 680787d881 | |||
| a71ead0a85 | |||
| fd2aa8a1bb | |||
| 6570c958b3 | |||
| b4053c45fd | |||
| dd4d71bd7d | |||
| c7c8913833 | |||
| a468338ead | |||
| 39bbcac217 | |||
| a3ad8eb337 | |||
| 4f3e8dcb3c | |||
| 90e006feb5 | |||
| d14608ed28 | |||
| ad369bbe44 | |||
| 252abeafcb | |||
| fb7f445e22 | |||
| 5c9c4b7e2d | |||
| ff93c957cd | |||
| 7daa289bb1 | |||
| c39174980c | |||
| efcef48f89 |
@@ -2,6 +2,8 @@ documents/
|
||||
vendor/
|
||||
|
||||
/nbproject/
|
||||
.vscode
|
||||
composer.phar
|
||||
/.idea/
|
||||
.settings
|
||||
.project
|
||||
|
||||
@@ -3,12 +3,35 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* NOTE(chris): example:
|
||||
Events::on('stv_conf_student', function (&$res) {
|
||||
$res['test'] = [
|
||||
'title' => 'TEST',
|
||||
'component' => './Stv/Studentenverwaltung/Details/Notizen.js'
|
||||
];
|
||||
});
|
||||
*/
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["lehreinheit"] = array(
|
||||
'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/calendarEvent.js',
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/modalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/modalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["reservierung"] = array(
|
||||
'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/calendarEvent.js',
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/modalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/modalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["ferien"] = array(
|
||||
'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/calendarEvent.js',
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/modalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/modalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
// Deadline for Application given as Time-Interval after Semesterstart.
|
||||
@@ -24,3 +24,12 @@ $config['send_mail'] = TRUE;
|
||||
|
||||
// Display fields to explain equivalence of ECTS and LV-Inhalte
|
||||
$config['explain_equivalence'] = TRUE;
|
||||
|
||||
// Displays infobox if set to true
|
||||
$config['display_infobox'] = [
|
||||
'fristen' => TRUE,
|
||||
'referenzbeispiele_ects' => TRUE,
|
||||
'voraussetzungen' => TRUE,
|
||||
'nachweisdokumente' => TRUE,
|
||||
'herkunft_kenntnisse' => TRUE
|
||||
];
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Define configuration parameters
|
||||
$config['timezone'] = 'Europe/Vienna';
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
// CMS Content Id for CIS4 Menu Root
|
||||
$config['cis_menu_root_content_id'] = 11087;
|
||||
// send Mails for ProfilUpdate
|
||||
$config['cis_send_profil_update_mails'] = true;
|
||||
// Vilesci CI BaseUrl
|
||||
$config['cis_vilesci_base_url'] = defined('VILESCI_ROOT') ? VILESCI_ROOT : APP_ROOT;
|
||||
$config['cis_vilesci_index_page'] = 'index.ci.php';
|
||||
// Cis CI BaseUrl
|
||||
$config['cis_base_url'] = defined('CIS_ROOT') ? CIS_ROOT : APP_ROOT;
|
||||
$config['cis_index_page'] = 'cis.php';
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// apps for which issues should be displayed
|
||||
$config['issues_list_apps'] = array('core', 'dvuh');
|
||||
|
||||
// functions which enable users to see issues
|
||||
$config['issues_list_functions'] = array('ass');
|
||||
|
||||
// functions which enable users to see issues
|
||||
$config['issues_list_status'] = array('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent');
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// use vuejs dev version
|
||||
$config['use_vuejs_dev_version'] = false;
|
||||
// use bundled javascript
|
||||
$config['use_bundled_javascript'] = false;
|
||||
// systemerror_mailto use in FHC-Alert Plugin - if empty Link will not be rendered
|
||||
$config['systemerror_mailto'] = '';
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
/*It defines which tags are available in LVVerwaltung and whether they are editable
|
||||
|
||||
$config['lvverwaltung_tags'] = [
|
||||
'tag_1' => ['readonly' => false],
|
||||
'tag_1' => ['readonly' => true]
|
||||
];
|
||||
*/
|
||||
|
||||
$config['lvverwaltung_tags'] = [];
|
||||
@@ -32,3 +32,18 @@ $config['validate'] = false; // If true then the email address will be validated
|
||||
|
||||
// If enabled will be logged info about emails in Codeigniter error logs
|
||||
$config['enable_debug'] = false;
|
||||
|
||||
// default sender
|
||||
$config['sancho_mail_default_sender'] = defined('SANCHO_MAIL_DEFAULT_SENDER') ? SANCHO_MAIL_DEFAULT_SENDER : '';
|
||||
|
||||
// If to use images for custom mails
|
||||
$config['sancho_mail_use_images'] = defined('SANCHO_MAIL_USE_IMAGES') ? SANCHO_MAIL_USE_IMAGES : false;
|
||||
|
||||
// image path for sancho mail, relativ to document root
|
||||
$config['sancho_mail_img_path'] = defined('SANCHO_MAIL_IMG_PATH') ? SANCHO_MAIL_IMG_PATH : '';
|
||||
|
||||
// header image for custom mails
|
||||
$config['sancho_mail_header_img'] = defined('SANCHO_MAIL_HEADER_IMG') ? SANCHO_MAIL_HEADER_IMG : '';
|
||||
|
||||
// footer image for custom mails
|
||||
$config['sancho_mail_footer_img'] = defined('SANCHO_MAIL_FOOTER_IMG') ? SANCHO_MAIL_FOOTER_IMG : '';
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
// Header menu
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$root = APP_ROOT;
|
||||
} else {
|
||||
$root = CIS_ROOT;
|
||||
}
|
||||
|
||||
$config['navigation_header'] = array(
|
||||
'*' => array(
|
||||
'fhcomplete' => array(
|
||||
@@ -50,11 +56,17 @@ $config['navigation_header'] = array(
|
||||
'requiredPermissions' => 'basis/vilesci:r',
|
||||
'children' => array(
|
||||
'cis' => array(
|
||||
'link' => CIS_ROOT,
|
||||
'link' => $root,
|
||||
'icon' => '',
|
||||
'description' => 'CIS',
|
||||
'sort' => 10
|
||||
),
|
||||
'lehrveranstaltungen' => array(
|
||||
'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'),
|
||||
'icon' => '',
|
||||
'description' => 'Lehrveranstaltungen Templates',
|
||||
'sort' => 15
|
||||
),
|
||||
'reihungstest' => array(
|
||||
'link' => site_url('organisation/Reihungstest'),
|
||||
'description' => 'Reihungstests',
|
||||
@@ -69,6 +81,16 @@ $config['navigation_header'] = array(
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'infocenter:r'
|
||||
),
|
||||
'lvverwaltung' => array(
|
||||
'link' => site_url('LVVerwaltung'),
|
||||
'icon' => '',
|
||||
'description' => 'LV Verwaltung',
|
||||
'requiredPermissions' => array(
|
||||
'admin:r',
|
||||
'assistenz:r'
|
||||
),
|
||||
'sort' => 35
|
||||
),
|
||||
'lehrauftrag' => array(
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
|
||||
'description' => 'Lehrauftrag',
|
||||
@@ -81,7 +103,7 @@ $config['navigation_header'] = array(
|
||||
),
|
||||
'zverfueg' => array(
|
||||
'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'),
|
||||
'description' => 'Zeitverfügbarkeit',
|
||||
'description' => 'Zeitverfügbarkeit',
|
||||
'expand' => true,
|
||||
'sort' => 45,
|
||||
'requiredPermissions' => array(
|
||||
@@ -217,7 +239,7 @@ $config['navigation_menu']['organisation/Reihungstest/index'] = array(
|
||||
'target' => '_blank'
|
||||
),
|
||||
'auswertung' => array(
|
||||
'link' => CIS_ROOT.'/cis/testtool/admin/auswertung.php',
|
||||
'link' => $root.'/cis/testtool/admin/auswertung.php',
|
||||
'description' => 'Auswertung',
|
||||
'icon' => 'list-alt',
|
||||
'sort' => 1,
|
||||
@@ -287,6 +309,15 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array(
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['lehre/lvplanung/LvTemplateUebersicht/index'] = array(
|
||||
'lvTemplateUebersicht' => array(
|
||||
'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'),
|
||||
'description' => 'LV Template Übersicht',
|
||||
'icon' => '',
|
||||
'sort' => 1
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['system/issues/Issues/*'] = array(
|
||||
'fehlerzustaendigkeiten' => array(
|
||||
'link' => site_url('system/issues/IssuesZustaendigkeiten'),
|
||||
@@ -306,3 +337,23 @@ $config['navigation_menu']['system/issues/Issues/*'] = array(
|
||||
),
|
||||
);
|
||||
|
||||
$config['navigation_menu']['apps'] = [
|
||||
'stv' => [
|
||||
'link' => site_url('studentenverwaltung'),
|
||||
'description' => 'Studierendenverwaltung',
|
||||
#'icon' => 'users',
|
||||
'requiredPermissions' => array('admin:r', 'assistenz:r')
|
||||
],
|
||||
'lvv' => [
|
||||
'link' => site_url('lVVerwaltung'),
|
||||
'description' => 'LV Verwaltung',
|
||||
#'icon' => 'person-chalkboard',
|
||||
'requiredPermissions' => array('admin:r', 'assistenz:r')
|
||||
],
|
||||
'lav' => [
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
|
||||
'description' => 'Lehraufträge',
|
||||
#'icon' => 'person-chalkboard',
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
|
||||
]
|
||||
];
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// liste von raumtyp_kurzbz welche in raumsuche studenten angezeigt werden
|
||||
$config['roomtypes_student'] = array(
|
||||
'LAB BM/Chem',
|
||||
'xEDV 1-36',
|
||||
'xEDV 37-60',
|
||||
'EDV 60',
|
||||
'EDV-HÖPL',
|
||||
'EDV ES',
|
||||
'LAB Elek',
|
||||
'LAB ES/TK',
|
||||
'Ener-EDV',
|
||||
'Ener-Lab',
|
||||
'Ener-SEM',
|
||||
'Ener-HS',
|
||||
'HS 59-109',
|
||||
'HS 25-38',
|
||||
'HS 39-58',
|
||||
'LAB Inf',
|
||||
'LAB Robo',
|
||||
'LAB SET'
|
||||
);
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------------
|
||||
@@ -50,8 +50,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
| Examples: my-controller/index -> my_controller/index
|
||||
| my-controller/my-method -> my_controller/my_method
|
||||
*/
|
||||
$route['default_controller'] = 'Vilesci';
|
||||
$route['translate_uri_dashes'] = FALSE;
|
||||
$route['default_controller'] = defined('CIS4') && CIS4 ? 'Cis4' : 'Vilesci';
|
||||
$route['translate_uri_dashes'] = false;
|
||||
|
||||
// Class name conflicts
|
||||
$route['api/v1/organisation/[S|s]tudiengang/(:any)'] = 'api/v1/organisation/studiengang2/$1';
|
||||
@@ -61,25 +61,81 @@ $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisa
|
||||
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
|
||||
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
// load routes from extensions
|
||||
$subdir = 'application/config/extensions';
|
||||
$dirlist = scandir($subdir);
|
||||
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
|
||||
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
|
||||
$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
|
||||
|
||||
if ($dirlist)
|
||||
// Studierendenverwaltung List Routes
|
||||
$route['api/frontend/v1/stv/[sS]tudents/inout'] = 'api/frontend/v1/stv/Students/index';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/index';
|
||||
|
||||
// (studiensemester_kurzbz)/inout[/(incoming|outgoing|gemeinsamestudien)]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout'] = 'api/frontend/v1/stv/Students/index';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/incoming'] = 'api/frontend/v1/stv/Students/getIncoming/$1';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/outgoing'] = 'api/frontend/v1/stv/Students/getOutgoing/$1';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/gemeinsamestudien'] = 'api/frontend/v1/stv/Students/getGemeinsamestudien/$1';
|
||||
|
||||
// (studiengang_kz)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudents/$1';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$4';
|
||||
|
||||
// (studiengang_kz)/(orgform)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$5';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)/(semester)/grp/(gruppe)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsSpezialgruppe/$1/$2/$3/$4';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)[/(semester)[/(verband)[/(gruppe)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/(:any)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3/$4/$5';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)/(orgform)/(semester)/grp/(gruppe)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgformSpezialgruppe/$1/$2/$3/$4/$5';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)/(orgform)[/(semester)[/(verband)[/(gruppe)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4/$5/$6';
|
||||
|
||||
// // (studiensemester_kurzbz)/uid/(uid)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/uid/(:any)'] = 'api/frontend/v1/stv/Students/getStudent/$1/$2';
|
||||
// // (studiensemester_kurzbz)/prestudent/(prestudent_id)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/prestudent/(:num)'] = 'api/frontend/v1/stv/Students/getPrestudent/$1/$2';
|
||||
// // (studiensemester_kurzbz)/person/(person_id)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/person/(:num)'] = 'api/frontend/v1/stv/Students/getPerson/$1/$2';
|
||||
|
||||
// load routes from extensions, also look for environment-specific configs
|
||||
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
|
||||
|
||||
foreach($subdirs as $subdir)
|
||||
{
|
||||
$files = array_diff($dirlist, array('.','..'));
|
||||
|
||||
foreach ($files as &$item)
|
||||
if(is_dir($subdir))
|
||||
{
|
||||
if (is_dir($subdir . DIRECTORY_SEPARATOR . $item))
|
||||
$dirlist = scandir($subdir);
|
||||
if ($dirlist)
|
||||
{
|
||||
$routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php';
|
||||
$files = array_diff($dirlist, array('.','..'));
|
||||
|
||||
if (file_exists($routes_file))
|
||||
foreach ($files as &$item)
|
||||
{
|
||||
require($routes_file);
|
||||
if (is_dir($subdir . DIRECTORY_SEPARATOR . $item))
|
||||
{
|
||||
$routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php';
|
||||
|
||||
if (file_exists($routes_file))
|
||||
{
|
||||
require($routes_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,874 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
$config['person'] = [
|
||||
'primarykey' => 'person_id',
|
||||
'table' => 'public.tbl_person',
|
||||
'searchfields' => [
|
||||
'uid' => [
|
||||
'comparison' => 'equals',
|
||||
'field' => 'uid',
|
||||
'join' => [
|
||||
'table' => "public.tbl_benutzer",
|
||||
'using' => "person_id"
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'vorname' => [
|
||||
'alias' => ['firstname'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'vorname'
|
||||
],
|
||||
'nachname' => [
|
||||
'alias' => ['lastname', 'surename'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'nachname'
|
||||
],
|
||||
'name' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => "(vorname || ' ' || nachname)"
|
||||
],
|
||||
'email' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => 'kontakt',
|
||||
'join' => [
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp = 'email' AND tbl_kontakt.person_id = tbl_person.person_id"
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'tel' => [
|
||||
'alias' => ['phone', 'telefon'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'kontakt',
|
||||
'join' => [
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp IN ('telefon', 'so.tel', 'mobil') AND tbl_kontakt.person_id = tbl_person.person_id"
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'preid' => [
|
||||
'alias' => ['prestudent_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => 'prestudent_id',
|
||||
'join' => [
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "person_id"
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'pid' => [
|
||||
'alias' => ['person_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => 'person_id'
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"ARRAY( SELECT uid FROM public.tbl_benutzer WHERE person_id = p.person_id ) AS uids",
|
||||
"p.person_id",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
|
||||
"CASE
|
||||
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
|
||||
ELSE NULL END
|
||||
AS photo_url"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN public.tbl_person p USING (person_id)"
|
||||
];
|
||||
|
||||
$config['student'] = [
|
||||
'primarykey' => 'student_uid',
|
||||
'table' => 'public.tbl_student',
|
||||
'searchfields' => [
|
||||
'uid' => [
|
||||
'comparison' => 'equals',
|
||||
'field' => 'student_uid'
|
||||
],
|
||||
'vorname' => [
|
||||
'alias' => ['firstname'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'vorname',
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'nachname' => [
|
||||
'alias' => ['lastname', 'surename'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'nachname',
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'name' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => "(vorname || ' ' || nachname)",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'email' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => 'kontakt',
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp = 'email' AND tbl_kontakt.person_id = tbl_prestudent.person_id"
|
||||
]
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'tel' => [
|
||||
'alias' => ['phone', 'telefon'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'kontakt',
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp IN ('telefon', 'so.tel', 'mobil') AND tbl_kontakt.person_id = tbl_prestudent.person_id"
|
||||
]
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'stg' => [
|
||||
'alias' => ['studiengang'],
|
||||
'comparison' => 'equals',
|
||||
'field' => "typ || kurzbz",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_studiengang",
|
||||
'on' => "tbl_studiengang.studiengang_kz = tbl_prestudent.studiengang_kz"
|
||||
]
|
||||
]
|
||||
],
|
||||
'preid' => [
|
||||
'alias' => ['prestudent_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => 'prestudent_id'
|
||||
],
|
||||
'pid' => [
|
||||
'alias' => ['person_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => 'person_id',
|
||||
'join' => [
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"s.student_uid AS uid",
|
||||
"s.matrikelnr",
|
||||
"p.person_id",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"(s.student_uid || '@" . DOMAIN . "') || ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
|
||||
"CASE
|
||||
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
|
||||
ELSE NULL END
|
||||
AS photo_url",
|
||||
"b.aktiv"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN public.tbl_student s USING (student_uid)
|
||||
JOIN public.tbl_benutzer b ON(b.uid = s.student_uid)
|
||||
JOIN public.tbl_person p USING(person_id)"
|
||||
];
|
||||
|
||||
$prestudent_sort = [
|
||||
"Student",
|
||||
"Incoming",
|
||||
"Outgoing",
|
||||
"Diplomand",
|
||||
"Unterbrecher",
|
||||
"Aufgenommener",
|
||||
"Wartender",
|
||||
"Bewerber",
|
||||
"Interessent",
|
||||
"Abgewiesener",
|
||||
"Absolvent",
|
||||
"Abbrecher",
|
||||
"Ausserordentlicher",
|
||||
"Praktikant"
|
||||
];
|
||||
$prestudent_sort_array = "array['" . implode("','", $prestudent_sort) . "']";
|
||||
$config['prestudent'] = [
|
||||
'primarykey' => 'prestudent_id',
|
||||
'table' => 'public.tbl_prestudent',
|
||||
'searchfields' => [
|
||||
'uid' => [
|
||||
'comparison' => 'equals',
|
||||
'field' => 'student_uid',
|
||||
'join' => [
|
||||
'table' => "public.tbl_student",
|
||||
'using' => "prestudent_id"
|
||||
]
|
||||
],
|
||||
'vorname' => [
|
||||
'alias' => ['firstname'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'vorname',
|
||||
'join' => [
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
],
|
||||
'nachname' => [
|
||||
'alias' => ['lastname', 'surename'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'nachname',
|
||||
'join' => [
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
],
|
||||
'name' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => "(vorname || ' ' || nachname)",
|
||||
'join' => [
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
],
|
||||
'email' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => 'kontakt',
|
||||
'join' => [
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp = 'email' AND tbl_kontakt.person_id = tbl_prestudent.person_id"
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'tel' => [
|
||||
'alias' => ['phone', 'telefon'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'kontakt',
|
||||
'join' => [
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp IN ('telefon', 'so.tel', 'mobil') AND tbl_kontakt.person_id = tbl_prestudent.person_id"
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'stg' => [
|
||||
'alias' => ['studiengang'],
|
||||
'comparison' => 'equals',
|
||||
'field' => "typ || kurzbz",
|
||||
'join' => [
|
||||
'table' => "public.tbl_studiengang",
|
||||
'using' => "studiengang_kz"
|
||||
]
|
||||
],
|
||||
'preid' => [
|
||||
'alias' => ['prestudent_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => 'prestudent_id'
|
||||
],
|
||||
'pid' => [
|
||||
'alias' => ['person_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => 'person_id',
|
||||
'join' => [
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"ps.prestudent_id",
|
||||
"ps.studiengang_kz",
|
||||
"s.matrikelnr",
|
||||
"p.person_id",
|
||||
"b.uid",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"(b.uid || '@" . DOMAIN . "') || ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
|
||||
"CASE
|
||||
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
|
||||
ELSE NULL END
|
||||
AS photo_url",
|
||||
"UPPER(sg.typ || sg.kurzbz) AS stg_kuerzel",
|
||||
"sg.bezeichnung",
|
||||
"(
|
||||
SELECT bezeichnung_mehrsprachig[(TABLE lang)]
|
||||
FROM public.tbl_status
|
||||
WHERE status_kurzbz = public.get_rolle_prestudent(ps.prestudent_id, NULL)
|
||||
LIMIT 1
|
||||
) AS status",
|
||||
"COALESCE(
|
||||
(
|
||||
SELECT COALESCE(plan.orgform_kurzbz, pss.orgform_kurzbz)
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
LEFT JOIN lehre.tbl_studienplan plan USING (studienplan_id)
|
||||
WHERE pss.prestudent_id=ps.prestudent_id
|
||||
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
|
||||
LIMIT 1
|
||||
),
|
||||
sg.orgform_kurzbz
|
||||
) AS orgform",
|
||||
"b.aktiv",
|
||||
"array_position(" . $prestudent_sort_array . ", public.get_rolle_prestudent(ps.prestudent_id, NULL)) AS sort"
|
||||
],
|
||||
'resultjoin' => "
|
||||
LEFT JOIN public.tbl_prestudent ps USING (prestudent_id)
|
||||
LEFT JOIN public.tbl_student s ON (ps.prestudent_id = s.prestudent_id)
|
||||
LEFT JOIN public.tbl_benutzer b ON (b.uid = s.student_uid)
|
||||
JOIN public.tbl_person p ON (p.person_id = ps.person_id)
|
||||
LEFT JOIN public.tbl_studiengang sg ON (sg.studiengang_kz = ps.studiengang_kz)"
|
||||
];
|
||||
|
||||
$config['employee'] = [
|
||||
'alias' => ['ma', 'mitarbeiter'],
|
||||
'primarykey' => 'mitarbeiter_uid',
|
||||
'table' => 'public.tbl_mitarbeiter',
|
||||
'searchfields' => [
|
||||
'uid' => [
|
||||
'alias' => ['mitarbeiter_uid'],
|
||||
'comparison' => 'equals',
|
||||
'field' => "mitarbeiter_uid"
|
||||
],
|
||||
'vorname' => [
|
||||
'alias' => ['firstname'],
|
||||
'comparison' => 'similar',
|
||||
'field' => "vorname",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_benutzer",
|
||||
'on' => "uid = mitarbeiter_uid"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'nachname' => [
|
||||
'alias' => ['lastname', 'surename'],
|
||||
'comparison' => 'similar',
|
||||
'field' => "nachname",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_benutzer",
|
||||
'on' => "uid = mitarbeiter_uid"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'name' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => "(vorname || ' ' || nachname)",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_benutzer",
|
||||
'on' => "uid = mitarbeiter_uid"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
],
|
||||
'email' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => "COALESCE(alias, uid) || '" . '@' . DOMAIN . "'",
|
||||
'join' => [
|
||||
'table' => "public.tbl_benutzer",
|
||||
'on' => "uid = mitarbeiter_uid"
|
||||
]
|
||||
],
|
||||
'tel' => [
|
||||
'alias' => ['phone', 'telefon'],
|
||||
'comparison' => 'similar',
|
||||
'field' => "TRIM(COALESCE(kontakt, '') || ' ' || COALESCE(telefonklappe, ''))",
|
||||
'join' => [
|
||||
'table' => "public.tbl_kontakt",
|
||||
'on' => "kontakttyp = 'telefon' AND tbl_kontakt.standort_id = tbl_mitarbeiter.standort_id"
|
||||
],
|
||||
"1-n" => true
|
||||
],
|
||||
'pid' => [
|
||||
'alias' => ['person_id'],
|
||||
'comparison' => 'equal-int',
|
||||
'field' => "person_id",
|
||||
'join' => [
|
||||
'table' => "public.tbl_benutzer",
|
||||
'on' => "uid = mitarbeiter_uid"
|
||||
]
|
||||
],
|
||||
'oe' => [
|
||||
'alias' => ['ou', 'organisationseinheit', 'organisationunit'],
|
||||
'comparison' => 'vector',
|
||||
'field' => "fts_bezeichnung",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_benutzerfunktion",
|
||||
'on' => "mitarbeiter_uid = uid
|
||||
AND funktion_kurzbz = 'oezuordnung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_organisationseinheit",
|
||||
'using' => "oe_kurzbz"
|
||||
]
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'kst' => [
|
||||
'comparison' => 'vector',
|
||||
'field' => "fts_bezeichnung",
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_benutzerfunktion",
|
||||
'on' => "mitarbeiter_uid = uid
|
||||
AND funktion_kurzbz = 'kstzuordnung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_organisationseinheit",
|
||||
'using' => "oe_kurzbz"
|
||||
]
|
||||
],
|
||||
'1-n' => true
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"b.uid",
|
||||
"p.person_id",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"ARRAY(
|
||||
SELECT
|
||||
'[' || ot.bezeichnung || '] ' || o.bezeichnung AS bezeichnung
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
|
||||
JOIN public.tbl_organisationseinheittyp ot USING(organisationseinheittyp_kurzbz)
|
||||
WHERE bf.funktion_kurzbz = 'oezuordnung'
|
||||
AND (bf.datum_von IS NULL OR bf.datum_von <= NOW())
|
||||
AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW())
|
||||
AND bf.uid = b.uid
|
||||
GROUP BY o.bezeichnung, ot.bezeichnung
|
||||
) AS organisationunit_name",
|
||||
"COALESCE(b.alias, b.uid) || '" . '@' . DOMAIN . "' AS email",
|
||||
"TRIM(COALESCE(k.kontakt, '') || ' ' || COALESCE(m.telefonklappe, '')) AS phone",
|
||||
"'" . base_url("/cis/public/bild.php?src=person&person_id=") . "' || p.person_id AS photo_url",
|
||||
"ARRAY(
|
||||
SELECT
|
||||
'[' || ot.bezeichnung || '] ' || o.bezeichnung AS bezeichnung
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
|
||||
JOIN public.tbl_organisationseinheittyp ot USING(organisationseinheittyp_kurzbz)
|
||||
WHERE bf.funktion_kurzbz = 'kstzuordnung'
|
||||
AND (bf.datum_von IS NULL OR bf.datum_von <= NOW())
|
||||
AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW())
|
||||
AND bf.uid = b.uid
|
||||
GROUP BY o.bezeichnung, ot.bezeichnung
|
||||
) AS standardkostenstelle"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN public.tbl_mitarbeiter m USING (mitarbeiter_uid)
|
||||
JOIN public.tbl_benutzer b ON (b.uid = m.mitarbeiter_uid)
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
LEFT JOIN (
|
||||
SELECT kontakt, standort_id
|
||||
FROM public.tbl_kontakt
|
||||
WHERE kontakttyp = 'telefon'
|
||||
) k ON (k.standort_id = m.standort_id)"
|
||||
];
|
||||
|
||||
// TODO(chris): move to searchpv21.php
|
||||
$config['unassigned_employee'] = $config['employee'];
|
||||
$config['unassigned_employee']['alias'] = ['mitarbeiter_ohne_zuordnung'];
|
||||
$config['unassigned_employee']['prepare'] = "unassigned_employee AS (
|
||||
SELECT tbl_mitarbeiter.*
|
||||
FROM public.tbl_mitarbeiter
|
||||
LEFT JOIN public.tbl_benutzerfunktion ON (
|
||||
uid = mitarbeiter_uid
|
||||
AND funktion_kurzbz = 'kstzuordnung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
)
|
||||
WHERE tbl_benutzerfunktion.bezeichnung IS NULL
|
||||
UNION
|
||||
SELECT tbl_mitarbeiter.*
|
||||
FROM public.tbl_mitarbeiter
|
||||
LEFT JOIN public.tbl_benutzerfunktion ON (
|
||||
uid = mitarbeiter_uid
|
||||
AND funktion_kurzbz = 'oezuordnung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
)
|
||||
WHERE tbl_benutzerfunktion.bezeichnung IS NULL
|
||||
)";
|
||||
$config['unassigned_employee']['table'] = "unassigned_employee";
|
||||
$config['unassigned_employee']['searchfields']['tel']['join']['on'] = "
|
||||
kontakttyp = 'telefon'
|
||||
AND tbl_kontakt.standort_id = unassigned_employee.standort_id
|
||||
";
|
||||
$config['unassigned_employee']['renderer'] = 'employee';
|
||||
|
||||
$config['organisationunit'] = [
|
||||
'alias' => ['ou', 'organisationseinheit', 'oe'],
|
||||
'primarykey' => 'oe_kurzbz',
|
||||
'table' => 'public.tbl_organisationseinheit',
|
||||
'searchfields' => [
|
||||
'uid' => [
|
||||
'comparison' => 'equals',
|
||||
'field' => 'uid',
|
||||
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
|
||||
SELECT oe_kurzbz, vorname, nachname, uid
|
||||
FROM public.tbl_benutzerfunktion
|
||||
JOIN public.tbl_benutzer USING (uid)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE funktion_kurzbz = 'Leitung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND tbl_benutzer.aktiv = TRUE
|
||||
)",
|
||||
'join' => [
|
||||
'table' => "organisationunit_leader",
|
||||
'using' => "oe_kurzbz"
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'vorname' => [
|
||||
'alias' => ['firstname'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'vorname',
|
||||
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
|
||||
SELECT oe_kurzbz, vorname, nachname, uid
|
||||
FROM public.tbl_benutzerfunktion
|
||||
JOIN public.tbl_benutzer USING (uid)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE funktion_kurzbz = 'Leitung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND tbl_benutzer.aktiv = TRUE
|
||||
)",
|
||||
'join' => [
|
||||
'table' => "organisationunit_leader",
|
||||
'using' => "oe_kurzbz"
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'nachname' => [
|
||||
'alias' => ['lastname', 'surename'],
|
||||
'comparison' => 'similar',
|
||||
'field' => 'nachname',
|
||||
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
|
||||
SELECT oe_kurzbz, vorname, nachname, uid
|
||||
FROM public.tbl_benutzerfunktion
|
||||
JOIN public.tbl_benutzer USING (uid)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE funktion_kurzbz = 'Leitung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND tbl_benutzer.aktiv = TRUE
|
||||
)",
|
||||
'join' => [
|
||||
'table' => "organisationunit_leader",
|
||||
'using' => "oe_kurzbz"
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'name' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => "(vorname || ' ' || nachname)",
|
||||
'prepare' => "organisationunit_leader(oe_kurzbz, uid, vorname, nachname) AS (
|
||||
SELECT oe_kurzbz, vorname, nachname, uid
|
||||
FROM public.tbl_benutzerfunktion
|
||||
JOIN public.tbl_benutzer USING (uid)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE funktion_kurzbz = 'Leitung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND tbl_benutzer.aktiv = TRUE
|
||||
)",
|
||||
'join' => [
|
||||
'table' => "organisationunit_leader",
|
||||
'using' => "oe_kurzbz"
|
||||
],
|
||||
'1-n' => true
|
||||
],
|
||||
'oe' => [
|
||||
'alias' => ['ou', 'organisationseinheit', 'organisationunit'],
|
||||
'comparison' => 'vector',
|
||||
'field' => "fts_bezeichnung"
|
||||
],
|
||||
'kurzbz' => [
|
||||
'alias' => ['oe_kurzbz'],
|
||||
'comparison' => 'equals',
|
||||
'field' => "oe_kurzbz"
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"oe.oe_kurzbz",
|
||||
"('[' || type.bezeichnung || '] ' || oe.bezeichnung) AS name",
|
||||
"oe_parent.oe_kurzbz AS parentoe_kurzbz",
|
||||
"(CASE WHEN oe_parent.bezeichnung IS NOT NULL THEN '[' || type_parent.bezeichnung || '] ' || oe_parent.bezeichnung END) AS parentoe_name",
|
||||
"ARRAY(
|
||||
SELECT JSON_BUILD_OBJECT('uid', b.uid, 'vorname', p.vorname, 'nachname', p.nachname, 'name', (p.vorname || ' ' || p.nachname))
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_benutzer b USING (uid)
|
||||
JOIN public.tbl_person p USING (person_id)
|
||||
WHERE funktion_kurzbz = 'Leitung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND b.aktiv = TRUE
|
||||
AND oe_kurzbz = oe.oe_kurzbz
|
||||
) AS leaders",
|
||||
"(
|
||||
SELECT COUNT(*)
|
||||
FROM public.tbl_benutzerfunktion
|
||||
WHERE funktion_kurzbz = 'oezuordnung'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND oe_kurzbz = oe.oe_kurzbz
|
||||
) AS number_of_people",
|
||||
"(CASE WHEN oe.mailverteiler THEN oe.oe_kurzbz || '" . '@' . DOMAIN . "' END) AS mailgroup"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN public.tbl_organisationseinheit oe
|
||||
USING (oe_kurzbz)
|
||||
JOIN public.tbl_organisationseinheittyp type
|
||||
USING (organisationseinheittyp_kurzbz)
|
||||
LEFT JOIN public.tbl_organisationseinheit oe_parent
|
||||
ON (oe_parent.oe_kurzbz = oe.oe_parent_kurzbz)
|
||||
LEFT JOIN public.tbl_organisationseinheittyp type_parent
|
||||
ON (oe_parent.organisationseinheittyp_kurzbz = type_parent.organisationseinheittyp_kurzbz)"
|
||||
];
|
||||
|
||||
$config['room'] = [
|
||||
'alias' => ['raum'],
|
||||
'primarykey' => 'ort_kurzbz',
|
||||
'table' => 'public.tbl_ort',
|
||||
'searchfields' => [
|
||||
'name' => [
|
||||
'comparison' => 'similar',
|
||||
'field' => 'ort_kurzbz'
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"ort.ort_kurzbz",
|
||||
"ort.gebteil AS building",
|
||||
"ort.ausstattung AS equipment",
|
||||
"ort.stockwerk AS floor",
|
||||
"ort.dislozierung AS room_number",
|
||||
"ort.content_id",
|
||||
"address.ort AS city",
|
||||
"address.plz AS zip",
|
||||
"address.strasse AS street",
|
||||
"ort.max_person",
|
||||
"ort.arbeitsplaetze AS workplaces"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN public.tbl_ort ort
|
||||
USING (ort_kurzbz)
|
||||
LEFT JOIN public.tbl_standort
|
||||
USING (standort_id)
|
||||
LEFT JOIN public.tbl_adresse address
|
||||
USING (adresse_id)"
|
||||
];
|
||||
$sprache = getUserLanguage();
|
||||
$config['cms'] = [
|
||||
'primarykey' => 'contentsprache_id',
|
||||
'table' => 'campus.tbl_contentsprache',
|
||||
'prepare' => "
|
||||
cms_auth (content_id) AS (
|
||||
SELECT content_id
|
||||
FROM campus.tbl_content c
|
||||
WHERE NOT EXISTS (SELECT 1 FROM campus.tbl_contentgruppe g WHERE g.content_id=c.content_id)
|
||||
UNION
|
||||
SELECT content_id
|
||||
FROM public.vw_gruppen g
|
||||
JOIN campus.tbl_contentgruppe c USING (gruppe_kurzbz)
|
||||
WHERE uid = (TABLE auth)
|
||||
),
|
||||
cms_active (content_id, template_kurzbz) AS (
|
||||
SELECT content_id, template_kurzbz
|
||||
FROM cms_auth
|
||||
JOIN campus.tbl_content USING (content_id)
|
||||
WHERE aktiv = TRUE
|
||||
),
|
||||
cms_active_redirect (content_id) AS (
|
||||
SELECT content_id
|
||||
FROM cms_active
|
||||
WHERE template_kurzbz = 'redirect'
|
||||
),
|
||||
cms_active_redirect_linked (content_id) AS (
|
||||
SELECT content_id
|
||||
FROM cms_active_redirect
|
||||
JOIN campus.tbl_contentsprache USING (content_id)
|
||||
WHERE LEFT((xpath('string(/content/url)', content))[1]::text, 1) <> '#'
|
||||
),
|
||||
cms_active_others (content_id) AS (
|
||||
SELECT content_id
|
||||
FROM cms_active
|
||||
WHERE template_kurzbz IN ('contentmittitel', 'contentohnetitel', 'contentmittitel_filterwidget')
|
||||
)
|
||||
",
|
||||
'searchfields' => [
|
||||
'content' => [
|
||||
'alias' => ['inhalt'],
|
||||
'comparison' => "vector",
|
||||
'field' => "(
|
||||
setweight(to_tsvector('simple', COALESCE(titel, '')), 'A')
|
||||
||
|
||||
setweight(to_tsvector('simple', COALESCE(content, '')::text), 'B')
|
||||
)"
|
||||
],
|
||||
'content_id' => [
|
||||
'alias' => ['id'],
|
||||
'comparison' => "equal-int",
|
||||
'field' => "content_id"
|
||||
],
|
||||
'lang' => [
|
||||
'alias' => ['language', 'sprache'],
|
||||
'comparison' => "equals",
|
||||
'field' => "sprache"
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"contentsprache.content_id",
|
||||
"content.template_kurzbz",
|
||||
"contentsprache.version",
|
||||
"contentsprache.sprache AS language",
|
||||
"contentsprache.titel AS title",
|
||||
"contentsprache.content",
|
||||
"(xpath('string(/content/url)', contentsprache.content))[1] AS content_url"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN campus.tbl_contentsprache contentsprache
|
||||
USING (contentsprache_id)
|
||||
JOIN campus.tbl_content content
|
||||
USING (content_id)
|
||||
WHERE content_id IN (
|
||||
SELECT content_id
|
||||
FROM cms_active_redirect_linked
|
||||
UNION
|
||||
SELECT content_id
|
||||
FROM cms_active_others
|
||||
)
|
||||
AND version = campus.get_highest_content_version(content_id)
|
||||
AND contentsprache.sprache = '{$sprache}'"
|
||||
];
|
||||
|
||||
$config['dms'] = [
|
||||
'primarykey' => 'dms_id, version',
|
||||
'table' => 'campus.tbl_dms_version',
|
||||
'searchfields' => [
|
||||
'keywords' => [
|
||||
'alias' => ['keyword', 'keywords', 'schlagwort', 'schlagworte'],
|
||||
'comparison' => "vector",
|
||||
'field' => "(to_tsvector('simple', COALESCE(schlagworte, '')))"
|
||||
]
|
||||
],
|
||||
'resultfields' => [
|
||||
"v.dms_id",
|
||||
"v.version",
|
||||
"v.filename",
|
||||
"v.mimetype",
|
||||
"v.name",
|
||||
"v.beschreibung AS description",
|
||||
"v.schlagworte AS keywords"
|
||||
],
|
||||
'resultjoin' => "
|
||||
JOIN campus.tbl_dms_version v
|
||||
USING (dms_id, version)
|
||||
WHERE cis_suche = TRUE
|
||||
AND version=(SELECT MAX(version) FROM campus.tbl_dms_version WHERE dms_id=v.dms_id)
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
fue.tbl_projekt_dokument p
|
||||
WHERE p.dms_id = v.dms_id
|
||||
) AND (
|
||||
NOT EXISTS (
|
||||
WITH RECURSIVE categories (kategorie_kurzbz) AS (
|
||||
SELECT
|
||||
kategorie_kurzbz
|
||||
FROM
|
||||
campus.tbl_dms c
|
||||
WHERE c.dms_id = v.dms_id
|
||||
UNION ALL
|
||||
SELECT
|
||||
cat.parent_kategorie_kurzbz AS kategorie_kurzbz
|
||||
FROM
|
||||
categories
|
||||
JOIN campus.tbl_dms_kategorie cat USING (kategorie_kurzbz)
|
||||
)
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
categories
|
||||
JOIN campus.tbl_dms_kategorie_gruppe USING (kategorie_kurzbz)
|
||||
UNION
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
categories
|
||||
JOIN campus.tbl_dms_kategorie USING (kategorie_kurzbz)
|
||||
WHERE
|
||||
berechtigung_kurzbz IS NOT NULL
|
||||
) OR EXISTS (
|
||||
WITH RECURSIVE categories (kategorie_kurzbz) AS (
|
||||
SELECT
|
||||
kategorie_kurzbz
|
||||
FROM
|
||||
campus.tbl_dms c
|
||||
WHERE c.dms_id = v.dms_id
|
||||
UNION ALL
|
||||
SELECT
|
||||
cat.parent_kategorie_kurzbz AS kategorie_kurzbz
|
||||
FROM
|
||||
categories
|
||||
JOIN campus.tbl_dms_kategorie cat USING (kategorie_kurzbz)
|
||||
)
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
categories
|
||||
JOIN campus.tbl_dms_kategorie_gruppe USING (kategorie_kurzbz)
|
||||
JOIN public.tbl_benutzergruppe USING(gruppe_kurzbz)
|
||||
WHERE
|
||||
uid = (TABLE auth)
|
||||
)
|
||||
)"
|
||||
];
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
$CI =& get_instance();
|
||||
|
||||
|
||||
$config['employee'] = $CI->config->item('employee', 'search');
|
||||
$config['employee']['resultjoin'] = "
|
||||
JOIN public.tbl_mitarbeiter m USING (mitarbeiter_uid)
|
||||
JOIN public.tbl_benutzer b ON (b.uid = m.mitarbeiter_uid AND b.aktiv = true)
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
LEFT JOIN (
|
||||
SELECT kontakt, standort_id
|
||||
FROM public.tbl_kontakt
|
||||
WHERE kontakttyp = 'telefon'
|
||||
) k ON (k.standort_id = m.standort_id)";
|
||||
|
||||
$config['student'] = $CI->config->item('student', 'search');
|
||||
unset($config['student']['searchfields']['email']);
|
||||
unset($config['student']['searchfields']['tel']);
|
||||
$config['student']['resultfields'] = [
|
||||
"s.student_uid AS uid",
|
||||
"s.matrikelnr",
|
||||
"p.person_id",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"ARRAY[s.student_uid || '@' || '" . DOMAIN . "'] AS email",
|
||||
"CASE
|
||||
WHEN (p.foto_sperre = false AND p.foto IS NOT NULL) THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
|
||||
ELSE NULL END
|
||||
AS photo_url",
|
||||
"b.aktiv"
|
||||
];
|
||||
$config['student']['resultjoin'] = "
|
||||
JOIN public.tbl_student s USING (student_uid)
|
||||
JOIN public.tbl_benutzer b ON(b.uid = s.student_uid AND b.aktiv = true)
|
||||
JOIN public.tbl_person p USING(person_id)";
|
||||
|
||||
$config['organisationunit'] = $CI->config->item('organisationunit', 'search');
|
||||
$config['organisationunit']['prepare'] = 'active_organisationseinheit AS (SELECT * FROM public.tbl_organisationseinheit WHERE aktiv = true AND organisationseinheittyp_kurzbz <> \'Container\')';
|
||||
$config['organisationunit']['table'] = 'active_organisationseinheit';
|
||||
|
||||
$config['room'] = $CI->config->item('room', 'search');
|
||||
|
||||
$config['cms'] = $CI->config->item('cms', 'search');
|
||||
|
||||
$config['dms'] = $CI->config->item('dms', 'search');
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/*
|
||||
* TODO: 2025-07-21 ma0080 bare integer comparision results in db error
|
||||
* if searchstring is numeric but out of range of int, think about
|
||||
* more sophisticated solution using column data type - quick fix
|
||||
* convert field and search string to text
|
||||
*/
|
||||
$config['equal-int'] = [
|
||||
'priority' => 4,
|
||||
'rank' => "0",
|
||||
'compare' => "{field}::text = {word}::text",
|
||||
'force_integer' => true
|
||||
];
|
||||
|
||||
$config['equals'] = [
|
||||
'priority' => 3,
|
||||
'rank' => "0",
|
||||
'compare' => "LOWER({field}) = {word}"
|
||||
];
|
||||
|
||||
$config['similar'] = [
|
||||
'priority' => 2,
|
||||
'rank' => "(COALESCE({field}, '') <->> {word})",
|
||||
'compare' => "COALESCE({field}, '') %> {word}",
|
||||
'compare_boolean' => "COALESCE({field}, '') ILIKE {like:word}"
|
||||
];
|
||||
|
||||
$config['vector'] = [
|
||||
'priority' => 1,
|
||||
'rank' => "ts_rank({field}, plainto_tsquery('simple', {word}))",
|
||||
'compare' => "plainto_tsquery('simple', {word}) @@ {field}"
|
||||
];
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
$CI =& get_instance();
|
||||
|
||||
|
||||
$config['student'] = $CI->config->item('student', 'search');
|
||||
$config['student']['searchfields']['pkz'] = [
|
||||
'alias' => ['personenkennzeichen', 'personalid'],
|
||||
'comparison' => 'equals',
|
||||
'field' => 'matrikelnr'
|
||||
];
|
||||
$config['student']['searchfields']['matrnr'] = [
|
||||
'alias' => ['matrikelnr', 'matrikelnummer', 'matrno', 'matriculationno', 'matriculationnumber', 'studno', 'studentno', 'studentnumber'],
|
||||
'comparison' => 'equals',
|
||||
'field' => 'matr_nr',
|
||||
'join' => [
|
||||
[
|
||||
'table' => "public.tbl_prestudent",
|
||||
'using' => "prestudent_id"
|
||||
],
|
||||
[
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$config['prestudent'] = $CI->config->item('prestudent', 'search');
|
||||
$config['prestudent']['searchfields']['pkz'] = [
|
||||
'alias' => ['personenkennzeichen', 'personalid'],
|
||||
'comparison' => 'equals',
|
||||
'field' => 'matrikelnr',
|
||||
'join' => [
|
||||
'table' => "public.tbl_student",
|
||||
'using' => "prestudent_id"
|
||||
]
|
||||
];
|
||||
$config['prestudent']['searchfields']['matrnr'] = [
|
||||
'alias' => ['matrikelnr', 'matrikelnummer', 'matrno', 'matriculationno', 'matriculationnumber', 'studno', 'studentno', 'studentnumber'],
|
||||
'comparison' => 'equals',
|
||||
'field' => 'matr_nr',
|
||||
'join' => [
|
||||
'table' => "public.tbl_person",
|
||||
'using' => "person_id"
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
$config['number_displayed_past_studiensemester_default'] = 5;
|
||||
$config['tabs'] =
|
||||
[
|
||||
'details' => [
|
||||
//all fields can be configured to be hidden, see class attribute stv-details-details-name for name
|
||||
'hiddenFields' => [],
|
||||
'hideUDFs' => false
|
||||
],
|
||||
|
||||
'prestudent' => [
|
||||
|
||||
//all fields can be configured to be hidden, see class attribute stv-details-prestudent-name for name
|
||||
'hiddenFields' => [
|
||||
|
||||
//propably used by FH-Communities
|
||||
'aufnahmeschluessel', 'standort_code', 'facheinschlaegigBerufstaetig'
|
||||
|
||||
],
|
||||
'hideUDFs' => false
|
||||
],
|
||||
'finalexam' => [
|
||||
'documents' => [
|
||||
'pruefungsprotokoll' => [
|
||||
'de' => [
|
||||
'Bakk' => 'PrProtBA',
|
||||
'Master' => 'PrProtMA',
|
||||
],
|
||||
'en' => [
|
||||
'Bakk' => 'PrProtBAEng',
|
||||
'Master' => 'PrProtMAEng',
|
||||
],
|
||||
],
|
||||
'pruefungszeugnis' => [
|
||||
'de' => [
|
||||
'Bakk' => 'Bakkzeugnis',
|
||||
'Master' => 'Diplomzeugnis',
|
||||
],
|
||||
'en' => [
|
||||
'Bakk' => 'BakkzeugnisEng',
|
||||
'Master' => 'DiplomzeugnisEng',
|
||||
],
|
||||
],
|
||||
'urkunde' => [
|
||||
'de' => [
|
||||
'Bakk' => 'Bakkurkunde',
|
||||
'Master' => 'Diplomurkunde',
|
||||
],
|
||||
'en' => [
|
||||
'Bakk' => 'BakkurkundeEng',
|
||||
'Master' => 'DiplomurkundeEng',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'exemptions' => [
|
||||
//if true, Anrechnungen can be added and edited in tab Anrechnungen
|
||||
'editableAnrechnungen' => false,
|
||||
],
|
||||
'notes' => [
|
||||
//if true, the count of Messages will be shown in the header of the Tab Messages
|
||||
'showCountNotes' => true
|
||||
],
|
||||
'combinePeople' => [
|
||||
//multitab should only be shown with this length of selection
|
||||
'validCountMulti' => 2,
|
||||
],
|
||||
];
|
||||
|
||||
// List of fields to show when ZGV_DOKTOR_ANZEIGEN is defined
|
||||
$fieldsZgvDoktor = ['zgvdoktorort', 'zgvdoktordatum', 'zgvdoktornation', 'zgvdoktor_erfuellt', 'zgvdoktor_code'];
|
||||
|
||||
// List of fields to show when ZGV_ERFUELLT_ANZEIGEN is defined
|
||||
$fieldsZgvErfuellt = ['zgv_erfuellt', 'zgvmas_erfuellt','zgvdoktor_erfuellt'];
|
||||
|
||||
//order important: to show zgf_erfuellt_doktor just in case visibility of doktor is true
|
||||
if (!defined('ZGV_ERFUELLT_ANZEIGEN') || !ZGV_ERFUELLT_ANZEIGEN) {
|
||||
$config['tabs']['prestudent']['hiddenFields'] = array_merge(
|
||||
$config['tabs']['prestudent']['hiddenFields'], $fieldsZgvErfuellt
|
||||
);
|
||||
}
|
||||
|
||||
if (!defined('ZGV_DOKTOR_ANZEIGEN') || !ZGV_DOKTOR_ANZEIGEN) {
|
||||
$config['tabs']['prestudent']['hiddenFields'] = array_merge(
|
||||
$config['tabs']['prestudent']['hiddenFields'],
|
||||
$fieldsZgvDoktor
|
||||
);
|
||||
}
|
||||
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStunden'] =
|
||||
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR')
|
||||
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR
|
||||
: '0.0';
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundenDiplom'] =
|
||||
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER')
|
||||
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER
|
||||
: '0.0';
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundensatz'] = '80.0';
|
||||
|
||||
$config['student_tab_order'] = [
|
||||
'details',
|
||||
'notes',
|
||||
'messages',
|
||||
'contact',
|
||||
'prestudent',
|
||||
'status',
|
||||
'documents',
|
||||
'archive',
|
||||
'banking',
|
||||
'grades',
|
||||
'exam',
|
||||
'exemptions',
|
||||
'projektarbeit',
|
||||
'finalexam',
|
||||
'mobility',
|
||||
'jointstudies',
|
||||
'admissionDates',
|
||||
'groups',
|
||||
'functions',
|
||||
'coursedates',
|
||||
'resources',
|
||||
];
|
||||
$config['students_tab_order'] = [
|
||||
'banking',
|
||||
'status',
|
||||
'messages',
|
||||
'groups',
|
||||
'finalexam',
|
||||
'combinePeople',
|
||||
'archive',
|
||||
];
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
// changing the color theme
|
||||
|
||||
$config['theme_name']='default';
|
||||
$config['theme_css']= "public/css/theme/default.css";
|
||||
$config['theme_logo']= "public/images/logo_fh-complete_300x46.png";
|
||||
$config['theme_modes']=['light','dark'];
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Abgabetool extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'getStudentProjektarbeitAbgabeFile' => self::PERM_LOGGED,
|
||||
'Mitarbeiter' => self::PERM_LOGGED,
|
||||
'Student' => self::PERM_LOGGED,
|
||||
'Deadlines' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
|
||||
}
|
||||
|
||||
public function Student()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']);
|
||||
}
|
||||
|
||||
public function Mitarbeiter()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']);
|
||||
}
|
||||
|
||||
public function Deadlines()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']);
|
||||
}
|
||||
|
||||
|
||||
public function getStudentProjektarbeitAbgabeFile()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->helper('download');
|
||||
|
||||
$paabgabe_id = $this->_ci->input->get('paabgabe_id');
|
||||
$student_uid = $this->_ci->input->get('student_uid');
|
||||
|
||||
if (!isset($paabgabe_id) || isEmptyString($paabgabe_id) || !isset($student_uid) || isEmptyString($student_uid))
|
||||
$this->terminateWithJsonError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$this->_ci->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$isZugeteilterBetreuer = count($this->_ci->ProjektarbeitModel->checkZuordnung($student_uid, getAuthUID())->retval) > 0;
|
||||
|
||||
if(getAuthUID() == $student_uid || $isZugeteilterBetreuer) {
|
||||
$file_path = PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf';
|
||||
if(file_exists($file_path)) {
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Disposition: attachment; filename="'.basename($file_path).'"');
|
||||
header('Content-Length: ' . filesize($file_path));
|
||||
|
||||
flush(); // send headers first just in case
|
||||
readfile($file_path); // read file content to output buffer
|
||||
|
||||
} else {
|
||||
$this->terminateWithJsonError('File not found');
|
||||
}
|
||||
} else {
|
||||
$this->terminateWithJsonError('Keine Zuordnung!');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Auth extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load Helpers
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('hlp_authentication');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('username', 'Username', 'required|trim|callback_validation');
|
||||
$this->form_validation->set_rules('password', 'Password', 'required|trim');
|
||||
|
||||
|
||||
if ($this->form_validation->run())
|
||||
{
|
||||
redirect($this->authlib->getLandingPage('/CisVue/Dashboard'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->view('Cis/Login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function validation()
|
||||
{
|
||||
$username = $this->input->post('username');
|
||||
$password = $this->input->post('password');
|
||||
|
||||
$this->load->library('AuthLib', [false]); // without authentication otherwise loooooop!
|
||||
|
||||
$login = $this->authlib->loginLDAP($username, $password);
|
||||
if (isSuccess($login))
|
||||
return true;
|
||||
$this->form_validation->set_message('validation', 'Incorrect username/password.');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
$this->load->library('AuthLib');
|
||||
$this->authlib->logout();
|
||||
setcookie('fhclogout', 'fhclogout', 0, '/');
|
||||
redirect(base_url('/cis/private/logout.php'), 'refresh');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Documents extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => [self::PERM_LOGGED],
|
||||
'student' => ['admin:r'],
|
||||
'download' => [self::PERM_LOGGED]
|
||||
]);
|
||||
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'tools'
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return $this->showDocuments(getAuthUID());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $uid Administratoren dürfen die UID als Parameter übergeben um die Dokumente von anderen Personen anzuzeigen
|
||||
* @return void
|
||||
*/
|
||||
public function student($uid)
|
||||
{
|
||||
return $this->showDocuments($uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $uid
|
||||
* @return void
|
||||
*/
|
||||
protected function showDocuments($uid)
|
||||
{
|
||||
$this->load->model('crm/Konto_model', 'KontoModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$stati = $this->PrestudentstatusModel->loadWhereUid($uid, null, true);
|
||||
if (isError($stati))
|
||||
return $this->load->view('errors/html/error_db.php', [
|
||||
'heading' => 'Database Error',
|
||||
'message' => getError($stati)
|
||||
]);
|
||||
$stati = getData($stati);
|
||||
if (!$stati)
|
||||
return $this->load->view('errors/html/error_general.php', [
|
||||
'heading' => 'User ist kein Student',
|
||||
'message' => 'Es konnten keine Studiensemester gefunden werden in denen der User als Student inskripiert ist'
|
||||
]);
|
||||
|
||||
$stgs = [];
|
||||
$stsemArray = [];
|
||||
$buchungstypen = defined("CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN") ? unserialize(CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN) : [];
|
||||
$person_ids = [];
|
||||
foreach ($stati as $status) {
|
||||
$person_ids[] = $status->person_id;
|
||||
|
||||
if(!in_array($status->studiensemester_kurzbz, $stsemArray)) {
|
||||
$stsemArray[] = $status->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (!isset($stgs[$status->studiengang_kz])) {
|
||||
$stg = $this->StudiengangModel->load($status->studiengang_kz);
|
||||
if (isError($stg))
|
||||
return $this->load->view('errors/html/error_db.php', [
|
||||
'heading' => 'Database Error',
|
||||
'message' => getError($stg)
|
||||
]);
|
||||
$stg = getData($stg);
|
||||
if (!$stg)
|
||||
return $this->load->view('errors/html/error_db.php', [
|
||||
'heading' => 'Database Error',
|
||||
'message' => 'No Studiengang found for studiengang_kz ' . $status->studiengang_kz
|
||||
]);
|
||||
$stgs[$status->studiengang_kz] = current($stg);
|
||||
$stgs[$status->studiengang_kz]->studiensemester = [];
|
||||
}
|
||||
if (!isset($stgs[$status->studiengang_kz]->studiensemester[$status->studiensemester_kurzbz])) {
|
||||
$stgs[$status->studiengang_kz]->studiensemester[$status->studiensemester_kurzbz] = new stdClass();
|
||||
$stgs[$status->studiengang_kz]->studiensemester[$status->studiensemester_kurzbz]->inskriptionsbestaetigung = (boolean)getData(
|
||||
$this->KontoModel->checkStudienbeitragFromPrestudent(
|
||||
$status->prestudent_id,
|
||||
$status->studiensemester_kurzbz,
|
||||
$buchungstypen
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
$person_ids = array_unique($person_ids);
|
||||
|
||||
$selfservice = null;
|
||||
if (!defined('CIS_DOKUMENTE_SELFSERVICE') || CIS_DOKUMENTE_SELFSERVICE) {
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$selfservice = [];
|
||||
foreach ($person_ids as $person_id) {
|
||||
$result = $this->AkteModel->getArchiv($person_id, null, true);
|
||||
if (isError($result))
|
||||
return $this->load->view('errors/html/error_db.php', [
|
||||
'heading' => 'Database Error',
|
||||
'message' => getError($result)
|
||||
]);
|
||||
$selfservice = array_merge($selfservice, getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('Cis/Documents', [
|
||||
'stsemArray' => $stsemArray,
|
||||
'stgs' => $stgs,
|
||||
'uid' => $uid,
|
||||
'studienbuchblatt' => defined('CIS_DOKUMENTE_STUDIENBUCHLBATT_DRUCKEN') && CIS_DOKUMENTE_STUDIENBUCHLBATT_DRUCKEN,
|
||||
'studienerfolgsbestaetigung' => defined('CIS_DOKUMENTE_STUDIENERFOLGSBESTAETIGUNG_DRUCKEN') && CIS_DOKUMENTE_STUDIENERFOLGSBESTAETIGUNG_DRUCKEN,
|
||||
'selfservice' => $selfservice
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $akte_id
|
||||
* @param string $uid (optional) Administratoren dürfen die UID als Parameter übergeben um die Dokumente von anderen Personen anzuzeigen
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function download($akte_id, $uid = null)
|
||||
{
|
||||
if (!is_numeric($akte_id))
|
||||
return show_404();
|
||||
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
$akte = getData($result);
|
||||
if (!$akte)
|
||||
return show_404();
|
||||
$akte = current($akte);
|
||||
|
||||
$admin_access = false;
|
||||
if ($uid !== null && $this->permissionlib->isBerechtigt('admin')) {
|
||||
$stati = $this->PrestudentstatusModel->loadWhereUid($uid, null, true);
|
||||
if (hasData($stati)) {
|
||||
$person_ids = array_map(function ($status) {
|
||||
return $status->person_id;
|
||||
}, getData($stati));
|
||||
$person_ids = array_unique($person_ids);
|
||||
if (count($person_ids) == 1 && current($person_ids) == $akte->person_id) {
|
||||
$admin_access = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$admin_access && ($akte->person_id != getAuthPersonId() || !$akte->stud_selfservice))
|
||||
return show_error('Forbidden', 403);
|
||||
|
||||
// NOTE(chris): Log bei einem Download vom Becheid
|
||||
if (isset($akte->dokument_kurzbz) && ($akte->dokument_kurzbz === 'Bescheid' || $akte->dokument_kurzbz === 'BescheidEng')) {
|
||||
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
|
||||
$this->WebservicelogModel->insert([
|
||||
'webservicetyp_kurzbz' => 'content',
|
||||
'request_id' => (isset($akte->akte_id) && !empty($akte->akte_id)) ? $akte->akte_id : null,
|
||||
'beschreibung' => 'Bescheidbestaetigungsdownload',
|
||||
'request_data' => $_SERVER['QUERY_STRING'],
|
||||
'execute_time' => date('c'),
|
||||
'execute_user' => getAuthUID()
|
||||
]);
|
||||
}
|
||||
|
||||
$this->output->set_content_type($akte->mimetype);
|
||||
$this->output->set_output(base64_decode($akte->inhalt));
|
||||
}
|
||||
}
|
||||
+7
-9
@@ -3,30 +3,28 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Test VBform Vue Component
|
||||
*
|
||||
*/
|
||||
class TestVBform extends Auth_Controller
|
||||
class InfoTerminal extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'system/developer:r'
|
||||
)
|
||||
);
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Everything has a beginning
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/logs/testVBform.php');
|
||||
$this->load->view('Cis/InfoTerminal.php', []);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class LvPlan extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'LvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class MyLv extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
'Info' => [self::PERM_LOGGED]
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLv']);
|
||||
}
|
||||
|
||||
public function Info($studien_semester,$lvid)
|
||||
{
|
||||
$this->load->view('Cis/LvInfo',['lvid'=> $lvid, 'studien_semester' => $studien_semester]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class MyLvPlan extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,755 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Profil extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
'foto_sperre_function' => ['basis/cis:r'],
|
||||
'getView' => ['basis/cis:r'],
|
||||
'View' => ['basis/cis:r'],
|
||||
'isMitarbeiter' => ['basis/cis:r'],
|
||||
'isStudent' => ['basis/cis:r'],
|
||||
'getZustellAdresse' => ['basis/cis:r'],
|
||||
'getZustellKontakt' => ['basis/cis:r'],
|
||||
'getAllNationen' => ['basis/cis:r'],
|
||||
'getGemeinden' => ['basis/cis:r'],
|
||||
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
|
||||
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
|
||||
//? put the uid and pid inside the controller for reusability
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* index loads the Profil view
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->load->library('ProfilLib');
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>true,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilIndex']);
|
||||
}
|
||||
|
||||
/**
|
||||
* redirects to the index function (needed to allow calling this URI)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function View($uid)
|
||||
{
|
||||
$this->load->library('ProfilLib');
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array (
|
||||
'uid' => $uid,
|
||||
'profil_data'=>$profil_data,
|
||||
);
|
||||
if($uid == getAuthUID()){
|
||||
$viewData['editable'] = true;
|
||||
}
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilViewUid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
* @param $uid the userID used to check if it is a mitarbeiter
|
||||
* @return boolean
|
||||
*/
|
||||
public function isStudent($uid)
|
||||
{
|
||||
$result = $this->StudentModel->isStudent($uid);
|
||||
if (isError($result)) {
|
||||
show_error("error when calling Student_model function isStudent with uid " . $uid);
|
||||
}
|
||||
$result = getData($result);
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
* @param $uid the userID used to check if it is a mitarbeiter
|
||||
* @return boolean
|
||||
*/
|
||||
public function isMitarbeiter($uid)
|
||||
{
|
||||
$result = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
if (isError($result)) {
|
||||
show_error("error when calling Mitarbeiter_model function isMitarbeiter with uid " . $uid);
|
||||
}
|
||||
$result = getData($result);
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the adressen that are marked as zustell from the currenlty logged in user
|
||||
* @access public
|
||||
* @return array a list of adresse_id's
|
||||
*/
|
||||
public function getZustellAdresse()
|
||||
{
|
||||
$this->AdresseModel->addSelect(["adresse_id"]);
|
||||
$adressen_res = $this->AdresseModel->loadWhere(['person_id' => $this->pid, 'zustelladresse' => true]);
|
||||
$adressen_res = hasData($adressen_res) ? getData($adressen_res) : null;
|
||||
$adressen_res = array_map(function ($item) {
|
||||
return $item->adresse_id;
|
||||
}, $adressen_res);
|
||||
echo json_encode($adressen_res);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the kontakte that are marked as zustell from the currenlty logged in user
|
||||
* @access public
|
||||
* @return array a list of kontakt_id's
|
||||
*/
|
||||
public function getZustellKontakt()
|
||||
{
|
||||
$this->KontaktModel->addSelect(["kontakt_id"]);
|
||||
$kontakt_res = $this->KontaktModel->loadWhere(['person_id' => $this->pid, 'zustellung' => true]);
|
||||
$kontakt_res = hasData($kontakt_res) ? getData($kontakt_res) : null;
|
||||
$kontakt_res = array_map(function ($item) {
|
||||
return $item->kontakt_id;
|
||||
}, $kontakt_res);
|
||||
echo json_encode($kontakt_res);
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for the corresponding view
|
||||
* the client side parses the @param $uid and calls this function to get the data to the correct view
|
||||
* @access public
|
||||
* @param boolean $uid the userID used to identify which information should be retrieved for which view
|
||||
* @return stdClass all the data corresponding to a view of a user
|
||||
*/
|
||||
public function getView($uid)
|
||||
{
|
||||
$res = new stdClass();
|
||||
|
||||
// if parsing the URL did not found a UID then the UID of the logged in user is used
|
||||
if ($uid == "Profil" || $uid == $this->uid) {
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid);
|
||||
if (isError($isMitarbeiter)) {
|
||||
show_error("error while checking if UID: " . $this->uid . " is a mitarbeiter");
|
||||
}
|
||||
$isMitarbeiter = getData($isMitarbeiter);
|
||||
if ($isMitarbeiter) {
|
||||
$res->view = "MitarbeiterProfil";
|
||||
$res->data = $this->mitarbeiterProfil();
|
||||
$res->data->pid = $this->pid;
|
||||
} else {
|
||||
$res->view = "StudentProfil";
|
||||
$res->data = $this->studentProfil();
|
||||
$res->data->pid = $this->pid;
|
||||
}
|
||||
}
|
||||
// UID is availabe when accessing Profil/View/:uid
|
||||
else {
|
||||
$this->PersonModel->addSelect(["person_id"]);
|
||||
$pid = $this->PersonModel->getByUid($uid);
|
||||
if (isError($pid)) {
|
||||
show_error("error while trying to update table public.tbl_person while searching for a person with UID: " . $uid);
|
||||
}
|
||||
$pid = hasData($pid) ? getData($pid)[0] : null;
|
||||
if (!$pid) {
|
||||
show_error("Person with UID: " . $uid . " does not exist");
|
||||
}
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
if (isError($isMitarbeiter)) {
|
||||
show_error("error while checking if UID: " . $uid . " is a mitarbeiter");
|
||||
}
|
||||
$isMitarbeiter = getData($isMitarbeiter);
|
||||
if ($isMitarbeiter) {
|
||||
$res->view = "ViewMitarbeiterProfil";
|
||||
$res->data = $this->viewMitarbeiterProfil($uid);
|
||||
|
||||
} else {
|
||||
$res->view = "ViewStudentProfil";
|
||||
$res->data = $this->viewStudentProfil($uid);
|
||||
}
|
||||
}
|
||||
echo json_encode($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* update column foto_sperre in public.tbl_person
|
||||
* @access public
|
||||
* @param boolean $value new value for the column
|
||||
* @return boolean the new value added to the column in public.tbl_person
|
||||
*/
|
||||
public function foto_sperre_function($value)
|
||||
{
|
||||
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
|
||||
if (isError($res)) {
|
||||
show_error("error while trying to update table public.tbl_person");
|
||||
}
|
||||
$this->PersonModel->addSelect("foto_sperre");
|
||||
$res = $this->PersonModel->load($this->pid);
|
||||
if (isError($res)) {
|
||||
show_error("error while trying to query table public.tbl_person");
|
||||
}
|
||||
$res = hasData($res) ? getData($res)[0] : null;
|
||||
echo json_encode($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all nations in the table bis.tbl_nation
|
||||
*
|
||||
* @access public
|
||||
* @return array all the nations in table bis.tbl_nation
|
||||
*/
|
||||
public function getAllNationen()
|
||||
{
|
||||
$this->load->model('codex/Nation_model', "NationModel");
|
||||
$this->NationModel->addSelect(["nation_code as code", "langtext"]);
|
||||
$nation_res = $this->NationModel->load();
|
||||
if (isError($nation_res)) {
|
||||
show_error("error while trying to query table codex.tbl_nation");
|
||||
}
|
||||
$nation_res = hasData($nation_res) ? getData($nation_res) : null;
|
||||
echo json_encode($nation_res);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets specific gemeinden which are related to the ZIP and the Nation passed in the body of the get request
|
||||
* @access public
|
||||
* @var $_GET function uses GET request payload
|
||||
* @return boolean the new value added to the column in public.tbl_person
|
||||
*/
|
||||
public function getGemeinden()
|
||||
{
|
||||
/** @var $nation value parsed out of the body of the get request */
|
||||
$nation = $this->input->get('nation', true);
|
||||
/** @var $zip value parsed out of the body of the get request and converted to a php integer with json_decode */
|
||||
$zip = json_decode($this->input->get('zip', true));
|
||||
|
||||
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
|
||||
$this->GemeindeModel->addDistinct();
|
||||
$this->GemeindeModel->addSelect(["name"]);
|
||||
if ($nation == "A") {
|
||||
if (isset($zip) && $zip > 999 && $zip < 32000) {
|
||||
|
||||
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
|
||||
if (isError($gemeinde_res)) {
|
||||
show_error("error while trying to query bis.tbl_gemeinde");
|
||||
}
|
||||
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
|
||||
$gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->name;
|
||||
}, $gemeinde_res);
|
||||
echo json_encode($gemeinde_res);
|
||||
|
||||
} else {
|
||||
echo json_encode(error("ortschaftskennziffer code was not valid"));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(error("Nation was not 'A' (Austria)"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* function that returns the data used for viewing another mitarbeiter profile
|
||||
* @access private
|
||||
* @param integer $uid the userID to retrieve the mitarbeiter data
|
||||
* @return stdClass restricted mitarbeiter data
|
||||
*/
|
||||
private function viewMitarbeiterProfil($uid)
|
||||
{
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$benutzer_funktion_res = $this->getBenutzerFunktion($uid);
|
||||
$benutzer_res = $this->getBenutzerAlias($uid);
|
||||
$person_res = $this->getPersonInfo($uid);
|
||||
$mitarbeiter_res = $this->getMitarbeiterInfo($uid);
|
||||
$telefon_res = $this->getTelefonInfo($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Info
|
||||
foreach ($person_res as $key => $val) {
|
||||
$res->$key = $val;
|
||||
}
|
||||
|
||||
//? Mitarbeiter Info
|
||||
foreach ($mitarbeiter_res as $key => $val) {
|
||||
$res->$key = $val;
|
||||
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $uid . "@" . DOMAIN;
|
||||
$extern_email = array();
|
||||
$extern_email["type"] = "alias";
|
||||
$extern_email["email"] = $benutzer_res->alias . "@" . DOMAIN;
|
||||
$res->emails = array($intern_email, $extern_email);
|
||||
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
$res->standort_telefon = isset($telefon_res) ? $telefon_res->kontakt : null;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for viewing another student profile
|
||||
* @access private
|
||||
* @param integer $uid the userID to retrieve the student data
|
||||
* @return stdClass restricted student data
|
||||
*/
|
||||
private function viewStudentProfil($uid)
|
||||
{
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$person_res = $this->getPersonInfo($uid);
|
||||
$student_res = $this->getStudentInfo($uid);
|
||||
$matr_res = $this->getMatrikelNummer($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Student Information
|
||||
foreach ($student_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $uid . "@" . DOMAIN;
|
||||
|
||||
$res->emails = [$intern_email];
|
||||
$res->matrikelnummer = $matr_res->matr_nr;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for the mitarbeiter profile
|
||||
* @access private
|
||||
* @return stdClass mitarbeiter data
|
||||
*/
|
||||
private function mitarbeiterProfil()
|
||||
{
|
||||
|
||||
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($this->uid);
|
||||
$adresse_res = $this->getAdressenInfo($this->pid);
|
||||
$kontakte_res = $this->getKontaktInfo($this->pid);
|
||||
$mailverteiler_res = $this->getMailverteiler($this->uid);
|
||||
$person_res = $this->getPersonInfo($this->uid, true);
|
||||
$benutzer_funktion_res = $this->getBenutzerFunktion($this->uid);
|
||||
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($this->pid);
|
||||
$profilUpdates = $this->getProfilUpdates($this->uid);
|
||||
$telefon_res = $this->getTelefonInfo($this->uid);
|
||||
$mitarbeiter_res = $this->getMitarbeiterInfo($this->uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $this->uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Mitarbeiter Information
|
||||
foreach ($mitarbeiter_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
$res->adressen = $adresse_res;
|
||||
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
|
||||
$res->kontakte = $kontakte_res;
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $this->uid . "@" . DOMAIN;
|
||||
$extern_email = array();
|
||||
$extern_email["type"] = "alias";
|
||||
$extern_email["email"] = $mitarbeiter_res->alias . "@" . DOMAIN;
|
||||
$res->emails = [$intern_email, $extern_email];
|
||||
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
$res->standort_telefon = $telefon_res;
|
||||
$res->profilUpdates = $profilUpdates;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for the student profile
|
||||
* @access private
|
||||
* @return stdClass student data
|
||||
*/
|
||||
private function studentProfil()
|
||||
{
|
||||
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($this->pid);
|
||||
$kontakte_res = $this->getKontaktInfo($this->pid);
|
||||
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($this->uid);
|
||||
$adresse_res = $this->getAdressenInfo($this->pid);
|
||||
$mailverteiler_res = $this->getMailverteiler($this->uid);
|
||||
$person_res = $this->getPersonInfo($this->uid, true);
|
||||
$zutrittsgruppe_res = $this->getZutrittsgruppen($this->uid);
|
||||
$student_res = $this->getStudentInfo($this->uid);
|
||||
$matr_res = $this->getMatrikelNummer($this->uid);
|
||||
$profilUpdates = $this->getProfilUpdates($this->uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $this->uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Student Information
|
||||
foreach ($student_res as $key => $value) {
|
||||
$res->$key = trim($value);
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $this->uid . "@" . DOMAIN;
|
||||
|
||||
$res->emails = [$intern_email];
|
||||
$res->adressen = $adresse_res;
|
||||
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
|
||||
$res->kontakte = $kontakte_res;
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->matrikelnummer = $matr_res->matr_nr;
|
||||
$res->zuttritsgruppen = $zutrittsgruppe_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
$res->profilUpdates = $profilUpdates;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the mailverteiler using the tables: tbl_benutzer, tbl_benutzergruppe, tbl_gruppe
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the mailverteiler
|
||||
* @return array returns the mailvertailer corresponding to a userID
|
||||
*/
|
||||
private function getMailverteiler($uid)
|
||||
{
|
||||
$this->PersonModel->addSelect('gruppe_kurzbz, beschreibung');
|
||||
$this->PersonModel->addJoin('tbl_benutzer', 'person_id');
|
||||
$this->PersonModel->addJoin('tbl_benutzergruppe', 'uid');
|
||||
$this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
|
||||
|
||||
$mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $uid));
|
||||
if (isError($mailverteiler_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($mailverteiler_res));
|
||||
}
|
||||
$mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null;
|
||||
$mailverteiler_res = array_map(function ($element) {
|
||||
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
|
||||
return $element;
|
||||
}, $mailverteiler_res);
|
||||
return $mailverteiler_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the Benutzerfunktionen of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the Benutzerfunktionen
|
||||
* @return array returns the Benutzerfunktionen corresponding to a userID
|
||||
*/
|
||||
private function getBenutzerFunktion($uid)
|
||||
{
|
||||
$this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"]);
|
||||
$this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz");
|
||||
|
||||
$benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid' => $uid));
|
||||
if (isError($benutzer_funktion_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzerfunktion:" . getData($benutzer_funktion_res));
|
||||
}
|
||||
$benutzer_funktion_res = hasData($benutzer_funktion_res) ? getData($benutzer_funktion_res) : null;
|
||||
return $benutzer_funktion_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the Betriebsmittel of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the Betriebsmittel
|
||||
* @return array returns the Betriebsmittel corresponding to a userID
|
||||
*/
|
||||
private function getBetriebsmittelInfo($pid)
|
||||
{
|
||||
$this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel", "nummer as Nummer", "ausgegebenam as Ausgegeben_am"]);
|
||||
|
||||
//? betriebsmittel are not needed in a view
|
||||
$betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($pid);
|
||||
if (isError($betriebsmittelperson_res)) {
|
||||
show_error("was not able to query the table public.tbl_betriebsmittelperson:" . getData($betriebsmittelperson_res));
|
||||
}
|
||||
$betriebsmittelperson_res = hasData($betriebsmittelperson_res) ? getData($betriebsmittelperson_res) : null;
|
||||
return $betriebsmittelperson_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the alias of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the alias
|
||||
* @return string the alias of the userID
|
||||
*/
|
||||
private function getBenutzerAlias($uid)
|
||||
{
|
||||
$this->BenutzerModel->addSelect(["alias"]);
|
||||
$benutzer_res = $this->BenutzerModel->load([$uid]);
|
||||
if (isError($benutzer_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($benutzer_res));
|
||||
} else {
|
||||
$benutzer_res = hasData($benutzer_res) ? getData($benutzer_res)[0] : null;
|
||||
}
|
||||
|
||||
return $benutzer_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the person information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the person information
|
||||
* @param integer $geburtsInfo flag wether to add the columns gebort, gebdatum, foto_sperre or not
|
||||
* @return array all the person informaion corresponding to a userID
|
||||
*/
|
||||
private function getPersonInfo($uid, $geburtsInfo = null)
|
||||
{
|
||||
$selectClause = ["foto", "anrede", "titelpost as postnomen", "titelpre as titel", "vorname", "nachname"];
|
||||
/** @param integer $geburtsInfo */
|
||||
if ($geburtsInfo) {
|
||||
array_push($selectClause, "gebort");
|
||||
array_push($selectClause, "gebdatum");
|
||||
array_push($selectClause, "foto_sperre");
|
||||
}
|
||||
$this->BenutzerModel->addSelect($selectClause);
|
||||
$this->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
|
||||
$person_res = $this->BenutzerModel->load([$uid]);
|
||||
if (isError($person_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($person_res));
|
||||
} else {
|
||||
$person_res = hasData($person_res) ? getData($person_res)[0] : null;
|
||||
}
|
||||
|
||||
return $person_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the mitarbeiter information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the mitarbeiter information
|
||||
* @return array all the mitarbeiter informaion corresponding to a userID
|
||||
*/
|
||||
private function getMitarbeiterInfo($uid)
|
||||
{
|
||||
$this->MitarbeiterModel->addSelect(["kurzbz", "telefonklappe", "alias", "ort_kurzbz"]);
|
||||
$this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid");
|
||||
$mitarbeiter_res = $this->MitarbeiterModel->load($uid);
|
||||
if (isError($mitarbeiter_res)) {
|
||||
show_error("was not able to query the table public.tbl_mitarbeiter:" . getData($mitarbeiter_res));
|
||||
} else {
|
||||
$mitarbeiter_res = hasData($mitarbeiter_res) ? getData($mitarbeiter_res)[0] : null;
|
||||
}
|
||||
|
||||
return $mitarbeiter_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the telefon information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the telefon information
|
||||
* @return array all the telefon informaion corresponding to a userID
|
||||
*/
|
||||
private function getTelefonInfo($uid)
|
||||
{
|
||||
$this->MitarbeiterModel->addSelect(["kontakt"]);
|
||||
$this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id");
|
||||
$this->MitarbeiterModel->addLimit(1);
|
||||
$telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid" => $uid, "kontakttyp" => "telefon"]);
|
||||
if (isError($telefon_res)) {
|
||||
show_error("was not able to query the table public.tbl_mitarbeiter:" . getData($telefon_res));
|
||||
}
|
||||
$telefon_res = hasData($telefon_res) ? getData($telefon_res)[0] : null;
|
||||
return $telefon_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the student information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the student information
|
||||
* @return array all the student informaion corresponding to a userID
|
||||
*/
|
||||
private function getStudentInfo($uid)
|
||||
{
|
||||
$this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen']);
|
||||
$this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz");
|
||||
|
||||
$student_res = $this->StudentModel->load([$uid]);
|
||||
if (isError($student_res)) {
|
||||
show_error("was not able to query the table public.tbl_student:" . getData($student_res));
|
||||
}
|
||||
$student_res = hasData($student_res) ? getData($student_res)[0] : null;
|
||||
return $student_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the profil updates corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the profil updates
|
||||
* @return array all the profil updates corresponding to a userID
|
||||
*/
|
||||
private function getProfilUpdates($uid)
|
||||
{
|
||||
$profilUpdates = $this->ProfilUpdateModel->getProfilUpdatesWhere(['uid' => $uid]);
|
||||
if (isError($profilUpdates)) {
|
||||
show_error("was not able to query the table public.tbl_profil_update:" . getData($profilUpdates));
|
||||
}
|
||||
$profilUpdates = hasData($profilUpdates) ? getData($profilUpdates) : null;
|
||||
return $profilUpdates;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the Matrikelnummer corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the Matrikelnummer
|
||||
* @return integer the Matrikelnummer corresponding to a userID
|
||||
*/
|
||||
private function getMatrikelNummer($uid)
|
||||
{
|
||||
$this->BenutzerModel->addSelect(["matr_nr"]);
|
||||
$this->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
|
||||
$matr_res = $this->BenutzerModel->load([$uid]);
|
||||
if (isError($matr_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($matr_res));
|
||||
}
|
||||
$matr_res = hasData($matr_res) ? getData($matr_res)[0] : [];
|
||||
return $matr_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the Zutrittsgruppen corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the Zutrittsgruppen
|
||||
* @return array all the Zutrittsgruppen corresponding to a userID
|
||||
*/
|
||||
private function getZutrittsgruppen($uid)
|
||||
{
|
||||
$this->BenutzergruppeModel->addSelect(['bezeichnung']);
|
||||
$this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
|
||||
|
||||
$zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid" => $uid, "zutrittssystem" => true));
|
||||
if (isError($zutrittsgruppe_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzergruppe:" . getData($zutrittsgruppe_res));
|
||||
}
|
||||
$zutrittsgruppe_res = hasData($zutrittsgruppe_res) ? getData($zutrittsgruppe_res) : null;
|
||||
return $zutrittsgruppe_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the address information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the address information
|
||||
* @return array all the address information corresponding to a userID
|
||||
*/
|
||||
private function getAdressenInfo($pid)
|
||||
{
|
||||
$adresse_res = $this->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
|
||||
$adresse_res = $this->AdresseModel->addOrder("zustelladresse", "DESC");
|
||||
$adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
|
||||
|
||||
$adresse_res = $this->AdresseModel->loadWhere(["person_id" => $pid]);
|
||||
if (isError($adresse_res)) {
|
||||
show_error("was not able to query the table public.tbl_adresse:" . getData($adresse_res));
|
||||
}
|
||||
$adresse_res = hasData($adresse_res) ? getData($adresse_res) : null;
|
||||
return $adresse_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the kontakt information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the kontakt information
|
||||
* @return array all the kontakt information corresponding to a userID
|
||||
*/
|
||||
private function getKontaktInfo($pid)
|
||||
{
|
||||
$this->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
|
||||
$this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT');
|
||||
$this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
|
||||
$this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
|
||||
|
||||
$kontakte_res = $this->KontaktModel->loadWhere(['person_id' => $pid]);
|
||||
if (isError($kontakte_res)) {
|
||||
show_error("was not able to query the table public.tbl_kontakt:" . getData($kontakte_res));
|
||||
}
|
||||
$kontakte_res = hasData($kontakte_res) ? getData($kontakte_res) : null;
|
||||
return $kontakte_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the date of issue of the FH access card corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the date of issue of the FH access card
|
||||
* @return string the date of issue of the FH access card corresponding to a userID
|
||||
*/
|
||||
private function getZutrittskarteDatum($uid)
|
||||
{
|
||||
$zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($uid, "Zutrittskarte");
|
||||
if (isError($zutrittskarte_ausgegebenam)) {
|
||||
show_error("was not able to query the table wavi.tbl_bentriebsmittelperson:" . getData($zutrittskarte_ausgegebenam));
|
||||
}
|
||||
$zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam) ? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null;
|
||||
|
||||
//? formats date from 01-01-2000 to 01.01.2000
|
||||
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
|
||||
return $zutrittskarte_ausgegebenam;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ProfilUpdate extends Auth_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
|
||||
'show' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r', 'basis/cis:r'],
|
||||
'id' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r']
|
||||
]);
|
||||
|
||||
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'profilUpdate'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('DmsLib');
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('Cis/ProfilUpdate');
|
||||
}
|
||||
|
||||
public function id($profil_update_id = null)
|
||||
{
|
||||
$this->load->view('Cis/ProfilUpdate', ['profil_update_id' => $profil_update_id]);
|
||||
}
|
||||
|
||||
public function show($dms_id)
|
||||
{
|
||||
$profil_update = $this->ProfilUpdateModel->loadWhere(['attachment_id' => $dms_id]);
|
||||
$profil_update = hasData($profil_update) ? getData($profil_update)[0] : null;
|
||||
|
||||
//? checks if an profil update exists with the dms_id requested from the user
|
||||
if ($profil_update)
|
||||
{
|
||||
$is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($profil_update->uid));
|
||||
$is_student_profil_update = getData($this->StudentModel->isStudent($profil_update->uid));
|
||||
|
||||
if (
|
||||
$this->permissionlib->isBerechtigt('student/stammdaten:r') && $is_student_profil_update ||
|
||||
$this->permissionlib->isBerechtigt('mitarbeiter/stammdaten:r') && $is_mitarbeiter_profil_update ||
|
||||
$this->uid == $profil_update->uid
|
||||
)
|
||||
{
|
||||
// Get file to be downloaded from DMS
|
||||
$newFilename = $this->uid . "/document_" . $dms_id;
|
||||
$download = $this->dmslib->download($dms_id);
|
||||
if (isError($download))
|
||||
return $download;
|
||||
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
else
|
||||
{
|
||||
show_error($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
show_error($this->p->t('profilUpdate', 'profilUpdate_dms_error'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Pub extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'bild' => ['basis/cis:r', 'assistenz:r']
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @param string $source [person|akte]
|
||||
* @param integer $id
|
||||
* @return void
|
||||
*/
|
||||
public function bild($source, $id)
|
||||
{
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$person_id_user = '';
|
||||
$serverzugriff = false;
|
||||
|
||||
// Wenn das Bild direkt aufgerufen wird, ist eine Authentifizierung erforderlich
|
||||
// Wenn es vom Server selbst aufgerufen wird, ist keine Auth. notwendig
|
||||
// (z.B. fuer die Erstellung von PDFs)
|
||||
if ($_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR']) {
|
||||
// Wenn Session gesetzt ist, keine Abfrage, da diese Personen noch keine UID haben
|
||||
|
||||
if (isset($_SESSION['incoming/user'])) { // Von Incomingtool
|
||||
$result = $this->PersonModel->loadWhere([
|
||||
'zugangscode' => $_SESSION['incoming/user']
|
||||
]);
|
||||
if (hasData($result))
|
||||
$person_id_user = current(getData($result))->person_id;
|
||||
} elseif (isset($_SESSION['prestudent/user'])) { // Von Prestudententool
|
||||
$result = $this->PersonModel->loadWhere([
|
||||
'zugangscode' => $_SESSION['prestudent/user']
|
||||
]);
|
||||
if (hasData($result))
|
||||
$person_id_user = current(getData($result))->person_id;
|
||||
} elseif (isset($_SESSION['bewerbung/personId'])) { // Von Bewerbungstool
|
||||
$person_id_user = $_SESSION['bewerbung/personId'];
|
||||
} else {
|
||||
$person_id_user = getAuthPersonId();
|
||||
}
|
||||
} else {
|
||||
$serverzugriff = true;
|
||||
}
|
||||
|
||||
// Default Bild (Dummy Profilbild)
|
||||
$cTmpHEX = base64_encode(file_get_contents(FHCPATH . 'skin/images/profilbild_dummy.jpg'));
|
||||
|
||||
if ($source == 'person' && $id) {
|
||||
$foto_gesperrt = false;
|
||||
// Person laden und Fotosperre überprüfen
|
||||
$result = $this->PersonModel->load($id);
|
||||
if (hasData($result)) {
|
||||
$person = current(getData($result));
|
||||
if ($person->foto_sperre) {
|
||||
// Wenn der User selbst darauf zugreift darf er das Bild sehen
|
||||
$foto_gesperrt = ($person_id_user != $id);
|
||||
} elseif (!$person_id_user && !$serverzugriff) {
|
||||
$foto_gesperrt = true;
|
||||
}
|
||||
|
||||
if ($person->foto && !$foto_gesperrt) {
|
||||
$cTmpHEX = base64_decode($person->foto);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($source == 'akte' && $id != '')
|
||||
{
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
|
||||
$this->AkteModel->addJoin('public.tbl_person', 'person_id');
|
||||
$result = $this->AkteModel->loadWhere([
|
||||
'person_id' => $id,
|
||||
'dokument_kurzbz' => 'Lichtbil'
|
||||
]);
|
||||
|
||||
if (hasData($result)) {
|
||||
$foto_gesperrt = false;
|
||||
|
||||
$akte = current(getData($result));
|
||||
if ($akte->foto_sperre) {
|
||||
// Wenn der User selbst darauf zugreift darf er das Bild sehen
|
||||
$foto_gesperrt = ($person_id_user != $id);
|
||||
} elseif (!$person_id_user && !$serverzugriff) {
|
||||
$foto_gesperrt = true;
|
||||
}
|
||||
|
||||
// Wenn das Foto nicht im Inhalt steht wird aus aus dem DMS geladen
|
||||
if (!$akte->inhalt && $akte->dms_id) {
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
$this->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->DmsModel->addOrder('version', 'DESC');
|
||||
$this->DmsModel->addLimit(1);
|
||||
$result = $this->DmsModel->load($akte->dms_id);
|
||||
|
||||
if (!hasData($result))
|
||||
die('Kein Dokument vorhanden');
|
||||
|
||||
$dms = current(getData($result));
|
||||
|
||||
$filename = DMS_PATH . $dms->filename;
|
||||
|
||||
$this->DmsVersionModel->update([
|
||||
'dms_id' => $dms->dms_id,
|
||||
'version' => $dms->version
|
||||
], [
|
||||
'letzterzugriff' => date('c')
|
||||
]);
|
||||
|
||||
if (file_exists($filename)) {
|
||||
$handle = fopen($filename, "r");
|
||||
if ($handle) {
|
||||
while (!feof($handle)) {
|
||||
$akte->inhalt .= fread($handle, 8192);
|
||||
}
|
||||
fclose($handle);
|
||||
} else {
|
||||
echo 'Fehler: Datei konnte nicht geoeffnet werden';
|
||||
}
|
||||
} else {
|
||||
echo 'Die Datei existiert nicht';
|
||||
}
|
||||
}
|
||||
|
||||
if ($akte->inhalt && !$foto_gesperrt) {
|
||||
$cTmpHEX = $akte->inhalt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// die bilder werden, sofern es funktioniert, in jpg umgewandelt da es sonst zu fehlern beim erstellen
|
||||
// von pdfs kommen kann.
|
||||
|
||||
$im = @imagecreatefromstring(base64_decode($cTmpHEX));
|
||||
if ($im) {
|
||||
@ob_clean();
|
||||
header("Content-type: image/jpeg");
|
||||
exit(imagejpeg($im));
|
||||
} else {
|
||||
// bei manchen Bildern funktioniert die konvertierung nicht
|
||||
// diese werden dann einfach so angezeigt.
|
||||
@ob_clean();
|
||||
header("Content-type: image/gif");
|
||||
exit($cTmpHEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Raumsuche extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Raumsuche']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Studium extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* index loads the Studium view
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'studium']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Cis4 extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'basis/cis:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id,
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'FhcDashboard']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Cms extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'content' => 'basis/cis:r',
|
||||
'getNews' => 'basis/cis:r',
|
||||
'getNewsRowCount' => 'basis/cis:r',
|
||||
'getRoomInformation' => 'basis/cis:r',
|
||||
'news' => 'basis/cis:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads Libraries
|
||||
$this->load->library('CmsLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @param int $version
|
||||
* @param string $sprache
|
||||
* @param boolean $sichtbar
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function content($content_id, $version = null, $sprache = null, $sichtbar = true)
|
||||
{
|
||||
// return early if the content_id for the content is missing
|
||||
if (!isset($content_id))
|
||||
$this->terminateWithError("content_id is missing");
|
||||
|
||||
$content = $this->ContentModel->load($content_id);
|
||||
if (isError($content))
|
||||
$this->terminateWithError(getError($content));
|
||||
|
||||
$content = getData($content);
|
||||
if (NULL === $content)
|
||||
$this->terminateWithError("Content not found");
|
||||
|
||||
$content = current($content);
|
||||
|
||||
$viewData = array(
|
||||
'content_id' => $content_id,
|
||||
'template_kurzbz' => $content->template_kurzbz,
|
||||
'version' => $version,
|
||||
'sichtbar' => $sichtbar
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Content']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $infoscreen
|
||||
* @param string | null $studiengang_kz
|
||||
* @param int | null $semester
|
||||
* @param boolean $mischen
|
||||
* @param string $titel
|
||||
* @param boolean $edit
|
||||
* @param boolean $sichtbar
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
|
||||
{
|
||||
$viewData = array();
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData'=>$viewData, 'route' => 'News']);
|
||||
}
|
||||
|
||||
public function getRoomInformation($ort_kurzbz)
|
||||
{
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
|
||||
$viewData = array(
|
||||
'ort_kurzbz' => $ort_kurzbz,
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'CmsRoom']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Dashboard extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller handles output and access to documents.
|
||||
* It creates a XML file, transforms it with the XSL-FO Vorlage from the
|
||||
* database and generates a PDF file with unoconv or docsbox.
|
||||
* This file is then outputted as download.
|
||||
*
|
||||
* It is the CodeIgniter version of content/pdfExport.php when not using the
|
||||
* get paremeters: "archivdokument" and "archive".
|
||||
* Use exportSigned() instead of providing the "sign" get parameter and
|
||||
* export() otherwise.
|
||||
*/
|
||||
class Documents extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'export' => self::PERM_LOGGED,
|
||||
'exportSigned' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'stv'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download a not signed document.
|
||||
*
|
||||
* @param string $xml
|
||||
* @param string $xsl
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function export($xml, $xsl)
|
||||
{
|
||||
return $this->_export($xml, $xsl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download a signed document.
|
||||
*
|
||||
* @param string $xml
|
||||
* @param string $xsl
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportSigned($xml, $xsl)
|
||||
{
|
||||
return $this->_export($xml, $xsl, getAuthUID());
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for export() and exportSigned()
|
||||
*
|
||||
* @param string $xml
|
||||
* @param string $xsl
|
||||
* @param string $sign_user (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _export($xml, $xsl, $sign_user = null)
|
||||
{
|
||||
$xsl_oe_kurzbz = null;
|
||||
$version = $this->input->post_get('version') ?: null;
|
||||
|
||||
// Get the OE or STG of the document
|
||||
$xsl_oe_kurzbz = $this->input->post_get('xsl_oe_kurzbz')
|
||||
?: $this->input->post_get('xsl_stg_kz')
|
||||
?: $this->input->post_get('stg_kz');
|
||||
if (is_null($xsl_oe_kurzbz)) {
|
||||
$uid = $this->input->post_get('uid');
|
||||
if ($uid) {
|
||||
$uid = current(explode(';', $uid));
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->load([$uid]);
|
||||
if (!isError($result) && hasData($result))
|
||||
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
|
||||
}
|
||||
}
|
||||
if (is_null($xsl_oe_kurzbz)) {
|
||||
$prestudent_id = $this->input->post_get('prestudent_id');
|
||||
if ($prestudent_id) {
|
||||
$prestudent_id = current(explode(';', $prestudent_id));
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load($prestudent_id);
|
||||
if (!isError($result) && hasData($result))
|
||||
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
|
||||
}
|
||||
}
|
||||
if (is_null($xsl_oe_kurzbz))
|
||||
$xsl_oe_kurzbz = 0;
|
||||
|
||||
// Access rights
|
||||
if ($xsl == 'AccountInfo') {
|
||||
$this->load->model('resource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$uids = $this->input->post_get('uid');
|
||||
if ($uids) {
|
||||
$uids = explode(';', $uids);
|
||||
foreach ($uids as $uid) {
|
||||
$result = $this->MitarbeiterModel->load($uid);
|
||||
if (!isError($result) && hasData($result)) {
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid', 0)
|
||||
&& !$this->permissionlib->isBerechtigt('mitarbeiter', 'suid', 0))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'mitarbeiter:rw']]);
|
||||
} else {
|
||||
$result = $this->StudentModel->load([$uid]);
|
||||
if (!isError($result) && hasData($result)) {
|
||||
$student = current(getData($result));
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $student->studiengang_kz)
|
||||
&& !$this->permissionlib->isBerechtigt('admin', 'suid', 0)
|
||||
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', $student->studiengang_kz)
|
||||
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', 0)
|
||||
&& !$this->permissionlib->isBerechtigt('support', 'suid', 0))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw', 'support:rw']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
|
||||
$result = $this->VorlagestudiengangModel->getCurrent($xsl, $xsl_oe_kurzbz, $version);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
if (!hasData($result))
|
||||
return show_404();
|
||||
|
||||
$access_rights = current(getData($result))->berechtigung;
|
||||
if (!$access_rights)
|
||||
return show_404();
|
||||
$allowed = false;
|
||||
foreach ($access_rights as $access_right) {
|
||||
if ($this->permissionlib->isBerechtigt($access_right)) {
|
||||
$allowed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$allowed)
|
||||
return $this->_outputAuthError([$this->router->method => $access_rights]);
|
||||
}
|
||||
|
||||
// Output format
|
||||
$outputformat = $this->input->post_get('output') ?: 'pdf';
|
||||
if ($outputformat != 'pdf'
|
||||
// An der FHTW darf das Studienblatt und das Prüfungsprotokoll auch in anderen Formaten exportiert werden
|
||||
&& !(CAMPUS_NAME == 'FH Technikum Wien'
|
||||
&& ($xsl == 'Studienblatt'
|
||||
|| $xsl == 'StudienblattEng'
|
||||
|| $xsl == 'PrProtBA'
|
||||
|| $xsl == 'PrProtBAEng'
|
||||
|| $xsl == 'PrProtMA'
|
||||
|| $xsl == 'PrProtMAEng'
|
||||
)
|
||||
)
|
||||
&& !$this->permissionlib->isBerechtigt('system/change_outputformat', null, $xsl_oe_kurzbz)
|
||||
) {
|
||||
$outputformat = 'pdf';
|
||||
}
|
||||
|
||||
// XML Params
|
||||
$params = 'xmlformat=xml';
|
||||
foreach ([
|
||||
'uid',
|
||||
'stg_kz',
|
||||
'person_id',
|
||||
'id',
|
||||
'prestudent_id',
|
||||
'buchungsnummern',
|
||||
'ss',
|
||||
'abschlusspruefung_id',
|
||||
'typ',
|
||||
'all',
|
||||
'preoutgoing_id',
|
||||
'lvid',
|
||||
'projekt_kurzbz',
|
||||
'von',
|
||||
'bis',
|
||||
'stundevon',
|
||||
'stundebis',
|
||||
'sem',
|
||||
'lehreinheit',
|
||||
'mitarbeiter_uid',
|
||||
'studienordnung_id',
|
||||
'fixangestellt',
|
||||
'standort',
|
||||
'abrechnungsmonat',
|
||||
'form',
|
||||
'projektarbeit_id',
|
||||
'betreuerart_kurzbz',
|
||||
'studiensemester_kurzbz'
|
||||
] as $key) {
|
||||
$value = $this->input->post_get($key);
|
||||
if ($value !== null)
|
||||
$params .= '&' . $key . '=' . urlencode($value);
|
||||
}
|
||||
$value = $this->input->post_get('vertrag_id');
|
||||
if ($value !== null) {
|
||||
foreach ($value as $id)
|
||||
$params .= '&vertrag_id[]=' . urlencode($id);
|
||||
}
|
||||
|
||||
$this->load->library('DocumentExportLib');
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
$result = $this->VorlageModel->load($xsl);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
if (!hasData($result))
|
||||
show_404();
|
||||
|
||||
$vorlage = current(getData($result));
|
||||
if ($sign_user && !$vorlage->signierbar)
|
||||
return show_error($this->p->t("stv", "grades_error_sign"));
|
||||
|
||||
|
||||
// Filename
|
||||
$filename = ($vorlage->bezeichnung ?: $vorlage->vorlage_kurzbz);
|
||||
switch ($xsl) {
|
||||
case 'LV_Informationen':
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->load($this->input->post_get('stg_kz'));
|
||||
if (!isError($result) && hasData($result))
|
||||
$filename .= '_' . sanitizeProblemChars(current(getData($result))->kurzbzlang);
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$result = $this->StudiensemesterModel->load($this->input->post_get('ss'));
|
||||
if (!isError($result) && hasData($result))
|
||||
$filename .= '_' . sanitizeProblemChars(current(getData($result))->studiensemester_kurzbz);
|
||||
break;
|
||||
case 'Honorarvertrag':
|
||||
$uid = str_replace(';', '', $this->input->post_get('uid') ?: '');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->BenutzerModel->addJoin('public.tbl_person', 'person_id', 'LEFT');
|
||||
$result = $this->BenutzerModel->load([$uid]);
|
||||
if (!isError($result) && hasData($result)) {
|
||||
$user = current(getData($result));
|
||||
$filename .= '_' . sanitizeProblemChars($user->nachname) . '_' . sanitizeProblemChars($user->vorname);
|
||||
}
|
||||
break;
|
||||
case 'Studienordnung':
|
||||
$filename = 'Studienordnung-Studienplan-';
|
||||
|
||||
$this->load->model('organisation/Studienordnung_model', 'StudienordnungModel');
|
||||
$result = $this->StudienordnungModel->load($this->input->post_get('studienordnung_id'));
|
||||
if (!isError($result) && hasData($result)) {
|
||||
$so = current(getData($result));
|
||||
$filename .= sprintf("%'.04d", $so->studiengang_kz) . '-' . $so->studiengangkurzbzlang;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$uid = str_replace(';', '', $this->input->post_get('uid') ?: '');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->BenutzerModel->addJoin('public.tbl_person', 'person_id', 'LEFT');
|
||||
$result = $this->BenutzerModel->load([$uid]);
|
||||
if (!isError($result) && hasData($result)) {
|
||||
$user = current(getData($result));
|
||||
$filename .= '_' . sanitizeProblemChars($user->nachname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// XML Data
|
||||
$result = $this->documentexportlib->getDataURL($xml, $params);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
// Output
|
||||
$this->documentexportlib->showContent($filename, $vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class LVVerwaltung extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function _remap()
|
||||
{
|
||||
$this->load->view('LVVerwaltung', [
|
||||
'permissions' => [
|
||||
'lehre/lehrveranstaltung' => $this->permissionlib->isBerechtigt('lehre/lehrveranstaltung'),
|
||||
'lv-plan/gruppenentfernen' => $this->permissionlib->isBerechtigt('lv-plan/gruppenentfernen'),
|
||||
'lv-plan/lektorentfernen' => $this->permissionlib->isBerechtigt('lv-plan/lektorentfernen'),
|
||||
],
|
||||
'variables' => [
|
||||
'semester_aktuell' => $this->variablelib->getVar('semester_aktuell')
|
||||
],
|
||||
'configs' => [
|
||||
'showVertragsdetails' => defined('FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN') && FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN,
|
||||
'showGewichtung' => defined('CIS_GESAMTNOTE_GEWICHTUNG') && CIS_GESAMTNOTE_GEWICHTUNG,
|
||||
'lehreinheitAnmerkungDefault' => defined('LEHREINHEIT_ANMERKUNG_DEFAULT') ? LEHREINHEIT_ANMERKUNG_DEFAULT : '',
|
||||
'lehreinheitRaumtypDefault' => defined('DEFAULT_LEHREINHEIT_RAUMTYP') ? DEFAULT_LEHREINHEIT_RAUMTYP : '',
|
||||
'lehreinheitRaumtypAlternativeDefault' => defined('DEFAULT_LEHREINHEIT_RAUMTYP_ALTERNATIV') ? DEFAULT_LEHREINHEIT_RAUMTYP_ALTERNATIV : ''
|
||||
]
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class NeueNachricht extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['vertrag/mitarbeiter:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function _remap()
|
||||
{
|
||||
$typeid = $this->input->post('typeid');
|
||||
$ids = ($this->input->post('ids') && strpos($this->input->post('ids'), ','))
|
||||
? explode(',', $this->input->post('ids'))
|
||||
: $this->input->post('ids');
|
||||
|
||||
//now working
|
||||
$this->load->view('Nachrichten', [
|
||||
'permissions' => [
|
||||
'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz','suid'),
|
||||
],
|
||||
'ids' => $ids,
|
||||
'typeid' => $typeid
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studentenverwaltung extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function _remap()
|
||||
{
|
||||
$this->load->view('Studentenverwaltung', [
|
||||
'permissions' => [
|
||||
'student/bpk' => $this->permissionlib->isBerechtigt('student/bpk'),
|
||||
'student/alias' => $this->permissionlib->isBerechtigt('student/alias'),
|
||||
'basis/prestudent' => $this->permissionlib->isBerechtigt('basis/prestudent'),
|
||||
'basis/prestudentstatus' => $this->permissionlib->isBerechtigt('basis/prestudentstatus'),
|
||||
'assistenz_stgs' => $this->permissionlib->getSTG_isEntitledFor('assistenz'),
|
||||
'admin' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz','suid'),
|
||||
'student/keine_studstatuspruefung' => $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung'),
|
||||
'lehre/reihungstestAufsicht' => $this->permissionlib->isBerechtigt('lehre/reihungstestAufsicht'),
|
||||
'system/change_outputformat' => $this->permissionlib->getOE_isEntitledFor('system/change_outputformat'),
|
||||
'student/editBakkZgv' => $this->permissionlib->isBerechtigt('student/editBakkZgv'),
|
||||
'student/editMakkZgv' => $this->permissionlib->isBerechtigt('student/editMakkZgv'),
|
||||
'student/editDokZgv' => $this->permissionlib->isBerechtigt('student/editDokZgv'),
|
||||
'student/editBismelden' => $this->permissionlib->isBerechtigt('student/editBismelden')
|
||||
],
|
||||
'variables' => [
|
||||
'semester_aktuell' => $this->variablelib->getVar('semester_aktuell')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
if ( !defined("PHPUNIT_TEST") ) {
|
||||
show_404();
|
||||
}
|
||||
|
||||
class Test extends CI_Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
// Yep... This is all we need.
|
||||
ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL);
|
||||
ini_set('display_errors', '1');
|
||||
ini_set('display_startup_errors', '1');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Ampeln extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'open' => self::PERM_LOGGED,
|
||||
'all' => self::PERM_LOGGED,
|
||||
'confirm' => self::PERM_LOGGED,
|
||||
'alleAmpeln' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('content/Ampel_model', 'AmpelModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* confirms ampel and inserts ampel_id in public.tbl_ampel_benutzer_bestaetigt
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function confirm($ampel_id)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data(['ampel_id'=> $ampel_id]);
|
||||
$this->form_validation->set_rules('ampel_id', 'Ampel ID', 'required|integer');
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// load Ampel_benutzer_bestaetigt_model to confirm the ampel
|
||||
$this->load->model('content/Ampel_Benutzer_Bestaetigt_model', 'AmpelBenutzerBestaetigtModel');
|
||||
$insert_into_result = $this->AmpelBenutzerBestaetigtModel->insert(["ampel_id"=> $ampel_id, "uid"=> $this->uid]);
|
||||
|
||||
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
|
||||
|
||||
$this->terminateWithSuccess($insert_into_result);
|
||||
}
|
||||
|
||||
/**
|
||||
* queries active and not confirmed ampeln by the user
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function open()
|
||||
{
|
||||
$userAmpeln = array();
|
||||
|
||||
// fetch active ampeln
|
||||
$activeAmpeln = $this->AmpelModel->openActive($this->uid, false);
|
||||
|
||||
$activeAmpeln = $this->getDataOrTerminateWithError($activeAmpeln);
|
||||
|
||||
foreach ($activeAmpeln as $ampel) {
|
||||
// only include non confirmed active ampeln in the result
|
||||
if (!$ampel->bestaetigt) {
|
||||
// check if the user was assigned to the ampel
|
||||
$zugeteilt = $this->AmpelModel->isZugeteilt($this->uid, $ampel->benutzer_select);
|
||||
|
||||
$zugeteilt = $this->getDataOrTerminateWithError($zugeteilt);
|
||||
|
||||
if($zugeteilt) $userAmpeln[] = $ampel;
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($userAmpeln);
|
||||
}
|
||||
|
||||
/**
|
||||
* queries all ampeln of the user
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$userAmpeln = array();
|
||||
|
||||
$ampel_result = $this->AmpelModel->active(false, $this->uid);
|
||||
|
||||
$ampel_result = $this->getDataOrTerminateWithError($ampel_result);
|
||||
|
||||
foreach ($ampel_result as $ampel) {
|
||||
// check if the ampel was assigned to the user
|
||||
$zugeteilt = $this->AmpelModel->isZugeteilt($this->uid, $ampel->benutzer_select);
|
||||
|
||||
$zugeteilt = $this->getDataOrTerminateWithError($zugeteilt);
|
||||
|
||||
if ($zugeteilt) $userAmpeln[] = $ampel;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($userAmpeln);
|
||||
}
|
||||
|
||||
/**
|
||||
* queries all ampeln that were assigned to the user until start of first work day
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function alleAmpeln()
|
||||
{
|
||||
|
||||
//fetch all ampeln
|
||||
$alle_ampeln = $this->AmpelModel->alleAmpeln($this->uid);
|
||||
|
||||
$alle_ampeln = $this->getDataOrTerminateWithError($alle_ampeln);
|
||||
|
||||
$alle_ampeln = array_map(function ($ampel) {
|
||||
// check if ampel is confirmed by user
|
||||
$confirmedByUser = $this->AmpelModel->isConfirmed($ampel->ampel_id, $this->uid);
|
||||
$ampel->bestaetigt = $confirmedByUser;
|
||||
return $ampel;
|
||||
}, $alle_ampeln);
|
||||
|
||||
$this->terminateWithSuccess($alle_ampeln);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class AuthInfo extends FHCAPI_Controller
|
||||
{
|
||||
protected $uid;
|
||||
protected $pid;
|
||||
protected $isMitarbeiter;
|
||||
protected $isStudent;
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAuthUID' => self::PERM_LOGGED,
|
||||
'getAuthInfo' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
$this->isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter($this->uid)) ?? false;
|
||||
$this->isStudent = getData($this->StudentModel->isStudent($this->uid)) ?? false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* returns the uid of the currently logged in user
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function getAuthUID()
|
||||
{
|
||||
$this->terminateWithSuccess(['uid'=>$this->uid]);
|
||||
}
|
||||
|
||||
public function getAuthInfo()
|
||||
{
|
||||
$data = (object) array(
|
||||
'uid' => $this->uid,
|
||||
'isMitarbeiter' => $this->isMitarbeiter,
|
||||
'isStudent' => $this->isStudent
|
||||
);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Bookmark extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getBookmarks' => self::PERM_LOGGED,
|
||||
'delete' => self::PERM_LOGGED,
|
||||
'insert' => self::PERM_LOGGED,
|
||||
'update' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('dashboard/Bookmark_model', 'BookmarkModel');
|
||||
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* gets the bookmarks associated to a user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBookmarks()
|
||||
{
|
||||
$this->BookmarkModel->addOrder("bookmark_id");
|
||||
$bookmarks = $this->BookmarkModel->loadWhere(["uid"=>$this->uid]);
|
||||
|
||||
$bookmarks = $this->getDataOrTerminateWithError($bookmarks);
|
||||
|
||||
$this->terminateWithSuccess($bookmarks);
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes bookmark from associated user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($bookmark_id)
|
||||
{
|
||||
$bookmark = $this->BookmarkModel->load($bookmark_id);
|
||||
|
||||
$bookmark = current($this->getDataOrTerminateWithError($bookmark));
|
||||
|
||||
// only delete bookmark if the user is the owner of the bookmark
|
||||
if($bookmark->uid == $this->uid || $this->permissionlib->isBerechtigt('admin')){
|
||||
|
||||
$delete_result = $this->BookmarkModel->delete($bookmark_id);
|
||||
|
||||
$delete_result = $this->getDataOrTerminateWithError($delete_result);
|
||||
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
}else{
|
||||
$this->_outputAuthError(['delete' => ['admin:rw']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inserts new bookmark into the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function insert()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url',true);
|
||||
$title = $this->input->post('title',true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
|
||||
$insert_into_result = $this->BookmarkModel->insert(['uid'=>$this->uid, 'url'=>$url, 'title'=>$title,'tag'=>$tag, 'insertvon'=>$this->uid, 'updateamum'=>NULL, 'updatevon'=>NULL]);
|
||||
|
||||
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
|
||||
|
||||
$this->terminateWithSuccess($insert_into_result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* updates bookmark in the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function update($bookmark_id)
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url',true);
|
||||
$title = $this->input->post('title',true);
|
||||
|
||||
$now = new DateTime();
|
||||
$now = $now->format('Y-m-d H:i:s');
|
||||
|
||||
$update_result = $this->BookmarkModel->update($bookmark_id,['url'=>$url, 'title'=>$title,'updateamum'=>$now]);
|
||||
|
||||
$update_result = $this->getDataOrTerminateWithError($update_result);
|
||||
|
||||
$this->terminateWithSuccess($update_result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Cis4FhcApi extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches ViewData
|
||||
*/
|
||||
public function getViewData()
|
||||
{
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
class CisMenu extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getMenu' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches the menu for CIS from the database based on the userLanguage
|
||||
*/
|
||||
public function getMenu()
|
||||
{
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->config('cis');
|
||||
$cis4_content_id =$this->config->item('cis_menu_root_content_id');
|
||||
$result = $this->ContentModel->getMenu($cis4_content_id, getAuthUID(),getUserLanguage());
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
$menu = $result->childs ?? [];
|
||||
$this->terminateWithSuccess($menu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
|
||||
* Provides data to the ajax get calls about the searchbar component
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class Cms extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// NOTE(chris): additional permission checks will be done in SearchBarLib
|
||||
parent::__construct([
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'content' => self::PERM_LOGGED,
|
||||
'news' => self::PERM_LOGGED,
|
||||
'getNewsRowCount' => self::PERM_LOGGED,
|
||||
'getNews' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
|
||||
// setting up the papgination_size
|
||||
$this->page_size = 10;
|
||||
|
||||
$this->load->library('CmsLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches the content with the content_id and additional parameters
|
||||
*/
|
||||
public function content()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id','Content ID','required|is_natural');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// getting the get parameters
|
||||
$content_id = $this->input->get("content_id",TRUE);
|
||||
$version = $this->input->get("version",TRUE);
|
||||
$sprache = $this->input->get("sprache",TRUE);
|
||||
$sichtbar = $this->input->get("sichtbar",TRUE);
|
||||
|
||||
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar);
|
||||
$content = $this->getDataOrTerminateWithError($content);
|
||||
|
||||
$this->terminateWithSuccess($content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
public function ContentID()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('ort_kurzbz', 'Ort', 'required');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$ort_kurzbz = $this->input->get('ort_kurzbz',TRUE);
|
||||
|
||||
$content_id = $this->OrtModel->getContentID($ort_kurzbz);
|
||||
|
||||
$content_id = current($this->getDataOrTerminateWithError($content_id))->content_id;
|
||||
|
||||
$this->terminateWithSuccess($content_id);
|
||||
}
|
||||
|
||||
public function news()
|
||||
{
|
||||
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('limit','Limit','required|is_natural_no_zero');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('content/news_model', 'NewsModel');
|
||||
|
||||
$limit = $this->input->get('limit',TRUE);
|
||||
|
||||
//query the news
|
||||
$news = $this->NewsModel->getAll($limit);
|
||||
|
||||
//get the data or terminate with error
|
||||
$news = $this->getDataOrTerminateWithError($news);
|
||||
// array that keeps track of which news don't have a betreff and have to be removed from the news array
|
||||
$newsToRemove = array();
|
||||
// collect the content of the news
|
||||
foreach($news as $index=>$news_element){
|
||||
|
||||
$this->NewsModel->resetQuery();
|
||||
$content = $this->cmslib->getContent($news_element->content_id);
|
||||
if(isError($content))
|
||||
{
|
||||
// removes the news from the news array, so that the response does not include a invalid news
|
||||
array_push($newsToRemove,$index);
|
||||
//add the error to the api response? visual feedback
|
||||
//$this->addError(print_r($content->retval,true));
|
||||
continue;
|
||||
}
|
||||
$content = getData($content);
|
||||
$news_element->content_obj = $content;
|
||||
}
|
||||
|
||||
//removes all news that don't have a betreff
|
||||
foreach($newsToRemove as $removeNewsIndex)
|
||||
{
|
||||
unset($news[$removeNewsIndex]);
|
||||
}
|
||||
|
||||
$withContent = function($news) {
|
||||
return $news->content_obj != null;
|
||||
};
|
||||
$newsWithContent = array_filter($news, $withContent);
|
||||
$this->terminateWithSuccess($newsWithContent);
|
||||
|
||||
}
|
||||
|
||||
public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10)
|
||||
{
|
||||
list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester);
|
||||
$all = $edit;
|
||||
|
||||
$this->load->model('content/News_model','NewsModel');
|
||||
|
||||
$num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen);
|
||||
|
||||
$num_rows = $this->getDataOrTerminateWithError($num_rows);
|
||||
|
||||
$this->terminateWithSuccess($num_rows);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
|
||||
{
|
||||
//form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('page','Page','required|is_natural');
|
||||
$this->form_validation->set_rules('page_size', 'PageSize', 'is_natural');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// getting the GET parameters
|
||||
$page = intval($this->input->get('page', true));
|
||||
$page_size = intval($this->input->get('page_size', true));
|
||||
$sprache = $this->input->get('sprache', true);
|
||||
if(!$sprache)
|
||||
{
|
||||
$sprache = getUserLanguage();
|
||||
}
|
||||
|
||||
// default value for the page_size is 10
|
||||
$page_size = $page_size ?? 10;
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size, $sprache);
|
||||
$news = $this->getDataOrTerminateWithError($news);
|
||||
|
||||
$this->addMeta('phrases', json_decode($this->p->getJson()));
|
||||
$this->terminateWithSuccess($news);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,493 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about documents
|
||||
* Listens to ajax post calls to change the documents data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*
|
||||
* This controller handles output and access to documents.
|
||||
* It checks permissions to render documents in an alternative format
|
||||
* or it creates a XML file, transforms it with the XSL-FO Vorlage from the
|
||||
* database and generates a PDF file with unoconv or docsbox.
|
||||
* This file is then archivated in the database.
|
||||
*
|
||||
* The last part is the CodeIgniter version of content/pdfExport.php when not
|
||||
* using the get paremeter: "archivdokument" but using the get parameter:
|
||||
* "archive".
|
||||
* Use archiveSigned() instead of providing the "sign" get parameter and
|
||||
* archive() otherwise.
|
||||
*/
|
||||
class Documents extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'permissionAlternativeFormat' => self::PERM_LOGGED,
|
||||
'archive' => ['admin:rw', 'assistenz:rw'],
|
||||
'archiveSigned' => ['admin:rw', 'assistenz:rw'],
|
||||
'download' => ['admin:rw', 'assistenz:rw']
|
||||
]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'stv'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current user has permission to render documents in an
|
||||
* alternative format.
|
||||
*
|
||||
* @param string $oe_kurzbz Or studiengang_kz
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function permissionAlternativeFormat($oe_kurzbz)
|
||||
{
|
||||
$this->terminateWithSuccess($this->permissionlib->isBerechtigt('system/change_outputformat', null, $oe_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive a not signed document.
|
||||
*
|
||||
* @param string $xml (optional)
|
||||
* @param string $xsl (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function archive($xml = null, $xsl = null)
|
||||
{
|
||||
return $this->_archive($xml, $xsl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive a signed document.
|
||||
*
|
||||
* @param string $xml (optional)
|
||||
* @param string $xsl (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function archiveSigned($xml = null, $xsl = null)
|
||||
{
|
||||
return $this->_archive($xml, $xsl, getAuthUID());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function download($xml, $xsl, $sign_user = null)
|
||||
{
|
||||
$akteExportData = $this->_getAkteExportData($xml, $xsl, $sign_user);
|
||||
|
||||
$akteData = $akteData['akteData'];
|
||||
$exportData = $akteData['exportData'];
|
||||
|
||||
/**
|
||||
* [
|
||||
'vorlage' => $vorlage,
|
||||
'xml_data' => $data,
|
||||
'oe_kurzbz' => $xsl_oe_kurzbz,
|
||||
'version' => $version,
|
||||
'outputformat' => $outputformat,
|
||||
'sign_user' => $sign_user
|
||||
]
|
||||
*/
|
||||
|
||||
// Output
|
||||
$result = $this->documentexportlib->showContent(
|
||||
$akteData['akteData']['inhalt'],
|
||||
$exportData['vorlage'],
|
||||
$exportData['xml_data'],
|
||||
$exportData['oe_kurzbz'],
|
||||
$exportData['version'],
|
||||
$exportData['outputformat'],
|
||||
$exportData['sign_user']
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for archive() and archiveSigned()
|
||||
*
|
||||
* @param string $xml
|
||||
* @param string $xsl
|
||||
* @param string $sign_user (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _archive($xml, $xsl, $sign_user = null)
|
||||
{
|
||||
$akteData = $this->_getAkteExportData($xml, $xsl, $sign_user);
|
||||
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$result = $this->AkteModel->insert($akteData['akteData']);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $xml
|
||||
* @param string $xsl
|
||||
* @param string $sign_user (optional)
|
||||
*
|
||||
* @return array with Akte data and export data
|
||||
*/
|
||||
private function _getAkteExportData($xml, $xsl, $sign_user = null)
|
||||
{
|
||||
if (!$xml || !$xsl) {
|
||||
$this->load->library('form_validation');
|
||||
if (!$xml) {
|
||||
$xml = $this->input->post_get('xml');
|
||||
$this->addMeta('xml', $xml);
|
||||
$this->form_validation->set_rules('xml', 'xml', 'required');
|
||||
}
|
||||
if (!$xsl) {
|
||||
$xsl = $this->input->post_get('xsl');
|
||||
$this->addMeta('xsl', $xsl);
|
||||
$this->form_validation->set_rules('xsl', 'xsl', 'required');
|
||||
}
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$xsl_oe_kurzbz = null;
|
||||
$version = $this->input->post_get('version') ?: null;
|
||||
|
||||
// Get the OE or STG of the document
|
||||
$xsl_oe_kurzbz = $this->input->post_get('xsl_oe_kurzbz')
|
||||
?: $this->input->post_get('xsl_stg_kz')
|
||||
?: $this->input->post_get('stg_kz');
|
||||
if (is_null($xsl_oe_kurzbz)) {
|
||||
$uid = $this->input->post_get('uid');
|
||||
if ($uid) {
|
||||
$uid = current(explode(';', $uid));
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->load([$uid]);
|
||||
if (!isError($result) && hasData($result))
|
||||
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
|
||||
}
|
||||
}
|
||||
if (is_null($xsl_oe_kurzbz)) {
|
||||
$prestudent_id = $this->input->post_get('prestudent_id');
|
||||
if ($prestudent_id) {
|
||||
$prestudent_id = current(explode(';', $prestudent_id));
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load($prestudent_id);
|
||||
if (!isError($result) && hasData($result))
|
||||
$xsl_oe_kurzbz = current(getData($result))->studiengang_kz;
|
||||
}
|
||||
}
|
||||
if (is_null($xsl_oe_kurzbz))
|
||||
$xsl_oe_kurzbz = 0;
|
||||
|
||||
// Vorlage
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
$result = $this->VorlageModel->load($xsl);
|
||||
$this->addMeta("ress", $result);
|
||||
$vorlage = current($this->getDataOrTerminateWithError($result));
|
||||
if (!$vorlage)
|
||||
show_404();
|
||||
|
||||
// Akte Data
|
||||
$akteData = [
|
||||
'dokument_kurzbz' => $vorlage->dokument_kurzbz ?: 'Zeugnis',
|
||||
'mimetype' => 'application/pdf',
|
||||
'erstelltam' => date('Y-m-d'),
|
||||
'gedruckt' => true,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
'uid' => $this->input->post_get('uid') ?: '',
|
||||
'archiv' => true,
|
||||
'signiert' => !!$sign_user,
|
||||
'stud_selfservice' => $vorlage->stud_selfservice
|
||||
];
|
||||
$studiengang_kz = null;
|
||||
if ($akteData['uid']) {
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->StudentModel->addSelect('tbl_student.*, UPPER(typ || kurzbz) AS kuerzel');
|
||||
$this->StudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
$result = $this->StudentModel->load([$akteData['uid']]);
|
||||
$student = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
$ss = $this->input->post_get('ss');
|
||||
|
||||
if ($ss !== null) {
|
||||
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$result = $this->PrestudentstatusModel->getLastStatus($student->prestudent_id, $ss);
|
||||
$status = current($this->getDataOrTerminateWithError($result));
|
||||
if (!$status)
|
||||
$this->terminateWithError($this->p->t("stv", "grades_error_prestudentstatus"));
|
||||
$semester = $status->ausbildungssemester;
|
||||
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->StudentlehrverbandModel->addJoin('public.tbl_benutzer', 'uid = student_uid');
|
||||
$this->StudentlehrverbandModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$result = $this->StudentlehrverbandModel->load([
|
||||
'studiensemester_kurzbz' => $ss,
|
||||
'student_uid' => $akteData['uid']
|
||||
]);
|
||||
$res = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
$studiengang_kz = $res->studiengang_kz;
|
||||
$akteData['person_id'] = $res->person_id;
|
||||
switch ($xsl) {
|
||||
case 'Ausbildungsver':
|
||||
case 'AusbVerEng':
|
||||
$akteData['titel'] = mb_substr($xsl .
|
||||
"_" .
|
||||
strtoupper($res->typ) .
|
||||
strtoupper($res->kurzbz) .
|
||||
"_" .
|
||||
$semester .
|
||||
"_" .
|
||||
$ss, 0, 64);
|
||||
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
|
||||
break;
|
||||
case 'LVZeugnisEng':
|
||||
case 'LVZeugnis':
|
||||
case 'Zertifikat':
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->load($this->input->post_get('lvid'));
|
||||
$lv = current($this->getDataOrTerminateWithError($result));
|
||||
$akteData['dokument_kurzbz'] = $xsl;
|
||||
$akteData['titel'] = mb_substr($xsl .
|
||||
"_" .
|
||||
strtoupper($res->typ) .
|
||||
strtoupper($res->kurzbz) .
|
||||
"_" .
|
||||
$semester .
|
||||
'_' .
|
||||
$ss .
|
||||
'_' .
|
||||
str_replace(' ', '_', $lv->bezeichnung), 0, 60);
|
||||
$akteData['bezeichnung'] = mb_substr($xsl .
|
||||
" " .
|
||||
strtoupper($res->typ) .
|
||||
strtoupper($res->kurzbz) .
|
||||
" " .
|
||||
$semester .
|
||||
". Semester" .
|
||||
' ' .
|
||||
$ss .
|
||||
' ' .
|
||||
$lv->bezeichnung, 0, 64);
|
||||
break;
|
||||
case 'SZeugnis':
|
||||
$akteData['titel'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
|
||||
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
|
||||
break;
|
||||
default:
|
||||
$akteData['titel'] = mb_substr($xsl .
|
||||
"_" .
|
||||
strtoupper($res->typ) .
|
||||
strtoupper($res->kurzbz) .
|
||||
"_" .
|
||||
$semester .
|
||||
"_" .
|
||||
$ss, 0, 64);
|
||||
$akteData['bezeichnung'] = mb_substr($xsl .
|
||||
" " .
|
||||
strtoupper($res->typ) .
|
||||
strtoupper($res->kurzbz) .
|
||||
" " .
|
||||
$semester .
|
||||
". Semester" .
|
||||
' ' .
|
||||
$ss, 0, 64);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$studiengang_kz = $student->studiengang_kz;
|
||||
$akteData['person_id'] = $student->person_id;
|
||||
$akteData['titel'] = $vorlage->bezeichnung . '_' . $student->kuerzel;
|
||||
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $student->kuerzel, 0, 64);
|
||||
}
|
||||
} else {
|
||||
$prestudent_id = $this->input->post_get('prestudent_id');
|
||||
if ($prestudent_id) {
|
||||
$this->load->model('crm/prestudent_model', 'PrestudentModel');
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
$result = $this->PrestudentModel->load($prestudent_id);
|
||||
$prestudent = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
$studiengang_kz = $prestudent->studiengang_kz;
|
||||
$akteData['person_id'] = $prestudent->person_id;
|
||||
$akteData['titel'] = mb_substr($xsl . "_" . $prestudent->kuerzel, 0, 64);
|
||||
$akteData['bezeichnung'] = mb_substr($vorlage->bezeichnung . " " . $prestudent->kuerzel, 0, 64);
|
||||
}
|
||||
}
|
||||
|
||||
// Access rights
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $studiengang_kz)
|
||||
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', $studiengang_kz))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw']]);
|
||||
if ($xsl == 'AccountInfo') {
|
||||
$this->load->model('resource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$uids = $this->input->post_get('uid');
|
||||
if ($uids) {
|
||||
$uids = explode(';', $uids);
|
||||
foreach ($uids as $uid) {
|
||||
$result = $this->MitarbeiterModel->load($uid);
|
||||
if (!isError($result) && hasData($result)) {
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid', 0)
|
||||
&& !$this->permissionlib->isBerechtigt('mitarbeiter', 'suid', 0))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'mitarbeiter:rw']]);
|
||||
} else {
|
||||
$result = $this->StudentModel->load([$uid]);
|
||||
if (!isError($result) && hasData($result)) {
|
||||
$student = current(getData($result));
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $student->studiengang_kz)
|
||||
&& !$this->permissionlib->isBerechtigt('admin', 'suid', 0)
|
||||
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', $student->studiengang_kz)
|
||||
&& !$this->permissionlib->isBerechtigt('assistenz', 'suid', 0)
|
||||
&& !$this->permissionlib->isBerechtigt('support', 'suid', 0))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw', 'support:rw']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
|
||||
$result = $this->VorlagestudiengangModel->getCurrent($xsl, $xsl_oe_kurzbz, $version);
|
||||
$access_rights = current($this->getDataOrTerminateWithError($result));
|
||||
// TODO: was bedeutet wenn keine berechtigung?
|
||||
if (!$access_rights || !$access_rights->berechtigung)
|
||||
return show_404();
|
||||
|
||||
$allowed = false;
|
||||
foreach ($access_rights->berechtigung as $access_right) {
|
||||
if ($this->permissionlib->isBerechtigt($access_right)) {
|
||||
$allowed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$allowed)
|
||||
return $this->_outputAuthError([$this->router->method => $access_rights]);
|
||||
}
|
||||
|
||||
// Output format
|
||||
$outputformat = $this->input->post_get('output') ?: 'pdf';
|
||||
if ($outputformat != 'pdf'
|
||||
// An der FHTW darf das Studienblatt und das Prüfungsprotokoll auch in anderen Formaten exportiert werden
|
||||
&& !(CAMPUS_NAME == 'FH Technikum Wien'
|
||||
&& ($xsl == 'Studienblatt'
|
||||
|| $xsl == 'StudienblattEng'
|
||||
|| $xsl == 'PrProtBA'
|
||||
|| $xsl == 'PrProtBAEng'
|
||||
|| $xsl == 'PrProtMA'
|
||||
|| $xsl == 'PrProtMAEng'
|
||||
)
|
||||
)
|
||||
&& !$this->permissionlib->isBerechtigt('system/change_outputformat', null, $xsl_oe_kurzbz)
|
||||
) {
|
||||
$outputformat = 'pdf';
|
||||
}
|
||||
|
||||
// XML Params
|
||||
$params = 'xmlformat=xml';
|
||||
foreach ([
|
||||
'uid',
|
||||
'stg_kz',
|
||||
'person_id',
|
||||
'id',
|
||||
'prestudent_id',
|
||||
'buchungsnummern',
|
||||
'ss',
|
||||
'abschlusspruefung_id',
|
||||
'typ',
|
||||
'all',
|
||||
'preoutgoing_id',
|
||||
'lvid',
|
||||
'projekt_kurzbz',
|
||||
'von',
|
||||
'bis',
|
||||
'stundevon',
|
||||
'stundebis',
|
||||
'sem',
|
||||
'lehreinheit',
|
||||
'mitarbeiter_uid',
|
||||
'studienordnung_id',
|
||||
'fixangestellt',
|
||||
'standort',
|
||||
'abrechnungsmonat',
|
||||
'form',
|
||||
'projektarbeit_id',
|
||||
'betreuerart_kurzbz',
|
||||
'studiensemester_kurzbz'
|
||||
] as $key) {
|
||||
if (in_array($xsl, array('Ausbildungsver', 'AusbVerEng')) && $key === 'uid')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$value = $this->input->post_get($key);
|
||||
if ($value !== null)
|
||||
$params .= '&' . $key . '=' . urlencode($value);
|
||||
}
|
||||
$value = $this->input->post_get('vertrag_id');
|
||||
if ($value !== null) {
|
||||
foreach ($value as $id)
|
||||
$params .= '&vertrag_id[]=' . urlencode($id);
|
||||
}
|
||||
|
||||
if (!$vorlage->archivierbar)
|
||||
$this->terminateWithError($this->p->t("stv", "grades_error_archive"));
|
||||
|
||||
if ($sign_user && !$vorlage->signierbar)
|
||||
$this->terminateWithError($this->p->t("stv", "grades_error_sign"));
|
||||
|
||||
|
||||
$this->load->library('DocumentExportLib');
|
||||
|
||||
// XML Data
|
||||
$result = $this->documentexportlib->getDataURL($xml, $params);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->documentexportlib->addArchiveToData($data);
|
||||
|
||||
// Output
|
||||
$result = $this->documentexportlib->getContent($vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
|
||||
|
||||
$content = $this->getDataOrTerminateWithError($result);
|
||||
$akteData['titel'] .= '.pdf';
|
||||
$akteData['inhalt'] = base64_encode($content);
|
||||
|
||||
return [
|
||||
'akteData' => $akteData,
|
||||
'exportData' =>
|
||||
[
|
||||
'vorlage' => $vorlage,
|
||||
'xml_data' => $data,
|
||||
'oe_kurzbz' => $xsl_oe_kurzbz,
|
||||
'version' => $version,
|
||||
'outputformat' => $outputformat,
|
||||
'sign_user' => $sign_user
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ class Filter extends FHCAPI_Controller
|
||||
*/
|
||||
public function applyFilterFields()
|
||||
{
|
||||
$this->form_validation->set_rules('filterFields', 'filterFields', 'required');
|
||||
$this->form_validation->set_rules('filterFields[]', 'filterFields', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about languages
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class Language extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
$this->SpracheModel->addOrder('sprache');
|
||||
|
||||
$result = $this->SpracheModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,681 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//require_once('../../../include/studiengang.class.php');
|
||||
//require_once('../../../include/student.class.php');
|
||||
//require_once('../../../include/datum.class.php');
|
||||
//require_once('../../../include/mail.class.php');
|
||||
//require_once('../../../include/benutzerberechtigung.class.php');
|
||||
//require_once('../../../include/phrasen.class.php');
|
||||
//require_once('../../../include/projektarbeit.class.php');
|
||||
//require_once('../../../include/projektbetreuer.class.php');
|
||||
|
||||
class Lehre extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'lvStudentenMail' => self::PERM_LOGGED,
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
'getStudentProjektarbeiten' => self::PERM_LOGGED, // TODO: abgabetool berechtigung?
|
||||
'getStudentProjektabgaben' => self::PERM_LOGGED,
|
||||
'postStudentProjektarbeitZwischenabgabe' => self::PERM_LOGGED,
|
||||
'postStudentProjektarbeitEndupload' => self::PERM_LOGGED,
|
||||
'getMitarbeiterProjektarbeiten' => self::PERM_LOGGED,
|
||||
'postProjektarbeitAbgabe' => self::PERM_LOGGED,
|
||||
'deleteProjektarbeitAbgabe' => self::PERM_LOGGED,
|
||||
'postSerientermin' => self::PERM_LOGGED,
|
||||
'fetchDeadlines' => self::PERM_LOGGED // TODO: mitarbeiter recht prüfen
|
||||
]);
|
||||
|
||||
$this->load->library('PhrasesLib');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'abgabetool'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
require_once(FHCPATH . 'include/studiengang.class.php');
|
||||
require_once(FHCPATH . 'include/student.class.php');
|
||||
require_once(FHCPATH . 'include/projektarbeit.class.php');
|
||||
require_once(FHCPATH . 'include/projektbetreuer.class.php');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* constructs the emails of the groups from a lehrveranstaltung
|
||||
*/
|
||||
public function lvStudentenMail()
|
||||
{
|
||||
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
|
||||
|
||||
// return early if the required parameter is missing
|
||||
if(!isset($lehreinheit_id))
|
||||
{
|
||||
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
|
||||
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
|
||||
//convert array of objects into array of strings
|
||||
$studentenMails = array_map(function($element){
|
||||
return $element->mail;
|
||||
}, $studentenMails);
|
||||
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
}
|
||||
|
||||
public function LV($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage(), $lehrveranstaltung_id);
|
||||
|
||||
$result = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all Pruefungen of a student for a specific lehrveranstaltung
|
||||
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
|
||||
* @param mixed $lehrveranstaltung_id
|
||||
* @return void
|
||||
*/
|
||||
public function Pruefungen($lehrveranstaltung_id)
|
||||
{
|
||||
$this->load->model('education/Pruefung_model', 'PruefungModel');
|
||||
|
||||
$result = $this->PruefungModel->getByStudentAndLv(getAuthUID(), $lehrveranstaltung_id, getUserLanguage());
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all projektabgabetermine for a given projektarbeit_id used in cis4 student abgabetool
|
||||
*/
|
||||
public function getStudentProjektabgaben() {
|
||||
$projektarbeit_id = $this->input->get("projektarbeit_id",TRUE);
|
||||
|
||||
// TODO: error messages
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$projektarbeit_obj = new projektarbeit();
|
||||
if($projektarbeit_id==-1)
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if(!$projektarbeit_obj->load($projektarbeit_id))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$paIsCurrent = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
|
||||
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
$ret = $this->ProjektarbeitModel->getProjektarbeitAbgabetermine($projektarbeit_id);
|
||||
|
||||
// TODO: fetch zweitbetreuer
|
||||
|
||||
$this->terminateWithSuccess(array($ret, $paIsCurrent));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all projektarbeiten and betreuer for a given student_uid used in cis4 student abgabetool
|
||||
*/
|
||||
public function getStudentProjektarbeiten($uid)
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
if (!isset($uid) || isEmptyString($uid))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$isZugeteilterBetreuer = count($this->ProjektarbeitModel->checkZuordnung($uid, getAuthUID())->retval) > 0;
|
||||
$this->addMeta('isZugeteilterBetreuer', $isZugeteilterBetreuer);
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
|
||||
if ($isMitarbeiter && $isZugeteilterBetreuer){
|
||||
$projektarbeiten = $this->ProjektarbeitModel->getStudentProjektarbeitenWithBetreuer($uid);
|
||||
} else {
|
||||
$projektarbeiten = $this->ProjektarbeitModel->getStudentProjektarbeitenWithBetreuer(getAuthUID());
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array($projektarbeiten, DOMAIN, $uid));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* projektarbeit - upload for zwischenabgaben in cis4 student abgabetool
|
||||
*/
|
||||
public function postStudentProjektarbeitZwischenabgabe()
|
||||
{
|
||||
|
||||
$projektarbeit_id = $_POST['projektarbeit_id'];
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
$student_uid = $_POST['student_uid'];
|
||||
$bperson_id = $_POST['bperson_id'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id)
|
||||
|| !isset($paabgabe_id) || isEmptyString($paabgabe_id)
|
||||
|| !isset($student_uid) || isEmptyString($student_uid)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if ((isset($_FILES) and isset($_FILES['file']) and ! $_FILES['file']['error'])) {
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf');
|
||||
|
||||
if(file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf')) {
|
||||
|
||||
exec('chmod 640 "'.PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf'.'"');
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$res = $this->PaabgabeModel->update($paabgabe_id, array(
|
||||
'abgabedatum' => date('Y-m-d'),
|
||||
'updatevon' => getAuthUID(),
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
));
|
||||
|
||||
$this->sendUploadEmail($bperson_id, $projektarbeit_id, $paabgabetyp_kurzbz, $student_uid);
|
||||
$this->terminateWithSuccess($res);
|
||||
} else {
|
||||
$this->terminateWithError('Error moving File');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->terminateWithError('File missing');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* upload für finale abgaben aka Endupload in cis4 student abgabetool
|
||||
*/
|
||||
public function postStudentProjektarbeitEndupload()
|
||||
{
|
||||
|
||||
$projektarbeit_id = $_POST['projektarbeit_id'];
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
$student_uid = $_POST['student_uid'];
|
||||
$sprache = $_POST['sprache'];
|
||||
$abstract = $_POST['abstract'];
|
||||
$abstract_en = $_POST['abstract_en'];
|
||||
$schlagwoerter = $_POST['schlagwoerter'];
|
||||
$schlagwoerter_en = $_POST['schlagwoerter_en'];
|
||||
$seitenanzahl = $_POST['seitenanzahl'];
|
||||
$bperson_id = $_POST['bperson_id'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id)
|
||||
|| !isset($paabgabe_id) || isEmptyString($paabgabe_id)
|
||||
|| !isset($student_uid) || isEmptyString($student_uid)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// TODO: maybe check for other params aswell?
|
||||
|
||||
if ((isset($_FILES) and isset($_FILES['file']) and ! $_FILES['file']['error'])) {
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf');
|
||||
|
||||
if(file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf')) {
|
||||
|
||||
// Loads Libraries
|
||||
$this->load->library('SignatureLib');
|
||||
|
||||
// Check if the document is signed
|
||||
$signaturVorhanden = true;
|
||||
$signList = SignatureLib::list(PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf');
|
||||
if (is_array($signList) && count($signList) > 0)
|
||||
{
|
||||
// The document is signed
|
||||
$uploadedDocumentSigned = 'The document is signed';
|
||||
}
|
||||
elseif ($signList === null)
|
||||
{
|
||||
$uploadedDocumentSigned = 'WARNING: signature server error';
|
||||
}
|
||||
else
|
||||
{
|
||||
$signaturVorhanden = false;
|
||||
$uploadedDocumentSigned = 'No document signature found';
|
||||
}
|
||||
$this->addMeta('signaturInfo', $uploadedDocumentSigned);
|
||||
|
||||
if ($signaturVorhanden === false)
|
||||
{
|
||||
$this->signaturFehltEmail($student_uid);
|
||||
}
|
||||
|
||||
// TODO error handle get data has data the updates
|
||||
// update projektarbeit cols
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
$this->ProjektarbeitModel->updateProjektarbeit($projektarbeit_id,$sprache,$abstract,$abstract_en
|
||||
,$schlagwoerter, $schlagwoerter_en, $seitenanzahl);
|
||||
|
||||
|
||||
// update paabgabe datum
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$res = $this->PaabgabeModel->update($paabgabe_id, array(
|
||||
'abgabedatum' => date('Y-m-d'),
|
||||
'updatevon' => getAuthUID(),
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
));
|
||||
|
||||
$this->sendUploadEmail($bperson_id, $projektarbeit_id, $paabgabetyp_kurzbz, $student_uid);
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
} else {
|
||||
$this->terminateWithError('Error moving File');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->terminateWithError('File missing');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function signaturFehltEmail($student_uid) {
|
||||
|
||||
|
||||
// Mail an Studiengang wenn keine Signatur gefunden wurde
|
||||
$student = new student();
|
||||
if(!$student->load($student_uid))
|
||||
$this->terminateWithError($this->p->t('global','userNichtGefunden'), 'general');
|
||||
|
||||
$stg_obj = new studiengang();
|
||||
if(!$stg_obj->load($student->studiengang_kz))
|
||||
$this->terminateWithError($this->p->t('global','fehlerBeimLesenAusDatenbank'), 'general');
|
||||
|
||||
$subject = 'Abgabe ohne Signatur';
|
||||
$tomail = $stg_obj->email;
|
||||
$data = array(
|
||||
'vorname' => $student->vorname,
|
||||
'nachname' => $student->nachname,
|
||||
'studiengang' => $stg_obj->bezeichnung
|
||||
);
|
||||
|
||||
$mailres = sendSanchoMail(
|
||||
'ParbeitsbeurteilungSiganturFehlt',
|
||||
$data,
|
||||
$tomail,
|
||||
$subject,
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg'
|
||||
);
|
||||
}
|
||||
|
||||
private function sendUploadEmail($bperson_id, $projektarbeit_id, $paabgabetyp_kurzbz, $student_uid) {
|
||||
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$resBetr = $this->ProjektarbeitModel->getProjektbetreuerAnrede($bperson_id);
|
||||
|
||||
$projektarbeit_obj = new projektarbeit();
|
||||
|
||||
if(!$projektarbeit_obj->load($projektarbeit_id))
|
||||
$this->terminateWithError('Ungueltiger Eintrag');
|
||||
|
||||
$num_rows_sem = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
|
||||
|
||||
if( null === $num_rows_sem || false === $num_rows_sem )
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool','fehlerAktualitaetProjektarbeit'), 'general');
|
||||
}
|
||||
|
||||
foreach($resBetr->retval as $betreuerRow) {
|
||||
|
||||
// query student benutzer view for every betreuer row
|
||||
$studentUser = $this->ProjektarbeitModel->getProjektarbeitBenutzer($student_uid)->retval[0];
|
||||
|
||||
// TODO: hasdata, getData etc
|
||||
|
||||
// 1. Begutachter mail ohne Token
|
||||
$mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter";
|
||||
$mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$studentUser->uid;
|
||||
$projekttyp_kurzbz = $projektarbeit_obj->projekttyp_kurzbz;
|
||||
$subject = $projektarbeit_obj->projekttyp_kurzbz == 'Diplom' ? 'Masterarbeitsbetreuung' : 'Bachelorarbeitsbetreuung';
|
||||
$abgabetyp = $paabgabetyp_kurzbz == 'end' ? 'Endabgabe' : 'Zwischenabgabe';
|
||||
|
||||
$maildata = array();
|
||||
$maildata['geehrt'] = "geehrte".($betreuerRow->anrede=="Herr"?"r":"");
|
||||
$maildata['anrede'] = $betreuerRow->anrede;
|
||||
$maildata['betreuer_voller_name'] = $betreuerRow->first;
|
||||
$maildata['student_anrede'] = $studentUser->anrede;
|
||||
$maildata['student_voller_name'] = trim($studentUser->titelpre." ".$studentUser->vorname." ".$studentUser->nachname." ".$studentUser->titelpost);
|
||||
$maildata['abgabetyp'] = $abgabetyp;
|
||||
$maildata['parbeituebersichtlink'] = "<p><a href='".APP_ROOT."cis/private/lehre/abgabe_lektor_frameset.html'>Zur Projektarbeitsübersicht</a></p>";
|
||||
$maildata['bewertunglink'] = $num_rows_sem >= 1 && $paabgabetyp_kurzbz == 'end' ? "<p><a href='$mail_fulllink'>Zur Beurteilung der Arbeit</a></p>" : "";
|
||||
$maildata['token'] = "";
|
||||
|
||||
$mailres = sendSanchoMail(
|
||||
'ParbeitsbeurteilungEndupload',
|
||||
$maildata,
|
||||
$betreuerRow->mitarbeiter_uid."@".DOMAIN,
|
||||
$subject,
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg',
|
||||
get_uid()."@".DOMAIN);
|
||||
|
||||
if(!$mailres)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailBegutachter'), 'general');
|
||||
}
|
||||
|
||||
// 2. Begutachter mail, wenn Endabgabe, mit Token wenn extern
|
||||
if ($paabgabetyp_kurzbz == 'end')
|
||||
{
|
||||
// Zweitbegutachter holen
|
||||
$zweitbegutachter = new projektbetreuer();
|
||||
$zweitbegutachterRes = $zweitbegutachter->getZweitbegutachterWithToken($bperson_id, $projektarbeit_id, $studentUser->uid);
|
||||
|
||||
if ($zweitbegutachterRes)
|
||||
{
|
||||
$zweitbegutachterResults = $zweitbegutachter->result;
|
||||
|
||||
foreach ($zweitbegutachterResults as $begutachter)
|
||||
{
|
||||
// token generieren, wenn noch nicht vorhanden und notwendig (wird in methode überprüft)
|
||||
$tokenGenRes = $zweitbegutachter->generateZweitbegutachterToken($begutachter->person_id, $projektarbeit_id);
|
||||
|
||||
if (!$tokenGenRes)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailZweitBegutachter'), 'general');
|
||||
}
|
||||
|
||||
// Zweitbegutachter (evtl. mit Token) holen
|
||||
$zweitbegutachterMitToken = new projektbetreuer();
|
||||
$begutachterMitTokenRes = $zweitbegutachterMitToken->getZweitbegutachterWithToken($bperson_id, $projektarbeit_id, $studentUser->uid, $begutachter->person_id);
|
||||
|
||||
if (!$begutachterMitTokenRes)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailZweitBegutachter'), 'general');
|
||||
}
|
||||
|
||||
// Email an Zweitbegutachter senden
|
||||
if (isset($zweitbegutachterMitToken->result[0]))
|
||||
{
|
||||
$begutachterMitToken = $zweitbegutachterMitToken->result[0];
|
||||
|
||||
$path = $begutachterMitToken->betreuerart_kurzbz == 'Zweitbegutachter' ? 'ProjektarbeitsbeurteilungZweitbegutachter' : 'ProjektarbeitsbeurteilungErstbegutachter';
|
||||
$mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/$path";
|
||||
$mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$studentUser->uid;
|
||||
$intern = isset($begutachterMitToken->uid);
|
||||
$mail_link = $intern ? $mail_fulllink : $mail_baselink;
|
||||
|
||||
$zweitbetmaildata = array();
|
||||
$zweitbetmaildata['geehrt'] = "geehrte" . ($begutachterMitToken->anrede == "Herr" ? "r" : "");
|
||||
$zweitbetmaildata['anrede'] = $begutachterMitToken->anrede;
|
||||
$zweitbetmaildata['betreuer_voller_name'] = $begutachterMitToken->voller_name;
|
||||
$zweitbetmaildata['student_anrede'] = $maildata['student_anrede'];
|
||||
$zweitbetmaildata['student_voller_name'] = $maildata['student_voller_name'];
|
||||
$zweitbetmaildata['abgabetyp'] = $abgabetyp;
|
||||
$zweitbetmaildata['parbeituebersichtlink'] = $intern ? $maildata['parbeituebersichtlink'] : "";
|
||||
$zweitbetmaildata['bewertunglink'] = $num_rows_sem >= 1 ? "<p><a href='$mail_link'>Zur Beurteilung der Arbeit</a></p>" : "";
|
||||
$zweitbetmaildata['token'] = $num_rows_sem >= 1 && isset($begutachterMitToken->zugangstoken) && !$intern ? "<p>Zugangstoken: " . $begutachterMitToken->zugangstoken . "</p>" : "";
|
||||
|
||||
$mailres = sendSanchoMail(
|
||||
'ParbeitsbeurteilungEndupload',
|
||||
$zweitbetmaildata,
|
||||
$begutachterMitToken->email,
|
||||
$subject,
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg',
|
||||
get_uid()."@".DOMAIN
|
||||
);
|
||||
|
||||
if (!$mailres)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailBegutachter'), 'general');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getMitarbeiterProjektarbeiten() {
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$boolParamStr = $this->input->get('showall');
|
||||
$trueStrings = ['true', '1'];
|
||||
$falseStrings = ['false', '0'];
|
||||
|
||||
// Handle missing or invalid parameter
|
||||
if ($boolParamStr === null) {
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
$boolParamStrLower = strtolower($boolParamStr);
|
||||
|
||||
if (in_array($boolParamStrLower, $trueStrings, true)) {
|
||||
$showAllBool = true;
|
||||
} elseif (in_array($boolParamStrLower, $falseStrings, true)) {
|
||||
$showAllBool = false;
|
||||
} else {
|
||||
// $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
|
||||
$projektarbeiten = $this->ProjektarbeitModel->getMitarbeiterProjektarbeiten(getAuthUID(), $showAllBool);
|
||||
|
||||
$this->terminateWithSuccess(array($projektarbeiten, DOMAIN));
|
||||
}
|
||||
|
||||
public function postProjektarbeitAbgabe() {
|
||||
$projektarbeit_id = $_POST['projektarbeit_id'];
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
$datum = $_POST['datum'];
|
||||
$fixtermin = $_POST['fixtermin'];
|
||||
$kurzbz = $_POST['kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id)
|
||||
|| !isset($paabgabe_id) || isEmptyString($paabgabe_id)
|
||||
|| !isset($datum) || isEmptyString($datum)
|
||||
|| !isset($datum) || isEmptyString($datum)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
if($paabgabe_id == -1) {
|
||||
$result = $this->PaabgabeModel->insert(
|
||||
array(
|
||||
'projektarbeit_id' => $projektarbeit_id,
|
||||
'paabgabetyp_kurzbz' => $paabgabetyp_kurzbz,
|
||||
'fixtermin' => $fixtermin,
|
||||
'datum' => $datum,
|
||||
'kurzbz' => $kurzbz,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
} else {
|
||||
$result = $this->PaabgabeModel->update(
|
||||
$paabgabe_id,
|
||||
array(
|
||||
'paabgabetyp_kurzbz' => $paabgabetyp_kurzbz,
|
||||
'datum' => $datum,
|
||||
'kurzbz' => $kurzbz,
|
||||
'updatevon' => getAuthUID(),
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteProjektarbeitAbgabe() {
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
|
||||
if (!isset($paabgabe_id) || isEmptyString($paabgabe_id))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
$result = $this->PaabgabeModel->load($paabgabe_id);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(count($result) == 0)
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// TODO: berechtigung?
|
||||
if($result[0]->insertvon === getAuthUID()) {
|
||||
$result = $this->PaabgabeModel->delete($paabgabe_id);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
|
||||
/**
|
||||
* endpoint for adding the same paabgabe for multiple projektarbeiten
|
||||
* can be slow for large n since it queries twice per projektarbeit_id
|
||||
*/
|
||||
public function postSerientermin() {
|
||||
$projektarbeit_ids = $_POST['projektarbeit_ids'];
|
||||
$datum = $_POST['datum'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
$bezeichnung = $_POST['bezeichnung'];
|
||||
$kurzbz = $_POST['kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_ids) || !is_array($projektarbeit_ids) || empty($projektarbeit_ids)
|
||||
|| !isset($datum) || isEmptyString($datum)
|
||||
|| !isset($kurzbz) || isEmptyString($kurzbz)
|
||||
|| !isset($bezeichnung) || isEmptyString($bezeichnung)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// old script checks if there already are tbl_paabgabe entries with exact date, type & kurzbz
|
||||
// for each termin - good to check that in principle but should not matter in this place. if necessary
|
||||
// duplicate abgabetermine can be easily deleted manually, also via cronjob@night.
|
||||
|
||||
// since this entry includes the kurzbz string match, it should have only ever mattered when there were
|
||||
// multiple users entering the exact same set of (date, type, kurzbz) - which is a much more narrow case than the
|
||||
// general "saveMultiple" function should handle
|
||||
|
||||
// old script afterwards again queries if user is not the zweitbetreuer of any id - this is blocked in the ui
|
||||
// and should never unintentionally happen
|
||||
|
||||
// TODO: check berechtigung &/|| zuordnung?
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$res = [];
|
||||
foreach ($projektarbeit_ids as $projektarbeit_id) {
|
||||
|
||||
$result = $this->PaabgabeModel->insert(
|
||||
array(
|
||||
'projektarbeit_id' => $projektarbeit_id,
|
||||
'paabgabetyp_kurzbz' => $paabgabetyp_kurzbz,
|
||||
'fixtermin' => false,
|
||||
'datum' => $datum,
|
||||
'kurzbz' => $kurzbz,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// $res[] = $data;
|
||||
|
||||
// send mail to student
|
||||
$result = $this->ProjektarbeitModel->getStudentInfoForProjektarbeitId($projektarbeit_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// $this->addMeta('emaildata'.$projektarbeit_id, $data);
|
||||
|
||||
$datetime = new DateTime($datum);
|
||||
$dateEmailFormatted = $datetime->format('d.m.Y');
|
||||
|
||||
$anredeFillString = $data[0]->anrede=="Herr"?"r":"";
|
||||
|
||||
$fullFormattedNameString = trim($data[0]->titelpre." ".$data[0]->vorname." ".$data[0]->nachname." ".$data[0]->titelpost);
|
||||
$res[] = $fullFormattedNameString;
|
||||
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'anrede' => $data[0]->anrede,
|
||||
'anredeFillString' => $anredeFillString,
|
||||
'datum' => $dateEmailFormatted,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'fullFormattedNameString' => $fullFormattedNameString,
|
||||
'kurzbz' => $kurzbz
|
||||
);
|
||||
|
||||
$email = $data[0]->uid."@".DOMAIN;
|
||||
|
||||
sendSanchoMail(
|
||||
'neuerAbgabetermin',
|
||||
$body_fields,
|
||||
$email,
|
||||
$this->p->t('abgabetool', 'neuerTerminBachelorMasterbetreuung')
|
||||
);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
|
||||
}
|
||||
|
||||
public function fetchDeadlines() {
|
||||
$person_id = $_POST['person_id'];
|
||||
|
||||
if (!isset($person_id) || isEmptyString($person_id))
|
||||
$person_id = getAuthPersonId();
|
||||
|
||||
|
||||
if($person_id !== getAuthPersonId()) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), 'general');
|
||||
}
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$result = $this->PaabgabeModel->getDeadlines($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2025 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Lehrveranstaltung extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getByEmp' => ['admin:r', 'assistenz:r'],
|
||||
'getByStg' => ['admin:r', 'assistenz:r'],
|
||||
'loadByLV' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function getByEmp($studiensemester_kurzbz = null, $mitarbeiter_uid = null, $stg_kz = null)
|
||||
{
|
||||
|
||||
if (is_null($mitarbeiter_uid))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz);
|
||||
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
|
||||
$tree = [];
|
||||
|
||||
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
|
||||
{
|
||||
$lehreinheiten = $this->_ci->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz, $mitarbeiter_uid);
|
||||
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
if (!isset($lehrveranstaltung->_children))
|
||||
{
|
||||
$lehrveranstaltung->_children = $lehreinheiten_data;
|
||||
}
|
||||
$tree[] = $lehrveranstaltung;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
public function getByStg($studiensemester_kurzbz = null, $studiengang_kz = null, $semester = null)
|
||||
{
|
||||
if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$verband = null;
|
||||
if (!is_null($semester) && !is_numeric($semester))
|
||||
{
|
||||
$verband = $semester;
|
||||
$semester = null;
|
||||
}
|
||||
|
||||
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
|
||||
|
||||
$studienplan_ids = array();
|
||||
$only_ids = array();
|
||||
$placeholders = array();
|
||||
|
||||
if (hasData($studienplan_data))
|
||||
{
|
||||
foreach (getData($studienplan_data) as $studienplan) {
|
||||
$placeholders[] = "(?, ?)";
|
||||
$studienplan_ids[] = $studienplan->studienplan_id;
|
||||
$studienplan_ids[] = $studienplan->semester;
|
||||
$only_ids[] = $studienplan->studienplan_id;
|
||||
}
|
||||
}
|
||||
|
||||
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
|
||||
$lehrveranstaltungen_data = hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
|
||||
|
||||
$tree = [];
|
||||
foreach ($lehrveranstaltungen_data as $row)
|
||||
{
|
||||
$rowData = $row;
|
||||
|
||||
$lehreinheiten_data = $this->_ci->LehreinheitModel->getByLvidStudiensemester($row->lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
|
||||
if (hasData($lehreinheiten_data))
|
||||
{
|
||||
$lehreinheiten = getData($lehreinheiten_data);
|
||||
|
||||
if (!isset($row->_children))
|
||||
{
|
||||
$row->_children = $lehreinheiten;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!is_array($row->_children))
|
||||
{
|
||||
$row->_children = [$row->_children];
|
||||
}
|
||||
$row->_children = array_merge($row->_children, $lehreinheiten);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isEmptyString($row->studienplan_lehrveranstaltung_id_parent))
|
||||
{
|
||||
$child = $this->_ci->StudienplanModel->loadStudienplanLehrveranstaltung($row->studienplan_lehrveranstaltung_id_parent);
|
||||
|
||||
if (hasData($child))
|
||||
{
|
||||
$child = getData($child)[0];
|
||||
$searchId = $child->lehrveranstaltung_id;
|
||||
|
||||
foreach ($lehrveranstaltungen_data as &$searchParent)
|
||||
{
|
||||
if ($searchParent->lehrveranstaltung_id === $searchId)
|
||||
{
|
||||
if (!isset($searchParent->_children))
|
||||
{
|
||||
$searchParent->_children = [];
|
||||
}
|
||||
|
||||
if (is_array($searchParent->_children))
|
||||
{
|
||||
$searchParent->_children[] = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
$searchParent->_children = [$searchParent->_children, $row];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tree[] = $rowData;
|
||||
}
|
||||
}
|
||||
|
||||
$counter = 0;
|
||||
$this->assignUniqueIndex($tree, $counter);
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
|
||||
|
||||
public function loadByLV($lehrveranstaltung_id = null)
|
||||
{
|
||||
if (is_null($lehrveranstaltung_id) || !ctype_digit((string)$lehrveranstaltung_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->_ci->LehrveranstaltungModel->addSelect('lehrveranstaltung_id, lehrform_kurzbz, lehre, bezeichnung as lvbezeichnung, sprache');
|
||||
$lehrveranstaltung_result = $this->_ci->LehrveranstaltungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id));
|
||||
$lehrveranstaltung_result = $this->getDataOrTerminateWithError($lehrveranstaltung_result);
|
||||
$lehrveranstaltung = $lehrveranstaltung_result[0];
|
||||
|
||||
$this->_ci->LehreinheitModel->addSelect('lehrveranstaltung_id_kompatibel');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung_kompatibel', 'lehrveranstaltung_id');
|
||||
$lehrfaecher = $this->_ci->LehreinheitModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung->lehrveranstaltung_id));
|
||||
|
||||
$lehrfaecher_array = [];
|
||||
if (hasData($lehrfaecher))
|
||||
$lehrfaecher_array = array_merge($lehrfaecher_array, array_column(getData($lehrfaecher), 'lehrveranstaltung_id_kompatibel'));
|
||||
|
||||
$lehrfaecher_array[] = $lehrveranstaltung->lehrveranstaltung_id;
|
||||
|
||||
$this->_ci->LehrveranstaltungModel->addDistinct('lehrfach_id');
|
||||
$this->_ci->LehrveranstaltungModel->addSelect("tbl_lehrveranstaltung.lehrveranstaltung_id, CONCAT(tbl_lehrveranstaltung.bezeichnung || '(' || tbl_lehrveranstaltung.oe_kurzbz || ')') as lehrfach");
|
||||
$this->_ci->LehrveranstaltungModel->db->where_in('tbl_lehrveranstaltung.lehrveranstaltung_id', $lehrfaecher_array);
|
||||
$lehrfaecher_result = $this->_ci->LehrveranstaltungModel->load();
|
||||
|
||||
$lehrfaecher_array = hasData($lehrfaecher_result) ? getData($lehrfaecher_result) : array();
|
||||
|
||||
$lehrveranstaltung->lehrfaecher = $lehrfaecher_array;
|
||||
$this->terminateWithSuccess($lehrveranstaltung);
|
||||
}
|
||||
|
||||
/*
|
||||
* (david) ggf. im naechsten release
|
||||
* public function loadByOrganization($oe_kurzbz)
|
||||
{
|
||||
$studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell');
|
||||
|
||||
$lehrveranstaltungen = $this->LehrveranstaltungModel->getLvsByOrganization($oe_kurzbz);
|
||||
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
$tree = [];
|
||||
|
||||
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
|
||||
{
|
||||
$lehreinheiten = $this->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
if (!isset($lehrveranstaltung->_children))
|
||||
{
|
||||
|
||||
$lehrveranstaltung->_children = $lehreinheiten_data;
|
||||
}
|
||||
$tree[] = $lehrveranstaltung;
|
||||
}
|
||||
$this->terminateWithSuccess($tree);
|
||||
}*/
|
||||
|
||||
/*public function loadByFachbereich($fachbereich, $mitarbeiter_uid = null)
|
||||
{
|
||||
$studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell');
|
||||
|
||||
$this->LehreinheitModel->getLvsByFachbereich($fachbereich, $studiensemester_kurzbz, $mitarbeiter_uid);
|
||||
}*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
|
||||
private function assignUniqueIndex(&$nodes, &$counter)
|
||||
{
|
||||
foreach ($nodes as &$node)
|
||||
{
|
||||
$node->uniqueindex = $counter++;
|
||||
if (!empty($node->_children) && is_array($node->_children))
|
||||
{
|
||||
$this->assignUniqueIndex($node->_children, $counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getStudiensemesterKurzbz($studiensemester_kurzbz = null)
|
||||
{
|
||||
if (!is_null($studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester_result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
|
||||
if (isError($studiensemester_result) || !hasData($studiensemester_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return getData($studiensemester_result)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,544 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
|
||||
* Provides data to the ajax get calls about the searchbar component
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class LvMenu extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getLvMenu' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model("ressource/Mitarbeiter_model");
|
||||
$this->load->model("education/Lehreinheit_model");
|
||||
$this->load->model("education/Lehrveranstaltung_model");
|
||||
$this->load->model("organisation/Studiengang_model");
|
||||
$this->load->model("accounting/Vertrag_model");
|
||||
$this->load->model("system/Variable_model");
|
||||
$this->load->model("person/Benutzergruppe_model");
|
||||
$this->load->model("education/Lvangebot_model");
|
||||
$this->load->model("ressource/Lehretools_model");
|
||||
|
||||
$this->load->library("PermissionLib", null, 'PermissionLib');
|
||||
|
||||
$this->load->library("PhrasesLib", null, 'PhrasesLib');
|
||||
$this->loadPhrases(array('global', 'lehre'));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* alternative function to get multiple lvMenus with a single http request
|
||||
*/
|
||||
public function getMultipleLvMenu($lvMenuOptionList){
|
||||
$result =[];
|
||||
foreach($lvMenuOptionList as $lvMenuOptions){
|
||||
$lvMenu = $this->getLvMenu($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
|
||||
if(isError($lvMenu)){
|
||||
// TODO: some lvMenu threw an error, handle error here
|
||||
}
|
||||
$result[$lvMenuOptions['lvid']]=$lvMenu;
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
|
||||
// return early if parameters are missing
|
||||
if(!isset($lvid) || !isset($studiensemester_kurzbz))
|
||||
$this->terminateWithError('Missing parameters', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// get the sprache
|
||||
$sprache = getUserLanguage();
|
||||
|
||||
// get the user
|
||||
if (!$user=getAuthUID())
|
||||
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
|
||||
|
||||
// check if is_lector
|
||||
$is_lector = false;
|
||||
$mares = $this->Mitarbeiter_model->isMitarbeiter($user);
|
||||
if(hasData($mares))
|
||||
{
|
||||
$is_lector = getData($mares);
|
||||
}
|
||||
|
||||
// definition of user_is_allowed_to_upload
|
||||
$user_is_allowed_to_upload=false;
|
||||
$angezeigtes_stsem = $studiensemester_kurzbz;
|
||||
|
||||
// load lehrveranstaltung
|
||||
$lvres = $this->Lehrveranstaltung_model->load($lvid);
|
||||
if(!hasData($lvres))
|
||||
{
|
||||
$this->terminateWithError('LV ' . $lvid . ' not found.');
|
||||
}
|
||||
$lv = (getData($lvres))[0];
|
||||
$this->addMeta('lvInfo',$lv);
|
||||
// define studiengang_kz / semester / lehrverzeichnis
|
||||
$studiengang_kz = $lv->studiengang_kz;
|
||||
$semester = $lv->semester;
|
||||
$short = $lv->lehreverzeichnis;
|
||||
// return empty menu for studiengang_kz = 0
|
||||
if($studiengang_kz == 0){
|
||||
$this->terminateWithSuccess("organisatorische_einheit");
|
||||
}
|
||||
|
||||
// load studiengang
|
||||
$stgres = $this->Studiengang_model->load(strval($studiengang_kz));
|
||||
if(!hasData($stgres))
|
||||
{
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
}
|
||||
$stg = (getData($stgres))[0];
|
||||
$kurzbz = strtoupper($stg->typ . $stg->kurzbz);
|
||||
|
||||
$short_name = $lv->bezeichnung;
|
||||
$short_short_name = $lv->lehreverzeichnis;
|
||||
|
||||
// angemeldet
|
||||
$angemeldet = true;
|
||||
if(defined('CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN && !$is_lector)
|
||||
{
|
||||
$angemeldet = false;
|
||||
|
||||
$lesres = $this->Lehreinheit_model->getLehreinheitenForStudentAndStudienSemester(
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
);
|
||||
|
||||
if(hasData($lesres) && count(getData($lesres)) > 0)
|
||||
$angemeldet = true;
|
||||
}
|
||||
|
||||
// lehrfach
|
||||
$lehrfach_id='';
|
||||
|
||||
if(defined('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN)
|
||||
{
|
||||
// Wenn der eingeloggte User zu einer der Lehreinheiten zugeteilt ist
|
||||
// wird zusätzlich das Lehrfach der Lehreinheit angezeigt.
|
||||
if($is_lector )
|
||||
{
|
||||
$result = $this->Lehreinheit_model->getLehrfachIdMitarbeiter($angezeigtes_stsem,$user,$lvid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->Lehreinheit_model->getLehrfachIdStudierender($angezeigtes_stsem,$user,$lvid);
|
||||
}
|
||||
|
||||
// Wenn die LV mehrere verschiedenen Lehrfaecher hat, und der User zu mehreren davon zugeteilt ist
|
||||
// wird das Lehrfach nicht angezeigt damit es nicht zu verwirrungen kommt.
|
||||
if( ($lehrfaecher = getData($result)) && count($lehrfaecher)==1 && ($lehrfach = $lehrfaecher[0]))
|
||||
{
|
||||
$lehrfach_id=$lehrfach->lehrfach_id;
|
||||
}
|
||||
}
|
||||
|
||||
// lektor der lv
|
||||
$lektor_der_lv=false;
|
||||
|
||||
$leinfores = $this->Lehreinheit_model->getLehreinheitInfo($lvid,$angezeigtes_stsem,$lehrfach_id);
|
||||
$db_result = hasData($leinfores) ? getData($leinfores) : array();
|
||||
|
||||
foreach($db_result as $row_lector)
|
||||
{
|
||||
|
||||
// Lektor wird erst angezeigt wenn der Auftrag erteilt wurde
|
||||
if (defined('CIS_LV_LEKTORINNENZUTEILUNG_VERTRAGSPRUEFUNG_VON')
|
||||
&& CIS_LV_LEKTORINNENZUTEILUNG_VERTRAGSPRUEFUNG_VON != '')
|
||||
{
|
||||
if (!$this->Vertrag_model->isVertragErteiltLV($lvid, $angezeigtes_stsem, $row_lector->uid))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($user == $row_lector->uid)
|
||||
{
|
||||
$lektor_der_lv=true;
|
||||
$user_is_allowed_to_upload=true;
|
||||
}
|
||||
|
||||
// style of the link
|
||||
if($row_lector->lvleiter === true)
|
||||
$style='style="font-weight: bold"';
|
||||
else
|
||||
$style='';
|
||||
|
||||
}
|
||||
|
||||
//Berechtigungen auf Fachbereichsebene
|
||||
$lehrfach_oe_kurzbz_arr = array();
|
||||
$fbres = $this->Lehrveranstaltung_model->getBerechtigungenAufFachberechsebene($lvid, $angezeigtes_stsem);
|
||||
$fbs = (hasData($fbres)) ? getData($fbres) : array();
|
||||
foreach($fbs as $row)
|
||||
{
|
||||
$lehrfach_oe_kurzbz_arr[] = $row->oe_kurzbz;
|
||||
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|
||||
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
|
||||
{
|
||||
$user_is_allowed_to_upload=true;
|
||||
}
|
||||
}
|
||||
|
||||
// FH-Core Menu Logic
|
||||
// ##########################################################################################
|
||||
|
||||
$menu = array();
|
||||
|
||||
$this->fhc_menu_lvinfo($menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr);
|
||||
|
||||
$this->fhc_menu_feedback($menu, $angemeldet, $lvid);
|
||||
|
||||
$this->fhc_menu_gesamtnote($menu, $angemeldet, $lvid, $lv, $is_lector, $angezeigtes_stsem);
|
||||
|
||||
$this->fhc_menu_emailStudierende($menu, $user, $angemeldet, $lvid, $angezeigtes_stsem);
|
||||
|
||||
$this->fhc_menu_abmeldung($menu, $user, $is_lector, $lvid, $angezeigtes_stsem);
|
||||
|
||||
$this->fhc_menu_lehretools($menu, $lvid, $angezeigtes_stsem, $sprache);
|
||||
|
||||
$this->fhc_menu_anrechnungStudent($menu, $lvid, $angezeigtes_stsem);
|
||||
|
||||
$this->fhc_menu_anrechnungLector($menu, $angezeigtes_stsem);
|
||||
|
||||
|
||||
// Addons Menu Logic
|
||||
// ##########################################################################################
|
||||
|
||||
$params = [
|
||||
'sprache'=>$sprache,
|
||||
//'p'=>$p,
|
||||
'ci_p'=> $this->p,
|
||||
//'db'=>$db,
|
||||
'user'=>$user,
|
||||
'is_lector'=>$is_lector,
|
||||
'user_is_allowed_to_upload'=>$user_is_allowed_to_upload,
|
||||
//'rechte'=>$rechte,
|
||||
'angezeigtes_stsem'=>$angezeigtes_stsem,
|
||||
//'lehreinheit'=>$lehreinheit,
|
||||
'lv_obj'=>$lv,
|
||||
'lv'=>$lv,
|
||||
'lvid'=>$lvid,
|
||||
'studiengang_kz'=>$studiengang_kz,
|
||||
'semester'=>$semester,
|
||||
'short'=>$short,
|
||||
'stg_obj'=>$stg,
|
||||
'kurzbz'=>$kurzbz,
|
||||
'short_name'=>$short_name,
|
||||
'short_short_name'=>$short_short_name,
|
||||
//'dir_name'=>$dir_name,
|
||||
'angemeldet'=>$angemeldet,
|
||||
'lehrfach_id'=>$lehrfach_id,
|
||||
'lektor_der_lv'=>$lektor_der_lv,
|
||||
'lehrfach_oe_kurzbz_arr'=>$lehrfach_oe_kurzbz_arr,
|
||||
'permissionLib' => &$this->PermissionLib,
|
||||
'phrasesLib' => &$this->PhrasesLib
|
||||
];
|
||||
|
||||
Events::trigger('lvMenuBuild',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
);
|
||||
|
||||
// Menu sortieren
|
||||
// ##########################################################################################
|
||||
|
||||
foreach ($menu as $key => $row){
|
||||
|
||||
// removes menu points that are not needed in the c4 lvUebersicht
|
||||
if( !array_key_exists('c4_link',$row) || !array_key_exists('c4_icon',$row)){
|
||||
unset($menu[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// fills pos array to sort the menu
|
||||
$pos[$key] = $row['position'];
|
||||
|
||||
}
|
||||
|
||||
array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);
|
||||
|
||||
// HTTP response
|
||||
// ##########################################################################################
|
||||
|
||||
$this->terminateWithSuccess($menu);
|
||||
|
||||
}
|
||||
|
||||
private function fhc_menu_lvinfo(&$menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr){
|
||||
|
||||
// LVINFO
|
||||
if(!defined('CIS_LEHRVERANSTALTUNG_LVINFO_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_LVINFO_ANZEIGEN)
|
||||
{
|
||||
$c4_linkList=array();
|
||||
|
||||
// Bearbeiten Button anzeigen wenn Lektor der LV und bearbeiten fuer Lektoren aktiviert ist
|
||||
// Oder Berechtigung zum Bearbeiten eingetragen ist
|
||||
if((!defined('CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT') && $lektor_der_lv)
|
||||
|| (defined('CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT') && CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT==true && $lektor_der_lv)
|
||||
|| $this->PermissionLib->isBerechtigt('lehre/lvinfo',$studiengang_kz)
|
||||
|| $this->PermissionLib->isBerechtigtMultipleOe('lehre/lvinfo', $lehrfach_oe_kurzbz_arr)
|
||||
)
|
||||
{
|
||||
$c4_linkList[]= [$this->p->t('lehre', 'lvInfoBearbeiten'), 'ects/index.php?lvid='.$lvid];
|
||||
}
|
||||
elseif ($is_lector)
|
||||
{
|
||||
$c4_linkList[]= ["Bearbeiten der LV-Infos derzeit gesperrt",'#'];
|
||||
}
|
||||
|
||||
$menu[]=array
|
||||
(
|
||||
'id'=>'core_menu_lvinfo',
|
||||
'position'=>'10',
|
||||
'name'=>$this->p->t('lehre', 'lehrveranstaltungsinformation'),
|
||||
'phrase' => 'lehre/lehrveranstaltungsinformation',
|
||||
'icon'=>'../../../skin/images/button_lvinfo.png',
|
||||
'link'=>'',
|
||||
'c4_icon'=> base_url('skin/images/button_lvinfo.png'),
|
||||
'c4_link'=>'',
|
||||
'c4_linkList'=>$c4_linkList
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function fhc_menu_feedback(&$menu, $angemeldet, $lvid){
|
||||
//FEEDBACK
|
||||
if((!defined('CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN) && $angemeldet)
|
||||
{
|
||||
$menu[]=array
|
||||
(
|
||||
'id'=>'core_menu_feedback',
|
||||
'position'=>'60',
|
||||
'name'=>$this->p->t('lehre', 'feedback'),
|
||||
'phrase' => 'lehre/feedback',
|
||||
'c4_icon'=> base_url('skin/images/button_feedback.png'),
|
||||
'c4_link'=> base_url('feedback.php?lvid='.$lvid),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function fhc_menu_gesamtnote(&$menu, $angemeldet, $lvid, $lv_obj, $is_lector, $angezeigtes_stsem){
|
||||
//Gesamtnote
|
||||
if($is_lector && ((!defined('CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN) && $angemeldet))
|
||||
{
|
||||
if($lv_obj->benotung)
|
||||
{
|
||||
$menu[]=array
|
||||
(
|
||||
'id'=>'core_menu_gesamtnote',
|
||||
'position'=>'80',
|
||||
'name'=>$this->p->t('lehre', 'gesamtnote'),
|
||||
'phrase' => 'lehre/gesamtnote',
|
||||
'c4_icon'=> base_url('skin/images/button_endnote.png'),
|
||||
'c4_link'=> base_url('cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
|
||||
//'c4_link'=> base_url('benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu[]=array
|
||||
(
|
||||
'id'=>'core_menu_gesamtnote',
|
||||
'position'=>'80',
|
||||
'name'=>$this->p->t('lehre', 'gesamtnote'),
|
||||
'phrase'=>'lehre/gesamtnote',
|
||||
'c4_icon'=>base_url('skin/images/button_endnote.png'),
|
||||
'c4_link'=>'#',
|
||||
'c4_linkList'=>[[$this->p->t('lehre', 'noteneingabedeaktiviert'),'#']],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function fhc_menu_emailStudierende(&$menu, $user, $angemeldet, $lvid, $angezeigtes_stsem){
|
||||
// Email an Studierende
|
||||
if((!defined('CIS_LEHRVERANSTALTUNG_MAILSTUDIERENDE_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_MAILSTUDIERENDE_ANZEIGEN) && $angemeldet)
|
||||
{
|
||||
$mailto='mailto:';
|
||||
$c4_linkList=array();
|
||||
|
||||
$studentMailsRes = $this->Lehrveranstaltung_model->getStudentEMail($lvid, $angezeigtes_stsem);
|
||||
|
||||
// get the data of the database result and map the array of objects to their object property
|
||||
$studentMails = $this->getDataOrTerminateWithError($studentMailsRes, 'No student mails found');
|
||||
|
||||
|
||||
$nomail='';
|
||||
$variablesres = $this->Variable_model->getVariables($user);
|
||||
$variables = (hasData($variablesres)) ? getData($variablesres) : array();
|
||||
|
||||
foreach ($studentMails as $row)
|
||||
{
|
||||
if($row->gruppe_kurzbz != '')
|
||||
{
|
||||
$bngrp_uids = $this->Benutzergruppe_model->getUids($row->gruppe_kurzbz, $angezeigtes_stsem);
|
||||
if(count($bngrp_uids) > 0)
|
||||
{
|
||||
if(!$row->mailgrp)
|
||||
{
|
||||
$nomail = $row->gruppe_kurzbz . ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mailto .= mb_strtolower($row->gruppe_kurzbz . '@'
|
||||
. DOMAIN . $variables['emailadressentrennzeichen']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mailto .= mb_strtolower($row->stg_typ . $row->stg_kurzbz
|
||||
. $row->semester . trim($row->verband) . trim($row->gruppe)
|
||||
. '@' . DOMAIN . $variables['emailadressentrennzeichen']);
|
||||
}
|
||||
}
|
||||
|
||||
if($nomail != '')
|
||||
{
|
||||
$c4_linkList[] = array(
|
||||
$this->p->t('lehre', 'keinMailverteiler', array('nomail' => $nomail)),
|
||||
'#'
|
||||
);
|
||||
$link_onclick = 'alert(\''.$this->p->t('lehre', 'keinMailverteiler', array('nomail' => $nomail)) . '\');';
|
||||
}
|
||||
else
|
||||
{
|
||||
$link_onclick = '';
|
||||
}
|
||||
|
||||
|
||||
$menu[]=array
|
||||
(
|
||||
'id'=>'core_menu_mailanstudierende',
|
||||
'position'=>'100',
|
||||
'name'=>$this->p->t('lehre', 'mail'),
|
||||
'phrase' => 'lehre/mail',
|
||||
'c4_icon'=>base_url('skin/images/button_feedback.png'),
|
||||
'c4_icon2' => 'fa-regular fa-envelope',
|
||||
'c4_link'=>$mailto,
|
||||
'c4_linkList'=>$c4_linkList,
|
||||
'link_onclick'=>$link_onclick
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function fhc_menu_abmeldung(&$menu, $user, $is_lector, $lvid, $angezeigtes_stsem){
|
||||
if(!defined('CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN)
|
||||
{
|
||||
if(!$is_lector)
|
||||
{
|
||||
$gruppen = $this->Lvangebot_model->AbmeldungMoeglich($lvid, $angezeigtes_stsem, $user);
|
||||
if(count($gruppen) > 0)
|
||||
{
|
||||
$menu[]=array
|
||||
(
|
||||
'id'=>'core_menu_abmeldung',
|
||||
'position'=>'120',
|
||||
'name'=>$this->p->t('lehre', 'abmelden'),
|
||||
'phrase'=>'lehre/abmelden',
|
||||
'c4_icon'=>base_url('skin/images/button_studiupload.png'),
|
||||
'c4_link'=>base_url('abmeldung.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem)),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function fhc_menu_lehretools(&$menu, $lvid, $angezeigtes_stsem, $sprache){
|
||||
//Anzeigen von zusaetzlichen Lehre-Tools
|
||||
$lehretools = $this->Lehretools_model->getTools($lvid, $angezeigtes_stsem, $sprache);
|
||||
foreach($lehretools as $row)
|
||||
{
|
||||
$menu[] = array(
|
||||
'id' => 'core_menu_lehretools_' . $row->lehre_tools_id,
|
||||
'position' => '1000',
|
||||
'name' => $row->bezeichnung,
|
||||
'c4_icon' => base_url('cms/dms.php?id='.$row->logo_dms_id),
|
||||
'c4_link' => $row->basis_url,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function fhc_menu_anrechnungStudent(&$menu, $lvid, $angezeigtes_stsem){
|
||||
// Anerkennung nachgewiesener Kenntnisse (Anrechnung) - Anzeige fuer Studenten
|
||||
if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN)
|
||||
&& $this->PermissionLib->isBerechtigt('student/anrechnung_beantragen'))
|
||||
{
|
||||
$menu[]=array
|
||||
(
|
||||
'id' => 'core_menu_anerkennungNachgewiesenerKenntnisse',
|
||||
'position' => '128',
|
||||
'name' => $this->p->t('lehre', 'anrechnung'),
|
||||
'phrase' => 'lehre/anrechnung',
|
||||
'c4_icon' => base_url('skin/images/button_listen.png'),
|
||||
'c4_icon2' => 'fa-regular fa-folder-open',
|
||||
'c4_link' => base_url('cis.php/lehre/anrechnung/RequestAnrechnung?studiensemester='.urlencode($angezeigtes_stsem).'&lv_id='.urlencode($lvid))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function fhc_menu_anrechnungLector(&$menu, $angezeigtes_stsem){
|
||||
// Anerkennung nachgewiesener Kenntnisse (Anrechnung) - Anzeige fuer LektorInnen
|
||||
if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN)
|
||||
&& $this->PermissionLib->isBerechtigt('lehre/anrechnung_empfehlen'))
|
||||
{
|
||||
$menu[]=array
|
||||
(
|
||||
'id' => 'core_menu_anerkennungNachgewiesenerKenntnisse_empfehlen',
|
||||
'position' => '128',
|
||||
'name' => $this->p->t('lehre', 'anrechnungen'),
|
||||
'phrase' => 'lehre/anrechnung',
|
||||
'c4_icon'=> base_url('skin/images/button_listen.png'),
|
||||
'c4_icon2' => 'fa-regular fa-folder-open',
|
||||
'c4_link' => base_url('cis.php/lehre/anrechnung/ReviewAnrechnungUebersicht?studiensemester='.urlencode($angezeigtes_stsem))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
use \DateTime as DateTime;
|
||||
use \DateTimeZone as DateTimeZone;
|
||||
|
||||
class LvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'getRoomplan' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'getReservierungen' => self::PERM_LOGGED,
|
||||
'LvPlanEvents' => self::PERM_LOGGED,
|
||||
'eventsPersonal' => self::PERM_LOGGED,
|
||||
'eventsLv' => self::PERM_LOGGED,
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
'studiensemesterDateInterval' => self::PERM_LOGGED,
|
||||
'getLvPlanForStudiensemester' => self::PERM_LOGGED,
|
||||
'getLv' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function LvPlanEvents()
|
||||
{
|
||||
$hasLv = $this->input->post('lv_id');
|
||||
|
||||
return $hasLv ? $this->eventsLv() : $this->eventsPersonal();
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches LvPlan, Moodle and Ferien events together for the logged in user
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function eventsPersonal()
|
||||
{
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
// form validation
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
|
||||
// fetching lvplan events
|
||||
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date);
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// fetching moodle events
|
||||
$moodleEvents = $this->fetchMoodleEvents($start_date, $end_date);
|
||||
|
||||
// fetching ferien events
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
|
||||
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$lvplanEvents,
|
||||
$moodleEvents,
|
||||
$ferienEvents
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Ferien events together for the lv
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function eventsLv()
|
||||
{
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
// form validation
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
$this->form_validation->set_rules('lv_id', "lv_id", "required|integer");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
$lv_id = $this->input->post('lv_id', true);
|
||||
|
||||
// fetching lvplan events
|
||||
$result = $this->stundenplanlib->getEventsLv($lv_id, $start_date, $end_date);
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// fetching ferien events
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
|
||||
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$lvplanEvents,
|
||||
$ferienEvents
|
||||
));
|
||||
}
|
||||
|
||||
//TODO: delete this function if we don't use the old calendar export endpoints anymore
|
||||
public function studiensemesterDateInterval($date){
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$studiensemester =$this->StudiensemesterModel->getByDate(date_format(date_create($date),'Y-m-d'));
|
||||
$studiensemester =current($this->getDataOrTerminateWithError($studiensemester));
|
||||
$this->terminateWithSuccess($studiensemester);
|
||||
}
|
||||
|
||||
public function getLvPlanForStudiensemester($studiensemester,$lvid){
|
||||
$this->load->library('StundenplanLib');
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
|
||||
$studiensemester_result = $this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz"=>$studiensemester]);
|
||||
$studiensemester_result = current($this->getDataOrTerminateWithError($studiensemester_result));
|
||||
$timespan_start = new DateTime($studiensemester_result->start);
|
||||
$timespan_ende = new DateTime($studiensemester_result->ende);
|
||||
$lvplan = $this->stundenplanlib->getStundenplan(date_format($timespan_start, 'Y-m-d'),date_format($timespan_ende, 'Y-m-d'), $lvid);
|
||||
$this->terminateWithSuccess($lvplan);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
$this->StundeModel->addOrder('stunde', 'ASC');
|
||||
$stunden = $this->StundeModel->load();
|
||||
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
|
||||
$this->terminateWithSuccess($stunden);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches room events from a certain date
|
||||
* @access public
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getRoomplan()
|
||||
{
|
||||
$this->form_validation->set_rules('ort_kurzbz', "Ort", "required");
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$ort_kurzbz = $this->input->post('ort_kurzbz', true);
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
|
||||
// get data
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$roomplan_data = $this->stundenplanlib->getRoomplan($ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
$roomplan_data = $this->getDataOrTerminateWithError($roomplan_data);
|
||||
|
||||
$this->terminateWithSuccess($roomplan_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the reservierungen of a room if the ort_kurzbz parameter is
|
||||
* supplied otherwise gets the reservierungen of the lvplan of a student
|
||||
* @access public
|
||||
*
|
||||
* @param string $ort_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
public function getReservierungen($ort_kurzbz = null)
|
||||
{
|
||||
$this->form_validation->set_rules('start_date', "StartDate", "required");
|
||||
$this->form_validation->set_rules('end_date', "EndDate", "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
|
||||
// get data
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
$result = current($this->getDataOrTerminateWithError($result))->studiensemester_kurzbz;
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* get details for a lv
|
||||
* @access public
|
||||
*
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @return void
|
||||
*/
|
||||
public function getLv($lehrveranstaltung_id)
|
||||
{
|
||||
if (!$lehrveranstaltung_id && $lehrveranstaltung_id !== 0 && $lehrveranstaltung_id !== '0')
|
||||
return show_404();
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases(['lehre']);
|
||||
|
||||
// Validation
|
||||
$this->form_validation->set_data([
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id', $this->p->t('lehre', 'lehrveranstaltung_id'), 'integer');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// Get Data
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $this->terminateWithSuccess(current($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch moodle events
|
||||
*
|
||||
* @param string $start_date
|
||||
* @param string $end_date
|
||||
* @return array
|
||||
*/
|
||||
private function fetchMoodleEvents($start_date, $end_date)
|
||||
{
|
||||
$this->load->config('calendar');
|
||||
|
||||
$tz = new DateTimeZone($this->config->item('timezone'));
|
||||
|
||||
$start = new DateTime($start_date);
|
||||
$start->setTimezone($tz);
|
||||
|
||||
$end = new DateTime($end_date);
|
||||
$end->setTimezone($tz);
|
||||
$end->modify('+1 day -1 second');
|
||||
|
||||
$moodle_events = [];
|
||||
|
||||
Events::trigger(
|
||||
'moodleCalendarEvents',
|
||||
function & () use (&$moodle_events) {
|
||||
return $moodle_events;
|
||||
},
|
||||
[
|
||||
'start_date' => $start->format('c'),
|
||||
'end_date' => $end->format('c'),
|
||||
'username' => getAuthUID()
|
||||
]
|
||||
);
|
||||
|
||||
return $moodle_events;
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch ferien events
|
||||
*
|
||||
* @param string $start_date
|
||||
* @param string $end_date
|
||||
* @return array
|
||||
*/
|
||||
private function fetchFerienEvents($start_date, $end_date)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentLehrverbandModel');
|
||||
|
||||
$currentStudiensemester = $this->StudiensemesterModel->getByDate($start_date);
|
||||
$currentStudiensemester = $this->getDataOrTerminateWithError($currentStudiensemester);
|
||||
|
||||
if ($currentStudiensemester) {
|
||||
$studentsemester_kurzbz = current($currentStudiensemester)->studiensemester_kurzbz;
|
||||
|
||||
$studiengang = $this->StudentLehrverbandModel->loadWhere([
|
||||
"student_uid" => getAuthUID(),
|
||||
"studiensemester_kurzbz" => $studentsemester_kurzbz
|
||||
]);
|
||||
$studiengang = $this->getDataOrTerminateWithError($studiengang);
|
||||
|
||||
if ($studiengang)
|
||||
$studiengang_kz = current($studiengang)->studiengang_kz;
|
||||
else
|
||||
$studiengang_kz = 0;
|
||||
} else {
|
||||
$studiengang_kz = 0;
|
||||
}
|
||||
|
||||
$ferienEvents = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $studiengang_kz);
|
||||
|
||||
return $this->getDataOrTerminateWithError($ferienEvents);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
|
||||
* Provides data to the ajax get calls about the searchbar component
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class Ort extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// NOTE(chris): additional permission checks will be done in SearchBarLib
|
||||
parent::__construct([
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'getRooms' => self::PERM_LOGGED,
|
||||
'getTypes' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->config->load('raumsuche');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Retrieves all Ort entries filtered by the provided parameters
|
||||
*/
|
||||
public function getRooms()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('datum','Datum','required');
|
||||
$this->form_validation->set_rules('von','Uhrzeit Von','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('bis','Uhrzeit Bis','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
if($this->form_validation->run() == FALSE) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$datum = $this->input->get('datum', TRUE);
|
||||
$von = $this->input->get('von', TRUE);
|
||||
$bis = $this->input->get('bis', TRUE);
|
||||
$typ = $this->input->get('typ', TRUE);
|
||||
$personenanzahl = $this->input->get('personenanzahl', TRUE);
|
||||
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
|
||||
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$vonStunde = getData($this->StundeModel->getStundeForTime($von))[0]->stunde;
|
||||
$bisStunde = getData($this->StundeModel->getStundeForTime($bis))[0]->stunde;
|
||||
|
||||
$params = array();
|
||||
$qry = "SELECT DISTINCT tbl_ort.*
|
||||
FROM public.tbl_ort JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
|
||||
WHERE aktiv AND lehre AND ort_kurzbz NOT LIKE '\\\\_%'";
|
||||
if($typ) {
|
||||
$params[] = $typ;
|
||||
$qry.= "AND raumtyp_kurzbz = ?";
|
||||
}
|
||||
|
||||
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
|
||||
$qry.= ' AND raumtyp_kurzbz IN ?';
|
||||
$params[] = $this->config->item('roomtypes_student');
|
||||
$this->addMeta('config', $this->config->item('roomtypes_student'));
|
||||
}
|
||||
|
||||
$qry.= "AND (max_person>= ? OR max_person is null)";
|
||||
$params[] = $personenanzahl;
|
||||
|
||||
$qry.=" AND ort_kurzbz NOT IN
|
||||
(
|
||||
SELECT ort_kurzbz FROM lehre.tbl_stundenplandev WHERE datum = ? AND stunde >= ? AND stunde <= ?
|
||||
UNION
|
||||
SELECT ort_kurzbz FROM campus.tbl_reservierung WHERE datum= ? AND stunde >= ? AND stunde <= ?
|
||||
)
|
||||
";
|
||||
$params = array_merge($params, [$datum, $vonStunde, $bisStunde, $datum, $vonStunde, $bisStunde]);
|
||||
// $this->addMeta('qry', $qry);
|
||||
// $this->addMeta('params', $params);
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getTypes()
|
||||
{
|
||||
$this->load->model('ressource/Raumtyp_model', 'RaumtypModel');
|
||||
$qry = "SELECT * FROM public.tbl_raumtyp WHERE aktiv = true";
|
||||
$params = array();
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
|
||||
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
|
||||
$qry.= ' AND raumtyp_kurzbz IN ?';
|
||||
$params[] = $this->config->item('roomtypes_student');
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY raumtyp_kurzbz;";
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
public function ContentID()
|
||||
{
|
||||
// if error
|
||||
//$this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$ort_kurzbz = $this->input->get('ort_kurzbz',TRUE);
|
||||
|
||||
if(!$ort_kurzbz){
|
||||
$this->terminateWithError("missing ort_kurzbz parameter", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->OrtModel->getContentID($ort_kurzbz);
|
||||
|
||||
if(isError($result)){
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = hasData($result) ? current(getData($result)) : null;
|
||||
|
||||
$this->terminateWithSuccess($result->content_id ?? NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $version
|
||||
* @param string $sprache
|
||||
* @param boolean $sichtbar
|
||||
*
|
||||
* @return $content
|
||||
*/
|
||||
public function getOrtKurzbzContent($version = null, $sprache = null, $sichtbar = true)
|
||||
{
|
||||
$content_id = $this->input->get("content_id",TRUE);
|
||||
|
||||
$this->load->library('CmsLib');
|
||||
|
||||
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar);
|
||||
|
||||
if (isError($content))
|
||||
$this->terminateWithError(getError($content), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$content = hasData($content) ? getData($content) : null;
|
||||
|
||||
$this->terminateWithSuccess($content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,13 @@ class Phrasen extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'loadModule' => self::PERM_ANONYMOUS
|
||||
'loadModule' => self::PERM_ANONYMOUS,
|
||||
'setLanguage' => self::PERM_ANONYMOUS,
|
||||
'getLanguage' => self::PERM_ANONYMOUS,
|
||||
'getAllLanguages' => self::PERM_ANONYMOUS,
|
||||
]);
|
||||
|
||||
$this->load->helper('hlp_language');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -43,4 +48,48 @@ class Phrasen extends FHCAPI_Controller
|
||||
$this->load->library('PhrasesLib', [$module], 'pj');
|
||||
$this->terminateWithSuccess(json_decode($this->pj->getJSON()));
|
||||
}
|
||||
}
|
||||
|
||||
public function setLanguage()
|
||||
{
|
||||
$postParams = $this->getPostJSON();
|
||||
$language = $postParams->language;
|
||||
$categories = $postParams->categories;
|
||||
|
||||
setUserLanguage($language);
|
||||
|
||||
$this->load->library('PhrasesLib', array($categories, $language), 'p');
|
||||
|
||||
$phrases = $this->p->setPhrases($categories, $language);
|
||||
$this->terminateWithSuccess($phrases);
|
||||
}
|
||||
|
||||
// gets the langauge of the currently logged in user session and otherwhise the system language
|
||||
public function getLanguage()
|
||||
{
|
||||
$lang = getUserLanguage();
|
||||
$this->terminateWithSuccess($lang);
|
||||
}
|
||||
|
||||
// gets all languages that are set as active in the database
|
||||
public function getAllLanguages()
|
||||
{
|
||||
$this->load->model('system/Sprache_model', 'SprachenModel');
|
||||
|
||||
// Add order clause by index and select the sprache,bezeichnung and index column
|
||||
$this->SprachenModel->addOrder('index');
|
||||
$this->SprachenModel->addSelect('sprache, bezeichnung, index');
|
||||
|
||||
// Retrieves from public.tbl_sprache
|
||||
$langs = $this->SprachenModel->loadWhere(array('content' => true));
|
||||
$langs = $this->getDataOrTerminateWithError($langs);
|
||||
$langs = array_map(function($lang){
|
||||
$data = new stdClass();
|
||||
$data->sprache = $lang->sprache;
|
||||
$data->bezeichnung = $lang->bezeichnung[($lang->index-1)];
|
||||
return $data;
|
||||
}, $langs);
|
||||
|
||||
$this->terminateWithSuccess($langs);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Profil extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'fotoSperre' => self::PERM_LOGGED,
|
||||
'getGemeinden' => self::PERM_LOGGED,
|
||||
'getAllNationen' => self::PERM_LOGGED,
|
||||
'isMitarbeiter' => self::PERM_LOGGED,
|
||||
'profilViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
|
||||
//? put the uid and pid inside the controller for reusability
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function profilViewData($uid=null){
|
||||
$this->load->library('ProfilLib');
|
||||
$editable = false;
|
||||
if(isset($uid) && $uid != null){
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
if($uid == getAuthUID()){
|
||||
$editable = true;
|
||||
}
|
||||
}else{
|
||||
$editable = true;
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
}
|
||||
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>$editable,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* update column foto_sperre in public.tbl_person
|
||||
* @access public
|
||||
* @param boolean $value new value for the column
|
||||
* @return boolean the new value added to the column in public.tbl_person
|
||||
*/
|
||||
public function fotoSperre($value)
|
||||
{
|
||||
if(!isset($value)){
|
||||
$this->terminateWithError("Missing parameter", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
|
||||
if (isError($res)) {
|
||||
$this->terminateWithError("error while trying to update table public.tbl_person");
|
||||
}
|
||||
$this->PersonModel->addSelect("foto_sperre");
|
||||
$res = $this->PersonModel->load($this->pid);
|
||||
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
$this->terminateWithSuccess(current($res));
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all nations in the table bis.tbl_nation
|
||||
*
|
||||
* @access public
|
||||
* @return array all the nations in table bis.tbl_nation
|
||||
*/
|
||||
public function getAllNationen()
|
||||
{
|
||||
// load the nationen from the database
|
||||
$this->load->model('codex/Nation_model', "NationModel");
|
||||
$this->NationModel->addSelect(["nation_code as code", "langtext"]);
|
||||
$nation_res = $this->NationModel->load();
|
||||
|
||||
if (isError($nation_res)) {
|
||||
$this->terminateWithError("error while trying to query table codex.tbl_nation", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$nation_res = $this->getDataOrTerminateWithError($nation_res);
|
||||
|
||||
$this->terminateWithSuccess($nation_res);
|
||||
}
|
||||
|
||||
public function getGemeinden($nation, $zip)
|
||||
{
|
||||
if(!isset($nation) || !isset($zip)){
|
||||
echo json_encode(error("Missing parameters"));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
|
||||
|
||||
|
||||
$gemeinde_res = $this->GemeindeModel->getGemeindeByPlz($zip);
|
||||
|
||||
if (isError($gemeinde_res)) {
|
||||
$this->terminateWithError(getError($gemeinde_res),self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$gemeinde_res = $this->getDataOrTerminateWithError($gemeinde_res);
|
||||
|
||||
/* $gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->ortschaftsname;
|
||||
}, $gemeinde_res); */
|
||||
|
||||
$this->terminateWithSuccess($gemeinde_res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
* @param $uid the userID used to check if it is a mitarbeiter
|
||||
* @return boolean
|
||||
*/
|
||||
public function isMitarbeiter($uid)
|
||||
{
|
||||
|
||||
if(!$uid) $this->terminateWithError("No uid provided", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$result = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError("error when calling Mitarbeiter_model function isMitarbeiter with uid " . $uid, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,957 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class ProfilUpdate extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
public static $STATUS_PENDING = NULL;
|
||||
public static $STATUS_ACCEPTED = NULL;
|
||||
public static $STATUS_REJECTED = NULL;
|
||||
|
||||
public static $TOPICS = [];
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStatus' => self::PERM_LOGGED,
|
||||
'getTopic' => self::PERM_LOGGED,
|
||||
'getProfilRequestFiles' => self::PERM_LOGGED,
|
||||
'getProfilUpdateWithPermission' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
|
||||
'denyProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
|
||||
'acceptProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
|
||||
'selectProfilRequest' => self::PERM_LOGGED,
|
||||
'insertProfilRequest' => self::PERM_LOGGED,
|
||||
'updateProfilRequest' => self::PERM_LOGGED,
|
||||
'deleteProfilRequest' => self::PERM_LOGGED,
|
||||
'insertFile' => self::PERM_LOGGED,
|
||||
'updateProfilbild' => self::PERM_LOGGED,
|
||||
'show' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->config('cis');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui',
|
||||
'global',
|
||||
'person',
|
||||
'profil',
|
||||
'profilUpdate'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Adressentyp_model', 'AdressenTypModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->load->model('person/Profil_update_status_model', 'ProfilUpdateStatusModel');
|
||||
$this->load->model('person/Profil_update_topic_model', 'ProfilUpdateTopicModel');
|
||||
|
||||
$this->load->library('DmsLib');
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
//? put the uid and pid inside the controller for reusability
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
|
||||
// setup the ProfilUpdate states
|
||||
$this->ProfilUpdateStatusModel->addSelect(['status_kurzbz']);
|
||||
$status_kurzbz = $this->ProfilUpdateStatusModel->load();
|
||||
if (hasData($status_kurzbz)) {
|
||||
list($status_pending, $status_accepted, $status_rejected) = getData($status_kurzbz);
|
||||
|
||||
self::$STATUS_PENDING = $status_pending->status_kurzbz;
|
||||
self::$STATUS_ACCEPTED = $status_accepted->status_kurzbz;
|
||||
self::$STATUS_REJECTED = $status_rejected->status_kurzbz;
|
||||
}
|
||||
// setup the ProfilUpdate topics
|
||||
$this->ProfilUpdateTopicModel->addSelect(['topic_kurzbz']);
|
||||
$topic_kurzbz = $this->ProfilUpdateTopicModel->load();
|
||||
|
||||
if (hasData($topic_kurzbz)) {
|
||||
foreach (getData($topic_kurzbz) as $topic) {
|
||||
self::$TOPICS[$topic->topic_kurzbz] = $topic->topic_kurzbz;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getStatus()
|
||||
{
|
||||
$this->terminateWithSuccess([self::$STATUS_PENDING => self::$STATUS_PENDING, self::$STATUS_ACCEPTED => self::$STATUS_ACCEPTED, self::$STATUS_REJECTED => self::$STATUS_REJECTED]);
|
||||
}
|
||||
|
||||
|
||||
public function getTopic()
|
||||
{
|
||||
if(!count(self::$TOPICS)){
|
||||
$this->terminateWithError('No topics found');
|
||||
}
|
||||
$this->terminateWithSuccess(self::$TOPICS);
|
||||
}
|
||||
|
||||
public function show($dms_id)
|
||||
{
|
||||
|
||||
$profil_update = $this->ProfilUpdateModel->loadWhere(['attachment_id' => $dms_id]);
|
||||
$profil_update = hasData($profil_update) ? getData($profil_update)[0] : null;
|
||||
|
||||
//? checks if an profil update exists with the dms_id requested from the user
|
||||
if ($profil_update) {
|
||||
$is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($profil_update->uid));
|
||||
$is_student_profil_update = getData($this->StudentModel->isStudent($profil_update->uid));
|
||||
|
||||
if (
|
||||
$this->permissionlib->isBerechtigt('student/stammdaten:r') && $is_student_profil_update ||
|
||||
$this->permissionlib->isBerechtigt('mitarbeiter/stammdaten:r') && $is_mitarbeiter_profil_update ||
|
||||
$this->uid == $profil_update->uid
|
||||
) {
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id);
|
||||
$download = $this->getDataOrTerminateWithError($download);
|
||||
// Download file
|
||||
$this->outputFile($download);
|
||||
|
||||
|
||||
} else {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_dms_error'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function selectProfilRequest()
|
||||
{
|
||||
|
||||
$uid = $this->input->get('uid',true);
|
||||
$id = $this->input->get('id',true);
|
||||
$whereClause = ['uid' => $this->uid];
|
||||
|
||||
if (isset($uid))
|
||||
$whereClause['uid'] = $uid;
|
||||
if (isset($id))
|
||||
$whereClause['id'] = $id;
|
||||
|
||||
$res = $this->ProfilUpdateModel->getProfilUpdatesWhere($whereClause);
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
$this->terminateWithSuccess($res);
|
||||
|
||||
}
|
||||
|
||||
public function insertProfilRequest()
|
||||
{
|
||||
|
||||
$payload = $this->input->post('payload');
|
||||
$topic = $this->input->post('topic',true);
|
||||
$fileID = $this->input->post('fileID',true);
|
||||
|
||||
if(!isset($payload) || !isset($topic)){
|
||||
$this->terminateWithError("required parameters are missing");
|
||||
}
|
||||
|
||||
$identifier = array_key_exists("kontakt_id", $payload) ? "kontakt_id" : (array_key_exists("adresse_id", $payload) ? "adresse_id" : null);
|
||||
|
||||
$data = ["topic" => $topic, "uid" => $this->uid, "requested_change" => json_encode($payload), "insertamum" => "NOW()", "insertvon" => $this->uid, "status" => self::$STATUS_PENDING ?: 'Pending'];
|
||||
|
||||
//? insert fileID in the dataset if sent with post request
|
||||
if (isset($fileID)) {
|
||||
$data['attachment_id'] = $fileID;
|
||||
}
|
||||
|
||||
//? loops over all updateRequests from a user to validate if the new request is valid
|
||||
$res = $this->ProfilUpdateModel->getProfilUpdatesWhere(["uid" => $this->uid]);
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
//? the user cannot delete a zustelladresse/kontakt
|
||||
if (isset($payload["delete"]) && $payload[$identifier == "kontakt_id" ? "zustellung" : "zustelladresse"]) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error'));
|
||||
}
|
||||
|
||||
//? if the user tries to delete a adresse, checks whether the adresse is a heimatadresse, if so an error is raised
|
||||
if (isset($payload["delete"]) && $identifier == "adresse_id") {
|
||||
$adr = $this->AdresseModel->load($payload[$identifier]);
|
||||
$adr = $this->getDataOrTerminateWithError($adr)[0];
|
||||
if ($adr->heimatadresse) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
$pending_changes = array_filter($res, function ($element) {
|
||||
return $element->status == (self::$STATUS_PENDING ?: "Pending");
|
||||
});
|
||||
foreach ($pending_changes as $update_request) {
|
||||
$existing_change = $update_request->requested_change;
|
||||
//? the user can add as many new kontakte/adressen as he likes
|
||||
if (!isset($payload["add"]) && property_exists($existing_change, $identifier) && array_key_exists($identifier,$payload) && $existing_change->$identifier == $payload[$identifier]) {
|
||||
//? the kontakt_id / adresse_id of a change has to be unique
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_changeTwice_error'));
|
||||
}
|
||||
|
||||
//? if it is not updating any kontakt/adresse, the topic has to be unique
|
||||
elseif (!$identifier && $update_request->topic == $topic) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_changeTopicTwice_error', ['0' => $update_request->topic]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$insertID = $this->ProfilUpdateModel->insert($data);
|
||||
|
||||
if (isError($insertID)) {
|
||||
$this->terminateWithError(getError($insertID));
|
||||
} else {
|
||||
|
||||
$insertID = hasData($insertID) ? getData($insertID) : null;
|
||||
//? sends emails to the correspondents of the $uid
|
||||
$this->sendEmail_onProfilUpdate_insertion($this->uid, $insertID, $topic);
|
||||
$this->terminateWithSuccess(success($insertID));
|
||||
}
|
||||
}
|
||||
|
||||
public function updateProfilRequest()
|
||||
{
|
||||
$topic = $this->input->post('topic', true);
|
||||
$payload = $this->input->post('payload', true);
|
||||
$ID = $this->input->post('ID', true);
|
||||
$fileID = $this->input->post('fileID', true);//optional
|
||||
|
||||
if(!isset($topic) || !isset($payload) || !isset($ID)){
|
||||
$this->terminateWithError("required parameters are missing");
|
||||
}
|
||||
|
||||
$updateData = ["requested_change" => json_encode($payload), "updateamum" => "NOW()", "updatevon" => $this->uid];
|
||||
if (isset($fileID)) {
|
||||
$updateData['attachment_id'] = json_decode($fileID);
|
||||
}
|
||||
$updateID = $this->ProfilUpdateModel->update([$ID], $updateData);
|
||||
//? insert fileID in the dataset if sent with post request
|
||||
|
||||
if (isError($updateID)) {
|
||||
$this->terminateWithError(getError($updateID));
|
||||
}
|
||||
|
||||
$updateID = $this->getDataOrTerminateWithError($updateID)[0];
|
||||
|
||||
$this->terminateWithSuccess(success($updateID));
|
||||
}
|
||||
|
||||
public function deleteProfilRequest()
|
||||
{
|
||||
|
||||
$requestID = $this->input->post('requestID', true);
|
||||
$result = $this->ProfilUpdateModel->delete([$requestID]);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getProfilRequestFiles($id)
|
||||
{
|
||||
if(!$id){
|
||||
$this->terminateWithError("parameter id is missing");
|
||||
}
|
||||
|
||||
$this->ProfilUpdateModel->addSelect(["attachment_id"]);
|
||||
$attachmentID = $this->ProfilUpdateModel->load([$id]);
|
||||
if (isError($attachmentID)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loading_error'),self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
//? get the attachmentID
|
||||
$dms_id = $this->getDataOrTerminateWithError($attachmentID)[0]->attachment_id;
|
||||
|
||||
//? get the name to the file
|
||||
$this->DmsVersionModel->addSelect(["name", "dms_id"]);
|
||||
$attachment = $this->DmsVersionModel->load([$dms_id, 0]);
|
||||
if (isError($attachment)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_dmsVersion_error'),self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$attachment = $this->getDataOrTerminateWithError($attachment);
|
||||
//? returns {name:..., dms_id:...}
|
||||
$this->terminateWithSuccess($attachment);
|
||||
}
|
||||
|
||||
public function denyProfilRequest()
|
||||
{
|
||||
$id = $this->input->post('profil_update_id', true);
|
||||
$uid = $this->input->post('uid', true);
|
||||
$topic = $this->input->post('topic', true);
|
||||
$status_message = $this->input->post('status_message', true); //optional
|
||||
|
||||
if(!isset($id) || !isset($uid) || !isset($topic)){
|
||||
$this->terminateWithError("parameter id, uid, topic or status_message is missing");
|
||||
}
|
||||
|
||||
$is_mitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
$is_mitarbeiter = $this->getDataOrTerminateWithError($is_mitarbeiter);
|
||||
|
||||
$is_student = $this->StudentModel->isStudent($uid);
|
||||
$is_student = $this->getDataOrTerminateWithError($is_student);
|
||||
|
||||
if (
|
||||
$is_student && $this->permissionlib->isBerechtigt('student/stammdaten', "suid", $this->getOE_from_student($uid)) ||
|
||||
$is_mitarbeiter && $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', "suid")
|
||||
) {
|
||||
$this->sendEmail_onProfilUpdate_response($uid, $topic, self::$STATUS_REJECTED);
|
||||
$this->terminateWithSuccess($this->setStatusOnUpdateRequest($id, self::$STATUS_REJECTED, $status_message));
|
||||
} else {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_permission_error'),self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
public function acceptProfilRequest()
|
||||
{
|
||||
$id = $this->input->post('profil_update_id', true);
|
||||
$uid = $this->input->post('uid', true);
|
||||
$topic = $this->input->post('topic', true);
|
||||
$requested_change = $this->input->post('requested_change');
|
||||
$status_message = $this->input->post('status_message', true); //optional
|
||||
|
||||
//? fetching person_id using UID
|
||||
$personID = $this->PersonModel->getByUid($uid);
|
||||
$personID = $this->getDataOrTerminateWithError($personID)[0]->person_id;
|
||||
|
||||
//! check for required information
|
||||
if (!isset($id) || !isset($uid) || !isset($personID) || !isset($requested_change) || !isset($topic)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_requiredInformation_error'));
|
||||
}
|
||||
|
||||
$is_mitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
$is_mitarbeiter = $this->getDataOrTerminateWithError($is_mitarbeiter);
|
||||
|
||||
$is_student = $this->StudentModel->isStudent($uid);
|
||||
$is_student = $this->getDataOrTerminateWithError($is_student);
|
||||
|
||||
|
||||
//? check if the permissions are set correctly
|
||||
if (
|
||||
$is_student && $this->permissionlib->isBerechtigt('student/stammdaten', "suid", $this->getOE_from_student($uid)) ||
|
||||
$is_mitarbeiter && $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', "suid")
|
||||
) {
|
||||
|
||||
if (is_array($requested_change) && array_key_exists("adresse_id", $requested_change)) {
|
||||
$insertID = $this->handleAdresse($requested_change, $personID);
|
||||
$insertID = getData($insertID);
|
||||
if (isset($insertID)) {
|
||||
$requested_change['adresse_id'] = $insertID;
|
||||
$update_res = $this->updateRequestedChange($id, $requested_change);
|
||||
if (isError($update_res)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_address_error', [$insertID]));
|
||||
}
|
||||
}
|
||||
|
||||
} else if (is_array($requested_change) && array_key_exists("kontakt_id", $requested_change)) {
|
||||
$insertID = $this->handleKontakt($requested_change, $personID);
|
||||
$insertID = getData($insertID);
|
||||
if (isset($insertID)) {
|
||||
$requested_change['kontakt_id'] = $insertID;
|
||||
$update_res = $this->updateRequestedChange($id, $requested_change);
|
||||
if (isError($update_res)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_kontakt_error', [$insertID]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
switch ($topic) {
|
||||
// mapping phrasen to database columns to make the update with the correct column names
|
||||
case self::$TOPICS['Titel']:
|
||||
$topic = "titelpre";
|
||||
break;
|
||||
case self::$TOPICS['Postnomen']:
|
||||
$topic = "titelpost";
|
||||
break;
|
||||
case self::$TOPICS['Vorname']:
|
||||
$topic = "vorname";
|
||||
break;
|
||||
case self::$TOPICS['Nachname']:
|
||||
$topic = "nachname";
|
||||
break;
|
||||
default:
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_topic_error', [$topic]));
|
||||
}
|
||||
|
||||
$result = $this->PersonModel->update($personID, [$topic => $requested_change["value"]]);
|
||||
if (isError($result)) $this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_insert_error'));
|
||||
|
||||
}
|
||||
$this->sendEmail_onProfilUpdate_response($uid, $topic, self::$STATUS_ACCEPTED);
|
||||
|
||||
$this->terminateWithSuccess($this->setStatusOnUpdateRequest($id, self::$STATUS_ACCEPTED, $status_message, $requested_change));
|
||||
} else {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function insertFile($replace)
|
||||
{
|
||||
$replace = json_decode($replace);
|
||||
|
||||
if (!count($_FILES)) {
|
||||
$this->terminateWithError("No file available for upload");
|
||||
}
|
||||
|
||||
//? if replace is set it contains the profil_update_id in which the attachment_id has to be replaced
|
||||
if (isset($replace)) {
|
||||
|
||||
$this->ProfilUpdateModel->addSelect(["attachment_id"]);
|
||||
$profilUpdate = $this->ProfilUpdateModel->load([$replace]);
|
||||
if (isError($profilUpdate)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loading_error'));
|
||||
}
|
||||
//? get the attachmentID
|
||||
$dms_id = $this->getDataOrTerminateWithError($profilUpdate)[0]->attachment_id;
|
||||
|
||||
//? delete old dms_file of Profil Update
|
||||
$deleteOldFile_result = $this->deleteOldVersionFile($dms_id);
|
||||
if(!$deleteOldFile_result){
|
||||
$this->terminateWithError("error while deleting the old file");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$files = $_FILES['files'];
|
||||
$file_count = count($files['name']);
|
||||
|
||||
$res = [];
|
||||
|
||||
for ($i = 0; $i < $file_count; $i++) {
|
||||
$_FILES['files']['name'] = $files['name'][$i];
|
||||
$_FILES['files']['type'] = $files['type'][$i];
|
||||
$_FILES['files']['tmp_name'] = $files['tmp_name'][$i];
|
||||
$_FILES['files']['error'] = $files['error'][$i];
|
||||
$_FILES['files']['size'] = $files['size'][$i];
|
||||
|
||||
$dms = [
|
||||
"kategorie_kurzbz" => "profil_aenderung",
|
||||
"version" => 0,
|
||||
"name" => $_FILES['files']['name'],
|
||||
"mimetype" => $_FILES['files']['type'],
|
||||
"beschreibung" => $this->uid . " Profil Änderung",
|
||||
"insertvon" => $this->uid,
|
||||
"insertamum" => "NOW()",
|
||||
];
|
||||
|
||||
$tmp_res = $this->dmslib->upload($dms, 'files', array("jpg", "png", "pdf"));
|
||||
|
||||
if(isError($tmp_res)){
|
||||
$this->addError(getError($tmp_res));
|
||||
}
|
||||
|
||||
$tmp_res = $this->getDataOrTerminateWithError($tmp_res);
|
||||
array_push($res, $tmp_res);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
}
|
||||
|
||||
public function updateProfilbild()
|
||||
{
|
||||
|
||||
$resize = function($filename, $width, $height){
|
||||
// Hoehe und Breite neu berechnen
|
||||
list($width_orig, $height_orig) = getimagesize($filename);
|
||||
|
||||
if ($width && ($width_orig < $height_orig))
|
||||
{
|
||||
$width = ($height / $height_orig) * $width_orig;
|
||||
}
|
||||
else
|
||||
{
|
||||
$height = ($width / $width_orig) * $height_orig;
|
||||
}
|
||||
|
||||
$image_p = imagecreatetruecolor($width, $height);
|
||||
|
||||
$image = imagecreatefromjpeg($filename);
|
||||
|
||||
//Bild nur verkleinern aber nicht vergroessern
|
||||
if($width_orig>$width || $height_orig>$height)
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
else
|
||||
$image_p = $image;
|
||||
|
||||
imagejpeg($image_p, $filename, 80);
|
||||
|
||||
@imagedestroy($image_p);
|
||||
@imagedestroy($image);
|
||||
};
|
||||
|
||||
if (!count($_FILES)) {
|
||||
$this->terminateWithError("No file available for upload");
|
||||
}
|
||||
|
||||
$files = $_FILES['files'];
|
||||
|
||||
$_FILES['files']['name'] = current($files['name']);
|
||||
$_FILES['files']['type'] = current($files['type']);
|
||||
$_FILES['files']['tmp_name'] = current($files['tmp_name']);
|
||||
$_FILES['files']['error'] = current($files['error']);
|
||||
$_FILES['files']['size'] = current($files['size']);
|
||||
$_FILES['files']['tmp_name'] = current($files['tmp_name']);
|
||||
|
||||
$filename = $_FILES['files']['tmp_name'];
|
||||
|
||||
$ext = substr(current($files['name']), strrpos(current($files['name']), '.') + 1);
|
||||
if($ext!='jpg' && $ext!='jpeg'){
|
||||
$this->terminateWithError("Only jpg and jpeg files are allowed for profilbild upload");
|
||||
}
|
||||
|
||||
// resize
|
||||
$resize($filename, 827, 1063);
|
||||
|
||||
//akte
|
||||
$fp = fopen($filename,'r');
|
||||
//auslesen
|
||||
$content = fread($fp, filesize($filename));
|
||||
$base64_content = base64_encode($content);
|
||||
$this->load->library('AkteLib');
|
||||
$aktenInsertResult = $this->aktelib->add($this->pid,'Lichtbil',"Lichtbild_".$this->pid.".jpg","image/jpg",$fp,"Lichtbild gross");
|
||||
fclose($fp);
|
||||
if (isError($aktenInsertResult)) {
|
||||
$this->terminateWithError(getError($aktenInsertResult));
|
||||
}
|
||||
|
||||
// in person abspeichern
|
||||
$resize($filename, 101, 130);
|
||||
$fp = fopen($filename,'r');
|
||||
$content = fread($fp, filesize($filename));
|
||||
fclose($fp);
|
||||
$base64_content = base64_encode($content);
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personUpdate = $this->PersonModel->update($this->pid, ["foto"=>$base64_content]);
|
||||
if(isError($personUpdate)){
|
||||
$this->terminateWithError(getError($personUpdate));
|
||||
}
|
||||
|
||||
|
||||
// update foto status
|
||||
$this->load->model('person/Fotostatusperson_model','FotostatusModel');
|
||||
$fotoInsert = $this->FotostatusModel->insert(["person_id"=>$this->pid,"fotostatus_kurzbz"=>"hochgeladen","datum"=>date('Y-m-d'),"insertamum"=>date('Y-m-d H:i:s'),"insertvon"=>$this->uid,"updateamum"=>date('Y-m-d H:i:s'),"updatevon"=>$this->uid]);
|
||||
if(isError($fotoInsert)){
|
||||
$this->terminateWithError(getError($fotoInsert));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
public function getProfilUpdateWithPermission($status = null)
|
||||
{
|
||||
// early return if no status has been passed as argument
|
||||
if (!isset($status)) {
|
||||
$this->terminateWithSuccess($this->ProfilUpdateModel->getProfilUpdateWithPermission());
|
||||
}
|
||||
|
||||
// get the sprache of the user
|
||||
$sprachenIndex = $this->SpracheModel->loadWhere(["sprache" => getUserLanguage()]);
|
||||
$sprachenIndex = hasData($sprachenIndex) ? getData($sprachenIndex)[0]->index : null;
|
||||
|
||||
if (isset($sprachenIndex) && isset($status)) {
|
||||
// get the corresponding status kurz_bz primary key out of the translation
|
||||
$status = $this->ProfilUpdateStatusModel->execReadOnlyQuery("select * from public.tbl_profil_update_status where ? = ANY(bezeichnung_mehrsprachig)", [$status]);
|
||||
$status = hasData($status) ? getData($status)[0]->status_kurzbz : null;
|
||||
$res = $this->ProfilUpdateModel->getProfilUpdateWithPermission(isset($status) ? ['status' => $status] : null);
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic)
|
||||
{
|
||||
if($this->config->item('cis_send_profil_update_mails') === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
$emails = [];
|
||||
|
||||
$is_mitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
if (isError($is_mitarbeiter)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_mitarbeiterCheck_error'));
|
||||
}
|
||||
$is_mitarbeiter = $this->getDataOrTerminateWithError($is_mitarbeiter);
|
||||
|
||||
//! if the $uid is a mitarbeiter and student, only the hr is notified by email
|
||||
if ($is_mitarbeiter) {
|
||||
//? user is not a student therefore he is a mitarbeiter, send email to Personalverwaltung
|
||||
//? use constant variable MAIL_GST to mail to the personalverwaltung
|
||||
$this->MitarbeiterModel->addSelect([TRUE]);
|
||||
$this->MitarbeiterModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid");
|
||||
//? check if the the userID is a mitarbeiter and if the benutzer is active
|
||||
$res = $this->MitarbeiterModel->loadWhere(["public.tbl_mitarbeiter.mitarbeiter_uid" => $uid, "public.tbl_benutzer.aktiv" => TRUE]);
|
||||
if (isError($res)) {
|
||||
$this->terminateWithError("was not able to query the mitarbeiter and benutzer by the uid: " . $uid);
|
||||
}
|
||||
if (hasData($res)) {
|
||||
array_push($emails, MAIL_GST);
|
||||
} else {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_mitarbeiterCheck_error'));
|
||||
}
|
||||
} else {
|
||||
//? if it is not a mitarbeiter, check whether it is a student and send email to studiengang
|
||||
$is_student = $this->StudentModel->isStudent($uid);
|
||||
if (isError($is_student)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_studentCheck_error'));
|
||||
}
|
||||
$is_student = $this->getDataOrTerminateWithError($is_student);
|
||||
if ($is_student) {
|
||||
//? Send email to the Studiengangsassistentinnen
|
||||
$this->StudentModel->addSelect(["public.tbl_studiengang.email"]);
|
||||
$this->StudentModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_student.student_uid");
|
||||
$this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id and public.tbl_student.studiengang_kz = public.tbl_prestudent.studiengang_kz");
|
||||
$this->StudentModel->addJoin("public.tbl_prestudentstatus", "public.tbl_prestudentstatus.prestudent_id = public.tbl_prestudent.prestudent_id");
|
||||
$this->StudentModel->addJoin("public.tbl_studiengang", "public.tbl_studiengang.studiengang_kz = public.tbl_prestudent.studiengang_kz");
|
||||
$this->StudentModel->addGroupBy(["public.tbl_studiengang.email"]);
|
||||
//* check if the benutzer itself is active
|
||||
//* check if the student status is Student or Diplomand (active students)
|
||||
$this->StudentModel->db->where_in("public.tbl_prestudentstatus.status_kurzbz", ['Student', 'Diplomand']);
|
||||
$res = $this->StudentModel->loadWhere(["public.tbl_benutzer.aktiv" => TRUE, "public.tbl_student.student_uid" => $uid]);
|
||||
if (isError($res)) {
|
||||
$this->terminateWithError(getError($res));
|
||||
} else {
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
foreach ($res as $emailObj) {
|
||||
array_push($emails, $emailObj->email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$mail_res = [];
|
||||
//? sending email
|
||||
foreach ($emails as $email)
|
||||
{
|
||||
$href = $this->config->item('cis_vilesci_base_url') . $this->config->item('cis_vilesci_index_page') . '/Cis/ProfilUpdate/id/' . $profil_update_id;
|
||||
array_push($mail_res, sendSanchoMail("profil_update", ['uid' => $uid, 'topic' => $topic, 'href' => $href], $email, ("Profil Änderung von " . $uid)));
|
||||
}
|
||||
foreach ($mail_res as $m_res) {
|
||||
if (!$m_res) {
|
||||
$this->addError($this->p->t('profilUpdate', 'profilUpdate_email_error'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function sendEmail_onProfilUpdate_response($uid, $topic, $status)
|
||||
{
|
||||
if($this->config->item('cis_send_profil_update_mails') === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
$email = $uid . "@" . DOMAIN;
|
||||
|
||||
|
||||
function languageQuery($language)
|
||||
{
|
||||
return "select index from public.tbl_sprache where sprache = '" . $language . "'";
|
||||
}
|
||||
|
||||
$this->ProfilUpdateStatusModel->addSelect(["bezeichnung_mehrsprachig[(" . languageQuery('German') . ")] as status_de", "bezeichnung_mehrsprachig[(" . languageQuery('English') . ")] as status_en"]);
|
||||
|
||||
$status_translation = $this->ProfilUpdateStatusModel->loadWhere(["status_kurzbz" => $status]);
|
||||
if (isError($status_translation)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'ProfilUpdateStatusTranslationError'));
|
||||
}
|
||||
|
||||
$status_translation = hasData($status_translation) ? getData($status_translation)[0] : null;
|
||||
if (isset($status_translation))
|
||||
{
|
||||
$href = $this->config->item('cis_base_url') . $this->config->item('cis_index_page') . '/Cis/Profil';
|
||||
$mail_res = sendSanchoMail("profil_update_response", ['topic' => $topic, 'status_de' => $status_translation->status_de, 'status_en' => $status_translation->status_en, 'href' => $href], $email, ("Profil Änderung " . $status_translation->status_de . ' / Profile Update ' . $status_translation->status_en));
|
||||
if (!$mail_res) {
|
||||
$this->addError($this->p->t('profilUpdate', 'profilUpdate_email_error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function setStatusOnUpdateRequest($id, $status, $status_message)
|
||||
{
|
||||
return $this->ProfilUpdateModel->update([$id], [
|
||||
"status" => $status,
|
||||
"status_timestamp" => "NOW()",
|
||||
"status_message" => $status_message,
|
||||
"updateamum" => "NOW()",
|
||||
"updatevon" => getAuthUID()
|
||||
]);
|
||||
}
|
||||
|
||||
private function updateRequestedChange($id, $requested_change)
|
||||
{
|
||||
return $this->ProfilUpdateModel->update([$id], ['requested_change' => json_encode($requested_change)]);
|
||||
}
|
||||
|
||||
private function deleteOldVersionFile($dms_id)
|
||||
{
|
||||
if (!isset($dms_id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// starting the transaction
|
||||
$this->db->trans_start();
|
||||
|
||||
//? delete the file from the profilUpdate first
|
||||
$profilUpdateFileDelete = $this->ProfilUpdateModel->removeFileFromProfilUpdate($dms_id);
|
||||
if(isError($profilUpdateFileDelete)){
|
||||
$this->terminateWithError(getError($profilUpdateFileDelete));
|
||||
}
|
||||
|
||||
//? delete all the different versions of the dms_file
|
||||
$dmsVersions = $this->DmsVersionModel->loadWhere(["dms_id" => $dms_id]);
|
||||
$dmsVersions = $this->getDataOrTerminateWithError($dmsVersions);
|
||||
|
||||
|
||||
|
||||
$dms_versions = array_map(function ($item) {
|
||||
return $item->version;
|
||||
}, $dmsVersions);
|
||||
|
||||
|
||||
$test_array = array();
|
||||
foreach ($dms_versions as $version) {
|
||||
|
||||
$delete_result = $this->dmslib->removeVersion($dms_id, $version);
|
||||
array_push($test_array, $delete_result);
|
||||
|
||||
if(isError($delete_result)){
|
||||
$this->addError(getError($delete_result));
|
||||
}
|
||||
}
|
||||
|
||||
// transaction complete
|
||||
$this->db->trans_complete();
|
||||
|
||||
if ($this->db->trans_status() === FALSE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function getOE_from_student($student_uid)
|
||||
{
|
||||
//? returns the oe_einheit eines Studenten
|
||||
$query = "SELECT public.tbl_studiengang.oe_kurzbz
|
||||
FROM public.tbl_student
|
||||
JOIN public.tbl_studiengang ON tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
|
||||
WHERE public.tbl_student.student_uid = ?;";
|
||||
|
||||
$res = $this->StudentModel->execReadOnlyQuery($query, [$student_uid]);
|
||||
$res = $this->getDataOrTerminateWithError($res, $this->p->t('profilUpdate', 'profilUpdate_loadingOE_error'));
|
||||
$oe = ($res[0])->oe_kurzbz;
|
||||
return $oe;
|
||||
}
|
||||
|
||||
private function handleAdresse($requested_change, $personID)
|
||||
{
|
||||
$this->AdressenTypModel->addSelect(["adressentyp_kurzbz"]);
|
||||
$adr_kurzbz = $this->AdressenTypModel->loadWhere(["bezeichnung" => $requested_change['typ']]);
|
||||
$adr_kurzbz = $this->getDataOrTerminateWithError($adr_kurzbz)[0]->adressentyp_kurzbz;
|
||||
|
||||
//? replace the address_typ with its correct kurzbz foreign key
|
||||
$requested_change['typ'] = $adr_kurzbz;
|
||||
|
||||
$adresse_id = $requested_change["adresse_id"];
|
||||
|
||||
//? removes the adresse_id because we don't want to update the kontakt_id in the database
|
||||
unset($requested_change["adresse_id"]);
|
||||
|
||||
//! ADD
|
||||
if (array_key_exists('add', $requested_change) && $requested_change['add']) {
|
||||
|
||||
//? removes add flag
|
||||
unset($requested_change['add']);
|
||||
$requested_change['insertamum'] = "NOW()";
|
||||
$requested_change['insertvon'] = getAuthUID();
|
||||
$requested_change['person_id'] = $personID;
|
||||
//TODO: zustelladresse, heimatadresse, rechnungsadresse und nation werden nicht beachtet
|
||||
$insertID = $this->AdresseModel->insert($requested_change);
|
||||
$insert_adresse_id = $insertID;
|
||||
$insert_adresse_id = $this->getDataOrTerminateWithError($insert_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
|
||||
if ($insert_adresse_id) {
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id, $personID);
|
||||
}
|
||||
}
|
||||
//! DELETE
|
||||
elseif (array_key_exists('delete', $requested_change) && $requested_change['delete']) {
|
||||
$result = $this->AdresseModel->delete($adresse_id);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
}
|
||||
//! UPDATE
|
||||
else {
|
||||
$curadresse_res = $this->AdresseModel->load($adresse_id);
|
||||
$curadresse = ($this->getDataOrTerminateWithError($curadresse_res))[0];
|
||||
|
||||
if($curadresse->heimatadresse)
|
||||
{
|
||||
$tmpadresse = array_merge((array) $curadresse, $requested_change);
|
||||
unset($tmpadresse["adresse_id"]);
|
||||
$tmpadresse['insertamum'] = "NOW()";
|
||||
$tmpadresse['insertvon'] = getAuthUID();
|
||||
$tmpadresse['person_id'] = $personID;
|
||||
unset($tmpadresse["heimatadresse"]);
|
||||
unset($tmpadresse["updateamum"]);
|
||||
unset($tmpadresse["updatevon"]);
|
||||
|
||||
$tmpadresse_res = $this->AdresseModel->insert($tmpadresse);
|
||||
$tmpadresse_id = $this->getDataOrTerminateWithError($tmpadresse_res, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $tmpadresse_id, $personID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$requested_change['updateamum'] = "NOW()";
|
||||
$requested_change['updatevon'] = getAuthUID();
|
||||
|
||||
$update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
|
||||
$update_adresse_id = $this->getDataOrTerminateWithError($update_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id, $personID);
|
||||
}
|
||||
}
|
||||
return $insertID ?? null;
|
||||
}
|
||||
|
||||
private function handleKontakt($requested_change, $personID)
|
||||
{
|
||||
$kontakt_id = $requested_change["kontakt_id"];
|
||||
//? removes the kontakt_id because we don't want to update the kontakt_id in the database
|
||||
unset($requested_change["kontakt_id"]);
|
||||
|
||||
//! ADD
|
||||
if (array_key_exists('add', $requested_change) && $requested_change['add']) {
|
||||
//? removes add flag
|
||||
unset($requested_change['add']);
|
||||
$requested_change['person_id'] = $personID;
|
||||
$requested_change['insertamum'] = "NOW()";
|
||||
$requested_change['insertvon'] = getAuthUID();
|
||||
$insertID = $this->KontaktModel->insert($requested_change);
|
||||
$insert_kontakt_id = $insertID;
|
||||
$insert_kontakt_id = $this->getDataOrTerminateWithError($insert_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_insertKontakt_error'));
|
||||
if ($insert_kontakt_id) {
|
||||
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id, $requested_change['kontakttyp'], $personID);
|
||||
}
|
||||
}
|
||||
//! DELETE
|
||||
elseif (array_key_exists('delete', $requested_change) && $requested_change['delete']) {
|
||||
$result = $this->KontaktModel->delete($kontakt_id);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
}
|
||||
//! UPDATE
|
||||
else {
|
||||
$requested_change['updateamum'] = "NOW()";
|
||||
$requested_change['updatevon'] = getAuthUID();
|
||||
$update_kontakt_id = $this->KontaktModel->update($kontakt_id, $requested_change);
|
||||
$update_kontakt_id = $this->getDataOrTerminateWithError($update_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_updateKontakt_error'));
|
||||
if ($update_kontakt_id) {
|
||||
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id, $requested_change['kontakttyp'], $personID);
|
||||
}
|
||||
}
|
||||
return isset($insertID) ? $insertID : null;
|
||||
}
|
||||
|
||||
private function handleDupplicateZustellAdressen($zustellung, $adresse_id, $person_id)
|
||||
{
|
||||
if ($zustellung) {
|
||||
$this->PersonModel->addSelect("public.tbl_adresse.adresse_id");
|
||||
$this->PersonModel->addJoin("public.tbl_adresse", "public.tbl_adresse.person_id = public.tbl_person.person_id");
|
||||
$zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $person_id, "zustelladresse" => TRUE]);
|
||||
if (isError($zustellAdressenArray)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loadingZustellAdressen_error'));
|
||||
}
|
||||
$zustellAdressenArray = $this->getDataOrTerminateWithError($zustellAdressenArray);
|
||||
|
||||
if (count($zustellAdressenArray) > 0) {
|
||||
|
||||
$zustellAdressenArray = array_filter($zustellAdressenArray, function ($adresse) use ($adresse_id) {
|
||||
|
||||
return $adresse->adresse_id != $adresse_id;
|
||||
});
|
||||
|
||||
$this->addMeta('bhzustelladressen', $zustellAdressenArray);
|
||||
|
||||
// remove the zustelladresse from all other zustelladressen
|
||||
foreach ($zustellAdressenArray as $adresse) {
|
||||
$this->AdresseModel->update($adresse->adresse_id, ["zustelladresse" => FALSE]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function handleDupplicateZustellKontakte($zustellung, $kontakt_id, $kontakttyp, $person_id)
|
||||
{
|
||||
if ($zustellung) {
|
||||
$this->PersonModel->addSelect("public.tbl_kontakt.kontakt_id");
|
||||
$this->PersonModel->addJoin("public.tbl_kontakt", "public.tbl_kontakt.person_id = public.tbl_person.person_id");
|
||||
$zustellKontakteArray = $this->PersonModel->loadWhere([
|
||||
"public.tbl_person.person_id" => $person_id,
|
||||
"zustellung" => TRUE,
|
||||
"kontakttyp" => $kontakttyp
|
||||
]);
|
||||
if (!isSuccess($zustellKontakteArray)) {
|
||||
return error($this->p->t('profilUpdate', 'profilUpdate_loadingZustellkontakte_error'));
|
||||
}
|
||||
$zustellKontakteArray = hasData($zustellKontakteArray) ? getData($zustellKontakteArray) : null;
|
||||
|
||||
if ($zustellung && count($zustellKontakteArray) > 0) {
|
||||
$zustellKontakteArray = array_filter($zustellKontakteArray, function ($kontakt) use ($kontakt_id) {
|
||||
return $kontakt->kontakt_id != $kontakt_id;
|
||||
});
|
||||
foreach ($zustellKontakteArray as $kontakt) {
|
||||
$this->KontaktModel->update($kontakt->kontakt_id, ["zustellung" => FALSE]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class RendererLoader extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'GetRenderers' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches Stundenplan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function GetRenderers(){
|
||||
$renderer_paths = [];
|
||||
Events::trigger(
|
||||
'loadRenderers',
|
||||
function & () use (&$renderer_paths)
|
||||
{
|
||||
return $renderer_paths;
|
||||
}
|
||||
);
|
||||
$this->terminateWithSuccess($renderer_paths);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class RouteInfo extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'info' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
|
||||
}
|
||||
|
||||
public function info()
|
||||
{
|
||||
$payload = json_decode($this->input->raw_input_stream);
|
||||
|
||||
if (isset($payload->app) && isset($payload->path) && $this->isValidApp($payload->app) && $this->isValidPath($payload->path))
|
||||
{
|
||||
$this->WebservicelogModel->insert(array(
|
||||
'webservicetyp_kurzbz' => 'content',
|
||||
'beschreibung' => $payload->app,
|
||||
'request_data' => $payload->path,
|
||||
'execute_user' => getAuthUID(),
|
||||
'execute_time' => 'NOW()'
|
||||
));
|
||||
}
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
protected function isValidApp($app)
|
||||
{
|
||||
return preg_match("/^[A-Za-z0-9\-_]+$/", $app);
|
||||
}
|
||||
|
||||
protected function isValidPath($path)
|
||||
{
|
||||
return preg_match("/^[\/A-Za-z0-9_.\-~?%=&;]+$/", $path);
|
||||
}
|
||||
}
|
||||
@@ -35,11 +35,12 @@ class Searchbar extends FHCAPI_Controller
|
||||
{
|
||||
// NOTE(chris): additional permission checks will be done in SearchBarLib
|
||||
parent::__construct([
|
||||
'search' => self::PERM_LOGGED
|
||||
'search' => self::PERM_LOGGED,
|
||||
'searchCis' => self::PERM_LOGGED,
|
||||
'searchStv' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load the library SearchBarLib
|
||||
$this->load->library('SearchBarLib');
|
||||
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -50,6 +51,7 @@ class Searchbar extends FHCAPI_Controller
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$this->load->library('SearchBarLib');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Checks if the searchstr and the types parameters are in the POSTed JSON
|
||||
@@ -63,7 +65,64 @@ class Searchbar extends FHCAPI_Controller
|
||||
$result = $this->searchbarlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
|
||||
if (property_exists($result, 'error'))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithSuccess($result);
|
||||
|
||||
$this->addMeta('mode', 'simple');
|
||||
|
||||
$this->terminateWithSuccess($result->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
public function searchCis()
|
||||
{
|
||||
return $this->searchAdvanced([ 'config' => 'searchcis' ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
public function searchStv()
|
||||
{
|
||||
return $this->searchAdvanced([ 'config' => 'searchstv' ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
private function searchAdvanced($config)
|
||||
{
|
||||
$this->load->library('SearchLib', $config);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Checks if the searchstr and the types parameters are in the POSTed JSON
|
||||
$this->form_validation->set_rules(self::SEARCHSTR_PARAM, null, 'required');
|
||||
$this->form_validation->set_rules(self::TYPES_PARAM . '[]', null, 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// Convert to json the result from searchlib->search
|
||||
$result = $this->searchlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
|
||||
|
||||
$this->WebservicelogModel->insert(array(
|
||||
'webservicetyp_kurzbz' => 'content',
|
||||
'beschreibung' => $config['config'],
|
||||
'request_data' => json_encode(array(
|
||||
self::SEARCHSTR_PARAM => $this->input->post(self::SEARCHSTR_PARAM),
|
||||
self::TYPES_PARAM => $this->input->post(self::TYPES_PARAM)
|
||||
)),
|
||||
'execute_user' => getAuthUID(),
|
||||
'execute_time' => 'NOW()'
|
||||
));
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->addMeta('time', $result->meta['time']);
|
||||
$this->addMeta('searchstring', $result->meta['searchstring']);
|
||||
$this->addMeta('mode', 'advanced');
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class Studgang extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiengangInfo'=> self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getStudiengangInfo(){
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
$isMitarbeiter = $this->getDataOrTerminateWithError($isMitarbeiter);
|
||||
if($isMitarbeiter) {
|
||||
$this->terminateWithSuccess(null);
|
||||
}
|
||||
|
||||
// fetches the Studiengang Information which is used next to the news
|
||||
$studiengangInfo = $this->StudiengangModel->getStudiengangInfoForNews();
|
||||
$studiengangInfo= $this->getDataOrTerminateWithError($studiengangInfo);
|
||||
$this->terminateWithSuccess($studiengangInfo);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class Studium extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAllStudienSemester'=> self::PERM_LOGGED,
|
||||
'getStudiengaengeForStudienSemester'=> self::PERM_LOGGED,
|
||||
'getStudienplaeneBySemester'=> self::PERM_LOGGED,
|
||||
'getLvEvaluierungInfo'=> self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('organisation/Studienordnung_model','StudienordnungModel');
|
||||
$this->load->model('organisation/Studiensemester_model',"StudiensemesterModel");
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('codex/Orgform_model','OrgformModel');
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getAllStudienSemester(){
|
||||
|
||||
$parameter_studiensemester = $this->input->get('studiensemester',true);
|
||||
$parameter_studiengang = $this->input->get('studiengang',true);
|
||||
$parameter_semester = $this->input->get('semester',true);
|
||||
$parameter_studienplan = $this->input->get('studienplan',true);
|
||||
|
||||
$aktuelles_studiensemester = current($this->getDataOrTerminateWithError($this->StudiensemesterModel->getAktOrNextSemester()));
|
||||
|
||||
if($this->getDataOrTerminateWithError($this->StudentModel->isStudent(getAuthUID()))){
|
||||
$lv_result =$this->StudentlehrverbandModel->loadWhere([
|
||||
"student_uid" => getAuthUID(),
|
||||
"studiensemester_kurzbz" => $aktuelles_studiensemester->studiensemester_kurzbz
|
||||
]);
|
||||
$lv_data = $this->getDataOrTerminateWithError($lv_result);
|
||||
|
||||
if ($studentLehrverband = current($lv_data)) {
|
||||
$student_studiensemester = $studentLehrverband->studiensemester_kurzbz;
|
||||
$student_studiengang = $studentLehrverband->studiengang_kz;
|
||||
$student_semester = $studentLehrverband->semester;
|
||||
}
|
||||
|
||||
$student_studienplan = $this->getStudienPlanFromPrestudentStatus(getAuthPersonId())->studienplan_id;
|
||||
|
||||
$parameter_studiensemester = $parameter_studiensemester ?? $student_studiensemester;
|
||||
$parameter_studiengang = $parameter_studiengang ?? $student_studiengang;
|
||||
$parameter_semester = $parameter_semester ?? $student_semester;
|
||||
$parameter_studienplan = $parameter_studienplan ?? $student_studienplan;
|
||||
}
|
||||
|
||||
if(isset($parameter_studiensemester)){
|
||||
$parameter_studiensemester = current($this->getDataOrTerminateWithError($this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz" => $parameter_studiensemester])));
|
||||
}
|
||||
|
||||
if(isset($parameter_studiengang)){
|
||||
$parameter_studiengang = current($this->getDataOrTerminateWithError($this->StudiengangModel->loadWhere(["studiengang_kz" => $parameter_studiengang])));
|
||||
}
|
||||
|
||||
if(isset($parameter_studienplan)){
|
||||
$this->StudienplanModel->addJoin("lehre.tbl_studienordnung", "studienordnung_id");
|
||||
$this->StudienplanModel->addJoin("lehre.tbl_studienplan_semester", "studienplan_id");
|
||||
$parameter_studienplan = $this->StudienplanModel->loadWhere(["studienplan_id" => $parameter_studienplan, "aktiv" => TRUE]);
|
||||
$parameter_studienplan = current($this->getDataOrTerminateWithError($parameter_studienplan));
|
||||
}
|
||||
|
||||
// fetch studiensemester
|
||||
$allStudienSemester = $this->getDataOrTerminateWithError($this->StudiensemesterModel->load());
|
||||
|
||||
|
||||
if(isset($parameter_studiensemester) && !empty(array_filter($allStudienSemester, function($studiensemester) use($parameter_studiensemester){
|
||||
return $studiensemester->studiensemester_kurzbz == $parameter_studiensemester->studiensemester_kurzbz;
|
||||
}))){
|
||||
$aktuelles_studiensemester = $parameter_studiensemester;
|
||||
}
|
||||
|
||||
// fetch studiengaenge
|
||||
$studiengaenge = $this->computeStudiengaenge($aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
$aktuelles_studiengang = current($studiengaenge);
|
||||
if(!$aktuelles_studiengang){
|
||||
$aktuelles_studiengang = null;
|
||||
}
|
||||
if(isset($parameter_studiengang) && !empty(array_filter( $studiengaenge,function($studiengang)use($parameter_studiengang){
|
||||
return $studiengang->studiengang_kz == $parameter_studiengang->studiengang_kz;
|
||||
}))){
|
||||
$aktuelles_studiengang = $parameter_studiengang;
|
||||
}
|
||||
|
||||
// compute semester and studienplaene
|
||||
if($aktuelles_studiengang){
|
||||
$studienplaene = $this->computeStudienplaene($aktuelles_studiengang->studiengang_kz, $aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
}else{
|
||||
$studienplaene =[];
|
||||
}
|
||||
|
||||
$semester = array_values(array_unique(array_map(function($item){
|
||||
return $item->semester;
|
||||
}, $studienplaene)));
|
||||
$aktuelles_semester = current($semester);
|
||||
if(!$aktuelles_semester){
|
||||
$aktuelles_semester = null;
|
||||
}
|
||||
if(isset($parameter_semester) && in_array($parameter_semester, $semester)){
|
||||
$aktuelles_semester = $parameter_semester;
|
||||
}
|
||||
|
||||
$semester_studienplan = array_filter($studienplaene, function($item) use($aktuelles_semester){
|
||||
return $item->semester == $aktuelles_semester;
|
||||
});
|
||||
|
||||
// fetch current studienplan based on semester
|
||||
$aktuelles_studienplan = current($semester_studienplan);
|
||||
if(!$aktuelles_studienplan){
|
||||
$aktuelles_studienplan = null;
|
||||
}
|
||||
if(isset($parameter_studienplan) && !empty(array_filter( $semester_studienplan, function($studienplan) use($parameter_studienplan){
|
||||
return $studienplan->studienplan_id == $parameter_studienplan->studienplan_id;
|
||||
}))){
|
||||
$aktuelles_studienplan = $parameter_studienplan ;
|
||||
}
|
||||
|
||||
// fetch studienplan lehrveranstaltungen
|
||||
if($aktuelles_studienplan){
|
||||
$lehrveranstaltungen = $this->computeStudienplanLehrveranstaltungen($aktuelles_studienplan->studienplan_id, $aktuelles_semester);
|
||||
foreach($lehrveranstaltungen as $lehrv){
|
||||
foreach($lehrv->lehrveranstaltungen as $lv){
|
||||
$lvLektoren =$this->computeLektorenFromLehrveranstaltung($lv->lehrveranstaltung_id,$aktuelles_semester, $aktuelles_studiengang->studiengang_kz, $aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
$lv->lektoren = $lvLektoren;
|
||||
}
|
||||
|
||||
}
|
||||
$aktuelles_lehrveranstaltungen = $lehrveranstaltungen;
|
||||
}else{
|
||||
$aktuelles_lehrveranstaltungen = [];
|
||||
}
|
||||
|
||||
// result object
|
||||
$result = new stdClass();
|
||||
$result->studienSemester = [];
|
||||
$result->studienSemester["all"]= $allStudienSemester;
|
||||
$result->studienSemester["preselected"]=$aktuelles_studiensemester;
|
||||
$result->studiengang["all"]=$studiengaenge;
|
||||
$result->studiengang["preselected"]=$aktuelles_studiengang;
|
||||
$result->semester["all"] =$semester;
|
||||
$result->semester["preselected"] =$aktuelles_semester;
|
||||
$result->studienplan["all"]=$semester_studienplan;
|
||||
$result->studienplan["preselected"]=$aktuelles_studienplan;
|
||||
$result->lehrveranstaltungen=$aktuelles_lehrveranstaltungen;
|
||||
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getLvEvaluierungInfo($studiensemester_kurzbz, $lehrveranstaltung_id){
|
||||
$result = [];
|
||||
Events::trigger('lvEvaluierungsInfo', function & () use (&$result) {
|
||||
return $result;
|
||||
},$lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getStudiengaengeForStudienSemester($studiensemester){
|
||||
$studiengaenge = $this->computeStudiengaenge($studiensemester);
|
||||
$this->terminateWithSuccess($studiengaenge);
|
||||
}
|
||||
|
||||
public function getStudienplaeneBySemester(){
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($this->input->get());
|
||||
$this->form_validation->set_rules('studiengang', 'studiengang', 'required');
|
||||
$this->form_validation->set_rules('studiensemester', 'studiensemester', 'required');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$studiengang = $this->input->get('studiengang',true);
|
||||
$studiensemester = $this->input->get('studiensemester',true);
|
||||
$studienplaene = $this->computeStudienplaene($studiengang, $studiensemester);
|
||||
$this->terminateWithSuccess($studienplaene);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
private function computeStudienplaene($studiengang, $studiensemester){
|
||||
$studienplaene = $this->StudienplanModel->getStudienplaeneBySemester($studiengang, $studiensemester);
|
||||
$studienplaene = $this->getDataOrTerminateWithError($studienplaene);
|
||||
$studienplaene = array_map(function($studienplan){
|
||||
$orgform = current($this->getDataOrTerminateWithError($this->OrgformModel->loadWhere(["orgform_kurzbz" => $studienplan->orgform_kurzbz])));
|
||||
$studienplan->orgform_bezeichnung = $orgform->bezeichnung;
|
||||
return $studienplan;
|
||||
},$studienplaene);
|
||||
return $studienplaene;
|
||||
}
|
||||
|
||||
private function computeStudienplanLehrveranstaltungen($studienplan_id, $semester){
|
||||
|
||||
/*
|
||||
SELECT tbl_lehrveranstaltung.*,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
|
||||
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
|
||||
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
|
||||
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
|
||||
tbl_studienplan_lehrveranstaltung.sort stpllv_sort,
|
||||
tbl_studienplan_lehrveranstaltung.curriculum,
|
||||
tbl_studienplan_lehrveranstaltung.export,
|
||||
tbl_studienplan_lehrveranstaltung.genehmigung
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(lehrveranstaltung_id)
|
||||
WHERE tbl_studienplan_lehrveranstaltung.studienplan_id=" . $this->db_add_param($studienplan_id, FHC_INTEGER);
|
||||
if (defined("CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN") && CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN)
|
||||
$qry .= " AND tbl_lehrveranstaltung.lehrtyp_kurzbz != 'modul'";
|
||||
if (!is_null($semester))
|
||||
{
|
||||
$qry.=" AND tbl_studienplan_lehrveranstaltung.semester=" . $this->db_add_param($semester, FHC_INTEGER);
|
||||
} */
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$query = "
|
||||
SELECT tbl_lehrveranstaltung.*,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
|
||||
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
|
||||
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
|
||||
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
|
||||
tbl_studienplan_lehrveranstaltung.sort stpllv_sort,
|
||||
tbl_studienplan_lehrveranstaltung.curriculum,
|
||||
tbl_studienplan_lehrveranstaltung.export,
|
||||
tbl_studienplan_lehrveranstaltung.genehmigung
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.lehre = true AND
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_id=? AND tbl_studienplan_lehrveranstaltung.semester=?";
|
||||
|
||||
if (defined("CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN") && CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN)
|
||||
$query .= " AND tbl_lehrveranstaltung.lehrtyp_kurzbz != 'modul'";
|
||||
|
||||
$lehrveranstaltungen = $this->LehrveranstaltungModel->execReadOnlyQuery($query,[$studienplan_id, $semester]);
|
||||
|
||||
$lehrveranstaltungen = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
usort($lehrveranstaltungen, function($a, $b){
|
||||
if($a->lehrtyp_kurzbz == "modul"){
|
||||
return -1;
|
||||
}
|
||||
else if($b->lehrtyp_kurzbz == "modul"){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
$lehrveranstaltungen= array_reduce($lehrveranstaltungen,function($carry, $lehrv){
|
||||
if($lehrv->lehrtyp_kurzbz == "modul"){
|
||||
$lehrv->lehrveranstaltungen = [];
|
||||
array_push($carry, $lehrv);
|
||||
}
|
||||
else{
|
||||
$parent =array_filter($carry, function($item)use($lehrv){
|
||||
return $item->studienplan_lehrveranstaltung_id == $lehrv->studienplan_lehrveranstaltung_id_parent;
|
||||
});
|
||||
$parent = current($parent);
|
||||
if($parent){
|
||||
$parent->lehrveranstaltungen[] = $lehrv;
|
||||
}
|
||||
}
|
||||
return $carry;
|
||||
}, []);
|
||||
return $lehrveranstaltungen;
|
||||
}
|
||||
|
||||
private function computeStudiengaenge($studiensemester){
|
||||
$studiengang_studiensemester_result = $this->StudiengangModel->getStudiengaengeByStudiensemester($studiensemester);
|
||||
$studiengang_studiensemester_result = $this->getDataOrTerminateWithError($studiengang_studiensemester_result);
|
||||
return $studiengang_studiensemester_result;
|
||||
}
|
||||
|
||||
private function getStudienPlanFromPrestudentStatus($person_id){
|
||||
$studienplan_id = current($this->getDataOrTerminateWithError($this->PrestudentstatusModel->getLastStatusPerson($person_id)))->studienplan_id;
|
||||
$studienplan =current($this->getDataOrTerminateWithError($this->StudienplanModel->loadWhere(["studienplan_id"=>$studienplan_id])));
|
||||
return $studienplan;
|
||||
}
|
||||
|
||||
private function computeLektorenFromLehrveranstaltung($lehreinheit_id, $semester, $studiengang, $studiensemester){
|
||||
$this->load->library('StundenplanLib');
|
||||
$lektoren = $this->stundenplanlib->getLektorenFromLehrveranstaltung($lehreinheit_id,$semester, $studiengang,$studiensemester);
|
||||
$lektoren = $this->getDataOrTerminateWithError($lektoren) ?? [];
|
||||
|
||||
$lektoren = array_map(function($lektor){
|
||||
return ["name"=>$this->getDataOrTerminateWithError($this->PersonModel->getFullName($lektor)), "email"=>$lektor."@".DOMAIN];
|
||||
},$lektoren);
|
||||
|
||||
return $lektoren;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the UDFLib (back-end)
|
||||
* Provides data to the ajax get calls about the Udf component
|
||||
* Listens to ajax post calls to change the Udf data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Udf extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Calls the parent's constructor and prepares the UDFLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// NOTE: UdfLib has its own permissions checks
|
||||
parent::__construct([
|
||||
'load' => self::PERM_LOGGED,
|
||||
'save' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('UDFLib');
|
||||
|
||||
// Models
|
||||
$this->load->model($this->getTargetModelPath(), 'TargetModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Load all UDFs for a dataset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function load()
|
||||
{
|
||||
$pks = $this->TargetModel->getPks();
|
||||
foreach ($pks as $id)
|
||||
$this->form_validation->set_rules($id, $id, 'required');
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$id = [];
|
||||
foreach ($pks as $pk)
|
||||
$id[$pk] = $this->input->post($pk);
|
||||
if (!is_array($this->TargetModel->getPk()))
|
||||
$id = current($id);
|
||||
|
||||
$result = $this->udflib->getFieldArray($this->TargetModel, $id);
|
||||
|
||||
$fields = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves UDFs to a dataset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$pks = $this->TargetModel->getPks();
|
||||
foreach ($pks as $id)
|
||||
$this->form_validation->set_rules($id, $id, 'required');
|
||||
|
||||
$result = $this->udflib->getCiValidations($this->TargetModel, $this->input->post());
|
||||
|
||||
$fieldValidations = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->form_validation->set_rules($fieldvalidations);
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$id = [];
|
||||
$fields = $this->input->post();
|
||||
foreach ($pks as $pk) {
|
||||
$id[$pk] = $fields[$pk];
|
||||
unset($fields[$pk]);
|
||||
}
|
||||
if (!is_array($this->TargetModel->getPk()))
|
||||
$id = current($id);
|
||||
|
||||
$result = $this->TargetModel->update($id, $fields);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(array_fill_keys(array_keys($fields), ''));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Get the path to the target model from the url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTargetModelPath()
|
||||
{
|
||||
$ci_model_path = array_slice($this->uri->rsegments, 2);
|
||||
if ($ci_model_path)
|
||||
$ci_model_path[] = ucfirst(array_pop($ci_model_path)) . '_model';
|
||||
return implode(DIRECTORY_SEPARATOR, $ci_model_path);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,11 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
|
||||
public function getAllBetriebsmittel($type_id, $id)
|
||||
{
|
||||
$result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($id, $type_id);
|
||||
$betriebsmitteltypes = null;
|
||||
if ($this->input->get('betriebsmitteltypes') !== null && !isEmptyArray($this->input->get('betriebsmitteltypes')))
|
||||
$betriebsmitteltypes = $this->input->get('betriebsmitteltypes');
|
||||
|
||||
$result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($id, $type_id, $betriebsmitteltypes);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
@@ -75,8 +79,9 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired')
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('kaution', 'Kaution', 'numeric|less_than_equal_to[9999.99]', [
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric')
|
||||
$this->form_validation->set_rules('kaution', 'Kaution', 'callback_valid_number|callback_not_less_than_equal', [
|
||||
'valid_number' => $this->p->t('ui', 'error_fieldNoValidNumber'),
|
||||
'not_less_than_equal' => $this->p->t('ui', 'error_fieldLessThan1000'),
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('ausgegebenam', 'Ausgegeben am', 'required|is_valid_date', [
|
||||
@@ -158,6 +163,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
], [
|
||||
'uid_in_person' => $this->p->t('person', 'error_uidNotInPerson')
|
||||
]);
|
||||
|
||||
$this->validateNewOrUpdate();
|
||||
|
||||
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');
|
||||
@@ -167,6 +173,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kaution = $this->input->post('kaution');
|
||||
if($kaution) $kaution = str_replace(',', '.', $kaution);
|
||||
$ausgegebenam = $this->input->post('ausgegebenam');
|
||||
$retouram = $this->input->post('retouram');
|
||||
$uid = $this->input->post('uid');
|
||||
@@ -250,6 +257,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kaution = $this->input->post('kaution');
|
||||
if($kaution) $kaution = str_replace(',', '.', $kaution);
|
||||
$ausgegebenam = $this->input->post('ausgegebenam');
|
||||
$retouram = $this->input->post('retouram');
|
||||
|
||||
@@ -342,7 +350,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Betriebsmittelperson_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
return $this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function deleteBetriebsmittel($betriebsmittelperson_id)
|
||||
@@ -358,7 +366,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
if (!hasData($result)) {
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Betriebsmittelperson_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function getTypenBetriebsmittel()
|
||||
@@ -366,6 +374,12 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
$this->load->model('ressource/Betriebsmitteltyp_model', 'BetriebsmitteltypModel');
|
||||
|
||||
$this->BetriebsmitteltypModel->addOrder('beschreibung', 'ASC');
|
||||
|
||||
if ($this->input->get('betriebsmitteltypes') !== null && !isEmptyArray($this->input->get('betriebsmitteltypes')))
|
||||
{
|
||||
$this->BetriebsmitteltypModel->db->where_in('betriebsmitteltyp', $this->input->get('betriebsmitteltypes'));
|
||||
}
|
||||
|
||||
$result = $this->BetriebsmitteltypModel->load(); // load All
|
||||
|
||||
if (isError($result)) {
|
||||
@@ -382,6 +396,26 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function valid_number($number)
|
||||
{
|
||||
if(is_null($number)) return true;
|
||||
$number = str_replace(',', '.', $number);
|
||||
if (!is_numeric($number))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function not_less_than_equal($number)
|
||||
{
|
||||
$number = str_replace(',', '.', $number);
|
||||
if ($number < 1000)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class CheckPerson extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'updatePersonUnrulyStatus' => array('basis/mitarbeiter:rw', 'student/antragfreigabe:rw', 'student/studierendenantrag:rw'),
|
||||
'filterPerson' => array('basis/mitarbeiter:rw', 'student/antragfreigabe:rw', 'student/studierendenantrag:rw'),
|
||||
'checkUnruly' => array('basis/mitarbeiter:r', 'student/antragfreigabe:r', 'student/studierendenantrag:r', 'infocenter:r'),
|
||||
'checkDuplicate' => array('infocenter:r'),
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('person/Person_model', 'PersonModel');
|
||||
}
|
||||
|
||||
public function updatePersonUnrulyStatus()
|
||||
{
|
||||
$data = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$person_id = $data['person_id'];
|
||||
$unruly = $data['unruly'];
|
||||
|
||||
$result = $this->_ci->PersonModel->updateUnruly($person_id, $unruly);
|
||||
|
||||
if(isError($result)) {
|
||||
$this->terminateWithError($result);
|
||||
} else if (isSuccess($result)) {
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function checkDuplicate() {
|
||||
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->_ci->PersonModel->checkDuplicate($person_id);
|
||||
|
||||
if (isSuccess($result))
|
||||
$this->terminateWithSuccess($result);
|
||||
else
|
||||
$this->terminateWithError('Error when searching for person');
|
||||
|
||||
}
|
||||
|
||||
// performs strict check over vorname, nachname, gebdatum
|
||||
public function checkUnruly() {
|
||||
|
||||
$vorname = $this->input->post('vorname');
|
||||
$nachname = $this->input->post('nachname');
|
||||
$gebdatum = $this->input->post('gebdatum');
|
||||
|
||||
$result = $this->_ci->PersonModel->checkUnruly($vorname, $nachname, $gebdatum);
|
||||
|
||||
if (isSuccess($result))
|
||||
$this->terminateWithSuccess($result);
|
||||
else
|
||||
$this->terminateWithError('Error when searching for person');
|
||||
}
|
||||
|
||||
// filters nachname on similarity and vorname/gebdatum are optional
|
||||
public function filterPerson() {
|
||||
$payload = json_decode($this->input->raw_input_stream, TRUE);
|
||||
|
||||
$nachnameString = '';
|
||||
$vornameString = '';
|
||||
$filterUnruly = true;
|
||||
$birthdateString = '';
|
||||
|
||||
if(array_key_exists( 'nachname', $payload) ) {
|
||||
$nachnameString = $payload['nachname'];
|
||||
}
|
||||
|
||||
if(array_key_exists('vorname', $payload)) {
|
||||
$vornameString = $payload['vorname'];
|
||||
}
|
||||
|
||||
if(array_key_exists('unruly', $payload)){
|
||||
$filterUnruly = $payload['unruly'];
|
||||
}
|
||||
|
||||
if(array_key_exists('gebdatum', $payload)) {
|
||||
// TODO: enable if gebdatum filter for unrulys is desired
|
||||
// $birthdateString = $payload['gebdatum'];
|
||||
}
|
||||
|
||||
$parametersArray = array($nachnameString);
|
||||
$where ="p.nachname~* ? ";
|
||||
if (mb_strlen($nachnameString) == 2)
|
||||
{
|
||||
$where = "p.nachname=? ";
|
||||
}
|
||||
|
||||
if(isset($vornameString) && $vornameString != '')
|
||||
{
|
||||
$where.= " AND p.vorname~*?";
|
||||
$parametersArray[] = $vornameString;
|
||||
}
|
||||
|
||||
if(isset($birthdateString) && $birthdateString != '')
|
||||
{
|
||||
$where.=" AND p.gebdatum=?";
|
||||
$parametersArray[] = $birthdateString;
|
||||
}
|
||||
|
||||
if(isset($filterUnruly))
|
||||
{
|
||||
$where.=" AND p.unruly=?";
|
||||
$parametersArray[] = $filterUnruly;
|
||||
}
|
||||
|
||||
$result = $this->_ci->PersonModel->checkUnrulyWhere($where, $parametersArray);
|
||||
|
||||
if (isSuccess($result))
|
||||
$this->terminateWithSuccess($result);
|
||||
else
|
||||
$this->terminateWithError('Error when searching for person');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Lehrveranstaltung extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Lehrveranstaltung API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(array(
|
||||
'getTemplateLvTree' => array(
|
||||
'lehre/lehrveranstaltung:rw'
|
||||
)
|
||||
));
|
||||
|
||||
// Load model LehrveranstaltungModel
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Templates and union with all Lehrveranstaltungen of given Studiensemester and Oes of given Berechtigung,
|
||||
* that are assigned to a template. This data structure can be used for nested tabulators' data tree.
|
||||
*
|
||||
* @param null|string $studiensemester_kurzbz
|
||||
* @param null|string $berechtigung
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getTemplateLvTree()
|
||||
{
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
$berechtigung = $this->input->get('berechtigung');
|
||||
|
||||
if ($berechtigung)
|
||||
{
|
||||
$oe_permissions = $this->permissionlib->getOE_isEntitledFor($berechtigung);
|
||||
if(!$oe_permissions) $oe_permissions = [];
|
||||
|
||||
$result = $this->LehrveranstaltungModel->getTemplateLvTree($studiensemester_kurzbz, $oe_permissions);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getTemplateLvTree($studiensemester_kurzbz);
|
||||
}
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Funktionen extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
//TODO(Manu) check permissions
|
||||
parent::__construct(array(
|
||||
'getAllFunctions' => ['admin:r', 'assistenz:r'],
|
||||
'getAllUserFunctions' => ['admin:r', 'assistenz:r'],
|
||||
'getOrgHeads' => ['admin:r', 'assistenz:r'],
|
||||
'getOrgetsForCompany' => ['admin:r', 'assistenz:r'],
|
||||
'getAllOrgUnits' => ['admin:r', 'assistenz:r'],
|
||||
'loadFunction' => ['admin:r', 'assistenz:r'],
|
||||
'insertFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
)
|
||||
);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('extensions/FHC-Core-Personalverwaltung/Api_model', 'ApiModel');
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
}
|
||||
|
||||
public function getAllFunctions()
|
||||
{
|
||||
$this->FunktionModel->addSelect("funktion_kurzbz");
|
||||
$this->FunktionModel->addSelect("beschreibung");
|
||||
$this->FunktionModel->addSelect("aktiv");
|
||||
$this->FunktionModel->addSelect("beschreibung AS label");
|
||||
$this->FunktionModel->addOrder("beschreibung");
|
||||
$result = $this->FunktionModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getOrgHeads()
|
||||
{
|
||||
$result = $this->OrganisationseinheitModel->getHeads();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAllUserFunctions($uid)
|
||||
{
|
||||
if(!$uid)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$sql = "
|
||||
SELECT
|
||||
dv.dienstverhaeltnis_id,
|
||||
un.bezeichnung || ' (' || TO_CHAR(dv.von, 'DD.MM.YYYY') || CASE WHEN dv.bis IS NOT NULL THEN ' - '
|
||||
|| TO_CHAR(dv.bis, 'DD.MM.YYYY') ELSE '' END || ')' AS dienstverhaeltnis_unternehmen ,
|
||||
'[' || oet.bezeichnung || '] ' || oe.bezeichnung AS funktion_oebezeichnung,
|
||||
f.beschreibung AS funktion_beschreibung,
|
||||
bf.*,
|
||||
fb.bezeichnung AS fachbereich_bezeichnung,
|
||||
CASE
|
||||
WHEN
|
||||
bf.datum_bis IS NOT NULL AND bf.datum_bis::date < now()::date
|
||||
THEN
|
||||
false
|
||||
ELSE
|
||||
true
|
||||
END aktiv
|
||||
FROM
|
||||
public.tbl_benutzerfunktion bf
|
||||
JOIN
|
||||
public.tbl_organisationseinheit oe ON oe.oe_kurzbz = bf.oe_kurzbz
|
||||
JOIN
|
||||
public.tbl_organisationseinheittyp oet ON oe.organisationseinheittyp_kurzbz = oet.organisationseinheittyp_kurzbz
|
||||
JOIN
|
||||
public.tbl_funktion f ON f.funktion_kurzbz = bf.funktion_kurzbz
|
||||
LEFT JOIN
|
||||
hr.tbl_vertragsbestandteil_funktion vf ON vf.benutzerfunktion_id = bf.benutzerfunktion_id
|
||||
LEFT JOIN
|
||||
hr.tbl_vertragsbestandteil v ON vf.vertragsbestandteil_id = v.vertragsbestandteil_id
|
||||
LEFT JOIN
|
||||
hr.tbl_dienstverhaeltnis dv ON v.dienstverhaeltnis_id = dv.dienstverhaeltnis_id
|
||||
LEFT JOIN
|
||||
public.tbl_organisationseinheit un ON dv.oe_kurzbz = un.oe_kurzbz
|
||||
LEFT JOIN
|
||||
public.tbl_fachbereich fb ON fb.fachbereich_kurzbz = bf.fachbereich_kurzbz
|
||||
WHERE
|
||||
bf.uid = ?
|
||||
ORDER BY
|
||||
bf.datum_von, bf.datum_von ASC";
|
||||
|
||||
$benutzerfunktionen = $this->BenutzerfunktionModel->execReadOnlyQuery($sql, array($uid));
|
||||
$data = $this->getDataOrTerminateWithError($benutzerfunktionen);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/*
|
||||
* returns list of all organisation units
|
||||
* as key value list to be used in select or autocomplete
|
||||
*/
|
||||
public function getAllOrgUnits()
|
||||
{
|
||||
$sql = "
|
||||
SELECT
|
||||
oe.oe_kurzbz, oe.aktiv,
|
||||
'[' || COALESCE(oet.bezeichnung, oet.organisationseinheittyp_kurzbz) ||
|
||||
'] ' || COALESCE(oe.bezeichnung, oe.oe_kurzbz) AS label
|
||||
FROM public.tbl_organisationseinheit oe
|
||||
JOIN public.tbl_organisationseinheittyp oet ON oe.organisationseinheittyp_kurzbz = oet.organisationseinheittyp_kurzbz
|
||||
ORDER BY oet.bezeichnung ASC, oe.bezeichnung ASC";
|
||||
|
||||
$result = $this->OrganisationseinheitModel->execReadOnlyQuery($sql);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/*
|
||||
* return list of child orgets for a given company orget_kurzbz
|
||||
* as key value list to be used in select or autocomplete
|
||||
*/
|
||||
public function getOrgetsForCompany($companyOrgetkurzbz = null)
|
||||
{
|
||||
$sql = "
|
||||
SELECT
|
||||
oe.oe_kurzbz, oe.aktiv,
|
||||
'[' || COALESCE(oet.bezeichnung, oet.organisationseinheittyp_kurzbz) ||
|
||||
'] ' || COALESCE(oe.bezeichnung, oe.oe_kurzbz) AS label
|
||||
FROM (
|
||||
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
|
||||
(
|
||||
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
|
||||
WHERE oe_kurzbz=?
|
||||
UNION ALL
|
||||
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
||||
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz
|
||||
)
|
||||
SELECT oe_kurzbz
|
||||
FROM oes
|
||||
GROUP BY oe_kurzbz
|
||||
) c
|
||||
JOIN public.tbl_organisationseinheit oe ON oe.oe_kurzbz = c.oe_kurzbz
|
||||
JOIN public.tbl_organisationseinheittyp oet ON oe.organisationseinheittyp_kurzbz = oet.organisationseinheittyp_kurzbz
|
||||
ORDER BY oet.bezeichnung ASC, oe.bezeichnung ASC";
|
||||
|
||||
$childorgets = $this->OrganisationseinheitModel->execReadOnlyQuery($sql, array($companyOrgetkurzbz));
|
||||
$data = $this->getDataOrTerminateWithError($childorgets);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadFunction($benutzerfunktion_id)
|
||||
{
|
||||
$this->BenutzerfunktionModel->addSelect("*");
|
||||
$result = $this->BenutzerfunktionModel->loadWhere(
|
||||
array('benutzerfunktion_id' => $benutzerfunktion_id)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function insertFunction()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$uid = $this->input->post('uid');
|
||||
|
||||
if(!$uid)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$datum_von = $formData['datum_von'] ?? null;
|
||||
$datum_bis = $formData['datum_bis'] ?? null;
|
||||
$formData['oe_kurzbz'] = is_array($formData['oe_kurzbz']) ? $formData['oe_kurzbz']['oe_kurzbz'] : $formData['oe_kurzbz'];
|
||||
$formData['funktion_kurzbz'] = is_array($formData['funktion_kurzbz'])
|
||||
? $formData['funktion_kurzbz']['funktion_kurzbz']
|
||||
: $formData['funktion_kurzbz'];
|
||||
$bezeichnung = $formData['bezeichnung'] ?? null;
|
||||
$wochenstunden = $formData['wochenstunden'] ?? null;
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
$this->form_validation->set_rules('datum_von', 'VonDatum', 'required|is_valid_date', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
|
||||
]);
|
||||
$this->form_validation->set_rules('datum_bis', 'BisDatum', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'BisDatum'])
|
||||
]);
|
||||
$this->form_validation->set_rules('oe_kurzbz', 'Organisationseinheit', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Organisationseinheit'])
|
||||
]);
|
||||
$this->form_validation->set_rules('funktion_kurzbz', 'Funktion', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Funktion'])
|
||||
]);
|
||||
$this->form_validation->set_rules('wochenstunden', 'Wochenstunden', 'numeric', [
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Wochenstunden'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->BenutzerfunktionModel->insert([
|
||||
'uid' => $uid,
|
||||
'datum_von' => $datum_von,
|
||||
'datum_bis' => $datum_bis ,
|
||||
'oe_kurzbz' => $formData['oe_kurzbz'],
|
||||
'funktion_kurzbz' => $formData['funktion_kurzbz'],
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'wochenstunden' => $wochenstunden,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID,
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function updateFunction()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$uid = $this->input->post('uid');
|
||||
|
||||
if(!$uid)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$benutzerfunktion_id = $this->input->post('benutzerfunktion_id');
|
||||
|
||||
if(!$benutzerfunktion_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Benutzerfunktion ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$datum_von = $formData['datum_von'] ?? null;
|
||||
$datum_bis = $formData['datum_bis'] ?? null;
|
||||
$formData['oe_kurzbz'] = is_array($formData['oe_kurzbz']) ? $formData['oe_kurzbz']['oe_kurzbz'] : $formData['oe_kurzbz'];
|
||||
$formData['funktion_kurzbz'] = is_array($formData['funktion_kurzbz'])
|
||||
? $formData['funktion_kurzbz']['funktion_kurzbz']
|
||||
: $formData['funktion_kurzbz'];
|
||||
$bezeichnung = $formData['bezeichnung'] ?? null;
|
||||
$wochenstunden = $formData['wochenstunden'] ?? null;
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
$this->form_validation->set_rules('datum_von', 'VonDatum', 'required|is_valid_date', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
|
||||
]);
|
||||
$this->form_validation->set_rules('datum_bis', 'BisDatum', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'BisDatum'])
|
||||
]);
|
||||
$this->form_validation->set_rules('oe_kurzbz', 'Organisationseinheit', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Organisationseinheit'])
|
||||
]);
|
||||
$this->form_validation->set_rules('funktion_kurzbz', 'Funktion', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Funktion'])
|
||||
]);
|
||||
$this->form_validation->set_rules('wochenstunden', 'Wochenstunden', 'numeric', [
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Wochenstunden'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->BenutzerfunktionModel->update(
|
||||
[
|
||||
'benutzerfunktion_id' => $benutzerfunktion_id,
|
||||
],
|
||||
[
|
||||
'uid' => $uid,
|
||||
'datum_von' => $datum_von,
|
||||
'datum_bis' => $datum_bis ,
|
||||
'oe_kurzbz' => $formData['oe_kurzbz'],
|
||||
'funktion_kurzbz' => $formData['funktion_kurzbz'],
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'wochenstunden' => $wochenstunden,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $authUID,
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteFunction($benutzerfunktion_id)
|
||||
{
|
||||
$result = $this->BenutzerfunktionModel->delete(
|
||||
array('benutzerfunktion_id' => $benutzerfunktion_id)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2025 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class DirektGruppe extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'add' => ['admin:rw', 'assistenz:rw'],
|
||||
'delete' => ['admin:rw', 'assistenz:rw'],
|
||||
'getByLehreinheit' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
$this->_ci->load->model('education/lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$uid = $this->input->post('uid');
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
|
||||
$this->checkPermission($lehreinheit_id, $uid);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->direktUserAdd($uid, $lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$uid = $this->input->post('uid');
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
|
||||
$this->checkPermission($lehreinheit_id, $uid);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->direktUserDelete($uid, $lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getByLehreinheit($lehreinheit_id = null)
|
||||
{
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
$gruppen = $this->_ci->LehreinheitgruppeModel->getDirectGroup($lehreinheit_id);
|
||||
$this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : array());
|
||||
}
|
||||
|
||||
private function checkPermission($lehreinheit_id, $uid = false)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
|
||||
|
||||
if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
$benuzuer_result = $this->_ci->BenutzerModel->load(array($uid));
|
||||
if (!hasData($benuzuer_result) || isError($benuzuer_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$oe_array = [];
|
||||
if (hasData($result))
|
||||
$oe_array = getData($result);
|
||||
|
||||
if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid'))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Favorites extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['lv_favorites']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithSuccess(null);
|
||||
else
|
||||
$this->terminateWithSuccess(isset($data['lv_favorites']) ? $data['lv_favorites'] : null);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('favorites', 'Favorites', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$favorites = $this->input->post('favorites');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'lv_favorites', $favorites);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Gruppe extends FHCAPI_Controller
|
||||
{
|
||||
private $_uid;
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'add' => ['admin:rw', 'assistenz:rw'],
|
||||
'delete' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteFromLVPlan' => ['admin:rw', 'assistenz:rw'],
|
||||
'getBenutzerSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getAllSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getByLehreinheit' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
$this->_ci->load->library('PhrasesLib');
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui',
|
||||
'lehre'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_ci->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
$this->_ci->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
$this->_ci->load->model('person/Person_model', 'PersonModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$lehreinheitgruppe_id = $this->input->post('lehreinheitgruppe_id');
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($lehreinheitgruppe_id) || !ctype_digit((string)$lehreinheitgruppe_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehreinheitgruppe_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheitgruppe_id' => $lehreinheitgruppe_id));
|
||||
if (!hasData($lehreinheitgruppe_result) || isError($lehreinheitgruppe_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->deleteGroup($lehreinheit_id, $lehreinheitgruppe_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$gid = $this->input->post('gid');
|
||||
$lehrverband = $this->input->post('lehrverband');
|
||||
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($gid) || !ctype_digit((string)$gid) || is_null($lehrverband))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, !($lehrverband === 'false'));
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getByLehreinheit($lehreinheit_id = null)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$gruppen = $this->_ci->LehreinheitgruppeModel->getByLehreinheit($lehreinheit_id);
|
||||
$this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : array());
|
||||
}
|
||||
|
||||
public function deleteFromLVPlan()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$lehreinheitgruppe_id = $this->input->post('lehreinheitgruppe_id');
|
||||
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($lehreinheitgruppe_id) || !ctype_digit((string)$lehreinheitgruppe_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehreinheitgruppe_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheitgruppe_id' => $lehreinheitgruppe_id));
|
||||
if (!hasData($lehreinheitgruppe_result) || isError($lehreinheitgruppe_result))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->StundenplandevModel->deleteGroupPlanning($lehreinheit_id, $lehreinheitgruppe_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
|
||||
public function getAllSearch()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$query_words = explode(' ', $query);
|
||||
|
||||
$this->_ci->GruppeModel->addSelect('gruppe_kurzbz,
|
||||
studiengang_kz,
|
||||
semester,
|
||||
bezeichnung,
|
||||
gid,
|
||||
\'false\' as lehrverband');
|
||||
$this->_ci->GruppeModel->db->where(array('sichtbar' => true, 'aktiv' => true, 'lehre' => true, 'direktinskription' => false, 'semester IS NOT NULL' => null));
|
||||
$this->_ci->GruppeModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->GruppeModel->db->group_start();
|
||||
$this->_ci->GruppeModel->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->_ci->GruppeModel->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->_ci->GruppeModel->db->group_end();
|
||||
}
|
||||
$this->_ci->GruppeModel->db->group_end();
|
||||
|
||||
$gruppen_result = $this->_ci->GruppeModel->load();
|
||||
|
||||
$gruppen_array = array();
|
||||
|
||||
if (isError($gruppen_result))
|
||||
$this->terminateWithError(getError($gruppen_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (hasData($gruppen_result))
|
||||
$gruppen_array = getData($gruppen_result);
|
||||
|
||||
$this->_ci->LehrverbandModel->addSelect('CONCAT(UPPER(CONCAT(typ, kurzbz)), \'\', semester, verband, COALESCE(gruppe,\'\')) as gruppe_kurzbz,
|
||||
studiengang_kz,
|
||||
semester,
|
||||
tbl_lehrverband.bezeichnung,
|
||||
gid,
|
||||
\'true\' as lehrverband');
|
||||
$this->_ci->LehrverbandModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$this->_ci->LehrverbandModel->addOrder('verband');
|
||||
$this->_ci->LehrverbandModel->addOrder('gruppe');
|
||||
$this->_ci->LehrverbandModel->db->where(array('tbl_lehrverband.aktiv' => true));
|
||||
|
||||
$this->_ci->LehrverbandModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->LehrverbandModel->db->group_start();
|
||||
$this->_ci->LehrverbandModel->db->where('CONCAT(CONCAT(typ, kurzbz), \'\', semester, verband, COALESCE(gruppe,\'\')) ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehrverbandModel->db->or_where('tbl_lehrverband.bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehrverbandModel->db->group_end();
|
||||
}
|
||||
$this->_ci->LehrverbandModel->db->group_end();
|
||||
$lehrverband_result = $this->_ci->LehrverbandModel->load();
|
||||
|
||||
$lehrverband_array = array();
|
||||
|
||||
if (isError($lehrverband_result))
|
||||
$this->terminateWithError(getError($lehrverband_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (hasData($lehrverband_result))
|
||||
$lehrverband_array = getData($lehrverband_result);
|
||||
|
||||
$all_gruppen = array_merge($gruppen_array, $lehrverband_array);
|
||||
|
||||
$this->terminateWithSuccess($all_gruppen);
|
||||
}
|
||||
|
||||
public function getBenutzerSearch()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$query_words = explode(' ', $query);
|
||||
|
||||
$this->_ci->PersonModel->addSelect('vorname, nachname, uid, semester, UPPER(CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz)) as studiengang');
|
||||
$this->_ci->PersonModel->addJoin('public.tbl_benutzer', 'person_id');
|
||||
$this->_ci->PersonModel->addJoin('public.tbl_mitarbeiter', 'uid = mitarbeiter_uid', 'LEFT');
|
||||
$this->_ci->PersonModel->addJoin('public.tbl_student', 'uid = student_uid', 'LEFT');
|
||||
$this->_ci->PersonModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
|
||||
$this->_ci->PersonModel->db->where(array('tbl_benutzer.aktiv' => true));
|
||||
|
||||
$this->_ci->PersonModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->PersonModel->db->group_start();
|
||||
$this->_ci->PersonModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
|
||||
$this->_ci->PersonModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
|
||||
$this->_ci->PersonModel->db->or_where('uid ILIKE', "%" . $word . "%");
|
||||
$this->_ci->PersonModel->db->or_where('CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz) ILIKE', "%" . $word . "%");
|
||||
|
||||
if (is_numeric($word))
|
||||
{
|
||||
$this->_ci->PersonModel->db->or_where('semester', $word);
|
||||
}
|
||||
$this->_ci->PersonModel->db->group_end();
|
||||
}
|
||||
$this->_ci->PersonModel->db->group_end();
|
||||
$personen = $this->_ci->PersonModel->load();
|
||||
$this->terminateWithSuccess(hasData($personen) ? getData($personen) : array());
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
|
||||
private function checkPermission($lehreinheit_id)
|
||||
{
|
||||
$lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
|
||||
|
||||
if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$oe_array = [];
|
||||
if (hasData($result))
|
||||
$oe_array = getData($result);
|
||||
|
||||
if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('lv-plan', $oe_array, 'suid'))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Lehreinheit extends FHCAPI_Controller
|
||||
{
|
||||
private $_uid;
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'add' => ['admin:rw', 'assistenz:rw'],
|
||||
'copy' => ['admin:rw', 'assistenz:rw'],
|
||||
'delete' => ['admin:rw', 'assistenz:rw'],
|
||||
'update' => ['admin:rw', 'assistenz:rw'],
|
||||
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
'getLehrfach' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
'getLehrform' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PhrasesLib');
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
$this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
|
||||
}
|
||||
|
||||
public function get($lehreinheit_id)
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
|
||||
$lehreinheit->lehrfaecher = $this->getLehrfaecher($lehreinheit);
|
||||
$this->terminateWithSuccess($lehreinheit);
|
||||
}
|
||||
|
||||
private function getLehrfaecher($lehreinheit)
|
||||
{
|
||||
$lehrfacher_array = array($lehreinheit->lehrfach_id);
|
||||
$this->_ci->LehreinheitModel->addSelect('lehrveranstaltung_id_kompatibel');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung_kompatibel', 'lehrveranstaltung_id');
|
||||
$lehrfaecher = $this->_ci->LehreinheitModel->loadWhere(array('lehrveranstaltung_id' => $lehreinheit->lehrveranstaltung_id));
|
||||
|
||||
|
||||
if (hasData($lehrfaecher))
|
||||
$lehrfaecher_array = array_merge($lehrfacher_array, array_column(getData($lehrfaecher), 'lehrveranstaltung_id_kompatibel'));
|
||||
|
||||
$lehrfaecher_array[] = $lehreinheit->lehrveranstaltung_id;
|
||||
|
||||
$this->_ci->LehrveranstaltungModel->addDistinct('lehrfach_id');
|
||||
$this->_ci->LehrveranstaltungModel->addSelect("tbl_lehrveranstaltung.lehrveranstaltung_id, CONCAT(tbl_lehrveranstaltung.bezeichnung || '(' || tbl_lehrveranstaltung.oe_kurzbz || ')') as lehrfach");
|
||||
$this->_ci->LehrveranstaltungModel->db->where_in('tbl_lehrveranstaltung.lehrveranstaltung_id', $lehrfaecher_array);
|
||||
$lehrfaecher_result = $this->_ci->LehrveranstaltungModel->load();
|
||||
|
||||
return hasData($lehrfaecher_result) ? getData($lehrfaecher_result) : array();
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id');
|
||||
|
||||
if (is_null($lehrveranstaltung_id) || !ctype_digit((string)$lehrveranstaltung_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehrveranstaltung_result = $this->_ci->LehrveranstaltungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id));
|
||||
|
||||
if (!hasData($lehrveranstaltung_result) || isError($lehrveranstaltung_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehrveranstaltung = getData($lehrveranstaltung_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->LehrveranstaltungModel->getAllOe($lehrveranstaltung->lehrveranstaltung_id);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array();
|
||||
|
||||
if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('lv-plan', $oe_array, 'suid'))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
$this->_ci->load->library('form_validation');
|
||||
|
||||
$updatableFields = array(
|
||||
'lehrveranstaltung_id',
|
||||
'studiensemester_kurzbz',
|
||||
'lehrfach_id',
|
||||
'lehrform_kurzbz',
|
||||
'stundenblockung',
|
||||
'wochenrythmus',
|
||||
'gewicht',
|
||||
'start_kw',
|
||||
'raumtyp',
|
||||
'raumtypalternativ',
|
||||
'sprache',
|
||||
'lehre',
|
||||
'anmerkung',
|
||||
'lvnr',
|
||||
'unr',
|
||||
);
|
||||
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
switch ($field) {
|
||||
case 'lehrveranstaltung_id':
|
||||
$this->form_validation->set_rules($field, 'Lehrveranstaltung ID', 'required|integer');
|
||||
break;
|
||||
case 'studiensemester_kurzbz':
|
||||
$this->form_validation->set_rules($field, 'Studiensemester', 'required|max_length[16]');
|
||||
break;
|
||||
case 'lehrfach_id':
|
||||
$this->form_validation->set_rules($field, 'Lehrfach ID', 'required|integer');
|
||||
break;
|
||||
case 'lehrform_kurzbz':
|
||||
$this->form_validation->set_rules($field, 'Lehrform', 'required|max_length[8]');
|
||||
break;
|
||||
case 'stundenblockung':
|
||||
$this->form_validation->set_rules($field, 'Stundenblockung', 'required|integer|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'wochenrythmus':
|
||||
$this->form_validation->set_rules($field, 'Wochenrhytmus', 'required|integer|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'start_kw':
|
||||
$this->form_validation->set_rules($field, 'Start KW', 'integer|greater_than[0]|less_than_equal_to[53]');
|
||||
break;
|
||||
case 'gewicht':
|
||||
$this->form_validation->set_rules($field, 'Gewicht', 'numeric');
|
||||
break;
|
||||
case 'raumtyp':
|
||||
$this->form_validation->set_rules($field, 'Raumtyp', 'required|max_length[16]');
|
||||
break;
|
||||
case 'raumtypalternativ':
|
||||
$this->form_validation->set_rules($field, 'Raumtyp Alternativ', 'required|max_length[16]');
|
||||
break;
|
||||
case 'sprache':
|
||||
$this->form_validation->set_rules($field, 'Sprache', 'required|max_length[16]');
|
||||
break;
|
||||
case 'lvnr':
|
||||
$this->form_validation->set_rules($field, 'LVNR', 'integer');
|
||||
break;
|
||||
case 'unr':
|
||||
$this->form_validation->set_rules($field, 'UNR', 'integer');
|
||||
break;
|
||||
case 'lehre':
|
||||
$this->form_validation->set_rules($field, 'Lehre', 'trim');
|
||||
break;
|
||||
case 'anmerkung':
|
||||
$this->form_validation->set_rules($field, 'Anmerkung', 'trim');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() === false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$updateData = array();
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
$value = $this->input->post($field);
|
||||
|
||||
if ($field === 'lehre')
|
||||
{
|
||||
$value = (bool)$value;
|
||||
}
|
||||
if ($value !== null)
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$updateData['insertvon'] = $this->_uid;
|
||||
$updateData['insertamum'] = date('Y-m-d H:i:s');
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->insert(
|
||||
$updateData
|
||||
);
|
||||
|
||||
if (!isset($updateData['unr']))
|
||||
{
|
||||
$unr = getData($result);
|
||||
$this->_ci->LehreinheitModel->update($unr, array('unr' => $unr));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function copy()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$art = $this->input->post('art');
|
||||
|
||||
$lehreinheit_old = $this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit_old->lehreinheit_id);
|
||||
|
||||
$lehreinheit_new = $lehreinheit_old;
|
||||
|
||||
$lehreinheit_new->unr = null;
|
||||
unset($lehreinheit_new->lehreinheit_id);
|
||||
$lehreinheit_new->updateamum = date('Y-m-d H:i:s');
|
||||
$lehreinheit_new->updatevon = $this->_uid;
|
||||
$lehreinheit_new->insertamum = date('Y-m-d H:i:s');
|
||||
$lehreinheit_new->insertvon = $this->_uid;
|
||||
|
||||
$insert_result = $this->_ci->LehreinheitModel->insert($lehreinheit_new);
|
||||
|
||||
if (isError($insert_result))
|
||||
$this->terminateWithError(getError($insert_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehreinheit_id_new = getData($insert_result);
|
||||
|
||||
$this->_ci->LehreinheitModel->update(array('lehreinheit_id' => $lehreinheit_id_new), array('unr' => $lehreinheit_id_new));
|
||||
if (in_array($art, array('gruppen', 'alle')))
|
||||
{
|
||||
$gruppen_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
|
||||
|
||||
if (isError($gruppen_result))
|
||||
$this->terminateWithError(getError($gruppen_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (hasData($gruppen_result))
|
||||
{
|
||||
$gruppen = getData($gruppen_result);
|
||||
|
||||
foreach ($gruppen as $gruppe)
|
||||
{
|
||||
$gruppe_new = $gruppe;
|
||||
unset($gruppe_new->lehreinheitgruppe_id);
|
||||
$gruppe_new->lehreinheit_id = $lehreinheit_id_new;
|
||||
$gruppe_new->insertamum = date('Y-m-d H:i:s');
|
||||
$gruppe_new->insertvon = $this->_uid;
|
||||
$gruppe_new->updateamum = date('Y-m-d H:i:s');
|
||||
$gruppe_new->updatevon = $this->_uid;
|
||||
|
||||
$gruppe_new_result = $this->_ci->LehreinheitgruppeModel->insert($gruppe_new);
|
||||
|
||||
if (isError($gruppe_new_result))
|
||||
$this->terminateWithError(getError($gruppe_new_result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($art, array('lektoren', 'alle')))
|
||||
{
|
||||
$lektoren_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
|
||||
|
||||
if (isError($lektoren_result))
|
||||
$this->terminateWithError(getError($lektoren_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (hasData($lektoren_result))
|
||||
{
|
||||
$lektoren = getData($lektoren_result);
|
||||
|
||||
foreach ($lektoren as $lektor)
|
||||
{
|
||||
|
||||
$lektor_new = $lektor;
|
||||
$lektor_new->lehreinheit_id = $lehreinheit_id_new;
|
||||
$lektor_new->insertamum = date('Y-m-d H:i:s');
|
||||
$lektor_new->insertvon = $this->_uid;
|
||||
$lektor_new->updateamum = date('Y-m-d H:i:s');
|
||||
$lektor_new->updatevon = $this->_uid;
|
||||
unset($lektor_new->vertrag_id);
|
||||
|
||||
$lektor_new_result = $this->_ci->LehreinheitmitarbeiterModel->insert((array)$lektor_new);
|
||||
|
||||
if (isError($lektor_new_result))
|
||||
$this->terminateWithError(getError($lektor_new_result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess("Erfolgeich gespeichert");
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
|
||||
$errors = array();
|
||||
if (is_array($lehreinheit_id))
|
||||
{
|
||||
foreach ($lehreinheit_id as $le_id)
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($le_id);
|
||||
$this->checkPermission($lehreinheit->lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$errors[] = getError($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit->lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
|
||||
if (!isEmptyArray($errors))
|
||||
{
|
||||
if (count($errors) !== count($lehreinheit_id))
|
||||
$this->terminateWithSuccess(array('errors' => $errors));
|
||||
else
|
||||
$this->terminateWithError($errors);
|
||||
}
|
||||
else
|
||||
$this->terminateWithSuccess('Erfolgreich geloescht');
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($this->input->post('lehreinheit_id'));
|
||||
|
||||
$this->checkPermission($lehreinheit->lehreinheit_id);
|
||||
|
||||
$this->_ci->load->library('form_validation');
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$updatableFields = array(
|
||||
'lehrveranstaltung_id',
|
||||
'studiensemester_kurzbz',
|
||||
'lehrfach_id',
|
||||
'lehrform_kurzbz',
|
||||
'stundenblockung',
|
||||
'wochenrythmus',
|
||||
'gewicht',
|
||||
'start_kw',
|
||||
'raumtyp',
|
||||
'raumtypalternativ',
|
||||
'sprache',
|
||||
'lehre',
|
||||
'anmerkung',
|
||||
'lvnr',
|
||||
'unr',
|
||||
);
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
if (array_key_exists($field, $formData))
|
||||
{
|
||||
switch ($field)
|
||||
{
|
||||
case 'lehrveranstaltung_id':
|
||||
$this->form_validation->set_rules($field, 'Lehrveranstaltung ID', 'required|integer');
|
||||
break;
|
||||
case 'studiensemester_kurzbz':
|
||||
$this->form_validation->set_rules($field, 'Studiensemester', 'required|max_length[16]');
|
||||
break;
|
||||
case 'lehrfach_id':
|
||||
$this->form_validation->set_rules($field, 'Lehrfach ID', 'required|integer');
|
||||
break;
|
||||
case 'lehrform_kurzbz':
|
||||
$this->form_validation->set_rules($field, 'Lehrform', 'required|max_length[8]');
|
||||
break;
|
||||
case 'stundenblockung':
|
||||
$this->form_validation->set_rules($field, 'Stundenblockung', 'required|integer|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'wochenrythmus':
|
||||
$this->form_validation->set_rules($field, 'Wochenrhytmus', 'required|integer|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'start_kw':
|
||||
$this->form_validation->set_rules($field, 'Start KW', 'integer|greater_than[0]|less_than_equal_to[53]');
|
||||
break;
|
||||
case 'gewicht':
|
||||
$this->form_validation->set_rules($field, 'Gewicht', 'numeric|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'raumtyp':
|
||||
$this->form_validation->set_rules($field, 'Raumtyp', 'required|max_length[16]');
|
||||
break;
|
||||
case 'raumtypalternativ':
|
||||
$this->form_validation->set_rules($field, 'Raumtyp Alternativ', 'required|max_length[16]');
|
||||
break;
|
||||
case 'sprache':
|
||||
$this->form_validation->set_rules($field, 'Sprache', 'required|max_length[16]');
|
||||
break;
|
||||
case 'lvnr':
|
||||
$this->form_validation->set_rules($field, 'LVNR', 'integer');
|
||||
break;
|
||||
case 'unr':
|
||||
$this->form_validation->set_rules($field, 'UNR', 'integer|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'lehre':
|
||||
$this->form_validation->set_rules($field, 'Lehre', 'trim');
|
||||
break;
|
||||
case 'anmerkung':
|
||||
$this->form_validation->set_rules($field, 'Anmerkung', 'trim');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() === false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$updateData = [];
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
if (array_key_exists($field, $formData))
|
||||
{
|
||||
$updateData[$field] = $formData[$field];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$updateData['updatevon'] = $this->_uid;
|
||||
$updateData['updateamum'] = date('Y-m-d H:i:s');
|
||||
$result = $this->_ci->LehreinheitModel->update(
|
||||
[
|
||||
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
|
||||
],
|
||||
$updateData
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithSuccess($this->p->t('global', 'gespeichert'));
|
||||
}
|
||||
|
||||
|
||||
private function checkPermission($lehreinheit_id)
|
||||
{
|
||||
$result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$oe_array = [];
|
||||
if (hasData($result))
|
||||
$oe_array = getData($result);
|
||||
|
||||
if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid') &&
|
||||
!$this->_ci->permissionlib->isBerechtigtMultipleOe('lv-plan', $oe_array, 'suid'))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
}
|
||||
private function checkLehreinheit($lehreinheit_id)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
|
||||
|
||||
if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return getData($lehreinheit_result)[0];
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,432 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Lektor extends FHCAPI_Controller
|
||||
{
|
||||
private $_uid;
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'add' => ['admin:rw', 'assistenz:rw'],
|
||||
'update' => ['admin:rw', 'assistenz:rw'],
|
||||
'cancelVertrag' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteLVPlan' => ['admin:rw', 'assistenz:rw'],
|
||||
'deletePerson' => ['admin:rw', 'assistenz:rw'],
|
||||
'getLehrfunktionen' => ['admin:r', 'assistenz:r'],
|
||||
'getLektorenSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getLektorenByLE' => ['admin:r', 'assistenz:r'],
|
||||
'getLektorDaten' => ['admin:r', 'assistenz:r'],
|
||||
'getLektorVertrag' => ['admin:r', 'assistenz:r'],
|
||||
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$this->_ci->load->library('LektorLib');
|
||||
$this->_ci->load->library('form_validation');
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
|
||||
$this->_ci->load->model('accounting/Vertrag_model', 'VertragModel');
|
||||
$this->_ci->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->_ci->load->model('education/lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->load->model('ressource/Stundensatz_model', 'StundensatzModel');
|
||||
|
||||
}
|
||||
|
||||
private function checkMitarbeiter($mitarbeiter_uid)
|
||||
{
|
||||
if (is_null($mitarbeiter_uid))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
|
||||
|
||||
if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
|
||||
$this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkMitarbeiter($mitarbeiter_uid);
|
||||
$lehrfach_permission = $this->checkLehrfachPermission($lehreinheit_id, array('assistenz', 'admin'));
|
||||
$lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
|
||||
|
||||
if (!$lehrfach_permission && !$lehreinheit_permission)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
$result = $this->_ci->lektorlib->addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess("Erfolgreich gespeichert");
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$formData = $this->input->post('formData');
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
|
||||
$this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkMitarbeiter($mitarbeiter_uid);
|
||||
|
||||
$updatableFields = array(
|
||||
'lehrfunktion_kurzbz',
|
||||
'planstunden',
|
||||
'stundensatz',
|
||||
'faktor',
|
||||
'anmerkung',
|
||||
'bismelden',
|
||||
'semesterstunden',
|
||||
'mitarbeiter_uid'
|
||||
);
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
if (array_key_exists($field, $formData))
|
||||
{
|
||||
switch ($field)
|
||||
{
|
||||
case 'lehrfunktion_kurzbz':
|
||||
$this->form_validation->set_rules($field, 'Lehrfunktion', 'required|max_length[16]');
|
||||
break;
|
||||
case 'planstunden':
|
||||
$this->form_validation->set_rules($field, 'Planstunden', 'integer|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'stundensatz':
|
||||
$formData['stundensatz'] = str_replace(',', '.', $formData['stundensatz']);
|
||||
$this->form_validation->set_rules($field, 'Stundensatz', 'callback__check_stundensatz');
|
||||
break;
|
||||
case 'faktor':
|
||||
$this->form_validation->set_rules($field, 'Faktor', 'numeric|greater_than_equal_to[0]');
|
||||
break;
|
||||
case 'anmerkung':
|
||||
$this->form_validation->set_rules($field, 'Anmerkung', 'max_length[256]');
|
||||
break;
|
||||
case 'bismelden':
|
||||
$this->form_validation->set_rules($field, 'Bis Melden', 'trim');
|
||||
break;
|
||||
case 'semesterstunden':
|
||||
$formData['semesterstunden'] = str_replace(',', '.', $formData['semesterstunden']);
|
||||
$this->form_validation->set_rules($field, 'Semesterstunden', 'callback__check_semesterstunden');
|
||||
break;
|
||||
case 'mitarbeiter_uid':
|
||||
$this->form_validation->set_rules($field, 'Semesterstunden', 'required|max_length[32]');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$this->form_validation->run())
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if (isset($formData['semesterstunden']) && (!is_numeric($formData['semesterstunden']) || $formData['semesterstunden'] === ''))
|
||||
{
|
||||
$formData['semesterstunden'] = null;
|
||||
}
|
||||
|
||||
$lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
|
||||
|
||||
if (!$lehreinheit_permission)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
$result = $this->_ci->lektorlib->updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $formData);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result));
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function _check_stundensatz($value)
|
||||
{
|
||||
$value = str_replace(',', '.', $value);
|
||||
|
||||
if (!is_numeric($value))
|
||||
{
|
||||
$this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss eine Zahl sein.');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($value < 0 || $value >= 10000) {
|
||||
$this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss zwischen 0 und 10000 liegen.');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
public function _check_semesterstunden($value)
|
||||
{
|
||||
if ($value === null || $value === '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is_numeric($value))
|
||||
{
|
||||
$this->form_validation->set_message(
|
||||
'_check_semesterstunden',
|
||||
'Das Feld {field} muss eine Zahl sein.'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($value < 0)
|
||||
{
|
||||
$this->form_validation->set_message(
|
||||
'_check_semesterstunden',
|
||||
'Das Feld {field} muss eine Zahl größer oder gleich 0 sein.'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if ($value > 999.99)
|
||||
{
|
||||
$this->form_validation->set_message(
|
||||
'_check_semesterstunden',
|
||||
'Das Feld {field} darf maximal 999,99 betragen.'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
public function getLehrfunktionen()
|
||||
{
|
||||
$this->_ci->load->model('education/Lehrfunktion_model', 'LehrfunktionModel');
|
||||
$this->_ci->LehrfunktionModel->addOrder('lehrfunktion_kurzbz');
|
||||
$this->terminateWithSuccess(getData($this->_ci->LehrfunktionModel->load()));
|
||||
}
|
||||
|
||||
public function getLektorenSearch()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$query_words = explode(' ', $query);
|
||||
|
||||
$this->_ci->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
|
||||
$this->_ci->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
|
||||
$this->_ci->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
|
||||
|
||||
$this->_ci->MitarbeiterModel->db->where('public.tbl_benutzer.aktiv', true);
|
||||
|
||||
$this->_ci->MitarbeiterModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->MitarbeiterModel->db->group_start();
|
||||
$this->_ci->MitarbeiterModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
|
||||
$this->_ci->MitarbeiterModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
|
||||
$this->_ci->MitarbeiterModel->db->or_where('uid ILIKE', "%" . $word . "%");
|
||||
$this->_ci->MitarbeiterModel->db->group_end();
|
||||
}
|
||||
$this->_ci->MitarbeiterModel->db->group_end();
|
||||
$this->_ci->MitarbeiterModel->addOrder('nachname');
|
||||
$this->_ci->MitarbeiterModel->addOrder('vorname');
|
||||
$result = $this->_ci->MitarbeiterModel->load();
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : array());
|
||||
}
|
||||
|
||||
private function checkLehreinheit($lehreinheit_id)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
|
||||
|
||||
if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return getData($lehreinheit_result)[0];
|
||||
|
||||
}
|
||||
public function getLektorenByLE($lehreinheit_id = null)
|
||||
{
|
||||
$this->checkLehreinheit($lehreinheit_id);
|
||||
$le_mitarbeiter_data = $this->_ci->LehreinheitmitarbeiterModel->getLektorenByLe($lehreinheit_id);
|
||||
$this->terminateWithSuccess(hasData($le_mitarbeiter_data) ? getData($le_mitarbeiter_data) : array());
|
||||
}
|
||||
|
||||
public function getLektorDaten($lehreinheit_id = null, $mitarbeiter_uid = null)
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
|
||||
|
||||
if (is_null($mitarbeiter_uid))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
|
||||
|
||||
if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz' => $lehreinheit->studiensemester_kurzbz));
|
||||
$studiensemester = getData($studiensemester_result)[0];
|
||||
|
||||
$defaultStundensatz = $this->_ci->StundensatzModel->getDefaultStundensatz($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre');
|
||||
|
||||
$le_mitarbeiter_result = $this->_ci->LehreinheitmitarbeiterModel->getByLeLektor($lehreinheit_id, $mitarbeiter_uid);
|
||||
|
||||
$le_mitarbeiter_data = array();
|
||||
if (hasData($le_mitarbeiter_result))
|
||||
{
|
||||
$le_mitarbeiter_data = getData($le_mitarbeiter_result)[0];
|
||||
$le_mitarbeiter_data->default_stundensatz = $defaultStundensatz;
|
||||
}
|
||||
$vertrag = $this->getLektorVertrag($lehreinheit_id, $mitarbeiter_uid);
|
||||
$le_mitarbeiter_data->vertrag = $vertrag;
|
||||
$this->terminateWithSuccess($le_mitarbeiter_data);
|
||||
}
|
||||
|
||||
private function getLektorVertrag($lehreinheit_id = null, $mitarbeiter_uid = null)
|
||||
{
|
||||
$this->_ci->load->model('accounting/Vertrag_model', 'VertragModel');
|
||||
$vertrag = $this->_ci->VertragModel->getVertrag($mitarbeiter_uid, $lehreinheit_id);
|
||||
return hasData($vertrag) ? getData($vertrag)[0] : null;
|
||||
}
|
||||
|
||||
private function checkLehrfachPermission($lehreinheit_id, $permissions)
|
||||
{
|
||||
$lehrfach_oe_kurzbz = $this->_ci->LehreinheitModel->getLehrfachOe($lehreinheit_id);
|
||||
|
||||
if (isError($lehrfach_oe_kurzbz))
|
||||
$this->terminateWithError(getError($lehrfach_oe_kurzbz), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehrfach_oe_kurzbz = array('');
|
||||
if (hasData($lehrfach_oe_kurzbz))
|
||||
$lehrfach_oe_kurzbz = array_column(getData($lehrfach_oe_kurzbz), 'oe_kurzbz');
|
||||
|
||||
|
||||
return $this->checkPermissionGenerel($permissions, $lehrfach_oe_kurzbz);
|
||||
}
|
||||
|
||||
private function checkPermissionGenerel($permissions, $oe_array)
|
||||
{
|
||||
$hasPermission = false;
|
||||
foreach ($permissions as $permission)
|
||||
{
|
||||
if ($this->_ci->permissionlib->isBerechtigtMultipleOe($permission, $oe_array, 'suid'))
|
||||
{
|
||||
$hasPermission = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $hasPermission;
|
||||
}
|
||||
|
||||
private function checkPermission($lehreinheit_id, $permissions)
|
||||
{
|
||||
$result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$oe_array = [];
|
||||
if (hasData($result))
|
||||
$oe_array = getData($result);
|
||||
|
||||
return $this->checkPermissionGenerel($permissions, $oe_array);
|
||||
}
|
||||
public function cancelVertrag()
|
||||
{
|
||||
$vertrag_id = $this->input->post('vertrag_id');
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
|
||||
$this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit_id, array('admin', 'lehre/lehrauftrag_bestellen'));
|
||||
|
||||
if (is_null($vertrag_id) || !ctype_digit((string)$vertrag_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$vertrag_result = $this->_ci->VertragModel->load($vertrag_id);
|
||||
|
||||
if (!hasData($vertrag_result) || isError($vertrag_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (is_null($mitarbeiter_uid))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
|
||||
|
||||
if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->_ci->VertragModel->cancelVertrag($vertrag_id, $mitarbeiter_uid);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function deletePerson()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
|
||||
$this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
|
||||
|
||||
if (is_null($mitarbeiter_uid))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
|
||||
|
||||
if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$delete_result =$this->_ci->LehreinheitmitarbeiterModel->deleteLektorFromLe($lehreinheit_id, $mitarbeiter_uid);
|
||||
|
||||
if (isError($delete_result))
|
||||
$this->terminateWithError(getError($delete_result));
|
||||
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
}
|
||||
|
||||
public function deleteLVPlan()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
|
||||
$this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit_id, array('lv-plan/lektorentfernen'));
|
||||
|
||||
if (is_null($mitarbeiter_uid))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
|
||||
|
||||
if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$delete_result = $this->_ci->StundenplandevModel->deleteLektorPlanning($lehreinheit_id, $mitarbeiter_uid);
|
||||
|
||||
if (isError($delete_result))
|
||||
$this->terminateWithError(getError($delete_result));
|
||||
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2025 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Setup extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
'getLehrform' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
}
|
||||
|
||||
public function getTabs()
|
||||
{
|
||||
$tabs['details'] = array (
|
||||
'title' => 'Details',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Details.js',
|
||||
'config' => []
|
||||
);
|
||||
$tabs['gruppen'] = array (
|
||||
'title' => 'Gruppen',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Gruppen.js',
|
||||
'config' => []
|
||||
);
|
||||
$tabs['lektor'] = array (
|
||||
'title' => 'LektorInnenzuteilung',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Lektor.js',
|
||||
'config' => []
|
||||
);
|
||||
$tabs['notiz'] = array (
|
||||
'title' => 'Notizen',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Notiz.js',
|
||||
'config' => []
|
||||
);
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->_ci->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$this->terminateWithSuccess(getData($this->_ci->StudiensemesterModel->load()));
|
||||
}
|
||||
public function getSprache()
|
||||
{
|
||||
$this->_ci->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->terminateWithSuccess(getData($this->_ci->SpracheModel->load()));
|
||||
}
|
||||
|
||||
public function getRaumtyp()
|
||||
{
|
||||
$this->_ci->load->model('ressource/Raumtyp_model', 'RaumtypModel');
|
||||
$this->_ci->RaumtypModel->addOrder('raumtyp_kurzbz');
|
||||
$this->terminateWithSuccess(getData($this->_ci->RaumtypModel->loadWhere(array('aktiv' => true))));
|
||||
}
|
||||
|
||||
public function getLehrform()
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
|
||||
$this->_ci->load->model('codex/lehrform_model', 'LehrformModel');
|
||||
|
||||
$this->_ci->LehrformModel->addSelect(
|
||||
'*,
|
||||
bezeichnung_kurz[('.$language.')] as bez_kurz,
|
||||
bezeichnung_lang[('.$language.')] as bez
|
||||
'
|
||||
);
|
||||
$this->terminateWithSuccess(getData($this->_ci->LehrformModel->load()));
|
||||
}
|
||||
|
||||
private function _getLanguageIndex()
|
||||
{
|
||||
$this->_ci->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->_ci->SpracheModel->addSelect('index');
|
||||
$result = $this->_ci->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
|
||||
|
||||
return hasData($result) ? getData($result)[0]->index : 1;
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class StgTree extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if ($method == '' || $method == 'index')
|
||||
return $this->getBase();
|
||||
|
||||
if (!$this->permissionlib->isBerechtigt('assistenz', 's', $method)
|
||||
&& !$this->permissionlib->isBerechtigt('admin', 's', $method)
|
||||
) {
|
||||
return $this->_outputAuthError([$method => ['admin:r', 'assistenz:r']]);
|
||||
}
|
||||
|
||||
return $this->getStudiengang($method);
|
||||
show_404();
|
||||
}
|
||||
|
||||
protected function getBase()
|
||||
{
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("v.studiengang_kz AS link");
|
||||
$this->StudiengangModel->addSelect(
|
||||
"CONCAT(kurzbzlang, ' (', UPPER(CONCAT(typ, kurzbz)), ') - ', tbl_studiengang.bezeichnung) AS name",
|
||||
false
|
||||
);
|
||||
$this->StudiengangModel->addSelect('erhalter_kz');
|
||||
$this->StudiengangModel->addSelect('typ');
|
||||
$this->StudiengangModel->addSelect('kurzbz');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz AS stg_kz');
|
||||
|
||||
$this->StudiengangModel->addOrder('erhalter_kz');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
|
||||
$stgs = $this->permissionlib->getSTG_isEntitledFor('admin') ?: [];
|
||||
$stgs = array_merge($stgs, $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []);
|
||||
|
||||
if (!$stgs)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $stgs);
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(['v.aktiv' => true]);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
protected function getStudiengang($studiengang_kz)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester ORDER BY verband, gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('semester');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('semester');
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.aktiv' => true
|
||||
]);
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
if ($result)
|
||||
{
|
||||
if (current($result)->mischform)
|
||||
{
|
||||
$this->load->model('organisation/Studienordnung_model', 'StudienordnungModel');
|
||||
|
||||
$this->StudienordnungModel->addDistinct();
|
||||
$this->StudienordnungModel->addSelect("CONCAT(studiengang_kz, '/', p.orgform_kurzbz) AS link");
|
||||
$this->StudienordnungModel->addSelect("p.orgform_kurzbz AS name");
|
||||
$this->StudienordnungModel->addSelect("TRUE as leaf", false);
|
||||
|
||||
$this->StudienordnungModel->addJoin('lehre.tbl_studienplan p', 'studienordnung_id');
|
||||
|
||||
$result = $this->StudienordnungModel->loadWhere([
|
||||
'aktiv' => true,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'p.orgform_kurzbz !=' => 'DDP'
|
||||
]);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$list = array_merge($list, $result);
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Tags extends Tag_Controller
|
||||
{
|
||||
const BERECHTIGUNG_KURZBZ = ['admin:rw', 'assistenz:r'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'updateLehre' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneLehre' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteLehre' => self::BERECHTIGUNG_KURZBZ,
|
||||
]);
|
||||
|
||||
$this->config->load('lvverwaltung');
|
||||
}
|
||||
public function getTag($readonly_tags = null)
|
||||
{
|
||||
parent::getTag($this->config->item('lvverwaltung_tags'));
|
||||
}
|
||||
public function getTags($tags = null)
|
||||
{
|
||||
parent::getTags($this->config->item('lvverwaltung_tags'));
|
||||
}
|
||||
public function addTag($withZuordnung = true, $updatable_tags = null)
|
||||
{
|
||||
parent::addTag(true, $this->config->item('lvverwaltung_tags'));
|
||||
}
|
||||
public function updateTag($updatable_tags = null)
|
||||
{
|
||||
parent::updateTag($this->config->item('lvverwaltung_tags'));
|
||||
}
|
||||
public function deleteTag($withZuordnung = true, $updatable_tags = null)
|
||||
{
|
||||
parent::deleteTag(true, $this->config->item('lvverwaltung_tags'));
|
||||
}
|
||||
public function doneTag($updatable_tags = null)
|
||||
{
|
||||
parent::doneTag($this->config->item('lvverwaltung_tags'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,556 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Messages extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getMessages' => ['admin:r', 'assistenz:r'],
|
||||
'getVorlagen' => ['admin:r', 'assistenz:r'],
|
||||
'getMessageVarsPerson' => ['admin:r', 'assistenz:r'],
|
||||
'getMsgVarsPrestudent' => ['admin:r', 'assistenz:r'],
|
||||
'getMsgVarsLoggedInUser' => ['admin:r', 'assistenz:r'],
|
||||
'getNameOfDefaultRecipient' => ['admin:r', 'assistenz:r'],
|
||||
'getNameOfDefaultRecipients' => ['admin:r', 'assistenz:r'],
|
||||
'sendMessage' => ['admin:r', 'assistenz:r'],
|
||||
'deleteMessage' => ['admin:r', 'assistenz:r'],
|
||||
'getDataVorlage' => ['admin:r', 'assistenz:r'],
|
||||
'getPreviewText' => ['admin:r', 'assistenz:r'],
|
||||
'getReplyData' => ['admin:r', 'assistenz:r'],
|
||||
'getPersonId' => ['admin:r', 'assistenz:r'],
|
||||
'getUid' => ['admin:r', 'assistenz:r'],
|
||||
'getUids' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
//Load Models
|
||||
$this->load->model('system/Message_model', 'MessageModel');
|
||||
$this->load->model('CL/Messages_model', 'MessagesModel');
|
||||
|
||||
// Additional Permission Checks
|
||||
//TODO(manu) check permissions
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui', 'messages'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getMessages($id, $type_id, $size, $page)
|
||||
{
|
||||
if($type_id != 'person_id'){
|
||||
$id = $this->_getPersonId($id, $type_id);
|
||||
}
|
||||
|
||||
$offset = $size * ($page - 1);
|
||||
$limit = $size;
|
||||
|
||||
$result = $this->MessageModel->getMessagesForTable($id, $offset, $limit);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$data = getData($result);
|
||||
$this->addMeta('count', $data['count']);
|
||||
$this->terminateWithSuccess($data['data']);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array());
|
||||
}
|
||||
|
||||
public function getVorlagen()
|
||||
{
|
||||
//get oe of user
|
||||
$uid = getAuthUID();
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$result = $this->BenutzerfunktionModel->getBenutzerfunktionByUid($uid, 'oezuordnung');
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
$oe_kurzbz = array_column($data, 'oe_kurzbz');
|
||||
$result = $this->VorlageModel->getAllVorlagenByOe($oe_kurzbz);
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : array());
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array());
|
||||
}
|
||||
|
||||
public function getDataVorlage($vorlage_kurzbz)
|
||||
{
|
||||
$studiengang_kz = 0;
|
||||
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
$this->VorlagestudiengangModel->addOrder('version', 'DESC');
|
||||
|
||||
$result = $this->VorlagestudiengangModel->loadWhere(
|
||||
[
|
||||
'vorlage_kurzbz' =>$vorlage_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$vorlage = current($data);
|
||||
$this->terminateWithSuccess($vorlage);
|
||||
}
|
||||
|
||||
public function getMessageVarsPerson($typeId)
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
$messageVarsPerson = [];
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$person_id = ($typeId == 'mitarbeiter_uid') ? $this->_getPersonId($id, $typeId) : $id;
|
||||
$result = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$messageVarsPerson[] = current($data);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($messageVarsPerson);
|
||||
}
|
||||
|
||||
public function getMsgVarsPrestudent($typeId)
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
if(!is_array($ids)) {
|
||||
$ids = array($ids);
|
||||
}
|
||||
$messageVarsPrestudent = [];
|
||||
|
||||
if($typeId == 'uid')
|
||||
{
|
||||
$prestudent_ids = [];
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$prestudent_ids[] = $this->_getPrestudentIdFromUid($id);
|
||||
}
|
||||
}
|
||||
else
|
||||
$prestudent_ids = $ids;
|
||||
|
||||
foreach ($prestudent_ids as $prestudent_id)
|
||||
{
|
||||
$result = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$messageVarsPrestudent[] = current($data);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($messageVarsPrestudent);
|
||||
}
|
||||
|
||||
public function getMsgVarsLoggedInUser()
|
||||
{
|
||||
$result = $this->MessageModel->getMsgVarsLoggedInUser();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getNameOfDefaultRecipients($type_id)
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
if(!is_array($ids)) {
|
||||
$ids = array($ids);
|
||||
}
|
||||
$recipients = [];
|
||||
|
||||
if (empty($ids)) {
|
||||
|
||||
throw new InvalidArgumentException($this->p->t('ui', 'errorMissingOrInvalidParameters', ['parameter'=> 'Id(s)']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
if($type_id != 'person_id'){
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $type_id);
|
||||
$result = $this->PersonModel->load($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$name = current($data);
|
||||
$recipients[$id] = $name->vorname . " " . $name->nachname;
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($ids as $id) {
|
||||
$result = $this->PersonModel->load($id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$name = current($data);
|
||||
$recipients[$id] = $name->vorname . " " . $name->nachname;
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($recipients);
|
||||
}
|
||||
|
||||
public function sendMessage($typeId)
|
||||
{
|
||||
$resultReturn = [];
|
||||
$uid = getAuthUID();
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['uid' => $uid]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$benutzer = current($data);
|
||||
|
||||
if (isset($_POST['data']))
|
||||
{
|
||||
$data = json_decode($_POST['data']);
|
||||
unset($_POST['data']);
|
||||
foreach ($data as $k => $v) {
|
||||
$_POST[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('subject', 'Betreff', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Betreff'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('body', 'Text', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Text'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$subject = $this->input->post('subject');
|
||||
$body = $this->input->post('body');
|
||||
$relationmessage_id = $this->input->post('relationmessage_id');
|
||||
|
||||
if (isset($_POST['ids']))
|
||||
{
|
||||
$ids = json_decode($_POST['ids']);
|
||||
unset($_POST['ids']);
|
||||
foreach ($data as $k => $v) {
|
||||
$_POST[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_array($ids)) {
|
||||
$ids = [$ids];
|
||||
}
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$receiversPersonId = $typeId == "person_id" ? $id : $this->_getPersonId($id, $typeId);
|
||||
|
||||
if($typeId == 'uid')
|
||||
{
|
||||
$prestudent_id = $this-> _getPrestudentIdFromUid($id);
|
||||
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
if($typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $typeId);
|
||||
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
elseif($typeId == 'person_id')
|
||||
{
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result =$this->messagelib->sendMessageUser($receiversPersonId, $subject, $bodyParsed, $benutzer->person_id, null, $relationmessage_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$resultReturn[] = current($data);
|
||||
|
||||
}
|
||||
$this->terminateWithSuccess($resultReturn);
|
||||
}
|
||||
|
||||
public function getPreviewText($type_id)
|
||||
{
|
||||
if (isset($_POST['data']))
|
||||
{
|
||||
$data = json_decode($_POST['data']);
|
||||
unset($_POST['data']);
|
||||
}
|
||||
else
|
||||
$this->terminateWithError($this->p->t('messages', 'errorMissingOrInvalidParameters', ['parameter'=> "Textbody"]), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (isset($_POST['ids']))
|
||||
{
|
||||
$ids = json_decode($_POST['ids']);
|
||||
if(!is_array($ids))
|
||||
{
|
||||
$ids = array($ids);
|
||||
}
|
||||
unset($_POST['ids']);
|
||||
}
|
||||
else
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingOrInvalidParameters', ['parameter'=> 'Id(s)']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$bodyParsed = [];
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
switch($type_id)
|
||||
{
|
||||
case 'uid':
|
||||
$prestudent_id = $this->_getPrestudentIdFromUid($id);
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
break;
|
||||
case 'prestudent_id':
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
break;
|
||||
case 'person_id':
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
break;
|
||||
case 'mitarbeiter_uid':
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $type_id);
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $type_id]), self::ERROR_TYPE_GENERAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($bodyParsed);
|
||||
}
|
||||
|
||||
public function getReplyData($messageId)
|
||||
{
|
||||
if (!is_numeric($messageId)) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value'=> 'Message ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->MessageModel->addSelect('public.tbl_msg_message.*');
|
||||
$this->MessageModel->addSelect('r.*');
|
||||
$this->MessageModel->addSelect('p.nachname');
|
||||
$this->MessageModel->addSelect('p.vorname');
|
||||
$this->MessageModel->addJoin('public.tbl_msg_recipient r', 'ON (r.message_id = public.tbl_msg_message.message_id)');
|
||||
$this->MessageModel->addJoin('public.tbl_person p', 'ON (p.person_id = public.tbl_msg_message.person_id)');
|
||||
|
||||
$result = $this->MessageModel->loadWhere(
|
||||
array('r.message_id' => $messageId)
|
||||
);
|
||||
|
||||
$dataMessage = $this->getDataOrTerminateWithError($result);
|
||||
$prefix = "Re: "; // reply subject prefix
|
||||
|
||||
$subject = $dataMessage[0]->subject;
|
||||
$body = $dataMessage[0]->body;
|
||||
|
||||
|
||||
$replyBody = $this->_getReplyBody($body, $dataMessage[0]->nachname, $dataMessage[0]->vorname, $dataMessage[0]->insertamum);
|
||||
|
||||
$dataMessage[0]->replyBody = $replyBody;
|
||||
$dataMessage[0]->replySubject = $prefix . $subject;
|
||||
|
||||
$this->terminateWithSuccess($dataMessage);
|
||||
}
|
||||
|
||||
public function deleteMessage($messageId)
|
||||
{
|
||||
// Start DB transaction
|
||||
$this->db->trans_begin();
|
||||
|
||||
$result = $this->MessageModel->deleteMessageRecipient($messageId);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
}
|
||||
|
||||
$result = $this->MessageModel->deleteMessageStatus($messageId);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->MessageModel->deleteMessage($messageId);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->db->trans_commit();
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getPersonId($id, $typeId)
|
||||
{
|
||||
if ($typeId == 'uid' || $typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['uid' => $id]
|
||||
);
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
|
||||
$this->terminateWithSuccess($person->person_id);
|
||||
}
|
||||
|
||||
public function getUids($typeId)
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
$benutzerIds = [];
|
||||
|
||||
if (!$typeId)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Type ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
elseif ($typeId == 'person_id')
|
||||
{
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['person_id' => $id]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$benutzer = current($data);
|
||||
|
||||
$benutzerIds[$id] = $benutzer->uid;
|
||||
}
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
$person_id = $person->person_id;
|
||||
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['person_id' => $person_id]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$benutzer = current($data);
|
||||
|
||||
$benutzerIds[$id] = $benutzer->uid;
|
||||
}
|
||||
}
|
||||
elseif($typeId == 'uid' || $typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$this->terminateWithSuccess($ids);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($benutzerIds);
|
||||
}
|
||||
|
||||
private function _getPersonId($id, $typeId)
|
||||
{
|
||||
if ($typeId == 'uid' || $typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['uid' => $id]
|
||||
);
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if (count($data) < 1)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$person = current($data);
|
||||
|
||||
return $person->person_id;
|
||||
}
|
||||
|
||||
private function _getPrestudentIdFromUid($uid)
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->loadWhere(
|
||||
['student_uid' => $uid]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if (count($data) < 1)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$student = current($data);
|
||||
|
||||
return $student->prestudent_id;
|
||||
}
|
||||
|
||||
private function _getReplyBody($body, $receiverName, $receiverSurname, $sentDate)
|
||||
{
|
||||
// To quote a reply body message
|
||||
$bodyFormat = "<br>
|
||||
<br>
|
||||
<blockquote>
|
||||
<i>
|
||||
On %s %s %s wrote:
|
||||
</i>
|
||||
</blockquote>
|
||||
<blockquote style='border-left:2px solid; padding-left: 8px'>
|
||||
%s
|
||||
</blockquote>";
|
||||
return sprintf(
|
||||
$bodyFormat,
|
||||
date_format(date_create($sentDate), 'd.m.Y H:i'), $receiverName, $receiverSurname, $body
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class NotizLehreinheit extends Notiz_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getUid' => ['admin:r', 'assistenz:r'],
|
||||
'getNotizen' => ['admin:r', 'assistenz:r'],
|
||||
'loadNotiz' => ['admin:r', 'assistenz:r'],
|
||||
'addNewNotiz' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateNotiz' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteNotiz' => ['admin:rw', 'assistenz:rw'],
|
||||
'loadDokumente' => ['admin:r', 'assistenz:r'],
|
||||
'getMitarbeiter' => ['admin:r', 'assistenz:r'],
|
||||
'isBerechtigt' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class NotizPerson extends Notiz_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getUid' => ['admin:r', 'assistenz:r'],
|
||||
'getNotizen' => ['admin:r', 'assistenz:r'],
|
||||
'loadNotiz' => ['admin:r', 'assistenz:r'],
|
||||
'addNewNotiz' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateNotiz' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteNotiz' => ['admin:rw', 'assistenz:rw'],
|
||||
'loadDokumente' => ['admin:r', 'assistenz:r'],
|
||||
'getMitarbeiter' => ['admin:r', 'assistenz:r'],
|
||||
'isBerechtigt' => ['admin:r', 'assistenz:r'],
|
||||
'getCountNotes' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
}
|
||||
|
||||
public function isBerechtigt($id, $typeId)
|
||||
{
|
||||
if($typeId != "person_id")
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//TODO define permission
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid'))
|
||||
{
|
||||
$result = $this->p->t('lehre', 'error_keineSchreibrechte');
|
||||
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
public function loadDokumente()
|
||||
{
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
// TODO(chris): make CI variant of endpoint
|
||||
$this->NotizModel->addSelect($this->NotizModel->escape(base_url('content/notizdokdownload.php?id=')) . ' || campus.tbl_dms_version.dms_id AS preview');
|
||||
|
||||
return parent::loadDokumente();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class StudiengangEP extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* StudiengangEP API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'getStudiengangByKz' => self::PERM_LOGGED
|
||||
)
|
||||
);
|
||||
// Load model StudiengangModel
|
||||
$this->load->model('organisation/studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getStudiengangByKz()
|
||||
{
|
||||
$studiengang_kz = intval($this->input->get('studiengang_kz'));
|
||||
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, kurzbz, kurzbzlang, '
|
||||
. 'typ, bezeichnung, english, aktiv, orgform_kurzbz, sprache, '
|
||||
. 'oe_kurzbz');
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$stg = null;
|
||||
if(hasData($result))
|
||||
{
|
||||
$stg = (getData($result))[0];
|
||||
}
|
||||
$this->terminateWithSuccess($stg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studienjahr extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Studienjahr API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'getAll' => self::PERM_LOGGED,
|
||||
'getNext' => self::PERM_LOGGED
|
||||
)
|
||||
);
|
||||
// Load model StudiensemesterModel
|
||||
$this->load->model('organisation/studienjahr_model', 'StudienjahrModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Studienjahre.
|
||||
*
|
||||
* @param null|string $order Sorting order for the Studienjahr, 'asc' or 'desc'. Defaults to 'asc'.
|
||||
* @param null|string $start Starting Studienjahre with given studienjahr_kurzbz
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$order = $this->input->get('order');
|
||||
$start = $this->input->get('studienjahr_kurzbz');
|
||||
|
||||
if (strcasecmp($order, 'DESC') == 0) {
|
||||
$this->StudienjahrModel->addOrder('studienjahr_kurzbz', 'DESC');
|
||||
} else {
|
||||
$this->StudienjahrModel->addOrder('studienjahr_kurzbz', 'ASC');
|
||||
}
|
||||
|
||||
if ($start) {
|
||||
$result = $this->StudienjahrModel->loadWhere([
|
||||
'studienjahr_kurzbz >= ' => $start
|
||||
]);
|
||||
} else {
|
||||
$result = $this->StudienjahrModel->load();
|
||||
}
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getNext()
|
||||
{
|
||||
$this->StudienjahrModel->addJoin('public.tbl_studiensemester', 'studienjahr_kurzbz');
|
||||
$this->StudienjahrModel->addOrder('start');
|
||||
$this->StudienjahrModel->addLimit(1);
|
||||
|
||||
$result = $this->StudienjahrModel->loadWhere(['start >' => 'NOW()']);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studienplan extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct([
|
||||
'getBySemester' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBySemester()
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
$ausbildungssemester = $this->input->get('ausbildungssemester') ?: null;
|
||||
$orgform_kurzbz = $this->input->get('orgform_kurzbz') ?: null;
|
||||
|
||||
if (!$studiengang_kz || !is_numeric($studiengang_kz))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!$studiensemester_kurzbz)
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiensemester']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (isset($ausbildungssemester) && !is_numeric($ausbildungssemester))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Ausbildungssemester']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
//~ $this->load->library('form_validation');
|
||||
|
||||
//~ $this->form_validation->set_rules('studiengang_kz', 'StudiengangKz', 'required|numeric');
|
||||
//~ $this->form_validation->set_rules('studiensemester_kurzbz', 'StudiensemesterKurbz', 'required');
|
||||
//~ $this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'numeric');
|
||||
|
||||
//~ if (!$this->form_validation->run())
|
||||
//~ {
|
||||
//~ $this->addMeta('fail2', 'fail2');
|
||||
//~ return $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
//~ }
|
||||
|
||||
|
||||
$this->addMeta('stg_kz', $studiengang_kz);
|
||||
$this->addMeta('sem', $studiensemester_kurzbz);
|
||||
$this->addMeta('sem2', $ausbildungssemester);
|
||||
$this->addMeta('org', $orgform_kurzbz);
|
||||
|
||||
$result = $this->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester, $orgform_kurzbz);
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studiensemester extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Studiensemester API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'getAll' => self::PERM_LOGGED,
|
||||
'getAktNext' => self::PERM_LOGGED,
|
||||
'getStudienjahrByStudiensemester' => self::PERM_LOGGED
|
||||
)
|
||||
);
|
||||
// Load model StudiensemesterModel
|
||||
$this->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Studiensemester.
|
||||
*
|
||||
* @param null|string $order Sorting order for the Studiensemester, 'asc' or 'desc'. Defaults to 'asc'.
|
||||
* @param null|string $start Start date of the displayed Studiensemester in the format 'YYYY-MM-DD'.
|
||||
* If provided, only Studiensemester starting from this date onwards will be returned.
|
||||
* eg. '2020-09-01' will start with WS2020.
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$order = $this->input->get('order');
|
||||
$start = $this->input->get('start');
|
||||
|
||||
if (strcasecmp($order, 'DESC') == 0)
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('ende', 'DESC');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('ende', 'ASC');
|
||||
}
|
||||
|
||||
if ($start)
|
||||
{
|
||||
$result = $this->StudiensemesterModel->loadWhere([
|
||||
'start >= ' => $start
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
}
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getAktNext()
|
||||
{
|
||||
$semester = $this->input->get('semester');
|
||||
|
||||
$result = null;
|
||||
|
||||
if (!is_numeric($semester))
|
||||
{
|
||||
$result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()', 'ende >=' => 'NOW()'));
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('ende');
|
||||
$this->StudiensemesterModel->addLimit(1);
|
||||
|
||||
$whereArray = array('ende >=' => 'NOW()');
|
||||
|
||||
if (is_numeric($semester))
|
||||
{
|
||||
if ($semester % 2 == 0)
|
||||
{
|
||||
$ss = 'SS';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ss = 'WS';
|
||||
}
|
||||
|
||||
$whereArray['SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) ='] = $ss;
|
||||
}
|
||||
|
||||
$result = $this->StudiensemesterModel->loadWhere($whereArray);
|
||||
}
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Studienjahr by Studiensemester.
|
||||
* input param semester: studiensemester_kurzbz
|
||||
*/
|
||||
public function getStudienjahrByStudiensemester()
|
||||
{
|
||||
$semester = $this->input->get('semester');
|
||||
|
||||
$studienjahrObj = null;
|
||||
|
||||
if (!is_numeric($semester))
|
||||
{
|
||||
$this->StudiensemesterModel->addSelect('studienjahr_kurzbz');
|
||||
$result = $this->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz =' => $semester));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$studienjahr = getData($result)[0]->studienjahr_kurzbz;
|
||||
$startstudienjahr = substr($studienjahr, 0, 4);
|
||||
$endstudienjahr = substr($studienjahr, 0, 2) . substr($studienjahr, -2);
|
||||
|
||||
$studienjahrObj = new StdClass();
|
||||
|
||||
$studienjahrObj->studienjahr_kurzbz = $studienjahr;
|
||||
$studienjahrObj->startstudienjahr = $startstudienjahr;
|
||||
$studienjahrObj->endstudienjahr= $endstudienjahr;
|
||||
}
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData(success($studienjahrObj))));
|
||||
}
|
||||
}
|
||||
@@ -184,4 +184,4 @@ class Abmeldung extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,8 @@ class Leitung extends FHCAPI_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
'studierendenantrag',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,459 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Abschlusspruefung extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAbschlusspruefung' => ['admin:r', 'assistenz:r'],
|
||||
'loadAbschlusspruefung' => ['admin:r', 'assistenz:r'],
|
||||
'insertAbschlusspruefung' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateAbschlusspruefung' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteAbschlusspruefung' => ['admin:rw', 'assistenz:rw'],
|
||||
'getTypenAbschlusspruefung' => ['admin:rw', 'assistenz:rw'],
|
||||
'getNoten' => ['admin:rw', 'assistenz:rw'],
|
||||
'getTypenAntritte' => ['admin:rw', 'assistenz:rw'],
|
||||
'getBeurteilungen' => ['admin:rw', 'assistenz:rw'],
|
||||
'getAkadGrade' => ['admin:rw', 'assistenz:rw'],
|
||||
'getMitarbeiter' => ['admin:rw', 'assistenz:rw'],
|
||||
'getPruefer' => ['admin:rw', 'assistenz:rw'],
|
||||
'getTypStudiengang' => ['admin:rw', 'assistenz:rw'],
|
||||
'checkForExistingExams' => ['admin:rw', 'assistenz:rw'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person',
|
||||
'abschlusspruefung'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Abschlusspruefung_model', 'AbschlusspruefungModel');
|
||||
|
||||
|
||||
//Permission checks for Studiengangsarray
|
||||
$allowedStgs = $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: [];
|
||||
|
||||
if ($this->router->method == 'insertAbschlusspruefung' || $this->router->method == 'updateAbschlusspruefung')
|
||||
{
|
||||
$student_uid = $this->input->post('uid') ?: ($this->input->post('formData')['student_uid'] ?? null);
|
||||
|
||||
if(!$student_uid)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->_checkAllowedStgsFromUid($student_uid, $allowedStgs);
|
||||
}
|
||||
|
||||
if ($this->router->method == 'deleteAbschlusspruefung')
|
||||
{
|
||||
$abschlusspruefung_id = $this->input->post('id');
|
||||
|
||||
if(!$abschlusspruefung_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Abschlusspruefung ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$result = $this->AbschlusspruefungModel->load(
|
||||
array('abschlusspruefung_id' => $abschlusspruefung_id)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$student_uid = current($data)->student_uid;
|
||||
|
||||
$this->_checkAllowedStgsFromUid($student_uid, $allowedStgs);
|
||||
}
|
||||
}
|
||||
|
||||
private function _checkAllowedStgsFromUid($student_uid, $allowedStgs)
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->loadWhere(['student_uid' => $student_uid]);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$studiengang_kz = current($data)->studiengang_kz;
|
||||
|
||||
if (!in_array($studiengang_kz, $allowedStgs))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_keineBerechtigungStg'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
public function getAbschlusspruefung($student_uid)
|
||||
{
|
||||
$result = $this->AbschlusspruefungModel->getAbschlusspruefungForPrestudent($student_uid);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function loadAbschlusspruefung()
|
||||
{
|
||||
$abschlusspruefung_id = $this->input->post('id');
|
||||
|
||||
$this->AbschlusspruefungModel->addSelect(
|
||||
'lehre.tbl_abschlusspruefung.*,
|
||||
p1.person_id AS p1_person_id, p1.vorname AS p1_vorname, p1.nachname AS p1_nachname,
|
||||
p1.titelpre AS p1_titelpre, p1.titelpost AS p1_titelpost,
|
||||
p2.person_id AS p2_person_id, p2.vorname AS p2_vorname, p2.nachname AS p2_nachname,
|
||||
p2.titelpre AS p2_titelpre, p2.titelpost AS p2_titelpost,
|
||||
p3.person_id AS p3_person_id, p3.vorname AS p3_vorname, p3.nachname AS p3_nachname,
|
||||
p3.titelpre AS p3_titelpre, p3.titelpost AS p3_titelpost,
|
||||
pv.person_id AS pv_person_id, pv.vorname AS pv_vorname, pv.nachname AS pv_nachname,
|
||||
pv.titelpre AS pv_titelpre, pv.titelpost AS pv_titelpost, ben.uid AS pv_uid'
|
||||
);
|
||||
//~ $this->AbschlusspruefungModel->addSelect("
|
||||
//~ CASE
|
||||
//~ WHEN pruefer1 IS NOT NULL
|
||||
//~ THEN CONCAT(p1.nachname, ' ', p1.vorname, COALESCE(' ' || p1.titelpre, ''))
|
||||
//~ ELSE NULL
|
||||
//~ END AS p1
|
||||
//~ ");
|
||||
//~ $this->AbschlusspruefungModel->addSelect("
|
||||
//~ CASE
|
||||
//~ WHEN pruefer2 IS NOT NULL
|
||||
//~ THEN CONCAT(p2.nachname, ' ', p2.vorname, COALESCE(' ' || p2.titelpre, ''))
|
||||
//~ ELSE NULL
|
||||
//~ END AS p2
|
||||
//~ ");
|
||||
//~ $this->AbschlusspruefungModel->addSelect("
|
||||
//~ CASE
|
||||
//~ WHEN pruefer3 IS NOT NULL
|
||||
//~ THEN CONCAT(p3.nachname, ' ', p3.vorname, COALESCE(' ' || p3.titelpre, ''))
|
||||
//~ ELSE NULL
|
||||
//~ END AS p3
|
||||
//~ ");
|
||||
//~ $this->AbschlusspruefungModel->addSelect("
|
||||
//~ CASE
|
||||
//~ WHEN vorsitz IS NOT NULL
|
||||
//~ THEN CONCAT(pv.nachname, ' ', pv.vorname, COALESCE(' ' || pv.titelpre, ''), ' (', ben.uid , ')' )
|
||||
//~ ELSE NULL
|
||||
//~ END AS pv
|
||||
//~ ");
|
||||
$this->AbschlusspruefungModel->addJoin('public.tbl_benutzer ben', 'ON (ben.uid = lehre.tbl_abschlusspruefung.vorsitz)', 'LEFT');
|
||||
$this->AbschlusspruefungModel->addJoin('public.tbl_person pv', 'ON (pv.person_id = ben.person_id)', 'LEFT');
|
||||
$this->AbschlusspruefungModel->addJoin('public.tbl_person p1', 'ON (p1.person_id = lehre.tbl_abschlusspruefung.pruefer1)', 'LEFT');
|
||||
$this->AbschlusspruefungModel->addJoin('public.tbl_person p2', 'ON (p2.person_id = lehre.tbl_abschlusspruefung.pruefer2)', 'LEFT');
|
||||
$this->AbschlusspruefungModel->addJoin('public.tbl_person p3', 'ON (p3.person_id = lehre.tbl_abschlusspruefung.pruefer3)', 'LEFT');
|
||||
$result = $this->AbschlusspruefungModel->loadWhere(
|
||||
array('abschlusspruefung_id' => $abschlusspruefung_id)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function getTypenAbschlusspruefung()
|
||||
{
|
||||
$this->load->model('education/Pruefungstyp_model', 'PruefungstypModel');
|
||||
|
||||
$result = $this->PruefungstypModel->loadWhere(
|
||||
array('abschluss' => true)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getTypenAntritte()
|
||||
{
|
||||
$this->load->model('education/Pruefungsantritt_model', 'PruefungsantrittModel');
|
||||
|
||||
$result = $this->PruefungsantrittModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getBeurteilungen()
|
||||
{
|
||||
$this->load->model('education/Abschlussbeurteilung_model', 'AbschlussbeurteilungModel');
|
||||
|
||||
$result = $this->AbschlussbeurteilungModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAkadGrade()
|
||||
{
|
||||
$studiengang_kz= $this->input->post('studiengang_kz');
|
||||
|
||||
|
||||
$this->load->model('education/Akadgrad_model', 'AkadgradModel');
|
||||
|
||||
$result = $this->AkadgradModel->loadWhere(
|
||||
array('studiengang_kz' => $studiengang_kz)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getTypStudiengang()
|
||||
{
|
||||
$studiengang_kz= $this->input->post('studiengang_kz');
|
||||
|
||||
/* if (!$studiengang_kzs || !is_array($studiengang_kzs)) {
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('studiengang_kzs', '', 'required|is_null', [
|
||||
'is_null' => $this->p->t('ui', 'error_fieldMustBeArray')
|
||||
]);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}*/
|
||||
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(
|
||||
array('studiengang_kz' => $studiengang_kz)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$typStudiengang = current($data)->typ;
|
||||
|
||||
$this->terminateWithSuccess($typStudiengang);
|
||||
}
|
||||
|
||||
public function getMitarbeiter()
|
||||
{
|
||||
$searchString = $this->input->get('searchString') ?? '';
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString, 'mitAkadGrad');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
}
|
||||
|
||||
public function getPruefer()
|
||||
{
|
||||
$searchString = $this->input->get('searchString') ?? '';
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString, 'ohneMaUid');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
}
|
||||
|
||||
public function getNoten()
|
||||
{
|
||||
$this->load->model('education/Note_model', 'NoteModel');
|
||||
|
||||
$this->NoteModel->addOrder('note', 'ASC');
|
||||
$result = $this->NoteModel->load();
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function insertAbschlusspruefung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$student_uid = $this->input->post('uid');
|
||||
|
||||
if(!$student_uid)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('pruefungstyp_kurzbz', 'Typ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Typ'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('akadgrad_id', 'AkadGrad', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'AkadGrad'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('datum', 'Datum', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Datum'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('sponsion', 'Sponsion', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Sponsion'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->AbschlusspruefungModel->insert([
|
||||
'student_uid' => $student_uid,
|
||||
'pruefungstyp_kurzbz' => $formData['pruefungstyp_kurzbz'],
|
||||
'akadgrad_id' => $formData['akadgrad_id'],
|
||||
'vorsitz' => $formData['vorsitz'],
|
||||
'pruefungsantritt_kurzbz' => $formData['pruefungsantritt_kurzbz'],
|
||||
'abschlussbeurteilung_kurzbz' => $formData['abschlussbeurteilung_kurzbz'],
|
||||
'datum' => $formData['datum'], //TODO(Manu) check if minute format like FAS
|
||||
'sponsion' => $formData['sponsion'],
|
||||
'pruefer1' => $formData['pruefer1'],
|
||||
'pruefer2' => $formData['pruefer2'],
|
||||
'pruefer3' => $formData['pruefer3'],
|
||||
'protokoll' => $formData['protokoll'],
|
||||
'note' => $formData['note'],
|
||||
'anmerkung' => $formData['anmerkung'],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function updateAbschlusspruefung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$abschlusspruefung_id = $this->input->post('id');
|
||||
|
||||
if(!$abschlusspruefung_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Abschlussprüfung ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$vorsitz = isset($formData['vorsitz']['mitarbeiter_uid']) ? $formData['vorsitz']['mitarbeiter_uid'] : $formData['vorsitz'];
|
||||
$pruefer1 = isset($formData['pruefer1']['person_id']) ? $formData['pruefer1']['person_id'] : $formData['pruefer1'];
|
||||
$pruefer2 = isset($formData['pruefer2']['person_id']) ? $formData['pruefer2']['person_id'] : $formData['pruefer2'];
|
||||
$pruefer3 = isset($formData['pruefer3']['person_id']) ? $formData['pruefer3']['person_id'] : $formData['pruefer3'];
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('pruefungstyp_kurzbz', 'Typ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Typ'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('akadgrad_id', 'AkadGrad', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'AkadGrad'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('datum', 'Datum', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Datum'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('sponsion', 'Sponsion', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Sponsion'])
|
||||
]);
|
||||
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->AbschlusspruefungModel->update(
|
||||
[
|
||||
'abschlusspruefung_id' => $abschlusspruefung_id
|
||||
],
|
||||
[
|
||||
'student_uid' => $formData['student_uid'],
|
||||
'pruefungstyp_kurzbz' => $formData['pruefungstyp_kurzbz'],
|
||||
'akadgrad_id' => $formData['akadgrad_id'],
|
||||
'vorsitz' => $vorsitz,
|
||||
'pruefungsantritt_kurzbz' => $formData['pruefungsantritt_kurzbz'],
|
||||
'abschlussbeurteilung_kurzbz' => $formData['abschlussbeurteilung_kurzbz'],
|
||||
'datum' => $formData['datum'],
|
||||
'sponsion' => $formData['sponsion'],
|
||||
'pruefer1' => $pruefer1,
|
||||
'pruefer2' => $pruefer2,
|
||||
'pruefer3' => $pruefer3,
|
||||
'protokoll' => $formData['protokoll'],
|
||||
'note' => $formData['note'],
|
||||
'anmerkung' => $formData['anmerkung'],
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteAbschlusspruefung()
|
||||
{
|
||||
$abschlusspruefung_id = $this->input->post('id');
|
||||
|
||||
$result = $this->AbschlusspruefungModel->delete(
|
||||
array('abschlusspruefung_id' => $abschlusspruefung_id)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->outputJson($result);
|
||||
}
|
||||
return $this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
public function checkForExistingExams()
|
||||
{
|
||||
$warning = false;
|
||||
$output = [];
|
||||
|
||||
$student_uids = $this->input->post('uids');
|
||||
|
||||
if (empty($student_uids)) {
|
||||
throw new InvalidArgumentException("Keine UID(s) übergeben.");
|
||||
}
|
||||
|
||||
if( !is_array($student_uids) )
|
||||
{
|
||||
$student_uids = array($student_uids);
|
||||
}
|
||||
|
||||
foreach ($student_uids as $uid)
|
||||
{
|
||||
$result = $this->AbschlusspruefungModel->loadWhere(
|
||||
array('student_uid' => $uid)
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
$warning = true;
|
||||
$output[] = $uid;
|
||||
}
|
||||
}
|
||||
if($warning)
|
||||
{
|
||||
$uids = is_array($output) ? implode(", ", $output) : $output;
|
||||
return $this->terminateWithError($this->p->t('abschlusspruefung', 'error_studentOhneFinalExam', ['id'=> $uids]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess('step3');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about addresses
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Address extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getNations' => self::PERM_LOGGED,
|
||||
'getPlaces' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getNations()
|
||||
{
|
||||
$this->load->model('codex/Nation_model', 'NationModel');
|
||||
|
||||
$this->NationModel->addOrder('kurztext');
|
||||
|
||||
$result = $this->NationModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getPlaces($plz = null)
|
||||
{
|
||||
$this->load->model('codex/Gemeinde_model', 'GemeindeModel');
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_data(['address.plz' => $plz]);
|
||||
|
||||
$this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric|less_than[10000]', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']),
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ']),
|
||||
'less_than' => $this->p->t('ui', 'error_fieldLessThan10000', ['field' => 'PLZ'])
|
||||
]);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->GemeindeModel->getGemeindeByPlz($plz);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Controller for downloading Akte
|
||||
*/
|
||||
class Akte extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Calls the parent's constructor and prepares libraries and phrases
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'download' => ['admin:w', 'assistenz:w'],
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
*
|
||||
* Downloads an Akte
|
||||
*/
|
||||
public function download()
|
||||
{
|
||||
$akte_id = $this->input->get('akte_id');
|
||||
|
||||
if (!is_numeric($akte_id)) $this->terminateWithError('akte Id missing');
|
||||
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithError('Akte not found');
|
||||
|
||||
$data = getData($result)[0];
|
||||
|
||||
if (isset($data->inhalt) && $data->inhalt != '')
|
||||
{
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: '. $data->mimetype);
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Disposition: attachment; filename="'.$data->titel.'"');
|
||||
echo base64_decode($data->inhalt);
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Anrechnungen extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAnrechnungen' => ['admin:r', 'assistenz:r'],
|
||||
'deleteAnrechnung' => ['admin:rw', 'assistenz:rw'],
|
||||
'getLehrveranstaltungen' => ['admin:r', 'assistenz:r'],
|
||||
'getBegruendungen' => ['admin:r', 'assistenz:r'],
|
||||
'getLektoren' => ['admin:r', 'assistenz:r'],
|
||||
'getLvsKompatibel' => ['admin:r', 'assistenz:r'],
|
||||
'insertAnrechnung' => ['admin:rw', 'assistenz:rw'],
|
||||
'loadAnrechnung' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateAnrechnung' => ['admin:rw', 'assistenz:rw'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui', 'lehre'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungsModel');
|
||||
}
|
||||
|
||||
public function getAnrechnungen($prestudent_id)
|
||||
{
|
||||
$result = $this->AnrechnungsModel->getAnrechnungsData($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getBegruendungen()
|
||||
{
|
||||
$this->load->model('education/Anrechnungbegruendung_model', 'AnrechnungbegrueundungsModel');
|
||||
|
||||
$result = $this->AnrechnungbegrueundungsModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function getLehrveranstaltungen($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$studienplan_id = current($data)->studienplan_id;
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudienplanId($studienplan_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLvsKompatibel($lehrveranstaltung_id)
|
||||
{
|
||||
$this->AnrechnungsModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'ON (lv.lehrveranstaltung_id = lehre.tbl_anrechnung.lehrveranstaltung_id)');
|
||||
$result = $this->AnrechnungsModel->loadWhere(
|
||||
['lehrveranstaltung_id_kompatibel' => $lehrveranstaltung_id]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLektoren($studiengang_kz)
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->getLektoren($studiengang_kz);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function insertAnrechnung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
|
||||
if(!$prestudent_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$_POST['lehrveranstaltung_id'] =
|
||||
(isset($formData['lehrveranstaltung_id']) && !empty($formData['lehrveranstaltung_id']))
|
||||
? $formData['lehrveranstaltung_id']
|
||||
: null;
|
||||
$_POST['lehrveranstaltung_id_kompatibel'] =
|
||||
(isset($formData['lehrveranstaltung_id_kompatibel']) && !empty($formData['lehrveranstaltung_id_kompatibel']))
|
||||
? $formData['lehrveranstaltung_id_kompatibel']
|
||||
: null;
|
||||
$_POST['begruendung'] =
|
||||
(isset($formData['begruendung_id']) && !empty($formData['begruendung_id']))
|
||||
? $formData['begruendung_id']
|
||||
: null;
|
||||
$_POST['genehmigtVon'] = (isset($formData['genehmigt_von']) && !empty($formData['genehmigt_von']))
|
||||
? $formData['genehmigt_von']
|
||||
: null;
|
||||
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id', 'Lehrveranstaltung_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehrveranstaltung'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('begruendung', 'Begruendung', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Begruendung'])
|
||||
]);
|
||||
|
||||
if($_POST['begruendung'] == 2)
|
||||
{
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id_kompatibel', 'Lehrveranstaltung_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehrveranstaltung Kompatibel'])
|
||||
]);
|
||||
}
|
||||
|
||||
$this->form_validation->set_rules('genehmigtVon', 'GenehmigtVon', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'GenehmigtVon'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->AnrechnungsModel->insert(
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'lehrveranstaltung_id' => $_POST['lehrveranstaltung_id'],
|
||||
'lehrveranstaltung_id_kompatibel' => $_POST['lehrveranstaltung_id_kompatibel'],
|
||||
'begruendung_id' => $_POST['begruendung'],
|
||||
'genehmigt_von' => $_POST['genehmigtVon']
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadAnrechnung($anrechnung_id)
|
||||
{
|
||||
$this->AnrechnungsModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'ON (lv.lehrveranstaltung_id = lehre.tbl_anrechnung.lehrveranstaltung_id)');
|
||||
$result = $this->AnrechnungsModel->loadWhere(
|
||||
array('anrechnung_id' => $anrechnung_id)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function updateAnrechnung()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$anrechnung_id = $this->input->post('anrechnung_id');
|
||||
|
||||
if(!$anrechnung_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Anrechnung UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$_POST['lehrveranstaltung_id'] =
|
||||
(isset($formData['lehrveranstaltung_id']) && !empty($formData['lehrveranstaltung_id']))
|
||||
? $formData['lehrveranstaltung_id']
|
||||
: null;
|
||||
$_POST['lehrveranstaltung_id_kompatibel'] =
|
||||
(isset($formData['lehrveranstaltung_id_kompatibel']) && !empty($formData['lehrveranstaltung_id_kompatibel']))
|
||||
? $formData['lehrveranstaltung_id_kompatibel']
|
||||
: null;
|
||||
$_POST['begruendung'] = (isset($formData['begruendung_id']) && !empty($formData['begruendung_id'])) ? $formData['begruendung_id'] : null;
|
||||
$_POST['genehmigtVon'] = (isset($formData['genehmigt_von']) && !empty($formData['genehmigt_von'])) ? $formData['genehmigt_von'] : null;
|
||||
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id', 'Lehrveranstaltung_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehrveranstaltung'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('begruendung', 'Begruendung', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Begruendung'])
|
||||
]);
|
||||
|
||||
if($_POST['begruendung'] == 2)
|
||||
{
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id_kompatibel', 'Lehrveranstaltung_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehrveranstaltung Kompatibel'])
|
||||
]);
|
||||
}
|
||||
|
||||
$this->form_validation->set_rules('genehmigtVon', 'GenehmigtVon', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'GenehmigtVon'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->AnrechnungsModel->update(
|
||||
[
|
||||
'anrechnung_id' => $anrechnung_id,
|
||||
],
|
||||
[
|
||||
|
||||
'lehrveranstaltung_id' => $_POST['lehrveranstaltung_id'],
|
||||
'lehrveranstaltung_id_kompatibel' => $_POST['lehrveranstaltung_id_kompatibel'],
|
||||
'begruendung_id' => $_POST['begruendung'],
|
||||
'genehmigt_von' => $_POST['genehmigtVon']
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteAnrechnung($anrechnung_id)
|
||||
{
|
||||
// Start DB transaction
|
||||
$this->db->trans_begin();
|
||||
|
||||
//delete anrechnung_id of table tbl_anrechnung_anrechnungstatus
|
||||
$this->load->model('education/Anrechnunganrechnungstatus_model','AnrechnungAnrechnungstatusModel');
|
||||
$result = $this->AnrechnungAnrechnungstatusModel->delete(
|
||||
array('anrechnung_id' => $anrechnung_id)
|
||||
);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
//delete anrechnung_id of table tbl_anrechnung
|
||||
$result = $this->AnrechnungsModel->delete(
|
||||
array('anrechnung_id' => $anrechnung_id)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->db->trans_commit();
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about archive documents
|
||||
* Listens to ajax post calls to change the archive documents
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Archiv extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Calls the parent's constructor and prepares libraries and phrases
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getArchiv' => ['admin:r', 'assistenz:r'],
|
||||
'getArchivVorlagen' => ['admin:r', 'assistenz:r'],
|
||||
'archive' => ['admin:w', 'assistenz:w'],
|
||||
'download' => ['admin:w', 'assistenz:w'],
|
||||
'update' => ['admin:w'],
|
||||
'delete' => ['admin:w', 'assistenz:w'],
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'archiv'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Get archive documents for a person
|
||||
|
||||
* @return void
|
||||
*/
|
||||
public function getArchiv()
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
if (!$person_id || !is_array($person_id))
|
||||
{
|
||||
$this->form_validation->set_rules('person_id', 'Person ID', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->AkteModel->getArchiv($person_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Vorlagen for archiving documents
|
||||
* @return void
|
||||
*/
|
||||
public function getArchivVorlagen()
|
||||
{
|
||||
$result = $this->VorlageModel->getArchivVorlagen();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
*/
|
||||
public function download()
|
||||
{
|
||||
$akte_id = $this->input->get('akte_id');
|
||||
|
||||
if (!is_numeric($akte_id)) $this->terminateWithError('akte Id missing');
|
||||
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithError('Akte not found');
|
||||
|
||||
$data = getData($result)[0];
|
||||
|
||||
$fileObj = new stdClass();
|
||||
if (isset($data->inhalt) && $data->inhalt != '')
|
||||
{
|
||||
// Define handle to output stream
|
||||
$tmpFilePointer = fopen("php://output", 'w');
|
||||
$meta_data = stream_get_meta_data($tmpFilePointer);
|
||||
$filename = $meta_data["uri"];
|
||||
fwrite($tmpFilePointer, $data->inhalt);
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: '. $data->mimetype);
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
//header('Content-Length: ' . filesize($fileObj->file));
|
||||
//header("Content-type: $data->mimetype");
|
||||
header('Content-Disposition: attachment; filename="'.$data->titel.'"');
|
||||
readfile($filename);
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->library('AkteLib');
|
||||
|
||||
$result = $this->aktelib->get($akte_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updating an Akte
|
||||
* @return void
|
||||
*/
|
||||
public function update()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('akte_id', 'Akte Id', 'required');
|
||||
$this->form_validation->set_rules('signiert', 'Signiert', 'is_bool');
|
||||
$this->form_validation->set_rules('stud_selfservice', 'Self-Service', 'is_bool');
|
||||
|
||||
//Events::trigger('konto_update_validation', $this->form_validation);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$id = $this->input->post('akte_id');
|
||||
|
||||
// get the akte
|
||||
$result = $this->AkteModel->load($id);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithError("Akte not found!");
|
||||
|
||||
$akte = getData($result)[0];
|
||||
|
||||
$allowed = [
|
||||
'signiert',
|
||||
'stud_selfservice'
|
||||
];
|
||||
|
||||
$data = [
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
];
|
||||
|
||||
// if Akte has Inhalt directly in Akte table
|
||||
if (isset($_FILES['datei']['tmp_name']))
|
||||
{
|
||||
$this->addMeta('read', "read");
|
||||
// update inhalt directly
|
||||
|
||||
// get tmp file
|
||||
$filename = $_FILES['datei']['tmp_name'];
|
||||
// open it
|
||||
$fp = fopen($filename,'r');
|
||||
// read it
|
||||
$content = fread($fp, filesize($filename));
|
||||
fclose($fp);
|
||||
// encode it
|
||||
$data['inhalt'] = base64_encode($content);
|
||||
$this->addMeta('content', base64_encode($content));
|
||||
}
|
||||
|
||||
|
||||
foreach ($allowed as $field)
|
||||
if ($this->input->post($field) !== null)
|
||||
$data[$field] = $this->input->post($field);
|
||||
|
||||
$this->addMeta("data", $data);
|
||||
|
||||
$result = $this->AkteModel->update($id, $data);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = null;
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete archived Akte
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('akte_id', 'Akte ID', 'required');
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'has_permissions_for_stg[admin:rw,assistenz:rw]');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$akte_id = $this->input->post('akte_id');
|
||||
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('archiv', 'error_missing', [
|
||||
'akte_id' => $akte_id
|
||||
]));
|
||||
}
|
||||
|
||||
$result = getData($result)[0];
|
||||
|
||||
if ($result->dokument_kurzbz == 'Ausbvert'
|
||||
&& isset($result->akzeptiertamum)
|
||||
&& !isEmptyString($result->akzeptiertamum)
|
||||
&& !has_permissions_for_stg($this->input->post('studiengang_kz'), 'admin:rw')
|
||||
)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('archiv', 'nur_admins_loschen_ausbildungsvertraege', [
|
||||
'akte_id' => $akte_id
|
||||
]));
|
||||
}
|
||||
|
||||
$result = $this->AkteModel->delete($akte_id);
|
||||
if (isError($result)) $this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,413 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Aufnahmetermine extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAufnahmetermine' => ['admin:r', 'assistenz:r'],
|
||||
'loadAufnahmetermin' => ['admin:r', 'assistenz:r'],
|
||||
'insertAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
|
||||
'getListPlacementTests' => ['admin:r', 'assistenz:r'],
|
||||
'getListStudyPlans' => ['admin:r', 'assistenz:r'],
|
||||
'loadDataRtPrestudent' => ['admin:r', 'assistenz:r'],
|
||||
'insertOrUpdateDataRtPrestudent' => ['admin:r', 'assistenz:r'],
|
||||
'loadAufnahmegruppen' => ['admin:r', 'assistenz:r'],
|
||||
'getResultReihungstest' => ['admin:r', 'assistenz:r'],
|
||||
'getZukuenftigeReihungstestStg' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'admission'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
||||
$this->load->model('crm/RtPerson_model', 'RtPersonModel');
|
||||
}
|
||||
|
||||
public function getAufnahmetermine($person_id)
|
||||
{
|
||||
$result = $this->ReihungstestModel->getReihungstestPerson($person_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function insertAufnahmetermin()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
if(!$person_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$rt_id = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null;
|
||||
$anmeldedatum = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null;
|
||||
$teilgenommen = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false;
|
||||
$studienplan_id = (isset($formData['studienplan_id']) && !empty($formData['studienplan_id'])) ? $formData['studienplan_id'] : null;
|
||||
$punkte = (isset($formData['punkte']) && !empty($formData['punkte'])) ? $formData['punkte'] : null;
|
||||
|
||||
//validation if there is already an RT with chosen data existing
|
||||
$result = $this->RtPersonModel->loadWhere(
|
||||
array(
|
||||
'rt_id' => $rt_id,
|
||||
'person_id' => $person_id,
|
||||
'studienplan_id' => $studienplan_id,
|
||||
)
|
||||
);
|
||||
$data = getData($result);
|
||||
if($data)
|
||||
return $this->terminateWithError("Error", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('punkte', 'Punkte', 'numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Punkte'])
|
||||
]);
|
||||
$this->form_validation->set_rules('studienplan_id', 'studienplan_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studienplan'])
|
||||
]);
|
||||
$this->form_validation->set_rules('rt_id', 'Reihungstest_id', 'required', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Reihungstest'])
|
||||
]);
|
||||
$this->form_validation->set_rules('anmeldedatum', 'AnmeldeDatum', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Anmeldedatum'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->RtPersonModel->insert([
|
||||
'person_id' => $person_id,
|
||||
'rt_id' => $rt_id,
|
||||
'anmeldedatum' => $anmeldedatum,
|
||||
'teilgenommen' => $teilgenommen,
|
||||
'studienplan_id' => $studienplan_id,
|
||||
'punkte' => $punkte,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID,
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadAufnahmetermin($rt_person_id)
|
||||
{
|
||||
$result = $this->RtPersonModel->loadWhere(
|
||||
array('rt_person_id' => $rt_person_id)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function updateAufnahmetermin()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$rt_person_id = $this->input->post('rt_person_id');
|
||||
$person_id = (isset($formData['person_id']) && !empty($formData['person_id'])) ? $formData['person_id'] : null;
|
||||
|
||||
|
||||
if(!$person_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(!$rt_person_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'RT_Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$rt_id = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null;
|
||||
$anmeldedatum = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null;
|
||||
$teilgenommen = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false;
|
||||
$studienplan_id = (isset($formData['studienplan_id']) && !empty($formData['studienplan_id'])) ? $formData['studienplan_id'] : null;
|
||||
$punkte = (isset($formData['punkte']) && !empty($formData['punkte'])) ? $formData['punkte'] : null;
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('punkte', 'Punkte', 'numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Punkte'])
|
||||
]);
|
||||
$this->form_validation->set_rules('studienplan_id', 'studienplan_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studienplan'])
|
||||
]);
|
||||
$this->form_validation->set_rules('rt_id', 'Reihungstest_id', 'required', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Reihungstest'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('anmeldedatum', 'AnmeldeDatum', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Anmeldedatum'])
|
||||
]);
|
||||
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->RtPersonModel->update(
|
||||
[
|
||||
'rt_person_id' => $rt_person_id,
|
||||
],
|
||||
[
|
||||
'rt_id' => $rt_id,
|
||||
'anmeldedatum' => $anmeldedatum,
|
||||
'teilgenommen' => $teilgenommen,
|
||||
'studienplan_id' => $studienplan_id,
|
||||
'punkte' => $punkte,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID,
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteAufnahmetermin($rt_person_id)
|
||||
{
|
||||
$result = $this->RtPersonModel->delete(
|
||||
array('rt_person_id' => $rt_person_id)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getListPlacementTests($prestudent_id)
|
||||
{
|
||||
if(!$prestudent_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//get studienplan array
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$this->PrestudentstatusModel->addSelect('*');
|
||||
$this->PrestudentstatusModel->addSelect('sp.studienplan_id');
|
||||
|
||||
$this->PrestudentstatusModel->addJoin('lehre.tbl_studienplan sp', 'studienplan_id', 'LEFT');
|
||||
|
||||
$result = $this->PrestudentstatusModel->loadWhere(
|
||||
array(
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => 'Interessent'
|
||||
)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$studienplan_arr = [];
|
||||
$include_ids = [];
|
||||
foreach ($data as $item)
|
||||
{
|
||||
if($item->studienplan_id != null)
|
||||
$studienplan_arr[] = $item->studienplan_id;
|
||||
}
|
||||
|
||||
//get Placementtests Person
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
$resultRt = $this->ReihungstestModel->getReihungstestPerson($person_id);
|
||||
|
||||
$dataRt = $this->getDataOrTerminateWithError($resultRt);
|
||||
|
||||
foreach ($dataRt as $item)
|
||||
{
|
||||
if(!in_array($item->studienplan_id, $studienplan_arr))
|
||||
$studienplan_arr[] = $item->studienplan_id;
|
||||
if(!in_array($item->rt_id, $include_ids) && ($item->rt_id != null))
|
||||
$include_ids[] = $item->rt_id;
|
||||
}
|
||||
|
||||
$result = $this->ReihungstestModel->getReihungstestByStudyPlanAndIds($studienplan_arr, $include_ids);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getListStudyPlans($person_id)
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$result = $this->StudienplanModel->getStudienplaeneForPerson($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadDataRtPrestudent($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->PrestudentModel->addSelect(["reihungstestangetreten"]);
|
||||
$this->PrestudentModel->addSelect(["rt_gesamtpunkte"]);
|
||||
$this->PrestudentModel->addSelect(["aufnahmegruppe_kurzbz"]);
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
array('prestudent_id' => $prestudent_id)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function insertOrUpdateDataRtPrestudent()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
|
||||
if(!$prestudent_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$rt_gesamtpunkte =
|
||||
(isset($formData['rt_gesamtpunkte']) && !empty($formData['rt_gesamtpunkte']))
|
||||
? $formData['rt_gesamtpunkte']
|
||||
: null;
|
||||
$reihungstestangetreten =
|
||||
(isset($formData['reihungstestangetreten']) && !empty($formData['reihungstestangetreten']))
|
||||
? $formData['reihungstestangetreten']
|
||||
: false;
|
||||
$aufnahmegruppe_kurzbz =
|
||||
(isset($formData['aufnahmegruppe_kurzbz']) && !empty($formData['aufnahmegruppe_kurzbz']))
|
||||
? $formData['aufnahmegruppe_kurzbz']
|
||||
: null;
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('rt_gesamtpunkte', 'Rt_gesamtpunkte', 'numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Rt_gesamtpunkte'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$result = $this->PrestudentModel->update(
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
],
|
||||
[
|
||||
'reihungstestangetreten' => $reihungstestangetreten,
|
||||
'rt_gesamtpunkte' => $rt_gesamtpunkte,
|
||||
'aufnahmegruppe_kurzbz' => $aufnahmegruppe_kurzbz,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $authUID,
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadAufnahmegruppen()
|
||||
{
|
||||
$uid = $this->input->get('uid');
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
|
||||
$this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
|
||||
|
||||
$result = $this->BenutzergruppeModel->loadAufnahmegruppen($uid, $studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(($data));
|
||||
}
|
||||
|
||||
public function getResultReihungstest()
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
$punkte = $this->input->get('punkte');
|
||||
$reihungstest_id = $this->input->get('reihungstest_id');
|
||||
|
||||
if(!$reihungstest_id)
|
||||
{
|
||||
$this->terminateWithSuccess(null);
|
||||
}
|
||||
|
||||
//for gewichtung
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
|
||||
$this->load->model('testtool/Ablauf_model', 'AblaufModel');
|
||||
$result = $this->AblaufModel->getAblaufGebieteAndGewichte($studiengang_kz);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$weightedArray = [];
|
||||
foreach ($data as $abl)
|
||||
{
|
||||
$weightedArray[$abl->gebiet_id] = $abl->gewicht;
|
||||
}
|
||||
|
||||
$result = $this->ReihungstestModel->getReihungstestErgebnisPerson($person_id, $punkte, $reihungstest_id, $weightedArray);
|
||||
|
||||
/* if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}*/
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getZukuenftigeReihungstestStg()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
if(!$studiengang_kz)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->ReihungstestModel->getZukuenftigeReihungstestStg($studiengang_kz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
private function _getPersonId($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $prestudent_id]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
|
||||
return $person->person_id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,834 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the StV Config
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Config extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): permissions
|
||||
parent::__construct([
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'set' => ['admin:r', 'assistenz:r'],
|
||||
'filter' => ['admin:r', 'assistenz:r'],
|
||||
'student' => ['admin:r', 'assistenz:r'],
|
||||
'students' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'person',
|
||||
'lehre',
|
||||
'stv',
|
||||
'konto',
|
||||
'abschlusspruefung',
|
||||
'projektarbeit'
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('stv');
|
||||
}
|
||||
|
||||
/**
|
||||
* get App config
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
$this->load->config('stv');
|
||||
|
||||
$config = [];
|
||||
|
||||
#number_displayed_past_studiensemester
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['number_displayed_past_studiensemester']);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$number_displayed_past_studiensemester_default = $this->config->item('number_displayed_past_studiensemester_default');
|
||||
|
||||
$config['number_displayed_past_studiensemester'] = [
|
||||
"type" => "number",
|
||||
"label" => $this->p->t('stv', 'settings_no_displayed_past_sem'),
|
||||
"value" => $data['number_displayed_past_studiensemester']
|
||||
?? $number_displayed_past_studiensemester_default
|
||||
];
|
||||
|
||||
#font_size
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['stv_font_size']);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$config['font_size'] = [
|
||||
"type" => "select",
|
||||
"label" => $this->p->t('stv', 'settings_fontsize'),
|
||||
"value" => $data['stv_font_size'] ?? "fs_normal",
|
||||
"options" => [
|
||||
"fs_xx-small" => $this->p->t('stv', 'settings_fontsize_xx-small'),
|
||||
"fs_x-small" => $this->p->t('stv', 'settings_fontsize_x-small'),
|
||||
"fs_small" => $this->p->t('stv', 'settings_fontsize_small'),
|
||||
"fs_normal" => $this->p->t('stv', 'settings_fontsize_normal'),
|
||||
"fs_big" => $this->p->t('stv', 'settings_fontsize_big'),
|
||||
"fs_huge" => $this->p->t('stv', 'settings_fontsize_huge')
|
||||
]
|
||||
];
|
||||
|
||||
#others
|
||||
Events::trigger('stv_config_get', function & () use (&$config) {
|
||||
return $config;
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* set App config
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'number_displayed_past_studiensemester',
|
||||
$this->p->t('stv', 'settings_no_displayed_past_sem'),
|
||||
'required|integer'
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'font_size',
|
||||
$this->p->t('stv', 'settings_fontsize'),
|
||||
'required|in_list[fs_xx-small,fs_x-small,fs_small,fs_normal,fs_big,fs_huge]'
|
||||
);
|
||||
|
||||
Events::trigger('stv_config_validation', $this->form_validation);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$this->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'number_displayed_past_studiensemester',
|
||||
$this->input->post('number_displayed_past_studiensemester')
|
||||
);
|
||||
$this->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'stv_font_size',
|
||||
$this->input->post('font_size')
|
||||
);
|
||||
|
||||
Events::trigger('stv_config_set', $this->input);
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the config for the student filters
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function filter()
|
||||
{
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
$this->load->model('crm/Buchungstyp_model', 'BuchungstypModel');
|
||||
|
||||
$this->BuchungstypModel->addOrder('beschreibung');
|
||||
|
||||
$result = $this->BuchungstypModel->load();
|
||||
|
||||
$buchungstyp_kurzbz = $this->getDataOrTerminateWithError($result);
|
||||
$buchungstyp_kurzbz_plus_all = array_merge([[
|
||||
'buchungstyp_kurzbz' => 'all',
|
||||
'beschreibung' => $this->p->t('stv', 'konto_all_types')
|
||||
]], $buchungstyp_kurzbz);
|
||||
|
||||
$this->load->model('crm/Statusgrund_model', 'StatusgrundModel');
|
||||
|
||||
$result = $this->StatusgrundModel->getAktiveGruende();
|
||||
|
||||
$statusgruende = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = [];
|
||||
|
||||
$result[] = [
|
||||
'id' => 'filter_konto_count_0',
|
||||
'label' => $this->p->t('stv', 'filter_konto_count_0'),
|
||||
'type' => 'konto',
|
||||
'fixed' => [
|
||||
'missing' => true,
|
||||
'usestdsem' => true
|
||||
],
|
||||
'dynamic' => [
|
||||
'buchungstyp_kurzbz' => [
|
||||
'type' => 'select',
|
||||
'values' => $buchungstyp_kurzbz,
|
||||
'value_key' => 'buchungstyp_kurzbz',
|
||||
'label_key' => 'beschreibung'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_konto_missing_counter',
|
||||
'label' => $this->p->t('stv', 'filter_konto_missing_counter'),
|
||||
'type' => 'konto_counter',
|
||||
'dynamic' => [
|
||||
'buchungstyp_kurzbz' => [
|
||||
'type' => 'select',
|
||||
'values' => $buchungstyp_kurzbz_plus_all,
|
||||
'value_key' => 'buchungstyp_kurzbz',
|
||||
'label_key' => 'beschreibung'
|
||||
],
|
||||
'samestg' => [
|
||||
'type' => 'bool',
|
||||
'label' => $this->p->t('stv', 'filter_konto_samestg'),
|
||||
'default' => $this->variablelib->getVar('kontofilterstg') == 'true'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_documents',
|
||||
'label' => $this->p->t('stv', 'filter_documents'),
|
||||
'type' => 'documents'
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_konto_missing_counter_past',
|
||||
'label' => $this->p->t('stv', 'filter_konto_missing_counter_past'),
|
||||
'type' => 'konto_counter',
|
||||
'fixed' => [
|
||||
'past' => true
|
||||
],
|
||||
'dynamic' => [
|
||||
'buchungstyp_kurzbz' => [
|
||||
'type' => 'select',
|
||||
'values' => $buchungstyp_kurzbz_plus_all,
|
||||
'value_key' => 'buchungstyp_kurzbz',
|
||||
'label_key' => 'beschreibung'
|
||||
],
|
||||
'samestg' => [
|
||||
'type' => 'bool',
|
||||
'label' => $this->p->t('stv', 'filter_konto_samestg'),
|
||||
'default' => $this->variablelib->getVar('kontofilterstg') == 'true'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_konto_missing_studiengebuehr',
|
||||
'label' => $this->p->t('stv', 'filter_konto_missing_studiengebuehr'),
|
||||
'type' => 'konto',
|
||||
'fixed' => [
|
||||
'missing' => true,
|
||||
'usestdsem' => true
|
||||
],
|
||||
'dynamic' => [
|
||||
'buchungstyp_kurzbz' => [
|
||||
'type' => 'select',
|
||||
'values' => $buchungstyp_kurzbz,
|
||||
'value_key' => 'buchungstyp_kurzbz',
|
||||
'label_key' => 'beschreibung'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_konto_studiengebuehrerhoeht',
|
||||
'label' => $this->p->t('stv', 'filter_konto_studiengebuehrerhoeht'),
|
||||
'type' => 'konto',
|
||||
'fixed' => [
|
||||
'usestdsem' => true
|
||||
],
|
||||
'dynamic' => [
|
||||
'buchungstyp_kurzbz' => [
|
||||
'type' => 'select',
|
||||
'values' => $buchungstyp_kurzbz,
|
||||
'value_key' => 'buchungstyp_kurzbz',
|
||||
'label_key' => 'beschreibung'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_zgv_without_date',
|
||||
'label' => $this->p->t('stv', 'filter_zgv_without_date'),
|
||||
'type' => 'zgv'
|
||||
];
|
||||
$result[] = [
|
||||
'id' => 'filter_statusgrund',
|
||||
'label' => $this->p->t('stv', 'filter_statusgrund'),
|
||||
'type' => 'statusgrund',
|
||||
'fixed' => [
|
||||
'usestdsem' => true
|
||||
],
|
||||
'dynamic' => [
|
||||
'statusgrund_id' => [
|
||||
'type' => 'select',
|
||||
'values' => $statusgruende,
|
||||
'value_key' => 'statusgrund_id',
|
||||
'label_key' => 'bezeichnung'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
Events::trigger('stv_conf_filter', function & () use (&$result) {
|
||||
return $result;
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function student()
|
||||
{
|
||||
$result = [];
|
||||
$config = $this->config->item('tabs');
|
||||
|
||||
$result['details'] = [
|
||||
'title' => $this->p->t('stv', 'tab_details'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Details.js'),
|
||||
'config' => $config['details']
|
||||
];
|
||||
|
||||
$result['notes'] = [
|
||||
'title' => $this->p->t('stv', 'tab_notes'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Notizen.js'),
|
||||
'config' => $config['notes'],
|
||||
'showSuffix' => ($config['notes']['showCountNotes'] ?? false),
|
||||
'suffixhelper' => absoluteJsImportUrl('public/js/helpers/Stv/Studentenverwaltung/Details/Notizen/NotizenSuffixHelper.js')
|
||||
];
|
||||
|
||||
$result['contact'] = [
|
||||
'title' => $this->p->t('stv', 'tab_contact'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Kontakt.js'),
|
||||
'config' => [
|
||||
'showBankaccount' => $this->permissionlib->isBerechtigt('mitarbeiter/bankdaten')
|
||||
|| $this->permissionlib->isBerechtigt('student/bankdaten')
|
||||
]
|
||||
];
|
||||
$result['prestudent'] = [
|
||||
'title' => $this->p->t('stv', 'tab_prestudent'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js'),
|
||||
'config' => $config['prestudent']
|
||||
];
|
||||
$result['status'] = [
|
||||
'title' => 'Status',
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js'),
|
||||
'config' => [
|
||||
'showStatusVorruecken' => defined('STATUS_VORRUECKEN_ANZEIGEN') ? STATUS_VORRUECKEN_ANZEIGEN : true,
|
||||
]
|
||||
];
|
||||
$result['documents'] = [
|
||||
'title' => $this->p->t('stv', 'tab_documents'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Dokumente.js')
|
||||
];
|
||||
$result['banking'] = [
|
||||
'title' => $this->p->t('stv', 'tab_banking'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Konto.js'),
|
||||
'config' => [
|
||||
'showZahlungsbestaetigung' => (defined('ZAHLUNGSBESTAETIGUNG_ANZEIGEN') && ZAHLUNGSBESTAETIGUNG_ANZEIGEN),
|
||||
'showBuchungsnr' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'showMahnspanne' => (!defined('FAS_KONTO_SHOW_MAHNSPANNE') || FAS_KONTO_SHOW_MAHNSPANNE===true),
|
||||
'showCreditpoints' => (defined('FAS_KONTO_SHOW_CREDIT_POINTS') && FAS_KONTO_SHOW_CREDIT_POINTS == 'true'),
|
||||
'columns' => $this->kontoColumns(),
|
||||
'additionalCols' => []
|
||||
]
|
||||
];
|
||||
$result['resources'] = [
|
||||
'title' => $this->p->t('stv', 'tab_resources'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Betriebsmittel.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
$result['groups'] = [
|
||||
'title' => $this->p->t('stv', 'tab_groups'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Groups.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
$result['messages'] = [
|
||||
'title' => $this->p->t('stv', 'tab_messages'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Messages.js'),
|
||||
];
|
||||
|
||||
$result['grades'] = [
|
||||
'title' => $this->p->t('stv', 'tab_grades'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Noten.js'),
|
||||
'showOnlyWithUid' => true,
|
||||
'config' => [
|
||||
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
|
||||
'edit' => 'both', // Possible values: both|header|inline
|
||||
'delete' => 'both', // Possible values: both|header|inline
|
||||
'documents' => 'both', // Possible values: both|header|inline
|
||||
'documentslist' => $this->gradesDocumentsList()
|
||||
]
|
||||
];
|
||||
|
||||
$result['exam'] = [
|
||||
'title' => $this->p->t('stv', 'tab_exam'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Pruefung.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
|
||||
$result['exemptions'] = [
|
||||
'title' => $this->p->t('lehre', 'anrechnungen'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen.js'),
|
||||
'config' => $config['exemptions']
|
||||
];
|
||||
|
||||
$result['finalexam'] = [
|
||||
'title' => $this->p->t('stv', 'tab_finalexam'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung.js'),
|
||||
'showOnlyWithUid' => true,
|
||||
'config' => $config['finalexam']
|
||||
];
|
||||
|
||||
$result['projektarbeit'] = [
|
||||
'title' => $this->p->t('stv', 'tab_projektarbeit'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit.js'),
|
||||
'config' => array_merge(
|
||||
$config['projektarbeit'],
|
||||
['showVertragsdetails' =>
|
||||
defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN') && FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN]
|
||||
)
|
||||
];
|
||||
|
||||
$result['mobility'] = [
|
||||
'title' => $this->p->t('stv', 'tab_mobility'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Mobility.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
|
||||
$result['archive'] = [
|
||||
'title' => $this->p->t('stv', 'tab_archive'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Archiv.js'),
|
||||
'config' => [
|
||||
'showEdit' => $this->permissionlib->isBerechtigt('admin')
|
||||
]
|
||||
];
|
||||
|
||||
$result['jointstudies'] = [
|
||||
'title' => $this->p->t('stv', 'tab_jointstudies'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/JointStudies.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
|
||||
$result['coursedates'] = [
|
||||
'title' => $this->p->t('stv', 'tab_courseDates'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine.js')
|
||||
];
|
||||
|
||||
$result['admissionDates'] = [
|
||||
'title' => $this->p->t('stv', 'tab_admissionDates'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine.js')
|
||||
];
|
||||
|
||||
$result['functions'] = [
|
||||
'title' => $this->p->t('stv', 'tab_functions'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Funktionen.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
|
||||
Events::trigger('stv_conf_student', function & () use (&$result) {
|
||||
return $result;
|
||||
});
|
||||
|
||||
$sortConfig = $this->config->item('student_tab_order');
|
||||
|
||||
$this->terminateWithSuccess($this->sortTabList($result, $sortConfig));
|
||||
}
|
||||
|
||||
public function students()
|
||||
{
|
||||
$result = [];
|
||||
$config = $this->config->item('tabs');
|
||||
$result['banking'] = [
|
||||
'title' => $this->p->t('stv', 'tab_banking'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Konto.js'),
|
||||
'config' => [
|
||||
'showZahlungsbestaetigung' => (defined('ZAHLUNGSBESTAETIGUNG_ANZEIGEN') && ZAHLUNGSBESTAETIGUNG_ANZEIGEN),
|
||||
'showBuchungsnr' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'showMahnspanne' => (!defined('FAS_KONTO_SHOW_MAHNSPANNE') || FAS_KONTO_SHOW_MAHNSPANNE===true),
|
||||
'showCreditpoints' => (defined('FAS_KONTO_SHOW_CREDIT_POINTS') && FAS_KONTO_SHOW_CREDIT_POINTS == 'true'),
|
||||
'columns' => $this->kontoColumnsMultiPerson(),
|
||||
'additionalCols' => []
|
||||
]
|
||||
];
|
||||
$result['groups'] = [
|
||||
'title' => $this->p->t('stv', 'tab_groups'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Groups.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
$result['status'] = [
|
||||
'title' => 'Status',
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js'),
|
||||
'config' => [
|
||||
'changeStatusToAbbrecherStgl' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'changeStatusToAbbrecherStud' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'changeStatusToUnterbrecher' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'changeStatusToDiplomand' => $this->permissionlib->isBerechtigt('admin'),
|
||||
'changeStatusToAbsolvent' => $this->permissionlib->isBerechtigt('admin')
|
||||
]
|
||||
];
|
||||
$result['finalexam'] = [
|
||||
'title' => $this->p->t('stv', 'tab_finalexam'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung.js'),
|
||||
'showOnlyWithUid' => true,
|
||||
'config' => $config['finalexam']
|
||||
];
|
||||
$result['archive'] = [
|
||||
'title' => $this->p->t('stv', 'tab_archive'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Archiv.js'),
|
||||
'config' => [
|
||||
'showEdit' => $this->permissionlib->isBerechtigt('admin')
|
||||
]
|
||||
];
|
||||
|
||||
if($this->permissionlib->isBerechtigt('basis/person'))
|
||||
{
|
||||
$result['combinePeople'] = [
|
||||
'title' => $this->p->t('stv', 'tab_combine_people'),
|
||||
'component' => './Stv/Studentenverwaltung/Details/CombinePeople.js',
|
||||
'config' => $config['combinePeople']
|
||||
];
|
||||
}
|
||||
|
||||
$result['kontaktieren'] = [
|
||||
'title' => $this->p->t('stv', 'tab_kontaktieren'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js'),
|
||||
];
|
||||
|
||||
$result['messages'] = [
|
||||
'title' => $this->p->t('stv', 'tab_messages'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Messages.js'),
|
||||
];
|
||||
|
||||
Events::trigger('stv_conf_students', function & () use (&$result) {
|
||||
return $result;
|
||||
});
|
||||
|
||||
$sortConfig = $this->config->item('students_tab_order');
|
||||
|
||||
$this->terminateWithSuccess($this->sortTabList($result, $sortConfig));
|
||||
}
|
||||
|
||||
protected function kontoColumns()
|
||||
{
|
||||
return [
|
||||
'buchungsdatum' => [
|
||||
'field' => "buchungsdatum",
|
||||
'title' => $this->p->t('konto', 'buchungsdatum')
|
||||
],
|
||||
'buchungstext' => [
|
||||
'field' => "buchungstext",
|
||||
'title' => $this->p->t('konto', 'buchungstext')
|
||||
],
|
||||
'betrag' => [
|
||||
'field' => "betrag",
|
||||
'title' => $this->p->t('konto', 'betrag')
|
||||
],
|
||||
'studiensemester_kurzbz' => [
|
||||
'field' => "studiensemester_kurzbz",
|
||||
'title' => $this->p->t('lehre', 'studiensemester')
|
||||
],
|
||||
'buchungstyp_kurzbz' => [
|
||||
'field' => "buchungstyp_kurzbz",
|
||||
'title' => $this->p->t('konto', 'buchungstyp'),
|
||||
'visible' => false
|
||||
],
|
||||
'buchungsnr' => [
|
||||
'field' => "buchungsnr",
|
||||
'title' => $this->p->t('konto', 'buchungsnr'),
|
||||
'visible' => false
|
||||
],
|
||||
'insertvon' => [
|
||||
'field' => "insertvon",
|
||||
'title' => $this->p->t('global', 'insertvon'),
|
||||
'visible' => false
|
||||
],
|
||||
'insertamum' => [
|
||||
'field' => "insertamum",
|
||||
'title' => $this->p->t('global', 'insertamum'),
|
||||
'visible' => false
|
||||
],
|
||||
'kuerzel' => [
|
||||
'field' => "kuerzel",
|
||||
'title' => $this->p->t('lehre', 'studiengang'),
|
||||
'visible' => false
|
||||
],
|
||||
'anmerkung' => [
|
||||
'field' => "anmerkung",
|
||||
'title' => $this->p->t('global', 'anmerkung')
|
||||
],
|
||||
'actions' => [
|
||||
'title' => $this->p->t('global', 'actions'),
|
||||
'frozen' => true
|
||||
]
|
||||
];
|
||||
}
|
||||
protected function kontoColumnsMultiPerson()
|
||||
{
|
||||
return [
|
||||
'person_id' => [
|
||||
'field' => "person_id",
|
||||
'title' => $this->p->t('person', 'person_id')
|
||||
],
|
||||
'anrede' => [
|
||||
'field' => "anrede",
|
||||
'title' => $this->p->t('person', 'anrede'),
|
||||
'visible' => false
|
||||
],
|
||||
'titelpost' => [
|
||||
'field' => "titelpost",
|
||||
'title' => $this->p->t('person', 'titelpost'),
|
||||
'visible' => false
|
||||
],
|
||||
'titelpre' => [
|
||||
'field' => "titelpre",
|
||||
'title' => $this->p->t('person', 'titelpre'),
|
||||
'visible' => false
|
||||
],
|
||||
'vorname' => [
|
||||
'field' => "vorname",
|
||||
'title' => $this->p->t('person', 'vorname')
|
||||
],
|
||||
'vornamen' => [
|
||||
'field' => "vornamen",
|
||||
'title' => $this->p->t('person', 'vornamen'),
|
||||
'visible' => false
|
||||
],
|
||||
'nachname' => [
|
||||
'field' => "nachname",
|
||||
'title' => $this->p->t('person', 'nachname')
|
||||
]
|
||||
] + $this->kontoColumns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to generate the default documentslist config for the
|
||||
* grades tab.
|
||||
*
|
||||
* The resulting array consists of elements which are associative arrays
|
||||
* that can have the following entries:
|
||||
* title (required) on the first level this can be HTML code.
|
||||
* permissioncheck (optional) an URL to an FHCAPI endpoint which returns
|
||||
* true or false.
|
||||
* link (optional) an URL that will be called if "action" and
|
||||
* "children" are not defined.
|
||||
* action (optional) an associative array that describes an
|
||||
* POST action that will be called if "children" is
|
||||
* not defined.
|
||||
* It can have the following entries:
|
||||
* - url (required) an URL to an FHCAPI endpoint.
|
||||
* - post (optional) an associative array with the POST data to
|
||||
* be sent.
|
||||
* - response (optional) a string that will be displayed on success.
|
||||
* children (optional) an array of child elements
|
||||
*
|
||||
* All strings that start with { and end with } in the URLs and the
|
||||
* actions post parameter will be replaced with the corresponding
|
||||
* attribute of the current dataset (e.G: {uid} will be replaced with the
|
||||
* uid of the current dataset)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function gradesDocumentsList()
|
||||
{
|
||||
$permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
|
||||
|
||||
$title_ger = $this->p->t("global", "deutsch");
|
||||
$title_eng = $this->p->t("global", "englisch");
|
||||
$title_ff = $this->p->t("stv", "document_certificate");
|
||||
$title_lv = $this->p->t("stv", "document_coursecertificate");
|
||||
|
||||
$link_ff = "documents/export/" .
|
||||
"zertifikat.rdf.php/" .
|
||||
"Zertifikat" .
|
||||
"?stg_kz={studiengang_kz_lv}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_ger = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnis" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_eng = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnisEng" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
|
||||
$archive_url = "api/frontend/v1/documents/archiveSigned";
|
||||
$archive_response = $this->p->t("stv", "document_signed_and_archived");
|
||||
$archive_post_ff = [
|
||||
"xml" => "zertifikat.rdf.php",
|
||||
"xsl" => "Zertifikat",
|
||||
"stg_kz" => "{studiengang_kz_lv}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_ger = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnis",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_eng = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnisEng",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
|
||||
$list = [
|
||||
[
|
||||
'title' => '<i class="fa fa-download" title="' . $this->p->t("stv", "document_download") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'link' => site_url($link_ff)
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'link' => site_url($link_lv_ger),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=odt")
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'link' => site_url($link_lv_eng),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=odt")
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => '<i class="fas fa-archive" title="' . $this->p->t("stv", "document_archive") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_ff,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_ger,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_eng,
|
||||
'response' => $archive_response
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort tab list
|
||||
*
|
||||
* @param array $input
|
||||
* @param array $config
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function sortTabList($input, $config)
|
||||
{
|
||||
// prepare config
|
||||
if (!$config || !is_array($config))
|
||||
$config = [];
|
||||
else
|
||||
$config = array_flip($config);
|
||||
|
||||
// fill missing items in config
|
||||
foreach (array_keys($input) as $key) {
|
||||
if (!isset($config[$key]))
|
||||
$config[$key] = count($config);
|
||||
}
|
||||
|
||||
// do the sorting
|
||||
uksort($input, function ($a, $b) use ($config) {
|
||||
return $config[$a] - $config[$b];
|
||||
});
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,990 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \CI3_Events as Events;
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Dokumente extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getDocumentsUnaccepted' => ['admin:r', 'assistenz:r'],
|
||||
'getDocumentsAccepted' => ['admin:r', 'assistenz:r'],
|
||||
'deleteZuordnung' => ['admin:rw', 'assistenz:rw'],
|
||||
'createZuordnung' => ['admin:rw', 'assistenz:rw'],
|
||||
'loadAkte' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteAkte' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateAkte' => ['admin:rw', 'assistenz:rw'],
|
||||
'getDoktypen' => ['admin:r', 'assistenz:r'],
|
||||
'uploadDokument' => ['admin:rw', 'assistenz:rw'],
|
||||
'download' => ['admin:rw', 'assistenz:rw'],
|
||||
'getDocumentDropDown' => ['admin:rw', 'assistenz:rw'],
|
||||
'getDocumentDropDownMulti' => ['admin:rw', 'assistenz:rw'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('DmsLib', array('who' => getAuthUID()));
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'dokumente'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->load->model('crm/Dokument_model', 'DokumentModel');
|
||||
$this->load->model('crm/Dokumentprestudent_model', 'DokumentprestudentModel');
|
||||
|
||||
//TODO(Manu) check additional Berechtigungen
|
||||
//TODO(Manu) check if using dokument lib instead of dokument model?
|
||||
}
|
||||
|
||||
public function getDocumentsUnaccepted($prestudent_id, $studiengang_kz)
|
||||
{
|
||||
if(!$prestudent_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!is_numeric($prestudent_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$studiengang_kz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
$result = $this->DokumentModel->getUnacceptedDocuments($prestudent_id, $person_id);
|
||||
|
||||
$dataAkteUnaccepted = $this->getDataOrTerminateWithError($result);
|
||||
$resultMd = $this->_getMissingDocuments($studiengang_kz, $prestudent_id);
|
||||
|
||||
$data = $this->_mergeDocuments($dataAkteUnaccepted, $resultMd);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getDocumentsAccepted($prestudent_id, $studiengang_kz)
|
||||
{
|
||||
if(!$prestudent_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!is_numeric($prestudent_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$studiengang_kz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$resultPreDoc = $this->_getPrestudentDokumente($prestudent_id);
|
||||
|
||||
$arrayAccepted = [];
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
|
||||
$docNames = array_map(function ($item) {
|
||||
return $item->dokument_kurzbz;
|
||||
}, $resultPreDoc);
|
||||
|
||||
foreach($docNames as $doc)
|
||||
{
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $doc, $studiengang_kz, $prestudent_id, true);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (hasData($result))
|
||||
{
|
||||
$data = getData($result);
|
||||
foreach ($data as $value)
|
||||
{
|
||||
array_push($arrayAccepted, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Mapping with document_kurzbz
|
||||
$preDocMap = [];
|
||||
foreach ($resultPreDoc as $pre) {
|
||||
$preDocMap[$pre->dokument_kurzbz] = $pre;
|
||||
}
|
||||
|
||||
$mergedArray = [];
|
||||
foreach ($arrayAccepted as $doc) {
|
||||
$merged = clone $doc;
|
||||
|
||||
if (isset($preDocMap[$doc->dokument_kurzbz])) {
|
||||
$merged->docdatum = $preDocMap[$doc->dokument_kurzbz]->docdatum;
|
||||
$merged->insertvonma = $preDocMap[$doc->dokument_kurzbz]->insertvonma;
|
||||
$merged->bezeichnung = $preDocMap[$doc->dokument_kurzbz]->bezeichnung;
|
||||
} else {
|
||||
$merged->akzeptiertdatum = null;
|
||||
$merged->akzeptiertvon = null;
|
||||
}
|
||||
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($mergedArray);
|
||||
}
|
||||
|
||||
public function deleteZuordnung($prestudent_id, $dokument_kurzbz)
|
||||
{
|
||||
if(!$prestudent_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!is_numeric($prestudent_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$dokument_kurzbz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Dokument_kurzbz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->DokumentprestudentModel->delete(
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadAkte($akte_id)
|
||||
{
|
||||
if (!$akte_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Akte ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->AkteModel->addSelect('public.tbl_akte.*');
|
||||
$this->AkteModel->addSelect("CONCAT(public.tbl_person.vorname, ' ' , public.tbl_person.nachname) AS namePerson");
|
||||
$this->AkteModel->addJoin('public.tbl_person', 'person_id');
|
||||
$result = $this->AkteModel->loadWhere(
|
||||
[
|
||||
'akte_id' => $akte_id,
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$data = current($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function updateAkte()
|
||||
{
|
||||
$this->form_validation->set_rules('akte_id', 'Akte ID', 'required', [
|
||||
'required' => $this->p->t('dokumente', 'err_updateNotAllowed')
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('dokument_kurzbz', 'Dokumenttyp', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Dokumenttyp'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('nachreichung_am', 'Nachreichung am', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Nachreichung am'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->AkteModel->update(
|
||||
[
|
||||
'akte_id' => $this->input->post('akte_id'),
|
||||
],
|
||||
[
|
||||
'dokument_kurzbz' => $this->input->post('dokument_kurzbz'),
|
||||
'anmerkung_intern' => $this->input->post('anmerkung_intern'),
|
||||
'titel_intern' => $this->input->post('titel_intern'),
|
||||
'nachgereicht_am' => $this->input->post('nachgereicht_am'),
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $uid,
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function createZuordnung($prestudent_id, $dokument_kurzbz)
|
||||
{
|
||||
if (!$prestudent_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$dokument_kurzbz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Dokument_kurzbz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$uid = getAuthUid();
|
||||
|
||||
//check if more than 1 dokumentkurzbz
|
||||
//if()
|
||||
|
||||
$result = $this->DokumentprestudentModel->insert(
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz,
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'datum' => date('c'),
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid,
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteAkte($akte_id)
|
||||
{
|
||||
if (!$akte_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Akte ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
$dataAkte = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$logdata_akte = var_export($dataAkte, true);
|
||||
|
||||
$dms_id = current($dataAkte)->dms_id;
|
||||
$nachgereicht = current($dataAkte)->nachgereicht;
|
||||
$inhalt = current($dataAkte)->inhalt;
|
||||
$inhaltVorhanden = $inhalt != '';
|
||||
$uid = getAuthUid();
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
if($dms_id)
|
||||
{
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
$result = $this->DmsModel->load($dms_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$logdata_dms = (array)$data;
|
||||
$logdata_dms = "Logdata: " . var_export($logdata_dms, true);
|
||||
|
||||
//delete from dmsLib
|
||||
$this->load->library('DmsLib');
|
||||
$person_id = current($dataAkte)->person_id;
|
||||
$result = $this->dmslib->delete($person_id, $dms_id);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
//LOGGING Dms ID
|
||||
$this->load->model('system/Log_model', 'LogModel');
|
||||
$result = $this->LogModel->insert([
|
||||
'executetime' => date('c'),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'beschreibung' => "Löschen der DMS_ID ". $dms_id,
|
||||
'sql' => $logdata_dms
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
//delete akte
|
||||
$result = $this->AkteModel->delete(
|
||||
[
|
||||
'akte_id' => $akte_id
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
//Logging Deletion Akte
|
||||
$result = $this->LogModel->insert([
|
||||
'executetime' => date('c'),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'beschreibung' => "Löschen der Akte ". $akte_id,
|
||||
'sql' => "DELETE FROM public.tbl_akte WHERE akte_id=" .$akte_id. " LogData: ". $logdata_akte
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
$this->db->trans_complete();
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
elseif (!!$dms_id || ($nachgereicht && !$inhaltVorhanden))
|
||||
{
|
||||
$result = $this->AkteModel->delete(
|
||||
[
|
||||
'akte_id' => $akte_id
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->LogModel->insert([
|
||||
'executetime' => date('c'),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'beschreibung' => "Löschen der Akte ". $akte_id,
|
||||
'sql' => "DELETE FROM public.tbl_akte WHERE akte_id=" .$akte_id. " LogData: ". $logdata_akte
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->db->trans_complete();
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->terminateWithError($this->p->t('dokumente', 'err_deleteDokHere'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
public function uploadDokument()
|
||||
{
|
||||
$this->load->library('DmsLib');
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
$anmerkung_intern = $this->input->post('anmerkung_intern');
|
||||
$titel_intern = $this->input->post('titel_intern');
|
||||
$dokument_kurzbz = $this->input->post('dokument_kurzbz');
|
||||
|
||||
$this->form_validation->set_rules('prestudent_id', 'Prestudent_id', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Prestudent ID'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('dokument_kurzbz', 'Dokumenttyp', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Dokumenttyp'])
|
||||
]);
|
||||
|
||||
//validation if attachment was added
|
||||
$this->form_validation->set_rules('anhang', 'Attachment', 'callback_file_check');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->db->trans_start();
|
||||
$uid = getAuthUID();
|
||||
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'Akte',
|
||||
'version' => 0,
|
||||
'name' => $_FILES['anhang']['name'],
|
||||
'mimetype' => $_FILES['anhang']['type'],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
$result = $this->dmslib->upload($dms, 'anhang', array("jpg", "png", "pdf"));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$dms_id = $result->retval['dms_id'];
|
||||
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
|
||||
$result = $this->DokumentModel->load($dokument_kurzbz);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$bezeichnung = current($data)->bezeichnung;
|
||||
|
||||
//save entry in akte
|
||||
if($dms_id)
|
||||
{
|
||||
$result = $this->AkteModel->insert([
|
||||
'person_id' => $person_id,
|
||||
'dms_id' => $dms_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz,
|
||||
'mimetype' => $_FILES['anhang']['type'],
|
||||
'insertamum' => date('c'),
|
||||
'erstelltam' => date('c'),
|
||||
'insertvon' => $uid,
|
||||
'anmerkung_intern' => $anmerkung_intern,
|
||||
'titel_intern' => $titel_intern,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'titel' => $_FILES['anhang']['name']
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->db->trans_complete();
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
$this->db->trans_complete();
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getDoktypen()
|
||||
{
|
||||
$this->DokumentModel->addSelect('dokument_kurzbz');
|
||||
$this->DokumentModel->addSelect('bezeichnung');
|
||||
$this->DokumentModel->addOrder('dokument_kurzbz', 'ASC');
|
||||
$result = $this->DokumentModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function download()
|
||||
{
|
||||
//TODO(Manu) check filetype, Decoding
|
||||
$akte_id = $this->input->get('akte_id');
|
||||
|
||||
if(!$akte_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Akte ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!is_numeric($akte_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value' => 'Akte ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
if (!hasData($result)) $this->terminateWithError('Akte not found');
|
||||
$data = getData($result)[0];
|
||||
|
||||
$mimetype = $data->mimetype;
|
||||
$filecontentbase64 = $data->inhalt;
|
||||
$filename = $data->titel;
|
||||
|
||||
if(intval($data->dms_id) > 0)
|
||||
{
|
||||
$dmsdokres = $this->dmslib->read($data->dms_id);
|
||||
if (!hasData($dmsdokres)) $this->terminateWithError('DMS File not found');
|
||||
$dmsdok = getData($dmsdokres)[0];
|
||||
|
||||
$mimetype = $dmsdok->mimetype;
|
||||
$filecontentbase64 = $dmsdok->file_content;
|
||||
$filename = $dmsdok->name;
|
||||
}
|
||||
|
||||
$filecontent = '';
|
||||
|
||||
if (!empty($filecontentbase64)) {
|
||||
$filecontent = base64_decode($filecontentbase64, true);
|
||||
|
||||
if ($filecontent === false) {
|
||||
$this->terminateWithError('Base64-Dekodierung failed.');
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithFileOutput($mimetype, $filecontent, $filename);
|
||||
}
|
||||
|
||||
private function _getMissingDocuments($studiengang_kz, $prestudent_id)
|
||||
{
|
||||
$result = $this->DokumentModel->getMissingDocuments($studiengang_kz, $prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function _getUnacceptedDocuments($prestudent_id)
|
||||
{
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
$result = $this->DokumentModel->getUnacceptedDocuments($prestudent_id, $person_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* helper function for merging objects
|
||||
* sorts object after merging according to dokument_kurzbz
|
||||
* @param $original object of documents of akte
|
||||
* @param object $toMerge documents to merge (of dokumentprestudent, dokumentstudiengang)
|
||||
* @return Array mergedObject
|
||||
*/
|
||||
private function _mergeDocuments($original, $toMerge)
|
||||
{
|
||||
$existingKurzbez = [];
|
||||
foreach ($original as $doc) {
|
||||
$existingKurzbez[$doc->dokument_kurzbz] = true;
|
||||
}
|
||||
|
||||
foreach ($toMerge as $doc) {
|
||||
if (!isset($existingKurzbez[$doc->dokument_kurzbz])) {
|
||||
$original[] = $doc;
|
||||
$existingKurzbez[$doc->dokument_kurzbz] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($original as $docOriginal)
|
||||
{
|
||||
if ($docOriginal->dokument_kurzbz == $doc->dokument_kurzbz)
|
||||
{
|
||||
$docOriginal->pflicht = $doc->pflicht;
|
||||
$docOriginal->onlinebewerbung = $doc->onlinebewerbung;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
usort($original, function ($a, $b) {
|
||||
return strcmp($a->dokument_kurzbz, $b->dokument_kurzbz);
|
||||
});
|
||||
|
||||
return $original;
|
||||
}
|
||||
|
||||
private function _getDocumentsOfAkte($person_id)
|
||||
{
|
||||
$result = $this->AkteModel->getAktenFAS($person_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function _getPrestudentDokumente($prestudent_id)
|
||||
{
|
||||
$result = $this->DokumentprestudentModel->getPrestudentDokumente($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function _getPersonId($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $prestudent_id]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
|
||||
return $person->person_id;
|
||||
}
|
||||
|
||||
public function file_check($str)
|
||||
{
|
||||
if (isset($_FILES['anhang']) && $_FILES['anhang']['size'] > 0)
|
||||
{
|
||||
$allowed_mime_types = ['image/jpeg', 'image/png', 'application/pdf'];
|
||||
$mime = mime_content_type($_FILES['anhang']['tmp_name']);
|
||||
|
||||
if (in_array($mime, $allowed_mime_types))
|
||||
{
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
$this->form_validation->set_message('file_check', $this->p->t('dokumente', 'error_fileType'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->form_validation->set_message('file_check', $this->p->t('dokumente', 'error_fileMissing'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getDocumentDropDown($prestudent_id, $studiensemester_kurzbz, $studiengang_kz)
|
||||
{
|
||||
$this->load->helper('hlp_common');
|
||||
//permission to create also odt, and doc outputs of certain documents(menu abschlusspruefung)
|
||||
$hasPermissionOutputformat = $this->permissionlib->isBerechtigt('system/change_outputformat', 's');
|
||||
|
||||
if (!$prestudent_id)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Prestudent_id']), self::ERROR_TYPE_GENERAL);
|
||||
if (!$studiensemester_kurzbz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiensemester']), self::ERROR_TYPE_GENERAL);
|
||||
if(!$studiengang_kz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$uid = $this->_loadUIDFromPrestudent($prestudent_id);
|
||||
$semArray = $this->_getEntriesStudiensemester();
|
||||
$stgTyp = $this->_getStudiengangstyp($studiengang_kz);
|
||||
|
||||
$documents = [
|
||||
buildDropdownEntryPrintArray("accountinfo", "Accountinfoblatt", "xml=accountinfoblatt.xml.php&xsl=AccountInfo&output=pdf", $uid, 10, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf&prestudent_id=$prestudent_id", null,20, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Zweisprachig", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf&prestudent_id=$prestudent_id", null,21, null),
|
||||
|
||||
buildDropdownEntryPrintArray("bescheid", "Bescheid (nur Voransicht)", "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf", $uid, 25, null),
|
||||
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uid, 26, null),
|
||||
|
||||
buildDropdownEntryPrintArray("studienbestaetigung", "Studienbestätigung", "xml=student.rdf.php&xsl=Inskription&output=pdf&ss=$studiensemester_kurzbz&xsl_stg_kz=$studiengang_kz", $uid, 50, null),
|
||||
buildDropdownEntryPrintArray("studienbestaetigung_en", "Studienbestätigung Englisch", "xml=student.rdf.php&xsl=InskriptionEng&output=pdf&ss=$studiensemester_kurzbz&xsl_stg_kz=$studiengang_kz", $uid, 51, null),
|
||||
buildDropdownEntryPrintArray("zutrittskarte", "Zutrittskarte", "xsl=ZutrittskarteStud&output=pdf&data=$uid", $uid,200, "zutrittskarte.php"),
|
||||
buildDropdownEntryPrintArray("studienblatt", "Studienblatt", "xml=studienblatt.xml.php&xsl=Studienblatt&output=pdf&ss=$studiensemester_kurzbz", $uid, 60, null),
|
||||
buildDropdownEntryPrintArray("studienblatt_eng", "Studienblatt Englisch", "xml=studienblatt.xml.php&xsl=StudienblattEng&output=pdf&ss=$studiensemester_kurzbz", $uid, 61, null),
|
||||
|
||||
$this->buildStudienerfolgSubmenu("de", $uid, $semArray, $studiensemester_kurzbz),
|
||||
$this->buildStudienerfolgSubmenu("en", $uid, $semArray, $studiensemester_kurzbz),
|
||||
$this->buildStudienerfolgSubmenu("de", $uid, $semArray, $studiensemester_kurzbz, true),
|
||||
$this->buildStudienerfolgSubmenu("en", $uid, $semArray, $studiensemester_kurzbz, true),
|
||||
|
||||
[
|
||||
"id" => "submenu_studstatus",
|
||||
"type" => "submenu",
|
||||
"name" => "Verwaltung des StudierendenStatus",
|
||||
"order" => 110,
|
||||
"data" => [
|
||||
buildDropdownEntryPrintArray("Abmeldung", "Abmeldung", "xml=AntragAbmeldung.xml.php&xsl=AntragAbmeldung&prestudent_id=$prestudent_id&output=pdf", $uid, null, null),
|
||||
buildDropdownEntryPrintArray("Abmeldung durch Stgl", "AntragAbmeldungStgl", "xml=AntragAbmeldungStgl.xml.php&xsl=AntragAbmeldungStgl&prestudent_id=$prestudent_id&output=pdf", $uid, null, null),
|
||||
buildDropdownEntryPrintArray("Unterbrechung", "Unterbrechung", "xml=AntragUnterbrechung.xml.php&xsl=AntragUnterbrechung&prestudent_id=$prestudent_id&output=pdf", $uid, null, null),
|
||||
buildDropdownEntryPrintArray("Wiederholung", "Abmeldung durch Ablauf der Wiederholungsfrist", "xml=AntragWiederholung.xml.php&xsl=AntragWiederholung&prestudent_id=$prestudent_id&output=pdf", $uid, null, null),
|
||||
]
|
||||
],
|
||||
|
||||
//Bakkzeugnis bzw. Diplomzeugnis is just shown in tab final_exam
|
||||
buildDropdownEntryPrintArray("zeugnis", "Zeugnis", "xml=zeugnis.rdf.php&xsl=Zeugnis&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uid, 121, null),
|
||||
buildDropdownEntryPrintArray("zeugnis_en", "Zeugnis Englisch", "xml=zeugnis.rdf.php&xsl=ZeugnisEng&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uid, 122, null),
|
||||
|
||||
|
||||
];
|
||||
|
||||
Events::trigger('DocumentGenerationDropDown',
|
||||
// passing $menu per reference
|
||||
function & () use (&$documents) {
|
||||
return $documents;
|
||||
},
|
||||
$prestudent_id,
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz
|
||||
);
|
||||
|
||||
$extraEntries = $this->loadDropDownEntriesBakkOrDipl($stgTyp, $uid);
|
||||
|
||||
$documents = array_merge($documents, $extraEntries);
|
||||
|
||||
usort($documents, function ($a, $b) {
|
||||
$orderA = isset($a['order']) ? (int)$a['order'] : PHP_INT_MAX;
|
||||
$orderB = isset($b['order']) ? (int)$b['order'] : PHP_INT_MAX;
|
||||
return $orderA <=> $orderB;
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($documents);
|
||||
//return $documents || null;
|
||||
}
|
||||
|
||||
public function getDocumentDropDownMulti($studiensemester_kurzbz,$studiengang_kz)
|
||||
{
|
||||
//permission to create also odt, and doc outputs of certain documents (menu abschlusspruefung)
|
||||
$hasPermissionOutputformat = $this->permissionlib->isBerechtigt('system/change_outputformat', 's');
|
||||
|
||||
$studentUids = $this->input->get('studentUids');
|
||||
$prestudentIds = [];
|
||||
|
||||
if (is_array($studentUids) && !empty($studentUids)) {
|
||||
foreach ($studentUids as $uid) {
|
||||
$prestudent_id = $this-> _loadPrestudentFromUid($uid);
|
||||
$prestudentIds[] = $prestudent_id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Array StudentUIDs']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!$studiensemester_kurzbz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiensemester']), self::ERROR_TYPE_GENERAL);
|
||||
if(!$studiengang_kz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$uidString = implode(";", $studentUids);
|
||||
$prestudentIdsString = implode(";", $prestudentIds);
|
||||
|
||||
$semArray = $this->_getEntriesStudiensemester();
|
||||
$stgTyp = $this->_getStudiengangstyp($studiengang_kz);
|
||||
|
||||
$documents = [
|
||||
buildDropdownEntryPrintArray("accountinfo", "Accountinfoblatt", "xml=accountinfoblatt.xml.php&xsl=AccountInfo&output=pdf", $uidString, 10, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf", $uidString, 20, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Englisch", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf", $uidString, 21, null),
|
||||
buildDropdownEntryPrintArray("studienbestaetigung", "Studienbestätigung", "xml=student.rdf.php&xsl=Inskription&output=pdf&ss=$studiensemester_kurzbz&xsl_stg_kz=$studiengang_kz", $uidString, 50, null),
|
||||
buildDropdownEntryPrintArray("studienbestaetigung_en", "Studienbestätigung Englisch", "xml=student.rdf.php&xsl=InskriptionEng&output=pdf&ss=$studiensemester_kurzbz&xsl_stg_kz=$studiengang_kz", $uidString, 51, null),
|
||||
buildDropdownEntryPrintArray("zutrittskarte", "Zutrittskarte", "xsl=ZutrittskarteStud&output=pdf&data=$uidString", $uidString,200, "zutrittskarte.php"),
|
||||
buildDropdownEntryPrintArray("studienblatt", "Studienblatt", "xml=studienblatt.xml.php&xsl=Studienblatt&output=pdf&ss=$studiensemester_kurzbz", $uidString, 60, null),
|
||||
buildDropdownEntryPrintArray("studienblatt_eng", "Studienblatt Englisch", "xml=studienblatt.xml.php&xsl=StudienblattEng&output=pdf&ss=$studiensemester_kurzbz", $uidString, 61, null),
|
||||
|
||||
// Studienerfolg Menüs automatisch
|
||||
$this->buildStudienerfolgSubmenu("de", $uidString, $semArray, $studiensemester_kurzbz),
|
||||
$this->buildStudienerfolgSubmenu("en", $uidString, $semArray, $studiensemester_kurzbz),
|
||||
$this->buildStudienerfolgSubmenu("de", $uidString, $semArray, $studiensemester_kurzbz, true),
|
||||
$this->buildStudienerfolgSubmenu("en", $uidString, $semArray, $studiensemester_kurzbz, true),
|
||||
|
||||
[
|
||||
"id" => "submenu_studstatus",
|
||||
"type" => "submenu",
|
||||
"name" => "Verwaltung des StudierendenStatus",
|
||||
"order" => 110,
|
||||
"data" => [
|
||||
buildDropdownEntryPrintArray("Abmeldung", "Abmeldung", "xml=AntragAbmeldung.xml.php&xsl=AntragAbmeldung&prestudent_id=$prestudentIdsString&output=pdf", $uidString, null, null),
|
||||
buildDropdownEntryPrintArray("Abmeldung durch Stgl", "AntragAbmeldungStgl", "xml=AntragAbmeldungStgl.xml.php&xsl=AntragAbmeldungStgl&prestudent_id=$prestudentIdsString&output=pdf", $uidString, null, null),
|
||||
buildDropdownEntryPrintArray("Unterbrechung", "Unterbrechung", "xml=AntragUnterbrechung.xml.php&xsl=AntragUnterbrechung&prestudent_id=$prestudentIdsString&output=pdf", $uidString, null, null),
|
||||
buildDropdownEntryPrintArray("Wiederholung", "Abmeldung durch Ablauf der Wiederholungsfrist", "xml=AntragWiederholung.xml.php&xsl=AntragWiederholung&prestudent_id=$prestudentIdsString&output=pdf", $uidString, null, null),
|
||||
]
|
||||
],
|
||||
|
||||
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uidString, 35, null),
|
||||
buildDropdownEntryPrintArray("zeugnis", "Zeugnis", "xml=zeugnis.rdf.php&xsl=Zeugnis&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uidString, 121, null),
|
||||
buildDropdownEntryPrintArray("zeugnis_en", "Zeugnis Englisch", "xml=zeugnis.rdf.php&xsl=ZeugnisEng&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uidString, 122, null),
|
||||
];
|
||||
|
||||
Events::trigger('DocumentGenerationDropDownMulti',
|
||||
// passing $menu per reference
|
||||
function & () use (&$documents) {
|
||||
return $documents;
|
||||
},
|
||||
$studentUids,
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz
|
||||
);
|
||||
|
||||
$extraEntries = $this->loadDropDownEntriesBakkOrDipl($stgTyp, $uidString);
|
||||
|
||||
$documents = array_merge($documents, $extraEntries);
|
||||
|
||||
usort($documents, function ($a, $b) {
|
||||
$orderA = isset($a['order']) ? (int)$a['order'] : PHP_INT_MAX;
|
||||
$orderB = isset($b['order']) ? (int)$b['order'] : PHP_INT_MAX;
|
||||
return $orderA <=> $orderB;
|
||||
});
|
||||
|
||||
|
||||
$this->terminateWithSuccess($documents);
|
||||
|
||||
return $documents || null;
|
||||
}
|
||||
|
||||
private function _loadUIDFromPrestudent($prestudent_id)
|
||||
{
|
||||
if(!$prestudent_id){
|
||||
return $this->terminateWithError("no prestudent ID received.");
|
||||
}
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->loadWhere(
|
||||
['prestudent_id' => $prestudent_id]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$student = current($data);
|
||||
|
||||
return $student->student_uid;
|
||||
}
|
||||
|
||||
private function _loadPrestudentFromUid($studentUid)
|
||||
{
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->loadWhere(
|
||||
['student_uid' => $studentUid]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$student = current($data);
|
||||
|
||||
|
||||
return $student->prestudent_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* is building an array with studiensemesterkurzb
|
||||
* actual studiensemester plus the 5 studiensemester in the past
|
||||
|
||||
* @return Array Studiensemester_kurzbz
|
||||
*/
|
||||
private function _getEntriesStudiensemester(){
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addPlusMinus(1, 5);
|
||||
$this->StudiensemesterModel->addOrder('ende', 'DESC');
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
foreach($data as $sem)
|
||||
{
|
||||
$semArray[] = $sem->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
array_shift($semArray);
|
||||
|
||||
return $semArray;
|
||||
}
|
||||
/**
|
||||
* is returning the typ of Studiengang (Bakk oder Master)
|
||||
|
||||
* @return character eg. 'b' or 'm'
|
||||
*/
|
||||
private function _getStudiengangstyp($studiengang_kz)
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(
|
||||
array('studiengang_kz' => $studiengang_kz)
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$typStudiengang = current($data)->typ;
|
||||
|
||||
return $typStudiengang;
|
||||
}
|
||||
|
||||
/**
|
||||
* helper function to create ArrayStructure
|
||||
* actual studiensemester plus the 5 studiensemester in the past
|
||||
|
||||
* @return Array Studiensemester_kurzbz
|
||||
*/
|
||||
private function buildStudienerfolgSubmenu($lang, $uid, $semArray, $studiensemester_kurzbz, $fa = false)
|
||||
{
|
||||
$entries = [];
|
||||
|
||||
$xsl = $lang === "de" ? "Studienerfolg" : "StudienerfolgEng";
|
||||
$idPrefix = "submenu_studienerfolg_" . $lang . ($fa ? "_fa" : "");
|
||||
|
||||
$entries[] = buildDropdownEntryPrintArray(
|
||||
$idPrefix . "_aktuell",
|
||||
"ausgewähltes Semester",
|
||||
"xml=studienerfolg.rdf.php&xsl=$xsl&ss=$studiensemester_kurzbz" . ($fa ? "&typ=finanzamt" : ""),
|
||||
$uid
|
||||
);
|
||||
|
||||
//all semester
|
||||
$entries[] = buildDropdownEntryPrintArray(
|
||||
$idPrefix . "_all",
|
||||
"alle Semester",
|
||||
"xml=studienerfolg.rdf.php&xsl=$xsl&ss=$studiensemester_kurzbz&all=true" . ($fa ? "&typ=finanzamt" : ""),
|
||||
$uid
|
||||
);
|
||||
|
||||
//sem from array
|
||||
foreach ($semArray as $i => $sem) {
|
||||
$entries[] = buildDropdownEntryPrintArray(
|
||||
$idPrefix . ($i === 0 ? "_akt" : "_minus" . $i),
|
||||
$sem,
|
||||
"xml=studienerfolg.rdf.php&xsl=$xsl&ss=$sem" . ($fa ? "&typ=finanzamt" : ""),
|
||||
$uid
|
||||
);
|
||||
|
||||
}
|
||||
$order = 0;
|
||||
if ($lang === "de" && !$fa) $order = 75; // Studienerfolg
|
||||
if ($lang === "en" && !$fa) $order = 76; // Studienerfolg Englisch
|
||||
if ($lang === "de" && $fa) $order = 77; // Studienerfolg Finanzamt
|
||||
if ($lang === "en" && $fa) $order = 78; // Studienerfolg Finanzamt Englisch
|
||||
|
||||
return [
|
||||
"id" => $idPrefix,
|
||||
"type" => "submenu",
|
||||
"name" => "Studienerfolg " . ($fa ? " Finanzamt" : "") . ($lang === "de" ? "" : "Englisch") ,
|
||||
"order" => $order,
|
||||
"data" => $entries,
|
||||
];
|
||||
}
|
||||
|
||||
private function loadDropDownEntriesFinalExam($hasPermissionOutputformat, $stgTyp, $uid)
|
||||
{
|
||||
if ($stgTyp == 'b')
|
||||
$postfix = 'Bakk';
|
||||
else if ($stgTyp == 'm' || $stgTyp == 'd')
|
||||
$postfix = 'Master';
|
||||
else
|
||||
return [];
|
||||
|
||||
$arrayFinalExam = [
|
||||
'pruefungsprotokoll' => [
|
||||
'de' => [
|
||||
'Bakk' => 'PrProtBA',
|
||||
'Master' => 'PrProtMA',
|
||||
],
|
||||
'en' => [
|
||||
'Bakk' => 'PrProtBAEng',
|
||||
'Master' => 'PrProtMAEng',
|
||||
],
|
||||
],
|
||||
'pruefungszeugnis' => [
|
||||
'de' => [
|
||||
'Bakk' => 'Bakkzeugnis',
|
||||
'Master' => 'Diplomzeugnis',
|
||||
],
|
||||
'en' => [
|
||||
'Bakk' => 'BakkzeugnisEng',
|
||||
'Master' => 'DiplomzeugnisEng',
|
||||
],
|
||||
],
|
||||
'urkunde' => [
|
||||
'de' => [
|
||||
'Bakk' => 'Bakkurkunde',
|
||||
'Master' => 'Diplomurkunde',
|
||||
],
|
||||
'en' => [
|
||||
'Bakk' => 'BakkurkundeEng',
|
||||
'Master' => 'DiplomurkundeEng',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$langLabels = [
|
||||
"de" => "Deutsch",
|
||||
"en" => "Englisch"
|
||||
];
|
||||
|
||||
$docLabels = [
|
||||
"pruefungsprotokoll" => "Prüfungsprotokoll",
|
||||
"pruefungszeugnis" => "Zeugnis",
|
||||
"urkunde" => "Urkunde"
|
||||
];
|
||||
|
||||
$submenuData = [];
|
||||
if ($hasPermissionOutputformat) {
|
||||
foreach ($arrayFinalExam as $docType => $langs) {
|
||||
foreach ($langs as $lang => $types) {
|
||||
$xsl = $types[$postfix];
|
||||
$idPrefix = $docType . "_" . $lang;
|
||||
|
||||
$baseName = $docLabels[$docType] . " " . $langLabels[$lang];
|
||||
$baseUrl = "xml=abschlusspruefung.rdf.php&xsl={$xsl}";
|
||||
|
||||
//3 outputformates
|
||||
foreach (["pdf", "odt", "docx"] as $format) {
|
||||
$submenuData[] = buildDropdownEntryPrintArray(
|
||||
$idPrefix . "_" . $format,
|
||||
$baseName . " (" . strtoupper($format) . ")",
|
||||
$baseUrl . "&output=" . $format,
|
||||
$uid
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($arrayFinalExam as $docType => $langs) {
|
||||
foreach ($langs as $lang => $types) {
|
||||
$xsl = $types[$postfix]; // Auswahl Bakk/Master für jeweilige Sprache
|
||||
$id = $docType . "_" . $lang;
|
||||
|
||||
$name = $docLabels[$docType] . " " . $langLabels[$lang];
|
||||
|
||||
$url = "xml=abschlusspruefung.rdf.php&xsl=" . $xsl . "&output=pdf";
|
||||
|
||||
$submenuData[] = buildDropdownEntryPrintArray($id, $name, $url, $uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return [
|
||||
"id" => "submenu_finalexam",
|
||||
"type" => "submenu",
|
||||
"name" => "Abschlussprüfung",
|
||||
"data" => $submenuData,
|
||||
"order" => null,
|
||||
"order" => 80,
|
||||
];
|
||||
}
|
||||
|
||||
private function loadDropDownEntriesBakkOrDipl($stgTyp, $uid)
|
||||
{
|
||||
$entries = [];
|
||||
|
||||
if ($stgTyp == 'b')
|
||||
{
|
||||
$entries[] = buildDropdownEntryPrintArray("bakkurkunde", "Bakkurkunde", "xml=abschlusspruefung.rdf.php&xsl=Bakkurkunde&output=pdf", $uid, 22, null);
|
||||
$entries[] = buildDropdownEntryPrintArray("bakkurkundeEng", "Bakkurkunde Englisch", "xml=abschlusspruefung.rdf.php&xsl=BakkurkundeEng&output=pdf", $uid, 23, null);
|
||||
}
|
||||
|
||||
if ($stgTyp == 'm' || $stgTyp == 'd')
|
||||
{
|
||||
$entries[] = buildDropdownEntryPrintArray("diplomurkunde", "Diplomurkunde", "xml=abschlusspruefung.rdf.php&xsl=Diplomurkunde&output=pdf", $uid, 27, null);
|
||||
$entries[] = buildDropdownEntryPrintArray("diplomurkundeEng", "Diplomurkunde Englisch", "xml=abschlusspruefung.rdf.php&xsl=DiplomurkundeEng&output=pdf", $uid, 28, null);
|
||||
}
|
||||
|
||||
return $entries;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about favorite verbände
|
||||
* Listens to ajax post calls to change the favorite verbände data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Favorites extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['stv_favorites']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithSuccess(null);
|
||||
else
|
||||
$this->terminateWithSuccess($data['stv_favorites'] ?? null);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('favorites', 'Favorites', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$favorites = $this->input->post('favorites');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the Studiengang filter
|
||||
* Listens to ajax post calls to change the Studiengang filter data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Filter extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Calls the parent's constructor and prepares libraries and phrases
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStg' => self::PERM_LOGGED,
|
||||
'setStg' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Get current setting
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getStg()
|
||||
{
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['kontofilterstg']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data['kontofilterstg'] == 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current setting
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setStg()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$studiengang_kz = $this->input->post('studiengang_kz');
|
||||
|
||||
if ($studiengang_kz === null) {
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'kontofilterstg', $studiengang_kz ? 'true' : 'false');
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class GemeinsameStudien extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudien' => ['admin:r', 'assistenz:r'],
|
||||
'loadStudie' => ['admin:r', 'assistenz:r'],
|
||||
'insertStudie' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateStudie' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteStudie' => ['admin:rw', 'assistenz:rw'],
|
||||
'getProgramsStudien' => ['admin:r', 'assistenz:r'],
|
||||
'getTypenMobility' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
'getStudienprogramme' => ['admin:r', 'assistenz:r'],
|
||||
'getPartnerfirmen' => ['admin:r', 'assistenz:r'],
|
||||
'getStatiPrestudent' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'jointstudies'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('codex/Mobilitaet_model', 'MobilitaetModel');
|
||||
|
||||
//TODO(check if additional Permissions necessary): 'student/stammdaten'
|
||||
}
|
||||
|
||||
public function getStudien($prestudent_id)
|
||||
{
|
||||
$this->MobilitaetModel->addSelect('mobilitaet_id');
|
||||
$this->MobilitaetModel->addSelect('mobilitaetstyp_kurzbz');
|
||||
$this->MobilitaetModel->addSelect('prestudent_id');
|
||||
$this->MobilitaetModel->addSelect('studiensemester_kurzbz');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.mobilitaetsprogramm_code');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.gsprogramm_id');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.firma_id');
|
||||
$this->MobilitaetModel->addSelect('status_kurzbz');
|
||||
$this->MobilitaetModel->addSelect('ausbildungssemester');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.insertvon');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.insertamum');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.updatevon');
|
||||
$this->MobilitaetModel->addSelect('bis.tbl_mobilitaet.updateamum');
|
||||
$this->MobilitaetModel->addSelect('mp.kurzbz');
|
||||
$this->MobilitaetModel->addSelect('gp.gsprogrammtyp_kurzbz');
|
||||
$this->MobilitaetModel->addSelect('gp.bezeichnung as studienprogramm');
|
||||
$this->MobilitaetModel->addSelect('f.name as partner');
|
||||
|
||||
$this->MobilitaetModel->addJoin('bis.tbl_mobilitaetsprogramm mp', 'ON (mp.mobilitaetsprogramm_code = bis.tbl_mobilitaet.mobilitaetsprogramm_code)', 'LEFT');
|
||||
$this->MobilitaetModel->addJoin('bis.tbl_gsprogramm gp', 'ON (gp.gsprogramm_id = bis.tbl_mobilitaet.gsprogramm_id)', 'LEFT');
|
||||
$this->MobilitaetModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = bis.tbl_mobilitaet.firma_id)', 'LEFT');
|
||||
|
||||
$result = $this->MobilitaetModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getTypenMobility()
|
||||
{
|
||||
$this->load->model('codex/Mobilitaetstyp_model', 'MobilitaetstypModel');
|
||||
|
||||
$result = $this->MobilitaetstypModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStudienprogramme()
|
||||
{
|
||||
$this->load->model('codex/Gsprogramm_model', 'GsprogrammModel');
|
||||
|
||||
$result = $this->GsprogrammModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getPartnerfirmen()
|
||||
{
|
||||
$this->load->model('ressource/Firma_model', 'FirmaModel');
|
||||
|
||||
$result = $this->FirmaModel->loadWhere(
|
||||
['partner_code !=' => null]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStatiPrestudent()
|
||||
{
|
||||
$this->load->model('crm/Status_model', 'StatusModel');
|
||||
|
||||
$result = $this->StatusModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadStudie($mobilitaet_id)
|
||||
{
|
||||
$result = $this->MobilitaetModel->load($mobilitaet_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function insertStudie()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
if(!$prestudent_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
$ausbildungssemester = (isset($formData['ausbildungssemester']) && !empty($formData['ausbildungssemester']))
|
||||
? $formData['ausbildungssemester']
|
||||
: null;
|
||||
$mobilitaetstyp_kurzbz = (isset($formData['mobilitaetstyp_kurzbz']) && !empty($formData['mobilitaetstyp_kurzbz']))
|
||||
? $formData['mobilitaetstyp_kurzbz']
|
||||
: null;
|
||||
$studiensemester_kurzbz = (isset($formData['studiensemester_kurzbz']) && !empty($formData['studiensemester_kurzbz']))
|
||||
? $formData['studiensemester_kurzbz'] : null;
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('mobilitaetstyp_kurzbz', 'Typ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Typ'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studiensemester'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'required|numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Ausbildungssemester']),
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ausbildungssemester']),
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$status_kurzbz = (isset($formData['status_kurzbz']) && !empty($formData['status_kurzbz']))
|
||||
? $formData['status_kurzbz']
|
||||
: null;
|
||||
$mobilitaetsprogramm_code = (isset($formData['mobilitaetsprogramm_code']) && !empty($formData['mobilitaetsprogramm_code']))
|
||||
? $formData['mobilitaetsprogramm_code']
|
||||
: null;
|
||||
$gsprogramm_id = (isset($formData['gsprogramm_id']) && !empty($formData['gsprogramm_id']))
|
||||
? $formData['gsprogramm_id']
|
||||
: null;
|
||||
$firma_id= (isset($formData['firma_id']) && !empty($formData['firma_id'])) ? $formData['firma_id'] : null;
|
||||
|
||||
$result = $this->MobilitaetModel->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'mobilitaetstyp_kurzbz' =>$mobilitaetstyp_kurzbz,
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'studiensemester_kurzbz' =>$studiensemester_kurzbz,
|
||||
'mobilitaetsprogramm_code' => $mobilitaetsprogramm_code,
|
||||
'gsprogramm_id' => $gsprogramm_id,
|
||||
'firma_id' => $firma_id,
|
||||
'ausbildungssemester' =>$ausbildungssemester,
|
||||
'insertvon' => $authUID,
|
||||
'insertamum' => date('c'),
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function updateStudie()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
if(!$prestudent_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$mobilitaet_id = (isset($formData['mobilitaet_id']) && !empty($formData['mobilitaet_id']))
|
||||
? $formData['mobilitaet_id'] :
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Mobilitaet ID']), self::ERROR_TYPE_GENERAL);
|
||||
$ausbildungssemester = (isset($formData['ausbildungssemester']) && !empty($formData['ausbildungssemester']))
|
||||
? $formData['ausbildungssemester']
|
||||
: null;
|
||||
$mobilitaetstyp_kurzbz = (isset($formData['mobilitaetstyp_kurzbz']) && !empty($formData['mobilitaetstyp_kurzbz']))
|
||||
? $formData['mobilitaetstyp_kurzbz']
|
||||
: null;
|
||||
$studiensemester_kurzbz = (isset($formData['studiensemester_kurzbz']) && !empty($formData['studiensemester_kurzbz']))
|
||||
? $formData['studiensemester_kurzbz']
|
||||
: null;
|
||||
|
||||
$this->form_validation->set_data($formData);
|
||||
|
||||
$this->form_validation->set_rules('mobilitaetstyp_kurzbz', 'Typ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Typ'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studiensemester'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'required|numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Ausbildungssemester']),
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ausbildungssemester']),
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$status_kurzbz = (isset($formData['status_kurzbz']) && !empty($formData['status_kurzbz'])) ? $formData['status_kurzbz'] : null;
|
||||
$mobilitaetsprogramm_code = (isset($formData['mobilitaetsprogramm_code']) && !empty($formData['mobilitaetsprogramm_code']))
|
||||
? $formData['mobilitaetsprogramm_code']
|
||||
: null;
|
||||
$gsprogramm_id = (isset($formData['gsprogramm_id']) && !empty($formData['gsprogramm_id']))
|
||||
? $formData['gsprogramm_id']
|
||||
: null;
|
||||
$firma_id= (isset($formData['firma_id']) && !empty($formData['firma_id'])) ? $formData['firma_id'] : null;
|
||||
|
||||
$result = $this->MobilitaetModel->update(
|
||||
[
|
||||
'mobilitaet_id' => $mobilitaet_id,
|
||||
],
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'mobilitaetstyp_kurzbz' => $mobilitaetstyp_kurzbz,
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'mobilitaetsprogramm_code' => $mobilitaetsprogramm_code,
|
||||
'gsprogramm_id' => $gsprogramm_id,
|
||||
'firma_id' => $firma_id,
|
||||
'ausbildungssemester' => $ausbildungssemester,
|
||||
'updatevon' => $authUID,
|
||||
'updateamum' => date('c'),
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteStudie($mobilitaet_id)
|
||||
{
|
||||
if(!$mobilitaet_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Mobilität ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$result = $this->MobilitaetModel->delete(
|
||||
array('mobilitaet_id' => $mobilitaet_id)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,700 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about grades
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Grades extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'list' => 'student/noten:r',
|
||||
'getCertificate' => 'student/noten:r',
|
||||
'getTeacherProposal' => 'student/noten:r',
|
||||
'getRepeaterGrades' => 'student/noten:r',
|
||||
'updateCertificate' => ['admin:w', 'assistenz:w'],
|
||||
'deleteCertificate' => ['admin:w', 'assistenz:w'],
|
||||
'copyTeacherProposalToCertificate' => 'student/noten:w',
|
||||
'copyRepeaterGradeToCertificate' => 'student/noten:w',
|
||||
'getGradeFromPoints' => 'student/noten:r'
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'stv',
|
||||
'person',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all possible grades
|
||||
* (Entries in lehre.tbl_note)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function list()
|
||||
{
|
||||
$this->load->model('codex/Note_model', 'NoteModel');
|
||||
|
||||
$this->NoteModel->addOrder('notenwert', 'ASC');
|
||||
$this->NoteModel->addOrder('bezeichnung', 'ASC');
|
||||
|
||||
$result = $this->NoteModel->load();
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
/**
|
||||
* List grades for the certificate of a prestudent.
|
||||
* (Entries in lehre.tbl_zeugnisnote)
|
||||
*
|
||||
* @param string $prestudent_id
|
||||
* @param string|null $studiensemester_kurzbz If studiensemester_kurzbz only this semesters grades will be loaded, otherwise all semesters grades will be loaded.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getCertificate($prestudent_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->StudentModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id
|
||||
]);
|
||||
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
if (!$student)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$student_uid = current($student)->student_uid;
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->ZeugnisnoteModel->getZeugnisnoten($student_uid, $studiensemester_kurzbz);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
/**
|
||||
* List grades of a prestudent that teachers gave.
|
||||
* (Entries in campus.tbl_lvgesamtnote)
|
||||
*
|
||||
* @param string $prestudent_id
|
||||
* @param string|null $studiensemester_kurzbz If studiensemester_kurzbz only this semesters grades will be loaded, otherwise all semesters grades will be loaded.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getTeacherProposal($prestudent_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->StudentModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id
|
||||
]);
|
||||
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
if (!$student)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
|
||||
$student_uid = current($student)->student_uid;
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten(null, $student_uid, $studiensemester_kurzbz);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
/**
|
||||
* List grades of a prestudent that an assistant marked as already done
|
||||
* or as not allowed because of the repeating of a semester.
|
||||
*
|
||||
* @param string $prestudent_id
|
||||
* @param string|false $studiensemester_kurzbz If studiensemester_kurzbz only this semesters grades will be loaded, otherwise all semesters grades will be loaded.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getRepeaterGrades($prestudent_id, $studiensemester_kurzbz = false)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->library('AntragLib');
|
||||
|
||||
if ($studiensemester_kurzbz !== false && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $studiensemester_kurzbz);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update or Insert a grade for the certificate of a prestudent.
|
||||
* (Entry in lehre.tbl_zeugnisnote)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateCertificate()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules("lehrveranstaltung_id", $this->p->t('lehre', 'lehrveranstaltung'), "required|integer");
|
||||
$this->form_validation->set_rules("student_uid", $this->p->t('person', 'student'), "required");
|
||||
$this->form_validation->set_rules("studiensemester_kurzbz", $this->p->t('lehre', 'studiensemester'), "required");
|
||||
$this->form_validation->set_rules('note', $this->p->t('lehre', 'note'), 'required|numeric');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$student_uid = $this->input->post('student_uid');
|
||||
$lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id');
|
||||
$note = $this->input->post('note');
|
||||
$authUID = getAuthUID();
|
||||
$now = date('c');
|
||||
|
||||
// NOTE(chris): Stg Permissions
|
||||
if (!$this->hasPermissionUpdate($lehrveranstaltung_id, $student_uid))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin', 'assistenz']]);
|
||||
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
|
||||
$result = $this->ZeugnisnoteModel->load([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
]);
|
||||
$current = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($current) {
|
||||
$result = $this->ZeugnisnoteModel->update([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
], [
|
||||
'note' => $note,
|
||||
'benotungsdatum' => $now,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $authUID
|
||||
]);
|
||||
} else {
|
||||
$result = $this->ZeugnisnoteModel->insert([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
'note' => $note,
|
||||
'benotungsdatum' => $now,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $authUID
|
||||
]);
|
||||
}
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a grade from the certificate of a prestudent.
|
||||
* (Entry in lehre.tbl_zeugnisnote)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteCertificate()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules("lehrveranstaltung_id", $this->p->t('lehre', 'lehrveranstaltung'), "required|integer");
|
||||
$this->form_validation->set_rules("student_uid", $this->p->t('person', 'student'), "required");
|
||||
$this->form_validation->set_rules("studiensemester_kurzbz", $this->p->t('lehre', 'studiensemester'), "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$student_uid = $this->input->post('student_uid');
|
||||
$lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id');
|
||||
|
||||
// NOTE(chris): Stg Permissions
|
||||
if (!$this->hasPermissionDelete($lehrveranstaltung_id, $student_uid))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin', 'assistenz']]);
|
||||
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
|
||||
$result = $this->ZeugnisnoteModel->delete([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a grade that teachers gave to the certificate of a prestudent.
|
||||
* (Entry in campus.tbl_lvgesamtnote to an entry in lehre.tbl_zeugnisnote)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function copyTeacherProposalToCertificate()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules("lehrveranstaltung_id", $this->p->t('lehre', 'lehrveranstaltung'), "required|integer");
|
||||
$this->form_validation->set_rules("student_uid", $this->p->t('person', 'student'), "required");
|
||||
$this->form_validation->set_rules("studiensemester_kurzbz", $this->p->t('lehre', 'studiensemester'), "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id');
|
||||
$student_uid = $this->input->post('student_uid');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
// NOTE(chris): Stg Permissions
|
||||
if (!$this->hasPermissionCopy($lehrveranstaltung_id, $student_uid))
|
||||
return $this->_outputAuthError([$this->router->method => 'student/noten']);
|
||||
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
|
||||
$result = $this->LvgesamtnoteModel->load([
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
]);
|
||||
$teacherGrade = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$teacherGrade)
|
||||
show_404();
|
||||
|
||||
$teacherGrade = current($teacherGrade);
|
||||
|
||||
$data = [
|
||||
'note' => $teacherGrade->note,
|
||||
'punkte' => $teacherGrade->punkte,
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $teacherGrade->benotungsdatum,
|
||||
'bemerkung' => $teacherGrade->bemerkung
|
||||
];
|
||||
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
|
||||
$this->ZeugnisnoteModel->addJoin('lehre.tbl_note n', 'note');
|
||||
$result = $this->ZeugnisnoteModel->load([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
]);
|
||||
$certificateGrade = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($certificateGrade) {
|
||||
$certificateGrade = current($certificateGrade);
|
||||
|
||||
if (!$certificateGrade->lkt_ueberschreibbar)
|
||||
$this->terminateWithError($this->p->t("stv", "grades_error_overwrite"));
|
||||
|
||||
// NOTE(chris): update
|
||||
$data['updateamum'] = $data['uebernahmedatum'];
|
||||
$data['updatevon'] = $authUID;
|
||||
|
||||
$this->ZeugnisnoteModel->update([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
], $data);
|
||||
} else {
|
||||
// NOTE(chris): insert
|
||||
$data['insertamum'] = $data['uebernahmedatum'];
|
||||
$data['insertvon'] = $authUID;
|
||||
$data['lehrveranstaltung_id'] = $lehrveranstaltung_id;
|
||||
$data['student_uid'] = $student_uid;
|
||||
$data['studiensemester_kurzbz'] = $studiensemester_kurzbz;
|
||||
|
||||
$this->ZeugnisnoteModel->insert($data);
|
||||
|
||||
if (defined('FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN')
|
||||
&& FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN) {
|
||||
$result = $this->addTestsForGrade(
|
||||
$studiensemester_kurzbz,
|
||||
$student_uid,
|
||||
$lehrveranstaltung_id,
|
||||
$teacherGrade->note,
|
||||
$teacherGrade->punkte
|
||||
);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a grade that was marked by an assistant as already done or not
|
||||
* allowed because of the repeating of a semester to the certificate of a
|
||||
* prestudent.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function copyRepeaterGradeToCertificate()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules("studierendenantrag_lehrveranstaltung_id", "studierendenantrag_lehrveranstaltung_id", "required|integer");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id');
|
||||
$authUID = getAuthUID();
|
||||
|
||||
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
|
||||
|
||||
$this->StudierendenantraglehrveranstaltungModel->addSelect("tbl_studierendenantrag_lehrveranstaltung.*");
|
||||
$this->StudierendenantraglehrveranstaltungModel->addSelect("student_uid");
|
||||
$this->StudierendenantraglehrveranstaltungModel->addJoin("campus.tbl_studierendenantrag", "studierendenantrag_id");
|
||||
$this->StudierendenantraglehrveranstaltungModel->addJoin("public.tbl_student", "prestudent_id", "LEFT");
|
||||
|
||||
$result = $this->StudierendenantraglehrveranstaltungModel->load($id);
|
||||
$repeaterGrade = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$repeaterGrade)
|
||||
show_404();
|
||||
|
||||
$repeaterGrade = current($repeaterGrade);
|
||||
|
||||
// NOTE(chris): Stg Permissions
|
||||
if (!$this->hasPermissionCopy($repeaterGrade->lehrveranstaltung_id, $repeaterGrade->student_uid))
|
||||
return $this->_outputAuthError([$this->router->method => 'student/noten']);
|
||||
|
||||
$data = [
|
||||
'note' => $repeaterGrade->note,
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $repeaterGrade->insertamum,
|
||||
'bemerkung' => $repeaterGrade->anmerkung
|
||||
];
|
||||
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
|
||||
$result = $this->ZeugnisnoteModel->load([
|
||||
$repeaterGrade->studiensemester_kurzbz,
|
||||
$repeaterGrade->student_uid,
|
||||
$repeaterGrade->lehrveranstaltung_id
|
||||
]);
|
||||
$certificateGrade = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($certificateGrade) {
|
||||
// NOTE(chris): update
|
||||
$data['updateamum'] = $data['uebernahmedatum'];
|
||||
$data['updatevon'] = $authUID;
|
||||
|
||||
$this->ZeugnisnoteModel->update([
|
||||
$repeaterGrade->studiensemester_kurzbz,
|
||||
$repeaterGrade->student_uid,
|
||||
$repeaterGrade->lehrveranstaltung_id
|
||||
], $data);
|
||||
} else {
|
||||
// NOTE(chris): insert
|
||||
$data['insertamum'] = $data['uebernahmedatum'];
|
||||
$data['insertvon'] = $authUID;
|
||||
$data['lehrveranstaltung_id'] = $repeaterGrade->lehrveranstaltung_id;
|
||||
$data['student_uid'] = $repeaterGrade->student_uid;
|
||||
$data['studiensemester_kurzbz'] = $repeaterGrade->studiensemester_kurzbz;
|
||||
|
||||
$this->ZeugnisnoteModel->insert($data);
|
||||
}
|
||||
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the grade from the points using the gradingkey
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getGradeFromPoints()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules("lehrveranstaltung_id", $this->p->t('lehre', 'lehrveranstaltung'), "required|integer");
|
||||
$this->form_validation->set_rules("points", $this->p->t("stv", "grades_points"), "required|numeric");
|
||||
$this->form_validation->set_rules("studiensemester_kurzbz", $this->p->t("lehre", "studiensemester"), "required|regex_match[/^[WS]S[0-9]{4}$/]");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
if (!$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$this->load->model('education/Notenschluesselaufteilung_model', 'NotenschluesselaufteilungModel');
|
||||
|
||||
$result = $this->NotenschluesselaufteilungModel->getNote(
|
||||
$this->input->post('points'),
|
||||
$this->input->post('lehrveranstaltung_id'),
|
||||
$studiensemester_kurzbz
|
||||
);
|
||||
|
||||
$note = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($note);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that adds tests for a student
|
||||
* (Entries in lehre.tbl_pruefung)
|
||||
*
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param string $student_uid
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param integer $note
|
||||
* @param numeric $punkte
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
protected function addTestsForGrade($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id, $note, $punkte)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
// Get Lehreinheit
|
||||
$result = $this->LehrveranstaltungModel->getLeByStudent($student_uid, $studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
if (!hasData($result))
|
||||
return error($this->p->t("stv", "grades_error_lehreinheit_id"));
|
||||
$le = current(getData($result));
|
||||
|
||||
// Prepare
|
||||
$this->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
$data = [
|
||||
"student_uid" => $student_uid,
|
||||
"lehreinheit_id" => $le->lehreinheit_id,
|
||||
"datum" => date('Y-m-d'),
|
||||
"pruefungstyp_kurzbz" => "Termin1",
|
||||
"note" => $note
|
||||
];
|
||||
|
||||
if (defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE)
|
||||
$data["punkte"] = $punkte;
|
||||
|
||||
// Get Anwesenheit
|
||||
$this->load->model('education/Anwesenheit_model', 'AnwesenheitModel');
|
||||
$result = $this->AnwesenheitModel->loadAnwesenheitStudiensemester($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$anwesenheit = getData($result);
|
||||
|
||||
if ($anwesenheit && (float)current($anwesenheit)->prozent < FAS_ANWESENHEIT_ROT) {
|
||||
// Get Anwesenheitsbefreiung
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$result = $this->BenutzerfunktionModel->getBenutzerFunktionByUidInStdsem($student_uid, $studiensemester_kurzbz, 'awbefreit');
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
$anwesenheitsbefreit = hasData($result);
|
||||
|
||||
// Wenn nicht Anwesenheitsbefreit und Anwesenheit unter einem bestimmten Prozentsatz fällt dann wird ein Pruefungsantritt abgezogen
|
||||
if (!$anwesenheitsbefreit) {
|
||||
$data2 = $data;
|
||||
$data2["note"] = 7;
|
||||
if (isset($data2["punkte"]))
|
||||
unset($data2["punkte"]);
|
||||
|
||||
$result = $this->LePruefungModel->insert($data2);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
$data["pruefungstyp_kurzbz"] = "Termin2";
|
||||
}
|
||||
}
|
||||
|
||||
return $this->LePruefungModel->insert($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to check permissions for updateCertificate()
|
||||
*
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param string $student_uid
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function hasPermissionUpdate($lehrveranstaltung_id, $student_uid)
|
||||
{
|
||||
if ($lehrveranstaltung_id === null || $student_uid === null)
|
||||
return true;
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
if (isError($result) || !hasData($result))
|
||||
return false;
|
||||
|
||||
$student = current(getData($result));
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('admin', 'suid', $student->studiengang_kz))
|
||||
return true;
|
||||
if ($this->permissionlib->isBerechtigt('assistenz', 'suid', $student->studiengang_kz))
|
||||
return true;
|
||||
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$result = $this->StudienplanModel->getAllOesForLv($lehrveranstaltung_id);
|
||||
if (isError($result))
|
||||
return false;
|
||||
|
||||
$oes = getData($result) ?: [];
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->getStg($lehrveranstaltung_id);
|
||||
if (isError($result))
|
||||
return false;
|
||||
|
||||
if (hasData($result))
|
||||
$oes[] = current(getData($result));
|
||||
|
||||
foreach ($oes as $oe) {
|
||||
if ($this->permissionlib->isBerechtigt('admin', 'suid', $oe->oe_kurzbz))
|
||||
return true;
|
||||
if ($this->permissionlib->isBerechtigt('assistenz', 'suid', $oe->oe_kurzbz))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to check permissions for deleteCertificate()
|
||||
*
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param string $student_uid
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function hasPermissionDelete($lehrveranstaltung_id, $student_uid)
|
||||
{
|
||||
if ($lehrveranstaltung_id === null || $student_uid === null)
|
||||
return true;
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
if (isError($result) || !hasData($result))
|
||||
return false;
|
||||
|
||||
$student = current(getData($result));
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('admin', 'suid', $student->studiengang_kz))
|
||||
return true;
|
||||
if ($this->permissionlib->isBerechtigt('assistenz', 'suid', $student->studiengang_kz))
|
||||
return true;
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
if (isError($result) || !hasData($result))
|
||||
return false;
|
||||
|
||||
$oe = current(getData($result));
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('admin', 'suid', $oe->oe_kurzbz))
|
||||
return true;
|
||||
if ($this->permissionlib->isBerechtigt('assistenz', 'suid', $oe->oe_kurzbz))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to check permissions for
|
||||
* copyTeacherProposalToCertificate() and copyRepeaterGradeToCertificate()
|
||||
*
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param string $student_uid
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function hasPermissionCopy($lehrveranstaltung_id, $student_uid)
|
||||
{
|
||||
if ($lehrveranstaltung_id === null || $student_uid === null)
|
||||
return true;
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
if (isError($result) || !hasData($result))
|
||||
return false;
|
||||
|
||||
$student = current(getData($result));
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('student/noten', 'suid', $student->studiengang_kz))
|
||||
return true;
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
if (isError($result) || !hasData($result))
|
||||
return false;
|
||||
|
||||
$oe = current(getData($result));
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('student/noten', 'suid', $oe->oe_kurzbz))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Gruppen extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'add' => ['admin:rw', 'assistenz:rw'],
|
||||
'search' => ['admin:r', 'assistenz:r'],
|
||||
'getGruppen' => ['admin:r', 'assistenz:r'],
|
||||
'deleteGruppe' => ['admin:rw', 'assistenz:rw'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'gruppenmanagement',
|
||||
'lehre'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
|
||||
$this->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$this->load->library("form_validation");
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'gruppe_kurzbz',
|
||||
$this->p->t('gruppenmanagement', 'gruppe'),
|
||||
'required|is_in_db[organisation/Gruppe_model]',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired'),
|
||||
'is_in_db' => $this->p->t('ui', 'error_fieldNotFound')
|
||||
]
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'uid',
|
||||
$this->p->t('ui', 'student_uid'),
|
||||
'required|is_in_db[crm/Student_model:student_uid]',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired'),
|
||||
'is_in_db' => $this->p->t('ui', 'error_fieldNotFound')
|
||||
]
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'studiensemester_kurzbz',
|
||||
$this->p->t('lehre', 'studiensemester'),
|
||||
'required|is_in_db[organisation/Studiensemester_model]',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired'),
|
||||
'is_in_db' => $this->p->t('ui', 'error_fieldNotFound')
|
||||
]
|
||||
);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$gruppe_kurzbz = $this->input->post('gruppe_kurzbz');
|
||||
$uid = $this->input->post('uid');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
|
||||
$result = $this->BenutzergruppeModel->load([
|
||||
$gruppe_kurzbz,
|
||||
$uid
|
||||
]);
|
||||
$benutzergruppe = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($benutzergruppe) {
|
||||
$this->terminateWithError(
|
||||
$this->p->t('gruppenmanagement', 'error_alreadyInGroup', [
|
||||
'uid' => $uid,
|
||||
'studiensemester_kurzbz' => current($benutzergruppe)->studiensemester_kurzbz
|
||||
]),
|
||||
self::ERROR_TYPE_GENERAL
|
||||
);
|
||||
}
|
||||
|
||||
$result = $this->BenutzergruppeModel->insert([
|
||||
'uid' => $uid,
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
]);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
public function search()
|
||||
{
|
||||
$query = $this->input->post('query');
|
||||
if (!$query)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
// add query to where clause
|
||||
$query = strtoupper($query);
|
||||
$query = $this->GruppeModel->db->escape_like_str($query);
|
||||
$query = '%' . str_replace(' ', '%', $query) . '%';
|
||||
|
||||
$this->GruppeModel->db->group_start();
|
||||
$this->GruppeModel->db->or_like('UPPER(gruppe_kurzbz)', $query, 'none', false);
|
||||
$this->GruppeModel->db->or_like('UPPER(bezeichnung)', $query, 'none', false);
|
||||
$this->GruppeModel->db->or_like('UPPER(beschreibung)', $query, 'none', false);
|
||||
$this->GruppeModel->db->group_end();
|
||||
|
||||
// add stg sorting 1
|
||||
$studiengang_kz = $this->input->post('studiengang_kz');
|
||||
$sort_stg = $studiengang_kz ? "WHEN studiengang_kz = " . $this->GruppeModel->escape($studiengang_kz) . " THEN 0" : "";
|
||||
|
||||
// add stg sorting 2
|
||||
$studiengang_kzs = [];
|
||||
$result = $this->permissionlib->getSTG_isEntitledFor('admin');
|
||||
if ($result)
|
||||
$studiengang_kzs = array_merge($studiengang_kzs, $result);
|
||||
$result = $this->permissionlib->getSTG_isEntitledFor('assistenz');
|
||||
if ($result)
|
||||
$studiengang_kzs = array_merge($studiengang_kzs, $result);
|
||||
|
||||
// selects
|
||||
$this->GruppeModel->addSelect("*");
|
||||
$this->GruppeModel->addSelect("CASE
|
||||
" . $sort_stg . "
|
||||
WHEN studiengang_kz IN (" . implode(",", $this->GruppeModel->db->escape($studiengang_kzs)) . ")
|
||||
THEN 1
|
||||
ELSE 2
|
||||
END AS sort_stg");
|
||||
|
||||
// ordering
|
||||
$this->GruppeModel->addOrder("sort_stg");
|
||||
$this->GruppeModel->addOrder("sort");
|
||||
$this->GruppeModel->addOrder("gruppe_kurzbz");
|
||||
|
||||
// default where clause & execute
|
||||
$result = $this->GruppeModel->loadWhere([
|
||||
'lehre' => true,
|
||||
'sichtbar' => true,
|
||||
'aktiv' => true,
|
||||
'direktinskription' => false,
|
||||
'generiert' => false
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getGruppen($student_uid)
|
||||
{
|
||||
$this->BenutzergruppeModel->addSelect('gruppe_kurzbz');
|
||||
$this->BenutzergruppeModel->addSelect('bezeichnung');
|
||||
$this->BenutzergruppeModel->addSelect('generiert');
|
||||
$this->BenutzergruppeModel->addSelect('uid');
|
||||
$this->BenutzergruppeModel->addSelect('studiensemester_kurzbz');
|
||||
$this->BenutzergruppeModel->addJoin('public.tbl_gruppe', 'gruppe_kurzbz');
|
||||
$this->BenutzergruppeModel->addOrder('bezeichnung', 'ASC');
|
||||
|
||||
$result = $this->BenutzergruppeModel->loadWhere(
|
||||
array(
|
||||
'uid' => $student_uid
|
||||
)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteGruppe()
|
||||
{
|
||||
$this->load->library("form_validation");
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'uid',
|
||||
$this->p->t('person', 'UID'),
|
||||
'required',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired')
|
||||
]
|
||||
);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'gruppe_kurzbz',
|
||||
$this->p->t('gruppenmanagement', 'gruppe'),
|
||||
'required',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired')
|
||||
]
|
||||
);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$uid = $this->input->post('uid');
|
||||
$gruppe_kurzbz = $this->input->post('gruppe_kurzbz');
|
||||
|
||||
// Validate if automatic group generation
|
||||
$result = $this->GruppeModel->loadWhere([
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz
|
||||
]);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$generation = current($data);
|
||||
|
||||
if ($generation->generiert)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('gruppenmanagement', 'error_deleteGeneratedGroups'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->BenutzergruppeModel->delete([
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz,
|
||||
'uid' => $uid
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,812 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Kontakt extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAdressen' => ['admin:r', 'assistenz:r'],
|
||||
'addNewAddress' => ['admin:rw', 'assistenz:rw'],
|
||||
'addNewContact' => ['admin:rw', 'assistenz:rw'],
|
||||
'addNewBankverbindung' => ['mitarbeiter/bankdaten:rw', 'student/bankdaten:rw'],
|
||||
'updateAddress' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateContact' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateBankverbindung' => ['mitarbeiter/bankdaten:rw', 'student/bankdaten:rw'],
|
||||
'loadAddress' => ['admin:r', 'assistenz:r'],
|
||||
'loadContact' => ['admin:r', 'assistenz:r'],
|
||||
'loadBankverbindung' => ['mitarbeiter/bankdaten:r', 'student/bankdaten:r'],
|
||||
'deleteAddress' => ['admin:rw', 'assistenz:rw'],
|
||||
'deleteContact' => ['admin:rw','assistenz:rw'],
|
||||
'deleteBankverbindung' => ['mitarbeiter/bankdaten:rw','astudent/bankdaten:rw'],
|
||||
'getAdressentypen' => ['admin:r', 'assistenz:r'],
|
||||
'getKontakttypen' => ['admin:r', 'assistenz:r'],
|
||||
'getFirmen' => ['admin:r', 'assistenz:r'],
|
||||
'getStandorte' => ['admin:r', 'assistenz:r'],
|
||||
'getStandorteByFirma' => ['admin:r', 'assistenz:r'],
|
||||
'getKontakte' => ['admin:r', 'assistenz:r'],
|
||||
'getBankverbindung' => ['mitarbeiter/bankdaten:r', 'student/bankdaten:r'],
|
||||
'getAllFirmen' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
$this->load->model('ressource/firma_model', 'FirmaModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Kontakttyp_model', 'KontakttypModel');
|
||||
|
||||
// Extra Permissionchecks
|
||||
$permsMa = [];
|
||||
$permsStud = [];
|
||||
$permsDefault = null;
|
||||
switch ($this->router->method) {
|
||||
case 'getBankverbindung':
|
||||
case 'loadBankverbindung':
|
||||
$permsMa = ['mitarbeiter/bankdaten:r'];
|
||||
$permsStud = ['student/bankdaten:r'];
|
||||
break;
|
||||
case 'addNewBankverbindung':
|
||||
case 'updateBankverbindung':
|
||||
case 'deleteBankverbindung':
|
||||
$permsMa = ['mitarbeiter/bankdaten:rw'];
|
||||
$permsStud = ['student/bankdaten:rw'];
|
||||
break;
|
||||
case 'getAdressen':
|
||||
case 'getKontakte':
|
||||
case 'loadAddress':
|
||||
case 'loadContact':
|
||||
$permsMa = $permsStud = $permsDefault = ['admin:r', 'assistenz:r'];
|
||||
break;
|
||||
case 'addNewAddress':
|
||||
case 'addNewContact':
|
||||
case 'updateAddress':
|
||||
case 'updateContact':
|
||||
case 'deleteAddress':
|
||||
case 'deleteContact':
|
||||
$permsMa = $permsStud = $permsDefault = ['admin:rw', 'assistenz:rw'];
|
||||
break;
|
||||
}
|
||||
if ($this->router->method == 'getAdressen'
|
||||
|| $this->router->method == 'getKontakte'
|
||||
|| $this->router->method == 'getBankverbindung'
|
||||
|| $this->router->method == 'addNewAddress'
|
||||
|| $this->router->method == 'addNewContact'
|
||||
|| $this->router->method == 'addNewBankverbindung'
|
||||
) {
|
||||
$person_id = current(array_slice($this->uri->rsegments, 2));
|
||||
|
||||
if (is_null($person_id) || !ctype_digit((string)$person_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->checkPermissionsForPerson($person_id, $permsMa, $permsStud, $permsDefault);
|
||||
} elseif ($this->router->method == 'loadAddress'
|
||||
|| $this->router->method == 'loadContact'
|
||||
|| $this->router->method == 'loadBankverbindung'
|
||||
|| $this->router->method == 'updateAddress'
|
||||
|| $this->router->method == 'updateContact'
|
||||
|| $this->router->method == 'updateBankverbindung'
|
||||
|| $this->router->method == 'deleteAddress'
|
||||
|| $this->router->method == 'deleteContact'
|
||||
|| $this->router->method == 'deleteBankverbindung'
|
||||
) {
|
||||
if($this->input->post('address_id'))
|
||||
$id = $this->input->post('address_id');
|
||||
if($this->input->post('adresse_id'))
|
||||
$id = $this->input->post('adresse_id');
|
||||
if($this->input->post('bankverbindung_id'))
|
||||
$id = $this->input->post('bankverbindung_id');
|
||||
if($this->input->post('kontakt_id'))
|
||||
$id = $this->input->post('kontakt_id');
|
||||
|
||||
$model = 'person/Adresse_model';
|
||||
if ($this->router->method == 'loadContact'
|
||||
|| $this->router->method == 'updateContact'
|
||||
|| $this->router->method == 'deleteContact'
|
||||
) {
|
||||
$model = 'person/Kontakt_model';
|
||||
} elseif ($this->router->method == 'loadBankverbindung'
|
||||
|| $this->router->method == 'updateBankverbindung'
|
||||
|| $this->router->method == 'deleteBankverbindung'
|
||||
) {
|
||||
$model = 'person/Bankverbindung_model';
|
||||
}
|
||||
|
||||
if (!isset($id) || !ctype_digit((string)$id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model($model, 'TempModel');
|
||||
$result = $this->TempModel->load($id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if (!$result)
|
||||
show_404();
|
||||
|
||||
$person_id = current($data)->person_id;
|
||||
|
||||
$this->checkPermissionsForPerson($person_id, $permsMa, $permsStud, $permsDefault);
|
||||
}
|
||||
}
|
||||
public function getAdressen($person_id)
|
||||
{
|
||||
$this->AdresseModel->addSelect("public.tbl_adresse.*,
|
||||
(CASE
|
||||
WHEN public.tbl_adresse.updateamum >= public.tbl_adresse.insertamum
|
||||
THEN public.tbl_adresse.updateamum
|
||||
ELSE public.tbl_adresse.insertamum
|
||||
END) AS lastUpdate");
|
||||
$this->AdresseModel->addSelect('t.*');
|
||||
$this->AdresseModel->addSelect('f.firma_id');
|
||||
$this->AdresseModel->addSelect('f.name as firmenname');
|
||||
$this->AdresseModel->addJoin('public.tbl_adressentyp t', 'ON (t.adressentyp_kurzbz = public.tbl_adresse.typ)');
|
||||
$this->AdresseModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = public.tbl_adresse.firma_id)', 'LEFT');
|
||||
|
||||
$result = $this->AdresseModel->loadWhere(
|
||||
array('person_id' => $person_id)
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function addNewAddress($person_id)
|
||||
{
|
||||
$this->form_validation->set_data(['address.plz' => $_POST['plz']]);
|
||||
|
||||
$this->form_validation->set_rules('address.plz', 'PLZ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']),
|
||||
]);
|
||||
|
||||
if(isset($_POST['nation']) && $_POST['nation'] == 'A')
|
||||
{
|
||||
$this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']),
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ'])
|
||||
]);
|
||||
}
|
||||
|
||||
if(isset($_POST['gemeinde']) && isset($_POST['ort']) && isset($_POST['nation']) && $_POST['nation'] == 'A')
|
||||
{
|
||||
$this->form_validation->set_rules('address.plz', 'Postleitzahl', 'callback_validateLocationCombination', [
|
||||
'validateLocationCombination' => $this->p->t('ui', 'error_location_combination')
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$co_name = isset($_POST['co_name']) ? $_POST['co_name'] : null;
|
||||
$strasse = isset($_POST['strasse']) ? $_POST['strasse'] : null;
|
||||
$ort = isset($_POST['ort']) ? $_POST['ort'] : null;
|
||||
$gemeinde = isset($_POST['gemeinde']) ? $_POST['gemeinde'] : null;
|
||||
$nation = isset($_POST['nation']) ? $_POST['nation'] : null;
|
||||
$name = isset($_POST['name']) ? $_POST['name'] : null;
|
||||
$typ = isset($_POST['typ']) ? $_POST['typ'] : null;
|
||||
$anmerkung = isset($_POST['anmerkung']) ? $_POST['anmerkung'] : null;
|
||||
$firma_id = isset($_POST['firma_id']) ? $_POST['firma_id'] : null;
|
||||
|
||||
$result = $this->AdresseModel->insert(
|
||||
[
|
||||
'person_id' => $person_id,
|
||||
'strasse' => $strasse,
|
||||
'insertvon' => $uid,
|
||||
'insertamum' => date('c'),
|
||||
'plz' => $_POST['plz'],
|
||||
'ort' => $ort,
|
||||
'gemeinde' => $gemeinde,
|
||||
'nation' => $nation,
|
||||
'heimatadresse' => $_POST['heimatadresse'],
|
||||
'zustelladresse' => $_POST['zustelladresse'],
|
||||
'co_name' => $co_name,
|
||||
'typ' => $typ,
|
||||
'firma_id' => $firma_id,
|
||||
'name' => $name,
|
||||
'rechnungsadresse' => $_POST['rechnungsadresse'],
|
||||
'anmerkung' => $anmerkung
|
||||
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function updateAddress()
|
||||
{
|
||||
$address_id = $this->input->post('adresse_id');
|
||||
|
||||
$this->form_validation->set_data(['address.plz' => $_POST['plz']]);
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$this->form_validation->set_rules('address.plz', 'PLZ', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']),
|
||||
]);
|
||||
|
||||
if(isset($_POST['nation']) && $_POST['nation'] == 'A')
|
||||
{
|
||||
$this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']),
|
||||
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ'])
|
||||
]);
|
||||
}
|
||||
|
||||
if(isset($_POST['gemeinde']) && isset($_POST['ort']) && isset($_POST['nation']) && $_POST['nation'] == 'A')
|
||||
{
|
||||
$this->form_validation->set_rules('address.plz', 'Postleitzahl', 'callback_validateLocationCombination', [
|
||||
'validateLocationCombination' => $this->p->t('ui', 'error_location_combination')
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
if(!$address_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Adresse_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$person_id = isset($_POST['person_id']) ? $_POST['person_id'] : null;
|
||||
$co_name = isset($_POST['co_name']) ? $_POST['co_name'] : null;
|
||||
$strasse = isset($_POST['strasse']) ? $_POST['strasse'] : null;
|
||||
$ort = isset($_POST['ort']) ? $_POST['ort'] : null;
|
||||
$gemeinde = isset($_POST['gemeinde']) ? $_POST['gemeinde'] : null;
|
||||
$nation = isset($_POST['nation']) ? $_POST['nation'] : null;
|
||||
$name = isset($_POST['name']) ? $_POST['name'] : null;
|
||||
$typ = isset($_POST['typ']) ? $_POST['typ'] : null;
|
||||
$anmerkung = isset($_POST['anmerkung']) ? $_POST['anmerkung'] : null;
|
||||
$firma_id = isset($_POST['firma_id']) ? $_POST['firma_id'] : null;
|
||||
|
||||
$result = $this->AdresseModel->update(
|
||||
[
|
||||
'adresse_id' => $address_id
|
||||
],
|
||||
[ 'person_id' => $person_id,
|
||||
'strasse' => $strasse,
|
||||
'updatevon' => $uid,
|
||||
'updateamum' => date('c'),
|
||||
'plz' => $_POST['plz'],
|
||||
'ort' => $ort,
|
||||
'gemeinde' => $gemeinde,
|
||||
'nation' => $nation,
|
||||
'heimatadresse' => $_POST['heimatadresse'],
|
||||
'zustelladresse' => $_POST['zustelladresse'],
|
||||
'co_name' => $co_name,
|
||||
'typ' => $typ,
|
||||
'firma_id' => $firma_id,
|
||||
'name' => $name,
|
||||
'rechnungsadresse' => $_POST['rechnungsadresse'],
|
||||
'anmerkung' => $anmerkung
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadAddress()
|
||||
{
|
||||
$adresse_id = $this->input->post('address_id');
|
||||
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
$this->AdresseModel->addSelect('public.tbl_adresse.*');
|
||||
$this->AdresseModel->addSelect('t.*');
|
||||
$this->AdresseModel->addSelect('f.firma_id');
|
||||
$this->AdresseModel->addSelect('f.name as firmenname');
|
||||
$this->AdresseModel->addJoin('public.tbl_adressentyp t', 'ON (t.adressentyp_kurzbz = public.tbl_adresse.typ)');
|
||||
$this->AdresseModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = public.tbl_adresse.firma_id)', 'LEFT');
|
||||
|
||||
$this->AdresseModel->addLimit(1);
|
||||
|
||||
$result = $this->AdresseModel->loadWhere(
|
||||
array('adresse_id' => $adresse_id)
|
||||
);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Adresse_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
public function deleteAddress()
|
||||
{
|
||||
$adresse_id = $this->input->post('address_id');
|
||||
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$result = $this->AdresseModel->load([
|
||||
'adresse_id'=> $adresse_id,
|
||||
]);
|
||||
if(isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$result = current(getData($result));
|
||||
|
||||
if($result->heimatadresse)
|
||||
|
||||
$this->terminateWithError($this->p->t('person', 'error_deleteHomeAdress'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->AdresseModel->delete(
|
||||
array('adresse_id' => $adresse_id)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Adresse_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
public function getAdressentypen()
|
||||
{
|
||||
$this->load->model('person/Adressentyp_model', 'AdressentypModel');
|
||||
|
||||
$result = $this->AdressentypModel->load();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function getFirmen($searchString = null)
|
||||
{
|
||||
if (is_null($searchString))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('ressource/firma_model', 'FirmaModel');
|
||||
|
||||
$result = $this->FirmaModel->searchFirmen($searchString);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
}
|
||||
|
||||
public function getStandorte($searchString = null)
|
||||
{
|
||||
if (is_null($searchString))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
|
||||
$result = $this->StandortModel->searchStandorte($searchString);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStandorteByFirma($firma_id = null)
|
||||
{
|
||||
if (is_null($firma_id) || !ctype_digit((string)$firma_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
|
||||
$result = $this->StandortModel->getStandorteByFirma($firma_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getKontakte($person_id)
|
||||
{
|
||||
$this->KontaktModel->addSelect("public.tbl_kontakt.*,
|
||||
(CASE
|
||||
WHEN public.tbl_kontakt.updateamum >= public.tbl_kontakt.insertamum
|
||||
THEN public.tbl_kontakt.updateamum
|
||||
ELSE public.tbl_kontakt.insertamum
|
||||
END) AS lastUpdate, st.bezeichnung, f.name");
|
||||
$this->KontakttypModel->addSelect("kt.beschreibung as kontakttypbeschreibung");
|
||||
$this->StandortModel->addJoin('public.tbl_standort st', 'ON (public.tbl_kontakt.standort_id = st.standort_id)', 'LEFT');
|
||||
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
|
||||
$this->KontakttypModel->addJoin('public.tbl_kontakttyp kt', 'ON (public.tbl_kontakt.kontakttyp = kt.kontakttyp)');
|
||||
$result = $this->KontaktModel->loadWhere(
|
||||
array(
|
||||
'person_id' => $person_id,
|
||||
'public.tbl_kontakt.kontakttyp !=' => 'hidden'
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
|
||||
}
|
||||
|
||||
public function getKontakttypen()
|
||||
{
|
||||
$this->load->model('person/Kontakttyp_model', 'KontakttypModel');
|
||||
$this->KontakttypModel->addOrder('beschreibung', 'ASC');
|
||||
$result = $this->KontakttypModel->loadWhere(array('kontakttyp !=' => 'hidden'));
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadContact()
|
||||
{
|
||||
$kontakt_id = $this->input->post('kontakt_id');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
$this->KontaktModel->addSelect('*, public.tbl_kontakt.*');
|
||||
$this->KontaktModel->addSelect('st.kurzbz');
|
||||
$this->KontaktModel->addJoin('public.tbl_standort st', 'ON (public.tbl_kontakt.standort_id = st.standort_id)', 'LEFT');
|
||||
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
|
||||
|
||||
$this->KontaktModel->addLimit(1);
|
||||
|
||||
$result = $this->KontaktModel->loadWhere(
|
||||
array('kontakt_id' => $kontakt_id)
|
||||
);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Kontakt_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function addNewContact($person_id)
|
||||
{
|
||||
if(($_POST['kontakttyp'] == 'email' && isset($_POST['kontakt'])))
|
||||
{
|
||||
$this->form_validation->set_rules('kontakt', 'Kontakt', 'required|valid_email', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Kontakt']),
|
||||
'valid_email' => $this->p->t('ui', 'error_fieldNoValidEmail', ['field' => 'Kontakt'])
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->form_validation->set_rules('kontakt', 'Kontakt', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Kontakt'])
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$kontakttyp = $this->input->post('kontakttyp');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kontakt = $this->input->post('kontakt');
|
||||
$ext_id = $this->input->post('ext_id');
|
||||
$standort_id = $this->input->post('standort_id');
|
||||
|
||||
$result = $this->KontaktModel->insert(
|
||||
[
|
||||
'person_id' => $person_id,
|
||||
'kontakttyp' => $kontakttyp,
|
||||
'anmerkung' => $anmerkung,
|
||||
'kontakt' => $kontakt,
|
||||
'zustellung' => $_POST['zustellung'],
|
||||
'insertvon' => $uid,
|
||||
'insertamum' => date('c'),
|
||||
'standort_id' => $standort_id,
|
||||
'ext_id' => $ext_id
|
||||
]
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function updateContact()
|
||||
{
|
||||
$kontakt_id = $this->input->post('kontakt_id');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
if(!$kontakt_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Kontakt_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if(($_POST['kontakttyp'] == 'email' && isset($_POST['kontakt'])))
|
||||
{
|
||||
$this->form_validation->set_rules('kontakt', 'Kontakt', 'required|valid_email', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Kontakt']),
|
||||
'valid_email' => $this->p->t('ui', 'error_fieldNoValidEmail', ['field' => 'Kontakt'])
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->form_validation->set_rules('kontakt', 'Kontakt', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Kontakt'])
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$kontakttyp = $this->input->post('kontakttyp');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kontakt = $this->input->post('kontakt');
|
||||
$ext_id = $this->input->post('ext_id');
|
||||
$person_id = $this->input->post('person_id');
|
||||
$standort_id = $this->input->post('standort_id');
|
||||
|
||||
$result = $this->KontaktModel->update(
|
||||
[
|
||||
'kontakt_id' => $kontakt_id
|
||||
],
|
||||
[
|
||||
'person_id' => $person_id,
|
||||
'kontakttyp' => $kontakttyp,
|
||||
'anmerkung' => $anmerkung,
|
||||
'kontakt' => $kontakt,
|
||||
'zustellung' => $_POST['zustellung'],
|
||||
'updatevon' => $uid,
|
||||
'updateamum' => date('c'),
|
||||
'standort_id' => $standort_id,
|
||||
'ext_id' => $ext_id
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteContact()
|
||||
{
|
||||
$kontakt_id = $this->input->post('kontakt_id');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
$result = $this->KontaktModel->delete(
|
||||
array('kontakt_id' => $kontakt_id)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
elseif (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Kontakt_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
public function getBankverbindung($person_id)
|
||||
{
|
||||
$this->load->model('person/Bankverbindung_model', 'BankverbindungModel');
|
||||
|
||||
$this->BankverbindungModel->addSelect('*');
|
||||
|
||||
$result = $this->BankverbindungModel->loadWhere(
|
||||
array('person_id' => $person_id)
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function addNewBankverbindung($person_id)
|
||||
{
|
||||
$this->form_validation->set_rules('iban', 'IBAN', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'IBAN'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('typ', 'TYP', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'TYP'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->load->model('person/Bankverbindung_model', 'BankverbindungModel');
|
||||
|
||||
$ext_id = $this->input->post('ext_id');
|
||||
$oe_kurzbz = $this->input->post('oe_kurzbz');
|
||||
$orgform_kurzbz = $this->input->post('orgform_kurzbz');
|
||||
$name = $this->input->post('name');
|
||||
$anschrift = $this->input->post('anschrift');
|
||||
$bic = $this->input->post('bic');
|
||||
$blz = $this->input->post('blz');
|
||||
$kontonr = $this->input->post('kontonr');
|
||||
$iban = $this->input->post('iban');
|
||||
$typ = $this->input->post('typ');
|
||||
$verrechnung = $this->input->post('verrechnung');
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->BankverbindungModel->insert(
|
||||
[
|
||||
'person_id' => $person_id,
|
||||
'name' => $name,
|
||||
'anschrift' => $anschrift,
|
||||
'bic' => $bic,
|
||||
'iban' => $iban,
|
||||
'blz' => $blz,
|
||||
'kontonr' => $kontonr,
|
||||
'insertvon' => $uid,
|
||||
'insertamum' => date('c'),
|
||||
'typ' => $typ,
|
||||
'verrechnung' => $verrechnung,
|
||||
'ext_id' => $ext_id,
|
||||
'oe_kurzbz' => $oe_kurzbz,
|
||||
'orgform_kurzbz' => $orgform_kurzbz
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadBankverbindung()
|
||||
{
|
||||
$bankverbindung_id = $this->input->post('bankverbindung_id');
|
||||
|
||||
$this->load->model('person/Bankverbindung_model', 'BankverbindungModel');
|
||||
|
||||
$this->BankverbindungModel->addSelect('*');
|
||||
|
||||
$this->BankverbindungModel->addLimit(1);
|
||||
|
||||
$result = $this->BankverbindungModel->loadWhere(
|
||||
array('bankverbindung_id' => $bankverbindung_id)
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Bankverbindung_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function updateBankverbindung($bankverbindung_id)
|
||||
{
|
||||
$this->form_validation->set_rules('iban', 'IBAN', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'IBAN'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('typ', 'TYP', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'TYP'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->load->model('person/Bankverbindung_model', 'BankverbindungModel');
|
||||
|
||||
if(!$bankverbindung_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Bankverbindung_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->BankverbindungModel->update(
|
||||
[
|
||||
'bankverbindung_id' => $bankverbindung_id
|
||||
],
|
||||
[
|
||||
'person_id' => $_POST['person_id'],
|
||||
'name' => $_POST['name'],
|
||||
'anschrift' => $_POST['anschrift'],
|
||||
'bic' => $_POST['bic'],
|
||||
'iban' => $_POST['iban'],
|
||||
'blz' => $_POST['blz'],
|
||||
'kontonr' => $_POST['kontonr'],
|
||||
'updatevon' => $uid,
|
||||
'updateamum' => date('c'),
|
||||
'typ' => $_POST['typ'],
|
||||
'verrechnung' => $_POST['verrechnung'],
|
||||
'ext_id' => $_POST['ext_id'],
|
||||
'oe_kurzbz' => $_POST['oe_kurzbz'],
|
||||
'orgform_kurzbz' => $_POST['orgform_kurzbz']
|
||||
]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function deleteBankverbindung()
|
||||
{
|
||||
$bankverbindung_id = $this->input->post('bankverbindung_id');
|
||||
|
||||
$this->load->model('person/Bankverbindung_model', 'BankverbindungModel');
|
||||
|
||||
$result = $this->BankverbindungModel->delete(
|
||||
array('bankverbindung_id' => $bankverbindung_id)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Bankverbindung_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
public function validateLocationCombination()
|
||||
{
|
||||
$this->load->model('codex/Gemeinde_model', 'GemeindeModel');
|
||||
|
||||
return $this->GemeindeModel->checkLocation($_POST['plz'], $_POST['gemeinde'], $_POST['ort']);
|
||||
}
|
||||
|
||||
/*
|
||||
* returns list of all companies
|
||||
* as key value list to be used in select or autocomplete
|
||||
*/
|
||||
public function getAllFirmen()
|
||||
{
|
||||
$sql = "
|
||||
SELECT
|
||||
f.firma_id, f.name,
|
||||
f.name AS label
|
||||
FROM public.tbl_firma f
|
||||
ORDER BY f.name ASC";
|
||||
|
||||
$result = $this->FirmaModel->execReadOnlyQuery($sql);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about a Konto
|
||||
* Listens to ajax post calls to change the Konto data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Konto extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Calls the parent's constructor and prepares libraries and phrases
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => 'student/stammdaten:r',
|
||||
'getBuchungstypen' => self::PERM_LOGGED,
|
||||
'checkDoubles' => ['admin:r', 'assistenz:r'],
|
||||
'insert' => ['admin:w', 'assistenz:w'],
|
||||
'counter' => ['admin:w', 'assistenz:w'],
|
||||
'update' => ['admin:w', 'assistenz:w'],
|
||||
'delete' => ['admin:w', 'assistenz:w']
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Konto_model', 'KontoModel');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'konto'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Get details for a prestudent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$person_id = $this->input->post('person_id');
|
||||
if (!$person_id || !is_array($person_id)) {
|
||||
$this->form_validation->set_rules('person_id', 'Person ID', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
|
||||
$studiengang_kz = $this->input->post('studiengang_kz');
|
||||
|
||||
if ($this->input->post('only_open')) {
|
||||
$result = $this->KontoModel->getOffeneBuchungen($person_id, $studiengang_kz);
|
||||
} else {
|
||||
$result = $this->KontoModel->getAlleBuchungen($person_id, $studiengang_kz);
|
||||
}
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// sort into tree
|
||||
$childs = [];
|
||||
$data = [];
|
||||
foreach ($result as $entry) {
|
||||
if ($entry->buchungsnr_verweis) {
|
||||
if (isset($data[$entry->buchungsnr_verweis])) {
|
||||
if (!isset($data[$entry->buchungsnr_verweis]->_children))
|
||||
$data[$entry->buchungsnr_verweis]->_children = [];
|
||||
$data[$entry->buchungsnr_verweis]->_children[] = $entry;
|
||||
} else {
|
||||
if (!isset($childs[$entry->buchungsnr_verweis]))
|
||||
$childs[$entry->buchungsnr_verweis] = [];
|
||||
$childs[$entry->buchungsnr_verweis][] = $entry;
|
||||
}
|
||||
} else {
|
||||
$data[$entry->buchungsnr] = $entry;
|
||||
if (isset($childs[$entry->buchungsnr]))
|
||||
$entry->_children = $childs[$entry->buchungsnr];
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array_values($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of Buchungstypen
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getBuchungstypen()
|
||||
{
|
||||
$this->load->model('crm/Buchungstyp_model', 'BuchungstypModel');
|
||||
|
||||
$this->BuchungstypModel->addOrder('beschreibung');
|
||||
|
||||
$result = $this->BuchungstypModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check double Buchungen
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkDoubles()
|
||||
{
|
||||
if (!defined('FAS_DOPPELTE_BUCHUNGSTYPEN_CHECK') || !FAS_DOPPELTE_BUCHUNGSTYPEN_CHECK)
|
||||
$this->terminateWithSuccess(false);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$person_ids = $this->input->post('person_id');
|
||||
|
||||
if (!$person_ids || !is_array($person_ids)) {
|
||||
$person_ids = [$person_ids];
|
||||
$this->form_validation->set_rules('person_id', 'Person ID', 'required');
|
||||
}
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required');
|
||||
$this->form_validation->set_rules('buchungstyp_kurzbz', 'Buchungstyp', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$buchungstypen = unserialize(FAS_DOPPELTE_BUCHUNGSTYPEN_CHECK);
|
||||
$buchung = $this->input->post('buchungstyp_kurzbz');
|
||||
|
||||
if (!isset($buchungstypen[$buchung]))
|
||||
$this->terminateWithSuccess(false);
|
||||
|
||||
$result = $this->KontoModel->checkDoubleBuchung($person_ids, $this->input->post('studiensemester_kurzbz'), $buchungstypen[$buchung]);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$result)
|
||||
$this->terminateWithSuccess(false);
|
||||
|
||||
$persons = array_map(function ($row) {
|
||||
return $row->nachname . ' ' . $row->vorname;
|
||||
}, $result);
|
||||
|
||||
$result = $this->p->t('konto', 'confirm_overwrite') . "\n";
|
||||
if (count($persons) > 10) {
|
||||
$result .= "-" . implode("\n-", array_slice($persons, 0, 10)) . "\n";
|
||||
|
||||
if (count($persons) == 11) {
|
||||
$result .= "\n" . $this->p->t('konto', 'confirm_overwrite_1_add_pers');
|
||||
} else {
|
||||
$result .= "\n" . $this->p->t('konto', 'confirm_overwrite_x_add_pers', [
|
||||
'x' => count($persons) - 10
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$result .= "-" . implode("\n-", $persons) . "\n";
|
||||
}
|
||||
$result .= $this->p->t('konto', 'confirm_overwrite_proceed');
|
||||
|
||||
$this->addError($result, 'confirm');
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save Buchung
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function insert()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$person_ids = $this->input->post('person_id');
|
||||
|
||||
if (!$person_ids || !is_array($person_ids)) {
|
||||
$person_ids = [$person_ids];
|
||||
$this->form_validation->set_rules('person_id', 'Person ID', 'required');
|
||||
}
|
||||
$this->form_validation->set_rules('betrag', 'Betrag', 'numeric');
|
||||
$this->form_validation->set_rules('buchungsdatum', 'Buchungsdatum', 'is_valid_date');
|
||||
$this->form_validation->set_rules('buchungstext', 'Buchungstext', 'max_length[256]');
|
||||
$this->form_validation->set_rules('mahnspanne', 'Mahnspanne', 'integer');
|
||||
$this->form_validation->set_rules('buchungstyp_kurzbz', 'Buchungstyp', 'required|max_length[32]');
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required|max_length[16]');
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'required|has_permissions_for_stg[admin:rw,assistenz:rw]');
|
||||
$this->form_validation->set_rules('credit_points', 'Credit Points', 'numeric');
|
||||
|
||||
Events::trigger('konto_insert_validation', $this->form_validation);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$allowed = [
|
||||
'betrag',
|
||||
'buchungsdatum',
|
||||
'buchungstext',
|
||||
'mahnspanne',
|
||||
'buchungstyp_kurzbz',
|
||||
'studiensemester_kurzbz',
|
||||
'studiengang_kz',
|
||||
'credit_points',
|
||||
'anmerkung'
|
||||
];
|
||||
$data = [
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
];
|
||||
foreach ($allowed as $field)
|
||||
if ($this->input->post($field) !== null)
|
||||
$data[$field] = $this->input->post($field);
|
||||
|
||||
if (defined('FAS_BUCHUNGSTYP_FIXE_KOSTENSTELLE') && isset(unserialize(FAS_BUCHUNGSTYP_FIXE_KOSTENSTELLE)[$data['buchungstyp_kurzbz']])) {
|
||||
$data['kostenstelle'] = unserialize(FAS_BUCHUNGSTYP_FIXE_KOSTENSTELLE)[$data['buchungstyp_kurzbz']];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
foreach ($person_ids as $person_id) {
|
||||
$id = $this->KontoModel->insert(array_merge($data, ['person_id' => $person_id]));
|
||||
if (isError($id)) {
|
||||
$this->addError(getError($id), self::ERROR_TYPE_DB);
|
||||
} else {
|
||||
$kontodata = $this->KontoModel->withAdditionalInfo()->load(getData($id));
|
||||
if (isError($kontodata))
|
||||
$this->addError(getError($kontodata), self::ERROR_TYPE_DB);
|
||||
else
|
||||
$result[] = current(getData($kontodata));
|
||||
}
|
||||
}
|
||||
|
||||
if ($result)
|
||||
$this->terminateWithSuccess($result);
|
||||
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Counter Buchung
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function counter()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$buchungsnrs = $this->input->post('buchungsnr');
|
||||
|
||||
if (!$buchungsnrs || !is_array($buchungsnrs)) {
|
||||
$buchungsnrs = $buchungsnrs ? [$buchungsnrs] : [];
|
||||
$this->form_validation->set_rules('buchungsnr', 'Buchungsnr', 'required');
|
||||
}
|
||||
$this->form_validation->set_rules('buchungsdatum', 'Buchungsdatum', 'is_valid_date');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$data = [];
|
||||
$rules = [];
|
||||
foreach ($buchungsnrs as $k => $buchungsnr) {
|
||||
$result = $this->KontoModel->load($buchungsnr);
|
||||
if (isError($result)) {
|
||||
$rules[] = [
|
||||
'field' => 'buchung[' . $k . ']',
|
||||
'label' => 'Buchung #' . $buchungsnr,
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => getError($result)
|
||||
]
|
||||
];
|
||||
} elseif (!hasData($result)) {
|
||||
$rules[] = [
|
||||
'field' => 'buchung[' . $k . ']',
|
||||
'label' => 'Buchung #' . $buchungsnr,
|
||||
'rules' => 'required'
|
||||
];
|
||||
} else {
|
||||
$data[$k] = get_object_vars(current(getData($result)));
|
||||
$rules[] = [
|
||||
'field' => 'buchung[' . $k . '][buchungsnr]',
|
||||
'label' => 'Buchung # ' . $buchungsnr,
|
||||
'rules' => 'required|numeric'
|
||||
];
|
||||
$rules[] = [
|
||||
'field' => 'buchung[' . $k . '][studiengang_kz]',
|
||||
'label' => 'Buchung # ' . $buchungsnr,
|
||||
'rules' => 'required|has_permissions_for_stg[admin:rw,assistenz:rw]'
|
||||
];
|
||||
$rules[] = [
|
||||
'field' => 'buchung[' . $k . '][buchungsnr_verweis]',
|
||||
'label' => 'Buchung # ' . $buchungsnr,
|
||||
'rules' => 'regex_match[/^$/]',
|
||||
'errors' => [
|
||||
'regex_match' => $this->p->t('konto', 'error_counter_level')
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$this->form_validation->reset_validation();
|
||||
$this->form_validation->set_data(['buchung' => $data]);
|
||||
$this->form_validation->set_rules($rules);
|
||||
|
||||
Events::trigger('konto_counter_validation', $this->form_validation);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$buchungsdatum = $this->input->post('buchungsdatum');
|
||||
|
||||
$newItems = [];
|
||||
foreach ($data as $buchung) {
|
||||
$result = $this->KontoModel->getDifferenz($buchung['buchungsnr']);
|
||||
if (isError($result)) {
|
||||
$this->addError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
continue;
|
||||
}
|
||||
$betrag = $result->retval;
|
||||
if ($betrag === null) {
|
||||
$this->addError($this->p->t(
|
||||
'konto',
|
||||
'error_missing',
|
||||
$buchung
|
||||
), self::ERROR_TYPE_GENERAL);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$result = $this->KontoModel->insert([
|
||||
'person_id' => $buchung['person_id'],
|
||||
'studiengang_kz' => $buchung['studiengang_kz'],
|
||||
'studiensemester_kurzbz' => $buchung['studiensemester_kurzbz'],
|
||||
'buchungstext' => $buchung['buchungstext'],
|
||||
'buchungstyp_kurzbz' => $buchung['buchungstyp_kurzbz'],
|
||||
'credit_points' => $buchung['credit_points'],
|
||||
'zahlungsreferenz' => $buchung['zahlungsreferenz'],
|
||||
'betrag' => number_format($betrag, 2, '.', ''),
|
||||
'buchungsdatum' => $buchungsdatum,
|
||||
'mahnspanne' => '0',
|
||||
'buchungsnr_verweis' => $buchung['buchungsnr'],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
'anmerkung' => ''
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$this->addError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
continue;
|
||||
}
|
||||
|
||||
$newItems = null;
|
||||
// TODO(chris): get as tree?
|
||||
/*$result = $this->KontoModel->withAdditionalInfo()->load($result->retval);
|
||||
if (!hasData($result))
|
||||
$newItems = null;
|
||||
elseif ($newItems !== null)
|
||||
$newItems[] = current(getData($result));*/
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Buchung
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('buchungsnr', 'Buchungsnr', 'required');
|
||||
$this->form_validation->set_rules('betrag', 'Betrag', 'numeric');
|
||||
$this->form_validation->set_rules('buchungsdatum', 'Buchungsdatum', 'is_valid_date');
|
||||
$this->form_validation->set_rules('buchungstext', 'Buchungstext', 'max_length[256]');
|
||||
$this->form_validation->set_rules('mahnspanne', 'Mahnspanne', 'integer');
|
||||
$this->form_validation->set_rules('buchungstyp_kurzbz', 'Buchungstyp', 'required|max_length[32]');
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required|max_length[16]');
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'required|has_permissions_for_stg[admin:rw,assistenz:rw]');
|
||||
$this->form_validation->set_rules('credit_points', 'Credit Points', 'numeric');
|
||||
|
||||
Events::trigger('konto_update_validation', $this->form_validation);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$id = $this->input->post('buchungsnr');
|
||||
$allowed = [
|
||||
'betrag',
|
||||
'buchungsdatum',
|
||||
'buchungstext',
|
||||
'mahnspanne',
|
||||
'buchungstyp_kurzbz',
|
||||
'studiensemester_kurzbz',
|
||||
'studiengang_kz',
|
||||
'credit_points',
|
||||
'anmerkung'
|
||||
];
|
||||
$data = [
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
];
|
||||
foreach ($allowed as $field)
|
||||
if ($this->input->post($field) !== null)
|
||||
$data[$field] = $this->input->post($field);
|
||||
|
||||
$result = $this->KontoModel->update($id, $data);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = null;
|
||||
// TODO(chris): get as tree?
|
||||
/*$result = $this->KontoModel->withAdditionalInfo()->load($id);
|
||||
|
||||
#$result = $this->getDataOrTerminateWithError($result);
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
$result = $result->retval;*/
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Buchung
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('buchungsnr', 'Buchungsnr', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
$buchungsnr = $this->input->post('buchungsnr');
|
||||
|
||||
$result = $this->KontoModel->load($buchungsnr);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$result)
|
||||
$this->terminateWithError($this->p->t('konto', 'error_missing', [
|
||||
'buchungsnr' => $buchungsnr
|
||||
]));
|
||||
|
||||
$_POST['studiengang_kz'] = current($result)->studiengang_kz;
|
||||
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'has_permissions_for_stg[admin:rw,assistenz:rw]');
|
||||
|
||||
Events::trigger('konto_delete_validation', $this->form_validation);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
|
||||
Events::trigger('konto_delete', $buchungsnr);
|
||||
|
||||
$result = $this->KontoModel->delete($buchungsnr);
|
||||
if (isError($result)) {
|
||||
if (getCode($result) != 42)
|
||||
$this->terminateWithError(getError($result));
|
||||
$this->terminateWithError($this->p->t('konto', 'error_delete_level'));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Lehrverband extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'hasOrgforms' => ['admin:r', 'assistenz:r'],
|
||||
'getTree' => ['admin:r', 'assistenz:r'],
|
||||
'getSpecialgroups' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
}
|
||||
|
||||
public function hasOrgforms($studiengang_kz)
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if ($data) {
|
||||
$data = current($data)->mischform;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getTree($studiengang_kz)
|
||||
{
|
||||
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
|
||||
$result = $this->LehrverbandModel->loadWhere([
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'aktiv' => true
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getSpecialgroups($studiengang_kz)
|
||||
{
|
||||
$this->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
|
||||
$where = [
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'lehre' => true,
|
||||
'sichtbar' => true,
|
||||
'aktiv' => true,
|
||||
'direktinskription' => false
|
||||
];
|
||||
|
||||
$result = $this->GruppeModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about generally used lists
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Lists extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiensemester' => self::PERM_LOGGED,
|
||||
'getStgs' => self::PERM_LOGGED,
|
||||
'getSprachen' => self::PERM_LOGGED,
|
||||
'getGeschlechter' => self::PERM_LOGGED,
|
||||
'getAusbildungen' => self::PERM_LOGGED,
|
||||
'getOrgforms' => self::PERM_LOGGED,
|
||||
'getStati' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addOrder('ende');
|
||||
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStgs()
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addSelect('*');
|
||||
$this->StudiengangModel->addSelect('UPPER(typ || kurzbz) AS kuerzel');
|
||||
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
|
||||
$result = $this->StudiengangModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getSprachen()
|
||||
{
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
|
||||
$this->SpracheModel->addOrder('sprache');
|
||||
|
||||
$result = $this->SpracheModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getGeschlechter()
|
||||
{
|
||||
$this->load->model('person/Geschlecht_model', 'GeschlechtModel');
|
||||
|
||||
$this->GeschlechtModel->addOrder('sort');
|
||||
$this->GeschlechtModel->addOrder('geschlecht');
|
||||
|
||||
$this->GeschlechtModel->addSelect('*');
|
||||
#$this->GeschlechtModel->addTranslatedSelect("bezeichnung_mehrsprachig", "bezeichnung");
|
||||
$this->GeschlechtModel->addSelect("bezeichnung_mehrsprachig[(SELECT index FROM public.tbl_sprache WHERE sprache=" . $this->GeschlechtModel->escape(DEFAULT_LANGUAGE) . " LIMIT 1)] AS bezeichnung");
|
||||
|
||||
$result = $this->GeschlechtModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAusbildungen()
|
||||
{
|
||||
$this->load->model('codex/Ausbildung_model', 'AusbildungModel');
|
||||
|
||||
$this->AusbildungModel->addOrder('ausbildungcode');
|
||||
|
||||
$result = $this->AusbildungModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getOrgforms()
|
||||
{
|
||||
$this->load->model('codex/Orgform_model', 'OrgformModel');
|
||||
|
||||
$this->OrgformModel->addOrder('bezeichnung');
|
||||
|
||||
$result = $this->OrgformModel->loadWhere(['rolle' => true]);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStati()
|
||||
{
|
||||
$lang = getUserLanguage();
|
||||
$this->load->model('crm/Status_model', 'StatusModel');
|
||||
|
||||
$this->StatusModel->addSelect('*');
|
||||
#$this->StatusModel->addTranslatedSelect('bezeichnung_mehrsprachig', 'bezeichnung');
|
||||
$this->StatusModel->addSelect(
|
||||
'bezeichnung_mehrsprachig[(
|
||||
SELECT index
|
||||
FROM public.tbl_sprache
|
||||
WHERE sprache=' . $this->StatusModel->escape($lang) . '
|
||||
LIMIT 1
|
||||
)] AS bezeichnung',
|
||||
false
|
||||
);
|
||||
#$this->StatusModel->addOrder('ext_id');
|
||||
|
||||
$result = $this->StatusModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,408 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class LvTermine extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStundenplan' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
//query verwenden wie im Cis endpoint
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
|
||||
}
|
||||
|
||||
//TODO Build own lib or combine with Controller Stundenplan.php
|
||||
//here use of logic of Stundenplan.php, extended with parameters uid, grouping, and used dbTable
|
||||
public function getStundenplan($uid, $start_date = null, $end_date = null, $groupConsecutiveHours = false, $dbStundenplanTable = "stundenplan")
|
||||
{
|
||||
$student_uid = $uid;
|
||||
$semester_range = $this->studienSemesterErmitteln($start_date, $end_date);
|
||||
|
||||
$this->sortStudienSemester($semester_range);
|
||||
$this->applyLoadUeberSemesterHaelfte($semester_range);
|
||||
|
||||
$benutzer_gruppen = $this->fetchBenutzerGruppenFromStudiensemester($semester_range, $student_uid);
|
||||
$student_lehrverband = $this->fetchStudentlehrverbandFromStudiensemester($semester_range, $student_uid);
|
||||
|
||||
if(!$groupConsecutiveHours)
|
||||
$stundenplan_query = $this->StundenplanModel->getStundenplanQuery(
|
||||
$start_date,
|
||||
$end_date,
|
||||
$semester_range,
|
||||
$benutzer_gruppen,
|
||||
$student_lehrverband
|
||||
);
|
||||
else
|
||||
$stundenplan_query = $this->StundenplanModel->getStundenplanQuery(
|
||||
$start_date,
|
||||
$end_date,
|
||||
$semester_range,
|
||||
$benutzer_gruppen,
|
||||
$student_lehrverband,
|
||||
true,
|
||||
$dbStundenplanTable
|
||||
);
|
||||
|
||||
if(!$stundenplan_query)
|
||||
{
|
||||
$this->terminateWithSuccess([]);
|
||||
}
|
||||
|
||||
if($groupConsecutiveHours)
|
||||
{
|
||||
$stundenplan_data = $this->StundenplanModel->stundenplanGruppierungConsecutive($stundenplan_query);
|
||||
}
|
||||
else
|
||||
{
|
||||
$stundenplan_data = $this->StundenplanModel->stundenplanGruppierung($stundenplan_query);
|
||||
}
|
||||
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
|
||||
$this->returnObj['$stundenplan_query'] = $stundenplan_query;
|
||||
$this->returnObj['$student_lehrverband'] = $student_lehrverband;
|
||||
$this->returnObj['$benutzer_gruppen'] = $benutzer_gruppen;
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addOrder('studienjahr_kurzbz', 'DESC');
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
//copied from Stundenplan.php
|
||||
private function studienSemesterErmitteln($start_date, $end_date)
|
||||
{
|
||||
// gets all studiensemester from the student from start_date to end_date
|
||||
$semester_range = $this->StudiensemesterModel->getByDateRange($start_date, $end_date);
|
||||
$semester_range = array_map(
|
||||
function ($sem) {
|
||||
return $sem->studiensemester_kurzbz;
|
||||
},
|
||||
$this->getDataOrTerminateWithError($semester_range)
|
||||
);
|
||||
|
||||
// if no studiensemester is found for the given timespan, get the nearest studiensemester
|
||||
if(count($semester_range) == 0)
|
||||
{
|
||||
$aktuelle_studiensemester = $this->StudiensemesterModel->getNearest();
|
||||
$aktuelle_studiensemester = $this->getDataOrTerminateWithError($aktuelle_studiensemester);
|
||||
if (count($aktuelle_studiensemester) == 0) {
|
||||
$this->terminateWithError("No aktuelles semester");
|
||||
}
|
||||
$aktuelle_studiensemester = current($aktuelle_studiensemester)->studiensemester_kurzbz;
|
||||
// push aktuelles semester in active semester array
|
||||
array_push($semester_range, $aktuelle_studiensemester);
|
||||
}
|
||||
return $semester_range;
|
||||
}
|
||||
|
||||
//copied from Stundenplan.php
|
||||
private function sortStudienSemester(&$semester_range)
|
||||
{
|
||||
usort(
|
||||
$semester_range,
|
||||
function ($first, $second) {
|
||||
$sem_first = null;
|
||||
$year_first = null;
|
||||
$match_first = null;
|
||||
|
||||
$sem_second = null;
|
||||
$year_second = null;
|
||||
$match_second = null;
|
||||
|
||||
preg_match('/([WS]+)([0-9]+)/', $first, $match_first);
|
||||
preg_match('/([WS]+)([0-9]+)/', $second, $match_second);
|
||||
|
||||
$sem_first = $match_first[1];
|
||||
$year_first = intval($match_first[2]);
|
||||
|
||||
$sem_second = $match_second[1];
|
||||
$year_second = intval($match_second[2]);
|
||||
|
||||
if($year_first < $year_second)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
elseif($year_first > $year_second)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
elseif($year_first == $year_second && $sem_first > $sem_second)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
elseif($year_first == $year_second && $sem_first < $sem_second)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//copied from Stundenplan.php
|
||||
private function applyLoadUeberSemesterHaelfte(&$semester_range)
|
||||
{
|
||||
/*
|
||||
@var($semester_collection)
|
||||
convert the array of studiensemester into an associative array with the studiensemester as the key
|
||||
and the values of each key are the studiensemester needed for the query associated to that studiensemester
|
||||
example:
|
||||
|
||||
#INPUT:
|
||||
['WS2023','SS2024','WS2024']
|
||||
#OUTPUT:
|
||||
[
|
||||
'WS2023' => ['SS2023','WS2023']
|
||||
'SS2024' => ['WS2023','SS2024']
|
||||
'WS2024' => ['SS2024','WS2024']
|
||||
]
|
||||
*/
|
||||
$semester_collection = [];
|
||||
foreach($semester_range as $studiensemester)
|
||||
{
|
||||
$previous_studiensemester = $this->StudiensemesterModel->getPreviousFrom($studiensemester);
|
||||
$previous_studiensemester = $this->getDataOrTerminateWithError($previous_studiensemester);
|
||||
if (count($previous_studiensemester) == 0) {
|
||||
$this->terminateWithError("No previous semester");
|
||||
}
|
||||
$previous_studiensemester = current($previous_studiensemester)->studiensemester_kurzbz;
|
||||
$semester_collection[$studiensemester] = [$previous_studiensemester, $studiensemester];
|
||||
}
|
||||
|
||||
/*
|
||||
@var($studienSemesterDateRanges)
|
||||
fetches for each studiensemester the start and end date, (SS) summer studiensemester are extended by 1 month to cover the summerbreak
|
||||
based on the LVPLAN_LOAD_UEBER_SEMESTERHAELFTE constant it will load both the semester and the previous semester with the full date range
|
||||
or the semester with the full date range and the previous semester with the half date range:
|
||||
|
||||
#INPUT:
|
||||
[
|
||||
'WS2023' => ['SS2023','WS2023']
|
||||
'SS2024' => ['WS2023','SS2024']
|
||||
'WS2024' => ['SS2024','WS2024']
|
||||
]
|
||||
#OUTPUT: depends whether LVPLAN_LOAD_UEBER_SEMESTERHAELFTE is true or false
|
||||
~ if LVPLAN_LOAD_UEBER_SEMESTERHAELFTE == true
|
||||
[
|
||||
"SS2024": [
|
||||
"WS2023": [
|
||||
"start"=> "2024-02-03",
|
||||
"ende"=> "2024-08-31"
|
||||
],
|
||||
"SS2024": [
|
||||
"start"=> "2024-02-03",
|
||||
"ende"=> "2024-08-31"
|
||||
]
|
||||
]
|
||||
]
|
||||
~ if LVPLAN_LOAD_UEBER_SEMESTERHAELFTE == false
|
||||
[
|
||||
"SS2024": [
|
||||
"WS2023": [
|
||||
"start"=> "2024-02-03",
|
||||
"ende"=> "2024-05-17"
|
||||
],
|
||||
"SS2024": [
|
||||
"start"=> "2024-02-03",
|
||||
"ende"=> "2024-08-31"
|
||||
]
|
||||
]
|
||||
]
|
||||
*/
|
||||
$studienSemesterDateRanges=[];
|
||||
foreach($semester_collection as $semester_original => $semester_adjoint)
|
||||
{
|
||||
$semester_start_ende = $this->StudiensemesterModel->getStartEndeFromStudiensemester($semester_original);
|
||||
$semester_start_ende = current($this->getDataOrTerminateWithError($semester_start_ende));
|
||||
|
||||
// initialize empty arrays to add key value pairs
|
||||
$studienSemesterDateRanges[$semester_original] = [];
|
||||
|
||||
// check if the studiensemester is a summer semester and add 1 month to bridge the school summer break
|
||||
$match = null;
|
||||
preg_match("/^(SS)([0-9]+)/", $semester_original, $match);
|
||||
if(count($match) >0)
|
||||
{
|
||||
$one_month = new DateInterval('P1M');
|
||||
$one_day = DateInterval::createFromDateString('1 days');
|
||||
$summer_studiensemester_end_date = DateTime::createFromFormat('Y-m-d', $semester_start_ende->ende);
|
||||
$summer_studiensemester_end_date->add($one_month);
|
||||
$summer_studiensemester_end_date->sub($one_day);
|
||||
$semester_start_ende->ende = date_format($summer_studiensemester_end_date, 'Y-m-d');
|
||||
}
|
||||
if (defined('LVPLAN_LOAD_UEBER_SEMESTERHAELFTE') && LVPLAN_LOAD_UEBER_SEMESTERHAELFTE === true)
|
||||
{
|
||||
foreach($semester_adjoint as $adjoint)
|
||||
{
|
||||
$studienSemesterDateRanges[$semester_original][$adjoint]=$semester_start_ende;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: half of a DateInterval might not be correctly calculated
|
||||
// calculate the half of the studiensemester
|
||||
$studiensemester_start_date = DateTime::createFromFormat('Y-m-d', $semester_start_ende->start);
|
||||
$studiensemester_end_date = DateTime::createFromFormat('Y-m-d', $semester_start_ende->ende);
|
||||
$studiensemester_time_difference = $studiensemester_start_date->diff($studiensemester_end_date);
|
||||
$half_dateNumber = ceil($studiensemester_time_difference->d/2)+ceil(($studiensemester_time_difference->m*30)/2);
|
||||
$half_dateInterval = new DateInterval('P'.strval($half_dateNumber) .'D');
|
||||
$studiensemester_half = date_format($studiensemester_start_date->add($half_dateInterval), 'Y-m-d');
|
||||
|
||||
$first_half = new stdClass();
|
||||
$first_half->start = $semester_start_ende->start;
|
||||
$first_half->ende = $studiensemester_half;
|
||||
|
||||
$studienSemesterDateRanges[$semester_original][$semester_adjoint[0]] = $first_half;
|
||||
$studienSemesterDateRanges[$semester_original][$semester_adjoint[1]] = $semester_start_ende;
|
||||
}
|
||||
$semester_range = $studienSemesterDateRanges;
|
||||
}
|
||||
}
|
||||
|
||||
//copied from Stundenplan.php, extended with $student_uid
|
||||
private function fetchBenutzerGruppenFromStudiensemester($semester_range, $student_uid)
|
||||
{
|
||||
//$student_uid = getAuthUID();
|
||||
$benutzer_gruppen = [];
|
||||
// for each studiensemester fetch the benutzer gruppen and add them to an associate $bentuzer_gruppen array
|
||||
/*
|
||||
[
|
||||
['WS2023'] => [['gruppe1_SS2023','gruppe2_SS2023'],['gruppe1_WS2023','gruppe2_WS2023']],
|
||||
['SS2024'] => [['gruppe1_WS2023','gruppe2_WS2023'],['gruppe1_SS2024','gruppe2_SS2024']],
|
||||
['WS2024'] => [['gruppe1_SS2024','gruppe2_SS2024'],['gruppe1_WS2024','gruppe2_WS2024']],
|
||||
]
|
||||
*/
|
||||
foreach($semester_range as $semester_key => $semester_array)
|
||||
{
|
||||
$benutzer_gruppen[$semester_key] = [];
|
||||
// each semester could have ajoint semesters that need to be checked
|
||||
foreach($semester_array as $semester => $semester_date_range)
|
||||
{
|
||||
// for each active semester query the benutzer_gruppen associated to the semester
|
||||
$benutzer_query = $this->BenutzergruppeModel->execReadOnlyQuery("
|
||||
SELECT * FROM tbl_benutzergruppe where uid = ? AND studiensemester_kurzbz = ?", [$student_uid, $semester]);
|
||||
$benutzer_query_result = $this->getDataOrTerminateWithError($benutzer_query);
|
||||
array_push(
|
||||
$benutzer_gruppen[$semester_key],
|
||||
array_map(
|
||||
function ($item) {
|
||||
return "'".$item->gruppe_kurzbz. "'";
|
||||
},
|
||||
$benutzer_query_result
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// merge the gruppen of each studiensemester together for the original studiensemester
|
||||
/*
|
||||
[
|
||||
['WS2023'] => ['gruppe1_SS2023','gruppe2_SS2023','gruppe1_WS2023','gruppe2_WS2023'],
|
||||
['SS2024'] => ['gruppe1_WS2023','gruppe2_WS2023','gruppe1_SS2024','gruppe2_SS2024'],
|
||||
['WS2024'] => ['gruppe1_SS2024','gruppe2_SS2024','gruppe1_WS2024','gruppe2_WS2024'],
|
||||
]
|
||||
*/
|
||||
$benutzer_gruppen = array_map(
|
||||
function ($gruppe) {
|
||||
$merged_gruppe = [];
|
||||
foreach($gruppe as $gruppen_array)
|
||||
{
|
||||
$merged_gruppe = array_merge($merged_gruppe, $gruppen_array);
|
||||
}
|
||||
return $merged_gruppe;
|
||||
},
|
||||
$benutzer_gruppen
|
||||
);
|
||||
|
||||
return $benutzer_gruppen;
|
||||
}
|
||||
|
||||
//copied from Stundenplan.php, extended with $student_uid
|
||||
private function fetchStudentlehrverbandFromStudiensemester($semester_range, $student_uid)
|
||||
{
|
||||
//$student_uid = getAuthUID();
|
||||
$student_lehrverband = [];
|
||||
// for each studiensemester fetch the studentlehrverbaende and add them to an associate $student_lehrverband array
|
||||
/*
|
||||
[
|
||||
['WS2023'] => [ [ ['stg_kz'=>298,'semester'=>1,'verband'=>"A",'gruppe'=>""] ] ],
|
||||
['SS2024'] => [ [ ['stg_kz'=>298,'semester'=>1,'verband'=>"A",'gruppe'=>""] ], [ ['stg_kz'=>298,'semester'=>2,'verband'=>"A",'gruppe'=>""] ] ],
|
||||
['WS2024'] => [ [ ['stg_kz'=>298,'semester'=>2,'verband'=>"A",'gruppe'=>""] ], [ ['stg_kz'=>298,'semester'=>3,'verband'=>"A",'gruppe'=>""] ] ],
|
||||
]
|
||||
*/
|
||||
foreach($semester_range as $semester_key => $semester_array)
|
||||
{
|
||||
$student_lehrverband[$semester_key] = [];
|
||||
foreach($semester_array as $semester => $semester_date_range)
|
||||
{
|
||||
// for each active semester query the student_lehrverband associated to the semester
|
||||
$lehrverband_query = $this->BenutzergruppeModel->execReadOnlyQuery("
|
||||
SELECT * FROM tbl_studentlehrverband where student_uid = ? AND studiensemester_kurzbz = ?", [$student_uid, $semester]);
|
||||
$lehrverband_query_result = $this->getDataOrTerminateWithError($lehrverband_query);
|
||||
array_push($student_lehrverband[$semester_key], array_map(
|
||||
function ($item) {
|
||||
$result = new stdClass();
|
||||
$result->studiengang_kz = $item->studiengang_kz;
|
||||
$result->semester = $item->semester;
|
||||
$result->verband = $item->verband;
|
||||
$result->gruppe = $item->gruppe;
|
||||
return $result;
|
||||
},
|
||||
$lehrverband_query_result));
|
||||
}
|
||||
}
|
||||
|
||||
// merge the studentlehrverband of each studiensemester together for the original studiensemester
|
||||
/*
|
||||
[
|
||||
['WS2023'] => [ ['stg_kz'=>298,'semester'=>1,'verband'=>"A",'gruppe'=>""] ],
|
||||
['SS2024'] => [ ['stg_kz'=>298,'semester'=>1,'verband'=>"A",'gruppe'=>""], ['stg_kz'=>298,'semester'=>2,'verband'=>"A",'gruppe'=>""] ],
|
||||
['WS2024'] => [ ['stg_kz'=>298,'semester'=>2,'verband'=>"A",'gruppe'=>""], ['stg_kz'=>298,'semester'=>3,'verband'=>"A",'gruppe'=>""] ],
|
||||
]
|
||||
*/
|
||||
$student_lehrverband = array_map(
|
||||
function ($studentlehrverband) {
|
||||
$merged_studentlehrverband = [];
|
||||
foreach($studentlehrverband as $studentlehrverband_array)
|
||||
{
|
||||
$merged_studentlehrverband = array_merge($merged_studentlehrverband, $studentlehrverband_array);
|
||||
}
|
||||
return $merged_studentlehrverband;
|
||||
},
|
||||
$student_lehrverband
|
||||
);
|
||||
|
||||
return $student_lehrverband;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user