mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Compare commits
640
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e818bc5e4d | ||
|
|
3e06740758 | ||
|
|
dc4939ee78 | ||
|
|
bca2884aa2 | ||
|
|
e2c2339f89 | ||
|
|
63d0bfc69b | ||
|
|
ab05f32fde | ||
|
|
68482a429e | ||
|
|
62e704a6cf | ||
|
|
2d5446bfc7 | ||
|
|
6f4482cff4 | ||
|
|
96a373682a | ||
|
|
cdd36f61b1 | ||
|
|
ebb0042881 | ||
|
|
4e7a3b22fe | ||
|
|
221d810f3f | ||
|
|
9e2cc68531 | ||
|
|
45647f0cec | ||
|
|
50a518ea7a | ||
|
|
2b44b421dc | ||
|
|
70a93cc093 | ||
|
|
0c4d102850 | ||
|
|
2e15f2c5ab | ||
|
|
4768fbda15 | ||
|
|
d8959d9776 | ||
|
|
9e2a818eab | ||
|
|
27bd463109 | ||
|
|
784e5693b4 | ||
|
|
88b49b70e9 | ||
|
|
3214ae3101 | ||
|
|
1f570f8495 | ||
|
|
67a33f2ceb | ||
|
|
4549c92d50 | ||
|
|
751445c199 | ||
|
|
916f5dd68e | ||
|
|
efc8fa1eeb | ||
|
|
5313693651 | ||
|
|
0239977d21 | ||
|
|
d58edff92d | ||
|
|
ca4043833e | ||
|
|
643929a0c6 | ||
|
|
a5aa4c8466 | ||
|
|
8db60c67f8 | ||
|
|
b97dec7343 | ||
|
|
8b58c82385 | ||
|
|
4ba2869632 | ||
|
|
293bb77179 | ||
|
|
3fe10d715d | ||
|
|
3034615455 | ||
|
|
9b137452d9 | ||
|
|
36064afbba | ||
|
|
65c931ea2d | ||
|
|
5aa007f49c | ||
|
|
f3d031ab16 | ||
|
|
762fd1cadd | ||
|
|
9feb442a07 | ||
|
|
e24a66a454 | ||
|
|
3d8c4fa4d0 | ||
|
|
272014bd78 | ||
|
|
76a8e00edf | ||
|
|
af978e1312 | ||
|
|
a53c4fd623 | ||
|
|
ce62713790 | ||
|
|
34761db664 | ||
|
|
c7131ed775 | ||
|
|
b57e1984a8 | ||
|
|
59c5100a86 | ||
|
|
cf6e747def | ||
|
|
22500a96c1 | ||
|
|
03af6bfda5 | ||
|
|
0fafb95bd8 | ||
|
|
1d838f8116 | ||
|
|
9605227139 | ||
|
|
a64219dd25 | ||
|
|
e06d5fbdc1 | ||
|
|
d30595bbfb | ||
|
|
43d5068cda | ||
|
|
eebe2d6aec | ||
|
|
d5fa13d644 | ||
|
|
9ae2c91677 | ||
|
|
e369a8c03f | ||
|
|
98175c5976 | ||
|
|
94992f40bd | ||
|
|
1e2dbeac10 | ||
|
|
153717b187 | ||
|
|
dd15b37f0f | ||
|
|
2fc2d12d65 | ||
|
|
0279813ba9 | ||
|
|
1c4c90ffba | ||
|
|
acedc11be8 | ||
|
|
c79f664f9e | ||
|
|
f817527ab9 | ||
|
|
754e619e30 | ||
|
|
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 | ||
|
|
faad2c4a9a | ||
|
|
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 | ||
|
|
2ffaf36270 | ||
|
|
ec8b9a4c0a | ||
|
|
69fd223358 | ||
|
|
9c43374267 | ||
|
|
80e17e264a | ||
|
|
99445d2372 | ||
|
|
0ab6e3d00d | ||
|
|
ea7c0cccde | ||
|
|
385b262be8 | ||
|
|
b4206e1e48 | ||
|
|
e09555908a | ||
|
|
38060c60fb | ||
|
|
40516b34a2 | ||
|
|
ea97e3a192 | ||
|
|
f34481ae60 | ||
|
|
fcf3cbac6c | ||
|
|
6dfe292776 | ||
|
|
40b28b88b9 | ||
|
|
c90f7a31bb | ||
|
|
c8c7d1566c | ||
|
|
073160dde4 | ||
|
|
56fe8c9d09 | ||
|
|
9a3532265f | ||
|
|
11f2f0ad75 | ||
|
|
4abe6f0d24 | ||
|
|
4ecf1845d4 | ||
|
|
9fbbd6b855 | ||
|
|
60b2c89c66 | ||
|
|
59b4b2bac9 | ||
|
|
5f546fca2a | ||
|
|
9d4218bf38 | ||
|
|
67f30c7765 | ||
|
|
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 | ||
|
|
5fff45e302 | ||
|
|
a0ea54d0c0 | ||
|
|
de627171d5 | ||
|
|
57c48f2c4a | ||
|
|
e32691994c | ||
|
|
6f3c0fb174 | ||
|
|
6d641bbd06 | ||
|
|
3455aed3f5 | ||
|
|
76130bbf2c | ||
|
|
f84d12277d | ||
|
|
9bf5bc2ad9 | ||
|
|
90bce8d3d5 | ||
|
|
0ce4acc71b | ||
|
|
364b506220 | ||
|
|
33038f409a | ||
|
|
1b4297a9bf | ||
|
|
1bbea69139 | ||
|
|
f8cea9036c | ||
|
|
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 | ||
|
|
ab854067eb | ||
|
|
9e9990dd6e | ||
|
|
b80805e09c | ||
|
|
d22ed099bb | ||
|
|
84c99d23cd | ||
|
|
36a302f20f | ||
|
|
9a592047a0 | ||
|
|
e6947a3246 | ||
|
|
5cd0897348 | ||
|
|
a973a50576 | ||
|
|
7121b46bf9 | ||
|
|
00f07ba6f0 | ||
|
|
4c1d3ceedf | ||
|
|
f674546df8 | ||
|
|
7910cf3055 | ||
|
|
ab1c8e63ee | ||
|
|
67bbe9c105 | ||
|
|
afb8011347 | ||
|
|
4d01b60808 | ||
|
|
46f8d0d07d | ||
|
|
b2af8587c2 | ||
|
|
409c0d7fb4 | ||
|
|
15beaa9be8 | ||
|
|
574057da88 | ||
|
|
9274743df3 | ||
|
|
a5797a0bde | ||
|
|
97be497fda | ||
|
|
e1e228eae2 | ||
|
|
1ece31fa7a | ||
|
|
b27d2a6b62 | ||
|
|
475b6210e0 | ||
|
|
06895510e0 | ||
|
|
83b06b6c50 | ||
|
|
42fc89a944 | ||
|
|
9a951c499b | ||
|
|
86b06db9ff | ||
|
|
4e67d7b765 | ||
|
|
e4c52701b7 | ||
|
|
3c9f46941c | ||
|
|
b59c962f60 | ||
|
|
0d5c898106 | ||
|
|
c9c92f82d3 | ||
|
|
d57985b90a | ||
|
|
56fcb23275 | ||
|
|
dba199b531 | ||
|
|
193dd166c3 | ||
|
|
0a46bf52dd | ||
|
|
431e0bb341 | ||
|
|
beb54c1bc5 | ||
|
|
1afc4c9a29 | ||
|
|
96b4210d21 | ||
|
|
85fcecdcf6 | ||
|
|
55dc2b26d2 | ||
|
|
9c7a85826b | ||
|
|
4e6a2d5218 | ||
|
|
273f00a9c4 | ||
|
|
e876b9e4ab | ||
|
|
32de4aac6b | ||
|
|
d40040efd8 | ||
|
|
66e400013a | ||
|
|
3f95bfd82f | ||
|
|
fc4b191dea | ||
|
|
cad23ef1ad | ||
|
|
0e10702fad | ||
|
|
0012e23bf6 | ||
|
|
2801b9baf2 | ||
|
|
5dd07525dc | ||
|
|
d7cb61e5fc | ||
|
|
38447e2217 | ||
|
|
9629345473 | ||
|
|
4d72b0047a | ||
|
|
759aad047b | ||
|
|
db7f46a874 | ||
|
|
fd0262f708 | ||
|
|
a06d7bbfec | ||
|
|
16689f4d6e | ||
|
|
d1adc160ca | ||
|
|
0bd75716f2 | ||
|
|
a70ef78ead | ||
|
|
9782fe5459 | ||
|
|
5e509f7f19 | ||
|
|
3f257af006 | ||
|
|
7fac6062e5 | ||
|
|
7ba74143df | ||
|
|
e110e8fa57 | ||
|
|
d018ab18f8 | ||
|
|
dc22ac6b06 | ||
|
|
76b9c6781d | ||
|
|
856706bc1c | ||
|
|
0411befe8d | ||
|
|
8bf18b0d37 | ||
|
|
d54747c4df | ||
|
|
7e141f73d3 | ||
|
|
da3b329772 | ||
|
|
7f9dcc43ad | ||
|
|
274262262a | ||
|
|
79c0f31ddc | ||
|
|
49d61342c2 | ||
|
|
be0943f1ba | ||
|
|
41d40102f3 | ||
|
|
95e63f865c | ||
|
|
1496045c40 | ||
|
|
e2dadcd208 | ||
|
|
164c11e10a | ||
|
|
f4cc311806 | ||
|
|
df46b8ebdd | ||
|
|
070ac1e878 | ||
|
|
765884b0dc | ||
|
|
fe8cf9bc83 | ||
|
|
f45782aeef | ||
|
|
c2faff5a03 | ||
|
|
1cff18112b | ||
|
|
195b99e588 | ||
|
|
63ff8dd4c4 | ||
|
|
6019489ef1 | ||
|
|
fc79f92796 | ||
|
|
8e569a9ccd | ||
|
|
d7b2964e4e | ||
|
|
366edb7e90 | ||
|
|
9430135592 | ||
|
|
199b62d13f | ||
|
|
b0fc5a3618 | ||
|
|
b0f90cafb6 | ||
|
|
870c36e76b | ||
|
|
6e599908cd | ||
|
|
b1be5a4ba4 | ||
|
|
71f68da90b | ||
|
|
c11fd03362 | ||
|
|
ec1422a136 | ||
|
|
d56d1bc2bd | ||
|
|
45eca862ac | ||
|
|
89e98056e6 | ||
|
|
9f738f4871 | ||
|
|
3533a3fd4b | ||
|
|
5cf14aa886 | ||
|
|
9ee6a0a01a | ||
|
|
6d26ec2ab7 | ||
|
|
672acfe8fe | ||
|
|
6a4db90897 | ||
|
|
82587a70be | ||
|
|
0a18fcf732 | ||
|
|
d0ef9ca96c | ||
|
|
a5d5d42ba3 | ||
|
|
e08b731cb5 | ||
|
|
15441a46f7 | ||
|
|
a9a56bb1e9 | ||
|
|
e840be84eb | ||
|
|
0b40455e3c | ||
|
|
d9ea5a95af | ||
|
|
d1a4cfd5df | ||
|
|
23502d4fab | ||
|
|
37b70861d1 | ||
|
|
150d54eeda | ||
|
|
3690babf62 | ||
|
|
68b26a1091 | ||
|
|
9ca7ff73f4 | ||
|
|
c56064d189 | ||
|
|
5c371a20d2 | ||
|
|
424495c636 | ||
|
|
9c7e98f1cb | ||
|
|
d42157c5f8 | ||
|
|
502851856b | ||
|
|
23edcf3aa7 | ||
|
|
ca19306b72 | ||
|
|
66c0c14748 | ||
|
|
cffa493984 | ||
|
|
9030cdcc76 | ||
|
|
c3ef487a6f | ||
|
|
ac0eddf4c7 | ||
|
|
e373e797f4 | ||
|
|
382244035b | ||
|
|
b9c8c71274 | ||
|
|
96b2d88d39 | ||
|
|
474fc1fc57 | ||
|
|
3825e2fb38 | ||
|
|
e86e7f0bd8 | ||
|
|
c36f259571 | ||
|
|
501bae585a | ||
|
|
2c72f704d0 | ||
|
|
194de7b4e7 | ||
|
|
c03609142b | ||
|
|
5374f71732 | ||
|
|
c53d451000 | ||
|
|
f6747713a1 | ||
|
|
59ddf175ed | ||
|
|
ccd8d5f871 | ||
|
|
bd47ad2b8c | ||
|
|
e90019cdd8 | ||
|
|
be508c99ea | ||
|
|
71a77fc576 | ||
|
|
a028297da6 | ||
|
|
ac44b36b59 | ||
|
|
4c0635be7c | ||
|
|
67b863f9db | ||
|
|
7628ebc9ca | ||
|
|
deb6dad7ad | ||
|
|
077f052112 | ||
|
|
e7f57c9ddd | ||
|
|
095e2bf581 | ||
|
|
25345a0522 | ||
|
|
e2b5201b5a | ||
|
|
5c80a382bf | ||
|
|
aa940683d6 | ||
|
|
843c65d52b | ||
|
|
e26f4262df | ||
|
|
dde586e004 | ||
|
|
506c23ae89 | ||
|
|
e90e03e0cc | ||
|
|
335671b46a | ||
|
|
19b8c16057 | ||
|
|
dea3aac222 | ||
|
|
5d7281e470 | ||
|
|
a7d925a177 | ||
|
|
4ef4a06a7e | ||
|
|
29515491a2 | ||
|
|
6cb8d0a9d1 | ||
|
|
2c4574d93b | ||
|
|
4b767d4a57 | ||
|
|
2fde630971 | ||
|
|
5d461a72f6 | ||
|
|
fce5ee7a16 | ||
|
|
8ccb9cd892 | ||
|
|
d1af44bcdc | ||
|
|
5a6d20f817 | ||
|
|
942b4512fe | ||
|
|
3778b27574 | ||
|
|
15b340db56 | ||
|
|
ce5da22180 | ||
|
|
05b2c3c42b | ||
|
|
2dd732b924 | ||
|
|
110f73e622 | ||
|
|
bb0d118284 | ||
|
|
701ccadff3 | ||
|
|
34555504df | ||
|
|
d1f5220925 | ||
|
|
decd514b22 | ||
|
|
6cf7093293 | ||
|
|
17f11fa871 | ||
|
|
96812868a4 | ||
|
|
40c79158f7 | ||
|
|
054663ee00 | ||
|
|
81eee814e9 | ||
|
|
390a3c0d5a | ||
|
|
695dd655c0 | ||
|
|
05838cc477 | ||
|
|
c34ffedb42 | ||
|
|
96e02c9911 | ||
|
|
248fceb4b5 | ||
|
|
b5382b1bdf | ||
|
|
519cbc7601 | ||
|
|
92697d9468 | ||
|
|
d1ec9c92eb | ||
|
|
957da460a6 | ||
|
|
c664c14afc | ||
|
|
8f9f447acf | ||
|
|
2cee36d7b5 | ||
|
|
454cf5ea64 | ||
|
|
4563533e67 | ||
|
|
640e719eda | ||
|
|
aece2b1d90 | ||
|
|
43925e3088 | ||
|
|
1c236cce02 | ||
|
|
4956a517ca | ||
|
|
cb13655ecd | ||
|
|
9b3b6cec8f | ||
|
|
3ca1a1f1c7 | ||
|
|
a7210208d6 | ||
|
|
eaad23ff69 | ||
|
|
c7ddf0a2a9 | ||
|
|
b129ef873b | ||
|
|
d927426d70 | ||
|
|
d9c7df736c | ||
|
|
9ced137ded | ||
|
|
73244df019 | ||
|
|
91d24ebae8 | ||
|
|
6861e26ed6 | ||
|
|
a89da50e0a | ||
|
|
9256046b6c | ||
|
|
fd95dd8023 | ||
|
|
cda2b84939 | ||
|
|
34242e12ea | ||
|
|
efc67d14a5 | ||
|
|
d893fe63e7 | ||
|
|
5aedf85982 | ||
|
|
55ab79c004 | ||
|
|
7c7a72600d | ||
|
|
bd67e41aa6 | ||
|
|
01357654c0 | ||
|
|
cd5900481b | ||
|
|
601c6c53e7 | ||
|
|
b7ba740a3a | ||
|
|
ddef97d49f | ||
|
|
47b0449f22 | ||
|
|
0193460678 | ||
|
|
e02b3e78d2 | ||
|
|
a6167583a3 | ||
|
|
c91e0a6b74 | ||
|
|
c6852a9514 | ||
|
|
04b5240615 | ||
|
|
9183c4f04c | ||
|
|
483547cd9c | ||
|
|
345413cd1f | ||
|
|
046a60b89c | ||
|
|
da725e3ab1 | ||
|
|
edd34941cc | ||
|
|
c65686ef42 | ||
|
|
c7729f85df | ||
|
|
53b187c9b6 | ||
|
|
7bc18e41b1 | ||
|
|
8bc17eded5 | ||
|
|
9adeb1c63a | ||
|
|
091ed0dacd | ||
|
|
1e68eb0b90 | ||
|
|
332efd4106 | ||
|
|
cf0a47cab7 | ||
|
|
bb7b24346a | ||
|
|
f303191c54 | ||
|
|
a68e2e798b | ||
|
|
bd49f3c420 | ||
|
|
3c1d67267d | ||
|
|
d6c7f16ceb | ||
|
|
61e1933a5b | ||
|
|
f1912fe739 | ||
|
|
25c443098c | ||
|
|
2f7fe05d21 | ||
|
|
ee4b61f549 | ||
|
|
352c6e1d68 | ||
|
|
0e2444d7ce | ||
|
|
c4390819a2 | ||
|
|
51104268d8 | ||
|
|
cb5d43ab21 | ||
|
|
08de5cd377 | ||
|
|
274fa63658 | ||
|
|
81b2ed6551 | ||
|
|
d9c6c3947b | ||
|
|
2d6dbbdb16 | ||
|
|
b60faa1cab | ||
|
|
fd19953864 | ||
|
|
927bafd93a | ||
|
|
d93b21f0af | ||
|
|
511a4256bc | ||
|
|
3c9db86df2 | ||
|
|
367204a1ee | ||
|
|
6a8f6fa05a | ||
|
|
7f997c9411 | ||
|
|
2e3f98deb0 | ||
|
|
a5feb656e0 | ||
|
|
9329955328 | ||
|
|
5b99dd2685 | ||
|
|
19288fc8f5 | ||
|
|
9f97de5952 | ||
|
|
c476f7339c | ||
|
|
3dc1cf520a | ||
|
|
616c335a3b | ||
|
|
bbe55a75ea | ||
|
|
e58bf3a8cf | ||
|
|
1f2f866c61 | ||
|
|
6ccbc95697 | ||
|
|
52d9e0a195 | ||
|
|
6a3982347b | ||
|
|
fe7feeb74e | ||
|
|
6495f741b9 | ||
|
|
b2419beca6 | ||
|
|
b752b475d9 | ||
|
|
658fe79ad7 | ||
|
|
5bbf05ac8a | ||
|
|
d3210f0d3d | ||
|
|
a0dce925d4 |
@@ -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(
|
||||
|
||||
@@ -1,448 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['fehler'] = array(
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0001',
|
||||
'fehler_kurzbz' => 'zgvDatumInZukunft',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Datum in Zukunft',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => array('core'),
|
||||
'producerLibName' => 'ZgvDatumInZukunft',
|
||||
'resolverLibName' => 'CORE_ZGV_0001',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0002',
|
||||
'fehler_kurzbz' => 'zgvDatumVorGeburtsdatum',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Datum vor Geburtsdatum',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'ZgvDatumVorGeburtsdatum',
|
||||
'resolverLibName' => 'CORE_ZGV_0002',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0003',
|
||||
'fehler_kurzbz' => 'zgvMasterDatumInZukunft',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Masterdatum in Zukunft',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'ZgvMasterDatumInZukunft',
|
||||
'resolverLibName' => 'CORE_ZGV_0003',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0004',
|
||||
'fehler_kurzbz' => 'zgvMasterDatumVorZgvdatum',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Masterdatum vor Zgvdatum',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'ZgvMasterDatumVorZgvdatum',
|
||||
'resolverLibName' => 'CORE_ZGV_0004',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0005',
|
||||
'fehler_kurzbz' => 'zgvMasterDatumVorGeburtsdatum',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Masterdatum vor Geburtsdatum',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'ZgvMasterDatumVorGeburtsdatum',
|
||||
'resolverLibName' => 'CORE_ZGV_0005',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0001',
|
||||
'fehler_kurzbz' => 'keinAufenthaltszweckPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Kein Aufenthaltszweck gefunden',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'KeinAufenthaltszweckPlausi',
|
||||
'resolverLibName' => 'CORE_INOUT_0001',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0002',
|
||||
'fehler_kurzbz' => 'zuVieleZweckeIncomingPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Es sind %s Aufenthaltszwecke eingetragen (max. 1 Zweck für Incomings)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'ZuVieleZweckeIncomingPlausi',
|
||||
'resolverLibName' => 'CORE_INOUT_0002',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0003',
|
||||
'fehler_kurzbz' => 'falscherIncomingZweckPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Aufenthaltszweckcode ist %s (für Incomings ist nur Zweck 1, 2, 3 erlaubt)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'FalscherIncomingZweckPlausi',
|
||||
'resolverLibName' => 'CORE_INOUT_0003',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0004',
|
||||
'fehler_kurzbz' => 'outgoingAufenthaltfoerderungfehltPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Keine Aufenthaltsfoerderung angegeben (bei Outgoings >= 29 Tage Monat im Ausland muss mind. 1 gemeldet werden)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'OutgoingAufenthaltfoerderungfehltPlausi',
|
||||
'resolverLibName' => 'CORE_INOUT_0004',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0005',
|
||||
'fehler_kurzbz' => 'outgoingAngerechneteEctsFehlenPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Angerechnete ECTS fehlen (Meldepflicht bei Outgoings >= 29 Tage Monat im Ausland)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'OutgoingAngerechneteEctsFehlenPlausi',
|
||||
'resolverLibName' => 'CORE_INOUT_0005',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0006',
|
||||
'fehler_kurzbz' => 'outgoingErworbeneEctsFehlenPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Erworbene ECTS fehlen (Meldepflicht bei Outgoings >= 29 Tage Monat im Ausland)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'OutgoingErworbeneEctsFehlenPlausi',
|
||||
'resolverLibName' => 'CORE_INOUT_0006',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
|
||||
/** Plausichecks **/
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0007',
|
||||
'fehler_kurzbz' => 'IncomingHeimatNationOesterreich',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Heimatnation bei Incoming Österreich',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'IncomingHeimatNationOesterreich',
|
||||
'resolverLibName' => 'CORE_INOUT_0007',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0008',
|
||||
'fehler_kurzbz' => 'IncomingOhneIoDatensatz',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Incoming hat keinen IO Datensatz (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'IncomingOhneIoDatensatz',
|
||||
'resolverLibName' => 'CORE_INOUT_0008',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0009',
|
||||
'fehler_kurzbz' => 'IncomingOrGsFoerderrelevant',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Incoming oder gemeinsames Studium ist nicht als nicht förderrelevant markiert. (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'IncomingOrGsFoerderrelevant',
|
||||
'resolverLibName' => 'CORE_INOUT_0009',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STG_0001',
|
||||
'fehler_kurzbz' => 'StgPrestudentUngleichStgStudent',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Studiengang des Prestudenten ist ungleich dem Studiengang des Studenten. (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'StgPrestudentUngleichStgStudent',
|
||||
'resolverLibName' => 'CORE_STG_0001',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STG_0002',
|
||||
'fehler_kurzbz' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Es ist kein Studienplan mit Studiengang (%s) und Organisationsform (%s) des Studenten zugewiesen. (prestudent_id %s, Studiensemester %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'resolverLibName' => 'CORE_STG_0002',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STG_0003',
|
||||
'fehler_kurzbz' => 'PrestudentMischformOhneOrgform',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Organisationsform ist für Studierenden/BewerberIn in Mischformstudiengang nicht eingetragen. (prestudent_id %s, Studiensemester %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'PrestudentMischformOhneOrgform',
|
||||
'resolverLibName' => 'CORE_STG_0003',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STG_0004',
|
||||
'fehler_kurzbz' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Studiengang des Prestudenten passt nicht zu Studiengang des Studienplans. (prestudent_id %s, Studienplan %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'resolverLibName' => 'CORE_STG_0004',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0001',
|
||||
'fehler_kurzbz' => 'AbbrecherAktiv',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'AbbrecherIn hat aktiven Benutzer. (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'AbbrecherAktiv',
|
||||
'resolverLibName' => null,
|
||||
'producerIsResolver' => true
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0002',
|
||||
'fehler_kurzbz' => 'StudentstatusNachAbbrecher',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Aktiver Status nach Abbrecher Status. (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'StudentstatusNachAbbrecher',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0002',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0003',
|
||||
'fehler_kurzbz' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Ausbildungssemester %s des aktuellen Status stimmt nicht mit Ausbildungssemester %s bei StudentIn (Lehrverband) überein. (student_uid %s, prestudent_id %s, Studiensemester %s)',
|
||||
'fehlertyp_kurzbz' => 'warning',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0003',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0004',
|
||||
'fehler_kurzbz' => 'InaktiverStudentAktiverStatus',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Inaktiver Benutzer hat aktiven Status. (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'warning',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'InaktiverStudentAktiverStatus',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0004',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0005',
|
||||
'fehler_kurzbz' => 'InskriptionVorLetzerBismeldung',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Datum der Inskription liegt vor dem Datum der letzten BIS-Meldung %s. (prestudent_id %s, Studiensemester %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'InskriptionVorLetzerBismeldung',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0005',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0006',
|
||||
'fehler_kurzbz' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Datum und Studiensemester sind bei den Status in falscher Reihenfolge. (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0006',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0007',
|
||||
'fehler_kurzbz' => 'AktiverStudentOhneStatus',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Aktive/r StudentIn ohne aktuellen Status (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'AktiverStudentOhneStatus',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0007',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
//~ array(
|
||||
//~ 'fehlercode' => 'CORE_STUDENTSTATUS_0008',
|
||||
//~ 'fehler_kurzbz' => 'StudienplanUngueltig',
|
||||
//~ 'fehlercode_extern' => null,
|
||||
//~ 'fehlertext' => 'Studienplan %s ist im Ausbildungssemester %s nicht gültig (prestudent_id %s)',
|
||||
//~ 'fehlertyp_kurzbz' => 'error',
|
||||
//~ 'app' => 'core',
|
||||
//~ 'producerLibName' => 'StudienplanUngueltig',
|
||||
//~ 'resolverLibName' => 'CORE_STUDENTSTATUS_0008',
|
||||
//~ 'producerIsResolver' => false
|
||||
//~ ),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0009',
|
||||
'fehler_kurzbz' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Mehrere oder keine bestandenen Abschlussprüfungen (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0009',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0010',
|
||||
'fehler_kurzbz' => 'DatumAbschlusspruefungFehlt',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Kein Abschlussprüfung Datum (prestudent_id %s, abschlusspruefung_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'DatumAbschlusspruefungFehlt',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0010',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0011',
|
||||
'fehler_kurzbz' => 'DatumSponsionFehlt',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Kein Sponsionsdatum (prestudent_id %s, abschlusspruefung_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'DatumSponsionFehlt',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0011',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
//~ array(
|
||||
//~ 'fehlercode' => 'CORE_STUDENTSTATUS_0012',
|
||||
//~ 'fehler_kurzbz' => 'BewerberNichtZumRtAngetreten',
|
||||
//~ 'fehlercode_extern' => null,
|
||||
//~ 'fehlertext' => 'Bewerber nicht zum Reihungstest angetreten (prestudent_id %s)',
|
||||
//~ 'fehlertyp_kurzbz' => 'warning',
|
||||
//~ 'app' => 'core',
|
||||
//~ 'producerLibName' => 'BewerberNichtZumRtAngetreten',
|
||||
//~ 'resolverLibName' => 'CORE_STUDENTSTATUS_0012',
|
||||
//~ 'producerIsResolver' => false
|
||||
//~ ),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0013',
|
||||
'fehler_kurzbz' => 'AktSemesterNull',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Aktuelles Ausbildungssemester ist 0 (prestudent_id %s, Studiensemester %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'AktSemesterNull',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0013',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0014',
|
||||
'fehler_kurzbz' => 'AbschlussstatusFehlt',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Kein Abschlussstatus (prestudent_id %s)',
|
||||
'fehlertyp_kurzbz' => 'warning',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'AbschlussstatusFehlt',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0014',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0015',
|
||||
'fehler_kurzbz' => 'AktiverStudentstatusOhneKontobuchung',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Keine Kontobuchung bei aktivem Studentstatus (prestudent_id %s, Studiensemester %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'AktiverStudentstatusOhneKontobuchung',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0015',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_STUDENTSTATUS_0016',
|
||||
'fehler_kurzbz' => 'DualesStudiumOhneMarkierung',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'StudentIn in dualem Studiengang nicht als dual markiert (prestudent_id %s, Studienplan %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'DualesStudiumOhneMarkierung',
|
||||
'resolverLibName' => 'CORE_STUDENTSTATUS_0016',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_PERSON_0001',
|
||||
'fehler_kurzbz' => 'GbDatumWeitZurueck',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Geburtsdatum vor dem 01.01.1920',
|
||||
'fehlertyp_kurzbz' => 'warning',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'GbDatumWeitZurueck',
|
||||
'resolverLibName' => 'CORE_PERSON_0001',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_PERSON_0002',
|
||||
'fehler_kurzbz' => 'NationNichtOesterreichAberGemeinde',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Nation der Adresse ist ungleich Österreich, es ist aber eine österreichische Gemeinde (%s) angegeben (adresse_id %s)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'NationNichtOesterreichAberGemeinde',
|
||||
'resolverLibName' => 'CORE_PERSON_0002',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_PERSON_0003',
|
||||
'fehler_kurzbz' => 'FalscheAnzahlHeimatadressen',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Es sind mehrere oder keine Heimatadressen eingetragen',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'FalscheAnzahlHeimatadressen',
|
||||
'resolverLibName' => 'CORE_PERSON_0003',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_PERSON_0004',
|
||||
'fehler_kurzbz' => 'FalscheAnzahlZustelladressen',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Es sind mehrere oder keine Zustelladressen eingetragen',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'FalscheAnzahlZustelladressen',
|
||||
'resolverLibName' => 'CORE_PERSON_0004',
|
||||
'producerIsResolver' => false
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_PERSON_0005',
|
||||
'fehler_kurzbz' => 'geburtsnationFehlt',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Geburtsnation nicht vorhanden',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'GeburtsnationFehlt',
|
||||
'resolverLibName' => null,
|
||||
'producerIsResolver' => true
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_PERSON_0006',
|
||||
'fehler_kurzbz' => 'uhstatPersonkennungFehltCore',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Personkennung fehlt (vBpk AS, vBpk BF oder Ersatzkennzeichen fehlt)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core',
|
||||
'producerLibName' => 'UhstatPersonkennungFehltCore',
|
||||
'resolverLibName' => 'CORE_PERSON_0006',
|
||||
'producerIsResolver' => false
|
||||
)
|
||||
);
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
@@ -129,13 +146,19 @@ $route['api/frontend/v1/treemenudata/stv/.*'] = 'api/frontend/v1/stv/students/in
|
||||
$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)/stg/(:any)/orgform/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$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';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/le/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByLe/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/lv/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByLv/$1/$2';
|
||||
|
||||
|
||||
// load routes from extensions, also look for environment-specific configs
|
||||
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
|
||||
|
||||
@@ -26,7 +26,8 @@ $config['root'] = [
|
||||
'verband' => [
|
||||
'group'
|
||||
]
|
||||
],
|
||||
'orgform'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$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' => ['cis/eigene_zeitsperren: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' => ['cis/andere_zeitsperren: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
|
||||
|
||||
@@ -1916,7 +1916,7 @@ class Abgabe extends FHCAPI_Controller
|
||||
|
||||
if (!$mailres)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailBegutachterv2'), 'general');
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailZweitBegutachterv2'), 'general');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,10 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
{
|
||||
parent::__construct([
|
||||
'getByEmp' => ['admin:r', 'assistenz:r'],
|
||||
'getByLe' => ['admin:r', 'assistenz:r'],
|
||||
'getByLv' => ['admin:r', 'assistenz:r'],
|
||||
'getByStg' => ['admin:r', 'assistenz:r'],
|
||||
'getByStgOrgform' => ['admin:r', 'assistenz:r'],
|
||||
'loadByLV' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
@@ -77,41 +80,117 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
public function getByStg($studiensemester_kurzbz = null, $stg_kz = null, $semester = null)
|
||||
{
|
||||
$studiengang_kz = $this->getStudiengangKz($stg_kz);
|
||||
|
||||
if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
|
||||
public function getByLe($studiensemester_kurzbz = null, $lehreinheit_id = null)
|
||||
{
|
||||
if (is_null($lehreinheit_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$verband = null;
|
||||
if (!is_null($semester) && !is_numeric($semester))
|
||||
{
|
||||
$verband = $this->getOrgformKurzbz($semester);
|
||||
$semester = null;
|
||||
}
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$lehreinheiten = $this->_ci->LehreinheitModel->getByLeStudiensemester($lehreinheit_id, $studiensemester_kurzbz);
|
||||
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
$this->terminateWithSuccess($lehreinheiten_data);
|
||||
}
|
||||
|
||||
public function getByLv($studiensemester_kurzbz = null, $lehrveranstaltung_id = null)
|
||||
{
|
||||
if (is_null($lehrveranstaltung_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
|
||||
|
||||
$studienplan_ids = array();
|
||||
$only_ids = array();
|
||||
$placeholders = array();
|
||||
$tree = [];
|
||||
|
||||
if (hasData($studienplan_data))
|
||||
$this->_ci->LehrveranstaltungModel->addSelect('studiengang_kz');
|
||||
$lv = $this->_ci->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
$lv = $this->getDataOrTerminateWithError($lv);
|
||||
|
||||
if (empty($lv))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehrveranstaltungen_data = array();
|
||||
foreach ($this->_loadLvRows(current($lv)->studiengang_kz, $studiensemester_kurzbz) as $row)
|
||||
{
|
||||
foreach (getData($studienplan_data) as $studienplan) {
|
||||
$placeholders[] = "(?, ?)";
|
||||
$studienplan_ids[] = $studienplan->studienplan_id;
|
||||
$studienplan_ids[] = $studienplan->semester;
|
||||
$only_ids[] = $studienplan->studienplan_id;
|
||||
if ((string)$row->lehrveranstaltung_id === (string)$lehrveranstaltung_id)
|
||||
{
|
||||
$lehrveranstaltungen_data[] = $row;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
|
||||
$lehrveranstaltungen_data = hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
|
||||
if (empty($lehrveranstaltungen_data))
|
||||
{
|
||||
|
||||
$this->_ci->LehrveranstaltungModel->addSelect('
|
||||
tbl_lehrveranstaltung.*,
|
||||
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
|
||||
lehrveranstaltung_id,
|
||||
lehrtyp_kurzbz,
|
||||
studiengang_kz as lv_studiengang_kz,
|
||||
UPPER(CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz)) as studiengang,
|
||||
semester as semester,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
ects as lv_ects,
|
||||
lehreverzeichnis as lv_lehreverzeichnis,
|
||||
planfaktor as lv_planfaktor,
|
||||
planlektoren as lv_planlektoren,
|
||||
planpersonalkosten as lv_planpersonalkosten,
|
||||
plankostenprolektor as lv_plankostenprolektor,
|
||||
tbl_lehrveranstaltung.orgform_kurzbz as orgform_kurzbz,
|
||||
tbl_lehrveranstaltung.sprache as sprache,
|
||||
lehrform_kurzbz as lv_lehrform_kurzbz,
|
||||
tbl_lehrveranstaltung.bezeichnung_english as lv_bezeichnung_english,
|
||||
semesterstunden as lv_semesterstunden,
|
||||
');
|
||||
$this->_ci->LehrveranstaltungModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$lehrveranstaltungen = $this->_ci->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
}
|
||||
|
||||
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
|
||||
{
|
||||
$lehreinheiten = $this->_ci->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
if (!isset($lehrveranstaltung->_children))
|
||||
{
|
||||
$lehrveranstaltung->_children = $lehreinheiten_data;
|
||||
}
|
||||
$tree[] = $lehrveranstaltung;
|
||||
}
|
||||
|
||||
$counter = 0;
|
||||
$this->assignUniqueIndex($tree, $counter);
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
|
||||
public function getByStg($studiensemester_kurzbz = null, $stg_kz = null, $semester = null)
|
||||
{
|
||||
$this->_getLvTree($studiensemester_kurzbz, $stg_kz, $semester, null);
|
||||
}
|
||||
|
||||
public function getByStgOrgform($studiensemester_kurzbz = null, $stg_kz = null, $orgform = null, $semester = null)
|
||||
{
|
||||
$orgform_kurzbz = $this->getOrgformKurzbz($orgform);
|
||||
$this->_getLvTree($studiensemester_kurzbz, $stg_kz, $semester, $orgform_kurzbz);
|
||||
}
|
||||
|
||||
private function _getLvTree($studiensemester_kurzbz, $stg_kz, $semester, $orgform_kurzbz)
|
||||
{
|
||||
$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);
|
||||
|
||||
if (!is_null($semester) && !ctype_digit((string)$semester))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$lehrveranstaltungen_data = $this->_loadLvRows($studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
|
||||
|
||||
$tree = [];
|
||||
foreach ($lehrveranstaltungen_data as $row)
|
||||
@@ -244,6 +323,31 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$this->LehreinheitModel->getLvsByFachbereich($fachbereich, $studiensemester_kurzbz, $mitarbeiter_uid);
|
||||
}*/
|
||||
|
||||
private function _loadLvRows($studiengang_kz, $studiensemester_kurzbz, $semester = null, $orgform_kurzbz = null)
|
||||
{
|
||||
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
|
||||
|
||||
$studienplan_ids = array();
|
||||
$only_ids = array();
|
||||
$placeholders = array();
|
||||
|
||||
if (hasData($studienplan_data))
|
||||
{
|
||||
foreach (getData($studienplan_data) as $studienplan) {
|
||||
$placeholders[] = "(?, ?)";
|
||||
$studienplan_ids[] = $studienplan->studienplan_id;
|
||||
$studienplan_ids[] = $studienplan->semester;
|
||||
$only_ids[] = $studienplan->studienplan_id;
|
||||
}
|
||||
}
|
||||
|
||||
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
|
||||
return hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
@@ -309,8 +413,8 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return $orgform_kurzbz;
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,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
|
||||
|
||||
@@ -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' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenFixeMa' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenLector' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenOes' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getZeitsperrenAss' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getStgLectors' => self::PERM_LOGGED,
|
||||
'loadZeitsperrenLectorStg' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'loadZeitsperrenMa' => ['cis/andere_zeitsperren: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
@@ -25,7 +25,19 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class Ort extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
// advanced filters of getRooms: tbl_ort column => filter type, the same list as in Raumsuche.js.
|
||||
// text: contains, case-insensitive; select: equals; range: <column>_min, <column>_max; flag: true; exists: not null
|
||||
const ADVANCED_FILTERS = [
|
||||
'ort_kurzbz' => 'text',
|
||||
'bezeichnung' => 'text',
|
||||
'planbezeichnung' => 'text',
|
||||
'stockwerk' => 'range',
|
||||
'gebteil' => 'select',
|
||||
'm2' => 'range',
|
||||
'lehre' => 'flag',
|
||||
'content_id' => 'exists'
|
||||
];
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
@@ -36,7 +48,10 @@ 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,
|
||||
'getStandorte' => self::PERM_LOGGED,
|
||||
'getAdvancedFilterOptions' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
@@ -56,6 +71,17 @@ class Ort extends FHCAPI_Controller
|
||||
$this->form_validation->set_rules('datum','Datum','required');
|
||||
$this->form_validation->set_rules('von','Uhrzeit Von','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('bis','Uhrzeit Bis','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('standort_id','Standort','regex_match[/^([0-9]+|none)$/]');
|
||||
foreach (self::ADVANCED_FILTERS as $column => $type) {
|
||||
if ($type == 'range') {
|
||||
$this->form_validation->set_rules($column.'_min', $column, 'numeric');
|
||||
$this->form_validation->set_rules($column.'_max', $column, 'numeric');
|
||||
} elseif ($type == 'flag' || $type == 'exists') {
|
||||
$this->form_validation->set_rules($column, $column, 'in_list[true]');
|
||||
} else {
|
||||
$this->form_validation->set_rules($column, $column, 'max_length[255]');
|
||||
}
|
||||
}
|
||||
if($this->form_validation->run() == FALSE) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
@@ -65,6 +91,7 @@ class Ort extends FHCAPI_Controller
|
||||
$bis = $this->input->get('bis', TRUE);
|
||||
$typ = $this->input->get('typ', TRUE);
|
||||
$personenanzahl = $this->input->get('personenanzahl', TRUE);
|
||||
$standort_id = $this->input->get('standort_id', TRUE);
|
||||
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
@@ -74,22 +101,36 @@ 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.*
|
||||
$qry = "SELECT DISTINCT tbl_ort.*, tbl_standort.bezeichnung AS standort
|
||||
FROM public.tbl_ort JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
|
||||
WHERE aktiv AND lehre AND ort_kurzbz NOT LIKE '\\\\_%'";
|
||||
LEFT JOIN public.tbl_standort USING(standort_id)
|
||||
WHERE aktiv AND reservieren";
|
||||
if($typ) {
|
||||
$params[] = $typ;
|
||||
$qry.= "AND raumtyp_kurzbz = ?";
|
||||
$qry.= " AND raumtyp_kurzbz = ?";
|
||||
}
|
||||
|
||||
if($standort_id === 'none') { // rooms without a Standort
|
||||
$qry.= " AND standort_id IS NULL";
|
||||
} elseif($standort_id) {
|
||||
$params[] = $standort_id;
|
||||
$qry.= " AND standort_id = ?";
|
||||
} else {
|
||||
$qry.= " AND standort_id IS NOT NULL";
|
||||
}
|
||||
|
||||
$qry.= $this->advancedFilterSql($params);
|
||||
|
||||
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
|
||||
$qry.= ' AND raumtyp_kurzbz IN ?';
|
||||
$params[] = $this->config->item('roomtypes_student');
|
||||
$this->addMeta('config', $this->config->item('roomtypes_student'));
|
||||
}
|
||||
|
||||
$qry.= "AND (max_person>= ? OR max_person is null)";
|
||||
$qry.= " AND (max_person>= ? OR max_person is null)";
|
||||
$params[] = $personenanzahl;
|
||||
|
||||
$qry.=" AND ort_kurzbz NOT IN
|
||||
@@ -127,6 +168,41 @@ class Ort extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Standorte of the rooms that pass the base filter of getRooms
|
||||
*/
|
||||
public function getStandorte()
|
||||
{
|
||||
$qry = "SELECT DISTINCT standort_id, tbl_standort.bezeichnung
|
||||
FROM public.tbl_ort JOIN public.tbl_standort USING(standort_id)
|
||||
WHERE aktiv AND reservieren
|
||||
ORDER BY tbl_standort.bezeichnung";
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry);
|
||||
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Values of the select filters: column => distinct values of the rooms that pass the base filter of getRooms
|
||||
*/
|
||||
public function getAdvancedFilterOptions()
|
||||
{
|
||||
$options = [];
|
||||
foreach (self::ADVANCED_FILTERS as $column => $type) {
|
||||
if ($type != 'select')
|
||||
continue;
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery("SELECT DISTINCT ".$column." AS value
|
||||
FROM public.tbl_ort
|
||||
WHERE aktiv AND reservieren AND ".$column." <> ''
|
||||
ORDER BY ".$column);
|
||||
$options[$column] = array_column($this->getDataOrTerminateWithError($result), 'value');
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
@@ -174,5 +250,60 @@ 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);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* SQL conditions of the advanced filters in the GET parameters, adds their values to $params
|
||||
*/
|
||||
private function advancedFilterSql(&$params)
|
||||
{
|
||||
// no xss_clean: the values are bound, and it could change a select value so that it no longer equals the column
|
||||
$sql = '';
|
||||
foreach (self::ADVANCED_FILTERS as $column => $type) {
|
||||
if ($type == 'range') {
|
||||
$min = $this->input->get($column.'_min');
|
||||
$max = $this->input->get($column.'_max');
|
||||
if ($min !== null && $min !== '') {
|
||||
$sql.= " AND tbl_ort.".$column." >= ?::numeric";
|
||||
$params[] = $min;
|
||||
}
|
||||
if ($max !== null && $max !== '') {
|
||||
$sql.= " AND tbl_ort.".$column." <= ?::numeric";
|
||||
$params[] = $max;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$value = $this->input->get($column);
|
||||
if ($value === null || $value === '')
|
||||
continue;
|
||||
|
||||
if ($type == 'flag') {
|
||||
$sql.= " AND tbl_ort.".$column;
|
||||
} elseif ($type == 'exists') {
|
||||
$sql.= " AND tbl_ort.".$column." IS NOT NULL";
|
||||
} elseif ($type == 'select') {
|
||||
$sql.= " AND tbl_ort.".$column." = ?";
|
||||
$params[] = $value;
|
||||
} else {
|
||||
$sql.= " AND strpos(lower(tbl_ort.".$column."), lower(?)) > 0";
|
||||
$params[] = $value;
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,367 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getZeitsperrenUser' => ['cis/eigene_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getTypenZeitsperren' => self::PERM_LOGGED,
|
||||
'getTypenErreichbarkeit' => self::PERM_LOGGED,
|
||||
'getStunden' => self::PERM_LOGGED,
|
||||
'loadZeitsperre' => ['cis/eigene_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'add' => ['cis/eigene_zeitsperren:rw', 'admin:rw', 'assistenz:rw'],
|
||||
'update' => ['cis/eigene_zeitsperren:rw', 'admin:rw', 'assistenz:rw'],
|
||||
'delete' => ['cis/eigene_zeitsperren:rw', 'admin:rw', 'assistenz:rw'],
|
||||
]);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,6 +101,9 @@ class Widget extends FHCAPI_Controller
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
$widget->permitted = empty($widget->berechtigung_kurzbz)
|
||||
|| $this->permissionlib->isBerechtigt($widget->berechtigung_kurzbz);
|
||||
|
||||
return $widget;
|
||||
}, $widgets);
|
||||
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
class IssueChecker extends FHCAPI_Controller
|
||||
{
|
||||
const DEFAULT_PERMISSION = 'system/issues_verwalten:r';
|
||||
|
||||
protected $person_id;
|
||||
protected $_extensionName = null;
|
||||
protected $_fehlercodes = [];
|
||||
protected $_apps = [];
|
||||
|
||||
protected $errors = [];
|
||||
protected $infos = [];
|
||||
|
||||
public function __construct($permissions = [])
|
||||
{
|
||||
$default_permissions = [
|
||||
'checkPerson' => self::DEFAULT_PERMISSION,
|
||||
'countPersonOpenIssues' => self::DEFAULT_PERMISSION
|
||||
];
|
||||
|
||||
if(!is_array($permissions))
|
||||
{
|
||||
$this->terminateWithError("Issue Checker: permissions must be an array");
|
||||
}
|
||||
|
||||
$merged_permissions = array_merge($default_permissions, $permissions);
|
||||
|
||||
parent::__construct($merged_permissions);
|
||||
|
||||
$this->load->model('system/Issue_model', 'IssueModel');
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$producerArgs = [];
|
||||
$resolverArgs = [];
|
||||
|
||||
// get fehler kurzbz from fehlercodes, if fehlercodes provided
|
||||
if (!isEmptyArray($this->_fehlercodes))
|
||||
{
|
||||
$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz');
|
||||
$this->FehlerModel->db->where_in('tbl_fehler.fehlercode', $this->_fehlercodes);
|
||||
$fehlerKurzbzRes = $this->FehlerModel->load();
|
||||
|
||||
if (isError($fehlerKurzbzRes)) $this->terminateWithError(getError($fehlerKurzbzRes), self::ERROR_TYPE_GENERAL);
|
||||
if (hasData($fehlerKurzbzRes))
|
||||
{
|
||||
$producerArgs['fehlerKurzbz'] = array_column(getData($fehlerKurzbzRes), 'fehler_kurzbz');
|
||||
$resolverArgs['fehlercode'] = array_column(getData($fehlerKurzbzRes), 'fehlercode');
|
||||
}
|
||||
}
|
||||
elseif (!isEmptyArray($this->_apps)) // if apps are provided
|
||||
{
|
||||
// get fehlercodes for the apps
|
||||
$fehlerRes = $this->FehlerModel->getByApps($this->_apps);
|
||||
if (hasData($fehlerRes)) $this->_fehlercodes = array_column(getData($fehlerRes), 'fehlercode');
|
||||
|
||||
$producerArgs['apps'] = $this->_apps;
|
||||
$resolverArgs['apps'] = $this->_apps;
|
||||
}
|
||||
|
||||
// load producer and checker libraries with fehler kurbz and fehlercode list
|
||||
$this->load->library(
|
||||
'issues/PlausicheckProducerLib',
|
||||
$producerArgs,
|
||||
'PlausicheckProducerLib'
|
||||
);
|
||||
|
||||
$this->load->library(
|
||||
'issues/PlausicheckResolverLib',
|
||||
$resolverArgs,
|
||||
'PlausicheckResolverLib'
|
||||
);
|
||||
|
||||
$this->load->library('PhrasesLib');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function checkPerson()
|
||||
{
|
||||
$person_id = $this->input->post('person_id', true);
|
||||
$hauptzustaendig = filter_var($this->input->post('hauptzustaendig', true), FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if (!is_numeric($person_id)) $this->terminateWithError($this->p->t('ui', 'error_invalidId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->person_id = intval($person_id);
|
||||
$this->hauptzustaendig = $hauptzustaendig;
|
||||
|
||||
$persRes = $this->PersonModel->load($this->person_id);
|
||||
if (!hasData($persRes)) $this->terminateWithError('Person with id ' . $this->person_id . ' not found.', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->_produceIssues();
|
||||
$this->_resolveIssues();
|
||||
$this->_produceIssues();
|
||||
|
||||
$openIssueCountRes = $this->_countOpenIssues();
|
||||
if (isError($openIssueCountRes)) $this->terminateWithError(getError($openIssueCountRes), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$data = array(
|
||||
'person_id' => $this->person_id,
|
||||
'openissues' => hasData($openIssueCountRes) ? getData($openIssueCountRes) : 0
|
||||
);
|
||||
|
||||
$this->addMeta('errors', $this->errors);
|
||||
$this->addMeta('infos', $this->infos);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function countPersonOpenIssues()
|
||||
{
|
||||
$person_id = $this->input->get('person_id', true);
|
||||
$hauptzustaendig = filter_var($this->input->get('hauptzustaendig', true), FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if (!is_numeric($person_id)) $this->terminateWithError($this->p->t('ui', 'error_invalidId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->person_id = intval($person_id);
|
||||
$this->hauptzustaendig = $hauptzustaendig;
|
||||
|
||||
$persRes = $this->PersonModel->load($this->person_id);
|
||||
|
||||
if (!hasData($persRes)) $this->terminateWithError('Person with id ' . $this->person_id . ' not found.', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$openIssueCountRes = $this->_countOpenIssues();
|
||||
if (isError($openIssueCountRes)) $this->terminateWithError(getError($openIssueCountRes), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$data = array(
|
||||
'person_id' => $this->person_id,
|
||||
'openissues' => hasData($openIssueCountRes) ? getData($openIssueCountRes) : 0
|
||||
);
|
||||
|
||||
$this->addMeta('errors', $this->errors);
|
||||
$this->addMeta('infos', $this->infos);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
protected function _countOpenIssues()
|
||||
{
|
||||
if (isEmptyArray($this->_fehlercodes)) return success([]);
|
||||
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(
|
||||
$this->_fehlercodes,
|
||||
$this->person_id,
|
||||
$oe_kurzbz = null,
|
||||
$fehlercode_extern = null,
|
||||
$this->hauptzustaendig
|
||||
);
|
||||
|
||||
// log error if occured
|
||||
if (isError($openIssuesRes)) return $openIssuesRes;
|
||||
|
||||
$issues = hasData($openIssuesRes) ? getData($openIssuesRes) : [];
|
||||
$issuescount = is_array($issues) || $issues instanceof Countable ? count($issues) : 0;
|
||||
|
||||
return success($issuescount);
|
||||
}
|
||||
|
||||
protected function _produceIssues()
|
||||
{
|
||||
$result = $this->PlausicheckProducerLib->producePlausicheckIssues(
|
||||
array('person_id' => $this->person_id)
|
||||
);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isset($result->errors))
|
||||
$this->errors = array_merge($this->errors, $result->errors);
|
||||
if (isset($result->infos))
|
||||
$this->infos = array_merge($this->infos, $result->infos);
|
||||
}
|
||||
|
||||
protected function _resolveIssues()
|
||||
{
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(
|
||||
$this->_fehlercodes,
|
||||
$this->person_id
|
||||
);
|
||||
|
||||
if (hasData($openIssuesRes))
|
||||
{
|
||||
$openIssues = getData($openIssuesRes);
|
||||
|
||||
$result = $this->PlausicheckResolverLib->resolvePlausicheckIssues($openIssues);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isset($result->errors))
|
||||
$this->errors = array_merge($this->errors, $result->errors);
|
||||
if (isset($result->infos))
|
||||
$this->infos = array_merge($this->infos, $result->infos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Issues extends FHCAPI_Controller
|
||||
{
|
||||
const DEFAULT_PERMISSION = 'system/issues_verwalten:r';
|
||||
|
||||
public function __construct() {
|
||||
|
||||
parent::__construct(
|
||||
array(
|
||||
'getOpenIssuesByProperties' => Self::DEFAULT_PERMISSION,
|
||||
'getPersonenMitOffenenIssues' => Self::DEFAULT_PERMISSION
|
||||
)
|
||||
);
|
||||
|
||||
// Loads authentication library and starts authenticationfetc
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
$this->load->model('extensions/FHC-Core-Personalverwaltung/Api_model','ApiModel');
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$this->load->model('system/Fehler_model','FehlerModel');
|
||||
$this->load->model('system/Issue_model', 'IssueModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
public function getOpenIssuesByProperties()
|
||||
{
|
||||
$person_id = $this->input->get('person_id', true);
|
||||
$oe_kurzbz = $this->input->get('oe_kurzbz', true);
|
||||
$fehlertyp_kurzbz = $this->input->get('fehlertyp_kurzbz', true);
|
||||
$apps = $this->input->get('apps', true);
|
||||
$behebung_parameter = $this->input->get('behebung_parameter', true);
|
||||
$hauptzustaendig = filter_var($this->input->get('hauptzustaendig', true), FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if (isset($person_id) && !is_numeric($person_id))
|
||||
$this->terminateWithError('person id is not numeric!');
|
||||
|
||||
if (isset($behebung_parameter) && !is_array($behebung_parameter))
|
||||
$this->terminateWithError('Behebung parameter invalid');
|
||||
|
||||
$issueRes = $this->IssueModel->getOpenIssuesByProperties(
|
||||
$person_id,
|
||||
$oe_kurzbz,
|
||||
$fehlertyp_kurzbz,
|
||||
$apps,
|
||||
$behebung_parameter,
|
||||
$hauptzustaendig
|
||||
);
|
||||
|
||||
if (isError($issueRes))
|
||||
{
|
||||
$this->terminateWithError(getError($issueRes));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(hasData($issueRes) ? getData($issueRes) : []);
|
||||
}
|
||||
|
||||
public function getPersonenMitOffenenIssues()
|
||||
{
|
||||
|
||||
$sql = <<<EOSQL
|
||||
SELECT
|
||||
|
||||
person_id, uid, vorname, nachname, count(*) AS openissues ,
|
||||
(select count(*) anz_aktiv
|
||||
from hr.tbl_dienstverhaeltnis dv
|
||||
where dv.mitarbeiter_uid=uid and dv.von<=now() and
|
||||
(dv.bis is null OR dv.bis>=now())
|
||||
) aktiv
|
||||
FROM
|
||||
system.tbl_issue
|
||||
JOIN
|
||||
system.tbl_fehler USING (fehlercode)
|
||||
JOIN
|
||||
public.tbl_person USING (person_id)
|
||||
JOIN
|
||||
public.tbl_benutzer USING (person_id)
|
||||
JOIN
|
||||
public.tbl_mitarbeiter ON uid = mitarbeiter_uid
|
||||
WHERE
|
||||
app = 'personalverwaltung' AND verarbeitetamum IS NULL
|
||||
GROUP BY
|
||||
person_id, uid, vorname, nachname
|
||||
HAVING
|
||||
count(*) > 0
|
||||
ORDER BY
|
||||
count(*) DESC;
|
||||
|
||||
EOSQL;
|
||||
|
||||
$personenmitissues = $this->IssueModel->execReadOnlyQuery($sql);
|
||||
if( hasData($personenmitissues) )
|
||||
{
|
||||
$this->terminateWithSuccess(getData($personenmitissues));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithSuccess(array());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH.'/controllers/api/frontend/v1/issues/IssueChecker.php';
|
||||
|
||||
class StudentIssueChecker extends IssueChecker
|
||||
{
|
||||
protected $_apps = array(
|
||||
'core',
|
||||
'dvuh',
|
||||
'bis'
|
||||
);
|
||||
|
||||
//protected $_fehlercodes = array(
|
||||
//~ 'CORE_AA_0001'
|
||||
//);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,8 @@ class Studiensemester extends FHCAPI_Controller
|
||||
'getStudienjahrByStudiensemester' => self::PERM_LOGGED,
|
||||
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED,
|
||||
'current' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
'set' => self::PERM_LOGGED,
|
||||
'getContainingOrNearestByDateRange' => self::PERM_LOGGED,
|
||||
)
|
||||
);
|
||||
// Load model StudiensemesterModel
|
||||
@@ -203,4 +204,15 @@ class Studiensemester extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function getContainingOrNearestByDateRange()
|
||||
{
|
||||
$from = $this->input->get("from");
|
||||
$to = $this->input->get("to");
|
||||
|
||||
$result = $this->StudiensemesterModel->getContainingOrNearestByDateRange($from, $to);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -574,6 +574,19 @@ class Kontakt extends FHCAPI_Controller
|
||||
$person_id = $this->input->post('person_id');
|
||||
$standort_id = $this->input->post('standort_id');
|
||||
|
||||
//check person_id: allow editing only of persons who are no mitarbeiter
|
||||
if($person_id)
|
||||
{
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->BenutzerModel->addJoin('public.tbl_mitarbeiter ma', 'ON (ma.mitarbeiter_uid = public.tbl_benutzer.uid)');
|
||||
|
||||
$result = $this->BenutzerModel->loadWhere([
|
||||
'person_id' => $person_id
|
||||
]);
|
||||
if(hasData($result))
|
||||
return $this->terminateWithError($this->p->t('ui', 'editingMitarbeiterPVonly'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->KontaktModel->update(
|
||||
[
|
||||
'kontakt_id' => $kontakt_id
|
||||
|
||||
@@ -370,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));
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -108,6 +108,7 @@ class Students extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
"(
|
||||
@@ -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(
|
||||
"(
|
||||
@@ -213,6 +215,7 @@ class Students extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
"(
|
||||
|
||||
@@ -13,6 +13,7 @@ class Mylv extends Auth_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'Student' => self::PERM_LOGGED,
|
||||
'Studiensemester' => 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');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,46 +5,58 @@
|
||||
*/
|
||||
class IssueResolver extends IssueResolver_Controller
|
||||
{
|
||||
protected $_fehlercodes = array(
|
||||
'CORE_ZGV_0001',
|
||||
'CORE_ZGV_0002',
|
||||
'CORE_ZGV_0003',
|
||||
'CORE_ZGV_0004',
|
||||
'CORE_ZGV_0005',
|
||||
'CORE_INOUT_0001',
|
||||
'CORE_INOUT_0002',
|
||||
'CORE_INOUT_0003',
|
||||
'CORE_INOUT_0004',
|
||||
'CORE_INOUT_0005',
|
||||
'CORE_INOUT_0006',
|
||||
'CORE_INOUT_0007',
|
||||
'CORE_INOUT_0008',
|
||||
'CORE_INOUT_0009',
|
||||
'CORE_STG_0001',
|
||||
'CORE_STG_0002',
|
||||
'CORE_STG_0003',
|
||||
'CORE_STG_0004',
|
||||
'CORE_STUDENTSTATUS_0001',
|
||||
'CORE_STUDENTSTATUS_0002',
|
||||
'CORE_STUDENTSTATUS_0003',
|
||||
'CORE_STUDENTSTATUS_0004',
|
||||
'CORE_STUDENTSTATUS_0005',
|
||||
'CORE_STUDENTSTATUS_0006',
|
||||
'CORE_STUDENTSTATUS_0007',
|
||||
'CORE_STUDENTSTATUS_0008',
|
||||
'CORE_STUDENTSTATUS_0009',
|
||||
'CORE_STUDENTSTATUS_0010',
|
||||
'CORE_STUDENTSTATUS_0011',
|
||||
'CORE_STUDENTSTATUS_0012',
|
||||
'CORE_STUDENTSTATUS_0013',
|
||||
'CORE_STUDENTSTATUS_0014',
|
||||
'CORE_STUDENTSTATUS_0015',
|
||||
'CORE_STUDENTSTATUS_0016',
|
||||
'CORE_PERSON_0001',
|
||||
'CORE_PERSON_0002',
|
||||
'CORE_PERSON_0003',
|
||||
'CORE_PERSON_0004',
|
||||
'CORE_PERSON_0005',
|
||||
'CORE_PERSON_0006'
|
||||
);
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// set fehler codes which can be resolved by the job, with own resolver defined
|
||||
// structure: fehlercode => class (library) name for resolving in "resolvers" folder
|
||||
$this->_codeLibMappings = array(
|
||||
'CORE_ZGV_0001' => 'CORE_ZGV_0001',
|
||||
'CORE_ZGV_0002' => 'CORE_ZGV_0002',
|
||||
'CORE_ZGV_0003' => 'CORE_ZGV_0003',
|
||||
'CORE_ZGV_0004' => 'CORE_ZGV_0004',
|
||||
'CORE_ZGV_0005' => 'CORE_ZGV_0005',
|
||||
'CORE_INOUT_0001' => 'CORE_INOUT_0001',
|
||||
'CORE_INOUT_0002' => 'CORE_INOUT_0002',
|
||||
'CORE_INOUT_0003' => 'CORE_INOUT_0003',
|
||||
'CORE_INOUT_0004' => 'CORE_INOUT_0004',
|
||||
'CORE_INOUT_0005' => 'CORE_INOUT_0005',
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006',
|
||||
'CORE_INOUT_0007' => 'CORE_INOUT_0007',
|
||||
'CORE_INOUT_0008' => 'CORE_INOUT_0008',
|
||||
'CORE_INOUT_0009' => 'CORE_INOUT_0009',
|
||||
'CORE_STG_0001' => 'CORE_STG_0001',
|
||||
'CORE_STG_0002' => 'CORE_STG_0002',
|
||||
'CORE_STG_0003' => 'CORE_STG_0003',
|
||||
'CORE_STG_0004' => 'CORE_STG_0004',
|
||||
'CORE_STUDENTSTATUS_0002' => 'CORE_STUDENTSTATUS_0002',
|
||||
'CORE_STUDENTSTATUS_0003' => 'CORE_STUDENTSTATUS_0003',
|
||||
'CORE_STUDENTSTATUS_0004' => 'CORE_STUDENTSTATUS_0004',
|
||||
'CORE_STUDENTSTATUS_0005' => 'CORE_STUDENTSTATUS_0005',
|
||||
'CORE_STUDENTSTATUS_0006' => 'CORE_STUDENTSTATUS_0006',
|
||||
'CORE_STUDENTSTATUS_0007' => 'CORE_STUDENTSTATUS_0007',
|
||||
'CORE_STUDENTSTATUS_0008' => 'CORE_STUDENTSTATUS_0008',
|
||||
'CORE_STUDENTSTATUS_0009' => 'CORE_STUDENTSTATUS_0009',
|
||||
'CORE_STUDENTSTATUS_0010' => 'CORE_STUDENTSTATUS_0010',
|
||||
'CORE_STUDENTSTATUS_0011' => 'CORE_STUDENTSTATUS_0011',
|
||||
'CORE_STUDENTSTATUS_0012' => 'CORE_STUDENTSTATUS_0012',
|
||||
'CORE_STUDENTSTATUS_0013' => 'CORE_STUDENTSTATUS_0013',
|
||||
'CORE_STUDENTSTATUS_0014' => 'CORE_STUDENTSTATUS_0014',
|
||||
'CORE_STUDENTSTATUS_0015' => 'CORE_STUDENTSTATUS_0015',
|
||||
'CORE_STUDENTSTATUS_0016' => 'CORE_STUDENTSTATUS_0016',
|
||||
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
|
||||
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
|
||||
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
|
||||
'CORE_PERSON_0004' => 'CORE_PERSON_0004',
|
||||
'CORE_PERSON_0005' => 'CORE_PERSON_0005',
|
||||
'CORE_PERSON_0006' => 'CORE_PERSON_0006'
|
||||
);
|
||||
|
||||
// fehler which are resolved by the job the same way as they are produced
|
||||
// structure: fehlercode => class (library) name for resolving in "plausichecks" folder
|
||||
$this->_codeProducerLibMappings = array(
|
||||
'CORE_STUDENTSTATUS_0001' => 'AbbrecherAktiv',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
class PlausiIssueProducer extends PlausiIssueProducer_Controller
|
||||
{
|
||||
private $_currentStudiensemester;
|
||||
protected $_apps = 'core';
|
||||
protected $_app = 'core';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -18,12 +18,12 @@ class PlausiIssueProducer extends PlausiIssueProducer_Controller
|
||||
$this->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// get current Studiensemester
|
||||
$studiensemesterRes = $this->StudiensemesterModel->getAktOrNextSemester(62);
|
||||
$studiensemesterRes = $this->StudiensemesterModel->getAkt();
|
||||
if (hasData($studiensemesterRes)) $this->_currentStudiensemester = getData($studiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
|
||||
// set fehler which can be produced by the job
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
$this->_fehlerKurzbz = $this->plausicheckdefinitionlib->getFehlerKurzbz();
|
||||
$this->_fehlerLibMappings = $this->plausicheckdefinitionlib->getFehlerLibMappings();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class Manager extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'installAll' => 'admin:rw',
|
||||
'installFromCore' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('FehlerUpdateLib');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function installAll()
|
||||
{
|
||||
$this->fehlerupdatelib->installAll();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function installFromCore()
|
||||
{
|
||||
$this->fehlerupdatelib->installFromCore();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function installFrom($fehlerConfigDirectory)
|
||||
{
|
||||
$this->fehlerupdatelib->installFrom($fehlerConfigDirectory);
|
||||
}
|
||||
}
|
||||
@@ -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'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,11 +88,9 @@ class IssuesKonfiguration extends Auth_Controller
|
||||
|
||||
// get all Fehler, optionally filtered by app
|
||||
$params = array('fehlercode_extern' => null);
|
||||
$this->FehlerModel->addDistinct();
|
||||
$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertyp_kurzbz, fehlertext');
|
||||
$this->FehlerModel->addJoin('system.tbl_fehler_app', 'fehlercode');
|
||||
$this->FehlerModel->addOrder('fehlercode');
|
||||
if (!isEmptyString($app)) $params['tbl_fehler_app.app'] = $app;
|
||||
if (!isEmptyString($app)) $params['app'] = $app;
|
||||
$fehlerRes = $this->FehlerModel->loadWhere($params);
|
||||
|
||||
if (isError($fehlerRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerLaden'));
|
||||
|
||||
@@ -69,7 +69,10 @@ class IssuesZustaendigkeiten extends Auth_Controller
|
||||
{
|
||||
$app = $this->input->get('app');
|
||||
|
||||
$fehlerRes = $this->FehlerModel->getByApps($app);
|
||||
$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertext, fehlertyp_kurzbz, app');
|
||||
$this->FehlerModel->addOrder('fehlercode');
|
||||
|
||||
$fehlerRes = isset($app) ? $this->FehlerModel->loadWhere(array('app' => $app)) : $this->FehlerModel->load();
|
||||
|
||||
$this->outputJson($fehlerRes);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class Plausichecks extends Auth_Controller
|
||||
{
|
||||
const GENERIC_ISSUE_OCCURED_TEXT = 'Issue aufgetreten';
|
||||
const APPS = ['core', 'dvuh', 'bis'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -17,7 +16,8 @@ class Plausichecks extends Auth_Controller
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('issues/PlausicheckProducerLib', array('apps' => self::APPS));
|
||||
$this->load->library('issues/PlausicheckProducerLib', array('app' => 'core'));
|
||||
$this->load->library('issues/PlausicheckDefinitionLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load models
|
||||
@@ -46,31 +46,37 @@ class Plausichecks extends Auth_Controller
|
||||
|
||||
// issues array for passing issue texts
|
||||
$allIssues = array();
|
||||
|
||||
$fehler_kurzbz_arr = isEmptyString($fehler_kurzbz) ? array_keys($this->plausicheckproducerlib->getFehlerMappings()) : [$fehler_kurzbz];
|
||||
|
||||
$this->FehlerModel->addOrder('fehler_kurzbz, fehlercode');
|
||||
$this->FehlerModel->db->where_in('fehler_kurzbz', $fehler_kurzbz_arr);
|
||||
$fehlerRes = $this->FehlerModel->load();
|
||||
|
||||
if (isError($fehlerRes)) $this->terminateWithJsonError(getError($fehlerRes));
|
||||
if (!hasData($fehlerRes)) return $this->outputJsonSuccess([]);
|
||||
|
||||
// all fehler which are going to be checked
|
||||
$fehlerArr = getData($fehlerRes);
|
||||
|
||||
// all fehler kurzbz which are going to be checked
|
||||
$fehlerKurzbz = !isEmptyString($fehler_kurzbz) ? array($fehler_kurzbz) : $this->plausicheckdefinitionlib->getFehlerKurzbz();
|
||||
$fehlerLibMappings = $this->plausicheckdefinitionlib->getFehlerLibMappings();
|
||||
// set Studiengang to null if not passed
|
||||
if (isEmptyString($studiengang_kz)) $studiengang_kz = null;
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerArr as $fehler)
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// get Text and fehlercode of the Fehler
|
||||
$this->FehlerModel->addSelect('fehlercode, fehlertext, fehlertyp_kurzbz');
|
||||
$fehlerRes = $this->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (isError($fehlerRes)) $this->terminateWithJsonError(getError($fehlerRes));
|
||||
|
||||
// do not check error if no data
|
||||
if (!hasData($fehlerRes)) continue;
|
||||
|
||||
// get the error data
|
||||
$fehler = getData($fehlerRes)[0];
|
||||
|
||||
// initialize issue array
|
||||
$allIssues[$fehler->fehler_kurzbz] = array('fehlercode' => $fehler->fehlercode, 'data' => array());
|
||||
$allIssues[$fehler_kurzbz] = array('fehlercode' => $fehler->fehlercode, 'data' => array());
|
||||
|
||||
// get library name for producing issue
|
||||
$libName = $fehlerLibMappings[$fehler_kurzbz];
|
||||
|
||||
// execute the check
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue(
|
||||
$fehler->fehler_kurzbz,
|
||||
$libName,
|
||||
$fehler_kurzbz,
|
||||
array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz
|
||||
@@ -101,7 +107,7 @@ class Plausichecks extends Auth_Controller
|
||||
{
|
||||
// replace placeholder with params, if present
|
||||
if (count($fehlertext_params) != substr_count($fehlerText, '%s'))
|
||||
$this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler->fehler_kurzbz);
|
||||
$this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler_kurzbz);
|
||||
|
||||
$fehlerText = vsprintf($fehlerText, $fehlertext_params);
|
||||
}
|
||||
@@ -112,7 +118,7 @@ class Plausichecks extends Auth_Controller
|
||||
$issueObj = new StdClass();
|
||||
$issueObj->fehlertext = $fehlerText;
|
||||
$issueObj->type = $fehlerTyp;
|
||||
$allIssues[$fehler->fehler_kurzbz]['data'][] = $issueObj;
|
||||
$allIssues[$fehler_kurzbz]['data'][] = $issueObj;
|
||||
}
|
||||
else // if no issue text found, use generic text
|
||||
{
|
||||
@@ -143,12 +149,6 @@ class Plausichecks extends Auth_Controller
|
||||
|
||||
if (isError($currSemRes)) show_error(getError($currSemRes));
|
||||
|
||||
if (!hasData($currSemRes))
|
||||
{
|
||||
$currSemRes = $this->StudiensemesterModel->getNext();
|
||||
if (isError($currSemRes)) show_error(getError($currSemRes));
|
||||
}
|
||||
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, tbl_studiengang.bezeichnung, tbl_studiengang.typ,
|
||||
tbl_studiengangstyp.bezeichnung AS typbezeichnung, UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as kuerzel');
|
||||
$this->StudiengangModel->addJoin('public.tbl_studiengangstyp', 'typ');
|
||||
@@ -157,7 +157,7 @@ class Plausichecks extends Auth_Controller
|
||||
|
||||
if (isError($studiengaengeRes)) show_error(getError($studiengaengeRes));
|
||||
|
||||
$fehlerKurzbz = array_keys($this->plausicheckproducerlib->getFehlerMappings());
|
||||
$fehlerKurzbz = $this->plausicheckdefinitionlib->getFehlerKurzbz();
|
||||
|
||||
$db = new DB_Model();
|
||||
|
||||
@@ -168,9 +168,7 @@ class Plausichecks extends Auth_Controller
|
||||
FROM
|
||||
system.tbl_fehler
|
||||
WHERE
|
||||
fehler_kurzbz IN ?
|
||||
ORDER BY
|
||||
fehler_kurzbz, fehlercode',
|
||||
fehler_kurzbz IN ?',
|
||||
array($fehlerKurzbz)
|
||||
);
|
||||
|
||||
@@ -190,8 +188,7 @@ class Plausichecks extends Auth_Controller
|
||||
'semester' => hasData($studiensemesterRes) ? getData($studiensemesterRes) : array(),
|
||||
'currsemester' => hasData($currSemRes) ? getData($currSemRes) : array(),
|
||||
'studiengaenge' => hasData($studiengaengeRes) ? getData($studiengaengeRes) : array(),
|
||||
'fehlerKurzbzCodeMappings' => $fehlerKurzbzCodeMappings,
|
||||
'studiengang_kz' => $this->input->get('studiengang_kz') ?? ''
|
||||
'fehlerKurzbzCodeMappings' => $fehlerKurzbzCodeMappings
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
*/
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
// codes of fehler to be resolved
|
||||
protected $_fehlercodes = [];
|
||||
// mappings in form fehlercode -> resolverlibrary name, fehler which have explicit resolver class defined
|
||||
protected $_codeLibMappings = [];
|
||||
|
||||
// mappings in form fehlercode -> producer library name, fehler which are resolved the same way they are produced
|
||||
protected $_codeProducerLibMappings = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -21,18 +24,25 @@ abstract class IssueResolver_Controller extends JOB_Controller
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// initialize librariy with provided fehlercodes
|
||||
$this->load->library(
|
||||
'issues/PlausicheckResolverLib',
|
||||
[
|
||||
'fehlercodes' => $this->_fehlercodes
|
||||
'extensionName' => $this->_extensionName ?? null,
|
||||
'codeLibMappings' => $this->_codeLibMappings,
|
||||
'codeProducerLibMappings' => $this->_codeProducerLibMappings
|
||||
]
|
||||
);
|
||||
|
||||
$this->logInfo("Issue resolve job started");
|
||||
|
||||
// resolve the issues
|
||||
$result = $this->plausicheckresolverlib->resolvePlausicheckIssues();
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(
|
||||
array_merge(array_keys($this->_codeLibMappings), array_keys($this->_codeProducerLibMappings))
|
||||
);
|
||||
|
||||
$openIssues = hasData($openIssuesRes) ? getData($openIssuesRes) : [];
|
||||
|
||||
$result = $this->plausicheckresolverlib->resolvePlausicheckIssues($openIssues);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
foreach ($result->errors as $error) $this->logError($error);
|
||||
|
||||
@@ -5,23 +5,14 @@
|
||||
*/
|
||||
abstract class PlausiIssueProducer_Controller extends JOB_Controller
|
||||
{
|
||||
protected $_fehlerKurzbz = [];
|
||||
protected $_apps = [];
|
||||
|
||||
/**
|
||||
* Runs issue production job.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// producing issues
|
||||
$this->producePlausicheckIssues(array());
|
||||
}
|
||||
protected $_fehlerLibMappings = [];
|
||||
protected $_app;
|
||||
|
||||
protected function producePlausicheckIssues($params)
|
||||
{
|
||||
$this->load->library(
|
||||
'issues/PlausicheckProducerLib',
|
||||
['apps' => $this->_apps, 'fehlerKurzbz' => $this->_fehlerKurzbz]
|
||||
['extensionName' => $this->_extensionName ?? null, 'app' => $this->_app, 'fehlerLibMappings' => $this->_fehlerLibMappings]
|
||||
);
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job started");
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,384 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2025 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FehlerUpdateLib
|
||||
{
|
||||
// Who adds phrases into the database
|
||||
const UPSERT_BY = 'FehlerUpdate';
|
||||
|
||||
const CONFIG_DIRECTORY = 'config';
|
||||
const CONFIG_FEHLER_NAME = 'fehler';
|
||||
const CONFIG_FEHLER_INDEX = 'fehler';
|
||||
|
||||
const TYPE_STRING = 'string';
|
||||
const TYPE_ARRAY = 'array';
|
||||
|
||||
//~ // Array elements names
|
||||
const FEHLERCODE = 'fehlercode';
|
||||
const FEHLER_KURZBZ = 'fehler_kurzbz';
|
||||
const FEHLERTEXT = 'fehlertext';
|
||||
const FEHLERTYP_KURZBZ = 'fehlertyp_kurzbz';
|
||||
const APP = 'app';
|
||||
const FEHLERCODE_EXTERN = 'fehlercode_extern';
|
||||
|
||||
// structure of a fehler
|
||||
// type default: string
|
||||
const FEHLER_ATTRIBUTES = [
|
||||
self::FEHLERCODE => ['required' => true],
|
||||
self::FEHLER_KURZBZ => ['required' => false],
|
||||
self::FEHLERTEXT => ['required' => true, 'updateable' => false],
|
||||
self::FEHLERTYP_KURZBZ => ['required' => false, 'updateable' => true],
|
||||
self::APP => ['required' => true, 'types' => [self::TYPE_STRING, self::TYPE_ARRAY]],
|
||||
self::FEHLERCODE_EXTERN => ['required' => false]
|
||||
];
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
private $_updateHistory = [];
|
||||
|
||||
/**
|
||||
* Loads parser library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Loads EPrintfLib
|
||||
$this->_ci->load->library('EPrintfLib');
|
||||
|
||||
// Loads the Models
|
||||
$this->_ci->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->_ci->load->model('system/App_model', 'AppModel');
|
||||
|
||||
// Loads extensions lib
|
||||
$this->_ci->load->library('ExtensionsLib');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* Install all possible fehler, from core and extensions
|
||||
*/
|
||||
public function installAll()
|
||||
{
|
||||
$this->installFromCore();
|
||||
|
||||
// load fehler entries of extensions
|
||||
$extensions = $this->_ci->extensionslib->getInstalledExtensions();
|
||||
|
||||
if (hasData($extensions))
|
||||
{
|
||||
$extensionArray = array();
|
||||
|
||||
$extensionsData = getData($extensions);
|
||||
|
||||
foreach ($extensionsData as $ext)
|
||||
{
|
||||
$this->installFrom($ext->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Install fehler from the core
|
||||
*/
|
||||
public function installFromCore()
|
||||
{
|
||||
$this->_installFehler();
|
||||
}
|
||||
|
||||
/**
|
||||
* Install fehler from the given path
|
||||
*/
|
||||
public function installFrom($extensionName)
|
||||
{
|
||||
if (!isset($extensionName))
|
||||
{
|
||||
$this->_ci->eprintflib->printError('Extension name missing!');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_installFehler(ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName.'/'.FehlerUpdateLib::CONFIG_FEHLER_NAME);
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Install fehler from the given directory
|
||||
*/
|
||||
private function _installFehler($fehlerConfigDirectory = null)
|
||||
{
|
||||
// check that fehler config file exists
|
||||
$configDir = isset($fehlerConfigDirectory) ? $fehlerConfigDirectory : self::CONFIG_FEHLER_NAME;
|
||||
|
||||
$configFilename = APPPATH.self::CONFIG_DIRECTORY.'/'.$configDir.'.php';
|
||||
|
||||
if (!file_exists($configFilename))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Load Fehler Entries
|
||||
$this->_ci->load->config($configDir);
|
||||
$configArray = $this->_ci->config->item(self::CONFIG_FEHLER_INDEX);
|
||||
|
||||
if (!isset($configArray) || !is_array($configArray)) // check if fehler config entries could be loaded
|
||||
{
|
||||
$this->_ci->eprintflib->printError(
|
||||
'Fehler config array could not be loaded, directory '.$configDir.' index '.self::CONFIG_FEHLER_INDEX
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_ci->eprintflib->printInfo('------------------------------------------------------------------------------------------');
|
||||
$this->_ci->eprintflib->printInfo('Fehler installation started, directory '.$configDir);
|
||||
|
||||
foreach ($configArray as $idx => $configEntry)
|
||||
{
|
||||
// create fehler from config entry
|
||||
$createFehlerResult = $this->_createFehlerFromEntry($configEntry);
|
||||
|
||||
// write error if creation failed
|
||||
if (isError($createFehlerResult))
|
||||
{
|
||||
$this->_ci->eprintflib->printError(
|
||||
getError($createFehlerResult).', directory '.$configDir.', index '.$idx
|
||||
);
|
||||
}
|
||||
elseif (hasData($createFehlerResult))
|
||||
{
|
||||
// add fehler to db
|
||||
$addFehlerResult = $this->_updateFehler(getData($createFehlerResult));
|
||||
|
||||
if (isError($addFehlerResult))
|
||||
{
|
||||
$this->_ci->eprintflib->printError(
|
||||
getError($addFehlerResult).', directory'.$configDir.', index '.$idx
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_ci->eprintflib->printInfo('Fehler installation ended');
|
||||
$this->_ci->eprintflib->printInfo('------------------------------------------------------------------------------------------');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new fehler to the database
|
||||
*/
|
||||
private function _updateFehler($fehler)
|
||||
{
|
||||
$fehlerReferences = $fehler['references'];
|
||||
$fehler = $fehler['fehler'];
|
||||
|
||||
// Checks if the fehler already exists in the database
|
||||
$this->_ci->FehlerModel->db->where(self::FEHLERCODE.' = ', $fehler[self::FEHLERCODE]);
|
||||
if (isset($fehler[self::FEHLER_KURZBZ]) && !isEmptyString($fehler[self::FEHLER_KURZBZ]))
|
||||
$this->_ci->FehlerModel->db->or_where(self::FEHLER_KURZBZ.' = ', $fehler[self::FEHLER_KURZBZ]);
|
||||
$fehlerResult = $this->_ci->FehlerModel->load();
|
||||
|
||||
// If an error occurred then return the error itself
|
||||
if (isError($fehlerResult)) return $fehlerResult;
|
||||
|
||||
$updateRes = null;
|
||||
|
||||
// if fehler has been found
|
||||
if (hasData($fehlerResult))
|
||||
{
|
||||
$foundFehler = getData($fehlerResult)[0];
|
||||
|
||||
// check if fehlercode - fehler kurzbz combination is correct
|
||||
if ($foundFehler->{self::FEHLERCODE} != $fehler[self::FEHLERCODE]
|
||||
|| $foundFehler->{self::FEHLER_KURZBZ} != ($fehler[self::FEHLER_KURZBZ] ?? null)
|
||||
) {
|
||||
return error("Wrong fehlercode - fehler kurzbz combination: ".$fehler[self::FEHLERCODE].", ".$fehler[self::FEHLER_KURZBZ]);
|
||||
}
|
||||
|
||||
$this->_ci->eprintflib->printMessage(
|
||||
"Fehler ".$fehler[self::FEHLERCODE]
|
||||
.(isset($fehler[self::FEHLER_KURZBZ]) ? " (".$fehler[self::FEHLER_KURZBZ].")" : "")
|
||||
." already exists in database"
|
||||
);
|
||||
|
||||
$updateArr = [];
|
||||
|
||||
// update fehler, if needed
|
||||
foreach (self::FEHLER_ATTRIBUTES as $attributeName => $attributeInfo)
|
||||
{
|
||||
if (!array_key_exists($attributeName, $fehler)) continue;
|
||||
|
||||
// set attributes to be updated
|
||||
if (isset($attributeInfo['updateable']) && $attributeInfo['updateable'] && $foundFehler->{$attributeName} != $fehler[$attributeName])
|
||||
{
|
||||
$updateArr[$attributeName] = $fehler[$attributeName];
|
||||
|
||||
if (isset($this->_updateHistory[$foundFehler->{self::FEHLERCODE}][$attributeName])
|
||||
&& $this->_updateHistory[$foundFehler->{self::FEHLERCODE}][$attributeName] != $fehler[$attributeName]
|
||||
) {
|
||||
return error("Conflicting update values for attribute ".$attributeName.", fehler ".$foundFehler->{self::FEHLERCODE});
|
||||
}
|
||||
$this->_updateHistory[$foundFehler->{self::FEHLERCODE}][$attributeName] = $fehler[$attributeName];
|
||||
}
|
||||
}
|
||||
|
||||
if (!isEmptyArray($updateArr))
|
||||
{
|
||||
$updateRes = $this->_ci->FehlerModel->update(
|
||||
[self::FEHLERCODE => $foundFehler->{self::FEHLERCODE}],
|
||||
array_merge($updateArr, ['updateamum' => 'NOW()', 'updatevon' => self::UPSERT_BY])
|
||||
);
|
||||
if (isError($updateRes)) return $updateRes;
|
||||
|
||||
$this->_ci->eprintflib->printMessage(
|
||||
"Fehler ".$fehler[self::FEHLERCODE].(isset($fehler[self::FEHLER_KURZBZ]) ? " (".$fehler[self::FEHLER_KURZBZ].")" : "")." updated"
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no fehler has been found
|
||||
|
||||
// then add the fehler to the database
|
||||
$updateRes = $this->_ci->FehlerModel->insert(
|
||||
array_merge($fehler, ['insertamum' => 'NOW()', 'insertvon' => self::UPSERT_BY])
|
||||
);
|
||||
|
||||
// If an error occurred then return the error itself
|
||||
if (isError($updateRes)) return $updateRes;
|
||||
|
||||
// Prints info about the new added fehler
|
||||
$this->_ci->eprintflib->printMessage(
|
||||
sprintf(
|
||||
'A new fehler has been added into the database: '.
|
||||
'fehlercode => %s | fehler_kurzbz => %s | fehlertyp => %s',
|
||||
$fehler[self::FEHLERCODE],
|
||||
$fehler[self::FEHLER_KURZBZ],
|
||||
$fehler[self::FEHLERTYP_KURZBZ]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// handle references
|
||||
if (isset($fehlerReferences[self::APP]))
|
||||
{
|
||||
$this->_ci->load->model('system/FehlerApp_model', 'FehlerAppModel');
|
||||
$apps = $fehlerReferences[self::APP];
|
||||
|
||||
// load all assigned apps
|
||||
$this->_ci->FehlerAppModel->addSelect(self::APP);
|
||||
$fehlerAppRes = $this->_ci->FehlerAppModel->loadWhere([self::FEHLERCODE => $fehler[self::FEHLERCODE]]);
|
||||
|
||||
$fehlerApps = hasData($fehlerAppRes) ? array_column(getData($fehlerAppRes), self::APP) : [];
|
||||
|
||||
$appsToInsert = array_diff($apps, $fehlerApps);
|
||||
|
||||
foreach ($appsToInsert as $app)
|
||||
{
|
||||
// check if app exists in db
|
||||
$fehlerAppsInsertRes = $this->_ci->FehlerAppModel->insert(
|
||||
[self::FEHLERCODE => $fehler[self::FEHLERCODE], self::APP => $app, 'insertamum' => 'NOW()', 'insertvon' => self::UPSERT_BY]
|
||||
);
|
||||
|
||||
if (isError($fehlerAppsInsertRes)) return $fehlerAppsInsertRes;
|
||||
|
||||
$this->_ci->eprintflib->printMessage(
|
||||
"Added app ".$app." to fehler ".$fehler[self::FEHLERCODE]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If here then no blocking errors occurred
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an array with fehler data from config entry
|
||||
*/
|
||||
private function _createFehlerFromEntry($configEntry)
|
||||
{
|
||||
$fehler = ['fehler' => [], 'references' => []];
|
||||
foreach (self::FEHLER_ATTRIBUTES as $attributeName => $attributeInfo)
|
||||
{
|
||||
$required = isset($attributeInfo['required']) && $attributeInfo['required'];
|
||||
if (!isset($configEntry[$attributeName]))
|
||||
{
|
||||
if ($required) return error('attribute'.$attributeName.' is missing');
|
||||
continue;
|
||||
}
|
||||
|
||||
$attributeValue = $configEntry[$attributeName];
|
||||
$validType = false;
|
||||
if (isset($attributeInfo['types']) && is_array($attributeInfo['types']))
|
||||
{
|
||||
foreach ($attributeInfo['types'] as $type)
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case self::TYPE_STRING:
|
||||
if (is_string($attributeValue) || is_null($attributeValue)) $validType = true;
|
||||
break;
|
||||
case self::TYPE_ARRAY:
|
||||
if (is_array($attributeValue) && !($required && isEmptyArray($attributeValue))) $validType = true;
|
||||
break;
|
||||
//~ default:
|
||||
//~ if (is_string($configEntry[$attributeName]) || is_null($configEntry[$attributeName])) $validType = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$validType = is_string($attributeValue) || is_null($attributeValue);
|
||||
}
|
||||
|
||||
if (!$validType)
|
||||
{
|
||||
return error('attribute'.$attributeName.' has invalid type');
|
||||
}
|
||||
|
||||
if ($attributeName == self::APP)
|
||||
{
|
||||
if (is_string($attributeValue)) $attributeValue = [$attributeValue];
|
||||
|
||||
foreach ($attributeValue as $app)
|
||||
{
|
||||
// check if app exists in db
|
||||
$this->_ci->AppModel->addSelect('1');
|
||||
$appRes = $this->_ci->AppModel->loadWhere(['app' => $app]);
|
||||
|
||||
if (!hasData($appRes)) return error("App ".$app." does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($attributeInfo['types']) && is_array($attributeInfo['types']) && in_array(self::TYPE_ARRAY, $attributeInfo['types']))
|
||||
{
|
||||
$fehler['references'][$attributeName] = $attributeValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fehler['fehler'][$attributeName] = $attributeValue;
|
||||
}
|
||||
|
||||
}
|
||||
return success($fehler);
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,6 @@ class IssuesLib
|
||||
const ERRORTYPE_CODE = 'error';
|
||||
const WARNINGTYPE_CODE = 'warning';
|
||||
|
||||
const STATUS_KURZBZ = 'status_kurzbz';
|
||||
const VERARBEITET_AMUM = 'verarbeitetamum';
|
||||
const VERARBEITET_VON = 'verarbeitetvon';
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
@@ -95,16 +91,12 @@ class IssuesLib
|
||||
return error("fehlercode_extern missing");
|
||||
|
||||
// get external fehlercode (unique for each app)
|
||||
$fehlerRes = $this->_ci->FehlerModel->execReadOnlyQuery(
|
||||
'
|
||||
SELECT
|
||||
fehlercode
|
||||
FROM
|
||||
system.tbl_fehler fe
|
||||
WHERE
|
||||
fehlercode_extern = ?
|
||||
AND EXISTS (SELECT 1 FROM system.tbl_fehler_app WHERE fehlercode = fe.fehlercode AND app = ?)',
|
||||
[$fehlercode_extern, $this->_app]
|
||||
$this->_ci->FehlerModel->addSelect('fehlercode');
|
||||
$fehlerRes = $this->_ci->FehlerModel->loadWhere(
|
||||
array(
|
||||
'fehlercode_extern' => $fehlercode_extern,
|
||||
'app' => $this->_app
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($fehlerRes))
|
||||
@@ -113,10 +105,8 @@ class IssuesLib
|
||||
// check if there is a predefined custom error for the external issue
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
// if found, use the code
|
||||
$fehlerData = getData($fehlerRes);
|
||||
if (count($fehlerData) > 1) return error("Multiple fehlercode_extern ".$fehlercode_extern. " for app ".$this->_app);
|
||||
$fehlerData = getData($fehlerRes)[0];
|
||||
// if found, use the code
|
||||
$fehlercode = $fehlerData->fehlercode;
|
||||
}
|
||||
else
|
||||
@@ -138,9 +128,9 @@ class IssuesLib
|
||||
public function setBehoben($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
self::STATUS_KURZBZ => self::STATUS_BEHOBEN,
|
||||
self::VERARBEITET_VON => $user,
|
||||
self::VERARBEITET_AMUM => date('Y-m-d H:i:s')
|
||||
'status_kurzbz' => self::STATUS_BEHOBEN,
|
||||
'verarbeitetvon' => $user,
|
||||
'verarbeitetamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
@@ -155,8 +145,8 @@ class IssuesLib
|
||||
public function setInBearbeitung($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
self::STATUS_KURZBZ => self::STATUS_IN_BEARBEITUNG,
|
||||
self::VERARBEITET_VON => $user
|
||||
'status_kurzbz' => self::STATUS_IN_BEARBEITUNG,
|
||||
'verarbeitetvon' => $user
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
@@ -171,9 +161,9 @@ class IssuesLib
|
||||
public function setNeu($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
self::STATUS_KURZBZ => self::STATUS_NEU,
|
||||
self::VERARBEITET_VON => null,
|
||||
self::VERARBEITET_AMUM => null
|
||||
'status_kurzbz' => self::STATUS_NEU,
|
||||
'verarbeitetvon' => null,
|
||||
'verarbeitetamum' => null
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
@@ -195,18 +185,13 @@ class IssuesLib
|
||||
return error("Issue Id must be set correctly.");
|
||||
|
||||
// check if given status is same as existing
|
||||
$this->_ci->IssueModel->addSelect(self::STATUS_KURZBZ.', '.self::VERARBEITET_AMUM);
|
||||
$this->_ci->IssueModel->addSelect('status_kurzbz');
|
||||
$currStatus = $this->_ci->IssueModel->load($issue_id);
|
||||
|
||||
if (hasData($currStatus))
|
||||
{
|
||||
$currStatusData = getData($currStatus)[0];
|
||||
// if same status set, and verarbeitet amum is not being newly set
|
||||
if ($currStatusData->{self::STATUS_KURZBZ} == $data[self::STATUS_KURZBZ]
|
||||
&& !(isset($data[self::VERARBEITET_AMUM]) && !isset($currStatusData->{self::VERARBEITET_AMUM}))
|
||||
) {
|
||||
if (getData($currStatus)[0]->status_kurzbz == $data['status_kurzbz'])
|
||||
return success("Same status already set");
|
||||
}
|
||||
}
|
||||
else
|
||||
return error("Error when getting status");
|
||||
@@ -242,10 +227,11 @@ class IssuesLib
|
||||
$fehlercode_extern = null,
|
||||
$inhalt_extern = null
|
||||
) {
|
||||
if (!is_numeric($person_id) && isEmptyString($oe_kurzbz)) return error("Person_id or oe_kurzbz must be set, fehlercode: $fehlercode");
|
||||
if (isEmptyString($person_id) && isEmptyString($oe_kurzbz))
|
||||
return error("Person_id or oe_kurzbz must be set.");
|
||||
|
||||
// get fehlertextVorlage and replace it with params
|
||||
$fehlerRes = $this->_ci->FehlerModel->loadWhere(['fehlercode' => $fehlercode]);
|
||||
$fehlerRes = $this->_ci->FehlerModel->load($fehlercode);
|
||||
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
@@ -255,7 +241,7 @@ class IssuesLib
|
||||
if (!isEmptyArray($fehlertext_params))
|
||||
{
|
||||
if (count($fehlertext_params) != substr_count($fehlertextVorlage, '%s'))
|
||||
return error('Wrong number of parameters for Fehlertext, fehlercode ' . $fehlercode);
|
||||
return error('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehlercode);
|
||||
|
||||
$fehlertext = vsprintf($fehlertextVorlage, $fehlertext_params);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class SearchBarLib
|
||||
const ERROR_NOT_AUTH = 'ERR005';
|
||||
|
||||
// List of allowed types of search
|
||||
const ALLOWED_TYPES = ['mitarbeiter', 'mitarbeiter_ohne_zuordnung', 'organisationunit', 'raum', 'person', 'student','studentStv', 'prestudent', 'document', 'cms'];
|
||||
const ALLOWED_TYPES = ['mitarbeiter', 'mitarbeiter_ohne_zuordnung', 'organisationunit', 'raum', 'person', 'student','studentStv', 'prestudent', 'document', 'cms', 'lehreinheit', 'lehrveranstaltung'];
|
||||
|
||||
const PHOTO_IMG_URL = '/cis/public/bild.php?src=person&person_id=';
|
||||
|
||||
@@ -180,10 +180,14 @@ class SearchBarLib
|
||||
protected function buildSearchClause(DB_Model $dbModel, array $columns, $searchstr)
|
||||
{
|
||||
$searchstr = preg_replace('/[[:punct:]]/', ' ', $searchstr);
|
||||
$words = preg_split('/\s+/', trim($searchstr), -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
if (empty($words)) return array();
|
||||
|
||||
$document = implode(' || \' \' || ', $columns);
|
||||
$query = '\'' . implode(':* & ', explode(' ', trim($searchstr))) . ':*\'';
|
||||
$reversequery = '\'*:' . implode(' & *:', explode(' ', trim($searchstr))) . '\'';
|
||||
$nospacequery = '\'' . implode('', explode(' ', trim($searchstr))) . ':*\'';
|
||||
$query = '\'' . implode(':* & ', $words) . ':*\'';
|
||||
$reversequery = '\'*:' . implode(' & *:', $words) . '\'';
|
||||
$nospacequery = '\'' . implode('', $words) . ':*\'';
|
||||
|
||||
$searchclause = <<<EOSC
|
||||
to_tsvector(lower(regexp_replace({$document}, '[[:punct:]]', ' ', 'g'))) @@ to_tsquery(lower({$query}))
|
||||
@@ -596,5 +600,98 @@ EOSC;
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
private function _lehreinheit($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$idwhere = '';
|
||||
if (ctype_digit(trim($searchstr)))
|
||||
{
|
||||
$id = (int)trim($searchstr);
|
||||
$idwhere = ' OR le.lehreinheit_id = ' . $id;
|
||||
}
|
||||
|
||||
$lehreinheit = $dbModel->execReadOnlyQuery('
|
||||
SELECT
|
||||
\'teachingunit\' AS renderer,
|
||||
\''.$type.'\' AS type,
|
||||
le.lehreinheit_id AS id,
|
||||
le.studiensemester_kurzbz,
|
||||
lv.bezeichnung,
|
||||
\'lv_table_icon icon-\' AS foto,
|
||||
UPPER(stg.typ || stg.kurzbz) AS studiengang,
|
||||
le.lehrform_kurzbz,
|
||||
lv.semester
|
||||
FROM lehre.tbl_lehreinheit le
|
||||
JOIN lehre.tbl_lehrveranstaltung lv ON (lv.lehrveranstaltung_id = le.lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang stg ON (stg.studiengang_kz = lv.studiengang_kz)
|
||||
JOIN public.tbl_studiensemester sem ON (sem.studiensemester_kurzbz = le.studiensemester_kurzbz)
|
||||
WHERE (' .
|
||||
$this->buildSearchClause(
|
||||
$dbModel,
|
||||
array(
|
||||
'(stg.typ || stg.kurzbz)',
|
||||
'lv.semester',
|
||||
'lv.bezeichnung'
|
||||
),
|
||||
$searchstr
|
||||
) . ')' . $idwhere . '
|
||||
');
|
||||
|
||||
// If something has been found then return it
|
||||
if (hasData($lehreinheit)) return getData($lehreinheit);
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
private function _lehrveranstaltung($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$idwhere = '';
|
||||
|
||||
if (ctype_digit(trim($searchstr)))
|
||||
{
|
||||
$id = (int)trim($searchstr);
|
||||
$idwhere = ' OR tbl_lehrveranstaltung.lehrveranstaltung_id = ' . $id;
|
||||
}
|
||||
|
||||
$lehreinheit = $dbModel->execReadOnlyQuery('
|
||||
|
||||
SELECT
|
||||
\'teachingunit\' AS renderer,
|
||||
\''.$type.'\' AS type,
|
||||
lehrveranstaltung_id as id,
|
||||
tbl_lehrveranstaltung.bezeichnung,
|
||||
\'lv_table_icon icon-lv\' as foto,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as studiengang,
|
||||
semester,
|
||||
lehrform_kurzbz,
|
||||
tbl_organisationseinheit.bezeichnung as oe_bezeichnung
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN public.tbl_organisationseinheit ON tbl_lehrveranstaltung.oe_kurzbz = tbl_organisationseinheit.oe_kurzbz
|
||||
WHERE (' .
|
||||
$this->buildSearchClause(
|
||||
$dbModel,
|
||||
array(
|
||||
'(tbl_studiengang.typ || tbl_studiengang.kurzbz)',
|
||||
'semester',
|
||||
'tbl_lehrveranstaltung.bezeichnung'
|
||||
),
|
||||
$searchstr
|
||||
) . ')' . $idwhere . '
|
||||
');
|
||||
|
||||
// If something has been found then return it
|
||||
if (hasData($lehreinheit)) return getData($lehreinheit);
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,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,
|
||||
@@ -116,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;
|
||||
@@ -391,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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,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
|
||||
@@ -632,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);
|
||||
|
||||
@@ -9,40 +9,48 @@ class PlausicheckDefinitionLib
|
||||
{
|
||||
// set fehler for core plausichecks
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
private $_fehlerKurzbz = array(
|
||||
'AbbrecherAktiv',
|
||||
'AbschlussstatusFehlt',
|
||||
'AktSemesterNull',
|
||||
'AktiverStudentOhneStatus',
|
||||
'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'DatumAbschlusspruefungFehlt',
|
||||
'DatumSponsionFehlt',
|
||||
'DatumStudiensemesterFalscheReihenfolge',
|
||||
'FalscheAnzahlAbschlusspruefungen',
|
||||
'FalscheAnzahlHeimatadressen',
|
||||
'FalscheAnzahlZustelladressen',
|
||||
'GbDatumWeitZurueck',
|
||||
'InaktiverStudentAktiverStatus',
|
||||
'IncomingHeimatNationOesterreich',
|
||||
'IncomingOhneIoDatensatz',
|
||||
'IncomingOrGsFoerderrelevant',
|
||||
'InskriptionVorLetzerBismeldung',
|
||||
'NationNichtOesterreichAberGemeinde',
|
||||
'OrgformStgUngleichOrgformPrestudent',
|
||||
'PrestudentMischformOhneOrgform',
|
||||
'StgPrestudentUngleichStgStudienplan',
|
||||
'StgPrestudentUngleichStgStudent',
|
||||
'StudentstatusNachAbbrecher',
|
||||
private $_fehlerLibMappings = array(
|
||||
'AbbrecherAktiv' => 'AbbrecherAktiv',
|
||||
'AbschlussstatusFehlt' => 'AbschlussstatusFehlt',
|
||||
'AktSemesterNull' => 'AktSemesterNull',
|
||||
'AktiverStudentOhneStatus' => 'AktiverStudentOhneStatus',
|
||||
'AusbildungssemPrestudentUngleichAusbildungssemStatus' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'DatumAbschlusspruefungFehlt' => 'DatumAbschlusspruefungFehlt',
|
||||
'DatumSponsionFehlt' => 'DatumSponsionFehlt',
|
||||
'DatumStudiensemesterFalscheReihenfolge' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'FalscheAnzahlAbschlusspruefungen' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'FalscheAnzahlHeimatadressen' => 'FalscheAnzahlHeimatadressen',
|
||||
'FalscheAnzahlZustelladressen' => 'FalscheAnzahlZustelladressen',
|
||||
'GbDatumWeitZurueck' => 'GbDatumWeitZurueck',
|
||||
'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus',
|
||||
'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich',
|
||||
'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz',
|
||||
'IncomingOrGsFoerderrelevant' => 'IncomingOrGsFoerderrelevant',
|
||||
'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung',
|
||||
'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde',
|
||||
'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'PrestudentMischformOhneOrgform' => 'PrestudentMischformOhneOrgform',
|
||||
'StgPrestudentUngleichStgStudienplan' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
|
||||
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher',
|
||||
'DualesStudiumOhneMarkierung' => 'DualesStudiumOhneMarkierung'
|
||||
//'StudienplanUngueltig',
|
||||
//'BewerberNichtZumRtAngetreten'
|
||||
//'StudienplanUngueltig' => 'StudienplanUngueltig'
|
||||
//'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten'
|
||||
);
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz-library mappings for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerLibMappings()
|
||||
{
|
||||
return $this->_fehlerLibMappings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerKurzbz()
|
||||
{
|
||||
return $this->_fehlerKurzbz;
|
||||
return array_keys($this->_fehlerLibMappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,43 +6,36 @@ class PlausicheckProducerLib
|
||||
{
|
||||
const CI_PATH = 'application';
|
||||
const CI_LIBRARY_FOLDER = 'libraries';
|
||||
const EXTENSIONS_FOLDER = 'extensions';
|
||||
const PLAUSI_ISSUES_FOLDER = 'issues/plausichecks';
|
||||
const EXECUTE_PLAUSI_CHECK_METHOD_NAME = 'executePlausiCheck';
|
||||
const CONFIG_FEHLER_NAME = 'fehler';
|
||||
const CONFIG_FEHLER_INDEX = 'fehler';
|
||||
const FEHLER_KURZBZ_NAME = 'fehler_kurzbz';
|
||||
const PRODUCER_LIB_NAME = 'producerLibName';
|
||||
const EXTENSION_NAME = 'extensionName';
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_extensionName; // name of extension
|
||||
private $_konfiguration = []; // configuration parameters
|
||||
private $_fehlerKurzbz = []; // fehler to produce
|
||||
private $_fehlerLibMappings = []; // mappings of fehler and libraries for producing them
|
||||
private $_apps = []; // apps of fehler to produce
|
||||
private $_isForResolutionCheck = false; // mappings of fehler and libraries for producing them
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
// set application(s))
|
||||
if (isset($params['apps']))
|
||||
{
|
||||
if (is_string($params['apps'])) $params['apps'] = [$params['apps']];
|
||||
if (is_array($params['apps'])) $this->_apps = $params['apps'];
|
||||
}
|
||||
// set extension name if called from extension
|
||||
if (isset($params['extensionName'])) $this->_extensionName = $params['extensionName'];
|
||||
if (isset($params['fehlerLibMappings'])) $this->_fehlerLibMappings = $params['fehlerLibMappings'];
|
||||
if (isset($params['isForResolutionCheck'])) $this->_isForResolutionCheck = $params['isForResolutionCheck'];
|
||||
|
||||
// set application
|
||||
$app = isset($params['app']) ? $params['app'] : null;
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// load libraries
|
||||
$this->_ci->load->library('IssuesLib');
|
||||
$this->_ci->load->library('ExtensionsLib');
|
||||
|
||||
// load models
|
||||
$this->_ci->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->_ci->load->model('system/Fehlerkonfiguration_model', 'FehlerkonfigurationModel');
|
||||
|
||||
$this->_ci->load->config(self::CONFIG_FEHLER_NAME);
|
||||
|
||||
// get all configuration parameters for the application(s))
|
||||
$fehlerkonfigurationRes = $this->_ci->FehlerkonfigurationModel->getKonfiguration($this->_apps);
|
||||
// get all configuration parameters for the application
|
||||
$fehlerkonfigurationRes = $this->_ci->FehlerkonfigurationModel->getKonfiguration($app);
|
||||
|
||||
if (hasData($fehlerkonfigurationRes))
|
||||
{
|
||||
@@ -53,88 +46,10 @@ class PlausicheckProducerLib
|
||||
$this->_konfiguration[$fk->fehler_kurzbz][$fk->konfigurationstyp_kurzbz] = $fk->konfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
// get all fehler to be produced (by kurzbz array or app)
|
||||
if (isset($params['fehlerKurzbz']) && !isEmptyArray($params['fehlerKurzbz']))
|
||||
{
|
||||
$this->_fehlerKurzbz = $params['fehlerKurzbz'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// get fehler by apps
|
||||
$fehlerRes = $this->_ci->FehlerModel->getByApps($this->_apps);
|
||||
|
||||
if (hasData($fehlerRes)) $this->_fehlerKurzbz = array_column(getData($fehlerRes), 'fehler_kurzbz');
|
||||
}
|
||||
|
||||
// get producer file paths for the fehler
|
||||
|
||||
// Load Fehler Entries of Core
|
||||
$configArray = $this->_ci->config->item(self::CONFIG_FEHLER_INDEX);
|
||||
|
||||
if (isset($configArray) && is_array($configArray))
|
||||
{
|
||||
foreach ($configArray as $coreEntry)
|
||||
{
|
||||
if (!isset($coreEntry[self::FEHLER_KURZBZ_NAME])
|
||||
|| !isset($coreEntry[self::PRODUCER_LIB_NAME])
|
||||
|| !in_array($coreEntry[self::FEHLER_KURZBZ_NAME], $this->_fehlerKurzbz)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->_fehlerLibMappings[$coreEntry[self::FEHLER_KURZBZ_NAME]][self::PRODUCER_LIB_NAME] = $coreEntry[self::PRODUCER_LIB_NAME];
|
||||
}
|
||||
}
|
||||
|
||||
// load fehler entries of extensions
|
||||
$extensions = $this->_ci->extensionslib->getInstalledExtensions();
|
||||
|
||||
if (hasData($extensions))
|
||||
{
|
||||
$extensionArray = array();
|
||||
|
||||
$extensionsData = getData($extensions);
|
||||
|
||||
foreach ($extensionsData as $ext)
|
||||
{
|
||||
$configFilePath = ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_FEHLER_NAME.'.php';
|
||||
$configFilename = APPPATH.'config/'.$configFilePath;
|
||||
|
||||
// if fehler config file exists in extension
|
||||
if (file_exists($configFilename))
|
||||
{
|
||||
$config = array(); // default value
|
||||
|
||||
// include the config file
|
||||
include($configFilename);
|
||||
|
||||
if (isset($config[self::CONFIG_FEHLER_NAME]) && is_array($config[self::CONFIG_FEHLER_NAME]))
|
||||
{
|
||||
foreach ($config[self::CONFIG_FEHLER_NAME] as $extensionEntry)
|
||||
{
|
||||
if (
|
||||
!isset($extensionEntry[self::FEHLER_KURZBZ_NAME])
|
||||
|| !isset($extensionEntry[self::PRODUCER_LIB_NAME])
|
||||
|| !in_array($extensionEntry[self::FEHLER_KURZBZ_NAME], $this->_fehlerKurzbz)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// add extension config data to fehler lib mappings
|
||||
$fehler_kurzbz = $extensionEntry[self::FEHLER_KURZBZ_NAME];
|
||||
|
||||
$this->_fehlerLibMappings[$fehler_kurzbz][self::PRODUCER_LIB_NAME] = $extensionEntry[self::PRODUCER_LIB_NAME];
|
||||
$this->_fehlerLibMappings[$fehler_kurzbz][self::EXTENSION_NAME] = $ext->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces multiple plausicheck issues at once, and saves them in the database.
|
||||
* Produces multiple plausicheck issues at once and saved them to db.
|
||||
* @param array $params passed to each plausicheck
|
||||
* @return result object with occured error and info
|
||||
*/
|
||||
@@ -144,17 +59,10 @@ class PlausicheckProducerLib
|
||||
$result->errors = [];
|
||||
$result->infos = [];
|
||||
|
||||
$mappingFehlerKurbz = array_keys($this->_fehlerLibMappings);
|
||||
|
||||
// check if all issues to produce could be found in database
|
||||
//~ $notFoundFehlerKurzbz = array_diff($this->_fehlerKurzbz, $mappingFehlerKurbz);
|
||||
|
||||
//~ if (!isEmptyArray($notFoundFehlerKurzbz))
|
||||
//~ $result->errors[] = error('Fehler to produce not defined in config: '.implode(', ', $notFoundFehlerKurzbz));
|
||||
|
||||
foreach ($mappingFehlerKurbz as $fehler_kurzbz)
|
||||
foreach ($this->_fehlerLibMappings as $fehler_kurzbz => $libName)
|
||||
{
|
||||
$plausicheckRes = $this->producePlausicheckIssue(
|
||||
$libName,
|
||||
$fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
@@ -188,23 +96,14 @@ class PlausicheckProducerLib
|
||||
|
||||
/**
|
||||
* Executes plausicheck using a given library, returns the result.
|
||||
* @param $libName string name of library producing the issue
|
||||
* @param $fehler_kurzbz string unique short name of fehler, for which issue is produced
|
||||
* @param $params parameters passed to issue production method
|
||||
*/
|
||||
public function producePlausicheckIssue($fehler_kurzbz, $params)
|
||||
public function producePlausicheckIssue($libName, $fehler_kurzbz, $params)
|
||||
{
|
||||
//if (!isset($this->_fehlerLibMappings[$fehler_kurzbz])) return error("Mapping for Fehler " . $fehler_kurzbz . " was not found");
|
||||
if (!isset($this->_fehlerLibMappings[$fehler_kurzbz])) return success(null);
|
||||
|
||||
$mapping = $this->_fehlerLibMappings[$fehler_kurzbz];
|
||||
|
||||
if (!isset($mapping[self::PRODUCER_LIB_NAME]) || isEmptyString($mapping[self::PRODUCER_LIB_NAME]))
|
||||
return error("No producer lib name set for Fehler " . $fehler_kurzbz);
|
||||
|
||||
$libName = $mapping[self::PRODUCER_LIB_NAME];
|
||||
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($mapping[self::EXTENSION_NAME]) ? ExtensionsLib::EXTENSIONS_DIR_NAME . '/' . $mapping[self::EXTENSION_NAME] . '/' : '';
|
||||
$libRootPath = isset($this->_extensionName) ? self::EXTENSIONS_FOLDER . '/' . $this->_extensionName . '/' : '';
|
||||
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::PLAUSI_ISSUES_FOLDER . '/';
|
||||
@@ -222,7 +121,7 @@ class PlausicheckProducerLib
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library(
|
||||
$issuesLibPath . $libName,
|
||||
['configurationParams' => $config]
|
||||
['configurationParams' => $config, 'isForResolutionCheck' => $this->_isForResolutionCheck]
|
||||
);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
@@ -234,13 +133,4 @@ class PlausicheckProducerLib
|
||||
// call the function for checking for issue production
|
||||
return $this->_ci->{$lowercaseLibName}->{self::EXECUTE_PLAUSI_CHECK_METHOD_NAME}($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fehler kurzbz -> library mappings.
|
||||
* @return array with fehler kurzbz as key and fehlerinfo as values
|
||||
*/
|
||||
public function getFehlerMappings()
|
||||
{
|
||||
return $this->_fehlerLibMappings;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,177 +9,43 @@ class PlausicheckResolverLib
|
||||
const EXTENSIONS_FOLDER = 'extensions';
|
||||
const ISSUE_RESOLVERS_FOLDER = 'issues/resolvers';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
const CONFIG_FEHLER_NAME = 'fehler';
|
||||
const FEHLERCODE_NAME = 'fehlercode';
|
||||
const FEHLER_KURZBZ_NAME = 'fehler_kurzbz';
|
||||
const RESOLVER_LIB_NAME = 'resolverLibName';
|
||||
const PRODUCER_IS_RESOLVER_NAME = 'producerIsResolver';
|
||||
const EXTENSION_NAME = 'extensionName';
|
||||
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_extensionName; // name of extension
|
||||
private $_fehlercodes = []; // fehlercodes to resolve
|
||||
private $_apps = []; // apps for which issues should be resolved
|
||||
private $_codeLibMappings = []; // mappings for issues which explicitly defined resolver
|
||||
private $_defaultIssueParams = ['issue_id' => 'issue_id', 'issue_person_id' => 'person_id', 'issue_oe_kurzbz' => 'oe_kurzbz'];
|
||||
private $_codeProducerLibMappings = []; // mappings for issues which are resolved with the same check as they are produced
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
// set application(s))
|
||||
if (isset($params['apps']))
|
||||
{
|
||||
if (is_string($params['apps'])) $params['apps'] = [$params['apps']];
|
||||
if (is_array($params['apps'])) $this->_apps = $params['apps'];
|
||||
}
|
||||
// set extension name if called from extension
|
||||
if (isset($params['extensionName'])) $this->_extensionName = $params['extensionName'];
|
||||
if (isset($params['codeLibMappings'])) $this->_codeLibMappings = $params['codeLibMappings'];
|
||||
if (isset($params['codeProducerLibMappings'])) $this->_codeProducerLibMappings = $params['codeProducerLibMappings'];
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// get all fehler to be produced (by kurzbz array or app)
|
||||
if (isset($params['fehlercodes']) && !isEmptyArray($params['fehlercodes']))
|
||||
{
|
||||
$this->_fehlercodes = $params['fehlercodes'];
|
||||
}
|
||||
elseif (isset($params['apps']) && !isEmptyArray($params['apps']))
|
||||
{
|
||||
$this->_ci->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$fehlerRes = $this->_ci->FehlerModel->getByApps($this->_apps);
|
||||
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$this->_fehlercodes = array_column(getData($fehlerRes), 'fehlercode');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_ci->load->library('IssuesLib');
|
||||
$this->_ci->load->library('ExtensionsLib');
|
||||
|
||||
$this->_ci->load->config('fehler');
|
||||
|
||||
// Load Fehler Entries of Core
|
||||
$configArray = $this->_ci->config->item(self::CONFIG_FEHLER_NAME);
|
||||
|
||||
foreach ($configArray as $coreEntry)
|
||||
{
|
||||
// each entry must have fehlercode
|
||||
if (!isset($coreEntry[self::FEHLERCODE_NAME])
|
||||
|| !in_array($coreEntry[self::FEHLERCODE_NAME], $this->_fehlercodes)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// fill code lib mappings with needed values
|
||||
$fehlercode = $coreEntry[self::FEHLERCODE_NAME];
|
||||
|
||||
if (isset($coreEntry[self::FEHLER_KURZBZ_NAME]))
|
||||
$this->_codeLibMappings[$fehlercode][self::FEHLER_KURZBZ_NAME] = $coreEntry[self::FEHLER_KURZBZ_NAME];
|
||||
|
||||
$this->_codeLibMappings[$fehlercode][self::RESOLVER_LIB_NAME] = $coreEntry[self::RESOLVER_LIB_NAME] ?? null;
|
||||
$this->_codeLibMappings[$fehlercode][self::PRODUCER_IS_RESOLVER_NAME]
|
||||
= $coreEntry[self::PRODUCER_IS_RESOLVER_NAME] ?? false;
|
||||
}
|
||||
|
||||
// load fehler entries of extensions
|
||||
$extensions = $this->_ci->extensionslib->getInstalledExtensions();
|
||||
|
||||
if (hasData($extensions))
|
||||
{
|
||||
$extensionArray = array();
|
||||
|
||||
$extensionsData = getData($extensions);
|
||||
|
||||
foreach ($extensionsData as $ext)
|
||||
{
|
||||
$configFilename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_FEHLER_NAME.'.php';
|
||||
|
||||
// if fehler config file exists in teh extension
|
||||
if (file_exists($configFilename))
|
||||
{
|
||||
$config = array(); // default value
|
||||
|
||||
// include config data
|
||||
include($configFilename);
|
||||
|
||||
if (isset($config[self::CONFIG_FEHLER_NAME]) && is_array($config[self::CONFIG_FEHLER_NAME]))
|
||||
{
|
||||
foreach ($config[self::CONFIG_FEHLER_NAME] as $extensionEntry)
|
||||
{
|
||||
if (
|
||||
!isset($extensionEntry[self::FEHLERCODE_NAME])
|
||||
|| !in_array($extensionEntry[self::FEHLERCODE_NAME], $this->_fehlercodes)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// add extension config data to fehlercode lib mappings
|
||||
$fehlercode = $extensionEntry[self::FEHLERCODE_NAME];
|
||||
if (isset($extensionEntry[self::FEHLER_KURZBZ_NAME]))
|
||||
$this->_codeLibMappings[$fehlercode][self::FEHLER_KURZBZ_NAME] = $extensionEntry[self::FEHLER_KURZBZ_NAME];
|
||||
|
||||
$this->_codeLibMappings[$fehlercode][self::RESOLVER_LIB_NAME]
|
||||
= $extensionEntry[self::RESOLVER_LIB_NAME] ?? null;
|
||||
$this->_codeLibMappings[$fehlercode][self::EXTENSION_NAME] = $ext->name;
|
||||
$this->_codeLibMappings[$fehlercode][self::PRODUCER_IS_RESOLVER_NAME]
|
||||
= $extensionEntry[self::PRODUCER_IS_RESOLVER_NAME] ?? false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_ci->load->library('issues/PlausicheckProducerLib', ['extensionName' => $this->_extensionName, 'isForResolutionCheck' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reseolves multiple plausicheck issues at once.
|
||||
* @param array $openIssues passed issues to resolve. If null, issues with fehlercodes in _fehlercodes property are loaded
|
||||
* @param array $codeLibMappings contains fehler type to check and library responsible for check (fehlercode => libName)
|
||||
* @param array $openIssues passed issues to resolve
|
||||
* @return result object with occured error and info
|
||||
*/
|
||||
public function resolvePlausicheckIssues($openIssues = null)
|
||||
public function resolvePlausicheckIssues($openIssues)
|
||||
{
|
||||
// loading producer lib with fehler kurzbz of provided code mappings, for "self resolving" issues
|
||||
$this->_ci->load->library(
|
||||
'issues/PlausicheckProducerLib',
|
||||
['fehlerKurzbz' => array_column($this->_codeLibMappings, self::FEHLER_KURZBZ_NAME)], 'PlausicheckResolverProducerLib'
|
||||
);
|
||||
|
||||
if (!isset($openIssues))
|
||||
{
|
||||
if (!isEmptyArray($this->_fehlercodes))
|
||||
{
|
||||
$this->_ci->load->model('system/Issue_model', 'IssueModel');
|
||||
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->_ci->IssueModel->getOpenIssues(
|
||||
$this->_fehlercodes
|
||||
);
|
||||
|
||||
$openIssues = hasData($openIssuesRes) ? getData($openIssuesRes) : [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result = new StdClass();
|
||||
$result->errors = [];
|
||||
$result->infos = [];
|
||||
|
||||
// check if all issues to resolve could be found in database
|
||||
//~ $mappingFehlerCodes = array_keys($this->_codeLibMappings);
|
||||
//~ $notFoundFehlerCodes = array_diff($this->_fehlercodes, $mappingFehlerCodes);
|
||||
|
||||
//~ if (!isEmptyArray($notFoundFehlerCodes))
|
||||
//~ $result->errors[] = error('Fehler to resolve not defined in config: '.implode(', ', $notFoundFehlerCodes));
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
$params = [];
|
||||
foreach ($this->_defaultIssueParams as $index => $propertyName)
|
||||
{
|
||||
$params[$index] = $issue->{$propertyName};
|
||||
}
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
$params,
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
@@ -188,72 +54,69 @@ class PlausicheckResolverLib
|
||||
// ignore if Fehlercode is not in libmappings (shouldn't be checked)
|
||||
if (isset($this->_codeLibMappings[$issue->fehlercode]))
|
||||
{
|
||||
$codeLibMapping = $this->_codeLibMappings[$issue->fehlercode];
|
||||
$libName = $codeLibMapping[self::RESOLVER_LIB_NAME] ?? null;
|
||||
$extensionName = $codeLibMapping[self::EXTENSION_NAME] ?? null;
|
||||
$producerIsResolver = $codeLibMapping[self::PRODUCER_IS_RESOLVER_NAME] ?? false;
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
if ($producerIsResolver)
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($this->_extensionName) ? self::EXTENSIONS_FOLDER . '/' . $this->_extensionName . '/' : '';
|
||||
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
|
||||
// file path of library for check if file exists
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH
|
||||
. '/' . $libRootPath . self::CI_LIBRARY_FOLDER . '/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
// execute same check as used for issue production
|
||||
$issueResolvedRes = $this->_ci->PlausicheckResolverProducerLib->producePlausicheckIssue(
|
||||
$issue->fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
// log error and continue with next issue if not
|
||||
$result->errors[] = "Issue library file " . $issuesLibFilePath . " does not exist";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$result->errors[] = getError($issueResolvedRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolved = !hasData($issueResolvedRes);
|
||||
}
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library($issuesLibPath . $libName);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->_ci->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$result->errors[] = "Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName";
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->_ci->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$result->errors[] = getError($issueResolvedRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($extensionName) ? self::EXTENSIONS_FOLDER . '/' . $extensionName . '/' : '';
|
||||
$issueResolved = getData($issueResolvedRes) === true;
|
||||
}
|
||||
}
|
||||
elseif (isset($this->_codeProducerLibMappings[$issue->fehlercode])) // check if it is an issue without explicit resolver, "self-resolving"
|
||||
{
|
||||
$libName = $this->_codeProducerLibMappings[$issue->fehlercode];
|
||||
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
// execute same check as used for issue production
|
||||
$issueResolvedRes = $this->_ci->plausicheckproducerlib->producePlausicheckIssue(
|
||||
$libName,
|
||||
$issue->fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
|
||||
// file path of library for check if file exists
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH
|
||||
. '/' . $libRootPath . self::CI_LIBRARY_FOLDER . '/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$result->errors[] = "Issue library file " . $issuesLibFilePath . " does not exist";
|
||||
continue;
|
||||
}
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library($issuesLibPath . $libName);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->_ci->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$result->errors[] = "Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName";
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->_ci->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$result->errors[] = getError($issueResolvedRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolved = getData($issueResolvedRes) === true;
|
||||
}
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$result->errors[] = getError($issueResolvedRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolved = !hasData($issueResolvedRes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,7 @@ class AbbrecherAktiv extends PlausiChecker
|
||||
AND benutzer.aktiv=true";
|
||||
|
||||
protected $_config_params = ['exkludierteStudiengaenge' => " AND stg.studiengang_kz NOT IN ?"];
|
||||
protected $_params_for_checking = [
|
||||
'studiengang_kz' => " AND stg.studiengang_kz = ?",
|
||||
'prestudent_id' => " AND pre.prestudent_id = ?",
|
||||
'person_id' => " AND pre.person_id = ?"
|
||||
];
|
||||
protected $_params_for_checking = ['studiengang_kz' => " AND stg.studiengang_kz = ?", 'prestudent_id' => " AND pre.prestudent_id = ?"];
|
||||
protected $_fehlertext_params = ['prestudent_id'];
|
||||
protected $_resolution_params = ['prestudent_id'];
|
||||
}
|
||||
|
||||
@@ -19,14 +19,12 @@ class AbschlussstatusFehlt extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAbschlussstatusFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -57,7 +55,6 @@ class AbschlussstatusFehlt extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -65,7 +62,6 @@ class AbschlussstatusFehlt extends PlausiChecker
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
@@ -136,12 +132,6 @@ class AbschlussstatusFehlt extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,10 +19,9 @@ class AktSemesterNull extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz, null, $person_id, $exkludierte_studiengang_kz);
|
||||
$prestudentRes = $this->getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -57,17 +56,11 @@ class AktSemesterNull extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAktSemesterNull(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
public function getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
@@ -96,12 +89,6 @@ class AktSemesterNull extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -18,10 +18,9 @@ class AktiverStudentOhneStatus extends PlausiChecker
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAktiverStudentOhneStatus($studiengang_kz, null, $person_id, $exkludierte_studiengang_kz);
|
||||
$prestudentRes = $this->getAktiverStudentOhneStatus($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -49,11 +48,10 @@ class AktiverStudentOhneStatus extends PlausiChecker
|
||||
* Students with active Benutzer should have a status in the current semester.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAktiverStudentOhneStatus($studiengang_kz = null, $prestudent_id = null, $person_id = null, $exkludierte_studiengang_kz = null)
|
||||
public function getAktiverStudentOhneStatus($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
@@ -90,12 +88,6 @@ class AktiverStudentOhneStatus extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND prestudent.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAktiverStudentstatusOhneKontobuchung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -63,7 +61,6 @@ class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -71,7 +68,6 @@ class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
@@ -113,13 +109,6 @@ class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pers.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
-10
@@ -19,14 +19,12 @@ class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -66,7 +64,6 @@ class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -74,7 +71,6 @@ class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz, $studiensemester_kurzbz, $studiensemester_kurzbz);
|
||||
@@ -109,12 +105,6 @@ class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND prestudent.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getBewerberNichtZumRtAngetreten(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -60,7 +58,6 @@ class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -68,7 +65,6 @@ class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
@@ -116,12 +112,6 @@ class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND prestudent.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getDatumAbschlusspruefungFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -60,7 +58,6 @@ class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param abschlusspruefung_id int if check is to be executed for a certain Abschlussprüfung
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -68,7 +65,6 @@ class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$abschlusspruefung_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
@@ -116,12 +112,6 @@ class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
$params[] = $abschlusspruefung_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class DatumSponsionFehlt extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getDatumSponsionFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -60,7 +58,6 @@ class DatumSponsionFehlt extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param abschlusspruefung_id int if check is to be executed only for a certain Abschlussprüfung
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -68,7 +65,6 @@ class DatumSponsionFehlt extends PlausiChecker
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$abschlusspruefung_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
@@ -116,12 +112,6 @@ class DatumSponsionFehlt extends PlausiChecker
|
||||
$params[] = $abschlusspruefung_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
+3
-15
@@ -18,10 +18,9 @@ class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getDatumStudiensemesterFalscheReihenfolge($studiengang_kz, null, $person_id, $exkludierte_studiengang_kz);
|
||||
$prestudentRes = $this->getDatumStudiensemesterFalscheReihenfolge($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -51,16 +50,11 @@ class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
* Status Dates and status studysemester dates should be in correct order.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if check is to be executed only for certain Studiengaenge
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getDatumStudiensemesterFalscheReihenfolge(
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
public function getDatumStudiensemesterFalscheReihenfolge($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
// all active students with Status student in current semester
|
||||
@@ -103,12 +97,6 @@ class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class DualesStudiumOhneMarkierung extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getDualesStudiumOhneMarkierung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -63,7 +61,6 @@ class DualesStudiumOhneMarkierung extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -71,7 +68,6 @@ class DualesStudiumOhneMarkierung extends PlausiChecker
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
@@ -136,12 +132,6 @@ class DualesStudiumOhneMarkierung extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND tbl_person.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getFalscheAnzahlAbschlusspruefungen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -57,7 +55,6 @@ class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
@@ -65,7 +62,6 @@ class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
@@ -115,12 +111,6 @@ class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,13 +19,12 @@ class FalscheAnzahlHeimatadressen extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->getFalscheAnzahlHeimatadressen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$person_id,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
|
||||
@@ -19,13 +19,12 @@ class FalscheAnzahlZustelladressen extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->getFalscheAnzahlZustelladressen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$person_id,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscherIncomingZweckPlausi extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$bisio_id = isset($params['bisio_id']) ? $params['bisio_id'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_getFalscherIncomingZweck(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$bisio_id,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
//'fehlertext_params' => array('bisio_id' => $prestudent->bisio_id),
|
||||
'resolution_params' => array('bisio_id' => $prestudent->bisio_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Incomings should have the correct Zweck.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param bisio_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
private function _getFalscherIncomingZweck(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$bisio_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
|
||||
$params = array();
|
||||
$studiensemester_clause = '';
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester_clause = "AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
$qry = "
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
DISTINCT ON (bisio_id) prestudent_id, person_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, zw.zweck_code, stg.studiengang_kz,
|
||||
bisio.bisio_id, COUNT(zw.zweck_code) OVER (PARTITION BY bisio_id) AS anzahl
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING (prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester sem ON status.studiensemester_kurzbz = sem.studiensemester_kurzbz
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN bis.tbl_bisio bisio ON stud.student_uid = bisio.student_uid
|
||||
JOIN bis.tbl_bisio_zweck zw USING (bisio_id)
|
||||
WHERE
|
||||
stg.melderelevant
|
||||
AND pre.bismelden
|
||||
AND status.status_kurzbz = 'Incoming'
|
||||
AND bisio.von::date < sem.ende AND bisio.bis::date > sem.start
|
||||
{$studiensemester_clause}
|
||||
) zwecke
|
||||
WHERE anzahl = 1 AND zweck_code NOT IN ('1', '2', '3')";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND zwecke.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($bisio_id))
|
||||
{
|
||||
$qry .= " AND zwecke.bisio_id = ?";
|
||||
$params[] = $bisio_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND zwecke.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND zwecke.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
@@ -19,10 +19,9 @@ class GbDatumWeitZurueck extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->getGbDatumWeitZurueck($studiensemester_kurzbz, $studiengang_kz, $person_id, $exkludierte_studiengang_kz);
|
||||
$personRes = $this->getGbDatumWeitZurueck($studiensemester_kurzbz, $studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class GeburtsnationFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_getGeburtsnationFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'fehlertext_params' => array(),
|
||||
'resolution_params' => array()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Geburtsnation is missing.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
private function _getGeburtsnationFehlt(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT person_id
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
(geburtsnation IS NULL OR geburtsnation = '')
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
@@ -19,14 +19,12 @@ class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getInaktiverStudentAktiverStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -60,26 +58,21 @@ class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getInaktiverStudentAktiverStatus(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
if (!isset($studiensemester_kurzbz))
|
||||
{
|
||||
$this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
$aktStudiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
|
||||
$this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
$aktStudiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
|
||||
|
||||
if (isError($aktStudiensemesterRes)) return $aktStudiensemesterRes;
|
||||
if (isError($aktStudiensemesterRes)) return $aktStudiensemesterRes;
|
||||
|
||||
$studiensemester_kurzbz = hasData($aktStudiensemesterRes) ? getData($aktStudiensemesterRes)[0]->studiensemester_kurzbz : '';
|
||||
}
|
||||
$studiensemester_kurzbz = hasData($aktStudiensemesterRes) ? getData($aktStudiensemesterRes)[0]->studiensemester_kurzbz : '';
|
||||
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
@@ -110,12 +103,6 @@ class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND prestudent.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,13 +19,12 @@ class IncomingHeimatNationOesterreich extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->getIncomingHeimatNationOesterreich(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$person_id,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
|
||||
@@ -18,10 +18,9 @@ class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getIncomingOhneIoDatensatz($studiengang_kz, null, $person_id, $exkludierte_studiengang_kz);
|
||||
$prestudentRes = $this->getIncomingOhneIoDatensatz($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
@@ -49,11 +48,10 @@ class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
* Incoming should have IN/OUT data.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getIncomingOhneIoDatensatz($studiengang_kz = null, $prestudent_id = null, $person_id = null, $exkludierte_studiengang_kz = null)
|
||||
public function getIncomingOhneIoDatensatz($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
@@ -87,12 +85,6 @@ class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND tbl_person.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getIncomingOrGsFoerderrelevant(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -57,7 +55,6 @@ class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return object success or error
|
||||
*/
|
||||
@@ -65,7 +62,6 @@ class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array();
|
||||
@@ -118,12 +114,6 @@ class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pers.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -19,14 +19,12 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getInskriptionVorLetzerBismeldung(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -61,7 +59,7 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
|
||||
/**
|
||||
* Students of a semester shouldn't start studies before the date of Bismeldung.
|
||||
* e.g. If student studies in WS2022 datum of status shouldn't be before 15.4.2022
|
||||
* e.g. If student studies in WS2022 datum of status shouldn't be before 15.4.2020
|
||||
* e.g. If student studies in SS2022 datum of status shouldn't be before 15.11.2022
|
||||
* @param studiensemester_kurzbz string check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
@@ -73,14 +71,11 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
// get Bismeldedatum
|
||||
$datumBis = $this->_getBisdateFromSemester($studiensemester_kurzbz);
|
||||
|
||||
if (!$datumBis) return success([]);
|
||||
|
||||
$params = array($datumBis, $studiensemester_kurzbz, $datumBis);
|
||||
|
||||
// get active students
|
||||
@@ -122,12 +117,6 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND prestudent.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
@@ -143,16 +132,17 @@ class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
*/
|
||||
private function _getBisdateFromSemester($studiensemester_kurzbz)
|
||||
{
|
||||
$bisdate = null;
|
||||
$semesterYear = substr($studiensemester_kurzbz, 2, 6);
|
||||
$semesterType = substr($studiensemester_kurzbz, 0, 2);
|
||||
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$prevSemester = $this->_ci->StudiensemesterModel->getPreviousFrom($studiensemester_kurzbz);
|
||||
if (!hasData($prevSemester)) return null;
|
||||
$prevSemester = getData($prevSemester)[0]->studiensemester_kurzbz;
|
||||
if ($semesterType == 'SS')
|
||||
{
|
||||
return date_format(date_create(($semesterYear - 1)."-11-15"), 'Y-m-d');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
|
||||
$bisDate = $this->_ci->BismeldestichtagModel->getLastReachedMeldestichtag($prevSemester);
|
||||
if (!hasData($bisDate)) return null;
|
||||
return getData($bisDate)[0]->meldestichtag;
|
||||
if ($semesterType == 'WS')
|
||||
{
|
||||
return date_format(date_create($semesterYear."-04-15"), 'Y-m-d');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class KeinAufenthaltszweckPlausi extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$bisio_id = isset($params['bisio_id']) ? $params['bisio_id'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_getKeinAufenthaltszweck(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$bisio_id,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
//'fehlertext_params' => array('bisio_id' => $prestudent->bisio_id),
|
||||
'resolution_params' => array('bisio_id' => $prestudent->bisio_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Students with mobility should have Aufenthaltszweck.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param bisio_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
private function _getKeinAufenthaltszweck(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$bisio_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (bisio_id) prestudent_id, person_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz,
|
||||
zw.zweck_code, stg.studiengang_kz, bisio.bisio_id
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING (prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester sem ON status.studiensemester_kurzbz = sem.studiensemester_kurzbz
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN bis.tbl_bisio bisio ON stud.student_uid = bisio.student_uid
|
||||
LEFT JOIN bis.tbl_bisio_zweck zw USING (bisio_id)
|
||||
WHERE
|
||||
(zw.zweck_code IS NULL OR zw.zweck_code = '')
|
||||
AND bisio.von::date < sem.ende AND bisio.bis::date > sem.start
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($bisio_id))
|
||||
{
|
||||
$qry .= " AND bisio.bisio_id = ?";
|
||||
$params[] = $bisio_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $bisio_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,11 @@ class NationNichtOesterreichAberGemeinde extends PlausiChecker
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->getNationNichtOesterreichAberGemeinde(
|
||||
$studiengang_kz,
|
||||
$person_id,
|
||||
null,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
|
||||
@@ -19,14 +19,12 @@ class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getOrgformStgUngleichOrgformPrestudent(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
null,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
@@ -72,7 +70,6 @@ class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz = null,
|
||||
$prestudent_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
$params = array($studiensemester_kurzbz);
|
||||
@@ -119,12 +116,6 @@ class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND prestudent.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OutgoingAngerechneteEctsFehlenPlausi extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$bisio_id = isset($params['bisio_id']) ? $params['bisio_id'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_getAngerechneteEctsFehlen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$bisio_id,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
//'fehlertext_params' => array('bisio_id' => $prestudent->bisio_id),
|
||||
'resolution_params' => array('bisio_id' => $prestudent->bisio_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Outgoing should have angerechnete ECTS.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param bisio_id int if check is to be executed only for one prestudent
|
||||
* @param person_id int if check is to be executed only for one person
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
private function _getAngerechneteEctsFehlen(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$bisio_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (bisio_id) prestudent_id, person_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz,
|
||||
stg.studiengang_kz, bisio.bisio_id
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING (prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester sem ON status.studiensemester_kurzbz = sem.studiensemester_kurzbz
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN bis.tbl_bisio bisio ON stud.student_uid = bisio.student_uid
|
||||
WHERE
|
||||
bisio.bis IS NOT NULL
|
||||
AND bisio.bis::date <= NOW()
|
||||
AND bisio.bis::date - bisio.von::date >= 29
|
||||
AND bisio.ects_angerechnet IS NULL
|
||||
AND NOT EXISTS (SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz = 'Incoming' AND prestudent_id = pre.prestudent_id)
|
||||
AND bisio.von::date < sem.ende AND bisio.bis::date > sem.start
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($bisio_id))
|
||||
{
|
||||
$qry .= " AND bisio.bisio_id = ?";
|
||||
$params[] = $bisio_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
-128
@@ -1,128 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OutgoingAufenthaltfoerderungfehltPlausi extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$bisio_id = isset($params['bisio_id']) ? $params['bisio_id'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_getAufenthaltsfoerderungFehlt(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$bisio_id,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
//'fehlertext_params' => array('bisio_id' => $prestudent->bisio_id),
|
||||
'resolution_params' => array('bisio_id' => $prestudent->bisio_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Student with mobility should have Aufenthaltsfoerderung.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param bisio_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
private function _getAufenthaltsfoerderungFehlt(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$bisio_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (bisio_id) prestudent_id, person_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz,
|
||||
stg.studiengang_kz, bisio.bisio_id
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING (prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester sem ON status.studiensemester_kurzbz = sem.studiensemester_kurzbz
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN bis.tbl_bisio bisio ON stud.student_uid = bisio.student_uid
|
||||
LEFT JOIN bis.tbl_bisio_aufenthaltfoerderung foerd USING (bisio_id)
|
||||
WHERE
|
||||
bisio.bis IS NOT NULL
|
||||
AND bisio.bis::date - bisio.von::date >= 29
|
||||
AND foerd.aufenthaltfoerderung_code IS NULL
|
||||
AND NOT EXISTS (SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz = 'Incoming' AND prestudent_id = pre.prestudent_id)
|
||||
AND bisio.von::date < sem.ende AND bisio.bis::date > sem.start
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($bisio_id))
|
||||
{
|
||||
$qry .= " AND bisio.bisio_id = ?";
|
||||
$params[] = $bisio_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OutgoingErworbeneEctsFehlenPlausi extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
$bisio_id = isset($params['bisio_id']) ? $params['bisio_id'] : null;
|
||||
$person_id = isset($params['person_id']) ? $params['person_id'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_getAngerechneteEctsFehlen(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz,
|
||||
$bisio_id,
|
||||
$person_id,
|
||||
$exkludierte_studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
//'fehlertext_params' => array('bisio_id' => $prestudent->bisio_id),
|
||||
'resolution_params' => array('bisio_id' => $prestudent->bisio_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Outgoing should have erworbene ECTS.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param bisio_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
private function _getAngerechneteEctsFehlen(
|
||||
$studiensemester_kurzbz = null,
|
||||
$studiengang_kz = null,
|
||||
$bisio_id = null,
|
||||
$person_id = null,
|
||||
$exkludierte_studiengang_kz = null
|
||||
) {
|
||||
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (bisio_id) prestudent_id, person_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz,
|
||||
stg.studiengang_kz, bisio.bisio_id
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_student stud USING (prestudent_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester sem ON status.studiensemester_kurzbz = sem.studiensemester_kurzbz
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
JOIN bis.tbl_bisio bisio ON stud.student_uid = bisio.student_uid
|
||||
WHERE
|
||||
bisio.bis IS NOT NULL
|
||||
AND bisio.bis::date <= NOW()
|
||||
AND bisio.bis::date - bisio.von::date >= 29
|
||||
AND bisio.ects_erworben IS NULL
|
||||
AND NOT EXISTS (SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz = 'Incoming' AND prestudent_id = pre.prestudent_id)
|
||||
AND bisio.von::date < sem.ende AND bisio.bis::date > sem.start
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= " AND status.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($bisio_id))
|
||||
{
|
||||
$qry .= " AND bisio.bisio_id = ?";
|
||||
$params[] = $bisio_id;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= " AND pre.person_id = ?";
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user