mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e7a3b22fe | ||
|
|
45647f0cec | ||
|
|
50a518ea7a | ||
|
|
2b44b421dc | ||
|
|
70a93cc093 | ||
|
|
4768fbda15 | ||
|
|
d8959d9776 | ||
|
|
4549c92d50 | ||
|
|
a5aa4c8466 | ||
|
|
8b58c82385 | ||
|
|
af978e1312 | ||
|
|
22500a96c1 | ||
|
|
03af6bfda5 | ||
|
|
0fafb95bd8 | ||
|
|
1d838f8116 | ||
|
|
9605227139 | ||
|
|
a64219dd25 | ||
|
|
e06d5fbdc1 | ||
|
|
d30595bbfb | ||
|
|
43d5068cda | ||
|
|
eebe2d6aec | ||
|
|
d5fa13d644 | ||
|
|
9ae2c91677 | ||
|
|
98175c5976 | ||
|
|
94992f40bd | ||
|
|
1e2dbeac10 | ||
|
|
153717b187 | ||
|
|
dd15b37f0f | ||
|
|
2fc2d12d65 | ||
|
|
0279813ba9 | ||
|
|
1c4c90ffba | ||
|
|
acedc11be8 | ||
|
|
c79f664f9e | ||
|
|
fb0a92a636 | ||
|
|
03858b12b9 | ||
|
|
342dede1b0 | ||
|
|
6e1c0fe623 | ||
|
|
fece3f7477 | ||
|
|
ab2333f708 | ||
|
|
c4e79ffdf9 | ||
|
|
15c1da74a2 | ||
|
|
4d2a6589b4 | ||
|
|
191a81058c | ||
|
|
dd25c7af75 | ||
|
|
ef996273a7 | ||
|
|
eb164f5f69 | ||
|
|
d33b45d7cb | ||
|
|
adce19e651 | ||
|
|
b3b6d847a7 | ||
|
|
80365de28c | ||
|
|
2d74522a4f | ||
|
|
d00aef66e1 | ||
|
|
241eec3ef2 | ||
|
|
2050f5ae65 | ||
|
|
587e523990 | ||
|
|
5ec1a1c54c | ||
|
|
2c65ccc8da | ||
|
|
787308aad4 | ||
|
|
8b44e4475b | ||
|
|
d251987850 | ||
|
|
e7127ae624 | ||
|
|
842ad77092 | ||
|
|
96104fd93a | ||
|
|
c34a74c040 | ||
|
|
ba92eea7eb | ||
|
|
ff33ea943d | ||
|
|
43b849e787 | ||
|
|
a4f8154662 | ||
|
|
33d3983a97 | ||
|
|
50951dfdcf | ||
|
|
a9f84eda42 | ||
|
|
be7527e994 | ||
|
|
3f3e94bdc9 | ||
|
|
72e7b215ef | ||
|
|
d5c1721ab1 | ||
|
|
8eb27b194f | ||
|
|
9bd3e7b1bc | ||
|
|
45595ab1fd | ||
|
|
3f056babac | ||
|
|
1a81f4a541 | ||
|
|
326e8c651c | ||
|
|
dfaaabfc2a | ||
|
|
f07f37ec35 | ||
|
|
1357ed5d3d | ||
|
|
579a55a00d | ||
|
|
0a00caa1e4 | ||
|
|
224cef7fad | ||
|
|
c53040ed5c | ||
|
|
f7465047cb | ||
|
|
0dadaece08 | ||
|
|
dafff1620d | ||
|
|
fc89a25d3a | ||
|
|
aaf8dd16ef | ||
|
|
fba5953b59 | ||
|
|
7ea80395a8 | ||
|
|
2d7458eefe | ||
|
|
9a45efd558 | ||
|
|
205b217854 | ||
|
|
e5ec9177e3 | ||
|
|
19c4cd70b8 | ||
|
|
75c341d983 | ||
|
|
f73f36ea6f | ||
|
|
6faf1cbcc2 | ||
|
|
87bd3975b8 | ||
|
|
5dc34ac0d0 | ||
|
|
09f18d9039 | ||
|
|
ec8b9a4c0a | ||
|
|
69fd223358 | ||
|
|
9c43374267 | ||
|
|
80e17e264a | ||
|
|
99445d2372 | ||
|
|
0ab6e3d00d | ||
|
|
ea7c0cccde | ||
|
|
385b262be8 | ||
|
|
b4206e1e48 | ||
|
|
e09555908a | ||
|
|
38060c60fb | ||
|
|
40516b34a2 | ||
|
|
ea97e3a192 | ||
|
|
f34481ae60 | ||
|
|
fcf3cbac6c | ||
|
|
6dfe292776 | ||
|
|
40b28b88b9 | ||
|
|
c90f7a31bb | ||
|
|
073160dde4 | ||
|
|
56fe8c9d09 | ||
|
|
9a3532265f | ||
|
|
11f2f0ad75 | ||
|
|
4abe6f0d24 | ||
|
|
4ecf1845d4 | ||
|
|
9fbbd6b855 | ||
|
|
60b2c89c66 | ||
|
|
59b4b2bac9 | ||
|
|
5f546fca2a | ||
|
|
1bf2b707ef | ||
|
|
f74b885253 | ||
|
|
3ab402adef | ||
|
|
52f24645fb | ||
|
|
4ac108174b | ||
|
|
6378b80d87 | ||
|
|
07d04d5701 | ||
|
|
3c373aac25 | ||
|
|
4e2254dfc7 | ||
|
|
a765de11ef | ||
|
|
658c8d6bd4 | ||
|
|
fe65dc60c4 | ||
|
|
e976c825c9 | ||
|
|
88b5a0af46 | ||
|
|
bf29faa5a7 | ||
|
|
2ada167557 | ||
|
|
a53551b462 | ||
|
|
f15349029f | ||
|
|
989ce6d707 | ||
|
|
018169b06a | ||
|
|
cc9d1f983e | ||
|
|
7275d6e897 | ||
|
|
0416a2ce7d | ||
|
|
dde95c8e01 | ||
|
|
349a0641cd | ||
|
|
304870f18c | ||
|
|
71e3cdb78d | ||
|
|
7260a0a00e | ||
|
|
5cfa398ea6 | ||
|
|
05375955d6 | ||
|
|
a0ea54d0c0 | ||
|
|
de627171d5 | ||
|
|
57c48f2c4a | ||
|
|
e32691994c | ||
|
|
6f3c0fb174 | ||
|
|
6d641bbd06 | ||
|
|
3455aed3f5 | ||
|
|
76130bbf2c | ||
|
|
f84d12277d | ||
|
|
9bf5bc2ad9 | ||
|
|
90bce8d3d5 | ||
|
|
364b506220 | ||
|
|
1b4297a9bf | ||
|
|
1bbea69139 | ||
|
|
916dab2584 | ||
|
|
67d53126c3 | ||
|
|
d639ec5e70 | ||
|
|
c6b1d518cf | ||
|
|
27765606e3 | ||
|
|
708ffac47e | ||
|
|
aff83fae49 | ||
|
|
90d8f5f2cc | ||
|
|
4e3ddad8c1 | ||
|
|
c2cb3f5b7a | ||
|
|
75d2cabdbe | ||
|
|
778bed969d | ||
|
|
cff5fa6d7b | ||
|
|
c24b6e6b32 | ||
|
|
e7b4a512ca | ||
|
|
cabda4cc35 | ||
|
|
a5d4629f07 | ||
|
|
16166db31a | ||
|
|
37d9ef66ed | ||
|
|
b2213bff62 | ||
|
|
411d2192cb | ||
|
|
391bf296d7 | ||
|
|
bae9d6d9a0 | ||
|
|
43d6a882ce | ||
|
|
7f3b4100ab | ||
|
|
9f54ecce54 | ||
|
|
7af0f4a478 | ||
|
|
0f843db33d | ||
|
|
3e59648d5b | ||
|
|
5923991848 | ||
|
|
55a6ec9d0d | ||
|
|
78505589c8 | ||
|
|
ab854067eb | ||
|
|
0e985113ec | ||
|
|
8d9113d5c8 | ||
|
|
7ce81ad4bd | ||
|
|
ea56ec8daa | ||
|
|
9e9990dd6e | ||
|
|
b80805e09c | ||
|
|
d22ed099bb | ||
|
|
84c99d23cd | ||
|
|
bf5ee2f64b | ||
|
|
55d6d90fa6 | ||
|
|
6adc55a843 | ||
|
|
52c1fba17b | ||
|
|
5e15d4b219 | ||
|
|
00954f680b | ||
|
|
36a302f20f | ||
|
|
92d27fc242 | ||
|
|
f6bb27cdb0 | ||
|
|
558963cd74 | ||
|
|
9a592047a0 | ||
|
|
e6947a3246 | ||
|
|
5cd0897348 | ||
|
|
a973a50576 | ||
|
|
7121b46bf9 | ||
|
|
00f07ba6f0 | ||
|
|
0b5c0f27a5 | ||
|
|
f846bb221a | ||
|
|
4c1d3ceedf | ||
|
|
f674546df8 | ||
|
|
7910cf3055 | ||
|
|
ab1c8e63ee | ||
|
|
67bbe9c105 | ||
|
|
d8355ba3f5 | ||
|
|
afb8011347 | ||
|
|
4d01b60808 | ||
|
|
46f8d0d07d | ||
|
|
6d5a4531e1 | ||
|
|
d85a3cb08f | ||
|
|
b2af8587c2 | ||
|
|
409c0d7fb4 | ||
|
|
15beaa9be8 | ||
|
|
574057da88 | ||
|
|
c81b5338de | ||
|
|
c433ff5c3a | ||
|
|
ab2a0e93ed | ||
|
|
9274743df3 | ||
|
|
d139c4ed66 | ||
|
|
dd410a74ba | ||
|
|
a5797a0bde | ||
|
|
5c69ede19e | ||
|
|
a5257eb934 | ||
|
|
97be497fda | ||
|
|
317da29376 | ||
|
|
772b8c603c | ||
|
|
37d5f2da5d | ||
|
|
27c39cfdca | ||
|
|
30c4e565dd | ||
|
|
d66fe72cc9 | ||
|
|
684d4f890a | ||
|
|
10218305db | ||
|
|
31bae9b693 | ||
|
|
59ac56374e | ||
|
|
a397460e0e | ||
|
|
c3c23d28bb | ||
|
|
9f0b387ab6 | ||
|
|
3a97f20122 | ||
|
|
046a552f34 | ||
|
|
e8a534f0fe | ||
|
|
1f21ed7364 | ||
|
|
774a1b81c4 | ||
|
|
f566ea1ac3 | ||
|
|
108f91ea1a | ||
|
|
4a92511b9b | ||
|
|
e1e228eae2 | ||
|
|
dc5a846c10 | ||
|
|
364477f0e9 | ||
|
|
d2ca33e757 | ||
|
|
1ece31fa7a | ||
|
|
b27d2a6b62 | ||
|
|
475b6210e0 | ||
|
|
8bfd90e159 | ||
|
|
8d8a4e8ca6 | ||
|
|
06895510e0 | ||
|
|
83b06b6c50 | ||
|
|
42fc89a944 | ||
|
|
9a951c499b | ||
|
|
86b06db9ff | ||
|
|
4e67d7b765 | ||
|
|
d710b4a9e4 | ||
|
|
bd99f3f927 | ||
|
|
eeb1529b64 | ||
|
|
98c3707802 | ||
|
|
e4c52701b7 | ||
|
|
43e9dad17d | ||
|
|
a27fa50e42 | ||
|
|
3c9f46941c | ||
|
|
196e9be728 | ||
|
|
a00f6363d9 | ||
|
|
a65b0d693f | ||
|
|
736e897928 | ||
|
|
21f8bb39b5 | ||
|
|
cd87ecc2d9 | ||
|
|
a3ae14b3f5 | ||
|
|
6cf4458dcd | ||
|
|
59b8d195c1 | ||
|
|
7926a2b201 | ||
|
|
b59c962f60 | ||
|
|
b6aa459b98 | ||
|
|
0d5c898106 | ||
|
|
c9c92f82d3 | ||
|
|
53a9fab70b | ||
|
|
5182f13bdb | ||
|
|
804dfc9327 | ||
|
|
74e2d1dcc5 | ||
|
|
e5c8807f17 | ||
|
|
d57985b90a | ||
|
|
af9e34a8ae | ||
|
|
10a97a80de | ||
|
|
56fcb23275 | ||
|
|
abd2f831f2 | ||
|
|
9d7f48f52c | ||
|
|
dd1a5064e4 | ||
|
|
a3ca578b3d | ||
|
|
e37321eeff | ||
|
|
505c71b18c | ||
|
|
efde2e9601 | ||
|
|
8f34142599 | ||
|
|
6570cc1fd7 | ||
|
|
fed0afd426 | ||
|
|
2c2c6efc5e | ||
|
|
0419286557 | ||
|
|
08f6bee2e4 | ||
|
|
cfa4dd8b8a | ||
|
|
dba199b531 | ||
|
|
ab637ded26 | ||
|
|
4c072aa819 | ||
|
|
f693f9d17c | ||
|
|
193dd166c3 | ||
|
|
2f86a1b017 | ||
|
|
75ddbdf7c1 | ||
|
|
d824334538 | ||
|
|
13515b2522 | ||
|
|
0a46bf52dd | ||
|
|
ecfe648bf5 | ||
|
|
bddd7b5d65 | ||
|
|
2686aee158 | ||
|
|
b7a2198057 | ||
|
|
bf6b588675 | ||
|
|
b427788e04 | ||
|
|
e7e561a4ba | ||
|
|
d9972c0d32 | ||
|
|
6c03110442 | ||
|
|
f717fb462f | ||
|
|
640a7285e1 | ||
|
|
e9fc0629f5 | ||
|
|
6f0279d451 | ||
|
|
2d73f97a25 | ||
|
|
dcd6163198 | ||
|
|
9f68fe6b3b | ||
|
|
7c9f6d89d6 | ||
|
|
ea3d01d23b | ||
|
|
c4ffc7283d | ||
|
|
0fa663145d | ||
|
|
b49831cae8 | ||
|
|
c616e9d450 | ||
|
|
9b0607ca74 | ||
|
|
3d728fd884 | ||
|
|
431e0bb341 | ||
|
|
2b4aef5633 | ||
|
|
dca30dccf3 | ||
|
|
b9d4aefd5e | ||
|
|
69048f8f48 | ||
|
|
beb54c1bc5 | ||
|
|
1afc4c9a29 | ||
|
|
96b4210d21 | ||
|
|
85fcecdcf6 | ||
|
|
55dc2b26d2 | ||
|
|
9c7a85826b | ||
|
|
36fe0a0f3c | ||
|
|
c5e296d557 | ||
|
|
d1ca6eb988 | ||
|
|
be4db980ad | ||
|
|
0ef905c6f2 | ||
|
|
21f0b18af4 | ||
|
|
6a786df198 | ||
|
|
4e16220da1 | ||
|
|
5ce02d747c | ||
|
|
9c31b27339 | ||
|
|
aa52c32d40 | ||
|
|
02a97fb0e2 | ||
|
|
2107c0839f | ||
|
|
b277725cc3 | ||
|
|
aade60179d | ||
|
|
e029b09add | ||
|
|
47b9e6c086 | ||
|
|
2fa8fd1703 | ||
|
|
89ea4187fa | ||
|
|
4e6a2d5218 | ||
|
|
0e099b2752 | ||
|
|
273f00a9c4 | ||
|
|
e876b9e4ab | ||
|
|
d7f383b969 | ||
|
|
a22a8acf83 | ||
|
|
32de4aac6b | ||
|
|
5c7df11ff3 | ||
|
|
c83674fc41 | ||
|
|
dcd17bb34f | ||
|
|
ed1925b517 | ||
|
|
5d024b3a71 | ||
|
|
507b47e9ea | ||
|
|
e7d2d3502b | ||
|
|
54168c86b4 | ||
|
|
a8dd995195 | ||
|
|
f46a3c1f68 | ||
|
|
a83fe561b9 | ||
|
|
ae56a4f2ed | ||
|
|
22b1f2822a | ||
|
|
1fd15e14d5 | ||
|
|
1ae02d8ed8 | ||
|
|
7cda22f807 | ||
|
|
68292b60af | ||
|
|
542590b470 | ||
|
|
eb460fdc0a | ||
|
|
65e76e951a | ||
|
|
43d69a5683 | ||
|
|
6c25a3b262 | ||
|
|
1f6c9e865b | ||
|
|
1abfbccb3e | ||
|
|
362d1c8bb0 | ||
|
|
25a61a56b7 | ||
|
|
afb210b0c2 | ||
|
|
c84146fcbd | ||
|
|
35decf476c | ||
|
|
0471f838b9 | ||
|
|
1c9d9d1ce5 | ||
|
|
379a99cb14 | ||
|
|
0d29a9ba32 | ||
|
|
ed44732eef | ||
|
|
6cfc4b0973 | ||
|
|
6296b87ea5 | ||
|
|
576a44838f | ||
|
|
c00e7a182c | ||
|
|
fd1b5daf9c | ||
|
|
c0b5f2f748 | ||
|
|
d391d1f09c | ||
|
|
a36ed55390 | ||
|
|
b0f317951b | ||
|
|
f65135be1e | ||
|
|
b8d86ba628 | ||
|
|
e9312dfbb3 | ||
|
|
b21900d006 | ||
|
|
11cfa670d6 | ||
|
|
a94fbeba14 | ||
|
|
e01b816ee8 | ||
|
|
52c90111cc | ||
|
|
012571d070 | ||
|
|
a2d10ae09d | ||
|
|
96bf45ceb0 | ||
|
|
c233902fe2 | ||
|
|
fd8de88abb | ||
|
|
0ec2c8c543 | ||
|
|
29738b6690 | ||
|
|
c5c29df6cc | ||
|
|
b217681ee5 | ||
|
|
7841a73fc0 | ||
|
|
0b1d0fbe4c | ||
|
|
2064008f9e | ||
|
|
19b9906c86 | ||
|
|
85807f5b8c | ||
|
|
a1950d179b | ||
|
|
2c3913a763 | ||
|
|
9111edf442 | ||
|
|
b1c47da3c3 | ||
|
|
67eb238876 | ||
|
|
66e400013a | ||
|
|
3f95bfd82f | ||
|
|
d4929c8e22 | ||
|
|
194b74e390 | ||
|
|
ee70e43bfb | ||
|
|
fc4b191dea | ||
|
|
cad23ef1ad | ||
|
|
f8d8d501ca | ||
|
|
7e6d670d82 | ||
|
|
0e10702fad | ||
|
|
0012e23bf6 | ||
|
|
f3a3bfcab6 | ||
|
|
d134509c90 | ||
|
|
4424c7d748 | ||
|
|
d436d8cb20 | ||
|
|
86c06e4756 | ||
|
|
3689c64b7b | ||
|
|
26ddd404c0 | ||
|
|
2801b9baf2 | ||
|
|
5dd07525dc | ||
|
|
2e33722674 | ||
|
|
b5e65cf072 | ||
|
|
d7cb61e5fc | ||
|
|
38447e2217 | ||
|
|
9629345473 | ||
|
|
4d72b0047a | ||
|
|
b991bbd9a5 | ||
|
|
5bed848aae | ||
|
|
f3b617d339 | ||
|
|
a4c5f9946f | ||
|
|
0be3505163 | ||
|
|
81f0b7a4bf | ||
|
|
6c550372a3 | ||
|
|
c86d6f4bf3 | ||
|
|
db7f46a874 | ||
|
|
a06d7bbfec | ||
|
|
d1adc160ca | ||
|
|
a70ef78ead | ||
|
|
5e509f7f19 | ||
|
|
3f257af006 | ||
|
|
7fac6062e5 | ||
|
|
7ba74143df | ||
|
|
c59b24ab4a | ||
|
|
c194e94b5c | ||
|
|
6d23f2b9fa | ||
|
|
0b70153da0 | ||
|
|
190d797d31 | ||
|
|
fb1c7f8e90 | ||
|
|
6428fccc48 | ||
|
|
d018ab18f8 | ||
|
|
dc22ac6b06 | ||
|
|
093e3d5c97 | ||
|
|
9bc9e57deb | ||
|
|
483d8f733f | ||
|
|
eb885bfea7 | ||
|
|
be5aad7c33 | ||
|
|
b7940a5cce | ||
|
|
f9b3939d09 | ||
|
|
69b19562f4 | ||
|
|
9948060ed8 | ||
|
|
06ec020c1c | ||
|
|
01f2099c28 | ||
|
|
9cb5d0895d | ||
|
|
086b271480 | ||
|
|
03b2d3d1a4 | ||
|
|
ff38731077 | ||
|
|
5399375bc1 | ||
|
|
3e8445304c | ||
|
|
b047b95505 | ||
|
|
3e48401a04 | ||
|
|
48f07eb3ca | ||
|
|
db5339e4a5 | ||
|
|
4ed87b5c2b | ||
|
|
d680c3aa2b | ||
|
|
d98bdb9745 | ||
|
|
0411befe8d | ||
|
|
90907d4276 | ||
|
|
8bf18b0d37 | ||
|
|
4a283ebf5d | ||
|
|
e27e64414a | ||
|
|
c47ac926d2 | ||
|
|
f751df55b6 | ||
|
|
ecd6588ead | ||
|
|
e7c133586b | ||
|
|
7e141f73d3 | ||
|
|
d5ee6f9cc2 | ||
|
|
7f9dcc43ad | ||
|
|
274262262a | ||
|
|
a721c1d14d | ||
|
|
79c0f31ddc | ||
|
|
49d61342c2 | ||
|
|
b662fa5fd3 | ||
|
|
be0943f1ba | ||
|
|
95e63f865c | ||
|
|
21886e30a3 | ||
|
|
2ab2176795 | ||
|
|
164c11e10a | ||
|
|
df2f142f37 | ||
|
|
c7bac03429 | ||
|
|
07d3b32279 | ||
|
|
245d0d3369 | ||
|
|
d3d04c5a77 | ||
|
|
f4cc311806 | ||
|
|
ff58f7a102 | ||
|
|
c0ed296ba7 | ||
|
|
2692806d4f | ||
|
|
a59f6085fe | ||
|
|
df46b8ebdd | ||
|
|
cce1c50495 | ||
|
|
765884b0dc | ||
|
|
fe8cf9bc83 | ||
|
|
4474a24ee2 | ||
|
|
f59e5a20ea | ||
|
|
c9fe633706 | ||
|
|
3ced1966f4 | ||
|
|
538223752b | ||
|
|
c9011fd6ed | ||
|
|
f0f9becc1f | ||
|
|
34c210a2a7 | ||
|
|
7abd35d11b | ||
|
|
d2c97d0238 | ||
|
|
1d0ca15bcb | ||
|
|
0bb81b23e5 | ||
|
|
b3ae1b74ab | ||
|
|
bf4b8348d2 | ||
|
|
f45782aeef | ||
|
|
c2faff5a03 | ||
|
|
1cff18112b | ||
|
|
195b99e588 | ||
|
|
6019489ef1 | ||
|
|
fc79f92796 | ||
|
|
22228478ad | ||
|
|
8e569a9ccd | ||
|
|
d7b2964e4e | ||
|
|
ac6aa28680 | ||
|
|
f6f58642f5 | ||
|
|
57eec98604 | ||
|
|
1561aa55b7 | ||
|
|
35f4d23308 | ||
|
|
bb366e4117 | ||
|
|
0ed56ca067 | ||
|
|
b0f90cafb6 | ||
|
|
870c36e76b | ||
|
|
b9c045382d | ||
|
|
c099eec7a7 | ||
|
|
0962e62e69 | ||
|
|
dcd6cfd74b | ||
|
|
5caab182b2 | ||
|
|
baaf941f25 | ||
|
|
2e5e7afb4d | ||
|
|
2c4626fd1a | ||
|
|
178638c006 | ||
|
|
981c97173e | ||
|
|
49d5c46133 | ||
|
|
9fb00f6cbd | ||
|
|
d56d1bc2bd | ||
|
|
45eca862ac | ||
|
|
9f738f4871 | ||
|
|
3533a3fd4b | ||
|
|
7d3096c2e8 | ||
|
|
ef2f9630a9 | ||
|
|
4d3c73c78f | ||
|
|
1e226f4515 | ||
|
|
ca8fe5bd19 | ||
|
|
e2497e1958 | ||
|
|
672acfe8fe | ||
|
|
6a4db90897 | ||
|
|
d4e170037b | ||
|
|
82587a70be | ||
|
|
0326a01585 | ||
|
|
7aba7aefb9 | ||
|
|
d0ef9ca96c | ||
|
|
e5ae400686 | ||
|
|
c468d350f3 | ||
|
|
a5d5d42ba3 | ||
|
|
15441a46f7 | ||
|
|
a9a56bb1e9 | ||
|
|
e840be84eb | ||
|
|
0b40455e3c | ||
|
|
1b822fc8f8 | ||
|
|
368eded1fd | ||
|
|
d9ea5a95af | ||
|
|
23502d4fab | ||
|
|
dbcacdddd6 | ||
|
|
8b2ef4e832 | ||
|
|
6fedb4b108 | ||
|
|
a7cc07fe15 | ||
|
|
e91f8e5ca4 | ||
|
|
905c69c384 | ||
|
|
c765c3c40a | ||
|
|
6fa0a7c102 | ||
|
|
7320dc448e | ||
|
|
ede9323224 | ||
|
|
3dcf72d679 | ||
|
|
3690babf62 | ||
|
|
9ca7ff73f4 | ||
|
|
c56064d189 | ||
|
|
424495c636 | ||
|
|
9c7e98f1cb | ||
|
|
23edcf3aa7 | ||
|
|
8ce67a4726 | ||
|
|
bcfdf1e05c | ||
|
|
cb744799bd | ||
|
|
90ebee25fe | ||
|
|
3e8ed231a6 | ||
|
|
4c67b9d267 | ||
|
|
c16cf342cb | ||
|
|
d843f05922 | ||
|
|
44e9b4dff1 | ||
|
|
bda42ab347 | ||
|
|
b5b69878b8 | ||
|
|
6f17ddbbdf | ||
|
|
ef1347c7d5 | ||
|
|
ca19306b72 | ||
|
|
66c0c14748 | ||
|
|
cffa493984 | ||
|
|
9030cdcc76 | ||
|
|
c3ef487a6f | ||
|
|
ac0eddf4c7 | ||
|
|
e373e797f4 | ||
|
|
382244035b | ||
|
|
b9c8c71274 | ||
|
|
d1fa5f64c4 | ||
|
|
21eb95bb23 | ||
|
|
b57836c2af | ||
|
|
e80ee03365 | ||
|
|
96b2d88d39 | ||
|
|
474fc1fc57 | ||
|
|
3825e2fb38 | ||
|
|
e856c8ad6b | ||
|
|
2723d6a741 | ||
|
|
e5e22931a9 | ||
|
|
21ea277aaf | ||
|
|
2c0badf67c | ||
|
|
5e72161ab0 | ||
|
|
e86e7f0bd8 | ||
|
|
c36f259571 | ||
|
|
501bae585a | ||
|
|
2c72f704d0 | ||
|
|
194de7b4e7 | ||
|
|
c03609142b | ||
|
|
5374f71732 | ||
|
|
c53d451000 | ||
|
|
903f3b99b3 | ||
|
|
f6747713a1 | ||
|
|
59ddf175ed | ||
|
|
ccd8d5f871 | ||
|
|
bd47ad2b8c | ||
|
|
e90019cdd8 | ||
|
|
df9edc36e0 | ||
|
|
39f1716ae2 | ||
|
|
c7b25e6632 | ||
|
|
695f3455e6 | ||
|
|
be508c99ea | ||
|
|
1339077b57 | ||
|
|
3aebccbb9d | ||
|
|
ee6f28c06d | ||
|
|
fdb037da96 | ||
|
|
71a77fc576 | ||
|
|
49cbbfc50c | ||
|
|
4f8e98f5d5 | ||
|
|
a028297da6 | ||
|
|
e9e614aa52 | ||
|
|
ac44b36b59 | ||
|
|
4c0635be7c | ||
|
|
67b863f9db | ||
|
|
7628ebc9ca | ||
|
|
50af6694d0 | ||
|
|
deb6dad7ad | ||
|
|
077f052112 | ||
|
|
e7f57c9ddd | ||
|
|
095e2bf581 | ||
|
|
25345a0522 | ||
|
|
e2b5201b5a | ||
|
|
5c80a382bf | ||
|
|
aa940683d6 | ||
|
|
5dbddb4beb | ||
|
|
b20613f5d7 | ||
|
|
843c65d52b | ||
|
|
e26f4262df | ||
|
|
dde586e004 | ||
|
|
506c23ae89 | ||
|
|
0621564be7 | ||
|
|
f1714db09e | ||
|
|
e90e03e0cc | ||
|
|
335671b46a | ||
|
|
19b8c16057 | ||
|
|
70b025da30 | ||
|
|
87dd858358 | ||
|
|
51f3edcd72 | ||
|
|
e7f626bd72 | ||
|
|
dea3aac222 | ||
|
|
17f94aabdf | ||
|
|
5d7281e470 | ||
|
|
c49e32c4ac | ||
|
|
a7d925a177 | ||
|
|
df124db84a | ||
|
|
29a4b4aadc | ||
|
|
4ef4a06a7e | ||
|
|
2682ea75ab | ||
|
|
b3a63a60e9 | ||
|
|
a54dfaf0c7 | ||
|
|
595538d6bb | ||
|
|
a5329e5bba | ||
|
|
37a79c4589 | ||
|
|
29515491a2 | ||
|
|
dd760f8210 | ||
|
|
dd87e893ba | ||
|
|
6cb8d0a9d1 | ||
|
|
2c4574d93b | ||
|
|
127ce312ea | ||
|
|
2fde630971 | ||
|
|
2237e9f1b7 | ||
|
|
fce5ee7a16 | ||
|
|
8ccb9cd892 | ||
|
|
9b4fa132dc | ||
|
|
daf332a102 | ||
|
|
d1af44bcdc | ||
|
|
5a6d20f817 | ||
|
|
7f91e20d03 | ||
|
|
ce5da22180 | ||
|
|
05b2c3c42b | ||
|
|
2dd732b924 | ||
|
|
233a6e8b89 | ||
|
|
c127c0900e | ||
|
|
fc01fa045e | ||
|
|
110f73e622 | ||
|
|
bb0d118284 | ||
|
|
701ccadff3 | ||
|
|
bb23679683 | ||
|
|
34555504df | ||
|
|
d1f5220925 | ||
|
|
decd514b22 | ||
|
|
6cf7093293 | ||
|
|
17f11fa871 | ||
|
|
96812868a4 | ||
|
|
40c79158f7 | ||
|
|
054663ee00 | ||
|
|
81eee814e9 | ||
|
|
390a3c0d5a | ||
|
|
695dd655c0 | ||
|
|
c34ffedb42 | ||
|
|
e26387a75a | ||
|
|
b5382b1bdf | ||
|
|
519cbc7601 | ||
|
|
ab63bf9d74 | ||
|
|
957da460a6 | ||
|
|
c664c14afc | ||
|
|
8f9f447acf | ||
|
|
2cee36d7b5 | ||
|
|
60f128b314 | ||
|
|
cc0a89c924 | ||
|
|
8f974e8902 | ||
|
|
a91fe05395 | ||
|
|
d9cdeb9773 | ||
|
|
0de033e428 | ||
|
|
1ab9635039 | ||
|
|
43925e3088 | ||
|
|
1c236cce02 | ||
|
|
4956a517ca | ||
|
|
e7fdbe13d0 | ||
|
|
00477528cc | ||
|
|
4c6d645cc6 | ||
|
|
d9c7df736c | ||
|
|
73244df019 | ||
|
|
91d24ebae8 | ||
|
|
6861e26ed6 | ||
|
|
34242e12ea | ||
|
|
efc67d14a5 | ||
|
|
bd67e41aa6 | ||
|
|
601c6c53e7 | ||
|
|
b7ba740a3a | ||
|
|
a6167583a3 | ||
|
|
9183c4f04c | ||
|
|
f57dc6785b | ||
|
|
1e68eb0b90 | ||
|
|
332efd4106 | ||
|
|
f303191c54 | ||
|
|
d6c7f16ceb | ||
|
|
f1912fe739 | ||
|
|
cf59bcff12 | ||
|
|
2f7fe05d21 | ||
|
|
ee4b61f549 | ||
|
|
511a4256bc | ||
|
|
3c9db86df2 | ||
|
|
367204a1ee | ||
|
|
bbe55a75ea | ||
|
|
e58bf3a8cf | ||
|
|
1f2f866c61 | ||
|
|
6ccbc95697 | ||
|
|
52d9e0a195 | ||
|
|
6a3982347b | ||
|
|
fe7feeb74e | ||
|
|
6495f741b9 | ||
|
|
b2419beca6 | ||
|
|
b752b475d9 | ||
|
|
658fe79ad7 | ||
|
|
5bbf05ac8a | ||
|
|
d3210f0d3d | ||
|
|
a0dce925d4 |
@@ -1,5 +1,6 @@
|
||||
documents/
|
||||
vendor/
|
||||
public/vendor
|
||||
|
||||
/nbproject/
|
||||
.vscode
|
||||
|
||||
@@ -23,6 +23,15 @@ Events::on('loadRenderers', function ($renderers) {
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["slot_room"] = array(
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Slot/roomModalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Slot/roomModalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["ferien"] = array(
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['infocenter_studiengang_kz'] = '10021, 10027, 10002';
|
||||
$config['infocenter_qualifikationskurs_kz'] = '10002';
|
||||
|
||||
@@ -8,4 +8,15 @@ $config['lvverwaltung_tags'] = [
|
||||
];
|
||||
*/
|
||||
|
||||
$config['lvverwaltung_tags'] = [];
|
||||
$config['lvverwaltung_tags'] = [];
|
||||
|
||||
# Additional columns:
|
||||
/*
|
||||
$config["list_columns"] = [
|
||||
'fieldname' => [
|
||||
'js' => 'path/to/snippet.js', // tabulator config snippet (eg: return { name: 'Name', field: 'fieldname' }; )
|
||||
// NOTE: 'default' & 'joins' like in stv.php config are currently not available here
|
||||
]
|
||||
];
|
||||
*/
|
||||
|
||||
|
||||
@@ -170,6 +170,13 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 51,
|
||||
'requiredPermissions' => 'vertrag/mitarbeiter:r'
|
||||
),
|
||||
'studierendenverwaltung' => array(
|
||||
'link' => site_url('studentenverwaltung'),
|
||||
'description' => 'Studierendenverwaltung',
|
||||
'expand' => true,
|
||||
'sort' => 52,
|
||||
'requiredPermissions' => ['admin:r', 'assistenz:r']
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -378,7 +385,7 @@ $config['navigation_menu']['apps'] = [
|
||||
],
|
||||
'lav' => [
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
|
||||
'description' => 'Lehraufträge',
|
||||
'description' => 'Lehrauftragsverwaltung',
|
||||
#'icon' => 'person-chalkboard',
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
|
||||
]
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Noten die keinen Prüfungsantritt verbrauchen. Fallback-PKs; massgeblich sind die per Bezeichnung
|
||||
// aufgelösten Noten (NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN), da die PKs je Installation abweichen.
|
||||
$config['NOTEN_OHNE_ANTRITT'] = [9, 17]; // tbl_note pk
|
||||
|
||||
// 'Nicht beurteilt' ist eine Altlast: formal eine Note, inhaltlich keine Leistungsfeststellung.
|
||||
// Wird weiterhin häufig vergeben und darf daher keinen Antritt kosten.
|
||||
$config['NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN'] = ['Noch nicht eingetragen', 'entschuldigt', 'Nicht beurteilt'];
|
||||
|
||||
// Anrechnungsnoten: die Leistung wurde vorab anerkannt, der/die Studierende ist zwar Teil der
|
||||
// Lehrveranstaltung, tritt aber zu keiner Prüfung an. Solange die ZEUGNISNOTE eine davon ist, sind
|
||||
// für diese Lehrveranstaltung keine Prüfungen möglich. Auflösung wie oben über die Bezeichnung,
|
||||
// die PKs sind nur Fallback.
|
||||
$config['NOTEN_ANRECHNUNG_BEZEICHNUNGEN'] = ['angerechnet', 'intern angerechnet'];
|
||||
$config['NOTEN_ANRECHNUNG'] = [6, 16]; // tbl_note pk
|
||||
|
||||
$config['NOTEN_OCCURANCE_LIMIT_MAP'] = [17 => 1]; // über alle Antritte hinweg nur ein entschuldigt
|
||||
|
||||
// tbl_note pk of the 'entschuldigt' note. An entschuldigt Termin is preserved as its own dated
|
||||
// entry when a new pruefung of the same type is created (instead of being overwritten).
|
||||
$config['NOTE_ENTSCHULDIGT'] = 17;
|
||||
|
||||
// The maximum number of attempts that count, the first attempt and the kommissionelle attempt
|
||||
// included. null derives the number from the old flags:
|
||||
// 1 (the original assessment) + TERMIN2 + TERMIN3 + KOMMPRUEF
|
||||
// The examination rules permit three attempts. With TERMIN2 and KOMMPRUEF the formula gives 3.
|
||||
// An installation with TERMIN3 gets 4, which is one more attempt in the same chain.
|
||||
$config['CIS_GESAMTNOTE_MAX_ANTRITTE'] = null;
|
||||
|
||||
// The exam types that take place before a commission.
|
||||
$config['PRUEFUNG_KOMMISSIONELL_TYPEN'] = ['kommPruef', 'zusKommPruef'];
|
||||
|
||||
// The type that the tool writes for the last attempt. The last attempt is always kommissionell.
|
||||
$config['PRUEFUNG_TYP_KOMMISSIONELL'] = 'kommPruef';
|
||||
|
||||
// Exam types that never use an attempt. A zusKommPruef repeats a kommissionelle Prüfung that had
|
||||
// a procedural fault. It stands outside the attempt chain, and the student administration enters
|
||||
// it. The examination rules do not describe it.
|
||||
$config['PRUEFUNG_TYPEN_OHNE_ANTRITT'] = ['zusKommPruef'];
|
||||
|
||||
// Spaltenaufteilung der Prüfungen in der Notentabelle:
|
||||
// 'antritt' - eine Spalte je Antrittsnummer, Datum steht in der Zelle (robust bei Einzelterminen)
|
||||
// 'datum' - eine Spalte je Prüfungsdatum (kompakt, wenn ganze Jahrgänge am selben Tag antreten)
|
||||
// Nur die Vorgabe; im Tool umschaltbar und pro Benutzer gespeichert.
|
||||
$config['CIS_GESAMTNOTE_PRUEFUNGSSPALTEN'] = 'antritt';
|
||||
|
||||
// Bei der Notenübernahme durch die Assistenz den ersten Antritt als eigene Prüfung anlegen.
|
||||
$config['CIS_GESAMTNOTE_ERSTANTRITT_BEI_UEBERNAHME'] = true;
|
||||
|
||||
// availability of the two Benotungstool import flows. When both are true they are shown as
|
||||
// separate buttons/dialogs.
|
||||
$config['CIS_GESAMTNOTE_PRUEFUNGSIMPORT'] = true; // dated import that creates a pruefung per row
|
||||
$config['CIS_GESAMTNOTE_NOTENIMPORT'] = false; // classic note-only import (uid + note, no date)
|
||||
|
||||
// Noteneintragungsfrist (Prüfungsordnung §1): grade/pruefung entry is only permitted up to this
|
||||
// deadline. The month/day below is applied to the studiensemester's year:
|
||||
// Sommersemester (SSyyyy) -> deadline in the SAME calendar year (default 15th November)
|
||||
// Wintersemester (WSyyyy) -> deadline in the FOLLOWING calendar year (default 15th May)
|
||||
$config['CIS_GESAMTNOTE_NOTENEINTRAGUNGSFRIST'] = false; // switch to use the window enforcement
|
||||
$config['NOTENEINTRAGUNGSFRIST_SS'] = ['month' => 11, 'day' => 15]; // Sommersemester deadline (same year)
|
||||
$config['NOTENEINTRAGUNGSFRIST_WS'] = ['month' => 5, 'day' => 15]; // Wintersemester deadline (following year)
|
||||
@@ -61,12 +61,29 @@ $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';
|
||||
|
||||
// Legacy CMS news routes
|
||||
$route['api/frontend/v1/Cms/getNewsItem/(:num)'] = 'api/frontend/v1/NewsAdministrationAPI/getNewsItem/$1';
|
||||
$route['api/frontend/v1/Cms/storeNewsItem'] = 'api/frontend/v1/NewsAdministrationAPI/storeNewsItem';
|
||||
$route['api/frontend/v1/Cms/updateNewsItem/(:num)'] = 'api/frontend/v1/NewsAdministrationAPI/updateNewsItem/$1';
|
||||
$route['api/frontend/v1/Cms/deleteNewsItem/(:num)'] = 'api/frontend/v1/NewsAdministrationAPI/deleteNewsItem/$1';
|
||||
|
||||
// Keep legacy uppercase URLs refreshable while using the canonical controller method casing
|
||||
$route['CisVue/Cms/NewsAdministration'] = 'CisVue/Cms/newsAdministration';
|
||||
|
||||
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
|
||||
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
|
||||
$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
|
||||
$route['Cis/OtherLvPlan/.*'] = 'Cis/OtherLvPlan/index/$1';
|
||||
//Route for LV Plan Stg/Semester/Verband/Gruppe
|
||||
$route['Cis/StgOrgLvPlan/.*'] = 'Cis/StgOrgLvPlan/index/$1';
|
||||
$route['Cis/Benotungstool/.*'] = 'Cis/Benotungstool/index/$1';
|
||||
|
||||
$route['Cis/MyReservation'] = 'Cis/MyReservation/index/$1';
|
||||
|
||||
//Route for Zeitsperrenma
|
||||
$route['Cis/Zeitsperrenma/.*'] = 'Cis/Zeitsperrenma/index/$1';
|
||||
//Route für Zeitsperren
|
||||
$route['Cis/Zeitsperren/.*'] = 'Cis/Zeitsperren/index/$1';
|
||||
|
||||
$route['Abgabetool/Assistenz'] = 'Cis/Abgabetool/Assistenz';
|
||||
$route['Abgabetool/Assistenz/(:any)'] = 'Cis/Abgabetool/Assistenz/$1';
|
||||
@@ -75,52 +92,67 @@ $route['Abgabetool/Student'] = 'Cis/Abgabetool/Student';
|
||||
$route['Abgabetool/Student/(:any)'] = 'Cis/Abgabetool/Student/$1';
|
||||
$route['Abgabetool/Deadlines'] = 'Cis/Abgabetool/Deadlines';
|
||||
|
||||
// Studierendenverwaltung App Routes
|
||||
$route['studvw'] = 'studentenverwaltung/index';
|
||||
$route['studvw/.*'] = 'studentenverwaltung/index';
|
||||
// Old routes
|
||||
$route['studentenverwaltung'] = 'redirect/301/studvw';
|
||||
$route['studentenverwaltung/(:any)'] = 'redirect/301/studvw/stdsem/$1';
|
||||
$route['studentenverwaltung/(:any)/(prestudent|student|person|search)/(:any)'] = 'redirect/301/studvw/stdsem/$1/$2/$3';
|
||||
$route['studentenverwaltung/(:any)/prestudent/(:any)/tab/:any'] = 'redirect/301/studvw/stdsem/$1/prestudent/$2';
|
||||
$route['studentenverwaltung/(:any)/search/(:any)/(:any)'] = 'redirect/301/studvw/stdsem/$1/search/$2/$3';
|
||||
$route['studentenverwaltung/(:any)/(:any)'] = 'redirect/301/studvw/stdsem/$1/stg/$2';
|
||||
|
||||
// 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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/inout/1/incoming/1'] = 'api/frontend/v1/stv/students/getIncoming/$1';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/inout/1/outgoing/1'] = 'api/frontend/v1/stv/students/getOutgoing/$1';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/inout/1/shared_studies/1'] = 'api/frontend/v1/stv/students/getGemeinsamestudien/$1';
|
||||
|
||||
// (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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)/:any/1/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1'] = 'api/frontend/v1/stv/students/getPrestudents/$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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)/:any/1/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2';
|
||||
|
||||
// (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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)/verband/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)/verband/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2';
|
||||
|
||||
// (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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/verband/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3/$4/$5/$6';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/verband/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3';
|
||||
|
||||
// (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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudentsSpezialgruppe/$1/$2/$3/$4';
|
||||
|
||||
// (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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgformSpezialgruppe/$1/$3/$2/$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';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/prestudent/(:any)'] = 'api/frontend/v1/stv/students/getPrestudent/$1/$2';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/student/(:any)'] = 'api/frontend/v1/stv/students/getStudent/$1/$2';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/person/(:any)'] = 'api/frontend/v1/stv/students/getPerson/$1/$2';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/stv/.*'] = 'api/frontend/v1/stv/students/index';
|
||||
|
||||
// Lvverwaltung List Routes
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
|
||||
|
||||
// // (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'];
|
||||
|
||||
@@ -197,3 +197,11 @@ $config['unterbrechung_enabled'] = true;
|
||||
*/
|
||||
$config['wiederholung_enabled'] = true;
|
||||
|
||||
/**
|
||||
* Modal with Infotext of TLC
|
||||
* if true, there will be shown an info modal in the studentsView after the first button ABMELDUNG
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
$config['showInfoModalAbmeldung'] = true;
|
||||
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
<?php
|
||||
|
||||
$config['number_displayed_past_studiensemester_default'] = 5;
|
||||
|
||||
# Additional columns:
|
||||
/*
|
||||
$config["list_columns"] = [
|
||||
'fieldname' => [
|
||||
'js' => 'path/to/snippet.js', // tabulator config snippet (eg: return { name: 'Name', field: 'fieldname' }; )
|
||||
'default' => "SQL SELECT statement for value",
|
||||
'joins' => [
|
||||
// additional joins needed for the SELECT statement above
|
||||
[
|
||||
'tablename',
|
||||
'join condition', // single fieldname for USING or full condition for ON
|
||||
'LEFT|RIGHT', // optional - join type
|
||||
'after_xxx|before_xxx|end' // optional - position in query
|
||||
]
|
||||
// ...
|
||||
]
|
||||
]
|
||||
];
|
||||
*/
|
||||
|
||||
$config['tabs'] =
|
||||
[
|
||||
'details' => [
|
||||
@@ -60,7 +81,13 @@ $config['tabs'] =
|
||||
],
|
||||
'notes' => [
|
||||
//if true, the count of Messages will be shown in the header of the Tab Messages
|
||||
'showCountNotes' => true
|
||||
'showCountNotes' => true,
|
||||
|
||||
//if true: section with following fields will be displayed: 'verfasser', 'bearbeiter', 'von', 'bis' and 'erledigt'
|
||||
'showErweitert' => false,
|
||||
|
||||
//notizlayout: choose of "classicFas", "twoColumnsFormLeft", twoColumnsFormRight, popupModal"
|
||||
'notizLayout' => 'popupModal'
|
||||
],
|
||||
'combinePeople' => [
|
||||
//multitab should only be shown with this length of selection
|
||||
@@ -133,13 +160,25 @@ $config['students_tab_order'] = [
|
||||
|
||||
$config['stv_prestudent_tags'] = [
|
||||
'prioone' => ['readonly' => false],
|
||||
'priotwo' => ['readonly' => true],
|
||||
'priotwo' => ['readonly' => false],
|
||||
'hinweis' => ['readonly' => false],
|
||||
'hinweis_assistenz' => ['readonly' => true],
|
||||
'hinweis_kf' => ['readonly' => true],
|
||||
'hinweis_assistenz' => ['readonly' => false],
|
||||
'hinweis_kf' => ['readonly' => false],
|
||||
'hinweis_lehrende' => ['readonly' => false],
|
||||
'hinweis_stg_kf' => ['readonly' => true],
|
||||
'finished_stg' => ['readonly' => true],
|
||||
'finished_kf' => ['readonly' => true],
|
||||
'inwork_kf' => ['readonly' => true],
|
||||
'hinweis_stg_kf' => ['readonly' => false],
|
||||
'finished_stg' => ['readonly' => false],
|
||||
'finished_kf' => ['readonly' => false],
|
||||
'inwork_kf' => ['readonly' => false],
|
||||
'dd_auto' => ['readonly' => true],
|
||||
'wh_auto' => ['readonly' => true],
|
||||
'prewh_auto' => ['readonly' => true],
|
||||
'out_auto' => ['readonly' => true],
|
||||
'zgv_auto' => ['readonly' => true],
|
||||
'unterbrecher_auto' => ['readonly' => true],
|
||||
'stbtr_erh_auto' => ['readonly' => true],
|
||||
'jgv_auto' => ['readonly' => true],
|
||||
'in_auto' => ['readonly' => true],
|
||||
'preabbr_auto' => ['readonly' => true],
|
||||
];
|
||||
|
||||
$config['userAutomatedTags'] = 'sftest';
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['stv'] = [
|
||||
"library" => "treemenu/StudVwLib",
|
||||
"permissions" => ["admin:r", "assistenz:r"]
|
||||
];
|
||||
$config['lvv'] = [
|
||||
"library" => "treemenu/LvVwLib",
|
||||
"permissions" => ["admin:r", "assistenz:r"]
|
||||
];
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['root'] = [
|
||||
'stg' => [
|
||||
'semester' => [
|
||||
'group',
|
||||
'verband' => [
|
||||
'group'
|
||||
]
|
||||
],
|
||||
'orgform'
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['root'] = [
|
||||
'stg' => [
|
||||
'prestudent' => [
|
||||
'stdsem' => [
|
||||
'interessenten' => [
|
||||
'bewerbungnichtabgeschickt',
|
||||
'bewerbungabgeschickt',
|
||||
'zgv',
|
||||
'statusbestaetigt' => [
|
||||
'statusbestaetigtrtnichtangemeldet',
|
||||
'statusbestaetigtrtangemeldet'
|
||||
],
|
||||
'reihungstestnichtangemeldet',
|
||||
'reihungstestangemeldet'
|
||||
],
|
||||
'bewerber' => [
|
||||
'bewerberrtnichtangemeldet',
|
||||
'bewerberrtangemeldet' => [
|
||||
'bewerberrtangemeldetteilgenommen',
|
||||
'bewerberrtangemeldetnichtteilgenommen'
|
||||
]
|
||||
],
|
||||
'aufgenommen',
|
||||
'warteliste',
|
||||
'absage',
|
||||
'incoming'
|
||||
]
|
||||
],
|
||||
'semester' => [
|
||||
'group',
|
||||
'verband' => [
|
||||
'group'
|
||||
]
|
||||
]
|
||||
],
|
||||
'inout' => [
|
||||
'incoming',
|
||||
'outgoing',
|
||||
'shared_studies'
|
||||
]
|
||||
];
|
||||
|
||||
// copy stg tree into stg/orgforms
|
||||
$config['root']['stg']['orgform'] = $config['root']['stg'];
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Benotungstool extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => array('lehre/benotungstool:rw', 'lehre/benotungstool_assistenz:rw')
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Benotungstool']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Compat extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'ci' => ['basis/cis:r'],
|
||||
'legacy' => ['basis/cis:r'],
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ci()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function legacy()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class MyReservation 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()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'MyReservation']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ProjektabgabeUebersicht extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'ProjektabgabeUebersicht']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* index loads the view Zeitsperren
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'zeitsperren']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Zeitsperrenma extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'Zeitsperrenma']);
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,15 @@ class Cms extends Auth_Controller
|
||||
array(
|
||||
'content' => 'basis/cis:r',
|
||||
'getNews' => 'basis/cis:r',
|
||||
'getNewsRowCount' => 'basis/cis:r',
|
||||
'getRoomInformation' => 'basis/cis:r',
|
||||
'news' => 'basis/cis:r'
|
||||
'news' => 'basis/cis:r',
|
||||
'newsAdministration' => ['basis/news:r'],
|
||||
)
|
||||
);
|
||||
|
||||
// Loads Libraries
|
||||
$this->load->library('CmsLib');
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
@@ -83,10 +84,18 @@ class Cms extends Auth_Controller
|
||||
*/
|
||||
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']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', [
|
||||
'route' => 'News',
|
||||
]);
|
||||
}
|
||||
|
||||
public function newsAdministration()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', [
|
||||
'route' => 'NewsAdministration',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getRoomInformation($ort_kurzbz)
|
||||
{
|
||||
// Load Config
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller redirects urls to another location. This is mainly used
|
||||
* with the $routes config
|
||||
*/
|
||||
class Redirect extends CI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function to handle all redirects.
|
||||
*
|
||||
* @param string $method - the redirect code (30x)
|
||||
* @param array $params - the url to redirect to
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params)
|
||||
{
|
||||
redirect($params, 'location', $method);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Benutzer extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getUserData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getUserData()
|
||||
{
|
||||
$uid = $this->input->get("uid") ?? getAuthUID();
|
||||
$this->BenutzerModel->addSelect("uid, person_id, insertamum");
|
||||
$userResult = $this->BenutzerModel->load(["uid" => $uid]);
|
||||
$userData = $this->getDataOrTerminateWithError($userResult);
|
||||
$this->terminateWithSuccess($userData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,11 @@ class CisMenu extends FHCAPI_Controller
|
||||
|
||||
private function generateUrlForMenuItem($menuItem)
|
||||
{
|
||||
$menuItem->url = $this->menuItemUrlHelper($menuItem);
|
||||
unset($menuItem->content);
|
||||
if(!isset($menuItem->url))
|
||||
{
|
||||
$menuItem->url = $this->menuItemUrlHelper($menuItem);
|
||||
unset($menuItem->content);
|
||||
}
|
||||
|
||||
if ($menuItem->childs && count($menuItem->childs)) {
|
||||
$menuItem->childs = $this->generateUrlsForMenuItems($menuItem->childs);
|
||||
@@ -83,7 +86,7 @@ class CisMenu extends FHCAPI_Controller
|
||||
return site_url("/CisVue/Cms/content/" . $menuItem->content_id);
|
||||
}
|
||||
|
||||
if (!$menuItem->content || !mb_strlen($menuItem->content)) {
|
||||
if (!isset($menuItem->content) || !$menuItem->content || !mb_strlen($menuItem->content)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -91,6 +94,8 @@ class CisMenu extends FHCAPI_Controller
|
||||
$doc->loadXML($menuItem->content);
|
||||
$urlElem = $doc->getElementsByTagName('url')->item(0);
|
||||
|
||||
$this->menuItemUrlTargetHelper($menuItem, $doc);
|
||||
|
||||
if (!$urlElem) {
|
||||
return '';
|
||||
}
|
||||
@@ -122,5 +127,18 @@ class CisMenu extends FHCAPI_Controller
|
||||
return $url;
|
||||
}
|
||||
|
||||
private function menuItemUrlTargetHelper($menuItem, $xmldoc)
|
||||
{
|
||||
if($menuItem->template_kurzbz === 'redirect')
|
||||
{
|
||||
$targetElem = $xmldoc->getElementsByTagName('target')->item(0);
|
||||
$target = ($targetElem) ? $targetElem->textContent : '';
|
||||
if(!in_array($target, array('_self', '_top', '_blank')))
|
||||
{
|
||||
$target = '_self';
|
||||
}
|
||||
$menuItem->target = $target;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,14 +36,15 @@ class Cms extends FHCAPI_Controller
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'content' => self::PERM_LOGGED,
|
||||
'news' => self::PERM_LOGGED,
|
||||
'getNewsRowCount' => self::PERM_LOGGED,
|
||||
'newsForWidget' => self::PERM_LOGGED,
|
||||
'getNews' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
// setting up the papgination_size
|
||||
$this->page_size = 10;
|
||||
|
||||
@@ -59,7 +60,6 @@ class Cms extends FHCAPI_Controller
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
@@ -106,7 +106,7 @@ class Cms extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($content_id);
|
||||
}
|
||||
|
||||
public function news()
|
||||
public function newsForWidget()
|
||||
{
|
||||
|
||||
// form validation
|
||||
@@ -118,7 +118,7 @@ class Cms extends FHCAPI_Controller
|
||||
$this->load->model('content/news_model', 'NewsModel');
|
||||
|
||||
$limit = $this->input->get('limit',TRUE);
|
||||
|
||||
|
||||
//query the news
|
||||
$news = $this->NewsModel->getAll($limit);
|
||||
|
||||
@@ -157,23 +157,7 @@ class Cms extends FHCAPI_Controller
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = false, $titel = '', $edit = false, $sichtbar = true)
|
||||
{
|
||||
//form validation
|
||||
$this->load->library('form_validation');
|
||||
@@ -193,15 +177,45 @@ class Cms extends FHCAPI_Controller
|
||||
|
||||
// default value for the page_size is 10
|
||||
$page_size = $page_size ?? 10;
|
||||
|
||||
$passedSichtbar = $this->input->get('published', true);
|
||||
if($passedSichtbar !== null)
|
||||
{
|
||||
$sichtbar = $passedSichtbar;
|
||||
}
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size, $sprache);
|
||||
$filterForDegreePrograms = false;
|
||||
$entitledDegreePrograms = [];
|
||||
$student = $this->StudentModel->loadWhere(['student_uid' => getAuthUID()]);
|
||||
if(isError($student))
|
||||
{
|
||||
$this->terminateWithError(getError($student));
|
||||
}
|
||||
if(hasData($student))
|
||||
{
|
||||
$student = current(getData($student));
|
||||
|
||||
$degreeProgramSemesterDataResult = $this->PrestudentModel->getStudiengaengAndAusbildungssemesterByStudentUid(getAuthUID());
|
||||
$degreeProgramSemesterData = $this->getDataOrTerminateWithError($degreeProgramSemesterDataResult)[0];
|
||||
if ($degreeProgramSemesterData) {
|
||||
$studiengang_kz = isset($degreeProgramSemesterData->studiengang_kz) ? $degreeProgramSemesterData->studiengang_kz : null;
|
||||
$semester = isset($degreeProgramSemesterData->ausbildungssemester) ? $degreeProgramSemesterData->ausbildungssemester : null;
|
||||
}
|
||||
|
||||
$mischen = true;
|
||||
} else {
|
||||
$filterForDegreePrograms = true;
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
array_push($entitledDegreePrograms, 0);
|
||||
}
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size, $sprache, $filterForDegreePrograms, $entitledDegreePrograms, true);
|
||||
$news = $this->getDataOrTerminateWithError($news);
|
||||
|
||||
$this->addMeta('phrases', json_decode($this->p->getJson()));
|
||||
$this->terminateWithSuccess($news);
|
||||
$this->addMeta('row_count', $news["row_count"] ?? 0);
|
||||
$this->terminateWithSuccess($news["content"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -20,8 +20,8 @@ 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
|
||||
* Provides data to the ajax get calls about favorite treemenu entries
|
||||
* Listens to ajax post calls to change the favorite treemenu entries
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Favorites extends FHCAPI_Controller
|
||||
@@ -29,7 +29,7 @@ class Favorites extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'get' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
@@ -37,19 +37,19 @@ class Favorites extends FHCAPI_Controller
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
public function get($app)
|
||||
{
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['stv_favorites']);
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), [$app . '_favorites']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithSuccess(null);
|
||||
else
|
||||
$this->terminateWithSuccess($data['stv_favorites'] ?? null);
|
||||
$this->terminateWithSuccess($data[$app . '_favorites'] ?? null);
|
||||
}
|
||||
|
||||
public function set()
|
||||
public function set($app)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -60,7 +60,7 @@ class Favorites extends FHCAPI_Controller
|
||||
|
||||
$favorites = $this->input->post('favorites');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), $app . '_favorites', $favorites);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -18,18 +18,9 @@
|
||||
|
||||
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
|
||||
*/
|
||||
@@ -40,38 +31,56 @@ class Lehre extends FHCAPI_Controller
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
'semesterAverageGrade' => self::PERM_LOGGED,
|
||||
'getZugewieseneLv' => self::PERM_LOGGED,
|
||||
'getLeForLv' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
|
||||
$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()
|
||||
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);
|
||||
}
|
||||
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
|
||||
// return early if the required parameter is missing
|
||||
if(!isset($lehreinheit_id))
|
||||
{
|
||||
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
$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);
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
}
|
||||
|
||||
public function LV($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
@@ -81,13 +90,13 @@ class Lehre extends FHCAPI_Controller
|
||||
$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
|
||||
* 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
|
||||
*/
|
||||
@@ -145,5 +154,46 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess(['average_grade' => $averageGrade, 'weighted_average_grade' => $weightedAverageGrade]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all assigned lehrveranstaltungen of a mitarbeiter for a given semester
|
||||
* @param mixed $uid
|
||||
* @param mixed $sem_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
public function getZugewieseneLv() {
|
||||
$uid = $this->input->get("uid",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
// TODO: error messages
|
||||
|
||||
if(!isset($sem_kurzbz) || isEmptyString($sem_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if (!isset($uid) || isEmptyString($uid))
|
||||
$uid = getAuthUID();
|
||||
|
||||
// querying other ma_uids data requires admin permission
|
||||
if($uid !== getAuthUID()) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), 'general');
|
||||
}
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLvForLektorInSemester($sem_kurzbz, $uid);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLeForLv() {
|
||||
$lv_id = $this->input->get("lv_id",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
// $this->terminateWithSuccess($this->LehreinheitModel->getLesForLv($lv_id, $sem_kurzbz));
|
||||
$this->terminateWithSuccess($this->LehreinheitModel->getAllLehreinheitenForLvaAndMaUid($lv_id, getAuthUID(), $sem_kurzbz));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz);
|
||||
$studiengang_kz = $this->getStudiengangKz($stg_kz);
|
||||
|
||||
$lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $studiengang_kz);
|
||||
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
|
||||
$tree = [];
|
||||
@@ -75,15 +77,17 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
public function getByStg($studiensemester_kurzbz = null, $studiengang_kz = null, $semester = null)
|
||||
public function getByStg($studiensemester_kurzbz = null, $stg_kz = null, $semester = null)
|
||||
{
|
||||
if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
|
||||
$studiengang_kz = $this->getStudiengangKz($stg_kz);
|
||||
|
||||
if (is_null($studiengang_kz) || !preg_match("/^(-?[1-9][0-9]*|0)$/", (string)$studiengang_kz))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$verband = null;
|
||||
if (!is_null($semester) && !is_numeric($semester))
|
||||
{
|
||||
$verband = $semester;
|
||||
$verband = $this->getOrgformKurzbz($semester);
|
||||
$semester = null;
|
||||
}
|
||||
|
||||
@@ -260,18 +264,53 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
protected function getStudiengangKz($studiengang_typ_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'LOWER(CONCAT(typ, kurzbz)) =' => strtolower($studiengang_typ_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return null;
|
||||
|
||||
return current($data)->studiengang_kz;
|
||||
}
|
||||
|
||||
private function getStudiensemesterKurzbz($studiensemester_kurzbz = null)
|
||||
{
|
||||
if (!is_null($studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester_result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere([
|
||||
'LOWER(studiensemester_kurzbz)' => strtolower($studiensemester_kurzbz)
|
||||
]);
|
||||
|
||||
if (isError($studiensemester_result) || !hasData($studiensemester_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
$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);
|
||||
}
|
||||
|
||||
protected function getOrgformKurzbz($orgform_kurzbz)
|
||||
{
|
||||
if ($orgform_kurzbz === null)
|
||||
return null;
|
||||
|
||||
$this->load->model('codex/Orgform_model', 'OrgformModel');
|
||||
$result = $this->OrgformModel->loadWhere([
|
||||
'LOWER(orgform_kurzbz) =' => strtolower($orgform_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return $orgform_kurzbz;
|
||||
|
||||
return current($data)->orgform_kurzbz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getLvMenu' => self::PERM_LOGGED
|
||||
'getLvMenu' => self::PERM_LOGGED,
|
||||
'getMultipleLvMenu' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model("ressource/Mitarbeiter_model");
|
||||
@@ -61,24 +62,23 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
/**
|
||||
* alternative function to get multiple lvMenus with a single http request
|
||||
* not yet working as intended as the menu_lv.inc.php scripts called by the
|
||||
* lvMenuBuild event have logic coupled to require_once import which results in
|
||||
* a wrong logic after the first invocation -> faulty results for lvinfo, moodle
|
||||
* and several others
|
||||
*/
|
||||
public function getMultipleLvMenu($lvMenuOptionList){
|
||||
public function getMultipleLvMenu(){
|
||||
$lvMenuOptionList = $this->input->post('lvMenuOptionList', true);
|
||||
$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
|
||||
}
|
||||
$lvMenu = $this->getLvMenuInternal($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
|
||||
|
||||
$result[$lvMenuOptions['lvid']]=$lvMenu;
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
|
||||
private function getLvMenuInternal($lvid, $studiensemester_kurzbz) {
|
||||
|
||||
// return early if parameters are missing
|
||||
if(!isset($lvid) || !isset($studiensemester_kurzbz))
|
||||
@@ -89,14 +89,14 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// get the user
|
||||
if (!$user=getAuthUID())
|
||||
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
|
||||
$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);
|
||||
$is_lector = getData($mares);
|
||||
}
|
||||
|
||||
// definition of user_is_allowed_to_upload
|
||||
@@ -105,7 +105,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// load lehrveranstaltung
|
||||
$lvres = $this->Lehrveranstaltung_model->load($lvid);
|
||||
if(!hasData($lvres))
|
||||
if(!hasData($lvres))
|
||||
{
|
||||
$this->terminateWithError('LV ' . $lvid . ' not found.');
|
||||
}
|
||||
@@ -124,7 +124,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
$stgres = $this->Studiengang_model->load(strval($studiengang_kz));
|
||||
if(!hasData($stgres))
|
||||
{
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
}
|
||||
$stg = (getData($stgres))[0];
|
||||
$kurzbz = strtoupper($stg->typ . $stg->kurzbz);
|
||||
@@ -139,7 +139,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
$angemeldet = false;
|
||||
|
||||
$lesres = $this->Lehreinheit_model->getLehreinheitenForStudentAndStudienSemester(
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
);
|
||||
|
||||
if(hasData($lesres) && count(getData($lesres)) > 0)
|
||||
@@ -148,7 +148,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// lehrfach
|
||||
$lehrfach_id='';
|
||||
|
||||
|
||||
if(defined('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN)
|
||||
{
|
||||
// Wenn der eingeloggte User zu einer der Lehreinheiten zugeteilt ist
|
||||
@@ -211,8 +211,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
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))
|
||||
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|
||||
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
|
||||
{
|
||||
$user_is_allowed_to_upload=true;
|
||||
}
|
||||
@@ -224,21 +224,21 @@ class LvMenu extends FHCAPI_Controller
|
||||
$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
|
||||
// ##########################################################################################
|
||||
@@ -272,18 +272,18 @@ class LvMenu extends FHCAPI_Controller
|
||||
'permissionLib' => &$this->PermissionLib,
|
||||
'phrasesLib' => &$this->PhrasesLib
|
||||
];
|
||||
|
||||
Events::trigger('lvMenuBuild',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
|
||||
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
|
||||
@@ -291,7 +291,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
unset($menu[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// fills pos array to sort the menu
|
||||
$pos[$key] = $row['position'];
|
||||
|
||||
@@ -299,11 +299,18 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);
|
||||
|
||||
// HTTP response
|
||||
// ##########################################################################################
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
$menu = $this->getLvMenuInternal($lvid, $studiensemester_kurzbz);
|
||||
|
||||
$this->terminateWithSuccess($menu);
|
||||
|
||||
}
|
||||
|
||||
private function fhc_menu_lvinfo(&$menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr){
|
||||
@@ -372,7 +379,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
'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'=> site_url('Cis/Benotungstool/'.urlencode($lvid).'/'.urlencode($angezeigtes_stsem))
|
||||
//'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))
|
||||
);
|
||||
}
|
||||
@@ -541,4 +549,4 @@ class LvMenu extends FHCAPI_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ class LvPlan extends FHCAPI_Controller
|
||||
'getLehrverband' => self::PERM_LOGGED,
|
||||
'permissionOtherLvPlan' => self::PERM_LOGGED,
|
||||
'compactibleEventTypes' => self::PERM_LOGGED,
|
||||
'getLeEvents' => self::PERM_LOGGED,
|
||||
'getLvEvents' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
@@ -60,7 +62,13 @@ class LvPlan extends FHCAPI_Controller
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('PhrasesLib');
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -106,6 +114,7 @@ class LvPlan extends FHCAPI_Controller
|
||||
|
||||
// fetching lvplan events
|
||||
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date, $uid);
|
||||
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// fetching moodle events
|
||||
@@ -196,6 +205,38 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
public function getLeEvents($le_id = null, $start_date = null, $end_date = null, $stundenplan = 'stundenplandev')
|
||||
{
|
||||
|
||||
if (is_null($le_id) || is_null($start_date) || is_null($end_date))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($stundenplan !== 'stundenplandev' && $stundenplan !== 'stundenplan')
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getEventsByLE($le_id, $start_date, $end_date, $stundenplan);
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($lvplanEvents);
|
||||
}
|
||||
|
||||
public function getLvEvents($lv_id = null, $start_date = null, $end_date = null, $stundenplan = 'stundenplandev')
|
||||
{
|
||||
if (is_null($lv_id) || is_null($start_date) || is_null($end_date))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($stundenplan !== 'stundenplandev' && $stundenplan !== 'stundenplan')
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getEventsByLV($lv_id, $start_date, $end_date, $stundenplan);
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
//TODO: delete this function if we don't use the old calendar export endpoints anymore
|
||||
public function studiensemesterDateInterval($date)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class MaZeitsperren extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAllActiveZeitsperren' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenFixeMa' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenLector' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenOes' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getZeitsperrenAss' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getStgLectors' => self::PERM_LOGGED,
|
||||
'loadZeitsperrenLectorStg' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'loadZeitsperrenMa' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getDetailsMa' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person',
|
||||
'zeitsperren'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
}
|
||||
|
||||
//only user with zeitsperren
|
||||
public function getAllActiveZeitsperren($days)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
//TODO: check query: more results after join with hr-table
|
||||
//all fixe Ma
|
||||
public function getAllZeitsperrenFixeMa($days)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, true, false, null, false);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAllZeitsperrenLector($days)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, null, false);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getZeitsperrenAss($days)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, null, true);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAllZeitsperrenOes($days, $oe)
|
||||
{
|
||||
if(!$oe)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'OE Kurzbezeichnung']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, $oe, false);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadZeitsperrenLectorStg($days, $stg)
|
||||
{
|
||||
if(!$stg)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(!is_numeric($stg))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_paramNoNumber', ['param'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, false, false, $stg);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStgLectors()
|
||||
{
|
||||
$sql = "
|
||||
select
|
||||
studiengang_kz,
|
||||
kurzbz,
|
||||
kurzbzlang,
|
||||
typ,
|
||||
bezeichnung,
|
||||
kurzbzlang || ' (' || bezeichnung || ')' AS label,
|
||||
aktiv
|
||||
from
|
||||
public.tbl_studiengang
|
||||
where
|
||||
typ in ('b','m')
|
||||
order by typ asc, kurzbz Asc
|
||||
";
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->execReadOnlyQuery($sql);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadZeitsperrenMa($days, $uid)
|
||||
{
|
||||
if ($uid === null || $uid === '')
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Mitarbeiter UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days, $uid);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getDetailsMa($uid)
|
||||
{
|
||||
if ($uid === null || $uid === '')
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Mitarbeiter UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$result = $this->PersonModel->getFullName($uid);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,948 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class NewsAdministrationAPI extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* News API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getNews' => 'basis/news:r',
|
||||
'getNewsItem' => 'basis/news:r',
|
||||
'storeNewsItem' => 'basis/news:w',
|
||||
'updateNewsItem' => 'basis/news:w',
|
||||
'deleteNewsItem' => 'basis/news:w'
|
||||
]);
|
||||
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->model('content/Contentsprache_model', 'ContentspracheModel');
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
|
||||
$this->load->library('CmsLib');
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $titel = '', $active = true, $sichtbar = true)
|
||||
{
|
||||
$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());
|
||||
|
||||
$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;
|
||||
|
||||
$passedSichtbar = $this->input->get('published', true);
|
||||
if($passedSichtbar !== null)
|
||||
{
|
||||
$sichtbar = $passedSichtbar;
|
||||
}
|
||||
|
||||
$passedIsActive = $this->input->get('isActive', true);
|
||||
if ($passedIsActive !== null)
|
||||
{
|
||||
$isActive = filter_var(
|
||||
$passedIsActive,
|
||||
FILTER_VALIDATE_BOOLEAN,
|
||||
FILTER_NULL_ON_FAILURE
|
||||
);
|
||||
if ($isActive !== null)
|
||||
{
|
||||
$active = $isActive;
|
||||
}
|
||||
}
|
||||
|
||||
$degreeProgramShortCode = $this->input->get('degreeProgramShortCode', true);
|
||||
if ($degreeProgramShortCode !== null && $degreeProgramShortCode !== '')
|
||||
{
|
||||
if (!ctype_digit((string)$degreeProgramShortCode))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'degreeProgramShortCode' => 'A valid degree program is required'
|
||||
]);
|
||||
}
|
||||
$studiengang_kz = $degreeProgramShortCode;
|
||||
}
|
||||
|
||||
$passedSemester = $this->input->get('semester', true);
|
||||
if ($passedSemester !== null && $passedSemester !== '')
|
||||
{
|
||||
if (
|
||||
!ctype_digit((string)$passedSemester)
|
||||
|| (int)$passedSemester < 1
|
||||
|| (int)$passedSemester > 8
|
||||
)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'semester' => 'A valid semester is required'
|
||||
]);
|
||||
}
|
||||
$semester = filter_var($passedSemester, FILTER_VALIDATE_INT);
|
||||
}
|
||||
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, false, $titel, true, $sichtbar, $page, $page_size, $sprache, true, $entitledDegreePrograms, $active);
|
||||
$news = $this->getDataOrTerminateWithError($news);
|
||||
|
||||
$this->addMeta('row_count', $news["row_count"] ?? 0);
|
||||
$this->terminateWithSuccess($news["content"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one news entry with all available language versions for editing.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getNewsItem($newsId)
|
||||
{
|
||||
if (!is_numeric($newsId) || (int)$newsId < 1)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'A valid news ID is required'
|
||||
]);
|
||||
}
|
||||
|
||||
$newsId = (int)$newsId;
|
||||
$newsResult = $this->NewsModel->load($newsId);
|
||||
|
||||
if (isError($newsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($newsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($newsResult))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'The requested news entry does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$news = current(getData($newsResult));
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
|
||||
if (!in_array($news->studiengang_kz, $entitledDegreePrograms)) {
|
||||
$this->terminateWithError('You are not entitled to access this news entry', self::ERROR_TYPE_PERMISSION);
|
||||
}
|
||||
$translationsResult = $this->ContentspracheModel->loadWhere([
|
||||
'content_id' => $news->content_id
|
||||
]);
|
||||
|
||||
if (isError($translationsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($translationsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$languages = [];
|
||||
|
||||
foreach ((array)getData($translationsResult) as $translation)
|
||||
{
|
||||
$languages[$translation->sprache] = true;
|
||||
}
|
||||
|
||||
$translations = [];
|
||||
|
||||
foreach (array_keys($languages) as $language)
|
||||
{
|
||||
$contentResult = $this->ContentModel->getContent(
|
||||
$news->content_id,
|
||||
$language,
|
||||
null,
|
||||
null,
|
||||
false
|
||||
);
|
||||
|
||||
if (isError($contentResult))
|
||||
{
|
||||
$this->terminateWithError(getError($contentResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$content = getData($contentResult);
|
||||
$document = new DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
if ($content->content !== '' && $document->loadXML($content->content) === false)
|
||||
{
|
||||
$this->terminateWithError(
|
||||
'The stored news content is invalid',
|
||||
self::ERROR_TYPE_GENERAL
|
||||
);
|
||||
}
|
||||
|
||||
$author = $document->getElementsByTagName('verfasser')->item(0);
|
||||
$title = $document->getElementsByTagName('betreff')->item(0);
|
||||
$text = $document->getElementsByTagName('text')->item(0);
|
||||
|
||||
$translations[] = [
|
||||
'language' => $language,
|
||||
'author' => $author ? $author->nodeValue : '',
|
||||
'title' => $title ? $title->nodeValue : '',
|
||||
'text' => $text ? str_replace('dms.php', APP_ROOT . 'cms/dms.php', $text->nodeValue) : '',
|
||||
'isPublished' => (bool)$content->sichtbar
|
||||
];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'newsId' => (int)$news->news_id,
|
||||
'visibleFrom' => $news->datum,
|
||||
'visibleTo' => $news->datum_bis,
|
||||
'degreeProgramShortCode' => $news->studiengang_kz,
|
||||
'semester' => $news->semester,
|
||||
'translations' => $translations
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a news entry and all supplied translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function storeNewsItem()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$postData = $this->input->post(null, true);
|
||||
$this->form_validation->set_data(is_array($postData) ? $postData : []);
|
||||
$this->form_validation->set_rules('visibleFrom', 'Visible from', 'required|is_valid_date');
|
||||
$this->form_validation->set_rules('visibleTo', 'Visible to', 'is_valid_date');
|
||||
$this->form_validation->set_rules(
|
||||
'degreeProgramShortCode',
|
||||
'Degree program',
|
||||
'required|is_natural'
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'semester',
|
||||
'Semester',
|
||||
'is_natural_no_zero|less_than_equal_to[8]'
|
||||
);
|
||||
|
||||
$errors = $this->form_validation->run() === false
|
||||
? $this->form_validation->error_array()
|
||||
: [];
|
||||
$visibleFrom = $this->input->post('visibleFrom', true);
|
||||
$visibleTo = $this->input->post('visibleTo', true);
|
||||
$translations = $this->input->post('translations', true);
|
||||
|
||||
if (
|
||||
is_string($visibleFrom)
|
||||
&& is_string($visibleTo)
|
||||
&& $visibleTo !== ''
|
||||
&& is_valid_date($visibleFrom)
|
||||
&& is_valid_date($visibleTo)
|
||||
&& new DateTime($visibleTo) < new DateTime($visibleFrom)
|
||||
)
|
||||
{
|
||||
$errors['visibleTo'] = 'Visible to must not be before Visible from';
|
||||
}
|
||||
|
||||
if (!is_array($translations) || count($translations) === 0)
|
||||
{
|
||||
$errors['translations'] = 'At least one translation is required';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
if (!is_array($translation))
|
||||
{
|
||||
$errors['translations.' . $index] = 'Each translation must be an object';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0)
|
||||
{
|
||||
$this->terminateWithValidationErrors($errors);
|
||||
}
|
||||
|
||||
|
||||
$this->_ensureUserIsEntitledForDegreeProgram($this->input->post('degreeProgramShortCode', true));
|
||||
|
||||
$degreeProgramShortCode = $this->input->post('degreeProgramShortCode', true);
|
||||
$semester = $this->input->post('semester', true);
|
||||
$semester = $semester === '' ? null : $semester;
|
||||
$visibleTo = $visibleTo === '' ? null : $visibleTo;
|
||||
|
||||
$studiengang = $this->_getStudiengang($degreeProgramShortCode);
|
||||
|
||||
$data = [
|
||||
'studiengang_kz' => $degreeProgramShortCode,
|
||||
'semester' => $semester,
|
||||
'datum' => $visibleFrom,
|
||||
'datum_bis' => $visibleTo,
|
||||
'translations' => []
|
||||
];
|
||||
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index] = [
|
||||
'sprache' => $translation['language'] ?? '',
|
||||
'verfasser' => $translation['author'] ?? '',
|
||||
'betreff' => $translation['title'] ?? '',
|
||||
'text' => $translation['text'] ?? '',
|
||||
'sichtbar' => isset($translation['isPublished']) ? (bool)$translation['isPublished'] : false
|
||||
];
|
||||
}
|
||||
|
||||
$this->_validateLanguages($data['translations']);
|
||||
|
||||
foreach ($data['translations'] as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index]['content'] = $this->_buildNewsXml($translation);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
if ($this->db->trans_begin() === false)
|
||||
{
|
||||
$this->terminateWithError($this->db->error(), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$contentResult = $this->ContentModel->insert([
|
||||
'template_kurzbz' => 'news',
|
||||
'oe_kurzbz' => $studiengang->oe_kurzbz,
|
||||
'aktiv' => true,
|
||||
'menu_open' => false,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
]);
|
||||
$contentId = (int)$this->_getInsertedIdOrRollback($contentResult);
|
||||
|
||||
$newsResult = $this->NewsModel->insert([
|
||||
'uid' => $uid,
|
||||
'studiengang_kz' => $data['studiengang_kz'],
|
||||
'semester' => $data['semester'],
|
||||
'datum' => $data['datum'],
|
||||
'datum_bis' => $data['datum_bis'],
|
||||
'content_id' => $contentId,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
$newsId = (int)$this->_getInsertedIdOrRollback($newsResult);
|
||||
|
||||
foreach ($data['translations'] as $translation)
|
||||
{
|
||||
$translation['content'] = $this->formatContentURLsToRelative($translation['content']);
|
||||
|
||||
$translationResult = $this->ContentspracheModel->insert([
|
||||
'sprache' => $translation['sprache'],
|
||||
'content_id' => $contentId,
|
||||
'version' => 1,
|
||||
'sichtbar' => $translation['sichtbar'],
|
||||
'content' => $translation['content'],
|
||||
'titel' => $translation['betreff'],
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
$this->_getInsertedIdOrRollback($translationResult);
|
||||
}
|
||||
|
||||
$newsItemResult = $this->NewsModel->load($newsId);
|
||||
$newsItem = $this->getDataOrTerminateWithError($newsItemResult);
|
||||
$newsItem = $newsItem[0];
|
||||
|
||||
$this->_sendNewsItemTranslationRequiredMail(
|
||||
$newsItem
|
||||
);
|
||||
|
||||
if ($this->db->trans_status() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_commit() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a news entry and its supplied translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateNewsItem($newsId)
|
||||
{
|
||||
if (!is_numeric($newsId) || (int)$newsId < 1)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'A valid news ID is required'
|
||||
]);
|
||||
}
|
||||
|
||||
$newsId = (int)$newsId;
|
||||
$existingNewsResult = $this->NewsModel->load($newsId);
|
||||
|
||||
if (isError($existingNewsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($existingNewsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($existingNewsResult))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'The requested news entry does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$existingNews = current(getData($existingNewsResult));
|
||||
|
||||
$this->_ensureUserIsEntitledForDegreeProgram($existingNews->studiengang_kz);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$postData = $this->input->post(null, true);
|
||||
$this->form_validation->set_data(is_array($postData) ? $postData : []);
|
||||
$this->form_validation->set_rules('visibleFrom', 'Visible from', 'required|is_valid_date');
|
||||
$this->form_validation->set_rules('visibleTo', 'Visible to', 'is_valid_date');
|
||||
$this->form_validation->set_rules(
|
||||
'degreeProgramShortCode',
|
||||
'Degree program',
|
||||
'required|is_natural'
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'semester',
|
||||
'Semester',
|
||||
'is_natural_no_zero|less_than_equal_to[8]'
|
||||
);
|
||||
|
||||
$errors = $this->form_validation->run() === false
|
||||
? $this->form_validation->error_array()
|
||||
: [];
|
||||
$visibleFrom = $this->input->post('visibleFrom', true);
|
||||
$visibleTo = $this->input->post('visibleTo', true);
|
||||
$translations = $this->input->post('translations', true);
|
||||
|
||||
if (
|
||||
is_string($visibleFrom)
|
||||
&& is_string($visibleTo)
|
||||
&& $visibleTo !== ''
|
||||
&& is_valid_date($visibleFrom)
|
||||
&& is_valid_date($visibleTo)
|
||||
&& new DateTime($visibleTo) < new DateTime($visibleFrom)
|
||||
)
|
||||
{
|
||||
$errors['visibleTo'] = 'Visible to must not be before Visible from';
|
||||
}
|
||||
|
||||
if (!is_array($translations) || count($translations) === 0)
|
||||
{
|
||||
$errors['translations'] = 'At least one translation is required';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
if (!is_array($translation))
|
||||
{
|
||||
$errors['translations.' . $index] = 'Each translation must be an object';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0)
|
||||
{
|
||||
$this->terminateWithValidationErrors($errors);
|
||||
}
|
||||
|
||||
$degreeProgramShortCode = $this->input->post('degreeProgramShortCode', true);
|
||||
$semester = $this->input->post('semester', true);
|
||||
$semester = $semester === '' ? null : $semester;
|
||||
$visibleTo = $visibleTo === '' ? null : $visibleTo;
|
||||
|
||||
$studiengang = $this->_getStudiengang($degreeProgramShortCode);
|
||||
|
||||
$data = [
|
||||
'studiengang_kz' => $degreeProgramShortCode,
|
||||
'semester' => $semester,
|
||||
'datum' => $visibleFrom,
|
||||
'datum_bis' => $visibleTo,
|
||||
'translations' => []
|
||||
];
|
||||
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index] = [
|
||||
'sprache' => $translation['language'] ?? '',
|
||||
'verfasser' => $translation['author'] ?? '',
|
||||
'betreff' => $translation['title'] ?? '',
|
||||
'text' => $translation['text'] ?? '',
|
||||
'sichtbar' => isset($translation['isPublished']) ? (bool)$translation['isPublished'] : false
|
||||
];
|
||||
}
|
||||
|
||||
$this->_validateLanguages($data['translations']);
|
||||
|
||||
foreach ($data['translations'] as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index]['content'] = $this->_buildNewsXml($translation);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
if ($this->db->trans_begin() === false)
|
||||
{
|
||||
$this->terminateWithError($this->db->error(), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$contentResult = $this->ContentModel->update($existingNews->content_id, [
|
||||
'oe_kurzbz' => $studiengang->oe_kurzbz,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
if (isError($contentResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($contentResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$newsResult = $this->NewsModel->update($newsId, [
|
||||
'studiengang_kz' => $data['studiengang_kz'],
|
||||
'semester' => $data['semester'],
|
||||
'datum' => $data['datum'],
|
||||
'datum_bis' => $data['datum_bis'],
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
if (isError($newsResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($newsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$existingTranslationsResult = $this->ContentspracheModel->loadWhere([
|
||||
'content_id' => $existingNews->content_id
|
||||
]);
|
||||
|
||||
if (isError($existingTranslationsResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($existingTranslationsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$existingTranslations = [];
|
||||
|
||||
foreach ((array)getData($existingTranslationsResult) as $existingTranslation)
|
||||
{
|
||||
$language = $existingTranslation->sprache;
|
||||
|
||||
if (
|
||||
!isset($existingTranslations[$language])
|
||||
|| (int)$existingTranslation->version > (int)$existingTranslations[$language]->version
|
||||
)
|
||||
{
|
||||
$existingTranslations[$language] = $existingTranslation;
|
||||
}
|
||||
}
|
||||
|
||||
$submittedLanguages = array_column($data['translations'], 'sprache');
|
||||
$this->db->where('content_id', $existingNews->content_id);
|
||||
$this->db->where_not_in('sprache', $submittedLanguages);
|
||||
|
||||
if ($this->db->delete('campus.tbl_contentsprache') === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
foreach ($data['translations'] as $translation)
|
||||
{
|
||||
$translation['content'] = $this->formatContentURLsToRelative($translation['content']);
|
||||
$translationData = [
|
||||
'sichtbar' => $translation['sichtbar'],
|
||||
'content' => $translation['content'],
|
||||
'titel' => $translation['betreff'],
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
];
|
||||
|
||||
$existingTranslation = $existingTranslations[$translation['sprache']] ?? null;
|
||||
|
||||
if ($existingTranslation)
|
||||
{
|
||||
$translationResult = $this->ContentspracheModel->update(
|
||||
$existingTranslation->contentsprache_id,
|
||||
$translationData
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$translationResult = $this->ContentspracheModel->insert([
|
||||
'sprache' => $translation['sprache'],
|
||||
'content_id' => $existingNews->content_id,
|
||||
'version' => 1,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
] + $translationData);
|
||||
}
|
||||
|
||||
$this->_getInsertedIdOrRollback($translationResult);
|
||||
}
|
||||
|
||||
if ($this->db->trans_status() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_commit() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes one news entry and its linked content.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteNewsItem($newsId)
|
||||
{
|
||||
if (!is_numeric($newsId) || (int)$newsId < 1)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'A valid news ID is required'
|
||||
]);
|
||||
}
|
||||
|
||||
$newsId = (int)$newsId;
|
||||
$newsResult = $this->NewsModel->load($newsId);
|
||||
|
||||
if (isError($newsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($newsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($newsResult))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'The requested news entry does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$news = current(getData($newsResult));
|
||||
|
||||
|
||||
$this->_ensureUserIsEntitledForDegreeProgram($news->studiengang_kz);
|
||||
|
||||
if ($this->db->trans_begin() === false)
|
||||
{
|
||||
$this->terminateWithError($this->db->error(), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$newsDeleteResult = $this->NewsModel->delete($newsId);
|
||||
|
||||
if (isError($newsDeleteResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($newsDeleteResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->db->where('content_id', $news->content_id);
|
||||
|
||||
if ($this->db->delete('campus.tbl_contentsprache') === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$contentDeleteResult = $this->ContentModel->delete($news->content_id);
|
||||
|
||||
if (isError($contentDeleteResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($contentDeleteResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_status() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_commit() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newsId);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Loads the requested Studiengang or reports a validation error.
|
||||
*
|
||||
* @param integer $studiengangKz
|
||||
* @return stdClass
|
||||
*/
|
||||
private function _getStudiengang($studiengangKz)
|
||||
{
|
||||
$result = $this->StudiengangModel->load($studiengangKz);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'studiengang_kz' => 'The requested Studiengang does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$studiengaenge = getData($result);
|
||||
|
||||
return current($studiengaenge);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that all supplied languages exist in tbl_sprache.
|
||||
*
|
||||
* @param array $translations
|
||||
* @return void
|
||||
*/
|
||||
private function _validateLanguages($translations)
|
||||
{
|
||||
$languages = [];
|
||||
|
||||
foreach ($translations as $translation)
|
||||
{
|
||||
$languages[] = $translation['sprache'];
|
||||
}
|
||||
|
||||
$result = $this->SpracheModel->loadMultiple($languages);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$existingLanguages = [];
|
||||
|
||||
foreach ((array)getData($result) as $language)
|
||||
{
|
||||
$existingLanguages[$language->sprache] = true;
|
||||
}
|
||||
|
||||
$errors = [];
|
||||
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
if (!isset($existingLanguages[$translation['sprache']]))
|
||||
{
|
||||
$errors['translations.' . $index . '.sprache'] = 'The requested language does not exist';
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0)
|
||||
{
|
||||
$this->terminateWithValidationErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
private function _ensureUserIsEntitledForDegreeProgram($degreeProgramShortCode)
|
||||
{
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news:w");
|
||||
if (!is_array($entitledDegreePrograms))
|
||||
{
|
||||
$this->terminateWithError('Failed to retrieve entitled degree programs for the user', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!in_array($degreeProgramShortCode, $entitledDegreePrograms)) {
|
||||
$this->terminateWithError("User is not entitled for the specified degree program");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns an inserted identifier or rolls the transaction back on error.
|
||||
*
|
||||
* @param stdClass $result
|
||||
* @return mixed
|
||||
*/
|
||||
private function _getInsertedIdOrRollback($result)
|
||||
{
|
||||
if (isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
return getData($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the XML format consumed by existing news readers.
|
||||
*
|
||||
* @param array $translation
|
||||
* @return string
|
||||
*/
|
||||
private function _buildNewsXml($translation)
|
||||
{
|
||||
$document = new DOMDocument('1.0', 'UTF-8');
|
||||
$news = $document->createElement('news');
|
||||
$document->appendChild($news);
|
||||
|
||||
$this->_appendCdataElement($document, $news, 'verfasser', $translation['verfasser']);
|
||||
$this->_appendCdataElement($document, $news, 'betreff', $translation['betreff']);
|
||||
$this->_appendCdataElement($document, $news, 'text', $translation['text']);
|
||||
|
||||
return $document->saveXML($news);
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a CDATA element and safely preserves CDATA terminators.
|
||||
*
|
||||
* @param DOMDocument $document
|
||||
* @param DOMElement $parent
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
private function _appendCdataElement($document, $parent, $name, $value)
|
||||
{
|
||||
$element = $document->createElement($name);
|
||||
$parts = explode(']]>', $value);
|
||||
$lastIndex = count($parts) - 1;
|
||||
|
||||
foreach ($parts as $index => $part)
|
||||
{
|
||||
if ($index > 0)
|
||||
{
|
||||
$part = '>' . $part;
|
||||
}
|
||||
|
||||
if ($index < $lastIndex)
|
||||
{
|
||||
$part .= ']]';
|
||||
}
|
||||
|
||||
$element->appendChild($document->createCDATASection($part));
|
||||
}
|
||||
|
||||
$parent->appendChild($element);
|
||||
}
|
||||
|
||||
private function _sendNewsItemTranslationRequiredMail($newsItem)
|
||||
{
|
||||
$translatorsResult = $this->BenutzerfunktionModel->getBenutzerFunktionen("translate", $newsItem->studiengang_kz);
|
||||
$translators = $this->getDataOrTerminateWithError($translatorsResult);
|
||||
|
||||
$newsItemContentResult = $this->ContentspracheModel->loadWhere([
|
||||
'content_id' => $newsItem->content_id,
|
||||
'sprache' => 'German'
|
||||
]);
|
||||
$newsItemContentEntry = getData($newsItemContentResult)[0] ?? null;
|
||||
if ($newsItemContentEntry) {
|
||||
$newsItem->sichtbar = $newsItemContentEntry->sichtbar ?? false;
|
||||
$newsItem->content = $newsItemContentEntry->content;
|
||||
}
|
||||
$content = getData(
|
||||
$this->cmslib->createNewsContent(
|
||||
$this->cmslib->createNewsWrapper($newsItem, true),
|
||||
false,
|
||||
""
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($translators as $translator) {
|
||||
sendSanchoMail(
|
||||
"Sancho_Mail_News_Translation_Req",
|
||||
[
|
||||
"newsItemUrl" => APP_ROOT . "cis.php/CisVue/Cms/newsAdministration?newsId=" . $newsItem->news_id,
|
||||
"newsItemAuthor" => $newsItem->verfasser,
|
||||
"newsItemSubject" => $newsItem->betreff,
|
||||
"newsItemContent" => $content
|
||||
],
|
||||
$translator->uid . "@" . DOMAIN,
|
||||
"Übersetzung erforderlich / Translation required"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function formatContentURLsToRelative($content)
|
||||
{
|
||||
$content = preg_replace(
|
||||
'#https?://[^"\'>\s]*/(dms\.php(?:\?[^"\'>\s]*)?)#i',
|
||||
'$1',
|
||||
$content
|
||||
);
|
||||
|
||||
$content = preg_replace(
|
||||
'#(?:\.\./)+[^"\'>\s]*/(dms\.php(?:\?[^"\'>\s]*)?)#i',
|
||||
'$1',
|
||||
$content
|
||||
);
|
||||
|
||||
$content = preg_replace(
|
||||
'#/[^"\'>\s]*/(dms\.php(?:\?[^"\'>\s]*)?)#i',
|
||||
'$1',
|
||||
$content
|
||||
);
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,7 +36,8 @@ class Ort extends FHCAPI_Controller
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'getRooms' => self::PERM_LOGGED,
|
||||
'getTypes' => self::PERM_LOGGED
|
||||
'getTypes' => self::PERM_LOGGED,
|
||||
'getRoomInfo' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
@@ -74,6 +75,8 @@ class Ort extends FHCAPI_Controller
|
||||
$vonStunde = getData($this->StundeModel->getStundeForTime($von))[0]->stunde;
|
||||
$bisStunde = getData($this->StundeModel->getStundeForTime($bis))[0]->stunde;
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
|
||||
$params = array();
|
||||
$qry = "SELECT DISTINCT tbl_ort.*
|
||||
FROM public.tbl_ort JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
|
||||
@@ -174,5 +177,16 @@ class Ort extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($content);
|
||||
}
|
||||
|
||||
public function getRoomInfo()
|
||||
{
|
||||
$ortKurzbz = $this->input->get("ortKurzbz");
|
||||
|
||||
$roomResult = $this->OrtModel->getRoomInfo($ortKurzbz);
|
||||
$roomData = $this->getDataOrTerminateWithError($roomResult);
|
||||
$room = count($roomData) ? $roomData[0] : null;
|
||||
|
||||
$this->terminateWithSuccess($room);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -17,60 +17,61 @@
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class OtherLvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'otherLvPlanViewData' => ['basis/other_lv_plan:r'],
|
||||
]);
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'otherLvPlanViewData' => ['basis/other_lv_plan:r'],
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->library('ProfilLib');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves viewData for other lv plan view
|
||||
* @access public
|
||||
* @param $uid the userID for which the other lv plan is being viewed
|
||||
*/
|
||||
public function otherLvPlanViewData($uid)
|
||||
{
|
||||
$isMitarbeiterResult = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
$isMitarbeiter = getData($isMitarbeiterResult);
|
||||
$isStudent = !$isMitarbeiter;
|
||||
/**
|
||||
* retrieves viewData for other lv plan view
|
||||
* @access public
|
||||
* @param $uid the userID for which the other lv plan is being viewed
|
||||
*/
|
||||
public function otherLvPlanViewData($uid)
|
||||
{
|
||||
$isMitarbeiterResult = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
$isMitarbeiter = getData($isMitarbeiterResult);
|
||||
$isStudent = !$isMitarbeiter;
|
||||
|
||||
$this->BenutzerModel->addSelect(["foto", "vorname", "nachname"]);
|
||||
$this->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
$personResult = $this->BenutzerModel->load([$uid]);
|
||||
$person = hasData($personResult) ? getData($personResult) : null;
|
||||
$resProfileData = $this->profillib->getView($uid);
|
||||
$profileData = hasData($resProfileData) ? getData($resProfileData) : null;
|
||||
|
||||
$viewData = [
|
||||
"user_data" => [
|
||||
"username" => $uid,
|
||||
"is_student" => $isStudent,
|
||||
"is_mitarbeiter" => $isMitarbeiter,
|
||||
"foto" => $person[0]->foto,
|
||||
"vorname" => $person[0]->vorname,
|
||||
"nachname" => $person[0]->nachname,
|
||||
],
|
||||
];
|
||||
$viewData = [
|
||||
"user_data" => [
|
||||
"username" => $uid,
|
||||
"is_student" => $isStudent,
|
||||
"is_mitarbeiter" => $isMitarbeiter,
|
||||
"foto" => $profileData->data->foto,
|
||||
"vorname" => $profileData->data->vorname,
|
||||
"nachname" => $profileData->data->nachname,
|
||||
"titel" => $profileData->data->titel,
|
||||
"postnomen" => $profileData->data->postnomen,
|
||||
],
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Permission extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getPermissions' => self::PERM_LOGGED,
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves permissions for auth user
|
||||
* @access public
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
$permissionsParam = $this->input->post("permissions");
|
||||
if (!$permissionsParam || !is_array($permissionsParam)) {
|
||||
$this->terminateWithError("Invalid parameter!");
|
||||
}
|
||||
|
||||
$permissions = [];
|
||||
foreach ($permissionsParam as $permission) {
|
||||
$permissions[$permission] = $this->permissionlib->isBerechtigt($permission);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($permissions);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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 Reservierung extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getMyReservation' => 'basis/cis:r',
|
||||
'deleteReservation' => 'lehre/reservierung:rw'
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all reservations from lehre.vw_reservation of the logged in user
|
||||
*/
|
||||
public function getMyReservation()
|
||||
{
|
||||
$result = $this->ReservierungModel->getMyReservation();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes a reservation by ID
|
||||
*/
|
||||
public function deleteReservation()
|
||||
{
|
||||
$reservierung_id = $this->input->post('reservierung_id');
|
||||
|
||||
|
||||
if ($reservierung_id === NULL || trim((string)$reservierung_id) === '') {
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
|
||||
$result = $this->ReservierungModel->deleteReservation($reservierung_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class Studgang extends FHCAPI_Controller
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiengangInfo'=> self::PERM_LOGGED,
|
||||
|
||||
'getDegreePrograms'=> self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
@@ -43,15 +43,46 @@ class Studgang extends FHCAPI_Controller
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getStudiengangInfo(){
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
$isMitarbeiter = $this->getDataOrTerminateWithError($isMitarbeiter);
|
||||
if($isMitarbeiter) {
|
||||
$this->terminateWithSuccess(null);
|
||||
public function getDegreePrograms() {
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
if (!$entitledDegreePrograms) {
|
||||
$this->terminateWithError("User is not entitled for any degree program");
|
||||
}
|
||||
|
||||
|
||||
$activeDegreePrograms = $this->StudiengangModel->getDegreePrograms();
|
||||
$activeDegreePrograms= $this->getDataOrTerminateWithError($activeDegreePrograms);
|
||||
|
||||
$activeDegreePrograms = array_values(array_filter($activeDegreePrograms, function($degreeProgram) use ($entitledDegreePrograms) {
|
||||
return in_array($degreeProgram->studiengang_kz, $entitledDegreePrograms);
|
||||
}));
|
||||
|
||||
$this->terminateWithSuccess($activeDegreePrograms);
|
||||
}
|
||||
|
||||
public function getStudiengangInfo(){
|
||||
$studiengang_kz = $this->input->get('studiengang_kz', true);
|
||||
$semester = $this->input->get('semester', true);
|
||||
|
||||
// without a Studiengang the info of the logged in Student is returned
|
||||
if (!is_numeric($studiengang_kz))
|
||||
{
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
$isMitarbeiter = $this->getDataOrTerminateWithError($isMitarbeiter);
|
||||
if($isMitarbeiter) {
|
||||
$this->terminateWithSuccess(null);
|
||||
}
|
||||
|
||||
$studiengang_kz = null;
|
||||
$semester = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengang_kz = (int)$studiengang_kz;
|
||||
$semester = is_numeric($semester) ? (int)$semester : null;
|
||||
}
|
||||
|
||||
// fetches the Studiengang Information which is used next to the news
|
||||
$studiengangInfo = $this->StudiengangModel->getStudiengangInfoForNews();
|
||||
$studiengangInfo = $this->StudiengangModel->getStudiengangInfoForNews($studiengang_kz, $semester);
|
||||
$studiengangInfo= $this->getDataOrTerminateWithError($studiengangInfo);
|
||||
$this->terminateWithSuccess($studiengangInfo);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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 Studiensemester extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiensemester'=> self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* returns List of all studiensemester as well as current one
|
||||
*/
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->_ci->StudiensemesterModel->addOrder("start", "DESC");
|
||||
$result = $this->_ci->StudiensemesterModel->load();
|
||||
|
||||
$studiensemester = getData($result);
|
||||
$result = $this->_ci->StudiensemesterModel->getAkt();
|
||||
$aktuell = getData($result);
|
||||
|
||||
$this->terminateWithSuccess(array($studiensemester, $aktuell));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -167,7 +167,9 @@ class Studium extends FHCAPI_Controller
|
||||
if($aktuelles_studienplan){
|
||||
$lehrveranstaltungen = $this->computeStudienplanLehrveranstaltungen($aktuelles_studienplan->studienplan_id, $aktuelles_semester);
|
||||
foreach($lehrveranstaltungen as $lehrv){
|
||||
foreach($lehrv->lehrveranstaltungen as $lv){
|
||||
// a lehrveranstaltung without a modul has no children and gets its lektoren directly
|
||||
$lvs = isset($lehrv->lehrveranstaltungen) ? $lehrv->lehrveranstaltungen : [$lehrv];
|
||||
foreach($lvs as $lv){
|
||||
$lvLektoren =$this->computeLektorenFromLehrveranstaltung($lv->lehrveranstaltung_id,$aktuelles_semester, $aktuelles_studiengang->studiengang_kz, $aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
$lv->lektoren = $lvLektoren;
|
||||
}
|
||||
@@ -286,6 +288,7 @@ SELECT tbl_lehrveranstaltung.*,
|
||||
$lehrveranstaltungen = $this->LehrveranstaltungModel->execReadOnlyQuery($query,[$studienplan_id, $semester]);
|
||||
|
||||
$lehrveranstaltungen = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
|
||||
usort($lehrveranstaltungen, function($a, $b){
|
||||
if($a->lehrtyp_kurzbz == "modul"){
|
||||
return -1;
|
||||
@@ -302,12 +305,17 @@ SELECT tbl_lehrveranstaltung.*,
|
||||
}
|
||||
else{
|
||||
$parent =array_filter($carry, function($item)use($lehrv){
|
||||
return $item->studienplan_lehrveranstaltung_id == $lehrv->studienplan_lehrveranstaltung_id_parent;
|
||||
return isset($item->lehrveranstaltungen)
|
||||
&& $item->studienplan_lehrveranstaltung_id == $lehrv->studienplan_lehrveranstaltung_id_parent;
|
||||
});
|
||||
$parent = current($parent);
|
||||
if($parent){
|
||||
$parent->lehrveranstaltungen[] = $lehrv;
|
||||
}
|
||||
else{
|
||||
// lehrveranstaltung without a modul: keep it on the top level
|
||||
array_push($carry, $lehrv);
|
||||
}
|
||||
}
|
||||
return $carry;
|
||||
}, []);
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class StudstatusAntraege extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTodos' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
//load models
|
||||
$this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* gets all todos of antraegen of the user with stg leitungsfunction
|
||||
* or list of open antraege for user with assistance function
|
||||
* @access public
|
||||
* @return array || []
|
||||
*/
|
||||
public function getTodos()
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
|
||||
//at first get studiengang with leitungsfunktion
|
||||
$result = $this->BenutzerfunktionModel->getSTGLByUID($uid);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$funktionen = getData($result);
|
||||
|
||||
$studiengaenge = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$studiengaenge[] = $funktion->studiengang_kz;
|
||||
}
|
||||
|
||||
$dataAntrage = [];
|
||||
|
||||
$result = $this->StudierendenantragModel->getOpenAntraegeForStgl($studiengaenge);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$dataAntrage[] = getData($result) ?: [];
|
||||
$statusRole = 1;
|
||||
|
||||
$this->terminateWithSuccess([count($dataAntrage) > 0 ? $dataAntrage[0] : $dataAntrage, $statusRole]);
|
||||
|
||||
}
|
||||
|
||||
//TODO delete after check if needed or not
|
||||
//get studiengaenge of assistance (regarding benutzerfunktion)
|
||||
//$result = $this->BenutzerfunktionModel->getSTGAssByUID($uid);
|
||||
/* if(hasData($result)) {
|
||||
$statusRole = 2;
|
||||
$funktionen = getData($result);
|
||||
|
||||
$studiengaenge = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$studiengaenge[] = $funktion->studiengang_kz;
|
||||
}
|
||||
|
||||
$ci->addMeta('stgAss', $studiengaenge);
|
||||
$dataAntrage = [];
|
||||
|
||||
foreach ($studiengaenge as $studiengang)
|
||||
{
|
||||
$result = $this->StudierendenantragModel->getOpenAntraegeForAss($studiengang);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(hasData($result)) {
|
||||
$dataAntrage[] = getData($result);
|
||||
$statusRole = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$statusRole = 0;
|
||||
$dataAntrage = [];
|
||||
//$this->terminateWithSuccess([[], $statusRole]);
|
||||
}*/
|
||||
|
||||
//get studiengaenge of assistance (regarding rights)
|
||||
$stgAss = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
|
||||
if(!is_array($stgAss))
|
||||
{
|
||||
$statusRole = 0;
|
||||
$this->terminateWithSuccess([[], $statusRole]);
|
||||
}
|
||||
else {
|
||||
$statusRole = 2;
|
||||
$studiengaenge = [];
|
||||
|
||||
foreach ($stgAss as $stg) {
|
||||
$studiengaenge[] = (int) $stg;
|
||||
}
|
||||
|
||||
$dataAntrage = [];
|
||||
$result = $this->StudierendenantragModel->getOpenAntraegeForAss($studiengaenge);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(hasData($result)) {
|
||||
$dataAntrage[] = getData($result);
|
||||
$statusRole = 2;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([count($dataAntrage) > 0 ? $dataAntrage[0] : $dataAntrage, $statusRole]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the PhrasesLib (back-end)
|
||||
* Provides data to the ajax get calls about the Phrasen plugin
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class TabulatorPresets extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTabulatorPresets' => self::PERM_LOGGED,
|
||||
'createTabulatorPreset' => self::PERM_LOGGED,
|
||||
'updateTabulatorPreset' => self::PERM_LOGGED,
|
||||
'deleteTabulatorPreset' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('tabulator/Tabulator_preset_model', 'TabulatorPresetModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'tabulator_presets'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getTabulatorPresets()
|
||||
{
|
||||
$tableName = $this->input->get("tableName");
|
||||
if (!$tableName) {
|
||||
$this->terminateWithError(error($this->p->t("tabulator_presets", "invalid_params_err_msg")));
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$presets = $this->TabulatorPresetModel->getTabulatorPresetsByUserAndTable($uid, $tableName);
|
||||
$presetsData = $this->getDataOrTerminateWithError($presets) ?? [];
|
||||
|
||||
$this->terminateWithSuccess($presetsData);
|
||||
}
|
||||
|
||||
public function createTabulatorPreset()
|
||||
{
|
||||
$tableName = $this->input->post("tableName");
|
||||
$presetName = $this->input->post("presetName");
|
||||
$preset = $this->input->post("preset");
|
||||
|
||||
if (!$tableName || !$presetName || !$preset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "invalid_params_err_msg"), "general", 400);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$existingPresetsResult = $this->TabulatorPresetModel->getTabulatorPresetsByUserAndTable($uid, $tableName);
|
||||
$existingPresets = $this->getDataOrTerminateWithError($existingPresetsResult) ?? [];
|
||||
|
||||
if (count($existingPresets) > 19) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "max_presets_count_err_msg"), "general", 409);
|
||||
}
|
||||
|
||||
$existingPresetNames = array_map(function($presetInfo) {
|
||||
return $presetInfo->preset_name;
|
||||
}, $existingPresets);
|
||||
|
||||
if (in_array($presetName, $existingPresetNames)) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_name_duplicate_err_msg"), "general", 409);
|
||||
}
|
||||
|
||||
$presetCreationResult = $this->TabulatorPresetModel->createTabulatorPreset($uid, $tableName, $presetName, $preset);
|
||||
|
||||
if (isError($presetCreationResult)) {
|
||||
$this->terminateWithError($presetCreationResult->retval);
|
||||
}
|
||||
|
||||
$newPresetData = $this->TabulatorPresetModel->getTabulatorPreset($presetCreationResult->retval);
|
||||
$newPresetArray = $this->getDataOrTerminateWithError($newPresetData) ?? [null];
|
||||
$newPreset = $newPresetArray[0];
|
||||
|
||||
$this->terminateWithSuccess($newPreset);
|
||||
}
|
||||
|
||||
public function updateTabulatorPreset()
|
||||
{
|
||||
$presetId = $this->input->post("presetId");
|
||||
$preset = $this->input->post("preset");
|
||||
|
||||
if (!$presetId || !$preset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "invalid_params_err_msg"), "general", 400);
|
||||
}
|
||||
|
||||
$existingPresetData = $this->TabulatorPresetModel->getTabulatorPreset($presetId);
|
||||
$existingPresetArray = $this->getDataOrTerminateWithError($existingPresetData) ?? [null];
|
||||
$existingPreset = $existingPresetArray[0];
|
||||
if (!$existingPreset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_found_err_msg"), "general", 404);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
if ($existingPreset->benutzer_uid !== $uid) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_own_update_err_msg"), "general", 403);
|
||||
}
|
||||
|
||||
$presetUpdateResult = $this->TabulatorPresetModel->updateTabulatorPreset($presetId, $preset);
|
||||
if (isError($presetUpdateResult)) {
|
||||
$this->terminateWithError($presetUpdateResult->retval);
|
||||
}
|
||||
|
||||
$updatedPresetData = $this->TabulatorPresetModel->getTabulatorPreset($presetId);
|
||||
$updatedPresetArray = $this->getDataOrTerminateWithError($updatedPresetData) ?? [null];
|
||||
$updatedPreset = $updatedPresetArray[0];
|
||||
|
||||
$this->terminateWithSuccess($updatedPreset);
|
||||
}
|
||||
|
||||
public function deleteTabulatorPreset()
|
||||
{
|
||||
$presetId = $this->input->post("presetId");
|
||||
if (!$presetId) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "invalid_params_err_msg"), "general", 400);
|
||||
}
|
||||
|
||||
$presetData = $this->TabulatorPresetModel->getTabulatorPreset($presetId);
|
||||
$presetArray = $this->getDataOrTerminateWithError($presetData) ?? [null];
|
||||
$preset = $presetArray[0];
|
||||
if (!$preset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_found_err_msg"), "general", 404);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
if ($preset->benutzer_uid !== $uid) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_own_delete_err_msg"), "general", 403);
|
||||
}
|
||||
|
||||
$presetDeletionResult = $this->TabulatorPresetModel->deleteTabulatorPreset($presetId);
|
||||
if (isError($presetDeletionResult)) {
|
||||
$this->terminateWithError($presetDeletionResult->retval);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \ReflectionMethod as ReflectionMethod;
|
||||
use \ReflectionFunction as ReflectionFunction;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about menues
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Treemenu extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// Load Router
|
||||
$router = load_class('Router');
|
||||
|
||||
// Load Config
|
||||
$config = load_class('Config');
|
||||
$config->load('treemenu');
|
||||
|
||||
// Get Treemenu name & config
|
||||
$name = $router->method;
|
||||
$conf = $config->item($name);
|
||||
|
||||
// Get Permissions from config
|
||||
$permissions = $conf['permissions'] ?? self::PERM_ANONYMOUS;
|
||||
|
||||
// Call constructor
|
||||
parent::__construct([
|
||||
$name => $permissions
|
||||
]);
|
||||
|
||||
// Load Library
|
||||
$libraryName = $conf['library'] ?? null;
|
||||
$this->load->library($libraryName, null, 'treemenulib');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
* @param array $params (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if (!$this->treemenulib)
|
||||
show_404();
|
||||
|
||||
$this->addMeta('ci_method', $method);
|
||||
$this->addMeta('ci_params', $params);
|
||||
|
||||
$params = $this->uri->uri_to_assoc(6); // 6 = start of $params
|
||||
$config = $this->treemenulib->config;
|
||||
|
||||
foreach (array_keys($params) as $key) {
|
||||
if (!isset($config[$key]) || !$config[$key])
|
||||
show_404();
|
||||
|
||||
$config = $config[$key];
|
||||
}
|
||||
|
||||
// Prepare aliases
|
||||
$argumentaliases = [];
|
||||
if (property_exists($this->treemenulib, 'path_to_argument'))
|
||||
$argumentaliases = array_flip($this->treemenulib->path_to_argument);
|
||||
$methodaliases = [];
|
||||
if (property_exists($this->treemenulib, 'redirect_method'))
|
||||
$methodaliases = $this->treemenulib->redirect_method;
|
||||
|
||||
$items = [];
|
||||
foreach ($config as $uripart => $children) {
|
||||
if (!is_array($children)) {
|
||||
$uripart = $children;
|
||||
$children = [];
|
||||
}
|
||||
|
||||
$methodName = $uripart;
|
||||
if (isset($methodaliases[$methodName])) {
|
||||
$methodName = $methodaliases[$methodName];
|
||||
} elseif (strpbrk($methodName, ' _-') !== false) {
|
||||
$methodName = lcfirst(str_replace([' ', '_', '-'], '', ucwords($methodName, " \t\r\n\f\v_-")));
|
||||
}
|
||||
|
||||
// Prepare arguments
|
||||
if (is_callable($methodName, false, $name)) {
|
||||
if (is_string($methodName) && is_callable([$this->treemenulib, $methodName]))
|
||||
$callable = [$this->treemenulib, $methodName];
|
||||
else
|
||||
$callable = $methodName;
|
||||
} else {
|
||||
$callable = [$this->treemenulib, $methodName];
|
||||
}
|
||||
|
||||
if (is_array($callable))
|
||||
$reflection = new ReflectionMethod($callable[0], $callable[1]);
|
||||
elseif (is_string($callable) && strstr($callable, '::'))
|
||||
$reflection = new ReflectionMethod($callable);
|
||||
elseif ($name != 'Closure::__invoke' && strstr($name, '::__invoke'))
|
||||
$reflection = new ReflectionMethod($callable, '__invoke');
|
||||
else
|
||||
$reflection = new ReflectionFunction($callable);
|
||||
|
||||
$arguments = [];
|
||||
foreach ($reflection->getParameters() as $arg) {
|
||||
if ($arg->name == 'path_template') {
|
||||
$path = $params;
|
||||
$path[$uripart] = '%s';
|
||||
$arguments[] = $this->uri->assoc_to_uri($path);
|
||||
} elseif ($arg->name == 'has_children') {
|
||||
$arguments[] = $children;
|
||||
} elseif ($arg->name == 'original_method') {
|
||||
$arguments[] = $uripart;
|
||||
} elseif (isset($argumentaliases[$arg->name]) && isset($params[$argumentaliases[$arg->name]])) {
|
||||
$arguments[] = $params[$argumentaliases[$arg->name]];
|
||||
} elseif (isset($params[$arg->name])) {
|
||||
$arguments[] = $params[$arg->name];
|
||||
} else {
|
||||
$arguments[] = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Call function from lib
|
||||
$items = array_merge($items, call_user_func_array($callable, $arguments));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($items);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getZeitsperrenUser' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getTypenZeitsperren' => self::PERM_LOGGED,
|
||||
'getTypenErreichbarkeit' => self::PERM_LOGGED,
|
||||
'getStunden' => self::PERM_LOGGED,
|
||||
'loadZeitsperre' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'add' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'update' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'delete' => ['basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person',
|
||||
'zeitsperren'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->load->model('ressource/Zeitsperretyp_model', 'ZeitsperretypModel');
|
||||
$this->load->model('ressource/Erreichbarkeit_model', 'ErreichbarkeitModel');
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->load->model('ressource/Zeitaufzeichnung_model', 'ZeitaufzeichnungModel');
|
||||
}
|
||||
|
||||
public function getZeitsperrenUser($uid)
|
||||
{
|
||||
//check if $uid is passedUser
|
||||
$loggedInUser = getAuthUID();
|
||||
if($loggedInUser != $uid) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) {
|
||||
$this->terminateWithError($this->p->t('ui', 'noAdmin'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenUser($uid);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getTypenZeitsperren()
|
||||
{
|
||||
$excludedTypes = array('ZVerfueg');
|
||||
$result = $this->ZeitsperretypModel->getTypenZeitsperren($excludedTypes);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getTypenErreichbarkeit()
|
||||
{
|
||||
$result = $this->ErreichbarkeitModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getStunden()
|
||||
{
|
||||
$this->StundeModel->addOrder('stunde', 'ASC');
|
||||
$result = $this->StundeModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function loadZeitsperre($zeitsperre_id)
|
||||
{
|
||||
$this->ZeitsperreModel->addSelect(
|
||||
'campus.tbl_zeitsperre.*, typ.*,
|
||||
ma.person_id AS ma_person_id, ma.vorname AS ma_vorname, ma.nachname AS ma_nachname,
|
||||
ma.titelpre AS ma_titelpre, ma.titelpost AS ma_titelpost'
|
||||
);
|
||||
$this->ZeitsperreModel->addJoin('campus.tbl_zeitsperretyp typ', 'ON (typ.zeitsperretyp_kurzbz = campus.tbl_zeitsperre.zeitsperretyp_kurzbz)');
|
||||
$this->ZeitsperreModel->addJoin('public.tbl_benutzer ben', 'ON (ben.uid = campus.tbl_zeitsperre.vertretung_uid)', 'LEFT');
|
||||
$this->ZeitsperreModel->addJoin('public.tbl_person ma', 'ON (ma.person_id = ben.person_id)', 'LEFT');
|
||||
$result = $this->ZeitsperreModel->loadWhere(
|
||||
array('zeitsperre_id' => $zeitsperre_id)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((current(getData($result)) ?: []));
|
||||
}
|
||||
|
||||
public function add($mitarbeiter_uid)
|
||||
{
|
||||
$loggedInUser = getAuthUID();
|
||||
|
||||
if($mitarbeiter_uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->form_validation->set_rules('zeitsperretyp_kurzbz', 'Grund Zeitsperre', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Grund Zeitsperre'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('vondatum', 'VonDatum', 'required|is_valid_date', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('bisdatum', 'BisDatum', 'required|is_valid_date|callback_check_von_bis_datum|callback_check_diff_intval', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'BisDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'BisDatum']),
|
||||
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
|
||||
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$bezeichnung = $this->input->post('bezeichnung');
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
$vonstunde = $this->input->post('vonstunde');
|
||||
$bisdatum = $this->input->post('bisdatum');
|
||||
$bisstunde = $this->input->post('bisstunde');
|
||||
//$vonIso = $this->input->post('vonISO'); //Timestamp für Stunde
|
||||
//$bisIso = $this->input->post('bisISO'); //Timestamp für Stunde
|
||||
$erreichbarkeit_kurzbz = $this->input->post('erreichbarkeit_kurzbz');
|
||||
$vertretung_uid = $this->input->post('vertretung_uid');
|
||||
$zeitsperretyp_kurzbz = $this->input->post('zeitsperretyp_kurzbz');
|
||||
|
||||
//check if existing zeitsperre
|
||||
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if existing zeitaufzeichnung
|
||||
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
|
||||
|
||||
if(hasData($result))
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->ZeitsperreModel->insert(
|
||||
[
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'vondatum' => $vondatum,
|
||||
'vonstunde' => $vonstunde,
|
||||
'bisdatum' => $bisdatum,
|
||||
'bisstunde' => $bisstunde,
|
||||
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
|
||||
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
|
||||
'vertretung_uid' => $vertretung_uid,
|
||||
'insertvon' => $loggedInUser,
|
||||
'insertamum' => date('c'),
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function update($zeitsperre_id)
|
||||
{
|
||||
//check if loggedin User is owner of the zeitsperre
|
||||
$loggedInUser = getAuthUID();
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$uid = current($data)->mitarbeiter_uid;
|
||||
|
||||
if($uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$zeitsperre_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
//get current params
|
||||
$array_update = [
|
||||
'bezeichnung',
|
||||
'vondatum',
|
||||
'vonstunde',
|
||||
'bisdatum',
|
||||
'bisstunde',
|
||||
// 'vonISO', //Timestamp für Stunde
|
||||
// 'bisISO', //Timestamp für Stunde
|
||||
'erreichbarkeit_kurzbz',
|
||||
'vertretung_uid',
|
||||
'zeitsperretyp_kurzbz',
|
||||
'mitarbeiter_uid',
|
||||
];
|
||||
$post = $this->input->post();
|
||||
$update = [];
|
||||
|
||||
foreach ($array_update as $prop)
|
||||
{
|
||||
if (array_key_exists($prop, $post))
|
||||
{
|
||||
$update[$prop] = $post[$prop];
|
||||
}
|
||||
}
|
||||
|
||||
// Validation
|
||||
$rulesDefined = false; //necessary, otherwise CI validation will always be triggered, even without rules
|
||||
foreach ($update as $key => $val) {
|
||||
switch ($key) {
|
||||
case 'zeitsperretyp_kurzbz':
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'Grund Zeitsperre',
|
||||
'required',
|
||||
['required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'Grund Zeitsperre'])]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
case 'vondatum':
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'VonDatum',
|
||||
'required|is_valid_date',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'VonDatum'])
|
||||
]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
case 'bisdatum':
|
||||
$rules = 'required|is_valid_date';
|
||||
if (array_key_exists('vondatum', $update)) {
|
||||
$rules .= '|callback_check_von_bis_datum|callback_check_diff_intval';
|
||||
}
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'BisDatum',
|
||||
$rules,
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'BisDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'BisDatum']),
|
||||
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
|
||||
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
|
||||
]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rulesDefined && $this->form_validation->run() == false) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if(array_key_exists('vondatum', $post) || array_key_exists('bisdatum', $post))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$data = current($data);
|
||||
|
||||
$mitarbeiter_uid = array_key_exists('mitarbeiter_uid', $post) ? $update['mitarbeiter_uid'] : $data->mitarbeiter_uid;
|
||||
$vondatum = array_key_exists('vondatum', $post) ? $update['vondatum'] : $data->vondatum;
|
||||
$bisdatum = array_key_exists('bisdatum', $post) ? $update['bisdatum'] : $data->bisdatum;
|
||||
$vonstunde = array_key_exists('vonstunde', $post) ? $update['vonstunde'] : $data->vonstunde;
|
||||
$zeitsperretyp_kurzbz = array_key_exists('zeitsperretyp_kurzbz', $post) ? $update['zeitsperretyp_kurzbz'] : $data->zeitsperretyp_kurzbz;
|
||||
|
||||
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if existing zeitaufzeichnung
|
||||
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
|
||||
|
||||
if(hasData($result))
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($update)) {
|
||||
$update['updatevon'] = $loggedInUser;
|
||||
$update['updateamum'] = date('c');
|
||||
$result = $this->ZeitsperreModel->update($zeitsperre_id, $update);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->terminateWithSuccess("no update");
|
||||
}
|
||||
|
||||
public function delete($zeitsperre_id)
|
||||
{
|
||||
|
||||
if (!is_numeric($zeitsperre_id) || (int)$zeitsperre_id <= 0)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if loggedin User is owner of the zeitsperre
|
||||
$loggedInUser = getAuthUID();
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$uid = current($data)->mitarbeiter_uid;
|
||||
|
||||
if($uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->ZeitsperreModel->delete(
|
||||
array('zeitsperre_id' => $zeitsperre_id)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function check_von_bis_datum($bisdatum)
|
||||
{
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
|
||||
return $vondatum <= $bisdatum;
|
||||
}
|
||||
|
||||
public function check_diff_intval($bisdatum)
|
||||
{
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
|
||||
// Intervall in days
|
||||
$vonTs = strtotime($vondatum);
|
||||
$bisTs = strtotime($bisdatum);
|
||||
|
||||
$tage = ($bisTs - $vonTs) / 86400;
|
||||
|
||||
// if intervall > 14
|
||||
return $tage <= 14;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -259,7 +259,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
$kaution = $this->input->post('kaution');
|
||||
if($kaution) $kaution = str_replace(',', '.', $kaution);
|
||||
$ausgegebenam = $this->input->post('ausgegebenam');
|
||||
$retouram = $this->input->post('retouram');
|
||||
$retouram = $this->input->post('retouram') == "" ? null : $this->input->post('retouram');
|
||||
|
||||
// NOTE(chris): transform_kartennummer
|
||||
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer)
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
<?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 RoomPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'addRoomReservation' => self::PERM_LOGGED,
|
||||
'deleteRoomReservation' => self::PERM_LOGGED,
|
||||
'getRoomCreationInfo' => self::PERM_LOGGED,
|
||||
'getGruppen' => self::PERM_LOGGED,
|
||||
'getLektor' => self::PERM_LOGGED,
|
||||
'getReservableMap' => self::PERM_LOGGED,
|
||||
'getGroupOptions' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API',
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$this->loadPhrases(['ui']);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
|
||||
public function addRoomReservation()
|
||||
{
|
||||
$this->form_validation->set_rules('selectedStart', "Start", "required");
|
||||
$this->form_validation->set_rules('selectedEnd', "End", "required");
|
||||
$this->form_validation->set_rules('title', "Title", "required|max_length[10]");
|
||||
$this->form_validation->set_rules('beschreibung', "Beschreibung", "required|max_length[32]");
|
||||
$this->form_validation->set_rules('ort_kurzbz', "Ort", "required|max_length[16]");
|
||||
$this->form_validation->set_rules('studiengang', 'Studiengang', 'numeric');
|
||||
$this->form_validation->set_rules('semester', 'Semester', 'integer|greater_than_equal_to[0]');
|
||||
$this->form_validation->set_rules('verband', 'Verband', 'trim');
|
||||
$this->form_validation->set_rules('gruppe', 'Gruppe', 'trim');
|
||||
$this->form_validation->set_rules('spezialgruppe', 'Spezialgruppe', 'max_length[32]');
|
||||
$this->form_validation->set_rules('lektoren', 'Lektoren');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$start = $this->input->post('selectedStart');
|
||||
$end = $this->input->post('selectedEnd');
|
||||
$title = $this->input->post('title');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
$ort_kurzbz = $this->input->post('ort_kurzbz');
|
||||
|
||||
$studiengang_kz = $this->input->post('studiengang');
|
||||
$semester = $this->input->post('semester');
|
||||
$verband = $this->input->post('verband');
|
||||
$gruppe = $this->input->post('gruppe');
|
||||
$spezialgruppe = $this->input->post('spezialgruppe');
|
||||
$lektoren = $this->input->post('lektoren');
|
||||
|
||||
|
||||
$result = $this->stundenplanlib->addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren, $studiengang_kz, $semester, $verband, $gruppe, $spezialgruppe);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function deleteRoomReservation()
|
||||
{
|
||||
$reservierung_id = $this->input->post('reservierung_id');
|
||||
|
||||
$result = $this->stundenplanlib->deleteReservation($reservierung_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getRoomCreationInfo()
|
||||
{
|
||||
$return_array = array('berechtigt' => false, 'studiengaenge' => []);
|
||||
if (!$this->permissionlib->isBerechtigt('lehre/reservierung'))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, UPPER(CONCAT(typ, kurzbz)) as kuerzel, kurzbzlang');
|
||||
$this->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$studiengaenge = $this->StudiengangModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($studiengaenge))
|
||||
$this->terminateWithError($studiengaenge);
|
||||
|
||||
$return_array['studiengaenge'] = hasData($studiengaenge) ? getData($studiengaenge) : [];
|
||||
$return_array['berechtigt'] = true;
|
||||
|
||||
$this->terminateWithSuccess($return_array);
|
||||
}
|
||||
|
||||
public function getGruppen()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
$this->GruppeModel->db->group_start();
|
||||
foreach ($query_words as $word) {
|
||||
$this->GruppeModel->db->group_start();
|
||||
$this->GruppeModel->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('beschreibung ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('orgform_kurzbz ILIKE', "%" . $word . "%");
|
||||
|
||||
if (is_numeric($word)) {
|
||||
$this->GruppeModel->db->or_where('studiengang_kz', $word);
|
||||
}
|
||||
$this->GruppeModel->db->group_end();
|
||||
}
|
||||
$this->GruppeModel->db->group_end();
|
||||
$this->GruppeModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$gruppen = $this->GruppeModel->loadWhere(array('sichtbar' => true, 'lehre' => true));
|
||||
if (isError($gruppen))
|
||||
$this->terminateWithError($gruppen);
|
||||
|
||||
$this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : []);
|
||||
}
|
||||
|
||||
public function getLektor()
|
||||
{
|
||||
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$this->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
|
||||
$this->MitarbeiterModel->db->where('public.tbl_benutzer.aktiv', true);
|
||||
$this->MitarbeiterModel->db->group_start();
|
||||
foreach ($query_words as $word) {
|
||||
$this->MitarbeiterModel->db->group_start();
|
||||
$this->MitarbeiterModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->or_where('uid ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->group_end();
|
||||
}
|
||||
$this->MitarbeiterModel->db->group_end();
|
||||
|
||||
$this->MitarbeiterModel->addOrder('nachname');
|
||||
$this->MitarbeiterModel->addOrder('vorname');
|
||||
$mitarbeiter = $this->MitarbeiterModel->load();
|
||||
if (isError($mitarbeiter))
|
||||
$this->terminateWithError($mitarbeiter);
|
||||
|
||||
$this->terminateWithSuccess(hasData($mitarbeiter) ? getData($mitarbeiter) : []);
|
||||
}
|
||||
|
||||
public function getReservableMap($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);
|
||||
|
||||
$result = $this->stundenplanlib->getReservableMap($ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
$this->terminateWithSuccess(array('reservierbarMap' => hasData($result) ? getData($result) : []));
|
||||
}
|
||||
|
||||
public function getGroupOptions()
|
||||
{
|
||||
$studiengangKz = $this->input->get('studiengangKz');
|
||||
|
||||
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
$this->LehrverbandModel->addSelect('semester, verband, gruppe');
|
||||
$this->LehrverbandModel->db->where('aktiv', true);
|
||||
$this->LehrverbandModel->db->where('studiengang_kz', $studiengangKz);
|
||||
$lehrverbandResult = $this->LehrverbandModel->load();
|
||||
|
||||
if (isError($lehrverbandResult))
|
||||
$this->terminateWithError($lehrverbandResult);
|
||||
|
||||
$lehrverbanden = hasData($lehrverbandResult) ? getData($lehrverbandResult) : [];
|
||||
|
||||
$grouppedValues = [];
|
||||
foreach ($lehrverbanden as $lehrverband) {
|
||||
if (isset($grouppedValues[$lehrverband->semester]) && $lehrverband->verband !== ' ') {
|
||||
$grouppedValues[$lehrverband->semester][] = $lehrverband;
|
||||
} else if (!isset($grouppedValues[$lehrverband->semester]) && $lehrverband->verband !== ' ') {
|
||||
$grouppedValues[$lehrverband->semester] = [$lehrverband];
|
||||
} else if (!isset($grouppedValues[$lehrverband->semester])) {
|
||||
$grouppedValues[$lehrverband->semester] = [];
|
||||
}
|
||||
}
|
||||
$grouppedValues = array_map(
|
||||
function ($semester) {
|
||||
$verbandGruppen = [];
|
||||
foreach ($semester as $lehrverband) {
|
||||
if (isset($verbandGruppen[$lehrverband->verband]) && $lehrverband->gruppe !== ' ') {
|
||||
$verbandGruppen[$lehrverband->verband][] = $lehrverband->gruppe;
|
||||
} else if (!isset($verbandGruppen[$lehrverband->verband]) && $lehrverband->gruppe !== ' ') {
|
||||
$verbandGruppen[$lehrverband->verband] = [$lehrverband->gruppe];
|
||||
} else if (!isset($verbandGruppen[$lehrverband->verband])) {
|
||||
$verbandGruppen[$lehrverband->verband] = [];
|
||||
}
|
||||
}
|
||||
return $verbandGruppen;
|
||||
},
|
||||
$grouppedValues
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($grouppedValues);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,9 +9,10 @@ class Detailheader extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getHeader' => ['vertrag/mitarbeiter:r'],
|
||||
'getPersonAbteilung' => ['vertrag/mitarbeiter:r'],
|
||||
'getLeitungOrg' => ['vertrag/mitarbeiter:r'],
|
||||
'getHeader' => ['vertrag/mitarbeiter:r', 'basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getPersonAbteilung' => ['vertrag/mitarbeiter:r', 'basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getLeitungOrg' => ['vertrag/mitarbeiter:r', 'basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getSemesterStati' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -48,6 +49,17 @@ class Detailheader extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function getSemesterStati($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$result = $this->PrestudentstatusModel->getAllPrestudentstatiWithStudiensemester($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
<?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');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class PaabgabeUebersicht extends FHCAPI_Controller
|
||||
{
|
||||
const DOWNLOAD_PERMISSION = 'lehre/abgabetool:download';
|
||||
const ABGABE_TYPES = ['Bachelor', 'Diplom'];
|
||||
|
||||
/**
|
||||
* PaabgabeUebersicht API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'viewData' => self::PERM_LOGGED,
|
||||
'getPaAbgaben' => array('lehre/abgabetool:r'),
|
||||
'getStudiengaenge' => array('lehre/abgabetool:r'),
|
||||
'getTermine' => array('lehre/abgabetool:r'),
|
||||
'getPaAbgabetypen' => array('lehre/abgabetool:r'),
|
||||
'downloadZip' => array('lehre/abgabetool:r'),
|
||||
//'downloadProjektarbeit' => array('lehre/abgabetool:r')
|
||||
]);
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'abgabetool'
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewData()
|
||||
{
|
||||
$viewData = [
|
||||
"uid" => getAuthUID(),
|
||||
// TODO create permission
|
||||
"showEdit" => true,
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Projektabgaben for search criteria.
|
||||
*/
|
||||
public function getPaAbgaben()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
$abgabedatum = $this->input->get('abgabedatum');
|
||||
$personSearchString = $this->input->get('personSearchString');
|
||||
|
||||
$result = $this->PaabgabeModel->getPaAbgaben(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz, $abgabedatum, $personSearchString);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
// check wether Abgabe is in visual library
|
||||
if (hasData($result))
|
||||
{
|
||||
Events::trigger('in_visual_library', getData($result));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Studiengänge for which user is entitled for
|
||||
*/
|
||||
public function getStudiengaenge()
|
||||
{
|
||||
$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::DOWNLOAD_PERMISSION);
|
||||
|
||||
if (!$studiengang_kz_arr) $this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addSelect('tbl_studiengang.*, UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) AS kuerzel', $studiengang_kz_arr);
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $studiengang_kz_arr);
|
||||
$this->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$result = $this->StudiengangModel->load();
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projekt work due dates, depending on search criteria.
|
||||
*/
|
||||
public function getTermine()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
|
||||
$result = $this->PaabgabeModel->getTermine(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all submission types.
|
||||
*/
|
||||
public function getPaAbgabetypen()
|
||||
{
|
||||
// Load model PaabgabetypModel
|
||||
$this->load->model('education/Paabgabetyp_model', 'PaabgabetypModel');
|
||||
|
||||
$this->PaabgabetypModel->addOrder('bezeichnung');
|
||||
$result = $this->PaabgabetypModel->load();
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Download zip files with project works matching submission search criteria.
|
||||
*/
|
||||
public function downloadZip()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
$abgabedatum = $this->input->get('abgabedatum');
|
||||
$personSearchString = $this->input->get('personSearchString');
|
||||
|
||||
if (!isset($studiengang_kz) && !isset($abgabetyp_kurzbz) && !isset($abgabedatum) && !isset($personSearchString))
|
||||
$this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'nichtsAusgewaehlt'));
|
||||
|
||||
$this->load->library('zip');
|
||||
|
||||
$result = $this->PaabgabeModel->getPaAbgaben(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz, $abgabedatum, $personSearchString);
|
||||
|
||||
if (isError($result)) $this->terminateWithFileOutput('text/plain', getError($result));
|
||||
|
||||
$fileExists = false;
|
||||
$studiengang_kuerzel = null;
|
||||
|
||||
if (!hasData($result)) $this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'keineDateienVorhanden'));
|
||||
|
||||
$abgaben = getData($result);
|
||||
|
||||
foreach ($abgaben as $abgabe)
|
||||
{
|
||||
$path = PAABGABE_PATH.$abgabe->paabgabe_id.'_'.$abgabe->uid.'.pdf';
|
||||
if (file_exists($path))
|
||||
{
|
||||
$fileExists = true;
|
||||
$studiengang_kuerzel = $abgabe->studiengang_kuerzel;
|
||||
$this->zip->read_file($path);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fileExists) $this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'keineDateienVorhanden'));
|
||||
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$zipFileName = 'Abgabe'.(isset($studiengang_kz) && isset($studiengang_kuerzel) ? '_'.$studiengang_kuerzel : '').'.zip';
|
||||
$this->zip->download($zipFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download Projektarbeit document.
|
||||
*/
|
||||
//~ public function downloadProjektarbeit()
|
||||
//~ {
|
||||
//~ $paabgabe_id = $this->input->get('paabgabe_id');
|
||||
|
||||
//~ if (!is_numeric($paabgabe_id))
|
||||
//~ $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Abgabe ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
//~ //$abgabeRes = $this->PaabgabeModel->getEndabgabe($projektarbeit_id);
|
||||
//~ $this->PaabgabeModel->addSelect("paabgabe_id, student_uid, tbl_paabgabe.datum, tbl_paabgabe.abgabedatum, projekttyp_kurzbz, titel, titel_english,
|
||||
//~ paabgabe_id || '_' || student_uid || '.pdf' AS filename");
|
||||
//~ $this->PaabgabeModel->addJoin('lehre.tbl_projektarbeit', 'projektarbeit_id');
|
||||
//~ $abgabeRes = $this->PaabgabeModel->load($paabgabe_id);
|
||||
|
||||
//~ if (isError($abgabeRes))
|
||||
//~ show_error(getError($abgabeRes));
|
||||
|
||||
//~ if (hasData($abgabeRes))
|
||||
//~ {
|
||||
//~ $endabgabe = getData($abgabeRes)[0];
|
||||
//~ $filepath = PAABGABE_PATH.$endabgabe->filename;
|
||||
|
||||
//~ if (file_exists($filepath))
|
||||
//~ {
|
||||
//~ $this->output
|
||||
//~ ->set_status_header(200)
|
||||
//~ ->set_content_type('application/pdf', 'utf-8')
|
||||
//~ ->set_header('Content-Disposition: attachment; filename="'.$endabgabe->filename.'"')
|
||||
//~ ->set_output(file_get_contents($filepath))
|
||||
//~ ->_display();
|
||||
//~ }
|
||||
//~ else
|
||||
//~ {
|
||||
//~ show_error("File does not exist.");
|
||||
//~ }
|
||||
//~ }
|
||||
//~ }
|
||||
}
|
||||
@@ -12,9 +12,9 @@ class Funktionen extends FHCAPI_Controller
|
||||
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'],
|
||||
'getOrgHeads' => self::PERM_LOGGED,
|
||||
'getOrgetsForCompany' => self::PERM_LOGGED,
|
||||
'getAllOrgUnits' => self::PERM_LOGGED,
|
||||
'loadFunction' => ['admin:r', 'assistenz:r'],
|
||||
'insertFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
@@ -294,6 +294,10 @@ class Funktionen extends FHCAPI_Controller
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
if($datum_von == '')
|
||||
$datum_von = null;
|
||||
if($datum_bis == '')
|
||||
$datum_bis = null;
|
||||
|
||||
$result = $this->BenutzerfunktionModel->update(
|
||||
[
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Betreuungen extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getBetreuungen' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getBetreuungen()
|
||||
{
|
||||
$semester = $this->input->get("semester");
|
||||
if (!$semester) $this->terminateWithError("Missing parameters!");
|
||||
|
||||
$personId = getAuthPersonId();
|
||||
|
||||
$betreuungenQuery = "SELECT
|
||||
tbl_lehrveranstaltung.bezeichnung,
|
||||
tbl_projektarbeit.titel,
|
||||
(SELECT nachname || ' ' || (CASE WHEN wahlname IS NOT NULL THEN wahlname ELSE vorname END)
|
||||
FROM public.tbl_benutzer
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
WHERE uid=student_uid)
|
||||
as name,
|
||||
(SELECT uid
|
||||
FROM public.tbl_benutzer
|
||||
WHERE uid=student_uid)
|
||||
as uid,
|
||||
tbl_lehrveranstaltung.studiengang_kz,
|
||||
tbl_lehrveranstaltung.semester,
|
||||
tbl_studiengang.kurzbzlang as studiengang,
|
||||
tbl_studiengang.email,
|
||||
tbl_betreuerart.beschreibung AS beutreuerart_beschreibung,
|
||||
tbl_projektbetreuer.stunden
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer, public.tbl_studiengang, lehre.tbl_betreuerart
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_projektarbeit.lehrveranstaltung_id AND
|
||||
tbl_projektarbeit.studiensemester_kurzbz = '$semester' AND
|
||||
tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id AND
|
||||
tbl_lehrveranstaltung.studiengang_kz = tbl_studiengang.studiengang_kz AND
|
||||
tbl_projektbetreuer.betreuerart_kurzbz = tbl_betreuerart.betreuerart_kurzbz AND
|
||||
tbl_projektbetreuer.person_id = '$personId'";
|
||||
$this->addMeta("query", $betreuungenQuery);
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->execReadOnlyQuery($betreuungenQuery);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Config extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'set' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
]);
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get()
|
||||
{
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$ignore_kollision = $this->_ci->variablelib->getVar('ignore_kollision');
|
||||
$ignore_zeitsperre = $this->_ci->variablelib->getVar('ignore_zeitsperre');
|
||||
$ignore_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung');
|
||||
|
||||
$config['ignore_kollision'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_kollision',
|
||||
"value" => $ignore_kollision,
|
||||
];
|
||||
|
||||
$config['ignore_zeitsperre'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_zeitsperre',
|
||||
"value" => $ignore_zeitsperre,
|
||||
];
|
||||
|
||||
$config['ignore_reservierung'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_reservierung',
|
||||
"value" => $ignore_reservierung,
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
public function set()
|
||||
{
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
foreach (['ignore_kollision','ignore_zeitsperre','ignore_reservierung'] as $variable)
|
||||
{
|
||||
if ($this->_ci->input->post($variable) !== null)
|
||||
{
|
||||
$this->VariableModel->update(array('uid' => $this->_uid, 'name' => $variable), array('wert' => $this->input->post($variable)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ class Gruppe extends FHCAPI_Controller
|
||||
'getBenutzerSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getAllSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getByLehreinheit' => ['admin:r', 'assistenz:r'],
|
||||
'getGruppe' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
@@ -67,7 +68,7 @@ class Gruppe extends FHCAPI_Controller
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, !($lehrverband === 'false'));
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, $lehrverband === true || $lehrverband === 'true');
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
@@ -75,6 +76,71 @@ class Gruppe extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getGruppe()
|
||||
{
|
||||
$lehrverband = $this->input->post('lehrverband');
|
||||
|
||||
$gruppen_result = array();
|
||||
|
||||
if ($lehrverband === false)
|
||||
{
|
||||
$gruppen_result = $this->_ci->GruppeModel->loadWhere(array(
|
||||
'studiengang_kz' => $this->input->post('stg_kz'),
|
||||
'gruppe_kurzbz' => $this->input->post('gruppe_kurzbz'),
|
||||
'aktiv' => true
|
||||
));
|
||||
}
|
||||
else if ($lehrverband === true)
|
||||
{
|
||||
|
||||
if (!isEmptyString($this->input->post('verband')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('verband', $this->input->post('verband'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("trim(verband) = ''");
|
||||
$this->LehrverbandModel->db->or_where("verband IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
if (!isEmptyString($this->input->post('gruppe')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('gruppe', $this->input->post('gruppe'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("trim(gruppe) = ''");
|
||||
$this->LehrverbandModel->db->or_where("gruppe IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
if (!isEmptyString((string)$this->input->post('semester')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('semester', $this->input->post('semester'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("semester = ''");
|
||||
$this->LehrverbandModel->db->or_where("semester IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
$gruppen_result = $this->LehrverbandModel->loadWhere(array('studiengang_kz' => $this->input->post('stg_kz'), 'aktiv' => true));
|
||||
}
|
||||
|
||||
if (!hasData($gruppen_result))
|
||||
return $this->terminateWithError('No group found');
|
||||
|
||||
$gruppen_array = getData($gruppen_result)[0];
|
||||
|
||||
$this->terminateWithSuccess($gruppen_array->gid);
|
||||
}
|
||||
|
||||
public function getByLehreinheit($lehreinheit_id = null)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
|
||||
@@ -19,7 +19,8 @@ class Lehreinheit extends FHCAPI_Controller
|
||||
'getLehrfach' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
'getLehrform' => ['admin:r', 'assistenz:r']
|
||||
'getLehrform' => ['admin:r', 'assistenz:r'],
|
||||
'getLehreinheitenBySemester' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
@@ -438,6 +439,27 @@ class Lehreinheit extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($this->p->t('global', 'gespeichert'));
|
||||
}
|
||||
|
||||
public function getLehreinheitenBySemester()
|
||||
{
|
||||
$semester = $this->input->get('semester');
|
||||
$lehreinheiten = $this->LehreinheitModel->getLehrenheitenBySemester(getAuthUID(), $semester);
|
||||
$lehreinheiten = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
foreach ($lehreinheiten as $lehreinheit) {
|
||||
$groups = $this->LehreinheitModel->getGroupsByLehreinheit($lehreinheit->lehreinheit_id);
|
||||
$groups = $this->getDataOrTerminateWithError($groups);
|
||||
$stgKurzbz = $lehreinheit->stg_kurzbz;
|
||||
$lehreinheit->groups = array_map(
|
||||
function ($group) use ($stgKurzbz) {
|
||||
return $group->gruppe_kurzbz ?? $stgKurzbz . "-" . $group->semester . $group->verband . $group->gruppe;
|
||||
},
|
||||
$groups
|
||||
);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($lehreinheiten);
|
||||
}
|
||||
|
||||
|
||||
private function checkPermission($lehreinheit_id)
|
||||
{
|
||||
|
||||
@@ -134,9 +134,14 @@ class Lektor extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if (isset($formData['semesterstunden']) && (!is_numeric($formData['semesterstunden']) || $formData['semesterstunden'] === ''))
|
||||
$nullable_fields = array('semesterstunden', 'stundensatz', 'planstunden');
|
||||
|
||||
foreach ($nullable_fields as $nullable_field)
|
||||
{
|
||||
$formData['semesterstunden'] = null;
|
||||
if (isset($formData[$nullable_field]) && (!is_numeric($formData[$nullable_field]) || $formData[$nullable_field] === ''))
|
||||
{
|
||||
$formData[$nullable_field] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
|
||||
@@ -144,6 +149,9 @@ class Lektor extends FHCAPI_Controller
|
||||
if (!$lehreinheit_permission)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
if (!is_null($this->getLektorVertrag($lehreinheit_id, $mitarbeiter_uid)) && (array_key_exists('mitarbeiter_uid', $formData) && $mitarbeiter_uid !== $formData['mitarbeiter_uid']))
|
||||
$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));
|
||||
@@ -154,7 +162,7 @@ class Lektor extends FHCAPI_Controller
|
||||
{
|
||||
$value = str_replace(',', '.', $value);
|
||||
|
||||
if (!is_numeric($value))
|
||||
if (!is_numeric($value) && $value !== "")
|
||||
{
|
||||
$this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss eine Zahl sein.');
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Noten extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getCertificate' => 'student/noten:r',
|
||||
'getTeacherProposal' => 'student/noten:r',
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'stv',
|
||||
'person',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getCertificate($lv_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($lv_id) || !ctype_digit((string)$lv_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere([
|
||||
'lehrveranstaltung_id' => $lv_id
|
||||
]);
|
||||
|
||||
$lehrveranstaltung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$lehrveranstaltung)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->ZeugnisnoteModel->getZeugnisnoten(null, $studiensemester_kurzbz, $lehrveranstaltung[0]->lehrveranstaltung_id);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
public function getTeacherProposal($lv_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($lv_id) || !ctype_digit((string)$lv_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere([
|
||||
'lehrveranstaltung_id' => $lv_id
|
||||
]);
|
||||
|
||||
$lehrveranstaltung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$lehrveranstaltung)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, null, $studiensemester_kurzbz);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,8 @@
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class Setup extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
@@ -27,7 +29,8 @@ class Setup extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getLETabs' => ['admin:r', 'assistenz:r'],
|
||||
'getLVTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
@@ -41,9 +44,10 @@ class Setup extends FHCAPI_Controller
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->helper('hlp_document');
|
||||
}
|
||||
|
||||
public function getTabs()
|
||||
public function getLETabs()
|
||||
{
|
||||
$tabs['details'] = array (
|
||||
'title' => 'Details',
|
||||
@@ -60,11 +64,43 @@ class Setup extends FHCAPI_Controller
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Lektor.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['termine'] = array (
|
||||
'title' => 'Termine',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Termine.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['notiz'] = array (
|
||||
'title' => 'Notizen',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Notiz.js'),
|
||||
'config' => []
|
||||
);
|
||||
|
||||
Events::trigger('lvv_conf_tabs', function & () use (&$tabs) {
|
||||
return $tabs;
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
public function getLVTabs()
|
||||
{
|
||||
$tabs['termine'] = array (
|
||||
'title' => 'Termine',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/LVTermine.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['noten'] = array (
|
||||
'title' => 'Noten',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Noten.js'),
|
||||
'config' => [
|
||||
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
|
||||
'edit' => 'both', // Possible values: both|header|inline
|
||||
'delete' => 'inline', // Possible values: both|header|inline
|
||||
'documents' => 'inline', // Possible values: both|header|inline
|
||||
'documentslist' => gradesDocumentsList(),
|
||||
'semesterSelect' => false
|
||||
]
|
||||
);
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,9 @@ class Studiensemester extends FHCAPI_Controller
|
||||
'getAll' => self::PERM_LOGGED,
|
||||
'getAktNext' => self::PERM_LOGGED,
|
||||
'getStudienjahrByStudiensemester' => self::PERM_LOGGED,
|
||||
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED
|
||||
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED,
|
||||
'current' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
)
|
||||
);
|
||||
// Load model StudiensemesterModel
|
||||
@@ -166,4 +168,39 @@ class Studiensemester extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess(array($studiensemester, $aktuell));
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithError('Kein Studiensemester aktiv');
|
||||
if (count($data) > 1)
|
||||
$this->terminateWithError('Mehrere Studiensemester aktiv');
|
||||
|
||||
$this->terminateWithSuccess(current($data)->studiensemester_kurzbz);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$stdsem = $this->input->post('studiensemester_kurzbz');
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'semester_aktuell', $stdsem);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,12 +246,12 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
{
|
||||
$searchString = $this->input->get('searchString') ?? '';
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString, 'ohneMaUid');
|
||||
$result = $this->PersonModel->searchPerson($searchString, 'mitMaUid');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
@@ -371,6 +371,9 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$datum = $formData['datum'] == '' ? null : $formData['datum'];
|
||||
$sponsion = $formData['sponsion'] == '' ? null : $formData['sponsion'];
|
||||
|
||||
$result = $this->AbschlusspruefungModel->update(
|
||||
[
|
||||
'abschlusspruefung_id' => $abschlusspruefung_id
|
||||
@@ -382,8 +385,8 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
'vorsitz' => $vorsitz,
|
||||
'pruefungsantritt_kurzbz' => $formData['pruefungsantritt_kurzbz'],
|
||||
'abschlussbeurteilung_kurzbz' => $formData['abschlussbeurteilung_kurzbz'],
|
||||
'datum' => $formData['datum'],
|
||||
'sponsion' => $formData['sponsion'],
|
||||
'datum' => $datum,
|
||||
'sponsion' => $sponsion,
|
||||
'pruefer1' => $pruefer1,
|
||||
'pruefer2' => $pruefer2,
|
||||
'pruefer3' => $pruefer3,
|
||||
|
||||
@@ -301,6 +301,7 @@ class Config extends FHCAPI_Controller
|
||||
|
||||
public function student()
|
||||
{
|
||||
$this->load->helper('hlp_document');
|
||||
$result = [];
|
||||
$config = $this->config->item('tabs');
|
||||
|
||||
@@ -376,9 +377,9 @@ class Config extends FHCAPI_Controller
|
||||
'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()
|
||||
'delete' => 'inline', // Possible values: both|header|inline
|
||||
'documents' => 'inline', // Possible values: both|header|inline
|
||||
'documentslist' => gradesDocumentsList()
|
||||
]
|
||||
];
|
||||
|
||||
@@ -622,188 +623,6 @@ class Config extends FHCAPI_Controller
|
||||
] + $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
|
||||
*
|
||||
|
||||
@@ -170,6 +170,8 @@ class Dokumente extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$nachgereicht_am = $this->input->post('nachgereicht_am') == '' ? null : $this->input->post('nachgereicht_am');
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->AkteModel->update(
|
||||
@@ -180,7 +182,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
'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'),
|
||||
'nachgereicht_am' => $nachgereicht_am,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $uid,
|
||||
]
|
||||
|
||||
@@ -41,6 +41,9 @@ class Grades extends FHCAPI_Controller
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('PruefungsverlaufLib', null, 'VerlaufLib');
|
||||
|
||||
$this->load->config('noten');
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
@@ -355,23 +358,24 @@ class Grades extends FHCAPI_Controller
|
||||
$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->ZeugnisnoteModel->insert($data);
|
||||
}
|
||||
|
||||
// Der erste Antritt wird bereits bei der Übernahme als eigene Prüfung angelegt, damit der
|
||||
// Prüfungsverlauf von Anfang an vollständig ist und das Benotungstool ihn nicht erst beim
|
||||
// Anlegen einer Wiederholung nachtragen muss. Läuft bewusst in BEIDEN Zweigen (auch beim
|
||||
// Überschreiben einer bestehenden Zeugnisnote) und ist idempotent.
|
||||
if ($this->config->item('CIS_GESAMTNOTE_ERSTANTRITT_BEI_UEBERNAHME')) {
|
||||
$result = $this->addErstantrittForGrade(
|
||||
$studiensemester_kurzbz,
|
||||
$student_uid,
|
||||
$lehrveranstaltung_id,
|
||||
$teacherGrade
|
||||
);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
@@ -491,20 +495,32 @@ class Grades extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that adds tests for a student
|
||||
* (Entries in lehre.tbl_pruefung)
|
||||
* Legt bei der Notenübernahme den ersten Prüfungsantritt als eigenen Datensatz an
|
||||
* (Eintrag in lehre.tbl_pruefung).
|
||||
*
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param string $student_uid
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param integer $note
|
||||
* @param numeric $punkte
|
||||
* Idempotent: existiert für den Studenten in dieser LV bereits ein Termin, passiert nichts -
|
||||
* die Übernahme darf beliebig oft laufen, ohne den Verlauf zu verfälschen.
|
||||
*
|
||||
* Datiert auf das Freigabedatum der LV-Note: das ist der Zeitpunkt, zu dem die
|
||||
* Leistungsfeststellung verbindlich wurde. Das Benotungsdatum ändert sich bei jeder Korrektur,
|
||||
* der Übernahmezeitpunkt ist reine Verwaltungsarbeit - beide taugen nicht als Termindatum.
|
||||
*
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param string $student_uid
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param stdClass $teacherGrade die übernommene LV-Gesamtnote
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
protected function addTestsForGrade($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id, $note, $punkte)
|
||||
protected function addErstantrittForGrade($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id, $teacherGrade)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
|
||||
// bereits ein Termin vorhanden -> der Verlauf beginnt schon, nichts nachzutragen
|
||||
$vorhanden = $this->VerlaufLib->getPruefungen($student_uid, $lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
if (count($vorhanden) > 0)
|
||||
return success(null);
|
||||
|
||||
// Get Lehreinheit
|
||||
$result = $this->LehrveranstaltungModel->getLeByStudent($student_uid, $studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
@@ -515,19 +531,24 @@ class Grades extends FHCAPI_Controller
|
||||
return error($this->p->t("stv", "grades_error_lehreinheit_id"));
|
||||
$le = current(getData($result));
|
||||
|
||||
$datum = $teacherGrade->freigabedatum ?: ($teacherGrade->benotungsdatum ?: date('Y-m-d'));
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
// 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
|
||||
"mitarbeiter_uid" => $teacherGrade->mitarbeiter_uid,
|
||||
"datum" => $datum,
|
||||
"pruefungstyp_kurzbz" => $this->VerlaufLib->legacyTypFuerAntritt(1),
|
||||
"note" => $teacherGrade->note,
|
||||
"insertamum" => $now,
|
||||
"insertvon" => getAuthUID()
|
||||
];
|
||||
|
||||
if (defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE)
|
||||
$data["punkte"] = $punkte;
|
||||
|
||||
$data["punkte"] = $teacherGrade->punkte;
|
||||
|
||||
// Get Anwesenheit
|
||||
$this->load->model('education/Anwesenheit_model', 'AnwesenheitModel');
|
||||
$result = $this->AnwesenheitModel->loadAnwesenheitStudiensemester($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id);
|
||||
@@ -535,7 +556,8 @@ class Grades extends FHCAPI_Controller
|
||||
return $result;
|
||||
$anwesenheit = getData($result);
|
||||
|
||||
if ($anwesenheit && (float)current($anwesenheit)->prozent < FAS_ANWESENHEIT_ROT) {
|
||||
if (defined('FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN') && FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN
|
||||
&& $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');
|
||||
@@ -545,7 +567,10 @@ class Grades extends FHCAPI_Controller
|
||||
|
||||
$anwesenheitsbefreit = hasData($result);
|
||||
|
||||
// Wenn nicht Anwesenheitsbefreit und Anwesenheit unter einem bestimmten Prozentsatz fällt dann wird ein Pruefungsantritt abgezogen
|
||||
// Bei zu geringer Anwesenheit ohne Befreiung wird ein zusätzlicher Termin
|
||||
// 'Nicht beurteilt' vor dem eigentlichen Antritt festgehalten. ACHTUNG: diese Note
|
||||
// zählt nicht mehr als Antritt (NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN) - der frühere
|
||||
// "Antritt abziehen"-Effekt entfällt damit, der Eintrag ist reine Dokumentation.
|
||||
if (!$anwesenheitsbefreit) {
|
||||
$data2 = $data;
|
||||
$data2["note"] = 7;
|
||||
@@ -556,8 +581,6 @@ class Grades extends FHCAPI_Controller
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
$data["pruefungstyp_kurzbz"] = "Termin2";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -429,9 +429,12 @@ class Konto extends FHCAPI_Controller
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
];
|
||||
|
||||
foreach ($allowed as $field)
|
||||
if ($this->input->post($field) !== null)
|
||||
$data[$field] = $this->input->post($field);
|
||||
if($data['buchungsdatum'] == '')
|
||||
$data['buchungsdatum'] = null;
|
||||
|
||||
$result = $this->KontoModel->update($id, $data);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class LvTermine extends FHCAPI_Controller
|
||||
|
||||
//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")
|
||||
public function getStundenplan($uid, $start_date = null, $end_date = null, $dbStundenplanTable = "stundenplan", $groupConsecutiveHours = false)
|
||||
{
|
||||
$student_uid = $uid;
|
||||
$semester_range = $this->studienSemesterErmitteln($start_date, $end_date);
|
||||
@@ -80,13 +80,6 @@ class LvTermine extends FHCAPI_Controller
|
||||
|
||||
$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()
|
||||
@@ -377,6 +370,7 @@ class LvTermine extends FHCAPI_Controller
|
||||
$result->semester = $item->semester;
|
||||
$result->verband = $item->verband;
|
||||
$result->gruppe = $item->gruppe;
|
||||
$result->studiensemester_kurzbz = $item->studiensemester_kurzbz;
|
||||
return $result;
|
||||
},
|
||||
$lehrverband_query_result));
|
||||
|
||||
@@ -237,8 +237,8 @@ class Mobility extends FHCAPI_Controller
|
||||
}
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$von = $formData['von'] ?? null;
|
||||
$bis = $formData['bis'] ?? null;
|
||||
$von = ($formData['von'] ?? '') ?: null;
|
||||
$bis = ($formData['bis'] ?? '') ?: null;
|
||||
$nation_code = $formData['nation_code'] ?? null;
|
||||
$mobilitaetsprogramm_code = $formData['mobilitaetsprogramm_code'] ?? null;
|
||||
$herkunftsland_code = $formData['herkunftsland_code'] ?? null;
|
||||
|
||||
@@ -193,7 +193,7 @@ class Prestudent extends FHCAPI_Controller
|
||||
}
|
||||
elseif (
|
||||
$val === ''
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode'])
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode', 'zgvdatum', 'zgvmadatum'])
|
||||
)
|
||||
{
|
||||
$val = null;
|
||||
|
||||
@@ -42,6 +42,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->load->model('education/Note_model', 'NoteModel');
|
||||
$this->load->model('education/Projektbetreuer_model', 'BetreuerModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
// load libraries
|
||||
$this->load->library('PermissionLib');
|
||||
@@ -100,16 +102,16 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
private function fetchProjektarbeitById($projektarbeit_id) {
|
||||
$this->ProjektarbeitModel->resetQuery();
|
||||
$this->ProjektarbeitModel->addSelect(
|
||||
'lehre.tbl_projektarbeit.projektarbeit_id, titel, titel_english, themenbereich, projekttyp_kurzbz, lehrveranstaltung_id, lehreinheit_id,
|
||||
firma_id, beginn, ende, gesperrtbis, note, final, freigegeben, tbl_projektarbeit.anmerkung, fa.name AS firma_name'
|
||||
'lehre.tbl_projektarbeit.projektarbeit_id, titel, titel_english, themenbereich, projekttyp_kurzbz, lehrveranstaltung_id, lehreinheit_id,
|
||||
tbl_projektarbeit.studiensemester_kurzbz, firma_id, beginn, ende, gesperrtbis, note, final, freigegeben, tbl_projektarbeit.anmerkung, fa.name AS firma_name'
|
||||
);
|
||||
$this->ProjektarbeitModel->addJoin('lehre.tbl_lehreinheit le', 'lehreinheit_id');
|
||||
$this->ProjektarbeitModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id');
|
||||
$this->ProjektarbeitModel->addJoin('public.tbl_firma fa', 'firma_id', 'LEFT');
|
||||
|
||||
|
||||
return $this->ProjektarbeitModel->loadWhere(
|
||||
array('projektarbeit_id' => $projektarbeit_id)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,14 +248,38 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$additional_lehrveranstaltung_id = $this->input->get('additional_lehrveranstaltung_id');
|
||||
|
||||
if (!isset($student_uid)) $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
|
||||
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemster missing', self::ERROR_TYPE_GENERAL);
|
||||
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemester missing', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// get Lvs
|
||||
// get prestudent_id from student model
|
||||
$studentRes = $this->StudentModel->load(['student_uid' => $student_uid]);
|
||||
if(hasData($studentRes)) {
|
||||
$student = getData($studentRes);
|
||||
} else {
|
||||
$this->terminateWithError($studentRes, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// to get prestudent_status history
|
||||
$historyRes = $this->PrestudentstatusModel->getHistoryPrestudent($student[0]->prestudent_id);
|
||||
if(hasData($historyRes)) {
|
||||
$history = getData($historyRes);
|
||||
} else {
|
||||
$this->terminateWithError($historyRes, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// query for every lva of a studiengang that has projektarbeit flag true
|
||||
$lvsResult = $this->LehrveranstaltungModel->getLvsForProjektarbeit($student_uid, $studiengang_kz, $additional_lehrveranstaltung_id);
|
||||
|
||||
if (isError($lvsResult)) return $this->terminateWithError($lvsResult, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lvs = hasData($lvsResult) ? getData($lvsResult) : [];
|
||||
|
||||
$lvsIDs = array_column($lvs, 'lehrveranstaltung_id');
|
||||
|
||||
// get current studienplan_id from status history to find out which lva options are actually assigned to the students studienplan
|
||||
// important so the projektarbeit has the correct lva assigned to be able to find and print the thesis title on the degree documents!
|
||||
$currentStatus = $history[0];
|
||||
$lvByStudienPlanRes = $this->LehrveranstaltungModel->getLvsByStudienplanByLvaIDs($currentStatus->studienplan_id, $lvsIDs);
|
||||
if(hasData($lvByStudienPlanRes)) {
|
||||
$lvs = getData($lvByStudienPlanRes);
|
||||
}
|
||||
|
||||
foreach ($lvs as $lv)
|
||||
{
|
||||
@@ -320,11 +346,18 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Projekttyp'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'required|is_natural', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehreinheit']),
|
||||
$this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'is_natural', [
|
||||
'is_natural' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Lehreinheit'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id', 'Lehrveranstaltung', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Lehrveranstaltung'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studiensemester'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('beginn', 'Beginn', 'is_valid_date', [
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Beginn'])
|
||||
]);
|
||||
@@ -354,6 +387,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
'projekttyp_kurzbz' => $formData['projekttyp_kurzbz'],
|
||||
'firma_id' => $formData['firma_id'] ?? null,
|
||||
'lehreinheit_id' => $formData['lehreinheit_id'],
|
||||
'lehrveranstaltung_id' => $formData['lehrveranstaltung_id'],
|
||||
'studiensemester_kurzbz' => $formData['studiensemester_kurzbz'],
|
||||
'beginn' => isset($formData['beginn']) && !isEmptyString($formData['beginn']) ? $formData['beginn'] : null,
|
||||
'ende' => isset($formData['ende']) && !isEmptyString($formData['ende']) ? $formData['ende'] : null,
|
||||
'note' => $formData['note'] ?? null,
|
||||
|
||||
@@ -448,8 +448,10 @@ class Pruefung extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$datum = $this->input->post('datum') == '' ? null : $this->input->post('datum');
|
||||
if(intval($pruefung_id) > 0)
|
||||
{
|
||||
|
||||
$result = $this->PruefungModel->update(
|
||||
[
|
||||
'pruefung_id' => $pruefung_id
|
||||
@@ -459,7 +461,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
|
||||
'note' => $this->input->post('note'),
|
||||
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
|
||||
'datum' => $this->input->post('datum'),
|
||||
'datum' => $datum,
|
||||
'anmerkung' => $this->input->post('anmerkung'),
|
||||
'updatevon' => $authUID,
|
||||
'updateamum' => date('c'),
|
||||
@@ -472,7 +474,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
|
||||
'student_uid' => $this->input->post('student_uid'),
|
||||
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
|
||||
'datum' => $this->input->post('datum'),
|
||||
'datum' => $datum,
|
||||
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
|
||||
'note' => $this->input->post('note'),
|
||||
'anmerkung' => $this->input->post('anmerkung'),
|
||||
@@ -520,7 +522,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'note' => $this->input->post('note'),
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $this->input->post('datum'),
|
||||
'benotungsdatum' => $datum,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID,
|
||||
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
|
||||
@@ -555,7 +557,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
], [
|
||||
'note' => $this->input->post('note'),
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $this->input->post('datum'),
|
||||
'benotungsdatum' => $datum,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $authUID,
|
||||
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
|
||||
|
||||
@@ -144,6 +144,7 @@ class Student extends FHCAPI_Controller
|
||||
. $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
. ") AS statusofsemester"
|
||||
);
|
||||
$this->PrestudentModel->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 'student_uid = uid', 'LEFT');
|
||||
@@ -296,6 +297,10 @@ class Student extends FHCAPI_Controller
|
||||
$fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val);
|
||||
$update_person[$prop] = $fotoval;
|
||||
}
|
||||
else if ($prop == 'gebdatum')
|
||||
{
|
||||
$update_person[$prop] = ($val == '') ? null : $val;
|
||||
}
|
||||
else
|
||||
{
|
||||
$update_person[$prop] = $val;
|
||||
|
||||
@@ -108,6 +108,7 @@ class Students extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
"(
|
||||
@@ -138,7 +139,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -153,7 +154,8 @@ class Students extends FHCAPI_Controller
|
||||
$this->addMeta('ci_params', [
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
"(
|
||||
@@ -190,14 +192,14 @@ class Students extends FHCAPI_Controller
|
||||
) AS semester", false);
|
||||
$this->studentlistlib->addSelect("COALESCE(v.verband::text, ''::text) AS verband");
|
||||
$this->studentlistlib->addSelect("COALESCE(v.gruppe::text, ''::text) AS gruppe");
|
||||
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -213,6 +215,7 @@ class Students extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
"(
|
||||
@@ -235,59 +238,66 @@ class Students extends FHCAPI_Controller
|
||||
) AS semester", false);
|
||||
$this->studentlistlib->addSelect("COALESCE(v.verband::text, ''::text) AS verband");
|
||||
$this->studentlistlib->addSelect("COALESCE(v.gruppe::text, ''::text) AS gruppe");
|
||||
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getPrestudents(
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$studiensemester_kurzbz = null,
|
||||
$filter = null
|
||||
) {
|
||||
$this->addMeta('ci_method', __FUNCTION__);
|
||||
$this->addMeta('ci_params', array(
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'studiengang_typ_kurzbz' => $studiengang_typ_kurzbz,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'filter' => $filter
|
||||
));
|
||||
|
||||
$this->fetchPrestudents($studiengang_kz, $studiensemester_kurzbz, $filter);
|
||||
$this->fetchPrestudents($studiengang_typ_kurzbz, $studiensemester_kurzbz, $filter);
|
||||
}
|
||||
|
||||
public function getPrestudentsOrgform(
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$orgform_kurzbz,
|
||||
$studiensemester_kurzbz = null,
|
||||
$filter = null
|
||||
) {
|
||||
$this->addMeta('ci_method', __FUNCTION__);
|
||||
$this->addMeta('ci_params', array(
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'studiengang_typ_kurzbz' => $studiengang_typ_kurzbz,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'filter' => $filter,
|
||||
'orgform_kurzbz' => $orgform_kurzbz
|
||||
));
|
||||
|
||||
$this->fetchPrestudents($studiengang_kz, $studiensemester_kurzbz, $filter, $orgform_kurzbz);
|
||||
$this->fetchPrestudents($studiengang_typ_kurzbz, $studiensemester_kurzbz, $filter, $orgform_kurzbz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param string $studiengang_typ_kurzbz
|
||||
* @param string $studiensemester_kurzbz (optional)
|
||||
* @param string $filter (optional)
|
||||
* @param string $orgform_kurzbz (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function fetchPrestudents($studiengang_kz, $studiensemester_kurzbz = null, $filter = null, $orgform_kurzbz = null)
|
||||
protected function fetchPrestudents($studiengang_typ_kurzbz, $studiensemester_kurzbz = null, $filter = null, $orgform_kurzbz = null)
|
||||
{
|
||||
$studiengang_kz = $this->getStudiengangKz($studiengang_typ_kurzbz);
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
$orgform_kurzbz = $this->getOrgformKurzbz($orgform_kurzbz);
|
||||
|
||||
if ($studiengang_kz === null)
|
||||
show_404();
|
||||
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$selectRT = "
|
||||
@@ -439,19 +449,21 @@ class Students extends FHCAPI_Controller
|
||||
$this->studentlistlib->addSelect("'' AS verband");
|
||||
$this->studentlistlib->addSelect("'' AS gruppe");
|
||||
|
||||
$query_studiensemester_kurzbz = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : '\'NULL\'';
|
||||
$this->studentlistlib->addSelect($query_studiensemester_kurzbz . ' as query_studiensemester_kurzbz');
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStudents(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$semester = null,
|
||||
$verband = null,
|
||||
$gruppe = null
|
||||
@@ -459,18 +471,18 @@ class Students extends FHCAPI_Controller
|
||||
$this->addMeta('ci_method', __FUNCTION__);
|
||||
$this->addMeta('ci_params', array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'studiengang_typ_kurzbz' => $studiengang_typ_kurzbz,
|
||||
'semester' => $semester,
|
||||
'verband' => $verband,
|
||||
'gruppe' => $gruppe
|
||||
));
|
||||
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_kz, $semester, $verband, $gruppe, null, null);
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_typ_kurzbz, $semester, $verband, $gruppe, null, null);
|
||||
}
|
||||
|
||||
public function getStudentsOrgform(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$orgform_kurzbz,
|
||||
$semester = null,
|
||||
$verband = null,
|
||||
@@ -479,37 +491,37 @@ class Students extends FHCAPI_Controller
|
||||
$this->addMeta('ci_method', __FUNCTION__);
|
||||
$this->addMeta('ci_params', array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'studiengang_typ_kurzbz' => $studiengang_typ_kurzbz,
|
||||
'orgform_kurzbz' => $orgform_kurzbz,
|
||||
'semester' => $semester,
|
||||
'verband' => $verband,
|
||||
'gruppe' => $gruppe
|
||||
));
|
||||
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_kz, $semester, $verband, $gruppe, null, $orgform_kurzbz);
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_typ_kurzbz, $semester, $verband, $gruppe, null, $orgform_kurzbz);
|
||||
}
|
||||
|
||||
public function getStudentsSpezialgruppe(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$semester,
|
||||
$gruppe_kurzbz
|
||||
) {
|
||||
$this->addMeta('ci_method', __FUNCTION__);
|
||||
$this->addMeta('ci_params', array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'studiengang_typ_kurzbz' => $studiengang_typ_kurzbz,
|
||||
'semester' => $semester,
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz
|
||||
));
|
||||
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_kz, $semester, null, null, $gruppe_kurzbz, null);
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_typ_kurzbz, $semester, null, null, $gruppe_kurzbz, null);
|
||||
}
|
||||
|
||||
public function getStudentsOrgformSpezialgruppe(
|
||||
$studiensemester_kurzbz,
|
||||
$orgform_kurzbz,
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$semester,
|
||||
$gruppe_kurzbz
|
||||
) {
|
||||
@@ -517,17 +529,17 @@ class Students extends FHCAPI_Controller
|
||||
$this->addMeta('ci_params', array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'orgform_kurzbz' => $orgform_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'studiengang_typ_kurzbz' => $studiengang_typ_kurzbz,
|
||||
'semester' => $semester,
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz
|
||||
));
|
||||
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_kz, $semester, null, null, $gruppe_kurzbz, $orgform_kurzbz);
|
||||
$this->fetchStudents($studiensemester_kurzbz, $studiengang_typ_kurzbz, $semester, null, null, $gruppe_kurzbz, $orgform_kurzbz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param string $studiengang_typ_kurzbz
|
||||
* @param integer $semester (optional)
|
||||
* @param string $verband (optional)
|
||||
* @param integer $gruppe (optional)
|
||||
@@ -538,13 +550,20 @@ class Students extends FHCAPI_Controller
|
||||
*/
|
||||
protected function fetchStudents(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$studiengang_typ_kurzbz,
|
||||
$semester = null,
|
||||
$verband = null,
|
||||
$gruppe = null,
|
||||
$gruppe_kurzbz = null,
|
||||
$orgform_kurzbz = null
|
||||
) {
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
$studiengang_kz = $this->getStudiengangKz($studiengang_typ_kurzbz);
|
||||
$orgform_kurzbz = $this->getOrgformKurzbz($orgform_kurzbz);
|
||||
|
||||
if ($studiengang_kz === null)
|
||||
show_404();
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
if (!$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
@@ -556,6 +575,7 @@ class Students extends FHCAPI_Controller
|
||||
$this->studentlistlib->addJoin("public.tbl_student s", "prestudent_id");
|
||||
|
||||
$this->studentlistlib->addSelect("'' AS priorisierung_relativ");
|
||||
$this->studentlistlib->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
if ($gruppe_kurzbz !== null) {
|
||||
$this->studentlistlib->addJoin('public.tbl_benutzergruppe g', 'uid', '', 'after_b');
|
||||
@@ -594,10 +614,22 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
protected function decodeTagsJsonInResult(&$data)
|
||||
{
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
array_walk($data, function($item, $key) {
|
||||
if(isset($item->tags))
|
||||
{
|
||||
$item->tags = json_decode($item->tags);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prestudent_id
|
||||
*
|
||||
@@ -611,6 +643,8 @@ class Students extends FHCAPI_Controller
|
||||
'prestudent_id' => $prestudent_id,
|
||||
));
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
if (!$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
@@ -618,7 +652,7 @@ class Students extends FHCAPI_Controller
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->studentlistlib->addSelect("COALESCE(
|
||||
v.semester::text,
|
||||
CASE
|
||||
@@ -638,7 +672,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -655,6 +689,8 @@ class Students extends FHCAPI_Controller
|
||||
'student_uid' => $student_uid,
|
||||
));
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
if (!$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
@@ -664,14 +700,14 @@ class Students extends FHCAPI_Controller
|
||||
|
||||
|
||||
$this->studentlistlib->addWhere('s.student_uid', $student_uid);
|
||||
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -689,6 +725,8 @@ class Students extends FHCAPI_Controller
|
||||
'person_id' => $person_id,
|
||||
));
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
if (!$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
@@ -699,13 +737,13 @@ class Students extends FHCAPI_Controller
|
||||
|
||||
$this->studentlistlib->addWhere('p.person_id', $person_id);
|
||||
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -721,6 +759,8 @@ class Students extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
));
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->load->library('SearchLib', [ 'config' => 'searchstv' ]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -755,6 +795,7 @@ class Students extends FHCAPI_Controller
|
||||
END
|
||||
) AS semester", false);
|
||||
|
||||
$this->studentlistlib->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
if ($prestudent_ids && $student_uids) {
|
||||
$this->studentlistlib->addWhere('tbl_prestudent.prestudent_id', $prestudent_ids);
|
||||
@@ -773,7 +814,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -802,4 +843,55 @@ class Students extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getStudiengangKz($studiengang_typ_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'LOWER(CONCAT(typ, kurzbz)) =' => strtolower($studiengang_typ_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return null;
|
||||
|
||||
return current($data)->studiengang_kz;
|
||||
}
|
||||
|
||||
protected function getStudiensemesterKurzbz($studiensemester_kurzbz)
|
||||
{
|
||||
if ($studiensemester_kurzbz === null)
|
||||
return null;
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$result = $this->StudiensemesterModel->loadWhere([
|
||||
'LOWER(studiensemester_kurzbz) =' => strtolower($studiensemester_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return $studiensemester_kurzbz;
|
||||
|
||||
return current($data)->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
protected function getOrgformKurzbz($orgform_kurzbz)
|
||||
{
|
||||
if ($orgform_kurzbz === null)
|
||||
return null;
|
||||
|
||||
$this->load->model('codex/Orgform_model', 'OrgformModel');
|
||||
$result = $this->OrgformModel->loadWhere([
|
||||
'LOWER(orgform_kurzbz) =' => strtolower($orgform_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return $orgform_kurzbz;
|
||||
|
||||
return current($data)->orgform_kurzbz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ class Tags extends Tag_Controller
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
]);
|
||||
|
||||
$this->config->load('stv');
|
||||
@@ -45,4 +47,5 @@ class Tags extends Tag_Controller
|
||||
{
|
||||
parent::doneTag($this->config->item('stv_prestudent_tags'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,513 +0,0 @@
|
||||
<?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 verbände
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Verband extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
// Load Models
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remap calls:
|
||||
* /
|
||||
* /(studiengang_kz) => getStudiengang
|
||||
* /(studiengang_kz)/(semester) => getSemester
|
||||
* /(studiengang_kz)/(semester)/(verband) => getVerband
|
||||
* /(studiengang_kz)/(org_form) => getStudiengang
|
||||
* /(studiengang_kz)/(org_form)/(semester) => getSemester
|
||||
* /(studiengang_kz)/(org_form)/(semester)/(verband) => getVerband
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $params (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if ($method == '' || $method == 'index')
|
||||
return $this->getBase();
|
||||
|
||||
// NOTE(chris): Test if access is allowed ($method is the Studiengang)
|
||||
if (!$this->permissionlib->isBerechtigt('assistenz', 's', $method)
|
||||
&& !$this->permissionlib->isBerechtigt('admin', 's', $method)
|
||||
) {
|
||||
return $this->_outputAuthError([$method => ['admin:r', 'assistenz:r']]);
|
||||
}
|
||||
|
||||
$count = count($params);
|
||||
if (!$count)
|
||||
return $this->getStudiengang($method);
|
||||
|
||||
if ($count == 1) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getSemester($method, $params[0]);
|
||||
elseif ($params[0] == 'prestudent')
|
||||
return $this->terminateWithSuccess($this->getStdSem($method . '/prestudent/', $method));
|
||||
else
|
||||
return $this->getStudiengang($method, $params[0]);
|
||||
}
|
||||
if ($count == 2) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getVerband($method, $params[0], $params[1]);
|
||||
elseif ($params[1] == 'prestudent')
|
||||
return $this->terminateWithSuccess($this->getStdSem($method . '/' . $params[0] . '/prestudent/', $method));
|
||||
else
|
||||
return $this->getSemester($method, $params[1], $params[0]);
|
||||
}
|
||||
if ($count == 3 && !is_numeric($params[0]) && is_numeric($params[1]) && !is_numeric($params[2]))
|
||||
return $this->getVerband($method, $params[1], $params[2], $params[0]);
|
||||
|
||||
show_404();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
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);
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('inout/uebersicht'))
|
||||
$list[] = [
|
||||
'name' => 'International',
|
||||
'link' => 'inout',
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'link' => 'inout/incoming',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Outgoing',
|
||||
'link' => 'inout/outgoing',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Gemeinsame Studien',
|
||||
'link' => 'inout/gemeinsamestudien',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param string $orgform (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getStudiengang($studiengang_kz, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
|
||||
$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('semester');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('semester');
|
||||
|
||||
if ($org_form !== null) {
|
||||
$this->StudiengangModel->addSelect("v.orgform_kurzbz");
|
||||
$this->StudiengangModel->db->group_start();
|
||||
$this->StudiengangModel->db->where('v.semester', 0);
|
||||
$this->StudiengangModel->db->or_where('v.orgform_kurzbz', $org_form);
|
||||
$this->StudiengangModel->db->group_end();
|
||||
}
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.aktiv' => true
|
||||
]);
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
array_unshift($list, [
|
||||
'name' => 'PreStudent',
|
||||
'link' => $link . 'prestudent',
|
||||
'no_sem_reload' => true,
|
||||
'stg_kz' => (int)$studiengang_kz,
|
||||
'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz)
|
||||
]);
|
||||
|
||||
if ($org_form === null) {
|
||||
// NOTE(chris): if mischform show orgforms
|
||||
$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("studiengang_kz AS stg_kz");
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester
|
||||
* @param string $orgform
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getSemester($studiengang_kz, $semester, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/';
|
||||
|
||||
|
||||
$this->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
|
||||
$this->GruppeModel->addDistinct();
|
||||
$this->GruppeModel->addSelect("CONCAT(" . $this->GruppeModel->escape($link . 'grp/') . ", gruppe_kurzbz) AS link", false);
|
||||
$this->GruppeModel->addSelect("CONCAT(gruppe_kurzbz, ' (', bezeichnung, ')') AS name", false);
|
||||
$this->GruppeModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->GruppeModel->addSelect('sort');
|
||||
$this->GruppeModel->addSelect('gruppe_kurzbz');
|
||||
$this->GruppeModel->addSelect($this->GruppeModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->GruppeModel->addOrder('sort');
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
|
||||
$where = [
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'semester' => $semester,
|
||||
'lehre' => true,
|
||||
'sichtbar' => true,
|
||||
'aktiv' => true,
|
||||
'direktinskription' => false
|
||||
];
|
||||
|
||||
if ($org_form !== null)
|
||||
$where['orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->GruppeModel->loadWhere($where);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", verband) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, (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 AND verband=v.verband ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("CASE WHEN MAX(gruppe)='' OR MAX(gruppe)=' ' THEN TRUE ELSE FALSE END AS leaf");
|
||||
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($semester) . ' AS semester');
|
||||
$this->StudiengangModel->addSelect('verband');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('verband');
|
||||
|
||||
$this->StudiengangModel->addGroupBy('link, name, verband');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$list = array_merge($list, $result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester
|
||||
* @param integer $verband
|
||||
* @param string $orgform
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getVerband($studiengang_kz, $semester, $verband, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/'. $verband . '/';
|
||||
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", gruppe) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, gruppe, (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 AND verband=v.verband AND gruppe=v.gruppe ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('v.semester');
|
||||
$this->StudiengangModel->addSelect('v.verband');
|
||||
$this->StudiengangModel->addSelect('gruppe');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('gruppe');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband' => $verband,
|
||||
'v.gruppe !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $link
|
||||
* @param integer $studiengang_kz
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getStdSem($link, $studiengang_kz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['number_displayed_past_studiensemester']);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->load->config('stv');
|
||||
$number_displayed_past_studiensemester_default = $this->config->item('number_displayed_past_studiensemester_default');
|
||||
|
||||
$number_displayed_past_studiensemester = $data['number_displayed_past_studiensemester'] ?? $number_displayed_past_studiensemester_default;
|
||||
|
||||
$this->StudiensemesterModel->addPlusMinus(null, $number_displayed_past_studiensemester);
|
||||
$this->StudiensemesterModel->addOrder('ende');
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
|
||||
$studiensemester = $this->getDataOrTerminateWithError($result);
|
||||
$result = [];
|
||||
|
||||
$studiengang_kz = (int)$studiengang_kz;
|
||||
|
||||
foreach ($studiensemester as $sem) {
|
||||
$semlink = $link . $sem->studiensemester_kurzbz;
|
||||
$intlink = $semlink . '/interessenten';
|
||||
$result[] = [
|
||||
'name' => $sem->studiensemester_kurzbz,
|
||||
'link' => $semlink,
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Interessenten',
|
||||
'link' => $intlink,
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Bewerbung nicht abgeschickt',
|
||||
'link' => $intlink . '/bewerbungnichtabgeschickt',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Bewerbung abgeschickt, Status unbestätigt',
|
||||
'link' => $intlink . '/bewerbungabgeschickt',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'ZGV erfüllt',
|
||||
'link' => $intlink . '/zgv',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Status bestätigt',
|
||||
'link' => $intlink . '/statusbestaetigt',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/statusbestaetigtrtnichtangemeldet',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/statusbestaetigtrtangemeldet',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/reihungstestnichtangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/reihungstestangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Bewerber',
|
||||
'link' => $semlink . '/bewerber',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/bewerberrtnichtangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/bewerberrtangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Teilgenommen',
|
||||
'link' => $intlink . '/bewerberrtangemeldetteilgenommen',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Nicht teilgenommen',
|
||||
'link' => $intlink . '/bewerberrtangemeldetnichtteilgenommen',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Aufgenommen',
|
||||
'link' => $semlink . '/aufgenommen',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Warteliste',
|
||||
'link' => $semlink . '/warteliste',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Absage',
|
||||
'link' => $semlink . '/absage',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'link' => $semlink . '/incoming',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ class Tag extends API_Controller
|
||||
|
||||
if (isset($tag))
|
||||
{
|
||||
$this->TagModel->addJoin('public.tbl_notiz_typ', 'typ_kurzbz', 'typ_kurzbz');
|
||||
$result = $this->TagModel->load($tag);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
|
||||
@@ -13,12 +13,13 @@ class Mylv extends Auth_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'Student' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Studiensemester' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Lvs' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Info' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Pruefungen' => ['student/anrechnung_beantragen:r','user:r'] // TODO(chris): permissions?
|
||||
'Student' => self::PERM_LOGGED,
|
||||
'Studiensemester' => self::PERM_LOGGED,
|
||||
'Lvs' => self::PERM_LOGGED,
|
||||
'Info' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -44,13 +45,27 @@ class Mylv extends Auth_Controller
|
||||
public function Studiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->StudiensemesterModel->getWhereStudentHasLvs(getAuthUID());
|
||||
$isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID())) ?? false;
|
||||
if($isMitarbeiter) {
|
||||
$result = $this->StudiensemesterModel->getWhereMitarbeiterHasLvs(getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else if(getData($this->StudentModel->isStudent(getAuthUID())) ?? false) { // $isStudent
|
||||
$result = $this->StudiensemesterModel->getWhereStudentHasLvs(getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else {
|
||||
$this->outputJsonError('neither student or mitarbeiter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,13 +73,27 @@ class Mylv extends Auth_Controller
|
||||
public function Lvs($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
$isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID())) ?? false;
|
||||
if($isMitarbeiter) {
|
||||
$result = $this->LehrveranstaltungModel->getLvsByMitarbeiterInSemester(getAuthUID(), $studiensemester_kurzbz);
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else if(getData($this->StudentModel->isStudent(getAuthUID())) ?? false) { // $isStudent
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else {
|
||||
$this->outputJsonError('neither student or mitarbeiter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studiensemester extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'now' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addOrder('start');
|
||||
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function now()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
}
|
||||
$result = getData($result) ?: [];
|
||||
|
||||
if (count($result) != 1) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJsonError(count($result) ? 'Mehrere Studiensemester aktiv' : 'Kein Studiensemester aktiv');
|
||||
} else {
|
||||
$this->outputJsonSuccess(current($result)->studiensemester_kurzbz);
|
||||
}
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
|
||||
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$stdsem = $this->input->post('studiensemester');
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'semester_aktuell', $stdsem);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(true);
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class AntragJob extends JOB_Controller
|
||||
$stgLeitungen[$leitung->uid]['stgs'][] = $antrag->studiengang_kz;
|
||||
}
|
||||
|
||||
$result = $this->StudierendenantragModel->getStgAndSem($antrag->studierendenantrag_id);
|
||||
$result = $this->StudierendenantragModel->getStgAndDetails($antrag->studierendenantrag_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
|
||||
@@ -803,7 +803,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
{
|
||||
if (!isset($studiensemester) || isEmptyString($studiensemester))
|
||||
{
|
||||
$this->logError("Studiensemster not passed as parameter");
|
||||
$this->logError("Studiensemester not passed as parameter");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class TagJob extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Configs
|
||||
$this->load->config('stv');
|
||||
|
||||
// Library
|
||||
$this->load->library('TagLib');
|
||||
|
||||
// Load Models
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function rebuildAutomatedTags()
|
||||
{
|
||||
$automatedTagsRes = $this->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
|
||||
|
||||
$result = $this->StudiensemesterModel->getAktOrNextSemester();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logInfo('Start Job rebuild Automated Tags');
|
||||
$this->logError('Error occurred during retrieving studiensemester');
|
||||
return $this->logInfo('End Job rebuild Automated Tags');
|
||||
}
|
||||
|
||||
if (empty($result->retval) || !isset($result->retval[0])) {
|
||||
$this->logInfo('Start Job rebuild Automated Tags');
|
||||
$this->logError('No Studiensemester found');
|
||||
return $this->logInfo('End Job rebuild Automated Tags');
|
||||
}
|
||||
$studiensemester_kurzbz = $result->retval[0]->studiensemester_kurzbz ?? null;
|
||||
$params = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
);
|
||||
|
||||
$this->logInfo('Start Job rebuild Automated Tags ' . $studiensemester_kurzbz);
|
||||
foreach($automatedTags as $autoTag)
|
||||
{
|
||||
// getPath: must not be lost
|
||||
$filePath = APPPATH . 'libraries/' . $autoTag->taglib . '.php'; // APPPATH = application/
|
||||
|
||||
if(file_exists($filePath)) {
|
||||
require_once($filePath);
|
||||
} else {
|
||||
$this->logInfo("File not found: " . $filePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
$kurz_bz = $autoTag->typ_kurzbz;
|
||||
// className without PATH (basename)
|
||||
$className = basename($autoTag->taglib);
|
||||
|
||||
$obj = new $className();
|
||||
|
||||
$outputArray = $obj->getZuordnungIds($params);
|
||||
$typeId = $outputArray->typeId;
|
||||
|
||||
$paramsTag = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'kurzbz' => $kurz_bz,
|
||||
'data' => $outputArray->data,
|
||||
'typeId' => $typeId
|
||||
);
|
||||
|
||||
$result = $this->taglib->updateAutomatedTags($paramsTag);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->logError('Error occurred during updateAutomatedTags ' . $kurz_bz);
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = is_array($result) ? $result['retval'] : $result->retval;
|
||||
|
||||
//SUMMARY
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . " | type_id " . $typeId . " --"
|
||||
. " Count Recycled: " . $result->retval['summary']['recycled']
|
||||
. " Count Added: ". $result->retval['summary']['added']
|
||||
. " Count Deleted: ". $result->retval['summary']['deleted']);
|
||||
|
||||
//DETAILS
|
||||
if($result->retval['results']['newTags'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "New tag(s): " . implode(', ', $result->retval['results']['newTags']));
|
||||
if($result->retval['results']['deletedTagsIds'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "Deleted tags(s: " . implode(', ', $result->retval['results']['deletedTagsIds']));
|
||||
if ($result->retval['results']['retaggedIds'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "Recycled tag(s): " . implode(', ', $result->retval['results']['retaggedIds']));
|
||||
}
|
||||
$this->logInfo( "End Job rebuild Automated Tags");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller generates javascript from snippets for tabulator columns
|
||||
*/
|
||||
class Tabulatorcolumns extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'stv' => ['admin:r', 'assistenz:r'],
|
||||
'lvverwaltung' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render tabulator columns for config
|
||||
*
|
||||
* @param string $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($config)
|
||||
{
|
||||
$this->load->config($config);
|
||||
$list_columns = $this->config->item('list_columns') ?: [];
|
||||
|
||||
$snippets = [
|
||||
'jssnippets/tabulatorcolumns/' . $config . '.js'
|
||||
];
|
||||
|
||||
foreach ($list_columns as $col) {
|
||||
$snippets[] = $col['js'];
|
||||
}
|
||||
|
||||
$this->output->set_content_type('application/javascript');
|
||||
|
||||
$this->load->view('jssnippets/tabulatorcolumns.js', [
|
||||
'snippets' => $snippets
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -215,8 +215,11 @@ class Pruefungsprotokoll extends Auth_Controller
|
||||
if (hasData($abschlusspruefung))
|
||||
{
|
||||
$abschlusspruefung_data = getData($abschlusspruefung);
|
||||
if ($this->permissionlib->isBerechtigt('admin') ||
|
||||
(isset($abschlusspruefung_data->studiengang_kz) && $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz))
|
||||
if ($this->permissionlib->isBerechtigt('admin')
|
||||
|| (
|
||||
isset($abschlusspruefung_data->studiengang_kz)
|
||||
&& $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz)
|
||||
)
|
||||
|| $this->_uid === $abschlusspruefung_data->uid_vorsitz)
|
||||
$result = $abschlusspruefung;
|
||||
else
|
||||
|
||||
@@ -25,7 +25,8 @@ class Studierendenantrag extends FHC_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
'studierendenantrag',
|
||||
'ui'
|
||||
]);
|
||||
|
||||
$this->load->config('studierendenantrag');
|
||||
|
||||
@@ -198,7 +198,19 @@ class Gradelist extends Auth_Controller
|
||||
if (!isset($row_noten->found))
|
||||
{
|
||||
$result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id);
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
|
||||
$studiengang_kz = null;
|
||||
|
||||
if (!empty($result_lv->retval) && isset($result_lv->retval[0]) && isset($result_lv->retval[0]->studiengang_kz))
|
||||
{
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
|
||||
if (!empty($result_stg->retval) && isset($result_stg->retval[0]) && is_object($result_stg->retval[0]) && isset($result_stg->retval[0]->kurzbzlang))
|
||||
{
|
||||
$studiengang_kz = $result_stg->retval[0]->kurzbzlang;
|
||||
}
|
||||
}
|
||||
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
|
||||
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
|
||||
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
|
||||
@@ -212,8 +224,8 @@ class Gradelist extends Auth_Controller
|
||||
'semester' => $result_lv->retval[0]->semester,
|
||||
'note' => $row_noten->note,
|
||||
'datum' => $row_noten->benotungsdatum,
|
||||
'zugeordnet' => true,
|
||||
'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang
|
||||
'studiengang_kurzbz' => $studiengang_kz,
|
||||
'zugeordnet' => true
|
||||
);
|
||||
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl']))
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0;
|
||||
|
||||
@@ -34,6 +34,9 @@ class InfoCenter extends Auth_Controller
|
||||
const PREV_FILTER_ID = 'prev_filter_id';
|
||||
const KEEP_TABLESORTER_FILTER = 'keepTsFilter';
|
||||
|
||||
const ONBOARDING_INSERTVON = 'onboarding';
|
||||
const ONBOARDING_KENNZEICHENTYP = 'eobRegistrierungsId';
|
||||
|
||||
private $_uid; // contains the UID of the logged user
|
||||
|
||||
// Used to log with PersonLogLib
|
||||
@@ -175,6 +178,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Geschlecht_model', 'GeschlechtModel');
|
||||
$this->load->model('person/adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Kennzeichen_model', 'KennzeichenModel');
|
||||
|
||||
// Loads libraries
|
||||
$this->load->library('PersonLogLib');
|
||||
@@ -1452,6 +1456,100 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$this->outputJsonSuccess("Done!");
|
||||
}
|
||||
|
||||
public function getAbsageData()
|
||||
{
|
||||
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
|
||||
|
||||
if (!is_null($stg_typ))
|
||||
{
|
||||
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
|
||||
|
||||
$data = array (
|
||||
'statusgruende' => $statusgruende,
|
||||
'studiengaenge' => $studiengaenge->retval
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->outputJsonSuccess(null);
|
||||
}
|
||||
|
||||
public function getStudienArtBerechtigung($typ = null)
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
|
||||
return getData($stg_typ);
|
||||
}
|
||||
|
||||
public function getStudienartData()
|
||||
{
|
||||
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
|
||||
}
|
||||
|
||||
public function saveAbsageForAll()
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$studiengang = $this->input->post('studiengang');
|
||||
$abgeschickt = $this->input->post('abgeschickt');
|
||||
$personen = $this->input->post('personen');
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
if ($studiengang === 'all' && $abgeschickt === 'all')
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
|
||||
|
||||
if (!hasData($prestudenten))
|
||||
continue;
|
||||
|
||||
$prestudentenData = getData($prestudenten);
|
||||
|
||||
foreach ($prestudentenData as $prestudent)
|
||||
{
|
||||
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$this->StudienplanModel->addSelect('1');
|
||||
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
|
||||
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
|
||||
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
|
||||
$this->StudienplanModel->addLimit(1);
|
||||
$studiengangResult = $this->StudienplanModel->load();
|
||||
|
||||
if (hasData($studiengangResult))
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
|
||||
|
||||
if (!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
|
||||
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -1946,6 +2044,17 @@ class InfoCenter extends Auth_Controller
|
||||
show_error(getError($user_person));
|
||||
}
|
||||
|
||||
// add info about first electronig onboarding login
|
||||
$this->KennzeichenModel->addSelect('insertamum');
|
||||
$onboarding_first_login = $this->KennzeichenModel->loadWhere(
|
||||
array('person_id' => $person_id, 'kennzeichentyp_kurzbz' => self::ONBOARDING_KENNZEICHENTYP)
|
||||
);
|
||||
|
||||
if (isError($onboarding_first_login))
|
||||
{
|
||||
show_error(getError($onboarding_first_login));
|
||||
}
|
||||
|
||||
$data = array (
|
||||
'lockedby' => $lockedby,
|
||||
'lockedbyother' => $lockedbyother,
|
||||
@@ -1955,7 +2064,9 @@ class InfoCenter extends Auth_Controller
|
||||
'messages' => $messages->retval,
|
||||
'logs' => $logs,
|
||||
'notizen' => $notizen->retval,
|
||||
'notizenbewerbung' => $notizen_bewerbung->retval
|
||||
'notizenbewerbung' => $notizen_bewerbung->retval,
|
||||
'created_by_onboarding' => $stammdaten->retval->insertvon == self::ONBOARDING_INSERTVON,
|
||||
'onboarding_first_login' => hasData($onboarding_first_login) ? getData($onboarding_first_login)[0]->insertamum : null
|
||||
);
|
||||
|
||||
return $data;
|
||||
@@ -2375,97 +2486,4 @@ class InfoCenter extends Auth_Controller
|
||||
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
|
||||
}
|
||||
}
|
||||
|
||||
public function getAbsageData()
|
||||
{
|
||||
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
|
||||
|
||||
if (!is_null($stg_typ))
|
||||
{
|
||||
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
|
||||
|
||||
$data = array (
|
||||
'statusgruende' => $statusgruende,
|
||||
'studiengaenge' => $studiengaenge->retval
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->outputJsonSuccess(null);
|
||||
}
|
||||
|
||||
public function getStudienArtBerechtigung($typ = null)
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
|
||||
return getData($stg_typ);
|
||||
}
|
||||
|
||||
public function getStudienartData()
|
||||
{
|
||||
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
|
||||
}
|
||||
|
||||
public function saveAbsageForAll()
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$studiengang = $this->input->post('studiengang');
|
||||
$abgeschickt = $this->input->post('abgeschickt');
|
||||
$personen = $this->input->post('personen');
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
if ($studiengang === 'all' && $abgeschickt === 'all')
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
|
||||
|
||||
if (!hasData($prestudenten))
|
||||
continue;
|
||||
|
||||
$prestudentenData = getData($prestudenten);
|
||||
|
||||
foreach ($prestudentenData as $prestudent)
|
||||
{
|
||||
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$this->StudienplanModel->addSelect('1');
|
||||
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
|
||||
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
|
||||
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
|
||||
$this->StudienplanModel->addLimit(1);
|
||||
$studiengangResult = $this->StudienplanModel->load();
|
||||
|
||||
if (hasData($studiengangResult))
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
|
||||
|
||||
if (!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
|
||||
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ class Rueckstellung extends Auth_Controller
|
||||
private $_ci; // Code igniter instance
|
||||
private $_uid;
|
||||
|
||||
const ZGV_UEBERPRUEFUNG_MAIL_VORLAGE = 'ZGVUEP';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
@@ -23,6 +25,7 @@ class Rueckstellung extends Auth_Controller
|
||||
$this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->library('PersonLogLib');
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
@@ -78,6 +81,8 @@ class Rueckstellung extends Auth_Controller
|
||||
|
||||
$this->_log($person_id, $status_kurzbz);
|
||||
|
||||
if ($status_kurzbz === 'onhold_zgv')
|
||||
$this->sendRueckstellungMessage($person_id);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
@@ -104,6 +109,10 @@ class Rueckstellung extends Auth_Controller
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
$this->_log($person, $status_kurzbz);
|
||||
|
||||
if ($status_kurzbz === 'onhold_zgv')
|
||||
$this->sendRueckstellungMessage($person);
|
||||
|
||||
}
|
||||
$this->outputJsonSuccess("Erfolgreich gespeichert!");
|
||||
}
|
||||
@@ -160,4 +169,26 @@ class Rueckstellung extends Auth_Controller
|
||||
$this->_uid
|
||||
);
|
||||
}
|
||||
|
||||
private function sendRueckstellungMessage($person_id)
|
||||
{
|
||||
$person = $this->_ci->PersonModel->load($person_id);
|
||||
|
||||
if (hasData($person))
|
||||
{
|
||||
$person = getData($person)[0];
|
||||
|
||||
return $this->messagelib->sendMessageUserTemplate(
|
||||
$person_id,
|
||||
self::ZGV_UEBERPRUEFUNG_MAIL_VORLAGE,
|
||||
array(
|
||||
'anrede' => $person->anrede,
|
||||
'nachname' => $person->nachname
|
||||
),
|
||||
null,
|
||||
getAuthPersonId(),
|
||||
'infocenter'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
const BERECHTIGUNG_KURZBZ = 'admin:rw';
|
||||
const BERECHTIGUNG_KURZBZ = ['admin:rw'];
|
||||
|
||||
public function __construct($permissions)
|
||||
{
|
||||
@@ -15,10 +15,11 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
'getTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
];
|
||||
|
||||
$merged_permissions = array_merge($default_permissions, $permissions);
|
||||
@@ -26,6 +27,10 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
parent::__construct($merged_permissions);
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
// Library
|
||||
$this->load->library('TagLib');
|
||||
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
@@ -38,6 +43,8 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
public function getTag($readonly_tags = null)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$index_bezeichnung_mehrsprachig = $language - 1;
|
||||
|
||||
$id = $this->input->get('id');
|
||||
|
||||
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
|
||||
@@ -62,14 +69,18 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $index_bezeichnung_mehrsprachig . " as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz_typ.prioritaet,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter,
|
||||
tbl_notiz.start,
|
||||
tbl_notiz.ende
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
@@ -82,18 +93,24 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
|
||||
$notiz = $this->NotizModel->loadWhere(array('notiz_id' => $id));
|
||||
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz)[0] : array());
|
||||
}
|
||||
|
||||
public function getTags($tags = null)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$index_bezeichnung_mehrsprachig = $language - 1;
|
||||
|
||||
$this->NotiztypModel->addSelect(
|
||||
'typ_kurzbz as tag_typ_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
|
||||
"typ_kurzbz as tag_typ_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $index_bezeichnung_mehrsprachig . " as bezeichnung,
|
||||
style,
|
||||
beschreibung,
|
||||
tag
|
||||
'
|
||||
tag,
|
||||
automatisiert,
|
||||
prioritaet
|
||||
"
|
||||
);
|
||||
$this->NotiztypModel->addOrder('prioritaet');
|
||||
|
||||
@@ -271,6 +288,90 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($deleteNotiz);
|
||||
}
|
||||
|
||||
public function getAllTags($readonly_tags = false)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$index_bezeichnung_mehrsprachig = $language - 1;
|
||||
$prestudent_id = $this->input->get('prestudent_id');
|
||||
|
||||
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
|
||||
{
|
||||
$readonly_tags = $this->_filterTag($readonly_tags, true);
|
||||
|
||||
foreach ($readonly_tags as $key => $tag)
|
||||
{
|
||||
$readonly_tags[$key] = $this->NotizModel->db->escape($tag);
|
||||
}
|
||||
$tags = '(' . implode(',', $readonly_tags) . ')';
|
||||
|
||||
$this->NotizModel->addSelect("
|
||||
CASE
|
||||
WHEN tbl_notiz_typ.typ_kurzbz IN $tags
|
||||
THEN TRUE
|
||||
ELSE FALSE
|
||||
END as readonly
|
||||
");
|
||||
}
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $index_bezeichnung_mehrsprachig . " as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz_typ.prioritaet,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter,
|
||||
tbl_notiz.start,
|
||||
tbl_notiz.ende
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer verfasserbenutzer', 'tbl_notiz.verfasser_uid = verfasserbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person verfasserperson', 'verfasserbenutzer.person_id = verfasserperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer bearbeiterbenutzer', 'tbl_notiz.bearbeiter_uid = bearbeiterbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person bearbeiterperson', 'bearbeiterbenutzer.person_id = bearbeiterperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notizzuordnung notizzuordnung', 'tbl_notiz.notiz_id = notizzuordnung.notiz_id');
|
||||
|
||||
$this->NotizModel->addOrder('done');
|
||||
$this->NotizModel->addOrder('tbl_notiz_typ.prioritaet');
|
||||
$notiz = $this->NotizModel->loadWhere(array('prestudent_id' => $prestudent_id));
|
||||
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz) : array());
|
||||
}
|
||||
|
||||
public function rebuildTagsForTypeId()
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
$typeId = $this->input->post('typeId');
|
||||
$semester = $this->input->post('sem');
|
||||
|
||||
$idsSuccess = [];
|
||||
$idsError = [];
|
||||
$outputResult = [];
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$result = $this->taglib->rebuildTagsForTypeId($typeId, $id, $semester);
|
||||
|
||||
if (isError($result))
|
||||
$idsError[] = $id;
|
||||
else
|
||||
$idsSuccess[] = $id;
|
||||
|
||||
$outputResult[] = $result;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([$outputResult, $idsSuccess, $idsError]);
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
@@ -311,4 +412,4 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
function gradesDocumentsList()
|
||||
{
|
||||
$ci =& get_instance();
|
||||
$ci->load->library('PhrasesLib', array('stv'), 'p');
|
||||
|
||||
$permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
|
||||
|
||||
$title_ger = $ci->p->t("global", "deutsch");
|
||||
$title_eng = $ci->p->t("global", "englisch");
|
||||
$title_ff = $ci->p->t("stv", "document_certificate");
|
||||
$title_lv = $ci->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 = $ci->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="' . $ci->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="' . $ci->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;
|
||||
}
|
||||
@@ -82,6 +82,21 @@ function generateCSSsInclude($CSSs)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the style sheets you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
function generatePrintCSS($path)
|
||||
{
|
||||
$cssLink = '<link rel="stylesheet" media="print" href="%s" />';
|
||||
|
||||
$ci =& get_instance();
|
||||
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
|
||||
|
||||
if (isset($path)) {
|
||||
echo sprintf($cssLink, base_url($path).$cachetoken) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates global JS-Object to pass parms to other javascripts
|
||||
*/
|
||||
@@ -111,7 +126,8 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
'theme' => [
|
||||
'name'=>$ci->config->item('theme_name'),
|
||||
'modes'=>$ci->config->item('theme_modes'),
|
||||
]
|
||||
],
|
||||
'domain' => DOMAIN
|
||||
);
|
||||
|
||||
$toPrint = "\n";
|
||||
@@ -270,6 +286,28 @@ function absoluteJsImportUrl($relurl)
|
||||
return $url;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate Css File Include if Extension contains file
|
||||
*
|
||||
* @param $relativeFilePath path relative to Extension public/css dir
|
||||
*/
|
||||
function generateCSSsIncludeIfExtensionCssExists($relativeFilePath)
|
||||
{
|
||||
$fsiterator = new FilesystemIterator(FHCPATH . 'application/extensions');
|
||||
foreach ($fsiterator as $fsitem)
|
||||
{
|
||||
if(preg_match('/^FHC-Core-/', $fsitem->getBasename()))
|
||||
{
|
||||
$extensionfile = 'public/extensions/' . $fsitem->getBasename()
|
||||
. '/css/' . $relativeFilePath;
|
||||
if(is_readable(FHCPATH . $extensionfile))
|
||||
{
|
||||
generateCSSsInclude($extensionfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Manipulate CI views includes Array to load
|
||||
* - public/js/FhcApps.js via customJSs and
|
||||
|
||||
@@ -741,7 +741,7 @@ class AnrechnungLib
|
||||
$fullname = hasData($result) ? $result->retval[0]->vorname. $result->retval[0]->nachname : '';
|
||||
|
||||
// Return filename
|
||||
return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname;
|
||||
return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname . '.pdf';
|
||||
}
|
||||
|
||||
public function LVhasLector($anrechnung_id)
|
||||
|
||||
@@ -4,6 +4,7 @@ if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use \DateInterval as DateInterval;
|
||||
use \DOMDocument as DOMDocument;
|
||||
use \XSLTProcessor as XSLTProcessor;
|
||||
|
||||
@@ -141,63 +142,6 @@ class CmsLib
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stdClass $stg_obj
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
protected function getNewsExtras($stg_obj, $semester)
|
||||
{
|
||||
$this->ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
$stg_ltg = $this->ci->StudiengangModel->getLeitungDetailed($stg_obj->studiengang_kz);
|
||||
if (isError($stg_ltg))
|
||||
return $stg_ltg;
|
||||
$stg_ltg = getData($stg_ltg) ?: [];
|
||||
|
||||
$gf_ltg = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('gLtg', $stg_obj->oe_kurzbz);
|
||||
if (isError($gf_ltg))
|
||||
return $gf_ltg;
|
||||
$gf_ltg = getData($gf_ltg) ?: [];
|
||||
|
||||
$stv_ltg = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('stvLtg', $stg_obj->oe_kurzbz);
|
||||
if (isError($stv_ltg))
|
||||
return $stv_ltg;
|
||||
$stv_ltg = getData($stv_ltg) ?: [];
|
||||
|
||||
$ass = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('ass', $stg_obj->oe_kurzbz);
|
||||
if (isError($ass))
|
||||
return $ass;
|
||||
$ass = getData($ass) ?: [];
|
||||
|
||||
$hochschulvertr = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('hsv');
|
||||
if (isError($hochschulvertr))
|
||||
return $hochschulvertr;
|
||||
$hochschulvertr = getData($hochschulvertr) ?: [];
|
||||
|
||||
$stdv = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('stdv', $stg_obj->oe_kurzbz);
|
||||
if (isError($stdv))
|
||||
return $stdv;
|
||||
$stdv = getData($stdv) ?: [];
|
||||
|
||||
$jahrgangsvertr = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('jgv', $stg_obj->oe_kurzbz, $semester);
|
||||
if (isError($jahrgangsvertr))
|
||||
return $jahrgangsvertr;
|
||||
$jahrgangsvertr = getData($jahrgangsvertr) ?: [];
|
||||
|
||||
return success($this->ci->load->view('Cis/Cms/News/Xml/NewsExtras', [
|
||||
'studiengang' => $stg_obj,
|
||||
'semester' => $semester,
|
||||
'stg_ltg' => $stg_ltg,
|
||||
'gf_ltg' => $gf_ltg,
|
||||
'stv_ltg' => $stv_ltg,
|
||||
'ass' => $ass,
|
||||
'hochschulvertr' => $hochschulvertr,
|
||||
'stdv' => $stdv,
|
||||
'jahrgangsvertr' => $jahrgangsvertr
|
||||
], true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $studiengang_kz
|
||||
* @param string $semester
|
||||
@@ -233,64 +177,102 @@ class CmsLib
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true, $page = 1, $page_size = 10, $sprache)
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true, $page = 1, $page_size = 10, $sprache, $filterForDegreePrograms = false, $allowedDegreePrograms = [], $active = true)
|
||||
|
||||
{
|
||||
$this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
list($studiengang_kz, $semester) = $this->getStgAndSem($studiengang_kz, $semester);
|
||||
$all = $edit;
|
||||
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8"?><content>';
|
||||
|
||||
$this->ci->load->model('content/News_model', 'NewsModel');
|
||||
$news = $this->ci->NewsModel->getNewsWithContent($sprache, $studiengang_kz, $semester, null, $sichtbar, 0, $page, $page_size, $all, $mischen);
|
||||
|
||||
if (isError($news))
|
||||
return $news;
|
||||
|
||||
$news = getData($news);
|
||||
|
||||
|
||||
$news = $this->ci->NewsModel->getNewsWithContent($sprache, $studiengang_kz, $semester, null, $sichtbar, $page, $page_size, $active, $mischen, $filterForDegreePrograms, $allowedDegreePrograms);
|
||||
$news = getData($news) ?? [];
|
||||
$newsWrappers = [];
|
||||
|
||||
foreach ($news as $newsobj) {
|
||||
if ($studiengang_kz && $edit && !$newsobj->studiengang_kz)
|
||||
continue;
|
||||
$date = new DateTime($newsobj->datum);
|
||||
$datum = '<datum><![CDATA[' . $date->format('d.m.Y') . ']]></datum>';
|
||||
$datum .= '<datumdetail><![CDATA[' . $date->format('Y-m-d H:i') . ']]></datumdetail>';
|
||||
$id = $edit ? '<news_id><![CDATA[' . $newsobj->news_id . ']]></news_id>' : '';
|
||||
$xml .= "<newswrapper>" . $newsobj->content . $datum . $id . "</newswrapper>";
|
||||
|
||||
$newsWrappers[] = $this->createNewsWrapper($newsobj, $edit);
|
||||
}
|
||||
|
||||
/* if ($studiengang_kz != 0) {
|
||||
$stg_obj = $this->ci->StudiengangModel->load($studiengang_kz);
|
||||
if (isError($stg_obj))
|
||||
return $stg_obj;
|
||||
$stg_obj = current(getData($stg_obj) ?: []);
|
||||
$content = $this->createNewsContent($newsWrappers, $infoscreen, $titel);
|
||||
if (isError($content))
|
||||
return $content;
|
||||
|
||||
if ($stg_obj) {
|
||||
if (!$edit && !$infoscreen) {
|
||||
$extras = $this->getNewsExtras($stg_obj, $semester);
|
||||
if (isError($extras))
|
||||
return $extras;
|
||||
$xml .= getData($extras);
|
||||
}
|
||||
$xml .= '<studiengang_bezeichnung><![CDATA[' . $stg_obj->bezeichnung . ']]></studiengang_bezeichnung>';
|
||||
}
|
||||
} */
|
||||
return success([
|
||||
"content" => getData($content),
|
||||
"row_count" => $news[0]->row_count ?? 0
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a newswrapper XML element from a news item.
|
||||
*
|
||||
* @param stdClass $newsobj
|
||||
* @param boolean $edit
|
||||
*
|
||||
* @return DOMElement
|
||||
*/
|
||||
public function createNewsWrapper($newsobj, $edit)
|
||||
{
|
||||
$id = $edit ? '<news_id><![CDATA[' . $newsobj->news_id . ']]></news_id>' : '';
|
||||
$isPublished = $edit ? '<is_published><![CDATA[' . ($newsobj->sichtbar ? 'true' : 'false') . ']]></is_published>' : '';
|
||||
|
||||
$date = new DateTime($newsobj->datum);
|
||||
$datum = '<datum><![CDATA[' . $date->format('d.m.Y') . ']]></datum>';
|
||||
$datum .= '<datumdetail><![CDATA[' . $date->format('Y-m-d H:i') . ']]></datumdetail>';
|
||||
|
||||
$hasVisibleToDate = isset($newsobj->datum_bis) && $newsobj->datum_bis !== '';
|
||||
$datumTo = $hasVisibleToDate
|
||||
? new DateTime($newsobj->datum_bis)
|
||||
: (clone $date)->add(new DateInterval('P' . MAXNEWSALTER . 'D'));
|
||||
if ($hasVisibleToDate)
|
||||
$datumTo->setTime(23, 59, 59);
|
||||
|
||||
$now = new DateTime();
|
||||
$isActive = '<is_active><![CDATA[' . ($datumTo >= $now ? 'true' : 'false') . ']]></is_active>';
|
||||
|
||||
$newsWrapper = new DOMDocument();
|
||||
$newsWrapper->loadXML('<newswrapper>' . $newsobj->content . $datum . $id . $isPublished . $isActive . '</newswrapper>');
|
||||
|
||||
return $newsWrapper->documentElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates rendered news content from one or more newswrapper XML elements.
|
||||
*
|
||||
* @param DOMElement|array $newsWrappers
|
||||
* @param boolean $infoscreen
|
||||
* @param string $titel
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function createNewsContent($newsWrappers, $infoscreen, $titel)
|
||||
{
|
||||
if (!is_array($newsWrappers))
|
||||
$newsWrappers = [$newsWrappers];
|
||||
|
||||
$XML = new DOMDocument('1.0', 'UTF-8');
|
||||
$contentElement = $XML->createElement('content');
|
||||
$XML->appendChild($contentElement);
|
||||
|
||||
foreach ($newsWrappers as $newsWrapper)
|
||||
$contentElement->appendChild($XML->importNode($newsWrapper, true));
|
||||
|
||||
if ($titel != '') {
|
||||
$xml .= '<news_titel>' . $titel . '</news_titel>';
|
||||
$titleElement = $XML->createElement('news_titel');
|
||||
$titleElement->appendChild($XML->createTextNode($titel));
|
||||
$contentElement->appendChild($titleElement);
|
||||
}
|
||||
|
||||
$xml .= '</content>';
|
||||
|
||||
//XSLT Vorlage laden
|
||||
$template = $this->ci->TemplateModel->load($infoscreen ? 'news_infoscreen' : 'news');
|
||||
if (isError($template))
|
||||
return $template;
|
||||
$template = current(getData($template));
|
||||
|
||||
$XML = new DOMDocument();
|
||||
$XML->loadXML($xml);
|
||||
|
||||
$xsltemplate = new DOMDocument();
|
||||
$xsltemplate->loadXML($template->xslt_xhtml_c4);
|
||||
|
||||
|
||||
@@ -17,7 +17,12 @@ class LektorLib
|
||||
$this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->_ci->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->_ci->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
|
||||
$this->_ci->load->library('PhrasesLib', array('lehre'));
|
||||
$this->_ci->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
public function addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid)
|
||||
@@ -78,10 +83,13 @@ class LektorLib
|
||||
|
||||
public function updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $new_data)
|
||||
{
|
||||
$old_uid = $mitarbeiter_uid;
|
||||
$new_uid = isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid;
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect('lehre.tbl_lehreinheitmitarbeiter.*, lehre.tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.studiengang_kz');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
$lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid));
|
||||
|
||||
if (isError($lehreinheit_result)) return $lehreinheit_result;
|
||||
|
||||
@@ -89,27 +97,47 @@ class LektorLib
|
||||
|
||||
$lehreinheit = getData($lehreinheit_result)[0];
|
||||
|
||||
$semesterstunden_alt = $lehreinheit->semesterstunden;
|
||||
$semesterstunden_neu = isset($new_data['semesterstunden']) ? $new_data['semesterstunden'] : $semesterstunden_alt;
|
||||
$bismelden_neu = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
|
||||
$neue_stunden_eingerechnet = (bool)$bismelden_neu;
|
||||
$alte_stunden_eingerechnet = (bool)$lehreinheit->bismelden;
|
||||
$stundenplan_update = false;
|
||||
|
||||
//TODO kollision check, wird vorerst nicht implementiert -> nur über das FAS möglich
|
||||
if (isset($new_data['mitarbeiter_uid']) && $new_data['mitarbeiter_uid'] !== $mitarbeiter_uid)
|
||||
if ($old_uid !== $new_uid)
|
||||
{
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
|
||||
if (hasData($verplant))
|
||||
return error($this->_ci->phraseslib->t("lehre", "lektorbereitsverplant"));
|
||||
|
||||
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_data['mitarbeiter_uid'], 'lehreinheit_id' => $lehreinheit_id));
|
||||
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_uid, 'lehreinheit_id' => $lehreinheit_id));
|
||||
|
||||
if (hasData($lehreinheit_data))
|
||||
return error($this->_ci->phraseslib->t("lehre", "bereitzugeteilt"));
|
||||
|
||||
$this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid));
|
||||
|
||||
if (hasData($verplant))
|
||||
{
|
||||
$kollision = $this->hasKollision(getData($verplant), $new_uid);
|
||||
|
||||
$ignore_kollision = $this->_ci->variablelib->getVar('ignore_kollision');
|
||||
|
||||
if ($kollision === false || $ignore_kollision == 'true')
|
||||
{
|
||||
$stundenplan_update = true;
|
||||
}
|
||||
else if (is_array($kollision))
|
||||
{
|
||||
return error( "Änderung fehlgeschlagen! Die Änderung des Lektors führt zu ".count($kollision)." Kollision(en) im LV-Plan. Deaktivieren Sie die Kollisionspruefung oder wenden Sie sich an die LV-Planung!\n zB. $kollision[0]");
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($kollision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$warning = '';
|
||||
if (isset($new_data['semesterstunden']))
|
||||
if (($semesterstunden_neu !== '' && $semesterstunden_alt !== '') && (($semesterstunden_neu > $semesterstunden_alt) || $neue_stunden_eingerechnet))
|
||||
{
|
||||
$studiengang_result = $this->_ci->StudiengangModel->loadWhere(array('studiengang_kz' => $lehreinheit->studiengang_kz));
|
||||
if (isError($studiengang_result)) return $studiengang_result;
|
||||
@@ -120,7 +148,7 @@ class LektorLib
|
||||
if (isError($studiensemester_result)) return $studiensemester_result;
|
||||
$studiensemester = getData($studiensemester_result)[0];
|
||||
|
||||
$echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
|
||||
$echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($new_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
|
||||
|
||||
$echter_dv = false;
|
||||
|
||||
@@ -129,83 +157,81 @@ class LektorLib
|
||||
$echter_dv = true;
|
||||
}
|
||||
|
||||
$neue_stunden_eingerechnet = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
|
||||
$alte_stunden_eingerechnet = $lehreinheit->bismelden;
|
||||
$stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
|
||||
if (isError($stundengrenze_result)) return $stundengrenze_result;
|
||||
|
||||
if (($new_data['semesterstunden'] > $lehreinheit->semesterstunden) || $neue_stunden_eingerechnet)
|
||||
$stundengrenze = getData($stundengrenze_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array();
|
||||
|
||||
$semesterstunden_alt_sql = is_null($semesterstunden_alt) ? 0 : $semesterstunden_alt;
|
||||
$semesterstunden_neu_sql = is_null($semesterstunden_neu) ? 0 : $semesterstunden_neu;
|
||||
|
||||
if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($semesterstunden_alt_sql) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($semesterstunden_neu_sql)}) as summe");
|
||||
else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($semesterstunden_alt_sql)) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($semesterstunden_neu_sql)})) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', $new_uid);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
|
||||
|
||||
if (count($oe_array) > 0)
|
||||
{
|
||||
$stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
|
||||
if (isError($stundengrenze_result)) return $stundengrenze_result;
|
||||
|
||||
$stundengrenze = getData($stundengrenze_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array('');
|
||||
|
||||
if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])}) as summe");
|
||||
else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden)) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])})) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', (isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid));
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_in('tbl_studiengang.oe_kurzbz', $oe_array);
|
||||
}
|
||||
|
||||
if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
|
||||
&& is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
|
||||
&& count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
|
||||
{
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
|
||||
}
|
||||
|
||||
if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
|
||||
&& is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
|
||||
&& count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
|
||||
$summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
|
||||
if (isError($summe_result)) return $summe_result;
|
||||
|
||||
if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
|
||||
|
||||
$summe = getData($summe_result)[0]->summe;
|
||||
|
||||
if ($summe > $stundengrenze->stunden)
|
||||
{
|
||||
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
|
||||
{
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
|
||||
if (!$this->LehrauftragAufFirma($new_uid))
|
||||
return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
|
||||
}
|
||||
|
||||
$summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
$stunden_limit_result = $this->getStundenInstitut($new_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
|
||||
|
||||
if (isError($summe_result)) return $summe_result;
|
||||
|
||||
if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
|
||||
|
||||
$summe = getData($summe_result)[0]->summe;
|
||||
|
||||
if ($summe > $stundengrenze->stunden)
|
||||
if (hasData($stunden_limit_result))
|
||||
{
|
||||
|
||||
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
|
||||
$stunden_limit_array = getData($stunden_limit_result);
|
||||
foreach ($stunden_limit_array as $stunden_limit)
|
||||
{
|
||||
if (!$this->LehrauftragAufFirma(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid))
|
||||
return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
|
||||
}
|
||||
|
||||
$stunden_limit_result = $this->getStundenInstitut($mitarbeiter_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
|
||||
|
||||
if (hasData($stunden_limit_result))
|
||||
{
|
||||
$stunden_limit_array = getData($stunden_limit_result);
|
||||
foreach ($stunden_limit_array as $stunden_limit)
|
||||
{
|
||||
$warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
|
||||
}
|
||||
$warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$benutzer_result = $this->_ci->BenutzerModel->load(array(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid));
|
||||
$benutzer_result = $this->_ci->BenutzerModel->load(array($new_uid));
|
||||
|
||||
if (isError($benutzer_result)) return $benutzer_result;
|
||||
|
||||
@@ -227,12 +253,23 @@ class LektorLib
|
||||
'bismelden'
|
||||
);
|
||||
|
||||
$nullable_fields = array('stundensatz', 'semesterstunden', 'planstunden');
|
||||
|
||||
$updateData = array();
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
$value = isset($new_data[$field]) ? $new_data[$field] : null;
|
||||
if (!array_key_exists($field, $new_data))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($value !== null)
|
||||
$value = $new_data[$field];
|
||||
|
||||
if (in_array($field, $nullable_fields))
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
elseif ($value !== null)
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
@@ -240,10 +277,24 @@ class LektorLib
|
||||
$updateData['updatevon'] = getAuthUID();
|
||||
$updateData['updateamum'] = date('Y-m-d H:i:s');
|
||||
|
||||
$result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid), $updateData);
|
||||
$result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid), $updateData);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if ($stundenplan_update)
|
||||
{
|
||||
$update_result = $this->_ci->StundenplandevModel->update([
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'mitarbeiter_uid' => $old_uid,
|
||||
], [
|
||||
'mitarbeiter_uid' => $new_uid,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => getAuthUID()
|
||||
]);
|
||||
|
||||
if (isError($update_result)) return $update_result;
|
||||
}
|
||||
|
||||
if ($warning !== '') return success(['warning' => $warning]);
|
||||
|
||||
return success('Erfolgreich geupdated');
|
||||
@@ -347,4 +398,52 @@ class LektorLib
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addGroupBy('tbl_studiengang.bezeichnung');
|
||||
return $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
}
|
||||
|
||||
private function hasKollision($stunden, $mitarbeiter)
|
||||
{
|
||||
$kollision = array();
|
||||
|
||||
$ignore_zeitsperre = $this->_ci->variablelib->getVar('ignore_zeitsperre');
|
||||
$ignore_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung');
|
||||
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$stundenplan_result = $this->_ci->StundenplandevModel->lektorHasStundenplandevEintrag($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (isError($stundenplan_result))
|
||||
return $stundenplan_result;
|
||||
|
||||
if (hasData($stundenplan_result))
|
||||
{
|
||||
$stundenplan_result = getData($stundenplan_result)[0];
|
||||
$kollision[] = "Kollision stundenplandev: $stundenplan_result->stundenplandev_id|$stundenplan_result->lektor|$stundenplan_result->ort_kurzbz|$stundenplan_result->stg_kurzbz-$stundenplan_result->semester$stundenplan_result->verband$stundenplan_result->gruppe$stundenplan_result->gruppe_kurzbz - $stundenplan_result->datum/$stundenplan_result->stunde";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($ignore_zeitsperre == 'false' && (!defined('KOLLISIONSFREIE_USER') || !in_array($mitarbeiter, unserialize(KOLLISIONSFREIE_USER))))
|
||||
{
|
||||
$zeitsperre_result = $this->_ci->ZeitsperreModel->checkIfZeitsperreExists($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (hasData($zeitsperre_result))
|
||||
{
|
||||
$zeitsperre_result = getData($zeitsperre_result)[0];
|
||||
$kollision[] = "Kollision (Zeitsperre): $zeitsperre_result->zeitsperre_id|$zeitsperre_result->mitarbeiter_uid|$zeitsperre_result->zeitsperretyp_kurzbz - $zeitsperre_result->vondatum/$zeitsperre_result->vonstunde|$zeitsperre_result->bisdatum/$zeitsperre_result->bisstunde";
|
||||
}
|
||||
}
|
||||
|
||||
if ($ignore_reservierung == 'false' && (!defined('KOLLISIONSFREIE_USER') || !in_array($mitarbeiter, unserialize(KOLLISIONSFREIE_USER))))
|
||||
{
|
||||
$reservierung_result = $this->_ci->ReservierungModel->lektorHasReservierung($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (hasData($reservierung_result))
|
||||
{
|
||||
$reservierung_result = getData($reservierung_result)[0];
|
||||
$kollision[] = "Kollision (Reservierung): $reservierung_result->reservierung_id|$reservierung_result->uid|$reservierung_result->ort_kurzbz|$reservierung_result->stg_kurzbz-$reservierung_result->semester$reservierung_result->verband$reservierung_result->gruppe$reservierung_result->gruppe_kurzbz - $reservierung_result->datum/$reservierung_result->stunde";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isEmptyArray($kollision) ? false : $kollision;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,410 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* The exam history of one student in one course: the order of the attempts, the attempt count
|
||||
* and the limits. This class is the only source of the examination rules. The controller and the
|
||||
* client only read the result.
|
||||
*/
|
||||
class PruefungsverlaufLib
|
||||
{
|
||||
/** The first attempt: the original assessment, which is the transcript grade itself. */
|
||||
const ROLLE_ERSTANTRITT = 'erstantritt';
|
||||
|
||||
/** Each attempt after the first one. */
|
||||
const ROLLE_PRUEFUNG = 'pruefung';
|
||||
|
||||
/** The last attempt. The examination rules require a commission for it. */
|
||||
const ROLLE_KOMMISSIONELL = 'kommissionell';
|
||||
|
||||
/** Maps an attempt number to the old exam type. Kept for backward compatibility. */
|
||||
private static $_legacyTypen = [1 => 'Termin1', 2 => 'Termin2', 3 => 'Termin3'];
|
||||
|
||||
private $_ci;
|
||||
private $_noteCache = [];
|
||||
private $_specialNotes = null;
|
||||
private $_typen = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
$this->_ci->load->model('education/Note_model', 'NoteModel');
|
||||
$this->_ci->load->model('education/Pruefungstyp_model', 'PruefungstypModel');
|
||||
$this->_ci->load->config('noten');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $lvNote counts as the implicit first attempt while no exam counts
|
||||
* @param mixed $zeugnisNote a credited grade makes all exams impossible
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getVerlauf($student_uid, $lv_id, $sem_kurzbz, $lvNote = null, $zeugnisNote = null)
|
||||
{
|
||||
return $this->buildVerlauf($this->getPruefungen($student_uid, $lv_id, $sem_kurzbz), $lvNote, $zeugnisNote);
|
||||
}
|
||||
|
||||
/** All exams of one student in one course, in chronological order. @return array */
|
||||
public function getPruefungen($student_uid, $lv_id, $sem_kurzbz)
|
||||
{
|
||||
$result = $this->_ci->LePruefungModel->getPruefungenByUidTypLvStudiensemester($student_uid, null, $lv_id, $sem_kurzbz);
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
return $this->sortPruefungen(getData($result));
|
||||
}
|
||||
|
||||
/** Sort keys: datum, then tbl_pruefungstyp.sort (old rows without a date), then pruefung_id. */
|
||||
public function sortPruefungen($pruefungen)
|
||||
{
|
||||
$pruefungen = array_values($pruefungen);
|
||||
$typen = $this->getTypen();
|
||||
|
||||
usort($pruefungen, function ($a, $b) use ($typen) {
|
||||
$da = substr((string) $a->datum, 0, 10);
|
||||
$db = substr((string) $b->datum, 0, 10);
|
||||
|
||||
if ($da !== $db) {
|
||||
if ($da === '') return -1;
|
||||
if ($db === '') return 1;
|
||||
return ($da < $db) ? -1 : 1;
|
||||
}
|
||||
|
||||
$sa = isset($typen[$a->pruefungstyp_kurzbz]) ? (int) $typen[$a->pruefungstyp_kurzbz]->sort : 0;
|
||||
$sb = isset($typen[$b->pruefungstyp_kurzbz]) ? (int) $typen[$b->pruefungstyp_kurzbz]->sort : 0;
|
||||
if ($sa !== $sb) return ($sa < $sb) ? -1 : 1;
|
||||
|
||||
return ((int) $a->pruefung_id < (int) $b->pruefung_id) ? -1 : 1;
|
||||
});
|
||||
|
||||
return $pruefungen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the history from a list of exams. Each exam gets: position, zaehlt, antritt_nr (null
|
||||
* if the exam does not count) and terminal.
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function buildVerlauf($pruefungen, $lvNote = null, $zeugnisNote = null)
|
||||
{
|
||||
$pruefungen = $this->sortPruefungen($pruefungen);
|
||||
|
||||
$antrittCount = 0;
|
||||
$terminal = false;
|
||||
$eintraege = [];
|
||||
|
||||
foreach ($pruefungen as $i => $p) {
|
||||
$zaehlt = $this->zaehltAlsAntritt($p->note, $p->pruefungstyp_kurzbz);
|
||||
if ($zaehlt) $antrittCount++;
|
||||
|
||||
// A kommissionelle exam closes the chain, also if its grade uses no attempt. A student
|
||||
// with a kommissionelle Prüfung gets no further exam from this tool.
|
||||
$kommissionell = $this->istKommissionell($p->pruefungstyp_kurzbz);
|
||||
if ($kommissionell) $terminal = true;
|
||||
|
||||
$eintrag = clone $p;
|
||||
$eintrag->position = $i + 1;
|
||||
$eintrag->zaehlt = $zaehlt;
|
||||
$eintrag->antritt_nr = $zaehlt ? $antrittCount : null;
|
||||
$eintrag->kommissionell = $kommissionell;
|
||||
$eintraege[] = $eintrag;
|
||||
}
|
||||
|
||||
// if no exam counts, the course grade itself is the first attempt
|
||||
$implizit = ($antrittCount === 0 && $lvNote !== null && $this->zaehltAlsAntritt($lvNote));
|
||||
if ($implizit) $antrittCount = 1;
|
||||
|
||||
$maxAntritte = $this->getMaxAntritte();
|
||||
|
||||
// credited: the row stays visible, but you cannot enter anything
|
||||
$angerechnet = $this->istAnrechnungsnote($zeugnisNote);
|
||||
|
||||
$verlauf = new stdClass();
|
||||
$verlauf->pruefungen = $eintraege;
|
||||
$verlauf->antrittCount = $antrittCount;
|
||||
$verlauf->maxAntritte = $maxAntritte;
|
||||
$verlauf->terminal = $terminal;
|
||||
$verlauf->angerechnet = $angerechnet;
|
||||
$verlauf->impliziterErstantritt = $implizit;
|
||||
$verlauf->canAdd = !$terminal && !$angerechnet && $antrittCount < $maxAntritte;
|
||||
|
||||
// after the first exam each new entry is a repeat attempt
|
||||
$verlauf->erstantrittMoeglich = !$angerechnet && (count($eintraege) === 0);
|
||||
|
||||
// The last attempt of the chain is kommissionell (§17 Abs 1). The role therefore follows
|
||||
// from the position, and the user interface offers no type to select.
|
||||
if (count($eintraege) === 0 && !$implizit) {
|
||||
$verlauf->naechsteRolle = self::ROLLE_ERSTANTRITT;
|
||||
} elseif (($antrittCount + 1) >= $maxAntritte) {
|
||||
$verlauf->naechsteRolle = self::ROLLE_KOMMISSIONELL;
|
||||
} else {
|
||||
$verlauf->naechsteRolle = self::ROLLE_PRUEFUNG;
|
||||
}
|
||||
|
||||
return $verlauf;
|
||||
}
|
||||
|
||||
/** 'angerechnet' or 'intern angerechnet'. The TRANSCRIPT grade decides. @return bool */
|
||||
public function istAnrechnungsnote($note)
|
||||
{
|
||||
if ($note === null || $note === '') return false;
|
||||
return in_array($note, $this->getSpecialNotes()['anrechnung']);
|
||||
}
|
||||
|
||||
/**
|
||||
* All attempts that count, the kommissionelle attempt included. The explicit configuration
|
||||
* wins. Without it the number comes from the old flags: the original assessment, one attempt
|
||||
* for each active repeat, and the kommissionelle attempt.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxAntritte()
|
||||
{
|
||||
$max = $this->_ci->config->item('CIS_GESAMTNOTE_MAX_ANTRITTE');
|
||||
if (is_numeric($max) && (int) $max > 0) return (int) $max;
|
||||
|
||||
$max = 1;
|
||||
if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) $max++;
|
||||
if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3) $max++;
|
||||
if (defined('CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF') && CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF) $max++;
|
||||
return $max;
|
||||
}
|
||||
|
||||
/**
|
||||
* The NOTE decides, therefore the same type can occur more than one time. The type decides in
|
||||
* one case only: a type in PRUEFUNG_TYPEN_OHNE_ANTRITT never uses an attempt.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function zaehltAlsAntritt($note, $typ = null)
|
||||
{
|
||||
if ($typ !== null && in_array($typ, $this->getTypenOhneAntritt())) return false;
|
||||
if ($note === null || $note === '') return false;
|
||||
if (in_array($note, $this->getSpecialNotes()['ohneAntritt'])) return false;
|
||||
|
||||
// a credited grade is not an assessment, therefore it uses no attempt
|
||||
if ($this->istAnrechnungsnote($note)) return false;
|
||||
|
||||
$noteRow = $this->getNote($note);
|
||||
return $noteRow ? (bool) $noteRow->lehre : false;
|
||||
}
|
||||
|
||||
/** Tells you if an exam takes place before a commission. @return bool */
|
||||
public function istKommissionell($typ)
|
||||
{
|
||||
$typen = $this->_ci->config->item('PRUEFUNG_KOMMISSIONELL_TYPEN');
|
||||
if (!is_array($typen)) $typen = ['kommPruef', 'zusKommPruef'];
|
||||
return in_array($typ, $typen);
|
||||
}
|
||||
|
||||
/** The exam types that never use an attempt. @return array */
|
||||
public function getTypenOhneAntritt()
|
||||
{
|
||||
$typen = $this->_ci->config->item('PRUEFUNG_TYPEN_OHNE_ANTRITT');
|
||||
return is_array($typen) ? $typen : ['zusKommPruef'];
|
||||
}
|
||||
|
||||
/**
|
||||
* The type for an attempt number. The student administration still reads this column, so the
|
||||
* value must be correct. The last attempt gets the kommissionelle type, the attempts before it
|
||||
* get the old Termin types.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function legacyTypFuerAntritt($antrittNr)
|
||||
{
|
||||
$antrittNr = max(1, (int) $antrittNr);
|
||||
$typen = $this->getTypen();
|
||||
|
||||
$maxAntritte = $this->getMaxAntritte();
|
||||
$kommissionell = $this->_ci->config->item('PRUEFUNG_TYP_KOMMISSIONELL');
|
||||
if (!is_string($kommissionell) || $kommissionell === '') $kommissionell = 'kommPruef';
|
||||
|
||||
if ($maxAntritte > 1 && $antrittNr >= $maxAntritte && isset($typen[$kommissionell])) {
|
||||
return $kommissionell;
|
||||
}
|
||||
|
||||
for ($n = $antrittNr; $n >= 1; $n--) {
|
||||
if (isset(self::$_legacyTypen[$n]) && isset($typen[self::$_legacyTypen[$n]])) {
|
||||
return self::$_legacyTypen[$n];
|
||||
}
|
||||
}
|
||||
|
||||
return self::$_legacyTypen[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* The old type for a new repeat attempt. It is never lower than Termin2, also if the first
|
||||
* exam does not use an attempt.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function legacyTypFuerWiederholung($verlauf)
|
||||
{
|
||||
return $this->legacyTypFuerAntritt(max(2, $verlauf->antrittCount + 1));
|
||||
}
|
||||
|
||||
/** @return array{entschuldigt: mixed, ohneAntritt: array, anrechnung: array, limitMap: array} */
|
||||
public function getSpecialNotes()
|
||||
{
|
||||
if ($this->_specialNotes !== null) return $this->_specialNotes;
|
||||
|
||||
$cfgEntschuldigt = $this->_ci->config->item('NOTE_ENTSCHULDIGT');
|
||||
$cfgOhneAntritt = $this->_ci->config->item('NOTEN_OHNE_ANTRITT');
|
||||
$cfgLimitMap = $this->_ci->config->item('NOTEN_OCCURANCE_LIMIT_MAP');
|
||||
$bezeichnungen = $this->_ci->config->item('NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN');
|
||||
if (!is_array($cfgOhneAntritt)) $cfgOhneAntritt = [];
|
||||
if (!is_array($cfgLimitMap)) $cfgLimitMap = [];
|
||||
if (!is_array($bezeichnungen)) $bezeichnungen = [];
|
||||
|
||||
$resEnt = $this->_ci->NoteModel->getEntschuldigtNote();
|
||||
$entschuldigt = (!isError($resEnt) && hasData($resEnt)) ? getData($resEnt)[0]->note : $cfgEntschuldigt;
|
||||
|
||||
// The name wins against the configured key. Do NOT merge the two sets: the same key has a
|
||||
// different meaning in each installation (17 is 'entschuldigt' here, but 'nicht zugelassen'
|
||||
// in the standard data).
|
||||
$ohneAntritt = [];
|
||||
foreach ($bezeichnungen as $bezeichnung) {
|
||||
$note = $this->getNoteByBezeichnung($bezeichnung);
|
||||
if ($note !== null && !in_array($note, $ohneAntritt)) $ohneAntritt[] = $note;
|
||||
}
|
||||
if (count($ohneAntritt) === 0) $ohneAntritt = $cfgOhneAntritt;
|
||||
if ($entschuldigt !== null && !in_array($entschuldigt, $ohneAntritt)) $ohneAntritt[] = $entschuldigt;
|
||||
|
||||
// move the configured limit for 'entschuldigt' to the key that was found
|
||||
$limitMap = [];
|
||||
foreach ($cfgLimitMap as $k => $v) {
|
||||
$limitMap[($k == $cfgEntschuldigt) ? $entschuldigt : $k] = $v;
|
||||
}
|
||||
|
||||
$this->_specialNotes = [
|
||||
'entschuldigt' => $entschuldigt,
|
||||
'ohneAntritt' => array_values($ohneAntritt),
|
||||
'anrechnung' => $this->resolveNoten('NOTEN_ANRECHNUNG_BEZEICHNUNGEN', 'NOTEN_ANRECHNUNG'),
|
||||
'limitMap' => $limitMap
|
||||
];
|
||||
return $this->_specialNotes;
|
||||
}
|
||||
|
||||
/**
|
||||
* The occurrence limit from NOTEN_OCCURANCE_LIMIT_MAP. $excludePruefungId skips the record
|
||||
* that the user edits at this moment.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function ueberschreitetNotenLimit($pruefungen, $note, $excludePruefungId = null)
|
||||
{
|
||||
$limitMap = $this->getSpecialNotes()['limitMap'];
|
||||
|
||||
$limit = null;
|
||||
foreach ($limitMap as $limitNote => $limitVal) {
|
||||
if ($limitNote == $note) { $limit = $limitVal; break; }
|
||||
}
|
||||
if ($limit === null) return false;
|
||||
|
||||
$count = 0;
|
||||
foreach ($pruefungen as $p) {
|
||||
if ($excludePruefungId !== null && $p->pruefung_id == $excludePruefungId) continue;
|
||||
if ($p->note == $note) $count++;
|
||||
}
|
||||
|
||||
return ($count + 1) > $limit;
|
||||
}
|
||||
|
||||
/** An exam with a later date locks the grade. You can still correct the date. @return bool */
|
||||
public function hatSpaeterenTermin($verlauf, $pruefung_id)
|
||||
{
|
||||
$current = null;
|
||||
foreach ($verlauf->pruefungen as $p) {
|
||||
if ($p->pruefung_id == $pruefung_id) { $current = $p; break; }
|
||||
}
|
||||
if ($current === null) return false;
|
||||
|
||||
foreach ($verlauf->pruefungen as $p) {
|
||||
if ($p->pruefung_id == $current->pruefung_id) continue;
|
||||
if ($p->position > $current->position) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* tbl_pruefungstyp as a map. It sorts old rows, and it limits the legacy type to the types
|
||||
* that exist. A type that does not exist breaks the foreign key. Termin3 is absent from the
|
||||
* standard data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getTypen()
|
||||
{
|
||||
if ($this->_typen !== null) return $this->_typen;
|
||||
|
||||
$this->_typen = [];
|
||||
$result = $this->_ci->PruefungstypModel->load();
|
||||
if (!isError($result) && hasData($result)) {
|
||||
foreach (getData($result) as $typ) {
|
||||
$this->_typen[$typ->pruefungstyp_kurzbz] = $typ;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_typen;
|
||||
}
|
||||
|
||||
/** Finds the grades by their name. The configured keys are the fallback only. @return array */
|
||||
private function resolveNoten($bezeichnungKey, $pkKey)
|
||||
{
|
||||
$bezeichnungen = $this->_ci->config->item($bezeichnungKey);
|
||||
if (!is_array($bezeichnungen)) $bezeichnungen = [];
|
||||
|
||||
$noten = [];
|
||||
foreach ($bezeichnungen as $bezeichnung) {
|
||||
$note = $this->getNoteByBezeichnung($bezeichnung);
|
||||
if ($note !== null && !in_array($note, $noten)) $noten[] = $note;
|
||||
}
|
||||
|
||||
if (count($noten) === 0) {
|
||||
$fallback = $this->_ci->config->item($pkKey);
|
||||
if (is_array($fallback)) $noten = $fallback;
|
||||
}
|
||||
|
||||
return array_values($noten);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return stdClass|null
|
||||
*/
|
||||
private function getNote($note)
|
||||
{
|
||||
if (array_key_exists($note, $this->_noteCache)) return $this->_noteCache[$note];
|
||||
|
||||
$result = $this->_ci->NoteModel->load($note);
|
||||
$this->_noteCache[$note] = (!isError($result) && hasData($result)) ? getData($result)[0] : null;
|
||||
return $this->_noteCache[$note];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|null
|
||||
*/
|
||||
private function getNoteByBezeichnung($bezeichnung)
|
||||
{
|
||||
$result = $this->_ci->NoteModel->loadWhere(['bezeichnung' => $bezeichnung]);
|
||||
return (!isError($result) && hasData($result)) ? getData($result)[0]->note : null;
|
||||
}
|
||||
}
|
||||
@@ -80,10 +80,12 @@ class StundenplanLib
|
||||
if (isError($semester_range))
|
||||
return $semester_range;
|
||||
$semester_range = getData($semester_range);
|
||||
$this->_ci->addMeta('semester_range', $semester_range);
|
||||
|
||||
$this->sortStudienSemester($semester_range);
|
||||
|
||||
$function_error = $this->applyLoadUeberSemesterHaelfte($semester_range);
|
||||
$this->_ci->addMeta('nach_apply_semester_range', $semester_range);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
|
||||
@@ -92,13 +94,13 @@ class StundenplanLib
|
||||
if (isError($benutzer_gruppen))
|
||||
return $benutzer_gruppen;
|
||||
$benutzer_gruppen = getData($benutzer_gruppen);
|
||||
|
||||
$this->_ci->addMeta('spezialgruppen', $benutzer_gruppen);
|
||||
// getting the student_lehrverbaende of the student in the different studiensemester
|
||||
$student_lehrverband = $this->fetchStudentlehrverbandFromStudiensemester($student_uid, $semester_range);
|
||||
if (isError($student_lehrverband))
|
||||
return $student_lehrverband;
|
||||
$student_lehrverband = getData($student_lehrverband);
|
||||
|
||||
$this->_ci->addMeta('studentlehrvebaende', $student_lehrverband);
|
||||
$stundenplan_query = $this->_ci->StundenplanModel->getStundenplanQuery(
|
||||
$start,
|
||||
$end,
|
||||
@@ -114,6 +116,7 @@ class StundenplanLib
|
||||
return $stundenplan_data;
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
|
||||
$this->_ci->addMeta("stundenplanData", $stundenplan_data);
|
||||
$function_error = $this->expandObjectInformation($stundenplan_data);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
@@ -184,6 +187,21 @@ class StundenplanLib
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getEventsByLE($lehreinheit_id, $start, $end, $stundenplan)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
return $this->_ci->StundenplanModel->getStundenplanLE($lehreinheit_id, $start, $end, $stundenplan);
|
||||
}
|
||||
|
||||
public function getEventsByLV($lehrveranstaltung_id, $start, $end, $stundenplan)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
return $this->_ci->StundenplanModel->getStundenplanLV($lehrveranstaltung_id, $start, $end, $stundenplan);
|
||||
}
|
||||
/**
|
||||
* Get stundenplan for a room
|
||||
*
|
||||
@@ -374,6 +392,39 @@ class StundenplanLib
|
||||
$item->gruppe = $gruppe_obj_array;
|
||||
$item->lektor = $lektor_obj_array;
|
||||
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$berechtigt_begrenzt = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt', 'sui');
|
||||
|
||||
$now = time();
|
||||
$res_lektor_start = $this->jump_day($now, RES_TAGE_LEKTOR_MIN - 1);
|
||||
$res_lektor_ende = mktime(0, 0, 0, date('m', $now), date('d', $now) + RES_TAGE_LEKTOR_BIS, date('Y', $now));
|
||||
|
||||
$start_date = is_numeric($item->beginn) ? $item->beginn : strtotime($item->beginn);
|
||||
if (!date('w', $start_date)) {
|
||||
$start_date = $this->jump_day($start_date, 1);
|
||||
}
|
||||
|
||||
$start_date_str = date('Y-m-d', $start_date);
|
||||
$res_lektor_start_str = date('Y-m-d', $res_lektor_start);
|
||||
$res_lektor_ende_str = date('Y-m-d', $res_lektor_ende);
|
||||
|
||||
$show_delete = (
|
||||
(
|
||||
$berechtigt_begrenzt &&
|
||||
(
|
||||
(isset($item->insertvon) && $item->insertvon == getAuthUID()) ||
|
||||
(isset($item->uids) && in_array(getAuthUID(), $item->uids))
|
||||
)
|
||||
) &&
|
||||
$start_date_str >= $res_lektor_start_str &&
|
||||
$start_date_str <= $res_lektor_ende_str
|
||||
);
|
||||
|
||||
if ($show_delete)
|
||||
$item->deletable = true;
|
||||
else
|
||||
$item->deletable = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,6 +520,212 @@ class StundenplanLib
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
public function addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren = null, $studiengang = null, $semester = null, $verband = null, $gruppe = null, $spezialgruppe = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->load->model('ressource/stundenplan_model', 'StundenplanModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
$startTime = new DateTime($start);
|
||||
$endTime = new DateTime($end);
|
||||
|
||||
$stunden = $this->_ci->StundeModel->loadWhere(array(
|
||||
'beginn <' => $endTime->format('H:i:s'),
|
||||
'ende >' => $startTime->format('H:i:s')
|
||||
));
|
||||
|
||||
if (!hasData($stunden))
|
||||
{
|
||||
return error("Keine Stunden vorhanden");
|
||||
}
|
||||
|
||||
$stunden = array_column(getData($stunden), 'stunde');
|
||||
|
||||
$this->_ci->StundenplandevModel->db->select('1');
|
||||
$this->_ci->StundenplandevModel->db->where('datum', $startTime->format('Y-m-d'));
|
||||
$this->_ci->StundenplandevModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$this->_ci->StundenplandevModel->db->where_in('stunde', $stunden);
|
||||
$stundenplandev_belegung = $this->_ci->StundenplandevModel->load();
|
||||
|
||||
$this->_ci->StundenplanModel->db->select('1');
|
||||
$this->_ci->StundenplanModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$this->_ci->StundenplanModel->db->where('datum', $startTime->format('Y-m-d'));
|
||||
$this->_ci->StundenplanModel->db->where_in('stunde', $stunden);
|
||||
$stundenplan_belegung = $this->_ci->StundenplanModel->load();
|
||||
|
||||
if ((hasData($stundenplandev_belegung) || hasData($stundenplan_belegung))
|
||||
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
|
||||
return error ('lvplan/bereitsReserviert');
|
||||
|
||||
$this->_ci->ReservierungModel->addSelect('stunde');
|
||||
$reservation_hours = $this->_ci->ReservierungModel->loadWhere(array('datum' => $startTime->format('Y-m-d'), 'ort_kurzbz' => $ort_kurzbz));
|
||||
|
||||
|
||||
if (isError($reservation_hours))
|
||||
return $reservation_hours;
|
||||
|
||||
$reservation_hours = hasData($reservation_hours) ? array_column(getData($reservation_hours), 'stunde') : array();
|
||||
|
||||
if (!empty(array_intersect($stunden, $reservation_hours))
|
||||
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
|
||||
return error("lvplan/bereitsReserviert");
|
||||
|
||||
|
||||
if (!empty($lektoren))
|
||||
{
|
||||
foreach ($lektoren as $lektor)
|
||||
{
|
||||
$insert = array('ort_kurzbz' => $ort_kurzbz,
|
||||
'datum' => $startTime->format('Y-m-d'),
|
||||
'titel' => $title,
|
||||
'studiengang_kz' => is_null($studiengang) ? 0 : $studiengang,
|
||||
'beschreibung' => $beschreibung,
|
||||
'insertvon' => getAuthUID(),
|
||||
'uid' => $lektor,
|
||||
'semester' => is_null($semester) ? null : $semester,
|
||||
'verband' => is_null($verband) ? null : $verband,
|
||||
'gruppe' => is_null($gruppe) ? null : $gruppe,
|
||||
'gruppe_kurzbz' => is_null($spezialgruppe) ? null : $spezialgruppe,
|
||||
);
|
||||
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$insert['stunde'] = $stunde;
|
||||
$check_insert = $this->_ci->ReservierungModel->insert($insert);
|
||||
if (isError($check_insert))
|
||||
return $check_insert;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$check_insert = $this->_ci->ReservierungModel->insert(array(
|
||||
'ort_kurzbz' => $ort_kurzbz,
|
||||
'uid' => getAuthUID(),
|
||||
'stunde' => $stunde,
|
||||
'datum' => $startTime->format('Y-m-d'),
|
||||
'titel' => $title,
|
||||
'studiengang_kz' => is_null($studiengang) ? 0 : $studiengang,
|
||||
'beschreibung' => $beschreibung,
|
||||
'insertvon' => getAuthUID()
|
||||
));
|
||||
if (isError($check_insert))
|
||||
return $check_insert;
|
||||
}
|
||||
}
|
||||
|
||||
return success("Erfolgreich");
|
||||
}
|
||||
|
||||
public function deleteReservation($reservierung_id)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
|
||||
$this->_ci->ReservierungModel->db->where_in('reservierung_id', $reservierung_id);
|
||||
$reservation = $this->_ci->ReservierungModel->load();
|
||||
if (isError($reservation))
|
||||
return $reservation;
|
||||
|
||||
if (!hasData($reservation))
|
||||
return error("Reservierungen nicht gefunden");
|
||||
|
||||
$reservations = getData($reservation);
|
||||
|
||||
$today = new DateTime();
|
||||
foreach ($reservations as $reservierung)
|
||||
{
|
||||
if ($today->format('Y-m-d') > $reservierung->datum)
|
||||
return error("Vergangene Reservierungen können nicht gelöscht werden");
|
||||
|
||||
if (($this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt')) && ($reservierung->insertvon == getAuthUID() || $reservierung->uid === getAuthUID()))
|
||||
{
|
||||
$delete_result = $this->_ci->ReservierungModel->delete($reservierung->reservierung_id);
|
||||
|
||||
if (isError($delete_result))
|
||||
return $delete_result;
|
||||
}
|
||||
}
|
||||
return success("Erfolgreich");
|
||||
}
|
||||
|
||||
|
||||
public function getReservableMap($ort_kurzbz, $start_date, $end_date)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
$berechtigt_begrenzt = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt', 'suid');
|
||||
$berechtigt_erweitert = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung', 'suid');
|
||||
|
||||
$ort_data = $this->_ci->OrtModel->load($ort_kurzbz);
|
||||
if (isError($ort_data) || !hasData($ort_data))
|
||||
return [];
|
||||
|
||||
$ort_data = getData($ort_data)[0];
|
||||
|
||||
if (!$ort_data->reservieren)
|
||||
return [];
|
||||
|
||||
if (!$berechtigt_begrenzt && !$berechtigt_erweitert)
|
||||
return [];
|
||||
|
||||
$start_ts = is_numeric($start_date) ? (int)$start_date : strtotime($start_date);
|
||||
$end_ts = is_numeric($end_date) ? (int)$end_date : strtotime($end_date);
|
||||
|
||||
if (!$start_ts || !$end_ts)
|
||||
return [];
|
||||
|
||||
if ($end_ts < $start_ts)
|
||||
{
|
||||
$tmp = $start_ts;
|
||||
$start_ts = $end_ts;
|
||||
$end_ts = $tmp;
|
||||
}
|
||||
|
||||
$now = time();
|
||||
$tage_min = defined('RES_TAGE_LEKTOR_MIN') ? (int)RES_TAGE_LEKTOR_MIN : 0;
|
||||
$tage_bis = defined('RES_TAGE_LEKTOR_BIS') ? (int)RES_TAGE_LEKTOR_BIS : 0;
|
||||
|
||||
$datum_res_lektor_start = $this->jump_day($now, $tage_min - 1);
|
||||
$datum_res_lektor_ende = $this->jump_day($now, $tage_bis);
|
||||
|
||||
$start_ymd_allowed = date('Y-m-d', $datum_res_lektor_start);
|
||||
$end_ymd_allowed = date('Y-m-d', $datum_res_lektor_ende);
|
||||
|
||||
$result = [];
|
||||
|
||||
$current = strtotime(date('Y-m-d', $start_ts) . ' 00:00:00');
|
||||
$end_day = strtotime(date('Y-m-d', $end_ts) . ' 00:00:00');
|
||||
|
||||
while ($current <= $end_day)
|
||||
{
|
||||
$ymd = date('Y-m-d', $current);
|
||||
|
||||
$result[$ymd] = ($ymd >= $start_ymd_allowed && $ymd <= $end_ymd_allowed) ? true : false;
|
||||
|
||||
$current = $this->jump_day($current, 1);
|
||||
}
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
private function jump_day($timestamp, $days)
|
||||
{
|
||||
$days = (int)$days;
|
||||
$prefix = ($days >= 0 ? '+' : '');
|
||||
return strtotime($prefix . $days . ' days', $timestamp);
|
||||
}
|
||||
|
||||
// start of the private functions ########################################################################################################
|
||||
|
||||
// function used to sort an array of studiensemester strings
|
||||
@@ -615,6 +872,7 @@ class StundenplanLib
|
||||
$result->semester = $item->semester;
|
||||
$result->verband = $item->verband;
|
||||
$result->gruppe = $item->gruppe;
|
||||
$result->studiensemester_kurzbz = $item->studiensemester_kurzbz;
|
||||
return $result;
|
||||
},
|
||||
$lehrverband_query_result);
|
||||
@@ -784,7 +1042,8 @@ class StundenplanLib
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// gets all studiensemester from the student from start_date to end_date
|
||||
$semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date, $end_date);
|
||||
//$semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date, $end_date);
|
||||
$semester_range = $this->_ci->StudiensemesterModel->getContainingOrNearestByDateRange($start_date, $end_date);
|
||||
if (isError($semester_range))
|
||||
return $semester_range;
|
||||
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2026 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use \stdClass as stdClass;
|
||||
|
||||
class TagLib
|
||||
{
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Configs
|
||||
$this->_ci->load->config('stv');
|
||||
|
||||
// Models
|
||||
$this->_ci->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->_ci->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
$this->_ci->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
$this->_ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// Libraries
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$this->_ci->load->library('PrestudentLib');
|
||||
|
||||
$this->batchUser = $this->_ci->config->item('userAutomatedTags');
|
||||
}
|
||||
|
||||
public function updateAutomatedTags($paramsTag)
|
||||
{
|
||||
// ---------------------------------
|
||||
// check params
|
||||
// ---------------------------------
|
||||
$required = ['kurzbz', 'data', 'typeId'];
|
||||
|
||||
foreach ($required as $key) {
|
||||
if (!isset($paramsTag[$key])) {
|
||||
return error('Missing Parameter: ' . $key);
|
||||
}
|
||||
}
|
||||
|
||||
$studiensemester_kurzbz = (isset ($paramsTag['studiensemester_kurzbz']) ? $paramsTag['studiensemester_kurzbz'] : null);
|
||||
$tag = $paramsTag['kurzbz'];
|
||||
$inputData = $paramsTag['data'];
|
||||
$typeId = $paramsTag['typeId'];
|
||||
|
||||
// ---------------------------------
|
||||
// prepare input
|
||||
// ---------------------------------
|
||||
$zeitraum = [];
|
||||
$arrayIds = [];
|
||||
|
||||
foreach ($inputData as $item) {
|
||||
$id = $item['id'];
|
||||
$arrayIds[] = $id;
|
||||
|
||||
$zeitraum[$id] = [
|
||||
'von' => $item['von'] ?? null,
|
||||
'bis' => $item['bis'] ?? null
|
||||
];
|
||||
}
|
||||
$arrayIds = array_unique($arrayIds);
|
||||
|
||||
$result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
$data = $result->retval[0] ?? null;
|
||||
|
||||
$von = $data->start ?? null;
|
||||
$bis = $data->ende ?? null;
|
||||
|
||||
// ---------------------------------
|
||||
// load existing tags
|
||||
// ---------------------------------
|
||||
$allTags = [];
|
||||
$resultAllTags = $this->_ci->NotizModel->getAllTags($tag, $von, $bis);
|
||||
if (isError($resultAllTags)) {
|
||||
return $resultAllTags;
|
||||
}
|
||||
$allTagsData = getData($resultAllTags);
|
||||
|
||||
if (!empty($allTagsData)) {
|
||||
foreach ($allTagsData as $item) {
|
||||
$allTags[$item->$typeId] = $item->notiz_id;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// map the data
|
||||
// ---------------------------------
|
||||
$toRecycle = [];
|
||||
$toAdd = [];
|
||||
$toDelete = [];
|
||||
|
||||
foreach ($arrayIds as $id) {
|
||||
if (isset($allTags[$id])) {
|
||||
$toRecycle[$id] = $allTags[$id];
|
||||
} else {
|
||||
$toAdd[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($allTags as $id => $notizId) {
|
||||
if (!in_array($id, $arrayIds)) {
|
||||
$toDelete[$id] = $notizId;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// recycle (update existing)
|
||||
// ---------------------------------
|
||||
$countRecycled = 0;
|
||||
$retagged = [];
|
||||
|
||||
foreach ($toRecycle as $id => $notizId)
|
||||
{
|
||||
$this->_updateTag($notizId, $zeitraum[$id]['von'], $zeitraum[$id]['bis']);
|
||||
|
||||
$countRecycled++;
|
||||
$retagged[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// ADD
|
||||
// ---------------------------------
|
||||
$countAdded = 0;
|
||||
$tagged = [];
|
||||
|
||||
foreach ($toAdd as $id)
|
||||
{
|
||||
$this->_insertTag($typeId, $id, $tag, $zeitraum[$id]['von'], $zeitraum[$id]['bis']);
|
||||
$countAdded++;
|
||||
|
||||
$tagged[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// delete
|
||||
// ---------------------------------
|
||||
$countDeleted = 0;
|
||||
$deleted = [];
|
||||
|
||||
foreach ($toDelete as $id => $notizId)
|
||||
{
|
||||
$result = $this->_deleteTag($notizId);
|
||||
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$countDeleted++;
|
||||
$deleted[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// return
|
||||
// ---------------------------------
|
||||
return success([
|
||||
'input' => [
|
||||
'tag' => $tag,
|
||||
'arrayIds' => $arrayIds
|
||||
],
|
||||
'summary' => [
|
||||
'recycled' => $countRecycled,
|
||||
'added' => $countAdded,
|
||||
'deleted' => $countDeleted
|
||||
],
|
||||
'details' => [
|
||||
'existingTags' => $allTags,
|
||||
'toAdd' => $toAdd,
|
||||
'toRecycle' => $toRecycle,
|
||||
'toDelete' => $toDelete
|
||||
],
|
||||
'results' => [
|
||||
'retaggedIds' => $retagged,
|
||||
'newTags' => $tagged,
|
||||
'deletedTagsIds' => $deleted
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAutomatedTagsForTypeId(array $params)
|
||||
{
|
||||
$return = null;
|
||||
$notiz_id = null;
|
||||
|
||||
$von = $params['von'];
|
||||
$bis = $params['bis'];
|
||||
$tag = $params['kurzbz'];
|
||||
$id = $params['id'];
|
||||
$typeId = $params['typeId'];
|
||||
|
||||
$this->_ci->NotizModel->addSelect('nz.notiz_id');
|
||||
$this->_ci->NotizModel->addSelect($typeId);
|
||||
$this->_ci->NotizModel->addJoin('public.tbl_notizzuordnung nz', 'notiz_id');
|
||||
$resultAllTags = $this->_ci->NotizModel->loadWhere([
|
||||
'typ' => $tag,
|
||||
$typeId => $id
|
||||
]);
|
||||
if(hasData($resultAllTags))
|
||||
{
|
||||
$notiz_id = $resultAllTags->retval[0]->notiz_id;
|
||||
}
|
||||
|
||||
//RECYCLE
|
||||
if ($notiz_id !== null)
|
||||
{
|
||||
$resultUpdateNotiz = $this->_updateTag($notiz_id, $von, $bis);
|
||||
$return = ['recycled' => $resultUpdateNotiz];
|
||||
}
|
||||
else
|
||||
//ADD
|
||||
{
|
||||
$resultInsertNotiz = $this->_insertTag($typeId, $id, $tag, $von, $bis);
|
||||
$return = ['added' => $resultInsertNotiz];
|
||||
}
|
||||
return success($return);
|
||||
}
|
||||
|
||||
/*
|
||||
* main function for rebuild Tags for typeId
|
||||
* */
|
||||
public function rebuildTagsForTypeId($typeId, $id, $studiensemester_kurzbz)
|
||||
{
|
||||
$automatedTagsRes = $this->_ci->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
|
||||
$result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return error('Error occurred during retrieving studiensemester');
|
||||
if (empty($result->retval) || !isset($result->retval[0])) {
|
||||
return error('No studiensemester found');
|
||||
}
|
||||
|
||||
$startSem = $result->retval[0]->start ?? null;
|
||||
$endeSem = $result->retval[0]->ende ?? null;
|
||||
$return = [];
|
||||
|
||||
foreach ($automatedTags as $autoTag)
|
||||
{
|
||||
// getPath: must not be lost
|
||||
$filePath = APPPATH . 'libraries/' . $autoTag->taglib . '.php'; // APPPATH = application/
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
require_once($filePath);
|
||||
} else {
|
||||
echo "File not found: " . $filePath;
|
||||
continue;
|
||||
}
|
||||
|
||||
$className = basename($autoTag->taglib);
|
||||
$kurz_bz = $autoTag->typ_kurzbz;
|
||||
|
||||
$obj = new $className();
|
||||
|
||||
$criteriaIsSet = $obj->isCriteriaSetFor([
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
if (hasData($criteriaIsSet))
|
||||
{
|
||||
$von = isset($criteriaIsSet->retval[0]->von) ? $criteriaIsSet->retval[0]->von : '';
|
||||
$bis = isset($criteriaIsSet->retval[0]->bis) ? $criteriaIsSet->retval[0]->bis : '';
|
||||
|
||||
$params = [
|
||||
'von' => $von,
|
||||
'bis' => $bis,
|
||||
'kurzbz' => $autoTag->typ_kurzbz,
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
];
|
||||
|
||||
$result = $this->updateAutomatedTagsForTypeId($params);
|
||||
if (isError($result))
|
||||
return error('Error occurred during updateAutomatedTags' . $kurz_bz);
|
||||
|
||||
$return[$kurz_bz] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
//CHECK FOR DELETE
|
||||
$params = [
|
||||
'von' => $startSem,
|
||||
'bis' => $endeSem,
|
||||
'kurzbz' => $autoTag->typ_kurzbz,
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
];
|
||||
$result = $this->_ci->NotizModel->checkIfExistingTag($kurz_bz, $typeId, $id, $startSem, $endeSem);
|
||||
if (hasData($result))
|
||||
{
|
||||
$notizId = $result->retval[0]->notiz_id;
|
||||
$this->_deleteTag($notizId);
|
||||
$return[$kurz_bz] = ['deleted' => $notizId];
|
||||
}
|
||||
}
|
||||
}
|
||||
return success($return);
|
||||
}
|
||||
|
||||
private function _insertTag($typeId, $id, $tag, $von, $bis)
|
||||
{
|
||||
$resultInsert = $this->_ci->NotizModel->insert([
|
||||
'titel' => 'TAG',
|
||||
'text' => 'AUTOMATED TAG',
|
||||
'verfasser_uid' => $this->batchUser,
|
||||
'erledigt' => false,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => 'BatchJobTagAdd',
|
||||
'typ' => $tag,
|
||||
'start' => $von,
|
||||
'ende' => $bis
|
||||
]);
|
||||
|
||||
if (isError($resultInsert)) {
|
||||
return error('Error inserting tag for ' . $typeId . ': ' . $id);
|
||||
}
|
||||
|
||||
$notizId = $resultInsert->retval;
|
||||
|
||||
$resultZuordnung = $this->_ci->NotizzuordnungModel->insert([
|
||||
'notiz_id' => $notizId,
|
||||
$typeId => $id
|
||||
]);
|
||||
|
||||
if (isError($resultZuordnung)) {
|
||||
return error('Error inserting relation for ' . $typeId . ': ' . $id);
|
||||
}
|
||||
|
||||
return $notizId;
|
||||
}
|
||||
|
||||
private function _updateTag($notiz_id, $von, $bis)
|
||||
{
|
||||
$resultUpdateNotiz = $this->_ci->NotizModel->update(
|
||||
[
|
||||
'notiz_id' => $notiz_id
|
||||
],
|
||||
array(
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => 'BatchJobTagUpdate',
|
||||
'start' => $von,
|
||||
'ende' => $bis
|
||||
));
|
||||
|
||||
|
||||
if (isError($resultUpdateNotiz))
|
||||
return error ('Error occurred during Update ' . $notiz_id);
|
||||
|
||||
return $notiz_id;
|
||||
}
|
||||
|
||||
private function _deleteTag($notiz_id)
|
||||
{
|
||||
$result = $this->_ci->NotizzuordnungModel->delete([
|
||||
'notiz_id' => $notiz_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return error('Error occurred during delete Notizzuordnung ' . $notiz_id);
|
||||
}
|
||||
|
||||
$result = $this->_ci->NotizModel->delete([
|
||||
'notiz_id' => $notiz_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return error('Error occurred during delete Notiz ' . $notiz_id);
|
||||
}
|
||||
|
||||
return success([
|
||||
'deleted' => $notiz_id
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,6 +28,7 @@ class StudentListLib
|
||||
private $_allowedStgs = [];
|
||||
private $_selects = [];
|
||||
private $_joins = [];
|
||||
private $_wheres = [];
|
||||
|
||||
/**
|
||||
* Gets the CI instance, loads model and prepares default values
|
||||
@@ -40,6 +41,8 @@ class StudentListLib
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->config('stv');
|
||||
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
if (isset($params['allowedStgs']))
|
||||
@@ -47,8 +50,6 @@ class StudentListLib
|
||||
|
||||
// Add default SELECTs
|
||||
$this->addSelect("b.uid");
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
$this->addSelect('tag_data_agg.tags');
|
||||
$this->addSelect('titelpre');
|
||||
$this->addSelect('nachname');
|
||||
$this->addSelect('vorname');
|
||||
@@ -72,6 +73,13 @@ class StudentListLib
|
||||
$this->addSelect('pls.status_kurzbz AS status');
|
||||
$this->addSelect('pls.datum AS status_datum');
|
||||
$this->addSelect('pls.bestaetigtam AS status_bestaetigung');
|
||||
$this->addSelect("
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Interessent','Aufgenommener','Bewerber','Wartender')
|
||||
THEN pls.ausbildungssemester
|
||||
ELSE v.semester
|
||||
END AS semester_berechnet
|
||||
");
|
||||
$this->addSelect(
|
||||
"(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS mail_privat",
|
||||
false
|
||||
@@ -111,7 +119,7 @@ class StudentListLib
|
||||
) prest
|
||||
WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent')
|
||||
AND priorisierung <= tbl_prestudent.priorisierung
|
||||
) || ' (' || COALESCE(tbl_prestudent.priorisierung::text, ' '::text) || ')' AS priorisierung_relativ", false); // TODO(chris): overwrite in fetchStudents
|
||||
) || ' (' || COALESCE(tbl_prestudent.priorisierung::text, ' '::text) || ')' AS priorisierung_relativ", false);
|
||||
$this->addSelect('mentor');
|
||||
$this->addSelect('b.aktiv AS bnaktiv');
|
||||
$this->addSelect('unruly');
|
||||
@@ -119,7 +127,7 @@ class StudentListLib
|
||||
// Add default JOINs
|
||||
$this->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT'); // TODO(chris): overwrite in fetchStudents
|
||||
$this->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT');
|
||||
$this->addJoin('public.tbl_prestudentstatus pls', '
|
||||
pls.status_kurzbz=public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL)
|
||||
AND pls.prestudent_id=tbl_prestudent.prestudent_id
|
||||
@@ -129,40 +137,14 @@ class StudentListLib
|
||||
$this->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid', 'LEFT');
|
||||
$this->addJoin("v", "", ""); // Will be replaced later
|
||||
$this->addJoin("ps", "", ""); // Will be replaced later
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
$this->_ci->load->config('stv');
|
||||
$tags = $this->_ci->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->_ci->PrestudentModel->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$subQueryTag = "(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz " . $whereTags . "
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg";
|
||||
|
||||
$this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
// Add SELECTs and JOINs from config
|
||||
$config = $this->_ci->config->item('list_columns') ?: [];
|
||||
foreach ($config as $conf) {
|
||||
$this->addSelect($conf['default']);
|
||||
if (isset($conf['joins']))
|
||||
foreach ($conf['joins'] as $join)
|
||||
call_user_func_array([$this, 'addJoin'], $join);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,11 +231,7 @@ class StudentListLib
|
||||
*/
|
||||
public function addWhere($key, $value = null, $escape = true)
|
||||
{
|
||||
if (!is_array($key) && is_array($value)) {
|
||||
$this->_ci->PrestudentModel->db->where_in($key, $value, $escape);
|
||||
} else {
|
||||
$this->_ci->PrestudentModel->db->where($key, $value, $escape);
|
||||
}
|
||||
$this->_wheres[] = [$key, $value, $escape, false];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,11 +245,7 @@ class StudentListLib
|
||||
*/
|
||||
public function addOrWhere($key, $value = null, $escape = true)
|
||||
{
|
||||
if (!is_array($key) && is_array($value)) {
|
||||
$this->_ci->PrestudentModel->db->or_where_in($key, $value, $escape);
|
||||
} else {
|
||||
$this->_ci->PrestudentModel->db->or_where($key, $value, $escape);
|
||||
}
|
||||
$this->_wheres[] = [$key, $value, $escape, true];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,8 +257,9 @@ class StudentListLib
|
||||
*/
|
||||
public function execute($studiensemester_kurzbz)
|
||||
{
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
$this->addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz);
|
||||
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$this->addSelect(
|
||||
"public.get_rolle_prestudent(
|
||||
@@ -315,6 +290,20 @@ class StudentListLib
|
||||
foreach ($this->_selects as $select)
|
||||
$this->_ci->PrestudentModel->addSelect($select[0], $select[1]);
|
||||
|
||||
foreach ($this->_wheres as $where) {
|
||||
if (!is_array($where[0]) && is_array($where[1])) {
|
||||
if ($where[3])
|
||||
$this->_ci->PrestudentModel->db->or_where_in($where[0], $where[1], $where[2]);
|
||||
else
|
||||
$this->_ci->PrestudentModel->db->where_in($where[0], $where[1], $where[2]);
|
||||
} else {
|
||||
if ($where[3])
|
||||
$this->_ci->PrestudentModel->db->or_where($where[0], $where[1], $where[2]);
|
||||
else
|
||||
$this->_ci->PrestudentModel->db->where($where[0], $where[1], $where[2]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_ci->PrestudentModel->addOrder('nachname');
|
||||
$this->_ci->PrestudentModel->addOrder('vorname');
|
||||
|
||||
@@ -325,6 +314,78 @@ class StudentListLib
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
* Add Select and Join for Tags if configured
|
||||
*
|
||||
* @param string studiensemester_kurzbz
|
||||
*
|
||||
*/
|
||||
protected function addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz)
|
||||
{
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
$this->_ci->load->config('stv');
|
||||
$tags = $this->_ci->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->_ci->PrestudentModel->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$studiensemester_kurzbz_escaped = $this->_ci->PrestudentModel->escape($studiensemester_kurzbz);
|
||||
$subQueryTag = "(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done, tag.prioritaet), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
nt.bezeichnung_mehrsprachig[(
|
||||
SELECT index
|
||||
FROM tbl_sprache
|
||||
WHERE sprache=" . $this->_ci->PrestudentModel->escape(getUserLanguage()) . "
|
||||
)] AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nt.prioritaet AS prioritaet,
|
||||
nt.automatisiert AS automatisiert,
|
||||
nz.prestudent_id,
|
||||
n.start,
|
||||
n.ende
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id AND nz.prestudent_id IS NOT NULL
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz " . $whereTags . "
|
||||
WHERE
|
||||
COALESCE(n.start, '1970-01-01') <= (
|
||||
SELECT
|
||||
ende
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz = " . $studiensemester_kurzbz_escaped . "
|
||||
)
|
||||
AND COALESCE(n.ende, '2170-12-31') >= (
|
||||
SELECT
|
||||
start
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz = " . $studiensemester_kurzbz_escaped . "
|
||||
)
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg";
|
||||
|
||||
$this->addSelect('tag_data_agg.tags');
|
||||
$this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get alias of a table or select statement
|
||||
*
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of dd_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreDoubleDegreeTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('codex/Mobilitaet_model', 'MobilitaetModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->MobilitaetModel->addJoin('bis.tbl_gsprogramm', 'gsprogramm_id');
|
||||
$this->ci->MobilitaetModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->MobilitaetModel-> loadWhere(array(
|
||||
'gsprogrammtyp_kurzbz' => 'Double',
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
|
||||
$doubledegree_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $doubledegree_data,
|
||||
'typeId' => 'prestudent_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->MobilitaetModel->addSelect('prestudent_id');
|
||||
$this->ci->MobilitaetModel->addSelect('start as von');
|
||||
$this->ci->MobilitaetModel->addSelect('ende as bis');
|
||||
|
||||
$this->ci->MobilitaetModel->addJoin('bis.tbl_gsprogramm', 'gsprogramm_id');
|
||||
$this->ci->MobilitaetModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->MobilitaetModel->loadWhere(array(
|
||||
'gsprogrammtyp_kurzbz' => 'Double',
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
//array mit prestudent_id, von und bis
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Description unruly
|
||||
* Test for different typeId
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreFiftyFiveTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
$this->ci-> load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'person_id' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->StudiensemesterModel->loadWhere(array(
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval[0];
|
||||
|
||||
$semVon = $data->start;
|
||||
$semBis = $data->ende;
|
||||
$result = $this->ci->PersonModel->getFiftyFivers($semVon, $semBis);
|
||||
|
||||
$data = $result->retval;
|
||||
$fiftyFiveData = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->person_id
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $fiftyFiveData,
|
||||
'typeId' => 'person_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'person_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$person_id = $params['id'];
|
||||
$typeId = $params['typeId'];
|
||||
|
||||
|
||||
$result = $this->ci->StudiensemesterModel->loadWhere(array(
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval[0];
|
||||
|
||||
$semVon = $data->start;
|
||||
$semBis = $data->ende;
|
||||
$result = $this->ci->PersonModel->isFiftyFive($semVon, $semBis, $person_id);
|
||||
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of out_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreIncomingTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->BisioModel->getIncomingsOfSemester($semester);
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$outgoing_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->von,
|
||||
'bis' => $item->bis
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $outgoing_data,
|
||||
'typeId' => 'prestudent_id',
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$result = $this->ci->BisioModel->isPrestudentIncoming($semester, $prestudent_id);
|
||||
|
||||
if (hasData($result)) {
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of jgv_auto (Jahrgangsvertretung)
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreJgvTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->BenutzerfunktionModel->getPrestudentsOfJgv($semester);
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$jgv_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->datum_von,
|
||||
'bis' => $item->datum_bis
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $jgv_data,
|
||||
'typeId' => 'prestudent_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$result = $this->ci->BenutzerfunktionModel->isJgv($semester, $prestudent_id);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of zgv_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreMissingZgvTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->ci->PrestudentModel->db->group_start();
|
||||
|
||||
$this->ci->PrestudentModel->db->where('zgvdatum', null);
|
||||
$this->ci->PrestudentModel->db->where('typ', 'b');
|
||||
|
||||
$this->ci->PrestudentModel->db->or_group_start();
|
||||
$this->ci->PrestudentModel->db->where('zgvmadatum', null);
|
||||
$this->ci->PrestudentModel->db->where('typ', 'm');
|
||||
$this->ci->PrestudentModel->db->group_end();
|
||||
|
||||
$this->ci->PrestudentModel->db->group_end();
|
||||
|
||||
$result = $this->ci->PrestudentModel-> loadWhere(array(
|
||||
'bn.aktiv' => true,
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$zgvmissing_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => null,
|
||||
'bis' => null
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'typeId' => 'prestudent_id',
|
||||
'data' => $zgvmissing_data
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->PrestudentModel->addSelect('prestudent_id');
|
||||
$this->ci->PrestudentModel->addSelect('start as von');
|
||||
$this->ci->PrestudentModel->addSelect('ende as bis');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id');
|
||||
|
||||
//add studiensemester also here for manual rebuild
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->ci->PrestudentModel->db->group_start();
|
||||
|
||||
$this->ci->PrestudentModel->db->where('zgvdatum', null);
|
||||
$this->ci->PrestudentModel->db->where('typ', 'b');
|
||||
|
||||
$this->ci->PrestudentModel->db->or_group_start();
|
||||
$this->ci->PrestudentModel->db->where('zgvmadatum', null);
|
||||
$this->ci->PrestudentModel->db->where('typ', 'm');
|
||||
$this->ci->PrestudentModel->db->group_end();
|
||||
|
||||
$this->ci->PrestudentModel->db->group_end();
|
||||
$this->ci->PrestudentModel->db->limit(1);
|
||||
|
||||
$result = $this->ci->PrestudentModel-> loadWhere(array(
|
||||
'bn.aktiv' => true,
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of out_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreOutgoingTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->BisioModel->getOutgoingsOfSemester($semester);
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$outgoing_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->von,
|
||||
'bis' => $item->bis
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $outgoing_data,
|
||||
'typeId' => 'prestudent_id',
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$result = $this->ci->BisioModel->isPrestudentOutgoing($semester, $prestudent_id);
|
||||
|
||||
if (hasData($result)) {
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of prewh_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CorePreabbrecherTagLib
|
||||
{
|
||||
protected $ci;
|
||||
const TYP_ABMELDUNG = ['Abmeldung', 'AbmeldungStgl'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->StudierendenantragModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
$this->ci->StudierendenantragModel->db->where_in('typ', self::TYP_ABMELDUNG);
|
||||
$this->ci->StudierendenantragModel->db->where('studiensemester_kurzbz', $semester);
|
||||
$result = $this->ci->StudierendenantragModel->getWithLastStatusWhere([
|
||||
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_CREATED
|
||||
]);
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$prewiederholer_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $prewiederholer_data,
|
||||
'typeId' => 'prestudent_id',
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->StudierendenantragModel->addSelect('prestudent_id');
|
||||
$this->ci->StudierendenantragModel->addSelect('start as von');
|
||||
$this->ci->StudierendenantragModel->addSelect('ende as bis');
|
||||
|
||||
$this->ci->StudierendenantragModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
$this->ci->StudierendenantragModel->db->where_in('typ', self::TYP_ABMELDUNG);
|
||||
$this->ci->StudierendenantragModel->db->where('studiensemester_kurzbz', $semester);
|
||||
$this->ci->StudierendenantragModel->db->where('prestudent_id', $prestudent_id);
|
||||
$result = $this->ci->StudierendenantragModel->getWithLastStatusWhere([
|
||||
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_CREATED
|
||||
]);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user