mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Compare commits
992
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
229352e5e4 | ||
|
|
3dd9be5ea2 | ||
|
|
ce62713790 | ||
|
|
34761db664 | ||
|
|
c7131ed775 | ||
|
|
b57e1984a8 | ||
|
|
acedc11be8 | ||
|
|
15c1da74a2 | ||
|
|
d33b45d7cb | ||
|
|
b3b6d847a7 | ||
|
|
80365de28c | ||
|
|
2d74522a4f | ||
|
|
d00aef66e1 | ||
|
|
241eec3ef2 | ||
|
|
2050f5ae65 | ||
|
|
587e523990 | ||
|
|
5ec1a1c54c | ||
|
|
2c65ccc8da | ||
|
|
787308aad4 | ||
|
|
8b44e4475b | ||
|
|
d251987850 | ||
|
|
ba92eea7eb | ||
|
|
50951dfdcf | ||
|
|
be7527e994 | ||
|
|
d5c1721ab1 | ||
|
|
8eb27b194f | ||
|
|
579a55a00d | ||
|
|
0a00caa1e4 | ||
|
|
224cef7fad | ||
|
|
c53040ed5c | ||
|
|
f7465047cb | ||
|
|
0dadaece08 | ||
|
|
69fd223358 | ||
|
|
9c43374267 | ||
|
|
ea7c0cccde | ||
|
|
6dfe292776 | ||
|
|
c90f7a31bb | ||
|
|
073160dde4 | ||
|
|
56fe8c9d09 | ||
|
|
9a3532265f | ||
|
|
4abe6f0d24 | ||
|
|
9fbbd6b855 | ||
|
|
59b4b2bac9 | ||
|
|
5f546fca2a | ||
|
|
1bf2b707ef | ||
|
|
f74b885253 | ||
|
|
3ab402adef | ||
|
|
52f24645fb | ||
|
|
d1bd77efb9 | ||
|
|
4ac108174b | ||
|
|
6378b80d87 | ||
|
|
658c8d6bd4 | ||
|
|
bf29faa5a7 | ||
|
|
2ada167557 | ||
|
|
086d20c1c9 | ||
|
|
9f29a7798a | ||
|
|
cc9d1f983e | ||
|
|
09ee72bd50 | ||
|
|
6af2c7e11a | ||
|
|
5fff45e302 | ||
|
|
57c48f2c4a | ||
|
|
1802f9d32c | ||
|
|
e32691994c | ||
|
|
6d641bbd06 | ||
|
|
3455aed3f5 | ||
|
|
f84d12277d | ||
|
|
9bf5bc2ad9 | ||
|
|
27765606e3 | ||
|
|
75d2cabdbe | ||
|
|
bae9d6d9a0 | ||
|
|
43d6a882ce | ||
|
|
7f3b4100ab | ||
|
|
9f54ecce54 | ||
|
|
7af0f4a478 | ||
|
|
0f843db33d | ||
|
|
3e59648d5b | ||
|
|
5923991848 | ||
|
|
55a6ec9d0d | ||
|
|
78505589c8 | ||
|
|
0e985113ec | ||
|
|
8d9113d5c8 | ||
|
|
7ce81ad4bd | ||
|
|
ea56ec8daa | ||
|
|
bf5ee2f64b | ||
|
|
55d6d90fa6 | ||
|
|
6adc55a843 | ||
|
|
52c1fba17b | ||
|
|
5e15d4b219 | ||
|
|
00954f680b | ||
|
|
92d27fc242 | ||
|
|
f6bb27cdb0 | ||
|
|
558963cd74 | ||
|
|
0b5c0f27a5 | ||
|
|
f846bb221a | ||
|
|
d8355ba3f5 | ||
|
|
afb8011347 | ||
|
|
46f8d0d07d | ||
|
|
6d5a4531e1 | ||
|
|
d85a3cb08f | ||
|
|
15beaa9be8 | ||
|
|
574057da88 | ||
|
|
c81b5338de | ||
|
|
c433ff5c3a | ||
|
|
ab2a0e93ed | ||
|
|
9274743df3 | ||
|
|
d139c4ed66 | ||
|
|
dd410a74ba | ||
|
|
a5797a0bde | ||
|
|
5c69ede19e | ||
|
|
a5257eb934 | ||
|
|
317da29376 | ||
|
|
772b8c603c | ||
|
|
37d5f2da5d | ||
|
|
27c39cfdca | ||
|
|
30c4e565dd | ||
|
|
d66fe72cc9 | ||
|
|
684d4f890a | ||
|
|
10218305db | ||
|
|
31bae9b693 | ||
|
|
59ac56374e | ||
|
|
a397460e0e | ||
|
|
c3c23d28bb | ||
|
|
9f0b387ab6 | ||
|
|
3a97f20122 | ||
|
|
046a552f34 | ||
|
|
e8a534f0fe | ||
|
|
1f21ed7364 | ||
|
|
774a1b81c4 | ||
|
|
f566ea1ac3 | ||
|
|
108f91ea1a | ||
|
|
4a92511b9b | ||
|
|
dc5a846c10 | ||
|
|
364477f0e9 | ||
|
|
d2ca33e757 | ||
|
|
8bfd90e159 | ||
|
|
8d8a4e8ca6 | ||
|
|
06895510e0 | ||
|
|
83b06b6c50 | ||
|
|
d710b4a9e4 | ||
|
|
bd99f3f927 | ||
|
|
eeb1529b64 | ||
|
|
98c3707802 | ||
|
|
43e9dad17d | ||
|
|
a27fa50e42 | ||
|
|
196e9be728 | ||
|
|
a00f6363d9 | ||
|
|
a65b0d693f | ||
|
|
736e897928 | ||
|
|
21f8bb39b5 | ||
|
|
cd87ecc2d9 | ||
|
|
a3ae14b3f5 | ||
|
|
6cf4458dcd | ||
|
|
59b8d195c1 | ||
|
|
7926a2b201 | ||
|
|
b6aa459b98 | ||
|
|
53a9fab70b | ||
|
|
5182f13bdb | ||
|
|
804dfc9327 | ||
|
|
74e2d1dcc5 | ||
|
|
e5c8807f17 | ||
|
|
af9e34a8ae | ||
|
|
10a97a80de | ||
|
|
abd2f831f2 | ||
|
|
9d7f48f52c | ||
|
|
dd1a5064e4 | ||
|
|
a3ca578b3d | ||
|
|
e37321eeff | ||
|
|
505c71b18c | ||
|
|
efde2e9601 | ||
|
|
8f34142599 | ||
|
|
6570cc1fd7 | ||
|
|
fed0afd426 | ||
|
|
2c2c6efc5e | ||
|
|
0419286557 | ||
|
|
08f6bee2e4 | ||
|
|
cfa4dd8b8a | ||
|
|
ab637ded26 | ||
|
|
4c072aa819 | ||
|
|
f693f9d17c | ||
|
|
2f86a1b017 | ||
|
|
75ddbdf7c1 | ||
|
|
d824334538 | ||
|
|
13515b2522 | ||
|
|
ecfe648bf5 | ||
|
|
bddd7b5d65 | ||
|
|
2686aee158 | ||
|
|
b7a2198057 | ||
|
|
bf6b588675 | ||
|
|
b427788e04 | ||
|
|
e7e561a4ba | ||
|
|
d9972c0d32 | ||
|
|
6c03110442 | ||
|
|
f717fb462f | ||
|
|
640a7285e1 | ||
|
|
e9fc0629f5 | ||
|
|
6f0279d451 | ||
|
|
2d73f97a25 | ||
|
|
dcd6163198 | ||
|
|
9f68fe6b3b | ||
|
|
7c9f6d89d6 | ||
|
|
ea3d01d23b | ||
|
|
c4ffc7283d | ||
|
|
0fa663145d | ||
|
|
b49831cae8 | ||
|
|
c616e9d450 | ||
|
|
9b0607ca74 | ||
|
|
3d728fd884 | ||
|
|
2b4aef5633 | ||
|
|
dca30dccf3 | ||
|
|
b9d4aefd5e | ||
|
|
69048f8f48 | ||
|
|
36fe0a0f3c | ||
|
|
c5e296d557 | ||
|
|
d1ca6eb988 | ||
|
|
be4db980ad | ||
|
|
0ef905c6f2 | ||
|
|
21f0b18af4 | ||
|
|
6a786df198 | ||
|
|
4e16220da1 | ||
|
|
5ce02d747c | ||
|
|
9c31b27339 | ||
|
|
aa52c32d40 | ||
|
|
02a97fb0e2 | ||
|
|
2107c0839f | ||
|
|
b277725cc3 | ||
|
|
aade60179d | ||
|
|
e029b09add | ||
|
|
47b9e6c086 | ||
|
|
2fa8fd1703 | ||
|
|
89ea4187fa | ||
|
|
0e099b2752 | ||
|
|
d7f383b969 | ||
|
|
a22a8acf83 | ||
|
|
5c7df11ff3 | ||
|
|
c83674fc41 | ||
|
|
dcd17bb34f | ||
|
|
ed1925b517 | ||
|
|
5d024b3a71 | ||
|
|
507b47e9ea | ||
|
|
e7d2d3502b | ||
|
|
54168c86b4 | ||
|
|
a8dd995195 | ||
|
|
f46a3c1f68 | ||
|
|
a83fe561b9 | ||
|
|
ae56a4f2ed | ||
|
|
22b1f2822a | ||
|
|
1fd15e14d5 | ||
|
|
1ae02d8ed8 | ||
|
|
7cda22f807 | ||
|
|
68292b60af | ||
|
|
542590b470 | ||
|
|
eb460fdc0a | ||
|
|
65e76e951a | ||
|
|
43d69a5683 | ||
|
|
6c25a3b262 | ||
|
|
1f6c9e865b | ||
|
|
1abfbccb3e | ||
|
|
362d1c8bb0 | ||
|
|
25a61a56b7 | ||
|
|
afb210b0c2 | ||
|
|
c84146fcbd | ||
|
|
35decf476c | ||
|
|
0471f838b9 | ||
|
|
1c9d9d1ce5 | ||
|
|
379a99cb14 | ||
|
|
0d29a9ba32 | ||
|
|
ed44732eef | ||
|
|
6cfc4b0973 | ||
|
|
6296b87ea5 | ||
|
|
576a44838f | ||
|
|
c00e7a182c | ||
|
|
fd1b5daf9c | ||
|
|
c0b5f2f748 | ||
|
|
d391d1f09c | ||
|
|
a36ed55390 | ||
|
|
b0f317951b | ||
|
|
f65135be1e | ||
|
|
b8d86ba628 | ||
|
|
e9312dfbb3 | ||
|
|
b21900d006 | ||
|
|
11cfa670d6 | ||
|
|
a94fbeba14 | ||
|
|
e01b816ee8 | ||
|
|
52c90111cc | ||
|
|
012571d070 | ||
|
|
a2d10ae09d | ||
|
|
96bf45ceb0 | ||
|
|
c233902fe2 | ||
|
|
fd8de88abb | ||
|
|
0ec2c8c543 | ||
|
|
29738b6690 | ||
|
|
c5c29df6cc | ||
|
|
b217681ee5 | ||
|
|
7841a73fc0 | ||
|
|
0b1d0fbe4c | ||
|
|
2064008f9e | ||
|
|
19b9906c86 | ||
|
|
85807f5b8c | ||
|
|
a1950d179b | ||
|
|
2c3913a763 | ||
|
|
9111edf442 | ||
|
|
b1c47da3c3 | ||
|
|
67eb238876 | ||
|
|
66e400013a | ||
|
|
a139cc8d2e | ||
|
|
35ecbdefa8 | ||
|
|
3f95bfd82f | ||
|
|
d4929c8e22 | ||
|
|
194b74e390 | ||
|
|
ee70e43bfb | ||
|
|
5f0b1ace51 | ||
|
|
b891d8baa5 | ||
|
|
5dbcf9ce70 | ||
|
|
f8d8d501ca | ||
|
|
7e6d670d82 | ||
|
|
f3a3bfcab6 | ||
|
|
d134509c90 | ||
|
|
4424c7d748 | ||
|
|
d436d8cb20 | ||
|
|
86c06e4756 | ||
|
|
c26db6cc40 | ||
|
|
3689c64b7b | ||
|
|
26ddd404c0 | ||
|
|
8548b93ddc | ||
|
|
bdc4782e9d | ||
|
|
0583990870 | ||
|
|
2e33722674 | ||
|
|
b5e65cf072 | ||
|
|
5972764731 | ||
|
|
9629345473 | ||
|
|
4d72b0047a | ||
|
|
2933a525c1 | ||
|
|
5694ba7325 | ||
|
|
bbec7de8de | ||
|
|
1d14e58d8f | ||
|
|
db2beeb51f | ||
|
|
e4f43cc820 | ||
|
|
8adc1c8bcc | ||
|
|
b991bbd9a5 | ||
|
|
fe195f4080 | ||
|
|
5bed848aae | ||
|
|
c69bb9ccaa | ||
|
|
4889299dd9 | ||
|
|
8f427344d0 | ||
|
|
0d6867799c | ||
|
|
5602c7091a | ||
|
|
f3b617d339 | ||
|
|
a4c5f9946f | ||
|
|
0be3505163 | ||
|
|
81f0b7a4bf | ||
|
|
6c550372a3 | ||
|
|
6a16fb7515 | ||
|
|
c86d6f4bf3 | ||
|
|
33b05e9df5 | ||
|
|
ac2a1147cc | ||
|
|
8d7fdb0254 | ||
|
|
0fd938e85c | ||
|
|
b57fe4839b | ||
|
|
335753be8c | ||
|
|
c59b24ab4a | ||
|
|
c194e94b5c | ||
|
|
6d23f2b9fa | ||
|
|
0b70153da0 | ||
|
|
190d797d31 | ||
|
|
fb1c7f8e90 | ||
|
|
6428fccc48 | ||
|
|
044e29f557 | ||
|
|
f5cdb0a2fb | ||
|
|
dc22ac6b06 | ||
|
|
093e3d5c97 | ||
|
|
9bc9e57deb | ||
|
|
483d8f733f | ||
|
|
eb885bfea7 | ||
|
|
d405296a14 | ||
|
|
787e5d0ee4 | ||
|
|
be5aad7c33 | ||
|
|
b7940a5cce | ||
|
|
f9b3939d09 | ||
|
|
69b19562f4 | ||
|
|
9948060ed8 | ||
|
|
06ec020c1c | ||
|
|
01f2099c28 | ||
|
|
9cb5d0895d | ||
|
|
086b271480 | ||
|
|
6264006728 | ||
|
|
03b2d3d1a4 | ||
|
|
0007460428 | ||
|
|
ff38731077 | ||
|
|
8cc0462712 | ||
|
|
4162305ac6 | ||
|
|
8abb028f55 | ||
|
|
5399375bc1 | ||
|
|
48798a9cee | ||
|
|
3e8445304c | ||
|
|
b047b95505 | ||
|
|
3e48401a04 | ||
|
|
48f07eb3ca | ||
|
|
6508301526 | ||
|
|
db5339e4a5 | ||
|
|
4ed87b5c2b | ||
|
|
a8f472ca6c | ||
|
|
d680c3aa2b | ||
|
|
d98bdb9745 | ||
|
|
138c80c97a | ||
|
|
97a88d1d0d | ||
|
|
a23d079001 | ||
|
|
90907d4276 | ||
|
|
f13f6ff0cc | ||
|
|
a595daa9b4 | ||
|
|
4a283ebf5d | ||
|
|
e27e64414a | ||
|
|
c47ac926d2 | ||
|
|
f751df55b6 | ||
|
|
ecd6588ead | ||
|
|
e7c133586b | ||
|
|
d5ee6f9cc2 | ||
|
|
a721c1d14d | ||
|
|
b662fa5fd3 | ||
|
|
3094772150 | ||
|
|
f0afcdd1c5 | ||
|
|
70368525e0 | ||
|
|
715c9f77b8 | ||
|
|
3401afed94 | ||
|
|
21886e30a3 | ||
|
|
2ab2176795 | ||
|
|
464cfb9efc | ||
|
|
e3aa36cae0 | ||
|
|
0a232828c8 | ||
|
|
90b8788c93 | ||
|
|
c125130dcb | ||
|
|
df2f142f37 | ||
|
|
eb9c882fe9 | ||
|
|
c7bac03429 | ||
|
|
07d3b32279 | ||
|
|
245d0d3369 | ||
|
|
d3d04c5a77 | ||
|
|
f4cc311806 | ||
|
|
0687ef72ce | ||
|
|
ff58f7a102 | ||
|
|
c0ed296ba7 | ||
|
|
2692806d4f | ||
|
|
a59f6085fe | ||
|
|
2170d3e14a | ||
|
|
9180b9bd63 | ||
|
|
2b06de8ecb | ||
|
|
df46b8ebdd | ||
|
|
cce1c50495 | ||
|
|
263b04e67f | ||
|
|
168fb00023 | ||
|
|
7c594bc4f9 | ||
|
|
3f99a2ce81 | ||
|
|
f5d81e4a93 | ||
|
|
b0f3fa0c46 | ||
|
|
6d89e95afa | ||
|
|
e574998897 | ||
|
|
4474a24ee2 | ||
|
|
f59e5a20ea | ||
|
|
c9fe633706 | ||
|
|
3ced1966f4 | ||
|
|
07bb0ddffd | ||
|
|
538223752b | ||
|
|
c9011fd6ed | ||
|
|
f0f9becc1f | ||
|
|
34c210a2a7 | ||
|
|
df8c58f5df | ||
|
|
7abd35d11b | ||
|
|
d2c97d0238 | ||
|
|
1d0ca15bcb | ||
|
|
0bb81b23e5 | ||
|
|
8862f050e8 | ||
|
|
e088b529f0 | ||
|
|
61349c7ca3 | ||
|
|
c75e1f9416 | ||
|
|
b3ae1b74ab | ||
|
|
bf4b8348d2 | ||
|
|
66e1e6ad8a | ||
|
|
d0d590ff89 | ||
|
|
0410c95447 | ||
|
|
60e36bb4b9 | ||
|
|
2f90112e4d | ||
|
|
774eb90bcc | ||
|
|
1def930147 | ||
|
|
30b8a406a5 | ||
|
|
093842274e | ||
|
|
9ec876fc27 | ||
|
|
cac3df195e | ||
|
|
ae71517ceb | ||
|
|
9f462fe3d6 | ||
|
|
004bcc43c3 | ||
|
|
6d79288f33 | ||
|
|
fd2f4187fa | ||
|
|
22228478ad | ||
|
|
2eb2c36d5b | ||
|
|
23b1e98a7a | ||
|
|
1d5b915717 | ||
|
|
eb281f3bc3 | ||
|
|
aeebc2a81a | ||
|
|
b2bebb7fa3 | ||
|
|
e32cce57fe | ||
|
|
22eed92c86 | ||
|
|
fa91e204f0 | ||
|
|
ac6aa28680 | ||
|
|
f6f58642f5 | ||
|
|
57eec98604 | ||
|
|
1561aa55b7 | ||
|
|
23506430b1 | ||
|
|
fa58635a22 | ||
|
|
35f4d23308 | ||
|
|
97e7e5b641 | ||
|
|
bb366e4117 | ||
|
|
178c854941 | ||
|
|
7f630f24d5 | ||
|
|
3483146c1a | ||
|
|
ca712781dc | ||
|
|
0ed56ca067 | ||
|
|
557e43e19c | ||
|
|
c0c57ba378 | ||
|
|
790568e1e0 | ||
|
|
a704ce215b | ||
|
|
0cc628a8e3 | ||
|
|
cf506a7b1e | ||
|
|
b9670f3f09 | ||
|
|
870c36e76b | ||
|
|
dfc3096587 | ||
|
|
b9c045382d | ||
|
|
c099eec7a7 | ||
|
|
0962e62e69 | ||
|
|
dcd6cfd74b | ||
|
|
5caab182b2 | ||
|
|
baaf941f25 | ||
|
|
2e5e7afb4d | ||
|
|
2c4626fd1a | ||
|
|
178638c006 | ||
|
|
981c97173e | ||
|
|
49d5c46133 | ||
|
|
9fb00f6cbd | ||
|
|
e59bd51333 | ||
|
|
239eaa90e9 | ||
|
|
4e5bf94a15 | ||
|
|
ec4a04d63b | ||
|
|
7d3096c2e8 | ||
|
|
ef2f9630a9 | ||
|
|
4d3c73c78f | ||
|
|
1e226f4515 | ||
|
|
ca8fe5bd19 | ||
|
|
e2497e1958 | ||
|
|
95f09e9114 | ||
|
|
a3dd5a188b | ||
|
|
c0192e9e00 | ||
|
|
d4e170037b | ||
|
|
449537ef77 | ||
|
|
d16120f650 | ||
|
|
0326a01585 | ||
|
|
7aba7aefb9 | ||
|
|
12d8c8447b | ||
|
|
905cd46942 | ||
|
|
e5ae400686 | ||
|
|
625ffe12ce | ||
|
|
0a4906c5ac | ||
|
|
c468d350f3 | ||
|
|
89814d1db2 | ||
|
|
29f9b226ab | ||
|
|
1b822fc8f8 | ||
|
|
368eded1fd | ||
|
|
dbcacdddd6 | ||
|
|
772f35c6ba | ||
|
|
8b2ef4e832 | ||
|
|
4b22f939b5 | ||
|
|
6fedb4b108 | ||
|
|
7b46a15752 | ||
|
|
a7cc07fe15 | ||
|
|
e91f8e5ca4 | ||
|
|
905c69c384 | ||
|
|
c765c3c40a | ||
|
|
bf3d6275d4 | ||
|
|
9b823dbaa1 | ||
|
|
6fa0a7c102 | ||
|
|
7320dc448e | ||
|
|
ede9323224 | ||
|
|
3dcf72d679 | ||
|
|
dd2fd6421b | ||
|
|
3b99a14b47 | ||
|
|
1d3d067b44 | ||
|
|
398e3aa139 | ||
|
|
d3ceed32c6 | ||
|
|
780890fbdd | ||
|
|
72aed76857 | ||
|
|
229882e8d8 | ||
|
|
1e184d36fc | ||
|
|
553a33aa42 | ||
|
|
90e933de00 | ||
|
|
8ce67a4726 | ||
|
|
bcfdf1e05c | ||
|
|
cb744799bd | ||
|
|
05e9d948ea | ||
|
|
a5d343268f | ||
|
|
90ebee25fe | ||
|
|
14372a6fce | ||
|
|
3e8ed231a6 | ||
|
|
4c67b9d267 | ||
|
|
c16cf342cb | ||
|
|
d843f05922 | ||
|
|
44e9b4dff1 | ||
|
|
80306dadf7 | ||
|
|
9e061de9bd | ||
|
|
bda42ab347 | ||
|
|
b5b69878b8 | ||
|
|
6f17ddbbdf | ||
|
|
adba14f6e7 | ||
|
|
d0adf2dfc3 | ||
|
|
57e901be27 | ||
|
|
d38641e312 | ||
|
|
40a0f6a7e9 | ||
|
|
b6e1bb06f3 | ||
|
|
ef1347c7d5 | ||
|
|
bf5ab6b7dd | ||
|
|
86dc002fa6 | ||
|
|
453fc209b8 | ||
|
|
d1fa5f64c4 | ||
|
|
af8814468f | ||
|
|
c8a6e2f7cd | ||
|
|
2227c3ecf1 | ||
|
|
c7526bd0d9 | ||
|
|
791f69b509 | ||
|
|
f51d0f72c6 | ||
|
|
21eb95bb23 | ||
|
|
b57836c2af | ||
|
|
e80ee03365 | ||
|
|
5592b69dc0 | ||
|
|
fc1303affd | ||
|
|
96b2d88d39 | ||
|
|
474fc1fc57 | ||
|
|
3825e2fb38 | ||
|
|
c62c3c23f6 | ||
|
|
863aaf62ec | ||
|
|
293352ac3c | ||
|
|
b22375bd21 | ||
|
|
f9550c99bb | ||
|
|
df369c7149 | ||
|
|
b16194701c | ||
|
|
736e91224e | ||
|
|
9bc564dbf9 | ||
|
|
6d0ab0d4aa | ||
|
|
1fe742d9c7 | ||
|
|
b18ce08578 | ||
|
|
7ae34e0640 | ||
|
|
e9b5438a24 | ||
|
|
51be318edc | ||
|
|
ca79b0c4d8 | ||
|
|
dfe05cbfa8 | ||
|
|
e856c8ad6b | ||
|
|
9109ead81c | ||
|
|
746f8bc736 | ||
|
|
9c03b89ab5 | ||
|
|
5798e960a2 | ||
|
|
98730ce612 | ||
|
|
5aded99999 | ||
|
|
f780553773 | ||
|
|
2723d6a741 | ||
|
|
e5e22931a9 | ||
|
|
804716edb2 | ||
|
|
332a47475e | ||
|
|
132edce701 | ||
|
|
6ce0cf6209 | ||
|
|
868599a7fe | ||
|
|
21ea277aaf | ||
|
|
53bce69c6f | ||
|
|
20c68d675c | ||
|
|
dfc8fdf44f | ||
|
|
2c0badf67c | ||
|
|
4a26d7a89a | ||
|
|
5e72161ab0 | ||
|
|
16f57a1bce | ||
|
|
1cf3c18841 | ||
|
|
1dd9ff0daf | ||
|
|
011e93720e | ||
|
|
331381c94d | ||
|
|
478b23825c | ||
|
|
ff876afbb3 | ||
|
|
dd13c73415 | ||
|
|
e89ab9b92f | ||
|
|
4e59173d6c | ||
|
|
df28d7331b | ||
|
|
2d0a2f3024 | ||
|
|
781e145721 | ||
|
|
e984425e36 | ||
|
|
2eb58e3346 | ||
|
|
ab4039dbbd | ||
|
|
2c1702a20b | ||
|
|
72a5f35b0e | ||
|
|
076ae15abd | ||
|
|
fbc5f95340 | ||
|
|
ff3a25a5ec | ||
|
|
2dd5a95232 | ||
|
|
2a21bbf062 | ||
|
|
d9a80e5ef7 | ||
|
|
2cadee1599 | ||
|
|
6c26fde210 | ||
|
|
bc908b7fe9 | ||
|
|
26d468aa6f | ||
|
|
0f7188a347 | ||
|
|
3e832f9526 | ||
|
|
392cfbdc4e | ||
|
|
0751aa5a0f | ||
|
|
e57846566e | ||
|
|
6c818e5c30 | ||
|
|
20f043abc6 | ||
|
|
416451eb0b | ||
|
|
3ab7a61a47 | ||
|
|
5571353464 | ||
|
|
95d85c7f5b | ||
|
|
d7e509979a | ||
|
|
91a5b2d4fc | ||
|
|
5171a7b7b3 | ||
|
|
b41c8acddd | ||
|
|
06bc1ebcd4 | ||
|
|
999827b3ec | ||
|
|
38ea481177 | ||
|
|
dbf945dfe5 | ||
|
|
21065a3c95 | ||
|
|
79b5defb63 | ||
|
|
956b201757 | ||
|
|
b90dabeb2c | ||
|
|
2f1edfeeab | ||
|
|
fac320bfce | ||
|
|
6c2820f900 | ||
|
|
9a113e2993 | ||
|
|
89e0326435 | ||
|
|
1a37273a9e | ||
|
|
d14b9e2ab5 | ||
|
|
d926e4165b | ||
|
|
8c88ae401b | ||
|
|
e5015f348b | ||
|
|
6792002c19 | ||
|
|
9890f6aade | ||
|
|
536e66eed9 | ||
|
|
6e103480cc | ||
|
|
6a53c9fae4 | ||
|
|
28d65ac114 | ||
|
|
239577e9cf | ||
|
|
a8fb45adc6 | ||
|
|
9316016d24 | ||
|
|
8d815d40b6 | ||
|
|
33b5c370b1 | ||
|
|
cdf63840b0 | ||
|
|
cf14501311 | ||
|
|
187b4a6e4b | ||
|
|
4ab9056700 | ||
|
|
9a281dfa71 | ||
|
|
0b3f7d1fe3 | ||
|
|
a9d82de25c | ||
|
|
414d8bd383 | ||
|
|
903f3b99b3 | ||
|
|
eb8b4986d7 | ||
|
|
6cc09969dd | ||
|
|
1a813e52ce | ||
|
|
afa765c4ba | ||
|
|
16b238124a | ||
|
|
df9edc36e0 | ||
|
|
4def45907b | ||
|
|
202e6e88d2 | ||
|
|
3b2473039f | ||
|
|
59d1ca3409 | ||
|
|
1d26303333 | ||
|
|
8f73489073 | ||
|
|
ff08ca140c | ||
|
|
61a9feb8fd | ||
|
|
21fdf31518 | ||
|
|
3af9397689 | ||
|
|
fef756f508 | ||
|
|
131edf1293 | ||
|
|
39f1716ae2 | ||
|
|
6787b9b553 | ||
|
|
1c2491385f | ||
|
|
97baaf6797 | ||
|
|
4e88765a83 | ||
|
|
aac26f6720 | ||
|
|
3b3e75003f | ||
|
|
ab699aafdc | ||
|
|
98bdb8c526 | ||
|
|
c7b25e6632 | ||
|
|
94f742187e | ||
|
|
70ebe34f1f | ||
|
|
992cb6b310 | ||
|
|
917a9ee707 | ||
|
|
d577ac6d54 | ||
|
|
5b5f6ac0b9 | ||
|
|
2aecc6e0f2 | ||
|
|
695f3455e6 | ||
|
|
13e8a1a9f6 | ||
|
|
4b064f566a | ||
|
|
2a86a70386 | ||
|
|
8ab83eaf41 | ||
|
|
262b170244 | ||
|
|
e21f35b880 | ||
|
|
24c8a1c501 | ||
|
|
cfe6e3c805 | ||
|
|
d3b62daea0 | ||
|
|
35355b28c0 | ||
|
|
88c82a41ba | ||
|
|
910e960e4f | ||
|
|
354e1ccdf4 | ||
|
|
d1911f0f96 | ||
|
|
1339077b57 | ||
|
|
cdc279b5da | ||
|
|
d003bfa7f1 | ||
|
|
343a82b89c | ||
|
|
09a5515121 | ||
|
|
cc23fb0f39 | ||
|
|
7edddd0566 | ||
|
|
ebafc4576f | ||
|
|
328fe4256e | ||
|
|
c240eb4a4e | ||
|
|
38d9d91945 | ||
|
|
4669598dd9 | ||
|
|
7daaf79fcc | ||
|
|
d68fa8ce95 | ||
|
|
d61ee51d79 | ||
|
|
a6f81006be | ||
|
|
5fa374259e | ||
|
|
9fd033b30e | ||
|
|
e98ed3c74f | ||
|
|
ebe76821e4 | ||
|
|
3858e38a02 | ||
|
|
510c35e077 | ||
|
|
a8f680810f | ||
|
|
f1c3c8296f | ||
|
|
6c90ccfbaa | ||
|
|
3aebccbb9d | ||
|
|
653a320e6c | ||
|
|
6868e68145 | ||
|
|
ee6f28c06d | ||
|
|
fdb037da96 | ||
|
|
57e7ad6903 | ||
|
|
290564fd2f | ||
|
|
b9207b5efb | ||
|
|
c58715d95b | ||
|
|
5c6a8b9966 | ||
|
|
44e43d9479 | ||
|
|
49cbbfc50c | ||
|
|
4f8e98f5d5 | ||
|
|
dd713a26db | ||
|
|
fad293fbbf | ||
|
|
5a1b94f45b | ||
|
|
e9e614aa52 | ||
|
|
344c68bf08 | ||
|
|
f06e59b362 | ||
|
|
8ca5849b14 | ||
|
|
01e6a1061c | ||
|
|
7eb888d2e3 | ||
|
|
26f67b6798 | ||
|
|
4c0635be7c | ||
|
|
e6eed4be4e | ||
|
|
4d9ff395e9 | ||
|
|
67b863f9db | ||
|
|
114a50ad4e | ||
|
|
7628ebc9ca | ||
|
|
50af6694d0 | ||
|
|
deb6dad7ad | ||
|
|
218f434e01 | ||
|
|
8a53c438e3 | ||
|
|
077f052112 | ||
|
|
3fe15a302c | ||
|
|
e7f57c9ddd | ||
|
|
dec83bbd21 | ||
|
|
2354746d4f | ||
|
|
d421b1ccb8 | ||
|
|
095e2bf581 | ||
|
|
25345a0522 | ||
|
|
e2b5201b5a | ||
|
|
5c80a382bf | ||
|
|
aa940683d6 | ||
|
|
5dbddb4beb | ||
|
|
b20613f5d7 | ||
|
|
00e019d6fe | ||
|
|
5b0c115b10 | ||
|
|
d37fac0ff7 | ||
|
|
91d656ff60 | ||
|
|
843c65d52b | ||
|
|
e26f4262df | ||
|
|
079a8e3ec1 | ||
|
|
8487694b37 | ||
|
|
dde586e004 | ||
|
|
506c23ae89 | ||
|
|
6ddb064c9e | ||
|
|
9b8b1b2532 | ||
|
|
0621564be7 | ||
|
|
f1714db09e | ||
|
|
aba4bc2909 | ||
|
|
e90e03e0cc | ||
|
|
335671b46a | ||
|
|
19b8c16057 | ||
|
|
70b025da30 | ||
|
|
87dd858358 | ||
|
|
9fd73ca34d | ||
|
|
51f3edcd72 | ||
|
|
e7f626bd72 | ||
|
|
dea3aac222 | ||
|
|
17f94aabdf | ||
|
|
5d7281e470 | ||
|
|
f6d2b55f75 | ||
|
|
c49e32c4ac | ||
|
|
36beb927f1 | ||
|
|
ee41b2b68d | ||
|
|
a7d925a177 | ||
|
|
df124db84a | ||
|
|
29a4b4aadc | ||
|
|
4ef4a06a7e | ||
|
|
2682ea75ab | ||
|
|
b3a63a60e9 | ||
|
|
a54dfaf0c7 | ||
|
|
595538d6bb | ||
|
|
a5329e5bba | ||
|
|
37a79c4589 | ||
|
|
29515491a2 | ||
|
|
dd760f8210 | ||
|
|
dd87e893ba | ||
|
|
6cb8d0a9d1 | ||
|
|
c0b685c77b | ||
|
|
2c4574d93b | ||
|
|
a4b1104abf | ||
|
|
127ce312ea | ||
|
|
2fde630971 | ||
|
|
2237e9f1b7 | ||
|
|
fce5ee7a16 | ||
|
|
8ccb9cd892 | ||
|
|
9b4fa132dc | ||
|
|
daf332a102 | ||
|
|
d1af44bcdc | ||
|
|
7f91e20d03 | ||
|
|
233a6e8b89 | ||
|
|
c127c0900e | ||
|
|
fc01fa045e | ||
|
|
3578e01838 | ||
|
|
2681a85fa5 | ||
|
|
9a0716af44 | ||
|
|
dc642cfbe7 | ||
|
|
b98e831300 | ||
|
|
0d73824727 | ||
|
|
bb23679683 | ||
|
|
1a0a5c652b | ||
|
|
f4f645b103 | ||
|
|
37395b70f6 | ||
|
|
a65cb3b03c | ||
|
|
779641e8e7 | ||
|
|
a5188ce24a | ||
|
|
e26387a75a | ||
|
|
c56d323cd3 | ||
|
|
ac4cdb44de | ||
|
|
ab63bf9d74 | ||
|
|
39a96885d2 | ||
|
|
96dbec3218 | ||
|
|
4b29e7bf8d | ||
|
|
c664c14afc | ||
|
|
60f128b314 | ||
|
|
cc0a89c924 | ||
|
|
ed69bd74ed | ||
|
|
8f974e8902 | ||
|
|
f0641ddd6d | ||
|
|
a91fe05395 | ||
|
|
d9cdeb9773 | ||
|
|
0de033e428 | ||
|
|
6c2a2e4665 | ||
|
|
1ab9635039 | ||
|
|
5e929df966 | ||
|
|
455e0533fe | ||
|
|
e7fdbe13d0 | ||
|
|
a8c4fc7607 | ||
|
|
00477528cc | ||
|
|
4c6d645cc6 | ||
|
|
a26bdfe385 | ||
|
|
efc67d14a5 | ||
|
|
df63b8c1b7 | ||
|
|
707d00b280 | ||
|
|
9c79d728e8 | ||
|
|
9c8a1f564e | ||
|
|
9183c4f04c | ||
|
|
f57dc6785b | ||
|
|
97126553f0 | ||
|
|
4014083238 | ||
|
|
da03e11071 | ||
|
|
f69016883c | ||
|
|
cf59bcff12 | ||
|
|
c10baca137 | ||
|
|
60e403a28b | ||
|
|
6495f741b9 | ||
|
|
d3210f0d3d | ||
|
|
92a08cebad | ||
|
|
1dba4be23f | ||
|
|
a0dce925d4 | ||
|
|
738c819272 | ||
|
|
ed39127f31 |
@@ -1,5 +1,6 @@
|
||||
documents/
|
||||
vendor/
|
||||
public/vendor
|
||||
|
||||
/nbproject/
|
||||
.vscode
|
||||
|
||||
@@ -29,7 +29,7 @@ $config['ALLOWED_NOTEN_ABGABETOOL'] = [10, 14]; // tbl_note pk
|
||||
// benotete projektarbeiten sperren weitere terminanlage & bearbeitung, diese noten sind ausnahmen dieser Regel
|
||||
// wie zB "Nicht beurteilt" & "Noch nicht eingetragen"
|
||||
$config['NONFINAL_NOTEN_ABGABETOOL'] = [9];
|
||||
$config['beurteilung_link_fallback'] = 'addons/fhtw/content/projektbeurteilung/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?';
|
||||
$config['beurteilung_link_fallback'] = 'cis/private/lehre/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?';
|
||||
|
||||
$config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ERSTBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter';
|
||||
$config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ZWEITBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter';
|
||||
@@ -38,8 +38,19 @@ $config['SIGNATUR_CHECK_PAABGABETYPEN'] = ['end'];
|
||||
|
||||
// to be used as "https://moodle.technikum-wien.at/course/view.php?idnumber=dl{$stg_kz}" for stg specific moodle routing
|
||||
$config['STG_MOODLE_LINK'] = 'https://moodle.technikum-wien.at/course/view.php?idnumber=dl';
|
||||
// TODO: check if these links change if the file changes and how to better retrieve the link?
|
||||
$config['SIGNATUR_INFO_LINK_GERMAN'] = 'https://cis.technikum-wien.at/cms/dms.php?id=214779';
|
||||
$config['SIGNATUR_INFO_LINK_ENGLISH'] = 'https://cis.technikum-wien.at/cms/dms.php?id=264256';
|
||||
|
||||
$config['ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT'] = true;
|
||||
$config['ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER'] = true;
|
||||
|
||||
$config['BETREUER_SAMMELMAIL_BUTTON_STUDENT'] = true;
|
||||
|
||||
$config['MULTIEDIT_TABLE'] = true;
|
||||
|
||||
$config['STUDENT_EDIT_PROJEKTARBEIT_TITLE'] = true;
|
||||
|
||||
$config['CONFETTI_ON_ENDUPLOAD'] = true;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Preferred organisational unit for a new content.
|
||||
// If the user is entitled for this unit, it wins.
|
||||
// If not, the first entitled unit wins.
|
||||
$config['default_oe_kurzbz'] = 'etw';
|
||||
|
||||
// Lifetime of an edit lock in hours, counted from tbl_contentlog.start. Must be > 0.
|
||||
$config['lock_ttl_hours'] = 24;
|
||||
|
||||
// Switches the click statistics off completely. With false the admin tab stays hidden and
|
||||
// the endpoint refuses every request, whatever the rights of the caller are.
|
||||
$config['clickstats_enabled'] = true;
|
||||
|
||||
// Default period of the click statistics in months, when the caller sends none.
|
||||
$config['clickstats_months'] = 12;
|
||||
|
||||
// Length of the ranking in the click statistics tab.
|
||||
$config['clickstats_limit'] = 100;
|
||||
@@ -3,3 +3,4 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['infocenter_studiengang_kz'] = '10021, 10027, 10002';
|
||||
$config['infocenter_qualifikationskurs_kz'] = '10002';
|
||||
|
||||
@@ -8,4 +8,15 @@ $config['lvverwaltung_tags'] = [
|
||||
];
|
||||
*/
|
||||
|
||||
$config['lvverwaltung_tags'] = [];
|
||||
$config['lvverwaltung_tags'] = [];
|
||||
|
||||
# Additional columns:
|
||||
/*
|
||||
$config["list_columns"] = [
|
||||
'fieldname' => [
|
||||
'js' => 'path/to/snippet.js', // tabulator config snippet (eg: return { name: 'Name', field: 'fieldname' }; )
|
||||
// NOTE: 'default' & 'joins' like in stv.php config are currently not available here
|
||||
]
|
||||
];
|
||||
*/
|
||||
|
||||
|
||||
@@ -170,6 +170,13 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 51,
|
||||
'requiredPermissions' => 'vertrag/mitarbeiter:r'
|
||||
),
|
||||
'studierendenverwaltung' => array(
|
||||
'link' => site_url('studentenverwaltung'),
|
||||
'description' => 'Studierendenverwaltung',
|
||||
'expand' => true,
|
||||
'sort' => 52,
|
||||
'requiredPermissions' => ['admin:r', 'assistenz:r']
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -378,7 +385,7 @@ $config['navigation_menu']['apps'] = [
|
||||
],
|
||||
'lav' => [
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
|
||||
'description' => 'Lehraufträge',
|
||||
'description' => 'Lehrauftragsverwaltung',
|
||||
#'icon' => 'person-chalkboard',
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
|
||||
]
|
||||
|
||||
@@ -64,6 +64,9 @@ $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
$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['Abgabetool/Assistenz'] = 'Cis/Abgabetool/Assistenz';
|
||||
$route['Abgabetool/Assistenz/(:any)'] = 'Cis/Abgabetool/Assistenz/$1';
|
||||
@@ -72,52 +75,71 @@ $route['Abgabetool/Student'] = 'Cis/Abgabetool/Student';
|
||||
$route['Abgabetool/Student/(:any)'] = 'Cis/Abgabetool/Student/$1';
|
||||
$route['Abgabetool/Deadlines'] = 'Cis/Abgabetool/Deadlines';
|
||||
|
||||
// CMS Admin App Routes
|
||||
$route['cms'] = 'cms/index';
|
||||
$route['cms/.*'] = 'cms/index';
|
||||
|
||||
// Studierendenverwaltung App Routes
|
||||
$route['studvw'] = 'studentenverwaltung/index';
|
||||
$route['studvw/.*'] = 'studentenverwaltung/index';
|
||||
// Old routes
|
||||
$route['studentenverwaltung'] = 'redirect/301/studvw';
|
||||
$route['studentenverwaltung/(:any)'] = 'redirect/301/studvw/stdsem/$1';
|
||||
$route['studentenverwaltung/(:any)/(prestudent|student|person|search)/(:any)'] = 'redirect/301/studvw/stdsem/$1/$2/$3';
|
||||
$route['studentenverwaltung/(:any)/prestudent/(:any)/tab/:any'] = 'redirect/301/studvw/stdsem/$1/prestudent/$2';
|
||||
$route['studentenverwaltung/(:any)/search/(:any)/(:any)'] = 'redirect/301/studvw/stdsem/$1/search/$2/$3';
|
||||
$route['studentenverwaltung/(:any)/(:any)'] = 'redirect/301/studvw/stdsem/$1/stg/$2';
|
||||
|
||||
// Studierendenverwaltung List Routes
|
||||
$route['api/frontend/v1/stv/[sS]tudents/inout'] = 'api/frontend/v1/stv/Students/index';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/index';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/inout/1/incoming/1'] = 'api/frontend/v1/stv/students/getIncoming/$1';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/inout/1/outgoing/1'] = 'api/frontend/v1/stv/students/getOutgoing/$1';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/inout/1/shared_studies/1'] = 'api/frontend/v1/stv/students/getGemeinsamestudien/$1';
|
||||
|
||||
// (studiensemester_kurzbz)/inout[/(incoming|outgoing|gemeinsamestudien)]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout'] = 'api/frontend/v1/stv/Students/index';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/incoming'] = 'api/frontend/v1/stv/Students/getIncoming/$1';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/outgoing'] = 'api/frontend/v1/stv/Students/getOutgoing/$1';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/gemeinsamestudien'] = 'api/frontend/v1/stv/Students/getGemeinsamestudien/$1';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)/:any/1/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1/stdsem/(:any)'] = 'api/frontend/v1/stv/students/getPrestudents/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/prestudent/1'] = 'api/frontend/v1/stv/students/getPrestudents/$1';
|
||||
|
||||
// (studiengang_kz)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudents/$1';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)/:any/1/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)/:any/1/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)/(:any)/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1/stdsem/(:any)'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/:any/stg/(:any)/orgform/(:any)/prestudent/1'] = 'api/frontend/v1/stv/students/getPrestudentsOrgform/$1/$2';
|
||||
|
||||
// (studiengang_kz)/(orgform)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)/verband/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)/verband/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)'] = 'api/frontend/v1/stv/students/getStudents/$1/$2';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)/(semester)/grp/(gruppe)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsSpezialgruppe/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/verband/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3/$4/$5/$6';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/verband/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgform/$1/$2/$3';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)[/(semester)[/(verband)[/(gruppe)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/(:any)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getStudents/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/semester/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudentsSpezialgruppe/$1/$2/$3/$4';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)/(orgform)/(semester)/grp/(gruppe)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgformSpezialgruppe/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/group/(:any)'] = 'api/frontend/v1/stv/students/getStudentsOrgformSpezialgruppe/$1/$3/$2/$4/$5';
|
||||
|
||||
// (studiensemester_kurzbz)/(studiengang_kz)/(orgform)[/(semester)[/(verband)[/(gruppe)]]]
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4/$5';
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/([A-Z]{2,3})/(:num)/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsOrgform/$1/$2/$3/$4/$5/$6';
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/prestudent/(:any)'] = 'api/frontend/v1/stv/students/getPrestudent/$1/$2';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/student/(:any)'] = 'api/frontend/v1/stv/students/getStudent/$1/$2';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/stv/stdsem/(:any)/person/(:any)'] = 'api/frontend/v1/stv/students/getPerson/$1/$2';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/stv/.*'] = 'api/frontend/v1/stv/students/index';
|
||||
|
||||
// Lvverwaltung List Routes
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
|
||||
|
||||
// // (studiensemester_kurzbz)/uid/(uid)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/uid/(:any)'] = 'api/frontend/v1/stv/Students/getStudent/$1/$2';
|
||||
// // (studiensemester_kurzbz)/prestudent/(prestudent_id)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/prestudent/(:num)'] = 'api/frontend/v1/stv/Students/getPrestudent/$1/$2';
|
||||
// // (studiensemester_kurzbz)/person/(person_id)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/person/(:num)'] = 'api/frontend/v1/stv/Students/getPerson/$1/$2';
|
||||
|
||||
// load routes from extensions, also look for environment-specific configs
|
||||
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
|
||||
|
||||
@@ -22,8 +22,9 @@ unset($config['student']['searchfields']['email']);
|
||||
unset($config['student']['searchfields']['tel']);
|
||||
$config['student']['resultfields'] = [
|
||||
"s.student_uid AS uid",
|
||||
"s.matrikelnr",
|
||||
"s.matrikelnr AS personenkennzeichen",
|
||||
"p.person_id",
|
||||
"p.matr_nr AS matrikelnummer",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"ARRAY[s.student_uid || '@' || '" . DOMAIN . "'] AS email",
|
||||
"CASE
|
||||
|
||||
@@ -168,3 +168,40 @@ $config['stgkz_blacklist_wiederholung'] = [];
|
||||
* @var array An array of noten ids
|
||||
*/
|
||||
$config['note_blacklist_wiederholung'] = [];
|
||||
|
||||
/**
|
||||
* Enable/disable the Abmeldung StG process
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
$config['abmeldung_stg_enabled'] = true;
|
||||
|
||||
/**
|
||||
* Enable/disable the Abmeldung process
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
$config['abmeldung_enabled'] = true;
|
||||
|
||||
/**
|
||||
* Enable/disable the Unterbrecher process
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
$config['unterbrechung_enabled'] = true;
|
||||
|
||||
/**
|
||||
* Enable/disable the Wiederholer process
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
$config['wiederholung_enabled'] = true;
|
||||
|
||||
/**
|
||||
* Modal with Infotext of TLC
|
||||
* if true, there will be shown an info modal in the studentsView after the first button ABMELDUNG
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
$config['showInfoModalAbmeldung'] = true;
|
||||
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
<?php
|
||||
|
||||
$config['number_displayed_past_studiensemester_default'] = 5;
|
||||
|
||||
# Additional columns:
|
||||
/*
|
||||
$config["list_columns"] = [
|
||||
'fieldname' => [
|
||||
'js' => 'path/to/snippet.js', // tabulator config snippet (eg: return { name: 'Name', field: 'fieldname' }; )
|
||||
'default' => "SQL SELECT statement for value",
|
||||
'joins' => [
|
||||
// additional joins needed for the SELECT statement above
|
||||
[
|
||||
'tablename',
|
||||
'join condition', // single fieldname for USING or full condition for ON
|
||||
'LEFT|RIGHT', // optional - join type
|
||||
'after_xxx|before_xxx|end' // optional - position in query
|
||||
]
|
||||
// ...
|
||||
]
|
||||
]
|
||||
];
|
||||
*/
|
||||
|
||||
$config['tabs'] =
|
||||
[
|
||||
'details' => [
|
||||
@@ -60,7 +81,13 @@ $config['tabs'] =
|
||||
],
|
||||
'notes' => [
|
||||
//if true, the count of Messages will be shown in the header of the Tab Messages
|
||||
'showCountNotes' => true
|
||||
'showCountNotes' => true,
|
||||
|
||||
//if true: section with following fields will be displayed: 'verfasser', 'bearbeiter', 'von', 'bis' and 'erledigt'
|
||||
'showErweitert' => false,
|
||||
|
||||
//notizlayout: choose of "classicFas", "twoColumnsFormLeft", twoColumnsFormRight, popupModal"
|
||||
'notizLayout' => 'popupModal'
|
||||
],
|
||||
'combinePeople' => [
|
||||
//multitab should only be shown with this length of selection
|
||||
@@ -133,13 +160,25 @@ $config['students_tab_order'] = [
|
||||
|
||||
$config['stv_prestudent_tags'] = [
|
||||
'prioone' => ['readonly' => false],
|
||||
'priotwo' => ['readonly' => true],
|
||||
'priotwo' => ['readonly' => false],
|
||||
'hinweis' => ['readonly' => false],
|
||||
'hinweis_assistenz' => ['readonly' => true],
|
||||
'hinweis_kf' => ['readonly' => true],
|
||||
'hinweis_assistenz' => ['readonly' => false],
|
||||
'hinweis_kf' => ['readonly' => false],
|
||||
'hinweis_lehrende' => ['readonly' => false],
|
||||
'hinweis_stg_kf' => ['readonly' => true],
|
||||
'finished_stg' => ['readonly' => true],
|
||||
'finished_kf' => ['readonly' => true],
|
||||
'inwork_kf' => ['readonly' => true],
|
||||
'hinweis_stg_kf' => ['readonly' => false],
|
||||
'finished_stg' => ['readonly' => false],
|
||||
'finished_kf' => ['readonly' => false],
|
||||
'inwork_kf' => ['readonly' => false],
|
||||
'dd_auto' => ['readonly' => true],
|
||||
'wh_auto' => ['readonly' => true],
|
||||
'prewh_auto' => ['readonly' => true],
|
||||
'out_auto' => ['readonly' => true],
|
||||
'zgv_auto' => ['readonly' => true],
|
||||
'unterbrecher_auto' => ['readonly' => true],
|
||||
'stbtr_erh_auto' => ['readonly' => true],
|
||||
'jgv_auto' => ['readonly' => true],
|
||||
'in_auto' => ['readonly' => true],
|
||||
'preabbr_auto' => ['readonly' => true],
|
||||
];
|
||||
|
||||
$config['userAutomatedTags'] = 'sftest';
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['stv'] = [
|
||||
"library" => "treemenu/StudVwLib",
|
||||
"permissions" => ["admin:r", "assistenz:r"]
|
||||
];
|
||||
$config['lvv'] = [
|
||||
"library" => "treemenu/LvVwLib",
|
||||
"permissions" => ["admin:r", "assistenz:r"]
|
||||
];
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['root'] = [
|
||||
'stg' => [
|
||||
'semester' => [
|
||||
'group',
|
||||
'verband' => [
|
||||
'group'
|
||||
]
|
||||
],
|
||||
'orgform'
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['root'] = [
|
||||
'stg' => [
|
||||
'prestudent' => [
|
||||
'stdsem' => [
|
||||
'interessenten' => [
|
||||
'bewerbungnichtabgeschickt',
|
||||
'bewerbungabgeschickt',
|
||||
'zgv',
|
||||
'statusbestaetigt' => [
|
||||
'statusbestaetigtrtnichtangemeldet',
|
||||
'statusbestaetigtrtangemeldet'
|
||||
],
|
||||
'reihungstestnichtangemeldet',
|
||||
'reihungstestangemeldet'
|
||||
],
|
||||
'bewerber' => [
|
||||
'bewerberrtnichtangemeldet',
|
||||
'bewerberrtangemeldet' => [
|
||||
'bewerberrtangemeldetteilgenommen',
|
||||
'bewerberrtangemeldetnichtteilgenommen'
|
||||
]
|
||||
],
|
||||
'aufgenommen',
|
||||
'warteliste',
|
||||
'absage',
|
||||
'incoming'
|
||||
]
|
||||
],
|
||||
'semester' => [
|
||||
'group',
|
||||
'verband' => [
|
||||
'group'
|
||||
]
|
||||
]
|
||||
],
|
||||
'inout' => [
|
||||
'incoming',
|
||||
'outgoing',
|
||||
'shared_studies'
|
||||
]
|
||||
];
|
||||
|
||||
// copy stg tree into stg/orgforms
|
||||
$config['root']['stg']['orgform'] = $config['root']['stg'];
|
||||
@@ -31,12 +31,8 @@ class Abgabetool extends Auth_Controller
|
||||
{
|
||||
// TODO: routing from index based on berechtigung?
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'Abgabetool']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'Abgabetool']);
|
||||
}
|
||||
@@ -44,12 +40,8 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Student($student_uid_prop = '')
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'AbgabetoolStudent']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolStudent', 'student_uid_prop' => $student_uid_prop]);
|
||||
}
|
||||
@@ -57,12 +49,8 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Mitarbeiter()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'AbgabetoolMitarbeiter']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolMitarbeiter']);
|
||||
}
|
||||
@@ -70,13 +58,8 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Assistenz($stg_kz_prop = '')
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolAssistenz']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'AbgabetoolAssistenz']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolAssistenz', 'stg_kz_prop' => $stg_kz_prop]);
|
||||
}
|
||||
@@ -84,12 +67,8 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Deadlines()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'DeadlinesOverview']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'DeadlinesOverview']);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class Auth extends FHC_Controller
|
||||
|
||||
if ($this->form_validation->run())
|
||||
{
|
||||
redirect($this->authlib->getLandingPage('/CisVue/Dashboard'));
|
||||
redirect($this->authlib->getLandingPage('/Cis4'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,12 +28,6 @@ class LvPlan extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'LvPlan']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'LvPlan']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,11 +26,6 @@ class MyLv extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLv']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'MyLv']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,7 @@ class MyLvPlan extends Auth_Controller
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLvPlan']);
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'MyLvPlan']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OtherLvPlan extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/other_lv_plan:r']
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'OtherLvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -55,15 +55,7 @@ class Profil extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->load->library('ProfilLib');
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>true,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilIndex']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'profilIndex']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,23 +65,13 @@ class Profil extends Auth_Controller
|
||||
*/
|
||||
public function View($uid)
|
||||
{
|
||||
$this->load->library('ProfilLib');
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array (
|
||||
'uid' => $uid,
|
||||
'profil_data'=>$profil_data,
|
||||
);
|
||||
if($uid == getAuthUID()){
|
||||
$viewData['editable'] = true;
|
||||
}
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilViewUid']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'profilViewUid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* checks whether a specific userID is a student or not (foreword declaration of the function isStudent in Student_model.php)
|
||||
* @access public
|
||||
* @param $uid the userID used to check if it is a mitarbeiter
|
||||
* @param $uid the userID used to check if it is a student
|
||||
* @return boolean
|
||||
*/
|
||||
public function isStudent($uid)
|
||||
@@ -119,7 +101,7 @@ class Profil extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the adressen that are marked as zustell from the currenlty logged in user
|
||||
* gets the adressen that are marked as zustell from the currently logged in user
|
||||
* @access public
|
||||
* @return array a list of adresse_id's
|
||||
*/
|
||||
@@ -262,23 +244,23 @@ class Profil extends Auth_Controller
|
||||
$this->GemeindeModel->addDistinct();
|
||||
$this->GemeindeModel->addSelect(["name"]);
|
||||
if ($nation == "A") {
|
||||
if (isset($zip) && $zip > 999 && $zip < 32000) {
|
||||
if (isset($zip) && $zip > 999 && $zip < 32000) {
|
||||
|
||||
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
|
||||
if (isError($gemeinde_res)) {
|
||||
show_error("error while trying to query bis.tbl_gemeinde");
|
||||
}
|
||||
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
|
||||
$gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->name;
|
||||
}, $gemeinde_res);
|
||||
echo json_encode($gemeinde_res);
|
||||
|
||||
} else {
|
||||
echo json_encode(error("ortschaftskennziffer code was not valid"));
|
||||
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
|
||||
if (isError($gemeinde_res)) {
|
||||
show_error("error while trying to query bis.tbl_gemeinde");
|
||||
}
|
||||
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
|
||||
$gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->name;
|
||||
}, $gemeinde_res);
|
||||
echo json_encode($gemeinde_res);
|
||||
|
||||
} else {
|
||||
echo json_encode(error("ortschaftskennziffer code was not valid"));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(error("Nation was not 'A' (Austria)"));
|
||||
echo json_encode(error("Nation was not 'A' (Austria)"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -750,6 +732,4 @@ class Profil extends Auth_Controller
|
||||
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
|
||||
return $zutrittskarte_ausgegebenam;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,11 +25,6 @@ class Raumsuche extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Raumsuche']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'Raumsuche']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StgOrgLvPlan 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' => 'StgOrgLvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,7 @@ class Studium extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'studium']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['route' => 'studium']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -13,9 +14,9 @@ class Cis4 extends Auth_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'basis/cis:r'
|
||||
)
|
||||
array(
|
||||
'index' => 'basis/cis:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Load Config
|
||||
@@ -30,16 +31,6 @@ class Cis4 extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id,
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'FhcDashboard']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'FhcDashboard']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,19 +44,22 @@ class Cms extends Auth_Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function content($content_id, $version = null, $sprache = null, $sichtbar = true)
|
||||
public function content($content_id = null, $version = null, $sprache = null, $sichtbar = true)
|
||||
{
|
||||
// return early if the content_id for the content is missing
|
||||
if (!isset($content_id))
|
||||
$this->terminateWithError("content_id is missing");
|
||||
if (!is_numeric($content_id))
|
||||
show_404();
|
||||
|
||||
$content = $this->ContentModel->load($content_id);
|
||||
if (isError($content))
|
||||
$this->terminateWithError(getError($content));
|
||||
{
|
||||
show_error('The content could not be loaded');
|
||||
}
|
||||
|
||||
$content = getData($content);
|
||||
if (NULL === $content)
|
||||
$this->terminateWithError("Content not found");
|
||||
|
||||
if (NULL === $content) {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$content = current($content);
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Dashboard extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Cms extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(['index' => 'basis/cms:r']);
|
||||
$this->load->library('PermissionLib');
|
||||
$this->config->load('cms');
|
||||
$this->loadPhrases(['global', 'ui', 'cms']);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// decide whether the click statistics tab is shown at all.
|
||||
$this->load->view('Cms.php', [
|
||||
'clickstats' => $this->config->item('clickstats_enabled')
|
||||
&& $this->permissionlib->isBerechtigt('admin')
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller redirects urls to another location. This is mainly used
|
||||
* with the $routes config
|
||||
*/
|
||||
class Redirect extends CI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function to handle all redirects.
|
||||
*
|
||||
* @param string $method - the redirect code (30x)
|
||||
* @param array $params - the url to redirect to
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params)
|
||||
{
|
||||
redirect($params, 'location', $method);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,8 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Bookmark extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
@@ -28,111 +30,162 @@ class Bookmark extends FHCAPI_Controller
|
||||
{
|
||||
parent::__construct([
|
||||
'getBookmarks' => self::PERM_LOGGED,
|
||||
'delete' => self::PERM_LOGGED,
|
||||
'insert' => self::PERM_LOGGED,
|
||||
'delete' => self::PERM_LOGGED,
|
||||
'insert' => self::PERM_LOGGED,
|
||||
'update' => self::PERM_LOGGED,
|
||||
]);
|
||||
'changeOrder' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model('dashboard/Bookmark_model', 'BookmarkModel');
|
||||
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* gets the bookmarks associated to a user
|
||||
/**
|
||||
* gets the bookmarks associated to a user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBookmarks()
|
||||
{
|
||||
$this->BookmarkModel->addOrder("bookmark_id");
|
||||
$this->BookmarkModel->addOrder("sort");
|
||||
$bookmarks = $this->BookmarkModel->loadWhere(["uid"=>$this->uid]);
|
||||
|
||||
$bookmarks = $this->getDataOrTerminateWithError($bookmarks);
|
||||
$bookmarks = $this->getDataOrTerminateWithError($bookmarks);
|
||||
|
||||
$this->terminateWithSuccess($bookmarks);
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes bookmark from associated user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($bookmark_id)
|
||||
{
|
||||
$bookmark = $this->BookmarkModel->load($bookmark_id);
|
||||
|
||||
$bookmark = current($this->getDataOrTerminateWithError($bookmark));
|
||||
|
||||
// only delete bookmark if the user is the owner of the bookmark
|
||||
if($bookmark->uid == $this->uid || $this->permissionlib->isBerechtigt('admin')){
|
||||
|
||||
$delete_result = $this->BookmarkModel->delete($bookmark_id);
|
||||
|
||||
$delete_result = $this->getDataOrTerminateWithError($delete_result);
|
||||
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
}else{
|
||||
$this->_outputAuthError(['delete' => ['admin:rw']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inserts new bookmark into the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function insert()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url',true);
|
||||
$title = $this->input->post('title',true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
|
||||
$insert_into_result = $this->BookmarkModel->insert(['uid'=>$this->uid, 'url'=>$url, 'title'=>$title,'tag'=>$tag, 'insertvon'=>$this->uid, 'updateamum'=>NULL, 'updatevon'=>NULL]);
|
||||
|
||||
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
|
||||
|
||||
$this->terminateWithSuccess($insert_into_result);
|
||||
|
||||
}
|
||||
$this->terminateWithSuccess($bookmarks);
|
||||
}
|
||||
|
||||
/**
|
||||
* updates bookmark in the bookmark table
|
||||
* deletes bookmark from associated user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function update($bookmark_id)
|
||||
public function delete($bookmark_id)
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
$bookmark = $this->BookmarkModel->load($bookmark_id);
|
||||
|
||||
$url = $this->input->post('url',true);
|
||||
$title = $this->input->post('title',true);
|
||||
$bookmark = current($this->getDataOrTerminateWithError($bookmark));
|
||||
|
||||
// only delete bookmark if the user is the owner of the bookmark
|
||||
if ($bookmark->uid == $this->uid || $this->permissionlib->isBerechtigt('admin')) {
|
||||
$delete_result = $this->BookmarkModel->delete($bookmark_id);
|
||||
|
||||
$delete_result = $this->getDataOrTerminateWithError($delete_result);
|
||||
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
} else {
|
||||
$this->_outputAuthError(['delete' => ['admin:rw']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inserts new bookmark into the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function insert()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url', true);
|
||||
$title = $this->input->post('title', true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
if (is_array($tag)) {
|
||||
$tag = json_encode($tag); // convert PHP array to JSON string
|
||||
}
|
||||
$sort = $this->input->post('sort', true);
|
||||
|
||||
$insert_into_result = $this->BookmarkModel->insert([
|
||||
'uid' => $this->uid,
|
||||
'url' => $url,
|
||||
'title' => $title,
|
||||
'tag' => $tag,
|
||||
'insertvon' => $this->uid,
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'sort' => $sort
|
||||
]);
|
||||
|
||||
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
|
||||
|
||||
$this->terminateWithSuccess($insert_into_result);
|
||||
}
|
||||
|
||||
/**
|
||||
* updates bookmark in the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function update($bookmark_id)
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url', true);
|
||||
$title = $this->input->post('title', true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
if (is_array($tag)) {
|
||||
$tag = json_encode($tag);
|
||||
}
|
||||
|
||||
$now = new DateTime();
|
||||
$now = $now->format('Y-m-d H:i:s');
|
||||
|
||||
$update_result = $this->BookmarkModel->update($bookmark_id,['url'=>$url, 'title'=>$title,'updateamum'=>$now]);
|
||||
$update_result = $this->BookmarkModel->update($bookmark_id, [
|
||||
'url' => $url,
|
||||
'title' => $title,
|
||||
'tag' => $tag,
|
||||
'updateamum' => $now
|
||||
]);
|
||||
|
||||
$update_result = $this->getDataOrTerminateWithError($update_result);
|
||||
$update_result = $this->getDataOrTerminateWithError($update_result);
|
||||
|
||||
$this->terminateWithSuccess($update_result);
|
||||
$this->terminateWithSuccess($update_result);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* changes sort of two bookmarks in the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function changeOrder($bookmark_id1, $bookmark_id2)
|
||||
{
|
||||
$update_result = [];
|
||||
|
||||
$result1 = $this->BookmarkModel->load($bookmark_id1);
|
||||
$data1 = $this->getDataOrTerminateWithError($result1);
|
||||
$sort1 = current($data1)->sort;
|
||||
|
||||
$result2 = $this->BookmarkModel->load(["bookmark_id"=>$bookmark_id2]);
|
||||
$data2 = $this->getDataOrTerminateWithError($result2);
|
||||
$sort2 = current($data2)->sort;
|
||||
|
||||
$update_result1 = $this->BookmarkModel->update($bookmark_id1, [
|
||||
'sort' => $sort2
|
||||
]);
|
||||
$update_result[] = $this->getDataOrTerminateWithError($update_result1);
|
||||
|
||||
$update_result2 = $this->BookmarkModel->update($bookmark_id2, [
|
||||
'sort' => $sort1
|
||||
]);
|
||||
$update_result[] = $this->getDataOrTerminateWithError($update_result2);
|
||||
|
||||
$this->terminateWithSuccess($update_result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Cis4FhcApi extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getViewData' => self::PERM_LOGGED,
|
||||
'dashboardViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
@@ -36,17 +36,22 @@ class Cis4FhcApi extends FHCAPI_Controller
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches ViewData
|
||||
*/
|
||||
public function getViewData()
|
||||
* retrieves view data for dashboard view
|
||||
* @access public
|
||||
* @param $uid the userID for which profile is being viewed, null or missing value implies one's own profile
|
||||
*/
|
||||
public function dashboardViewData()
|
||||
{
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$this->load->config('calendar');
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id
|
||||
'person_id' => $personData->person_id,
|
||||
'timezone' => $this->config->item('timezone'),
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
|
||||
class CisMenu extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
@@ -31,28 +32,113 @@ class CisMenu extends FHCAPI_Controller
|
||||
'getMenu' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
/**
|
||||
* fetches the menu for CIS from the database based on the userLanguage
|
||||
*/
|
||||
public function getMenu()
|
||||
public function getMenu()
|
||||
{
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->config('cis');
|
||||
$cis4_content_id =$this->config->item('cis_menu_root_content_id');
|
||||
$result = $this->ContentModel->getMenu($cis4_content_id, getAuthUID(),getUserLanguage());
|
||||
$cis4_content_id = $this->config->item('cis_menu_root_content_id');
|
||||
$result = $this->ContentModel->getMenu($cis4_content_id, getAuthUID(), getUserLanguage());
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
$menu = $result->childs ?? [];
|
||||
$this->terminateWithSuccess($menu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$menu = $this->generateUrlsForMenuItems($menu);
|
||||
$this->terminateWithSuccess($menu);
|
||||
}
|
||||
|
||||
private function generateUrlsForMenuItems($menuItems)
|
||||
{
|
||||
return array_map(
|
||||
function ($menuItem) {
|
||||
return $this->generateUrlForMenuItem($menuItem);
|
||||
},
|
||||
$menuItems
|
||||
);
|
||||
}
|
||||
|
||||
private function generateUrlForMenuItem($menuItem)
|
||||
{
|
||||
if(!isset($menuItem->url))
|
||||
{
|
||||
$menuItem->url = $this->menuItemUrlHelper($menuItem);
|
||||
unset($menuItem->content);
|
||||
}
|
||||
|
||||
if ($menuItem->childs && count($menuItem->childs)) {
|
||||
$menuItem->childs = $this->generateUrlsForMenuItems($menuItem->childs);
|
||||
}
|
||||
|
||||
return $menuItem;
|
||||
}
|
||||
|
||||
private function menuItemUrlHelper($menuItem)
|
||||
{
|
||||
if ($menuItem->template_kurzbz !== 'redirect') {
|
||||
return site_url("/CisVue/Cms/content/" . $menuItem->content_id);
|
||||
}
|
||||
|
||||
if (!isset($menuItem->content) || !$menuItem->content || !mb_strlen($menuItem->content)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($menuItem->content);
|
||||
$urlElem = $doc->getElementsByTagName('url')->item(0);
|
||||
|
||||
$this->menuItemUrlTargetHelper($menuItem, $doc);
|
||||
|
||||
if (!$urlElem) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$url = $urlElem->textContent;
|
||||
|
||||
if (strpos($url, '../cms/news.php') !== false) {
|
||||
$newsRegex = '/^\.\.\/cms\/news\.php/';
|
||||
$url = preg_replace($newsRegex, site_url("/CisVue/Cms/news"), $url);
|
||||
}
|
||||
|
||||
if (strpos($url, '../cms/content.php?') !== false) {
|
||||
$contentRegex = '/^\.\.\/cms\/content\.php\?content_id=([0-9]+)/';
|
||||
$matches = [];
|
||||
preg_match($contentRegex, $url, $matches);
|
||||
$url = site_url('/CisVue/Cms/content/' . $matches[1]);
|
||||
}
|
||||
|
||||
if (strpos($url, '../index.ci.php') !== false) {
|
||||
$indexRegex = '/^\.\.\/index\.ci\.php/';
|
||||
$url = preg_replace($indexRegex, site_url(), $url);
|
||||
}
|
||||
|
||||
if (strpos($url, '../') !== false) {
|
||||
$relativeRegex = '/^\.\.\//';
|
||||
$url = preg_replace($relativeRegex, base_url(), $url);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class Cms extends FHCAPI_Controller
|
||||
{
|
||||
// Upper bound for the tiefe of oe-personen and dms-liste. A hierarchy this deep does
|
||||
// not occur, and the cap keeps one marker from walking a whole tree.
|
||||
const MAX_TIEFE = 10;
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
@@ -39,6 +43,11 @@ class Cms extends FHCAPI_Controller
|
||||
'news' => self::PERM_LOGGED,
|
||||
'getNewsRowCount' => self::PERM_LOGGED,
|
||||
'getNews' => self::PERM_LOGGED,
|
||||
'getOePersonen' => self::PERM_LOGGED,
|
||||
'getDmsKategorie' => self::PERM_LOGGED,
|
||||
'getContentChilds' => self::PERM_LOGGED,
|
||||
'getPerson' => self::PERM_LOGGED,
|
||||
'getDmsDokumente' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
@@ -55,11 +64,7 @@ class Cms extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
@@ -80,7 +85,10 @@ class Cms extends FHCAPI_Controller
|
||||
$sprache = $this->input->get("sprache",TRUE);
|
||||
$sichtbar = $this->input->get("sichtbar",TRUE);
|
||||
|
||||
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar);
|
||||
// cms admin preview renders a content without counting a view
|
||||
$preview = $this->input->get("preview",TRUE);
|
||||
|
||||
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar, !$preview);
|
||||
$content = $this->getDataOrTerminateWithError($content);
|
||||
|
||||
$this->terminateWithSuccess($content);
|
||||
@@ -203,5 +211,331 @@ class Cms extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Lists the people assigned to an organisation unit.
|
||||
* Used by the CMS content component "oe-personen".
|
||||
*/
|
||||
public function getOePersonen()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('oe_kurzbz', 'Organisationseinheit', 'required');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
|
||||
$oe_kurzbz = $this->input->get('oe_kurzbz', TRUE);
|
||||
$mitFoto = $this->input->get('foto', TRUE) ? true : false;
|
||||
|
||||
// tiefe 0 asks about the one unit. Deeper takes the sub units with it.
|
||||
$oeResult = $this->OrganisationseinheitModel->getMitUntereinheiten(
|
||||
$oe_kurzbz, $this->_tiefe()
|
||||
);
|
||||
$oeRows = $this->getDataOrTerminateWithError($oeResult) ?: array();
|
||||
|
||||
$uids = array();
|
||||
$funktionen = array();
|
||||
|
||||
foreach ($oeRows as $oe)
|
||||
{
|
||||
// 'oezuordnung' is the function that assigns an employee to an organisation
|
||||
// unit. The model already filters datum_von and datum_bis.
|
||||
$rows = $this->BenutzerfunktionModel->getBenutzerFunktionenDetailed(
|
||||
'oezuordnung', $oe->oe_kurzbz
|
||||
);
|
||||
$rows = $this->getDataOrTerminateWithError($rows) ?: array();
|
||||
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
// The model returns the aktiv flag but does not filter on it.
|
||||
if (!$row->aktiv)
|
||||
continue;
|
||||
|
||||
// One person can hold the assignment in several units of the walk. The
|
||||
// first one wins, so the list keeps one block per person.
|
||||
if (isset($funktionen[$row->uid]))
|
||||
continue;
|
||||
|
||||
$uids[] = $row->uid;
|
||||
// tbl_benutzerfunktion.bezeichnung is the free label of one assignment,
|
||||
// for example "Bibliothekarin". tbl_funktion.beschreibung is the generic
|
||||
// name.
|
||||
$funktionen[$row->uid] = $row->bezeichnung ?: $row->beschreibung;
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($this->_cmsPersonen($uids, $funktionen, $mitFoto));
|
||||
}
|
||||
|
||||
/**
|
||||
* Contact data of one person.
|
||||
* Used by the CMS content component "person-block".
|
||||
*/
|
||||
public function getPerson()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('uid', 'UID', 'required');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$uid = $this->input->get('uid', TRUE);
|
||||
$mitFoto = $this->input->get('foto', TRUE) ? true : false;
|
||||
|
||||
// The function label comes from the marker, not from the database. The component
|
||||
// passes it through as a property.
|
||||
$personen = $this->_cmsPersonen(array($uid), array(), $mitFoto);
|
||||
|
||||
$this->terminateWithSuccess($personen ? current($personen) : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the published documents of one DMS category.
|
||||
* Used by the CMS content component "dms-liste".
|
||||
*/
|
||||
public function getDmsKategorie()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('kategorie_kurzbz', 'DMS-Kategorie', 'required');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$kategorie_kurzbz = $this->input->get('kategorie_kurzbz', TRUE);
|
||||
|
||||
$erlaubt = $this->_dmsKategorieErlaubt($kategorie_kurzbz);
|
||||
|
||||
if ($erlaubt === null)
|
||||
$this->terminateWithError('DMS category not found', self::ERROR_TYPE_404);
|
||||
|
||||
// a missing entitlement answers with success and an empty list, not with
|
||||
// an error. The component sits inside a public content page. An error would raise a
|
||||
// toast for every reader who is simply not in the group.
|
||||
$dokumente = array();
|
||||
if ($erlaubt)
|
||||
{
|
||||
// tiefe 0 asks about the one category. Deeper takes the sub categories with it.
|
||||
$katResult = $this->DmsModel->getMitUnterkategorien(
|
||||
$kategorie_kurzbz, $this->_tiefe()
|
||||
);
|
||||
$kategorien = $this->getDataOrTerminateWithError($katResult) ?: array();
|
||||
|
||||
foreach ($kategorien as $kat)
|
||||
{
|
||||
// Every category carries its own group rule, so a sub category can be
|
||||
// closed while the parent is open. Ask for each one instead of letting the
|
||||
// entitlement of the root stand for the whole walk. The root is already
|
||||
// answered above.
|
||||
if ($kat->kategorie_kurzbz !== $kategorie_kurzbz
|
||||
&& $this->_dmsKategorieErlaubt($kat->kategorie_kurzbz) !== true)
|
||||
continue;
|
||||
|
||||
$rows = $this->DmsModel->getKategorieDokumente($kat->kategorie_kurzbz);
|
||||
$rows = $this->getDataOrTerminateWithError($rows) ?: array();
|
||||
|
||||
foreach ($rows as $row)
|
||||
$dokumente[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array(
|
||||
'zugriff' => $erlaubt,
|
||||
'dokumente' => $dokumente
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists named documents, in the order the caller asked for them.
|
||||
* Used by the CMS content component "dms-dokumente".
|
||||
*/
|
||||
public function getDmsDokumente()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('dms_ids', 'DMS-IDs', 'required');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
|
||||
$ids = array();
|
||||
foreach (explode(',', $this->input->get('dms_ids', TRUE)) as $teil)
|
||||
{
|
||||
$teil = trim($teil);
|
||||
if (is_numeric($teil))
|
||||
$ids[] = (int) $teil;
|
||||
}
|
||||
|
||||
// An unbounded list would let one marker fetch the whole DMS.
|
||||
$ids = array_slice(array_unique($ids), 0, 50);
|
||||
|
||||
$dokumente = $this->DmsModel->getDokumenteByIds($ids);
|
||||
$dokumente = $this->getDataOrTerminateWithError($dokumente) ?: array();
|
||||
|
||||
// A hand picked list holds few categories, so deciding per category is cheap and
|
||||
// reuses the rule of getDmsKategorie().
|
||||
$erlaubte = array();
|
||||
$nachId = array();
|
||||
foreach ($dokumente as $dokument)
|
||||
{
|
||||
if (!array_key_exists($dokument->kategorie_kurzbz, $erlaubte))
|
||||
$erlaubte[$dokument->kategorie_kurzbz] = $this->_dmsKategorieErlaubt($dokument->kategorie_kurzbz);
|
||||
|
||||
if ($erlaubte[$dokument->kategorie_kurzbz] === true)
|
||||
$nachId[$dokument->dms_id] = $dokument;
|
||||
}
|
||||
|
||||
// The editor chose the order. Keep it.
|
||||
$sortiert = array();
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
if (isset($nachId[$id]))
|
||||
$sortiert[] = $nachId[$id];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($sortiert);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the child pages of a content, as a reader may see them.
|
||||
* Used by the CMS content component "contentchild-menu".
|
||||
*/
|
||||
public function getContentChilds()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural_no_zero');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('content/Contentchild_model', 'ContentchildModel');
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
if (!$sprache)
|
||||
$sprache = getUserLanguage();
|
||||
|
||||
$childs = $this->ContentchildModel->getChildsForReader($content_id, $sprache, getAuthUID());
|
||||
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($childs) ?: array());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Builds the shape both person content components render.
|
||||
*
|
||||
* The assembly follows Cis/Cms/News/Xml/Address/Detailed.php, so a person reads the
|
||||
* same in the news extras and on a content page.
|
||||
*
|
||||
* @param array $uids in the order the result should keep
|
||||
* @param array $funktionen uid => function label, may be empty
|
||||
* @param boolean $mitFoto
|
||||
* @return array
|
||||
*/
|
||||
private function _cmsPersonen($uids, $funktionen, $mitFoto)
|
||||
{
|
||||
if (empty($uids))
|
||||
return array();
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$kontakt = $this->PersonModel->getCmsKontakt($uids, $mitFoto);
|
||||
$kontakt = $this->getDataOrTerminateWithError($kontakt) ?: array();
|
||||
|
||||
$nachUid = array();
|
||||
foreach ($kontakt as $row)
|
||||
$nachUid[$row->uid] = $row;
|
||||
|
||||
$personen = array();
|
||||
|
||||
// Loops over $uids, not over the result, so the caller keeps its order.
|
||||
foreach ($uids as $uid)
|
||||
{
|
||||
if (!isset($nachUid[$uid]))
|
||||
continue;
|
||||
|
||||
$row = $nachUid[$uid];
|
||||
|
||||
$name = trim(implode(' ', array_filter(array(
|
||||
$row->titelpre, $row->vorname, $row->nachname, $row->titelpost
|
||||
))));
|
||||
|
||||
$telefon = '';
|
||||
if ($row->telefonklappe)
|
||||
$telefon = trim(($row->kontakt ?: '') . ' - ' . $row->telefonklappe);
|
||||
|
||||
$email = '';
|
||||
if (defined('DOMAIN'))
|
||||
$email = ($row->alias ?: $row->uid) . '@' . DOMAIN;
|
||||
|
||||
$personen[] = array(
|
||||
'uid' => $row->uid,
|
||||
'name' => $name,
|
||||
'funktion' => isset($funktionen[$uid]) ? $funktionen[$uid] : '',
|
||||
'telefon' => $telefon,
|
||||
'email' => $email,
|
||||
'ort' => $row->planbezeichnung,
|
||||
'foto' => $row->foto
|
||||
);
|
||||
}
|
||||
|
||||
return $personen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides whether the current user may see a DMS category.
|
||||
*
|
||||
* Same rule as cms/dms.php: an unlocked category is open to everyone. A locked one
|
||||
* needs a granted group, or the category permission together with basis/dms.
|
||||
*
|
||||
* @param string $kategorie_kurzbz
|
||||
* @return boolean|null null when the category does not exist
|
||||
*/
|
||||
/**
|
||||
* Reads the tiefe parameter of a content component. 0 keeps the component to the unit
|
||||
* or category it names, which is what a marker without the attribute means.
|
||||
* Capped, because the depth drives a recursive walk and one query per level found.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function _tiefe()
|
||||
{
|
||||
$tiefe = (int) $this->input->get('tiefe', TRUE);
|
||||
|
||||
if ($tiefe < 0)
|
||||
return 0;
|
||||
|
||||
return min($tiefe, self::MAX_TIEFE);
|
||||
}
|
||||
|
||||
private function _dmsKategorieErlaubt($kategorie_kurzbz)
|
||||
{
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
|
||||
$zugriff = $this->DmsModel->getKategorieZugriff($kategorie_kurzbz, getAuthUID());
|
||||
$zugriff = $this->getDataOrTerminateWithError($zugriff);
|
||||
|
||||
if (empty($zugriff))
|
||||
return null;
|
||||
|
||||
$kategorie = current($zugriff);
|
||||
|
||||
if (!$kategorie->gesperrt || $kategorie->in_gruppe)
|
||||
return true;
|
||||
|
||||
$erlaubt = $this->permissionlib->isBerechtigt('basis/dms');
|
||||
|
||||
if ($erlaubt && $kategorie->berechtigung_kurzbz != '')
|
||||
$erlaubt = $this->permissionlib->isBerechtigt($kategorie->berechtigung_kurzbz);
|
||||
|
||||
return $erlaubt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,760 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class CmsAdmin extends FHCAPI_Controller
|
||||
{
|
||||
const MAX_TREE_DEPTH = 50;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTree' => ['basis/cms:r'],
|
||||
'getSubtree' => ['basis/cms:r'],
|
||||
'getContent' => ['basis/cms:r'],
|
||||
'getContentsprache' => ['basis/cms:r'],
|
||||
'getTemplates' => ['basis/cms:r'],
|
||||
'getOrganisationseinheiten' => ['basis/cms:r'],
|
||||
'getSprachen' => ['basis/cms:r'],
|
||||
'getDmsKategorien' => ['basis/cms:r'],
|
||||
'getMitarbeiter' => ['basis/cms:r'],
|
||||
'getDmsKategorieDokumente' => ['basis/cms:r'],
|
||||
'getUsage' => ['basis/cms:r'],
|
||||
'getTreeMeta' => ['basis/cms:r'],
|
||||
'getAncestors' => ['basis/cms:r'],
|
||||
'getClickCount' => ['basis/cms:r'],
|
||||
'getClickRanking' => ['basis/cms:r'],
|
||||
'postContent' => ['basis/cms:rw'],
|
||||
'postTranslation' => ['basis/cms:rw'],
|
||||
'postVersion' => ['basis/cms:rw'],
|
||||
'putProperties' => ['basis/cms:rw'],
|
||||
'deleteContent' => ['basis/cms:rw'],
|
||||
'deleteContentsprache' => ['basis/cms:rw']
|
||||
]);
|
||||
|
||||
$this->load->library('CmsAdminLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->model('content/Contentsprache_model', 'ContentspracheModel');
|
||||
$this->load->model('content/Contentchild_model', 'ContentchildModel');
|
||||
$this->load->model('content/Contentgruppe_model', 'ContentgruppeModel');
|
||||
$this->load->model('content/Template_model', 'TemplateModel');
|
||||
|
||||
$this->loadPhrases(['global', 'cms']);
|
||||
}
|
||||
|
||||
public function getTree()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('menu', 'Menu', 'required|in_list[content,news]');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$menu = $this->input->get('menu', TRUE);
|
||||
$filter = $this->input->get('filter', TRUE);
|
||||
|
||||
$entitledResult = $this->cmsadminlib->getEntitledOe();
|
||||
$entitledOe = isError($entitledResult) ? [] : getData($entitledResult) ?? [];
|
||||
|
||||
$nodes = [];
|
||||
|
||||
if ($menu === 'news')
|
||||
{
|
||||
$newsResult = $this->ContentModel->getNewsContent();
|
||||
if (!isError($newsResult) && getData($newsResult))
|
||||
{
|
||||
foreach (getData($newsResult) as $row)
|
||||
{
|
||||
$titel = '';
|
||||
$csResult = $this->ContentspracheModel->getOne(
|
||||
(int) $row->content_id, DEFAULT_LANGUAGE
|
||||
);
|
||||
if (!isError($csResult))
|
||||
$titel = getData($csResult)->titel;
|
||||
|
||||
$node = new stdClass();
|
||||
$node->content_id = (int) $row->content_id;
|
||||
$node->titel = mb_substr($titel, 0, 15) . ' '
|
||||
. date('d.m.Y', strtotime($row->insertamum));
|
||||
$node->template_kurzbz = $row->template_kurzbz;
|
||||
$node->oe_kurzbz = $row->oe_kurzbz;
|
||||
$node->aktiv = ($row->aktiv === 't' || $row->aktiv === true);
|
||||
$node->entitled = false;
|
||||
$node->groups = [];
|
||||
$node->children = [];
|
||||
$nodes[] = $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!empty($filter))
|
||||
{
|
||||
$clean = str_replace(['!', '.', '?', ','], '', $filter);
|
||||
$searchItems = preg_split('/\s+/', $clean, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$rootsResult = $this->ContentModel->searchCms($searchItems);
|
||||
}
|
||||
else
|
||||
{
|
||||
$rootsResult = $this->ContentModel->getRootContent();
|
||||
}
|
||||
|
||||
if (!isError($rootsResult) && getData($rootsResult))
|
||||
{
|
||||
$visited = [];
|
||||
foreach (getData($rootsResult) as $row)
|
||||
{
|
||||
$node = $this->buildTreeNode(
|
||||
(int) $row->content_id, 0, $visited
|
||||
);
|
||||
if ($node !== null)
|
||||
$nodes[] = $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$allIds = [];
|
||||
$this->collectContentIds($nodes, $allIds);
|
||||
|
||||
$groupMap = [];
|
||||
if (!empty($allIds))
|
||||
{
|
||||
$gResult = $this->ContentgruppeModel->getGruppenForContents($allIds);
|
||||
if (!isError($gResult))
|
||||
$groupMap = getData($gResult);
|
||||
}
|
||||
|
||||
$this->applyMeta($nodes, $entitledOe, $groupMap);
|
||||
|
||||
$result = [];
|
||||
foreach ($nodes as $node)
|
||||
{
|
||||
$pruned = $this->pruneUnentitled($node);
|
||||
if ($pruned !== null)
|
||||
$result[] = $pruned;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
// One subtree in the shape of a getTree root node. Lets the client replace a branch
|
||||
// instead of rebuilding the whole tree after a change.
|
||||
// The visited map starts empty here, so a node with several parents can show up twice
|
||||
// until the next full reload. Rebuilding the whole tree on every change costs more.
|
||||
public function getSubtree()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = (int) $this->input->get('content_id', TRUE);
|
||||
|
||||
$entitledResult = $this->cmsadminlib->getEntitledOe();
|
||||
$entitledOe = isError($entitledResult) ? [] : getData($entitledResult);
|
||||
|
||||
$visited = [];
|
||||
$node = $this->buildTreeNode($content_id, 0, $visited);
|
||||
|
||||
// Deleted meanwhile. The client drops the branch.
|
||||
if ($node === null)
|
||||
$this->terminateWithSuccess(null);
|
||||
|
||||
$nodes = [$node];
|
||||
|
||||
$allIds = [];
|
||||
$this->collectContentIds($nodes, $allIds);
|
||||
|
||||
$groupMap = [];
|
||||
if (!empty($allIds))
|
||||
{
|
||||
$gResult = $this->ContentgruppeModel->getGruppenForContents($allIds);
|
||||
if (!isError($gResult))
|
||||
$groupMap = getData($gResult);
|
||||
}
|
||||
|
||||
$this->applyMeta($nodes, $entitledOe, $groupMap);
|
||||
|
||||
$this->terminateWithSuccess($this->pruneUnentitled($node));
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
|
||||
$entitledResult = $this->cmsadminlib->isEntitledForContent($content_id);
|
||||
$entitled = $this->getDataOrTerminateWithError($entitledResult);
|
||||
|
||||
if (!$entitled)
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigungFuerDiesenEintrag'));
|
||||
|
||||
$this->ContentModel->resetQuery();
|
||||
$contentResult = $this->ContentModel->load($content_id);
|
||||
$contentData = $this->getDataOrTerminateWithError($contentResult);
|
||||
if (empty($contentData))
|
||||
$this->terminateWithError($this->p->t('cms', 'contentNichtGefunden'));
|
||||
$content = $contentData[0];
|
||||
|
||||
$langResult = $this->ContentspracheModel->getLanguages($content_id);
|
||||
$languages = $this->getDataOrTerminateWithError($langResult);
|
||||
|
||||
$versions = new stdClass();
|
||||
foreach ($languages as $sprache)
|
||||
{
|
||||
$vResult = $this->ContentspracheModel->getVersions($content_id, $sprache);
|
||||
if (!isError($vResult) && getData($vResult))
|
||||
{
|
||||
$versions->$sprache = array_map(function ($v) {
|
||||
return (int) $v->version;
|
||||
}, getData($vResult));
|
||||
}
|
||||
}
|
||||
|
||||
$result = new stdClass();
|
||||
$result->content_id = (int) $content->content_id;
|
||||
$result->template_kurzbz = $content->template_kurzbz;
|
||||
$result->oe_kurzbz = $content->oe_kurzbz;
|
||||
$result->aktiv = ($content->aktiv === 't' || $content->aktiv === true);
|
||||
$result->menu_open = ($content->menu_open === 't' || $content->menu_open === true);
|
||||
$result->beschreibung = $content->beschreibung ?: '';
|
||||
$result->entitled = true;
|
||||
$result->languages = $languages;
|
||||
$result->versions = $versions;
|
||||
|
||||
// Tells the CIS4 preview whether this template renders there at all.
|
||||
$cis4Result = $this->TemplateModel->hasCis4Stylesheet($content->template_kurzbz);
|
||||
$result->has_cis4_stylesheet = !isError($cis4Result) && getData($cis4Result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getContentsprache()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
$version = $this->input->get('version', TRUE);
|
||||
|
||||
$result = $this->ContentspracheModel->getOne($content_id, $sprache, $version);
|
||||
if (isError($result))
|
||||
$this->terminateWithError($this->p->t('cms', 'versionNichtGefunden'));
|
||||
|
||||
$data = getData($result);
|
||||
$data->sichtbar = ($data->sichtbar === 't' || $data->sichtbar === true);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
// The tree lists a search hit out of its place, so a generic title carries no context.
|
||||
// This answers where each one sits. One walk for the whole list, not one per node.
|
||||
const MAX_ANCESTOR_TIEFE = 12;
|
||||
|
||||
/**
|
||||
* Ancestors of the given contents, keyed by content_id and ordered from the top down.
|
||||
*/
|
||||
public function getAncestors()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_ids', 'Content IDs', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$ids = [];
|
||||
foreach (explode(',', $this->input->get('content_ids', TRUE)) as $teil)
|
||||
{
|
||||
$teil = trim($teil);
|
||||
if (is_numeric($teil))
|
||||
$ids[] = (int) $teil;
|
||||
}
|
||||
$ids = array_values(array_unique($ids));
|
||||
|
||||
if (empty($ids))
|
||||
$this->terminateWithSuccess(new stdClass());
|
||||
|
||||
$result = $this->ContentchildModel->getAncestors(
|
||||
$ids, self::MAX_ANCESTOR_TIEFE, DEFAULT_LANGUAGE
|
||||
);
|
||||
$rows = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// Same rule as the tree: an entry of an organisational unit the editor is not
|
||||
// entitled for stays readable but cannot be opened.
|
||||
$entitledResult = $this->cmsadminlib->getEntitledOe();
|
||||
$entitledOe = isError($entitledResult) ? [] : getData($entitledResult) ?? [];
|
||||
|
||||
// The query orders by the distance, farthest first, so appending keeps the path
|
||||
// reading from the top down.
|
||||
$pfade = [];
|
||||
foreach ((array) $rows as $row)
|
||||
{
|
||||
$start = (int) $row->start_id;
|
||||
|
||||
if (!isset($pfade[$start]))
|
||||
$pfade[$start] = [];
|
||||
|
||||
$pfade[$start][] = [
|
||||
'content_id' => (int) $row->content_id,
|
||||
'titel' => $row->titel,
|
||||
'tiefe' => (int) $row->tiefe,
|
||||
'entitled' => in_array($row->oe_kurzbz, $entitledOe)
|
||||
];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($pfade ?: new stdClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Per content metadata for the tree filter, keyed by content_id.
|
||||
* One query for the whole tree, so the client filters and sorts without a round trip.
|
||||
*/
|
||||
public function getTreeMeta()
|
||||
{
|
||||
$result = $this->ContentModel->getTreeMeta(getAuthUID(), DEFAULT_LANGUAGE);
|
||||
$rows = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$meta = [];
|
||||
foreach ((array) $rows as $row)
|
||||
{
|
||||
$meta[(int) $row->content_id] = [
|
||||
'childcount' => (int) $row->childcount,
|
||||
'insertamum' => $row->insertamum,
|
||||
'updateamum' => $row->updateamum,
|
||||
'mine' => ($row->mine === 't' || $row->mine === true),
|
||||
'contentlength' => (int) $row->contentlength
|
||||
];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($meta);
|
||||
}
|
||||
|
||||
/**
|
||||
* Two gates guard every click statistics request: the config flag switches the feature
|
||||
* off for everybody, the admin right decides who may read the numbers.
|
||||
*/
|
||||
private function checkClickstatsAccess()
|
||||
{
|
||||
$this->config->load('cms');
|
||||
|
||||
if (!$this->config->item('clickstats_enabled'))
|
||||
$this->terminateWithError($this->p->t('cms', 'klickstatistikDeaktiviert'));
|
||||
|
||||
if (!$this->permissionlib->isBerechtigt('admin'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Period of a click statistics request. 0 counts the whole log.
|
||||
* Call it after checkClickstatsAccess, which loads the config.
|
||||
* @return array months and the start date, null for the whole log
|
||||
*/
|
||||
private function clickstatsPeriod()
|
||||
{
|
||||
$months = $this->input->get('months');
|
||||
if ($months === null || $months === '')
|
||||
$months = $this->config->item('clickstats_months');
|
||||
$months = (int) $months;
|
||||
|
||||
$since = ($months > 0)
|
||||
? date('Y-m-d H:i:s', strtotime('-' . $months . ' months'))
|
||||
: null;
|
||||
|
||||
return [$months, $since];
|
||||
}
|
||||
|
||||
/**
|
||||
* Views of one content. One counting query, so the tab loads it right away.
|
||||
* Empty if LOG_CONTENT is off.
|
||||
*/
|
||||
public function getClickCount()
|
||||
{
|
||||
$this->checkClickstatsAccess();
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('months', 'Monate', 'is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
|
||||
|
||||
list($months, $since) = $this->clickstatsPeriod();
|
||||
|
||||
$result = $this->WebservicelogModel->getContentClickCount(
|
||||
(int) $this->input->get('content_id', TRUE), $since
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'since' => $since,
|
||||
'months' => $months,
|
||||
'own' => $this->getDataOrTerminateWithError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* The ranking of the most viewed contents. It groups the whole log and resolves a
|
||||
* title per row, which takes seconds, so the tab fetches it only on request.
|
||||
* Empty if LOG_CONTENT is off.
|
||||
*/
|
||||
public function getClickRanking()
|
||||
{
|
||||
$this->checkClickstatsAccess();
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('months', 'Monate', 'is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('system/Webservicelog_model', 'WebservicelogModel');
|
||||
|
||||
list($months, $since) = $this->clickstatsPeriod();
|
||||
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
if (empty($sprache))
|
||||
$sprache = DEFAULT_LANGUAGE;
|
||||
|
||||
$result = $this->WebservicelogModel->getContentClickCounts(
|
||||
$since, $sprache, (int) $this->config->item('clickstats_limit')
|
||||
);
|
||||
$rows = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$ranked = [];
|
||||
foreach ((array) $rows as $row)
|
||||
{
|
||||
$ranked[] = [
|
||||
'content_id' => (int) $row->content_id,
|
||||
'titel' => $row->titel,
|
||||
'hits' => (int) $row->hits
|
||||
];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'since' => $since,
|
||||
'months' => $months,
|
||||
'ranked' => $ranked
|
||||
]);
|
||||
}
|
||||
|
||||
public function getTemplates()
|
||||
{
|
||||
$this->TemplateModel->addSelect('template_kurzbz, bezeichnung');
|
||||
$this->TemplateModel->addOrder('bezeichnung');
|
||||
$result = $this->TemplateModel->loadWhere([]);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getOrganisationseinheiten()
|
||||
{
|
||||
$this->load->model(
|
||||
'organisation/Organisationseinheit_model', 'OrganisationseinheitModel'
|
||||
);
|
||||
$this->OrganisationseinheitModel->addSelect(
|
||||
'oe_kurzbz, bezeichnung, organisationseinheittyp_kurzbz, aktiv'
|
||||
);
|
||||
$this->OrganisationseinheitModel->addOrder('bezeichnung');
|
||||
$result = $this->OrganisationseinheitModel->loadWhere([]);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getSprachen()
|
||||
{
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->SpracheModel->addSelect('sprache, bezeichnung');
|
||||
|
||||
$result = $this->SpracheModel->loadWhere(['content' => true]);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getUsage()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$result = $this->ContentModel->getUsage($content_id);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function postContent()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'i'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('parent_content_id', 'Parent', 'is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$parent = $this->input->post('parent_content_id');
|
||||
if (empty($parent))
|
||||
$parent = null;
|
||||
|
||||
$result = $this->cmsadminlib->createContent($parent);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function postTranslation()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'i'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
$this->form_validation->set_rules('target_sprache', 'Target Sprache', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->cmsadminlib->createTranslation(
|
||||
$this->input->post('content_id'),
|
||||
$this->input->post('sprache'),
|
||||
$this->input->post('version'),
|
||||
$this->input->post('target_sprache')
|
||||
);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function postVersion()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'i'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->cmsadminlib->createVersion(
|
||||
$this->input->post('content_id'),
|
||||
$this->input->post('sprache')
|
||||
);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function putProperties()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
$this->form_validation->set_rules('template_kurzbz', 'Template', 'required');
|
||||
$this->form_validation->set_rules('oe_kurzbz', 'OE', 'required');
|
||||
$this->form_validation->set_rules('titel', 'Titel', 'required|max_length[256]');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$daten = [
|
||||
'content_id' => $this->input->post('content_id'),
|
||||
'sprache' => $this->input->post('sprache'),
|
||||
'version' => $this->input->post('version'),
|
||||
'template_kurzbz' => $this->input->post('template_kurzbz'),
|
||||
'oe_kurzbz' => $this->input->post('oe_kurzbz'),
|
||||
'titel' => $this->input->post('titel'),
|
||||
'beschreibung' => $this->input->post('beschreibung') ?: '',
|
||||
'aktiv' => filter_var($this->input->post('aktiv'), FILTER_VALIDATE_BOOLEAN),
|
||||
'menu_open' => filter_var($this->input->post('menu_open'), FILTER_VALIDATE_BOOLEAN),
|
||||
'sichtbar' => filter_var($this->input->post('sichtbar'), FILTER_VALIDATE_BOOLEAN)
|
||||
];
|
||||
|
||||
$result = $this->cmsadminlib->saveProperties($daten);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function deleteContent()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'd'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->cmsadminlib->deleteContent($this->input->post('content_id'));
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function deleteContentsprache()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'd'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->validateContentSpracheVersion();
|
||||
|
||||
$result = $this->cmsadminlib->deleteVersion(
|
||||
$this->input->post('content_id'),
|
||||
$this->input->post('sprache'),
|
||||
$this->input->post('version')
|
||||
);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
// --- Private helpers ---
|
||||
|
||||
private function validateContentSpracheVersion()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
private function buildTreeNode($content_id, $depth, &$visited)
|
||||
{
|
||||
if ($depth > self::MAX_TREE_DEPTH || isset($visited[$content_id]))
|
||||
return null;
|
||||
|
||||
$visited[$content_id] = true;
|
||||
|
||||
$this->ContentModel->resetQuery();
|
||||
$contentResult = $this->ContentModel->load($content_id);
|
||||
if (isError($contentResult) || empty(getData($contentResult)))
|
||||
return null;
|
||||
$content = getData($contentResult)[0];
|
||||
|
||||
$titel = '';
|
||||
$csResult = $this->ContentspracheModel->getOne($content_id, DEFAULT_LANGUAGE);
|
||||
if (!isError($csResult))
|
||||
$titel = getData($csResult)->titel;
|
||||
|
||||
$childrenResult = $this->ContentchildModel->getChilds($content_id, DEFAULT_LANGUAGE);
|
||||
$children = [];
|
||||
if (!isError($childrenResult) && getData($childrenResult))
|
||||
{
|
||||
foreach (getData($childrenResult) as $child)
|
||||
{
|
||||
$childNode = $this->buildTreeNode(
|
||||
(int) $child->child_content_id, $depth + 1, $visited
|
||||
);
|
||||
if ($childNode !== null)
|
||||
$children[] = $childNode;
|
||||
}
|
||||
}
|
||||
|
||||
$node = new stdClass();
|
||||
$node->content_id = (int) $content_id;
|
||||
$node->titel = $titel;
|
||||
$node->template_kurzbz = $content->template_kurzbz;
|
||||
$node->oe_kurzbz = $content->oe_kurzbz;
|
||||
$node->aktiv = ($content->aktiv === 't' || $content->aktiv === true);
|
||||
$node->entitled = false;
|
||||
$node->groups = [];
|
||||
$node->children = $children;
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
private function collectContentIds($nodes, &$ids)
|
||||
{
|
||||
foreach ($nodes as $node)
|
||||
{
|
||||
$ids[] = $node->content_id;
|
||||
if (!empty($node->children))
|
||||
$this->collectContentIds($node->children, $ids);
|
||||
}
|
||||
}
|
||||
|
||||
private function applyMeta(&$nodes, $entitledOe, $groupMap)
|
||||
{
|
||||
foreach ($nodes as $node)
|
||||
{
|
||||
$node->entitled = in_array($node->oe_kurzbz, $entitledOe);
|
||||
$node->groups = isset($groupMap[$node->content_id])
|
||||
? $groupMap[$node->content_id]
|
||||
: [];
|
||||
if (!empty($node->children))
|
||||
$this->applyMeta($node->children, $entitledOe, $groupMap);
|
||||
}
|
||||
}
|
||||
|
||||
private function pruneUnentitled($node)
|
||||
{
|
||||
$kept = [];
|
||||
foreach ($node->children as $child)
|
||||
{
|
||||
$pruned = $this->pruneUnentitled($child);
|
||||
if ($pruned !== null)
|
||||
$kept[] = $pruned;
|
||||
}
|
||||
$node->children = $kept;
|
||||
|
||||
if ($node->entitled || !empty($node->children))
|
||||
return $node;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the DMS categories for the contentcomponent insert dialog.
|
||||
*/
|
||||
public function getDmsKategorien()
|
||||
{
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
|
||||
$result = $this->DmsModel->getKategorien();
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lists active staff for the contentcomponent insert dialog.
|
||||
* Names only. See Mitarbeiter_model::getAktivesPersonalNamen().
|
||||
*/
|
||||
public function getMitarbeiter()
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->getAktivesPersonalNamen();
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lists the documents of one DMS category for the contentcomponent insert dialog.
|
||||
*/
|
||||
public function getDmsKategorieDokumente()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('kategorie_kurzbz', 'DMS-Kategorie', 'required');
|
||||
if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
|
||||
$result = $this->DmsModel->getKategorieDokumenteAlle($this->input->get('kategorie_kurzbz', TRUE));
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result) ?: array());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class CmsAdminInhalt extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getFormSchema' => ['basis/cms:r'],
|
||||
'getFormData' => ['basis/cms:r'],
|
||||
'getLock' => ['basis/cms:r'],
|
||||
'getVersions' => ['basis/cms:r'],
|
||||
'putFormData' => ['basis/cms:rw'],
|
||||
'postLock' => ['basis/cms:rw'],
|
||||
'deleteLock' => ['basis/cms:rw'],
|
||||
'deleteLockForced' => ['basis/cms:rw']
|
||||
]);
|
||||
|
||||
$this->load->library('CmsAdminLib');
|
||||
$this->load->library('XsdSchemaLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->model('content/Contentsprache_model', 'ContentspracheModel');
|
||||
$this->load->model('content/Template_model', 'TemplateModel');
|
||||
|
||||
$this->loadPhrases(['global', 'cms']);
|
||||
}
|
||||
|
||||
public function getFormSchema()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('template_kurzbz', 'Template', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$template_kurzbz = $this->input->get('template_kurzbz', TRUE);
|
||||
|
||||
$this->TemplateModel->resetQuery();
|
||||
$templateResult = $this->TemplateModel->load($template_kurzbz);
|
||||
$templateData = $this->getDataOrTerminateWithError($templateResult);
|
||||
if (empty($templateData))
|
||||
$this->terminateWithError($this->p->t('cms', 'vorlageNichtGefunden'));
|
||||
|
||||
$schemaResult = $this->xsdschemalib->parseSchema(
|
||||
$templateData[0]->xsd, $template_kurzbz
|
||||
);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($schemaResult));
|
||||
}
|
||||
|
||||
public function getFormData()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
$version = $this->input->get('version', TRUE);
|
||||
|
||||
$versionResult = $this->ContentspracheModel->getOne($content_id, $sprache, $version);
|
||||
$row = $this->getDataOrTerminateWithError($versionResult);
|
||||
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->ContentModel->resetQuery();
|
||||
$contentResult = $this->ContentModel->load($content_id);
|
||||
$contentData = $this->getDataOrTerminateWithError($contentResult);
|
||||
if (empty($contentData))
|
||||
$this->terminateWithError($this->p->t('cms', 'contentNichtGefunden'));
|
||||
|
||||
$this->TemplateModel->resetQuery();
|
||||
$templateResult = $this->TemplateModel->load($contentData[0]->template_kurzbz);
|
||||
$templateData = $this->getDataOrTerminateWithError($templateResult);
|
||||
if (empty($templateData))
|
||||
$this->terminateWithError($this->p->t('cms', 'vorlageNichtGefunden'));
|
||||
|
||||
$schemaResult = $this->xsdschemalib->parseSchema(
|
||||
$templateData[0]->xsd, $contentData[0]->template_kurzbz
|
||||
);
|
||||
$schema = $this->getDataOrTerminateWithError($schemaResult);
|
||||
|
||||
$valuesResult = $this->xsdschemalib->extractValues($row->content, $schema);
|
||||
$values = $this->getDataOrTerminateWithError($valuesResult);
|
||||
|
||||
$lockResult = $this->cmsadminlib->getLockState($content_id, $sprache, $version);
|
||||
$lock = $this->getDataOrTerminateWithError($lockResult);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'schema' => $schema,
|
||||
'values' => $values,
|
||||
'sperre' => $lock
|
||||
]);
|
||||
}
|
||||
|
||||
public function getLock()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
$version = $this->input->get('version', TRUE);
|
||||
|
||||
$result = $this->cmsadminlib->getLockState($content_id, $sprache, $version);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getVersions()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
|
||||
$result = $this->ContentspracheModel->getVersions($content_id, $sprache);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function putFormData()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('sprache', 'Sprache', 'required');
|
||||
$this->form_validation->set_rules('version', 'Version', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->post('content_id');
|
||||
$sprache = $this->input->post('sprache');
|
||||
$version = $this->input->post('version');
|
||||
$values = $this->input->post('values');
|
||||
|
||||
if (is_string($values))
|
||||
$values = json_decode($values, true);
|
||||
|
||||
if (!is_array($values))
|
||||
$values = [];
|
||||
|
||||
$lockResult = $this->cmsadminlib->getLockState($content_id, $sprache, $version);
|
||||
$lock = $this->getDataOrTerminateWithError($lockResult);
|
||||
if (!$lock['own'])
|
||||
$this->terminateWithError($this->p->t('cms', 'speichernNurMitSperre'));
|
||||
|
||||
$result = $this->cmsadminlib->saveContentXml($content_id, $sprache, $version, $values);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function postLock()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigungFuerDieseAktion'));
|
||||
|
||||
$contentsprache_id = $this->input->post('contentsprache_id');
|
||||
|
||||
$result = $this->cmsadminlib->lock($contentsprache_id);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function deleteLock()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigungFuerDieseAktion'));
|
||||
|
||||
$contentsprache_id = $this->input->post('contentsprache_id');
|
||||
|
||||
$result = $this->cmsadminlib->releaseOwnLock($contentsprache_id);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function deleteLockForced()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms_sperrfreigabe', 'su'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigungFuerDieseAktion'));
|
||||
|
||||
$contentsprache_id = $this->input->post('contentsprache_id');
|
||||
|
||||
$result = $this->cmsadminlib->forceRelease($contentsprache_id);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class CmsAdminStruktur extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getGruppen' => ['basis/cms:r'],
|
||||
'getAllGruppen' => ['basis/cms:r'],
|
||||
'getChilds' => ['basis/cms:r'],
|
||||
'getParents' => ['basis/cms:r'],
|
||||
'getPossibleChilds' => ['basis/cms:r'],
|
||||
'postGruppe' => ['basis/cms:rw'],
|
||||
'deleteGruppe' => ['basis/cms:rw'],
|
||||
'postChild' => ['basis/cms:rw'],
|
||||
'deleteChild' => ['basis/cms:rw'],
|
||||
'putChildSort' => ['basis/cms:rw'],
|
||||
'putChildOrder' => ['basis/cms:rw']
|
||||
]);
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->model('content/Contentchild_model', 'ContentchildModel');
|
||||
$this->load->model('content/Contentgruppe_model', 'ContentgruppeModel');
|
||||
|
||||
$this->loadPhrases(['global', 'cms']);
|
||||
}
|
||||
|
||||
public function getGruppen()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
|
||||
$result = $this->ContentgruppeModel->getGruppen($content_id);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getAllGruppen()
|
||||
{
|
||||
$result = $this->ContentgruppeModel->getAllGruppen();
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getChilds()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
|
||||
if (empty($sprache))
|
||||
$sprache = DEFAULT_LANGUAGE;
|
||||
|
||||
$result = $this->ContentchildModel->getChilds($content_id, $sprache);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getParents()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
|
||||
if (empty($sprache))
|
||||
$sprache = DEFAULT_LANGUAGE;
|
||||
|
||||
$result = $this->ContentchildModel->getParents($content_id, $sprache);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getPossibleChilds()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->get('content_id', TRUE);
|
||||
$sprache = $this->input->get('sprache', TRUE);
|
||||
|
||||
if (empty($sprache))
|
||||
$sprache = DEFAULT_LANGUAGE;
|
||||
|
||||
$result = $this->ContentModel->getPossibleChilds($content_id, $sprache);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function postGruppe()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('gruppe_kurzbz', 'Gruppe', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->ContentgruppeModel->insert([
|
||||
'content_id' => $this->input->post('content_id'),
|
||||
'gruppe_kurzbz' => $this->input->post('gruppe_kurzbz'),
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => getAuthUID()
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('cms', 'gruppeBereitsZugeordnet'));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function deleteGruppe()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('gruppe_kurzbz', 'Gruppe', 'required');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->ContentgruppeModel->delete([
|
||||
$this->input->post('gruppe_kurzbz'),
|
||||
$this->input->post('content_id')
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function postChild()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('child_content_id', 'Child Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$content_id = $this->input->post('content_id');
|
||||
|
||||
$sortResult = $this->ContentchildModel->getMaxSort($content_id);
|
||||
$sort = $this->getDataOrTerminateWithError($sortResult) + 1;
|
||||
|
||||
$result = $this->ContentchildModel->insert([
|
||||
'content_id' => $content_id,
|
||||
'child_content_id' => $this->input->post('child_content_id'),
|
||||
'sort' => $sort,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => getAuthUID()
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function deleteChild()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('contentchild_id', 'Contentchild ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->ContentchildModel->delete($this->input->post('contentchild_id'));
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
public function putChildSort()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('contentchild_id', 'Contentchild ID', 'required|is_natural');
|
||||
$this->form_validation->set_rules('direction', 'Direction', 'required|in_list[up,down]');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$direction = $this->input->post('direction');
|
||||
|
||||
$result = $this->ContentchildModel->swapSort(
|
||||
$this->input->post('contentchild_id'),
|
||||
$direction
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
// The child already sits at the end it was moved towards. That is a normal
|
||||
// answer, not a failure, and the direction decides the wording.
|
||||
if (getError($result) === Contentchild_model::NO_NEIGHBOUR)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('cms',
|
||||
$direction === 'up' ? 'bereitsGanzOben' : 'bereitsGanzUnten'));
|
||||
}
|
||||
|
||||
$this->terminateWithError($this->p->t('cms', 'sortierungFehlgeschlagen'));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
// Writes the whole order at once. The drag and drop moves a child over any distance,
|
||||
// and putChildSort would need one request per position.
|
||||
public function putChildOrder()
|
||||
{
|
||||
if (!$this->permissionlib->isBerechtigt('basis/cms', 'u'))
|
||||
$this->terminateWithError($this->p->t('cms', 'keineBerechtigung'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_POST);
|
||||
$this->form_validation->set_rules('content_id', 'Content ID', 'required|is_natural');
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$ids = $this->input->post('contentchild_ids');
|
||||
|
||||
if (is_string($ids))
|
||||
$ids = json_decode($ids, true);
|
||||
|
||||
if (!is_array($ids) || empty($ids))
|
||||
$this->terminateWithError($this->p->t('cms', 'sortierungFehlgeschlagen'));
|
||||
|
||||
$result = $this->ContentchildModel->setSortOrder(
|
||||
$this->input->post('content_id'),
|
||||
$ids
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($this->p->t('cms', 'sortierungFehlgeschlagen'));
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -20,8 +20,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about favorite verbände
|
||||
* Listens to ajax post calls to change the favorite verbände data
|
||||
* Provides data to the ajax get calls about favorite treemenu entries
|
||||
* Listens to ajax post calls to change the favorite treemenu entries
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Favorites extends FHCAPI_Controller
|
||||
@@ -29,7 +29,7 @@ class Favorites extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'get' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
@@ -37,19 +37,19 @@ class Favorites extends FHCAPI_Controller
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
public function get($app)
|
||||
{
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['stv_favorites']);
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), [$app . '_favorites']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithSuccess(null);
|
||||
else
|
||||
$this->terminateWithSuccess($data['stv_favorites'] ?? null);
|
||||
$this->terminateWithSuccess($data[$app . '_favorites'] ?? null);
|
||||
}
|
||||
|
||||
public function set()
|
||||
public function set($app)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -60,7 +60,7 @@ class Favorites extends FHCAPI_Controller
|
||||
|
||||
$favorites = $this->input->post('favorites');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), $app . '_favorites', $favorites);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -38,7 +38,8 @@ class Lehre extends FHCAPI_Controller
|
||||
parent::__construct([
|
||||
'lvStudentenMail' => self::PERM_LOGGED,
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
'semesterAverageGrade' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
@@ -100,5 +101,49 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* calculates and returns the grade average and weighted average for a specific semester
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function semesterAverageGrade($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$semesterLvs = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
|
||||
if (isError($semesterLvs))
|
||||
return $this->outputJsonError(getError($semesterLvs));
|
||||
|
||||
$semesterLvsData = getData($semesterLvs);
|
||||
|
||||
$doGradesExist = false;
|
||||
$sum = 0;
|
||||
$count = 0;
|
||||
$sumWeighted = 0;
|
||||
$sumEcts = 0;
|
||||
|
||||
foreach ($semesterLvsData as $lv) {
|
||||
if (!$lv->znote || $lv->znote < 1 || $lv->znote > 5)
|
||||
continue;
|
||||
|
||||
$doGradesExist = true;
|
||||
|
||||
$sum += $lv->znote;
|
||||
$count++;
|
||||
$sumWeighted += $lv->znote * floatval($lv->ects);
|
||||
$sumEcts += floatval($lv->ects);
|
||||
}
|
||||
|
||||
$averageGrade = null;
|
||||
$weightedAverageGrade = null;
|
||||
if ($doGradesExist) {
|
||||
$averageGrade = $sum/$count;
|
||||
$weightedAverageGrade = $sumWeighted/$sumEcts;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(['average_grade' => $averageGrade, 'weighted_average_grade' => $weightedAverageGrade]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,9 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz);
|
||||
$studiengang_kz = $this->getStudiengangKz($stg_kz);
|
||||
|
||||
$lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $studiengang_kz);
|
||||
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
|
||||
$tree = [];
|
||||
@@ -75,15 +77,17 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
public function getByStg($studiensemester_kurzbz = null, $studiengang_kz = null, $semester = null)
|
||||
public function getByStg($studiensemester_kurzbz = null, $stg_kz = null, $semester = null)
|
||||
{
|
||||
if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
|
||||
$studiengang_kz = $this->getStudiengangKz($stg_kz);
|
||||
|
||||
if (is_null($studiengang_kz) || !preg_match("/^(-?[1-9][0-9]*|0)$/", (string)$studiengang_kz))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$verband = null;
|
||||
if (!is_null($semester) && !is_numeric($semester))
|
||||
{
|
||||
$verband = $semester;
|
||||
$verband = $this->getOrgformKurzbz($semester);
|
||||
$semester = null;
|
||||
}
|
||||
|
||||
@@ -260,18 +264,53 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
protected function getStudiengangKz($studiengang_typ_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'LOWER(CONCAT(typ, kurzbz)) =' => strtolower($studiengang_typ_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return null;
|
||||
|
||||
return current($data)->studiengang_kz;
|
||||
}
|
||||
|
||||
private function getStudiensemesterKurzbz($studiensemester_kurzbz = null)
|
||||
{
|
||||
if (!is_null($studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester_result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere([
|
||||
'LOWER(studiensemester_kurzbz)' => strtolower($studiensemester_kurzbz)
|
||||
]);
|
||||
|
||||
if (isError($studiensemester_result) || !hasData($studiensemester_result))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return getData($studiensemester_result)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
protected function getOrgformKurzbz($orgform_kurzbz)
|
||||
{
|
||||
if ($orgform_kurzbz === null)
|
||||
return null;
|
||||
|
||||
$this->load->model('codex/Orgform_model', 'OrgformModel');
|
||||
$result = $this->OrgformModel->loadWhere([
|
||||
'LOWER(orgform_kurzbz) =' => strtolower($orgform_kurzbz)
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return $orgform_kurzbz;
|
||||
|
||||
return current($data)->orgform_kurzbz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
use \DateTime as DateTime;
|
||||
@@ -33,19 +34,27 @@ class LvPlan extends FHCAPI_Controller
|
||||
|
||||
parent::__construct([
|
||||
'getRoomplan' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'getReservierungen' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'getReservierungen' => self::PERM_LOGGED,
|
||||
'LvPlanEvents' => self::PERM_LOGGED,
|
||||
'eventsPersonal' => self::PERM_LOGGED,
|
||||
'eventsLv' => self::PERM_LOGGED,
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
'studiensemesterDateInterval' => self::PERM_LOGGED,
|
||||
'getLvPlanForStudiensemester' => self::PERM_LOGGED,
|
||||
'getLv' => self::PERM_LOGGED
|
||||
'getLv' => self::PERM_LOGGED,
|
||||
'eventsStgOrg' => self::PERM_LOGGED,
|
||||
'fetchFerienEvents' => self::PERM_LOGGED,
|
||||
'getStudiengaenge' => self::PERM_LOGGED,
|
||||
'getLehrverband' => self::PERM_LOGGED,
|
||||
'permissionOtherLvPlan' => self::PERM_LOGGED,
|
||||
'compactibleEventTypes' => self::PERM_LOGGED,
|
||||
'getLeEvents' => self::PERM_LOGGED,
|
||||
'getLvEvents' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
@@ -54,16 +63,22 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('PhrasesLib');
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
* fetches LvPlan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function LvPlanEvents()
|
||||
{
|
||||
$hasLv = $this->input->post('lv_id');
|
||||
@@ -83,24 +98,31 @@ class LvPlan extends FHCAPI_Controller
|
||||
// form validation
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
$uid = $this->input->post('uid', true);
|
||||
|
||||
// disallow accessing other user's events if missing permission
|
||||
if ($uid && $uid !== getAuthUID() && !$this->permissionlib->isBerechtigt('basis/other_lv_plan')) {
|
||||
$this->terminateWithError("Missing permission to view other users' timetables!");
|
||||
}
|
||||
|
||||
// fetching lvplan events
|
||||
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date);
|
||||
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date, $uid);
|
||||
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// fetching moodle events
|
||||
$moodleEvents = $this->fetchMoodleEvents($start_date, $end_date);
|
||||
$moodleEvents = $this->fetchMoodleEvents($start_date, $end_date, $uid);
|
||||
|
||||
// fetching ferien events
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
|
||||
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date, $uid);
|
||||
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$lvplanEvents,
|
||||
@@ -109,6 +131,45 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches LvPlan for studiengang / semester / verband / gruppe
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function eventsStgOrg()
|
||||
{
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
// form validation
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
//$this->form_validation->set_rules('stg_kz', "stg_kz", "required"); //no validation show empty calendar
|
||||
|
||||
if (!$this->form_validation->run()) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
$stgOrgEvents = [];
|
||||
$ferienEvents = [];
|
||||
} else {
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
$stg_kz = $this->input->post('stg_kz', true);
|
||||
$sem = $this->input->post('sem', true);
|
||||
$verband = $this->input->post('verband', true);
|
||||
$gruppe = $this->input->post('gruppe', true);
|
||||
|
||||
$result = $this->stundenplanlib->getEventsStgOrg($start_date, $end_date, $stg_kz, $sem, $verband, $gruppe);
|
||||
$stgOrgEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $stg_kz);
|
||||
$ferienEvents = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$stgOrgEvents,
|
||||
$ferienEvents
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Ferien events together for the lv
|
||||
*
|
||||
@@ -122,7 +183,7 @@ class LvPlan extends FHCAPI_Controller
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
$this->form_validation->set_rules('lv_id', "lv_id", "required|integer");
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
@@ -137,7 +198,6 @@ class LvPlan extends FHCAPI_Controller
|
||||
|
||||
// fetching ferien events
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
|
||||
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$lvplanEvents,
|
||||
@@ -145,41 +205,75 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
public function getLeEvents($le_id = null, $start_date = null, $end_date = null, $stundenplan = 'stundenplandev')
|
||||
{
|
||||
|
||||
if (is_null($le_id) || is_null($start_date) || is_null($end_date))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($stundenplan !== 'stundenplandev' && $stundenplan !== 'stundenplan')
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getEventsByLE($le_id, $start_date, $end_date, $stundenplan);
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($lvplanEvents);
|
||||
}
|
||||
|
||||
public function getLvEvents($lv_id = null, $start_date = null, $end_date = null, $stundenplan = 'stundenplandev')
|
||||
{
|
||||
if (is_null($lv_id) || is_null($start_date) || is_null($end_date))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($stundenplan !== 'stundenplandev' && $stundenplan !== 'stundenplan')
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getEventsByLV($lv_id, $start_date, $end_date, $stundenplan);
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
//TODO: delete this function if we don't use the old calendar export endpoints anymore
|
||||
public function studiensemesterDateInterval($date){
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$studiensemester =$this->StudiensemesterModel->getByDate(date_format(date_create($date),'Y-m-d'));
|
||||
$studiensemester =current($this->getDataOrTerminateWithError($studiensemester));
|
||||
public function studiensemesterDateInterval($date)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$studiensemester = $this->StudiensemesterModel->getByDate(date_format(date_create($date), 'Y-m-d'));
|
||||
$studiensemester = current($this->getDataOrTerminateWithError($studiensemester));
|
||||
$this->terminateWithSuccess($studiensemester);
|
||||
}
|
||||
|
||||
public function getLvPlanForStudiensemester($studiensemester,$lvid){
|
||||
public function getLvPlanForStudiensemester($studiensemester, $lvid)
|
||||
{
|
||||
$this->load->library('StundenplanLib');
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
|
||||
$studiensemester_result = $this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz"=>$studiensemester]);
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$studiensemester_result = $this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz" => $studiensemester]);
|
||||
$studiensemester_result = current($this->getDataOrTerminateWithError($studiensemester_result));
|
||||
$timespan_start = new DateTime($studiensemester_result->start);
|
||||
$timespan_ende = new DateTime($studiensemester_result->ende);
|
||||
$lvplan = $this->stundenplanlib->getStundenplan(date_format($timespan_start, 'Y-m-d'),date_format($timespan_ende, 'Y-m-d'), $lvid);
|
||||
$lvplan = $this->stundenplanlib->getStundenplan(date_format($timespan_start, 'Y-m-d'), date_format($timespan_ende, 'Y-m-d'), $lvid);
|
||||
$this->terminateWithSuccess($lvplan);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
$this->StundeModel->addOrder('stunde', 'ASC');
|
||||
$stunden = $this->StundeModel->load();
|
||||
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
|
||||
$this->terminateWithSuccess($stunden);
|
||||
}
|
||||
@@ -210,10 +304,10 @@ class LvPlan extends FHCAPI_Controller
|
||||
$roomplan_data = $this->stundenplanlib->getRoomplan($ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
$roomplan_data = $this->getDataOrTerminateWithError($roomplan_data);
|
||||
|
||||
|
||||
$this->terminateWithSuccess($roomplan_data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gets the reservierungen of a room if the ort_kurzbz parameter is
|
||||
* supplied otherwise gets the reservierungen of the lvplan of a student
|
||||
@@ -226,25 +320,32 @@ class LvPlan extends FHCAPI_Controller
|
||||
{
|
||||
$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);
|
||||
$uid = $this->input->post('uid', true);
|
||||
|
||||
// disallow accessing other user's reservierungen if missing permission
|
||||
if ($uid && $uid !== getAuthUID() && !$this->permissionlib->isBerechtigt('basis/other_lv_plan')) {
|
||||
$this->terminateWithError("Missing permission to view other users' timetables!");
|
||||
}
|
||||
|
||||
// get data
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz, $uid);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id)
|
||||
{
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
@@ -287,6 +388,68 @@ class LvPlan extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(current($result));
|
||||
}
|
||||
|
||||
public function getStudiengaenge()
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'aktiv' => true
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLehrverband($studiengang_kz, $semester = null, $verband = null)
|
||||
{
|
||||
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
|
||||
$where = [
|
||||
'aktiv' => true,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
];
|
||||
|
||||
if ($semester !== null && $semester !== 'null' && $semester !== 'undefined') {
|
||||
$where['semester'] = $semester;
|
||||
}
|
||||
if ($verband !== null && $verband !== 'null' && $verband !== 'undefined') {
|
||||
$where['verband'] = $verband;
|
||||
}
|
||||
|
||||
$this->LehrverbandModel->addOrder('studiengang_kz');
|
||||
$this->LehrverbandModel->addOrder('semester');
|
||||
$this->LehrverbandModel->addOrder('verband');
|
||||
$this->LehrverbandModel->addOrder('gruppe');
|
||||
$result = $this->LehrverbandModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current user has permission to view other users' timetables
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function permissionOtherLvPlan()
|
||||
{
|
||||
$this->terminateWithSuccess($this->permissionlib->isBerechtigt('basis/other_lv_plan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get event types which can be compacted in lv plan display
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compactibleEventTypes()
|
||||
{
|
||||
$this->terminateWithSuccess(["lehreinheit", "reservierung", "ferien", "moodle"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch moodle events
|
||||
*
|
||||
@@ -294,30 +457,34 @@ class LvPlan extends FHCAPI_Controller
|
||||
* @param string $end_date
|
||||
* @return array
|
||||
*/
|
||||
private function fetchMoodleEvents($start_date, $end_date)
|
||||
private function fetchMoodleEvents($start_date, $end_date, $uid = null)
|
||||
{
|
||||
if ($uid && $uid !== getAuthUID()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$this->load->config('calendar');
|
||||
|
||||
$tz = new DateTimeZone($this->config->item('timezone'));
|
||||
|
||||
|
||||
$start = new DateTime($start_date);
|
||||
$start->setTimezone($tz);
|
||||
|
||||
|
||||
$end = new DateTime($end_date);
|
||||
$end->setTimezone($tz);
|
||||
$end->modify('+1 day -1 second');
|
||||
|
||||
|
||||
$moodle_events = [];
|
||||
|
||||
|
||||
Events::trigger(
|
||||
'moodleCalendarEvents',
|
||||
function & () use (&$moodle_events) {
|
||||
function &() use (&$moodle_events) {
|
||||
return $moodle_events;
|
||||
},
|
||||
[
|
||||
'start_date' => $start->format('c'),
|
||||
'end_date' => $end->format('c'),
|
||||
'username' => getAuthUID()
|
||||
'username' => $uid ?? getAuthUID()
|
||||
]
|
||||
);
|
||||
|
||||
@@ -331,23 +498,23 @@ class LvPlan extends FHCAPI_Controller
|
||||
* @param string $end_date
|
||||
* @return array
|
||||
*/
|
||||
private function fetchFerienEvents($start_date, $end_date)
|
||||
private function fetchFerienEvents($start_date, $end_date, $uid = null)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentLehrverbandModel');
|
||||
|
||||
$currentStudiensemester = $this->StudiensemesterModel->getByDate($start_date);
|
||||
$currentStudiensemester = $this->getDataOrTerminateWithError($currentStudiensemester);
|
||||
|
||||
|
||||
if ($currentStudiensemester) {
|
||||
$studentsemester_kurzbz = current($currentStudiensemester)->studiensemester_kurzbz;
|
||||
|
||||
$studiengang = $this->StudentLehrverbandModel->loadWhere([
|
||||
"student_uid" => getAuthUID(),
|
||||
"student_uid" => $uid ?? getAuthUID(),
|
||||
"studiensemester_kurzbz" => $studentsemester_kurzbz
|
||||
]);
|
||||
$studiengang = $this->getDataOrTerminateWithError($studiengang);
|
||||
|
||||
|
||||
if ($studiengang)
|
||||
$studiengang_kz = current($studiengang)->studiengang_kz;
|
||||
else
|
||||
@@ -357,7 +524,7 @@ class LvPlan extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
$ferienEvents = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $studiengang_kz);
|
||||
|
||||
|
||||
return $this->getDataOrTerminateWithError($ferienEvents);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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 OtherLvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'otherLvPlanViewData' => ['basis/other_lv_plan:r'],
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->library('ProfilLib');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves viewData for other lv plan view
|
||||
* @access public
|
||||
* @param $uid the userID for which the other lv plan is being viewed
|
||||
*/
|
||||
public function otherLvPlanViewData($uid)
|
||||
{
|
||||
$isMitarbeiterResult = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
$isMitarbeiter = getData($isMitarbeiterResult);
|
||||
$isStudent = !$isMitarbeiter;
|
||||
|
||||
$resProfileData = $this->profillib->getView($uid);
|
||||
$profileData = hasData($resProfileData) ? getData($resProfileData) : null;
|
||||
|
||||
$viewData = [
|
||||
"user_data" => [
|
||||
"username" => $uid,
|
||||
"is_student" => $isStudent,
|
||||
"is_mitarbeiter" => $isMitarbeiter,
|
||||
"foto" => $profileData->data->foto,
|
||||
"vorname" => $profileData->data->vorname,
|
||||
"nachname" => $profileData->data->nachname,
|
||||
"titel" => $profileData->data->titel,
|
||||
"postnomen" => $profileData->data->postnomen,
|
||||
],
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ class Phrasen extends FHCAPI_Controller
|
||||
'setLanguage' => self::PERM_ANONYMOUS,
|
||||
'getLanguage' => self::PERM_ANONYMOUS,
|
||||
'getAllLanguages' => self::PERM_ANONYMOUS,
|
||||
'getPhrases' => self::PERM_ANONYMOUS,
|
||||
'getTabulatorPhrases' => self::PERM_ANONYMOUS,
|
||||
]);
|
||||
|
||||
$this->load->helper('hlp_language');
|
||||
@@ -92,4 +94,59 @@ class Phrasen extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($langs);
|
||||
}
|
||||
|
||||
public function getPhrases()
|
||||
{
|
||||
$postParams = $this->getPostJSON();
|
||||
|
||||
$languages = $postParams->languages;
|
||||
if (!$languages || !count($languages)) {
|
||||
$this->load->model('system/Sprache_model', 'sprachenModel');
|
||||
$activeLanguages = $this->sprachenModel->loadWhere(array('content' => true));
|
||||
$activeLanguagesData = $this->getDataOrTerminateWithError($activeLanguages);
|
||||
$languages = array_map(
|
||||
function ($languageData) {
|
||||
return $languageData->sprache;
|
||||
},
|
||||
$activeLanguagesData
|
||||
);
|
||||
}
|
||||
|
||||
$this->load->model('system/Phrase_model', 'phraseModel');
|
||||
$phrasesGroupedByCategory = $postParams->phrasesGroupedByCategory;
|
||||
$result = [];
|
||||
foreach ($languages as $language) {
|
||||
$phrases = $this->phraseModel->getPhrasesByCategoryAndPhrasesAndLanguage($phrasesGroupedByCategory, $language);
|
||||
$result[$language] = $this->getDataOrTerminateWithError($phrases);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getTabulatorPhrases()
|
||||
{
|
||||
$languages = json_decode($this->input->get('languages'));
|
||||
if (!$languages || !count($languages)) {
|
||||
$this->load->model('system/Sprache_model', 'sprachenModel');
|
||||
$activeLanguages = $this->sprachenModel->loadWhere(array('content' => true));
|
||||
$activeLanguagesData = $this->getDataOrTerminateWithError($activeLanguages);
|
||||
$languages = array_map(
|
||||
function ($languageData) {
|
||||
return $languageData->sprache;
|
||||
},
|
||||
$activeLanguagesData
|
||||
);
|
||||
}
|
||||
|
||||
$this->load->model('system/Phrase_model', 'phraseModel');
|
||||
$result = [];
|
||||
foreach ($languages as $language) {
|
||||
$tabulatorPhrases = $this->phraseModel->getPhrasesByCategoryAndLanguage(['tabulator'], $language);
|
||||
$result[$language] = $this->getDataOrTerminateWithError($tabulatorPhrases);
|
||||
}
|
||||
|
||||
header('Pragma: private');
|
||||
header('Cache-Control: private, max-age=' . (60 * 60 * 24 * 30));
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,7 +16,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Profil extends FHCAPI_Controller
|
||||
{
|
||||
@@ -27,13 +28,13 @@ class Profil extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'fotoSperre' => self::PERM_LOGGED,
|
||||
'fotoSperre' => self::PERM_LOGGED,
|
||||
'getGemeinden' => self::PERM_LOGGED,
|
||||
'getAllNationen' => self::PERM_LOGGED,
|
||||
'isMitarbeiter' => self::PERM_LOGGED,
|
||||
'profilViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
@@ -48,28 +49,37 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function profilViewData($uid=null){
|
||||
|
||||
/**
|
||||
* retrieves view data for profile view
|
||||
* @access public
|
||||
* @param $uid the userID for which profile is being viewed, null or missing value implies one's own profile
|
||||
*/
|
||||
public function profilViewData($uid = null)
|
||||
{
|
||||
$authUid = getAuthUID();
|
||||
$isProfilOfAuthUser = !$uid || $uid === $authUid;
|
||||
|
||||
$this->load->library('ProfilLib');
|
||||
$editable = false;
|
||||
if(isset($uid) && $uid != null){
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
if($uid == getAuthUID()){
|
||||
$editable = true;
|
||||
}
|
||||
}else{
|
||||
$editable = true;
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
$profileData = $this->profillib->getView($uid ?? $authUid);
|
||||
$profileData = hasData($profileData) ? getData($profileData) : null;
|
||||
|
||||
$viewData = [
|
||||
'editable' => $isProfilOfAuthUser,
|
||||
'profil_data' => $profileData,
|
||||
'permissions' => [
|
||||
'basis/other_lv_plan' => $this->permissionlib->isBerechtigt(('basis/other_lv_plan'))
|
||||
]
|
||||
];
|
||||
|
||||
if ($isProfilOfAuthUser) {
|
||||
$viewData['calendar_sync_urls'] = $this->getCalendarSyncUrlData();
|
||||
}
|
||||
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>$editable,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* update column foto_sperre in public.tbl_person
|
||||
* @access public
|
||||
* @param boolean $value new value for the column
|
||||
@@ -77,9 +87,9 @@ class Profil extends FHCAPI_Controller
|
||||
*/
|
||||
public function fotoSperre($value)
|
||||
{
|
||||
if(!isset($value)){
|
||||
$this->terminateWithError("Missing parameter", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!isset($value)) {
|
||||
$this->terminateWithError("Missing parameter", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
|
||||
if (isError($res)) {
|
||||
@@ -87,10 +97,10 @@ class Profil extends FHCAPI_Controller
|
||||
}
|
||||
$this->PersonModel->addSelect("foto_sperre");
|
||||
$res = $this->PersonModel->load($this->pid);
|
||||
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
$this->terminateWithSuccess(current($res));
|
||||
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
$this->terminateWithSuccess(current($res));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,7 +119,7 @@ class Profil extends FHCAPI_Controller
|
||||
if (isError($nation_res)) {
|
||||
$this->terminateWithError("error while trying to query table codex.tbl_nation", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$nation_res = $this->getDataOrTerminateWithError($nation_res);
|
||||
|
||||
$this->terminateWithSuccess($nation_res);
|
||||
@@ -117,30 +127,30 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
public function getGemeinden($nation, $zip)
|
||||
{
|
||||
if(!isset($nation) || !isset($zip)){
|
||||
if (!isset($nation) || !isset($zip)) {
|
||||
echo json_encode(error("Missing parameters"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
|
||||
|
||||
|
||||
|
||||
$gemeinde_res = $this->GemeindeModel->getGemeindeByPlz($zip);
|
||||
|
||||
|
||||
if (isError($gemeinde_res)) {
|
||||
$this->terminateWithError(getError($gemeinde_res),self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError(getError($gemeinde_res), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$gemeinde_res = $this->getDataOrTerminateWithError($gemeinde_res);
|
||||
|
||||
|
||||
/* $gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->ortschaftsname;
|
||||
}, $gemeinde_res); */
|
||||
|
||||
$this->terminateWithSuccess($gemeinde_res);
|
||||
|
||||
$this->terminateWithSuccess($gemeinde_res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
@@ -150,23 +160,48 @@ class Profil extends FHCAPI_Controller
|
||||
public function isMitarbeiter($uid)
|
||||
{
|
||||
|
||||
if(!$uid) $this->terminateWithError("No uid provided", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
if (!$uid)
|
||||
$this->terminateWithError("No uid provided", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$result = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError("error when calling Mitarbeiter_model function isMitarbeiter with uid " . $uid, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
/**
|
||||
* gets the identifier, phrase, and url for each calendar sync option
|
||||
* @access private
|
||||
* @return array array of arrays, where each child array is a sync option
|
||||
*/
|
||||
private function getCalendarSyncUrlData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
"identifier" => "cal_dav",
|
||||
"labelPhrase" => "profil/calendar_sync_cal_dav",
|
||||
"url" => APP_ROOT . "webdav/lvplan.php/calendars/" . $this->uid . "/LVPlan-" . $this->uid,
|
||||
],
|
||||
[
|
||||
"identifier" => "cal_dav_principal",
|
||||
"labelPhrase" => "profil/calendar_sync_cal_dav_principal",
|
||||
"url" => APP_ROOT . "webdav/lvplan.php/principals/" . $this->uid,
|
||||
],
|
||||
[
|
||||
"identifier" => "i_cal",
|
||||
"labelPhrase" => "profil/calendar_sync_i_cal",
|
||||
"url" => APP_ROOT . "webdav/google.php?cal=" . encryptData($this->uid, LVPLAN_CYPHER_KEY) . "&" . microtime(true),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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 StgOrgLvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'stgOrgLvPlanViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches view data for stg org lv plan
|
||||
* @access public
|
||||
*/
|
||||
public function stgOrgLvPlanViewData()
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'aktiv' => true
|
||||
]);
|
||||
$studiengaenge = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$viewData = array(
|
||||
'studiengaenge' => $studiengaenge,
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -62,21 +62,36 @@ class Studium extends FHCAPI_Controller
|
||||
|
||||
if($this->getDataOrTerminateWithError($this->StudentModel->isStudent(getAuthUID()))){
|
||||
$studentLehrverband =$this->StudentlehrverbandModel->loadWhere(["student_uid" => getAuthUID(), "studiensemester_kurzbz" => $aktuelles_studiensemester->studiensemester_kurzbz]);
|
||||
$studentLehrverband = current($this->getDataOrTerminateWithError($studentLehrverband));
|
||||
|
||||
$student_studiensemester = $studentLehrverband->studiensemester_kurzbz;
|
||||
$student_studiengang = $studentLehrverband->studiengang_kz;
|
||||
$student_semester = $studentLehrverband->semester;
|
||||
|
||||
//TODO(Manu) check if use Fallback or just comment out all paramschecks?
|
||||
//add Fallback: if no LehrverbandData of actual semester, get Data of previous one
|
||||
if(!hasData($studentLehrverband))
|
||||
{
|
||||
$result= $this->StudiensemesterModel->getPreviousFrom($aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$vorheriges_studiensemester = current($data)->studiensemester_kurzbz;
|
||||
$studentLehrverband =$this->StudentlehrverbandModel->loadWhere(["student_uid" => getAuthUID(), "studiensemester_kurzbz" => $vorheriges_studiensemester]);
|
||||
}
|
||||
$studentLehrverband = current(getData($studentLehrverband));
|
||||
|
||||
$student_studienplan = $this->getStudienPlanFromPrestudentStatus(getAuthPersonId())->studienplan_id;
|
||||
|
||||
if(!isset($parameter_studiensemester))
|
||||
$parameter_studiensemester = $student_studiensemester;
|
||||
if(!isset($parameter_studiengang))
|
||||
$parameter_studiengang = $student_studiengang;
|
||||
if(!isset($parameter_semester))
|
||||
$parameter_semester = $student_semester;
|
||||
if(!isset($parameter_studiensemester)) {
|
||||
$student_studiensemester = $studentLehrverband->studiensemester_kurzbz;
|
||||
$parameter_studiensemester = $student_studiensemester;
|
||||
}
|
||||
if(!isset($parameter_studiengang)) {
|
||||
$student_studiengang = $studentLehrverband->studiengang_kz;
|
||||
$parameter_studiengang = $student_studiengang;
|
||||
}
|
||||
if(!isset($parameter_semester)) {
|
||||
$student_semester = $studentLehrverband->semester;
|
||||
$parameter_semester = $student_semester;
|
||||
}
|
||||
if(!isset($parameter_studienplan))
|
||||
$parameter_studienplan = $student_studienplan;
|
||||
$parameter_studienplan = $student_studienplan;
|
||||
|
||||
}
|
||||
|
||||
if(isset($parameter_studiensemester)){
|
||||
@@ -96,8 +111,7 @@ class Studium extends FHCAPI_Controller
|
||||
|
||||
// fetch studiensemester
|
||||
$allStudienSemester = $this->getDataOrTerminateWithError($this->StudiensemesterModel->load());
|
||||
|
||||
|
||||
|
||||
if(isset($parameter_studiensemester) && !empty(array_filter($allStudienSemester, function($studiensemester) use($parameter_studiensemester){
|
||||
return $studiensemester->studiensemester_kurzbz == $parameter_studiensemester->studiensemester_kurzbz;
|
||||
}))){
|
||||
@@ -153,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;
|
||||
}
|
||||
@@ -216,6 +232,8 @@ class Studium extends FHCAPI_Controller
|
||||
$studienplaene = array_map(function($studienplan){
|
||||
$orgform = current($this->getDataOrTerminateWithError($this->OrgformModel->loadWhere(["orgform_kurzbz" => $studienplan->orgform_kurzbz])));
|
||||
$studienplan->orgform_bezeichnung = $orgform->bezeichnung;
|
||||
// bezeichnung_mehrsprachig
|
||||
$studienplan->orgform_bezeichnung_english = $orgform->bezeichnung_mehrsprachig[1];
|
||||
return $studienplan;
|
||||
},$studienplaene);
|
||||
return $studienplaene;
|
||||
@@ -270,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;
|
||||
@@ -286,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,162 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the PhrasesLib (back-end)
|
||||
* Provides data to the ajax get calls about the Phrasen plugin
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class TabulatorPresets extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTabulatorPresets' => self::PERM_LOGGED,
|
||||
'createTabulatorPreset' => self::PERM_LOGGED,
|
||||
'updateTabulatorPreset' => self::PERM_LOGGED,
|
||||
'deleteTabulatorPreset' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('tabulator/Tabulator_preset_model', 'TabulatorPresetModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'tabulator_presets'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getTabulatorPresets()
|
||||
{
|
||||
$tableName = $this->input->get("tableName");
|
||||
if (!$tableName) {
|
||||
$this->terminateWithError(error($this->p->t("tabulator_presets", "invalid_params_err_msg")));
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$presets = $this->TabulatorPresetModel->getTabulatorPresetsByUserAndTable($uid, $tableName);
|
||||
$presetsData = $this->getDataOrTerminateWithError($presets) ?? [];
|
||||
|
||||
$this->terminateWithSuccess($presetsData);
|
||||
}
|
||||
|
||||
public function createTabulatorPreset()
|
||||
{
|
||||
$tableName = $this->input->post("tableName");
|
||||
$presetName = $this->input->post("presetName");
|
||||
$preset = $this->input->post("preset");
|
||||
|
||||
if (!$tableName || !$presetName || !$preset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "invalid_params_err_msg"), "general", 400);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$existingPresetsResult = $this->TabulatorPresetModel->getTabulatorPresetsByUserAndTable($uid, $tableName);
|
||||
$existingPresets = $this->getDataOrTerminateWithError($existingPresetsResult) ?? [];
|
||||
|
||||
if (count($existingPresets) > 19) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "max_presets_count_err_msg"), "general", 409);
|
||||
}
|
||||
|
||||
$existingPresetNames = array_map(function($presetInfo) {
|
||||
return $presetInfo->preset_name;
|
||||
}, $existingPresets);
|
||||
|
||||
if (in_array($presetName, $existingPresetNames)) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_name_duplicate_err_msg"), "general", 409);
|
||||
}
|
||||
|
||||
$presetCreationResult = $this->TabulatorPresetModel->createTabulatorPreset($uid, $tableName, $presetName, $preset);
|
||||
|
||||
if (isError($presetCreationResult)) {
|
||||
$this->terminateWithError($presetCreationResult->retval);
|
||||
}
|
||||
|
||||
$newPresetData = $this->TabulatorPresetModel->getTabulatorPreset($presetCreationResult->retval);
|
||||
$newPresetArray = $this->getDataOrTerminateWithError($newPresetData) ?? [null];
|
||||
$newPreset = $newPresetArray[0];
|
||||
|
||||
$this->terminateWithSuccess($newPreset);
|
||||
}
|
||||
|
||||
public function updateTabulatorPreset()
|
||||
{
|
||||
$presetId = $this->input->post("presetId");
|
||||
$preset = $this->input->post("preset");
|
||||
|
||||
if (!$presetId || !$preset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "invalid_params_err_msg"), "general", 400);
|
||||
}
|
||||
|
||||
$existingPresetData = $this->TabulatorPresetModel->getTabulatorPreset($presetId);
|
||||
$existingPresetArray = $this->getDataOrTerminateWithError($existingPresetData) ?? [null];
|
||||
$existingPreset = $existingPresetArray[0];
|
||||
if (!$existingPreset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_found_err_msg"), "general", 404);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
if ($existingPreset->benutzer_uid !== $uid) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_own_update_err_msg"), "general", 403);
|
||||
}
|
||||
|
||||
$presetUpdateResult = $this->TabulatorPresetModel->updateTabulatorPreset($presetId, $preset);
|
||||
if (isError($presetUpdateResult)) {
|
||||
$this->terminateWithError($presetUpdateResult->retval);
|
||||
}
|
||||
|
||||
$updatedPresetData = $this->TabulatorPresetModel->getTabulatorPreset($presetId);
|
||||
$updatedPresetArray = $this->getDataOrTerminateWithError($updatedPresetData) ?? [null];
|
||||
$updatedPreset = $updatedPresetArray[0];
|
||||
|
||||
$this->terminateWithSuccess($updatedPreset);
|
||||
}
|
||||
|
||||
public function deleteTabulatorPreset()
|
||||
{
|
||||
$presetId = $this->input->post("presetId");
|
||||
if (!$presetId) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "invalid_params_err_msg"), "general", 400);
|
||||
}
|
||||
|
||||
$presetData = $this->TabulatorPresetModel->getTabulatorPreset($presetId);
|
||||
$presetArray = $this->getDataOrTerminateWithError($presetData) ?? [null];
|
||||
$preset = $presetArray[0];
|
||||
if (!$preset) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_found_err_msg"), "general", 404);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
if ($preset->benutzer_uid !== $uid) {
|
||||
$this->terminateWithError($this->p->t("tabulator_presets", "preset_not_own_delete_err_msg"), "general", 403);
|
||||
}
|
||||
|
||||
$presetDeletionResult = $this->TabulatorPresetModel->deleteTabulatorPreset($presetId);
|
||||
if (isError($presetDeletionResult)) {
|
||||
$this->terminateWithError($presetDeletionResult->retval);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \ReflectionMethod as ReflectionMethod;
|
||||
use \ReflectionFunction as ReflectionFunction;
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about menues
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Treemenu extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// Load Router
|
||||
$router = load_class('Router');
|
||||
|
||||
// Load Config
|
||||
$config = load_class('Config');
|
||||
$config->load('treemenu');
|
||||
|
||||
// Get Treemenu name & config
|
||||
$name = $router->method;
|
||||
$conf = $config->item($name);
|
||||
|
||||
// Get Permissions from config
|
||||
$permissions = $conf['permissions'] ?? self::PERM_ANONYMOUS;
|
||||
|
||||
// Call constructor
|
||||
parent::__construct([
|
||||
$name => $permissions
|
||||
]);
|
||||
|
||||
// Load Library
|
||||
$libraryName = $conf['library'] ?? null;
|
||||
$this->load->library($libraryName, null, 'treemenulib');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
* @param array $params (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if (!$this->treemenulib)
|
||||
show_404();
|
||||
|
||||
$this->addMeta('ci_method', $method);
|
||||
$this->addMeta('ci_params', $params);
|
||||
|
||||
$params = $this->uri->uri_to_assoc(6); // 6 = start of $params
|
||||
$config = $this->treemenulib->config;
|
||||
|
||||
foreach (array_keys($params) as $key) {
|
||||
if (!isset($config[$key]) || !$config[$key])
|
||||
show_404();
|
||||
|
||||
$config = $config[$key];
|
||||
}
|
||||
|
||||
// Prepare aliases
|
||||
$argumentaliases = [];
|
||||
if (property_exists($this->treemenulib, 'path_to_argument'))
|
||||
$argumentaliases = array_flip($this->treemenulib->path_to_argument);
|
||||
$methodaliases = [];
|
||||
if (property_exists($this->treemenulib, 'redirect_method'))
|
||||
$methodaliases = $this->treemenulib->redirect_method;
|
||||
|
||||
$items = [];
|
||||
foreach ($config as $uripart => $children) {
|
||||
if (!is_array($children)) {
|
||||
$uripart = $children;
|
||||
$children = [];
|
||||
}
|
||||
|
||||
$methodName = $uripart;
|
||||
if (isset($methodaliases[$methodName])) {
|
||||
$methodName = $methodaliases[$methodName];
|
||||
} elseif (strpbrk($methodName, ' _-') !== false) {
|
||||
$methodName = lcfirst(str_replace([' ', '_', '-'], '', ucwords($methodName, " \t\r\n\f\v_-")));
|
||||
}
|
||||
|
||||
// Prepare arguments
|
||||
if (is_callable($methodName, false, $name)) {
|
||||
if (is_string($methodName) && is_callable([$this->treemenulib, $methodName]))
|
||||
$callable = [$this->treemenulib, $methodName];
|
||||
else
|
||||
$callable = $methodName;
|
||||
} else {
|
||||
$callable = [$this->treemenulib, $methodName];
|
||||
}
|
||||
|
||||
if (is_array($callable))
|
||||
$reflection = new ReflectionMethod($callable[0], $callable[1]);
|
||||
elseif (is_string($callable) && strstr($callable, '::'))
|
||||
$reflection = new ReflectionMethod($callable);
|
||||
elseif ($name != 'Closure::__invoke' && strstr($name, '::__invoke'))
|
||||
$reflection = new ReflectionMethod($callable, '__invoke');
|
||||
else
|
||||
$reflection = new ReflectionFunction($callable);
|
||||
|
||||
$arguments = [];
|
||||
foreach ($reflection->getParameters() as $arg) {
|
||||
if ($arg->name == 'path_template') {
|
||||
$path = $params;
|
||||
$path[$uripart] = '%s';
|
||||
$arguments[] = $this->uri->assoc_to_uri($path);
|
||||
} elseif ($arg->name == 'has_children') {
|
||||
$arguments[] = $children;
|
||||
} elseif ($arg->name == 'original_method') {
|
||||
$arguments[] = $uripart;
|
||||
} elseif (isset($argumentaliases[$arg->name]) && isset($params[$argumentaliases[$arg->name]])) {
|
||||
$arguments[] = $params[$argumentaliases[$arg->name]];
|
||||
} elseif (isset($params[$arg->name])) {
|
||||
$arguments[] = $params[$arg->name];
|
||||
} else {
|
||||
$arguments[] = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Call function from lib
|
||||
$items = array_merge($items, call_user_func_array($callable, $arguments));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($items);
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ class BetriebsmittelP extends FHCAPI_Controller
|
||||
$kaution = $this->input->post('kaution');
|
||||
if($kaution) $kaution = str_replace(',', '.', $kaution);
|
||||
$ausgegebenam = $this->input->post('ausgegebenam');
|
||||
$retouram = $this->input->post('retouram');
|
||||
$retouram = $this->input->post('retouram') == "" ? null : $this->input->post('retouram');
|
||||
|
||||
// NOTE(chris): transform_kartennummer
|
||||
if ($betriebsmitteltyp == 'Zutrittskarte' && $nummer)
|
||||
|
||||
@@ -40,11 +40,32 @@ class Board extends FHCAPI_Controller
|
||||
|
||||
public function list()
|
||||
{
|
||||
$this->DashboardModel->addSelect('dashboard_id');
|
||||
$this->DashboardModel->addSelect('dashboard_kurzbz');
|
||||
$this->DashboardModel->addSelect('tbl_dashboard.beschreibung');
|
||||
$this->DashboardModel->addSelect("(
|
||||
SELECT json_agg(w.*)
|
||||
FROM dashboard.tbl_widget w
|
||||
JOIN dashboard.tbl_dashboard_widget dw
|
||||
USING(widget_id)
|
||||
WHERE dw.dashboard_id=tbl_dashboard.dashboard_id
|
||||
) AS \"widgetSetup\"");
|
||||
|
||||
$result = $this->DashboardModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
$data = array_map(function ($dashboard) {
|
||||
$tmpSetups = json_decode($dashboard->widgetSetup);
|
||||
$tmpSetups = array_map(function ($widget) {
|
||||
$widget->setup->file = absoluteJsImportUrl($widget->setup->file);
|
||||
return $widget;
|
||||
}, $tmpSetups);
|
||||
$dashboard->widgetSetup = $tmpSetups;
|
||||
return $dashboard;
|
||||
}, $data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
@@ -82,7 +103,7 @@ class Board extends FHCAPI_Controller
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
@@ -116,6 +137,6 @@ class Board extends FHCAPI_Controller
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,10 +120,7 @@ class Preset extends FHCAPI_Controller
|
||||
$conf = $this->dashboardlib->getPreset($db, $funktion);
|
||||
if ($conf) {
|
||||
$preset = json_decode($conf->preset, true);
|
||||
if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets']))
|
||||
$result[$funktion] = [];
|
||||
else
|
||||
$result[$funktion] = $preset[$funktion]['widgets'];
|
||||
$result[$funktion] = $preset;
|
||||
} else {
|
||||
$result[$funktion] = [];
|
||||
}
|
||||
@@ -154,7 +151,7 @@ class Preset extends FHCAPI_Controller
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
$this->dashboardlib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, [$widget]);
|
||||
$preset_decoded[$widget['widgetid']] = $widget;
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
@@ -186,8 +183,10 @@ class Preset extends FHCAPI_Controller
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
if (!$this->dashboardlib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid))
|
||||
if (!isset($preset_decoded[$widgetid]))
|
||||
show_404();
|
||||
|
||||
unset($preset_decoded[$widgetid]);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
|
||||
@@ -48,25 +48,9 @@ class User extends FHCAPI_Controller
|
||||
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
/*$mergedconfig = $this->dashboardlib->getMergedConfig($dashboard->dashboard_id, $uid);
|
||||
$mergedconfig = $this->dashboardlib->getMergedUserConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'general' => call_user_func_array(
|
||||
'array_merge_recursive',
|
||||
$mergedconfig
|
||||
)
|
||||
]);*/
|
||||
$defaultconfig = $this->dashboardlib->getDefaultConfig($dashboard->dashboard_id);
|
||||
$userconfig = $this->dashboardlib->getUserConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$defaultconfig_squashed = $defaultconfig ? call_user_func_array('array_replace_recursive', $defaultconfig) : [];
|
||||
$userconfig_squashed = $userconfig ? call_user_func_array('array_replace_recursive', $userconfig) : [];
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig_squashed, $userconfig_squashed);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
DashboardLib::SECTION_IF_FUNKTION_KURZBZ_IS_NULL => $mergedconfig
|
||||
]);
|
||||
$this->terminateWithSuccess($mergedconfig);
|
||||
}
|
||||
|
||||
public function addWidget()
|
||||
@@ -86,26 +70,15 @@ class User extends FHCAPI_Controller
|
||||
if (!isset($widget['widgetid']))
|
||||
$widget['widgetid'] = $this->dashboardlib->generateWidgetId($dashboard_kurzbz);
|
||||
|
||||
if (isset($widget['source']))
|
||||
unset($widget['source']);
|
||||
|
||||
$override = $this->dashboardlib->getOverrideOrCreateEmptyOverride($dashboard_kurzbz, $uid);
|
||||
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
if (!isset($override_decoded['general']) || !is_array($override_decoded['general']))
|
||||
$override_decoded['general'] = [];
|
||||
$override_decoded[$widget['widgetid']] = $widget;
|
||||
|
||||
if (!isset($override_decoded['general']['widgets']))
|
||||
$override_decoded['general']['widgets'] = [];
|
||||
|
||||
$override_decoded['general']['widgets'][$widget['widgetid']] = $widget;
|
||||
|
||||
// NOTE(chris): remove doubles in other funktionen
|
||||
foreach ($override_decoded as $funktion => $array) {
|
||||
if ($funktion == 'general')
|
||||
continue;
|
||||
if (isset($array['widgets']) && isset($array['widgets'][$widget['widgetid']]))
|
||||
unset($override_decoded[$funktion]['widgets'][$widget['widgetid']]);
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdateOverride($override);
|
||||
@@ -135,18 +108,10 @@ class User extends FHCAPI_Controller
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
foreach (array_keys($override_decoded) as $k) {
|
||||
if (!isset($override_decoded[$k]["widgets"])) {
|
||||
unset($override_decoded[$k]);
|
||||
continue;
|
||||
}
|
||||
if (isset($override_decoded[$k]["widgets"][$widget_id])) {
|
||||
unset($override_decoded[$k]["widgets"][$widget_id]);
|
||||
}
|
||||
if (!$override_decoded[$k]["widgets"]) {
|
||||
unset($override_decoded[$k]);
|
||||
}
|
||||
}
|
||||
if (!isset($override_decoded[$widget_id]))
|
||||
show_404();
|
||||
|
||||
unset($override_decoded[$widget_id]);
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@ class Detailheader extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getHeader' => ['vertrag/mitarbeiter:r'],
|
||||
'getPersonAbteilung' => ['vertrag/mitarbeiter:r'],
|
||||
'getLeitungOrg' => ['vertrag/mitarbeiter:r'],
|
||||
'getHeader' => ['vertrag/mitarbeiter:r', 'basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getPersonAbteilung' => ['vertrag/mitarbeiter:r', 'basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getLeitungOrg' => ['vertrag/mitarbeiter:r', 'basis/mitarbeiter:r', 'admin:r', 'assistenz:r'],
|
||||
'getSemesterStati' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -48,6 +49,17 @@ class Detailheader extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function getSemesterStati($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$result = $this->PrestudentstatusModel->getAllPrestudentstatiWithStudiensemester($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -294,6 +294,10 @@ class Funktionen extends FHCAPI_Controller
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
if($datum_von == '')
|
||||
$datum_von = null;
|
||||
if($datum_bis == '')
|
||||
$datum_bis = null;
|
||||
|
||||
$result = $this->BenutzerfunktionModel->update(
|
||||
[
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Config extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'set' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
]);
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get()
|
||||
{
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$ignore_kollision = $this->_ci->variablelib->getVar('ignore_kollision');
|
||||
$ignore_zeitsperre = $this->_ci->variablelib->getVar('ignore_zeitsperre');
|
||||
$ignore_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung');
|
||||
|
||||
$config['ignore_kollision'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_kollision',
|
||||
"value" => $ignore_kollision,
|
||||
];
|
||||
|
||||
$config['ignore_zeitsperre'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_zeitsperre',
|
||||
"value" => $ignore_zeitsperre,
|
||||
];
|
||||
|
||||
$config['ignore_reservierung'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_reservierung',
|
||||
"value" => $ignore_reservierung,
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
public function set()
|
||||
{
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
foreach (['ignore_kollision','ignore_zeitsperre','ignore_reservierung'] as $variable)
|
||||
{
|
||||
if ($this->_ci->input->post($variable) !== null)
|
||||
{
|
||||
$this->VariableModel->update(array('uid' => $this->_uid, 'name' => $variable), array('wert' => $this->input->post($variable)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Favorites extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['lv_favorites']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithSuccess(null);
|
||||
else
|
||||
$this->terminateWithSuccess(isset($data['lv_favorites']) ? $data['lv_favorites'] : null);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('favorites', 'Favorites', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$favorites = $this->input->post('favorites');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'lv_favorites', $favorites);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ class Gruppe extends FHCAPI_Controller
|
||||
'getBenutzerSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getAllSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getByLehreinheit' => ['admin:r', 'assistenz:r'],
|
||||
'getGruppe' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
@@ -67,7 +68,7 @@ class Gruppe extends FHCAPI_Controller
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, !($lehrverband === 'false'));
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, $lehrverband === true || $lehrverband === 'true');
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
@@ -75,6 +76,71 @@ class Gruppe extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getGruppe()
|
||||
{
|
||||
$lehrverband = $this->input->post('lehrverband');
|
||||
|
||||
$gruppen_result = array();
|
||||
|
||||
if ($lehrverband === false)
|
||||
{
|
||||
$gruppen_result = $this->_ci->GruppeModel->loadWhere(array(
|
||||
'studiengang_kz' => $this->input->post('stg_kz'),
|
||||
'gruppe_kurzbz' => $this->input->post('gruppe_kurzbz'),
|
||||
'aktiv' => true
|
||||
));
|
||||
}
|
||||
else if ($lehrverband === true)
|
||||
{
|
||||
|
||||
if (!isEmptyString($this->input->post('verband')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('verband', $this->input->post('verband'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("trim(verband) = ''");
|
||||
$this->LehrverbandModel->db->or_where("verband IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
if (!isEmptyString($this->input->post('gruppe')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('gruppe', $this->input->post('gruppe'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("trim(gruppe) = ''");
|
||||
$this->LehrverbandModel->db->or_where("gruppe IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
if (!isEmptyString((string)$this->input->post('semester')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('semester', $this->input->post('semester'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("semester = ''");
|
||||
$this->LehrverbandModel->db->or_where("semester IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
$gruppen_result = $this->LehrverbandModel->loadWhere(array('studiengang_kz' => $this->input->post('stg_kz'), 'aktiv' => true));
|
||||
}
|
||||
|
||||
if (!hasData($gruppen_result))
|
||||
return $this->terminateWithError('No group found');
|
||||
|
||||
$gruppen_array = getData($gruppen_result)[0];
|
||||
|
||||
$this->terminateWithSuccess($gruppen_array->gid);
|
||||
}
|
||||
|
||||
public function getByLehreinheit($lehreinheit_id = null)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
|
||||
@@ -134,9 +134,14 @@ class Lektor extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if (isset($formData['semesterstunden']) && (!is_numeric($formData['semesterstunden']) || $formData['semesterstunden'] === ''))
|
||||
$nullable_fields = array('semesterstunden', 'stundensatz', 'planstunden');
|
||||
|
||||
foreach ($nullable_fields as $nullable_field)
|
||||
{
|
||||
$formData['semesterstunden'] = null;
|
||||
if (isset($formData[$nullable_field]) && (!is_numeric($formData[$nullable_field]) || $formData[$nullable_field] === ''))
|
||||
{
|
||||
$formData[$nullable_field] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
|
||||
@@ -144,6 +149,9 @@ class Lektor extends FHCAPI_Controller
|
||||
if (!$lehreinheit_permission)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
if (!is_null($this->getLektorVertrag($lehreinheit_id, $mitarbeiter_uid)) && (array_key_exists('mitarbeiter_uid', $formData) && $mitarbeiter_uid !== $formData['mitarbeiter_uid']))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
$result = $this->_ci->lektorlib->updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $formData);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result));
|
||||
@@ -154,7 +162,7 @@ class Lektor extends FHCAPI_Controller
|
||||
{
|
||||
$value = str_replace(',', '.', $value);
|
||||
|
||||
if (!is_numeric($value))
|
||||
if (!is_numeric($value) && $value !== "")
|
||||
{
|
||||
$this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss eine Zahl sein.');
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Noten extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getCertificate' => 'student/noten:r',
|
||||
'getTeacherProposal' => 'student/noten:r',
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'stv',
|
||||
'person',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getCertificate($lv_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($lv_id) || !ctype_digit((string)$lv_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere([
|
||||
'lehrveranstaltung_id' => $lv_id
|
||||
]);
|
||||
|
||||
$lehrveranstaltung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$lehrveranstaltung)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->ZeugnisnoteModel->getZeugnisnoten(null, $studiensemester_kurzbz, $lehrveranstaltung[0]->lehrveranstaltung_id);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
public function getTeacherProposal($lv_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($lv_id) || !ctype_digit((string)$lv_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere([
|
||||
'lehrveranstaltung_id' => $lv_id
|
||||
]);
|
||||
|
||||
$lehrveranstaltung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$lehrveranstaltung)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, null, $studiensemester_kurzbz);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,8 @@
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class Setup extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
@@ -27,7 +29,8 @@ class Setup extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getLETabs' => ['admin:r', 'assistenz:r'],
|
||||
'getLVTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
@@ -41,9 +44,10 @@ class Setup extends FHCAPI_Controller
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->helper('hlp_document');
|
||||
}
|
||||
|
||||
public function getTabs()
|
||||
public function getLETabs()
|
||||
{
|
||||
$tabs['details'] = array (
|
||||
'title' => 'Details',
|
||||
@@ -60,11 +64,43 @@ class Setup extends FHCAPI_Controller
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Lektor.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['termine'] = array (
|
||||
'title' => 'Termine',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Termine.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['notiz'] = array (
|
||||
'title' => 'Notizen',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Notiz.js'),
|
||||
'config' => []
|
||||
);
|
||||
|
||||
Events::trigger('lvv_conf_tabs', function & () use (&$tabs) {
|
||||
return $tabs;
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
public function getLVTabs()
|
||||
{
|
||||
$tabs['termine'] = array (
|
||||
'title' => 'Termine',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/LVTermine.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['noten'] = array (
|
||||
'title' => 'Noten',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Noten.js'),
|
||||
'config' => [
|
||||
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
|
||||
'edit' => 'both', // Possible values: both|header|inline
|
||||
'delete' => 'inline', // Possible values: both|header|inline
|
||||
'documents' => 'inline', // Possible values: both|header|inline
|
||||
'documentslist' => gradesDocumentsList(),
|
||||
'semesterSelect' => false
|
||||
]
|
||||
);
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class StgTree extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if ($method == '' || $method == 'index')
|
||||
return $this->getBase();
|
||||
|
||||
if (!$this->permissionlib->isBerechtigt('assistenz', 's', $method)
|
||||
&& !$this->permissionlib->isBerechtigt('admin', 's', $method)
|
||||
) {
|
||||
return $this->_outputAuthError([$method => ['admin:r', 'assistenz:r']]);
|
||||
}
|
||||
|
||||
return $this->getStudiengang($method);
|
||||
show_404();
|
||||
}
|
||||
|
||||
protected function getBase()
|
||||
{
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("v.studiengang_kz AS link");
|
||||
$this->StudiengangModel->addSelect(
|
||||
"CONCAT(kurzbzlang, ' (', UPPER(CONCAT(typ, kurzbz)), ') - ', tbl_studiengang.bezeichnung) AS name",
|
||||
false
|
||||
);
|
||||
$this->StudiengangModel->addSelect('erhalter_kz');
|
||||
$this->StudiengangModel->addSelect('typ');
|
||||
$this->StudiengangModel->addSelect('kurzbz');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz AS stg_kz');
|
||||
|
||||
$this->StudiengangModel->addOrder('erhalter_kz');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
|
||||
$stgs = $this->permissionlib->getSTG_isEntitledFor('admin') ?: [];
|
||||
$stgs = array_merge($stgs, $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []);
|
||||
|
||||
if (!$stgs)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $stgs);
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(['v.aktiv' => true]);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
protected function getStudiengang($studiengang_kz)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester ORDER BY verband, gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('semester');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('semester');
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.aktiv' => true
|
||||
]);
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
if ($result)
|
||||
{
|
||||
if (current($result)->mischform)
|
||||
{
|
||||
$this->load->model('organisation/Studienordnung_model', 'StudienordnungModel');
|
||||
|
||||
$this->StudienordnungModel->addDistinct();
|
||||
$this->StudienordnungModel->addSelect("CONCAT(studiengang_kz, '/', p.orgform_kurzbz) AS link");
|
||||
$this->StudienordnungModel->addSelect("p.orgform_kurzbz AS name");
|
||||
$this->StudienordnungModel->addSelect("TRUE as leaf", false);
|
||||
|
||||
$this->StudienordnungModel->addJoin('lehre.tbl_studienplan p', 'studienordnung_id');
|
||||
|
||||
$result = $this->StudienordnungModel->loadWhere([
|
||||
'aktiv' => true,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'p.orgform_kurzbz !=' => 'DDP'
|
||||
]);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$list = array_merge($list, $result);
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,9 @@ class Studiensemester extends FHCAPI_Controller
|
||||
'getAll' => self::PERM_LOGGED,
|
||||
'getAktNext' => self::PERM_LOGGED,
|
||||
'getStudienjahrByStudiensemester' => self::PERM_LOGGED,
|
||||
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED
|
||||
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED,
|
||||
'current' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
)
|
||||
);
|
||||
// Load model StudiensemesterModel
|
||||
@@ -166,4 +168,39 @@ class Studiensemester extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess(array($studiensemester, $aktuell));
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
$this->terminateWithError('Kein Studiensemester aktiv');
|
||||
if (count($data) > 1)
|
||||
$this->terminateWithError('Mehrere Studiensemester aktiv');
|
||||
|
||||
$this->terminateWithSuccess(current($data)->studiensemester_kurzbz);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$stdsem = $this->input->post('studiensemester_kurzbz');
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'semester_aktuell', $stdsem);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,12 +246,12 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
{
|
||||
$searchString = $this->input->get('searchString') ?? '';
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString, 'ohneMaUid');
|
||||
$result = $this->PersonModel->searchPerson($searchString, 'mitMaUid');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
@@ -371,6 +371,9 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$datum = $formData['datum'] == '' ? null : $formData['datum'];
|
||||
$sponsion = $formData['sponsion'] == '' ? null : $formData['sponsion'];
|
||||
|
||||
$result = $this->AbschlusspruefungModel->update(
|
||||
[
|
||||
'abschlusspruefung_id' => $abschlusspruefung_id
|
||||
@@ -382,8 +385,8 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
'vorsitz' => $vorsitz,
|
||||
'pruefungsantritt_kurzbz' => $formData['pruefungsantritt_kurzbz'],
|
||||
'abschlussbeurteilung_kurzbz' => $formData['abschlussbeurteilung_kurzbz'],
|
||||
'datum' => $formData['datum'],
|
||||
'sponsion' => $formData['sponsion'],
|
||||
'datum' => $datum,
|
||||
'sponsion' => $sponsion,
|
||||
'pruefer1' => $pruefer1,
|
||||
'pruefer2' => $pruefer2,
|
||||
'pruefer3' => $pruefer3,
|
||||
|
||||
@@ -301,6 +301,7 @@ class Config extends FHCAPI_Controller
|
||||
|
||||
public function student()
|
||||
{
|
||||
$this->load->helper('hlp_document');
|
||||
$result = [];
|
||||
$config = $this->config->item('tabs');
|
||||
|
||||
@@ -376,9 +377,9 @@ class Config extends FHCAPI_Controller
|
||||
'config' => [
|
||||
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
|
||||
'edit' => 'both', // Possible values: both|header|inline
|
||||
'delete' => 'both', // Possible values: both|header|inline
|
||||
'documents' => 'both', // Possible values: both|header|inline
|
||||
'documentslist' => $this->gradesDocumentsList()
|
||||
'delete' => 'inline', // Possible values: both|header|inline
|
||||
'documents' => 'inline', // Possible values: both|header|inline
|
||||
'documentslist' => gradesDocumentsList()
|
||||
]
|
||||
];
|
||||
|
||||
@@ -622,188 +623,6 @@ class Config extends FHCAPI_Controller
|
||||
] + $this->kontoColumns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to generate the default documentslist config for the
|
||||
* grades tab.
|
||||
*
|
||||
* The resulting array consists of elements which are associative arrays
|
||||
* that can have the following entries:
|
||||
* title (required) on the first level this can be HTML code.
|
||||
* permissioncheck (optional) an URL to an FHCAPI endpoint which returns
|
||||
* true or false.
|
||||
* link (optional) an URL that will be called if "action" and
|
||||
* "children" are not defined.
|
||||
* action (optional) an associative array that describes an
|
||||
* POST action that will be called if "children" is
|
||||
* not defined.
|
||||
* It can have the following entries:
|
||||
* - url (required) an URL to an FHCAPI endpoint.
|
||||
* - post (optional) an associative array with the POST data to
|
||||
* be sent.
|
||||
* - response (optional) a string that will be displayed on success.
|
||||
* children (optional) an array of child elements
|
||||
*
|
||||
* All strings that start with { and end with } in the URLs and the
|
||||
* actions post parameter will be replaced with the corresponding
|
||||
* attribute of the current dataset (e.G: {uid} will be replaced with the
|
||||
* uid of the current dataset)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function gradesDocumentsList()
|
||||
{
|
||||
$permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
|
||||
|
||||
$title_ger = $this->p->t("global", "deutsch");
|
||||
$title_eng = $this->p->t("global", "englisch");
|
||||
$title_ff = $this->p->t("stv", "document_certificate");
|
||||
$title_lv = $this->p->t("stv", "document_coursecertificate");
|
||||
|
||||
$link_ff = "documents/export/" .
|
||||
"zertifikat.rdf.php/" .
|
||||
"Zertifikat" .
|
||||
"?stg_kz={studiengang_kz_lv}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_ger = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnis" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_eng = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnisEng" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
|
||||
$archive_url = "api/frontend/v1/documents/archiveSigned";
|
||||
$archive_response = $this->p->t("stv", "document_signed_and_archived");
|
||||
$archive_post_ff = [
|
||||
"xml" => "zertifikat.rdf.php",
|
||||
"xsl" => "Zertifikat",
|
||||
"stg_kz" => "{studiengang_kz_lv}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_ger = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnis",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_eng = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnisEng",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
|
||||
$list = [
|
||||
[
|
||||
'title' => '<i class="fa fa-download" title="' . $this->p->t("stv", "document_download") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'link' => site_url($link_ff)
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'link' => site_url($link_lv_ger),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=odt")
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'link' => site_url($link_lv_eng),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=odt")
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => '<i class="fas fa-archive" title="' . $this->p->t("stv", "document_archive") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_ff,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_ger,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_eng,
|
||||
'response' => $archive_response
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort tab list
|
||||
*
|
||||
|
||||
@@ -170,6 +170,8 @@ class Dokumente extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$nachgereicht_am = $this->input->post('nachgereicht_am') == '' ? null : $this->input->post('nachgereicht_am');
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->AkteModel->update(
|
||||
@@ -180,7 +182,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
'dokument_kurzbz' => $this->input->post('dokument_kurzbz'),
|
||||
'anmerkung_intern' => $this->input->post('anmerkung_intern'),
|
||||
'titel_intern' => $this->input->post('titel_intern'),
|
||||
'nachgereicht_am' => $this->input->post('nachgereicht_am'),
|
||||
'nachgereicht_am' => $nachgereicht_am,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $uid,
|
||||
]
|
||||
|
||||
@@ -429,9 +429,12 @@ class Konto extends FHCAPI_Controller
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID()
|
||||
];
|
||||
|
||||
foreach ($allowed as $field)
|
||||
if ($this->input->post($field) !== null)
|
||||
$data[$field] = $this->input->post($field);
|
||||
if($data['buchungsdatum'] == '')
|
||||
$data['buchungsdatum'] = null;
|
||||
|
||||
$result = $this->KontoModel->update($id, $data);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class LvTermine extends FHCAPI_Controller
|
||||
|
||||
//TODO Build own lib or combine with Controller Stundenplan.php
|
||||
//here use of logic of Stundenplan.php, extended with parameters uid, grouping, and used dbTable
|
||||
public function getStundenplan($uid, $start_date = null, $end_date = null, $groupConsecutiveHours = false, $dbStundenplanTable = "stundenplan")
|
||||
public function getStundenplan($uid, $start_date = null, $end_date = null, $dbStundenplanTable = "stundenplan", $groupConsecutiveHours = false)
|
||||
{
|
||||
$student_uid = $uid;
|
||||
$semester_range = $this->studienSemesterErmitteln($start_date, $end_date);
|
||||
@@ -80,13 +80,6 @@ class LvTermine extends FHCAPI_Controller
|
||||
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
|
||||
$this->returnObj['$stundenplan_query'] = $stundenplan_query;
|
||||
$this->returnObj['$student_lehrverband'] = $student_lehrverband;
|
||||
$this->returnObj['$benutzer_gruppen'] = $benutzer_gruppen;
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
@@ -377,6 +370,7 @@ class LvTermine extends FHCAPI_Controller
|
||||
$result->semester = $item->semester;
|
||||
$result->verband = $item->verband;
|
||||
$result->gruppe = $item->gruppe;
|
||||
$result->studiensemester_kurzbz = $item->studiensemester_kurzbz;
|
||||
return $result;
|
||||
},
|
||||
$lehrverband_query_result));
|
||||
|
||||
@@ -237,8 +237,8 @@ class Mobility extends FHCAPI_Controller
|
||||
}
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$von = $formData['von'] ?? null;
|
||||
$bis = $formData['bis'] ?? null;
|
||||
$von = ($formData['von'] ?? '') ?: null;
|
||||
$bis = ($formData['bis'] ?? '') ?: null;
|
||||
$nation_code = $formData['nation_code'] ?? null;
|
||||
$mobilitaetsprogramm_code = $formData['mobilitaetsprogramm_code'] ?? null;
|
||||
$herkunftsland_code = $formData['herkunftsland_code'] ?? null;
|
||||
|
||||
@@ -193,7 +193,7 @@ class Prestudent extends FHCAPI_Controller
|
||||
}
|
||||
elseif (
|
||||
$val === ''
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode'])
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode', 'zgvdatum', 'zgvmadatum'])
|
||||
)
|
||||
{
|
||||
$val = null;
|
||||
|
||||
@@ -42,6 +42,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->load->model('education/Note_model', 'NoteModel');
|
||||
$this->load->model('education/Projektbetreuer_model', 'BetreuerModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
// load libraries
|
||||
$this->load->library('PermissionLib');
|
||||
@@ -90,21 +92,27 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
|
||||
if (!isset($projektarbeit_id) || !is_numeric($projektarbeit_id)) return $this->terminateWithError('Projektarbeit Id missing', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$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'
|
||||
);
|
||||
$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');
|
||||
$result = $this->ProjektarbeitModel->loadWhere(
|
||||
array('projektarbeit_id' => $projektarbeit_id)
|
||||
);
|
||||
$result = $this->fetchProjektarbeitByID($projektarbeit_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
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,
|
||||
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_lehrveranstaltung lv', 'lehrveranstaltung_id');
|
||||
$this->ProjektarbeitModel->addJoin('public.tbl_firma fa', 'firma_id', 'LEFT');
|
||||
|
||||
|
||||
return $this->ProjektarbeitModel->loadWhere(
|
||||
array('projektarbeit_id' => $projektarbeit_id)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inwert a Projektarbeit.
|
||||
@@ -132,7 +140,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($this->fetchProjektarbeitById($data));
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -239,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)
|
||||
{
|
||||
@@ -280,10 +313,7 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
*/
|
||||
public function getNoten()
|
||||
{
|
||||
$this->NoteModel->addOrder('notenwert', 'ASC');
|
||||
$this->NoteModel->addOrder('bezeichnung', 'ASC');
|
||||
|
||||
$result = $this->NoteModel->load();
|
||||
$result = $this->NoteModel->getAllActive();
|
||||
|
||||
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
@@ -316,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'])
|
||||
]);
|
||||
@@ -350,6 +387,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
'projekttyp_kurzbz' => $formData['projekttyp_kurzbz'],
|
||||
'firma_id' => $formData['firma_id'] ?? null,
|
||||
'lehreinheit_id' => $formData['lehreinheit_id'],
|
||||
'lehrveranstaltung_id' => $formData['lehrveranstaltung_id'],
|
||||
'studiensemester_kurzbz' => $formData['studiensemester_kurzbz'],
|
||||
'beginn' => isset($formData['beginn']) && !isEmptyString($formData['beginn']) ? $formData['beginn'] : null,
|
||||
'ende' => isset($formData['ende']) && !isEmptyString($formData['ende']) ? $formData['ende'] : null,
|
||||
'note' => $formData['note'] ?? null,
|
||||
|
||||
@@ -448,8 +448,10 @@ class Pruefung extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$datum = $this->input->post('datum') == '' ? null : $this->input->post('datum');
|
||||
if(intval($pruefung_id) > 0)
|
||||
{
|
||||
|
||||
$result = $this->PruefungModel->update(
|
||||
[
|
||||
'pruefung_id' => $pruefung_id
|
||||
@@ -459,7 +461,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
|
||||
'note' => $this->input->post('note'),
|
||||
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
|
||||
'datum' => $this->input->post('datum'),
|
||||
'datum' => $datum,
|
||||
'anmerkung' => $this->input->post('anmerkung'),
|
||||
'updatevon' => $authUID,
|
||||
'updateamum' => date('c'),
|
||||
@@ -472,7 +474,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'lehreinheit_id' => $this->input->post('lehreinheit_id'),
|
||||
'student_uid' => $this->input->post('student_uid'),
|
||||
'mitarbeiter_uid' => $this->input->post('mitarbeiter_uid'),
|
||||
'datum' => $this->input->post('datum'),
|
||||
'datum' => $datum,
|
||||
'pruefungstyp_kurzbz' => $this->input->post('pruefungstyp_kurzbz'),
|
||||
'note' => $this->input->post('note'),
|
||||
'anmerkung' => $this->input->post('anmerkung'),
|
||||
@@ -520,7 +522,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'note' => $this->input->post('note'),
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $this->input->post('datum'),
|
||||
'benotungsdatum' => $datum,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID,
|
||||
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
|
||||
@@ -555,7 +557,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
], [
|
||||
'note' => $this->input->post('note'),
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $this->input->post('datum'),
|
||||
'benotungsdatum' => $datum,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $authUID,
|
||||
'punkte' => $this->input->post('punkte') ? str_replace(',', '.', $this->input->post('punkte')) : null
|
||||
|
||||
@@ -144,6 +144,7 @@ class Student extends FHCAPI_Controller
|
||||
. $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
. ") AS statusofsemester"
|
||||
);
|
||||
$this->PrestudentModel->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 'student_uid = uid', 'LEFT');
|
||||
@@ -296,6 +297,10 @@ class Student extends FHCAPI_Controller
|
||||
$fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val);
|
||||
$update_person[$prop] = $fotoval;
|
||||
}
|
||||
else if ($prop == 'gebdatum')
|
||||
{
|
||||
$update_person[$prop] = ($val == '') ? null : $val;
|
||||
}
|
||||
else
|
||||
{
|
||||
$update_person[$prop] = $val;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,9 @@ class Tags extends Tag_Controller
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
]);
|
||||
|
||||
$this->config->load('stv');
|
||||
@@ -45,4 +47,5 @@ class Tags extends Tag_Controller
|
||||
{
|
||||
parent::doneTag($this->config->item('stv_prestudent_tags'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,513 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about verbände
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Verband extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
// Load Models
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remap calls:
|
||||
* /
|
||||
* /(studiengang_kz) => getStudiengang
|
||||
* /(studiengang_kz)/(semester) => getSemester
|
||||
* /(studiengang_kz)/(semester)/(verband) => getVerband
|
||||
* /(studiengang_kz)/(org_form) => getStudiengang
|
||||
* /(studiengang_kz)/(org_form)/(semester) => getSemester
|
||||
* /(studiengang_kz)/(org_form)/(semester)/(verband) => getVerband
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $params (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if ($method == '' || $method == 'index')
|
||||
return $this->getBase();
|
||||
|
||||
// NOTE(chris): Test if access is allowed ($method is the Studiengang)
|
||||
if (!$this->permissionlib->isBerechtigt('assistenz', 's', $method)
|
||||
&& !$this->permissionlib->isBerechtigt('admin', 's', $method)
|
||||
) {
|
||||
return $this->_outputAuthError([$method => ['admin:r', 'assistenz:r']]);
|
||||
}
|
||||
|
||||
$count = count($params);
|
||||
if (!$count)
|
||||
return $this->getStudiengang($method);
|
||||
|
||||
if ($count == 1) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getSemester($method, $params[0]);
|
||||
elseif ($params[0] == 'prestudent')
|
||||
return $this->terminateWithSuccess($this->getStdSem($method . '/prestudent/', $method));
|
||||
else
|
||||
return $this->getStudiengang($method, $params[0]);
|
||||
}
|
||||
if ($count == 2) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getVerband($method, $params[0], $params[1]);
|
||||
elseif ($params[1] == 'prestudent')
|
||||
return $this->terminateWithSuccess($this->getStdSem($method . '/' . $params[0] . '/prestudent/', $method));
|
||||
else
|
||||
return $this->getSemester($method, $params[1], $params[0]);
|
||||
}
|
||||
if ($count == 3 && !is_numeric($params[0]) && is_numeric($params[1]) && !is_numeric($params[2]))
|
||||
return $this->getVerband($method, $params[1], $params[2], $params[0]);
|
||||
|
||||
show_404();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function getBase()
|
||||
{
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("v.studiengang_kz AS link");
|
||||
$this->StudiengangModel->addSelect(
|
||||
"CONCAT(kurzbzlang, ' (', UPPER(CONCAT(typ, kurzbz)), ') - ', tbl_studiengang.bezeichnung) AS name",
|
||||
false
|
||||
);
|
||||
$this->StudiengangModel->addSelect('erhalter_kz');
|
||||
$this->StudiengangModel->addSelect('typ');
|
||||
$this->StudiengangModel->addSelect('kurzbz');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz AS stg_kz');
|
||||
|
||||
$this->StudiengangModel->addOrder('erhalter_kz');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
|
||||
$stgs = $this->permissionlib->getSTG_isEntitledFor('admin') ?: [];
|
||||
$stgs = array_merge($stgs, $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []);
|
||||
|
||||
if (!$stgs)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $stgs);
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(['v.aktiv' => true]);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($this->permissionlib->isBerechtigt('inout/uebersicht'))
|
||||
$list[] = [
|
||||
'name' => 'International',
|
||||
'link' => 'inout',
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'link' => 'inout/incoming',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Outgoing',
|
||||
'link' => 'inout/outgoing',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Gemeinsame Studien',
|
||||
'link' => 'inout/gemeinsamestudien',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param string $orgform (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getStudiengang($studiengang_kz, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(
|
||||
UPPER(CONCAT(typ, kurzbz)),
|
||||
'-',
|
||||
semester,
|
||||
(
|
||||
SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END
|
||||
FROM public.tbl_lehrverband
|
||||
WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester
|
||||
ORDER BY verband, gruppe LIMIT 1
|
||||
)
|
||||
) AS name", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('semester');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('semester');
|
||||
|
||||
if ($org_form !== null) {
|
||||
$this->StudiengangModel->addSelect("v.orgform_kurzbz");
|
||||
$this->StudiengangModel->db->group_start();
|
||||
$this->StudiengangModel->db->where('v.semester', 0);
|
||||
$this->StudiengangModel->db->or_where('v.orgform_kurzbz', $org_form);
|
||||
$this->StudiengangModel->db->group_end();
|
||||
}
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.aktiv' => true
|
||||
]);
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
array_unshift($list, [
|
||||
'name' => 'PreStudent',
|
||||
'link' => $link . 'prestudent',
|
||||
'no_sem_reload' => true,
|
||||
'stg_kz' => (int)$studiengang_kz,
|
||||
'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz)
|
||||
]);
|
||||
|
||||
if ($org_form === null) {
|
||||
// NOTE(chris): if mischform show orgforms
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
if ($result) {
|
||||
if (current($result)->mischform) {
|
||||
$this->load->model('organisation/Studienordnung_model', 'StudienordnungModel');
|
||||
|
||||
$this->StudienordnungModel->addDistinct();
|
||||
$this->StudienordnungModel->addSelect("CONCAT(studiengang_kz, '/', p.orgform_kurzbz) AS link");
|
||||
$this->StudienordnungModel->addSelect("p.orgform_kurzbz AS name");
|
||||
$this->StudienordnungModel->addSelect("studiengang_kz AS stg_kz");
|
||||
|
||||
$this->StudienordnungModel->addJoin('lehre.tbl_studienplan p', 'studienordnung_id');
|
||||
|
||||
$result = $this->StudienordnungModel->loadWhere([
|
||||
'aktiv' => true,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'p.orgform_kurzbz !=' => 'DDP'
|
||||
]);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$list = array_merge($list, $result);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester
|
||||
* @param string $orgform
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getSemester($studiengang_kz, $semester, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/';
|
||||
|
||||
|
||||
$this->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
|
||||
$this->GruppeModel->addDistinct();
|
||||
$this->GruppeModel->addSelect("CONCAT(" . $this->GruppeModel->escape($link . 'grp/') . ", gruppe_kurzbz) AS link", false);
|
||||
$this->GruppeModel->addSelect("CONCAT(gruppe_kurzbz, ' (', bezeichnung, ')') AS name", false);
|
||||
$this->GruppeModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->GruppeModel->addSelect('sort');
|
||||
$this->GruppeModel->addSelect('gruppe_kurzbz');
|
||||
$this->GruppeModel->addSelect($this->GruppeModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->GruppeModel->addOrder('sort');
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
|
||||
$where = [
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'semester' => $semester,
|
||||
'lehre' => true,
|
||||
'sichtbar' => true,
|
||||
'aktiv' => true,
|
||||
'direktinskription' => false
|
||||
];
|
||||
|
||||
if ($org_form !== null)
|
||||
$where['orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->GruppeModel->loadWhere($where);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", verband) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester AND verband=v.verband ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("CASE WHEN MAX(gruppe)='' OR MAX(gruppe)=' ' THEN TRUE ELSE FALSE END AS leaf");
|
||||
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($semester) . ' AS semester');
|
||||
$this->StudiengangModel->addSelect('verband');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('verband');
|
||||
|
||||
$this->StudiengangModel->addGroupBy('link, name, verband');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$list = array_merge($list, $result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester
|
||||
* @param integer $verband
|
||||
* @param string $orgform
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getVerband($studiengang_kz, $semester, $verband, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/'. $verband . '/';
|
||||
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", gruppe) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, gruppe, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester AND verband=v.verband AND gruppe=v.gruppe ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('v.semester');
|
||||
$this->StudiengangModel->addSelect('v.verband');
|
||||
$this->StudiengangModel->addSelect('gruppe');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('gruppe');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband' => $verband,
|
||||
'v.gruppe !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $link
|
||||
* @param integer $studiengang_kz
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getStdSem($link, $studiengang_kz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['number_displayed_past_studiensemester']);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->load->config('stv');
|
||||
$number_displayed_past_studiensemester_default = $this->config->item('number_displayed_past_studiensemester_default');
|
||||
|
||||
$number_displayed_past_studiensemester = $data['number_displayed_past_studiensemester'] ?? $number_displayed_past_studiensemester_default;
|
||||
|
||||
$this->StudiensemesterModel->addPlusMinus(null, $number_displayed_past_studiensemester);
|
||||
$this->StudiensemesterModel->addOrder('ende');
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
|
||||
$studiensemester = $this->getDataOrTerminateWithError($result);
|
||||
$result = [];
|
||||
|
||||
$studiengang_kz = (int)$studiengang_kz;
|
||||
|
||||
foreach ($studiensemester as $sem) {
|
||||
$semlink = $link . $sem->studiensemester_kurzbz;
|
||||
$intlink = $semlink . '/interessenten';
|
||||
$result[] = [
|
||||
'name' => $sem->studiensemester_kurzbz,
|
||||
'link' => $semlink,
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Interessenten',
|
||||
'link' => $intlink,
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Bewerbung nicht abgeschickt',
|
||||
'link' => $intlink . '/bewerbungnichtabgeschickt',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Bewerbung abgeschickt, Status unbestätigt',
|
||||
'link' => $intlink . '/bewerbungabgeschickt',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'ZGV erfüllt',
|
||||
'link' => $intlink . '/zgv',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Status bestätigt',
|
||||
'link' => $intlink . '/statusbestaetigt',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/statusbestaetigtrtnichtangemeldet',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/statusbestaetigtrtangemeldet',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/reihungstestnichtangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/reihungstestangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Bewerber',
|
||||
'link' => $semlink . '/bewerber',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/bewerberrtnichtangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/bewerberrtangemeldet',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Teilgenommen',
|
||||
'link' => $intlink . '/bewerberrtangemeldetteilgenommen',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Nicht teilgenommen',
|
||||
'link' => $intlink . '/bewerberrtangemeldetnichtteilgenommen',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Aufgenommen',
|
||||
'link' => $semlink . '/aufgenommen',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Warteliste',
|
||||
'link' => $semlink . '/warteliste',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Absage',
|
||||
'link' => $semlink . '/absage',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'link' => $semlink . '/incoming',
|
||||
'stg_kz' => $studiengang_kz,
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ class Tag extends API_Controller
|
||||
|
||||
if (isset($tag))
|
||||
{
|
||||
$this->TagModel->addJoin('public.tbl_notiz_typ', 'typ_kurzbz', 'typ_kurzbz');
|
||||
$result = $this->TagModel->load($tag);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
|
||||
@@ -14,11 +14,11 @@ class Mylv extends Auth_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'Student' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Studiensemester' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Lvs' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Info' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Pruefungen' => ['student/anrechnung_beantragen:r','user:r'] // TODO(chris): permissions?
|
||||
'Student' => self::PERM_LOGGED,
|
||||
'Studiensemester' => self::PERM_LOGGED,
|
||||
'Lvs' => self::PERM_LOGGED,
|
||||
'Info' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studiensemester extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'now' => self::PERM_LOGGED,
|
||||
'set' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addOrder('start');
|
||||
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function now()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
}
|
||||
$result = getData($result) ?: [];
|
||||
|
||||
if (count($result) != 1) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJsonError(count($result) ? 'Mehrere Studiensemester aktiv' : 'Kein Studiensemester aktiv');
|
||||
} else {
|
||||
$this->outputJsonSuccess(current($result)->studiensemester_kurzbz);
|
||||
}
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
|
||||
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
|
||||
|
||||
if ($this->form_validation->run() == false) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$stdsem = $this->input->post('studiensemester');
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'semester_aktuell', $stdsem);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(true);
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,8 @@ class AbgabetoolJob extends JOB_Controller
|
||||
foreach($assistenzMap as $assistenz_person_id => $tupelArr) {
|
||||
|
||||
$abgabenString = '<div style="font-family: Arial, sans-serif; color: #333;">';
|
||||
|
||||
$hasContent = false;
|
||||
|
||||
foreach($tupelArr as $tupel) {
|
||||
$projektarbeit_id = $tupel[0];
|
||||
$assistenzRow = $tupel[1];
|
||||
@@ -377,6 +378,7 @@ class AbgabetoolJob extends JOB_Controller
|
||||
if(count($relevantAbgaben) == 0) {
|
||||
continue;
|
||||
}
|
||||
$hasContent = true;
|
||||
|
||||
// Format the Student Name
|
||||
$s = $relevantAbgaben[0];
|
||||
@@ -447,7 +449,12 @@ class AbgabetoolJob extends JOB_Controller
|
||||
}
|
||||
|
||||
$abgabenString .= '</div>';
|
||||
|
||||
|
||||
// skip send entirely
|
||||
if (!$hasContent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// done with building the change list, now send it
|
||||
$assistenzRow = $tupelArr[0][1];
|
||||
$anrede = $assistenzRow->anrede;
|
||||
|
||||
@@ -40,6 +40,13 @@ class AntragJob extends JOB_Controller
|
||||
*/
|
||||
public function sendStglSammelmail()
|
||||
{
|
||||
|
||||
if ($this->config->item('abmeldung_enabled') !== true &&
|
||||
$this->config->item('abmeldung_stg_enabled') !== true &&
|
||||
$this->config->item('unterbrechung_enabled') !== true &&
|
||||
$this->config->item('wiederholung_enabled') !== true)
|
||||
return $this->logError('Konnte Job nicht starten: Keine der Configs "abmeldung_stg_enabled", "abmeldung_enabled", "unterbrechung_enabled", "wiederholung_enabled" auf true gesetzt');
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$this->logInfo('Start Job sendStglSammelmail');
|
||||
@@ -47,25 +54,38 @@ class AntragJob extends JOB_Controller
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudierendenantragModel->addJoin('public.tbl_prestudent', 'prestudent_id');
|
||||
$this->db->group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG_STGL);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
if ($this->config->item('abmeldung_enabled') === true)
|
||||
{
|
||||
$this->db->group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
}
|
||||
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_UNTERBRECHUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
if ($this->config->item('abmeldung_stg_enabled') === true)
|
||||
{
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG_STGL);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
}
|
||||
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_WIEDERHOLUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_LVSASSIGNED);
|
||||
$this->db->group_end();
|
||||
if ($this->config->item('unterbrechung_enabled') === true)
|
||||
{
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_UNTERBRECHUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED);
|
||||
$this->db->group_end();
|
||||
}
|
||||
|
||||
if ($this->config->item('wiederholung_enabled') === true)
|
||||
{
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('typ', Studierendenantrag_model::TYP_WIEDERHOLUNG);
|
||||
$this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_LVSASSIGNED);
|
||||
$this->db->group_end();
|
||||
}
|
||||
|
||||
$result = $this->StudierendenantragModel->load();
|
||||
if(isError($result))
|
||||
@@ -105,7 +125,7 @@ class AntragJob extends JOB_Controller
|
||||
$stgLeitungen[$leitung->uid]['stgs'][] = $antrag->studiengang_kz;
|
||||
}
|
||||
|
||||
$result = $this->StudierendenantragModel->getStgAndSem($antrag->studierendenantrag_id);
|
||||
$result = $this->StudierendenantragModel->getStgAndDetails($antrag->studierendenantrag_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
@@ -206,6 +226,10 @@ class AntragJob extends JOB_Controller
|
||||
public function sendReminderWiedereinstieg()
|
||||
{
|
||||
$now = new DateTime();
|
||||
|
||||
if ($this->config->item('unterbrechung_enabled') !== true)
|
||||
return $this->logError('Konnte Job nicht starten: Config "unterbrechung_enabled" nicht auf true gesetzt');
|
||||
|
||||
$modifier = $this->config->item('unterbrechung_job_remind_wiedereinstieg_date_modifier');
|
||||
|
||||
if (!$modifier)
|
||||
@@ -363,6 +387,13 @@ class AntragJob extends JOB_Controller
|
||||
{
|
||||
$this->logInfo('Start Job handleWiederholerDeadline');
|
||||
|
||||
if ($this->config->item('wiederholung_enabled') !== true)
|
||||
{
|
||||
$this->logError('Config "wiederholung_enabled" nicht auf true gesetzt');
|
||||
$this->logInfo('Ende Job handleWiederholerDeadline');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
|
||||
$insertvon = $this->config->item('antrag_job_systemuser');
|
||||
@@ -481,6 +512,13 @@ class AntragJob extends JOB_Controller
|
||||
{
|
||||
$this->logInfo('Start Job handleAbmeldungenStglDeadline');
|
||||
|
||||
if ($this->config->item('abmeldung_stg_enabled') !== true)
|
||||
{
|
||||
$this->logError('Config "abmeldung_stg_enabled" nicht auf true gesetzt');
|
||||
$this->logInfo('Ende Job handleAbmeldungenStglDeadline');
|
||||
return;
|
||||
}
|
||||
|
||||
$insertvon = $this->config->item('antrag_job_systemuser');
|
||||
if (!$insertvon) {
|
||||
$this->logError('Config "antrag_job_systemuser" nicht gesetzt');
|
||||
@@ -614,6 +652,13 @@ class AntragJob extends JOB_Controller
|
||||
{
|
||||
$this->logInfo('Start Job sendAufforderungWiederholer');
|
||||
|
||||
if ($this->config->item('wiederholung_enabled') !== true)
|
||||
{
|
||||
$this->logError('Config "wiederholung_enabled" nicht auf true gesetzt');
|
||||
$this->logInfo('Ende Job sendAufforderungWiederholer');
|
||||
return;
|
||||
}
|
||||
|
||||
$modifier_request_1 = $this->config->item('wiederholung_job_request_1_date_modifier');
|
||||
$modifier_request_2 = $this->config->item('wiederholung_job_request_2_date_modifier');
|
||||
$modifier_deadline = $this->config->item('wiederholung_job_deadline_date_modifier');
|
||||
|
||||
@@ -803,7 +803,7 @@ class ReihungstestJob extends JOB_Controller
|
||||
{
|
||||
if (!isset($studiensemester) || isEmptyString($studiensemester))
|
||||
{
|
||||
$this->logError("Studiensemster not passed as parameter");
|
||||
$this->logError("Studiensemester not passed as parameter");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class TagJob extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Configs
|
||||
$this->load->config('stv');
|
||||
|
||||
// Library
|
||||
$this->load->library('TagLib');
|
||||
|
||||
// Load Models
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function rebuildAutomatedTags()
|
||||
{
|
||||
$automatedTagsRes = $this->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
|
||||
|
||||
$result = $this->StudiensemesterModel->getAktOrNextSemester();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logInfo('Start Job rebuild Automated Tags');
|
||||
$this->logError('Error occurred during retrieving studiensemester');
|
||||
return $this->logInfo('End Job rebuild Automated Tags');
|
||||
}
|
||||
|
||||
if (empty($result->retval) || !isset($result->retval[0])) {
|
||||
$this->logInfo('Start Job rebuild Automated Tags');
|
||||
$this->logError('No Studiensemester found');
|
||||
return $this->logInfo('End Job rebuild Automated Tags');
|
||||
}
|
||||
$studiensemester_kurzbz = $result->retval[0]->studiensemester_kurzbz ?? null;
|
||||
$params = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
);
|
||||
|
||||
$this->logInfo('Start Job rebuild Automated Tags ' . $studiensemester_kurzbz);
|
||||
foreach($automatedTags as $autoTag)
|
||||
{
|
||||
// getPath: must not be lost
|
||||
$filePath = APPPATH . 'libraries/' . $autoTag->taglib . '.php'; // APPPATH = application/
|
||||
|
||||
if(file_exists($filePath)) {
|
||||
require_once($filePath);
|
||||
} else {
|
||||
$this->logInfo("File not found: " . $filePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
$kurz_bz = $autoTag->typ_kurzbz;
|
||||
// className without PATH (basename)
|
||||
$className = basename($autoTag->taglib);
|
||||
|
||||
$obj = new $className();
|
||||
|
||||
$outputArray = $obj->getZuordnungIds($params);
|
||||
$typeId = $outputArray->typeId;
|
||||
|
||||
$paramsTag = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'kurzbz' => $kurz_bz,
|
||||
'data' => $outputArray->data,
|
||||
'typeId' => $typeId
|
||||
);
|
||||
|
||||
$result = $this->taglib->updateAutomatedTags($paramsTag);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->logError('Error occurred during updateAutomatedTags ' . $kurz_bz);
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = is_array($result) ? $result['retval'] : $result->retval;
|
||||
|
||||
//SUMMARY
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . " | type_id " . $typeId . " --"
|
||||
. " Count Recycled: " . $result->retval['summary']['recycled']
|
||||
. " Count Added: ". $result->retval['summary']['added']
|
||||
. " Count Deleted: ". $result->retval['summary']['deleted']);
|
||||
|
||||
//DETAILS
|
||||
if($result->retval['results']['newTags'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "New tag(s): " . implode(', ', $result->retval['results']['newTags']));
|
||||
if($result->retval['results']['deletedTagsIds'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "Deleted tags(s: " . implode(', ', $result->retval['results']['deletedTagsIds']));
|
||||
if ($result->retval['results']['retaggedIds'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "Recycled tag(s): " . implode(', ', $result->retval['results']['retaggedIds']));
|
||||
}
|
||||
$this->logInfo( "End Job rebuild Automated Tags");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller generates javascript from snippets for tabulator columns
|
||||
*/
|
||||
class Tabulatorcolumns extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'stv' => ['admin:r', 'assistenz:r'],
|
||||
'lvverwaltung' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render tabulator columns for config
|
||||
*
|
||||
* @param string $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($config)
|
||||
{
|
||||
$this->load->config($config);
|
||||
$list_columns = $this->config->item('list_columns') ?: [];
|
||||
|
||||
$snippets = [
|
||||
'jssnippets/tabulatorcolumns/' . $config . '.js'
|
||||
];
|
||||
|
||||
foreach ($list_columns as $col) {
|
||||
$snippets[] = $col['js'];
|
||||
}
|
||||
|
||||
$this->output->set_content_type('application/javascript');
|
||||
|
||||
$this->load->view('jssnippets/tabulatorcolumns.js', [
|
||||
'snippets' => $snippets
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,13 @@ class Studierendenantrag extends FHC_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'studierendenantrag'
|
||||
'studierendenantrag',
|
||||
'ui'
|
||||
]);
|
||||
|
||||
if (strtolower($this->router->method) === 'leitung')
|
||||
$this->load->config('studierendenantrag');
|
||||
|
||||
if (strtolower($this->router->method) === 'leitung')
|
||||
$this->_isAllowed([
|
||||
'leitung' => ['student/studierendenantrag:r', 'student/antragfreigabe:r']
|
||||
]);
|
||||
@@ -54,18 +57,27 @@ class Studierendenantrag extends FHC_Controller
|
||||
'bezeichnungStg' => $antrag->bezeichnung,
|
||||
'bezeichnungOrgform' => $antrag->orgform
|
||||
);
|
||||
|
||||
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Wiederholung';
|
||||
|
||||
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung';
|
||||
if ($this->config->item('wiederholung_enabled') === true)
|
||||
{
|
||||
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Wiederholung';
|
||||
}
|
||||
|
||||
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Abmeldung';
|
||||
if ($this->config->item('unterbrechung_enabled') === true)
|
||||
{
|
||||
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung';
|
||||
}
|
||||
|
||||
if ($this->config->item('abmeldung_enabled') === true)
|
||||
{
|
||||
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Abmeldung';
|
||||
}
|
||||
}
|
||||
if ($antrag->studierendenantrag_id == null)
|
||||
continue;
|
||||
@@ -88,45 +100,59 @@ class Studierendenantrag extends FHC_Controller
|
||||
|
||||
$this->load->view('lehre/Antrag/Leitung/List', [
|
||||
'stgA' => $stgA,
|
||||
'stgL' => $stgL
|
||||
'stgL' => $stgL,
|
||||
'abmeldung_enabled' => $this->config->item('abmeldung_stg_enabled')
|
||||
]);
|
||||
}
|
||||
|
||||
public function abmeldung($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Abmeldung'
|
||||
]);
|
||||
if ($this->config->item('abmeldung_enabled') === true)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Abmeldung'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function abmeldungstgl($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'AbmeldungStgl'
|
||||
]);
|
||||
if ($this->config->item('abmeldung_stg_enabled') === true)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'AbmeldungStgl'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function unterbrechung($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Unterbrechung'
|
||||
]);
|
||||
if ($this->config->item('unterbrechung_enabled') === true)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Unterbrechung'
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function wiederholung($prestudent_id, $studierendenantrag_id = null)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Wiederholung'
|
||||
]);
|
||||
if ($this->config->item('wiederholung_enabled') === true)
|
||||
{
|
||||
$this->load->view('lehre/Antrag/Create', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studierendenantrag_id' => $studierendenantrag_id,
|
||||
'antrag_type' => 'Wiederholung'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -198,7 +198,19 @@ class Gradelist extends Auth_Controller
|
||||
if (!isset($row_noten->found))
|
||||
{
|
||||
$result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id);
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
|
||||
$studiengang_kz = null;
|
||||
|
||||
if (!empty($result_lv->retval) && isset($result_lv->retval[0]) && isset($result_lv->retval[0]->studiengang_kz))
|
||||
{
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
|
||||
if (!empty($result_stg->retval) && isset($result_stg->retval[0]) && is_object($result_stg->retval[0]) && isset($result_stg->retval[0]->kurzbzlang))
|
||||
{
|
||||
$studiengang_kz = $result_stg->retval[0]->kurzbzlang;
|
||||
}
|
||||
}
|
||||
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
|
||||
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
|
||||
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
|
||||
@@ -212,8 +224,8 @@ class Gradelist extends Auth_Controller
|
||||
'semester' => $result_lv->retval[0]->semester,
|
||||
'note' => $row_noten->note,
|
||||
'datum' => $row_noten->benotungsdatum,
|
||||
'zugeordnet' => true,
|
||||
'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang
|
||||
'studiengang_kurzbz' => $studiengang_kz,
|
||||
'zugeordnet' => true
|
||||
);
|
||||
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl']))
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0;
|
||||
|
||||
@@ -34,6 +34,9 @@ class InfoCenter extends Auth_Controller
|
||||
const PREV_FILTER_ID = 'prev_filter_id';
|
||||
const KEEP_TABLESORTER_FILTER = 'keepTsFilter';
|
||||
|
||||
const ONBOARDING_INSERTVON = 'onboarding';
|
||||
const ONBOARDING_KENNZEICHENTYP = 'eobRegistrierungsId';
|
||||
|
||||
private $_uid; // contains the UID of the logged user
|
||||
|
||||
// Used to log with PersonLogLib
|
||||
@@ -175,6 +178,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Geschlecht_model', 'GeschlechtModel');
|
||||
$this->load->model('person/adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Kennzeichen_model', 'KennzeichenModel');
|
||||
|
||||
// Loads libraries
|
||||
$this->load->library('PersonLogLib');
|
||||
@@ -1452,6 +1456,100 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$this->outputJsonSuccess("Done!");
|
||||
}
|
||||
|
||||
public function getAbsageData()
|
||||
{
|
||||
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
|
||||
|
||||
if (!is_null($stg_typ))
|
||||
{
|
||||
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
|
||||
|
||||
$data = array (
|
||||
'statusgruende' => $statusgruende,
|
||||
'studiengaenge' => $studiengaenge->retval
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->outputJsonSuccess(null);
|
||||
}
|
||||
|
||||
public function getStudienArtBerechtigung($typ = null)
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
|
||||
return getData($stg_typ);
|
||||
}
|
||||
|
||||
public function getStudienartData()
|
||||
{
|
||||
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
|
||||
}
|
||||
|
||||
public function saveAbsageForAll()
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$studiengang = $this->input->post('studiengang');
|
||||
$abgeschickt = $this->input->post('abgeschickt');
|
||||
$personen = $this->input->post('personen');
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
if ($studiengang === 'all' && $abgeschickt === 'all')
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
|
||||
|
||||
if (!hasData($prestudenten))
|
||||
continue;
|
||||
|
||||
$prestudentenData = getData($prestudenten);
|
||||
|
||||
foreach ($prestudentenData as $prestudent)
|
||||
{
|
||||
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$this->StudienplanModel->addSelect('1');
|
||||
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
|
||||
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
|
||||
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
|
||||
$this->StudienplanModel->addLimit(1);
|
||||
$studiengangResult = $this->StudienplanModel->load();
|
||||
|
||||
if (hasData($studiengangResult))
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
|
||||
|
||||
if (!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
|
||||
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -1946,6 +2044,17 @@ class InfoCenter extends Auth_Controller
|
||||
show_error(getError($user_person));
|
||||
}
|
||||
|
||||
// add info about first electronig onboarding login
|
||||
$this->KennzeichenModel->addSelect('insertamum');
|
||||
$onboarding_first_login = $this->KennzeichenModel->loadWhere(
|
||||
array('person_id' => $person_id, 'kennzeichentyp_kurzbz' => self::ONBOARDING_KENNZEICHENTYP)
|
||||
);
|
||||
|
||||
if (isError($onboarding_first_login))
|
||||
{
|
||||
show_error(getError($onboarding_first_login));
|
||||
}
|
||||
|
||||
$data = array (
|
||||
'lockedby' => $lockedby,
|
||||
'lockedbyother' => $lockedbyother,
|
||||
@@ -1955,7 +2064,9 @@ class InfoCenter extends Auth_Controller
|
||||
'messages' => $messages->retval,
|
||||
'logs' => $logs,
|
||||
'notizen' => $notizen->retval,
|
||||
'notizenbewerbung' => $notizen_bewerbung->retval
|
||||
'notizenbewerbung' => $notizen_bewerbung->retval,
|
||||
'created_by_onboarding' => $stammdaten->retval->insertvon == self::ONBOARDING_INSERTVON,
|
||||
'onboarding_first_login' => hasData($onboarding_first_login) ? getData($onboarding_first_login)[0]->insertamum : null
|
||||
);
|
||||
|
||||
return $data;
|
||||
@@ -2375,97 +2486,4 @@ class InfoCenter extends Auth_Controller
|
||||
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
|
||||
}
|
||||
}
|
||||
|
||||
public function getAbsageData()
|
||||
{
|
||||
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
|
||||
|
||||
if (!is_null($stg_typ))
|
||||
{
|
||||
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
|
||||
|
||||
$data = array (
|
||||
'statusgruende' => $statusgruende,
|
||||
'studiengaenge' => $studiengaenge->retval
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->outputJsonSuccess(null);
|
||||
}
|
||||
|
||||
public function getStudienArtBerechtigung($typ = null)
|
||||
{
|
||||
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
|
||||
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
|
||||
return getData($stg_typ);
|
||||
}
|
||||
|
||||
public function getStudienartData()
|
||||
{
|
||||
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
|
||||
}
|
||||
|
||||
public function saveAbsageForAll()
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$studiengang = $this->input->post('studiengang');
|
||||
$abgeschickt = $this->input->post('abgeschickt');
|
||||
$personen = $this->input->post('personen');
|
||||
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
|
||||
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
if ($studiengang === 'all' && $abgeschickt === 'all')
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
|
||||
|
||||
if (!hasData($prestudenten))
|
||||
continue;
|
||||
|
||||
$prestudentenData = getData($prestudenten);
|
||||
|
||||
foreach ($prestudentenData as $prestudent)
|
||||
{
|
||||
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$this->StudienplanModel->addSelect('1');
|
||||
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
|
||||
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
|
||||
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
|
||||
$this->StudienplanModel->addLimit(1);
|
||||
$studiengangResult = $this->StudienplanModel->load();
|
||||
|
||||
if (hasData($studiengangResult))
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
|
||||
|
||||
if (!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
|
||||
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ class Rueckstellung extends Auth_Controller
|
||||
private $_ci; // Code igniter instance
|
||||
private $_uid;
|
||||
|
||||
const ZGV_UEBERPRUEFUNG_MAIL_VORLAGE = 'ZGVUEP';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
@@ -23,6 +25,7 @@ class Rueckstellung extends Auth_Controller
|
||||
$this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->library('PersonLogLib');
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
@@ -78,6 +81,8 @@ class Rueckstellung extends Auth_Controller
|
||||
|
||||
$this->_log($person_id, $status_kurzbz);
|
||||
|
||||
if ($status_kurzbz === 'onhold_zgv')
|
||||
$this->sendRueckstellungMessage($person_id);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
@@ -104,6 +109,10 @@ class Rueckstellung extends Auth_Controller
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
$this->_log($person, $status_kurzbz);
|
||||
|
||||
if ($status_kurzbz === 'onhold_zgv')
|
||||
$this->sendRueckstellungMessage($person);
|
||||
|
||||
}
|
||||
$this->outputJsonSuccess("Erfolgreich gespeichert!");
|
||||
}
|
||||
@@ -160,4 +169,26 @@ class Rueckstellung extends Auth_Controller
|
||||
$this->_uid
|
||||
);
|
||||
}
|
||||
|
||||
private function sendRueckstellungMessage($person_id)
|
||||
{
|
||||
$person = $this->_ci->PersonModel->load($person_id);
|
||||
|
||||
if (hasData($person))
|
||||
{
|
||||
$person = getData($person)[0];
|
||||
|
||||
return $this->messagelib->sendMessageUserTemplate(
|
||||
$person_id,
|
||||
self::ZGV_UEBERPRUEFUNG_MAIL_VORLAGE,
|
||||
array(
|
||||
'anrede' => $person->anrede,
|
||||
'nachname' => $person->nachname
|
||||
),
|
||||
null,
|
||||
getAuthPersonId(),
|
||||
'infocenter'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
const BERECHTIGUNG_KURZBZ = 'admin:rw';
|
||||
const BERECHTIGUNG_KURZBZ = ['admin:rw'];
|
||||
|
||||
public function __construct($permissions)
|
||||
{
|
||||
@@ -15,10 +15,11 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
'getTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
];
|
||||
|
||||
$merged_permissions = array_merge($default_permissions, $permissions);
|
||||
@@ -26,6 +27,10 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
parent::__construct($merged_permissions);
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
// Library
|
||||
$this->load->library('TagLib');
|
||||
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
@@ -38,6 +43,8 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
public function getTag($readonly_tags = null)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$index_bezeichnung_mehrsprachig = $language - 1;
|
||||
|
||||
$id = $this->input->get('id');
|
||||
|
||||
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
|
||||
@@ -62,14 +69,18 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $index_bezeichnung_mehrsprachig . " as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz_typ.prioritaet,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter,
|
||||
tbl_notiz.start,
|
||||
tbl_notiz.ende
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
@@ -82,18 +93,24 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
|
||||
$notiz = $this->NotizModel->loadWhere(array('notiz_id' => $id));
|
||||
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz)[0] : array());
|
||||
}
|
||||
|
||||
public function getTags($tags = null)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$index_bezeichnung_mehrsprachig = $language - 1;
|
||||
|
||||
$this->NotiztypModel->addSelect(
|
||||
'typ_kurzbz as tag_typ_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
|
||||
"typ_kurzbz as tag_typ_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $index_bezeichnung_mehrsprachig . " as bezeichnung,
|
||||
style,
|
||||
beschreibung,
|
||||
tag
|
||||
'
|
||||
tag,
|
||||
automatisiert,
|
||||
prioritaet
|
||||
"
|
||||
);
|
||||
$this->NotiztypModel->addOrder('prioritaet');
|
||||
|
||||
@@ -271,6 +288,90 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($deleteNotiz);
|
||||
}
|
||||
|
||||
public function getAllTags($readonly_tags = false)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$index_bezeichnung_mehrsprachig = $language - 1;
|
||||
$prestudent_id = $this->input->get('prestudent_id');
|
||||
|
||||
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
|
||||
{
|
||||
$readonly_tags = $this->_filterTag($readonly_tags, true);
|
||||
|
||||
foreach ($readonly_tags as $key => $tag)
|
||||
{
|
||||
$readonly_tags[$key] = $this->NotizModel->db->escape($tag);
|
||||
}
|
||||
$tags = '(' . implode(',', $readonly_tags) . ')';
|
||||
|
||||
$this->NotizModel->addSelect("
|
||||
CASE
|
||||
WHEN tbl_notiz_typ.typ_kurzbz IN $tags
|
||||
THEN TRUE
|
||||
ELSE FALSE
|
||||
END as readonly
|
||||
");
|
||||
}
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $index_bezeichnung_mehrsprachig . " as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz_typ.prioritaet,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter,
|
||||
tbl_notiz.start,
|
||||
tbl_notiz.ende
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer verfasserbenutzer', 'tbl_notiz.verfasser_uid = verfasserbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person verfasserperson', 'verfasserbenutzer.person_id = verfasserperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer bearbeiterbenutzer', 'tbl_notiz.bearbeiter_uid = bearbeiterbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person bearbeiterperson', 'bearbeiterbenutzer.person_id = bearbeiterperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notizzuordnung notizzuordnung', 'tbl_notiz.notiz_id = notizzuordnung.notiz_id');
|
||||
|
||||
$this->NotizModel->addOrder('done');
|
||||
$this->NotizModel->addOrder('tbl_notiz_typ.prioritaet');
|
||||
$notiz = $this->NotizModel->loadWhere(array('prestudent_id' => $prestudent_id));
|
||||
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz) : array());
|
||||
}
|
||||
|
||||
public function rebuildTagsForTypeId()
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
$typeId = $this->input->post('typeId');
|
||||
$semester = $this->input->post('sem');
|
||||
|
||||
$idsSuccess = [];
|
||||
$idsError = [];
|
||||
$outputResult = [];
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$result = $this->taglib->rebuildTagsForTypeId($typeId, $id, $semester);
|
||||
|
||||
if (isError($result))
|
||||
$idsError[] = $id;
|
||||
else
|
||||
$idsSuccess[] = $id;
|
||||
|
||||
$outputResult[] = $result;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([$outputResult, $idsSuccess, $idsError]);
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
@@ -311,4 +412,4 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Helper function to generate the default documentslist config for the
|
||||
* grades tab.
|
||||
*
|
||||
* The resulting array consists of elements which are associative arrays
|
||||
* that can have the following entries:
|
||||
* title (required) on the first level this can be HTML code.
|
||||
* permissioncheck (optional) an URL to an FHCAPI endpoint which returns
|
||||
* true or false.
|
||||
* link (optional) an URL that will be called if "action" and
|
||||
* "children" are not defined.
|
||||
* action (optional) an associative array that describes an
|
||||
* POST action that will be called if "children" is
|
||||
* not defined.
|
||||
* It can have the following entries:
|
||||
* - url (required) an URL to an FHCAPI endpoint.
|
||||
* - post (optional) an associative array with the POST data to
|
||||
* be sent.
|
||||
* - response (optional) a string that will be displayed on success.
|
||||
* children (optional) an array of child elements
|
||||
*
|
||||
* All strings that start with { and end with } in the URLs and the
|
||||
* actions post parameter will be replaced with the corresponding
|
||||
* attribute of the current dataset (e.G: {uid} will be replaced with the
|
||||
* uid of the current dataset)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function gradesDocumentsList()
|
||||
{
|
||||
$ci =& get_instance();
|
||||
$ci->load->library('PhrasesLib', array('stv'), 'p');
|
||||
|
||||
$permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
|
||||
|
||||
$title_ger = $ci->p->t("global", "deutsch");
|
||||
$title_eng = $ci->p->t("global", "englisch");
|
||||
$title_ff = $ci->p->t("stv", "document_certificate");
|
||||
$title_lv = $ci->p->t("stv", "document_coursecertificate");
|
||||
|
||||
$link_ff = "documents/export/" .
|
||||
"zertifikat.rdf.php/" .
|
||||
"Zertifikat" .
|
||||
"?stg_kz={studiengang_kz_lv}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_ger = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnis" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_eng = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnisEng" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
|
||||
$archive_url = "api/frontend/v1/documents/archiveSigned";
|
||||
$archive_response = $ci->p->t("stv", "document_signed_and_archived");
|
||||
$archive_post_ff = [
|
||||
"xml" => "zertifikat.rdf.php",
|
||||
"xsl" => "Zertifikat",
|
||||
"stg_kz" => "{studiengang_kz_lv}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_ger = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnis",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_eng = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnisEng",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
|
||||
$list = [
|
||||
[
|
||||
'title' => '<i class="fa fa-download" title="' . $ci->p->t("stv", "document_download") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'link' => site_url($link_ff)
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'link' => site_url($link_lv_ger),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=odt")
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'link' => site_url($link_lv_eng),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=odt")
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => '<i class="fas fa-archive" title="' . $ci->p->t("stv", "document_archive") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_ff,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_ger,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_eng,
|
||||
'response' => $archive_response
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
@@ -111,7 +111,8 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
'theme' => [
|
||||
'name'=>$ci->config->item('theme_name'),
|
||||
'modes'=>$ci->config->item('theme_modes'),
|
||||
]
|
||||
],
|
||||
'domain' => DOMAIN
|
||||
);
|
||||
|
||||
$toPrint = "\n";
|
||||
@@ -270,6 +271,28 @@ function absoluteJsImportUrl($relurl)
|
||||
return $url;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate Css File Include if Extension contains file
|
||||
*
|
||||
* @param $relativeFilePath path relative to Extension public/css dir
|
||||
*/
|
||||
function generateCSSsIncludeIfExtensionCssExists($relativeFilePath)
|
||||
{
|
||||
$fsiterator = new FilesystemIterator(FHCPATH . 'application/extensions');
|
||||
foreach ($fsiterator as $fsitem)
|
||||
{
|
||||
if(preg_match('/^FHC-Core-/', $fsitem->getBasename()))
|
||||
{
|
||||
$extensionfile = 'public/extensions/' . $fsitem->getBasename()
|
||||
. '/css/' . $relativeFilePath;
|
||||
if(is_readable(FHCPATH . $extensionfile))
|
||||
{
|
||||
generateCSSsInclude($extensionfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Manipulate CI views includes Array to load
|
||||
* - public/js/FhcApps.js via customJSs and
|
||||
|
||||
@@ -741,7 +741,7 @@ class AnrechnungLib
|
||||
$fullname = hasData($result) ? $result->retval[0]->vorname. $result->retval[0]->nachname : '';
|
||||
|
||||
// Return filename
|
||||
return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname;
|
||||
return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname . '.pdf';
|
||||
}
|
||||
|
||||
public function LVhasLector($anrechnung_id)
|
||||
|
||||
@@ -1657,7 +1657,7 @@ class AntragLib
|
||||
|
||||
$result = $this->_ci->StudierendenantragModel->loadWithStatusWhere($where);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
return $result;
|
||||
|
||||
if (!hasData($result))
|
||||
return error($this->_ci->p->t('studierendenantrag', "error_no_antrag_found", ['id' => $studierendenantrag_id]));
|
||||
@@ -1709,6 +1709,7 @@ class AntragLib
|
||||
$result->statustyp = $antrag->statustyp;
|
||||
$result->status_insertvon = $antrag->status_insertvon;
|
||||
$result->grund = $antrag->grund;
|
||||
$result->status_grund = $antrag->status_grund;
|
||||
$result->studierendenantrag_id = $antrag->studierendenantrag_id;
|
||||
$result->typ = $antrag->typ;
|
||||
$result->datum = $antrag->datum;
|
||||
|
||||
@@ -0,0 +1,563 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class CmsAdminLib
|
||||
{
|
||||
private $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
|
||||
$this->ci->load->model('content/Content_model', 'ContentModel');
|
||||
$this->ci->load->model('content/Contentsprache_model', 'ContentspracheModel');
|
||||
$this->ci->load->model('content/Contentchild_model', 'ContentchildModel');
|
||||
$this->ci->load->model('content/Contentgruppe_model', 'ContentgruppeModel');
|
||||
$this->ci->load->model('content/Contentlog_model', 'ContentlogModel');
|
||||
$this->ci->load->model('content/Template_model', 'TemplateModel');
|
||||
|
||||
$this->ci->load->library('XsdSchemaLib');
|
||||
$this->ci->load->library('PermissionLib');
|
||||
$this->ci->config->load('cms');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object success(array) entitled oe_kurzbz values
|
||||
*/
|
||||
public function getEntitledOe()
|
||||
{
|
||||
$oe = $this->ci->permissionlib->getOE_isEntitledFor('basis/cms');
|
||||
|
||||
if ($oe === false || !is_array($oe))
|
||||
return success([]);
|
||||
|
||||
return success($oe);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @return object success(bool)
|
||||
*/
|
||||
public function isEntitledForContent($content_id)
|
||||
{
|
||||
$oeResult = $this->ci->ContentModel->getOeKurzbz($content_id);
|
||||
if (isError($oeResult))
|
||||
return $oeResult;
|
||||
|
||||
$entitledResult = $this->getEntitledOe();
|
||||
if (isError($entitledResult))
|
||||
return $entitledResult;
|
||||
|
||||
return success(in_array(getData($oeResult), getData($entitledResult)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object success(string) or error
|
||||
*/
|
||||
public function getDefaultOe()
|
||||
{
|
||||
$default = $this->ci->config->item('default_oe_kurzbz');
|
||||
|
||||
$entitledResult = $this->getEntitledOe();
|
||||
if (isError($entitledResult))
|
||||
return $entitledResult;
|
||||
$entitled = getData($entitledResult);
|
||||
|
||||
if (empty($entitled))
|
||||
return error($this->ci->p->t('cms', 'keineBerechtigteOe'));
|
||||
|
||||
if (in_array($default, $entitled))
|
||||
return success($default);
|
||||
|
||||
return success($entitled[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $parent_content_id
|
||||
* @return object success(array) with content_id, sprache, version
|
||||
*/
|
||||
public function createContent($parent_content_id = null)
|
||||
{
|
||||
$templatesResult = $this->ci->TemplateModel->loadWhere([]);
|
||||
if (isError($templatesResult))
|
||||
return $templatesResult;
|
||||
$templates = getData($templatesResult);
|
||||
if (empty($templates))
|
||||
return error($this->ci->p->t('cms', 'keineVorlageVorhanden'));
|
||||
$template = $templates[0];
|
||||
|
||||
$oeResult = $this->getDefaultOe();
|
||||
if (isError($oeResult))
|
||||
return $oeResult;
|
||||
$oe = getData($oeResult);
|
||||
|
||||
$titel = $this->ci->p->t('cms', 'neuerEintrag');
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$uid = getAuthUID();
|
||||
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$contentResult = $this->ci->ContentModel->insert([
|
||||
'template_kurzbz' => $template->template_kurzbz,
|
||||
'oe_kurzbz' => $oe,
|
||||
'aktiv' => true,
|
||||
'menu_open' => false,
|
||||
'beschreibung' => '',
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
]);
|
||||
if (isError($contentResult))
|
||||
return $contentResult;
|
||||
$content_id = getData($contentResult);
|
||||
|
||||
$spracheResult = $this->ci->ContentspracheModel->insert([
|
||||
'content_id' => $content_id,
|
||||
'sprache' => DEFAULT_LANGUAGE,
|
||||
'version' => 1,
|
||||
'sichtbar' => true,
|
||||
'titel' => $titel,
|
||||
'content' => '<?xml version="1.0" encoding="UTF-8" ?><content></content>',
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
]);
|
||||
if (isError($spracheResult))
|
||||
return $spracheResult;
|
||||
|
||||
if ($parent_content_id !== null)
|
||||
{
|
||||
$maxSortResult = $this->ci->ContentchildModel->getMaxSort($parent_content_id);
|
||||
if (isError($maxSortResult))
|
||||
return $maxSortResult;
|
||||
|
||||
$childResult = $this->ci->ContentchildModel->insert([
|
||||
'content_id' => $parent_content_id,
|
||||
'child_content_id' => $content_id,
|
||||
'sort' => getData($maxSortResult) + 1,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
]);
|
||||
if (isError($childResult))
|
||||
return $childResult;
|
||||
}
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'speichernFehlgeschlagen'));
|
||||
|
||||
return success([
|
||||
'content_id' => $content_id,
|
||||
'sprache' => DEFAULT_LANGUAGE,
|
||||
'version' => 1
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @param string $sprache source language
|
||||
* @param int $version source version
|
||||
* @param string $neueSprache target language
|
||||
* @return object success(array) with contentsprache_id
|
||||
*/
|
||||
public function createTranslation($content_id, $sprache, $version, $neueSprache)
|
||||
{
|
||||
$existsResult = $this->ci->ContentspracheModel->exists($content_id, $neueSprache);
|
||||
if (isError($existsResult))
|
||||
return $existsResult;
|
||||
if (getData($existsResult))
|
||||
return error($this->ci->p->t('cms', 'uebersetzungExistiert'));
|
||||
|
||||
$sourceResult = $this->ci->ContentspracheModel->getOne($content_id, $sprache, $version);
|
||||
if (isError($sourceResult))
|
||||
return $sourceResult;
|
||||
$source = getData($sourceResult);
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$uid = getAuthUID();
|
||||
|
||||
$insertResult = $this->ci->ContentspracheModel->insert([
|
||||
'content_id' => $content_id,
|
||||
'sprache' => $neueSprache,
|
||||
'version' => $source->version,
|
||||
'sichtbar' => true,
|
||||
'titel' => $source->titel,
|
||||
'content' => $source->content,
|
||||
// The review feature is gone from this admin, but the columns stay
|
||||
'reviewvon' => null,
|
||||
'reviewamum' => null,
|
||||
'gesperrt_uid' => null,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
if (isError($insertResult))
|
||||
return $insertResult;
|
||||
|
||||
return success(['contentsprache_id' => getData($insertResult)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @param string $sprache
|
||||
* @return object success(array) with version
|
||||
*/
|
||||
public function createVersion($content_id, $sprache)
|
||||
{
|
||||
$sourceResult = $this->ci->ContentspracheModel->getOne($content_id, $sprache, null);
|
||||
if (isError($sourceResult))
|
||||
return $sourceResult;
|
||||
$source = getData($sourceResult);
|
||||
|
||||
$maxResult = $this->ci->ContentspracheModel->getMaxVersion($content_id, $sprache);
|
||||
if (isError($maxResult))
|
||||
return $maxResult;
|
||||
$newVersion = getData($maxResult) + 1;
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$uid = getAuthUID();
|
||||
|
||||
$insertResult = $this->ci->ContentspracheModel->insert([
|
||||
'content_id' => $content_id,
|
||||
'sprache' => $sprache,
|
||||
'version' => $newVersion,
|
||||
'sichtbar' => false,
|
||||
'titel' => $source->titel,
|
||||
'content' => $source->content,
|
||||
// The review feature is gone from this admin, but the columns stay
|
||||
'reviewvon' => null,
|
||||
'reviewamum' => null,
|
||||
'gesperrt_uid' => null,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
if (isError($insertResult))
|
||||
return $insertResult;
|
||||
|
||||
return success(['version' => $newVersion]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the properties of one content version.
|
||||
* @param array $daten content_id, sprache, version, template_kurzbz, oe_kurzbz,
|
||||
* aktiv, menu_open, beschreibung, titel, sichtbar
|
||||
* @return object success(true) or error
|
||||
*/
|
||||
public function saveProperties($daten)
|
||||
{
|
||||
$versionResult = $this->ci->ContentspracheModel->getOne(
|
||||
$daten['content_id'], $daten['sprache'], $daten['version']
|
||||
);
|
||||
if (isError($versionResult))
|
||||
return $versionResult;
|
||||
$row = getData($versionResult);
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$uid = getAuthUID();
|
||||
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$this->ci->ContentModel->update($daten['content_id'], [
|
||||
'template_kurzbz' => $daten['template_kurzbz'],
|
||||
'oe_kurzbz' => $daten['oe_kurzbz'],
|
||||
'aktiv' => $daten['aktiv'],
|
||||
'menu_open' => $daten['menu_open'],
|
||||
'beschreibung' => $daten['beschreibung'],
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
$this->ci->ContentspracheModel->update($row->contentsprache_id, [
|
||||
'titel' => $daten['titel'],
|
||||
'sichtbar' => $daten['sichtbar'],
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'speichernFehlgeschlagen'));
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// legacy cms checks neither the permission
|
||||
// type nor the lock. The form appears only when the user holds the lock, but the POST
|
||||
// itself is unprotected.
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @param string $sprache
|
||||
* @param int $version
|
||||
* @param array $values field name => value
|
||||
* @return object success(true) or error
|
||||
*/
|
||||
public function saveContentXml($content_id, $sprache, $version, $values)
|
||||
{
|
||||
$versionResult = $this->ci->ContentspracheModel->getOne($content_id, $sprache, $version);
|
||||
if (isError($versionResult))
|
||||
return $versionResult;
|
||||
$row = getData($versionResult);
|
||||
|
||||
$contentResult = $this->ci->ContentModel->load($content_id);
|
||||
if (isError($contentResult))
|
||||
return $contentResult;
|
||||
$content = getData($contentResult);
|
||||
if (empty($content))
|
||||
return error($this->ci->p->t('cms', 'contentNichtGefunden'));
|
||||
|
||||
$templateResult = $this->ci->TemplateModel->load($content[0]->template_kurzbz);
|
||||
if (isError($templateResult))
|
||||
return $templateResult;
|
||||
$template = getData($templateResult);
|
||||
if (empty($template))
|
||||
return error($this->ci->p->t('cms', 'keineVorlageVorhanden'));
|
||||
|
||||
$schemaResult = $this->ci->xsdschemalib->parseSchema(
|
||||
$template[0]->xsd, $content[0]->template_kurzbz
|
||||
);
|
||||
if (isError($schemaResult))
|
||||
return $schemaResult;
|
||||
|
||||
$xmlResult = $this->ci->xsdschemalib->buildXml(getData($schemaResult), $values);
|
||||
if (isError($xmlResult))
|
||||
return $xmlResult;
|
||||
|
||||
$updateResult = $this->ci->ContentspracheModel->update(
|
||||
$row->contentsprache_id,
|
||||
['content' => getData($xmlResult)]
|
||||
);
|
||||
if (isError($updateResult))
|
||||
return $updateResult;
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks a version for the current user, or takes over an expired lock.
|
||||
* @param int $contentsprache_id
|
||||
* @return object success(true) or error
|
||||
*/
|
||||
public function lock($contentsprache_id)
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
|
||||
$rowResult = $this->ci->ContentspracheModel->load($contentsprache_id);
|
||||
if (isError($rowResult))
|
||||
return $rowResult;
|
||||
$rowData = getData($rowResult);
|
||||
if (empty($rowData))
|
||||
return error($this->ci->p->t('cms', 'versionNichtGefunden'));
|
||||
|
||||
$holder = ($rowData[0]->gesperrt_uid === '') ? null : $rowData[0]->gesperrt_uid;
|
||||
|
||||
if ($holder !== null && $holder !== $uid)
|
||||
{
|
||||
$openResult = $this->ci->ContentlogModel->getOpenLock($contentsprache_id, $holder);
|
||||
$openEntry = (!isError($openResult)) ? getData($openResult) : null;
|
||||
|
||||
if (!$this->isLockExpired($holder, $openEntry))
|
||||
return error($this->ci->p->t('cms', 'bereitsGesperrt'));
|
||||
}
|
||||
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$this->ci->ContentlogModel->closeOpenEntries($contentsprache_id);
|
||||
|
||||
$logResult = $this->ci->ContentlogModel->insert([
|
||||
'uid' => $uid,
|
||||
'contentsprache_id' => $contentsprache_id,
|
||||
'start' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
if (isError($logResult))
|
||||
return $logResult;
|
||||
|
||||
$updateResult = $this->ci->ContentspracheModel->update($contentsprache_id, [
|
||||
'gesperrt_uid' => $uid
|
||||
]);
|
||||
if (isError($updateResult))
|
||||
return $updateResult;
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'speichernFehlgeschlagen'));
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// legacy released ALL locks of the user. Releasing now ends one lock.
|
||||
// The uid predicate stops a user releasing a lock of somebody else.
|
||||
/**
|
||||
* Releases the lock of the current user on one version.
|
||||
* @param int $contentsprache_id
|
||||
* @return object success(true)
|
||||
*/
|
||||
public function releaseOwnLock($contentsprache_id)
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$this->ci->ContentlogModel->closeOpenEntries($contentsprache_id, $uid);
|
||||
$this->ci->ContentspracheModel->releaseLock($contentsprache_id, $uid);
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'speichernFehlgeschlagen'));
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $contentsprache_id
|
||||
* @return object success(true)
|
||||
*/
|
||||
public function forceRelease($contentsprache_id)
|
||||
{
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$this->ci->ContentlogModel->closeOpenEntries($contentsprache_id);
|
||||
$this->ci->ContentspracheModel->releaseLock($contentsprache_id);
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'speichernFehlgeschlagen'));
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @param string $sprache
|
||||
* @param int $version
|
||||
* @return object success(array) gesperrt_uid, start, expires, own, expired, may_force
|
||||
*/
|
||||
public function getLockState($content_id, $sprache, $version)
|
||||
{
|
||||
$versionResult = $this->ci->ContentspracheModel->getOne($content_id, $sprache, $version);
|
||||
if (isError($versionResult))
|
||||
return $versionResult;
|
||||
$row = getData($versionResult);
|
||||
|
||||
// legacy admin.php inserts an empty string, releasing writes NULL.
|
||||
// this code reports NULL.
|
||||
$gesperrt_uid = ($row->gesperrt_uid === '') ? null : $row->gesperrt_uid;
|
||||
|
||||
$logEntry = null;
|
||||
if ($gesperrt_uid !== null)
|
||||
{
|
||||
$lockResult = $this->ci->ContentlogModel->getOpenLock(
|
||||
$row->contentsprache_id, $gesperrt_uid
|
||||
);
|
||||
$logEntry = (!isError($lockResult)) ? getData($lockResult) : null;
|
||||
}
|
||||
|
||||
return success([
|
||||
'contentsprache_id' => (int) $row->contentsprache_id,
|
||||
'gesperrt_uid' => $gesperrt_uid,
|
||||
'start' => $logEntry ? $logEntry->start : null,
|
||||
'own' => ($gesperrt_uid !== null && $gesperrt_uid === getAuthUID()),
|
||||
'expired' => $this->isLockExpired($gesperrt_uid, $logEntry),
|
||||
'expires' => $this->lockExpiryDate($logEntry),
|
||||
'may_force' => $this->ci->permissionlib->isBerechtigt('basis/cms_sperrfreigabe', 'su')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* End of the lock window, null if the entry carries no start.
|
||||
* @param stdClass|null $logEntry
|
||||
* @return string|null
|
||||
*/
|
||||
private function lockExpiryDate($logEntry)
|
||||
{
|
||||
if ($logEntry === null || empty($logEntry->start))
|
||||
return null;
|
||||
|
||||
$ttlHours = (int) $this->ci->config->item('lock_ttl_hours');
|
||||
|
||||
// lock() writes start with PHP time, so stay on PHP time.
|
||||
return date('Y-m-d H:i:s', strtotime($logEntry->start) + $ttlHours * 3600);
|
||||
}
|
||||
|
||||
// Locks now age out after lock_ttl_hours.
|
||||
/**
|
||||
* A lock without a log entry has no age and counts as expired.
|
||||
* @param string|null $gesperrt_uid
|
||||
* @param stdClass|null $logEntry
|
||||
* @return bool
|
||||
*/
|
||||
private function isLockExpired($gesperrt_uid, $logEntry)
|
||||
{
|
||||
if ($gesperrt_uid === null)
|
||||
return false;
|
||||
|
||||
$expires = $this->lockExpiryDate($logEntry);
|
||||
|
||||
return $expires === null || strtotime($expires) < time();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @return object success(true) or error
|
||||
*/
|
||||
public function deleteContent($content_id)
|
||||
{
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$this->ci->ContentchildModel->deleteByContent($content_id);
|
||||
$this->ci->ContentlogModel->deleteByContent($content_id);
|
||||
$this->ci->ContentspracheModel->deleteByContent($content_id);
|
||||
$this->ci->ContentgruppeModel->deleteByContent($content_id);
|
||||
$this->ci->ContentModel->delete($content_id);
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'loeschenNichtMoeglichReferenzen'));
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $content_id
|
||||
* @param string $sprache
|
||||
* @param int $version
|
||||
* @return object success(true) or error
|
||||
*/
|
||||
public function deleteVersion($content_id, $sprache, $version)
|
||||
{
|
||||
if ($sprache === DEFAULT_LANGUAGE)
|
||||
{
|
||||
$countResult = $this->ci->ContentspracheModel->getNumberOfVersions($content_id, $sprache);
|
||||
if (isError($countResult))
|
||||
return $countResult;
|
||||
if (getData($countResult) === 1)
|
||||
return error($this->ci->p->t('cms', 'letzteVersionNichtLoeschbar'));
|
||||
}
|
||||
|
||||
$versionResult = $this->ci->ContentspracheModel->getOne($content_id, $sprache, $version);
|
||||
if (isError($versionResult))
|
||||
return $versionResult;
|
||||
$row = getData($versionResult);
|
||||
|
||||
$this->ci->db->trans_start();
|
||||
|
||||
$this->ci->ContentlogModel->deleteByContentsprache($row->contentsprache_id);
|
||||
$this->ci->ContentspracheModel->deleteVersion($content_id, $sprache, $version);
|
||||
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
return error($this->ci->p->t('cms', 'loeschenFehlgeschlagen'));
|
||||
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -42,10 +42,12 @@ class CmsLib
|
||||
* @param int $version
|
||||
* @param string $sprache
|
||||
* @param boolean $sichtbar
|
||||
* @param boolean $log false suppresses the click log entry. The CMS admin
|
||||
* preview renders a content without counting a view.
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getContent($content_id, $version = null, $sprache = null, $sichtbar = true)
|
||||
public function getContent($content_id, $version = null, $sprache = null, $sichtbar = true, $log = true)
|
||||
{
|
||||
if (!is_numeric($content_id))
|
||||
return error('ContentID ist ungueltig');
|
||||
@@ -72,7 +74,7 @@ class CmsLib
|
||||
return $content;
|
||||
|
||||
// Legt einen Logeintrag für die Klickstatistik an
|
||||
if (defined('LOG_CONTENT') && LOG_CONTENT) {
|
||||
if ($log && defined('LOG_CONTENT') && LOG_CONTENT) {
|
||||
// Nur eingeloggte User werden geloggt, das sonst auch alle Infoscreenaufrufe und dgl. mitgeloggt werden
|
||||
if (isLogged()) {
|
||||
$request_data = 'content_id=' . $content_id;
|
||||
|
||||
@@ -17,7 +17,12 @@ class LektorLib
|
||||
$this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->_ci->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->_ci->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
|
||||
$this->_ci->load->library('PhrasesLib', array('lehre'));
|
||||
$this->_ci->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
public function addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid)
|
||||
@@ -78,10 +83,13 @@ class LektorLib
|
||||
|
||||
public function updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $new_data)
|
||||
{
|
||||
$old_uid = $mitarbeiter_uid;
|
||||
$new_uid = isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid;
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect('lehre.tbl_lehreinheitmitarbeiter.*, lehre.tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.studiengang_kz');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
$lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid));
|
||||
|
||||
if (isError($lehreinheit_result)) return $lehreinheit_result;
|
||||
|
||||
@@ -89,27 +97,47 @@ class LektorLib
|
||||
|
||||
$lehreinheit = getData($lehreinheit_result)[0];
|
||||
|
||||
$semesterstunden_alt = $lehreinheit->semesterstunden;
|
||||
$semesterstunden_neu = isset($new_data['semesterstunden']) ? $new_data['semesterstunden'] : $semesterstunden_alt;
|
||||
$bismelden_neu = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
|
||||
$neue_stunden_eingerechnet = (bool)$bismelden_neu;
|
||||
$alte_stunden_eingerechnet = (bool)$lehreinheit->bismelden;
|
||||
$stundenplan_update = false;
|
||||
|
||||
//TODO kollision check, wird vorerst nicht implementiert -> nur über das FAS möglich
|
||||
if (isset($new_data['mitarbeiter_uid']) && $new_data['mitarbeiter_uid'] !== $mitarbeiter_uid)
|
||||
if ($old_uid !== $new_uid)
|
||||
{
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
|
||||
if (hasData($verplant))
|
||||
return error($this->_ci->phraseslib->t("lehre", "lektorbereitsverplant"));
|
||||
|
||||
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_data['mitarbeiter_uid'], 'lehreinheit_id' => $lehreinheit_id));
|
||||
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_uid, 'lehreinheit_id' => $lehreinheit_id));
|
||||
|
||||
if (hasData($lehreinheit_data))
|
||||
return error($this->_ci->phraseslib->t("lehre", "bereitzugeteilt"));
|
||||
|
||||
$this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid));
|
||||
|
||||
if (hasData($verplant))
|
||||
{
|
||||
$kollision = $this->hasKollision(getData($verplant), $new_uid);
|
||||
|
||||
$ignore_kollision = $this->_ci->variablelib->getVar('ignore_kollision');
|
||||
|
||||
if ($kollision === false || $ignore_kollision == 'true')
|
||||
{
|
||||
$stundenplan_update = true;
|
||||
}
|
||||
else if (is_array($kollision))
|
||||
{
|
||||
return error( "Änderung fehlgeschlagen! Die Änderung des Lektors führt zu ".count($kollision)." Kollision(en) im LV-Plan. Deaktivieren Sie die Kollisionspruefung oder wenden Sie sich an die LV-Planung!\n zB. $kollision[0]");
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($kollision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$warning = '';
|
||||
if (isset($new_data['semesterstunden']))
|
||||
if (($semesterstunden_neu !== '' && $semesterstunden_alt !== '') && (($semesterstunden_neu > $semesterstunden_alt) || $neue_stunden_eingerechnet))
|
||||
{
|
||||
$studiengang_result = $this->_ci->StudiengangModel->loadWhere(array('studiengang_kz' => $lehreinheit->studiengang_kz));
|
||||
if (isError($studiengang_result)) return $studiengang_result;
|
||||
@@ -120,7 +148,7 @@ class LektorLib
|
||||
if (isError($studiensemester_result)) return $studiensemester_result;
|
||||
$studiensemester = getData($studiensemester_result)[0];
|
||||
|
||||
$echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
|
||||
$echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($new_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
|
||||
|
||||
$echter_dv = false;
|
||||
|
||||
@@ -129,83 +157,81 @@ class LektorLib
|
||||
$echter_dv = true;
|
||||
}
|
||||
|
||||
$neue_stunden_eingerechnet = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
|
||||
$alte_stunden_eingerechnet = $lehreinheit->bismelden;
|
||||
$stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
|
||||
if (isError($stundengrenze_result)) return $stundengrenze_result;
|
||||
|
||||
if (($new_data['semesterstunden'] > $lehreinheit->semesterstunden) || $neue_stunden_eingerechnet)
|
||||
$stundengrenze = getData($stundengrenze_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array();
|
||||
|
||||
$semesterstunden_alt_sql = is_null($semesterstunden_alt) ? 0 : $semesterstunden_alt;
|
||||
$semesterstunden_neu_sql = is_null($semesterstunden_neu) ? 0 : $semesterstunden_neu;
|
||||
|
||||
if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($semesterstunden_alt_sql) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($semesterstunden_neu_sql)}) as summe");
|
||||
else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($semesterstunden_alt_sql)) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($semesterstunden_neu_sql)})) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', $new_uid);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
|
||||
|
||||
if (count($oe_array) > 0)
|
||||
{
|
||||
$stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
|
||||
if (isError($stundengrenze_result)) return $stundengrenze_result;
|
||||
|
||||
$stundengrenze = getData($stundengrenze_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array('');
|
||||
|
||||
if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])}) as summe");
|
||||
else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden)) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])})) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', (isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid));
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_in('tbl_studiengang.oe_kurzbz', $oe_array);
|
||||
}
|
||||
|
||||
if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
|
||||
&& is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
|
||||
&& count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
|
||||
{
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
|
||||
}
|
||||
|
||||
if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
|
||||
&& is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
|
||||
&& count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
|
||||
$summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
|
||||
if (isError($summe_result)) return $summe_result;
|
||||
|
||||
if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
|
||||
|
||||
$summe = getData($summe_result)[0]->summe;
|
||||
|
||||
if ($summe > $stundengrenze->stunden)
|
||||
{
|
||||
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
|
||||
{
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
|
||||
if (!$this->LehrauftragAufFirma($new_uid))
|
||||
return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
|
||||
}
|
||||
|
||||
$summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
$stunden_limit_result = $this->getStundenInstitut($new_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
|
||||
|
||||
if (isError($summe_result)) return $summe_result;
|
||||
|
||||
if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
|
||||
|
||||
$summe = getData($summe_result)[0]->summe;
|
||||
|
||||
if ($summe > $stundengrenze->stunden)
|
||||
if (hasData($stunden_limit_result))
|
||||
{
|
||||
|
||||
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
|
||||
$stunden_limit_array = getData($stunden_limit_result);
|
||||
foreach ($stunden_limit_array as $stunden_limit)
|
||||
{
|
||||
if (!$this->LehrauftragAufFirma(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid))
|
||||
return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
|
||||
}
|
||||
|
||||
$stunden_limit_result = $this->getStundenInstitut($mitarbeiter_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
|
||||
|
||||
if (hasData($stunden_limit_result))
|
||||
{
|
||||
$stunden_limit_array = getData($stunden_limit_result);
|
||||
foreach ($stunden_limit_array as $stunden_limit)
|
||||
{
|
||||
$warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
|
||||
}
|
||||
$warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$benutzer_result = $this->_ci->BenutzerModel->load(array(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid));
|
||||
$benutzer_result = $this->_ci->BenutzerModel->load(array($new_uid));
|
||||
|
||||
if (isError($benutzer_result)) return $benutzer_result;
|
||||
|
||||
@@ -227,12 +253,23 @@ class LektorLib
|
||||
'bismelden'
|
||||
);
|
||||
|
||||
$nullable_fields = array('stundensatz', 'semesterstunden', 'planstunden');
|
||||
|
||||
$updateData = array();
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
$value = isset($new_data[$field]) ? $new_data[$field] : null;
|
||||
if (!array_key_exists($field, $new_data))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($value !== null)
|
||||
$value = $new_data[$field];
|
||||
|
||||
if (in_array($field, $nullable_fields))
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
elseif ($value !== null)
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
@@ -240,10 +277,24 @@ class LektorLib
|
||||
$updateData['updatevon'] = getAuthUID();
|
||||
$updateData['updateamum'] = date('Y-m-d H:i:s');
|
||||
|
||||
$result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid), $updateData);
|
||||
$result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid), $updateData);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if ($stundenplan_update)
|
||||
{
|
||||
$update_result = $this->_ci->StundenplandevModel->update([
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'mitarbeiter_uid' => $old_uid,
|
||||
], [
|
||||
'mitarbeiter_uid' => $new_uid,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => getAuthUID()
|
||||
]);
|
||||
|
||||
if (isError($update_result)) return $update_result;
|
||||
}
|
||||
|
||||
if ($warning !== '') return success(['warning' => $warning]);
|
||||
|
||||
return success('Erfolgreich geupdated');
|
||||
@@ -347,4 +398,52 @@ class LektorLib
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addGroupBy('tbl_studiengang.bezeichnung');
|
||||
return $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
}
|
||||
|
||||
private function hasKollision($stunden, $mitarbeiter)
|
||||
{
|
||||
$kollision = array();
|
||||
|
||||
$ignore_zeitsperre = $this->_ci->variablelib->getVar('ignore_zeitsperre');
|
||||
$ignore_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung');
|
||||
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$stundenplan_result = $this->_ci->StundenplandevModel->lektorHasStundenplandevEintrag($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (isError($stundenplan_result))
|
||||
return $stundenplan_result;
|
||||
|
||||
if (hasData($stundenplan_result))
|
||||
{
|
||||
$stundenplan_result = getData($stundenplan_result)[0];
|
||||
$kollision[] = "Kollision stundenplandev: $stundenplan_result->stundenplandev_id|$stundenplan_result->lektor|$stundenplan_result->ort_kurzbz|$stundenplan_result->stg_kurzbz-$stundenplan_result->semester$stundenplan_result->verband$stundenplan_result->gruppe$stundenplan_result->gruppe_kurzbz - $stundenplan_result->datum/$stundenplan_result->stunde";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($ignore_zeitsperre == 'false' && (!defined('KOLLISIONSFREIE_USER') || !in_array($mitarbeiter, unserialize(KOLLISIONSFREIE_USER))))
|
||||
{
|
||||
$zeitsperre_result = $this->_ci->ZeitsperreModel->checkIfZeitsperreExists($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (hasData($zeitsperre_result))
|
||||
{
|
||||
$zeitsperre_result = getData($zeitsperre_result)[0];
|
||||
$kollision[] = "Kollision (Zeitsperre): $zeitsperre_result->zeitsperre_id|$zeitsperre_result->mitarbeiter_uid|$zeitsperre_result->zeitsperretyp_kurzbz - $zeitsperre_result->vondatum/$zeitsperre_result->vonstunde|$zeitsperre_result->bisdatum/$zeitsperre_result->bisstunde";
|
||||
}
|
||||
}
|
||||
|
||||
if ($ignore_reservierung == 'false' && (!defined('KOLLISIONSFREIE_USER') || !in_array($mitarbeiter, unserialize(KOLLISIONSFREIE_USER))))
|
||||
{
|
||||
$reservierung_result = $this->_ci->ReservierungModel->lektorHasReservierung($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (hasData($reservierung_result))
|
||||
{
|
||||
$reservierung_result = getData($reservierung_result)[0];
|
||||
$kollision[] = "Kollision (Reservierung): $reservierung_result->reservierung_id|$reservierung_result->uid|$reservierung_result->ort_kurzbz|$reservierung_result->stg_kurzbz-$reservierung_result->semester$reservierung_result->verband$reservierung_result->gruppe$reservierung_result->gruppe_kurzbz - $reservierung_result->datum/$reservierung_result->stunde";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isEmptyArray($kollision) ? false : $kollision;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,6 +263,59 @@ class ProfilLib{
|
||||
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
|
||||
return $element;
|
||||
}, $mailverteiler_res);
|
||||
|
||||
$this->ci->load->model("crm/Student_model", "StudentModel");
|
||||
$this->ci->StudentModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_student.student_uid");
|
||||
$this->ci->StudentModel->addJoin("tbl_person", "tbl_benutzer.person_id = tbl_person.person_id");
|
||||
$this->ci->StudentModel->addJoin("tbl_studiengang", "tbl_student.studiengang_kz = tbl_studiengang.studiengang_kz");
|
||||
$this->ci->StudentModel->addSelect("matr_nr, semester, verband, gruppe, kurzbzlang");
|
||||
|
||||
$studentResult = $this->ci->StudentModel->loadWhere(["student_uid" => $uid]);
|
||||
if (isError($studentResult)) {
|
||||
return error(getData($studentResult));
|
||||
}
|
||||
|
||||
$studentResultData = getData($studentResult);
|
||||
$studentData = null;
|
||||
if (is_array($studentResultData) && count($studentResultData)) {
|
||||
$studentData = $studentResultData[0];
|
||||
}
|
||||
|
||||
if ($studentData && $studentData->matr_nr) {
|
||||
$this->ci->load->library("phrasesLib", ["profil"], "phrases");
|
||||
$standardCourseVerteiler = trim($studentData->kurzbzlang) . "_STD";
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $standardCourseVerteiler,
|
||||
"gruppe_kurzbz" => $standardCourseVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($standardCourseVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
|
||||
$semesterVerteiler = trim($studentData->kurzbzlang) . trim($studentData->semester);
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $semesterVerteiler,
|
||||
"gruppe_kurzbz" => $semesterVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($semesterVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
|
||||
if ($studentData->verband && strlen(trim($studentData->verband))) {
|
||||
$verbandVerteiler = $semesterVerteiler . trim($studentData->verband);
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $verbandVerteiler,
|
||||
"gruppe_kurzbz" => $verbandVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($verbandVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
|
||||
if ($studentData->gruppe && strlen(trim($studentData->gruppe))) {
|
||||
$gruppeVerteiler = $verbandVerteiler . trim($studentData->gruppe);
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $gruppeVerteiler,
|
||||
"gruppe_kurzbz" => $gruppeVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($gruppeVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $mailverteiler_res;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,16 @@ class StundenplanLib
|
||||
* @return stdClass
|
||||
* @access public
|
||||
*/
|
||||
public function getEventsUser($start, $end)
|
||||
public function getEventsUser($start, $end, $uid = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$uid = getAuthUID();
|
||||
if (!$uid) {
|
||||
$uid = getAuthUID();
|
||||
}
|
||||
|
||||
if (is_null($uid))
|
||||
return error("No UID");
|
||||
|
||||
@@ -77,10 +80,12 @@ class StundenplanLib
|
||||
if (isError($semester_range))
|
||||
return $semester_range;
|
||||
$semester_range = getData($semester_range);
|
||||
$this->_ci->addMeta('semester_range', $semester_range);
|
||||
|
||||
$this->sortStudienSemester($semester_range);
|
||||
|
||||
$function_error = $this->applyLoadUeberSemesterHaelfte($semester_range);
|
||||
$this->_ci->addMeta('nach_apply_semester_range', $semester_range);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
|
||||
@@ -89,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,
|
||||
@@ -181,6 +186,21 @@ class StundenplanLib
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getEventsByLE($lehreinheit_id, $start, $end, $stundenplan)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
return $this->_ci->StundenplanModel->getStundenplanLE($lehreinheit_id, $start, $end, $stundenplan);
|
||||
}
|
||||
|
||||
public function getEventsByLV($lehrveranstaltung_id, $start, $end, $stundenplan)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
return $this->_ci->StundenplanModel->getStundenplanLV($lehrveranstaltung_id, $start, $end, $stundenplan);
|
||||
}
|
||||
/**
|
||||
* Get stundenplan for a room
|
||||
*
|
||||
@@ -217,7 +237,7 @@ class StundenplanLib
|
||||
* @param string $ort_kurzbz
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = '')
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = '', $uid = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
@@ -228,14 +248,14 @@ class StundenplanLib
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter($uid ?? getAuthUID()));
|
||||
|
||||
if ($is_mitarbeiter && empty($ort_kurzbz)) {
|
||||
// request for personal lvplan show only reservations of logged in user
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date);
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $uid);
|
||||
} else {
|
||||
// querying the reservierungen
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz, $uid);
|
||||
}
|
||||
|
||||
if (isError($reservierungen))
|
||||
@@ -357,7 +377,10 @@ class StundenplanLib
|
||||
if (isError($ort_content_object)) {
|
||||
return error(getData($ort_content_object));
|
||||
}
|
||||
$ort_content_object = getData($ort_content_object)[0];
|
||||
$ort_content_object_data = getData($ort_content_object);
|
||||
$ort_content_object = (is_array($ort_content_object_data) && count($ort_content_object_data) > 0)
|
||||
? $ort_content_object_data[0]
|
||||
: null;
|
||||
if($ort_content_object) {
|
||||
$item->ort_content_id = $ort_content_object->content_id;
|
||||
}
|
||||
@@ -445,6 +468,24 @@ class StundenplanLib
|
||||
return success($ferienEventsFlattened);
|
||||
}
|
||||
|
||||
public function getEventsStgOrg( $start, $end, $stg_kz, $sem, $verband, $gruppe)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
$stundenplan_data = $this->_ci->StundenplanModel->getStundenplanStudiengang($start, $end, $stg_kz, $sem, $verband, $gruppe);
|
||||
if (isError($stundenplan_data))
|
||||
return $stundenplan_data;
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
|
||||
$function_error = $this->expandObjectInformation($stundenplan_data);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
// start of the private functions ########################################################################################################
|
||||
|
||||
// function used to sort an array of studiensemester strings
|
||||
@@ -591,6 +632,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);
|
||||
@@ -760,7 +802,8 @@ class StundenplanLib
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// gets all studiensemester from the student from start_date to end_date
|
||||
$semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date, $end_date);
|
||||
//$semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date, $end_date);
|
||||
$semester_range = $this->_ci->StudiensemesterModel->getContainingOrNearestByDateRange($start_date, $end_date);
|
||||
if (isError($semester_range))
|
||||
return $semester_range;
|
||||
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2026 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use \stdClass as stdClass;
|
||||
|
||||
class TagLib
|
||||
{
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Configs
|
||||
$this->_ci->load->config('stv');
|
||||
|
||||
// Models
|
||||
$this->_ci->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->_ci->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
$this->_ci->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
$this->_ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// Libraries
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$this->_ci->load->library('PrestudentLib');
|
||||
|
||||
$this->batchUser = $this->_ci->config->item('userAutomatedTags');
|
||||
}
|
||||
|
||||
public function updateAutomatedTags($paramsTag)
|
||||
{
|
||||
// ---------------------------------
|
||||
// check params
|
||||
// ---------------------------------
|
||||
$required = ['kurzbz', 'data', 'typeId'];
|
||||
|
||||
foreach ($required as $key) {
|
||||
if (!isset($paramsTag[$key])) {
|
||||
return error('Missing Parameter: ' . $key);
|
||||
}
|
||||
}
|
||||
|
||||
$studiensemester_kurzbz = (isset ($paramsTag['studiensemester_kurzbz']) ? $paramsTag['studiensemester_kurzbz'] : null);
|
||||
$tag = $paramsTag['kurzbz'];
|
||||
$inputData = $paramsTag['data'];
|
||||
$typeId = $paramsTag['typeId'];
|
||||
|
||||
// ---------------------------------
|
||||
// prepare input
|
||||
// ---------------------------------
|
||||
$zeitraum = [];
|
||||
$arrayIds = [];
|
||||
|
||||
foreach ($inputData as $item) {
|
||||
$id = $item['id'];
|
||||
$arrayIds[] = $id;
|
||||
|
||||
$zeitraum[$id] = [
|
||||
'von' => $item['von'] ?? null,
|
||||
'bis' => $item['bis'] ?? null
|
||||
];
|
||||
}
|
||||
$arrayIds = array_unique($arrayIds);
|
||||
|
||||
$result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
$data = $result->retval[0] ?? null;
|
||||
|
||||
$von = $data->start ?? null;
|
||||
$bis = $data->ende ?? null;
|
||||
|
||||
// ---------------------------------
|
||||
// load existing tags
|
||||
// ---------------------------------
|
||||
$allTags = [];
|
||||
$resultAllTags = $this->_ci->NotizModel->getAllTags($tag, $von, $bis);
|
||||
if (isError($resultAllTags)) {
|
||||
return $resultAllTags;
|
||||
}
|
||||
$allTagsData = getData($resultAllTags);
|
||||
|
||||
if (!empty($allTagsData)) {
|
||||
foreach ($allTagsData as $item) {
|
||||
$allTags[$item->$typeId] = $item->notiz_id;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// map the data
|
||||
// ---------------------------------
|
||||
$toRecycle = [];
|
||||
$toAdd = [];
|
||||
$toDelete = [];
|
||||
|
||||
foreach ($arrayIds as $id) {
|
||||
if (isset($allTags[$id])) {
|
||||
$toRecycle[$id] = $allTags[$id];
|
||||
} else {
|
||||
$toAdd[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($allTags as $id => $notizId) {
|
||||
if (!in_array($id, $arrayIds)) {
|
||||
$toDelete[$id] = $notizId;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// recycle (update existing)
|
||||
// ---------------------------------
|
||||
$countRecycled = 0;
|
||||
$retagged = [];
|
||||
|
||||
foreach ($toRecycle as $id => $notizId)
|
||||
{
|
||||
$this->_updateTag($notizId, $zeitraum[$id]['von'], $zeitraum[$id]['bis']);
|
||||
|
||||
$countRecycled++;
|
||||
$retagged[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// ADD
|
||||
// ---------------------------------
|
||||
$countAdded = 0;
|
||||
$tagged = [];
|
||||
|
||||
foreach ($toAdd as $id)
|
||||
{
|
||||
$this->_insertTag($typeId, $id, $tag, $zeitraum[$id]['von'], $zeitraum[$id]['bis']);
|
||||
$countAdded++;
|
||||
|
||||
$tagged[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// delete
|
||||
// ---------------------------------
|
||||
$countDeleted = 0;
|
||||
$deleted = [];
|
||||
|
||||
foreach ($toDelete as $id => $notizId)
|
||||
{
|
||||
$result = $this->_deleteTag($notizId);
|
||||
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$countDeleted++;
|
||||
$deleted[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// return
|
||||
// ---------------------------------
|
||||
return success([
|
||||
'input' => [
|
||||
'tag' => $tag,
|
||||
'arrayIds' => $arrayIds
|
||||
],
|
||||
'summary' => [
|
||||
'recycled' => $countRecycled,
|
||||
'added' => $countAdded,
|
||||
'deleted' => $countDeleted
|
||||
],
|
||||
'details' => [
|
||||
'existingTags' => $allTags,
|
||||
'toAdd' => $toAdd,
|
||||
'toRecycle' => $toRecycle,
|
||||
'toDelete' => $toDelete
|
||||
],
|
||||
'results' => [
|
||||
'retaggedIds' => $retagged,
|
||||
'newTags' => $tagged,
|
||||
'deletedTagsIds' => $deleted
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAutomatedTagsForTypeId(array $params)
|
||||
{
|
||||
$return = null;
|
||||
$notiz_id = null;
|
||||
|
||||
$von = $params['von'];
|
||||
$bis = $params['bis'];
|
||||
$tag = $params['kurzbz'];
|
||||
$id = $params['id'];
|
||||
$typeId = $params['typeId'];
|
||||
|
||||
$this->_ci->NotizModel->addSelect('nz.notiz_id');
|
||||
$this->_ci->NotizModel->addSelect($typeId);
|
||||
$this->_ci->NotizModel->addJoin('public.tbl_notizzuordnung nz', 'notiz_id');
|
||||
$resultAllTags = $this->_ci->NotizModel->loadWhere([
|
||||
'typ' => $tag,
|
||||
$typeId => $id
|
||||
]);
|
||||
if(hasData($resultAllTags))
|
||||
{
|
||||
$notiz_id = $resultAllTags->retval[0]->notiz_id;
|
||||
}
|
||||
|
||||
//RECYCLE
|
||||
if ($notiz_id !== null)
|
||||
{
|
||||
$resultUpdateNotiz = $this->_updateTag($notiz_id, $von, $bis);
|
||||
$return = ['recycled' => $resultUpdateNotiz];
|
||||
}
|
||||
else
|
||||
//ADD
|
||||
{
|
||||
$resultInsertNotiz = $this->_insertTag($typeId, $id, $tag, $von, $bis);
|
||||
$return = ['added' => $resultInsertNotiz];
|
||||
}
|
||||
return success($return);
|
||||
}
|
||||
|
||||
/*
|
||||
* main function for rebuild Tags for typeId
|
||||
* */
|
||||
public function rebuildTagsForTypeId($typeId, $id, $studiensemester_kurzbz)
|
||||
{
|
||||
$automatedTagsRes = $this->_ci->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
|
||||
$result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return error('Error occurred during retrieving studiensemester');
|
||||
if (empty($result->retval) || !isset($result->retval[0])) {
|
||||
return error('No studiensemester found');
|
||||
}
|
||||
|
||||
$startSem = $result->retval[0]->start ?? null;
|
||||
$endeSem = $result->retval[0]->ende ?? null;
|
||||
$return = [];
|
||||
|
||||
foreach ($automatedTags as $autoTag)
|
||||
{
|
||||
// getPath: must not be lost
|
||||
$filePath = APPPATH . 'libraries/' . $autoTag->taglib . '.php'; // APPPATH = application/
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
require_once($filePath);
|
||||
} else {
|
||||
echo "File not found: " . $filePath;
|
||||
continue;
|
||||
}
|
||||
|
||||
$className = basename($autoTag->taglib);
|
||||
$kurz_bz = $autoTag->typ_kurzbz;
|
||||
|
||||
$obj = new $className();
|
||||
|
||||
$criteriaIsSet = $obj->isCriteriaSetFor([
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
if (hasData($criteriaIsSet))
|
||||
{
|
||||
$von = isset($criteriaIsSet->retval[0]->von) ? $criteriaIsSet->retval[0]->von : '';
|
||||
$bis = isset($criteriaIsSet->retval[0]->bis) ? $criteriaIsSet->retval[0]->bis : '';
|
||||
|
||||
$params = [
|
||||
'von' => $von,
|
||||
'bis' => $bis,
|
||||
'kurzbz' => $autoTag->typ_kurzbz,
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
];
|
||||
|
||||
$result = $this->updateAutomatedTagsForTypeId($params);
|
||||
if (isError($result))
|
||||
return error('Error occurred during updateAutomatedTags' . $kurz_bz);
|
||||
|
||||
$return[$kurz_bz] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
//CHECK FOR DELETE
|
||||
$params = [
|
||||
'von' => $startSem,
|
||||
'bis' => $endeSem,
|
||||
'kurzbz' => $autoTag->typ_kurzbz,
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
];
|
||||
$result = $this->_ci->NotizModel->checkIfExistingTag($kurz_bz, $typeId, $id, $startSem, $endeSem);
|
||||
if (hasData($result))
|
||||
{
|
||||
$notizId = $result->retval[0]->notiz_id;
|
||||
$this->_deleteTag($notizId);
|
||||
$return[$kurz_bz] = ['deleted' => $notizId];
|
||||
}
|
||||
}
|
||||
}
|
||||
return success($return);
|
||||
}
|
||||
|
||||
private function _insertTag($typeId, $id, $tag, $von, $bis)
|
||||
{
|
||||
$resultInsert = $this->_ci->NotizModel->insert([
|
||||
'titel' => 'TAG',
|
||||
'text' => 'AUTOMATED TAG',
|
||||
'verfasser_uid' => $this->batchUser,
|
||||
'erledigt' => false,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => 'BatchJobTagAdd',
|
||||
'typ' => $tag,
|
||||
'start' => $von,
|
||||
'ende' => $bis
|
||||
]);
|
||||
|
||||
if (isError($resultInsert)) {
|
||||
return error('Error inserting tag for ' . $typeId . ': ' . $id);
|
||||
}
|
||||
|
||||
$notizId = $resultInsert->retval;
|
||||
|
||||
$resultZuordnung = $this->_ci->NotizzuordnungModel->insert([
|
||||
'notiz_id' => $notizId,
|
||||
$typeId => $id
|
||||
]);
|
||||
|
||||
if (isError($resultZuordnung)) {
|
||||
return error('Error inserting relation for ' . $typeId . ': ' . $id);
|
||||
}
|
||||
|
||||
return $notizId;
|
||||
}
|
||||
|
||||
private function _updateTag($notiz_id, $von, $bis)
|
||||
{
|
||||
$resultUpdateNotiz = $this->_ci->NotizModel->update(
|
||||
[
|
||||
'notiz_id' => $notiz_id
|
||||
],
|
||||
array(
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => 'BatchJobTagUpdate',
|
||||
'start' => $von,
|
||||
'ende' => $bis
|
||||
));
|
||||
|
||||
|
||||
if (isError($resultUpdateNotiz))
|
||||
return error ('Error occurred during Update ' . $notiz_id);
|
||||
|
||||
return $notiz_id;
|
||||
}
|
||||
|
||||
private function _deleteTag($notiz_id)
|
||||
{
|
||||
$result = $this->_ci->NotizzuordnungModel->delete([
|
||||
'notiz_id' => $notiz_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return error('Error occurred during delete Notizzuordnung ' . $notiz_id);
|
||||
}
|
||||
|
||||
$result = $this->_ci->NotizModel->delete([
|
||||
'notiz_id' => $notiz_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return error('Error occurred during delete Notiz ' . $notiz_id);
|
||||
}
|
||||
|
||||
return success([
|
||||
'deleted' => $notiz_id
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
use \DOMDocument as DOMDocument;
|
||||
|
||||
class XsdSchemaLib
|
||||
{
|
||||
private $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an XSD into a field schema.
|
||||
* @param string $xsd the XSD as a string
|
||||
* @param string $templateKurzbz short name of the template
|
||||
* @return object success(array) with template_kurzbz, root, fields
|
||||
*/
|
||||
public function parseSchema($xsd, $templateKurzbz)
|
||||
{
|
||||
libxml_use_internal_errors(true);
|
||||
$dom = new DOMDocument();
|
||||
|
||||
if (!$dom->loadXML($xsd))
|
||||
{
|
||||
libxml_clear_errors();
|
||||
return error($this->ci->p->t('cms', 'xsdUngueltig'));
|
||||
}
|
||||
|
||||
libxml_clear_errors();
|
||||
|
||||
$root = null;
|
||||
$fields = array();
|
||||
$this->_walkElements($dom->documentElement, $root, $fields);
|
||||
|
||||
return success(array(
|
||||
'template_kurzbz' => $templateKurzbz,
|
||||
'root' => $root,
|
||||
'fields' => $fields
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the values of a content from the XML.
|
||||
* @param string $xml the value of tbl_contentsprache.content
|
||||
* @param array $schema the result of parseSchema
|
||||
* @return object success(array) field name => value
|
||||
*/
|
||||
public function extractValues($xml, $schema)
|
||||
{
|
||||
$values = array();
|
||||
|
||||
foreach ($schema['fields'] as $field)
|
||||
{
|
||||
$values[$field['name']] = '';
|
||||
}
|
||||
|
||||
if ($xml === null || trim($xml) === '')
|
||||
{
|
||||
return success($values);
|
||||
}
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
$dom = new DOMDocument();
|
||||
|
||||
if (!$dom->loadXML($xml))
|
||||
{
|
||||
libxml_clear_errors();
|
||||
return success($values);
|
||||
}
|
||||
|
||||
libxml_clear_errors();
|
||||
|
||||
foreach ($schema['fields'] as $field)
|
||||
{
|
||||
$nodes = $dom->getElementsByTagName($field['name']);
|
||||
if ($nodes->length > 0)
|
||||
{
|
||||
$values[$field['name']] = $nodes->item(0)->nodeValue;
|
||||
}
|
||||
}
|
||||
|
||||
return success($values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the XML from the values.
|
||||
* @param array $schema the result of parseSchema
|
||||
* @param array $values field name => value
|
||||
* @return object success(string) the XML
|
||||
*/
|
||||
public function buildXml($schema, $values)
|
||||
{
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
|
||||
$xml .= "\n<" . $schema['root'] . '>';
|
||||
|
||||
foreach ($schema['fields'] as $field)
|
||||
{
|
||||
$value = isset($values[$field['name']]) ? $values[$field['name']] : '';
|
||||
$xml .= "\n<" . $field['name'] . '><![CDATA[' . $this->_escapeCdata($value) . ']]></' . $field['name'] . '>';
|
||||
}
|
||||
|
||||
$xml .= "\n</" . $schema['root'] . '>';
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
$check = new DOMDocument();
|
||||
|
||||
if (!$check->loadXML($xml))
|
||||
{
|
||||
libxml_clear_errors();
|
||||
return error($this->ci->p->t('cms', 'xmlUngueltig'));
|
||||
}
|
||||
|
||||
libxml_clear_errors();
|
||||
|
||||
return success($xml);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Walks xs:element nodes recursively.
|
||||
* The first element without a type attribute is the root.
|
||||
* Elements with a type attribute are fields.
|
||||
* xs:complexType and xs:sequence are traversed and ignored.
|
||||
*/
|
||||
private function _walkElements($node, &$root, &$fields)
|
||||
{
|
||||
if ($node->nodeType !== XML_ELEMENT_NODE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$localName = $node->localName;
|
||||
|
||||
if ($localName === 'element')
|
||||
{
|
||||
$typeAttr = $node->getAttribute('type');
|
||||
|
||||
if ($typeAttr === '')
|
||||
{
|
||||
if ($root === null)
|
||||
{
|
||||
$root = $node->getAttribute('name');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$minOccurs = $node->getAttribute('minOccurs');
|
||||
$required = ($minOccurs === '') ? true : ((int)$minOccurs > 0);
|
||||
|
||||
$fields[] = array(
|
||||
'name' => $node->getAttribute('name'),
|
||||
'type' => $this->_mapType($typeAttr),
|
||||
'required' => $required
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($node->childNodes as $child)
|
||||
{
|
||||
$this->_walkElements($child, $root, $fields);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps an XSD type to the field schema type.
|
||||
*/
|
||||
private function _mapType($xsdType)
|
||||
{
|
||||
$map = array(
|
||||
'xs:string' => 'string',
|
||||
'xs:decimal' => 'string',
|
||||
'xs:integer' => 'string',
|
||||
'xs:positiveInteger' => 'string',
|
||||
'xs:date' => 'date',
|
||||
'wysiwyg' => 'wysiwyg',
|
||||
'file' => 'file',
|
||||
'boolean' => 'boolean'
|
||||
);
|
||||
|
||||
return isset($map[$xsdType]) ? $map[$xsdType] : 'string';
|
||||
}
|
||||
|
||||
// Escapes ]]> in the value. The legacy code does not do this and writes broken XML.
|
||||
private function _escapeCdata($value)
|
||||
{
|
||||
return str_replace(']]>', ']]]]><![CDATA[>', $value);
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,9 @@ class DashboardLib
|
||||
|
||||
public function getDashboardByKurzbz($dashboard_kurzbz)
|
||||
{
|
||||
$result = $this->_ci->DashboardModel->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
$result = $this->_ci->DashboardModel->loadWhere([
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz
|
||||
]);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -47,17 +49,21 @@ class DashboardLib
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getMergedConfig($dashboard_id, $uid)
|
||||
public function getMergedUserConfig($dashboard_id, $uid)
|
||||
{
|
||||
$defaultconfig = $this->getDefaultConfig($dashboard_id);
|
||||
$userconfig = $this->getUserConfig($dashboard_id, $uid);
|
||||
$defaultconfig = $this->getUserBaseConfig($dashboard_id);
|
||||
$userconfig = $this->getUserOverrideConfig($dashboard_id, $uid);
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig, $userconfig);
|
||||
$sourceconfig = array_map(function ($value) {
|
||||
return ['source' => $value['source']];
|
||||
}, $defaultconfig);
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig, $userconfig, $sourceconfig);
|
||||
|
||||
return $mergedconfig;
|
||||
}
|
||||
|
||||
public function getDefaultConfig($dashboard_id)
|
||||
protected function getUserBaseConfig($dashboard_id)
|
||||
{
|
||||
$funktion_kurzbzs = [];
|
||||
$rights = $this->_ci->permissionlib->getAccessRights();
|
||||
@@ -87,7 +93,11 @@ class DashboardLib
|
||||
$preset = json_decode($presetobj->preset, true);
|
||||
if (null !== $preset)
|
||||
{
|
||||
$defaultconfig = array_replace_recursive($defaultconfig, $preset);
|
||||
$preset = array_map(function ($value) use ($presetobj) {
|
||||
$value['source'] = $presetobj->funktion_kurzbz ?: self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
return $value;
|
||||
}, $preset);
|
||||
$defaultconfig = array_merge_recursive($defaultconfig, $preset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,7 +105,7 @@ class DashboardLib
|
||||
return $defaultconfig;
|
||||
}
|
||||
|
||||
public function getUserConfig($dashboard_id, $uid)
|
||||
protected function getUserOverrideConfig($dashboard_id, $uid)
|
||||
{
|
||||
$res_userconfig = $this->_ci->DashboardOverrideModel->getOverride($dashboard_id, $uid);
|
||||
|
||||
@@ -124,7 +134,7 @@ class DashboardLib
|
||||
$emptyoverride = new stdClass();
|
||||
$emptyoverride->dashboard_id = $dashboard->dashboard_id;
|
||||
$emptyoverride->uid = $uid;
|
||||
$emptyoverride->override = '{"' . self::USEROVERRIDE_SECTION . '": {"widgets":{}}, "custom": { "widgets" : {}}}';
|
||||
$emptyoverride->override = '[]';
|
||||
|
||||
return $emptyoverride;
|
||||
}
|
||||
@@ -143,8 +153,7 @@ class DashboardLib
|
||||
$emptypreset = new stdClass();
|
||||
$emptypreset->dashboard_id = $dashboard->dashboard_id;
|
||||
$emptypreset->funktion_kurzbz = $funktion_kurzbz;
|
||||
$section = ($funktion_kurzbz !== null) ? $funktion_kurzbz : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
$emptypreset->preset = '{"' . $section . '": { "widgets" : {}},"custom": { "widgets" : {}}}';
|
||||
$emptypreset->preset = '[]';
|
||||
|
||||
return $emptypreset;
|
||||
}
|
||||
@@ -209,44 +218,4 @@ class DashboardLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function addWidgetsToWidgets(&$widgets, $dashboard_kurzbz, $section, $addwigets)
|
||||
{
|
||||
foreach ($addwigets as $widget)
|
||||
{
|
||||
if(!isset($widget['widgetid']))
|
||||
{
|
||||
$widget['widgetid'] = $this->generateWidgetId($dashboard_kurzbz);
|
||||
}
|
||||
$this->addWidgetToWidgets($widgets, $section, $widget, $widget['widgetid']);
|
||||
}
|
||||
}
|
||||
|
||||
public function addWidgetToWidgets(&$widgets, $section, $widget, $widgetid)
|
||||
{
|
||||
$section = ($section !== null) ? $section : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
if (!isset($widgets[$section]) || !isset($widgets[$section]["widgets"]) || !is_array($widgets[$section]))
|
||||
{
|
||||
$widgets[$section] = array();
|
||||
$widgets[$section]["widgets"] = array();
|
||||
}
|
||||
|
||||
$widgets[$section]["widgets"][$widgetid] = $widget;
|
||||
}
|
||||
|
||||
public function removeWidgetFromWidgets(&$widgets, $section, $widgetid)
|
||||
{
|
||||
$section = ($section !== null) ? $section : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
if (isset($widgets[$section]) && isset($widgets[$section]["widgets"][$widgetid]))
|
||||
{
|
||||
unset($widgets[$section]["widgets"][$widgetid]);
|
||||
if(empty($widgets[$section]["widgets"]) && $section !== self::USEROVERRIDE_SECTION) {
|
||||
unset($widgets[$section]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user